You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
203 lines
1.1 MiB
203 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[210,5,7,8,13],{"+NIl":function(rt,Be,H){(function(oe){oe(H("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(V,I){"use strict";function K(f,a){f.cmdState.push(a)}function L(f){return f.cmdState.length>0?f.cmdState[f.cmdState.length-1]:null}function N(f){var a=f.cmdState.pop();a&&a.closeBracket()}function W(f){for(var a=f.cmdState,d=a.length-1;d>=0;d--){var l=a[d];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function F(f,a,d){return function(){this.name=f,this.bracketNo=0,this.style=a,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 R={};R.importmodule=F("importmodule","tag",["string","builtin"]),R.documentclass=F("documentclass","tag",["","atom"]),R.usepackage=F("usepackage","tag",["atom"]),R.begin=F("begin","tag",["atom"]),R.end=F("end","tag",["atom"]),R.label=F("label","tag",["atom"]),R.ref=F("ref","tag",["atom"]),R.eqref=F("eqref","tag",["atom"]),R.cite=F("cite","tag",["atom"]),R.bibitem=F("bibitem","tag",["atom"]),R.Bibitem=F("Bibitem","tag",["atom"]),R.RBibitem=F("RBibitem","tag",["atom"]),R.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(f,a){f.f=a}function b(f,a){var d;if(f.match(/^\\[a-zA-Z@]+/)){var l=f.current().slice(1);return d=R.hasOwnProperty(l)?R[l]:R.DEFAULT,d=new d,K(a,d),D(a,_),d.style}if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/\\]/))return"tag";if(f.match("\\["))return D(a,function(u,c){return p(u,c,"\\]")}),"keyword";if(f.match("\\("))return D(a,function(u,c){return p(u,c,"\\)")}),"keyword";if(f.match("$$"))return D(a,function(u,c){return p(u,c,"$$")}),"keyword";if(f.match("$"))return D(a,function(u,c){return p(u,c,"$")}),"keyword";var i=f.next();if(i=="%")return f.skipToEnd(),"comment";if(i=="}"||i=="]"){if(d=L(a),d)d.closeBracket(i),D(a,_);else return"error";return"bracket"}else return i=="{"||i=="["?(d=R.DEFAULT,d=new d,K(a,d),"bracket"):/\d/.test(i)?(f.eatWhile(/[\w.%]/),"atom"):(f.eatWhile(/[\w\-_]/),d=W(a),d.name=="begin"&&(d.argument=f.current()),d.styleIdentifier())}function p(f,a,d){if(f.eatSpace())return null;if(d&&f.match(d))return D(a,b),"keyword";if(f.match(/^\\[a-zA-Z@]+/))return"tag";if(f.match(/^[a-zA-Z]+/))return"variable-2";if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/]/))return"tag";if(f.match(/^[\^_&]/))return"tag";if(f.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(f.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=f.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(f.skipToEnd(),"comment"):"error"}function _(f,a){var d=f.peek(),l;return d=="{"||d=="["?(l=L(a),l.openBracket(d),f.eat(d),D(a,b),"bracket"):/[ \t\r]/.test(d)?(f.eat(d),null):(D(a,b),N(a),b(f,a))}return{startState:function(){var f=I.inMathMode?function(a,d){return p(a,d)}:b;return{cmdState:[],f}},copyState:function(f){return{cmdState:f.cmdState.slice(),f:f.f}},token:function(f,a){return a.f(f,a)},blankLine:function(f){f.f=b,f.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+ua5":function(rt,Be,H){},"+vTd":function(rt,Be,H){rt.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(rt,Be,H){rt.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(rt,Be,H){(function(oe){oe(H("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(F,R,D){var b=D&&D!=oe.Init;if(R&&!b)F.on("blur",L),F.on("change",N),F.on("swapDoc",N),oe.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){K(F)}),N(F);else if(!R&&b){F.off("blur",L),F.off("change",N),F.off("swapDoc",N),oe.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),V(F);var p=F.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}R&&!F.hasFocus()&&L(F)});function V(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function I(F){V(F);var R=F.state.placeholder=document.createElement("pre");R.style.cssText="height: 0; overflow: visible",R.style.direction=F.getOption("direction"),R.className="CodeMirror-placeholder CodeMirror-line-like";var D=F.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),R.appendChild(D),F.display.lineSpace.insertBefore(R,F.display.lineSpace.firstChild)}function K(F){setTimeout(function(){var R=!1,D=F.getInputField();D.nodeName=="TEXTAREA"?R=!D.value:F.lineCount()==1&&(R=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),R?I(F):V(F)},20)}function L(F){W(F)&&I(F)}function N(F){var R=F.getWrapperElement(),D=W(F);R.className=R.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?I(F):V(F)}function W(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1ZF9":function(rt,Be,H){rt.exports=H.p+"static/Authorize.cc9c212f.png"},"1eCo":function(rt,Be,H){(function(oe){oe(H("VrN/"))})(function(oe){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(K,L){var N=K.indentUnit,W={},F=L.htmlMode?V:I;for(var R in F)W[R]=F[R];for(var R in L)W[R]=L[R];var D,b;function p(o,E){function g(k){return E.tokenize=k,k(o,E)}var O=o.next();if(O=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?g(a("atom","]]>")):null:o.match("--")?g(a("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),g(d(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),E.tokenize=a("meta","?>"),"meta"):(D=o.eat("/")?"closeTag":"openTag",E.tokenize=_,"tag bracket");if(O=="&"){var M;return o.eat("#")?o.eat("x")?M=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):M=o.eatWhile(/[\d]/)&&o.eat(";"):M=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),M?"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,D=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return D="equals",null;if(g=="<"){E.tokenize=p,E.state=c,E.tagName=E.tagStart=null;var O=E.tokenize(o,E);return O?O+" tag error":"tag error"}else return/[\'\"]/.test(g)?(E.tokenize=f(g),E.stringStartCol=o.column(),E.tokenize(o,E)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(o){var E=function(g,O){for(;!g.eol();)if(g.next()==o){O.tokenize=_;break}return"string"};return E.isInAttribute=!0,E}function a(o,E){return function(g,O){for(;!g.eol();){if(g.match(E)){O.tokenize=p;break}g.next()}return o}}function d(o){return function(E,g){for(var O;(O=E.next())!=null;){if(O=="<")return g.tokenize=d(o+1),g.tokenize(E,g);if(O==">")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,(W.doNotIndent.hasOwnProperty(E)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function i(o){o.context&&(o.context=o.context.prev)}function u(o,E){for(var g;;){if(!o.context)return;if(g=o.context.tagName,!W.contextGrabbers.hasOwnProperty(g)||!W.contextGrabbers[g].hasOwnProperty(E))return;i(o)}}function c(o,E,g){return o=="openTag"?(g.tagStart=E.column(),S):o=="closeTag"?C:c}function S(o,E,g){return o=="word"?(g.tagName=E.current(),b="tag",A):W.allowMissingTagName&&o=="endTag"?(b="tag bracket",A(o,E,g)):(b="error",S)}function C(o,E,g){if(o=="word"){var O=E.current();return g.context&&g.context.tagName!=O&&W.implicitlyClosed.hasOwnProperty(g.context.tagName)&&i(g),g.context&&g.context.tagName==O||W.matchClosing===!1?(b="tag",T):(b="tag error",w)}else return W.allowMissingTagName&&o=="endTag"?(b="tag bracket",T(o,E,g)):(b="error",w)}function T(o,E,g){return o!="endTag"?(b="error",T):(i(g),c)}function w(o,E,g){return b="error",T(o,E,g)}function A(o,E,g){if(o=="word")return b="attribute",m;if(o=="endTag"||o=="selfcloseTag"){var O=g.tagName,M=g.tagStart;return g.tagName=g.tagStart=null,o=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(O)?u(g,O):(u(g,O),g.context=new l(g,O,M==g.indented)),c}return b="error",A}function m(o,E,g){return o=="equals"?v:(W.allowMissing||(b="error"),A(o,E,g))}function v(o,E,g){return o=="string"?s:o=="word"&&W.allowUnquoted?(b="string",A):(b="error",A(o,E,g))}function s(o,E,g){return o=="string"?s:A(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;D=null;var g=E.tokenize(o,E);return(g||D)&&g!="comment"&&(b=null,E.state=E.state(D||g,o,E),b&&(g=b=="error"?g+" error":b)),g},indent:function(o,E,g){var O=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+N;if(O&&O.noIndent)return oe.Pass;if(o.tokenize!=_&&o.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(o.tagName)return W.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+N*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var M=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(M&&M[1])for(;O;)if(O.tagName==M[2]){O=O.prev;break}else if(W.implicitlyClosed.hasOwnProperty(O.tagName))O=O.prev;else break;else if(M)for(;O;){var k=W.contextGrabbers[O.tagName];if(k&&k.hasOwnProperty(M[2]))O=O.prev;else break}for(;O&&O.prev&&!O.startOfLine;)O=O.prev;return O?O.indent+N:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(o){o.state==v&&(o.state=A)},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()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(rt,Be,H){rt.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"55Ip":function(rt,Be,H){"use strict";H.d(Be,"a",function(){return u});var oe=H("Ty5D"),V=H("dI71"),I=H("cDcd"),K=H.n(I),L=H("YS25"),N=H("17x9"),W=H.n(N),F=H("wx14"),R=H("zLVn"),D=H("9R94"),b=function(v){Object(V.a)(s,v);function s(){for(var E,g=arguments.length,O=new Array(g),M=0;M<g;M++)O[M]=arguments[M];return E=v.call.apply(v,[this].concat(O))||this,E.history=Object(L.a)(E.props),E}var o=s.prototype;return o.render=function(){return K.a.createElement(oe.c,{history:this.history,children:this.props.children})},s}(K.a.Component),p=function(v){Object(V.a)(s,v);function s(){for(var E,g=arguments.length,O=new Array(g),M=0;M<g;M++)O[M]=arguments[M];return E=v.call.apply(v,[this].concat(O))||this,E.history=Object(L.b)(E.props),E}var o=s.prototype;return o.render=function(){return K.a.createElement(oe.c,{history:this.history,children:this.props.children})},s}(K.a.Component),_=function(s,o){return typeof s=="function"?s(o):s},f=function(s,o){return typeof s=="string"?Object(L.c)(s,null,null,o):s},a=function(s){return s},d=K.a.forwardRef;typeof d=="undefined"&&(d=a);function l(v){return!!(v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)}var i=d(function(v,s){var o=v.innerRef,E=v.navigate,g=v.onClick,O=Object(R.a)(v,["innerRef","navigate","onClick"]),M=O.target,k=Object(F.a)({},O,{onClick:function(B){try{g&&g(B)}catch(y){throw B.preventDefault(),y}!B.defaultPrevented&&B.button===0&&(!M||M==="_self")&&!l(B)&&(B.preventDefault(),E())}});return a!==d?k.ref=s||o:k.ref=o,K.a.createElement("a",k)}),u=d(function(v,s){var o=v.component,E=o===void 0?i:o,g=v.replace,O=v.to,M=v.innerRef,k=Object(R.a)(v,["component","replace","to","innerRef"]);return K.a.createElement(oe.e.Consumer,null,function(U){U||Object(D.a)(!1);var B=U.history,y=f(_(O,U.location),U.location),x=y?B.createHref(y):"",j=Object(F.a)({},k,{href:x,navigate:function(){var Y=_(O,U.location),$=g?B.replace:B.push;$(Y)}});return a!==d?j.ref=s||M:j.innerRef=M,K.a.createElement(E,j)})});if(!1)var c,S;var C=function(s){return s},T=K.a.forwardRef;typeof T=="undefined"&&(T=C);function w(){for(var v=arguments.length,s=new Array(v),o=0;o<v;o++)s[o]=arguments[o];return s.filter(function(E){return E}).join(" ")}var A=T(function(v,s){var o=v["aria-current"],E=o===void 0?"page":o,g=v.activeClassName,O=g===void 0?"active":g,M=v.activeStyle,k=v.className,U=v.exact,B=v.isActive,y=v.location,x=v.sensitive,j=v.strict,z=v.style,Y=v.to,$=v.innerRef,ce=Object(R.a)(v,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return K.a.createElement(oe.e.Consumer,null,function(se){se||Object(D.a)(!1);var ne=y||se.location,re=f(_(Y,ne),ne),ue=re.pathname,ee=ue&&ue.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ae=ee?Object(oe.f)(ne.pathname,{path:ee,exact:U,sensitive:x,strict:j}):null,ge=!!(B?B(ae,ne):ae),Le=ge?w(k,O):k,ke=ge?Object(F.a)({},z,{},M):z,De=Object(F.a)({"aria-current":ge&&E||null,className:Le,style:ke,to:re},ce);return C!==T?De.ref=s||$:De.innerRef=$,K.a.createElement(u,De)})});if(!1)var m},"5VLF":function(rt,Be,H){"use strict";var oe,V;function I(K,L,N){var W=function(F,R){return K.js_beautify(F,R)};return W.js=K.js_beautify,W.css=L.css_beautify,W.html=N.html_beautify,W.js_beautify=K.js_beautify,W.css_beautify=L.css_beautify,W.html_beautify=N.html_beautify,W}!(oe=[H("6UM0"),H("TXwP"),H("psGv")],V=function(K,L,N){return I(K,L,N)}.apply(Be,oe),V!==void 0&&(rt.exports=V))},"6+eU":function(rt,Be,H){"use strict";H.d(Be,"a",function(){return T});var oe=H("wx14"),V=H("rePB"),I=H("VTBJ"),K=H("1OyB"),L=H("vuIU"),N=H("Ji7U"),W=H("LK+K"),F=H("cDcd"),R=H.n(F),D=H("TSYQ"),b=H.n(D),p=function(A){var m,v="".concat(A.rootPrefixCls,"-item"),s=b()(v,"".concat(v,"-").concat(A.page),(m={},Object(V.a)(m,"".concat(v,"-active"),A.active),Object(V.a)(m,A.className,!!A.className),Object(V.a)(m,"".concat(v,"-disabled"),!A.page),m)),o=function(){A.onClick(A.page)},E=function(O){A.onKeyPress(O,A.onClick,A.page)};return R.a.createElement("li",{title:A.showTitle?A.page:null,className:s,onClick:o,onKeyPress:E,tabIndex:"0"},A.itemRender(A.page,"page",R.a.createElement("a",{rel:"nofollow"},A.page)))},_=p,f={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(w){Object(N.a)(m,w);var A=Object(W.a)(m);function m(){var v;Object(K.a)(this,m);for(var s=arguments.length,o=new Array(s),E=0;E<s;E++)o[E]=arguments[E];return v=A.call.apply(A,[this].concat(o)),v.state={goInputText:""},v.buildOptionText=function(g){return"".concat(g," ").concat(v.props.locale.items_per_page)},v.changeSize=function(g){v.props.changeSize(Number(g))},v.handleChange=function(g){v.setState({goInputText:g.target.value})},v.handleBlur=function(g){var O=v.props,M=O.goButton,k=O.quickGo,U=O.rootPrefixCls,B=v.state.goInputText;if(M||B==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(U,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(U,"-next"))>=0))return;v.setState({goInputText:""}),k(v.getValidValue())},v.go=function(g){var O=v.state.goInputText;if(O==="")return;(g.keyCode===f.ENTER||g.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(L.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,O){var M=isNaN(Number(g))?0:Number(g),k=isNaN(Number(O))?0:Number(O);return M-k})}},{key:"render",value:function(){var s=this,o=this.props,E=o.pageSize,g=o.locale,O=o.rootPrefixCls,M=o.changeSize,k=o.quickGo,U=o.goButton,B=o.selectComponentClass,y=o.buildOptionText,x=o.selectPrefixCls,j=o.disabled,z=this.state.goInputText,Y="".concat(O,"-options"),$=B,ce=null,se=null,ne=null;if(!M&&!k)return null;var re=this.getPageSizeOptions();if(M&&$){var ue=re.map(function(ee,ae){return R.a.createElement($.Option,{key:ae,value:ee.toString()},(y||s.buildOptionText)(ee))});ce=R.a.createElement($,{disabled:j,prefixCls:x,showSearch:!1,className:"".concat(Y,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||re[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ae){return ae.parentNode}},ue)}return k&&(U&&(ne=typeof U=="boolean"?R.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:j,className:"".concat(Y,"-quick-jumper-button")},g.jump_to_confirm):R.a.createElement("span",{onClick:this.go,onKeyUp:this.go},U)),se=R.a.createElement("div",{className:"".concat(Y,"-quick-jumper")},g.jump_to,R.a.createElement("input",{disabled:j,type:"text",value:z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,ne)),R.a.createElement("li",{className:"".concat(Y)},ce,se)}}]),m}(R.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=a,l=H("N2Kk");function i(){}function u(w){return typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function c(w,A,m){return m}function S(w,A,m){var v=typeof w=="undefined"?A.pageSize:w;return Math.floor((m.total-1)/v)+1}var C=function(w){Object(N.a)(m,w);var A=Object(W.a)(m);function m(v){var s;Object(K.a)(this,m),s=A.call(this,v),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(S(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(M,k){var U=s.props.prefixCls,B=M||R.a.createElement("button",{type:"button","aria-label":k,className:"".concat(U,"-item-link")});return typeof M=="function"&&(B=R.a.createElement(M,Object(I.a)({},s.props))),B},s.savePaginationNode=function(M){s.paginationNode=M},s.isValid=function(M){return u(M)&&M!==s.state.current},s.shouldDisplayQuickJumper=function(){var M=s.props,k=M.showQuickJumper,U=M.pageSize,B=M.total;return B<=U?!1:k},s.handleKeyDown=function(M){(M.keyCode===f.ARROW_UP||M.keyCode===f.ARROW_DOWN)&&M.preventDefault()},s.handleKeyUp=function(M){var k=s.getValidValue(M),U=s.state.currentInputValue;k!==U&&s.setState({currentInputValue:k}),M.keyCode===f.ENTER?s.handleChange(k):M.keyCode===f.ARROW_UP?s.handleChange(k-1):M.keyCode===f.ARROW_DOWN&&s.handleChange(k+1)},s.changePageSize=function(M){var k=s.state.current,U=S(M,s.state,s.props);k=k>U?U:k,U===0&&(k=s.state.current),typeof M=="number"&&("pageSize"in s.props||s.setState({pageSize:M}),"current"in s.props||s.setState({current:k,currentInputValue:k})),s.props.onShowSizeChange(k,M),"onChange"in s.props&&s.props.onChange&&s.props.onChange(k,M)},s.handleChange=function(M){var k=s.props.disabled,U=M;if(s.isValid(U)&&!k){var B=S(void 0,s.state,s.props);U>B?U=B:U<1&&(U=1),"current"in s.props||s.setState({current:U,currentInputValue:U});var y=s.state.pageSize;return s.props.onChange(U,y),U}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.current<S(void 0,s.state,s.props)},s.runIfEnter=function(M,k){if(M.key==="Enter"||M.charCode===13){for(var U=arguments.length,B=new Array(U>2?U-2:0),y=2;y<U;y++)B[y-2]=arguments[y];k.apply(void 0,B)}},s.runIfEnterPrev=function(M){s.runIfEnter(M,s.prev)},s.runIfEnterNext=function(M){s.runIfEnter(M,s.next)},s.runIfEnterJumpPrev=function(M){s.runIfEnter(M,s.jumpPrev)},s.runIfEnterJumpNext=function(M){s.runIfEnter(M,s.jumpNext)},s.handleGoTO=function(M){(M.keyCode===f.ENTER||M.type==="click")&&s.handleChange(s.state.currentInputValue)};var o=v.onChange!==i,E="current"in v;E&&!o&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var g=v.defaultCurrent;"current"in v&&(g=v.current);var O=v.defaultPageSize;return"pageSize"in v&&(O=v.pageSize),g=Math.min(g,S(O,void 0,v)),s.state={current:g,currentInputValue:g,pageSize:O},s}return Object(L.a)(m,[{key:"componentDidUpdate",value:function(s,o){var E=this.props.prefixCls;if(o.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(E,"-item-").concat(o.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(s){var o=s.target.value,E=S(void 0,this.state,this.props),g=this.state.currentInputValue,O;return o===""?O=o:isNaN(Number(o))?O=g:o>=E?O=E:O=Number(o),O}},{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,O=g(s,"prev",this.getItemIcon(E,"prev page")),M=!this.hasPrev();return Object(F.isValidElement)(O)?Object(F.cloneElement)(O,{disabled:M}):O}},{key:"renderNext",value:function(s){var o=this.props,E=o.nextIcon,g=o.itemRender,O=g(s,"next",this.getItemIcon(E,"next page")),M=!this.hasNext();return Object(F.isValidElement)(O)?Object(F.cloneElement)(O,{disabled:M}):O}},{key:"render",value:function(){var s=this,o=this.props,E=o.prefixCls,g=o.className,O=o.style,M=o.disabled,k=o.hideOnSinglePage,U=o.total,B=o.locale,y=o.showQuickJumper,x=o.showLessItems,j=o.showTitle,z=o.showTotal,Y=o.simple,$=o.itemRender,ce=o.showPrevNextJumpers,se=o.jumpPrevIcon,ne=o.jumpNextIcon,re=o.selectComponentClass,ue=o.selectPrefixCls,ee=o.pageSizeOptions,ae=this.state,ge=ae.current,Le=ae.pageSize,ke=ae.currentInputValue;if(k===!0&&U<=Le)return null;var De=S(void 0,this.state,this.props),Ue=[],Ie=null,Re=null,Ve=null,$e=null,Ze=null,Qe=y&&y.goButton,Ke=x?1:2,st=ge-1>0?ge-1:0,it=ge+1<De?ge+1:De,ut=Object.keys(this.props).reduce(function(q,ie){return(ie.substr(0,5)==="data-"||ie.substr(0,5)==="aria-"||ie==="role")&&(q[ie]=s.props[ie]),q},{});if(Y)return Qe&&(typeof Qe=="boolean"?Ze=R.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},B.jump_to_confirm):Ze=R.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Qe),Ze=R.a.createElement("li",{title:j?"".concat(B.jump_to).concat(ge,"/").concat(De):null,className:"".concat(E,"-simple-pager")},Ze)),R.a.createElement("ul",Object(oe.a)({className:b()(E,"".concat(E,"-simple"),Object(V.a)({},"".concat(E,"-disabled"),M),g),style:O,ref:this.savePaginationNode},ut),R.a.createElement("li",{title:j?B.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(V.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(st)),R.a.createElement("li",{title:j?"".concat(ge,"/").concat(De):null,className:"".concat(E,"-simple-pager")},R.a.createElement("input",{type:"text",value:ke,disabled:M,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),R.a.createElement("span",{className:"".concat(E,"-slash")},"/"),De),R.a.createElement("li",{title:j?B.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(V.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(it)),Ze);if(De<=3+Ke*2){var Je={locale:B,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:j,itemRender:$};De||Ue.push(R.a.createElement(_,Object(oe.a)({},Je,{key:"noPager",page:De,className:"".concat(E,"-disabled")})));for(var _t=1;_t<=De;_t+=1){var gt=ge===_t;Ue.push(R.a.createElement(_,Object(oe.a)({},Je,{key:_t,page:_t,active:gt})))}}else{var mt=x?B.prev_3:B.prev_5,We=x?B.next_3:B.next_5;ce&&(Ie=R.a.createElement("li",{title:j?mt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(E,"-jump-prev"),Object(V.a)({},"".concat(E,"-jump-prev-custom-icon"),!!se))},$(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(se,"prev page"))),Re=R.a.createElement("li",{title:j?We:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(E,"-jump-next"),Object(V.a)({},"".concat(E,"-jump-next-custom-icon"),!!ne))},$(this.getJumpNextPage(),"jump-next",this.getItemIcon(ne,"next page")))),$e=R.a.createElement(_,{locale:B,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:De,page:De,active:!1,showTitle:j,itemRender:$}),Ve=R.a.createElement(_,{locale:B,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:j,itemRender:$});var Et=Math.max(1,ge-Ke),ht=Math.min(ge+Ke,De);ge-1<=Ke&&(ht=1+Ke*2),De-ge<=Ke&&(Et=De-Ke*2);for(var Ne=Et;Ne<=ht;Ne+=1){var nt=ge===Ne;Ue.push(R.a.createElement(_,{locale:B,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:nt,showTitle:j,itemRender:$}))}ge-1>=Ke*2&&ge!==1+2&&(Ue[0]=Object(F.cloneElement)(Ue[0],{className:"".concat(E,"-item-after-jump-prev")}),Ue.unshift(Ie)),De-ge>=Ke*2&&ge!==De-2&&(Ue[Ue.length-1]=Object(F.cloneElement)(Ue[Ue.length-1],{className:"".concat(E,"-item-before-jump-next")}),Ue.push(Re)),Et!==1&&Ue.unshift(Ve),ht!==De&&Ue.push($e)}var me=null;z&&(me=R.a.createElement("li",{className:"".concat(E,"-total-text")},z(U,[U===0?0:(ge-1)*Le+1,ge*Le>U?U:ge*Le])));var ve=!this.hasPrev()||!De,le=!this.hasNext()||!De;return R.a.createElement("ul",Object(oe.a)({className:b()(E,g,Object(V.a)({},"".concat(E,"-disabled"),M)),style:O,unselectable:"unselectable",ref:this.savePaginationNode},ut),me,R.a.createElement("li",{title:j?B.prev_page:null,onClick:this.prev,tabIndex:ve?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(V.a)({},"".concat(E,"-disabled"),ve)),"aria-disabled":ve},this.renderPrev(st)),Ue,R.a.createElement("li",{title:j?B.next_page:null,onClick:this.next,tabIndex:le?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(V.a)({},"".concat(E,"-disabled"),le)),"aria-disabled":le},this.renderNext(it)),R.a.createElement(d,{disabled:M,locale:B,rootPrefixCls:E,selectComponentClass:re,selectPrefixCls:ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ge,pageSize:Le,pageSizeOptions:ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Qe}))}}],[{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,O=S(s.pageSize,o,s);g=g>O?O:g,"current"in s||(E.current=g,E.currentInputValue=g),E.pageSize=s.pageSize}return E}}]),m}(R.a.Component);C.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:i,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:i,locale:l.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var T=C},"6UM0":function(rt,Be,H){var oe,V;(function(){var I;(function(){"use strict";var L=[function(R,D,b){var p=b(1).Beautifier,_=b(5).Options;function f(a,d){var l=new p(a,d);return l.beautify()}R.exports=f,R.exports.defaultOptions=function(){return new _}},function(R,D,b){var p=b(2).Output,_=b(3).Token,f=b(4),a=b(5).Options,d=b(7).Tokenizer,l=b(7).line_starters,i=b(7).positionable_operators,u=b(7).TOKEN;function c(x,j){return j.indexOf(x)!==-1}function S(x){return x.replace(/^\s+/g,"")}function C(x){for(var j={},z=0;z<x.length;z++)j[x[z].replace(/-/g,"_")]=x[z];return j}function T(x,j){return x&&x.type===u.RESERVED&&x.text===j}function w(x,j){return x&&x.type===u.RESERVED&&c(x.text,j)}var A=["case","return","do","if","throw","else","await","break","continue","async"],m=["before-newline","after-newline","preserve-newline"],v=C(m),s=[v.before_newline,v.preserve_newline],o={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(x,j){if(j.multiline_frame||j.mode===o.ForInitializer||j.mode===o.Conditional)return;x.remove_indent(j.start_line_index)}function g(x){x=x.replace(f.allLineBreaks,`
|
|
`);for(var j=[],z=x.indexOf(`
|
|
`);z!==-1;)j.push(x.substring(0,z)),x=x.substring(z+1),z=x.indexOf(`
|
|
`);return x.length&&j.push(x),j}function O(x){return x===o.ArrayLiteral}function M(x){return c(x,[o.Expression,o.ForInitializer,o.Conditional])}function k(x,j){for(var z=0;z<x.length;z++){var Y=x[z].trim();if(Y.charAt(0)!==j)return!1}return!0}function U(x,j){for(var z=0,Y=x.length,$;z<Y;z++)if($=x[z],$&&$.indexOf(j)!==0)return!1;return!0}function B(x,j){j=j||{},this._source_text=x||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(j)}B.prototype.create_flags=function(x,j){var z=0;x&&(z=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>z&&(z=x.line_indent_level));var Y={mode:j,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:z,alignment:0,line_indent_level:x?x.line_indent_level:z,start_line_index:this._output.get_line_number(),ternary_depth:0};return Y},B.prototype._reset=function(x){var j=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,j),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(o.BlockStatement);var z=new d(x,this._options);return this._tokens=z.tokenize(),x},B.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,j=this._reset(this._source_text),z=this._options.eol;this._options.eol==="auto"&&(z=`
|
|
`,j&&f.lineBreak.test(j||"")&&(z=j.match(f.lineBreak)[0]));for(var Y=this._tokens.next();Y;)this.handle_token(Y),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Y,Y=this._tokens.next();return x=this._output.get_code(z),x},B.prototype.handle_token=function(x,j){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,j):x.type===u.COMMENT?this.handle_comment(x,j):x.type===u.DOT?this.handle_dot(x):x.type===u.EOF?this.handle_eof(x):x.type===u.UNKNOWN?this.handle_unknown(x,j):this.handle_unknown(x,j)},B.prototype.handle_whitespace_and_comments=function(x,j){var z=x.newlines,Y=this._options.keep_array_indentation&&O(this._flags.mode);if(x.comments_before)for(var $=x.comments_before.next();$;)this.handle_whitespace_and_comments($,j),this.handle_token($,j),$=x.comments_before.next();if(Y)for(var ce=0;ce<z;ce+=1)this.print_newline(ce>0,j);else if(this._options.max_preserve_newlines&&z>this._options.max_preserve_newlines&&(z=this._options.max_preserve_newlines),this._options.preserve_newlines&&z>1){this.print_newline(!1,j);for(var se=1;se<z;se+=1)this.print_newline(!0,j)}};var y=["async","break","continue","return","throw","yield"];B.prototype.allow_wrap_or_preserved_newline=function(x,j){if(j=j===void 0?!1:j,this._output.just_added_newline())return;var z=this._options.preserve_newlines&&x.newlines||j,Y=c(this._flags.last_token.text,i)||c(x.text,i);if(Y){var $=c(this._flags.last_token.text,i)&&c(this._options.operator_position,s)||c(x.text,i);z=z&&$}if(z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(w(this._flags.last_token,y))return;this._output.set_wrap_point()}},B.prototype.print_newline=function(x,j){if(!j&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var z=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&T(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},B.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||O(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(x.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},B.prototype.print_token=function(x){if(this._output.raw){this._output.add_raw_token(x);return}if(this._options.comma_first&&x.previous&&x.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var j=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(j),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(x),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(x),this._output.non_breaking_space=!0,this._output.add_token(x.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},B.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},B.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},B.prototype.set_mode=function(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)},B.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===o.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},B.prototype.start_of_object_property=function(){return this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"]))},B.prototype.start_of_statement=function(x){var j=!1;return j=j||w(this._flags.last_token,["var","let","const"])&&x.type===u.WORD,j=j||T(this._flags.last_token,"do"),j=j||!(this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement)&&w(this._flags.last_token,y)&&!x.newlines,j=j||T(this._flags.last_token,"else")&&!(T(x,"if")&&!x.comments_before),j=j||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===o.ForInitializer||this._previous_flags.mode===o.Conditional),j=j||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,j=j||this._flags.mode===o.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"])),j?(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,w(x,["do","for","if","while"])),!0):!1},B.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var j=o.Expression;if(x.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){w(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(j),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}j=o.ArrayLiteral,O(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,j=o.ForInitializer):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,j=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 z=this._tokens.peek(-3);if(this._options.space_after_named_function&&z){var Y=this._tokens.peek(-4);w(z,["async","function"])||z.text==="*"&&w(Y,["async","function"])?this._output.space_before_token=!0:this._flags.mode===o.ObjectLiteral?(z.text==="{"||z.text===","||z.text==="*"&&(Y.text==="{"||Y.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(j),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},B.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==="]"&&O(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)},B.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var j=this._tokens.peek(),z=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):z&&(c(z.text,[":",","])&&c(j.type,[u.STRING,u.WORD,u.RESERVED])||c(j.text,["get","set","..."])&&c(z.type,[u.WORD,u.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(z.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])||w(this._flags.last_token,["return","throw","import","default"])?this.set_mode(o.ObjectLiteral):this.set_mode(o.BlockStatement),this._flags.last_token&&(w(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var Y=!j.comments_before&&j.text==="}",$=Y&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ce=0,se=null;this._flags.inline_frame=!0;do if(ce+=1,se=this._tokens.peek(ce-1),se.newlines){this._flags.inline_frame=!1;break}while(se.type!==u.EOF&&!(se.type===u.END_BLOCK&&se.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&&($||this._flags.last_token.type===u.EQUALS||w(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(O(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(),!Y&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},B.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===o.Statement;)this.restore_mode();var j=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!j?this._output.space_before_token=!0:this._options.brace_style==="expand"?j||this.print_newline():j||(O(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)},B.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 j=this._tokens.peek();j.text===":"&&(x.type=u.WORD)}}if(this.start_of_statement(x)?w(this._flags.last_token,["var","let","const"])&&x.type===u.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!M(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||!w(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&&w(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?w(this._flags.last_token,["get","set","new","export"])||w(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&&(M(this._flags.mode)||O(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var z="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?z="SPACE":w(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?z="NEWLINE":(z="SPACE",this._output.space_before_token=!0):z="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===o.BlockStatement?z="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&M(this._flags.mode)?z="SPACE":this._flags.last_token.type===u.STRING?z="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,["{",","]))?z="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?z="SPACE":z="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,z="NEWLINE"),w(x,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?z="SPACE":z="NEWLINE"),w(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 Y=this._output.current_line;Y.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else z==="NEWLINE"?w(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&w(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||!w(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()):w(x,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&O(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():z==="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))},B.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var j=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&T(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},B.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)},B.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},B.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?(M(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(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)},B.prototype.handle_operator=function(x){var j=x.text==="*"&&(w(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),z=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 Y=!j;this.handle_whitespace_and_comments(x,Y)}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 $=!0,ce=!0,se=!1;if(x.text===":"?this._flags.ternary_depth===0?$=!1:(this._flags.ternary_depth-=1,se=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!z&&!j&&this._options.preserve_newlines&&c(x.text,i)){var ne=x.text===":",re=ne&&se,ue=ne&&!se;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!ue,this.print_token(x),(!ne||re)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!ne||re?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:ue||this.allow_wrap_or_preserved_newline(x),$=!(this._output.just_added_newline()||ue),this._output.space_before_token=$,this.print_token(x),this._output.space_before_token=!0;return}}if(j){this.allow_wrap_or_preserved_newline(x),$=!1;var ee=this._tokens.peek();ce=ee&&c(ee.type,[u.WORD,u.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),$=this._flags.last_token.type===u.START_BLOCK,ce=!1;else if(c(x.text,["--","++","!","~"])||z){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),$=!1,ce=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var ae=w(this._flags.last_token,A)&&x.newlines;ae&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ae,!0)}this._flags.last_token.text===";"&&M(this._flags.mode)&&($=!0),this._flags.last_token.type===u.RESERVED?$=!0:this._flags.last_token.type===u.END_EXPR?$=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===u.OPERATOR&&($=c(x.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(x.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(ce=!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||$,this.print_token(x),this._output.space_before_token=ce},B.prototype.handle_block_comment=function(x,j){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,j),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!f.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,j)},B.prototype.print_block_commment=function(x,j){var z=g(x.text),Y,$=!1,ce=!1,se=x.whitespace_before,ne=se.length;if(this.print_newline(!1,j),this.print_token_line_indentation(x),this._output.add_token(z[0]),this.print_newline(!1,j),z.length>1){for(z=z.slice(1),$=k(z,"*"),ce=U(z,se),$&&(this._flags.alignment=1),Y=0;Y<z.length;Y++)$?(this.print_token_line_indentation(x),this._output.add_token(S(z[Y]))):ce&&z[Y]?(this.print_token_line_indentation(x),this._output.add_token(z[Y].substring(ne))):(this._output.current_line.set_indent(-1),this._output.add_token(z[Y])),this.print_newline(!1,j);this._flags.alignment=0}},B.prototype.handle_comment=function(x,j){x.newlines?this.print_newline(!1,j):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,j)},B.prototype.handle_dot=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),w(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(x,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(x)},B.prototype.handle_unknown=function(x,j){this.print_token(x),x.text[x.text.length-1]===`
|
|
`&&this.print_newline(!1,j)},B.prototype.handle_eof=function(x){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},R.exports.Beautifier=B},function(R){function D(_){this.__parent=_,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=[]}D.prototype.clone_empty=function(){var _=new D(this.__parent);return _.set_indent(this.__indent_count,this.__alignment_count),_},D.prototype.item=function(_){return _<0?this.__items[this.__items.length+_]:this.__items[_]},D.prototype.has_match=function(_){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(_))return!0;return!1},D.prototype.set_indent=function(_,f){this.is_empty()&&(this.__indent_count=_||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.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},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(_){this.__items.push(_);var f=_.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=_.length-f:this.__character_count+=_.length},D.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.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(_,f){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)),f=f||"",_.indent_level>0&&(f=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}b.prototype.get_indent_size=function(_,f){var a=this.__base_string_length;return f=f||0,_<0&&(a=0),a+=_*this.__indent_size,a+=f,a},b.prototype.get_indent_string=function(_,f){var a=this.__base_string;return f=f||0,_<0&&(_=0,a=""),f+=_*this.__indent_size,this.__ensure_cache(f),a+=this.__cache[f],a},b.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var _=this.__cache.length,f=0,a="";this.__indent_size&&_>=this.__indent_size&&(f=Math.floor(_/this.__indent_size),_-=f*this.__indent_size,a=new Array(f+1).join(this.__indent_string)),_&&(a+=new Array(_+1).join(" ")),this.__cache.push(a)};function p(_,f){this.__indent_cache=new b(_,f),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 D(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(_,f){return this.__indent_cache.get_indent_string(_,f)},p.prototype.get_indent_size=function(_,f){return this.__indent_cache.get_indent_size(_,f)},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 f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return _!==`
|
|
`&&(a=a.replace(/[\n]/g,_)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,f){return _=_||0,f=f||0,this.next_line.set_indent(_,f),this.__lines.length>1?(this.current_line.set_indent(_,f),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var f=0;f<_.newlines;f++)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 f=this.__lines.length;_<f;)this.__lines[_]._remove_indent(),_++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(_){for(_=_===void 0?!1:_,this.current_line.trim();_&&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(_,f){for(var a=this.__lines.length-2;a>=0;){var d=this.__lines[a];if(d.is_empty())break;if(d.item(0).indexOf(_)!==0&&d.item(-1)!==f){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},R.exports.Output=p},function(R){function D(b,p,_,f){this.type=b,this.text=p,this.comments_before=null,this.newlines=_||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}R.exports.Token=D},function(R,D){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",f="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+b+_+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+_+f+"])*";D.identifier=new RegExp(a+d,"g"),D.identifierStart=new RegExp(a),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+_+f+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(R,D,b){var p=b(6).Options,_=["before-newline","after-newline","preserve-newline"];function f(a){p.call(this,a,"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 i=0;i<l.length;i++)l[i]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[i];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",_),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}f.prototype=new p,R.exports.Options=f},function(R){function D(_,f){this.raw_options=b(_,f),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"])}D.prototype._get_array=function(_,f){var a=this.raw_options[_],d=f||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(d=a.concat()):typeof a=="string"&&(d=a.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(_,f){var a=this.raw_options[_],d=a===void 0?!!f:!!a;return d},D.prototype._get_characters=function(_,f){var a=this.raw_options[_],d=f||"";return typeof a=="string"&&(d=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(_,f){var a=this.raw_options[_];f=parseInt(f,10),isNaN(f)&&(f=0);var d=parseInt(a,10);return isNaN(d)&&(d=f),d},D.prototype._get_selection=function(_,f,a){var d=this._get_selection_list(_,f,a);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[_]+"'");return d[0]},D.prototype._get_selection_list=function(_,f,a){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[f[0]],!this._is_valid_selection(a,f))throw new Error("Invalid Default Value!");var d=this._get_array(_,a);if(!this._is_valid_selection(d,f))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[_]+"'");return d},D.prototype._is_valid_selection=function(_,f){return _.length&&f.length&&!_.some(function(a){return f.indexOf(a)===-1})};function b(_,f){var a={};_=p(_);var d;for(d in _)d!==f&&(a[d]=_[d]);if(f&&_[f])for(d in _[f])a[d]=_[f][d];return a}function p(_){var f={},a;for(a in _){var d=a.replace(/-/g,"_");f[d]=_[a]}return f}R.exports.Options=D,R.exports.normalizeOpts=p,R.exports.mergeOpts=b},function(R,D,b){var p=b(8).InputScanner,_=b(9).Tokenizer,f=b(9).TOKEN,a=b(13).Directives,d=b(4),l=b(12).Pattern,i=b(14).TemplatablePattern;function u(k,U){return U.indexOf(k)!==-1}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:f.START,RAW:f.RAW,EOF:f.EOF},S=new a(/\/\*/,/\*\//),C=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,w=/[^\d\.]/,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,O=function(k,U){_.call(this,k,U),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var B=new l(this._input),y=new i(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(d.identifier).matching(d.identifierMatch),number:B.matching(C),punct:B.matching(v),comment:B.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:B.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:B.matching(/<!--/),html_comment_end:B.matching(/-->/),include:B.starting_with(/#include/).until_after(d.lineBreak),shebang:B.starting_with(/#!/).until_after(d.lineBreak),xml:B.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};O.prototype=new _,O.prototype._is_comment=function(k){return k.type===c.COMMENT||k.type===c.BLOCK_COMMENT||k.type===c.UNKNOWN},O.prototype._is_opening=function(k){return k.type===c.START_BLOCK||k.type===c.START_EXPR},O.prototype._is_closing=function(k,U){return(k.type===c.END_BLOCK||k.type===c.END_EXPR)&&U&&(k.text==="]"&&U.text==="["||k.text===")"&&U.text==="("||k.text==="}"&&U.text==="{")},O.prototype._reset=function(){g=!1},O.prototype._get_next_token=function(k,U){var B=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(c.EOF,""):(B=B||this._read_non_javascript(y),B=B||this._read_string(y),B=B||this._read_word(k),B=B||this._read_singles(y),B=B||this._read_comment(y),B=B||this._read_regexp(y,k),B=B||this._read_xml(y,k),B=B||this._read_punctuation(),B=B||this._create_token(c.UNKNOWN,this._input.next()),B)},O.prototype._read_word=function(k){var U;if(U=this.__patterns.identifier.read(),U!=="")return U=U.replace(d.allLineBreaks,`
|
|
`),!(k.type===c.DOT||k.type===c.RESERVED&&(k.text==="set"||k.text==="get"))&&E.test(U)?(U==="in"||U==="of")&&(k.type===c.WORD||k.type===c.STRING)?this._create_token(c.OPERATOR,U):this._create_token(c.RESERVED,U):this._create_token(c.WORD,U);if(U=this.__patterns.number.read(),U!=="")return this._create_token(c.WORD,U)},O.prototype._read_singles=function(k){var U=null;return k==="("||k==="["?U=this._create_token(c.START_EXPR,k):k===")"||k==="]"?U=this._create_token(c.END_EXPR,k):k==="{"?U=this._create_token(c.START_BLOCK,k):k==="}"?U=this._create_token(c.END_BLOCK,k):k===";"?U=this._create_token(c.SEMICOLON,k):k==="."&&w.test(this._input.peek(1))?U=this._create_token(c.DOT,k):k===","&&(U=this._create_token(c.COMMA,k)),U&&this._input.next(),U},O.prototype._read_punctuation=function(){var k=this.__patterns.punct.read();if(k!=="")return k==="="?this._create_token(c.EQUALS,k):k==="?."?this._create_token(c.DOT,k):this._create_token(c.OPERATOR,k)},O.prototype._read_non_javascript=function(k){var U="";if(k==="#"){if(this._is_first_token()&&(U=this.__patterns.shebang.read(),U))return this._create_token(c.UNKNOWN,U.trim()+`
|
|
`);if(U=this.__patterns.include.read(),U)return this._create_token(c.UNKNOWN,U.trim()+`
|
|
`);k=this._input.next();var B="#";if(this._input.hasNext()&&this._input.testChar(T)){do k=this._input.next(),B+=k;while(this._input.hasNext()&&k!=="#"&&k!=="=");return k==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(B+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(B+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,B)}this._input.back()}else if(k==="<"&&this._is_first_token()){if(U=this.__patterns.html_comment_start.read(),U){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)U+=this._input.next();return g=!0,this._create_token(c.COMMENT,U)}}else if(g&&k==="-"&&(U=this.__patterns.html_comment_end.read(),U))return g=!1,this._create_token(c.COMMENT,U);return null},O.prototype._read_comment=function(k){var U=null;if(k==="/"){var B="";if(this._input.peek(1)==="*"){B=this.__patterns.block_comment.read();var y=S.get_directives(B);y&&y.ignore==="start"&&(B+=S.readIgnored(this._input)),B=B.replace(d.allLineBreaks,`
|
|
`),U=this._create_token(c.BLOCK_COMMENT,B),U.directives=y}else this._input.peek(1)==="/"&&(B=this.__patterns.comment.read(),U=this._create_token(c.COMMENT,B))}return U},O.prototype._read_string=function(k){if(k==="`"||k==="'"||k==='"'){var U=this._input.next();return this.has_char_escapes=!1,k==="`"?U+=this._read_string_recursive("`",!0,"${"):U+=this._read_string_recursive(k),this.has_char_escapes&&this._options.unescape_strings&&(U=M(U)),this._input.peek()===k&&(U+=this._input.next()),U=U.replace(d.allLineBreaks,`
|
|
`),this._create_token(c.STRING,U)}return null},O.prototype._allow_regexp_or_xml=function(k){return k.type===c.RESERVED&&u(k.text,["return","case","throw","else","do","typeof","yield"])||k.type===c.END_EXPR&&k.text===")"&&k.opened.previous.type===c.RESERVED&&u(k.opened.previous.text,["if","while","for"])||u(k.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},O.prototype._read_regexp=function(k,U){if(k==="/"&&this._allow_regexp_or_xml(U)){for(var B=this._input.next(),y=!1,x=!1;this._input.hasNext()&&(y||x||this._input.peek()!==k)&&!this._input.testChar(d.newline);)B+=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()===k&&(B+=this._input.next(),B+=this._input.read(d.identifier)),this._create_token(c.STRING,B)}return null},O.prototype._read_xml=function(k,U){if(this._options.e4x&&k==="<"&&this._allow_regexp_or_xml(U)){var B="",y=this.__patterns.xml.read_match();if(y){for(var x=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),j=x.indexOf("{")===0,z=0;y;){var Y=!!y[1],$=y[2],ce=!!y[y.length-1]||$.slice(0,8)==="![CDATA[";if(!ce&&($===x||j&&$.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Y?--z:++z),B+=y[0],z<=0)break;y=this.__patterns.xml.read_match()}return y||(B+=this._input.match(/[\s\S]*/g)[0]),B=B.replace(d.allLineBreaks,`
|
|
`),this._create_token(c.STRING,B)}}return null};function M(k){for(var U="",B=0,y=new p(k),x=null;y.hasNext();)if(x=y.match(/([\s]|[^\\]|\\\\)+/g),x&&(U+=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{U+="\\",y.hasNext()&&(U+=y.next());continue}if(!x)return k;if(B=parseInt(x[1],16),B>126&&B<=255&&x[0].indexOf("x")===0)return k;if(B>=0&&B<32){U+="\\"+x[0];continue}else B===34||B===39||B===92?U+="\\"+String.fromCharCode(B):U+=String.fromCharCode(B)}return U}O.prototype._read_string_recursive=function(k,U,B){var y,x;k==="'"?x=this.__patterns.single_quote:k==='"'?x=this.__patterns.double_quote:k==="`"?x=this.__patterns.template_text:k==="}"&&(x=this.__patterns.template_expression);for(var j=x.read(),z="";this._input.hasNext();){if(z=this._input.next(),z===k||!U&&d.newline.test(z)){this._input.back();break}else z==="\\"&&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(),z+=this._input.next()):B&&(B==="${"&&z==="$"&&this._input.peek()==="{"&&(z+=this._input.next()),B===z&&(k==="`"?z+=this._read_string_recursive("}",U,"`"):z+=this._read_string_recursive("`",U,"${"),this._input.hasNext()&&(z+=this._input.next())));z+=x.read(),j+=z}return j},R.exports.Tokenizer=O,R.exports.TOKEN=c,R.exports.positionable_operators=A.slice(),R.exports.line_starters=s.slice()},function(R){var D=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<this.__input_length},b.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},b.prototype.peek=function(p){var _=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(_=this.__input.charAt(p)),_},b.prototype.__match=function(p,_){p.lastIndex=_;var f=p.exec(this.__input);return f&&!(D&&p.sticky)&&(f.index!==_&&(f=null)),f},b.prototype.test=function(p,_){return _=_||0,_+=this.__position,_>=0&&_<this.__input_length?!!this.__match(p,_):!1},b.prototype.testChar=function(p,_){var f=this.peek(_);return p.lastIndex=0,f!==null&&p.test(f)},b.prototype.match=function(p){var _=this.__match(p,this.__position);return _?this.__position+=_[0].length:_=null,_},b.prototype.read=function(p,_,f){var a="",d;return p&&(d=this.match(p),d&&(a+=d[0])),_&&(d||!p)&&(a+=this.readUntil(_,f)),a},b.prototype.readUntil=function(p,_){var f="",a=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(a=d.index,_&&(a+=d[0].length)):a=this.__input_length,f=this.__input.substring(this.__position,a),this.__position=a,f},b.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},b.prototype.get_regexp=function(p,_){var f=null,a="g";return _&&D&&(a="y"),typeof p=="string"&&p!==""?f=new RegExp(p,a):p&&(f=new RegExp(p.source,a)),f},b.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(p){var _=this.__position,f=this.readUntilAfter(p);return this.__position=_,f},b.prototype.lookBack=function(p){var _=this.__position-1;return _>=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},R.exports.InputScanner=b},function(R,D,b){var p=b(8).InputScanner,_=b(3).Token,f=b(10).TokenStream,a=b(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(i,u){this._input=new p(i),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var i,u=new _(d.START,""),c=null,S=[],C=new f;u.type!==d.EOF;){for(i=this._get_next_token(u,c);this._is_comment(i);)C.add(i),i=this._get_next_token(u,c);C.isEmpty()||(i.comments_before=C,C=new f),i.parent=c,this._is_opening(i)?(S.push(c),c=i):c&&this._is_closing(i,c)&&(i.opened=c,c.closed=i,c=S.pop(),i.parent=c),i.previous=u,u.next=i,this.__tokens.add(i),u=i}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(i,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(i){return!1},l.prototype._is_opening=function(i){return!1},l.prototype._is_closing=function(i,u){return!1},l.prototype._create_token=function(i,u){var c=new _(i,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},R.exports.Tokenizer=l,R.exports.TOKEN=d},function(R){function D(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},D.prototype.peek=function(b){var p=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(p=this.__tokens[b]),p},D.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},R.exports.TokenStream=D},function(R,D,b){var p=b(12).Pattern;function _(f,a){p.call(this,f,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}_.prototype=new p,_.prototype.__set_whitespace_patterns=function(f,a){f+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},_.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var a=this.__split(this._newline_regexp,f);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return f},_.prototype.matching=function(f,a){var d=this._create();return d.__set_whitespace_patterns(f,a),d._update(),d},_.prototype._create=function(){return new _(this._input,this)},_.prototype.__split=function(f,a){f.lastIndex=0;for(var d=0,l=[],i=f.exec(a);i;)l.push(a.substring(d,i.index)),d=i.index+i[0].length,i=f.exec(a);return d<a.length?l.push(a.substring(d,a.length)):l.push(""),l},R.exports.WhitespacePattern=_},function(R){function D(b,p){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}D.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(b){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(b),p._update(),p},D.prototype.until=function(b){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(b),p._update(),p},D.prototype.starting_with=function(b){var p=this._create();return p._starting_pattern=this._input.get_regexp(b,!0),p._update(),p},D.prototype.matching=function(b){var p=this._create();return p._match_pattern=this._input.get_regexp(b,!0),p._update(),p},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},R.exports.Pattern=D},function(R){function D(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")}D.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},D.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},R.exports.Directives=D},function(R,D,b){var p=b(12).Pattern,_={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(a,d){p.call(this,a,d),this.__template_pattern=null,this._disabled=Object.assign({},_),this._excluded=Object.assign({},_),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var l=new p(a);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new p,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(a){var d=this._create();return d._disabled[a]=!0,d._update(),d},f.prototype.read_options=function(a){var d=this._create();for(var l in _)d._disabled[l]=a.templating.indexOf(l)===-1;return d._update(),d},f.prototype.exclude=function(a){var d=this._create();return d._excluded[a]=!0,d._update(),d},f.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),a+=d,d=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},f.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},f.prototype._read_template=function(){var a="",d=this._input.peek();if(d==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(a=a||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},R.exports.TemplatablePattern=f}],N={};function W(R){var D=N[R];if(D!==void 0)return D.exports;var b=N[R]={exports:{}};return L[R](b,b.exports,W),b.exports}var F=W(0);I=F})();var K=I;!(oe=[],V=function(){return{js_beautify:K}}.apply(Be,oe),V!==void 0&&(rt.exports=V))})()},"7Cbv":function(rt,Be,H){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function I(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(V)}var K=/^(?:[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 L(_){return typeof _=="string"&&K.test(_)}for(var N=L,W=[],F=0;F<256;++F)W.push((F+256).toString(16).substr(1));function R(_){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(W[_[f+0]]+W[_[f+1]]+W[_[f+2]]+W[_[f+3]]+"-"+W[_[f+4]]+W[_[f+5]]+"-"+W[_[f+6]]+W[_[f+7]]+"-"+W[_[f+8]]+W[_[f+9]]+"-"+W[_[f+10]]+W[_[f+11]]+W[_[f+12]]+W[_[f+13]]+W[_[f+14]]+W[_[f+15]]).toLowerCase();if(!N(a))throw TypeError("Stringified UUID is invalid");return a}var D=R;function b(_,f,a){_=_||{};var d=_.random||(_.rng||I)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,f){a=a||0;for(var l=0;l<16;++l)f[a+l]=d[l];return f}return D(d)}var p=Be.a=b},"7ahc":function(rt,Be,H){"use strict";H.d(Be,"a",function(){return S});var oe=H("k1fw"),V=H("0Owb"),I=H("+L6B"),K=H("2/Rp"),L=H("y8nQ"),N=H("Vl3Y"),W=H("tJVT"),F=H("OaEy"),R=H("2fM7"),D=H("cDcd"),b=H.n(D),p=H("VrN/"),_=H.n(p),f=H("p77/"),a=H.n(f),d=H("c5Ni"),l=H.n(d),i=R.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"]};Be.b=function(C){var T=C.callback,w=C.onCancel,A=Object(D.useState)("python"),m=Object(W.a)(A,2),v=m[0],s=m[1];function o(g){s(c[g][1])}function E(g){T(g)}return b.a.createElement(N.a,Object(V.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),b.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(R.a,{onChange:o},Object.keys(c).map(function(g){return b.a.createElement(i,{key:g,value:g},c[g][0])}))),b.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(S,{mode:v})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(K.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function S(C){var T=C.value,w=C.onChange,A=C.mode,m=C.options,v=m===void 0?{}:m,s=Object(D.useRef)(),o=Object(D.useState)(),E=Object(W.a)(o,2),g=E[0],O=E[1];return Object(D.useEffect)(function(){if(g){function M(k){var U=k.getValue();w&&w(U)}return g.on("change",M),function(){g.off("change",M)}}},[g,w]),Object(D.useEffect)(function(){g&&g.setOption("mode",A)},[g,A]),Object(D.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(D.useEffect)(function(){if(s.current&&!g){var M=_.a.fromTextArea(s.current,Object(oe.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));O(M)}},[s.current,g]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:s}))}},"815F":function(rt,Be,H){"use strict";H.d(Be,"e",function(){return W}),H.d(Be,"c",function(){return R}),H.d(Be,"d",function(){return D}),H.d(Be,"a",function(){return p}),H.d(Be,"f",function(){return _}),H.d(Be,"b",function(){return f});var oe=H("KQm4"),V=H("VTBJ"),I=H("Ff2n"),K=H("Zm9Q"),L=H("Kwbf"),N=H("OZM5");function W(a,d){return a!=null?a:d}function F(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function l(i){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(i||[]).forEach(function(c){var S=c.key,C=c.children;Object(L.a)(S!=null,"Tree node must have a certain key: [".concat(u).concat(S,"]"));var T=String(S);Object(L.a)(!d.has(T)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(T)),d.set(T,!0),l(C,"".concat(u).concat(T," > "))})}l(a)}function R(a){function d(l){var i=Object(K.a)(l);return i.map(function(u){if(!Object(N.i)(u))return Object(L.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var c=u.key,S=u.props,C=S.children,T=Object(I.a)(S,["children"]),w=Object(V.a)({key:c},T),A=d(C);return A.length&&(w.children=A),w}).filter(function(u){return u})}return d(a)}function D(){var a=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),i=[];function u(c){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(C,T){var w=Object(N.h)(S?S.pos:"0",T),A=W(C.key,w),m=Object(V.a)(Object(V.a)({},C),{},{parent:S,pos:w,children:null,data:C,isStart:[].concat(Object(oe.a)(S?S.isStart:[]),[T===0]),isEnd:[].concat(Object(oe.a)(S?S.isEnd:[]),[T===c.length-1])});return i.push(m),d===!0||l.has(A)?m.children=u(C.children||[],m):m.children=[],m})}return u(a),i}function b(a,d,l){var i;l?typeof l=="string"?i=function(S){return S[l]}:typeof l=="function"&&(i=function(S){return l(S)}):i=function(S,C){return W(S.key,C)};function u(c,S,C){var T=c?c.children:a,w=c?Object(N.h)(C.pos,S):"0";if(c){var A=i(c,w),m={node:c,index:S,pos:w,key:A,parentPos:C.node?C.pos:null,level:C.level+1};d(m)}T&&T.forEach(function(v,s){u(v,s,{node:c,pos:w,level:C?C.level+1:-1})})}u(null)}function p(a){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=d.initWrapper,i=d.processEntity,u=d.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,S={},C={},T={posEntities:S,keyEntities:C};return l&&(T=l(T)||T),b(a,function(w){var A=w.node,m=w.index,v=w.pos,s=w.key,o=w.parentPos,E=w.level,g={node:A,index:m,key:s,pos:v,level:E},O=W(s,v);S[v]=g,C[O]=g,g.parent=S[o],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),i&&i(g,T)},c),u&&u(T),T}function _(a,d){var l=d.expandedKeys,i=d.selectedKeys,u=d.loadedKeys,c=d.loadingKeys,S=d.checkedKeys,C=d.halfCheckedKeys,T=d.dragOverNodeKey,w=d.dropPosition,A=d.keyEntities,m=A[a],v={eventKey:a,expanded:l.indexOf(a)!==-1,selected:i.indexOf(a)!==-1,loaded:u.indexOf(a)!==-1,loading:c.indexOf(a)!==-1,checked:S.indexOf(a)!==-1,halfChecked:C.indexOf(a)!==-1,pos:String(m?m.pos:""),dragOver:T===a&&w===0,dragOverGapTop:T===a&&w===-1,dragOverGapBottom:T===a&&w===1};return v}function f(a){var d=a.data,l=a.expanded,i=a.selected,u=a.checked,c=a.loaded,S=a.loading,C=a.halfChecked,T=a.dragOver,w=a.dragOverGapTop,A=a.dragOverGapBottom,m=a.pos,v=a.active,s=Object(V.a)(Object(V.a)({},d),{},{expanded:l,selected:i,checked:u,loaded:c,loading:S,halfChecked:C,dragOver:T,dragOverGapTop:w,dragOverGapBottom:A,pos:m,active:v});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(L.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),s}},"8EBN":function(rt,Be,H){(function(oe){oe(H("VrN/"))})(function(oe){"use strict";oe.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var V=0;V<oe.modeInfo.length;V++){var I=oe.modeInfo[V];I.mimes&&(I.mime=I.mimes[0])}oe.findModeByMIME=function(K){K=K.toLowerCase();for(var L=0;L<oe.modeInfo.length;L++){var N=oe.modeInfo[L];if(N.mime==K)return N;if(N.mimes){for(var W=0;W<N.mimes.length;W++)if(N.mimes[W]==K)return N}}if(/\+xml$/.test(K))return oe.findModeByMIME("application/xml");if(/\+json$/.test(K))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(K){K=K.toLowerCase();for(var L=0;L<oe.modeInfo.length;L++){var N=oe.modeInfo[L];if(N.ext){for(var W=0;W<N.ext.length;W++)if(N.ext[W]==K)return N}}},oe.findModeByFileName=function(K){for(var L=0;L<oe.modeInfo.length;L++){var N=oe.modeInfo[L];if(N.file&&N.file.test(K))return N}var W=K.lastIndexOf("."),F=W>-1&&K.substring(W+1,K.length);if(F)return oe.findModeByExtension(F)},oe.findModeByName=function(K){K=K.toLowerCase();for(var L=0;L<oe.modeInfo.length;L++){var N=oe.modeInfo[L];if(N.name.toLowerCase()==K)return N;if(N.alias){for(var W=0;W<N.alias.length;W++)if(N.alias[W].toLowerCase()==K)return N}}}})},"8hTe":function(rt,Be,H){rt.exports={button:"button___1wy9m"}},"9Bee":function(rt,Be,H){"use strict";var oe=H("DYRE"),V=H("zeV3"),I=H("+L6B"),K=H("2/Rp"),L=H("k1fw"),N=H("tJVT"),W=H("cDcd"),F=H.n(W),R=H("vg9a"),D=H("DlQD"),b=H.n(D),p=H("rUJ1");function _(ne,re){var ue=ne.match(/^(\s+)(?:```)/);if(ue===null)return re;var ee=ue[1];return re.split(`
|
|
`).map(function(ae){var ge=ae.match(/^\s+/);if(ge===null)return ae;var Le=Object(N.a)(ge,1),ke=Le[0];return ke.length>=ee.length?ae.slice(ee.length):ae}).join(`
|
|
`)}var f=[],a=["<ul>"],d=new b.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function i(){f.length=0,a=["<ul>"]}var u={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function c(ne,re,ue,ee){if(re>=ne.length||ne[re].level<=ue)return re;var ae=ne[re];ee.push("<li><a href='#"+ae.anchor+"'>"+ae.text+"</a>"),re++;var ge=[];return re=c(ne,re,ae.level,ge),ge.length>0&&(ee.push("<ul>"),ge.forEach(function(Le){ee.push(Le)}),ee.push("</ul>")),ee.push("</li>"),re=c(ne,re,ue,ee),re}function S(){return c(f,0,0,a),a.push("</ul>"),a.join("")}var C={heading:function(re){var ue=l.exec(re);if(ue)return{type:"heading",raw:ue[0],depth:ue[1].length,text:ue[2]}},fences:function(re){var ue=this.rules.block.fences.exec(re);if(ue){var ee=ue[0],ae=_(ee,ue[3]||""),ge=ue[2]?ue[2].trim():ue[2];if(["latex","katex","math"].indexOf(ge)>=0){var Le=A(),ke=ae;ae=Le,m[Le]={type:"block",expression:ke}}return{type:"code",raw:ee,lang:ge,text:ae}}}},T=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,A=function(){return"__special_katext_id_".concat(w++,"__")},m={};function v(){return m}function s(){w=0,m={}}function o(ne){return ne=ne.replace(T,function(re,ue){var ee=A();return m[ee]={type:"inline",expression:ue},ee}),ne}var E=d.listitem;d.listitem=function(ne){return E(o(ne))};var g=d.paragraph;d.paragraph=function(ne){return g(o(ne))};var O=d.tablecell;d.tablecell=function(ne,re){return O(o(ne),re)},d.code=function(ne,re,ue){var ee=(re||"").match(/\S*/)[0];return ee?["latex","katex","math"].indexOf(ee)>=0?"<p class='editormd-tex'>".concat(ne,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(re,'">').concat(ue?ne:Object(p.escape)(ne,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(ue?ne:Object(p.escape)(ne,!0))+"</code></pre>"},d.heading=function(ne,re,ue){var ee=this.options.headerPrefix+ue.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return f.push({anchor:ee,level:re,text:ne}),"<h"+re+' id="'+ee+'">'+ne+"</h"+re+">"},b.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),b.a.use({tokenizer:C,renderer:d});var M=b.a,k=H("SJMd"),U=H("ulZh"),B=H.n(U),y=H("m3rI"),x=H("Oy/b"),j=H("p5ED"),z=H("8hTe"),Y=H.n(z),$=/<pre[^>]*>/g;function ce(ne){var re=document.createElement("div");return re.innerHTML=ne,re.childNodes.length===0?"":re.childNodes[0].nodeValue}var se=Be.a=function(ne){var re=ne.value,ue=re===void 0?"":re,ee=ne.edit,ae=ee===void 0?!1:ee,ge=ne.className,Le=ne.showTextOnly,ke=ne.showLines,De=ne.replaces,Ue=ne.zoomImg,Ie=ne.hasMask,Re=ne.style,Ve=Re===void 0?{}:Re,$e=ne.stylesPrev,Ze=$e===void 0?{}:$e,Qe=String(ue),Ke=Object(W.useRef)(),st=Object(W.useRef)(),it=Object(W.useState)(""),ut=Object(N.a)(it,2),Je=ut[0],_t=ut[1],gt=Object(W.useState)("office"),mt=Object(N.a)(gt,2),We=mt[0],Et=mt[1],ht=Object(W.useMemo)(function(){try{var le=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,q=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ie=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Qe=Qe.replace(le,"("+y.a.API_SERVER+"/api/attachments/").replace(q,'"'+y.a.API_SERVER+"/api/attachments/").replace(ie,'"'+y.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(Ge){}var fe=M(Qe),Ee=v();if(Qe.match(/\[TOC\]/)&&(fe=fe.replace("<p>[TOC]</p>",S()),i()),fe=fe.replace(/(__special_katext_id_\d+__)/g,function(Ge,tt){var Tt=Ee[tt],jt=Tt.type,Ft=Tt.expression;return Object(x.renderToString)(ce(Ft)||"",{displayMode:jt==="block",throwOnError:!1,output:"html"})}),fe=fe.replace(/▁/g,"\u2581\u2581\u2581"),s(),Le){var Oe=document.createElement("div");return Oe.innerHTML=fe,Oe.innerText}return setTimeout(function(){return me()},500),fe},[Qe]),Ne=Object(W.useRef)();u.WebkitLineClamp=ke,ke&&(Ve=Object(L.a)(Object(L.a)({},Ve),u));function nt(le){var q=le.target;if(q.tagName.toUpperCase()==="IMG"){if(Ue){var ie=q.getAttribute("src");_t(ie),Et("image")}}else if(q.tagName.toUpperCase()==="A"){var fe=q.getAttribute("href");if(fe.indexOf("office")>-1)le.preventDefault(),_t(fe),Et("office");else if(fe.indexOf("application/pdf")>-1)le.preventDefault(),_t(fe),Et("pdf");else if(fe.indexOf("text/html")>-1)le.preventDefault(),_t(fe),Et("html");else if(fe.startsWith("#")){le.preventDefault();var Ee=document.getElementById(fe.replace("#",""));Ee&&Ee.scrollIntoView(!0)}}}var me=function(){var q,ie=(q=Ne.current)===null||q===void 0?void 0:q.querySelectorAll("video");ie==null||ie.forEach(function(fe){if(fe.oncontextmenu=function(){return!1},fe.src.indexOf(".m3u8")>-1&&!fe.canPlayType("application/vnd.apple.mpegurl")){if(B.a.isSupported()){var Ee=new B.a;Ee.loadSource(fe.src),Ee.attachMedia(fe)}}})};Object(W.useEffect)(function(){if(Ne.current&&ht&&(ht.match($)&&window.PR.prettyPrint()),Ne.current)return Ne.current.addEventListener("click",nt),function(){Ne.current.removeEventListener("click",nt),s(),i()}},[ht,Ne.current,nt]);var ve=function(q){if(!ae)return;q.target.nodeName==="IMG"?(Ke.current.style.display="flex",Ke.current.style.width=q.target.clientWidth+"px",Ke.current.style.height=q.target.clientHeight+"px",Ke.current.style.top=q.target.offsetTop+"px",Ke.current.style.left=q.target.offsetLeft+"px",st.current.src=q.target.getAttribute("src")):Ke.current.style.display="none"};return F.a.createElement("div",{style:{position:"relative"}},F.a.createElement("div",{ref:Ne,style:Object(L.a)({},Ve),className:"".concat(ge||""," markdown-body ").concat(Y.a.mdBody),onMouseOver:ve,dangerouslySetInnerHTML:{__html:ht}}),F.a.createElement("div",{ref:Ke,className:Y.a.button},F.a.createElement(V.a,null,F.a.createElement(K.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),F.a.createElement(K.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),F.a.createElement("img",{ref:st,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),F.a.createElement(j.a,{close:!0,data:Je,type:Je!=null&&Je.length?We:"",style:Object(L.a)({},Ze),onClose:function(){return _t("")}}))}},"9VGf":function(rt,Be,H){"use strict";H.d(Be,"a",function(){return I});var oe=H("cDcd"),V=H.n(oe);function I(K,L){var N=Object(oe.useRef)();Object(oe.useEffect)(function(){N.current=K}),Object(oe.useEffect)(function(){function W(){N.current()}if(L!==null){var F=setInterval(W,L);return function(){return clearInterval(F)}}},[L])}},"A60/":function(rt,Be,H){rt.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(rt,Be,H){"use strict";H.d(Be,"a",function(){return N});var oe=H("MNnm"),V="rc-util-key";function I(W){if(W.attachTo)return W.attachTo;var F=document.querySelector("head");return F||document.body}function K(W){var F,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var D=document.createElement("style");if((F=R.csp)===null||F===void 0?void 0:F.nonce){var b;D.nonce=(b=R.csp)===null||b===void 0?void 0:b.nonce}D.innerHTML=W;var p=I(R),_=p.firstChild;return R.prepend&&p.prepend?p.prepend(D):R.prepend&&_?p.insertBefore(D,_):p.appendChild(D),D}var L=new Map;function N(W,F){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=I(R);if(!L.has(D)){var b=K("",R),p=b.parentNode;L.set(D,p),p.removeChild(b)}var _=Array.from(L.get(D).children).find(function(i){return i.tagName==="STYLE"&&i[V]===F});if(_){var f,a;if(((f=R.csp)===null||f===void 0?void 0:f.nonce)&&_.nonce!==((a=R.csp)===null||a===void 0?void 0:a.nonce)){var d;_.nonce=(d=R.csp)===null||d===void 0?void 0:d.nonce}return _.innerHTML!==W&&(_.innerHTML=W),_}var l=K(W,R);return l[V]=F,l}},Bd2K:function(rt,Be,H){(function(oe){oe(H("VrN/"),H("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(R,D,b){if(b!=oe.Init&&b&&R.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(_){return N(_)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(_){return K(_)}),R.addKeyMap(p)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function K(R){if(R.getOption("disableInput"))return oe.Pass;for(var D=R.listSelections(),b=[],p=R.getOption("autoCloseTags"),_=0;_<D.length;_++){if(!D[_].empty())return oe.Pass;var f=D[_].head,a=R.getTokenAt(f),d=oe.innerMode(R.getMode(),a.state),l=d.state,i=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(l),u=i&&i.name;if(!u)return oe.Pass;var c=d.mode.configuration=="html",S=typeof p=="object"&&p.dontCloseTags||c&&V,C=typeof p=="object"&&p.indentTags||c&&I;a.end>f.ch&&(u=u.slice(0,u.length-a.end+f.ch));var T=u.toLowerCase();if(!u||a.type=="string"&&(a.end!=f.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&i.close||a.string.indexOf("/")==f.ch-a.start-1||S&&W(S,T)>-1||F(R,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(l)||[],u,f,!0))return oe.Pass;var w=typeof p=="object"&&p.emptyTags;if(w&&W(w,u)>-1){b[_]={text:"/>",newPos:oe.Pos(f.line,f.ch+2)};continue}var A=C&&W(C,T)>-1;b[_]={indent:A,text:">"+(A?`
|
|
|
|
`:"")+"</"+u+">",newPos:A?oe.Pos(f.line+1,0):oe.Pos(f.line,f.ch+1)}}for(var m=typeof p=="object"&&p.dontIndentOnAutoClose,_=D.length-1;_>=0;_--){var v=b[_];R.replaceRange(v.text,D[_].head,D[_].anchor,"+insert");var s=R.listSelections().slice(0);s[_]={head:v.newPos,anchor:v.newPos},R.setSelections(s),!m&&v.indent&&(R.indentLine(v.newPos.line,null,!0),R.indentLine(v.newPos.line+1,null,!0))}}function L(R,D){for(var b=R.listSelections(),p=[],_=D?"/":"</",f=R.getOption("autoCloseTags"),a=typeof f=="object"&&f.dontIndentOnSlash,d=0;d<b.length;d++){if(!b[d].empty())return oe.Pass;var l=b[d].head,i=R.getTokenAt(l),u=oe.innerMode(R.getMode(),i.state),c=u.state;if(D&&(i.type=="string"||i.string.charAt(0)!="<"||i.start!=l.ch-1))return oe.Pass;var S,C=u.mode.name!="xml"&&R.getMode().name=="htmlmixed";if(C&&u.mode.name=="javascript")S=_+"script";else if(C&&u.mode.name=="css")S=_+"style";else{var T=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(c);if(!T||T.length&&F(R,T,T[T.length-1],l))return oe.Pass;S=_+T[T.length-1]}R.getLine(l.line).charAt(i.end)!=">"&&(S+=">"),p[d]=S}if(R.replaceSelections(p),b=R.listSelections(),!a)for(var d=0;d<b.length;d++)(d==b.length-1||b[d].head.line<b[d+1].head.line)&&R.indentLine(b[d].head.line)}function N(R){return R.getOption("disableInput")?oe.Pass:L(R,!0)}oe.commands.closeTag=function(R){return L(R)};function W(R,D){if(R.indexOf)return R.indexOf(D);for(var b=0,p=R.length;b<p;++b)if(R[b]==D)return b;return-1}function F(R,D,b,p,_){if(!oe.scanForClosingTag)return!1;var f=Math.min(R.lastLine()+1,p.line+500),a=oe.scanForClosingTag(R,p,null,f);if(!a||a.tag!=b)return!1;for(var d=_?1:0,l=D.length-1;l>=0&&D[l]==b;l--)++d;p=a.to;for(var l=1;l<d;l++){var i=oe.scanForClosingTag(R,p,null,f);if(!i||i.tag!=b)return!1;p=i.to}return!0}})},BdwD:function(rt,Be,H){"use strict";var oe=H("+L6B"),V=H("2/Rp"),I=H("0Owb"),K=H("k1fw"),L=H("cDcd"),N=H.n(L),W=H("FOrL"),F=H.n(W),R=function(b){var p=b.buttonProps,_=p===void 0?{}:p,f=b.styles,a=f===void 0?{}:f,d=b.customText,l=b.ButtonText,i=b.ButtonClick,u=b.Buttonclass,c=b.ButtonTwo;return N.a.createElement("section",{className:"tc animated fadeIn",style:Object(K.a)(Object(K.a)({},{color:"#999",margin:"200px auto"}),a)},N.a.createElement("img",{src:F.a}),N.a.createElement("p",{className:"mt20 font14"},d||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&N.a.createElement(V.a,Object(I.a)({className:u,onClick:i},_),l),c&&c)};Be.a=R},BjJ7:function(rt,Be,H){"use strict";H.d(Be,"d",function(){return V}),H.d(Be,"c",function(){return I}),H.d(Be,"e",function(){return K}),H.d(Be,"b",function(){return L}),H.d(Be,"a",function(){return W});var oe=H("m3rI");function V(F){var R=!0;if(F.length>0){for(var D=0;D<F.length;D++)if(F[D].compile_success==0||!F[D].compile_success){R=!1;break}}else R=!1;return R}function I(F){for(var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],b=0;b<F.length;b++){var p=F[b],_=R?"".concat(R,"/").concat(p.name):"".concat(p.name);D.push({title:p.name,isLeaf:!(p.type==="tree"),key:_})}return D}function K(F,R,D){for(var b=0;b<F.length;b++){var p=F[b];if(p.key===R){p.children=D;break}p.children&&K(p.children,R,D)}return F}function L(F,R,D){var b;return function(){var p=this,_=arguments,f=function(){b=null,D||F.apply(p,_)},a=D&&!b;clearTimeout(b),b=setTimeout(f,R),a&&F.apply(p,_)}}var N=!0,W=oe.a.API_SERVER},"C+DQ":function(rt,Be,H){},DlQD:function(rt,Be,H){(function(oe,V){rt.exports=V()})(this,function(){"use strict";function oe(me,ve){for(var le=0;le<ve.length;le++){var q=ve[le];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(me,q.key,q)}}function V(me,ve,le){return ve&&oe(me.prototype,ve),le&&oe(me,le),me}function I(me,ve){if(!me)return;if(typeof me=="string")return K(me,ve);var le=Object.prototype.toString.call(me).slice(8,-1);if(le==="Object"&&me.constructor&&(le=me.constructor.name),le==="Map"||le==="Set")return Array.from(me);if(le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le))return K(me,ve)}function K(me,ve){(ve==null||ve>me.length)&&(ve=me.length);for(var le=0,q=new Array(ve);le<ve;le++)q[le]=me[le];return q}function L(me,ve){var le;if(typeof Symbol=="undefined"||me[Symbol.iterator]==null){if(Array.isArray(me)||(le=I(me))||ve&&me&&typeof me.length=="number"){le&&(me=le);var q=0;return function(){return q>=me.length?{done:!0}:{done:!1,value:me[q++]}}}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 le=me[Symbol.iterator](),le.next.bind(le)}function N(me,ve){return ve={exports:{}},me(ve,ve.exports),ve.exports}var W=N(function(me){function ve(){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 le(q){me.exports.defaults=q}me.exports={defaults:ve(),getDefaults:ve,changeDefaults:le}}),F=W.defaults,R=W.getDefaults,D=W.changeDefaults,b=/[&<>"']/,p=/[&<>"']/g,_=/[<>"']|&(?!#?\w+;)/,f=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(ve){return a[ve]};function l(me,ve){if(ve){if(b.test(me))return me.replace(p,d)}else if(_.test(me))return me.replace(f,d);return me}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(me){return me.replace(i,function(ve,le){return le=le.toLowerCase(),le==="colon"?":":le.charAt(0)==="#"?le.charAt(1)==="x"?String.fromCharCode(parseInt(le.substring(2),16)):String.fromCharCode(+le.substring(1)):""})}var c=/(^|[^\[])\^/g;function S(me,ve){me=me.source||me,ve=ve||"";var le={replace:function(ie,fe){return fe=fe.source||fe,fe=fe.replace(c,"$1"),me=me.replace(ie,fe),le},getRegex:function(){return new RegExp(me,ve)}};return le}var C=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(me,ve,le){if(me){var q;try{q=decodeURIComponent(u(le)).replace(C,"").toLowerCase()}catch(ie){return null}if(q.indexOf("javascript:")===0||q.indexOf("vbscript:")===0||q.indexOf("data:")===0)return null}ve&&!T.test(le)&&(le=o(ve,le));try{le=encodeURI(le).replace(/%25/g,"%")}catch(ie){return null}return le}var A={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(me,ve){A[" "+me]||(m.test(me)?A[" "+me]=me+"/":A[" "+me]=M(me,"/",!0)),me=A[" "+me];var le=me.indexOf(":")===-1;return ve.substring(0,2)==="//"?le?ve:me.replace(v,"$1")+ve:ve.charAt(0)==="/"?le?ve:me.replace(s,"$1")+ve:me+ve}var E={exec:function(){}};function g(me){for(var ve=1,le,q;ve<arguments.length;ve++){le=arguments[ve];for(q in le)Object.prototype.hasOwnProperty.call(le,q)&&(me[q]=le[q])}return me}function O(me,ve){var le=me.replace(/\|/g,function(fe,Ee,Oe){for(var Ge=!1,tt=Ee;--tt>=0&&Oe[tt]==="\\";)Ge=!Ge;return Ge?"|":" |"}),q=le.split(/ \|/),ie=0;if(q.length>ve)q.splice(ve);else for(;q.length<ve;)q.push("");for(;ie<q.length;ie++)q[ie]=q[ie].trim().replace(/\\\|/g,"|");return q}function M(me,ve,le){var q=me.length;if(q===0)return"";for(var ie=0;ie<q;){var fe=me.charAt(q-ie-1);if(fe===ve&&!le)ie++;else if(fe!==ve&&le)ie++;else break}return me.substr(0,q-ie)}function k(me,ve){if(me.indexOf(ve[1])===-1)return-1;for(var le=me.length,q=0,ie=0;ie<le;ie++)if(me[ie]==="\\")ie++;else if(me[ie]===ve[0])q++;else if(me[ie]===ve[1]&&(q--,q<0))return ie;return-1}function U(me){me&&me.sanitize&&!me.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var B={escape:l,unescape:u,edit:S,cleanUrl:w,resolveUrl:o,noopTest:E,merge:g,splitCells:O,rtrim:M,findClosingBracket:k,checkSanitizeDeprecation:U},y=W.defaults,x=B.rtrim,j=B.splitCells,z=B.escape,Y=B.findClosingBracket;function $(me,ve,le){var q=ve.href,ie=ve.title?z(ve.title):null,fe=me[1].replace(/\\([\[\]])/g,"$1");return me[0].charAt(0)!=="!"?{type:"link",raw:le,href:q,title:ie,text:fe}:{type:"image",raw:le,href:q,title:ie,text:z(fe)}}function ce(me,ve){var le=me.match(/^(\s+)(?:```)/);if(le===null)return ve;var q=le[1];return ve.split(`
|
|
`).map(function(ie){var fe=ie.match(/^\s+/);if(fe===null)return ie;var Ee=fe[0];return Ee.length>=q.length?ie.slice(q.length):ie}).join(`
|
|
`)}var se=function(){function me(le){this.options=le||y}var ve=me.prototype;return ve.space=function(q){var ie=this.rules.block.newline.exec(q);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},ve.code=function(q,ie){var fe=this.rules.block.code.exec(q);if(fe){var Ee=ie[ie.length-1];if(Ee&&Ee.type==="paragraph")return{raw:fe[0],text:fe[0].trimRight()};var Oe=fe[0].replace(/^ {4}/gm,"");return{type:"code",raw:fe[0],codeBlockStyle:"indented",text:this.options.pedantic?Oe:x(Oe,`
|
|
`)}}},ve.fences=function(q){var ie=this.rules.block.fences.exec(q);if(ie){var fe=ie[0],Ee=ce(fe,ie[3]||"");return{type:"code",raw:fe,lang:ie[2]?ie[2].trim():ie[2],text:Ee}}},ve.heading=function(q){var ie=this.rules.block.heading.exec(q);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ve.nptable=function(q){var ie=this.rules.block.nptable.exec(q);if(ie){var fe={type:"table",header:j(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(fe.header.length===fe.align.length){var Ee=fe.align.length,Oe;for(Oe=0;Oe<Ee;Oe++)/^ *-+: *$/.test(fe.align[Oe])?fe.align[Oe]="right":/^ *:-+: *$/.test(fe.align[Oe])?fe.align[Oe]="center":/^ *:-+ *$/.test(fe.align[Oe])?fe.align[Oe]="left":fe.align[Oe]=null;for(Ee=fe.cells.length,Oe=0;Oe<Ee;Oe++)fe.cells[Oe]=j(fe.cells[Oe],fe.header.length);return fe}}},ve.hr=function(q){var ie=this.rules.block.hr.exec(q);if(ie)return{type:"hr",raw:ie[0]}},ve.blockquote=function(q){var ie=this.rules.block.blockquote.exec(q);if(ie){var fe=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:fe}}},ve.list=function(q){var ie=this.rules.block.list.exec(q);if(ie){for(var fe=ie[0],Ee=ie[2],Oe=Ee.length>1,Ge=Ee[Ee.length-1]===")",tt={type:"list",raw:fe,ordered:Oe,start:Oe?+Ee.slice(0,-1):"",loose:!1,items:[]},Tt=ie[0].match(this.rules.block.item),jt=!1,Ft,In,sn,Wt,Qn,mn,yr,hr=Tt.length,En=0;En<hr;En++)Ft=Tt[En],fe=Ft,In=Ft.length,Ft=Ft.replace(/^ *([*+-]|\d+[.)]) */,""),~Ft.indexOf(`
|
|
`)&&(In-=Ft.length,Ft=this.options.pedantic?Ft.replace(/^ {1,4}/gm,""):Ft.replace(new RegExp("^ {1,"+In+"}","gm"),"")),En!==hr-1&&(sn=this.rules.block.bullet.exec(Tt[En+1])[0],(Oe?sn.length===1||!Ge&&sn[sn.length-1]===")":sn.length>1||this.options.smartLists&&sn!==Ee)&&(Wt=Tt.slice(En+1).join(`
|
|
`),tt.raw=tt.raw.substring(0,tt.raw.length-Wt.length),En=hr-1)),Qn=jt||/\n\n(?!\s*$)/.test(Ft),En!==hr-1&&(jt=Ft.charAt(Ft.length-1)===`
|
|
`,Qn||(Qn=jt)),Qn&&(tt.loose=!0),mn=/^\[[ xX]\] /.test(Ft),yr=void 0,mn&&(yr=Ft[1]!==" ",Ft=Ft.replace(/^\[[ xX]\] +/,"")),tt.items.push({type:"list_item",raw:fe,task:mn,checked:yr,loose:Qn,text:Ft});return tt}},ve.html=function(q){var ie=this.rules.block.html.exec(q);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):z(ie[0]):ie[0]}},ve.def=function(q){var ie=this.rules.block.def.exec(q);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var fe=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:fe,raw:ie[0],href:ie[2],title:ie[3]}}},ve.table=function(q){var ie=this.rules.block.table.exec(q);if(ie){var fe={type:"table",header:j(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(fe.header.length===fe.align.length){fe.raw=ie[0];var Ee=fe.align.length,Oe;for(Oe=0;Oe<Ee;Oe++)/^ *-+: *$/.test(fe.align[Oe])?fe.align[Oe]="right":/^ *:-+: *$/.test(fe.align[Oe])?fe.align[Oe]="center":/^ *:-+ *$/.test(fe.align[Oe])?fe.align[Oe]="left":fe.align[Oe]=null;for(Ee=fe.cells.length,Oe=0;Oe<Ee;Oe++)fe.cells[Oe]=j(fe.cells[Oe].replace(/^ *\| *| *\| *$/g,""),fe.header.length);return fe}}},ve.lheading=function(q){var ie=this.rules.block.lheading.exec(q);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ve.paragraph=function(q){var ie=this.rules.block.paragraph.exec(q);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},ve.text=function(q,ie){var fe=this.rules.block.text.exec(q);if(fe){var Ee=ie[ie.length-1];return Ee&&Ee.type==="text"?{raw:fe[0],text:fe[0]}:{type:"text",raw:fe[0],text:fe[0]}}},ve.escape=function(q){var ie=this.rules.inline.escape.exec(q);if(ie)return{type:"escape",raw:ie[0],text:z(ie[1])}},ve.tag=function(q,ie,fe){var Ee=this.rules.inline.tag.exec(q);if(Ee)return!ie&&/^<a /i.test(Ee[0])?ie=!0:ie&&/^<\/a>/i.test(Ee[0])&&(ie=!1),!fe&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ee[0])?fe=!0:fe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ee[0])&&(fe=!1),{type:this.options.sanitize?"text":"html",raw:Ee[0],inLink:ie,inRawBlock:fe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):z(Ee[0]):Ee[0]}},ve.link=function(q){var ie=this.rules.inline.link.exec(q);if(ie){var fe=Y(ie[2],"()");if(fe>-1){var Ee=ie[0].indexOf("!")===0?5:4,Oe=Ee+ie[1].length+fe;ie[2]=ie[2].substring(0,fe),ie[0]=ie[0].substring(0,Oe).trim(),ie[3]=""}var Ge=ie[2],tt="";if(this.options.pedantic){var Tt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ge);Tt?(Ge=Tt[1],tt=Tt[3]):tt=""}else tt=ie[3]?ie[3].slice(1,-1):"";Ge=Ge.trim().replace(/^<([\s\S]*)>$/,"$1");var jt=$(ie,{href:Ge&&Ge.replace(this.rules.inline._escapes,"$1"),title:tt&&tt.replace(this.rules.inline._escapes,"$1")},ie[0]);return jt}},ve.reflink=function(q,ie){var fe;if((fe=this.rules.inline.reflink.exec(q))||(fe=this.rules.inline.nolink.exec(q))){var Ee=(fe[2]||fe[1]).replace(/\s+/g," ");if(Ee=ie[Ee.toLowerCase()],!Ee||!Ee.href){var Oe=fe[0].charAt(0);return{type:"text",raw:Oe,text:Oe}}var Ge=$(fe,Ee,fe[0]);return Ge}},ve.strong=function(q,ie,fe){fe===void 0&&(fe="");var Ee=this.rules.inline.strong.start.exec(q);if(Ee&&(!Ee[1]||Ee[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){ie=ie.slice(-1*q.length);var Oe=Ee[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Oe.lastIndex=0;for(var Ge;(Ee=Oe.exec(ie))!=null;)if(Ge=this.rules.inline.strong.middle.exec(ie.slice(0,Ee.index+3)),Ge)return{type:"strong",raw:q.slice(0,Ge[0].length),text:q.slice(2,Ge[0].length-2)}}},ve.em=function(q,ie,fe){fe===void 0&&(fe="");var Ee=this.rules.inline.em.start.exec(q);if(Ee&&(!Ee[1]||Ee[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){ie=ie.slice(-1*q.length);var Oe=Ee[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Oe.lastIndex=0;for(var Ge;(Ee=Oe.exec(ie))!=null;)if(Ge=this.rules.inline.em.middle.exec(ie.slice(0,Ee.index+2)),Ge)return{type:"em",raw:q.slice(0,Ge[0].length),text:q.slice(1,Ge[0].length-1)}}},ve.codespan=function(q){var ie=this.rules.inline.code.exec(q);if(ie){var fe=ie[2].replace(/\n/g," "),Ee=/[^ ]/.test(fe),Oe=fe.startsWith(" ")&&fe.endsWith(" ");return Ee&&Oe&&(fe=fe.substring(1,fe.length-1)),fe=z(fe,!0),{type:"codespan",raw:ie[0],text:fe}}},ve.br=function(q){var ie=this.rules.inline.br.exec(q);if(ie)return{type:"br",raw:ie[0]}},ve.del=function(q){var ie=this.rules.inline.del.exec(q);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ve.autolink=function(q,ie){var fe=this.rules.inline.autolink.exec(q);if(fe){var Ee,Oe;return fe[2]==="@"?(Ee=z(this.options.mangle?ie(fe[1]):fe[1]),Oe="mailto:"+Ee):(Ee=z(fe[1]),Oe=Ee),{type:"link",raw:fe[0],text:Ee,href:Oe,tokens:[{type:"text",raw:Ee,text:Ee}]}}},ve.url=function(q,ie){var fe;if(fe=this.rules.inline.url.exec(q)){var Ee,Oe;if(fe[2]==="@")Ee=z(this.options.mangle?ie(fe[0]):fe[0]),Oe="mailto:"+Ee;else{var Ge;do Ge=fe[0],fe[0]=this.rules.inline._backpedal.exec(fe[0])[0];while(Ge!==fe[0]);Ee=z(fe[0]),fe[1]==="www."?Oe="http://"+Ee:Oe=Ee}return{type:"link",raw:fe[0],text:Ee,href:Oe,tokens:[{type:"text",raw:Ee,text:Ee}]}}},ve.inlineText=function(q,ie,fe){var Ee=this.rules.inline.text.exec(q);if(Ee){var Oe;return ie?Oe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):z(Ee[0]):Ee[0]:Oe=z(this.options.smartypants?fe(Ee[0]):Ee[0]),{type:"text",raw:Ee[0],text:Oe}}},me}(),ne=B.noopTest,re=B.edit,ue=B.merge,ee={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ne,table:ne,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=re(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ee.item=re(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=re(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._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",ee._comment=/<!--(?!-?>)[\s\S]*?-->/,ee.html=re(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=re(ee._paragraph).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ee._tag).getRegex(),ee.blockquote=re(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=ue({},ee),ee.gfm=ue({},ee.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*|$)"}),ee.gfm.nptable=re(ee.gfm.nptable).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ee._tag).getRegex(),ee.gfm.table=re(ee.gfm.table).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ee._tag).getRegex(),ee.pedantic=ue({},ee.normal,{html:re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ne,paragraph:re(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ne,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ne,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ae.punctuation=re(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=re(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=re(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=re(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=re(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=re(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=re(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=re(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=re(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=re(ae._blockSkip,"g").getRegex(),ae.overlapSkip=re(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ae.autolink=re(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=re(ae.tag).replace("comment",ee._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=re(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=re(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=re(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=ue({},ae),ae.pedantic=ue({},ae.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:re(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=ue({},ae.normal,{escape:re(ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ae.gfm.url=re(ae.gfm.url,"i").replace("email",ae.gfm._extended_email).getRegex(),ae.breaks=ue({},ae.gfm,{br:re(ae.br).replace("{2,}","*").getRegex(),text:re(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ge={block:ee,inline:ae},Le=W.defaults,ke=ge.block,De=ge.inline;function Ue(me){return me.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Ie(me){var ve="",le,q,ie=me.length;for(le=0;le<ie;le++)q=me.charCodeAt(le),Math.random()>.5&&(q="x"+q.toString(16)),ve+="&#"+q+";";return ve}var Re=function(){function me(le){this.tokens=[],this.tokens.links=Object.create(null),this.options=le||Le,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var q={block:ke.normal,inline:De.normal};this.options.pedantic?(q.block=ke.pedantic,q.inline=De.pedantic):this.options.gfm&&(q.block=ke.gfm,this.options.breaks?q.inline=De.breaks:q.inline=De.gfm),this.tokenizer.rules=q}me.lex=function(q,ie){var fe=new me(ie);return fe.lex(q)};var ve=me.prototype;return ve.lex=function(q){return q=q.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(q,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(q,ie,fe){ie===void 0&&(ie=[]),fe===void 0&&(fe=!0),q=q.replace(/^ +$/gm,"");for(var Ee,Oe,Ge,tt;q;){if(Ee=this.tokenizer.space(q)){q=q.substring(Ee.raw.length),Ee.type&&ie.push(Ee);continue}if(Ee=this.tokenizer.code(q,ie)){q=q.substring(Ee.raw.length),Ee.type?ie.push(Ee):(tt=ie[ie.length-1],tt.raw+=`
|
|
`+Ee.raw,tt.text+=`
|
|
`+Ee.text);continue}if(Ee=this.tokenizer.fences(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.heading(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.nptable(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.hr(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.blockquote(q)){q=q.substring(Ee.raw.length),Ee.tokens=this.blockTokens(Ee.text,[],fe),ie.push(Ee);continue}if(Ee=this.tokenizer.list(q)){for(q=q.substring(Ee.raw.length),Ge=Ee.items.length,Oe=0;Oe<Ge;Oe++)Ee.items[Oe].tokens=this.blockTokens(Ee.items[Oe].text,[],!1);ie.push(Ee);continue}if(Ee=this.tokenizer.html(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(fe&&(Ee=this.tokenizer.def(q))){q=q.substring(Ee.raw.length),this.tokens.links[Ee.tag]||(this.tokens.links[Ee.tag]={href:Ee.href,title:Ee.title});continue}if(Ee=this.tokenizer.table(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.lheading(q)){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(fe&&(Ee=this.tokenizer.paragraph(q))){q=q.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.text(q,ie)){q=q.substring(Ee.raw.length),Ee.type?ie.push(Ee):(tt=ie[ie.length-1],tt.raw+=`
|
|
`+Ee.raw,tt.text+=`
|
|
`+Ee.text);continue}if(q){var Tt="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(Tt);break}else throw new Error(Tt)}}return ie},ve.inline=function(q){var ie,fe,Ee,Oe,Ge,tt,Tt=q.length;for(ie=0;ie<Tt;ie++){tt=q[ie];switch(tt.type){case"paragraph":case"text":case"heading":{tt.tokens=[],this.inlineTokens(tt.text,tt.tokens);break}case"table":{for(tt.tokens={header:[],cells:[]},Oe=tt.header.length,fe=0;fe<Oe;fe++)tt.tokens.header[fe]=[],this.inlineTokens(tt.header[fe],tt.tokens.header[fe]);for(Oe=tt.cells.length,fe=0;fe<Oe;fe++)for(Ge=tt.cells[fe],tt.tokens.cells[fe]=[],Ee=0;Ee<Ge.length;Ee++)tt.tokens.cells[fe][Ee]=[],this.inlineTokens(Ge[Ee],tt.tokens.cells[fe][Ee]);break}case"blockquote":{this.inline(tt.tokens);break}case"list":{for(Oe=tt.items.length,fe=0;fe<Oe;fe++)this.inline(tt.items[fe].tokens);break}}}return q},ve.inlineTokens=function(q,ie,fe,Ee,Oe){ie===void 0&&(ie=[]),fe===void 0&&(fe=!1),Ee===void 0&&(Ee=!1),Oe===void 0&&(Oe="");var Ge,tt=q,Tt;if(this.tokens.links){var jt=Object.keys(this.tokens.links);if(jt.length>0)for(;(Tt=this.tokenizer.rules.inline.reflinkSearch.exec(tt))!=null;)jt.includes(Tt[0].slice(Tt[0].lastIndexOf("[")+1,-1))&&(tt=tt.slice(0,Tt.index)+"["+"a".repeat(Tt[0].length-2)+"]"+tt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Tt=this.tokenizer.rules.inline.blockSkip.exec(tt))!=null;)tt=tt.slice(0,Tt.index)+"["+"a".repeat(Tt[0].length-2)+"]"+tt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;q;){if(Ge=this.tokenizer.escape(q)){q=q.substring(Ge.raw.length),ie.push(Ge);continue}if(Ge=this.tokenizer.tag(q,fe,Ee)){q=q.substring(Ge.raw.length),fe=Ge.inLink,Ee=Ge.inRawBlock,ie.push(Ge);continue}if(Ge=this.tokenizer.link(q)){q=q.substring(Ge.raw.length),Ge.type==="link"&&(Ge.tokens=this.inlineTokens(Ge.text,[],!0,Ee)),ie.push(Ge);continue}if(Ge=this.tokenizer.reflink(q,this.tokens.links)){q=q.substring(Ge.raw.length),Ge.type==="link"&&(Ge.tokens=this.inlineTokens(Ge.text,[],!0,Ee)),ie.push(Ge);continue}if(Ge=this.tokenizer.strong(q,tt,Oe)){q=q.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],fe,Ee),ie.push(Ge);continue}if(Ge=this.tokenizer.em(q,tt,Oe)){q=q.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],fe,Ee),ie.push(Ge);continue}if(Ge=this.tokenizer.codespan(q)){q=q.substring(Ge.raw.length),ie.push(Ge);continue}if(Ge=this.tokenizer.br(q)){q=q.substring(Ge.raw.length),ie.push(Ge);continue}if(Ge=this.tokenizer.del(q)){q=q.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],fe,Ee),ie.push(Ge);continue}if(Ge=this.tokenizer.autolink(q,Ie)){q=q.substring(Ge.raw.length),ie.push(Ge);continue}if(!fe&&(Ge=this.tokenizer.url(q,Ie))){q=q.substring(Ge.raw.length),ie.push(Ge);continue}if(Ge=this.tokenizer.inlineText(q,Ee,Ue)){q=q.substring(Ge.raw.length),Oe=Ge.raw.slice(-1),ie.push(Ge);continue}if(q){var Ft="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(Ft);break}else throw new Error(Ft)}}return ie},V(me,null,[{key:"rules",get:function(){return{block:ke,inline:De}}}]),me}(),Ve=W.defaults,$e=B.cleanUrl,Ze=B.escape,Qe=function(){function me(le){this.options=le||Ve}var ve=me.prototype;return ve.code=function(q,ie,fe){var Ee=(ie||"").match(/\S*/)[0];if(this.options.highlight){var Oe=this.options.highlight(q,Ee);Oe!=null&&Oe!==q&&(fe=!0,q=Oe)}return Ee?'<pre><code class="'+this.options.langPrefix+Ze(Ee,!0)+'">'+(fe?q:Ze(q,!0))+`</code></pre>
|
|
`:"<pre><code>"+(fe?q:Ze(q,!0))+`</code></pre>
|
|
`},ve.blockquote=function(q){return`<blockquote>
|
|
`+q+`</blockquote>
|
|
`},ve.html=function(q){return q},ve.heading=function(q,ie,fe,Ee){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+Ee.slug(fe)+'">'+q+"</h"+ie+`>
|
|
`:"<h"+ie+">"+q+"</h"+ie+`>
|
|
`},ve.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ve.list=function(q,ie,fe){var Ee=ie?"ol":"ul",Oe=ie&&fe!==1?' start="'+fe+'"':"";return"<"+Ee+Oe+`>
|
|
`+q+"</"+Ee+`>
|
|
`},ve.listitem=function(q){return"<li>"+q+`</li>
|
|
`},ve.checkbox=function(q){return"<input "+(q?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ve.paragraph=function(q){return"<p>"+q+`</p>
|
|
`},ve.table=function(q,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+q+`</thead>
|
|
`+ie+`</table>
|
|
`},ve.tablerow=function(q){return`<tr>
|
|
`+q+`</tr>
|
|
`},ve.tablecell=function(q,ie){var fe=ie.header?"th":"td",Ee=ie.align?"<"+fe+' align="'+ie.align+'">':"<"+fe+">";return Ee+q+"</"+fe+`>
|
|
`},ve.strong=function(q){return"<strong>"+q+"</strong>"},ve.em=function(q){return"<em>"+q+"</em>"},ve.codespan=function(q){return"<code>"+q+"</code>"},ve.br=function(){return this.options.xhtml?"<br/>":"<br>"},ve.del=function(q){return"<del>"+q+"</del>"},ve.link=function(q,ie,fe){if(q=$e(this.options.sanitize,this.options.baseUrl,q),q===null)return fe;var Ee='<a href="'+Ze(q)+'"';return ie&&(Ee+=' title="'+ie+'"'),Ee+=">"+fe+"</a>",Ee},ve.image=function(q,ie,fe){if(q=$e(this.options.sanitize,this.options.baseUrl,q),q===null)return fe;var Ee='<img src="'+q+'" alt="'+fe+'"';return ie&&(Ee+=' title="'+ie+'"'),Ee+=this.options.xhtml?"/>":">",Ee},ve.text=function(q){return q},me}(),Ke=function(){function me(){}var ve=me.prototype;return ve.strong=function(q){return q},ve.em=function(q){return q},ve.codespan=function(q){return q},ve.del=function(q){return q},ve.html=function(q){return q},ve.text=function(q){return q},ve.link=function(q,ie,fe){return""+fe},ve.image=function(q,ie,fe){return""+fe},ve.br=function(){return""},me}(),st=function(){function me(){this.seen={}}var ve=me.prototype;return ve.slug=function(q){var ie=q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var fe=ie;do this.seen[fe]++,ie=fe+"-"+this.seen[fe];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},me}(),it=W.defaults,ut=B.unescape,Je=function(){function me(le){this.options=le||it,this.options.renderer=this.options.renderer||new Qe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new st}me.parse=function(q,ie){var fe=new me(ie);return fe.parse(q)};var ve=me.prototype;return ve.parse=function(q,ie){ie===void 0&&(ie=!0);var fe="",Ee,Oe,Ge,tt,Tt,jt,Ft,In,sn,Wt,Qn,mn,yr,hr,En,Ar,br,Jt,ln=q.length;for(Ee=0;Ee<ln;Ee++){Wt=q[Ee];switch(Wt.type){case"space":continue;case"hr":{fe+=this.renderer.hr();continue}case"heading":{fe+=this.renderer.heading(this.parseInline(Wt.tokens),Wt.depth,ut(this.parseInline(Wt.tokens,this.textRenderer)),this.slugger);continue}case"code":{fe+=this.renderer.code(Wt.text,Wt.lang,Wt.escaped);continue}case"table":{for(In="",Ft="",tt=Wt.header.length,Oe=0;Oe<tt;Oe++)Ft+=this.renderer.tablecell(this.parseInline(Wt.tokens.header[Oe]),{header:!0,align:Wt.align[Oe]});for(In+=this.renderer.tablerow(Ft),sn="",tt=Wt.cells.length,Oe=0;Oe<tt;Oe++){for(jt=Wt.tokens.cells[Oe],Ft="",Tt=jt.length,Ge=0;Ge<Tt;Ge++)Ft+=this.renderer.tablecell(this.parseInline(jt[Ge]),{header:!1,align:Wt.align[Ge]});sn+=this.renderer.tablerow(Ft)}fe+=this.renderer.table(In,sn);continue}case"blockquote":{sn=this.parse(Wt.tokens),fe+=this.renderer.blockquote(sn);continue}case"list":{for(Qn=Wt.ordered,mn=Wt.start,yr=Wt.loose,tt=Wt.items.length,sn="",Oe=0;Oe<tt;Oe++)En=Wt.items[Oe],Ar=En.checked,br=En.task,hr="",En.task&&(Jt=this.renderer.checkbox(Ar),yr?En.tokens.length>0&&En.tokens[0].type==="text"?(En.tokens[0].text=Jt+" "+En.tokens[0].text,En.tokens[0].tokens&&En.tokens[0].tokens.length>0&&En.tokens[0].tokens[0].type==="text"&&(En.tokens[0].tokens[0].text=Jt+" "+En.tokens[0].tokens[0].text)):En.tokens.unshift({type:"text",text:Jt}):hr+=Jt),hr+=this.parse(En.tokens,yr),sn+=this.renderer.listitem(hr,br,Ar);fe+=this.renderer.list(sn,Qn,mn);continue}case"html":{fe+=this.renderer.html(Wt.text);continue}case"paragraph":{fe+=this.renderer.paragraph(this.parseInline(Wt.tokens));continue}case"text":{for(sn=Wt.tokens?this.parseInline(Wt.tokens):Wt.text;Ee+1<ln&&q[Ee+1].type==="text";)Wt=q[++Ee],sn+=`
|
|
`+(Wt.tokens?this.parseInline(Wt.tokens):Wt.text);fe+=ie?this.renderer.paragraph(sn):sn;continue}default:{var _n='Token with "'+Wt.type+'" type was not found.';if(this.options.silent){console.error(_n);return}else throw new Error(_n)}}}return fe},ve.parseInline=function(q,ie){ie=ie||this.renderer;var fe="",Ee,Oe,Ge=q.length;for(Ee=0;Ee<Ge;Ee++){Oe=q[Ee];switch(Oe.type){case"escape":{fe+=ie.text(Oe.text);break}case"html":{fe+=ie.html(Oe.text);break}case"link":{fe+=ie.link(Oe.href,Oe.title,this.parseInline(Oe.tokens,ie));break}case"image":{fe+=ie.image(Oe.href,Oe.title,Oe.text);break}case"strong":{fe+=ie.strong(this.parseInline(Oe.tokens,ie));break}case"em":{fe+=ie.em(this.parseInline(Oe.tokens,ie));break}case"codespan":{fe+=ie.codespan(Oe.text);break}case"br":{fe+=ie.br();break}case"del":{fe+=ie.del(this.parseInline(Oe.tokens,ie));break}case"text":{fe+=ie.text(Oe.text);break}default:{var tt='Token with "'+Oe.type+'" type was not found.';if(this.options.silent){console.error(tt);return}else throw new Error(tt)}}}return fe},me}(),_t=B.merge,gt=B.checkSanitizeDeprecation,mt=B.escape,We=W.getDefaults,Et=W.changeDefaults,ht=W.defaults;function Ne(me,ve,le){if(typeof me=="undefined"||me===null)throw new Error("marked(): input parameter is undefined or null");if(typeof me!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(me)+", string expected");if(typeof ve=="function"&&(le=ve,ve=null),ve=_t({},Ne.defaults,ve||{}),gt(ve),le){var q=ve.highlight,ie;try{ie=Re.lex(me,ve)}catch(Ge){return le(Ge)}var fe=function(tt){var Tt;if(!tt)try{Tt=Je.parse(ie,ve)}catch(jt){tt=jt}return ve.highlight=q,tt?le(tt):le(null,Tt)};if(!q||q.length<3)return fe();if(delete ve.highlight,!ie.length)return fe();var Ee=0;Ne.walkTokens(ie,function(Ge){Ge.type==="code"&&(Ee++,setTimeout(function(){q(Ge.text,Ge.lang,function(tt,Tt){if(tt)return fe(tt);Tt!=null&&Tt!==Ge.text&&(Ge.text=Tt,Ge.escaped=!0),Ee--,Ee===0&&fe()})},0))}),Ee===0&&fe();return}try{var Oe=Re.lex(me,ve);return ve.walkTokens&&Ne.walkTokens(Oe,ve.walkTokens),Je.parse(Oe,ve)}catch(Ge){if(Ge.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+mt(Ge.message+"",!0)+"</pre>";throw Ge}}Ne.options=Ne.setOptions=function(me){return _t(Ne.defaults,me),Et(Ne.defaults),Ne},Ne.getDefaults=We,Ne.defaults=ht,Ne.use=function(me){var ve=_t({},me);if(me.renderer&&function(){var q=Ne.defaults.renderer||new Qe,ie=function(Oe){var Ge=q[Oe];q[Oe]=function(){for(var tt=arguments.length,Tt=new Array(tt),jt=0;jt<tt;jt++)Tt[jt]=arguments[jt];var Ft=me.renderer[Oe].apply(q,Tt);return Ft===!1&&(Ft=Ge.apply(q,Tt)),Ft}};for(var fe in me.renderer)ie(fe);ve.renderer=q}(),me.tokenizer&&function(){var q=Ne.defaults.tokenizer||new se,ie=function(Oe){var Ge=q[Oe];q[Oe]=function(){for(var tt=arguments.length,Tt=new Array(tt),jt=0;jt<tt;jt++)Tt[jt]=arguments[jt];var Ft=me.tokenizer[Oe].apply(q,Tt);return Ft===!1&&(Ft=Ge.apply(q,Tt)),Ft}};for(var fe in me.tokenizer)ie(fe);ve.tokenizer=q}(),me.walkTokens){var le=Ne.defaults.walkTokens;ve.walkTokens=function(q){me.walkTokens(q),le&&le(q)}}Ne.setOptions(ve)},Ne.walkTokens=function(me,ve){for(var le=L(me),q;!(q=le()).done;){var ie=q.value;ve(ie);switch(ie.type){case"table":{for(var fe=L(ie.tokens.header),Ee;!(Ee=fe()).done;){var Oe=Ee.value;Ne.walkTokens(Oe,ve)}for(var Ge=L(ie.tokens.cells),tt;!(tt=Ge()).done;)for(var Tt=tt.value,jt=L(Tt),Ft;!(Ft=jt()).done;){var In=Ft.value;Ne.walkTokens(In,ve)}break}case"list":{Ne.walkTokens(ie.items,ve);break}default:ie.tokens&&Ne.walkTokens(ie.tokens,ve)}}},Ne.Parser=Je,Ne.parser=Je.parse,Ne.Renderer=Qe,Ne.TextRenderer=Ke,Ne.Lexer=Re,Ne.lexer=Re.lex,Ne.Tokenizer=se,Ne.Slugger=st,Ne.parse=Ne;var nt=Ne;return nt})},EJTS:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return C});var oe=H("qVdP"),V=H("jsC+"),I=H("lUTK"),K=H("BvKs"),L=H("sRBo"),N=H("kaz8"),W=H("oBTY"),F=H("7Kak"),R=H("9yH6"),D=H("tJVT"),b=H("cDcd"),p=H.n(b),_=H("9Bee"),f=H("+vTd"),a=H.n(f),d=H("xKgJ"),l=H("Is5a"),i=H.n(l),u=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],c=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],S=function(w){var A,m=w.data,v=w.selectIds,s=w.onSelectCheckBox,o=s===void 0?function(){}:s,E=w.showCheckbox,g=E===void 0?!0:E,O=Object(b.useState)(!1),M=Object(D.a)(O,2),k=M[0],U=M[1],B=function(){if(m.item_type==="JUDGMENT")return p.a.createElement("div",{className:a.a.judgmentContent},m.choices.map(function(ce,se){return p.a.createElement(R.a,{key:se,disabled:!0},ce.choice_text)}));if(m.item_type==="PROGRAM"){var Y;return p.a.createElement("div",{className:a.a.programContent},p.a.createElement(_.a,{value:(Y=m.program_attr)===null||Y===void 0?void 0:Y.description}))}if(m.item_type==="COMBINATION"){var $;return p.a.createElement("div",{className:a.a.combinationContent},m==null||(($=m.sub_item_banks)===null||$===void 0)?void 0:$.map(function(ce,se){var ne,re="(\u9898\u76EE".concat(se+1,"-\u5355\u9009\u9898) ");return p.a.createElement(b.Fragment,null,p.a.createElement("div",{style:{marginTop:10,marginBottom:10}},p.a.createElement(_.a,{value:re+ce.name})),ce.choices.map(function(ue,ee){return p.a.createElement("div",{key:ee,className:a.a.otherContentItem},p.a.createElement("p",null,u[ee]),p.a.createElement(_.a,{className:a.a.otehrContentHtml,value:ue.choice_text}))}),p.a.createElement("div",{className:a.a.con},p.a.createElement("b",{className:"c-grey-333 font14"}," \u7B54\u6848\uFF1A",c==null?void 0:c[ce==null||((ne=ce.choices)===null||ne===void 0)?void 0:ne.findIndex(function(ue){return ue==null?void 0:ue.is_answer})]," "),p.a.createElement("div",null,p.a.createElement("span",null,"\u89E3\u6790\uFF1A"),p.a.createElement(_.a,{className:a.a.parseAnswerHtml,value:ce.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return p.a.createElement("div",{className:a.a.otherContent},m.choices.map(function(ce,se){return p.a.createElement("div",{key:se,className:a.a.otherContentItem},p.a.createElement("p",null,u[se]),p.a.createElement(_.a,{className:a.a.otehrContentHtml,value:ce.choice_text}))}))},y=function(){var Y;return p.a.createElement("div",null,(Y=m.standard_answer)===null||Y===void 0?void 0:Y.map(function($,ce){return p.a.createElement(_.a,{key:ce,className:a.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat($.position,"\uFF09\uFF1A").concat($.answer_text.join("\u3001"))})}))},x=function(){var Y,$,ce,se={SUBJECTIVE:(Y=m.answer_texts)===null||Y===void 0?void 0:Y[0],JUDGMENT:($=m.choices)===null||$===void 0||((ce=$.find(function(Le){return Le.is_answer}))===null||ce===void 0)?void 0:ce.choice_text},ne=m.choices.map(function(Le){return Le.is_answer}).findIndex(function(Le){return Le}),re=ne>-1?c[ne]:"",ue="";m.choices.map(function(Le,ke){Le.is_answer&&(ue+=c[ke])});var ee=se[m.item_type],ae={SINGLE:p.a.createElement(_.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(re||"\u65E0")}),MULTIPLE:p.a.createElement(_.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ue||"\u65E0")}),COMPLETION:y()},ge=p.a.createElement(_.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ee||"\u65E0")});return ae[m.item_type]||ge},j=function(Y){var $=Object(W.a)(v);Y.target.checked?$.push(m.id):$=$.filter(function(ce){return ce!==m.id}),o($)};return p.a.createElement("div",{className:a.a.itemWrap},p.a.createElement("div",{className:a.a.list},g&&p.a.createElement(N.a,{className:"mr10",onChange:j,checked:v.includes(m.id)}),p.a.createElement("div",{className:a.a.title},p.a.createElement(_.a,{key:1,showLines:1,showTextOnly:!0,className:a.a.topicTitleContent,value:m.name})),p.a.createElement("div",{className:a.a.line},p.a.createElement("b",{className:a.a.b1}),p.a.createElement("b",{className:a.a.b2})),p.a.createElement("div",{onClick:function(){return U(!k)},className:a.a.tr},k?"\u6536\u8D77":"\u5C55\u5F00",p.a.createElement("i",{style:{transform:k?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),p.a.createElement("aside",{style:k?{display:"block"}:{display:"none"},className:a.a.itemDetail},p.a.createElement("div",{style:{marginBottom:44}},p.a.createElement(_.a,{key:2,className:a.a.topicTitleContent,value:m.name}),p.a.createElement("div",{className:"".concat(a.a.row," mt15")},B()),p.a.createElement("div",{className:a.a.row},p.a.createElement("div",{className:a.a.updateTimeRow},p.a.createElement("div",{className:a.a.updateTimeWrap},m.item_type==="PROGRAM"&&p.a.createElement("p",{className:a.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(A=m.program_attr)===null||A===void 0?void 0:A.language))))),m.item_type!=="PROGRAM"&&m.item_type!=="COMBINATION"&&p.a.createElement("div",{className:a.a.answerWrapper},p.a.createElement("img",{src:i.a,alt:"",className:a.a.decoration}),p.a.createElement("div",{className:a.a.answer},x()),p.a.createElement("div",{className:a.a.parse},p.a.createElement("div",{className:a.a.parseText},"\u89E3\u6790\uFF1A"),p.a.createElement("div",{className:a.a.parseAnswer},m.analysis?p.a.createElement(_.a,{className:a.a.parseAnswerHtml,value:m.analysis}):"\u6682\u65E0\u89E3\u6790")))))},C=function(w){var A,m,v,s,o,E,g,O,M,k,U,B,y,x,j,z,Y=w.isProblemset,$=w.data,ce=w.user,se=w.activeTabsKey,ne=w.onPublicReview,re=ne===void 0?function(){}:ne,ue=w.onStartExperience,ee=ue===void 0?function(){}:ue,ae=w.onSetPrivate,ge=ae===void 0?function(){}:ae,Le=w.onCorrection,ke=Le===void 0?function(){}:Le,De=w.onCollect,Ue=De===void 0?function(){}:De,Ie=w.onSetPublic,Re=Ie===void 0?function(){}:Ie,Ve=w.onDelete,$e=Ve===void 0?function(){}:Ve,Ze=w.onCancel,Qe=Ze===void 0?function(){}:Ze,Ke=w.onSelect,st=Ke===void 0?function(){}:Ke,it=w.onMoveTo,ut=it===void 0?function(){}:it,Je=w.onSetShare,_t=Je===void 0?function(){}:Je,gt=w.onCancelShare,mt=gt===void 0?function(){}:gt,We=w.onPublish,Et=We===void 0?function(){}:We,ht=w.onCancelPublish,Ne=ht===void 0?function(){}:ht,nt=$.item_type==="PROGRAM"?"/problems/".concat((A=$.program_attr)===null||A===void 0?void 0:A.identifier,"/edit"):"/problemset/edit/".concat($.id),me=se==="0"&&!$.public&&!$.apply&&($.item_type==="PROGRAM"&&((m=$.program_attr)===null||m===void 0?void 0:m.status)!==0||$.item_type!=="PROGRAM"),ve=p.a.createElement(K.a,{forceSubMenuRender:!0,className:a.a.menu},se==="0"&&!$.public&&p.a.createElement(K.a.Item,{key:"-1"},p.a.createElement("a",{className:a.a.actionLink,target:"_blank",href:nt},"\u7F16\u8F91")),(se==="0"||se==="3")&&$.item_type==="PROGRAM"&&((v=$.program_attr)===null||v===void 0?void 0:v.status)!==0&&!$.public&&((s=$.author)===null||s===void 0?void 0:s.login)===((o=ce.userInfo)===null||o===void 0?void 0:o.login)&&p.a.createElement(K.a.Item,{key:"0"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){var fe;return Ne($==null||((fe=$.program_attr)===null||fe===void 0)?void 0:fe.identifier)}},"\u64A4\u9500\u53D1\u5E03")),se==="0"&&p.a.createElement(K.a.Item,{key:"1"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return ut($.id)}},"\u79FB\u52A8\u5230")),se==="0"&&!($!=null&&$.is_share)&&p.a.createElement(K.a.Item,{key:"3"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return _t($.id)}},"\u5171\u4EAB")),(se==="0"&&($==null?void 0:$.is_share)||se==="3"&&((E=$.author)===null||E===void 0?void 0:E.login)===((g=ce.userInfo)===null||g===void 0?void 0:g.login))&&p.a.createElement(K.a.Item,{key:"3"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return mt($.id)}},"\u64A4\u9500\u5171\u4EAB")),me&&p.a.createElement(K.a.Item,{key:"4"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Re($.id)}},"\u516C\u5F00")),se==="0"&&!$.public&&$.apply&&($.item_type==="PROGRAM"&&$.program_attr.status!==0||$.item_type!=="PROGRAM")&&p.a.createElement(K.a.Item,{key:"5"},p.a.createElement("a",{className:a.a.reviewFlag,onClick:re},"\u5BA1\u6838\u4E2D")),(se==="0"||se==="1")&&$.public&&((O=$.author)===null||O===void 0?void 0:O.login)===((M=ce.userInfo)===null||M===void 0?void 0:M.login)&&p.a.createElement(K.a.Item,{key:"6"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return ge($.id)}},"\u64A4\u9500\u516C\u5F00")),se==="2"&&p.a.createElement(K.a.Item,{key:"7"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ue($.id,$.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(se==="0"||se==="3")&&$.item_type==="PROGRAM"&&((k=$.program_attr)===null||k===void 0?void 0:k.status)===0&&!$.public&&((U=$.author)===null||U===void 0?void 0:U.login)===((B=ce.userInfo)===null||B===void 0?void 0:B.login)&&p.a.createElement(K.a.Item,{key:"8"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){var fe;return Et($==null||((fe=$.program_attr)===null||fe===void 0)?void 0:fe.identifier)}},"\u53D1\u5E03")),(se==="1"||se==="3")&&!Object(d.o)()&&!Object(d.m)()&&((y=$.author)===null||y===void 0?void 0:y.login)!==((x=ce.userInfo)===null||x===void 0?void 0:x.login)&&p.a.createElement(K.a.Item,{key:"9"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ue($.id,$.is_collected)}},$.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),se!=="0"&&!Object(d.o)()&&!Object(d.m)()&&p.a.createElement(K.a.Item,{key:"10"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return ke($.id)}},"\u7EA0\u9519")),(se==="0"&&!$.public||se==="1"&&Object(d.o)()&&((j=$.author)===null||j===void 0?void 0:j.login)!==((z=ce.userInfo)===null||z===void 0?void 0:z.login))&&p.a.createElement(K.a.Item,{key:"11"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return $e($.id)}},"\u5220\u9664"))),le=p.a.createElement(K.a,{forceSubMenuRender:!0,className:a.a.menu},p.a.createElement(K.a.Item,{key:"10"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return ke($.id)}},"\u7EA0\u9519"))),q=se!=="0"&&!Object(d.o)()&&!Object(d.m)();return p.a.createElement(p.a.Fragment,null,Y?p.a.createElement(p.a.Fragment,null,$.item_type!=="SUBJECTIVE"&&$.item_type!=="COMBINATION"&&p.a.createElement("span",{className:a.a.textBtn,style:{cursor:"pointer"},onClick:function(){return ee($)}},"\u4F53\u9A8C"),p.a.createElement(V.a,{overlay:ve},p.a.createElement("span",{style:{cursor:"default"},onClick:function(fe){return fe.preventDefault()}},p.a.createElement("span",{className:a.a.textBtn},"\u66F4\u591A")))):q?p.a.createElement(V.a,{className:"ml40",overlay:le},p.a.createElement("span",{style:{cursor:"default"},onClick:function(fe){return fe.preventDefault()}},p.a.createElement("span",null,"\u66F4\u591A"))):p.a.createElement("span",null))};Be.b=S},ELLl:function(rt,Be,H){(function(oe){oe(H("VrN/"))})(function(oe){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(a,d,l){l&&l!=oe.Init&&(a.removeKeyMap(L),a.state.closeBrackets=null),d&&(N(K(d,"pairs")),a.state.closeBrackets=d,a.addKeyMap(L))});function K(a,d){return d=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[d]!=null?a[d]:V[d]}var L={Backspace:R,Enter:D};function N(a){for(var d=0;d<a.length;d++){var l=a.charAt(d),i="'"+l+"'";L[i]||(L[i]=W(l))}}N(V.pairs+"`");function W(a){return function(d){return p(d,a)}}function F(a){var d=a.state.closeBrackets;if(!d||d.override)return d;var l=a.getModeAt(a.getCursor());return l.closeBrackets||d}function R(a){var d=F(a);if(!d||a.getOption("disableInput"))return oe.Pass;for(var l=K(d,"pairs"),i=a.listSelections(),u=0;u<i.length;u++){if(!i[u].empty())return oe.Pass;var c=_(a,i[u].head);if(!c||l.indexOf(c)%2!=0)return oe.Pass}for(var u=i.length-1;u>=0;u--){var S=i[u].head;a.replaceRange("",I(S.line,S.ch-1),I(S.line,S.ch+1),"+delete")}}function D(a){var d=F(a),l=d&&K(d,"explode");if(!l||a.getOption("disableInput"))return oe.Pass;for(var i=a.listSelections(),u=0;u<i.length;u++){if(!i[u].empty())return oe.Pass;var c=_(a,i[u].head);if(!c||l.indexOf(c)%2!=0)return oe.Pass}a.operation(function(){var S=a.lineSeparator()||`
|
|
`;a.replaceSelection(S+S,null),a.execCommand("goCharLeft"),i=a.listSelections();for(var C=0;C<i.length;C++){var T=i[C].head.line;a.indentLine(T,null,!0),a.indentLine(T+1,null,!0)}})}function b(a){var d=oe.cmpPos(a.anchor,a.head)>0;return{anchor:new I(a.anchor.line,a.anchor.ch+(d?-1:1)),head:new I(a.head.line,a.head.ch+(d?1:-1))}}function p(a,d){var l=F(a);if(!l||a.getOption("disableInput"))return oe.Pass;var i=K(l,"pairs"),u=i.indexOf(d);if(u==-1)return oe.Pass;for(var c=K(l,"closeBefore"),S=K(l,"triples"),C=i.charAt(u+1)==d,T=a.listSelections(),w=u%2==0,A,m=0;m<T.length;m++){var v=T[m],s=v.head,o,E=a.getRange(s,I(s.line,s.ch+1));if(w&&!v.empty())o="surround";else if((C||!w)&&E==d)C&&f(a,s)?o="both":S.indexOf(d)>=0&&a.getRange(s,I(s.line,s.ch+3))==d+d+d?o="skipThree":o="skip";else if(C&&s.ch>1&&S.indexOf(d)>=0&&a.getRange(I(s.line,s.ch-2),s)==d+d){if(s.ch>2&&/\bstring/.test(a.getTokenTypeAt(I(s.line,s.ch-2))))return oe.Pass;o="addFour"}else if(C){var g=s.ch==0?" ":a.getRange(I(s.line,s.ch-1),s);if(!oe.isWordChar(E)&&g!=d&&!oe.isWordChar(g))o="both";else return oe.Pass}else if(w&&(E.length===0||/\s/.test(E)||c.indexOf(E)>-1))o="both";else return oe.Pass;if(!A)A=o;else if(A!=o)return oe.Pass}var O=u%2?i.charAt(u-1):d,M=u%2?d:i.charAt(u+1);a.operation(function(){if(A=="skip")a.execCommand("goCharRight");else if(A=="skipThree")for(var k=0;k<3;k++)a.execCommand("goCharRight");else if(A=="surround"){for(var U=a.getSelections(),k=0;k<U.length;k++)U[k]=O+U[k]+M;a.replaceSelections(U,"around"),U=a.listSelections().slice();for(var k=0;k<U.length;k++)U[k]=b(U[k]);a.setSelections(U)}else A=="both"?(a.replaceSelection(O+M,null),a.triggerElectric(O+M),a.execCommand("goCharLeft")):A=="addFour"&&(a.replaceSelection(O+O+O+O,"before"),a.execCommand("goCharRight"))})}function _(a,d){var l=a.getRange(I(d.line,d.ch-1),I(d.line,d.ch+1));return l.length==2?l:null}function f(a,d){var l=a.getTokenAt(I(d.line,d.ch+1));return/\bstring/.test(l.type)&&l.start==d.ch&&(d.ch==0||!/\bstring/.test(a.getTokenTypeAt(d)))}})},FOrL:function(rt,Be,H){rt.exports=H.p+"static/nodata.a6b3f948.png"},HmJG:function(rt,Be,H){},IPdS:function(rt,Be,H){rt.exports={drawerWrap:"drawerWrap___nRvfD",title:"title___e_1lX",problemset:"problemset___1u9oP",content:"content___1WwQ5",delete:"delete___3Q7nc",deleteIcon:"deleteIcon___ObOyh",previewWrap:"previewWrap___25lTY",preview:"preview___3uiyE"}},Is5a:function(rt,Be){rt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(rt,Be){rt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(rt,Be,H){"use strict";H.r(Be);var oe=H("14J3"),V=H("BMrR"),I=H("DjyN"),K=H("NUBc"),L=H("qVdP"),N=H("jsC+"),W=H("T2oS"),F=H("W9HT"),R=H("+L6B"),D=H("2/Rp"),b=H("sPJy"),p=H("bE4q"),_=H("5Dmo"),f=H("3S7+"),a=H("lUTK"),d=H("BvKs"),l=H("sRBo"),i=H("kaz8"),u=H("miYZ"),c=H("tsqr"),S=H("7Kak"),C=H("9yH6"),T=H("2qtc"),w=H("kLXV"),A=H("oBTY"),m=H("k1fw"),v=H("9og8"),s=H("tJVT"),o=H("PpiC"),E=H("5NDa"),g=H("5rEg"),O=H("Znn+"),M=H("ZTPi"),k=H("WmNS"),U=H.n(k),B=H("cDcd"),y=H.n(B),x=H("9kvl"),j=H("55Ip"),z=H("iris"),Y=H("jcZT"),$=H("BdwD"),ce=H("iNYN"),se=H.n(ce),ne=function(at){var Lt=at.problemset,xt=at.globalSetting,St=at.loading,Yt=at.dispatch,hn=Object(o.a)(at,["problemset","globalSetting","loading","dispatch"]);return y.a.createElement(w.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Lt.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){Yt({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){Yt({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:se.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),y.a.createElement("div",{className:se.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},re=Object(x.a)(function(Gt){var at=Gt.problemset,Lt=Gt.loading,xt=Gt.globalSetting;return{problemset:at,globalSetting:xt,loading:Lt.effects}})(ne),ue=H("xlxt"),ee=H.n(ue),ae=H("P/tu"),ge=H("wd/R"),Le=H.n(ge),ke=function(at){var Lt=at.problemset,xt=at.dispatch,St=Object(B.useState)([]),Yt=Object(s.a)(St,2),hn=Yt[0],yn=Yt[1],qt=function(){xt({type:"problemset/setActionTabs",payload:{}})};Object(B.useEffect)(function(){if(Lt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var en,un;yn([(en=Lt.actionTabs)===null||en===void 0||((un=en.params)===null||un===void 0)?void 0:un.group_id])}},[Lt.actionTabs.key]);var vn=function(){if(hn.length===0){c.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}console.log(hn[0],22),kn({},"/api/item_banks/export.xlsx?group_id=".concat(hn[0]),function(un,tr){var Nn;if(((Nn=un.target.response)===null||Nn===void 0?void 0:Nn.type)==="application/json"){var kt=new FileReader;kt.readAsText(un.target.response,"utf-8"),kt.addEventListener("loadend",function(){var rn=JSON.parse(kt.result);c.b.warn((rn==null?void 0:rn.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458")});return}var pn=new Blob([un.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),er="item_bank_template_".concat(Le()().format("YYYY-MM-DD HH:mm:ss"),".xlsx");if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(pn,er);else{var Rn=URL.createObjectURL(pn),zt=document.createElement("a");zt.href=Rn,zt.setAttribute("download",er),document.body.appendChild(zt),zt.click(),window.URL.revokeObjectURL(zt.href)}qt()})},kn=function(un,tr,Nn,kt){var pn=tr,er=new window.XMLHttpRequest;return er.withCredentials=!0,er.addEventListener("load",function(Rn){Nn(Rn,er)},!1),er.addEventListener("error",function(Rn){kt&&kt(Rn)},!1),er.responseType="blob",er.open("GET",pn),er.send(null),er};return y.a.createElement(w.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:Lt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:ee.a.customModal,onCancel:qt,onOk:vn},y.a.createElement("aside",{className:ee.a.exportModal},y.a.createElement(ae.a,{value:hn,onChange:function(un){return yn(un)}})))},De=Object(x.a)(function(Gt){var at=Gt.problemset;return{problemset:at}})(ke),Ue=H("i8i3"),Ie=H.n(Ue),Re=H("WCUW"),Ve=H("Ty5D"),$e=function(at){var Lt,xt,St=at.problemset,Yt=at.dispatch,hn=at.onOk,yn=Object(Ve.i)(),qt=Object(B.useState)([]),vn=Object(s.a)(qt,2),kn=vn[0],en=vn[1],un=Object(B.useState)(1),tr=Object(s.a)(un,2),Nn=tr[0],kt=tr[1],pn=Object(B.useState)([]),er=Object(s.a)(pn,2),Rn=er[0],zt=er[1],rn=Object(B.useState)([]),Tn=Object(s.a)(rn,2),Pt=Tn[0],It=Tn[1],Mt=Object(B.useState)(!0),Ae=Object(s.a)(Mt,2),Vt=Ae[0],dn=Ae[1],sr=Object(B.useState)(!1),cn=Object(s.a)(sr,2),Hr=cn[0],Kr=cn[1],Sr=Object(B.useState)(!1),On=Object(s.a)(Sr,2),At=On[0],lr=On[1];Object(B.useEffect)(function(){if(St.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var Nt,Dt;$n(),zt([(Nt=St.actionTabs)===null||Nt===void 0||((Dt=Nt.params)===null||Dt===void 0)?void 0:Dt.group_id])}},[St.actionTabs.key]);var $n=function(){var Nt=Object(v.a)(U.a.mark(function Dt(){var Qt,Dn,bn;return U.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return dn(!0),nr.next=3,Object(Re.y)({type:0,page:1,per_page:10,order_by:"new"});case 3:Qt=nr.sent,Qt!=null&&Qt.item_banks_group&&(Dn={id:-1,item_banks_count:(Qt==null?void 0:Qt.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},bn=[Dn].concat((Qt==null?void 0:Qt.item_banks_group)||[]),en(bn)),dn(!1);case 6:case"end":return nr.stop()}},Dt)}));return function(){return Nt.apply(this,arguments)}}(),jn=function(){Yt({type:"problemset/setActionTabs",payload:{}})},Gr=function(){var Nt=Object(v.a)(U.a.mark(function Dt(){var Qt;return U.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(!(Rn.length===0)){bn.next=3;break}return c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),bn.abrupt("return");case 3:if(!(Nn===1)){bn.next=6;break}return kt(2),bn.abrupt("return");case 6:return Kr(!0),bn.next=9,Object(Re.l)({item_banks_group_ids:Rn,clazz:"ItemBank",group_ids:Pt});case 9:Qt=bn.sent,(Qt==null?void 0:Qt.status)===0&&(hn(),jn()),Kr(!1);case 12:case"end":return bn.stop()}},Dt)}));return function(){return Nt.apply(this,arguments)}}(),Rt=function(Dt){zt(Dt),lr(Dt.length===kn.length)};return y.a.createElement(w.a,{centered:!0,afterClose:function(){It([]),kt(1),lr(!1),en([])},title:"\u5171\u4EAB\u8BD5\u9898".concat(Nn,"/2"),visible:St.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:Ie.a.customModal,onCancel:jn},y.a.createElement("aside",{className:Ie.a.shareModal},y.a.createElement(F.a,{spinning:Vt},y.a.createElement("div",{className:Ie.a.content},Nn===1&&y.a.createElement("div",{className:Ie.a.group},y.a.createElement(ae.a,{value:Rn,onChange:function(Dt){return zt(Dt)}})),Nn===2&&y.a.createElement("div",{className:Ie.a.teachGroup},y.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),y.a.createElement(i.a.Group,{value:Pt,onChange:function(Dt){return It(Dt)}},St==null||((Lt=St.teachGroupData)===null||Lt===void 0||((xt=Lt.groups)===null||xt===void 0))?void 0:xt.map(function(Nt){return y.a.createElement(i.a,{key:Nt.group_id,value:Nt.group_id},Nt==null?void 0:Nt.name)})))),y.a.createElement("div",{className:Ie.a.footer},y.a.createElement(D.a,{onClick:jn},"\u53D6\u6D88"),y.a.createElement(D.a,{loading:Hr,onClick:Gr,type:"primary"},Nn===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},Ze=Object(x.a)(function(Gt){var at=Gt.problemset;return{problemset:at}})($e),Qe=function(at){var Lt=at.problemset,xt=at.globalSetting,St=at.loading,Yt=at.dispatch,hn=at.onReloadData,yn=hn===void 0?function(){}:hn,qt=Object(o.a)(at,["problemset","globalSetting","loading","dispatch","onReloadData"]),vn=Object(B.useRef)(!1),kn=Object(B.useState)(!1),en=Object(s.a)(kn,2),un=en[0],tr=en[1];Object(B.useEffect)(function(){Lt.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?Nn():tr(!0):tr(!1)},[Lt.actionTabs.key]);var Nn=function(){var kt=Object(v.a)(U.a.mark(function pn(){var er;return U.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return vn.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),zt.next=3,Yt({type:"problemset/setPrivate",payload:Lt.actionTabs.params});case 3:er=zt.sent,Yt({type:"problemset/setActionTabs",payload:{}}),vn.current=!1,er.status===0&&yn();case 7:case"end":return zt.stop()}},pn)}));return function(){return kt.apply(this,arguments)}}();return y.a.createElement(w.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:un,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:St["problemset/setPrivate"],width:"442px",onOk:Nn,onCancel:function(){Yt({type:"problemset/setActionTabs",payload:{}}),vn.current=!1}},y.a.createElement("div",{className:se.a.modalContentLeft},"\u672C\u9898\u5DF2\u516C\u5F00\uFF0C\u64A4\u9500\u516C\u5F00\u53EF\u80FD\u5BFC\u81F4\u90E8\u5206\u7528\u6237\u5BF9\u672C\u9898\u7684\u4F7F\u7528\u53D7\u635F\u3002"),y.a.createElement("div",{className:se.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),y.a.createElement("div",null,y.a.createElement(i.a,{className:"mt10",defaultChecked:!1,onChange:function(pn){return vn.current=pn.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},Ke=Object(x.a)(function(Gt){var at=Gt.problemset,Lt=Gt.loading,xt=Gt.globalSetting;return{problemset:at,globalSetting:xt,loading:Lt.effects}})(Qe),st=function(at){var Lt=at.problemset,xt=at.globalSetting,St=at.loading,Yt=at.dispatch,hn=at.onReloadData,yn=hn===void 0?function(){}:hn,qt=Object(o.a)(at,["problemset","globalSetting","loading","dispatch","onReloadData"]),vn=function(){var kn=Object(v.a)(U.a.mark(function en(){var un;return U.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Yt({type:"problemset/handleDelete",payload:Lt.actionTabs.params});case 2:un=Nn.sent,Yt({type:"problemset/setActionTabs",payload:{}}),un.status===0&&yn();case 5:case"end":return Nn.stop()}},en)}));return function(){return kn.apply(this,arguments)}}();return y.a.createElement(w.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Lt.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:St["problemset/handleDelete"],width:"442px",onOk:vn,onCancel:function(){Yt({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:se.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),y.a.createElement("div",{className:se.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},it=Object(x.a)(function(Gt){var at=Gt.problemset,Lt=Gt.loading,xt=Gt.globalSetting;return{problemset:at,globalSetting:xt,loading:Lt.effects}})(st),ut=H("LvDl"),Je=H("9Bee"),_t=function(at){var Lt,xt=at.problemset,St=at.dispatch,Yt=Object(B.useState)({}),hn=Object(s.a)(Yt,2),yn=hn[0],qt=hn[1],vn=Object(B.useState)([]),kn=Object(s.a)(vn,2),en=kn[0],un=kn[1],tr=Object(B.useState)(!1),Nn=Object(s.a)(tr,2),kt=Nn[0],pn=Nn[1],er=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(B.useEffect)(function(){var Tn;if((xt==null||((Tn=xt.actionTabs)===null||Tn===void 0)?void 0:Tn.key)==="SINGLE"){var Pt,It=Object(ut.cloneDeep)(xt==null||((Pt=xt.actionTabs)===null||Pt===void 0)?void 0:Pt.params);qt(It),un(It.choices)}},[xt==null||((Lt=xt.actionTabs)===null||Lt===void 0)?void 0:Lt.key]);var Rn=function(){var Tn=Object(v.a)(U.a.mark(function Pt(){var It,Mt;return U.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(en.some(function(dn){return dn==null?void 0:dn.checked})){Vt.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Vt.abrupt("return");case 3:kt&&(Mt=Object(ut.cloneDeep)(xt==null||((It=xt.actionTabs)===null||It===void 0)?void 0:It.params),un(Mt.choices)),pn(!kt);case 5:case"end":return Vt.stop()}},Pt)}));return function(){return Tn.apply(this,arguments)}}(),zt=function(Pt,It){console.log(Pt.target.checked);var Mt=en.map(function(Ae,Vt){return Object(m.a)(Object(m.a)({},Ae),{},{checked:Vt===It?Pt.target.checked:!1})});un(Mt)},rn=function(){qt({}),un([]),pn(!1),St({type:"problemset/setActionTabs",payload:{}})};return y.a.createElement(w.a,{centered:!0,destroyOnClose:!0,visible:xt.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:kt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Rn,onCancel:rn},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),y.a.createElement(Je.a,{value:yn==null?void 0:yn.name}),en==null?void 0:en.map(function(Tn,Pt){var It=Tn.is_answer,Mt=Tn.checked,Ae=Tn.choice_text,Vt="";return kt&&It&&(Vt=se.a.green),kt&&!It&&Mt&&(Vt=se.a.red),y.a.createElement("div",{key:Pt,style:{pointerEvents:kt?"none":"auto"},className:"".concat(se.a.row," ").concat(Vt)},y.a.createElement(C.a,{onChange:function(sr){return zt(sr,Pt)},checked:Mt}),y.a.createElement("span",null,er[Pt],".\xA0"),y.a.createElement(Je.a,{className:se.a.html,value:Ae}),kt&&It&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),kt&&!It&&Mt&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),kt&&y.a.createElement(B.Fragment,null,y.a.createElement("div",{className:se.a.line}),y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),er[en.findIndex(function(Tn){return Tn.is_answer})]),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(yn==null?void 0:yn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},gt=Object(x.a)(function(Gt){var at=Gt.problemset;return{problemset:at}})(_t),mt=function(at){var Lt,xt=at.problemset,St=at.dispatch,Yt=Object(B.useState)({}),hn=Object(s.a)(Yt,2),yn=hn[0],qt=hn[1],vn=Object(B.useState)([]),kn=Object(s.a)(vn,2),en=kn[0],un=kn[1],tr=Object(B.useState)(!1),Nn=Object(s.a)(tr,2),kt=Nn[0],pn=Nn[1],er=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(B.useEffect)(function(){var Pt;if((xt==null||((Pt=xt.actionTabs)===null||Pt===void 0)?void 0:Pt.key)==="MULTIPLE"){var It,Mt=Object(ut.cloneDeep)(xt==null||((It=xt.actionTabs)===null||It===void 0)?void 0:It.params);qt(Mt),un(Mt.choices)}},[xt==null||((Lt=xt.actionTabs)===null||Lt===void 0)?void 0:Lt.key]);var Rn=function(){var Pt=Object(v.a)(U.a.mark(function It(){var Mt,Ae;return U.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(en.some(function(sr){return sr==null?void 0:sr.checked})){dn.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),dn.abrupt("return");case 3:kt&&(Ae=Object(ut.cloneDeep)(xt==null||((Mt=xt.actionTabs)===null||Mt===void 0)?void 0:Mt.params),un(Ae.choices)),pn(!kt);case 5:case"end":return dn.stop()}},It)}));return function(){return Pt.apply(this,arguments)}}(),zt=function(It,Mt){console.log(It.target.checked);var Ae=en.map(function(Vt,dn){return Object(m.a)(Object(m.a)({},Vt),{},{checked:dn===Mt?It.target.checked:Vt.checked})});un(Ae)},rn=function(){qt({}),un([]),pn(!1),St({type:"problemset/setActionTabs",payload:{}})},Tn=function(){var It="";return en.forEach(function(Mt,Ae){Mt.is_answer&&(It=It+er[Ae])}),It};return y.a.createElement(w.a,{centered:!0,destroyOnClose:!0,visible:xt.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:kt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Rn,onCancel:rn},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),y.a.createElement(Je.a,{value:yn==null?void 0:yn.name}),en==null?void 0:en.map(function(Pt,It){var Mt=Pt.is_answer,Ae=Pt.checked,Vt=Pt.choice_text,dn="";return kt&&Mt&&(dn=se.a.green),kt&&!Mt&&Ae&&(dn=se.a.red),y.a.createElement("div",{key:It,style:{pointerEvents:kt?"none":"auto"},className:"".concat(se.a.row," ").concat(dn)},y.a.createElement(i.a,{style:{padding:3},onChange:function(cn){return zt(cn,It)},checked:Ae}),y.a.createElement("span",null,er[It],".\xA0"),y.a.createElement(Je.a,{className:se.a.html,value:Vt}),kt&&Mt&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),kt&&!Mt&&Ae&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),kt&&y.a.createElement(B.Fragment,null,y.a.createElement("div",{className:se.a.line}),y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),Tn()),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(yn==null?void 0:yn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},We=Object(x.a)(function(Gt){var at=Gt.problemset;return{problemset:at}})(mt),Et=function(at){var Lt,xt,St=at.problemset,Yt=at.dispatch,hn=Object(B.useState)({}),yn=Object(s.a)(hn,2),qt=yn[0],vn=yn[1],kn=Object(B.useState)([]),en=Object(s.a)(kn,2),un=en[0],tr=en[1],Nn=Object(B.useState)(!1),kt=Object(s.a)(Nn,2),pn=kt[0],er=kt[1],Rn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(B.useEffect)(function(){var Pt;if((St==null||((Pt=St.actionTabs)===null||Pt===void 0)?void 0:Pt.key)==="JUDGMENT"){var It,Mt=Object(ut.cloneDeep)(St==null||((It=St.actionTabs)===null||It===void 0)?void 0:It.params);vn(Mt),tr(Mt.choices)}},[St==null||((Lt=St.actionTabs)===null||Lt===void 0)?void 0:Lt.key]);var zt=function(){var Pt=Object(v.a)(U.a.mark(function It(){var Mt,Ae;return U.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(un.some(function(sr){return sr==null?void 0:sr.checked})){dn.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),dn.abrupt("return");case 3:pn&&(Ae=Object(ut.cloneDeep)(St==null||((Mt=St.actionTabs)===null||Mt===void 0)?void 0:Mt.params),tr(Ae.choices)),er(!pn);case 5:case"end":return dn.stop()}},It)}));return function(){return Pt.apply(this,arguments)}}(),rn=function(It,Mt){console.log(It.target.checked);var Ae=un.map(function(Vt,dn){return Object(m.a)(Object(m.a)({},Vt),{},{checked:dn===Mt?It.target.checked:!1})});tr(Ae)},Tn=function(){vn({}),tr([]),er(!1),Yt({type:"problemset/setActionTabs",payload:{}})};return y.a.createElement(w.a,{centered:!0,destroyOnClose:!0,visible:St.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:pn?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:zt,onCancel:Tn},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),y.a.createElement(Je.a,{value:qt==null?void 0:qt.name}),un==null?void 0:un.map(function(Pt,It){var Mt=Pt.is_answer,Ae=Pt.checked,Vt=Pt.choice_text,dn="";return pn&&Mt&&(dn=se.a.green),pn&&!Mt&&Ae&&(dn=se.a.red),y.a.createElement("div",{key:It,style:{pointerEvents:pn?"none":"auto"},className:"".concat(se.a.row," ").concat(dn)},y.a.createElement(C.a,{onChange:function(cn){return rn(cn,It)},checked:Ae}),y.a.createElement(Je.a,{className:se.a.html,value:Vt}),pn&&Mt&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),pn&&!Mt&&Ae&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),pn&&y.a.createElement(B.Fragment,null,y.a.createElement("div",{className:se.a.line}),y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(xt=un.find(function(Pt){return Pt.is_answer}))===null||xt===void 0?void 0:xt.choice_text),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(qt==null?void 0:qt.analysis)||"\u6682\u65E0\u89E3\u6790"))))},ht=Object(x.a)(function(Gt){var at=Gt.problemset;return{problemset:at}})(Et),Ne=function(at){var Lt,xt,St=at.problemset,Yt=at.dispatch,hn=Object(B.useState)({}),yn=Object(s.a)(hn,2),qt=yn[0],vn=yn[1],kn=Object(B.useState)([]),en=Object(s.a)(kn,2),un=en[0],tr=en[1],Nn=Object(B.useState)(!1),kt=Object(s.a)(Nn,2),pn=kt[0],er=kt[1],Rn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(B.useEffect)(function(){var Pt;if((St==null||((Pt=St.actionTabs)===null||Pt===void 0)?void 0:Pt.key)==="COMPLETION"){var It,Mt,Ae=Object(ut.cloneDeep)(St==null||((It=St.actionTabs)===null||It===void 0)?void 0:It.params);vn(Ae),tr(Ae==null||((Mt=Ae.standard_answer)===null||Mt===void 0)?void 0:Mt.map(function(Vt){return{value:"",answer:(Vt==null?void 0:Vt.answer_text)||[]}}))}},[St==null||((Lt=St.actionTabs)===null||Lt===void 0)?void 0:Lt.key]);var zt=function(){var Pt=Object(v.a)(U.a.mark(function It(){var Mt,Ae,Vt;return U.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:if(!un.some(function(cn){return(cn==null?void 0:cn.value)===""})){sr.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),sr.abrupt("return");case 3:pn&&(Vt=Object(ut.cloneDeep)(St==null||((Mt=St.actionTabs)===null||Mt===void 0)?void 0:Mt.params),tr(Vt==null||((Ae=Vt.standard_answer)===null||Ae===void 0)?void 0:Ae.map(function(cn){return{value:"",answer:(cn==null?void 0:cn.answer_text)||[]}}))),er(!pn);case 5:case"end":return sr.stop()}},It)}));return function(){return Pt.apply(this,arguments)}}(),rn=function(It,Mt){var Ae=un.map(function(Vt,dn){return Object(m.a)(Object(m.a)({},Vt),{},{value:dn===Mt?It.target.value:Vt.value})});tr(Ae)},Tn=function(){vn({}),tr([]),er(!1),Yt({type:"problemset/setActionTabs",payload:{}})};return y.a.createElement(w.a,{centered:!0,destroyOnClose:!0,visible:St.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:pn?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:zt,onCancel:Tn},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),y.a.createElement(Je.a,{value:qt==null?void 0:qt.name}),un==null?void 0:un.map(function(Pt,It){var Mt=Pt.value,Ae=Pt.answer,Vt="";return pn&&Ae!==null&&Ae!==void 0&&Ae.includes(Mt)&&(Vt=se.a.green),pn&&!(Ae!=null&&Ae.includes(Mt))&&(Vt=se.a.red),y.a.createElement("div",{key:It,style:{pointerEvents:pn?"none":"auto",marginTop:10},className:"".concat(se.a.row," ").concat(Vt)},y.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",It+1,"\u7B54\u6848:"),y.a.createElement(g.a.TextArea,{className:se.a.textArea,style:{width:610,marginRight:10},onChange:function(sr){return rn(sr,It)},value:Mt}),pn&&(Ae==null?void 0:Ae.includes(Mt))&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),pn&&!(Ae!=null&&Ae.includes(Mt))&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),pn&&y.a.createElement(B.Fragment,null,y.a.createElement("div",{className:se.a.line}),qt==null||((xt=qt.standard_answer)===null||xt===void 0)?void 0:xt.map(function(Pt,It){var Mt;return y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u586B\u7A7A",It+1,"\u7B54\u6848:\xA0"),(Pt==null||((Mt=Pt.answer_text)===null||Mt===void 0)?void 0:Mt.join("\u3001"))||"")}),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(qt==null?void 0:qt.analysis)||"\u6682\u65E0\u89E3\u6790"))))},nt=Object(x.a)(function(Gt){var at=Gt.problemset;return{problemset:at}})(Ne),me=H("SAoR"),ve=H("tK3L"),le=H.n(ve),q=H("bbsP"),ie=H("/wGt"),fe=H("IPdS"),Ee=H.n(fe),Oe=[],Ge=function(at){Oe.forEach(function(Lt){if(at.target===Lt.element||tt.isParent(at.target,Lt.element))return;Lt.callbacks.forEach(function(xt){return xt()})})};window.document.body?window.document.body.addEventListener("click",Ge):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",Ge)});var tt={isParent:function(at,Lt){for(var xt=at;xt&&xt.tagName&&xt.tagName.toLowerCase()!=="body";){if(xt===Lt)return!0;xt=xt.parentNode}return!1},init:function(at,Lt){var xt=Oe.filter(function(St){return St.element===at});return xt.length>0?xt[0].callbacks.push(Lt):Oe.push({element:at,callbacks:[Lt]}),{clear:function(){Oe=Oe.filter(function(Yt){return Yt.element!==at})}}}},Tt=tt,jt=[{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"}],Ft=function(at){var Lt=at.visible,xt=at.basketData,St=at.basketTotal,Yt=at.onClose,hn=Yt===void 0?function(){}:Yt,yn=at.onDelete,qt=yn===void 0?function(){}:yn,vn=Object(B.useRef)(),kn=Object(B.useRef)();return Object(B.useEffect)(function(){return kn.current?(St>=0&&!vn.current&&(vn.current=Tt.init(kn.current,function(){hn()})),function(){vn.current&&vn.current.clear()}):void 0},[kn.current]),y.a.createElement(ie.a,{className:Ee.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:Lt,forceRender:!0,onClose:hn},St>0?y.a.createElement("div",{style:{height:"100%"},ref:kn},y.a.createElement("div",{className:Ee.a.title},"\u8BD5\u9898\u7BEE"),jt.map(function(en){return xt[en.stateName]>0&&y.a.createElement("div",{className:Ee.a.problemset,key:en.type},y.a.createElement("div",{className:Ee.a.content},en.typeName,"(",xt[en.stateName],")"),y.a.createElement("div",{className:Ee.a.delete,onClick:function(){return qt(en.type)}},y.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Ee.a.deleteIcon)})))}),y.a.createElement("div",{className:Ee.a.previewWrap},y.a.createElement("div",{className:Ee.a.preview,onClick:function(){return x.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):y.a.createElement("div",{ref:kn},y.a.createElement($.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},In={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"},sn=function(at){var Lt,xt,St=at.problemset,Yt=at.globalSetting,hn=at.loading,yn=at.dispatch,qt=at.onReloadData,vn=qt===void 0?function(){}:qt,kn=at.onReloadBasketData,en=kn===void 0?function(){}:kn,un=Object(o.a)(at,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),tr=function(){var Nn=Object(v.a)(U.a.mark(function kt(){var pn;return U.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,yn({type:"problemset/basketDelete",payload:St.actionTabs.params});case 2:pn=Rn.sent,yn({type:"problemset/setActionTabs",payload:{}}),pn.status===0&&(vn(),en());case 5:case"end":return Rn.stop()}},kt)}));return function(){return Nn.apply(this,arguments)}}();return y.a.createElement(w.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:St.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:hn["problemset/handleDelete"],width:"442px",onOk:tr,onCancel:function(){yn({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:se.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",In[(Lt=St.actionTabs)===null||Lt===void 0||((xt=Lt.params)===null||xt===void 0)?void 0:xt.type]))},Wt=Object(x.a)(function(Gt){var at=Gt.problemset,Lt=Gt.loading,xt=Gt.globalSetting;return{problemset:at,globalSetting:xt,loading:Lt.effects}})(sn),Qn=H("A60/"),mn=H.n(Qn),yr=function(at){var Lt=at.count,xt=at.visibleBasket,St=at.onToggleVisible,Yt=St===void 0?function(){}:St;return y.a.createElement("div",{className:"".concat(xt?mn.a.right180:mn.a.right20," ").concat(mn.a.wrap)},y.a.createElement(f.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},y.a.createElement("div",{className:mn.a.basket,onClick:Yt},Lt>0&&y.a.createElement("div",{className:mn.a.count},Lt),y.a.createElement("span",{className:mn.a.iconWrap},y.a.createElement("i",{className:"".concat(mn.a.icon," iconfont icon-shitilan")})),y.a.createElement("p",{className:mn.a.name},"\u8BD5\u9898\u7BEE"))))},hr=H("EJTS"),En=H("LE3n"),Ar=H("1vsH"),br=H("xKgJ"),Jt=H("/zsF"),ln=H("PArb"),_n=H("jCWc"),qn=H("kPKH"),Er=H("y8nQ"),Ir=H("Vl3Y"),Oa=H("nSDg"),xn=H.n(Oa),Bt=H("HBuW"),na=H("NLgs"),ya=H("vkP9"),ra=g.a.Search,Wn={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},Zr={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"}]},Na=function(at){var Lt,xt,St,Yt,hn=at.classroomList,yn=at.loading,qt=at.dispatch,vn=at.cb,kn=at.shixunIds,en=kn===void 0?[]:kn,un=Object(Ve.i)(),tr=Object(Ve.h)(),Nn=hn.actionTabs,kt=Ir.a.useForm(),pn=Object(s.a)(kt,1),er=pn[0],Rn=hn.shixunLists,zt=Object(B.useState)([]),rn=Object(s.a)(zt,2),Tn=rn[0],Pt=rn[1],It=Object(B.useState)([]),Mt=Object(s.a)(It,2),Ae=Mt[0],Vt=Mt[1],dn=Object(B.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}),sr=Object(s.a)(dn,2),cn=sr[0],Hr=sr[1];Object(B.useEffect)(function(){hn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&qt({type:"classroomList/getShixunLists",payload:Object(m.a)({},cn)})},[hn.actionTabs.key]),Object(B.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(B.useEffect)(function(){Kr()},[un]);var Kr=function(){var At=Object(v.a)(U.a.mark(function lr(){var $n;return U.a.wrap(function(Gr){for(;;)switch(Gr.prev=Gr.next){case 0:return Gr.next=2,Object(Bt.pb)({});case 2:$n=Gr.sent,Vt(($n==null?void 0:$n.disciplines)||[]);case 4:case"end":return Gr.stop()}},lr)}));return function(){return At.apply(this,arguments)}}(),Sr=function(lr,$n,jn){cn.tag_level=lr,cn.sub_discipline_id=$n,cn.discipline_id=jn,Hr(Object(m.a)({},cn)),qt({type:"classroomList/getShixunLists",payload:Object(m.a)({},cn)})},On=function(){qt({type:"classroomList/setActionTabs",payload:{}}),Hr({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 hn.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:y.a.createElement(ie.a,{placement:"bottom",height:"100%",closable:!0,onClose:On,visible:hn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:xn.a.drawer,footer:y.a.createElement("div",{className:"tc"},y.a.createElement(D.a,{size:"large",onClick:function(){On(),Pt([])},style:{marginRight:8}},"\u53D6\u6D88"),y.a.createElement(D.a,{size:"large",onClick:Object(v.a)(U.a.mark(function At(){var lr,$n,jn;return U.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:lr=function(Dt){var Qt=Tn[Dt];if(en.includes(Qt)){var Dn,bn;return c.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(Rn==null||((Dn=Rn.shixun_list)===null||Dn===void 0||((bn=Dn.find(function(Hn){return Hn.id===Qt}))===null||bn===void 0))?void 0:bn.title)),{v:void 0}}},$n=0;case 2:if(!($n<(Tn==null?void 0:Tn.length))){Rt.next=9;break}if(jn=lr($n),!(typeof jn=="object")){Rt.next=6;break}return Rt.abrupt("return",jn.v);case 6:$n++,Rt.next=2;break;case 9:On(),vn(Tn),Pt([]);case 12:case"end":return Rt.stop()}},At)})),type:"primary"},"\u786E\u5B9A"))},y.a.createElement("section",{className:"tc"},y.a.createElement(ya.a,{onChange:function(lr){Hr(Object(m.a)(Object(m.a)(Object(m.a)({},cn),lr),{},{page:1})),qt({type:"classroomList/getShixunLists",payload:Object(m.a)(Object(m.a)(Object(m.a)({},cn),lr),{},{page:1})})}})),y.a.createElement("section",{className:"edu-container"},y.a.createElement("ul",{className:xn.a.menu},y.a.createElement("li",null,Wn.name),Wn==null||((Lt=Wn.children)===null||Lt===void 0)?void 0:Lt.map(function(At,lr){return y.a.createElement("li",{className:cn[Wn.id]==At.id?xn.a.actived:"",key:At.id,onClick:function(){cn[Wn.id]=At.id,Hr(Object(m.a)({},cn)),qt({type:"classroomList/getShixunLists",payload:Object(m.a)({},cn)})}},y.a.createElement("strong",null,At.name))})),y.a.createElement("ul",{className:xn.a.menuDirection},y.a.createElement("li",{className:xn.a.directionName},"\u65B9\u5411"),y.a.createElement("li",{className:cn.discipline_id?"":xn.a.actived,onClick:function(){Sr(null,null,null)}},y.a.createElement("strong",null,"\u5168\u90E8")),Ae==null?void 0:Ae.map(function(At,lr){return y.a.createElement("li",{key:lr,className:cn.discipline_id==At.id?xn.a.actived:""},y.a.createElement("strong",{onClick:function(){Sr(1,null,At.id)}},At.name),y.a.createElement("div",null,At.sub_disciplines.map(function($n,jn){return y.a.createElement("div",{key:jn,className:"mt5"},y.a.createElement("div",{className:cn.sub_discipline_id==$n.id?"".concat(xn.a.actived2," ").concat(xn.a.subTag):xn.a.subTag,onClick:function(){Sr(2,$n.id,At.id)}},$n.name),y.a.createElement("ul",{className:"mt5"},$n.tags&&$n.tags.map(function(Gr,Rt){return y.a.createElement("li",{key:Rt,className:cn.sub_discipline_id==Gr.id&&cn.tag_level===3?xn.a.actived2:"",onClick:function(){Sr(3,Gr.id,At.id)}},Gr.name)})))})))})),y.a.createElement("ul",{className:xn.a.menu},y.a.createElement("li",null,Zr.name),Zr==null||((xt=Zr.children)===null||xt===void 0)?void 0:xt.map(function(At,lr){return y.a.createElement("li",{className:cn[Zr.id]==At.id?xn.a.actived:"",key:At.name,onClick:function(){cn[Zr.id]=At.id,Hr(Object(m.a)({},cn)),qt({type:"classroomList/getShixunLists",payload:Object(m.a)({},cn)})}},y.a.createElement("strong",null,At.name))})),y.a.createElement(V.a,null,y.a.createElement(qn.a,{flex:"1"},y.a.createElement("div",{className:xn.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"},Tn.length),"\u4E2A\u5B9E\u8BAD"),y.a.createElement("li",null,"\u5171",y.a.createElement("span",{className:"c-blue"},Rn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),y.a.createElement("li",{className:"current",onClick:function(){var lr=Object(m.a)(Object(m.a)({},cn),{},{order:cn.order==="asc"?"desc":"asc"});Hr(lr),qt({type:"classroomList/getShixunLists",payload:lr})}},"\u5B66\u4E60\u4EBA\u6570",y.a.createElement("p",{className:"edu-sorter current ".concat(cn.order)},cn.order==="asc"?y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),y.a.createElement(qn.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),Rn==null||((St=Rn.shixun_list)===null||St===void 0)?void 0:St.map(function(At,lr){return y.a.createElement("div",{className:xn.a.listItem,key:lr},y.a.createElement(i.a,{checked:Tn.includes(At.id),value:At.id,disabled:At==null?void 0:At.need_authorize,onChange:function(jn){var Gr=Tn.indexOf(At.id);Tn.indexOf(At.id)>-1?Pt(Tn.filter(function(Rt){return Rt!==At.id})):Pt(Tn.concat(At.id))}}),y.a.createElement("div",{className:xn.a.info},y.a.createElement("div",{className:xn.a.title},y.a.createElement("div",{className:xn.a.titleLeft},y.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(At==null?void 0:At.identifier,"/challenges"),target:"_blank"},y.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:At.title}})),(At==null?void 0:At.need_authorize)&&y.a.createElement("span",{onClick:function(){Object(na.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(br.v)()&&(At==null?void 0:At.mark_status)===1&&y.a.createElement(f.a,{title:At==null?void 0:At.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(br.v)()&&(At==null?void 0:At.mark_status)===2&&y.a.createElement(f.a,{title:At==null?void 0:At.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(br.v)()&&(At==null?void 0:At.mark_status)===3&&y.a.createElement(f.a,{title:At==null?void 0:At.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:xn.a.description,dangerouslySetInnerHTML:{__html:At.description}})),y.a.createElement("div",{className:" mt15"},At.challenge_names.map(function($n,jn){return y.a.createElement("span",{key:jn,className:"mr30 font12"},"\u7B2C",jn+1,"\u5173 ",$n," ")})),y.a.createElement(ln.a,{dashed:!0}),y.a.createElement("div",{className:"c-light-black mt20 font12"},y.a.createElement("span",null,At.author_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,At.author_school_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",At.level),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),y.a.createElement("span",null,At.study_count))))}),(Rn==null||((Yt=Rn.shixun_list)===null||Yt===void 0)?void 0:Yt.length)===0&&y.a.createElement($.a,null),y.a.createElement("p",null)),y.a.createElement("div",{className:"tc mt20"},y.a.createElement(K.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:cn.page||1,showQuickJumper:!0,total:Rn==null?void 0:Rn.shixuns_count,onChange:function(lr){var $n=Object(m.a)(Object(m.a)({},cn),{},{page:lr});Hr($n),qt({type:"classroomList/getShixunLists",payload:$n})}})))},Ja=Object(x.a)(function(Gt){var at=Gt.classroomList,Lt=Gt.loading;return{classroomList:at,loading:Lt}})(Na),ft=H("mgmH"),Zt=H("ErOA"),qa=H("ORt/"),za=H.n(qa),ui=H("Ot1p"),Ua=function(at,Lt){var xt,St=at.data,Yt=Ir.a.useForm(),hn=Object(s.a)(Yt,1),yn=hn[0],qt=Object(B.useState)({}),vn=Object(s.a)(qt,2),kn=vn[0],en=vn[1];return Object(B.useEffect)(function(){St&&(en(St),yn.setFieldsValue(Object(m.a)({},St)))},[St]),Object(B.useImperativeHandle)(Lt,function(){return{form:yn}}),y.a.createElement("div",{className:za.a.operating},y.a.createElement(Ir.a,{form:yn,scrollToFirstError:!0,onValuesChange:function(){en(Object(m.a)({},yn.getFieldsValue()))}},y.a.createElement(Ir.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(((xt=kn.name)===null||xt===void 0?void 0:xt.length)||0,"/30")})),y.a.createElement(Ir.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},y.a.createElement(i.a.Group,null,y.a.createElement(i.a,{value:"c"},"C"),y.a.createElement(i.a,{value:"c++"},"C++"),y.a.createElement(i.a,{value:"java"},"Java"),y.a.createElement(i.a,{value:"python"},"Python"))),y.a.createElement("div",{className:za.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(Ir.a.Item,{name:"description"},y.a.createElement(ui.a,{defaultValue:kn.description||"",watch:!0}))))},di=Object(B.forwardRef)(Ua),gn=H("SVaM"),Pi=H("sesT"),yt=H.n(Pi),ja=H("wNkr"),pa=H.n(ja),bi=H("xTzM"),ei=H.n(bi),da=M.a.TabPane,ci=g.a.Search,Ei=g.a.TextArea,ar;(function(Gt){Gt.Mine="0",Gt.Public="1",Gt.Collection="2",Gt.TeachGroupShare="3"})(ar||(ar={}));var xi=function(at){var Lt,xt,St,Yt,hn,yn,qt,vn,kn,en,un,tr,Nn=at.classroomList,kt=at.problemset,pn=at.user,er=at.globalSetting,Rn=at.loading,zt=at.dispatch,rn=at.match,Tn=at.shixunHomeworks,Pt=Object(o.a)(at,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),It=Object(B.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:((Lt=Pt.location)===null||Lt===void 0||((xt=Lt.query)===null||xt===void 0)?void 0:xt.id)||null,exam_id:(rn==null||((St=rn.params)===null||St===void 0)?void 0:St.id)||null,exercise_id:(rn==null||((Yt=rn.params)===null||Yt===void 0)?void 0:Yt.categoryId)||null}),Mt=Object(s.a)(It,2),Ae=Mt[0],Vt=Mt[1],dn=Object(B.useState)(0),sr=Object(s.a)(dn,2),cn=sr[0],Hr=sr[1],Kr=Object(B.useState)([]),Sr=Object(s.a)(Kr,2),On=Sr[0],At=Sr[1],lr=Object(B.useState)(ar.Mine),$n=Object(s.a)(lr,2),jn=$n[0],Gr=$n[1],Rt=Object(B.useState)(0),Nt=Object(s.a)(Rt,2),Dt=Nt[0],Qt=Nt[1],Dn=Object(B.useState)(-1),bn=Object(s.a)(Dn,2),Hn=bn[0],nr=bn[1],ca=Object(B.useState)([]),Fn=Object(s.a)(ca,2),Fa=Fn[0],rr=Fn[1],Jr=Object(B.useState)(!1),zr=Object(s.a)(Jr,2),Aa=zr[0],Ii=zr[1],Lo=Object(B.useState)([]),ti=Object(s.a)(Lo,2),Rr=ti[0],lo=ti[1],uo=Object(B.useState)(0),fi=Object(s.a)(uo,2),hi=fi[0],Qi=fi[1],co=Object(B.useState)(!1),Mi=Object(s.a)(co,2),Ti=Mi[0],fo=Mi[1],ho=Object(B.useState)(!1),ki=Object(s.a)(ho,2),po=ki[0],$i=ki[1],pi=Object(B.useRef)(!1),Va=Object(B.useRef)(""),mi=Object(B.useRef)(),pe=Object(B.useRef)(),xe=Object(B.useRef)(),Se=Object(B.useState)(),_e=Object(s.a)(Se,2),Z=_e[0],de=_e[1],te=Object(B.useState)([]),ye=Object(s.a)(te,2),he=ye[0],Ce=ye[1],we=Object(B.useRef)(!1),Pe=(rn==null?void 0:rn.url)==="/problemset",ze=rn==null||((hn=rn.url)===null||hn===void 0)?void 0:hn.includes("program_homework"),ot=ze&&rn!==null&&rn!==void 0&&(yn=rn.params)!==null&&yn!==void 0&&yn.categoryId&&rn!==null&&rn!==void 0&&(qt=rn.url)!==null&&qt!==void 0&&qt.includes("edit")?rn==null||((vn=rn.params)===null||vn===void 0)?void 0:vn.categoryId:"",dt=ot?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Ot=Object(B.useState)({}),on=Object(s.a)(Ot,2),Un=on[0],An=on[1],Ln=Object(B.useState)(!1),Mn=Object(s.a)(Ln,2),Pn=Mn[0],wn=Mn[1],Bn=pn.userInfo||{},Kn=Bn.admin,xr=Bn.business,Gn=Bn.is_shixun_marker,tn=Bn.is_teacher,$t=Bn.user_identity,Cn=Kn||xr||Gn||tn||$t!=="\u5B66\u751F",Zn=Object(B.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),Ht=Object(s.a)(Zn,2),Jn=Ht[0],Tr=Ht[1],Vn=Tn.commonHomeWorkAddDefaultData,pr=Object(B.useState)([]),ur=Object(s.a)(pr,2),Dr=ur[0],Mr=ur[1],wr=Object(B.useRef)(null),aa=Object(B.useState)(!1),ba=Object(s.a)(aa,2),fa=ba[0],kr=ba[1],gr=Object(B.useState)([]),dr=Object(s.a)(gr,2),an=dr[0],cr=dr[1],wa=Object(B.useState)(""),Ba=Object(s.a)(wa,2),Xa=Ba[0],fr=Ba[1],Ia=Object(B.useState)(!1),Wa=Object(s.a)(Ia,2),mr=Wa[0],ir=Wa[1],Cr=Object(B.useRef)(null),Ni=[{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(B.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Zi=function(){var Xe=Object(v.a)(U.a.mark(function He(){var je,Ye,qe;return U.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Re.q)({id:ot});case 2:je=pt.sent,je!=null&&je.name&&(qe={description:je.description,languages:je.languages,name:je.name},Cr.current.form.setFieldsValue(qe),An(Object(m.a)({},qe)),cr(Object(A.a)(je.data)),Ce((Ye=je.data)===null||Ye===void 0?void 0:Ye.map(function(ct){return ct.id})));case 4:case"end":return pt.stop()}},He)}));return function(){return Xe.apply(this,arguments)}}();Object(B.useEffect)(function(){ot&&Zi()},[ot]),Object(B.useEffect)(function(){var Xe;zt({type:"problemset/getDisciplines",payload:{source:"question"}});var He=((Xe=Pt.location.query)===null||Xe===void 0?void 0:Xe.group_id)||0;Ae.group_id=Number(He),Vt(Ae),Fr(Ae).then(function(je){je!=null&&je.status||Mr(je==null?void 0:je.item_banks_group),kr(!1)}),Ma(),gi()},[]),Object(B.useEffect)(function(){return zt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),zt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){zt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),zt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(B.useEffect)(function(){return zt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){zt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(B.useEffect)(function(){return zt({type:"globalSetting/headerFooterToggle",payload:Pe}),function(){zt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(B.useEffect)(function(){Object(Ar.Z)(ze?dt:"\u8BD5\u9898\u5E93")},[ze,dt]);var ni=function(He,je){var Ye=[];if(!He){var qe,vt;kt==null||((qe=kt.disciplinesData)===null||qe===void 0||((vt=qe.disciplines)===null||vt===void 0))||vt.forEach(function(Lr){var Ca;Lr==null||((Ca=Lr.sub_disciplines)===null||Ca===void 0)||Ca.forEach(function(Ga){var Ri;Ga==null||((Ri=Ga.tag_disciplines)===null||Ri===void 0)||Ri.forEach(function(Sa){Sa.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&Ye.push(Sa)})})})}if(He&&!je){var pt,ct,Xt,zn=kt==null||((pt=kt.disciplinesData)===null||pt===void 0||((ct=pt.disciplines)===null||ct===void 0))?void 0:ct.find(function(Lr){return Lr.id===He});zn==null||((Xt=zn.sub_disciplines)===null||Xt===void 0)||Xt.forEach(function(Lr){var Ca;Lr==null||((Ca=Lr.tag_disciplines)===null||Ca===void 0)||Ca.forEach(function(Ga){Ga.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&Ye.push(Ga)})})}if(He&&je){var ma,Sn,oa,sa,ea=kt==null||((ma=kt.disciplinesData)===null||ma===void 0||((Sn=ma.disciplines)===null||Sn===void 0))?void 0:Sn.find(function(Lr){return Lr.id===He}),ga=ea==null||((oa=ea.sub_disciplines)===null||oa===void 0)?void 0:oa.find(function(Lr){return Lr.id===je});ga==null||((sa=ga.tag_disciplines)===null||sa===void 0)||sa.forEach(function(Lr){Lr.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&Ye.push(Lr)})}return Ye},gi=function(){var Xe=Object(v.a)(U.a.mark(function He(){return U.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:zt({type:"problemset/getTeachGroupData"});case 1:case"end":return Ye.stop()}},He)}));return function(){return Xe.apply(this,arguments)}}();Object(B.useEffect)(function(){var Xe=kt.basketData||{},He=Xe.completion_questions_count,je=He===void 0?0:He,Ye=Xe.judgement_questions_count,qe=Ye===void 0?0:Ye,vt=Xe.multiple_questions_count,pt=vt===void 0?0:vt,ct=Xe.practical_questions_count,Xt=ct===void 0?0:ct,zn=Xe.program_questions_count,ma=zn===void 0?0:zn,Sn=Xe.single_questions_count,oa=Sn===void 0?0:Sn,sa=Xe.subjective_questions_count,ea=sa===void 0?0:sa,ga=Xe.combination_questions_count,Lr=ga===void 0?0:ga,Ca=je+qe+pt+Xt+ma+oa+ea+Lr;Qi(Ca)},[kt.basketData]);var Fr=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye,qe;return U.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return Ye=Object(m.a)({},je),Ye.item_type=ze?"PROGRAM":je.item_type,kr(!0),Ye.keyword=encodeURIComponent(je.keyword||""),pt.next=6,zt({type:"problemset/getItemBanks",payload:Ye});case 6:if(qe=pt.sent,!(qe&&qe.status!==403&&qe.status!==401&&qe.status!==500)){pt.next=18;break}return Hr(qe.items_count||0),At(qe.items||[]),rr(qe.tag_disciplines||[]),de(qe.used_shixun_ids||[]),Ui(qe.items||[]),ze||Ce([]),lo((qe==null?void 0:qe.navigation)||[]),Qt((qe==null?void 0:qe.added_num)||0),kr(!1),pt.abrupt("return",qe);case 18:case"end":return pt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Ma=function(){zt({type:"problemset/getBasketList",payload:{}})},Ui=function(He){var je=He.every(function(Ye){var qe;return((qe=Ye.program_attr)===null||qe===void 0?void 0:qe.status)===0});pi.current=je},Po=function(He,je){if(Ae.discipline_id=He||"",Ae.sub_discipline_id=je||"",Ae.tag_discipline_id="",Ae.page=1,Ae.per_page=20,delete Ae.id,nr(He===null?-1:null),Vt(Ae),Fr(Ae),He===null)return},Io=function(He){Ae.item_type=He||"",Ae.page=1,Ae.per_page=20,Vt(Ae),Fr(Ae)},mo=function(He){Ae.difficulty=He||"",Ae.page=1,Ae.per_page=20,delete Ae.id,Vt(Ae),Fr(Ae)},Ji=function(He){Ae.tag_discipline_id=He,Ae.page=1,Ae.per_page=20,delete Ae.id,He===-1&&(Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id=""),nr(He),Vt(Ae),Fr(Ae)},qi=Object(B.useState)(!1),ri=Object(s.a)(qi,2),vi=ri[0],go=ri[1],ji=function(He){zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:He}}),Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.item_type=null,Ae.difficulty=null,Ae.type=He,He==="0"?Ae.group_id=0:Ae.group_id=null,He==="3"&&ze?Ae.only_published=!0:Ae.only_published=null,He==="3"?go(!0):go(!1),Ae.page=1,Ae.per_page=20,delete Ae.id,nr(-1),Gr(He),Vt(Ae),Fr(Ae)},_i=function(He,je){Ae.page=He,Ae.per_page=je,Vt(Ae),Fr(Ae)},ai=function(He){Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.item_type=null,Ae.difficulty=null,Ae.page=1,Ae.keyword=He,delete Ae.id,He?($i(!0),Object(gn.a)({name:He,copywriting:He,position:ze?"Practice":"ItemBank"})):$i(!1),nr(-1),Vt(Ae),Fr(Ae)},vr=function(){Ae.per_page=20,Vt(Ae),Fr(Ae)},Ea=function(He){var je=He.length===On.length&&Ae.page>1?Ae.page-1:Ae.page;Ae.page=je,Ae.per_page=20,Ma(),Vt(Ae),Fr(Ae)},ii=function(){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},Ya=function(){var Xe=Object(v.a)(U.a.mark(function He(je,Ye){var qe;return U.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(!Ye){pt.next=6;break}return pt.next=3,Object(Re.n)({id:je});case 3:pt.t0=pt.sent,pt.next=9;break;case 6:return pt.next=8,Object(Re.G)({id:je});case 8:pt.t0=pt.sent;case 9:qe=pt.t0,(qe==null?void 0:qe.status)===0&&vr();case 11:case"end":return pt.stop()}},He)}));return function(je,Ye){return Xe.apply(this,arguments)}}(),Oi=function(){var Xe=Object(v.a)(U.a.mark(function He(je){return U.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:Hi(je);case 1:case"end":return qe.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),oi=function(){var Xe=Object(v.a)(U.a.mark(function He(je){return U.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:Wi([je]);case 1:case"end":return qe.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Fi=function(He){pe.current="",mi.current="",w.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(C.a.Group,{className:"mt10",onChange:function(Ye){return mi.current=Ye.target.value}},y.a.createElement(C.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),y.a.createElement(C.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),y.a.createElement(C.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),y.a.createElement(C.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),y.a.createElement(C.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),y.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),y.a.createElement(Ei,{className:"mt10",rows:4,defaultValue:pe.current,onChange:function(Ye){return pe.current=Ye.target.value}})),onOk:function(){return new Promise(function(){var Ye=Object(v.a)(U.a.mark(function qe(vt,pt){var ct;return U.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(mi.current&&pe.current){zn.next=3;break}return c.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),zn.abrupt("return",pt());case 3:return zn.next=5,Object(Re.o)({id:He,clazz:mi.current,description:pe.current});case 5:ct=zn.sent,ct.status===0&&c.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),vt();case 8:case"end":return zn.stop()}},qe)}));return function(qe,vt){return Ye.apply(this,arguments)}}())}})},eo=function(He){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:He}}})},Bi=function(He){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:He}}})},to=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye,qe,vt,pt;return U.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(Ye=je.item_type,!(Ye==="PROGRAM")){Xt.next=12;break}return qe=je.program_attr.identifier,Xt.next=5,zt({type:"problemset/startExperience",payload:{id:qe}});case 5:if(vt=Xt.sent,!(vt.status===0)){Xt.next=10;break}return pt=vt.identifier,Object(Ar.U)("/myproblems/".concat(pt)),Xt.abrupt("return");case 10:return c.b.warn(vt.message),Xt.abrupt("return");case 12:zt({type:"problemset/setActionTabs",payload:{key:Ye,params:je}});case 13:case"end":return Xt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Ha=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye,qe,vt;return U.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(!Ae.exam_id){ct.next=6;break}return ct.next=3,Object(Re.M)({item_id:je,id:Ae.exam_id});case 3:return Ye=ct.sent,Ye.status===0&&vr(),ct.abrupt("return");case 6:if(!(Ae!=null&&Ae.exercise_id)){ct.next=12;break}return ct.next=9,Object(Zt.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Ae==null?void 0:Ae.exercise_id,item_bank_ids:[je]}});case 9:return qe=ct.sent,qe.status===0&&vr(),ct.abrupt("return");case 12:return ct.next=14,zt({type:"problemset/cancel",payload:{id:je,item_bank:1}});case 14:vt=ct.sent,vt.status===0&&(vr(),Ma());case 16:case"end":return ct.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Qa=function(){var Xe=Object(v.a)(U.a.mark(function He(je){return U.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(je),group_type:ar.Mine}}),Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.page=1,Ae.per_page=20,Ae.group_id=Math.abs(je),nr(-1),Vt(Ae),Fr(Ae).then(function(vt){return Mr(vt==null?void 0:vt.item_banks_group)});case 10:case"end":return qe.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),no=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye,qe,vt;return U.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(!Ae.exam_id){ct.next=6;break}return ct.next=3,Object(Re.t)({exam_id:Ae.exam_id,item_bank_ids:[je]});case 3:return Ye=ct.sent,Ye.status===0&&vr(),ct.abrupt("return");case 6:if(!(Ae!=null&&Ae.exercise_id)){ct.next=12;break}return ct.next=9,Object(Zt.a)("/api/exercises/".concat(Ae==null?void 0:Ae.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[je]}});case 9:return qe=ct.sent,qe.status===0&&vr(),ct.abrupt("return");case 12:if(!(hi===200)){ct.next=15;break}return c.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),ct.abrupt("return");case 15:return ct.next=17,zt({type:"problemset/select",payload:{item_bank_ids:[je]}});case 17:vt=ct.sent,vt.status===0&&(vr(),Ma());case 19:case"end":return ct.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),ro=function(){var Xe=Object(v.a)(U.a.mark(function He(je){return U.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(je){qe.next=3;break}if(he!=null&&he.length){qe.next=3;break}return qe.abrupt("return",c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:xe.current=[0],w.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(le.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(ae.a,{defaultValue:!0,value:xe.current,onChange:function(pt){return xe.current=pt}})),onOk:function(){var vt=Object(v.a)(U.a.mark(function ct(){var Xt,zn;return U.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(Re.f)({ids:je?[je]:he,groups_ids:(Xt=xe.current)===null||Xt===void 0?void 0:Xt[0]});case 2:zn=Sn.sent,xe.current=[],(zn==null?void 0:zn.status)===0&&vr();case 5:case"end":return Sn.stop()}},ct)}));function pt(){return vt.apply(this,arguments)}return pt}()});case 5:case"end":return qe.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Mo=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye,qe;return U.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Re.D)({clazz:"ItemBank",id:je});case 2:Ye=pt.sent,qe=(Ye==null?void 0:Ye.groups)||[],xe.current=[],w.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(le.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(i.a.Group,{className:le.a.checkbox,defaultValue:xe.current,onChange:function(Xt){return xe.current=Xt}},qe==null?void 0:qe.map(function(ct){return y.a.createElement(i.a,{key:ct.group_id,value:ct.group_id},ct.name)}))),onOk:function(){var ct=Object(v.a)(U.a.mark(function zn(){return U.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.abrupt("return",new Promise(function(){var oa=Object(v.a)(U.a.mark(function sa(ea,ga){var Lr,Ca,Ga;return U.a.wrap(function(Sa){for(;;)switch(Sa.prev=Sa.next){case 0:if(xe.current.length){Sa.next=3;break}return c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Sa.abrupt("return",ga());case 3:return Ca=qe==null||((Lr=qe.map(function(yo){return yo.group_id}))===null||Lr===void 0)?void 0:Lr.filter(function(yo){return!xe.current.includes(yo)}),Sa.next=6,Object(Re.l)({ids:[je],clazz:"ItemBank",group_ids:Ca});case 6:return Ga=Sa.sent,xe.current=[],(Ga==null?void 0:Ga.status)===0&&(c.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),vr()),Sa.abrupt("return",ea());case 10:case"end":return Sa.stop()}},sa)}));return function(sa,ea){return oa.apply(this,arguments)}}()));case 1:case"end":return Sn.stop()}},zn)}));function Xt(){return ct.apply(this,arguments)}return Xt}()});case 6:case"end":return pt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),ko=function(He){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:He}}})},ao=function(){zt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Ae}});return},No=function(){var He={discipline_id:"&discipline_id=".concat(Ae.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(Ae.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(Ae.tag_discipline_id),difficulty:"&difficulty=".concat(Ae.difficulty),item_type:"&item_type=".concat(Ae.item_type),group_id:"&group_id=".concat(Ae.group_id||0)},je="/problemset/newitem?pages=".concat(Ae.page);Object.keys(He).forEach(function(Ye){Ae[Ye]&&(je=je+He[Ye])}),x.d===null||x.d===void 0||x.d.push(je)},Br=function(He){var je=he;if(!(je!=null&&je.length))return c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(hi+je.length>200&&He&&Pe){c.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-hi,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(je.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}He?Nr(je):qr(je)},Nr=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye;return U.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:Ye=Object(A.a)(je),On.forEach(function(pt){if(Ye.includes(pt.id)){var ct;pt.item_type==="PROGRAM"&&((ct=pt.program_attr)===null||ct===void 0?void 0:ct.status)===0&&Object(ut.remove)(Ye,function(Xt){return Xt===pt.id})}}),w.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",je.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 pt=Object(v.a)(U.a.mark(function Xt(){var zn;return U.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:if(!Ae.exam_id){Sn.next=6;break}return Sn.next=3,Object(Re.t)({exam_id:Ae.exam_id,item_bank_ids:Ye});case 3:zn=Sn.sent,Sn.next=15;break;case 6:if(!(Ae!=null&&Ae.exercise_id)){Sn.next=12;break}return Sn.next=9,Object(Zt.a)("/api/exercises/".concat(Ae==null?void 0:Ae.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:Ye}});case 9:zn=Sn.sent,Sn.next=15;break;case 12:return Sn.next=14,zt({type:"problemset/select",payload:{item_bank_ids:Ye}});case 14:zn=Sn.sent;case 15:zn.status===0&&(vr(),Ma());case 16:case"end":return Sn.stop()}},Xt)}));function ct(){return pt.apply(this,arguments)}return ct}()});case 3:case"end":return vt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),qr=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye;return U.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(!Ae.exam_id){vt.next=6;break}return vt.next=3,Object(Zt.a)("/api/examination_banks/".concat(Ae.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:je}});case 3:Ye=vt.sent,vt.next=15;break;case 6:if(!(Ae!=null&&Ae.exercise_id)){vt.next=12;break}return vt.next=9,Object(Zt.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Ae==null?void 0:Ae.exercise_id,item_bank_ids:je}});case 9:Ye=vt.sent,vt.next=15;break;case 12:return vt.next=14,zt({type:"problemset/unselectAll",payload:{item_ids:je}});case 14:Ye=vt.sent;case 15:Ye.status===0&&(vr(),Ma());case 16:case"end":return vt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Ur=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye;return U.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(!(Pe&&hi===200)){vt.next=3;break}return c.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),vt.abrupt("return");case 3:if(!Ae.exam_id){vt.next=10;break}return vt.next=6,Object(Re.t)({exam_id:Ae.exam_id,shixun_ids:je});case 6:Ye=vt.sent,Ye.status===0&&vr(),vt.next=14;break;case 10:return vt.next=12,zt({type:"problemset/select",payload:{shixun_ids:je}});case 12:Ye=vt.sent,Ye.status===0&&(Ma(),vr());case 14:case"end":return vt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),Ai=function(){zt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Wi=function(He){var je,Ye,qe,vt;if(!((je=kt.teachGroupData)!==null&&je!==void 0&&(Ye=je.groups)!==null&&Ye!==void 0&&Ye.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");w.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(le.a.overflow)},y.a.createElement(i.a.Group,{className:le.a.checkbox,defaultValue:xe.current,onChange:function(ct){return xe.current=ct}},(qe=kt.teachGroupData)===null||qe===void 0||((vt=qe.groups)===null||vt===void 0)?void 0:vt.map(function(pt){return y.a.createElement(i.a,{key:pt.group_id,value:pt.group_id},pt.name)}))),onOk:function(){return new Promise(function(){var ct=Object(v.a)(U.a.mark(function Xt(zn,ma){var Sn,oa;return U.a.wrap(function(ea){for(;;)switch(ea.prev=ea.next){case 0:if((Sn=xe.current)!==null&&Sn!==void 0&&Sn.length){ea.next=3;break}return c.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),ea.abrupt("return",ma());case 3:return ea.next=5,Object(Re.l)({ids:He||he,clazz:"ItemBank",group_ids:xe.current});case 5:oa=ea.sent,(oa==null?void 0:oa.status)===0&&(c.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),xe.current=[],Ce([]),vr(),zn());case 7:case"end":return ea.stop()}},Xt)}));return function(Xt,zn){return ct.apply(this,arguments)}}())}})},xa=function(){var He=function(){var je=Object(v.a)(U.a.mark(function Ye(){var qe;return U.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return Ii(!0),pt.next=3,Object(Re.j)({ids:he});case 3:qe=pt.sent,Ii(!1),(qe==null?void 0:qe.status)===0&&w.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(qe.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(qe.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(){Ea(new Array(qe.success))}});case 6:case"end":return pt.stop()}},Ye)}));return function(){return je.apply(this,arguments)}}();if(he!=null&&he.length){w.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(he==null?void 0:he.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:He});return}c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},io=function(){var He,je;if(!(he!=null&&he.length))return c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(On!=null&&(He=On.filter(function(Ye){return he.includes(Ye.id)}))!==null&&He!==void 0&&He.every(function(Ye){return Ye.public}))return c.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(On!=null&&(je=On.filter(function(Ye){return he.includes(Ye.id)}))!==null&&je!==void 0&&je.find(function(Ye){var qe;return Ye.item_type==="PROGRAM"&&((qe=Ye.program_attr)===null||qe===void 0?void 0:qe.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"||pn.userInfo.professional_certification?Hi():w.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(i.a,{className:"mt10",defaultChecked:!1,onChange:function(qe){return we.current=qe.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Hi()}})},Hi=function(){var Xe=Object(v.a)(U.a.mark(function He(je){var Ye,qe;return U.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return Ye=jn===ar.TeachGroupShare?1:2,pt.next=3,Object(Re.g)({ids:je?[je]:he,source:Ye});case 3:qe=pt.sent,qe.status===0&&(we.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),we.current=!1,Ce([]),vr());case 5:case"end":return pt.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),vo=function(He){w.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:le.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),y.a.createElement("div",{className:le.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var je=Object(v.a)(U.a.mark(function qe(){var vt;return U.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return ct.next=2,Object(Re.L)({identifier:He});case 2:vt=ct.sent,(vt==null?void 0:vt.status)===0&&(c.b.success("\u53D1\u5E03\u6210\u529F"),vr());case 4:case"end":return ct.stop()}},qe)}));function Ye(){return je.apply(this,arguments)}return Ye}()})},si=function(He){w.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:y.a.createElement("p",{className:le.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var je=Object(v.a)(U.a.mark(function qe(){var vt;return U.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return ct.next=2,Object(Re.K)({identifier:He});case 2:vt=ct.sent,(vt==null?void 0:vt.status)===0&&(c.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),vr());case 4:case"end":return ct.stop()}},qe)}));function Ye(){return je.apply(this,arguments)}return Ye}()})},Ki=function(){var Xe=Object(v.a)(U.a.mark(function He(je){return U.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:je,group_type:ar.TeachGroupShare}}),Ae.page=1,Ae.group_id=je||null,delete Ae.id,Vt(Object(m.a)({},Ae)),Fr(Ae);case 6:case"end":return qe.stop()}},He)}));return function(je){return Xe.apply(this,arguments)}}(),wi=function(He){Ae.sort_by=He.type,Ae.sort_direction=He.direction,Ae.page=1,Ae.per_page=20,Tr(He.name),Vt(Ae),Fr(Ae)},_o=function(){Ae.page=1,Vt(Ae),Fr(Ae)},Gi=function(He){Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.item_type=null,Ae.difficulty=null,Ae.page=1,Ae.per_page=20,Ae.group_id=He,nr(-1),Vt(Ae),Fr(Ae).then(function(je){return Mr(je==null?void 0:je.item_banks_group)})},or=function(){if(!(he!=null&&he.length)){zt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:Ae}});return}w.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(le.a.overflow)},"\u5DF2\u9009\u4E2D",he==null?void 0:he.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(ft.k)({ids:he})}})},Yn=function(){var Xe=Object(v.a)(U.a.mark(function He(){var je,Ye,qe,vt;return U.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return ct.next=2,Object(Re.i)({ids:he});case 2:je=ct.sent,Ye=je.data||{},qe=Ye.unpublish_program_question_count,vt=Ye.total_item_banks,qe===0?w.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"}):w.a.confirm({title:"\u63D0\u793A",content:y.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",vt,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",qe,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var Xt=Object(v.a)(U.a.mark(function ma(){var Sn;return U.a.wrap(function(sa){for(;;)switch(sa.prev=sa.next){case 0:return sa.next=2,Object(Re.h)({ids:he});case 2:Sn=sa.sent,Sn.status===0&&(c.b.success("\u53D1\u5E03\u6210\u529F"),vr());case 4:case"end":return sa.stop()}},ma)}));function zn(){return Xt.apply(this,arguments)}return zn}()});case 5:case"end":return ct.stop()}},He)}));return function(){return Xe.apply(this,arguments)}}(),Yr=y.a.createElement(d.a,null,Cn&&y.a.createElement(d.a.Item,{onClick:function(){return Br(!0)}},"\u6279\u91CF\u52A0\u5165"),Cn&&y.a.createElement(d.a.Item,{onClick:function(){return Br(!1)}},"\u6279\u91CF\u79FB\u51FA"),jn===ar.Mine&&Pe&&y.a.createElement(d.a.Item,{onClick:function(){return ro()}},"\u79FB\u52A8\u5230"),jn===ar.Mine&&Pe&&y.a.createElement(d.a.Item,{onClick:io},"\u6279\u91CF\u516C\u5F00"),jn===ar.Mine&&Pe&&y.a.createElement(d.a.Item,{onClick:function(){return Wi()}},"\u6279\u91CF\u5171\u4EAB"),jn===ar.Mine&&Pe&&y.a.createElement(d.a.Item,{onClick:xa},"\u6279\u91CF\u5220\u9664")),ia=function(He){if(ze)if((an==null?void 0:an.length)<=0){var je=On.filter(function(Xt){return He.includes(Xt.id)});cr(Object(A.a)(je)),Ce(je==null?void 0:je.map(function(Xt){return Xt.id}))}else if(He.length>an.length){var Ye,qe=On.filter(function(Xt){return He.includes(Xt.id)}),vt=an.map(function(Xt){return Xt.id}),pt=qe.filter(function(Xt){return!vt.includes(Xt.id)});cr([].concat(Object(A.a)(an),Object(A.a)(pt))),Ce((Ye=[].concat(Object(A.a)(an),Object(A.a)(pt)))===null||Ye===void 0?void 0:Ye.map(function(Xt){return Xt.id}))}else{var ct=an.filter(function(Xt){return He.includes(Xt.id)});cr(Object(A.a)(ct)),Ce(ct==null?void 0:ct.map(function(Xt){return Xt.id}))}else Ce(He)},$a=function(He){if(ze)if(He){var je,Ye=an==null?void 0:an.map(function(ct){return ct.id}),qe=On.filter(function(ct){return!Ye.includes(ct.id)});cr([].concat(Object(A.a)(an),Object(A.a)(qe))),Ce((je=[].concat(Object(A.a)(an),Object(A.a)(qe)))===null||je===void 0?void 0:je.map(function(ct){return ct.id}))}else{var vt=On==null?void 0:On.map(function(ct){return ct.id}),pt=an.filter(function(ct){return!vt.includes(ct.id)});cr(Object(A.a)(pt)),Ce(pt==null?void 0:pt.map(function(ct){return ct.id}))}else Ce(He?On==null?void 0:On.map(function(ct){return ct.id}):[])},Ka=function(){var He="/problemset/preview";if(Ae.exam_id&&(He="/paperlibrary/edit/".concat(Ae.exam_id)),Ae!=null&&Ae.exercise_id){var je;He="/classrooms/".concat(rn==null||((je=rn.params)===null||je===void 0)?void 0:je.coursesId,"/exercise/").concat(Ae==null?void 0:Ae.exercise_id,"/edit")}x.d.push(He)},Ci=[{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"}],Za={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Vr=function(He,je){var Ye,qe=je.id<0?"--":Cn?je[Ae.exercise_id?"added":"choosed"]?y.a.createElement("span",{key:1,className:le.a.btnAdd,onClick:function(ct){ct.target.style.pointerEvents="none",Ha(je.id)}},Pe?"\u79FB\u51FA\u8BD5\u9898\u7BEE":y.a.createElement("span",null,y.a.createElement("b",{className:"iconfont icon-yichu ".concat(le.a.cancelC)}),"\u79FB\u51FA")):je.item_type==="PROGRAM"&&((Ye=je.program_attr)===null||Ye===void 0?void 0:Ye.status)===0?y.a.createElement(f.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},y.a.createElement("span",{className:le.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",Pe?"\u52A0\u5165\u8BD5\u9898\u7BEE":y.a.createElement("span",{style:{padding:"0 3px"}},y.a.createElement("b",{className:"iconfont icon-jiaru ".concat(le.a.addC)}),"\u52A0\u5165")," ")):y.a.createElement("span",{className:le.a.btnAdd,onClick:function(){return no(je.id)}},Pe?"\u52A0\u5165\u8BD5\u9898\u7BEE":y.a.createElement("span",{style:{padding:"0 3px"}},y.a.createElement("b",{className:"iconfont icon-jiaru ".concat(le.a.addC)}),"\u52A0\u5165")):y.a.createElement(y.a.Fragment,null),vt=y.a.createElement("span",{className:le.a.actonBtn},je.id>0&&y.a.createElement(hr.a,{isProblemset:Pe,user:pn,key:je.id,data:je,activeTabsKey:jn,selectIds:he,onCollect:Ya,onSetPublic:Oi,onStartExperience:to,onCorrection:Fi,onPublicReview:ii,onSetPrivate:eo,onDelete:Bi,onCancel:Ha,onSelect:no,onMoveTo:ro,onSetShare:oi,onCancelShare:Mo,onPublish:vo,onCancelPublish:si}),qe);return vt};Object(B.useEffect)(function(){if(ze){var Xe=rn.params,He=Xe.coursesId,je=Xe.categoryId;zt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:je,coursesId:He,type:5}})}},[ze]);var Si=function(){var Xe=Object(v.a)(U.a.mark(function He(){var je,Ye,qe,vt,pt;return U.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Cr.current.form.validateFields().catch(function(zn){document.body.scrollIntoView()}),Xt.next=3,Cr.current.form.validateFields();case 3:if(je=Cr.current.form.getFieldsValue(),console.log(je,"value"),!((an==null?void 0:an.length)<=0)){Xt.next=8;break}return c.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),Xt.abrupt("return");case 8:return wn(!0),Ye=rn.params,qe=Ye.coursesId,vt=Ye.categoryId,Xt.next=12,Object(Zt.a)(ot?"/api/homework_commons/".concat(vt,"/update_hack.json"):"/api/courses/".concat(qe,"/homework_commons.json"),{method:ot?"put":"post",body:Object(m.a)(Object(m.a)({},je),{},{coursesId:qe,category:vt,type:5,hack_ids:an==null?void 0:an.map(function(zn){return zn.id})})});case 12:pt=Xt.sent,(pt==null?void 0:pt.status)===0&&x.d.push("/classrooms/".concat(rn.params.coursesId,"/program_homework/").concat(ot?vt:pt.homework_id,"/detail?tabs=1")),wn(!1);case 15:case"end":return Xt.stop()}},He)}));return function(){return Xe.apply(this,arguments)}}();return y.a.createElement("div",{className:le.a.page},y.a.createElement("section",null,y.a.createElement("div",{className:le.a.wrap},Vn.course_name&&ze&&y.a.createElement("section",{className:"animated fadeIn"},y.a.createElement("aside",{className:"mt10"},Vn.category&&y.a.createElement(p.a,{separator:">"},y.a.createElement(p.a.Item,null,y.a.createElement(j.a,{to:"/classrooms/".concat(Vn.course_id,"/program_homework")},Vn.course_name)),y.a.createElement(p.a.Item,null,y.a.createElement(j.a,{to:"/classrooms/".concat(Vn.course_id,"/program_homework")},Vn.category.category_name)),y.a.createElement(p.a.Item,null,dt)))),y.a.createElement("div",{className:le.a.title},ze?dt:"\u8BD5\u9898\u5E93"),ze&&y.a.createElement(di,{data:Un,ref:Cr}),y.a.createElement("div",{className:le.a.headerWrapper},y.a.createElement("div",{className:le.a.tabsWrap},y.a.createElement(M.a,{activeKey:jn,onChange:ji,tabBarExtraContent:y.a.createElement("div",{className:le.a.searchWrap},jn===ar.Mine&&Pe&&y.a.createElement(D.a,{className:le.a.addQuestionBtn,onClick:No},y.a.createElement("img",{src:yt.a,className:le.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),y.a.createElement(ci,{allowClear:!0,suffix:y.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(le.a.searchIcon),onClick:function(){return ai(Ae.keyword)}}),className:le.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function(He){Ae.keyword=He.target.value,Vt(Object(m.a)({},Ae))},onSearch:ai}))},y.a.createElement(da,{tab:"\u516C\u5171",key:"1"}),((kn=kt.teachGroupData)===null||kn===void 0||((en=kn.groups)===null||en===void 0)?void 0:en.length)&&y.a.createElement(da,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(br.o)()&&!Object(br.m)()&&!ze&&y.a.createElement(da,{tab:"\u6536\u85CF\u5939",key:"2"}),y.a.createElement(da,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),y.a.createElement(z.a,{showSelectAll:!1,className:le.a.select,disciplinesData:(un=kt.disciplinesData)===null||un===void 0?void 0:un.disciplines,knowledgeData:Fa,directionValue:Ae.discipline_id,subDisciplineValue:Ae.sub_discipline_id,typeValue:Ae.item_type,isprogram_homework:ze,showKnowledge:!0,name:Xa,setname:fr,difficultyValue:Ae.difficulty,showShixun:!Object(br.m)()&&!Ae.exercise_id&&jn!==ar.TeachGroupShare&&jn!==ar.Public,onShixunChange:Ai,onDirectionChange:Po,onTypeChange:Io,onDifficultyChange:mo,knowledgeValue:Hn,onKnowledgeChange:Ji,teachGroupData:(tr=kt.teachGroupData)===null||tr===void 0?void 0:tr.groups,onTeachGroupChange:Ki,teachGroupValue:Ae.group_id,showTeachGroup:vi})),y.a.createElement("div",{className:le.a.treeWrapper,style:{display:jn===ar.Mine?"block":"none"}},y.a.createElement("div",{className:le.a.treeHeader},y.a.createElement(me.a,{data:Rr,onClick:Qa}),y.a.createElement(D.a,{type:"link",onClick:ao,className:le.a.exportBtn},y.a.createElement("img",{src:ei.a,alt:"",className:le.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),y.a.createElement(F.a,{spinning:fa},y.a.createElement("div",{ref:wr,className:le.a.treeContent},y.a.createElement(En.a,{isProblemset:Pe,reloadData:vr,data:Dr,onShare:Wi,onOpen:Qa})))),y.a.createElement("div",{className:le.a.contentWrap},y.a.createElement("div",{className:le.a.batchWrap},y.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!ze&&y.a.createElement("div",{className:"font14"},y.a.createElement(N.a,{overlay:y.a.createElement(d.a,{selectedKeys:[Jn]},Ni==null?void 0:Ni.map(function(Xe,He){return y.a.createElement(d.a.Item,{key:Xe.name,onClick:function(){return wi(Xe)}},Xe.name)}))},y.a.createElement("span",{style:{color:"#464F66"}},y.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),Jn))),ze&&y.a.createElement("div",null,y.a.createElement(i.a,{checked:(On==null?void 0:On.filter(function(Xe){return an==null?void 0:an.map(function(He){return He.id}).includes(Xe.id)}).length)===On.length,onChange:function(He){return $a(He.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",he==null?void 0:he.length,")"))),ze&&y.a.createElement(w.a,{visible:mr,centered:!0,width:700,okText:"\u786E\u8BA4".concat(ot?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return ir(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:Si,confirmLoading:Pn,title:"\u67E5\u770B\u5DF2\u9009"},y.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",an==null?void 0:an.length,"\u4E2A"),y.a.createElement("div",{style:{height:400,overflow:"auto"}},an==null?void 0:an.map(function(Xe,He){var je,Ye,qe,vt,pt,ct;return y.a.createElement("div",{key:He,className:le.a.sendModal},y.a.createElement("div",{className:le.a.li},y.a.createElement("p",null,Xe==null?void 0:Xe.name),y.a.createElement("div",{className:le.a.bottom},y.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),y.a.createElement("i",{className:le.a.line}),y.a.createElement("span",{className:"c-grey-333"},Xe.difficulty===1&&"\u7B80\u5355",Xe.difficulty===2&&"\u9002\u4E2D",Xe.difficulty===3&&"\u56F0\u96BE"),y.a.createElement("i",{className:le.a.line}),y.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",y.a.createElement(f.a,{title:Xe==null||((je=Xe.author)===null||je===void 0)?void 0:je.name},y.a.createElement("span",{className:"c-grey-333"},(Xe==null||((Ye=Xe.author)===null||Ye===void 0||((qe=Ye.name)===null||qe===void 0))?void 0:qe.length)>6?(Xe==null||((vt=Xe.author)===null||vt===void 0||((pt=vt.name)===null||pt===void 0))?void 0:pt.substr(0,3))+"...":Xe==null||((ct=Xe.author)===null||ct===void 0)?void 0:ct.name))),y.a.createElement("i",{className:le.a.line}),y.a.createElement("span",{className:le.a.des},"\u66F4\u65B0\xA0",y.a.createElement("span",{className:"c-grey-333"},Xe==null?void 0:Xe.updated_at)))),y.a.createElement("div",{className:le.a.del,onClick:function(){ia(an.filter(function(zn){return zn.id!==Xe.id}).map(function(zn){return zn.id}))}},"\u5220\u9664"))})))),y.a.createElement("div",null,jn===ar.Mine&&Pe&&y.a.createElement(D.a,{onClick:or,type:"link",className:le.a.exportBtn},y.a.createElement("img",{src:pa.a,className:le.a.pngIcon}),y.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?y.a.createElement("div",null,y.a.createElement(D.a,{style:{paddingLeft:0},onClick:function(){Ae.page=1,Ae.keyword=null,delete Ae.id,Vt(Ae),$i(!1),Fr(Ae)},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(Ae.keyword),"\u201D")):null,y.a.createElement("div",{className:le.a.contentListWrap},cn!==0?y.a.createElement(F.a,{size:"large",spinning:Rn["problemset/getItemBanks"]},On.map(function(Xe,He){var je,Ye;return y.a.createElement("div",{className:le.a.li},y.a.createElement("div",{className:le.a.top},y.a.createElement(hr.b,{key:Xe.id,data:Xe,selectIds:he,onSelectCheckBox:ia})),y.a.createElement("div",{className:le.a.bottom},y.a.createElement("p",{className:"".concat(le.a.actionLeftItem," ").concat(le.a.questionTypeName)},(je=Ci.find(function(qe){return qe.type===Xe.item_type}))===null||je===void 0?void 0:je.name),y.a.createElement("p",{className:le.a.actionLeftItem},Za[Xe.difficulty]),y.a.createElement("p",{className:le.a.actionLeftItem},"\u521B\u5EFA\u8005",y.a.createElement("span",{className:"c-grey-333"},Xe==null||((Ye=Xe.author)===null||Ye===void 0)?void 0:Ye.name)),y.a.createElement("p",{className:le.a.actionLeftItem},"\u66F4\u65B0",y.a.createElement("span",{className:"c-grey-333"},Xe==null?void 0:Xe.updated_at)),y.a.createElement("p",{className:le.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",y.a.createElement("span",{className:"c-grey-333"},Xe==null?void 0:Xe.quotes)),!ze&&y.a.createElement("div",{className:le.a.more},Vr({},Xe))))})):y.a.createElement(F.a,{size:"large",spinning:Rn["problemset/getItemBanks"]},y.a.createElement($.a,null))),cn!==0&&!ze&&y.a.createElement(K.a,{showQuickJumper:!0,onChange:_i,defaultCurrent:1,pageSize:Ae==null?void 0:Ae.per_page,current:Ae.page||1,total:cn,showTotal:function(He){return y.a.createElement("span",{className:"mr10"},"\u5171",y.a.createElement("span",{className:"c-light-primary"},He),"\u6761\u6570\u636E")}}),ze&&y.a.createElement("div",{style:{height:20}})),Pe&&y.a.createElement(Ft,{basketData:kt.basketData,visible:Ti,basketTotal:hi,onClose:function(){return fo(!1)},onDelete:ko}),!Object(br.m)()&&Pe&&y.a.createElement(yr,{visibleBasket:Ti,onToggleVisible:function(){return fo(!Ti)},count:hi})),y.a.createElement(re,null),y.a.createElement(Ke,{onReloadData:vr}),y.a.createElement(it,{onReloadData:function(){return Ea([null])}}),y.a.createElement(Wt,{onReloadData:vr,onReloadBasketData:Ma}),Nn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?y.a.createElement(Ja,{shixunIds:Z,cb:Ur}):null,y.a.createElement(gt,null),y.a.createElement(We,null),y.a.createElement(ht,null),y.a.createElement(nt,null),y.a.createElement(De,null),y.a.createElement(Ze,{onOk:_o}),y.a.createElement(Y.a,{onOk:Gi})),Pe?y.a.createElement(B.Fragment,null,!!(he!=null&&he.length)&&y.a.createElement("div",{className:le.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(i.a,{className:"font14",checked:On!=null&&On.length?he.length===(On==null?void 0:On.length):!1,onChange:function(He){return $a(He.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",he==null?void 0:he.length,")"))),y.a.createElement("div",{className:le.a.btns},Cn&&y.a.createElement("div",{className:le.a.btn,onClick:function(){return Br(!0)}},y.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Cn&&y.a.createElement("div",{className:le.a.btn,onClick:function(){return Br(!1)}},y.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),jn===ar.Mine&&y.a.createElement("div",{className:le.a.btn,onClick:function(){return ro()}},y.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),jn===ar.Mine&&y.a.createElement("div",{className:le.a.btn,onClick:io}," ",y.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),jn===ar.Mine&&y.a.createElement("div",{className:le.a.btn,onClick:function(){return Wi()}}," ",y.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),jn===ar.Mine&&y.a.createElement("div",{className:le.a.btn,onClick:xa}," ",y.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),jn===ar.Mine&&y.a.createElement("div",{className:le.a.btn,onClick:Yn}," ",y.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),y.a.createElement("div",{onClick:function(){return Ce([])},style:{marginLeft:"auto"},className:le.a.btn}," ",y.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):ze?"":y.a.createElement("div",{className:le.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(i.a,{className:"font14",checked:On!=null&&On.length?he.length===(On==null?void 0:On.length):!1,onChange:function(He){return $a(He.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",he==null?void 0:he.length,")"))),y.a.createElement("div",{className:le.a.btns},Cn&&!!(he!=null&&he.length)&&y.a.createElement("div",{className:le.a.btn,onClick:function(){return Br(!0)}},y.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Cn&&!!(he!=null&&he.length)&&y.a.createElement("div",{className:le.a.btn,onClick:function(){return Br(!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",Dt,"\u9898"),y.a.createElement("div",{onClick:Ka,className:le.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),ze&&y.a.createElement("div",{className:le.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(K.a,{showQuickJumper:!0,onChange:_i,defaultCurrent:1,pageSize:Ae==null?void 0:Ae.per_page,current:Ae.page||1,hideOnSinglePage:!0,total:cn,showTotal:function(He){return y.a.createElement("span",{className:"mr10"},"\u5171",y.a.createElement("span",{className:"c-light-primary"},He),"\u6761\u6570\u636E")}})),y.a.createElement("div",{className:le.a.btns},y.a.createElement(V.a,{align:"middle",style:{marginLeft:"auto"}},y.a.createElement(V.a,{onClick:function(){if((an==null?void 0:an.length)<=0){c.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}ir(!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"},he.length),"\u4E2A")),y.a.createElement(D.a,{className:"mr20 ml40",onClick:function(){if(ot){var He;x.d.push("/classrooms/".concat(rn.params.coursesId,"/program_homework/").concat(rn==null||((He=rn.params)===null||He===void 0)?void 0:He.categoryId,"/detail?tabs=1"));return}x.d.push("/classrooms/".concat(rn.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),y.a.createElement(D.a,{loading:Pn,onClick:Si,type:"primary"},"\u786E\u8BA4",ot?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Yi=Be.default=Object(x.a)(function(Gt){var at=Gt.classroomList,Lt=Gt.problemset,xt=Gt.user,St=Gt.loading,Yt=Gt.globalSetting,hn=Gt.shixunHomeworks;return{classroomList:at,problemset:Lt,user:xt,globalSetting:Yt,loading:St.effects,shixunHomeworks:hn}})(xi)},LE3n:function(rt,Be,H){"use strict";var oe=H("ozfa"),V=H("MJZm"),I=H("k1fw"),K=H("+L6B"),L=H("2/Rp"),N=H("5NDa"),W=H("5rEg"),F=H("2qtc"),R=H("kLXV"),D=H("miYZ"),b=H("tsqr"),p=H("9og8"),_=H("tJVT"),f=H("WmNS"),a=H.n(f),d=H("cDcd"),l=H.n(d),i=H("1vnw"),u=H.n(i),c=H("ErOA"),S=H("Ix/O"),C=H.n(S),T=H("xTzM"),w=H.n(T),A=H("WCUW"),m=H("LvDl"),v=H.n(m),s=function(g){var O=g.isProblemset,M=g.name,k=g.id,U=g.itemBanksCount,B=g.onOpen,y=B===void 0?function(){}:B,x=g.onShare,j=x===void 0?function(){}:x,z=g.onMove,Y=z===void 0?function(){}:z,$=g.onDeleteOk,ce=$===void 0?function(){}:$,se=Object(d.useState)(!1),ne=Object(_.a)(se,2),re=ne[0],ue=ne[1],ee=Object(d.useState)(M),ae=Object(_.a)(ee,2),ge=ae[0],Le=ae[1],ke=Object(d.useState)(M),De=Object(_.a)(ke,2),Ue=De[0],Ie=De[1],Re=function(){var $e=Object(p.a)(a.a.mark(function Ze(Qe){var Ke,st,it;return a.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(Ke=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Ue.trim()){Je.next=4;break}return b.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Je.abrupt("return");case 4:if(!(Ue.charAt(0)===" ")){Je.next=7;break}return b.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Je.abrupt("return");case 7:st=0;case 8:if(!(st<Ue.length)){Je.next=15;break}if(!Ke.includes(Ue.charAt(st))){Je.next=12;break}return b.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Je.abrupt("return",!1);case 12:st++,Je.next=8;break;case 15:return Je.next=17,Object(c.a)("/api/item_banks_groups/".concat(Math.abs(Qe),".json"),{method:"put",body:{name:Ue}});case 17:it=Je.sent,it.status===0&&(ue(!1),Le(Ue));case 19:case"end":return Je.stop()}},Ze)}));return function(Qe){return $e.apply(this,arguments)}}(),Ve=function(Ze){R.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:l.a.createElement("div",null,l.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),l.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var Qe=Object(p.a)(a.a.mark(function st(){var it;return a.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Je.next=2,Object(c.a)("/api/item_banks_groups/".concat(Math.abs(Ze),".json"),{method:"delete",body:{}});case 2:it=Je.sent,it.status===0&&ce(Ze);case 4:case"end":return Je.stop()}},st)}));function Ke(){return Qe.apply(this,arguments)}return Ke}()})};return l.a.createElement("div",{className:u.a.list},re?l.a.createElement(W.a,{style:{maxWidth:780},value:Ue,onChange:function(Ze){return Ie(Ze.target.value)}}):l.a.createElement("div",{title:ge,onClick:function(){return y(k)},className:u.a.name},ge),O&&l.a.createElement("div",{className:u.a.btns},re?l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{style:{height:16},onClick:function(){return Re(k)},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),l.a.createElement("div",{style:{height:16},onClick:function(){Ie(ge),ue(!1)},className:"ml10"},l.a.createElement("i",{className:"iconfont icon-qingchu"}))):l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{onClick:function(){return Y(k,"up")},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),l.a.createElement("div",{onClick:function(){return Y(k,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},l.a.createElement("i",{className:"iconfont icon-shangyi3"}))),l.a.createElement(L.a,{className:"ml10",onClick:function(){if(!U){b.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}j(Math.abs(k))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),l.a.createElement(L.a,{className:"ml10",onClick:function(){return ue(!0)},type:"link"},"\u91CD\u547D\u540D"),l.a.createElement(L.a,{onClick:function(){return Ve(k)},type:"link",danger:!0},"\u5220\u9664")))},o=function(g){var O=g.isProblemset,M=g.data,k=g.onOpen,U=k===void 0?function(){}:k,B=g.onShare,y=B===void 0?function(){}:B,x=g.reloadData,j=Object(d.useState)(),z=Object(_.a)(j,2),Y=z[0],$=z[1];Object(d.useEffect)(function(){$(M==null?void 0:M.map(function(ge){return{title:l.a.createElement(s,{isProblemset:O,name:ge.name,id:ge.id,itemBanksCount:ge.item_banks_count,onMove:se,onOpen:U,onShare:y,onDeleteOk:re}),key:ge.id,icon:l.a.createElement("img",{src:C.a,className:u.a.folderIcon}),isLeaf:!1}}))},[M]);var ce=function ge(Le,ke,De){for(var Ue=Object(m.cloneDeep)(Le),Ie=0;Ie<Ue.length;Ie++){if(Ue[Ie].key===ke){if(De==="up"){var Re=[Ue[Ie],Ue[Ie-1]];Ue[Ie-1]=Re[0],Ue[Ie]=Re[1]}else{var Ve=[Ue[Ie+1],Ue[Ie]];Ue[Ie]=Ve[0],Ue[Ie+1]=Ve[1]}break}Ue[Ie].children&&(Ue[Ie].children=ge(Ue[Ie].children,ke,De))}return Ue},se=function(){var ge=Object(p.a)(a.a.mark(function Le(ke,De){var Ue;return a.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:if(!(De==="up")){Re.next=6;break}return Re.next=3,Object(A.I)({id:Math.abs(ke)});case 3:Re.t0=Re.sent,Re.next=9;break;case 6:return Re.next=8,Object(A.H)({id:Math.abs(ke)});case 8:Re.t0=Re.sent;case 9:Ue=Re.t0,Ue.status===0&&$(function(Ve){return ce(Ve,ke,De)});case 11:case"end":return Re.stop()}},Le)}));return function(ke,De){return ge.apply(this,arguments)}}(),ne=function ge(Le,ke){return Le.filter(function(De){return De.key===ke?!1:(De.children&&(De.children=ge(De.children,ke)),!0)})},re=function(Le){$(function(ke){return ne(ke,Le)}),x()},ue=function ge(Le,ke,De){return Le.map(function(Ue){return Ue.key===ke?Object(I.a)(Object(I.a)({},Ue),De):Ue.children?Object(I.a)(Object(I.a)({},Ue),{},{children:ge(Ue.children,ke,De)}):Ue})},ee=function(){var ge=Object(p.a)(a.a.mark(function Le(ke){var De,Ue,Ie,Re,Ve;return a.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return De=ke.key,Ze.next=3,Object(A.B)({group_id:Math.abs(De)});case 3:Ue=Ze.sent,Ie=Ue||{},Re=Ie.item_banks_group,Ve=Ie.item_banks_group_count,Ve>0?$(function(Qe){return ue(Qe,De,{children:Re.map(function(Ke){return{title:l.a.createElement(s,{isProblemset:O,name:Ke.name,id:Ke.id,itemBanksCount:Ke.item_banks_count,onMove:se,onOpen:U,onShare:y,onDeleteOk:re}),key:Ke.id,icon:l.a.createElement("img",{src:C.a,className:u.a.folderIcon}),isLeaf:!1}})})}):$(function(Qe){return ue(Qe,De,{isLeaf:!0})});case 6:case"end":return Ze.stop()}},Le)}));return function(ke){return ge.apply(this,arguments)}}(),ae=function(Le,ke){var De=ke.node,Ue=ke.expanded;$(function(Ie){return ue(Ie,De.key,{icon:Ue?l.a.createElement("img",{src:w.a,className:u.a.folderIcon}):l.a.createElement("img",{src:C.a,className:u.a.folderIcon})})})};return(Y==null?void 0:Y.length)>0&&l.a.createElement(V.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:Y,loadData:ee,onExpand:ae,className:u.a.folderWrapper,selectable:!1})};Be.a=o},LdHM:function(rt,Be,H){"use strict";H.d(Be,"b",function(){return c}),H.d(Be,"a",function(){return C});var oe=H("1OyB"),V=H("vuIU"),I=H("Ji7U"),K=H("LK+K"),L=H("cDcd"),N=H("rePB"),W=H("Ff2n"),F=H("ODXe"),R=H("4IlW"),D=H("bX4T"),b=H("YrtM"),p=H("TSYQ"),_=H.n(p),f=H("+nKL"),a=H("8OUc"),d=function(j,z){var Y=j.prefixCls,$=j.id,ce=j.flattenOptions,se=j.childrenAsData,ne=j.values,re=j.searchValue,ue=j.multiple,ee=j.defaultActiveFirstOption,ae=j.height,ge=j.itemHeight,Le=j.notFoundContent,ke=j.open,De=j.menuItemSelectedIcon,Ue=j.virtual,Ie=j.onSelect,Re=j.onToggleOpen,Ve=j.onActiveValue,$e=j.onScroll,Ze=j.onMouseEnter,Qe="".concat(Y,"-item"),Ke=Object(b.a)(function(){return ce},[ke,ce],function(nt,me){return me[0]&&nt[1]!==me[1]}),st=L.useRef(null),it=function(me){me.preventDefault()},ut=function(me){st.current&&st.current.scrollTo({index:me})},Je=function(me){for(var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,le=Ke.length,q=0;q<le;q+=1){var ie=(me+q*ve+le)%le,fe=Ke[ie],Ee=fe.group,Oe=fe.data;if(!Ee&&!Oe.disabled)return ie}return-1},_t=L.useState(function(){return Je(0)}),gt=Object(F.a)(_t,2),mt=gt[0],We=gt[1],Et=function(me){We(me);var ve=Ke[me];if(!ve){Ve(null,-1);return}Ve(ve.data.value,me)};L.useEffect(function(){Et(ee!==!1?Je(0):-1)},[Ke.length,re]),L.useEffect(function(){var nt=setTimeout(function(){if(!ue&&ke&&ne.size===1){var me=Array.from(ne)[0],ve=Ke.findIndex(function(le){var q=le.data;return q.value===me});Et(ve),ut(ve)}});return function(){return clearTimeout(nt)}},[ke]);var ht=function(me){me!==void 0&&Ie(me,{selected:!ne.has(me)}),ue||Re(!1)};if(L.useImperativeHandle(z,function(){return{onKeyDown:function(me){var ve=me.which;switch(ve){case R.a.UP:case R.a.DOWN:{var le=0;if(ve===R.a.UP?le=-1:ve===R.a.DOWN&&(le=1),le!==0){var q=Je(mt+le,le);ut(q),Et(q)}break}case R.a.ENTER:{var ie=Ke[mt];ie&&!ie.data.disabled?ht(ie.data.value):ht(void 0),ke&&me.preventDefault();break}case R.a.ESC:Re(!1)}},onKeyUp:function(){},scrollTo:function(me){ut(me)}}}),Ke.length===0)return L.createElement("div",{role:"listbox",id:"".concat($,"_list"),className:"".concat(Qe,"-empty"),onMouseDown:it},Le);function Ne(nt){var me=Ke[nt];if(!me)return null;var ve=me.data||{},le=ve.value,q=ve.label,ie=ve.children,fe=Object(D.a)(ve,!0),Ee=se?ie:q;return me?L.createElement("div",Object.assign({"aria-label":typeof Ee=="string"?Ee:null},fe,{key:nt,role:"option",id:"".concat($,"_list_").concat(nt),"aria-selected":ne.has(le)}),le):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat($,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(mt-1),Ne(mt),Ne(mt+1)),L.createElement(f.a,{itemKey:"key",ref:st,data:Ke,height:ae,itemHeight:ge,fullHeight:!1,onMouseDown:it,onScroll:$e,virtual:Ue,onMouseEnter:Ze},function(nt,me){var ve,le=nt.group,q=nt.groupOption,ie=nt.data,fe=ie.label,Ee=ie.key;if(le)return L.createElement("div",{className:_()(Qe,"".concat(Qe,"-group"))},fe!==void 0?fe:Ee);var Oe=ie.disabled,Ge=ie.value,tt=ie.title,Tt=ie.children,jt=ie.style,Ft=ie.className,In=Object(W.a)(ie,["disabled","value","title","children","style","className"]),sn=ne.has(Ge),Wt="".concat(Qe,"-option"),Qn=_()(Qe,Wt,Ft,(ve={},Object(N.a)(ve,"".concat(Wt,"-grouped"),q),Object(N.a)(ve,"".concat(Wt,"-active"),mt===me&&!Oe),Object(N.a)(ve,"".concat(Wt,"-disabled"),Oe),Object(N.a)(ve,"".concat(Wt,"-selected"),sn),ve)),mn=se?Tt:fe,yr=!De||typeof De=="function"||sn;return L.createElement("div",Object.assign({},In,{"aria-selected":sn,className:Qn,title:tt,onMouseMove:function(){if(mt===me||Oe)return;Et(me)},onClick:function(){Oe||ht(Ge)},style:jt}),L.createElement("div",{className:"".concat(Wt,"-content")},mn||Ge),L.isValidElement(De)||sn,yr&&L.createElement(a.a,{className:"".concat(Qe,"-option-state"),customizeIcon:De,customizeIconProps:{isSelected:sn}},sn?"\u2713":null))}))},l=L.forwardRef(d);l.displayName="OptionList";var i=l,u=function(){return null};u.isSelectOption=!0;var c=u,S=function(){return null};S.isSelectOptGroup=!0;var C=S,T=H("VTBJ"),w=H("Zm9Q");function A(x){var j=x.key,z=x.props,Y=z.children,$=z.value,ce=Object(W.a)(z,["children","value"]);return Object(T.a)({key:j,value:$!==void 0?$:j,children:Y},ce)}function m(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(x).map(function(z,Y){if(!L.isValidElement(z)||!z.type)return null;var $=z.type.isSelectOptGroup,ce=z.key,se=z.props,ne=se.children,re=Object(W.a)(se,["children"]);return j||!$?A(z):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(ce===null?Y:ce,"__"),label:ce},re),{},{options:m(ne)})}).filter(function(z){return z})}var v=H("2Qr1"),s=H("qNPg"),o=H("U8pU"),E=H("Kwbf"),g=H("WKfj");function O(x){var j=x.mode,z=x.options,Y=x.children,$=x.backfill,ce=x.allowClear,se=x.placeholder,ne=x.getInputElement,re=x.showSearch,ue=x.onSearch,ee=x.defaultOpen,ae=x.autoFocus,ge=x.labelInValue,Le=x.value,ke=x.inputValue,De=x.optionLabelProp,Ue=j==="multiple"||j==="tags",Ie=re!==void 0?re:Ue||j==="combobox",Re=z||m(Y);if(Object(E.a)(j!=="tags"||Re.every(function(Qe){return!Qe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),j==="tags"||j==="combobox"){var Ve=Re.some(function(Qe){return Qe.options?Qe.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in Qe?Qe.value:Qe.key)=="number"});Object(E.a)(!Ve,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(j!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(j==="combobox"||!$,"`backfill` only works with `combobox` mode."),Object(E.a)(j==="combobox"||!ne,"`getInputElement` only work with `combobox` mode."),Object(E.b)(j!=="combobox"||!ne||!ce||!se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!Ie&&j!=="combobox"&&j!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!ee||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Le!=null){var $e=Object(g.d)(Le);Object(E.a)(!ge||$e.every(function(Qe){return Object(o.a)(Qe)==="object"&&("key"in Qe||"value"in Qe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!Ue||Array.isArray(Le),"`value` should be array when `mode` is `multiple` or `tags`")}if(Y){var Ze=null;Object(w.a)(Y).some(function(Qe){if(!L.isValidElement(Qe)||!Qe.type)return!1;var Ke=Qe.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var st=Object(w.a)(Qe.props.children).every(function(it){return!L.isValidElement(it)||!Qe.type||it.type.isSelectOption?!0:(Ze=it.type,!1)});return!st}return Ze=Ke,!0}),Ze&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ze.displayName||Ze.name||Ze,"`.")),Object(E.a)(ke===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=O,k=Object(s.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:m,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:M,fillOptionsWithMissingValue:v.a}),U=function(x){Object(I.a)(z,x);var j=Object(K.a)(z);function z(){var Y;return Object(oe.a)(this,z),Y=j.apply(this,arguments),Y.selectRef=L.createRef(),Y.focus=function(){Y.selectRef.current.focus()},Y.blur=function(){Y.selectRef.current.blur()},Y}return Object(V.a)(z,[{key:"render",value:function(){return L.createElement(k,Object.assign({ref:this.selectRef},this.props))}}]),z}(L.Component);U.Option=c,U.OptGroup=C;var B=U,y=Be.c=B},M8RZ:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return R});var oe=H("fWQN"),V=H("mtLc"),I=H("yKVA"),K=H("879j"),L=H("cDcd"),N=H.n(L),W=H("faye"),F=H.n(W),R=function(D){Object(I.a)(p,D);var b=Object(K.a)(p);function p(_){var f;Object(oe.a)(this,p),f=b.call(this,_);var a=window.document;return f.node=a.createElement("div"),a.body.appendChild(f.node),f}return Object(V.a)(p,[{key:"render",value:function(){var f=this.props.children;return Object(W.createPortal)(f,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(N.a.Component)},NLgs:function(rt,Be,H){"use strict";H.d(Be,"e",function(){return c}),H.d(Be,"f",function(){return S}),H.d(Be,"d",function(){return T}),H.d(Be,"c",function(){return w}),H.d(Be,"a",function(){return A}),H.d(Be,"b",function(){return m});var oe=H("miYZ"),V=H("tsqr"),I=H("9og8"),K=H("2qtc"),L=H("kLXV"),N=H("WmNS"),W=H.n(N),F=H("cDcd"),R=H.n(F),D=H("9kvl"),b=H("xKgJ"),p=H("1vsH"),_=H("RCxd"),f=H("mOS8"),a=H.n(f),d=H("1ZF9"),l=H.n(d),i=H("NoGO"),u=H.n(i),c=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(S(s)&&C(o))},S=function(s){return Object(b.p)()?!0:(s({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},C=function(){var s,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(D.c)()._store.getState(),g=E.user;return(s=g.userInfo)!==null&&s!==void 0&&s.profile_completed?!0:(L.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(){D.d.push("/account/profile/edit")}}),!1)},T=function(){var s,o=Object(D.c)()._store.getState(),E=o.user;return(s=E.userInfo)!==null&&s!==void 0&&s.professional_certification?!0:(L.a.confirm({title:"\u63D0\u793A",centered:!0,content:R.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(p.U)("/account/certification")}}),!1)},w=function(){return Object(b.a)()?!0:(L.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:R.a.createElement("div",{className:"tc",style:{marginLeft:-38}},R.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),R.a.createElement("img",{src:u.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},A=function(s,o){return s?!0:(L.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:R.a.createElement("div",null,R.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"),R.a.createElement("div",{style:{marginLeft:"110px"}},R.a.createElement("img",{src:l.a,width:200}),R.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.U)("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(D.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?(L.a.info({centered:!0,icon:R.a.createElement(_.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:R.a.createElement("div",{className:"tc",style:{marginLeft:-38}},R.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},R.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(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"),R.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),R.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(L.a.confirm({centered:!0,icon:R.a.createElement(_.a,null),title:"\u63D0\u793A",content:R.a.createElement("div",null,R.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",o,"\u3002"),R.a.createElement("br",null),R.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){L.a.confirm({width:440,centered:!0,icon:R.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 M=Object(I.a)(W.a.mark(function U(){var B;return W.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:B=x.sent,B.status!==401&&(V.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()}},U)}));function k(){return M.apply(this,arguments)}return k}()})}}),!0):!1}},NoGO:function(rt,Be,H){rt.exports=H.p+"static/newqrcode.9bae6615.png"},NvD2:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return N});var oe=H("Kwbf");function V(W,F){var R=new Set;return W.forEach(function(D){F.has(D)||R.add(D)}),R}function I(W){var F=W||{},R=F.disabled,D=F.disableCheckbox,b=F.checkable;return!!(R||D)||b===!1}function K(W,F,R,D){for(var b=new Set(W),p=new Set,_=0;_<=R;_+=1){var f=F.get(_)||new Set;f.forEach(function(i){var u=i.key,c=i.node,S=i.children,C=S===void 0?[]:S;b.has(u)&&!D(c)&&C.filter(function(T){return!D(T.node)}).forEach(function(T){b.add(T.key)})})}for(var a=new Set,d=R;d>=0;d-=1){var l=F.get(d)||new Set;l.forEach(function(i){var u=i.parent,c=i.node;if(D(c)||!i.parent||a.has(i.parent.key))return;if(D(i.parent.node)){a.add(u.key);return}var S=!0,C=!1;(u.children||[]).filter(function(T){return!D(T.node)}).forEach(function(T){var w=T.key,A=b.has(w);S&&!A&&(S=!1),!C&&(A||p.has(w))&&(C=!0)}),S&&b.add(u.key),C&&p.add(u.key),a.add(u.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(V(p,b))}}function L(W,F,R,D,b){for(var p=new Set(W),_=new Set(F),f=0;f<=D;f+=1){var a=R.get(f)||new Set;a.forEach(function(u){var c=u.key,S=u.node,C=u.children,T=C===void 0?[]:C;!p.has(c)&&!_.has(c)&&!b(S)&&T.filter(function(w){return!b(w.node)}).forEach(function(w){p.delete(w.key)})})}_=new Set;for(var d=new Set,l=D;l>=0;l-=1){var i=R.get(l)||new Set;i.forEach(function(u){var c=u.parent,S=u.node;if(b(S)||!u.parent||d.has(u.parent.key))return;if(b(u.parent.node)){d.add(c.key);return}var C=!0,T=!1;(c.children||[]).filter(function(w){return!b(w.node)}).forEach(function(w){var A=w.key,m=p.has(A);C&&!m&&(C=!1),!T&&(m||_.has(A))&&(T=!0)}),C||p.delete(c.key),T&&_.add(c.key),d.add(c.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(V(_,p))}}function N(W,F,R,D){var b=[],p;D?p=D:p=I;var _=new Set(W.filter(function(l){var i=!!R[l];return i||b.push(l),i})),f=new Map,a=0;Object.keys(R).forEach(function(l){var i=R[l],u=i.level,c=f.get(u);c||(c=new Set,f.set(u,c)),c.add(i),a=Math.max(a,u)}),Object(oe.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var d;return F===!0?d=K(_,f,a,p):d=L(_,F.halfCheckedKeys,f,a,p),d}},"ORt/":function(rt,Be,H){rt.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(rt,Be,H){"use strict";H.d(Be,"b",function(){return D}),H.d(Be,"a",function(){return b}),H.d(Be,"k",function(){return p}),H.d(Be,"h",function(){return _}),H.d(Be,"i",function(){return f}),H.d(Be,"g",function(){return a}),H.d(Be,"c",function(){return d}),H.d(Be,"d",function(){return l}),H.d(Be,"j",function(){return c}),H.d(Be,"e",function(){return S}),H.d(Be,"f",function(){return C});var oe=H("KQm4"),V=H("U8pU"),I=H("Ff2n"),K=H("cDcd"),L=H.n(K),N=H("Kwbf"),W=H("WaYH"),F=.25,R=2;function D(T,w){var A=T.slice(),m=A.indexOf(w);return m>=0&&A.splice(m,1),A}function b(T,w){var A=T.slice();return A.indexOf(w)===-1&&A.push(w),A}function p(T){return T.split("-")}function _(T,w){return"".concat(T,"-").concat(w)}function f(T){return T&&T.type&&T.type.isTreeNode}function a(T,w){var A=[T],m=w[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;A.push(E),v(g)})}return v(m.children),A}function d(T,w){var A=T.clientY,m=w.selectHandle.getBoundingClientRect(),v=m.top,s=m.bottom,o=m.height,E=Math.max(o*F,R);return A<=v+E?-1:A>=s-E?1:0}function l(T,w){if(!T)return;var A=w.multiple;return A?T.slice():T.length?[T[0]]:T}var i=function(w){return w};function u(T,w){if(!T)return[];var A=w||{},m=A.processProps,v=m===void 0?i:m,s=Array.isArray(T)?T:[T];return s.map(function(o){var E=o.children,g=Object(I.a)(o,["children"]),O=u(E,w);return L.a.createElement(W.a,Object.assign({},v(g)),O)})}function c(T){if(!T)return null;var w;if(Array.isArray(T))w={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(V.a)(T)==="object")w={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(N.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function S(T,w){var A=new Set;function m(v){if(A.has(v))return;var s=w[v];if(!s)return;A.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(oe.a)(A)}function C(T){var w={};return Object.keys(T).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(w[A]=T[A])}),w}},Ot1p:function(rt,Be,H){"use strict";var oe=H("2qtc"),V=H("kLXV"),I=H("rAM+"),K=H("miYZ"),L=H("tsqr"),N=H("9og8"),W=H("tJVT"),F=H("jrin"),R=H("WmNS"),D=H.n(R),b=H("cDcd"),p=H.n(b),_=H("VrN/"),f=H.n(_),a=H("bdgK"),d=H("p77/"),l=H("Bd2K"),i=H("ELLl"),u=H("19Vz"),c=H("lZu9"),S=H("+NIl"),C=H("kSUc"),T=H("9Bee"),w=function(Oe){var Ge=Oe.value,tt=Ge===void 0?"":Ge,Tt=Oe.className,jt=Oe.showTextOnly,Ft=Oe.showLines,In=Oe.style,sn=In===void 0?{}:In,Wt=Object(b.useMemo)(function(){return""},[tt]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Wt}}))},A=H("0Owb"),m=H("dejd"),v=H("C+DQ"),s=H("1vsH"),o=H("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(Oe){var Ge=Oe.onActionCallback,tt=Oe.title,Tt=Oe.icon,jt=Oe.actionName,Ft=Oe.className,In=Ft===void 0?"":Ft,sn=Oe.children;function Wt(){Ge(jt)}return p.a.createElement("a",{title:tt,className:In,onClick:Wt},p.a.createElement("i",{className:"md-iconfont ".concat(Tt)}),sn)}var O=function(Oe){var Ge=Oe.watch,tt=Oe.showNullButton,Tt=Oe.onActionCallback,jt=Oe.fullScreen,Ft=Oe.insertTemp,In=Oe.hidetoolBar,sn=Oe.uuid,Wt=Oe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.G)("_educoder_session"),"&key=").concat(sn,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Qn=[].concat(E,[{title:"".concat(Ge?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ge?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!In&&Qn.map(function(mn,yr){return p.a.createElement("li",{key:yr},mn.actionName?p.a.createElement(g,Object(A.a)({},mn,{onActionCallback:Tt})):p.a.createElement("span",{className:"v-line"}))}),tt?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:Tt},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ft&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ft),onActionCallback:Tt},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(jt?"icon-shrink":"icon-enlarge"),title:jt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Tt})))},M=H("M8RZ"),k=H("+L6B"),U=H("2/Rp"),B=H("y8nQ"),y=H("Vl3Y"),x=H("5NDa"),j=H("5rEg"),z={labelCol:{span:4},wrapperCol:{span:20}},Y=function(Oe){var Ge=Oe.callback,tt=Oe.onCancel;function Tt(jt){Ge(jt)}return p.a.createElement(y.a,Object(A.a)({},z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Tt}),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(j.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(j.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(U.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))},$=H("7ahc"),ce=H("HmJG"),se=H("BjJ7"),ne=y.a.useForm,re={width:280,marginRight:10},ue={labelCol:{span:5},wrapperCol:{span:19}},ee=function(Oe){var Ge=Oe.callback,tt=Oe.onCancel,Tt=ne(),jt=Object(W.a)(Tt,1),Ft=jt[0];function In(Qn){Ge(Qn)}function sn(Qn,mn){if(Qn.status===-1){L.b.error(Qn.message);return}Ft.setFieldsValue({src:"/api/attachments/".concat(Qn.id),type:mn.type})}function Wt(Qn){var mn=Qn.target.files[0];ge(mn,sn)}return p.a.createElement(y.a,Object(A.a)({form:Ft},ue,{className:"upload-image-panel",onFinish:In}),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(j.a,{style:re})),p.a.createElement(ae,{onFileChange:Wt}))),p.a.createElement(y.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(j.a,{style:{width:264}})),p.a.createElement(y.a.Item,{style:{textAlign:"right"}},p.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(U.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))};function ae(Oe){var Ge=Oe.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Ge}))}function ge(Oe,Ge){if(!Oe)throw new String("\u6CA1\u6709\u6587\u4EF6");var tt=new FormData;tt.append("editormd-image-file",Oe),tt.append("file_param_name","editormd-image-file"),tt.append("byxhr","true");var Tt=new window.XMLHttpRequest;Tt.withCredentials=!0,Tt.addEventListener("load",function(jt){Ge(JSON.parse(jt.target.responseText),Oe)},!1),Tt.addEventListener("error",function(jt){console.error(jt)},!1),Tt.open("POST","".concat(se.a,"/api/attachments.json")),Tt.send(tt)}var Le=H("giR+"),ke=H("fyUT"),De=H("7Kak"),Ue=H("9yH6"),Ie=Ue.a.Group,Re={margin:"0 8px"},Ve=function(Oe){var Ge=Oe.callback,tt=Oe.onCancel;function Tt(jt){Ge(jt)}return p.a.createElement(y.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Tt},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Re},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Re},"\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:Re},"\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:Re},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(y.a.Item,{name:"align"},p.a.createElement(Ie,null,p.a.createElement(Ue.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(Ue.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(Ue.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(Ue.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(U.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))},$e=H("ErOA"),Ze=H("7Cbv"),Qe="link",Ke="upload-image",st="code-block",it="add-table",ut="------------",Je={default:ut,left:":".concat(ut),center:":".concat(ut,":"),right:"".concat(ut,":")},_t=H("9VGf"),gt,mt;function We(){}var Et=0,ht=1e4,Ne="\u2581",nt=`
|
|
**\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 me(Oe){return/^\d+$/.test(Oe)?"".concat(Oe,"px"):Oe}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0,le=ve?"Cmd":"Ctrl",q=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(gt={},Object(F.a)(gt,le+"-B","bold"),Object(F.a)(gt,le+"-I","italic"),gt),fe=(mt={},Object(F.a)(mt,Qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(mt,st,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(mt,Ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(mt,it,"\u6DFB\u52A0\u8868\u683C"),mt),Ee=Be.a=function(Oe){var Ge=Oe.defaultValue,tt=Ge===void 0?"":Ge,Tt=Oe.onChange,jt=Oe.width,Ft=jt===void 0?"100%":jt,In=Oe.height,sn=In===void 0?400:In,Wt=Oe.miniToolbar,Qn=Wt===void 0?!1:Wt,mn=Oe.isFocus,yr=mn===void 0?!1:mn,hr=Oe.watch,En=Oe.insertTemp,Ar=Oe.mode,br=Ar===void 0?"markdown":Ar,Jt=Oe.id,ln=Jt===void 0?"markdown-editor-id":Jt,_n=Oe.showResizeBar,qn=_n===void 0?!1:_n,Er=Oe.noStorage,Ir=Er===void 0?!1:Er,Oa=Oe.showNullButton,xn=Oa===void 0?!1:Oa,Bt=Oe.hidetoolBar,na=Bt===void 0?!1:Bt,ya=Oe.fullScreen,ra=ya===void 0?!1:ya,Wn=Oe.onBlur,Zr=Oe.onCMBeforeChange,Na=Oe.onFullScreen,Ja=Oe.className,ft=Ja===void 0?"":Ja,Zt=Oe.disablePaste,qa=Zt===void 0?!1:Zt,za=Oe.placeholder,ui=za===void 0?"":za,Ua=Oe.values,di=Ua===void 0?"":Ua,gn=Object(b.useState)(null),Pi=Object(W.a)(gn,2),yt=Pi[0],ja=Pi[1],pa=Object(b.useState)(tt),bi=Object(W.a)(pa,2),ei=bi[0],da=bi[1],ci=Object(b.useState)(hr),Ei=Object(W.a)(ci,2),ar=Ei[0],xi=Ei[1],Yi=Object(b.useState)(ra),Gt=Object(W.a)(Yi,2),at=Gt[0],Lt=Gt[1],xt=Object(b.useState)(""),St=Object(W.a)(xt,2),Yt=St[0],hn=St[1],yn=Object(b.useState)(0),qt=Object(W.a)(yn,2),vn=qt[0],kn=qt[1],en=Object(b.useState)(sn),un=Object(W.a)(en,2),tr=un[0],Nn=un[1],kt=Object(b.useState)(!1),pn=Object(W.a)(kt,2),er=pn[0],Rn=pn[1],zt=Object(b.useRef)(Object(Ze.a)()),rn=Object(b.useRef)(!1),Tn=Object(b.useRef)(),Pt=Object(b.useRef)(),It=Object(b.useRef)(),Mt=Object(b.useRef)(),Ae=Object(b.useRef)(),Vt=function(){var Rt=Object(N.a)(D.a.mark(function Nt(){var Dt,Qt;return D.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object($e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:Qt=bn.sent,Qt!=null&&(Dt=Qt.attachments)!==null&&Dt!==void 0&&Dt.length&&(console.log("cm:",yt,Pt),Qt.attachments.map(function(Hn){Hn.content_type.indexOf("image")>-1?yt.replaceSelection(".concat(Hn.content_type,")")):Hn.content_type.indexOf("video")>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Hn.content_type.indexOf("pdf")>-1?yt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Hn.id,"?type=").concat(Hn.content_type,'&disposition=inline" target="_blank">').concat(Hn.name,"</a>")):yt.replaceSelection("[".concat(Hn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Hn.id,"?type=").concat(Hn.content_type,")"))}));case 4:case"end":return bn.stop()}},Nt)}));return function(){return Rt.apply(this,arguments)}}();Object(b.useEffect)(function(){da(di),yt==null||yt.setValue(di)},[di]),Object(b.useEffect)(function(){Na==null||Na(at)},[at]),Object(b.useEffect)(function(){if(Pt.current){var Rt=f.a.fromTextArea(Pt.current,{mode:br,lineNumbers:!Qn,lineWrapping:!0,value:tt,autoCloseTags:!0,autoCloseBrackets:!0});yr&&Rt.focus();function Nt(Dt,Qt){if(qa){Qt.preventDefault();return}var Dn=Qt.clipboardData;if(Dn){var bn=Dn.types.toString(),Hn=Dn.items;if(bn==="Files"||Dn.types.indexOf("Files")>-1){if(Qt.preventDefault(),br=="stex")return;try{var nr,ca=Hn[1];((nr=Hn[0])===null||nr===void 0?void 0:nr.kind)==="file"&&(ca=Hn[0]);var Fn=ca.getAsFile(),Fa=Fn.name.split(".").pop();ge(Fn,function(rr){if(rr.id){var Jr,zr,Aa;(Fn==null||((Jr=Fn.type)===null||Jr===void 0)?void 0:Jr.indexOf("image"))>-1?Rt.replaceSelection(".concat(rr.content_type,")")):(Fn==null||((zr=Fn.type)===null||zr===void 0)?void 0:zr.indexOf("video"))>-1?Rt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,'"></video>')):(Fn==null||((Aa=Fn.type)===null||Aa===void 0)?void 0:Aa.indexOf("pdf"))>-1?Rt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(Fn.type,'&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):q.includes(Fa)?Rt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,'?type=office&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):Rt.replaceSelection("[".concat(Fn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(rr.content_type,")"))}else(rr==null?void 0:rr.status)===401&&(document.location.href="/user/login")})}catch(rr){L.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Rt.on("paste",Nt),Rt.on("dragleave",function(Dt,Qt){It.current.classList.remove("mouse-hover-md")}),Rt.on("dragover",function(Dt,Qt){It.current.classList.add("mouse-hover-md")}),Rt.on("drop",function(Dt,Qt){It.current.classList.add("mouse-hover-md");var Dn;if(Dn=Qt.dataTransfer.files,Dn.length>0){Qt.preventDefault(),Qt.stopPropagation();for(var bn=function(ca){var Fn=Dn[ca],Fa=Fn.name.split(".").pop();ge(Fn,function(rr){if(rr.id){var Jr,zr,Aa;(Fn==null||((Jr=Fn.type)===null||Jr===void 0)?void 0:Jr.indexOf("image"))>-1?Rt.replaceSelection(".concat(rr.content_type,")")):(Fn==null||((zr=Fn.type)===null||zr===void 0)?void 0:zr.indexOf("video"))>-1?Rt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,'"></video>')):(Fn==null||((Aa=Fn.type)===null||Aa===void 0)?void 0:Aa.indexOf("pdf"))>-1?Rt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(Fn.type,'&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):q.includes(Fa)?Rt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,'?type=office&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):Rt.replaceSelection("[".concat(Fn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(rr.content_type,")"))}else(rr==null?void 0:rr.status)===401&&(document.location.href="/user/login")})},Hn=0;Hn<Dn.length;Hn++)bn(Hn)}}),ja(Rt),function(){Rt.off("paste",Nt)}}},[]);var dn=Object(b.useCallback)(function(){if(It.current)try{}catch(Rt){console.log(Rt,"---- to set md editor body height")}},[tr,It,at]);Object(b.useEffect)(function(){function Rt(){var Dt=new a.default(function(Qt){var Dn=Object(I.a)(Qt),bn;try{for(Dn.s();!(bn=Dn.n()).done;){var Hn=bn.value;(Hn.target.offsetHeight>0||Hn.target.offsetWidth>0)&&(dn(),yt.setSize("100%","100%"),yt.refresh())}}catch(nr){Dn.e(nr)}finally{Dn.f()}});return Dt.observe(Pt.current.parentElement),Dt}if(yt){var Nt=Rt();return function(){Nt.unobserve(Pt.current.parentElement)}}},[yt,dn]),Object(b.useEffect)(function(){if(yt){for(var Rt=[],Nt=function(){var Hn=Qt[Dt];Dn=Object(W.a)(Hn,2);var nr=Dn[0],ca=Dn[1],Fn=Object(F.a)({},nr,function(){sr(ca)});Rt.push(Fn),yt.addKeyMap(Fn)},Dt=0,Qt=Object.entries(ie);Dt<Qt.length;Dt++){var Dn;Nt()}return Tn.current=setInterval(function(){rn.current&&Vt()},4e3),function(){clearInterval(Tn.current);var bn=Object(I.a)(Rt),Hn;try{for(bn.s();!(Hn=bn.n()).done;){var nr=Hn.value;yt.removeKeyMap(nr)}}catch(ca){bn.e(ca)}finally{bn.f()}}}},[yt]),Object(b.useEffect)(function(){ra!==at&&Lt(ra)},[ra]),Object(_t.a)(function(){if(!Ir&&vn>0){var Rt=new Date().getTime(),Nt=window.sessionStorage.getItem(ln);Rt>=vn+ht&&(!Nt||Nt!==ei)&&(window.sessionStorage.setItem(ln,ei),Rn(!0))}},ht),Object(b.useEffect)(function(){xi(hr)},[yt,hr]),Object(b.useEffect)(function(){yt&&(yr&&yt.focus())},[yt,yr]),Object(b.useEffect)(function(){if(ar&&yt){var Rt=yt.getScrollerElement();function Nt(Dt){var Qt=Dt.target;if(Ae.current){var Dn=Qt.scrollTop/Qt.scrollHeight;Ae.current.scrollTop=Ae.current.scrollHeight*Dn}}return Rt.addEventListener("scroll",Nt),function(){Rt.removeEventListener("scroll",Nt)}}},[yt,ar]),Object(b.useEffect)(function(){if(yt&&Zr){function Rt(Nt,Dt){Zr(Nt,Dt)}return yt.on("beforeChange",Rt),function(){yt.off("beforeChange",Rt)}}},[yt,Zr]),Object(b.useEffect)(function(){if(yt&&Wn){function Rt(){Wn(yt.getValue())}return yt.on("blur",Rt),function(){yt.off("blur",Rt)}}},[yt,Wn]),Object(b.useEffect)(function(){if(yt){function Rt(Nt){var Dt=Nt.getValue();da(Dt),kn(new Date().getTime()),Nt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Tt&&Tt(Dt)}return yt.on("change",Rt),function(){yt.off("change",Rt)}}},[yt,Tt]),Object(b.useEffect)(function(){yt&&(tt==null?(yt.setValue(""),da("")):tt!==yt.getValue()&&(yt.setValue(tt),da(tt),yt.setCursor(yt.lineCount(),0)))},[yt,tt]);var sr=Object(b.useCallback)(function(Rt){var Nt=yt.getCursor(),Dt=yt.getSelection(),Qt=Dt.split(`
|
|
`);switch(Rt){case"bold":return yt.replaceSelection("**"+Dt+"**"),Dt===""&&yt.setCursor(Nt.line,Nt.ch+2),yt.focus();case"italic":return yt.replaceSelection("*"+Dt+"*"),Dt===""&&yt.setCursor(Nt.line,Nt.ch+1),yt.focus();case"code":return yt.replaceSelection("`"+Dt+"`"),Dt===""&&yt.setCursor(Nt.line,Nt.ch+1),yt.focus();case"inline-latex":return yt.replaceSelection("`$$"+Dt+"$$`"),Dt===""&&yt.setCursor(Nt.line,Nt.ch+3),yt.focus();case"latex":return yt.replaceSelection("```latex\n"+Dt+"\n```"),yt.setCursor(Nt.line+1,Dt.length+1),yt.focus();case"line-break":return yt.replaceSelection(`<br/>
|
|
`),yt.focus();case"list-ul":return Dt===""?yt.replaceSelection("- "+Dt):yt.replaceSelection(Qt.map(function(Dn){return Dn===""?"":"- ".concat(Dn)}).join(`
|
|
`)),yt.focus();case"list-ol":return Dt===""?yt.replaceSelection("1. "+Dt):yt.replaceSelection(Qt.map(function(Dn,bn){return Dn===""?"":"".concat(bn+1,". ").concat(Dn)}).join(`
|
|
`)),yt.focus();case"add-null-ch":return Dt===""&&yt.setCursor(Nt.line,Nt.ch+1),yt.replaceSelection(Ne),yt.focus();case"inster-template-1":return Dt===""&&yt.setCursor(Nt.line,Nt.ch),yt.replaceSelection(nt),yt.focus();case"eraser":return yt.setValue(""),yt.focus();case"trigger-watch":return xi(!ar),yt.focus();case"trigger-full-screen":return Lt(!at),yt.focus();case Qe:hn(Qe);return;case st:hn(st);return;case Ke:hn(Ke);return;case it:hn(it);return;default:throw new Error}},[yt,ar,at]),cn=Object(b.useCallback)(function(Rt){hn("");switch(Yt){case Qe:var Nt=Rt.title,Dt=Rt.link;return yt.replaceSelection("[".concat(Nt,"](").concat(Dt,")")),yt.focus();case st:var Qt=Rt.language,Dn=Rt.content;return yt.replaceSelection(["```"+Qt,Dn,"```"].join(`
|
|
`)),yt.focus();case Ke:var bn=Rt.src,Hn=Rt.alt;return Hn?yt.replaceSelection(".concat(bn,' "').concat(Hn,'" )')):yt.replaceSelection("")),yt.focus();case it:for(var nr=Rt.row,ca=Rt.col,Fn=Rt.align,Fa=`
|
|
`,rr=0;rr<nr;rr++){for(var Jr=[],zr=[],Aa=0;Aa<ca;Aa++)rr===1&&zr.push(Je[Fn]),Jr.push(" ");rr===1&&(Fa+="| ".concat(zr.join(" | "),` |
|
|
`)),Fa+="| ".concat(Jr.join(ca===1?"":" | "),` |
|
|
`)}return yt.replaceSelection(Fa+`
|
|
`),yt.focus();default:throw new Error}},[yt,Yt]),Hr=Object(b.useMemo)(function(){switch(Yt){case Qe:return p.a.createElement(Y,{callback:cn,onCancel:Kr});case st:return p.a.createElement($.b,{callback:cn,onCancel:Kr});case Ke:return p.a.createElement(ee,{callback:cn,onCancel:Kr});case it:return p.a.createElement(Ve,{callback:cn,onCancel:Kr});default:return null}},[Yt]);function Kr(){hn("")}Object(b.useEffect)(function(){if(Mt.current){var Rt=Mt.current,Nt=!1,Dt=0;function Qt(Hn){Nt=!0,Dt=Hn.pageY}function Dn(){Nt=!1}function bn(Hn){if(Nt){var nr=Hn.pageY-Dt;nr<0&&(nr=0),nr>300&&(nr=300);var ca=sn+nr+"px";Nn(ca)}}return Rt.addEventListener("mousedown",Qt),document.addEventListener("mousemove",bn),document.addEventListener("mouseup",Dn),function(){Rt.removeEventListener("mousedown",Qt),document.removeEventListener("mousemove",bn),document.removeEventListener("mouseup",Dn)}}},[yt,Mt]),Object(b.useEffect)(function(){Nn(sn)},[sn]);var Sr=me(Ft),On=me(tr),At={width:Sr,height:On},lr=Object(b.useMemo)(function(){if(vn){var Rt=new Date(vn),Nt=Rt.getHours(),Dt=Rt.getMinutes(),Qt=Rt.getSeconds();return Nt=Nt<10?"0"+Nt:Nt,Dt=Dt<10?"0"+Dt:Dt,Qt=Qt<10?"0"+Qt:Qt,"".concat(Nt,":").concat(Dt,":").concat(Qt)}return 0},[vn]);function $n(){window.sessionStorage.removeItem(ln),Rn(!1),kn(0)}function jn(){Rn(!1),kn(0),yt.setValue(window.sessionStorage.getItem(ln))}function Gr(Rt,Nt){var Dt=yt.getValue();Dt=Dt.replace(Rt,Nt),da(Dt),yt==null||yt.setValue(Dt)}return p.a.createElement(b.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:It},p.a.createElement("div",{className:"markdown-editor-container ".concat(ft," ").concat(ar?"on-preview":""," ").concat(Qn?"mini":""," ").concat(at?"full-screen":""),style:At},p.a.createElement(O,{insertTemp:En,watch:ar,fullScreen:at,showNullButton:xn,onActionCallback:sr,hidetoolBar:na,uuid:zt.current,setOpenPhones:function(){rn.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Pt,placeholder:ui})),ar?p.a.createElement("div",{ref:Ae,className:"preview-container"},br==="stex"&&p.a.createElement(w,{value:ei}),br!=="stex"&&p.a.createElement(T.a,{edit:!0,value:ei,replaces:Gr})):null))),qn?p.a.createElement("a",{ref:Mt,className:"editor-resize"}):null,p.a.createElement(M.a,null,fe[Yt]?p.a.createElement(V.a,{centered:!0,title:fe[Yt],visible:!0,onCancel:Kr,footer:null,className:"markdown-popup-form"},Hr):null))}},"P/tu":function(rt,Be,H){"use strict";var oe=H("ozfa"),V=H("MJZm"),I=H("0Owb"),K=H("9og8"),L=H("tJVT"),N=H("PpiC"),W=H("WmNS"),F=H.n(W),R=H("cDcd"),D=H.n(R),b=H("WCUW"),p=H("spXi"),_=H.n(p),f=function(d){var l=d.value,i=d.onChange,u=d.defaultValue,c=d.disabled,S=Object(N.a)(d,["value","onChange","defaultValue","disabled"]),C=Object(R.useState)([]),T=Object(L.a)(C,2),w=T[0],A=T[1],m=Object(R.useState)("1"),v=Object(L.a)(m,2),s=v[0],o=v[1];Object(R.useEffect)(function(){E()},[]);var E=function(){var M=Object(K.a)(F.a.mark(function k(){var U,B;return F.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,Object(b.A)({});case 2:U=x.sent,U!=null&&U.data&&(B=[{title:D.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:_.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:D.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:g(U.data||[])}],A(B),o("2"));case 4:case"end":return x.stop()}},k)}));return function(){return M.apply(this,arguments)}}(),g=function(k){function U(B){var y=B.children,x=Array.isArray(y)&&y.length>0,j=B==null?void 0:B.group_id;return{title:D.a.createElement("div",{title:B==null?void 0:B.name,className:_.a.name},B==null?void 0:B.name),value:j,key:j,icon:D.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:x?y==null?void 0:y.map(function(z){return U(z)}):[]}}return k==null?void 0:k.map(function(B){return U(B)})},O=u?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return D.a.createElement("div",{className:_.a.customTree},D.a.createElement(V.a,Object(I.a)({key:s},O,{showIcon:!0,treeData:w,onSelect:i,disabled:c},S)))};Be.a=f},Q0Vu:function(rt,Be,H){rt.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(rt,Be,H){"use strict";var oe=H("Q9mQ"),V=H("diRs"),I=H("cDcd"),K=H.n(I),L=H("+z73"),N=H.n(L),W=function(R){var D=R.data,b=D===void 0?[]:D,p=R.onClick,_=function(){return b.map(function(d,l){return K.a.createElement("div",{key:l,className:N.a.few},K.a.createElement("b",{title:d.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return p(d.id)}},d.name),l<b.length-1&&K.a.createElement("span",null,"/"))})},f=function(){var d=!0,l=b.slice(2,-2),i=K.a.createElement("div",{className:N.a.pWrap},l.map(function(u){return K.a.createElement("span",{title:u.name,onClick:function(){return p(u.id)},key:u.id},u.name)}));return b.map(function(u,c){var S=null;return c>1&&c<b.length-2?d&&(S=K.a.createElement(V.a,{key:c,placement:"bottom",content:i},K.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),d=!1):S=K.a.createElement("div",{key:c,className:N.a.few},K.a.createElement("b",{title:u.name,style:{color:c===0?"#333333":"#999999"},onClick:function(){return p(u.id)}},u.name),c<b.length-1&&K.a.createElement("span",null,"/")),S})};return K.a.createElement("aside",{style:{overflowX:"auto"}},(b==null?void 0:b.length)>5?f():_())};Be.a=W},SJMd:function(rt,Be){/**
|
|
* @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 H,oe,V,I=!1,K,L;window.PR_SHOULD_USE_CONTINUATION=!0;var N,W;(function(){var F=window,R=["break,continue,do,else,for,if,return,while"],D=[R,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],b=[D,"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"],f=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",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",i=[R,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],u=[R,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],c=[R,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[p,f,_,d,l,i,u,c],C=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",w="kwd",A="com",m="typ",v="lit",s="pun",o="pln",E="tag",g="dec",O="src",M="atn",k="atv",U="nocode",B="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function y(Ie){for(var Re=0,Ve=!1,$e=!1,Ze=0,Qe=Ie.length;Ze<Qe;++Ze){var Ke=Ie[Ze];if(Ke.ignoreCase)$e=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ve=!0,$e=!1;break}}var st={b:8,t:9,n:10,v:11,f:12,r:13};function it(mt){var We=mt.charCodeAt(0);if(We!==92)return We;var Et=mt.charAt(1);return We=st[Et],We||("0"<=Et&&Et<="7"?parseInt(mt.substring(1),8):Et==="u"||Et==="x"?parseInt(mt.substring(2),16):mt.charCodeAt(1))}function ut(mt){if(mt<32)return(mt<16?"\\x0":"\\x")+mt.toString(16);var We=String.fromCharCode(mt);return We==="\\"||We==="-"||We==="]"||We==="^"?"\\"+We:We}function Je(mt){var We=mt.substring(1,mt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Et=[],ht=We[0]==="^",Ne=["["];ht&&Ne.push("^");for(var nt=ht?1:0,me=We.length;nt<me;++nt){var ve=We[nt];if(/\\[bdsw]/i.test(ve))Ne.push(ve);else{var le=it(ve),q;nt+2<me&&We[nt+1]==="-"?(q=it(We[nt+2]),nt+=2):q=le,Et.push([le,q]),q<65||le>122||(q<65||le>90||Et.push([Math.max(65,le)|32,Math.min(q,90)|32]),q<97||le>122||Et.push([Math.max(97,le)&~32,Math.min(q,122)&~32]))}}Et.sort(function(Oe,Ge){return Oe[0]-Ge[0]||Ge[1]-Oe[1]});for(var ie=[],fe=[],nt=0;nt<Et.length;++nt){var Ee=Et[nt];Ee[0]<=fe[1]+1?fe[1]=Math.max(fe[1],Ee[1]):ie.push(fe=Ee)}for(var nt=0;nt<ie.length;++nt){var Ee=ie[nt];Ne.push(ut(Ee[0])),Ee[1]>Ee[0]&&(Ee[1]+1>Ee[0]&&Ne.push("-"),Ne.push(ut(Ee[1])))}return Ne.push("]"),Ne.join("")}function _t(mt){for(var We=mt.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")),Et=We.length,ht=[],Ne=0,nt=0;Ne<Et;++Ne){var me=We[Ne];if(me==="(")++nt;else if(me.charAt(0)==="\\"){var ve=+me.substring(1);ve&&(ve<=nt?ht[ve]=-1:We[Ne]=ut(ve))}}for(var Ne=1;Ne<ht.length;++Ne)ht[Ne]===-1&&(ht[Ne]=++Re);for(var Ne=0,nt=0;Ne<Et;++Ne){var me=We[Ne];if(me==="(")++nt,ht[nt]||(We[Ne]="(?:");else if(me.charAt(0)==="\\"){var ve=+me.substring(1);ve&&ve<=nt&&(We[Ne]="\\"+ht[ve])}}for(var Ne=0;Ne<Et;++Ne)We[Ne]==="^"&&We[Ne+1]!=="^"&&(We[Ne]="");if(mt.ignoreCase&&Ve)for(var Ne=0;Ne<Et;++Ne){var me=We[Ne],le=me.charAt(0);me.length>=2&&le==="["?We[Ne]=Je(me):le!=="\\"&&(We[Ne]=me.replace(/[a-zA-Z]/g,function(fe){var Ee=fe.charCodeAt(0);return"["+String.fromCharCode(Ee&~32,Ee|32)+"]"}))}return We.join("")}for(var gt=[],Ze=0,Qe=Ie.length;Ze<Qe;++Ze){var Ke=Ie[Ze];if(Ke.global||Ke.multiline)throw new Error(""+Ke);gt.push("(?:"+_t(Ke)+")")}return new RegExp(gt.join("|"),$e?"gi":"g")}function x(Ie,Re){var Ve=/(?:^|\s)nocode(?:\s|$)/,$e=[],Ze=0,Qe=[],Ke=0;function st(it){var ut=it.nodeType;if(ut==1){if(Ve.test(it.className))return;for(var Je=it.firstChild;Je;Je=Je.nextSibling)st(Je);var _t=it.nodeName.toLowerCase();(_t==="br"||_t==="li")&&($e[Ke]=`
|
|
`,Qe[Ke<<1]=Ze++,Qe[Ke++<<1|1]=it)}else if(ut==3||ut==4){var gt=it.nodeValue;gt.length&&(Re?gt=gt.replace(/\r\n?/g,`
|
|
`):gt=gt.replace(/[ \t\r\n]+/g," "),$e[Ke]=gt,Qe[Ke<<1]=Ze,Ze+=gt.length,Qe[Ke++<<1|1]=it)}}return st(Ie),{sourceCode:$e.join("").replace(/\n$/,""),spans:Qe}}function j(Ie,Re,Ve,$e,Ze){if(!Ve)return;var Qe={sourceNode:Ie,pre:1,langExtension:null,numberLines:null,sourceCode:Ve,spans:null,basePos:Re,decorations:null};$e(Qe),Ze.push.apply(Ze,Qe.decorations)}var z=/\S/;function Y(Ie){for(var Re=void 0,Ve=Ie.firstChild;Ve;Ve=Ve.nextSibling){var $e=Ve.nodeType;Re=$e===1?Re?Ie:Ve:$e===3&&z.test(Ve.nodeValue)?Ie:Re}return Re===Ie?void 0:Re}function $(Ie,Re){var Ve={},$e;(function(){for(var Ke=Ie.concat(Re),st=[],it={},ut=0,Je=Ke.length;ut<Je;++ut){var _t=Ke[ut],gt=_t[3];if(gt)for(var mt=gt.length;--mt>=0;)Ve[gt.charAt(mt)]=_t;var We=_t[1],Et=""+We;it.hasOwnProperty(Et)||(st.push(We),it[Et]=null)}st.push(/[\0-\uffff]/),$e=y(st)})();var Ze=Re.length,Qe=function(Ke){for(var st=Ke.sourceCode,it=Ke.basePos,ut=Ke.sourceNode,Je=[it,o],_t=0,gt=st.match($e)||[],mt={},We=0,Et=gt.length;We<Et;++We){var ht=gt[We],Ne=mt[ht],nt=void 0,me;if(typeof Ne=="string")me=!1;else{var ve=Ve[ht.charAt(0)];if(ve)nt=ht.match(ve[1]),Ne=ve[0];else{for(var le=0;le<Ze;++le)if(ve=Re[le],nt=ht.match(ve[1]),nt){Ne=ve[0];break}nt||(Ne=o)}me=Ne.length>=5&&Ne.substring(0,5)==="lang-",me&&!(nt&&typeof nt[1]=="string")&&(me=!1,Ne=O),me||(mt[ht]=Ne)}var q=_t;if(_t+=ht.length,!me)Je.push(it+q,Ne);else{var ie=nt[1],fe=ht.indexOf(ie),Ee=fe+ie.length;nt[2]&&(Ee=ht.length-nt[2].length,fe=Ee-ie.length);var Oe=Ne.substring(5);j(ut,it+q,ht.substring(0,fe),Qe,Je),j(ut,it+q+fe,ie,ae(Oe,ie),Je),j(ut,it+q+Ee,ht.substring(Ee),Qe,Je)}}Ke.decorations=Je};return Qe}function ce(Ie){var Re=[],Ve=[];Ie.tripleQuotedStrings?Re.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ie.multiLineStrings?Re.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ie.verbatimStrings&&Ve.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $e=Ie.hashComments;$e&&(Ie.cStyleComments?($e>1?Re.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ve.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([A,/^#[^\r\n]*/,null,"#"])),Ie.cStyleComments&&(Ve.push([A,/^\/\/[^\r\n]*/,null]),Ve.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ze=Ie.regexLiterals;if(Ze){var Qe=Ze>1?"":`
|
|
\r`,Ke=Qe?".":"[\\S\\s]",st="/(?=[^/*"+Qe+"])(?:[^/\\x5B\\x5C"+Qe+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+Qe+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";Ve.push(["lang-regex",RegExp("^"+B+"("+st+")")])}var it=Ie.types;it&&Ve.push([m,it]);var ut=(""+Ie.keywords).replace(/^ | $/g,"");ut.length&&Ve.push([w,new RegExp("^(?:"+ut.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([o,/^\s+/,null,` \r
|
|
\xA0`]);var Je="^.[^\\s\\w.$@'\"`/\\\\]*";return Ie.regexLiterals&&(Je+="(?!s*/)"),Ve.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(Je),null]),$(Re,Ve)}var se=ce({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ne(Ie,Re,Ve){for(var $e=/(?:^|\s)nocode(?:\s|$)/,Ze=/\r\n?|\n/,Qe=Ie.ownerDocument,Ke=Qe.createElement("li");Ie.firstChild;)Ke.appendChild(Ie.firstChild);var st=[Ke];function it(We){var Et=We.nodeType;if(Et==1&&!$e.test(We.className))if(We.nodeName==="br")ut(We),We.parentNode&&We.parentNode.removeChild(We);else for(var ht=We.firstChild;ht;ht=ht.nextSibling)it(ht);else if((Et==3||Et==4)&&Ve){var Ne=We.nodeValue,nt=Ne.match(Ze);if(nt){var me=Ne.substring(0,nt.index);We.nodeValue=me;var ve=Ne.substring(nt.index+nt[0].length);if(ve){var le=We.parentNode;le.insertBefore(Qe.createTextNode(ve),We.nextSibling)}ut(We),me||We.parentNode.removeChild(We)}}}function ut(We){for(;!We.nextSibling;)if(We=We.parentNode,!We)return;function Et(nt,me){var ve=me?nt.cloneNode(!1):nt,le=nt.parentNode;if(le){var q=Et(le,1),ie=nt.nextSibling;q.appendChild(ve);for(var fe=ie;fe;fe=ie)ie=fe.nextSibling,q.appendChild(fe)}return ve}for(var ht=Et(We.nextSibling,0),Ne;(Ne=ht.parentNode)&&Ne.nodeType===1;)ht=Ne;st.push(ht)}for(var Je=0;Je<st.length;++Je)it(st[Je]);Re===(Re|0)&&st[0].setAttribute("value",Re);var _t=Qe.createElement("ol");_t.className="linenums";for(var gt=Math.max(0,Re-1|0)||0,Je=0,mt=st.length;Je<mt;++Je)Ke=st[Je],Ke.className="L"+(Je+gt)%10,Ke.firstChild||Ke.appendChild(Qe.createTextNode("\xA0")),_t.appendChild(Ke);Ie.appendChild(_t)}function re(Ie){var Re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Re=Re&&+Re[1]<=8;var Ve=/\n/g,$e=Ie.sourceCode,Ze=$e.length,Qe=0,Ke=Ie.spans,st=Ke.length,it=0,ut=Ie.decorations,Je=ut.length,_t=0;ut[Je]=Ze;var gt,mt;for(mt=gt=0;mt<Je;)ut[mt]!==ut[mt+2]?(ut[gt++]=ut[mt++],ut[gt++]=ut[mt++]):mt+=2;for(Je=gt,mt=gt=0;mt<Je;){for(var We=ut[mt],Et=ut[mt+1],ht=mt+2;ht+2<=Je&&ut[ht+1]===Et;)ht+=2;ut[gt++]=We,ut[gt++]=Et,mt=ht}Je=ut.length=gt;var Ne=Ie.sourceNode,nt="";Ne&&(nt=Ne.style.display,Ne.style.display="none");try{for(var me=null;it<st;){var ve=Ke[it],le=Ke[it+2]||Ze,q=ut[_t+2]||Ze,ht=Math.min(le,q),ie=Ke[it+1],fe;if(ie.nodeType!==1&&(fe=$e.substring(Qe,ht))){Re&&(fe=fe.replace(Ve,"\r")),ie.nodeValue=fe;var Ee=ie.ownerDocument,Oe=Ee.createElement("span");Oe.className=ut[_t+1];var Ge=ie.parentNode;Ge.replaceChild(Oe,ie),Oe.appendChild(ie),Qe<le&&(Ke[it+1]=ie=Ee.createTextNode($e.substring(ht,le)),Ge.insertBefore(ie,Oe.nextSibling))}Qe=ht,Qe>=le&&(it+=2),Qe>=q&&(_t+=2)}}finally{Ne&&(Ne.style.display=nt)}}var ue={};function ee(Ie,Re){for(var Ve=Re.length;--Ve>=0;){var $e=Re[Ve];ue.hasOwnProperty($e)?F.console&&console.warn("cannot override language handler %s",$e):ue[$e]=Ie}}function ae(Ie,Re){return Ie&&ue.hasOwnProperty(Ie)||(Ie=/^\s*</.test(Re)?"default-markup":"default-code"),ue[Ie]}ee(se,["default-code"]),ee($([],[[o,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ee($([[o,/^[\s]+/,null,` \r
|
|
`],[k,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!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"]),ee($([],[[k,/^[\s\S]+/]]),["uq.val"]),ee(ce({keywords:p,hashComments:!0,cStyleComments:!0,types:C}),["c","cc","cpp","cxx","cyc","m"]),ee(ce({keywords:"null,true,false"}),["json"]),ee(ce({keywords:f,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:C}),["cs"]),ee(ce({keywords:_,cStyleComments:!0}),["java"]),ee(ce({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(ce({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(ce({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(ce({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(ce({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(ce({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee($([],[[T,/^[\s\S]+/]]),["regex"]);function ge(Ie){var Re=Ie.langExtension;try{var Ve=x(Ie.sourceNode,Ie.pre),$e=Ve.sourceCode;Ie.sourceCode=$e,Ie.spans=Ve.spans,Ie.basePos=0,ae(Re,$e)(Ie),re(Ie)}catch(Ze){F.console&&console.log(Ze&&Ze.stack||Ze)}}function Le(Ie,Re,Ve){var $e=Ve||!1,Ze=Re||null,Qe=document.createElement("div");Qe.innerHTML="<pre>"+Ie+"</pre>",Qe=Qe.firstChild,$e&&ne(Qe,$e,!0);var Ke={langExtension:Ze,numberLines:$e,sourceNode:Qe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ge(Ke),Qe.innerHTML}function ke(Ie,Re){var Ve=Re||document.body,$e=Ve.ownerDocument||document;function Ze(ve){return Ve.getElementsByTagName(ve)}for(var Qe=[Ze("pre"),Ze("code"),Ze("xmp")],Ke=[],st=0;st<Qe.length;++st)for(var it=0,ut=Qe[st].length;it<ut;++it)Ke.push(Qe[st][it]);Qe=null;var Je=Date;Je.now||(Je={now:function(){return+new Date}});var _t=0,gt=/\blang(?:uage)?-([\w.]+)(?!\S)/,mt=/\bprettyprint\b/,We=/\bprettyprinted\b/,Et=/pre|xmp/i,ht=/^code$/i,Ne=/^(?:pre|code|xmp)$/i,nt={};function me(){for(var ve=F.PR_SHOULD_USE_CONTINUATION?Je.now()+250:Infinity;_t<Ke.length&&Je.now()<ve;_t++){for(var le=Ke[_t],q=nt,ie=le;ie=ie.previousSibling;){var fe=ie.nodeType,Ee=(fe===7||fe===8)&&ie.nodeValue;if(Ee?!/^\??prettify\b/.test(Ee):fe!==3||/\S/.test(ie.nodeValue))break;if(Ee){q={},Ee.replace(/\b(\w+)=([\w:.%+-]+)/g,function(hr,En,Ar){q[En]=Ar});break}}var Oe=le.className;if((q!==nt||mt.test(Oe))&&!We.test(Oe)){for(var Ge=!1,tt=le.parentNode;tt;tt=tt.parentNode){var Tt=tt.tagName;if(Ne.test(Tt)&&tt.className&&mt.test(tt.className)){Ge=!0;break}}if(!Ge){le.className+=" prettyprinted";var jt=q.lang;if(!jt){jt=Oe.match(gt);var Ft;!jt&&(Ft=Y(le))&&ht.test(Ft.tagName)&&(jt=Ft.className.match(gt)),jt&&(jt=jt[1])}var In;if(Et.test(le.tagName))In=1;else{var sn=le.currentStyle,Wt=$e.defaultView,Qn=sn?sn.whiteSpace:Wt&&Wt.getComputedStyle?Wt.getComputedStyle(le,null).getPropertyValue("white-space"):0;In=Qn&&Qn.substring(0,3)==="pre"}var mn=q.linenums;(mn=mn==="true"||+mn)||(mn=Oe.match(/\blinenums\b(?::(\d+))?/),mn=mn?mn[1]&&mn[1].length?+mn[1]:!0:!1),mn&&ne(le,mn,In);var yr={langExtension:jt,sourceNode:le,numberLines:mn,pre:In,sourceCode:null,basePos:null,spans:null,decorations:null};ge(yr)}}}_t<Ke.length?F.setTimeout(me,250):typeof Ie=="function"&&Ie()}me()}var De=F.PR={createSimpleLexer:$,registerLangHandler:ee,sourceDecorator:ce,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:k,PR_COMMENT:A,PR_DECLARATION:g,PR_KEYWORD:w,PR_LITERAL:v,PR_NOCODE:U,PR_PLAIN:o,PR_PUNCTUATION:s,PR_SOURCE:O,PR_STRING:T,PR_TAG:E,PR_TYPE:m,prettyPrintOne:I?F.prettyPrintOne=Le:N=Le,prettyPrint:W=I?F.prettyPrint=ke:W=ke},Ue=F.define;typeof Ue=="function"&&Ue.amd&&Ue("google-code-prettify",[],function(){return De})})()},TXwP:function(rt,Be,H){var oe,V;(function(){var I;(function(){"use strict";var L=[,,function(R){function D(_){this.__parent=_,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=[]}D.prototype.clone_empty=function(){var _=new D(this.__parent);return _.set_indent(this.__indent_count,this.__alignment_count),_},D.prototype.item=function(_){return _<0?this.__items[this.__items.length+_]:this.__items[_]},D.prototype.has_match=function(_){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(_))return!0;return!1},D.prototype.set_indent=function(_,f){this.is_empty()&&(this.__indent_count=_||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.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},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(_){this.__items.push(_);var f=_.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=_.length-f:this.__character_count+=_.length},D.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.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(_,f){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)),f=f||"",_.indent_level>0&&(f=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}b.prototype.get_indent_size=function(_,f){var a=this.__base_string_length;return f=f||0,_<0&&(a=0),a+=_*this.__indent_size,a+=f,a},b.prototype.get_indent_string=function(_,f){var a=this.__base_string;return f=f||0,_<0&&(_=0,a=""),f+=_*this.__indent_size,this.__ensure_cache(f),a+=this.__cache[f],a},b.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var _=this.__cache.length,f=0,a="";this.__indent_size&&_>=this.__indent_size&&(f=Math.floor(_/this.__indent_size),_-=f*this.__indent_size,a=new Array(f+1).join(this.__indent_string)),_&&(a+=new Array(_+1).join(" ")),this.__cache.push(a)};function p(_,f){this.__indent_cache=new b(_,f),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 D(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(_,f){return this.__indent_cache.get_indent_string(_,f)},p.prototype.get_indent_size=function(_,f){return this.__indent_cache.get_indent_size(_,f)},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 f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return _!==`
|
|
`&&(a=a.replace(/[\n]/g,_)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,f){return _=_||0,f=f||0,this.next_line.set_indent(_,f),this.__lines.length>1?(this.current_line.set_indent(_,f),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var f=0;f<_.newlines;f++)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 f=this.__lines.length;_<f;)this.__lines[_]._remove_indent(),_++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(_){for(_=_===void 0?!1:_,this.current_line.trim();_&&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(_,f){for(var a=this.__lines.length-2;a>=0;){var d=this.__lines[a];if(d.is_empty())break;if(d.item(0).indexOf(_)!==0&&d.item(-1)!==f){this.__lines.splice(a+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},R.exports.Output=p},,,,function(R){function D(_,f){this.raw_options=b(_,f),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"])}D.prototype._get_array=function(_,f){var a=this.raw_options[_],d=f||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(d=a.concat()):typeof a=="string"&&(d=a.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(_,f){var a=this.raw_options[_],d=a===void 0?!!f:!!a;return d},D.prototype._get_characters=function(_,f){var a=this.raw_options[_],d=f||"";return typeof a=="string"&&(d=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(_,f){var a=this.raw_options[_];f=parseInt(f,10),isNaN(f)&&(f=0);var d=parseInt(a,10);return isNaN(d)&&(d=f),d},D.prototype._get_selection=function(_,f,a){var d=this._get_selection_list(_,f,a);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[_]+"'");return d[0]},D.prototype._get_selection_list=function(_,f,a){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[f[0]],!this._is_valid_selection(a,f))throw new Error("Invalid Default Value!");var d=this._get_array(_,a);if(!this._is_valid_selection(d,f))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[_]+"'");return d},D.prototype._is_valid_selection=function(_,f){return _.length&&f.length&&!_.some(function(a){return f.indexOf(a)===-1})};function b(_,f){var a={};_=p(_);var d;for(d in _)d!==f&&(a[d]=_[d]);if(f&&_[f])for(d in _[f])a[d]=_[f][d];return a}function p(_){var f={},a;for(a in _){var d=a.replace(/-/g,"_");f[d]=_[a]}return f}R.exports.Options=D,R.exports.normalizeOpts=p,R.exports.mergeOpts=b},,function(R){var D=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<this.__input_length},b.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},b.prototype.peek=function(p){var _=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(_=this.__input.charAt(p)),_},b.prototype.__match=function(p,_){p.lastIndex=_;var f=p.exec(this.__input);return f&&!(D&&p.sticky)&&(f.index!==_&&(f=null)),f},b.prototype.test=function(p,_){return _=_||0,_+=this.__position,_>=0&&_<this.__input_length?!!this.__match(p,_):!1},b.prototype.testChar=function(p,_){var f=this.peek(_);return p.lastIndex=0,f!==null&&p.test(f)},b.prototype.match=function(p){var _=this.__match(p,this.__position);return _?this.__position+=_[0].length:_=null,_},b.prototype.read=function(p,_,f){var a="",d;return p&&(d=this.match(p),d&&(a+=d[0])),_&&(d||!p)&&(a+=this.readUntil(_,f)),a},b.prototype.readUntil=function(p,_){var f="",a=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(a=d.index,_&&(a+=d[0].length)):a=this.__input_length,f=this.__input.substring(this.__position,a),this.__position=a,f},b.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},b.prototype.get_regexp=function(p,_){var f=null,a="g";return _&&D&&(a="y"),typeof p=="string"&&p!==""?f=new RegExp(p,a):p&&(f=new RegExp(p.source,a)),f},b.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(p){var _=this.__position,f=this.readUntilAfter(p);return this.__position=_,f},b.prototype.lookBack=function(p){var _=this.__position-1;return _>=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},R.exports.InputScanner=b},,,,,function(R){function D(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")}D.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},D.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},R.exports.Directives=D},,function(R,D,b){var p=b(16).Beautifier,_=b(17).Options;function f(a,d){var l=new p(a,d);return l.beautify()}R.exports=f,R.exports.defaultOptions=function(){return new _}},function(R,D,b){var p=b(17).Options,_=b(2).Output,f=b(8).InputScanner,a=b(13).Directives,d=new a(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,C=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(w,A){this._source_text=w||"",this._options=new p(A),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(w){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(w.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return A},T.prototype.eatWhitespace=function(w){for(var A=u.test(this._input.peek()),m=0;u.test(this._input.peek());)this._ch=this._input.next(),w&&this._ch===`
|
|
`&&((m===0||m<this._options.max_preserve_newlines)&&(m++,this._output.add_new_line(!0)));return A},T.prototype.foundNestedPseudoClass=function(){for(var w=0,A=1,m=this._input.peek(A);m;){if(m==="{")return!0;if(m==="(")w+=1;else if(m===")"){if(w===0)return!1;w-=1}else if(m===";"||m==="}")return!1;A++,m=this._input.peek(A)}return!1},T.prototype.print_string=function(w){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(w)},T.prototype.preserveSingleSpace=function(w){w&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,A=this._options.eol;A==="auto"&&(A=`
|
|
`,w&&l.test(w||"")&&(A=w.match(l)[0])),w=w.replace(i,`
|
|
`);var m=w.match(/^[\t ]*/)[0];this._output=new _(this._options,m),this._input=new f(w),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,s=!1,o=!1,E=!1,g=!1,O=!1,M=!1,k=this._ch,U=!1,B,y,x;B=this._input.read(c),y=B!=="",x=k,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),k=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var j=this._input.read(S),z=d.get_directives(j);z&&z.ignore==="start"&&(j+=d.readIgnored(this._input)),this.print_string(j),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(C)),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 Y=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Y.match(/[ :]$/)&&(Y=this.eatString(": ").replace(/\s$/,""),this.print_string(Y),this._output.space_before_token=!0),Y=Y.replace(/\s$/,""),Y==="extend"?g=!0:Y==="import"&&(O=!0),Y in this.NESTED_AT_RULE?(this._nestedLevel+=1,Y in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!s&&v===0&&Y.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),O=!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 $=0;$<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;$++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[$])){U=!0;break}(s||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&v===0?(this.print_string(":"),o||(o=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ce=x==='"'||x==="'";this.preserveSingleSpace(ce||y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")U=!1,v===0?(o&&(this.outdent(),o=!1),g=!1,O=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),v++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),v&&(v--,this.outdent()));else{var se=!1;this._input.lookBack("with")&&(se=!0),this.preserveSingleSpace(y||se),this.print_string(this._ch),o&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),M=!0):(this.eatWhitespace(),v++,this.indent())}else if(this._ch===")")v&&(v--,this.outdent()),M&&this._input.peek()===";"&&this._options.selector_separator_newline&&(M=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!o||M)&&v===0&&!O&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||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 ne=x==='"'||x==="'";this.preserveSingleSpace(ne||y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&U&&this._output.add_new_line()}var re=this._output.get_code(A);return re},R.exports.Beautifier=T},function(R,D,b){var p=b(6).Options;function _(f){p.call(this,f,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<d.length;l++)d[l]!=="expand"?this.brace_style="collapse":this.brace_style=d[l]}_.prototype=new p,R.exports.Options=_}],N={};function W(R){var D=N[R];if(D!==void 0)return D.exports;var b=N[R]={exports:{}};return L[R](b,b.exports,W),b.exports}var F=W(15);I=F})();var K=I;!(oe=[],V=function(){return{css_beautify:K}}.apply(Be,oe),V!==void 0&&(rt.exports=V))})()},"VrN/":function(rt,Be,H){(function(oe,V){rt.exports=V()})(this,function(){"use strict";var oe=navigator.userAgent,V=navigator.platform,I=/gecko\/\d/i.test(oe),K=/MSIE \d/.test(oe),L=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),N=/Edge\/(\d+)/.exec(oe),W=K||L||N,F=W&&(K?document.documentMode||6:+(N||L)[1]),R=!N&&/WebKit\//.test(oe),D=R&&/Qt\/\d+\.\d+/.test(oe),b=!N&&/Chrome\//.test(oe),p=/Opera\//.test(oe),_=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),a=/PhantomJS/.test(oe),d=!N&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),l=/Android/.test(oe),i=d||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),u=d||/Mac/.test(V),c=/\bCrOS\b/.test(oe),S=/win/i.test(V),C=p&&oe.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(p=!1,R=!0);var T=u&&(D||p&&(C==null||C<12.11)),w=I||W&&F>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var r=e.className,n=A(t).exec(r);if(n){var h=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(h?n[1]+h:"")}};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,r,n){var h=document.createElement(e);if(r&&(h.className=r),n&&(h.style.cssText=n),typeof t=="string")h.appendChild(document.createTextNode(t));else if(t)for(var P=0;P<t.length;++P)h.appendChild(t[P]);return h}function E(e,t,r,n){var h=o(e,t,r,n);return h.setAttribute("role","presentation"),h}var g;document.createRange?g=function(e,t,r,n){var h=document.createRange();return h.setEnd(n||e,r),h.setStart(e,t),h}:g=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(h){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function O(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function M(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function k(e,t){var r=e.className;A(t).test(r)||(e.className+=(r?" ":"")+t)}function U(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!A(r[n]).test(t)&&(t+=" "+r[n]);return t}var B=function(e){e.select()};d?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(B=function(e){try{e.select()}catch(t){}});function y(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function x(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function j(e,t,r,n,h){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var P=n||0,G=h||0;;){var X=e.indexOf(" ",P);if(X<0||X>=t)return G+(t-P);G+=X-P,G+=r-G%r,P=X+1}}var z=function(){this.id=null,this.f=null,this.time=0,this.handler=y(this.onTimeout,this)};z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function Y(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var $=50,ce={toString:function(){return"CodeMirror.Pass"}},se={scroll:!1},ne={origin:"*mouse"},re={origin:"+move"};function ue(e,t,r){for(var n=0,h=0;;){var P=e.indexOf(" ",n);P==-1&&(P=e.length);var G=P-n;if(P==e.length||h+G>=t)return n+Math.min(G,t-h);if(h+=P-n,h+=r-h%r,n=P+1,h>=t)return n}}var ee=[""];function ae(e){for(;ee.length<=e;)ee.push(ge(ee)+" ");return ee[e]}function ge(e){return e[e.length-1]}function Le(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ke(e,t,r){for(var n=0,h=r(t);n<e.length&&r(e[n])<=h;)n++;e.splice(n,0,t)}function De(){}function Ue(e,t){var r;return Object.create?r=Object.create(e):(De.prototype=e,r=new De),t&&x(t,r),r}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Re(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Ve(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function $e(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ze=/[\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 Qe(e){return e.charCodeAt(0)>=768&&Ze.test(e)}function Ke(e,t,r){for(;(r<0?t>0:t<e.length)&&Qe(e.charAt(t));)t+=r;return t}function st(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var h=(t+r)/2,P=n<0?Math.ceil(h):Math.floor(h);if(P==t)return e(P)?t:r;e(P)?r=P:t=P+n}}function it(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var h=!1,P=0;P<e.length;++P){var G=e[P];(G.from<r&&G.to>t||t==r&&G.to==t)&&(n(Math.max(G.from,t),Math.min(G.to,r),G.level==1?"rtl":"ltr",P),h=!0)}h||n(t,r,"ltr")}var ut=null;function Je(e,t,r){var n;ut=null;for(var h=0;h<e.length;++h){var P=e[h];if(P.from<t&&P.to>t)return h;P.to==t&&(P.from!=P.to&&r=="before"?n=h:ut=h),P.from==t&&(P.from!=P.to&&r!="before"?n=h:ut=h)}return n!=null?n:ut}var _t=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(J){return J<=247?e.charAt(J):1424<=J&&J<=1524?"R":1536<=J&&J<=1785?t.charAt(J-1536):1774<=J&&J<=2220?"r":8192<=J&&J<=8203?"w":J==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,h=/[stwN]/,P=/[LRr]/,G=/[Lb1n]/,X=/[1n]/;function Q(J,be,Te){this.level=J,this.from=be,this.to=Te}return function(J,be){var Te=be=="ltr"?"L":"R";if(J.length==0||be=="ltr"&&!n.test(J))return!1;for(var Fe=J.length,Me=[],et=0;et<Fe;++et)Me.push(r(J.charCodeAt(et)));for(var lt=0,bt=Te;lt<Fe;++lt){var wt=Me[lt];wt=="m"?Me[lt]=bt:bt=wt}for(var Ut=0,Ct=Te;Ut<Fe;++Ut){var Kt=Me[Ut];Kt=="1"&&Ct=="r"?Me[Ut]="n":P.test(Kt)&&(Ct=Kt,Kt=="r"&&(Me[Ut]="R"))}for(var fn=1,nn=Me[0];fn<Fe-1;++fn){var Xn=Me[fn];Xn=="+"&&nn=="1"&&Me[fn+1]=="1"?Me[fn]="1":Xn==","&&nn==Me[fn+1]&&(nn=="1"||nn=="n")&&(Me[fn]=nn),nn=Xn}for(var Or=0;Or<Fe;++Or){var la=Me[Or];if(la==",")Me[Or]="N";else if(la=="%"){var jr=void 0;for(jr=Or+1;jr<Fe&&Me[jr]=="%";++jr);for(var ka=Or&&Me[Or-1]=="!"||jr<Fe&&Me[jr]=="1"?"1":"N",Da=Or;Da<jr;++Da)Me[Da]=ka;Or=jr-1}}for(var Qr=0,La=Te;Qr<Fe;++Qr){var ha=Me[Qr];La=="L"&&ha=="1"?Me[Qr]="L":P.test(ha)&&(La=ha)}for(var ta=0;ta<Fe;++ta)if(h.test(Me[ta])){var $r=void 0;for($r=ta+1;$r<Fe&&h.test(Me[$r]);++$r);for(var Wr=(ta?Me[ta-1]:Te)=="L",Pa=($r<Fe?Me[$r]:Te)=="L",Ro=Wr==Pa?Wr?"L":"R":Te,Xi=ta;Xi<$r;++Xi)Me[Xi]=Ro;ta=$r-1}for(var _a=[],yi,ua=0;ua<Fe;)if(G.test(Me[ua])){var ys=ua;for(++ua;ua<Fe&&G.test(Me[ua]);++ua);_a.push(new Q(0,ys,ua))}else{var Li=ua,oo=_a.length,so=be=="rtl"?1:0;for(++ua;ua<Fe&&Me[ua]!="L";++ua);for(var Ta=Li;Ta<ua;)if(X.test(Me[Ta])){Li<Ta&&(_a.splice(oo,0,new Q(1,Li,Ta)),oo+=so);var Do=Ta;for(++Ta;Ta<ua&&X.test(Me[Ta]);++Ta);_a.splice(oo,0,new Q(2,Do,Ta)),oo+=so,Li=Ta}else++Ta;Li<ua&&_a.splice(oo,0,new Q(1,Li,ua))}return be=="ltr"&&(_a[0].level==1&&(yi=J.match(/^\s+/))&&(_a[0].from=yi[0].length,_a.unshift(new Q(0,0,yi[0].length))),ge(_a).level==1&&(yi=J.match(/\s+$/))&&(ge(_a).to-=yi[0].length,_a.push(new Q(0,Fe-yi[0].length,Fe)))),be=="rtl"?_a.reverse():_a}}();function gt(e,t){var r=e.order;return r==null&&(r=e.order=_t(e.text,t)),r}var mt=[],We=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||mt).concat(r)}};function Et(e,t){return e._handlers&&e._handlers[t]||mt}function ht(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,h=n&&n[t];if(h){var P=Y(h,r);P>-1&&(n[t]=h.slice(0,P).concat(h.slice(P+1)))}}}function Ne(e,t){var r=Et(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),h=0;h<r.length;++h)r[h].apply(null,n)}function nt(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ne(e,r||t.type,e,t),fe(t)||t.codemirrorIgnore}function me(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Y(r,t[n])==-1&&r.push(t[n])}function ve(e,t){return Et(e,t).length>0}function le(e){e.prototype.on=function(t,r){We(this,t,r)},e.prototype.off=function(t,r){ht(this,t,r)}}function q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function fe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ee(e){q(e),ie(e)}function Oe(e){return e.target||e.srcElement}function Ge(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 tt=function(){if(W&&F<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),Tt;function jt(e){if(Tt==null){var t=o("span","\u200B");s(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Tt=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&F<8))}var r=Tt?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var Ft;function In(e){if(Ft!=null)return Ft;var t=s(e,document.createTextNode("A\u062EA")),r=g(t,0,1).getBoundingClientRect(),n=g(t,1,2).getBoundingClientRect();return v(e),!r||r.left==r.right?!1:Ft=n.right-r.right<3}var sn=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var h=e.indexOf(`
|
|
`,t);h==-1&&(h=e.length);var P=e.slice(t,e.charAt(h-1)=="\r"?h-1:h),G=P.indexOf("\r");G!=-1?(r.push(P.slice(0,G)),t+=G+1):(r.push(P),t=h+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Wt=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Qn=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),mn=null;function yr(e){if(mn!=null)return mn;var t=s(e,o("span","x")),r=t.getBoundingClientRect(),n=g(t,0,1).getBoundingClientRect();return mn=Math.abs(r.left-n.left)>1}var hr={},En={};function Ar(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),hr[e]=t}function br(e,t){En[e]=t}function Jt(e){if(typeof e=="string"&&En.hasOwnProperty(e))e=En[e];else if(e&&typeof e.name=="string"&&En.hasOwnProperty(e.name)){var t=En[e.name];typeof t=="string"&&(t={name:t}),e=Ue(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Jt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Jt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ln(e,t){t=Jt(t);var r=hr[t.name];if(!r)return ln(e,"text/plain");var n=r(e,t);if(_n.hasOwnProperty(t.name)){var h=_n[t.name];for(var P in h){if(!h.hasOwnProperty(P))continue;n.hasOwnProperty(P)&&(n["_"+P]=n[P]),n[P]=h[P]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var G in t.modeProps)n[G]=t.modeProps[G];return n}var _n={};function qn(e,t){var r=_n.hasOwnProperty(e)?_n[e]:_n[e]={};x(t,r)}function Er(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var h=t[n];h instanceof Array&&(h=h.concat([])),r[n]=h}return r}function Ir(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Oa(e,t,r){return e.startState?e.startState(t,r):!0}var xn=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};xn.prototype.eol=function(){return this.pos>=this.string.length},xn.prototype.sol=function(){return this.pos==this.lineStart},xn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},xn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},xn.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},xn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},xn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},xn.prototype.skipToEnd=function(){this.pos=this.string.length},xn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},xn.prototype.backUp=function(e){this.pos-=e},xn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},xn.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},xn.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(G){return r?G.toLowerCase():G},h=this.string.substr(this.pos,e.length);if(n(h)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var P=this.string.slice(this.pos).match(e);return P&&P.index>0?null:(P&&t!==!1&&(this.pos+=P[0].length),P)}},xn.prototype.current=function(){return this.string.slice(this.start,this.pos)},xn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},xn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},xn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Bt(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 r=e;!r.lines;)for(var n=0;;++n){var h=r.children[n],P=h.chunkSize();if(t<P){r=h;break}t-=P}return r.lines[t]}function na(e,t,r){var n=[],h=t.line;return e.iter(t.line,r.line+1,function(P){var G=P.text;h==r.line&&(G=G.slice(0,r.ch)),h==t.line&&(G=G.slice(t.ch)),n.push(G),++h}),n}function ya(e,t,r){var n=[];return e.iter(t,r,function(h){n.push(h.text)}),n}function ra(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Wn(e){if(e.parent==null)return null;for(var t=e.parent,r=Y(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var h=0;!(n.children[h]==t);++h)r+=n.children[h].chunkSize();return r+t.first}function Zr(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var h=e.children[n],P=h.height;if(t<P){e=h;continue e}t-=P,r+=h.chunkSize()}return r}while(!e.lines);for(var G=0;G<e.lines.length;++G){var X=e.lines[G],Q=X.height;if(t<Q)break;t-=Q}return r+G}function Na(e,t){return t>=e.first&&t<e.first+e.size}function Ja(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ft(e,t,r){if(r===void 0&&(r=null),!(this instanceof ft))return new ft(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Zt(e,t){return e.line-t.line||e.ch-t.ch}function qa(e,t){return e.sticky==t.sticky&&Zt(e,t)==0}function za(e){return ft(e.line,e.ch)}function ui(e,t){return Zt(e,t)<0?t:e}function Ua(e,t){return Zt(e,t)<0?e:t}function di(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gn(e,t){if(t.line<e.first)return ft(e.first,0);var r=e.first+e.size-1;return t.line>r?ft(r,Bt(e,r).text.length):Pi(t,Bt(e,t.line).text.length)}function Pi(e,t){var r=e.ch;return r==null||r>t?ft(e.line,t):r<0?ft(e.line,0):e}function yt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=gn(e,t[n]);return r}var ja=function(e,t){this.state=e,this.lookAhead=t},pa=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};pa.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pa.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}},pa.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pa.fromSaved=function(e,t,r){return t instanceof ja?new pa(e,Er(e.mode,t.state),r,t.lookAhead):new pa(e,Er(e.mode,t),r)},pa.prototype.save=function(e){var t=e!==!1?Er(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ja(t,this.maxLookAhead):t};function bi(e,t,r,n){var h=[e.state.modeGen],P={};at(e,t.text,e.doc.mode,r,function(J,be){return h.push(J,be)},P,n);for(var G=r.state,X=function(J){r.baseTokens=h;var be=e.state.overlays[J],Te=1,Fe=0;r.state=!0,at(e,t.text,be.mode,r,function(Me,et){for(var lt=Te;Fe<Me;){var bt=h[Te];bt>Me&&h.splice(Te,1,Me,h[Te+1],bt),Te+=2,Fe=Math.min(Me,bt)}if(!et)return;if(be.opaque)h.splice(lt,Te-lt,Me,"overlay "+et),Te=lt+2;else for(;lt<Te;lt+=2){var wt=h[lt+1];h[lt+1]=(wt?wt+" ":"")+"overlay "+et}},P),r.state=G,r.baseTokens=null,r.baseTokenPos=1},Q=0;Q<e.state.overlays.length;++Q)X(Q);return{styles:h,classes:P.bgClass||P.textClass?P:null}}function ei(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=da(e,Wn(t)),h=t.text.length>e.options.maxHighlightLength&&Er(e.doc.mode,n.state),P=bi(e,t,n);h&&(n.state=h),t.stateAfter=n.save(!h),t.styles=P.styles,P.classes?t.styleClasses=P.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function da(e,t,r){var n=e.doc,h=e.display;if(!n.mode.startState)return new pa(n,!0,t);var P=Lt(e,t,r),G=P>n.first&&Bt(n,P-1).stateAfter,X=G?pa.fromSaved(n,G,P):new pa(n,Oa(n.mode),P);return n.iter(P,t,function(Q){ci(e,Q.text,X);var J=X.line;Q.stateAfter=J==t-1||J%5==0||J>=h.viewFrom&&J<h.viewTo?X.save():null,X.nextLine()}),r&&(n.modeFrontier=X.line),X}function ci(e,t,r,n){var h=e.doc.mode,P=new xn(t,e.options.tabSize,r);for(P.start=P.pos=n||0,t==""&&Ei(h,r.state);!P.eol();)ar(h,P,r.state),P.start=P.pos}function Ei(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Ir(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function ar(e,t,r,n){for(var h=0;h<10;h++){n&&(n[0]=Ir(e,r).mode);var P=e.token(t,r);if(t.pos>t.start)return P}throw new Error("Mode "+e.name+" failed to advance stream.")}var xi=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Yi(e,t,r,n){var h=e.doc,P=h.mode,G;t=gn(h,t);var X=Bt(h,t.line),Q=da(e,t.line,r),J=new xn(X.text,e.options.tabSize,Q),be;for(n&&(be=[]);(n||J.pos<t.ch)&&!J.eol();)J.start=J.pos,G=ar(P,J,Q.state),n&&be.push(new xi(J,G,Er(h.mode,Q.state)));return n?be:new xi(J,G,Q.state)}function Gt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function at(e,t,r,n,h,P,G){var X=r.flattenSpans;X==null&&(X=e.options.flattenSpans);var Q=0,J=null,be=new xn(t,e.options.tabSize,n),Te,Fe=e.options.addModeClass&&[null];for(t==""&&Gt(Ei(r,n.state),P);!be.eol();){if(be.pos>e.options.maxHighlightLength?(X=!1,G&&ci(e,t,n,be.pos),be.pos=t.length,Te=null):Te=Gt(ar(r,be,n.state,Fe),P),Fe){var Me=Fe[0].name;Me&&(Te="m-"+(Te?Me+" "+Te:Me))}if(!X||J!=Te){for(;Q<be.start;)Q=Math.min(be.start,Q+5e3),h(Q,J);J=Te}be.start=be.pos}for(;Q<be.pos;){var et=Math.min(be.pos,Q+5e3);h(et,J),Q=et}}function Lt(e,t,r){for(var n,h,P=e.doc,G=r?-1:t-(e.doc.mode.innerMode?1e3:100),X=t;X>G;--X){if(X<=P.first)return P.first;var Q=Bt(P,X-1),J=Q.stateAfter;if(J&&(!r||X+(J instanceof ja?J.lookAhead:0)<=P.modeFrontier))return X;var be=j(Q.text,null,e.options.tabSize);(h==null||n>be)&&(h=X-1,n=be)}return h}function xt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var h=Bt(e,n).stateAfter;if(h&&(!(h instanceof ja)||n+h.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var St=!1,Yt=!1;function hn(){St=!0}function yn(){Yt=!0}function qt(e,t,r){this.marker=e,this.from=t,this.to=r}function vn(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function kn(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function en(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function un(e,t,r){var n;if(e)for(var h=0;h<e.length;++h){var P=e[h],G=P.marker,X=P.from==null||(G.inclusiveLeft?P.from<=t:P.from<t);if(X||P.from==t&&G.type=="bookmark"&&(!r||!P.marker.insertLeft)){var Q=P.to==null||(G.inclusiveRight?P.to>=t:P.to>t);(n||(n=[])).push(new qt(G,P.from,Q?null:P.to))}}return n}function tr(e,t,r){var n;if(e)for(var h=0;h<e.length;++h){var P=e[h],G=P.marker,X=P.to==null||(G.inclusiveRight?P.to>=t:P.to>t);if(X||P.from==t&&G.type=="bookmark"&&(!r||P.marker.insertLeft)){var Q=P.from==null||(G.inclusiveLeft?P.from<=t:P.from<t);(n||(n=[])).push(new qt(G,Q?null:P.from-t,P.to==null?null:P.to-t))}}return n}function Nn(e,t){if(t.full)return null;var r=Na(e,t.from.line)&&Bt(e,t.from.line).markedSpans,n=Na(e,t.to.line)&&Bt(e,t.to.line).markedSpans;if(!r&&!n)return null;var h=t.from.ch,P=t.to.ch,G=Zt(t.from,t.to)==0,X=un(r,h,G),Q=tr(n,P,G),J=t.text.length==1,be=ge(t.text).length+(J?h:0);if(X)for(var Te=0;Te<X.length;++Te){var Fe=X[Te];if(Fe.to==null){var Me=vn(Q,Fe.marker);Me?J&&(Fe.to=Me.to==null?null:Me.to+be):Fe.to=h}}if(Q)for(var et=0;et<Q.length;++et){var lt=Q[et];if(lt.to!=null&&(lt.to+=be),lt.from==null){var bt=vn(X,lt.marker);bt||(lt.from=be,J&&(X||(X=[])).push(lt))}else lt.from+=be,J&&(X||(X=[])).push(lt)}X&&(X=kt(X)),Q&&Q!=X&&(Q=kt(Q));var wt=[X];if(!J){var Ut=t.text.length-2,Ct;if(Ut>0&&X)for(var Kt=0;Kt<X.length;++Kt)X[Kt].to==null&&(Ct||(Ct=[])).push(new qt(X[Kt].marker,null,null));for(var fn=0;fn<Ut;++fn)wt.push(Ct);wt.push(Q)}return wt}function kt(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function pn(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(Me){if(Me.markedSpans)for(var et=0;et<Me.markedSpans.length;++et){var lt=Me.markedSpans[et].marker;lt.readOnly&&(!n||Y(n,lt)==-1)&&(n||(n=[])).push(lt)}}),!n)return null;for(var h=[{from:t,to:r}],P=0;P<n.length;++P)for(var G=n[P],X=G.find(0),Q=0;Q<h.length;++Q){var J=h[Q];if(Zt(J.to,X.from)<0||Zt(J.from,X.to)>0)continue;var be=[Q,1],Te=Zt(J.from,X.from),Fe=Zt(J.to,X.to);(Te<0||!G.inclusiveLeft&&!Te)&&be.push({from:J.from,to:X.from}),(Fe>0||!G.inclusiveRight&&!Fe)&&be.push({from:X.to,to:J.to}),h.splice.apply(h,be),Q+=be.length-3}return h}function er(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Rn(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function zt(e){return e.inclusiveLeft?-1:0}function rn(e){return e.inclusiveRight?1:0}function Tn(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),h=t.find(),P=Zt(n.from,h.from)||zt(e)-zt(t);if(P)return-P;var G=Zt(n.to,h.to)||rn(e)-rn(t);return G||t.id-e.id}function Pt(e,t){var r=Yt&&e.markedSpans,n;if(r)for(var h=void 0,P=0;P<r.length;++P)h=r[P],h.marker.collapsed&&(t?h.from:h.to)==null&&(!n||Tn(n,h.marker)<0)&&(n=h.marker);return n}function It(e){return Pt(e,!0)}function Mt(e){return Pt(e,!1)}function Ae(e,t){var r=Yt&&e.markedSpans,n;if(r)for(var h=0;h<r.length;++h){var P=r[h];P.marker.collapsed&&(P.from==null||P.from<t)&&(P.to==null||P.to>t)&&(!n||Tn(n,P.marker)<0)&&(n=P.marker)}return n}function Vt(e,t,r,n,h){var P=Bt(e,t),G=Yt&&P.markedSpans;if(G)for(var X=0;X<G.length;++X){var Q=G[X];if(!Q.marker.collapsed)continue;var J=Q.marker.find(0),be=Zt(J.from,r)||zt(Q.marker)-zt(h),Te=Zt(J.to,n)||rn(Q.marker)-rn(h);if(be>=0&&Te<=0||be<=0&&Te>=0)continue;if(be<=0&&(Q.marker.inclusiveRight&&h.inclusiveLeft?Zt(J.to,r)>=0:Zt(J.to,r)>0)||be>=0&&(Q.marker.inclusiveRight&&h.inclusiveLeft?Zt(J.from,n)<=0:Zt(J.from,n)<0))return!0}}function dn(e){for(var t;t=It(e);)e=t.find(-1,!0).line;return e}function sr(e){for(var t;t=Mt(e);)e=t.find(1,!0).line;return e}function cn(e){for(var t,r;t=Mt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Hr(e,t){var r=Bt(e,t),n=dn(r);return r==n?t:Wn(n)}function Kr(e,t){if(t>e.lastLine())return t;var r=Bt(e,t),n;if(!Sr(e,r))return t;for(;n=Mt(r);)r=n.find(1,!0).line;return Wn(r)+1}function Sr(e,t){var r=Yt&&t.markedSpans;if(r)for(var n=void 0,h=0;h<r.length;++h){if(n=r[h],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&On(e,t,n))return!0}}function On(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return On(e,n.line,vn(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var h=void 0,P=0;P<t.markedSpans.length;++P)if(h=t.markedSpans[P],h.marker.collapsed&&!h.marker.widgetNode&&h.from==r.to&&(h.to==null||h.to!=r.from)&&(h.marker.inclusiveLeft||r.marker.inclusiveRight)&&On(e,t,h))return!0}function At(e){e=dn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var h=r.lines[n];if(h==e)break;t+=h.height}for(var P=r.parent;P;r=P,P=r.parent)for(var G=0;G<P.children.length;++G){var X=P.children[G];if(X==r)break;t+=X.height}return t}function lr(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=It(n);){var h=r.find(0,!0);n=h.from.line,t+=h.from.ch-h.to.ch}for(n=e;r=Mt(n);){var P=r.find(0,!0);t-=n.text.length-P.from.ch,n=P.to.line,t+=n.text.length-P.to.ch}return t}function $n(e){var t=e.display,r=e.doc;t.maxLine=Bt(r,r.first),t.maxLineLength=lr(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var h=lr(n);h>t.maxLineLength&&(t.maxLineLength=h,t.maxLine=n)})}var jn=function(e,t,r){this.text=e,Rn(this,t),this.height=r?r(this):1};jn.prototype.lineNo=function(){return Wn(this)},le(jn);function Gr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),er(e),Rn(e,r);var h=n?n(e):1;h!=e.height&&ra(e,h)}function Rt(e){e.parent=null,er(e)}var Nt={},Dt={};function Qt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Dt:Nt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Dn(e,t){var r=E("span",null,null,R?"padding-right: .1px":null),n={pre:E("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var h=0;h<=(t.rest?t.rest.length:0);h++){var P=h?t.rest[h-1]:t.line,G=void 0;n.pos=0,n.addToken=Hn,In(e.display.measure)&&(G=gt(P,e.doc.direction))&&(n.addToken=ca(n.addToken,G)),n.map=[];var X=t!=e.display.externalMeasured&&Wn(P);Fa(P,n,ei(e,P,X)),P.styleClasses&&(P.styleClasses.bgClass&&(n.bgClass=U(P.styleClasses.bgClass,n.bgClass||"")),P.styleClasses.textClass&&(n.textClass=U(P.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(jt(e.display.measure))),h==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(R){var Q=n.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=U(n.pre.className,n.textClass||"")),n}function bn(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 Hn(e,t,r,n,h,P,G){if(!t)return;var X=e.splitSpaces?nr(t,e.trailingSpace):t,Q=e.cm.state.specialChars,J=!1,be;if(!Q.test(t))e.col+=t.length,be=document.createTextNode(X),e.map.push(e.pos,e.pos+t.length,be),W&&F<9&&(J=!0),e.pos+=t.length;else{be=document.createDocumentFragment();for(var Te=0;;){Q.lastIndex=Te;var Fe=Q.exec(t),Me=Fe?Fe.index-Te:t.length-Te;if(Me){var et=document.createTextNode(X.slice(Te,Te+Me));W&&F<9?be.appendChild(o("span",[et])):be.appendChild(et),e.map.push(e.pos,e.pos+Me,et),e.col+=Me,e.pos+=Me}if(!Fe)break;Te+=Me+1;var lt=void 0;if(Fe[0]==" "){var bt=e.cm.options.tabSize,wt=bt-e.col%bt;lt=be.appendChild(o("span",ae(wt),"cm-tab")),lt.setAttribute("role","presentation"),lt.setAttribute("cm-text"," "),e.col+=wt}else Fe[0]=="\r"||Fe[0]==`
|
|
`?(lt=be.appendChild(o("span",Fe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),lt.setAttribute("cm-text",Fe[0]),e.col+=1):(lt=e.cm.options.specialCharPlaceholder(Fe[0]),lt.setAttribute("cm-text",Fe[0]),W&&F<9?be.appendChild(o("span",[lt])):be.appendChild(lt),e.col+=1);e.map.push(e.pos,e.pos+1,lt),e.pos++}}if(e.trailingSpace=X.charCodeAt(t.length-1)==32,r||n||h||J||P||G){var Ut=r||"";n&&(Ut+=n),h&&(Ut+=h);var Ct=o("span",[be],Ut,P);if(G)for(var Kt in G)G.hasOwnProperty(Kt)&&Kt!="style"&&Kt!="class"&&Ct.setAttribute(Kt,G[Kt]);return e.content.appendChild(Ct)}e.content.appendChild(be)}function nr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",h=0;h<e.length;h++){var P=e.charAt(h);P==" "&&r&&(h==e.length-1||e.charCodeAt(h+1)==32)&&(P="\xA0"),n+=P,r=P==" "}return n}function ca(e,t){return function(r,n,h,P,G,X,Q){h=h?h+" cm-force-border":"cm-force-border";for(var J=r.pos,be=J+n.length;;){for(var Te=void 0,Fe=0;Fe<t.length&&!(Te=t[Fe],Te.to>J&&Te.from<=J);Fe++);if(Te.to>=be)return e(r,n,h,P,G,X,Q);e(r,n.slice(0,Te.to-J),h,P,null,X,Q),P=null,n=n.slice(Te.to-J),J=Te.to}}}function Fn(e,t,r,n){var h=!n&&r.widgetNode;h&&e.map.push(e.pos,e.pos+t,h),!n&&e.cm.display.input.needsContentAttribute&&(h||(h=e.content.appendChild(document.createElement("span"))),h.setAttribute("cm-marker",r.id)),h&&(e.cm.display.input.setUneditable(h),e.content.appendChild(h)),e.pos+=t,e.trailingSpace=!1}function Fa(e,t,r){var n=e.markedSpans,h=e.text,P=0;if(!n){for(var G=1;G<r.length;G+=2)t.addToken(t,h.slice(P,P=r[G]),Qt(r[G+1],t.cm.options));return}for(var X=h.length,Q=0,J=1,be="",Te,Fe,Me=0,et,lt,bt,wt,Ut;;){if(Me==Q){et=lt=bt=Fe="",Ut=null,wt=null,Me=Infinity;for(var Ct=[],Kt=void 0,fn=0;fn<n.length;++fn){var nn=n[fn],Xn=nn.marker;if(Xn.type=="bookmark"&&nn.from==Q&&Xn.widgetNode)Ct.push(Xn);else if(nn.from<=Q&&(nn.to==null||nn.to>Q||Xn.collapsed&&nn.to==Q&&nn.from==Q)){if(nn.to!=null&&nn.to!=Q&&Me>nn.to&&(Me=nn.to,lt=""),Xn.className&&(et+=" "+Xn.className),Xn.css&&(Fe=(Fe?Fe+";":"")+Xn.css),Xn.startStyle&&nn.from==Q&&(bt+=" "+Xn.startStyle),Xn.endStyle&&nn.to==Me&&(Kt||(Kt=[])).push(Xn.endStyle,nn.to),Xn.title&&((Ut||(Ut={})).title=Xn.title),Xn.attributes)for(var Or in Xn.attributes)(Ut||(Ut={}))[Or]=Xn.attributes[Or];Xn.collapsed&&(!wt||Tn(wt.marker,Xn)<0)&&(wt=nn)}else nn.from>Q&&Me>nn.from&&(Me=nn.from)}if(Kt)for(var la=0;la<Kt.length;la+=2)Kt[la+1]==Me&&(lt+=" "+Kt[la]);if(!wt||wt.from==Q)for(var jr=0;jr<Ct.length;++jr)Fn(t,0,Ct[jr]);if(wt&&(wt.from||0)==Q){if(Fn(t,(wt.to==null?X+1:wt.to)-Q,wt.marker,wt.from==null),wt.to==null)return;wt.to==Q&&(wt=!1)}}if(Q>=X)break;for(var ka=Math.min(X,Me);;){if(be){var Da=Q+be.length;if(!wt){var Qr=Da>ka?be.slice(0,ka-Q):be;t.addToken(t,Qr,Te?Te+et:et,bt,Q+Qr.length==Me?lt:"",Fe,Ut)}if(Da>=ka){be=be.slice(ka-Q),Q=ka;break}Q=Da,bt=""}be=h.slice(P,P=r[J++]),Te=Qt(r[J++],t.cm.options)}}}function rr(e,t,r){this.line=t,this.rest=cn(t),this.size=this.rest?Wn(ge(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Sr(e,t)}function Jr(e,t,r){for(var n=[],h,P=t;P<r;P=h){var G=new rr(e.doc,Bt(e.doc,P),P);h=P+G.size,n.push(G)}return n}var zr=null;function Aa(e){zr?zr.ops.push(e):e.ownsGroup=zr={ops:[e],delayedCallbacks:[]}}function Ii(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var h=e.ops[n];if(h.cursorActivityHandlers)for(;h.cursorActivityCalled<h.cursorActivityHandlers.length;)h.cursorActivityHandlers[h.cursorActivityCalled++].call(null,h.cm)}}while(r<t.length)}function Lo(e,t){var r=e.ownsGroup;if(!r)return;try{Ii(r)}finally{zr=null,t(r)}}var ti=null;function Rr(e,t){var r=Et(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),h;zr?h=zr.delayedCallbacks:ti?h=ti:(h=ti=[],setTimeout(lo,0));for(var P=function(X){h.push(function(){return r[X].apply(null,n)})},G=0;G<r.length;++G)P(G)}function lo(){var e=ti;ti=null;for(var t=0;t<e.length;++t)e[t]()}function uo(e,t,r,n){for(var h=0;h<t.changes.length;h++){var P=t.changes[h];P=="text"?co(e,t):P=="gutter"?Ti(e,t,r,n):P=="class"?Mi(e,t):P=="widget"&&fo(e,t,n)}t.changes=null}function fi(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),W&&F<8&&(e.node.style.zIndex=2)),e.node}function hi(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=fi(t);t.background=n.insertBefore(o("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Qi(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Dn(e,t)}function co(e,t){var r=t.text.className,n=Qi(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Mi(e,t)):r&&(t.text.className=r)}function Mi(e,t){hi(e,t),t.line.wrapClass?fi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ti(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var h=fi(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),h.insertBefore(t.gutterBackground,t.text)}var P=t.line.gutterMarkers;if(e.options.lineNumbers||P){var G=fi(t),X=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(X),G.insertBefore(X,t.text),t.line.gutterClass&&(X.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!P||!P["CodeMirror-linenumbers"])&&(t.lineNumber=X.appendChild(o("div",Ja(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),P)for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var J=e.display.gutterSpecs[Q].className,be=P.hasOwnProperty(J)&&P[J];be&&X.appendChild(o("div",[be],"CodeMirror-gutter-elt","left: "+n.gutterLeft[J]+"px; width: "+n.gutterWidth[J]+"px"))}}}function fo(e,t,r){t.alignable&&(t.alignable=null);for(var n=A("CodeMirror-linewidget"),h=t.node.firstChild,P=void 0;h;h=P)P=h.nextSibling,n.test(h.className)&&t.node.removeChild(h);ki(e,t,r)}function ho(e,t,r,n){var h=Qi(e,t);return t.text=t.node=h.pre,h.bgClass&&(t.bgClass=h.bgClass),h.textClass&&(t.textClass=h.textClass),Mi(e,t),Ti(e,t,r,n),ki(e,t,n),t.node}function ki(e,t,r){if(po(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)po(e,t.rest[n],t,r,!1)}function po(e,t,r,n,h){if(!t.widgets)return;for(var P=fi(r),G=0,X=t.widgets;G<X.length;++G){var Q=X[G],J=o("div",[Q.node],"CodeMirror-linewidget"+(Q.className?" "+Q.className:""));Q.handleMouseEvents||J.setAttribute("cm-ignore-events","true"),$i(Q,J,r,n),e.display.input.setUneditable(J),h&&Q.above?P.insertBefore(J,r.gutter||r.text):P.appendChild(J),Rr(Q,"redraw")}}function $i(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var h=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(h-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=h+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function pi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,o("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Va(e,t){for(var r=Oe(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function mi(e){return e.lineSpace.offsetTop}function pe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function xe(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,o("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Se(e){return $-e.display.nativeBarWidth}function _e(e){return e.display.scroller.clientWidth-Se(e)-e.display.barWidth}function Z(e){return e.display.scroller.clientHeight-Se(e)-e.display.barHeight}function de(e,t,r){var n=e.options.lineWrapping,h=n&&_e(e);if(!t.measure.heights||n&&t.measure.width!=h){var P=t.measure.heights=[];if(n){t.measure.width=h;for(var G=t.text.firstChild.getClientRects(),X=0;X<G.length-1;X++){var Q=G[X],J=G[X+1];Math.abs(Q.bottom-J.bottom)>2&&P.push((Q.bottom+J.top)/2-r.top)}}P.push(r.bottom-r.top)}}function te(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var h=0;h<e.rest.length;h++)if(Wn(e.rest[h])>r)return{map:e.measure.maps[h],cache:e.measure.caches[h],before:!0}}function ye(e,t){t=dn(t);var r=Wn(t),n=e.display.externalMeasured=new rr(e.doc,t,r);n.lineN=r;var h=n.built=Dn(e,n);return n.text=h.pre,s(e.display.lineMeasure,h.pre),n}function he(e,t,r,n){return Pe(e,we(e,t),r,n)}function Ce(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gr(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function we(e,t){var r=Wn(t),n=Ce(e,r);n&&!n.text?n=null:n&&n.changes&&(uo(e,n,r,wr(e)),e.curOp.forceUpdate=!0),n||(n=ye(e,t));var h=te(n,t,r);return{line:t,view:n,rect:null,map:h.map,cache:h.cache,before:h.before,hasHeights:!1}}function Pe(e,t,r,n,h){t.before&&(r=-1);var P=r+(n||""),G;return t.cache.hasOwnProperty(P)?G=t.cache[P]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(de(e,t.view,t.rect),t.hasHeights=!0),G=Ot(e,t,r,n),G.bogus||(t.cache[P]=G)),{left:G.left,right:G.right,top:h?G.rtop:G.top,bottom:h?G.rbottom:G.bottom}}var ze={left:0,right:0,top:0,bottom:0};function ot(e,t,r){for(var n,h,P,G,X,Q,J=0;J<e.length;J+=3)if(X=e[J],Q=e[J+1],t<X?(h=0,P=1,G="left"):t<Q?(h=t-X,P=h+1):(J==e.length-3||t==Q&&e[J+3]>t)&&(P=Q-X,h=P-1,t>=Q&&(G="right")),h!=null){if(n=e[J+2],X==Q&&r==(n.insertLeft?"left":"right")&&(G=r),r=="left"&&h==0)for(;J&&e[J-2]==e[J-3]&&e[J-1].insertLeft;)n=e[(J-=3)+2],G="left";if(r=="right"&&h==Q-X)for(;J<e.length-3&&e[J+3]==e[J+4]&&!e[J+5].insertLeft;)n=e[(J+=3)+2],G="right";break}return{node:n,start:h,end:P,collapse:G,coverStart:X,coverEnd:Q}}function dt(e,t){var r=ze;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var h=e.length-1;h>=0&&!((r=e[h]).left!=r.right);h--);return r}function Ot(e,t,r,n){var h=ot(t.map,r,n),P=h.node,G=h.start,X=h.end,Q=h.collapse,J;if(P.nodeType==3){for(var be=0;be<4;be++){for(;G&&Qe(t.line.text.charAt(h.coverStart+G));)--G;for(;h.coverStart+X<h.coverEnd&&Qe(t.line.text.charAt(h.coverStart+X));)++X;if(W&&F<9&&G==0&&X==h.coverEnd-h.coverStart?J=P.parentNode.getBoundingClientRect():J=dt(g(P,G,X).getClientRects(),n),J.left||J.right||G==0)break;X=G,G=G-1,Q="right"}W&&F<11&&(J=on(e.display.measure,J))}else{G>0&&(Q=n="right");var Te;e.options.lineWrapping&&(Te=P.getClientRects()).length>1?J=Te[n=="right"?Te.length-1:0]:J=P.getBoundingClientRect()}if(W&&F<9&&!G&&(!J||!J.left&&!J.right)){var Fe=P.parentNode.getClientRects()[0];Fe?J={left:Fe.left,right:Fe.left+Mr(e.display),top:Fe.top,bottom:Fe.bottom}:J=ze}for(var Me=J.top-t.rect.top,et=J.bottom-t.rect.top,lt=(Me+et)/2,bt=t.view.measure.heights,wt=0;wt<bt.length-1&&!(lt<bt[wt]);wt++);var Ut=wt?bt[wt-1]:0,Ct=bt[wt],Kt={left:(Q=="right"?J.right:J.left)-t.rect.left,right:(Q=="left"?J.left:J.right)-t.rect.left,top:Ut,bottom:Ct};return!J.left&&!J.right&&(Kt.bogus=!0),e.options.singleCursorHeightPerLine||(Kt.rtop=Me,Kt.rbottom=et),Kt}function on(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!yr(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function Un(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function An(e){e.display.externalMeasure=null,v(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Un(e.display.view[t])}function Ln(e){An(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Mn(){return b&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Pn(){return b&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wn(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=pi(e.widgets[r]));return t}function Bn(e,t,r,n,h){if(!h){var P=wn(t);r.top+=P,r.bottom+=P}if(n=="line")return r;n||(n="local");var G=At(t);if(n=="local"?G+=mi(e.display):G-=e.display.viewOffset,n=="page"||n=="window"){var X=e.display.lineSpace.getBoundingClientRect();G+=X.top+(n=="window"?0:Pn());var Q=X.left+(n=="window"?0:Mn());r.left+=Q,r.right+=Q}return r.top+=G,r.bottom+=G,r}function Kn(e,t,r){if(r=="div")return t;var n=t.left,h=t.top;if(r=="page")n-=Mn(),h-=Pn();else if(r=="local"||!r){var P=e.display.sizer.getBoundingClientRect();n+=P.left,h+=P.top}var G=e.display.lineSpace.getBoundingClientRect();return{left:n-G.left,top:h-G.top}}function xr(e,t,r,n,h){return n||(n=Bt(e.doc,t.line)),Bn(e,n,he(e,n,t.ch,h),r)}function Gn(e,t,r,n,h,P){n=n||Bt(e.doc,t.line),h||(h=we(e,n));function G(et,lt){var bt=Pe(e,h,et,lt?"right":"left",P);return lt?bt.left=bt.right:bt.right=bt.left,Bn(e,n,bt,r)}var X=gt(n,e.doc.direction),Q=t.ch,J=t.sticky;if(Q>=n.text.length?(Q=n.text.length,J="before"):Q<=0&&(Q=0,J="after"),!X)return G(J=="before"?Q-1:Q,J=="before");function be(et,lt,bt){var wt=X[lt],Ut=wt.level==1;return G(bt?et-1:et,Ut!=bt)}var Te=Je(X,Q,J),Fe=ut,Me=be(Q,Te,J=="before");return Fe!=null&&(Me.other=be(Q,Fe,J!="before")),Me}function tn(e,t){var r=0;t=gn(e.doc,t),e.options.lineWrapping||(r=Mr(e.display)*t.ch);var n=Bt(e.doc,t.line),h=At(n)+mi(e.display);return{left:r,right:r,top:h,bottom:h+n.height}}function $t(e,t,r,n,h){var P=ft(e,t,r);return P.xRel=h,n&&(P.outside=n),P}function Cn(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return $t(n.first,0,null,-1,-1);var h=Zr(n,r),P=n.first+n.size-1;if(h>P)return $t(n.first+n.size-1,Bt(n,P).text.length,null,1,1);t<0&&(t=0);for(var G=Bt(n,h);;){var X=Tr(e,G,h,t,r),Q=Ae(G,X.ch+(X.xRel>0||X.outside>0?1:0));if(!Q)return X;var J=Q.find(1);if(J.line==h)return J;G=Bt(n,h=J.line)}}function Zn(e,t,r,n){n-=wn(t);var h=t.text.length,P=st(function(G){return Pe(e,r,G-1).bottom<=n},h,0);return h=st(function(G){return Pe(e,r,G).top>n},P,h),{begin:P,end:h}}function Ht(e,t,r,n){r||(r=we(e,t));var h=Bn(e,t,Pe(e,r,n),"line").top;return Zn(e,t,r,h)}function Jn(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Tr(e,t,r,n,h){h-=At(t);var P=we(e,t),G=wn(t),X=0,Q=t.text.length,J=!0,be=gt(t,e.doc.direction);if(be){var Te=(e.options.lineWrapping?pr:Vn)(e,t,r,P,be,n,h);J=Te.level!=1,X=J?Te.from:Te.to-1,Q=J?Te.to:Te.from-1}var Fe=null,Me=null,et=st(function(fn){var nn=Pe(e,P,fn);return nn.top+=G,nn.bottom+=G,Jn(nn,n,h,!1)?(nn.top<=h&&nn.left<=n&&(Fe=fn,Me=nn),!0):!1},X,Q),lt,bt,wt=!1;if(Me){var Ut=n-Me.left<Me.right-n,Ct=Ut==J;et=Fe+(Ct?0:1),bt=Ct?"after":"before",lt=Ut?Me.left:Me.right}else{!J&&(et==Q||et==X)&&et++,bt=et==0?"after":et==t.text.length?"before":Pe(e,P,et-(J?1:0)).bottom+G<=h==J?"after":"before";var Kt=Gn(e,ft(r,et,bt),"line",t,P);lt=Kt.left,wt=h<Kt.top?-1:h>=Kt.bottom?1:0}return et=Ke(t.text,et,1),$t(r,et,bt,wt,n-lt)}function Vn(e,t,r,n,h,P,G){var X=st(function(Te){var Fe=h[Te],Me=Fe.level!=1;return Jn(Gn(e,ft(r,Me?Fe.to:Fe.from,Me?"before":"after"),"line",t,n),P,G,!0)},0,h.length-1),Q=h[X];if(X>0){var J=Q.level!=1,be=Gn(e,ft(r,J?Q.from:Q.to,J?"after":"before"),"line",t,n);Jn(be,P,G,!0)&&be.top>G&&(Q=h[X-1])}return Q}function pr(e,t,r,n,h,P,G){var X=Zn(e,t,n,G),Q=X.begin,J=X.end;/\s/.test(t.text.charAt(J-1))&&J--;for(var be=null,Te=null,Fe=0;Fe<h.length;Fe++){var Me=h[Fe];if(Me.from>=J||Me.to<=Q)continue;var et=Me.level!=1,lt=Pe(e,n,et?Math.min(J,Me.to)-1:Math.max(Q,Me.from)).right,bt=lt<P?P-lt+1e9:lt-P;(!be||Te>bt)&&(be=Me,Te=bt)}return be||(be=h[h.length-1]),be.from<Q&&(be={from:Q,to:be.to,level:be.level}),be.to>J&&(be={from:be.from,to:J,level:be.level}),be}var ur;function Dr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ur==null){ur=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ur.appendChild(document.createTextNode("x")),ur.appendChild(o("br"));ur.appendChild(document.createTextNode("x"))}s(e.measure,ur);var r=ur.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),v(e.measure),r||1}function Mr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),r=o("pre",[t],"CodeMirror-line-like");s(e.measure,r);var n=t.getBoundingClientRect(),h=(n.right-n.left)/10;return h>2&&(e.cachedCharWidth=h),h||10}function wr(e){for(var t=e.display,r={},n={},h=t.gutters.clientLeft,P=t.gutters.firstChild,G=0;P;P=P.nextSibling,++G){var X=e.display.gutterSpecs[G].className;r[X]=P.offsetLeft+P.clientLeft+h,n[X]=P.clientWidth}return{fixedPos:aa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function aa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ba(e){var t=Dr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Mr(e.display)-3);return function(h){if(Sr(e.doc,h))return 0;var P=0;if(h.widgets)for(var G=0;G<h.widgets.length;G++)h.widgets[G].height&&(P+=h.widgets[G].height);return r?P+(Math.ceil(h.text.length/n)||1)*t:P+t}}function fa(e){var t=e.doc,r=ba(e);t.iter(function(n){var h=r(n);h!=n.height&&ra(n,h)})}function kr(e,t,r,n){var h=e.display;if(!r&&Oe(t).getAttribute("cm-not-content")=="true")return null;var P,G,X=h.lineSpace.getBoundingClientRect();try{P=t.clientX-X.left,G=t.clientY-X.top}catch(Te){return null}var Q=Cn(e,P,G),J;if(n&&Q.xRel>0&&(J=Bt(e.doc,Q.line).text).length==Q.ch){var be=j(J,J.length,e.options.tabSize)-J.length;Q=ft(Q.line,Math.max(0,Math.round((P-xe(e.display).left)/Mr(e.display))-be))}return Q}function gr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function dr(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var h=e.display;if(n&&r<h.viewTo&&(h.updateLineNumbers==null||h.updateLineNumbers>t)&&(h.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=h.viewTo)Yt&&Hr(e.doc,t)<h.viewTo&&cr(e);else if(r<=h.viewFrom)Yt&&Kr(e.doc,r+n)>h.viewFrom?cr(e):(h.viewFrom+=n,h.viewTo+=n);else if(t<=h.viewFrom&&r>=h.viewTo)cr(e);else if(t<=h.viewFrom){var P=wa(e,r,r+n,1);P?(h.view=h.view.slice(P.index),h.viewFrom=P.lineN,h.viewTo+=n):cr(e)}else if(r>=h.viewTo){var G=wa(e,t,t,-1);G?(h.view=h.view.slice(0,G.index),h.viewTo=G.lineN):cr(e)}else{var X=wa(e,t,t,-1),Q=wa(e,r,r+n,1);X&&Q?(h.view=h.view.slice(0,X.index).concat(Jr(e,X.lineN,Q.lineN)).concat(h.view.slice(Q.index)),h.viewTo+=n):cr(e)}var J=h.externalMeasured;J&&(r<J.lineN?J.lineN+=n:t<J.lineN+J.size&&(h.externalMeasured=null))}function an(e,t,r){e.curOp.viewChanged=!0;var n=e.display,h=e.display.externalMeasured;if(h&&t>=h.lineN&&t<h.lineN+h.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var P=n.view[gr(e,t)];if(P.node==null)return;var G=P.changes||(P.changes=[]);Y(G,r)==-1&&G.push(r)}function cr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function wa(e,t,r,n){var h=gr(e,t),P,G=e.display.view;if(!Yt||r==e.doc.first+e.doc.size)return{index:h,lineN:r};for(var X=e.display.viewFrom,Q=0;Q<h;Q++)X+=G[Q].size;if(X!=t){if(n>0){if(h==G.length-1)return null;P=X+G[h].size-t,h++}else P=X-t;t+=P,r+=P}for(;Hr(e.doc,r)!=r;){if(h==(n<0?0:G.length-1))return null;r+=n*G[h-(n<0?1:0)].size,h+=n}return{index:h,lineN:r}}function Ba(e,t,r){var n=e.display,h=n.view;h.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Jr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Jr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(gr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Jr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,gr(e,r)))),n.viewTo=r}function Xa(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var h=t[n];!h.hidden&&(!h.node||h.changes)&&++r}return r}function fr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ia(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},h=n.cursors=document.createDocumentFragment(),P=n.selection=document.createDocumentFragment(),G=0;G<r.sel.ranges.length;G++){if(!t&&G==r.sel.primIndex)continue;var X=r.sel.ranges[G];if(X.from().line>=e.display.viewTo||X.to().line<e.display.viewFrom)continue;var Q=X.empty();(Q||e.options.showCursorWhenSelecting)&&Wa(e,X.head,h),Q||ir(e,X,P)}return n}function Wa(e,t,r){var n=Gn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),h=r.appendChild(o("div","\xA0","CodeMirror-cursor"));if(h.style.left=n.left+"px",h.style.top=n.top+"px",h.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var P=r.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));P.style.display="",P.style.left=n.other.left+"px",P.style.top=n.other.top+"px",P.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function mr(e,t){return e.top-t.top||e.left-t.left}function ir(e,t,r){var n=e.display,h=e.doc,P=document.createDocumentFragment(),G=xe(e.display),X=G.left,Q=Math.max(n.sizerWidth,_e(e)-n.sizer.offsetLeft)-G.right,J=h.direction=="ltr";function be(Ct,Kt,fn,nn){Kt<0&&(Kt=0),Kt=Math.round(Kt),nn=Math.round(nn),P.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+Ct+`px;
|
|
top: `+Kt+"px; width: "+(fn==null?Q-Ct:fn)+`px;
|
|
height: `+(nn-Kt)+"px"))}function Te(Ct,Kt,fn){var nn=Bt(h,Ct),Xn=nn.text.length,Or,la;function jr(Qr,La){return xr(e,ft(Ct,Qr),"div",nn,La)}function ka(Qr,La,ha){var ta=Ht(e,nn,null,Qr),$r=La=="ltr"==(ha=="after")?"left":"right",Wr=ha=="after"?ta.begin:ta.end-(/\s/.test(nn.text.charAt(ta.end-1))?2:1);return jr(Wr,$r)[$r]}var Da=gt(nn,h.direction);return it(Da,Kt||0,fn==null?Xn:fn,function(Qr,La,ha,ta){var $r=ha=="ltr",Wr=jr(Qr,$r?"left":"right"),Pa=jr(La-1,$r?"right":"left"),Ro=Kt==null&&Qr==0,Xi=fn==null&&La==Xn,_a=ta==0,yi=!Da||ta==Da.length-1;if(Pa.top-Wr.top<=3){var ua=(J?Ro:Xi)&&_a,ys=(J?Xi:Ro)&&yi,Li=ua?X:($r?Wr:Pa).left,oo=ys?Q:($r?Pa:Wr).right;be(Li,Wr.top,oo-Li,Wr.bottom)}else{var so,Ta,Do,bs;$r?(so=J&&Ro&&_a?X:Wr.left,Ta=J?Q:ka(Qr,ha,"before"),Do=J?X:ka(La,ha,"after"),bs=J&&Xi&&yi?Q:Pa.right):(so=J?ka(Qr,ha,"before"):X,Ta=!J&&Ro&&_a?Q:Wr.right,Do=!J&&Xi&&yi?X:Pa.left,bs=J?ka(La,ha,"after"):Q),be(so,Wr.top,Ta-so,Wr.bottom),Wr.bottom<Pa.top&&be(X,Wr.bottom,null,Pa.top),be(Do,Pa.top,bs-Do,Pa.bottom)}(!Or||mr(Wr,Or)<0)&&(Or=Wr),mr(Pa,Or)<0&&(Or=Pa),(!la||mr(Wr,la)<0)&&(la=Wr),mr(Pa,la)<0&&(la=Pa)}),{start:Or,end:la}}var Fe=t.from(),Me=t.to();if(Fe.line==Me.line)Te(Fe.line,Fe.ch,Me.ch);else{var et=Bt(h,Fe.line),lt=Bt(h,Me.line),bt=dn(et)==dn(lt),wt=Te(Fe.line,Fe.ch,bt?et.text.length+1:null).end,Ut=Te(Me.line,bt?0:null,Me.ch).start;bt&&(wt.top<Ut.top-2?(be(wt.right,wt.top,null,wt.bottom),be(X,Ut.top,Ut.left,Ut.bottom)):be(wt.right,wt.top,Ut.left-wt.right,wt.bottom)),wt.bottom<Ut.top&&be(X,wt.bottom,null,Ut.top)}r.appendChild(P)}function Cr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||gi(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ni(e){e.state.focused||(e.display.input.focus(),ni(e))}function Zi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,gi(e))},100)}function ni(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,k(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),R&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Cr(e)}function gi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(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 Fr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var h=t.view[n],P=e.options.lineWrapping,G=void 0,X=0;if(h.hidden)continue;if(W&&F<8){var Q=h.node.offsetTop+h.node.offsetHeight;G=Q-r,r=Q}else{var J=h.node.getBoundingClientRect();G=J.bottom-J.top,!P&&h.text.firstChild&&(X=h.text.firstChild.getBoundingClientRect().right-J.left-1)}var be=h.line.height-G;if((be>.005||be<-.005)&&(ra(h.line,G),Ma(h.line),h.rest))for(var Te=0;Te<h.rest.length;Te++)Ma(h.rest[Te]);if(X>e.display.sizerWidth){var Fe=Math.ceil(X/Mr(e.display));Fe>e.display.maxLineLength&&(e.display.maxLineLength=Fe,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}function Ma(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Ui(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-mi(e));var h=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,P=Zr(t,n),G=Zr(t,h);if(r&&r.ensure){var X=r.ensure.from.line,Q=r.ensure.to.line;X<P?(P=X,G=Zr(t,At(Bt(t,X))+e.wrapper.clientHeight)):Math.min(Q,t.lastLine())>=G&&(P=Zr(t,At(Bt(t,Q))-e.wrapper.clientHeight),G=Q)}return{from:P,to:Math.max(G,P+1)}}function Po(e,t){if(nt(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),h=null;if(t.top+n.top<0?h=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(h=!1),h!=null&&!a){var P=o("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-mi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Se(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(P),P.scrollIntoView(h),e.display.lineSpace.removeChild(P)}}function Io(e,t,r,n){n==null&&(n=0);var h;!e.options.lineWrapping&&t==r&&(t=t.ch?ft(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?ft(t.line,t.ch+1,"before"):t);for(var P=0;P<5;P++){var G=!1,X=Gn(e,t),Q=!r||r==t?X:Gn(e,r);h={left:Math.min(X.left,Q.left),top:Math.min(X.top,Q.top)-n,right:Math.max(X.left,Q.left),bottom:Math.max(X.bottom,Q.bottom)+n};var J=Ji(e,h),be=e.doc.scrollTop,Te=e.doc.scrollLeft;if(J.scrollTop!=null&&(ai(e,J.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(G=!0)),J.scrollLeft!=null&&(Ea(e,J.scrollLeft),Math.abs(e.doc.scrollLeft-Te)>1&&(G=!0)),!G)break}return h}function mo(e,t){var r=Ji(e,t);r.scrollTop!=null&&ai(e,r.scrollTop),r.scrollLeft!=null&&Ea(e,r.scrollLeft)}function Ji(e,t){var r=e.display,n=Dr(e.display);t.top<0&&(t.top=0);var h=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,P=Z(e),G={};t.bottom-t.top>P&&(t.bottom=t.top+P);var X=e.doc.height+pe(r),Q=t.top<n,J=t.bottom>X-n;if(t.top<h)G.scrollTop=Q?0:t.top;else if(t.bottom>h+P){var be=Math.min(t.top,(J?X:t.bottom)-P);be!=h&&(G.scrollTop=be)}var Te=e.options.fixedGutter?0:r.gutters.offsetWidth,Fe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-Te,Me=_e(e)-r.gutters.offsetWidth,et=t.right-t.left>Me;return et&&(t.right=t.left+Me),t.left<10?G.scrollLeft=0:t.left<Fe?G.scrollLeft=Math.max(0,t.left+Te-(et?0:10)):t.right>Me+Fe-3&&(G.scrollLeft=t.right+(et?0:10)-Me),G}function qi(e,t){if(t==null)return;ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ri(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function vi(e,t,r){(t!=null||r!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function go(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=tn(e,t.from),n=tn(e,t.to);_i(e,r,n,t.margin)}}function _i(e,t,r,n){var h=Ji(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});vi(e,h.scrollLeft,h.scrollTop)}function ai(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;I||wi(e,{top:t}),vr(e,t,!0),I&&wi(e),Ai(e,100)}function vr(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ea(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Yn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ii(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+pe(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?r:0,docHeight:n,scrollHeight:n+Se(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Ya=function(e,t,r){this.cm=r;var n=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),h=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=h.tabIndex=-1,e(n),e(h),We(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),We(h,"scroll",function(){h.clientWidth&&t(h.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ya.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var h=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+h)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var P=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+P)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Ya.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ya.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ya.prototype.zeroWidthHack=function(){var e=u&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},Ya.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var h=e.getBoundingClientRect(),P=r=="vert"?document.elementFromPoint(h.right-1,(h.top+h.bottom)/2):document.elementFromPoint((h.right+h.left)/2,h.bottom-1);P!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Ya.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Oi=function(){};Oi.prototype.update=function(){return{bottom:0,right:0}},Oi.prototype.setScrollLeft=function(){},Oi.prototype.setScrollTop=function(){},Oi.prototype.clear=function(){};function oi(e,t){t||(t=ii(e));var r=e.display.barWidth,n=e.display.barHeight;Fi(e,t);for(var h=0;h<4&&r!=e.display.barWidth||n!=e.display.barHeight;h++)r!=e.display.barWidth&&e.options.lineWrapping&&Fr(e),Fi(e,ii(e)),r=e.display.barWidth,n=e.display.barHeight}function Fi(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var eo={native:Ya,null:Oi};function Bi(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),We(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Ea(e,t):ai(e,t)},e),e.display.scrollbars.addClass&&k(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function Ha(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},Aa(e.curOp)}function Qa(e){var t=e.curOp;t&&Lo(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;no(r)})}function no(e){for(var t=e.ops,r=0;r<t.length;r++)ro(t[r]);for(var n=0;n<t.length;n++)Mo(t[n]);for(var h=0;h<t.length;h++)ko(t[h]);for(var P=0;P<t.length;P++)ao(t[P]);for(var G=0;G<t.length;G++)No(t[G])}function ro(e){var t=e.cm,r=t.display;io(t),e.updateMaxLine&&$n(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mo(e){e.updatedDisplay=e.mustUpdate&&si(e.cm,e.update)}function ko(e){var t=e.cm,r=t.display;e.updatedDisplay&&Fr(t),e.barMeasure=ii(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=he(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Se(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-_e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function ao(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ea(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&oi(t,e.barMeasure),e.updatedDisplay&&or(t,e.barMeasure),e.selectionChanged&&Cr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Ni(e.cm)}function No(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Ki(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&vr(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ea(t,e.scrollLeft,!0,!0),e.scrollToPos){var h=Io(t,gn(n,e.scrollToPos.from),gn(n,e.scrollToPos.to),e.scrollToPos.margin);Po(t,h)}var P=e.maybeHiddenMarkers,G=e.maybeUnhiddenMarkers;if(P)for(var X=0;X<P.length;++X)P[X].lines.length||Ne(P[X],"hide");if(G)for(var Q=0;Q<G.length;++Q)G[Q].lines.length&&Ne(G[Q],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Br(e,t){if(e.curOp)return t();Ha(e);try{return t()}finally{Qa(e)}}function Nr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ha(e);try{return t.apply(e,arguments)}finally{Qa(e)}}}function qr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ha(this);try{return e.apply(this,arguments)}finally{Qa(this)}}}function Ur(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ha(t);try{return e.apply(this,arguments)}finally{Qa(t)}}}function Ai(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,y(Wi,e))}function Wi(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=da(e,t.highlightFrontier),h=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(P){if(n.line>=e.display.viewFrom){var G=P.styles,X=P.text.length>e.options.maxHighlightLength?Er(t.mode,n.state):null,Q=bi(e,P,n,!0);X&&(n.state=X),P.styles=Q.styles;var J=P.styleClasses,be=Q.classes;be?P.styleClasses=be:J&&(P.styleClasses=null);for(var Te=!G||G.length!=P.styles.length||J!=be&&(!J||!be||J.bgClass!=be.bgClass||J.textClass!=be.textClass),Fe=0;!Te&&Fe<G.length;++Fe)Te=G[Fe]!=P.styles[Fe];Te&&h.push(n.line),P.stateAfter=n.save(),n.nextLine()}else P.text.length<=e.options.maxHighlightLength&&ci(e,P.text,n),P.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Ai(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),h.length&&Br(e,function(){for(var P=0;P<h.length;P++)an(e,h[P],"text")})}var xa=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ui(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=_e(e),this.force=r,this.dims=wr(e),this.events=[]};xa.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},xa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.apply(null,this.events[e])};function io(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Se(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Se(e)+"px",t.scrollbarsClipped=!0)}function Hi(e){if(e.hasFocus())return null;var t=M();if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function vo(e){if(!e||!e.activeElt||e.activeElt==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function si(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return cr(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&Xa(e)==0)return!1;Yr(e)&&(cr(e),t.dims=wr(e));var h=n.first+n.size,P=Math.max(t.visible.from-e.options.viewportMargin,n.first),G=Math.min(h,t.visible.to+e.options.viewportMargin);r.viewFrom<P&&P-r.viewFrom<20&&(P=Math.max(n.first,r.viewFrom)),r.viewTo>G&&r.viewTo-G<20&&(G=Math.min(h,r.viewTo)),Yt&&(P=Hr(e.doc,P),G=Kr(e.doc,G));var X=P!=r.viewFrom||G!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Ba(e,P,G),r.viewOffset=At(Bt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Q=Xa(e);if(!X&&Q==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var J=Hi(e);return Q>4&&(r.lineDiv.style.display="none"),_o(e,r.updateLineNumbers,t.dims),Q>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,vo(J),v(r.cursorDiv),v(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,X&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Ai(e,400)),r.updateLineNumbers=null,!0}function Ki(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==_e(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+pe(e.display)-Z(e),r.top)}),t.visible=Ui(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Ui(e.display,e.doc,r));if(!si(e,t))break;Fr(e);var h=ii(e);fr(e),oi(e,h),or(e,h),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 wi(e,t){var r=new xa(e,t);if(si(e,r)){Fr(e),Ki(e,r);var n=ii(e);fr(e),oi(e,n),or(e,n),r.finish()}}function _o(e,t,r){var n=e.display,h=e.options.lineNumbers,P=n.lineDiv,G=P.firstChild;function X(et){var lt=et.nextSibling;return R&&u&&e.display.currentWheelTarget==et?et.style.display="none":et.parentNode.removeChild(et),lt}for(var Q=n.view,J=n.viewFrom,be=0;be<Q.length;be++){var Te=Q[be];if(!Te.hidden)if(!Te.node||Te.node.parentNode!=P){var Fe=ho(e,Te,J,r);P.insertBefore(Fe,G)}else{for(;G!=Te.node;)G=X(G);var Me=h&&t!=null&&t<=J&&Te.lineNumber;Te.changes&&(Y(Te.changes,"gutter")>-1&&(Me=!1),uo(e,Te,J,r)),Me&&(v(Te.lineNumber),Te.lineNumber.appendChild(document.createTextNode(Ja(e.options,J)))),G=Te.node.nextSibling}J+=Te.size}for(;G;)G=X(G)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function or(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+Se(e)+"px"}function Yn(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=aa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,h=t.gutters.offsetWidth,P=n+"px",G=0;G<r.length;G++)if(!r[G].hidden){e.options.fixedGutter&&(r[G].gutter&&(r[G].gutter.style.left=P),r[G].gutterBackground&&(r[G].gutterBackground.style.left=P));var X=r[G].alignable;if(X)for(var Q=0;Q<X.length;Q++)X[Q].style.left=P}e.options.fixedGutter&&(t.gutters.style.left=n+h+"px")}function Yr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Ja(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var h=n.measure.appendChild(o("div",[o("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),P=h.firstChild.offsetWidth,G=h.offsetWidth-P;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(P,n.lineGutter.offsetWidth-G)+1,n.lineNumWidth=n.lineNumInnerWidth+G,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Gi(e.display),!0}return!1}function ia(e,t){for(var r=[],n=!1,h=0;h<e.length;h++){var P=e[h],G=null;if(typeof P!="string"&&(G=P.style,P=P.className),P=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:P,style:G})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function $a(e){var t=e.gutters,r=e.gutterSpecs;v(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var h=r[n],P=h.className,G=h.style,X=t.appendChild(o("div",null,"CodeMirror-gutter "+P));G&&(X.style.cssText=G),P=="CodeMirror-linenumbers"&&(e.lineGutter=X,X.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Gi(e)}function Ka(e){$a(e.display),dr(e),Yn(e)}function Ci(e,t,r,n){var h=this;this.input=r,h.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),h.scrollbarFiller.setAttribute("cm-not-content","true"),h.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),h.gutterFiller.setAttribute("cm-not-content","true"),h.lineDiv=E("div",null,"CodeMirror-code"),h.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),h.cursorDiv=o("div",null,"CodeMirror-cursors"),h.measure=o("div",null,"CodeMirror-measure"),h.lineMeasure=o("div",null,"CodeMirror-measure"),h.lineSpace=E("div",[h.measure,h.lineMeasure,h.selectionDiv,h.cursorDiv,h.lineDiv],null,"position: relative; outline: none");var P=E("div",[h.lineSpace],"CodeMirror-lines");h.mover=o("div",[P],null,"position: relative"),h.sizer=o("div",[h.mover],"CodeMirror-sizer"),h.sizerWidth=null,h.heightForcer=o("div",null,null,"position: absolute; height: "+$+"px; width: 1px;"),h.gutters=o("div",null,"CodeMirror-gutters"),h.lineGutter=null,h.scroller=o("div",[h.sizer,h.heightForcer,h.gutters],"CodeMirror-scroll"),h.scroller.setAttribute("tabIndex","-1"),h.wrapper=o("div",[h.scrollbarFiller,h.gutterFiller,h.scroller],"CodeMirror"),W&&F<8&&(h.gutters.style.zIndex=-1,h.scroller.style.paddingRight=0),!R&&!(I&&i)&&(h.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(h.wrapper):e(h.wrapper)),h.viewFrom=h.viewTo=t.first,h.reportedViewFrom=h.reportedViewTo=t.first,h.view=[],h.renderedView=null,h.externalMeasured=null,h.viewOffset=0,h.lastWrapHeight=h.lastWrapWidth=0,h.updateLineNumbers=null,h.nativeBarWidth=h.barHeight=h.barWidth=0,h.scrollbarsClipped=!1,h.lineNumWidth=h.lineNumInnerWidth=h.lineNumChars=null,h.alignWidgets=!1,h.cachedCharWidth=h.cachedTextHeight=h.cachedPaddingH=null,h.maxLine=null,h.maxLineLength=0,h.maxLineChanged=!1,h.wheelDX=h.wheelDY=h.wheelStartX=h.wheelStartY=null,h.shift=!1,h.selForContextMenu=null,h.activeTouch=null,h.gutterSpecs=ia(n.gutters,n.lineNumbers),$a(h),r.init(h)}var Za=0,Vr=null;W?Vr=-.53:I?Vr=15:b?Vr=-.7:_&&(Vr=-1/3);function Si(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function Xe(e){var t=Si(e);return t.x*=Vr,t.y*=Vr,t}function He(e,t){var r=Si(t),n=r.x,h=r.y,P=e.display,G=P.scroller,X=G.scrollWidth>G.clientWidth,Q=G.scrollHeight>G.clientHeight;if(!(n&&X||h&&Q))return;if(h&&u&&R){e:for(var J=t.target,be=P.view;J!=G;J=J.parentNode)for(var Te=0;Te<be.length;Te++)if(be[Te].node==J){e.display.currentWheelTarget=J;break e}}if(n&&!I&&!p&&Vr!=null){h&&Q&&ai(e,Math.max(0,G.scrollTop+h*Vr)),Ea(e,Math.max(0,G.scrollLeft+n*Vr)),(!h||h&&Q)&&q(t),P.wheelStartX=null;return}if(h&&Vr!=null){var Fe=h*Vr,Me=e.doc.scrollTop,et=Me+P.wrapper.clientHeight;Fe<0?Me=Math.max(0,Me+Fe-50):et=Math.min(e.doc.height,et+Fe+50),wi(e,{top:Me,bottom:et})}Za<20&&(P.wheelStartX==null?(P.wheelStartX=G.scrollLeft,P.wheelStartY=G.scrollTop,P.wheelDX=n,P.wheelDY=h,setTimeout(function(){if(P.wheelStartX==null)return;var lt=G.scrollLeft-P.wheelStartX,bt=G.scrollTop-P.wheelStartY,wt=bt&&P.wheelDY&&bt/P.wheelDY||lt&&P.wheelDX&</P.wheelDX;if(P.wheelStartX=P.wheelStartY=null,!wt)return;Vr=(Vr*Za+wt)/(Za+1),++Za},200)):(P.wheelDX+=n,P.wheelDY+=h))}var je=function(e,t){this.ranges=e,this.primIndex=t};je.prototype.primary=function(){return this.ranges[this.primIndex]},je.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!qa(r.anchor,n.anchor)||!qa(r.head,n.head))return!1}return!0},je.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ye(za(this.ranges[t].anchor),za(this.ranges[t].head));return new je(e,this.primIndex)},je.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},je.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Zt(t,n.from())>=0&&Zt(e,n.to())<=0)return r}return-1};var Ye=function(e,t){this.anchor=e,this.head=t};Ye.prototype.from=function(){return Ua(this.anchor,this.head)},Ye.prototype.to=function(){return ui(this.anchor,this.head)},Ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qe(e,t,r){var n=e&&e.options.selectionsMayTouch,h=t[r];t.sort(function(Fe,Me){return Zt(Fe.from(),Me.from())}),r=Y(t,h);for(var P=1;P<t.length;P++){var G=t[P],X=t[P-1],Q=Zt(X.to(),G.from());if(n&&!G.empty()?Q>0:Q>=0){var J=Ua(X.from(),G.from()),be=ui(X.to(),G.to()),Te=X.empty()?G.from()==G.head:X.from()==X.head;P<=r&&--r,t.splice(--P,2,new Ye(Te?be:J,Te?J:be))}}return new je(t,r)}function vt(e,t){return new je([new Ye(e,t||e)],0)}function pt(e){return e.text?ft(e.from.line+e.text.length-1,ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ct(e,t){if(Zt(e,t.from)<0)return e;if(Zt(e,t.to)<=0)return pt(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=pt(t).ch-t.to.ch),ft(r,n)}function Xt(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var h=e.sel.ranges[n];r.push(new Ye(ct(h.anchor,t),ct(h.head,t)))}return qe(e.cm,r,e.sel.primIndex)}function zn(e,t,r){return e.line==t.line?ft(r.line,e.ch-t.ch+r.ch):ft(r.line+(e.line-t.line),e.ch)}function ma(e,t,r){for(var n=[],h=ft(e.first,0),P=h,G=0;G<t.length;G++){var X=t[G],Q=zn(X.from,h,P),J=zn(pt(X),h,P);if(h=X.to,P=J,r=="around"){var be=e.sel.ranges[G],Te=Zt(be.head,be.anchor)<0;n[G]=new Ye(Te?J:Q,Te?Q:J)}else n[G]=new Ye(Q,Q)}return new je(n,e.sel.primIndex)}function Sn(e){e.doc.mode=ln(e.options,e.doc.modeOption),oa(e)}function oa(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ai(e,100),e.state.modeGen++,e.curOp&&dr(e)}function sa(e,t){return t.from.ch==0&&t.to.ch==0&&ge(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ea(e,t,r,n){function h(Ut){return r?r[Ut]:null}function P(Ut,Ct,Kt){Gr(Ut,Ct,Kt,n),Rr(Ut,"change",Ut,t)}function G(Ut,Ct){for(var Kt=[],fn=Ut;fn<Ct;++fn)Kt.push(new jn(J[fn],h(fn),n));return Kt}var X=t.from,Q=t.to,J=t.text,be=Bt(e,X.line),Te=Bt(e,Q.line),Fe=ge(J),Me=h(J.length-1),et=Q.line-X.line;if(t.full)e.insert(0,G(0,J.length)),e.remove(J.length,e.size-J.length);else if(sa(e,t)){var lt=G(0,J.length-1);P(Te,Te.text,Me),et&&e.remove(X.line,et),lt.length&&e.insert(X.line,lt)}else if(be==Te)if(J.length==1)P(be,be.text.slice(0,X.ch)+Fe+be.text.slice(Q.ch),Me);else{var bt=G(1,J.length-1);bt.push(new jn(Fe+be.text.slice(Q.ch),Me,n)),P(be,be.text.slice(0,X.ch)+J[0],h(0)),e.insert(X.line+1,bt)}else if(J.length==1)P(be,be.text.slice(0,X.ch)+J[0]+Te.text.slice(Q.ch),h(0)),e.remove(X.line+1,et);else{P(be,be.text.slice(0,X.ch)+J[0],h(0)),P(Te,Fe+Te.text.slice(Q.ch),Me);var wt=G(1,J.length-1);et>1&&e.remove(X.line+1,et-1),e.insert(X.line+1,wt)}Rr(e,"change",e,t)}function ga(e,t,r){function n(h,P,G){if(h.linked)for(var X=0;X<h.linked.length;++X){var Q=h.linked[X];if(Q.doc==P)continue;var J=G&&Q.sharedHist;if(r&&!J)continue;t(Q.doc,J),n(Q.doc,h,J)}}n(e,null,!0)}function Lr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,fa(e),Sn(e),Ca(e),e.options.lineWrapping||$n(e),e.options.mode=t.modeOption,dr(e)}function Ca(e){(e.doc.direction=="rtl"?k:m)(e.display.lineDiv,"CodeMirror-rtl")}function Ga(e){Br(e,function(){Ca(e),dr(e)})}function Ri(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Sa(e,t){var r={from:za(t.from),to:pt(t),text:na(e,t.from,t.to)};return xs(e,r,t.from.line,t.to.line+1),ga(e,function(n){return xs(n,r,t.from.line,t.to.line+1)},!0),r}function yo(e){for(;e.length;){var t=ge(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return yo(e.done),ge(e.done);if(e.done.length&&!ge(e.done).ranges)return ge(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ge(e.done)}function Es(e,t,r,n){var h=e.history;h.undone.length=0;var P=+new Date,G,X;if((h.lastOp==n||h.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&h.lastModTime>P-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(G=pl(h,h.lastOp==n)))X=ge(G.changes),Zt(t.from,t.to)==0&&Zt(t.from,X.to)==0?X.to=pt(t):G.changes.push(Sa(e,t));else{var Q=ge(h.done);for((!Q||!Q.ranges)&&$o(e.sel,h.done),G={changes:[Sa(e,t)],generation:h.generation},h.done.push(G);h.done.length>h.undoDepth;)h.done.shift(),h.done[0].ranges||h.done.shift()}h.done.push(r),h.generation=++h.maxGeneration,h.lastModTime=h.lastSelTime=P,h.lastOp=h.lastSelOp=n,h.lastOrigin=h.lastSelOrigin=t.origin,X||Ne(e,"historyAdded")}function ml(e,t,r,n){var h=t.charAt(0);return h=="*"||h=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var h=e.history,P=n&&n.origin;r==h.lastSelOp||P&&h.lastSelOrigin==P&&(h.lastModTime==h.lastSelTime&&h.lastOrigin==P||ml(e,P,ge(h.done),t))?h.done[h.done.length-1]=t:$o(t,h.done),h.lastSelTime=+new Date,h.lastSelOrigin=P,h.lastSelOp=r,n&&n.clearRedo!==!1&&yo(h.undone)}function $o(e,t){var r=ge(t);r&&r.ranges&&r.equals(e)||t.push(e)}function xs(e,t,r,n){var h=t["spans_"+e.id],P=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(G){G.markedSpans&&((h||(h=t["spans_"+e.id]={}))[P]=G.markedSpans),++P})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function _l(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],h=0;h<t.text.length;++h)n.push(vl(r[h]));return n}function Ts(e,t){var r=_l(e,t),n=Nn(e,t);if(!r)return n;if(!n)return r;for(var h=0;h<r.length;++h){var P=r[h],G=n[h];if(P&&G){e:for(var X=0;X<G.length;++X){for(var Q=G[X],J=0;J<P.length;++J)if(P[J].marker==Q.marker)continue e;P.push(Q)}}else G&&(r[h]=G)}return r}function bo(e,t,r){for(var n=[],h=0;h<e.length;++h){var P=e[h];if(P.ranges){n.push(r?je.prototype.deepCopy.call(P):P);continue}var G=P.changes,X=[];n.push({changes:X});for(var Q=0;Q<G.length;++Q){var J=G[Q],be=void 0;if(X.push({from:J.from,to:J.to,text:J.text}),t)for(var Te in J)(be=Te.match(/^spans_(\d+)$/))&&(Y(t,Number(be[1]))>-1&&(ge(X)[Te]=J[Te],delete J[Te]))}}return n}function ls(e,t,r,n){if(n){var h=e.anchor;if(r){var P=Zt(t,h)<0;P!=Zt(r,h)<0?(h=t,t=r):P!=Zt(t,r)<0&&(t=r)}return new Ye(h,t)}else return new Ye(r||t,t)}function Zo(e,t,r,n,h){h==null&&(h=e.cm&&(e.cm.display.shift||e.extend)),va(e,new je([ls(e.sel.primary(),t,r,h)],0),n)}function Os(e,t,r){for(var n=[],h=e.cm&&(e.cm.display.shift||e.extend),P=0;P<e.sel.ranges.length;P++)n[P]=ls(e.sel.ranges[P],t[P],null,h);var G=qe(e.cm,n,e.sel.primIndex);va(e,G,r)}function us(e,t,r,n){var h=e.sel.ranges.slice(0);h[t]=r,va(e,qe(e.cm,h,e.sel.primIndex),n)}function As(e,t,r,n){va(e,vt(t,r),n)}function yl(e,t,r){var n={ranges:t.ranges,update:function(h){this.ranges=[];for(var P=0;P<h.length;P++)this.ranges[P]=new Ye(gn(e,h[P].anchor),gn(e,h[P].head))},origin:r&&r.origin};return Ne(e,"beforeSelectionChange",e,n),e.cm&&Ne(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?qe(e.cm,n.ranges,n.ranges.length-1):t}function ws(e,t,r){var n=e.history.done,h=ge(n);h&&h.ranges?(n[n.length-1]=t,Jo(e,t,r)):va(e,t,r)}function va(e,t,r){Jo(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Jo(e,t,r){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(Zt(t.primary().head,e.sel.primary().head)<0?-1:1);Cs(e,Rs(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&ri(e.cm)}function Cs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,me(e.cm)),Rr(e,"cursorActivity",e)}function Ss(e){Cs(e,Rs(e,e.sel,null,!1))}function Rs(e,t,r,n){for(var h,P=0;P<t.ranges.length;P++){var G=t.ranges[P],X=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[P],Q=qo(e,G.anchor,X&&X.anchor,r,n),J=qo(e,G.head,X&&X.head,r,n);(h||Q!=G.anchor||J!=G.head)&&(h||(h=t.ranges.slice(0,P)),h[P]=new Ye(Q,J))}return h?qe(e.cm,h,t.primIndex):t}function Eo(e,t,r,n,h){var P=Bt(e,t.line);if(P.markedSpans)for(var G=0;G<P.markedSpans.length;++G){var X=P.markedSpans[G],Q=X.marker,J="selectLeft"in Q?!Q.selectLeft:Q.inclusiveLeft,be="selectRight"in Q?!Q.selectRight:Q.inclusiveRight;if((X.from==null||(J?X.from<=t.ch:X.from<t.ch))&&(X.to==null||(be?X.to>=t.ch:X.to>t.ch))){if(h&&(Ne(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(P.markedSpans){--G;continue}else break;if(!Q.atomic)continue;if(r){var Te=Q.find(n<0?1:-1),Fe=void 0;if((n<0?be:J)&&(Te=Ds(e,Te,-n,Te&&Te.line==t.line?P:null)),Te&&Te.line==t.line&&(Fe=Zt(Te,r))&&(n<0?Fe<0:Fe>0))return Eo(e,Te,t,n,h)}var Me=Q.find(n<0?-1:1);return(n<0?J:be)&&(Me=Ds(e,Me,n,Me.line==t.line?P:null)),Me?Eo(e,Me,t,n,h):null}}return t}function qo(e,t,r,n,h){var P=n||1,G=Eo(e,t,r,P,h)||!h&&Eo(e,t,r,P,!0)||Eo(e,t,r,-P,h)||!h&&Eo(e,t,r,-P,!0);return G||(e.cantEdit=!0,ft(e.first,0))}function Ds(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?gn(e,ft(t.line-1)):null:r>0&&t.ch==(n||Bt(e,t.line)).text.length?t.line<e.first+e.size-1?ft(t.line+1,0):null:new ft(t.line,t.ch+r)}function Ls(e){e.setSelection(ft(e.firstLine(),0),ft(e.lastLine()),se)}function Ps(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(h,P,G,X){h&&(n.from=gn(e,h)),P&&(n.to=gn(e,P)),G&&(n.text=G),X!==void 0&&(n.origin=X)}),Ne(e,"beforeChange",e,n),e.cm&&Ne(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function xo(e,t,r){if(e.cm){if(!e.cm.curOp)return Nr(e.cm,xo)(e,t,r);if(e.cm.state.suppressEdits)return}if((ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))&&(t=Ps(e,t,!0),!t))return;var n=St&&!r&&pn(e,t.from,t.to);if(n)for(var h=n.length-1;h>=0;--h)Is(e,{from:n[h].from,to:n[h].to,text:h?[""]:t.text,origin:t.origin});else Is(e,t)}function Is(e,t){if(t.text.length==1&&t.text[0]==""&&Zt(t.from,t.to)==0)return;var r=Xt(e,t);Es(e,t,r,e.cm?e.cm.curOp.id:NaN),Uo(e,t,r,Nn(e,t));var n=[];ga(e,function(h,P){!P&&Y(n,h.history)==-1&&(Us(h.history,t),n.push(h.history)),Uo(h,t,null,Nn(h,t))})}function es(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var h=e.history,P,G=e.sel,X=t=="undo"?h.done:h.undone,Q=t=="undo"?h.undone:h.done,J=0;J<X.length&&!(P=X[J],r?P.ranges&&!P.equals(e.sel):!P.ranges);J++);if(J==X.length)return;for(h.lastOrigin=h.lastSelOrigin=null;;)if(P=X.pop(),P.ranges){if($o(P,Q),r&&!P.equals(e.sel)){va(e,P,{clearRedo:!1});return}G=P}else if(n){X.push(P);return}else break;var be=[];$o(G,Q),Q.push({changes:be,generation:h.generation}),h.generation=P.generation||++h.maxGeneration;for(var Te=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),Fe=function(lt){var bt=P.changes[lt];if(bt.origin=t,Te&&!Ps(e,bt,!1))return X.length=0,{};be.push(Sa(e,bt));var wt=lt?Xt(e,bt):ge(X);Uo(e,bt,wt,Ts(e,bt)),!lt&&e.cm&&e.cm.scrollIntoView({from:bt.from,to:pt(bt)});var Ut=[];ga(e,function(Ct,Kt){!Kt&&Y(Ut,Ct.history)==-1&&(Us(Ct.history,bt),Ut.push(Ct.history)),Uo(Ct,bt,null,Ts(Ct,bt))})},Me=P.changes.length-1;Me>=0;--Me){var et=Fe(Me);if(et)return et.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new je(Le(e.sel.ranges,function(h){return new Ye(ft(h.anchor.line+t,h.anchor.ch),ft(h.head.line+t,h.head.ch))}),e.sel.primIndex),e.cm){dr(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)an(e.cm,n,"gutter")}}function Uo(e,t,r,n){if(e.cm&&!e.cm.curOp)return Nr(e.cm,Uo)(e,t,r,n);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var h=t.text.length-1-(e.first-t.from.line);Ms(e,h),t={from:ft(e.first,0),to:ft(t.to.line+h,t.to.ch),text:[ge(t.text)],origin:t.origin}}var P=e.lastLine();t.to.line>P&&(t={from:t.from,to:ft(P,Bt(e,P).text.length),text:[t.text[0]],origin:t.origin}),t.removed=na(e,t.from,t.to),r||(r=Xt(e,t)),e.cm?bl(e.cm,t,n):ea(e,t,n),Jo(e,r,se),e.cantEdit&&qo(e,ft(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,r){var n=e.doc,h=e.display,P=t.from,G=t.to,X=!1,Q=P.line;e.options.lineWrapping||(Q=Wn(dn(Bt(n,P.line))),n.iter(Q,G.line+1,function(Me){if(Me==h.maxLine)return X=!0,!0})),n.sel.contains(t.from,t.to)>-1&&me(e),ea(n,t,r,ba(e)),e.options.lineWrapping||(n.iter(Q,P.line+t.text.length,function(Me){var et=lr(Me);et>h.maxLineLength&&(h.maxLine=Me,h.maxLineLength=et,h.maxLineChanged=!0,X=!1)}),X&&(e.curOp.updateMaxLine=!0)),xt(n,P.line),Ai(e,400);var J=t.text.length-(G.line-P.line)-1;t.full?dr(e):P.line==G.line&&t.text.length==1&&!sa(e.doc,t)?an(e,P.line,"text"):dr(e,P.line,G.line+1,J);var be=ve(e,"changes"),Te=ve(e,"change");if(Te||be){var Fe={from:P,to:G,text:t.text,removed:t.removed,origin:t.origin};Te&&Rr(e,"change",e,Fe),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Fe)}e.display.selForContextMenu=null}function To(e,t,r,n,h){var P;n||(n=r),Zt(n,r)<0&&(P=[n,r],r=P[0],n=P[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:r,to:n,text:t,origin:h})}function ks(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,r,n){for(var h=0;h<e.length;++h){var P=e[h],G=!0;if(P.ranges){P.copied||(P=e[h]=P.deepCopy(),P.copied=!0);for(var X=0;X<P.ranges.length;X++)ks(P.ranges[X].anchor,t,r,n),ks(P.ranges[X].head,t,r,n);continue}for(var Q=0;Q<P.changes.length;++Q){var J=P.changes[Q];if(r<J.from.line)J.from=ft(J.from.line+n,J.from.ch),J.to=ft(J.to.line+n,J.to.ch);else if(t<=J.to.line){G=!1;break}}G||(e.splice(0,h+1),h=0)}}function Us(e,t){var r=t.from.line,n=t.to.line,h=t.text.length-(n-r)-1;Ns(e.done,r,n,h),Ns(e.undone,r,n,h)}function jo(e,t,r,n){var h=t,P=t;return typeof t=="number"?P=Bt(e,di(e,t)):h=Wn(t),h==null?null:(n(P,h)&&e.cm&&an(e.cm,h,r),P)}function Fo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Fo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var h=this.lines[r];this.height-=h.height,Rt(h),Rr(h,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function Bo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var h=e[n];t+=h.chunkSize(),r+=h.height,h.parent=this}this.size=t,this.height=r,this.parent=null}Bo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],h=n.chunkSize();if(e<h){var P=Math.min(t,h-e),G=n.height;if(n.removeInner(e,P),this.height-=G-n.height,h==P&&(this.children.splice(r--,1),n.parent=null),(t-=P)==0)break;e=0}else e-=h}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Fo))){var X=[];this.collapse(X),this.children=[new Fo(X)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var h=this.children[n],P=h.chunkSize();if(e<=P){if(h.insertInner(e,t,r),h.lines&&h.lines.length>50){for(var G=h.lines.length%25+25,X=G;X<h.lines.length;){var Q=new Fo(h.lines.slice(X,X+=25));h.height-=Q.height,this.children.splice(++n,0,Q),Q.parent=this}h.lines=h.lines.slice(0,G),this.maybeSpill()}break}e-=P}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Bo(t);if(e.parent){e.size-=r.size,e.height-=r.height;var h=Y(e.parent.children,e);e.parent.children.splice(h+1,0,r)}else{var n=new Bo(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var h=this.children[n],P=h.chunkSize();if(e<P){var G=Math.min(t,P-e);if(h.iterN(e,G,r))return!0;if((t-=G)==0)break;e=0}else e-=P}}};var Wo=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Wn(r);if(n==null||!t)return;for(var h=0;h<t.length;++h)t[h]==this&&t.splice(h--,1);t.length||(r.widgets=null);var P=pi(this);ra(r,Math.max(0,r.height-P)),e&&(Br(e,function(){js(e,r,-P),an(e,n,"widget")}),Rr(e,"lineWidgetCleared",e,this,n))},Wo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var h=pi(this)-t;if(!h)return;Sr(this.doc,n)||ra(n,n.height+h),r&&Br(r,function(){r.curOp.forceUpdate=!0,js(r,n,h),Rr(r,"lineWidgetChanged",r,e,Wn(n))})},le(Wo);function js(e,t,r){At(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qi(e,r)}function El(e,t,r,n){var h=new Wo(e,r,n),P=e.cm;return P&&h.noHScroll&&(P.display.alignWidgets=!0),jo(e,t,"widget",function(G){var X=G.widgets||(G.widgets=[]);if(h.insertAt==null?X.push(h):X.splice(Math.min(X.length-1,Math.max(0,h.insertAt)),0,h),h.line=G,P&&!Sr(e,G)){var Q=At(G)<e.scrollTop;ra(G,G.height+pi(h)),Q&&qi(P,h.height),P.curOp.forceUpdate=!0}return!0}),P&&Rr(P,"lineWidgetAdded",P,h,typeof t=="number"?t:Wn(t)),h}var Fs=0,zi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Fs};zi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ha(e),ve(this,"clear")){var r=this.find();r&&Rr(this,"clear",r.from,r.to)}for(var n=null,h=null,P=0;P<this.lines.length;++P){var G=this.lines[P],X=vn(G.markedSpans,this);e&&!this.collapsed?an(e,Wn(G),"text"):e&&(X.to!=null&&(h=Wn(G)),X.from!=null&&(n=Wn(G))),G.markedSpans=kn(G.markedSpans,X),X.from==null&&this.collapsed&&!Sr(this.doc,G)&&e&&ra(G,Dr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Q=0;Q<this.lines.length;++Q){var J=dn(this.lines[Q]),be=lr(J);be>e.display.maxLineLength&&(e.display.maxLine=J,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&dr(e,n,h+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ss(e.doc)),e&&Rr(e,"markerCleared",e,this,n,h),t&&Qa(e),this.parent&&this.parent.clear()},zi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,h=0;h<this.lines.length;++h){var P=this.lines[h],G=vn(P.markedSpans,this);if(G.from!=null&&(r=ft(t?P:Wn(P),G.from),e==-1))return r;if(G.to!=null&&(n=ft(t?P:Wn(P),G.to),e==1))return n}return r&&{from:r,to:n}},zi.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;Br(n,function(){var h=t.line,P=Wn(t.line),G=Ce(n,P);if(G&&(Un(G),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Sr(r.doc,h)&&r.height!=null){var X=r.height;r.height=null;var Q=pi(r)-X;Q&&ra(h,h.height+Q)}Rr(n,"markerChanged",n,e)})},zi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Y(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},zi.prototype.detachLine=function(e){if(this.lines.splice(Y(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},le(zi);function Oo(e,t,r,n,h){if(n&&n.shared)return xl(e,t,r,n,h);if(e.cm&&!e.cm.curOp)return Nr(e.cm,Oo)(e,t,r,n,h);var P=new zi(e,h),G=Zt(t,r);if(n&&x(n,P,!1),G>0||G==0&&P.clearWhenEmpty!==!1)return P;if(P.replacedWith&&(P.collapsed=!0,P.widgetNode=E("span",[P.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||P.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(P.widgetNode.insertLeft=!0)),P.collapsed){if(Vt(e,t.line,t,r,P)||t.line!=r.line&&Vt(e,r.line,t,r,P))throw new Error("Inserting collapsed marker partially overlapping an existing one");yn()}P.addToHistory&&Es(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var X=t.line,Q=e.cm,J;if(e.iter(X,r.line+1,function(Te){Q&&P.collapsed&&!Q.options.lineWrapping&&dn(Te)==Q.display.maxLine&&(J=!0),P.collapsed&&X!=t.line&&ra(Te,0),en(Te,new qt(P,X==t.line?t.ch:null,X==r.line?r.ch:null)),++X}),P.collapsed&&e.iter(t.line,r.line+1,function(Te){Sr(e,Te)&&ra(Te,0)}),P.clearOnEnter&&We(P,"beforeCursorEnter",function(){return P.clear()}),P.readOnly&&(hn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),P.collapsed&&(P.id=++Fs,P.atomic=!0),Q){if(J&&(Q.curOp.updateMaxLine=!0),P.collapsed)dr(Q,t.line,r.line+1);else if(P.className||P.startStyle||P.endStyle||P.css||P.attributes||P.title)for(var be=t.line;be<=r.line;be++)an(Q,be,"text");P.atomic&&Ss(Q.doc),Rr(Q,"markerAdded",Q,P)}return P}var Ho=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Ho.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Rr(this,"clear")},Ho.prototype.find=function(e,t){return this.primary.find(e,t)},le(Ho);function xl(e,t,r,n,h){n=x(n),n.shared=!1;var P=[Oo(e,t,r,n,h)],G=P[0],X=n.widgetNode;return ga(e,function(Q){X&&(n.widgetNode=X.cloneNode(!0)),P.push(Oo(Q,gn(Q,t),gn(Q,r),n,h));for(var J=0;J<Q.linked.length;++J)if(Q.linked[J].isParent)return;G=ge(P)}),new Ho(P,G)}function Bs(e){return e.findMarks(ft(e.first,0),e.clipPos(ft(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var r=0;r<t.length;r++){var n=t[r],h=n.find(),P=e.clipPos(h.from),G=e.clipPos(h.to);if(Zt(P,G)){var X=Oo(e,P,G,n.primary,n.primary.type);n.markers.push(X),X.parent=n}}}function Ol(e){for(var t=function(n){var h=e[n],P=[h.primary.doc];ga(h.primary.doc,function(Q){return P.push(Q)});for(var G=0;G<h.markers.length;G++){var X=h.markers[G];Y(P,X.doc)==-1&&(X.parent=null,h.markers.splice(G--,1))}},r=0;r<e.length;r++)t(r)}var Al=0,Ra=function(e,t,r,n,h){if(!(this instanceof Ra))return new Ra(e,t,r,n,h);r==null&&(r=0),Bo.call(this,[new Fo([new jn("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var P=ft(r,0);this.sel=vt(P),this.history=new Ri(null),this.id=++Al,this.modeOption=t,this.lineSep=n,this.direction=h=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ea(this,{from:P,to:P,text:e}),va(this,vt(P),se)};Ra.prototype=Ue(Bo.prototype,{constructor:Ra,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ya(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ur(function(e){var t=ft(this.first,0),r=this.first+this.size-1;xo(this,{from:t,to:ft(r,Bt(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&vi(this.cm,0,0),va(this,vt(t),se)}),replaceRange:function(e,t,r,n){t=gn(this,t),r=r?gn(this,r):t,To(this,e,t,r,n)},getRange:function(e,t,r){var n=na(this,gn(this,e),gn(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Na(this,e))return Bt(this,e)},getLineNumber:function(e){return Wn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Bt(this,e)),dn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gn(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ur(function(e,t,r){As(this,gn(this,typeof e=="number"?ft(e,t||0):e),null,r)}),setSelection:Ur(function(e,t,r){As(this,gn(this,e),gn(this,t||e),r)}),extendSelection:Ur(function(e,t,r){Zo(this,gn(this,e),t&&gn(this,t),r)}),extendSelections:Ur(function(e,t){Os(this,yt(this,e),t)}),extendSelectionsBy:Ur(function(e,t){var r=Le(this.sel.ranges,e);Os(this,yt(this,r),t)}),setSelections:Ur(function(e,t,r){if(!e.length)return;for(var n=[],h=0;h<e.length;h++)n[h]=new Ye(gn(this,e[h].anchor),gn(this,e[h].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),va(this,qe(this.cm,n,t),r)}),addSelection:Ur(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ye(gn(this,e),gn(this,t||e))),va(this,qe(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var h=na(this,t[n].from(),t[n].to());r=r?r.concat(h):h}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var h=na(this,r[n].from(),r[n].to());e!==!1&&(h=h.join(e||this.lineSeparator())),t[n]=h}return t},replaceSelection:function(e,t,r){for(var n=[],h=0;h<this.sel.ranges.length;h++)n[h]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Ur(function(e,t,r){for(var n=[],h=this.sel,P=0;P<h.ranges.length;P++){var G=h.ranges[P];n[P]={from:G.from(),to:G.to(),text:this.splitLines(e[P]),origin:r}}for(var X=t&&t!="end"&&ma(this,n,t),Q=n.length-1;Q>=0;Q--)xo(this,n[Q]);X?ws(this,X):this.cm&&ri(this.cm)}),undo:Ur(function(){es(this,"undo")}),redo:Ur(function(){es(this,"redo")}),undoSelection:Ur(function(){es(this,"undo",!0)}),redoSelection:Ur(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,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var h=0;h<e.undone.length;h++)e.undone[h].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ri(this.history.maxGeneration),ga(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:bo(this.history.done),undone:bo(this.history.undone)}},setHistory:function(e){var t=this.history=new Ri(this.history.maxGeneration);t.done=bo(e.done.slice(0),null,!0),t.undone=bo(e.undone.slice(0),null,!0)},setGutterMarker:Ur(function(e,t,r){return jo(this,e,"gutter",function(n){var h=n.gutterMarkers||(n.gutterMarkers={});return h[t]=r,!r&&$e(h)&&(n.gutterMarkers=null),!0})}),clearGutter:Ur(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&jo(t,r,"gutter",function(){return r.gutterMarkers[e]=null,$e(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Na(this,e))return null;if(t=e,e=Bt(this,e),!e)return null}else if(t=Wn(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ur(function(e,t,r){return jo(this,e,t=="gutter"?"gutter":"class",function(n){var h=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[h])n[h]=r;else{if(A(r).test(n[h]))return!1;n[h]+=" "+r}return!0})}),removeLineClass:Ur(function(e,t,r){return jo(this,e,t=="gutter"?"gutter":"class",function(n){var h=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",P=n[h];if(P)if(r==null)n[h]=null;else{var G=P.match(A(r));if(!G)return!1;var X=G.index+G[0].length;n[h]=P.slice(0,G.index)+(!G.index||X==P.length?"":" ")+P.slice(X)||null}else return!1;return!0})}),addLineWidget:Ur(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Oo(this,gn(this,e),gn(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=gn(this,e),Oo(this,e,e,r,"bookmark")},findMarksAt:function(e){e=gn(this,e);var t=[],r=Bt(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var h=r[n];(h.from==null||h.from<=e.ch)&&(h.to==null||h.to>=e.ch)&&t.push(h.marker.parent||h.marker)}return t},findMarks:function(e,t,r){e=gn(this,e),t=gn(this,t);var n=[],h=e.line;return this.iter(e.line,t.line+1,function(P){var G=P.markedSpans;if(G)for(var X=0;X<G.length;X++){var Q=G[X];!(Q.to!=null&&h==e.line&&e.ch>=Q.to||Q.from==null&&h!=e.line||Q.from!=null&&h==t.line&&Q.from>=t.ch)&&(!r||r(Q.marker))&&n.push(Q.marker.parent||Q.marker)}++h}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(h){var P=h.text.length+n;if(P>e)return t=e,!0;e-=P,++r}),gn(this,ft(r,t))},indexFromPos:function(e){e=gn(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new Ra(ya(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Ra(ya(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,Bs(this)),n},unlinkDoc:function(e){if(e instanceof Pr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Ol(Bs(this));break}if(e.history==this.history){var n=[e.id];ga(e,function(h){return n.push(h.id)},!0),e.history=new Ri(null),e.history.done=bo(this.history.done,n),e.history.undone=bo(this.history.undone,n)}},iterLinkedDocs:function(e){ga(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):sn(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Ur(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Ga(this.cm)})}),Ra.prototype.eachLine=Ra.prototype.iter;var Ws=0;function wl(e){var t=this;if(Hs(t),nt(t,e)||Va(t.display,e))return;q(e),W&&(Ws=+new Date);var r=kr(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var h=n.length,P=Array(h),G=0,X=function(){++G==h&&Nr(t,function(){r=gn(t.doc,r);var Me={from:r,to:r,text:t.doc.splitLines(P.filter(function(et){return et!=null}).join(t.doc.lineSeparator())),origin:"paste"};xo(t.doc,Me),ws(t.doc,vt(gn(t.doc,r),gn(t.doc,pt(Me))))})()},Q=function(Me,et){if(t.options.allowDropFileTypes&&Y(t.options.allowDropFileTypes,Me.type)==-1){X();return}var lt=new FileReader;lt.onerror=function(){return X()},lt.onload=function(){var bt=lt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(bt)){X();return}P[et]=bt,X()},lt.readAsText(Me)},J=0;J<n.length;J++)Q(n[J],J);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var Te;if(t.state.draggingText&&!t.state.draggingText.copy&&(Te=t.listSelections()),Jo(t.doc,vt(r,r)),Te)for(var Fe=0;Fe<Te.length;++Fe)To(t.doc,"",Te[Fe].anchor,Te[Fe].head,"drag");t.replaceSelection(be,"around","paste"),t.display.input.focus()}}catch(Me){}}}function Cl(e,t){if(W&&(!e.state.draggingText||+new Date-Ws<100)){Ee(t);return}if(nt(e,t)||Va(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!_){var r=o("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),p&&r.parentNode.removeChild(r)}}function Sl(e,t){var r=kr(e,t);if(!r)return;var n=document.createDocumentFragment();Wa(e,r,n),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ks(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var h=t[n].CodeMirror;h&&r.push(h)}r.length&&r[0].operation(function(){for(var P=0;P<r.length;P++)e(r[P])})}var Gs=!1;function Rl(){if(Gs)return;Dl(),Gs=!0}function Dl(){var e;We(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ks(Ll)},100))}),We(window,"blur",function(){return Ks(gi)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ko=0;Ko<10;Ko++)Vi[Ko+48]=Vi[Ko+96]=String(Ko);for(var ts=65;ts<=90;ts++)Vi[ts]=String.fromCharCode(ts);for(var Go=1;Go<=12;Go++)Vi[Go+111]=Vi[Go+63235]="F"+Go;var Di={};Di.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Di.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Di.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Di.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Di.default=u?Di.macDefault:Di.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,h,P,G=0;G<t.length-1;G++){var X=t[G];if(/^(cmd|meta|m)$/i.test(X))P=!0;else if(/^a(lt)?$/i.test(X))r=!0;else if(/^(c|ctrl|control)$/i.test(X))n=!0;else if(/^s(hift)?$/i.test(X))h=!0;else throw new Error("Unrecognized modifier name: "+X)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),P&&(e="Cmd-"+e),h&&(e="Shift-"+e),e}function Il(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var h=Le(r.split(" "),Pl),P=0;P<h.length;P++){var G=void 0,X=void 0;P==h.length-1?(X=h.join(" "),G=n):(X=h.slice(0,P+1).join(" "),G="...");var Q=t[X];if(!Q)t[X]=G;else if(Q!=G)throw new Error("Inconsistent bindings for "+X)}delete e[r]}for(var J in t)e[J]=t[J];return e}function Ao(e,t,r,n){t=ns(t);var h=t.call?t.call(e,n):t[e];if(h===!1)return"nothing";if(h==="...")return"multi";if(h!=null&&r(h))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ao(e,t.fallthrough,r,n);for(var P=0;P<t.fallthrough.length;P++){var G=Ao(e,t.fallthrough[P],r,n);if(G)return G}}}function zs(e){var t=typeof e=="string"?e:Vi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(p&&e.keyCode==34&&e.char)return!1;var r=Vi[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),Vs(r,e,t))}function ns(e){return typeof e=="string"?Di[e]:e}function wo(e,t){for(var r=e.doc.sel.ranges,n=[],h=0;h<r.length;h++){for(var P=t(r[h]);n.length&&Zt(P.from,ge(n).to)<=0;){var G=n.pop();if(Zt(G.from,P.from)<0){P.from=G.from;break}}n.push(P)}Br(e,function(){for(var X=n.length-1;X>=0;X--)To(e.doc,"",n[X].from,n[X].to,"+delete");ri(e)})}function ds(e,t,r){var n=Ke(e.text,t+r,r);return n<0||n>e.text.length?null:n}function cs(e,t,r){var n=ds(e,t.ch,r);return n==null?null:new ft(t.line,n,r<0?"after":"before")}function fs(e,t,r,n,h){if(e){t.doc.direction=="rtl"&&(h=-h);var P=gt(r,t.doc.direction);if(P){var G=h<0?ge(P):P[0],X=h<0==(G.level==1),Q=X?"after":"before",J;if(G.level>0||t.doc.direction=="rtl"){var be=we(t,r);J=h<0?r.text.length-1:0;var Te=Pe(t,be,J).top;J=st(function(Fe){return Pe(t,be,Fe).top==Te},h<0==(G.level==1)?G.from:G.to-1,J),Q=="before"&&(J=ds(r,J,1))}else J=h<0?G.to:G.from;return new ft(n,J,Q)}}return new ft(n,h<0?r.text.length:0,h<0?"before":"after")}function Ml(e,t,r,n){var h=gt(t,e.doc.direction);if(!h)return cs(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var P=Je(h,r.ch,r.sticky),G=h[P];if(e.doc.direction=="ltr"&&G.level%2==0&&(n>0?G.to>r.ch:G.from<r.ch))return cs(t,r,n);var X=function(wt,Ut){return ds(t,wt instanceof ft?wt.ch:wt,Ut)},Q,J=function(wt){return e.options.lineWrapping?(Q=Q||we(e,t),Ht(e,t,Q,wt)):{begin:0,end:t.text.length}},be=J(r.sticky=="before"?X(r,-1):r.ch);if(e.doc.direction=="rtl"||G.level==1){var Te=G.level==1==n<0,Fe=X(r,Te?1:-1);if(Fe!=null&&(Te?Fe<=G.to&&Fe<=be.end:Fe>=G.from&&Fe>=be.begin)){var Me=Te?"before":"after";return new ft(r.line,Fe,Me)}}var et=function(wt,Ut,Ct){for(var Kt=function(Or,la){return la?new ft(r.line,X(Or,1),"before"):new ft(r.line,Or,"after")};wt>=0&&wt<h.length;wt+=Ut){var fn=h[wt],nn=Ut>0==(fn.level!=1),Xn=nn?Ct.begin:X(Ct.end,-1);if(fn.from<=Xn&&Xn<fn.to)return Kt(Xn,nn);if(Xn=nn?fn.from:X(fn.to,-1),Ct.begin<=Xn&&Xn<Ct.end)return Kt(Xn,nn)}},lt=et(P+n,n,be);if(lt)return lt;var bt=n>0?be.end:X(be.begin,-1);return bt!=null&&!(n>0&&bt==t.text.length)&&(lt=et(n>0?0:h.length-1,n,J(bt)),lt)?lt:null}var zo={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),se)},killLine:function(e){return wo(e,function(t){if(t.empty()){var r=Bt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ft(t.head.line+1,0)}:{from:t.head,to:ft(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return wo(e,function(t){return{from:ft(t.from().line,0),to:gn(e.doc,ft(t.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(t){return{from:ft(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return wo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return wo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ft(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ft(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Qs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},re)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},re)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?Qs(e,t.head):n},re)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,h=0;h<r.length;h++){var P=r[h].from(),G=j(e.getLine(P.line),P.ch,n);t.push(ae(n-G%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Br(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var h=t[n].head,P=Bt(e.doc,h.line).text;if(P){if(h.ch==P.length&&(h=new ft(h.line,h.ch-1)),h.ch>0)h=new ft(h.line,h.ch+1),e.replaceRange(P.charAt(h.ch-1)+P.charAt(h.ch-2),ft(h.line,h.ch-2),h,"+transpose");else if(h.line>e.doc.first){var G=Bt(e.doc,h.line-1).text;G&&(h=new ft(h.line,1),e.replaceRange(P.charAt(0)+e.doc.lineSeparator()+G.charAt(G.length-1),ft(h.line-1,G.length-1),h,"+transpose"))}}r.push(new Ye(h,h))}e.setSelections(r)})},newlineAndIndent:function(e){return Br(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);ri(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var r=Bt(e.doc,t),n=dn(r);return n!=r&&(t=Wn(n)),fs(!0,e,n,t,1)}function kl(e,t){var r=Bt(e.doc,t),n=sr(r);return n!=r&&(t=Wn(n)),fs(!0,e,r,t,-1)}function Qs(e,t){var r=Ys(e,t.line),n=Bt(e.doc,r.line),h=gt(n,e.doc.direction);if(!h||h[0].level==0){var P=Math.max(r.ch,n.text.search(/\S/)),G=t.line==r.line&&t.ch<=P&&t.ch;return ft(r.line,G?0:P,r.sticky)}return r}function rs(e,t,r){if(typeof t=="string"&&(t=zo[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),h=t(e)!=ce}finally{e.display.shift=n,e.state.suppressEdits=!1}return h}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var h=Ao(t,e.state.keyMaps[n],r,e);if(h)return h}return e.options.extraKeys&&Ao(t,e.options.extraKeys,r,e)||Ao(t,e.options.keyMap,r,e)}var Ul=new z;function Vo(e,t,r,n){var h=e.state.keySeq;if(h){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==h&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,h+" "+t,r,n))return!0}return $s(e,t,r,n)}function $s(e,t,r,n){var h=Nl(e,t,n);return h=="multi"&&(e.state.keySeq=t),h=="handled"&&Rr(e,"keyHandled",e,t,r),(h=="handled"||h=="multi")&&(q(r),Cr(e)),!!h}function Zs(e,t){var r=Xs(t,!0);return r?t.shiftKey&&!e.state.keySeq?Vo(e,"Shift-"+r,t,function(n){return rs(e,n,!0)})||Vo(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return rs(e,n)}):Vo(e,r,t,function(n){return rs(e,n)}):!1}function jl(e,t,r){return Vo(e,"'"+r+"'",t,function(n){return rs(e,n,!0)})}var hs=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=M(),nt(t,e))return;W&&F<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=Zs(t,e);p&&(hs=n?r:null,!n&&r==88&&!Qn&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),I&&!u&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;k(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(m(t,"CodeMirror-crosshair"),ht(document,"keyup",r),ht(document,"mouseover",r))}We(document,"keyup",r),We(document,"mouseover",r)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),nt(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Va(t.display,e)||nt(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(p&&r==hs){hs=null,q(e);return}if(p&&(!e.which||e.which<10)&&Zs(t,e))return;var h=String.fromCharCode(n==null?r:n);if(h=="\b")return;if(jl(t,e,h))return;t.display.input.onKeyPress(e)}var Bl=400,ps=function(e,t,r){this.time=e,this.pos=t,this.button=r};ps.prototype.compare=function(e,t,r){return this.time+Bl>e&&Zt(t,this.pos)==0&&r==this.button};var Xo,Yo;function Wl(e,t){var r=+new Date;return Yo&&Yo.compare(r,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(r,e,t)?(Yo=new ps(r,e,t),Xo=null,"double"):(Xo=new ps(r,e,t),Yo=null,"single")}function tl(e){var t=this,r=t.display;if(nt(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Va(r,e)){R||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(ms(t,e))return;var n=kr(t,e),h=Ge(e),P=n?Wl(n,h):"single";if(window.focus(),h==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,h,n,P,e))return;h==1?n?Gl(t,n,P,e):Oe(e)==r.scroller&&q(e):h==2?(n&&Zo(t.doc,n),setTimeout(function(){return r.input.focus()},20)):h==3&&(w?t.display.input.onContextMenu(e):Zi(t))}function Hl(e,t,r,n,h){var P="Click";return n=="double"?P="Double"+P:n=="triple"&&(P="Triple"+P),P=(t==1?"Left":t==2?"Middle":"Right")+P,Vo(e,Vs(P,h),h,function(G){if(typeof G=="string"&&(G=zo[G]),!G)return!1;var X=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),X=G(e,r)!=ce}finally{e.state.suppressEdits=!1}return X})}function Kl(e,t,r){var n=e.getOption("configureMouse"),h=n?n(e,t,r):{};if(h.unit==null){var P=c?r.shiftKey&&r.metaKey:r.altKey;h.unit=P?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(h.extend==null||e.doc.extend)&&(h.extend=e.doc.extend||r.shiftKey),h.addNew==null&&(h.addNew=u?r.metaKey:r.ctrlKey),h.moveOnDrag==null&&(h.moveOnDrag=!(u?r.altKey:r.ctrlKey)),h}function Gl(e,t,r,n){W?setTimeout(y(Ni,e),0):e.curOp.focus=M();var h=Kl(e,r,n),P=e.doc.sel,G;e.options.dragDrop&&tt&&!e.isReadOnly()&&r=="single"&&(G=P.contains(t))>-1&&(Zt((G=P.ranges[G]).from(),t)<0||t.xRel>0)&&(Zt(G.to(),t)>0||t.xRel<0)?zl(e,n,t,h):Vl(e,n,t,h)}function zl(e,t,r,n){var h=e.display,P=!1,G=Nr(e,function(J){R&&(h.scroller.draggable=!1),e.state.draggingText=!1,ht(h.wrapper.ownerDocument,"mouseup",G),ht(h.wrapper.ownerDocument,"mousemove",X),ht(h.scroller,"dragstart",Q),ht(h.scroller,"drop",G),P||(q(J),n.addNew||Zo(e.doc,r,null,null,n.extend),R&&!_||W&&F==9?setTimeout(function(){h.wrapper.ownerDocument.body.focus({preventScroll:!0}),h.input.focus()},20):h.input.focus())}),X=function(J){P=P||Math.abs(t.clientX-J.clientX)+Math.abs(t.clientY-J.clientY)>=10},Q=function(){return P=!0};R&&(h.scroller.draggable=!0),e.state.draggingText=G,G.copy=!n.moveOnDrag,h.scroller.dragDrop&&h.scroller.dragDrop(),We(h.wrapper.ownerDocument,"mouseup",G),We(h.wrapper.ownerDocument,"mousemove",X),We(h.scroller,"dragstart",Q),We(h.scroller,"drop",G),Zi(e),setTimeout(function(){return h.input.focus()},20)}function nl(e,t,r){if(r=="char")return new Ye(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Ye(ft(t.line,0),gn(e.doc,ft(t.line+1,0)));var n=r(e,t);return new Ye(n.from,n.to)}function Vl(e,t,r,n){var h=e.display,P=e.doc;q(t);var G,X,Q=P.sel,J=Q.ranges;if(n.addNew&&!n.extend?(X=P.sel.contains(r),X>-1?G=J[X]:G=new Ye(r,r)):(G=P.sel.primary(),X=P.sel.primIndex),n.unit=="rectangle")n.addNew||(G=new Ye(r,r)),r=kr(e,t,!0,!0),X=-1;else{var be=nl(e,r,n.unit);n.extend?G=ls(G,be.anchor,be.head,n.extend):G=be}n.addNew?X==-1?(X=J.length,va(P,qe(e,J.concat([G]),X),{scroll:!1,origin:"*mouse"})):J.length>1&&J[X].empty()&&n.unit=="char"&&!n.extend?(va(P,qe(e,J.slice(0,X).concat(J.slice(X+1)),0),{scroll:!1,origin:"*mouse"}),Q=P.sel):us(P,X,G,ne):(X=0,va(P,new je([G],0),ne),Q=P.sel);var Te=r;function Fe(Ct){if(Zt(Te,Ct)==0)return;if(Te=Ct,n.unit=="rectangle"){for(var Kt=[],fn=e.options.tabSize,nn=j(Bt(P,r.line).text,r.ch,fn),Xn=j(Bt(P,Ct.line).text,Ct.ch,fn),Or=Math.min(nn,Xn),la=Math.max(nn,Xn),jr=Math.min(r.line,Ct.line),ka=Math.min(e.lastLine(),Math.max(r.line,Ct.line));jr<=ka;jr++){var Da=Bt(P,jr).text,Qr=ue(Da,Or,fn);Or==la?Kt.push(new Ye(ft(jr,Qr),ft(jr,Qr))):Da.length>Qr&&Kt.push(new Ye(ft(jr,Qr),ft(jr,ue(Da,la,fn))))}Kt.length||Kt.push(new Ye(r,r)),va(P,qe(e,Q.ranges.slice(0,X).concat(Kt),X),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ct)}else{var La=G,ha=nl(e,Ct,n.unit),ta=La.anchor,$r;Zt(ha.anchor,ta)>0?($r=ha.head,ta=Ua(La.from(),ha.anchor)):($r=ha.anchor,ta=ui(La.to(),ha.head));var Wr=Q.ranges.slice(0);Wr[X]=Xl(e,new Ye(gn(P,ta),$r)),va(P,qe(e,Wr,X),ne)}}var Me=h.wrapper.getBoundingClientRect(),et=0;function lt(Ct){var Kt=++et,fn=kr(e,Ct,!0,n.unit=="rectangle");if(!fn)return;if(Zt(fn,Te)!=0){e.curOp.focus=M(),Fe(fn);var nn=Ui(h,P);(fn.line>=nn.to||fn.line<nn.from)&&setTimeout(Nr(e,function(){et==Kt&<(Ct)}),150)}else{var Xn=Ct.clientY<Me.top?-20:Ct.clientY>Me.bottom?20:0;Xn&&setTimeout(Nr(e,function(){if(et!=Kt)return;h.scroller.scrollTop+=Xn,lt(Ct)}),50)}}function bt(Ct){e.state.selectingText=!1,et=Infinity,Ct&&(q(Ct),h.input.focus()),ht(h.wrapper.ownerDocument,"mousemove",wt),ht(h.wrapper.ownerDocument,"mouseup",Ut),P.history.lastSelOrigin=null}var wt=Nr(e,function(Ct){Ct.buttons===0||!Ge(Ct)?bt(Ct):lt(Ct)}),Ut=Nr(e,bt);e.state.selectingText=Ut,We(h.wrapper.ownerDocument,"mousemove",wt),We(h.wrapper.ownerDocument,"mouseup",Ut)}function Xl(e,t){var r=t.anchor,n=t.head,h=Bt(e.doc,r.line);if(Zt(r,n)==0&&r.sticky==n.sticky)return t;var P=gt(h);if(!P)return t;var G=Je(P,r.ch,r.sticky),X=P[G];if(X.from!=r.ch&&X.to!=r.ch)return t;var Q=G+(X.from==r.ch==(X.level!=1)?0:1);if(Q==0||Q==P.length)return t;var J;if(n.line!=r.line)J=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=Je(P,n.ch,n.sticky),Te=be-G||(n.ch-r.ch)*(X.level==1?-1:1);be==Q-1||be==Q?J=Te<0:J=Te>0}var Fe=P[Q+(J?-1:0)],Me=J==(Fe.level==1),et=Me?Fe.from:Fe.to,lt=Me?"after":"before";return r.ch==et&&r.sticky==lt?t:new Ye(new ft(r.line,et,lt),n)}function rl(e,t,r,n){var h,P;if(t.touches)h=t.touches[0].clientX,P=t.touches[0].clientY;else try{h=t.clientX,P=t.clientY}catch(Fe){return!1}if(h>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&q(t);var G=e.display,X=G.lineDiv.getBoundingClientRect();if(P>X.bottom||!ve(e,r))return fe(t);P-=X.top-G.viewOffset;for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var J=G.gutters.childNodes[Q];if(J&&J.getBoundingClientRect().right>=h){var be=Zr(e.doc,P),Te=e.display.gutterSpecs[Q];return Ne(e,r,e,be,Te.className,t),fe(t)}}}function ms(e,t){return rl(e,t,"gutterClick",!0)}function al(e,t){if(Va(e.display,t)||Yl(e,t))return;if(nt(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Yl(e,t){return ve(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ln(e)}var Co={toString:function(){return"CodeMirror.Init"}},ol={},as={};function Ql(e){var t=e.optionHandlers;function r(n,h,P,G){e.defaults[n]=h,P&&(t[n]=G?function(X,Q,J){J!=Co&&P(X,Q,J)}:P)}e.defineOption=r,e.Init=Co,r("value","",function(n,h){return n.setValue(h)},!0),r("mode",null,function(n,h){n.doc.modeOption=h,Sn(n)},!0),r("indentUnit",2,Sn,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){oa(n),Ln(n),dr(n)},!0),r("lineSeparator",null,function(n,h){if(n.doc.lineSep=h,!h)return;var P=[],G=n.doc.first;n.doc.iter(function(Q){for(var J=0;;){var be=Q.text.indexOf(h,J);if(be==-1)break;J=be+h.length,P.push(ft(G,be))}G++});for(var X=P.length-1;X>=0;X--)To(n.doc,h,P[X],ft(P[X].line,P[X].ch+h.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,h,P){n.state.specialChars=new RegExp(h.source+(h.test(" ")?"":"| "),"g"),P!=Co&&n.refresh()}),r("specialCharPlaceholder",bn,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,h){return n.getInputField().spellcheck=h},!0),r("autocorrect",!1,function(n,h){return n.getInputField().autocorrect=h},!0),r("autocapitalize",!1,function(n,h){return n.getInputField().autocapitalize=h},!0),r("rtlMoveVisually",!S),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){il(n),Ka(n)},!0),r("keyMap","default",function(n,h,P){var G=ns(h),X=P!=Co&&ns(P);X&&X.detach&&X.detach(n,G),G.attach&&G.attach(n,X||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,h){n.display.gutterSpecs=ia(h,n.options.lineNumbers),Ka(n)},!0),r("fixedGutter",!0,function(n,h){n.display.gutters.style.left=h?aa(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return oi(n)},!0),r("scrollbarStyle","native",function(n){Bi(n),oi(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,h){n.display.gutterSpecs=ia(n.options.gutters,h),Ka(n)},!0),r("firstLineNumber",1,Ka,!0),r("lineNumberFormatter",function(n){return n},Ka,!0),r("showCursorWhenSelecting",!1,fr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,h){h=="nocursor"&&(gi(n),n.display.input.blur()),n.display.input.readOnlyChanged(h)}),r("screenReaderLabel",null,function(n,h){h=h===""?null:h,n.display.input.screenReaderLabelChanged(h)}),r("disableInput",!1,function(n,h){h||n.display.input.reset()},!0),r("dragDrop",!0,$l),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,fr,!0),r("singleCursorHeightPerLine",!0,fr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,oa,!0),r("addModeClass",!1,oa,!0),r("pollInterval",100),r("undoDepth",200,function(n,h){return n.doc.history.undoDepth=h}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,oa,!0),r("moveInputWithCursor",!0,function(n,h){h||n.display.input.resetPosition()}),r("tabindex",null,function(n,h){return n.display.input.getField().tabIndex=h||""}),r("autofocus",null),r("direction","ltr",function(n,h){return n.doc.setDirection(h)},!0),r("phrases",null)}function $l(e,t,r){var n=r&&r!=Co;if(!t!=!n){var h=e.display.dragFunctions,P=t?We:ht;P(e.display.scroller,"dragstart",h.start),P(e.display.scroller,"dragenter",h.enter),P(e.display.scroller,"dragover",h.over),P(e.display.scroller,"dragleave",h.leave),P(e.display.scroller,"drop",h.drop)}}function Zl(e){e.options.lineWrapping?(k(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),$n(e)),fa(e),dr(e),Ln(e),setTimeout(function(){return oi(e)},100)}function Pr(e,t){var r=this;if(!(this instanceof Pr))return new Pr(e,t);this.options=t=t?x(t):{},x(ol,t,!1);var n=t.value;typeof n=="string"?n=new Ra(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var h=new Pr.inputStyles[t.inputStyle](this),P=this.display=new Ci(e,n,h,t);P.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Bi(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 z,keySeq:null,specialChars:null},t.autofocus&&!i&&P.input.focus(),W&&F<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Jl(this),Rl(),Ha(this),this.curOp.forceUpdate=!0,Lr(this,n),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&ni(r)},20):gi(this);for(var G in as)as.hasOwnProperty(G)&&as[G](this,t[G],Co);Yr(this),t.finishInit&&t.finishInit(this);for(var X=0;X<gs.length;++X)gs[X](this);Qa(this),R&&t.lineWrapping&&getComputedStyle(P.lineDiv).textRendering=="optimizelegibility"&&(P.lineDiv.style.textRendering="auto")}Pr.defaults=ol,Pr.optionHandlers=as;function Jl(e){var t=e.display;We(t.scroller,"mousedown",Nr(e,tl)),W&&F<11?We(t.scroller,"dblclick",Nr(e,function(Q){if(nt(e,Q))return;var J=kr(e,Q);if(!J||ms(e,Q)||Va(e.display,Q))return;q(Q);var be=e.findWordAt(J);Zo(e.doc,be.anchor,be.head)})):We(t.scroller,"dblclick",function(Q){return nt(e,Q)||q(Q)}),We(t.scroller,"contextmenu",function(Q){return al(e,Q)}),We(t.input.getField(),"contextmenu",function(Q){t.scroller.contains(Q.target)||al(e,Q)});var r,n={end:0};function h(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function P(Q){if(Q.touches.length!=1)return!1;var J=Q.touches[0];return J.radiusX<=1&&J.radiusY<=1}function G(Q,J){if(J.left==null)return!0;var be=J.left-Q.left,Te=J.top-Q.top;return be*be+Te*Te>20*20}We(t.scroller,"touchstart",function(Q){if(!nt(e,Q)&&!P(Q)&&!ms(e,Q)){t.input.ensurePolled(),clearTimeout(r);var J=+new Date;t.activeTouch={start:J,moved:!1,prev:J-n.end<=300?n:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),We(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),We(t.scroller,"touchend",function(Q){var J=t.activeTouch;if(J&&!Va(t,Q)&&J.left!=null&&!J.moved&&new Date-J.start<300){var be=e.coordsChar(t.activeTouch,"page"),Te;!J.prev||G(J,J.prev)?Te=new Ye(be,be):!J.prev.prev||G(J,J.prev.prev)?Te=e.findWordAt(be):Te=new Ye(ft(be.line,0),gn(e.doc,ft(be.line+1,0))),e.setSelection(Te.anchor,Te.head),e.focus(),q(Q)}h()}),We(t.scroller,"touchcancel",h),We(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ai(e,t.scroller.scrollTop),Ea(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),We(t.scroller,"mousewheel",function(Q){return He(e,Q)}),We(t.scroller,"DOMMouseScroll",function(Q){return He(e,Q)}),We(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){nt(e,Q)||Ee(Q)},over:function(Q){nt(e,Q)||(Sl(e,Q),Ee(Q))},start:function(Q){return Cl(e,Q)},drop:Nr(e,wl),leave:function(Q){nt(e,Q)||Hs(e)}};var X=t.input.getField();We(X,"keyup",function(Q){return qs.call(e,Q)}),We(X,"keydown",Nr(e,Js)),We(X,"keypress",Nr(e,el)),We(X,"focus",function(Q){return ni(e,Q)}),We(X,"blur",function(Q){return gi(e,Q)})}var gs=[];Pr.defineInitHook=function(e){return gs.push(e)};function Qo(e,t,r,n){var h=e.doc,P;r==null&&(r="add"),r=="smart"&&(h.mode.indent?P=da(e,t).state:r="prev");var G=e.options.tabSize,X=Bt(h,t),Q=j(X.text,null,G);X.stateAfter&&(X.stateAfter=null);var J=X.text.match(/^\s*/)[0],be;if(!n&&!/\S/.test(X.text))be=0,r="not";else if(r=="smart"&&(be=h.mode.indent(P,X.text.slice(J.length),X.text),be==ce||be>150)){if(!n)return;r="prev"}r=="prev"?t>h.first?be=j(Bt(h,t-1).text,null,G):be=0:r=="add"?be=Q+e.options.indentUnit:r=="subtract"?be=Q-e.options.indentUnit:typeof r=="number"&&(be=Q+r),be=Math.max(0,be);var Te="",Fe=0;if(e.options.indentWithTabs)for(var Me=Math.floor(be/G);Me;--Me)Fe+=G,Te+=" ";if(Fe<be&&(Te+=ae(be-Fe)),Te!=J)return To(h,Te,ft(t,0),ft(t,J.length),"+input"),X.stateAfter=null,!0;for(var et=0;et<h.sel.ranges.length;et++){var lt=h.sel.ranges[et];if(lt.head.line==t&<.head.ch<J.length){var bt=ft(t,J.length);us(h,et,new Ye(bt,bt));break}}}var li=null;function is(e){li=e}function vs(e,t,r,n,h){var P=e.doc;e.display.shift=!1,n||(n=P.sel);var G=+new Date-200,X=h=="paste"||e.state.pasteIncoming>G,Q=sn(t),J=null;if(X&&n.ranges.length>1)if(li&&li.text.join(`
|
|
`)==t){if(n.ranges.length%li.text.length==0){J=[];for(var be=0;be<li.text.length;be++)J.push(P.splitLines(li.text[be]))}}else Q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(J=Le(Q,function(wt){return[wt]}));for(var Te=e.curOp.updateInput,Fe=n.ranges.length-1;Fe>=0;Fe--){var Me=n.ranges[Fe],et=Me.from(),lt=Me.to();Me.empty()&&(r&&r>0?et=ft(et.line,et.ch-r):e.state.overwrite&&!X?lt=ft(lt.line,Math.min(Bt(P,lt.line).text.length,lt.ch+ge(Q).length)):X&&li&&li.lineWise&&li.text.join(`
|
|
`)==Q.join(`
|
|
`)&&(et=lt=ft(et.line,0)));var bt={from:et,to:lt,text:J?J[Fe%J.length]:Q,origin:h||(X?"paste":e.state.cutIncoming>G?"cut":"+input")};xo(e.doc,bt),Rr(e,"inputRead",e,bt)}t&&!X&&ll(e,t),ri(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Te),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Br(t,function(){return vs(t,r,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var h=r.ranges[n];if(h.head.ch>100||n&&r.ranges[n-1].head.line==h.head.line)continue;var P=e.getModeAt(h.head),G=!1;if(P.electricChars){for(var X=0;X<P.electricChars.length;X++)if(t.indexOf(P.electricChars.charAt(X))>-1){G=Qo(e,h.head.line,"smart");break}}else P.electricInput&&(P.electricInput.test(Bt(e.doc,h.head.line).text.slice(0,h.head.ch))&&(G=Qo(e,h.head.line,"smart")));G&&Rr(e,"electricInput",e,h.head.line)}}function ul(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var h=e.doc.sel.ranges[n].head.line,P={anchor:ft(h,0),head:ft(h+1,0)};r.push(P),t.push(e.getRange(P.anchor,P.head))}return{text:t,ranges:r}}function dl(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return R?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),dl(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,h){var P=this.options,G=P[n];if(P[n]==h&&n!="mode")return;P[n]=h,t.hasOwnProperty(n)&&Nr(this,t[n])(this,h,G),Ne(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,h){this.state.keyMaps[h?"push":"unshift"](ns(n))},removeKeyMap:function(n){for(var h=this.state.keyMaps,P=0;P<h.length;++P)if(h[P]==n||h[P].name==n)return h.splice(P,1),!0},addOverlay:qr(function(n,h){var P=n.token?n:e.getMode(this.options,n);if(P.startState)throw new Error("Overlays may not be stateful.");ke(this.state.overlays,{mode:P,modeSpec:n,opaque:h&&h.opaque,priority:h&&h.priority||0},function(G){return G.priority}),this.state.modeGen++,dr(this)}),removeOverlay:qr(function(n){for(var h=this.state.overlays,P=0;P<h.length;++P){var G=h[P].modeSpec;if(G==n||typeof n=="string"&&G.name==n){h.splice(P,1),this.state.modeGen++,dr(this);return}}}),indentLine:qr(function(n,h,P){typeof h!="string"&&typeof h!="number"&&(h==null?h=this.options.smartIndent?"smart":"prev":h=h?"add":"subtract"),Na(this.doc,n)&&Qo(this,n,h,P)}),indentSelection:qr(function(n){for(var h=this.doc.sel.ranges,P=-1,G=0;G<h.length;G++){var X=h[G];if(X.empty())X.head.line>P&&(Qo(this,X.head.line,n,!0),P=X.head.line,G==this.doc.sel.primIndex&&ri(this));else{var Q=X.from(),J=X.to(),be=Math.max(P,Q.line);P=Math.min(this.lastLine(),J.line-(J.ch?0:1))+1;for(var Te=be;Te<P;++Te)Qo(this,Te,n);var Fe=this.doc.sel.ranges;Q.ch==0&&h.length==Fe.length&&Fe[G].from().ch>0&&us(this.doc,G,new Ye(Q,Fe[G].to()),se)}}}),getTokenAt:function(n,h){return Yi(this,n,h)},getLineTokens:function(n,h){return Yi(this,ft(n),h,!0)},getTokenTypeAt:function(n){n=gn(this.doc,n);var h=ei(this,Bt(this.doc,n.line)),P=0,G=(h.length-1)/2,X=n.ch,Q;if(X==0)Q=h[2];else for(;;){var J=P+G>>1;if((J?h[J*2-1]:0)>=X)G=J;else if(h[J*2+1]<X)P=J+1;else{Q=h[J*2+2];break}}var be=Q?Q.indexOf("overlay "):-1;return be<0?Q:be==0?null:Q.slice(0,be-1)},getModeAt:function(n){var h=this.doc.mode;return h.innerMode?e.innerMode(h,this.getTokenAt(n).state).mode:h},getHelper:function(n,h){return this.getHelpers(n,h)[0]},getHelpers:function(n,h){var P=[];if(!r.hasOwnProperty(h))return P;var G=r[h],X=this.getModeAt(n);if(typeof X[h]=="string")G[X[h]]&&P.push(G[X[h]]);else if(X[h])for(var Q=0;Q<X[h].length;Q++){var J=G[X[h][Q]];J&&P.push(J)}else X.helperType&&G[X.helperType]?P.push(G[X.helperType]):G[X.name]&&P.push(G[X.name]);for(var be=0;be<G._global.length;be++){var Te=G._global[be];Te.pred(X,this)&&Y(P,Te.val)==-1&&P.push(Te.val)}return P},getStateAfter:function(n,h){var P=this.doc;return n=di(P,n==null?P.first+P.size-1:n),da(this,n+1,h).state},cursorCoords:function(n,h){var P,G=this.doc.sel.primary();return n==null?P=G.head:typeof n=="object"?P=gn(this.doc,n):P=n?G.from():G.to(),Gn(this,P,h||"page")},charCoords:function(n,h){return xr(this,gn(this.doc,n),h||"page")},coordsChar:function(n,h){return n=Kn(this,n,h||"page"),Cn(this,n.left,n.top)},lineAtHeight:function(n,h){return n=Kn(this,{top:n,left:0},h||"page").top,Zr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,h,P){var G=!1,X;if(typeof n=="number"){var Q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>Q&&(n=Q,G=!0),X=Bt(this.doc,n)}else X=n;return Bn(this,X,{top:0,left:0},h||"page",P||G).top+(G?this.doc.height-At(X):0)},defaultTextHeight:function(){return Dr(this.display)},defaultCharWidth:function(){return Mr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,h,P,G,X){var Q=this.display;n=Gn(this,gn(this.doc,n));var J=n.bottom,be=n.left;if(h.style.position="absolute",h.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(h),Q.sizer.appendChild(h),G=="over")J=n.top;else if(G=="above"||G=="near"){var Te=Math.max(Q.wrapper.clientHeight,this.doc.height),Fe=Math.max(Q.sizer.clientWidth,Q.lineSpace.clientWidth);(G=="above"||n.bottom+h.offsetHeight>Te)&&n.top>h.offsetHeight?J=n.top-h.offsetHeight:n.bottom+h.offsetHeight<=Te&&(J=n.bottom),be+h.offsetWidth>Fe&&(be=Fe-h.offsetWidth)}h.style.top=J+"px",h.style.left=h.style.right="",X=="right"?(be=Q.sizer.clientWidth-h.offsetWidth,h.style.right="0px"):(X=="left"?be=0:X=="middle"&&(be=(Q.sizer.clientWidth-h.offsetWidth)/2),h.style.left=be+"px"),P&&mo(this,{left:be,top:J,right:be+h.offsetWidth,bottom:J+h.offsetHeight})},triggerOnKeyDown:qr(Js),triggerOnKeyPress:qr(el),triggerOnKeyUp:qs,triggerOnMouseDown:qr(tl),execCommand:function(n){if(zo.hasOwnProperty(n))return zo[n].call(null,this)},triggerElectric:qr(function(n){ll(this,n)}),findPosH:function(n,h,P,G){var X=1;h<0&&(X=-1,h=-h);for(var Q=gn(this.doc,n),J=0;J<h&&!(Q=_s(this.doc,Q,X,P,G),Q.hitSide);++J);return Q},moveH:qr(function(n,h){var P=this;this.extendSelectionsBy(function(G){return P.display.shift||P.doc.extend||G.empty()?_s(P.doc,G.head,n,h,P.options.rtlMoveVisually):n<0?G.from():G.to()},re)}),deleteH:qr(function(n,h){var P=this.doc.sel,G=this.doc;P.somethingSelected()?G.replaceSelection("",null,"+delete"):wo(this,function(X){var Q=_s(G,X.head,n,h,!1);return n<0?{from:Q,to:X.head}:{from:X.head,to:Q}})}),findPosV:function(n,h,P,G){var X=1,Q=G;h<0&&(X=-1,h=-h);for(var J=gn(this.doc,n),be=0;be<h;++be){var Te=Gn(this,J,"div");if(Q==null?Q=Te.left:Te.left=Q,J=fl(this,Te,X,P),J.hitSide)break}return J},moveV:qr(function(n,h){var P=this,G=this.doc,X=[],Q=!this.display.shift&&!G.extend&&G.sel.somethingSelected();if(G.extendSelectionsBy(function(be){if(Q)return n<0?be.from():be.to();var Te=Gn(P,be.head,"div");be.goalColumn!=null&&(Te.left=be.goalColumn),X.push(Te.left);var Fe=fl(P,Te,n,h);return h=="page"&&be==G.sel.primary()&&qi(P,xr(P,Fe,"div").top-Te.top),Fe},re),X.length)for(var J=0;J<G.sel.ranges.length;J++)G.sel.ranges[J].goalColumn=X[J]}),findWordAt:function(n){var h=this.doc,P=Bt(h,n.line).text,G=n.ch,X=n.ch;if(P){var Q=this.getHelper(n,"wordChars");(n.sticky=="before"||X==P.length)&&G?--G:++X;for(var J=P.charAt(G),be=Ve(J,Q)?function(Te){return Ve(Te,Q)}:/\s/.test(J)?function(Te){return/\s/.test(Te)}:function(Te){return!/\s/.test(Te)&&!Ve(Te)};G>0&&be(P.charAt(G-1));)--G;for(;X<P.length&&be(P.charAt(X));)++X}return new Ye(ft(n.line,G),ft(n.line,X))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?k(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:qr(function(n,h){vi(this,n,h)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Se(this)-this.display.barHeight,width:n.scrollWidth-Se(this)-this.display.barWidth,clientHeight:Z(this),clientWidth:_e(this)}},scrollIntoView:qr(function(n,h){n==null?(n={from:this.doc.sel.primary().head,to:null},h==null&&(h=this.options.cursorScrollMargin)):typeof n=="number"?n={from:ft(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=h||0,n.from.line!=null?go(this,n):_i(this,n.from,n.to,n.margin)}),setSize:qr(function(n,h){var P=this,G=function(Q){return typeof Q=="number"||/^\d+$/.test(String(Q))?Q+"px":Q};n!=null&&(this.display.wrapper.style.width=G(n)),h!=null&&(this.display.wrapper.style.height=G(h)),this.options.lineWrapping&&An(this);var X=this.display.viewFrom;this.doc.iter(X,this.display.viewTo,function(Q){if(Q.widgets){for(var J=0;J<Q.widgets.length;J++)if(Q.widgets[J].noHScroll){an(P,X,"widget");break}}++X}),this.curOp.forceUpdate=!0,Ne(this,"refresh",this)}),operation:function(n){return Br(this,n)},startOperation:function(){return Ha(this)},endOperation:function(){return Qa(this)},refresh:qr(function(){var n=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,Ln(this),vi(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(n==null||Math.abs(n-Dr(this.display))>.5||this.options.lineWrapping)&&fa(this),Ne(this,"refresh",this)}),swapDoc:qr(function(n){var h=this.doc;return h.cm=null,this.state.selectingText&&this.state.selectingText(),Lr(this,n),Ln(this),this.display.input.reset(),vi(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Rr(this,"swapDoc",this,h),h}),phrase:function(n){var h=this.options.phrases;return h&&Object.prototype.hasOwnProperty.call(h,n)?h[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}},le(e),e.registerHelper=function(n,h,P){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][h]=P},e.registerGlobalHelper=function(n,h,P,G){e.registerHelper(n,h,G),r[n]._global.push({pred:P,val:G})}}function _s(e,t,r,n,h){var P=t,G=r,X=Bt(e,t.line),Q=h&&e.direction=="rtl"?-r:r;function J(){var Ut=t.line+Q;return Ut<e.first||Ut>=e.first+e.size?!1:(t=new ft(Ut,t.ch,t.sticky),X=Bt(e,Ut))}function be(Ut){var Ct;if(n=="codepoint"){var Kt=X.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Kt)?Ct=null:Ct=new ft(t.line,Math.max(0,Math.min(X.text.length,t.ch+r*(Kt>=55296&&Kt<56320?2:1))),-r)}else h?Ct=Ml(e.cm,X,t,r):Ct=cs(X,t,r);if(Ct==null)if(!Ut&&J())t=fs(h,e.cm,X,t.line,Q);else return!1;else t=Ct;return!0}if(n=="char"||n=="codepoint")be();else if(n=="column")be(!0);else if(n=="word"||n=="group")for(var Te=null,Fe=n=="group",Me=e.cm&&e.cm.getHelper(t,"wordChars"),et=!0;!(r<0&&!be(!et));et=!1){var lt=X.text.charAt(t.ch)||`
|
|
`,bt=Ve(lt,Me)?"w":Fe&<==`
|
|
`?"n":!Fe||/\s/.test(lt)?null:"p";if(Fe&&!et&&!bt&&(bt="s"),Te&&Te!=bt){r<0&&(r=1,be(),t.sticky="after");break}if(bt&&(Te=bt),r>0&&!be(!et))break}var wt=qo(e,t,P,G,!0);return qa(P,wt)&&(wt.hitSide=!0),wt}function fl(e,t,r,n){var h=e.doc,P=t.left,G;if(n=="page"){var X=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Q=Math.max(X-.5*Dr(e.display),3);G=(r>0?t.bottom:t.top)+r*Q}else n=="line"&&(G=r>0?t.bottom+3:t.top-3);for(var J;!(J=Cn(e,P,G),!J.outside);){if(r<0?G<=0:G>=h.height){J.hitSide=!0;break}G+=r*5}return J}var _r=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_r.prototype.init=function(e){var t=this,r=this,n=r.cm,h=r.div=e.lineDiv;dl(h,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function P(X){for(var Q=X.target;Q;Q=Q.parentNode){if(Q==h)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Q.className))break}return!1}We(h,"paste",function(X){if(!P(X)||nt(n,X)||sl(X,n))return;F<=11&&setTimeout(Nr(n,function(){return t.updateFromDOM()}),20)}),We(h,"compositionstart",function(X){t.composing={data:X.data,done:!1}}),We(h,"compositionupdate",function(X){t.composing||(t.composing={data:X.data,done:!1})}),We(h,"compositionend",function(X){t.composing&&(X.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),We(h,"touchstart",function(){return r.forceCompositionEnd()}),We(h,"input",function(){t.composing||t.readFromDOMSoon()});function G(X){if(!P(X)||nt(n,X))return;if(n.somethingSelected())is({lineWise:!1,text:n.getSelections()}),X.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Q=ul(n);is({lineWise:!0,text:Q.text}),X.type=="cut"&&n.operation(function(){n.setSelections(Q.ranges,0,se),n.replaceSelection("",null,"cut")})}else return;if(X.clipboardData){X.clipboardData.clearData();var J=li.text.join(`
|
|
`);if(X.clipboardData.setData("Text",J),X.clipboardData.getData("Text")==J){X.preventDefault();return}}var be=cl(),Te=be.firstChild;n.display.lineSpace.insertBefore(be,n.display.lineSpace.firstChild),Te.value=li.text.join(`
|
|
`);var Fe=document.activeElement;B(Te),setTimeout(function(){n.display.lineSpace.removeChild(be),Fe.focus(),Fe==h&&r.showPrimarySelection()},50)}We(h,"copy",G),We(h,"cut",G)},_r.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},_r.prototype.prepareSelection=function(){var e=Ia(this.cm,!1);return e.focus=document.activeElement==this.div,e},_r.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},_r.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},_r.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),h=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||h.line<t.display.viewFrom){e.removeAllRanges();return}var P=os(t,e.anchorNode,e.anchorOffset),G=os(t,e.focusNode,e.focusOffset);if(P&&!P.bad&&G&&!G.bad&&Zt(Ua(P,G),n)==0&&Zt(ui(P,G),h)==0)return;var X=t.display.view,Q=n.line>=t.display.viewFrom&&hl(t,n)||{node:X[0].measure.map[2],offset:0},J=h.line<t.display.viewTo&&hl(t,h);if(!J){var be=X[X.length-1].measure,Te=be.maps?be.maps[be.maps.length-1]:be.map;J={node:Te[Te.length-1],offset:Te[Te.length-2]-Te[Te.length-3]}}if(!Q||!J){e.removeAllRanges();return}var Fe=e.rangeCount&&e.getRangeAt(0),Me;try{Me=g(Q.node,Q.offset,J.offset,J.node)}catch(et){}Me&&(!I&&t.state.focused?(e.collapse(Q.node,Q.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Fe&&e.anchorNode==null?e.addRange(Fe):I&&this.startGracePeriod()),this.rememberSelection()},_r.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},_r.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},_r.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},_r.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},_r.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},_r.prototype.blur=function(){this.div.blur()},_r.prototype.getField=function(){return this.div},_r.prototype.supportsTouch=function(){return!0},_r.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Br(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},_r.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},_r.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=os(t,e.anchorNode,e.anchorOffset),n=os(t,e.focusNode,e.focusOffset);r&&n&&Br(t,function(){va(t.doc,vt(r,n),se),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},_r.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),h=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=ft(n.line-1,Bt(e.doc,n.line-1).length)),h.ch==Bt(e.doc,h.line).text.length&&h.line<e.lastLine()&&(h=ft(h.line+1,0)),n.line<t.viewFrom||h.line>t.viewTo-1)return!1;var P,G,X;n.line==t.viewFrom||(P=gr(e,n.line))==0?(G=Wn(t.view[0].line),X=t.view[0].node):(G=Wn(t.view[P].line),X=t.view[P-1].node.nextSibling);var Q=gr(e,h.line),J,be;if(Q==t.view.length-1?(J=t.viewTo-1,be=t.lineDiv.lastChild):(J=Wn(t.view[Q+1].line)-1,be=t.view[Q+1].node.previousSibling),!X)return!1;for(var Te=e.doc.splitLines(tu(e,X,be,G,J)),Fe=na(e.doc,ft(G,0),ft(J,Bt(e.doc,J).text.length));Te.length>1&&Fe.length>1;)if(ge(Te)==ge(Fe))Te.pop(),Fe.pop(),J--;else if(Te[0]==Fe[0])Te.shift(),Fe.shift(),G++;else break;for(var Me=0,et=0,lt=Te[0],bt=Fe[0],wt=Math.min(lt.length,bt.length);Me<wt&<.charCodeAt(Me)==bt.charCodeAt(Me);)++Me;for(var Ut=ge(Te),Ct=ge(Fe),Kt=Math.min(Ut.length-(Te.length==1?Me:0),Ct.length-(Fe.length==1?Me:0));et<Kt&&Ut.charCodeAt(Ut.length-et-1)==Ct.charCodeAt(Ct.length-et-1);)++et;if(Te.length==1&&Fe.length==1&&G==n.line)for(;Me&&Me>n.ch&&Ut.charCodeAt(Ut.length-et-1)==Ct.charCodeAt(Ct.length-et-1);)Me--,et++;Te[Te.length-1]=Ut.slice(0,Ut.length-et).replace(/^\u200b+/,""),Te[0]=Te[0].slice(Me).replace(/\u200b+$/,"");var fn=ft(G,Me),nn=ft(J,Fe.length?ge(Fe).length-et:0);if(Te.length>1||Te[0]||Zt(fn,nn))return To(e.doc,Te,fn,nn,"+input"),!0},_r.prototype.ensurePolled=function(){this.forceCompositionEnd()},_r.prototype.reset=function(){this.forceCompositionEnd()},_r.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},_r.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)},_r.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Br(this.cm,function(){return dr(e.cm)})},_r.prototype.setUneditable=function(e){e.contentEditable="false"},_r.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Nr(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},_r.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},_r.prototype.onContextMenu=function(){},_r.prototype.resetPosition=function(){},_r.prototype.needsContentAttribute=!0;function hl(e,t){var r=Ce(e,t.line);if(!r||r.hidden)return null;var n=Bt(e.doc,t.line),h=te(r,n,t.line),P=gt(n,e.doc.direction),G="left";if(P){var X=Je(P,t.ch);G=X%2?"right":"left"}var Q=ot(h.map,t.ch,G);return Q.offset=Q.collapse=="right"?Q.end:Q.start,Q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function So(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,h){var P="",G=!1,X=e.doc.lineSeparator(),Q=!1;function J(Me){return function(et){return et.id==Me}}function be(){G&&(P+=X,Q&&(P+=X),G=Q=!1)}function Te(Me){Me&&(be(),P+=Me)}function Fe(Me){if(Me.nodeType==1){var et=Me.getAttribute("cm-text");if(et){Te(et);return}var lt=Me.getAttribute("cm-marker"),bt;if(lt){var wt=e.findMarks(ft(n,0),ft(h+1,0),J(+lt));wt.length&&(bt=wt[0].find(0))&&Te(na(e.doc,bt.from,bt.to).join(X));return}if(Me.getAttribute("contenteditable")=="false")return;var Ut=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;Ut&&be();for(var Ct=0;Ct<Me.childNodes.length;Ct++)Fe(Me.childNodes[Ct]);/^(pre|p)$/i.test(Me.nodeName)&&(Q=!0),Ut&&(G=!0)}else Me.nodeType==3&&Te(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Fe(t),t==r);)t=t.nextSibling,Q=!1;return P}function os(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return So(e.clipPos(ft(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var h=0;h<e.display.view.length;h++){var P=e.display.view[h];if(P.node==n)return nu(P,t,r)}}function nu(e,t,r){var n=e.text.firstChild,h=!1;if(!t||!O(n,t))return So(ft(Wn(e.line),0),!0);if(t==n&&(h=!0,t=n.childNodes[r],r=0,!t)){var P=e.rest?ge(e.rest):e.line;return So(ft(Wn(P),P.text.length),h)}var G=t.nodeType==3?t:null,X=t;for(!G&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(G=t.firstChild,r&&(r=G.nodeValue.length));X.parentNode!=n;)X=X.parentNode;var Q=e.measure,J=Q.maps;function be(bt,wt,Ut){for(var Ct=-1;Ct<(J?J.length:0);Ct++)for(var Kt=Ct<0?Q.map:J[Ct],fn=0;fn<Kt.length;fn+=3){var nn=Kt[fn+2];if(nn==bt||nn==wt){var Xn=Wn(Ct<0?e.line:e.rest[Ct]),Or=Kt[fn]+Ut;return(Ut<0||nn!=bt)&&(Or=Kt[fn+(Ut?1:0)]),ft(Xn,Or)}}}var Te=be(G,X,r);if(Te)return So(Te,h);for(var Fe=X.nextSibling,Me=G?G.nodeValue.length-r:0;Fe;Fe=Fe.nextSibling){if(Te=be(Fe,Fe.firstChild,0),Te)return So(ft(Te.line,Te.ch-Me),h);Me+=Fe.textContent.length}for(var et=X.previousSibling,lt=r;et;et=et.previousSibling){if(Te=be(et,et.firstChild,-1),Te)return So(ft(Te.line,Te.ch+lt),h);lt+=et.textContent.length}}var Xr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Xr.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var h=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(h.style.width="0px"),We(h,"input",function(){W&&F>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),We(h,"paste",function(G){if(nt(n,G)||sl(G,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function P(G){if(nt(n,G))return;if(n.somethingSelected())is({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var X=ul(n);is({lineWise:!0,text:X.text}),G.type=="cut"?n.setSelections(X.ranges,null,se):(r.prevInput="",h.value=X.text.join(`
|
|
`),B(h))}else return;G.type=="cut"&&(n.state.cutIncoming=+new Date)}We(h,"cut",P),We(h,"copy",P),We(e.scroller,"paste",function(G){if(Va(e,G)||nt(n,G))return;if(!h.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var X=new Event("paste");X.clipboardData=G.clipboardData,h.dispatchEvent(X)}),We(e.lineSpace,"selectstart",function(G){Va(e,G)||q(G)}),We(h,"compositionstart",function(){var G=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:G,range:n.markText(G,n.getCursor("to"),{className:"CodeMirror-composing"})}}),We(h,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Xr.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Xr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Ia(e);if(e.options.moveInputWithCursor){var h=Gn(e,r.sel.primary().head,"div"),P=t.wrapper.getBoundingClientRect(),G=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,h.top+G.top-P.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,h.left+G.left-P.left))}return n},Xr.prototype.showSelection=function(e){var t=this.cm,r=t.display;s(r.cursorDiv,e.cursors),s(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&B(this.textarea),W&&F>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",W&&F>=9&&(this.hasSelection=null))},Xr.prototype.getField=function(){return this.textarea},Xr.prototype.supportsTouch=function(){return!1},Xr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xr.prototype.blur=function(){this.textarea.blur()},Xr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xr.prototype.receivedFocus=function(){this.slowPoll()},Xr.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()})},Xr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Xr.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Wt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var h=r.value;if(h==n&&!t.somethingSelected())return!1;if(W&&F>=9&&this.hasSelection===h||u&&/[\uf700-\uf7ff]/.test(h))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var P=h.charCodeAt(0);if(P==8203&&!n&&(n="\u200B"),P==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,X=Math.min(n.length,h.length);G<X&&n.charCodeAt(G)==h.charCodeAt(G);)++G;return Br(t,function(){vs(t,h.slice(G),n.length-G,null,e.composing?"*compose":null),h.length>1e3||h.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=h,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xr.prototype.onKeyPress=function(){W&&F>=9&&(this.hasSelection=null),this.fastPoll()},Xr.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,h=t.textarea;t.contextMenuPending&&t.contextMenuPending();var P=kr(r,e),G=n.scroller.scrollTop;if(!P||p)return;var X=r.options.resetSelectionOnContextMenu;X&&r.doc.sel.contains(P)==-1&&Nr(r,va)(r.doc,vt(P),se);var Q=h.style.cssText,J=t.wrapper.style.cssText,be=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",h.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-be.top-5)+"px; left: "+(e.clientX-be.left-5)+`px;
|
|
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Te;R&&(Te=window.scrollY),n.input.focus(),R&&window.scrollTo(null,Te),n.input.reset(),r.somethingSelected()||(h.value=t.prevInput=" "),t.contextMenuPending=Me,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Fe(){if(h.selectionStart!=null){var lt=r.somethingSelected(),bt="\u200B"+(lt?h.value:"");h.value="\u21DA",h.value=bt,t.prevInput=lt?"":"\u200B",h.selectionStart=1,h.selectionEnd=bt.length,n.selForContextMenu=r.doc.sel}}function Me(){if(t.contextMenuPending!=Me)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=J,h.style.cssText=Q,W&&F<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=G),h.selectionStart!=null){(!W||W&&F<9)&&Fe();var lt=0,bt=function(){n.selForContextMenu==r.doc.sel&&h.selectionStart==0&&h.selectionEnd>0&&t.prevInput=="\u200B"?Nr(r,Ls)(r):lt++<10?n.detectingSelectAll=setTimeout(bt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(bt,200)}}if(W&&F>=9&&Fe(),w){Ee(e);var et=function(){ht(window,"mouseup",et),setTimeout(Me,20)};We(window,"mouseup",et)}else setTimeout(Me,50)},Xr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xr.prototype.setUneditable=function(){},Xr.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?x(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=M();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=X.getValue()}var h;if(e.form&&(We(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var P=e.form;h=P.submit;try{var G=P.submit=function(){n(),P.submit=h,P.submit(),P.submit=G}}catch(Q){}}t.finishInit=function(Q){Q.save=n,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,n(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=h))}},e.style.display="none";var X=Pr(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return X}function au(e){e.off=ht,e.on=We,e.wheelEventPixels=Xe,e.Doc=Ra,e.splitLines=sn,e.countColumn=j,e.findColumn=ue,e.isWordChar=Re,e.Pass=ce,e.signal=Ne,e.Line=jn,e.changeEnd=pt,e.scrollbarModel=eo,e.Pos=ft,e.cmpPos=Zt,e.modes=hr,e.mimeModes=En,e.resolveMode=Jt,e.getMode=ln,e.modeExtensions=_n,e.extendMode=qn,e.copyState=Er,e.startState=Oa,e.innerMode=Ir,e.commands=zo,e.keyMap=Di,e.keyName=Xs,e.isModifierKey=zs,e.lookupKey=Ao,e.normalizeKeyMap=Il,e.StringStream=xn,e.SharedTextMarker=Ho,e.TextMarker=zi,e.LineWidget=Wo,e.e_preventDefault=q,e.e_stopPropagation=ie,e.e_stop=Ee,e.addClass=k,e.contains=O,e.rmClass=m,e.keyNames=Vi}Ql(Pr),ql(Pr);var iu="iter insert remove copy getEditor constructor".split(" ");for(var ss in Ra.prototype)Ra.prototype.hasOwnProperty(ss)&&Y(iu,ss)<0&&(Pr.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ra.prototype[ss]));return le(Ra),Pr.inputStyles={textarea:Xr,contenteditable:_r},Pr.defineMode=function(e){!Pr.defaults.mode&&e!="null"&&(Pr.defaults.mode=e),Ar.apply(this,arguments)},Pr.defineMIME=br,Pr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pr.defineMIME("text/plain","null"),Pr.defineExtension=function(e,t){Pr.prototype[e]=t},Pr.defineDocExtension=function(e,t){Ra.prototype[e]=t},Pr.fromTextArea=ru,au(Pr),Pr.version="5.58.2",Pr})},WaYH:function(rt,Be,H){"use strict";var oe=H("rePB"),V=H("Ff2n"),I=H("VTBJ"),K=H("1OyB"),L=H("vuIU"),N=H("JX7q"),W=H("Ji7U"),F=H("LK+K"),R=H("cDcd"),D=H("TSYQ"),b=H.n(D),p=H("sboe"),_=H("OZM5"),f=function(w){var A=w.prefixCls,m=w.level,v=w.isStart,s=w.isEnd;if(!m)return null;for(var o="".concat(A,"-indent-unit"),E=[],g=0;g<m;g+=1){var O;E.push(R.createElement("span",{key:g,className:b()(o,(O={},Object(oe.a)(O,"".concat(o,"-start"),v[g+1]),Object(oe.a)(O,"".concat(o,"-end"),s[g+1]),Object(oe.a)(O,"".concat(o,"-end-first-level"),!g&&s[0]),O))}))}return R.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},E)},a=f,d=H("815F"),l="open",i="close",u="---",c=function(T){Object(W.a)(A,T);var w=Object(F.a)(A);function A(){var m;return Object(K.a)(this,A),m=w.apply(this,arguments),m.state={dragNodeHighlight:!1},m.onSelectorClick=function(v){var s=m.props.context.onNodeClick;s(v,Object(d.b)(m.props)),m.isSelectable()?m.onSelect(v):m.onCheck(v)},m.onSelectorDoubleClick=function(v){var s=m.props.context.onNodeDoubleClick;s(v,Object(d.b)(m.props))},m.onSelect=function(v){if(m.isDisabled())return;var s=m.props.context.onNodeSelect;v.preventDefault(),s(v,Object(d.b)(m.props))},m.onCheck=function(v){if(m.isDisabled())return;var s=m.props,o=s.disableCheckbox,E=s.checked,g=m.props.context.onNodeCheck;if(!m.isCheckable()||o)return;v.preventDefault();var O=!E;g(v,Object(d.b)(m.props),O)},m.onMouseEnter=function(v){var s=m.props.context.onNodeMouseEnter;s(v,Object(d.b)(m.props))},m.onMouseLeave=function(v){var s=m.props.context.onNodeMouseLeave;s(v,Object(d.b)(m.props))},m.onContextMenu=function(v){var s=m.props.context.onNodeContextMenu;s(v,Object(d.b)(m.props))},m.onDragStart=function(v){var s=m.props.context.onNodeDragStart;v.stopPropagation(),m.setState({dragNodeHighlight:!0}),s(v,Object(N.a)(m));try{v.dataTransfer.setData("text/plain","")}catch(o){}},m.onDragEnter=function(v){var s=m.props.context.onNodeDragEnter;v.preventDefault(),v.stopPropagation(),s(v,Object(N.a)(m))},m.onDragOver=function(v){var s=m.props.context.onNodeDragOver;v.preventDefault(),v.stopPropagation(),s(v,Object(N.a)(m))},m.onDragLeave=function(v){var s=m.props.context.onNodeDragLeave;v.stopPropagation(),s(v,Object(N.a)(m))},m.onDragEnd=function(v){var s=m.props.context.onNodeDragEnd;v.stopPropagation(),m.setState({dragNodeHighlight:!1}),s(v,Object(N.a)(m))},m.onDrop=function(v){var s=m.props.context.onNodeDrop;v.preventDefault(),v.stopPropagation(),m.setState({dragNodeHighlight:!1}),s(v,Object(N.a)(m))},m.onExpand=function(v){var s=m.props.context.onNodeExpand;s(v,Object(d.b)(m.props))},m.setSelectHandle=function(v){m.selectHandle=v},m.getNodeState=function(){var v=m.props.expanded;return m.isLeaf()?null:v?l:i},m.hasChildren=function(){var v=m.props.eventKey,s=m.props.context.keyEntities,o=s[v]||{},E=o.children;return!!(E||[]).length},m.isLeaf=function(){var v=m.props,s=v.isLeaf,o=v.loaded,E=m.props.context.loadData,g=m.hasChildren();return s===!1?!1:s||!E&&!g||E&&o&&!g},m.isDisabled=function(){var v=m.props.disabled,s=m.props.context.disabled;return!!(s||v)},m.isCheckable=function(){var v=m.props.checkable,s=m.props.context.checkable;return!s||v===!1?!1:s},m.syncLoadData=function(v){var s=v.expanded,o=v.loading,E=v.loaded,g=m.props.context,O=g.loadData,M=g.onNodeLoad;if(o)return;O&&s&&!m.isLeaf()&&(!m.hasChildren()&&!E&&M(Object(d.b)(m.props)))},m.renderSwitcher=function(){var v=m.props,s=v.expanded,o=v.switcherIcon,E=m.props.context,g=E.prefixCls,O=E.switcherIcon,M=o||O;if(m.isLeaf())return R.createElement("span",{className:b()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof M=="function"?M(Object(I.a)(Object(I.a)({},m.props),{},{isLeaf:!0})):M);var k=b()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(s?l:i));return R.createElement("span",{onClick:m.onExpand,className:k},typeof M=="function"?M(Object(I.a)(Object(I.a)({},m.props),{},{isLeaf:!1})):M)},m.renderCheckbox=function(){var v=m.props,s=v.checked,o=v.halfChecked,E=v.disableCheckbox,g=m.props.context.prefixCls,O=m.isDisabled(),M=m.isCheckable();if(!M)return null;var k=typeof M!="boolean"?M:null;return R.createElement("span",{className:b()("".concat(g,"-checkbox"),s&&"".concat(g,"-checkbox-checked"),!s&&o&&"".concat(g,"-checkbox-indeterminate"),(O||E)&&"".concat(g,"-checkbox-disabled")),onClick:m.onCheck},k)},m.renderIcon=function(){var v=m.props.loading,s=m.props.context.prefixCls;return R.createElement("span",{className:b()("".concat(s,"-iconEle"),"".concat(s,"-icon__").concat(m.getNodeState()||"docu"),v&&"".concat(s,"-icon_loading"))})},m.renderSelector=function(){var v=m.state.dragNodeHighlight,s=m.props,o=s.title,E=s.selected,g=s.icon,O=s.loading,M=s.data,k=m.props.context,U=k.prefixCls,B=k.showIcon,y=k.icon,x=k.draggable,j=k.loadData,z=k.titleRender,Y=m.isDisabled(),$="".concat(U,"-node-content-wrapper"),ce;if(B){var se=g||y;ce=se?R.createElement("span",{className:b()("".concat(U,"-iconEle"),"".concat(U,"-icon__customize"))},typeof se=="function"?se(m.props):se):m.renderIcon()}else j&&O&&(ce=m.renderIcon());var ne;typeof o=="function"?ne=o(M):z?ne=z(M):ne=o;var re=R.createElement("span",{className:"".concat(U,"-title")},ne);return R.createElement("span",{ref:m.setSelectHandle,title:typeof o=="string"?o:"",className:b()("".concat($),"".concat($,"-").concat(m.getNodeState()||"normal"),!Y&&(E||v)&&"".concat(U,"-node-selected"),!Y&&x&&"draggable"),draggable:!Y&&x||void 0,"aria-grabbed":!Y&&x||void 0,onMouseEnter:m.onMouseEnter,onMouseLeave:m.onMouseLeave,onContextMenu:m.onContextMenu,onClick:m.onSelectorClick,onDoubleClick:m.onSelectorDoubleClick,onDragStart:x?m.onDragStart:void 0},ce,re)},m}return Object(L.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var v=this.props.selectable,s=this.props.context.selectable;return typeof v=="boolean"?v:s}},{key:"render",value:function(){var v,s=this.props,o=s.eventKey,E=s.className,g=s.style,O=s.dragOver,M=s.dragOverGapTop,k=s.dragOverGapBottom,U=s.isLeaf,B=s.isStart,y=s.isEnd,x=s.expanded,j=s.selected,z=s.checked,Y=s.halfChecked,$=s.loading,ce=s.domRef,se=s.active,ne=s.onMouseMove,re=Object(V.a)(s,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ue=this.props.context,ee=ue.prefixCls,ae=ue.filterTreeNode,ge=ue.draggable,Le=ue.keyEntities,ke=this.isDisabled(),De=Object(_.f)(re),Ue=Le[o]||{},Ie=Ue.level,Re=y[y.length-1];return R.createElement("div",Object.assign({ref:ce,className:b()(E,"".concat(ee,"-treenode"),(v={},Object(oe.a)(v,"".concat(ee,"-treenode-disabled"),ke),Object(oe.a)(v,"".concat(ee,"-treenode-switcher-").concat(x?"open":"close"),!U),Object(oe.a)(v,"".concat(ee,"-treenode-checkbox-checked"),z),Object(oe.a)(v,"".concat(ee,"-treenode-checkbox-indeterminate"),Y),Object(oe.a)(v,"".concat(ee,"-treenode-selected"),j),Object(oe.a)(v,"".concat(ee,"-treenode-loading"),$),Object(oe.a)(v,"".concat(ee,"-treenode-active"),se),Object(oe.a)(v,"".concat(ee,"-treenode-leaf-last"),Re),Object(oe.a)(v,"drag-over",!ke&&O),Object(oe.a)(v,"drag-over-gap-top",!ke&&M),Object(oe.a)(v,"drag-over-gap-bottom",!ke&&k),Object(oe.a)(v,"filter-node",ae&&ae(Object(d.b)(this.props))),v)),style:g,onDragEnter:ge?this.onDragEnter:void 0,onDragOver:ge?this.onDragOver:void 0,onDragLeave:ge?this.onDragLeave:void 0,onDrop:ge?this.onDrop:void 0,onDragEnd:ge?this.onDragEnd:void 0,onMouseMove:ne},De),R.createElement(a,{prefixCls:ee,level:Ie,isStart:B,isEnd:y}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(R.Component),S=function(w){return R.createElement(p.a.Consumer,null,function(A){return R.createElement(c,Object.assign({},w,{context:A}))})};S.displayName="TreeNode",S.defaultProps={title:u},S.isTreeNode=1;var C=Be.a=S},Y1PL:function(rt,Be,H){"use strict";H.r(Be),H.d(Be,"ResizableTextArea",function(){return Y});var oe=H("wx14"),V=H("1OyB"),I=H("vuIU"),K=H("Ji7U"),L=H("LK+K"),N=H("cDcd"),W=H("VTBJ"),F=H("rePB"),R=H("Zm9Q"),D=H("Kwbf"),b=H("c+Xe"),p=H("m+aA"),_=H("bdgK"),f=new Map;function a(se){se.forEach(function(ne){var re,ue=ne.target;(re=f.get(ue))===null||re===void 0||re.forEach(function(ee){return ee(ue)})})}var d=new _.default(a),l=null,i=null;function u(se,ne){f.has(se)||(f.set(se,new Set),d.observe(se)),f.get(se).add(ne)}function c(se,ne){f.has(se)&&(f.get(se).delete(ne),f.get(se).size||(d.unobserve(se),f.delete(se)))}var S=function(se){Object(K.a)(re,se);var ne=Object(L.a)(re);function re(){return Object(V.a)(this,re),ne.apply(this,arguments)}return Object(I.a)(re,[{key:"render",value:function(){return this.props.children}}]),re}(N.Component),C=N.createContext(null);function T(se){var ne=se.children,re=se.onBatchResize,ue=N.useRef(0),ee=N.useRef([]),ae=N.useContext(C),ge=N.useCallback(function(Le,ke,De){ue.current+=1;var Ue=ue.current;ee.current.push({size:Le,element:ke,data:De}),Promise.resolve().then(function(){Ue===ue.current&&(re==null||re(ee.current),ee.current=[])}),ae==null||ae(Le,ke,De)},[re,ae]);return N.createElement(C.Provider,{value:ge},ne)}function w(se){var ne=se.children,re=se.disabled,ue=N.useRef(null),ee=N.useRef(null),ae=N.useContext(C),ge=N.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Le=N.isValidElement(ne)&&Object(b.c)(ne),ke=Le?ne.ref:null,De=N.useMemo(function(){return Object(b.a)(ke,ue)},[ke,ue]),Ue=N.useRef(se);Ue.current=se;var Ie=N.useCallback(function(Re){var Ve=Ue.current,$e=Ve.onResize,Ze=Ve.data,Qe=Re.getBoundingClientRect(),Ke=Qe.width,st=Qe.height,it=Re.offsetWidth,ut=Re.offsetHeight,Je=Math.floor(Ke),_t=Math.floor(st);if(ge.current.width!==Je||ge.current.height!==_t||ge.current.offsetWidth!==it||ge.current.offsetHeight!==ut){var gt={width:Je,height:_t,offsetWidth:it,offsetHeight:ut};ge.current=gt;var mt=it===Math.round(Ke)?Ke:it,We=ut===Math.round(st)?st:ut,Et=Object(W.a)(Object(W.a)({},gt),{},{offsetWidth:mt,offsetHeight:We});ae==null||ae(Et,Re,Ze),$e&&Promise.resolve().then(function(){$e(Et,Re)})}},[]);return N.useEffect(function(){var Re=Object(p.a)(ue.current)||Object(p.a)(ee.current);return Re&&!re&&u(Re,Ie),function(){return c(Re,Ie)}},[ue.current,re]),N.createElement(S,{ref:ee},Le?N.cloneElement(ne,{ref:De}):ne)}var A="rc-observer-key";function m(se){var ne=se.children,re=Object(R.a)(ne);return re.map(function(ue,ee){var ae=(ue==null?void 0:ue.key)||"".concat(A,"-").concat(ee);return N.createElement(w,Object(oe.a)({},se,{key:ae}),ue)})}m.Collection=T;var v=m,s=H("bT9E"),o=H("TSYQ"),E=H.n(o),g=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,O=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],M={},k;function U(se){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,re=se.getAttribute("id")||se.getAttribute("data-reactid")||se.getAttribute("name");if(ne&&M[re])return M[re];var ue=window.getComputedStyle(se),ee=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),ge=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),Le=O.map(function(De){return"".concat(De,":").concat(ue.getPropertyValue(De))}).join(";"),ke={sizingStyle:Le,paddingSize:ae,borderSize:ge,boxSizing:ee};return ne&&re&&(M[re]=ke),ke}function B(se){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;k||(k=document.createElement("textarea"),k.setAttribute("tab-index","-1"),k.setAttribute("aria-hidden","true"),document.body.appendChild(k)),se.getAttribute("wrap")?k.setAttribute("wrap",se.getAttribute("wrap")):k.removeAttribute("wrap");var ee=U(se,ne),ae=ee.paddingSize,ge=ee.borderSize,Le=ee.boxSizing,ke=ee.sizingStyle;k.setAttribute("style","".concat(ke,";").concat(g)),k.value=se.value||se.placeholder||"";var De=Number.MIN_SAFE_INTEGER,Ue=Number.MAX_SAFE_INTEGER,Ie=k.scrollHeight,Re;if(Le==="border-box"?Ie+=ge:Le==="content-box"&&(Ie-=ae),re!==null||ue!==null){k.value=" ";var Ve=k.scrollHeight-ae;re!==null&&(De=Ve*re,Le==="border-box"&&(De=De+ae+ge),Ie=Math.max(De,Ie)),ue!==null&&(Ue=Ve*ue,Le==="border-box"&&(Ue=Ue+ae+ge),Re=Ie>Ue?"":"hidden",Ie=Math.min(Ue,Ie))}return{height:Ie,minHeight:De,maxHeight:Ue,overflowY:Re,resize:"none"}}var y=H("Gytx"),x=H.n(y),j;(function(se){se[se.NONE=0]="NONE",se[se.RESIZING=1]="RESIZING",se[se.RESIZED=2]="RESIZED"})(j||(j={}));var z=function(se){Object(K.a)(re,se);var ne=Object(L.a)(re);function re(ue){var ee;return Object(V.a)(this,re),ee=ne.call(this,ue),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(ae){ee.textArea=ae},ee.handleResize=function(ae){var ge=ee.state.resizeStatus,Le=ee.props,ke=Le.autoSize,De=Le.onResize;if(ge!==j.NONE)return;typeof De=="function"&&De(ae),ke&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var ae=ee.props.autoSize;if(!ae||!ee.textArea)return;var ge=ae.minRows,Le=ae.maxRows,ke=B(ee.textArea,!1,ge,Le);ee.setState({textareaStyles:ke,resizeStatus:j.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:j.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:j.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var ae=ee.props,ge=ae.prefixCls,Le=ge===void 0?"rc-textarea":ge,ke=ae.autoSize,De=ae.onResize,Ue=ae.className,Ie=ae.disabled,Re=ee.state,Ve=Re.textareaStyles,$e=Re.resizeStatus,Ze=Object(s.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Qe=E()(Le,Ue,Object(F.a)({},"".concat(Le,"-disabled"),Ie));"value"in Ze&&(Ze.value=Ze.value||"");var Ke=Object(W.a)(Object(W.a)(Object(W.a)({},ee.props.style),Ve),$e===j.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return N.createElement(v,{onResize:ee.handleResize,disabled:!(ke||De)},N.createElement("textarea",Object(oe.a)({},Ze,{className:Qe,style:Ke,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:j.NONE},ee}return Object(I.a)(re,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!x()(ee.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 ee=this.textArea.selectionStart,ae=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,ae)}}catch(ge){}}},{key:"render",value:function(){return this.renderTextArea()}}]),re}(N.Component),Y=z,$=function(se){Object(K.a)(re,se);var ne=Object(L.a)(re);function re(ue){var ee;Object(V.a)(this,re),ee=ne.call(this,ue),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(ge){ee.resizableTextArea=ge},ee.handleChange=function(ge){var Le=ee.props.onChange;ee.setValue(ge.target.value,function(){ee.resizableTextArea.resizeTextarea()}),Le&&Le(ge)},ee.handleKeyDown=function(ge){var Le=ee.props,ke=Le.onPressEnter,De=Le.onKeyDown;ge.keyCode===13&&ke&&ke(ge),De&&De(ge)};var ae=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return ee.state={value:ae},ee}return Object(I.a)(re,[{key:"setValue",value:function(ee,ae){"value"in this.props||this.setState({value:ee},ae)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return N.createElement(Y,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ee){return"value"in ee?{value:ee.value}:null}}]),re}(N.Component),ce=Be.default=$},ZW9T:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return B});var oe=H("k1fw"),V=H("miYZ"),I=H("tsqr"),K=H("rAM+"),L=H("tJVT"),N=H("PpiC"),W=H("cDcd"),F=H.n(W),R=H("bdgK"),D=H("oBTY"),b=H("9og8"),p=H("WmNS"),_=H.n(p),f={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},a={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},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 <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},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(`
|
|
`)}]},i=H("5VLF"),u=H.n(i),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"]}},S=function(x,j){return j.map(function(z){return{label:z,kind:x.languages.CompletionItemKind.Keyword,insertText:z}})},C=function(x){return Object.keys(c.tables).map(function(j){return{label:j,kind:x.languages.CompletionItemKind.Variable,insertText:j}})},T=function(x,j){var z=c.tables[x];return z?z.map(function(Y){return{label:Y,kind:j.languages.CompletionItemKind.Field,insertText:Y}}):[]};function w(y,x,j,z,Y){var $=x.getWordUntilPosition(j),ce={startLineNumber:j.lineNumber,endLineNumber:j.lineNumber,startColumn:$.startColumn,endColumn:$.endColumn},se=z.map(function(ne){return{label:ne,kind:y.languages.CompletionItemKind.Keyword,insertText:ne,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return Y.map(function(ne){se.push(Object(oe.a)(Object(oe.a)({},ne),{},{range:ce}))}),se}var A=function(y){c.languages.map(function(Y){return y.languages.registerDocumentFormattingEditProvider(Y,{provideDocumentFormattingEdits:function(ce,se,ne){return Object(b.a)(_.a.mark(function re(){var ue;return _.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ue=u()(ce.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}),ae.abrupt("return",[{range:ce.getFullModelRange(),text:ue}]);case 2:case"end":return ae.stop()}},re)}))()}}),Y});var x=d.quickKey.map(function(Y){return{label:Y.label,kind:y.languages.CompletionItemKind.Method,insertText:Y.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),j=l.quickKey.map(function(Y){return{label:Y.label,kind:y.languages.CompletionItemKind.Method,insertText:Y.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=a.quickKey.map(function(Y){return{label:Y.label,kind:y.languages.CompletionItemKind.Method,insertText:Y.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(D.a)(d.keywords),Object(D.a)(d.quickKey.map(function(Y){return Y.label}))),provideCompletionItems:function($,ce){var se=$.getValueInRange({startLineNumber:ce.lineNumber,startColumn:1,endLineNumber:ce.lineNumber,endColumn:ce.column}),ne=se.match(/cu/gim);console.log("match:",ne,ce,se,$);var re=[],ue=ce.lineNumber,ee=ce.column,ae=$.getValueInRange({startLineNumber:ue,startColumn:0,endLineNumber:ue,endColumn:ee}),ge=ae.trim().split(/\s+/),Le=ge[ge.length-1];if(Le.endsWith(".")){var ke=Le.slice(0,Le.length-1);Object.keys(c.tables).includes(ke)&&(re=Object(D.a)(T(ke,y)))}else Le==="."?re=[]:re=[].concat(Object(D.a)(C(y)),Object(D.a)(S(y,d.keywords)),Object(D.a)(x));return{suggestions:re}}}),y.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(D.a)(f.keywords)),provideCompletionItems:function($,ce){var se=$.getValueInRange({startLineNumber:ce.lineNumber,startColumn:1,endLineNumber:ce.lineNumber,endColumn:ce.column}),ne=se.match(/cu/gim);console.log("match:",ne,ce,se,$);var re=[],ue=ce.lineNumber,ee=ce.column,ae=$.getValueInRange({startLineNumber:ue,startColumn:0,endLineNumber:ue,endColumn:ee}),ge=ae.trim().split(/\s+/),Le=ge[ge.length-1];if(Le.endsWith(".")){var ke=Le.slice(0,Le.length-1);Object.keys(c.tables).includes(ke)&&(re=Object(D.a)(T(ke,y)))}else Le==="."?re=[]:re=[].concat(Object(D.a)(C(y)),Object(D.a)(S(y,f.keywords)));return{suggestions:re}}}),y.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(D.a)(a.keywords)),provideCompletionItems:function($,ce){var se=[],ne=ce.lineNumber,re=ce.column,ue=$.getValueInRange({startLineNumber:ne,startColumn:0,endLineNumber:ne,endColumn:re}),ee=ue.trim().split(/\s+/),ae=ee[ee.length-1];if(ae.endsWith(".")){var ge=ae.slice(0,ae.length-1);Object.keys(c.tables).includes(ge)&&(se=Object(D.a)(T(ge,y)))}else ae==="."?se=[]:se=[].concat(Object(D.a)(C(y)),Object(D.a)(S(y,a.keywords)),Object(D.a)(z));return{suggestions:se}}}),y.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(D.a)(l.keywords)),provideCompletionItems:function($,ce){var se=[],ne=ce.lineNumber,re=ce.column,ue=$.getValueInRange({startLineNumber:ne,startColumn:0,endLineNumber:ne,endColumn:re}),ee=ue.trim().split(/\s+/),ae=ee[ee.length-1];if(ae.endsWith(".")){var ge=ae.slice(0,ae.length-1);Object.keys(c.tables).includes(ge)&&(se=Object(D.a)(T(ge,y)))}else ae==="."?se=[]:se=[].concat(Object(D.a)(C(y)),Object(D.a)(S(y,l.keywords)),Object(D.a)(j));return{suggestions:se}}})},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=H("LvDl"),s=H("+ua5");function o(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function E(){}var g=!1,O={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function M(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],x=y;if(Array.isArray(y)){for(var j=0;j<y.length;j++){var z=O[y[j]];if(z)return z}return x[0]}return O[x]||x}var k=null,U=Be.b=function(y){var x=y.width,j=x===void 0?"100%":x,z=y.height,Y=z===void 0?"100%":z,$=y.value,ce=y.language,se=ce===void 0?"javascript":ce,ne=y.style,re=ne===void 0?{}:ne,ue=y.options,ee=ue===void 0?{}:ue,ae=y.overrideServices,ge=ae===void 0?{}:ae,Le=y.theme,ke=Le===void 0?"vs-dark":Le,De=y.onEditBlur,Ue=y.onSave,Ie=y.autoHeight,Re=Ie===void 0?!1:Ie,Ve=y.forbidCopy,$e=Ve===void 0?!1:Ve,Ze=y.onChange,Qe=Ze===void 0?E:Ze,Ke=y.editorDidMount,st=Ke===void 0?E:Ke,it=y.onFocus,ut=it===void 0?E:it,Je=y.filename,_t=Je===void 0?"educoder.txt":Je,gt=y.errorLine,mt=y.errorContent,We=mt===void 0?"":mt,Et=Object(N.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ht=Object(W.useRef)(),Ne=Object(W.useRef)({}),nt=Object(W.useRef)(),me=Object(W.useRef)(!1),ve=Object(W.useRef)(),le=Object(W.useState)(!1),q=Object(L.a)(le,2),ie=q[0],fe=q[1];function Ee(){var Jt;return ht.current&&(Jt=new R.default(function(ln){var _n=Object(K.a)(ln),qn;try{for(_n.s();!(qn=_n.n()).done;){var Er=qn.value;(Er.target.offsetHeight>0||Er.target.offsetWidth>0)&&Ne.current.instance.layout()}}catch(Ir){_n.e(Ir)}finally{_n.f()}}),Jt.observe(ht.current)),Jt}function Oe(){I.b.warn(decodeURIComponent(m))}var Ge=function(){var ln=Ne.current.instance;if($!=null&&ln&&ie){var _n=ln.getModel();_n&&$!==_n.getValue()&&(g=!0,_n.setValue($),ln.layout(),g=!1)}};Object(W.useEffect)(function(){nt.current&&clearTimeout(nt.current),nt.current=setTimeout(function(){Ge()},500)},[$,ie,Ne.current]),Object(W.useEffect)(function(){if(gt&&Ne.current&&Ne.current.instance){var Jt=Ne.current.instance;Jt.changeViewZones(function(_n){var qn=document.createElement("div");qn.style.padding="10px 20px",qn.style.width="calc(100% - 20px)",qn.className="my-error-line-wrp",qn.innerHTML=We,_n.addZone({afterLineNumber:gt||11,heightInLines:3,domNode:qn})});var ln={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}};Jt.addOverlayWidget(ln),Jt.revealPositionInCenter({lineNumber:20,column:1})}},[gt,Ne.current,ie]);function tt(){var Jt=Ne.current.instance;if(Jt){var ln=Jt.getSelection(),_n=Ne.current.pastePos||{},qn=new k.Range(_n.startLineNumber||ln.endLineNumber,_n.startColumn||ln.endColumn,_n.endLineNumber||ln.endLineNumber,_n.endColumn||ln.endColumn);setTimeout(function(){Jt.executeEdits("",[{range:qn,text:""}])},300)}}function Tt(Jt){(window.navigator.platform.match("Mac")?Jt.metaKey:Jt.ctrlKey)&&Jt.keyCode==83&&(Jt.preventDefault(),Ue())}var jt=function(){if(Re&&Ne.current.instance){var ln=Ne.current.instance.getContentHeight();Ar(ln<Y?Y:ln)}else Ar(Y)};function Ft(Jt){var ln=document.createEvent("MouseEvents");ln.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Jt.dispatchEvent(ln)}function In(Jt,ln){var _n=window.URL||window.webkitURL||window,qn=new Blob([ln]),Er=document.createElementNS("http://www.w3.org/1999/xhtml","a");Er.href=_n.createObjectURL(qn),Er.download=Jt,Ft(Er)}Object(W.useEffect)(function(){jt()},[jt]),Object(W.useEffect)(function(){ht.current&&!ie&&H.e(27).then(H.t.bind(null,"M/lh",7)).then(function(Jt){try{k=Jt,Ne.current.instance=k.editor.create(ht.current,{value:$,language:M(se),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},ge);var ln=Ne.current.instance;if(st(ln,k),setTimeout(function(){jt(),Ne.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){In(_t||"educoder.txt",ln.getValue())}})},500),Ne.current.subscription=ln.onDidChangeModelContent(function(qn){me.current?clearTimeout(ve.current):(jt(),Qe(ln.getValue(),qn)),ve.current=setTimeout(function(){me.current=!1},500)}),window.Monaco||A(k),$e&&(ln.addCommand(k.KeyMod.CtrlCmd|k.KeyMod.Shift|k.KeyCode.KEY_V,function(){return Oe(),null}),ln.addCommand(k.KeyMod.CtrlCmd|k.KeyCode.KEY_C,function(){return Oe(),null})),window.Monaco=k,De&&ln.onDidBlurEditorWidget(function(){De(ln.getValue())}),ut&&ln.onDidFocusEditorText(function(){ut(ln.getValue())}),$e){ln.addCommand(k.KeyMod.CtrlCmd|k.KeyCode.KEY_V,function(){return Oe(),null}),ln.onDidPaste(function(qn){Ne.current.pastePos=qn});try{window.addEventListener("paste",tt)}catch(qn){}}var _n=Ee();return fe(!0),function(){var qn=Ne.current.instance;qn.dispose();var Er=qn.getModel();Er&&Er.dispose(),Ne.current.subscription&&Ne.current.subscription.dispose(),$e&&window.removeEventListener("paste",tt),_n.unobserve(ht.current)}}catch(qn){}})},[]),Object(W.useEffect)(function(){var Jt=Ne.current.instance;if(Jt&&ie)return document.addEventListener("keydown",Tt,!1),function(){document.removeEventListener("keydown",Tt)}},[Ue,ie]),Object(W.useEffect)(function(){var Jt=Ne.current.instance;if(Jt&&ie){var ln=M(se);k.editor.setModelLanguage(Jt.getModel(),ln),console.log("language:",se,Jt.getModel(),ln)}},[se,ie]),Object(W.useEffect)(function(){var Jt=Ne.current.instance;Jt&&ie&&k.editor.setTheme(ke)},[ke,ie]),Object(W.useEffect)(function(){var Jt=Ne.current.instance;Jt&&ie&&(Jt.updateOptions(Object(oe.a)({},ee)),setTimeout(function(){Jt.getModel().updateOptions(Object(oe.a)({},ee))},200))},[JSON.stringify(ee),ie]),Object(W.useEffect)(function(){var Jt=Ne.current.instance;Jt&&ie&&Jt.layout()},[j,Y,ie]);var sn=Object(W.useState)(o(j)),Wt=Object(L.a)(sn,2),Qn=Wt[0],mn=Wt[1],yr=Object(W.useState)(o(Y)),hr=Object(L.a)(yr,2),En=hr[0],Ar=hr[1],br=Object(oe.a)(Object(oe.a)({},re),{},{width:Qn,height:En});return F.a.createElement("div",{className:"my-monaco-editor",ref:ht,style:br})};function B(y){var x=y.width,j=x===void 0?"100%":x,z=y.height,Y=z===void 0?"100%":z,$=y.original,ce=y.modified,se=y.language,ne=y.options,re=ne===void 0?{}:ne,ue=Object(W.useRef)(),ee=Object(W.useState)(null),ae=Object(L.a)(ee,2),ge=ae[0],Le=ae[1];function ke(Re){var Ve;return ue.current&&(Ve=new R.default(function($e){var Ze=Object(K.a)($e),Qe;try{for(Ze.s();!(Qe=Ze.n()).done;){var Ke=Qe.value;(Ke.target.offsetHeight>0||Ke.target.offsetWidth>0)&&Re.layout()}}catch(st){Ze.e(st)}finally{Ze.f()}}),Ve.observe(ue.current)),Ve}Object(W.useEffect)(function(){ue.current&&H.e(27).then(H.t.bind(null,"M/lh",7)).then(function(Re){k=Re;var Ve=k.editor.createDiffEditor(ue.current,Object(oe.a)(Object(oe.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},re),{},{wordWrap:!0}));Le(Ve);var $e=ke(Ve);return function(){Ve.dispose();var Ze=Ve.getModel();Ze&&Ze.dispose(),$e.unobserve(ue.current)}})},[]),Object(W.useEffect)(function(){ge&&ge.setModel({original:k.editor.createModel($,se),modified:k.editor.createModel(ce,se)})},[$,ce,se,ge]);var De=o(j),Ue=o(Y),Ie={width:De,height:Ue};return F.a.createElement("div",{className:"my-diff-editor",ref:ue,style:Ie})}},ZpRC:function(rt,Be,H){"use strict";function oe(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function V(b,p){return(!p||b!=="hidden")&&b!=="visible"&&b!=="clip"}function I(b,p){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var _=getComputedStyle(b,null);return V(_.overflowY,p)||V(_.overflowX,p)||function(f){var a=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(l){return null}}(f);return!!a&&(a.clientHeight<f.scrollHeight||a.clientWidth<f.scrollWidth)}(b)}return!1}function K(b,p,_,f,a,d,l,i){return d<b&&l>p||d>b&&l<p?0:d<=b&&i<=_||l>=p&&i>=_?d-b-f:l>p&&i<_||d<b&&i>_?l-p+a:0}var L=function(b,p){var _=window,f=p.scrollMode,a=p.block,d=p.inline,l=p.boundary,i=p.skipOverflowHiddenElements,u=typeof l=="function"?l:function(Ve){return Ve!==l};if(!oe(b))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,S=[],C=b;oe(C)&&u(C);){if((C=C.parentElement)===c){S.push(C);break}C!=null&&C===document.body&&I(C)&&!I(document.documentElement)||C!=null&&I(C,i)&&S.push(C)}for(var T=_.visualViewport?_.visualViewport.width:innerWidth,w=_.visualViewport?_.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,v=b.getBoundingClientRect(),s=v.height,o=v.width,E=v.top,g=v.right,O=v.bottom,M=v.left,k=a==="start"||a==="nearest"?E:a==="end"?O:E+s/2,U=d==="center"?M+o/2:d==="end"?g:M,B=[],y=0;y<S.length;y++){var x=S[y],j=x.getBoundingClientRect(),z=j.height,Y=j.width,$=j.top,ce=j.right,se=j.bottom,ne=j.left;if(f==="if-needed"&&E>=0&&M>=0&&O<=w&&g<=T&&E>=$&&O<=se&&M>=ne&&g<=ce)return B;var re=getComputedStyle(x),ue=parseInt(re.borderLeftWidth,10),ee=parseInt(re.borderTopWidth,10),ae=parseInt(re.borderRightWidth,10),ge=parseInt(re.borderBottomWidth,10),Le=0,ke=0,De="offsetWidth"in x?x.offsetWidth-x.clientWidth-ue-ae:0,Ue="offsetHeight"in x?x.offsetHeight-x.clientHeight-ee-ge:0;if(c===x)Le=a==="start"?k:a==="end"?k-w:a==="nearest"?K(m,m+w,w,ee,ge,m+k,m+k+s,s):k-w/2,ke=d==="start"?U:d==="center"?U-T/2:d==="end"?U-T:K(A,A+T,T,ue,ae,A+U,A+U+o,o),Le=Math.max(0,Le+m),ke=Math.max(0,ke+A);else{Le=a==="start"?k-$-ee:a==="end"?k-se+ge+Ue:a==="nearest"?K($,se,z,ee,ge+Ue,k,k+s,s):k-($+z/2)+Ue/2,ke=d==="start"?U-ne-ue:d==="center"?U-(ne+Y/2)+De/2:d==="end"?U-ce+ae+De:K(ne,ce,Y,ue,ae+De,U,U+o,o);var Ie=x.scrollLeft,Re=x.scrollTop;k+=Re-(Le=Math.max(0,Math.min(Re+Le,x.scrollHeight-z+Ue))),U+=Ie-(ke=Math.max(0,Math.min(Ie+ke,x.scrollWidth-Y+De)))}B.push({el:x,top:Le,left:ke})}return B};function N(b){return b===Object(b)&&Object.keys(b).length!==0}function W(b,p){p===void 0&&(p="auto");var _="scrollBehavior"in document.body.style;b.forEach(function(f){var a=f.el,d=f.top,l=f.left;a.scroll&&_?a.scroll({top:d,left:l,behavior:p}):(a.scrollTop=d,a.scrollLeft=l)})}function F(b){return b===!1?{block:"end",inline:"nearest"}:N(b)?b:{block:"start",inline:"nearest"}}function R(b,p){var _=!b.ownerDocument.documentElement.contains(b);if(N(p)&&typeof p.behavior=="function")return p.behavior(_?[]:L(b,p));if(_)return;var f=F(p);return W(L(b,f),f.behavior)}var D=Be.a=R},"a+yL":function(rt,Be,H){rt.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return V});var oe=H("VTBJ");function V(I,K){var L=Object(oe.a)({},I);return Array.isArray(K)&&K.forEach(function(N){delete L[N]}),L}},c5Ni:function(rt,Be,H){},d5o6:function(rt,Be,H){rt.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(rt,Be,H){},dmUQ:function(rt,Be,H){"use strict";var oe=H("Ff2n"),V=H("rePB"),I=H("1OyB"),K=H("vuIU"),L=H("Ji7U"),N=H("md7G"),W=H("foSv"),F=H("cDcd"),R=H.n(F),D=H("TSYQ"),b=H.n(D),p=H("4IlW");function _(s,o){var E=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);o&&(g=g.filter(function(O){return Object.getOwnPropertyDescriptor(s,O).enumerable})),E.push.apply(E,g)}return E}function f(s){for(var o=1;o<arguments.length;o++){var E=arguments[o]!=null?arguments[o]:{};o%2?_(Object(E),!0).forEach(function(g){Object(V.a)(s,g,E[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(E)):_(Object(E)).forEach(function(g){Object.defineProperty(s,g,Object.getOwnPropertyDescriptor(E,g))})}return s}function a(s){var o=d();return function(){var g=Object(W.a)(s),O;if(o){var M=Object(W.a)(this).constructor;O=Reflect.construct(g,arguments,M)}else O=g.apply(this,arguments);return Object(N.a)(this,O)}}function d(){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(s){return!1}}function l(){}function i(s){s.preventDefault()}var u=function(o){return o.replace(/[^\w.-]+/g,"")},c=200,S=600,C=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(o){return o!=null},w=function(o,E){return E===o||typeof E=="number"&&typeof o=="number"&&isNaN(E)&&isNaN(o)},A=function(s){Object(L.a)(E,s);var o=a(E);function E(g){var O;Object(I.a)(this,E),O=o.call(this,g),O.onKeyDown=function(U){var B=O.props,y=B.onKeyDown,x=B.onPressEnter;if(U.keyCode===p.a.UP){var j=O.getRatio(U);O.up(U,j,null),O.stop()}else if(U.keyCode===p.a.DOWN){var z=O.getRatio(U);O.down(U,z,null),O.stop()}else U.keyCode===p.a.ENTER&&x&&x(U);if(O.recordCursorPosition(),O.lastKeyCode=U.keyCode,y){for(var Y=arguments.length,$=new Array(Y>1?Y-1:0),ce=1;ce<Y;ce++)$[ce-1]=arguments[ce];y.apply(void 0,[U].concat($))}},O.onKeyUp=function(U){var B=O.props.onKeyUp;if(O.stop(),O.recordCursorPosition(),B){for(var y=arguments.length,x=new Array(y>1?y-1:0),j=1;j<y;j++)x[j-1]=arguments[j];B.apply(void 0,[U].concat(x))}},O.onChange=function(U){var B=O.props.onChange;O.state.focused&&(O.inputting=!0),O.rawInput=O.props.parser(O.getValueFromEvent(U)),O.setState({inputValue:O.rawInput}),B(O.toNumber(O.rawInput))},O.onMouseUp=function(){var U=O.props.onMouseUp;O.recordCursorPosition(),U&&U.apply(void 0,arguments)},O.onFocus=function(){var U;O.setState({focused:!0}),(U=O.props).onFocus.apply(U,arguments)},O.onBlur=function(){var U=O.props.onBlur;O.inputting=!1,O.setState({focused:!1});var B=O.getCurrentValidValue(O.state.inputValue),y=O.setValue(B,l);if(U){var x=O.input.value,j=O.getInputDisplayValue({focus:!1,value:y});O.input.value=j&&Number(j),U.apply(void 0,arguments),O.input.value=x}},O.getRatio=function(U){var B=1;return U.metaKey||U.ctrlKey?B=.1:U.shiftKey&&(B=10),B},O.getFullNum=function(U){return isNaN(U)?U:/e/i.test(String(U))?Number(U).toFixed(18).replace(/\.?0+$/,""):U},O.getPrecision=function(U){if(T(O.props.precision))return O.props.precision;var B=String(U);if(B.indexOf("e-")>=0)return parseInt(B.slice(B.indexOf("e-")+2),10);var y=0;return B.indexOf(".")>=0&&(y=B.length-B.indexOf(".")-1),y},O.getInputDisplayValue=function(U){var B=U||O.state,y=B.focused,x=B.inputValue,j=B.value,z;y?z=x:z=O.toPrecisionAsStep(j),z==null&&(z="");var Y=O.formatWrapper(z);return T(O.props.decimalSeparator)&&(Y=Y.toString().replace(".",O.props.decimalSeparator)),Y},O.recordCursorPosition=function(){try{O.cursorStart=O.input.selectionStart,O.cursorEnd=O.input.selectionEnd,O.currentValue=O.input.value,O.cursorBefore=O.input.value.substring(0,O.cursorStart),O.cursorAfter=O.input.value.substring(O.cursorEnd)}catch(U){}},O.restoreByAfter=function(U){if(U===void 0)return!1;var B=O.input.value,y=B.lastIndexOf(U);if(y===-1)return!1;var x=O.cursorBefore.length;return O.lastKeyCode===p.a.DELETE&&O.cursorBefore.charAt(x-1)===U[0]?(O.fixCaret(x,x),!0):y+U.length===B.length?(O.fixCaret(y,y),!0):!1},O.partRestoreByAfter=function(U){return U===void 0?!1:Array.prototype.some.call(U,function(B,y){var x=U.substring(y);return O.restoreByAfter(x)})},O.isNotCompleteNumber=function(U){return isNaN(U)||U===""||U===null||U&&U.toString().indexOf(".")===U.toString().length-1},O.stop=function(){O.autoStepTimer&&clearTimeout(O.autoStepTimer)},O.down=function(U,B,y){O.pressingUpOrDown=!0,O.step("down",U,B,y)},O.up=function(U,B,y){O.pressingUpOrDown=!0,O.step("up",U,B,y)},O.saveInput=function(U){O.input=U};var M=g.value;M===void 0&&(M=g.defaultValue),O.state={focused:g.autoFocus};var k=O.getValidValue(O.toNumber(M));return O.state=f(f({},O.state),{},{inputValue:O.toPrecisionAsStep(k),value:k}),O}return Object(K.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(O){var M=this.props,k=M.value,U=M.onChange,B=M.max,y=M.min,x=this.state.focused;if(O){if(!w(O.value,k)||!w(O.max,B)||!w(O.min,y)){var j=x?k:this.getValidValue(k),z;this.pressingUpOrDown?z=j:this.inputting?z=this.rawInput:z=this.toPrecisionAsStep(j),this.setState({value:j,inputValue:z})}var Y="value"in this.props?k:this.state.value;"max"in this.props&&O.max!==B&&typeof Y=="number"&&Y>B&&U&&U(B),"min"in this.props&&O.min!==y&&typeof Y=="number"&&Y<y&&U&&U(y)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var $=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?$=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&($=this.cursorStart):$=this.input.value.length,this.fixCaret($,$)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ce){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(O){var M=O;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(O){var M=O.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,U=parseFloat(O);return isNaN(U)?O:(U<M&&(U=M),U>k&&(U=k),U)}},{key:"setValue",value:function(O,M){var k=this.props.precision,U=this.isNotCompleteNumber(parseFloat(O))?null:parseFloat(O),B=this.state.value,y=B===void 0?null:B,x=this.state.inputValue,j=x===void 0?null:x,z=typeof U=="number"?U.toFixed(k):"".concat(U),Y=U!==y||z!=="".concat(j);return"value"in this.props?(j=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:j},M)):this.setState({value:U,inputValue:this.toPrecisionAsStep(O)},M),Y&&this.props.onChange(U),U}},{key:"getMaxPrecision",value:function(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,k=this.props,U=k.precision,B=k.step;if(T(U))return U;var y=this.getPrecision(M),x=this.getPrecision(B),j=this.getPrecision(O);return O?Math.max(j,y+x):y+x}},{key:"getPrecisionFactor",value:function(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,k=this.getMaxPrecision(O,M);return Math.pow(10,k)}},{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(O){return this.props.formatter?this.props.formatter(O):O}},{key:"toPrecisionAsStep",value:function(O){if(this.isNotCompleteNumber(O)||O==="")return O;var M=Math.abs(this.getMaxPrecision(O));return isNaN(M)?O.toString():Number(O).toFixed(M)}},{key:"toNumber",value:function(O){var M=this.props.precision,k=this.state.focused,U=O&&O.length>16&&k;return this.isNotCompleteNumber(O)||U?O:T(M)?Math.round(O*Math.pow(10,M))/Math.pow(10,M):Number(O)}},{key:"upStep",value:function(O,M){var k=this.props.step,U=this.getPrecisionFactor(O,M),B=Math.abs(this.getMaxPrecision(O,M)),y=((U*O+U*k*M)/U).toFixed(B);return this.toNumber(y)}},{key:"downStep",value:function(O,M){var k=this.props.step,U=this.getPrecisionFactor(O,M),B=Math.abs(this.getMaxPrecision(O,M)),y=((U*O-U*k*M)/U).toFixed(B);return this.toNumber(y)}},{key:"step",value:function(O,M){var k=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,B=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var y=this.props;if(y.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var j=this["".concat(O,"Step")](x,U),z=j>y.max||j<y.min;if(j>y.max?j=y.max:j<y.min&&(j=y.min),this.setValue(j,null),this.setState({focused:!0},function(){k.pressingUpOrDown=!1}),z)return;this.autoStepTimer=setTimeout(function(){k[O](M,U,!0)},B?c:S)}},{key:"fixCaret",value:function(O,M){if(O===void 0||M===void 0||!this.input||!this.input.value)return;try{var k=this.input.selectionStart,U=this.input.selectionEnd;(O!==k||M!==U)&&this.input.setSelectionRange(O,M)}catch(B){}}},{key:"render",value:function(){var O,M=this.props,k=M.prefixCls,U=M.disabled,B=M.readOnly,y=M.useTouch,x=M.autoComplete,j=M.upHandler,z=M.downHandler,Y=M.className,$=M.max,ce=M.min,se=M.style,ne=M.title,re=M.onMouseEnter,ue=M.onMouseLeave,ee=M.onMouseOver,ae=M.onMouseOut,ge=M.required,Le=M.onClick,ke=M.tabIndex,De=M.type,Ue=M.placeholder,Ie=M.id,Re=M.inputMode,Ve=M.pattern,$e=M.step,Ze=M.maxLength,Qe=M.autoFocus,Ke=M.name,st=M.onPaste,it=M.onInput,ut=Object(oe.a)(M,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Je=this.state,_t=Je.value,gt=Je.focused,mt=b()(k,(O={},Object(V.a)(O,Y,!!Y),Object(V.a)(O,"".concat(k,"-disabled"),U),Object(V.a)(O,"".concat(k,"-focused"),gt),O)),We={};Object.keys(ut).forEach(function(Ee){(Ee.substr(0,5)==="data-"||Ee.substr(0,5)==="aria-"||Ee==="role")&&(We[Ee]=ut[Ee])});var Et=!B&&!U,ht=this.getInputDisplayValue(null),Ne=(_t||_t===0)&&(isNaN(_t)||Number(_t)>=$),nt=(_t||_t===0)&&(isNaN(_t)||Number(_t)<=ce),me=Ne||U||B,ve=nt||U||B,le=b()("".concat(k,"-handler"),"".concat(k,"-handler-up"),Object(V.a)({},"".concat(k,"-handler-up-disabled"),me)),q=b()("".concat(k,"-handler"),"".concat(k,"-handler-down"),Object(V.a)({},"".concat(k,"-handler-down-disabled"),ve)),ie=y?{onTouchStart:me?l:this.up,onTouchEnd:this.stop}:{onMouseDown:me?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},fe=y?{onTouchStart:ve?l:this.down,onTouchEnd:this.stop}:{onMouseDown:ve?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return R.a.createElement("div",{className:mt,style:se,title:ne,onMouseEnter:re,onMouseLeave:ue,onMouseOver:ee,onMouseOut:ae,onFocus:function(){return null},onBlur:function(){return null}},R.a.createElement("div",{className:"".concat(k,"-handler-wrap")},R.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":me,className:le}),j||R.a.createElement("span",{unselectable:"on",className:"".concat(k,"-handler-up-inner"),onClick:i})),R.a.createElement("span",Object.assign({unselectable:"on"},fe,{role:"button","aria-label":"Decrease Value","aria-disabled":ve,className:q}),z||R.a.createElement("span",{unselectable:"on",className:"".concat(k,"-handler-down-inner"),onClick:i}))),R.a.createElement("div",{className:"".concat(k,"-input-wrap")},R.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ce,"aria-valuemax":$,"aria-valuenow":_t,required:ge,type:De,placeholder:Ue,onPaste:st,onClick:Le,onMouseUp:this.onMouseUp,className:"".concat(k,"-input"),tabIndex:ke,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Et?this.onKeyDown:l,onKeyUp:Et?this.onKeyUp:l,autoFocus:Qe,maxLength:Ze,readOnly:B,disabled:U,max:$,min:ce,step:$e,name:Ke,title:ne,id:Ie,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ht),pattern:Ve,inputMode:Re,onInput:it},We))))}}]),E}(R.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:C,min:-C,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:u,required:!1,autoComplete:"off"};var m=A,v=Be.a=m},fAei:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return c.a});var oe=H("rePB"),V=H("VTBJ"),I=H("KQm4"),K=H("1OyB"),L=H("vuIU"),N=H("Ji7U"),W=H("LK+K"),F=H("cDcd"),R=H("4IlW"),D=H("Kwbf"),b=H("TSYQ"),p=H.n(b),_=H("sboe"),f=H("OZM5"),a=H("815F"),d=H("ODXe"),l=H("Ff2n"),i=H("+nKL"),u=H("8XRh"),c=H("WaYH"),S=function(ce,se){var ne=ce.className,re=ce.style,ue=ce.motion,ee=ce.motionNodes,ae=ce.motionType,ge=ce.onMotionStart,Le=ce.onMotionEnd,ke=ce.active,De=ce.treeNodeRequiredProps,Ue=Object(l.a)(ce,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Ie=F.useState(!0),Re=Object(d.a)(Ie,2),Ve=Re[0],$e=Re[1],Ze=F.useContext(_.a),Qe=Ze.prefixCls,Ke=F.useRef(!1),st=function(){Ke.current||Le(),Ke.current=!0};return Object(F.useEffect)(function(){ee&&ae==="hide"&&Ve&&$e(!1)},[ee]),Object(F.useEffect)(function(){return ee&&ge(),function(){ee&&st()}},[]),ee?F.createElement(u.default,Object.assign({ref:se,visible:Ve},ue,{motionAppear:ae==="show",onAppearEnd:st,onLeaveEnd:st}),function(it,ut){var Je=it.className,_t=it.style;return F.createElement("div",{ref:ut,className:p()("".concat(Qe,"-treenode-motion"),Je),style:_t},ee.map(function(gt){var mt=gt.data,We=mt.key,Et=Object(l.a)(mt,["key"]),ht=gt.isStart,Ne=gt.isEnd;delete Et.children;var nt=Object(a.f)(We,De);return F.createElement(c.a,Object.assign({},Et,nt,{active:ke,data:gt.data,key:We,isStart:ht,isEnd:Ne}))}))}):F.createElement(c.a,Object.assign({domRef:se,className:ne,style:re},Ue,{active:ke}))};S.displayName="MotionTreeNode";var C=F.forwardRef(S),T=C;function w(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],se=$.length,ne=ce.length;if(Math.abs(se-ne)!==1)return{add:!1,key:null};function re(ue,ee){var ae=new Map;ue.forEach(function(Le){ae.set(Le,!0)});var ge=ee.filter(function(Le){return!ae.has(Le)});return ge.length===1?ge[0]:null}return se<ne?{add:!0,key:re($,ce)}:{add:!1,key:re(ce,$)}}function A($,ce,se){var ne=$.findIndex(function(ae){var ge=ae.data;return ge.key===se}),re=$[ne+1],ue=ce.findIndex(function(ae){var ge=ae.data;return ge.key===se});if(re){var ee=ce.findIndex(function(ae){var ge=ae.data;return ge.key===re.data.key});return ce.slice(ue+1,ee)}return ce.slice(ue+1)}var m={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v=function(){},s="RC_TREE_MOTION_".concat(Math.random()),o={key:s},E={key:s,level:0,index:0,pos:"0",node:o},g={parent:null,children:[],pos:E.pos,data:o,isStart:[],isEnd:[]};function O($,ce,se,ne){return ce===!1||!se?$:$.slice(0,Math.ceil(se/ne)+1)}function M($){var ce=$.data.key,se=$.pos;return Object(a.e)(ce,se)}function k($){for(var ce=String($.data.key),se=$;se.parent;)se=se.parent,ce="".concat(se.data.key," > ").concat(ce);return ce}var U=function(ce,se){var ne=ce.prefixCls,re=ce.data,ue=ce.selectable,ee=ce.checkable,ae=ce.expandedKeys,ge=ce.selectedKeys,Le=ce.checkedKeys,ke=ce.loadedKeys,De=ce.loadingKeys,Ue=ce.halfCheckedKeys,Ie=ce.keyEntities,Re=ce.disabled,Ve=ce.dragging,$e=ce.dragOverNodeKey,Ze=ce.dropPosition,Qe=ce.motion,Ke=ce.height,st=ce.itemHeight,it=ce.virtual,ut=ce.focusable,Je=ce.activeItem,_t=ce.focused,gt=ce.tabIndex,mt=ce.onKeyDown,We=ce.onFocus,Et=ce.onBlur,ht=ce.onActiveChange,Ne=ce.onListChangeStart,nt=ce.onListChangeEnd,me=Object(l.a)(ce,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ve=F.useRef(null);F.useImperativeHandle(se,function(){return{scrollTo:function(qn){ve.current.scrollTo(qn)}}});var le=F.useState(ae),q=Object(d.a)(le,2),ie=q[0],fe=q[1],Ee=F.useState(re),Oe=Object(d.a)(Ee,2),Ge=Oe[0],tt=Oe[1],Tt=F.useState(re),jt=Object(d.a)(Tt,2),Ft=jt[0],In=jt[1],sn=F.useState([]),Wt=Object(d.a)(sn,2),Qn=Wt[0],mn=Wt[1],yr=F.useState(null),hr=Object(d.a)(yr,2),En=hr[0],Ar=hr[1];function br(){tt(re),In(re),mn([]),Ar(null),nt()}F.useEffect(function(){fe(ae);var _n=w(ie,ae);if(_n.key!==null)if(_n.add){var qn=Ge.findIndex(function(na){var ya=na.data.key;return ya===_n.key}),Er=O(A(Ge,re,_n.key),it,Ke,st),Ir=Ge.slice();Ir.splice(qn+1,0,g),In(Ir),mn(Er),Ar("show")}else{var Oa=re.findIndex(function(na){var ya=na.data.key;return ya===_n.key}),xn=O(A(re,Ge,_n.key),it,Ke,st),Bt=re.slice();Bt.splice(Oa+1,0,g),In(Bt),mn(xn),Ar("hide")}else Ge!==re&&(tt(re),In(re))},[ae,re]),F.useEffect(function(){Ve||br()},[Ve]);var Jt=Qe?Ft:re,ln={expandedKeys:ae,selectedKeys:ge,loadedKeys:ke,loadingKeys:De,checkedKeys:Le,halfCheckedKeys:Ue,dragOverNodeKey:$e,dropPosition:Ze,keyEntities:Ie};return F.createElement(F.Fragment,null,_t&&Je&&F.createElement("span",{style:m,"aria-live":"assertive"},k(Je)),F.createElement("div",{role:"tree"},F.createElement("input",{style:m,disabled:ut===!1||Re,tabIndex:ut!==!1?gt:null,onKeyDown:mt,onFocus:We,onBlur:Et,value:"",onChange:v})),F.createElement(i.a,Object.assign({},me,{data:Jt,itemKey:M,height:Ke,fullHeight:!1,virtual:it,itemHeight:st,prefixCls:"".concat(ne,"-list"),ref:ve}),function(_n){var qn=_n.pos,Er=_n.data,Ir=Er.key,Oa=Object(l.a)(Er,["key"]),xn=_n.isStart,Bt=_n.isEnd,na=Object(a.e)(Ir,qn);delete Oa.children;var ya=Object(a.f)(na,ln);return F.createElement(T,Object.assign({},Oa,ya,{active:Je&&Ir===Je.data.key,pos:qn,data:_n.data,isStart:xn,isEnd:Bt,motion:Qe,motionNodes:Ir===s?Qn:null,motionType:En,onMotionStart:Ne,onMotionEnd:br,treeNodeRequiredProps:ln,onMouseMove:function(){ht(null)}}))}))},B=F.forwardRef(U);B.displayName="NodeList";var y=B,x=H("NvD2"),j=function($){Object(N.a)(se,$);var ce=Object(W.a)(se);function se(){var ne;return Object(K.a)(this,se),ne=ce.apply(this,arguments),ne.destroyed=!1,ne.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},ne.listRef=F.createRef(),ne.onNodeDragStart=function(re,ue){var ee=ne.state,ae=ee.expandedKeys,ge=ee.keyEntities,Le=ne.props.onDragStart,ke=ue.props.eventKey;ne.dragNode=ue;var De=Object(f.b)(ae,ke);ne.setState({dragging:!0,dragNodesKeys:Object(f.g)(ke,ge)}),ne.setExpandedKeys(De),Le&&Le({event:re,node:Object(a.b)(ue.props)})},ne.onNodeDragEnter=function(re,ue){var ee=ne.state,ae=ee.expandedKeys,ge=ee.keyEntities,Le=ee.dragNodesKeys,ke=ne.props.onDragEnter,De=ue.props,Ue=De.pos,Ie=De.eventKey;if(!ne.dragNode||Le.indexOf(Ie)!==-1)return;var Re=Object(f.c)(re,ue);if(ne.dragNode.props.eventKey===Ie&&Re===0){ne.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ne.setState({dragOverNodeKey:Ie,dropPosition:Re}),ne.delayedDragEnterLogic||(ne.delayedDragEnterLogic={}),Object.keys(ne.delayedDragEnterLogic).forEach(function(Ve){clearTimeout(ne.delayedDragEnterLogic[Ve])}),ne.delayedDragEnterLogic[Ue]=window.setTimeout(function(){if(!ne.state.dragging)return;var Ve=Object(I.a)(ae),$e=ge[Ie];$e&&($e.children||[]).length&&(Ve=Object(f.a)(ae,Ie)),"expandedKeys"in ne.props||ne.setExpandedKeys(Ve),ke&&ke({event:re,node:Object(a.b)(ue.props),expandedKeys:Ve})},400)},0)},ne.onNodeDragOver=function(re,ue){var ee=ne.state.dragNodesKeys,ae=ne.props.onDragOver,ge=ue.props.eventKey;if(ee.indexOf(ge)!==-1)return;if(ne.dragNode&&ge===ne.state.dragOverNodeKey){var Le=Object(f.c)(re,ue);if(Le===ne.state.dropPosition)return;ne.setState({dropPosition:Le})}ae&&ae({event:re,node:Object(a.b)(ue.props)})},ne.onNodeDragLeave=function(re,ue){var ee=ne.props.onDragLeave;ne.setState({dragOverNodeKey:""}),ee&&ee({event:re,node:Object(a.b)(ue.props)})},ne.onNodeDragEnd=function(re,ue){var ee=ne.props.onDragEnd;ne.setState({dragOverNodeKey:""}),ne.cleanDragState(),ee&&ee({event:re,node:Object(a.b)(ue.props)}),ne.dragNode=null},ne.onNodeDrop=function(re,ue){var ee=ne.state,ae=ee.dragNodesKeys,ge=ae===void 0?[]:ae,Le=ee.dropPosition,ke=ne.props.onDrop,De=ue.props,Ue=De.eventKey,Ie=De.pos;if(ne.setState({dragOverNodeKey:""}),ne.cleanDragState(),ge.indexOf(Ue)!==-1){Object(D.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Re=Object(f.k)(Ie),Ve={event:re,node:Object(a.b)(ue.props),dragNode:ne.dragNode?Object(a.b)(ne.dragNode.props):null,dragNodesKeys:ge.slice(),dropPosition:Le+Number(Re[Re.length-1]),dropToGap:!1};Le!==0&&(Ve.dropToGap=!0),ke&&ke(Ve),ne.dragNode=null},ne.cleanDragState=function(){var re=ne.state.dragging;re&&ne.setState({dragging:!1})},ne.onNodeClick=function(re,ue){var ee=ne.props.onClick;ee&&ee(re,ue)},ne.onNodeDoubleClick=function(re,ue){var ee=ne.props.onDoubleClick;ee&&ee(re,ue)},ne.onNodeSelect=function(re,ue){var ee=ne.state.selectedKeys,ae=ne.state.keyEntities,ge=ne.props,Le=ge.onSelect,ke=ge.multiple,De=ue.selected,Ue=ue.key,Ie=!De;Ie?ke?ee=Object(f.a)(ee,Ue):ee=[Ue]:ee=Object(f.b)(ee,Ue);var Re=ee.map(function(Ve){var $e=ae[Ve];return $e?$e.node:null}).filter(function(Ve){return Ve});ne.setUncontrolledState({selectedKeys:ee}),Le&&Le(ee,{event:"select",selected:Ie,node:ue,selectedNodes:Re,nativeEvent:re.nativeEvent})},ne.onNodeCheck=function(re,ue,ee){var ae=ne.state,ge=ae.keyEntities,Le=ae.checkedKeys,ke=ae.halfCheckedKeys,De=ne.props,Ue=De.checkStrictly,Ie=De.onCheck,Re=ue.key,Ve,$e={event:"check",node:ue,checked:ee,nativeEvent:re.nativeEvent};if(Ue){var Ze=ee?Object(f.a)(Le,Re):Object(f.b)(Le,Re),Qe=Object(f.b)(ke,Re);Ve={checked:Ze,halfChecked:Qe},$e.checkedNodes=Ze.map(function(_t){return ge[_t]}).filter(function(_t){return _t}).map(function(_t){return _t.node}),ne.setUncontrolledState({checkedKeys:Ze})}else{var Ke=Object(x.a)([].concat(Object(I.a)(Le),[Re]),!0,ge),st=Ke.checkedKeys,it=Ke.halfCheckedKeys;if(!ee){var ut=new Set(st);ut.delete(Re);var Je=Object(x.a)(Array.from(ut),{checked:!1,halfCheckedKeys:it},ge);st=Je.checkedKeys,it=Je.halfCheckedKeys}Ve=st,$e.checkedNodes=[],$e.checkedNodesPositions=[],$e.halfCheckedKeys=it,st.forEach(function(_t){var gt=ge[_t];if(!gt)return;var mt=gt.node,We=gt.pos;$e.checkedNodes.push(mt),$e.checkedNodesPositions.push({node:mt,pos:We})}),ne.setUncontrolledState({checkedKeys:st},!1,{halfCheckedKeys:it})}Ie&&Ie(Ve,$e)},ne.onNodeLoad=function(re){return new Promise(function(ue){ne.setState(function(ee){var ae=ee.loadedKeys,ge=ae===void 0?[]:ae,Le=ee.loadingKeys,ke=Le===void 0?[]:Le,De=ne.props,Ue=De.loadData,Ie=De.onLoad,Re=re.key;if(!Ue||ge.indexOf(Re)!==-1||ke.indexOf(Re)!==-1)return{};var Ve=Ue(re);return Ve.then(function(){var $e=ne.state,Ze=$e.loadedKeys,Qe=$e.loadingKeys,Ke=Object(f.a)(Ze,Re),st=Object(f.b)(Qe,Re);Ie&&Ie(Ke,{event:"load",node:re}),ne.setUncontrolledState({loadedKeys:Ke}),ne.setState({loadingKeys:st}),ue()}),{loadingKeys:Object(f.a)(ke,Re)}})})},ne.onNodeMouseEnter=function(re,ue){var ee=ne.props.onMouseEnter;ee&&ee({event:re,node:ue})},ne.onNodeMouseLeave=function(re,ue){var ee=ne.props.onMouseLeave;ee&&ee({event:re,node:ue})},ne.onNodeContextMenu=function(re,ue){var ee=ne.props.onRightClick;ee&&(re.preventDefault(),ee({event:re,node:ue}))},ne.onFocus=function(){var re=ne.props.onFocus;ne.setState({focused:!0}),re&&re.apply(void 0,arguments)},ne.onBlur=function(){var re=ne.props.onBlur;ne.setState({focused:!1}),ne.onActiveChange(null),re&&re.apply(void 0,arguments)},ne.getTreeNodeRequiredProps=function(){var re=ne.state,ue=re.expandedKeys,ee=re.selectedKeys,ae=re.loadedKeys,ge=re.loadingKeys,Le=re.checkedKeys,ke=re.halfCheckedKeys,De=re.dragOverNodeKey,Ue=re.dropPosition,Ie=re.keyEntities;return{expandedKeys:ue||[],selectedKeys:ee||[],loadedKeys:ae||[],loadingKeys:ge||[],checkedKeys:Le||[],halfCheckedKeys:ke||[],dragOverNodeKey:De,dropPosition:Ue,keyEntities:Ie}},ne.setExpandedKeys=function(re){var ue=ne.state.treeData,ee=Object(a.d)(ue,re);ne.setUncontrolledState({expandedKeys:re,flattenNodes:ee},!0)},ne.onNodeExpand=function(re,ue){var ee=ne.state.expandedKeys,ae=ne.state.listChanging,ge=ne.props,Le=ge.onExpand,ke=ge.loadData,De=ue.key,Ue=ue.expanded;if(ae)return;var Ie=ee.indexOf(De),Re=!Ue;if(Object(D.a)(Ue&&Ie!==-1||!Ue&&Ie===-1,"Expand state not sync with index check"),Re?ee=Object(f.a)(ee,De):ee=Object(f.b)(ee,De),ne.setExpandedKeys(ee),Le&&Le(ee,{node:ue,expanded:Re,nativeEvent:re.nativeEvent}),Re&&ke){var Ve=ne.onNodeLoad(ue);Ve&&Ve.then(function(){var $e=Object(a.d)(ne.state.treeData,ee);ne.setUncontrolledState({flattenNodes:$e})})}},ne.onListChangeStart=function(){ne.setUncontrolledState({listChanging:!0})},ne.onListChangeEnd=function(){setTimeout(function(){ne.setUncontrolledState({listChanging:!1})})},ne.onActiveChange=function(re){var ue=ne.state.activeKey,ee=ne.props.onActiveChange;if(ue===re)return;ne.setState({activeKey:re}),re!==null&&ne.scrollTo({key:re}),ee&&ee(re)},ne.getActiveItem=function(){var re=ne.state,ue=re.activeKey,ee=re.flattenNodes;return ue===null?null:ee.find(function(ae){var ge=ae.data.key;return ge===ue})||null},ne.offsetActiveKey=function(re){var ue=ne.state,ee=ue.flattenNodes,ae=ue.activeKey,ge=ee.findIndex(function(De){var Ue=De.data.key;return Ue===ae});ge===-1&&re<0&&(ge=ee.length),ge=(ge+re+ee.length)%ee.length;var Le=ee[ge];if(Le){var ke=Le.data.key;ne.onActiveChange(ke)}else ne.onActiveChange(null)},ne.onKeyDown=function(re){var ue=ne.state,ee=ue.activeKey,ae=ue.expandedKeys,ge=ue.checkedKeys,Le=ne.props,ke=Le.onKeyDown,De=Le.checkable,Ue=Le.selectable;switch(re.which){case R.a.UP:{ne.offsetActiveKey(-1),re.preventDefault();break}case R.a.DOWN:{ne.offsetActiveKey(1),re.preventDefault();break}}var Ie=ne.getActiveItem();if(Ie&&Ie.data){var Re=ne.getTreeNodeRequiredProps(),Ve=Ie.data.isLeaf===!1||!!(Ie.data.children||[]).length,$e=Object(a.b)(Object(V.a)(Object(V.a)({},Object(a.f)(ee,Re)),{},{data:Ie.data,active:!0}));switch(re.which){case R.a.LEFT:{Ve&&ae.includes(ee)?ne.onNodeExpand({},$e):Ie.parent&&ne.onActiveChange(Ie.parent.data.key),re.preventDefault();break}case R.a.RIGHT:{Ve&&!ae.includes(ee)?ne.onNodeExpand({},$e):Ie.children&&Ie.children.length&&ne.onActiveChange(Ie.children[0].data.key),re.preventDefault();break}case R.a.ENTER:case R.a.SPACE:{De&&!$e.disabled&&$e.checkable!==!1&&!$e.disableCheckbox?ne.onNodeCheck({},$e,!ge.includes(ee)):!De&&Ue&&!$e.disabled&&$e.selectable!==!1&&ne.onNodeSelect({},$e);break}}}ke&&ke(re)},ne.setUncontrolledState=function(re){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ne.destroyed)return;var ae=!1,ge=!0,Le={};Object.keys(re).forEach(function(ke){if(ke in ne.props){ge=!1;return}ae=!0,Le[ke]=re[ke]}),ae&&(!ue||ge)&&ne.setState(Object(V.a)(Object(V.a)({},Le),ee))},ne.scrollTo=function(re){ne.listRef.current.scrollTo(re)},ne}return Object(L.a)(se,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var re,ue=this.state,ee=ue.focused,ae=ue.flattenNodes,ge=ue.keyEntities,Le=ue.dragging,ke=ue.activeKey,De=this.props,Ue=De.prefixCls,Ie=De.className,Re=De.style,Ve=De.showLine,$e=De.focusable,Ze=De.tabIndex,Qe=Ze===void 0?0:Ze,Ke=De.selectable,st=De.showIcon,it=De.icon,ut=De.switcherIcon,Je=De.draggable,_t=De.checkable,gt=De.checkStrictly,mt=De.disabled,We=De.motion,Et=De.loadData,ht=De.filterTreeNode,Ne=De.height,nt=De.itemHeight,me=De.virtual,ve=De.titleRender,le=De.onContextMenu,q=Object(f.f)(this.props);return F.createElement(_.a.Provider,{value:{prefixCls:Ue,selectable:Ke,showIcon:st,icon:it,switcherIcon:ut,draggable:Je,checkable:_t,checkStrictly:gt,disabled:mt,keyEntities:ge,loadData:Et,filterTreeNode:ht,titleRender:ve,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}},F.createElement("div",{className:p()(Ue,Ie,(re={},Object(oe.a)(re,"".concat(Ue,"-show-line"),Ve),Object(oe.a)(re,"".concat(Ue,"-focused"),ee),Object(oe.a)(re,"".concat(Ue,"-active-focused"),ke!==null),re))},F.createElement(y,Object.assign({ref:this.listRef,prefixCls:Ue,style:Re,data:ae,disabled:mt,selectable:Ke,checkable:!!_t,motion:We,dragging:Le,height:Ne,itemHeight:nt,virtual:me,focusable:$e,focused:ee,tabIndex:Qe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:le},this.getTreeNodeRequiredProps(),q))))}}],[{key:"getDerivedStateFromProps",value:function(re,ue){var ee=ue.prevProps,ae={prevProps:re};function ge(it){return!ee&&it in re||ee&&ee[it]!==re[it]}var Le;if(ge("treeData")?Le=re.treeData:ge("children")&&(Object(D.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Le=Object(a.c)(re.children)),Le){ae.treeData=Le;var ke=Object(a.a)(Le);ae.keyEntities=Object(V.a)(Object(oe.a)({},s,E),ke.keyEntities)}var De=ae.keyEntities||ue.keyEntities;if(ge("expandedKeys")||ee&&ge("autoExpandParent"))ae.expandedKeys=re.autoExpandParent||!ee&&re.defaultExpandParent?Object(f.e)(re.expandedKeys,De):re.expandedKeys;else if(!ee&&re.defaultExpandAll){var Ue=Object(V.a)({},De);delete Ue[s],ae.expandedKeys=Object.keys(Ue).map(function(it){return Ue[it].key})}else!ee&&re.defaultExpandedKeys&&(ae.expandedKeys=re.autoExpandParent||re.defaultExpandParent?Object(f.e)(re.defaultExpandedKeys,De):re.defaultExpandedKeys);if(ae.expandedKeys||delete ae.expandedKeys,Le||ae.expandedKeys){var Ie=Object(a.d)(Le||ue.treeData,ae.expandedKeys||ue.expandedKeys);ae.flattenNodes=Ie}if(re.selectable&&(ge("selectedKeys")?ae.selectedKeys=Object(f.d)(re.selectedKeys,re):!ee&&re.defaultSelectedKeys&&(ae.selectedKeys=Object(f.d)(re.defaultSelectedKeys,re))),re.checkable){var Re;if(ge("checkedKeys")?Re=Object(f.j)(re.checkedKeys)||{}:!ee&&re.defaultCheckedKeys?Re=Object(f.j)(re.defaultCheckedKeys)||{}:Le&&(Re=Object(f.j)(re.checkedKeys)||{checkedKeys:ue.checkedKeys,halfCheckedKeys:ue.halfCheckedKeys}),Re){var Ve=Re,$e=Ve.checkedKeys,Ze=$e===void 0?[]:$e,Qe=Ve.halfCheckedKeys,Ke=Qe===void 0?[]:Qe;if(!re.checkStrictly){var st=Object(x.a)(Ze,!0,De);Ze=st.checkedKeys,Ke=st.halfCheckedKeys}ae.checkedKeys=Ze,ae.halfCheckedKeys=Ke}}return ge("loadedKeys")&&(ae.loadedKeys=re.loadedKeys),ae}}]),se}(F.Component);j.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:[]},j.TreeNode=c.a;var z=j,Y=Be.b=z},fcSX:function(rt,Be,H){"use strict";var oe=H("Ff2n"),V=H("1OyB"),I=H("vuIU"),K=H("Ji7U"),L=H("md7G"),N=H("foSv"),W=H("1W/9"),F=H("cDcd"),R=H("rePB"),D=H("JX7q"),b=H("TSYQ"),p=H.n(b),_=H("qx4F"),f=H("4IlW");function a(U){return Array.isArray(U)?U:[U]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(d).filter(function(U){if(typeof document=="undefined")return!1;var B=document.getElementsByTagName("html")[0];return U in(B?B.style:{})})[0],i=d[l];function u(U,B,y,x){U.addEventListener?U.addEventListener(B,y,x):U.attachEvent&&U.attachEvent("on".concat(B),y)}function c(U,B,y,x){U.removeEventListener?U.removeEventListener(B,y,x):U.attachEvent&&U.detachEvent("on".concat(B),y)}function S(U,B){var y=typeof U=="function"?U(B):U;return Array.isArray(y)?y.length===2?y:[y[0],y[1]]:[y]}var C=function(B){return!isNaN(parseFloat(B))&&isFinite(B)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),w=function U(B,y,x,j){if(!y||y===document||y instanceof Document)return!1;if(y===B.parentNode)return!0;var z=Math.max(Math.abs(x),Math.abs(j))===Math.abs(j),Y=Math.max(Math.abs(x),Math.abs(j))===Math.abs(x),$=y.scrollHeight-y.clientHeight,ce=y.scrollWidth-y.clientWidth,se=document.defaultView.getComputedStyle(y),ne=se.overflowY==="auto"||se.overflowY==="scroll",re=se.overflowX==="auto"||se.overflowX==="scroll",ue=$&&ne,ee=ce&&re;return z&&(!ue||ue&&(y.scrollTop>=$&&j<0||y.scrollTop<=0&&j>0))||Y&&(!ee||ee&&(y.scrollLeft>=ce&&x<0||y.scrollLeft<=0&&x>0))?U(B,y.parentNode,x,j):!1};function A(U){var B=m();return function(){var x=Object(N.a)(U),j;if(B){var z=Object(N.a)(this).constructor;j=Reflect.construct(x,arguments,z)}else j=x.apply(this,arguments);return Object(L.a)(this,j)}}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(U){return!1}}var v={},s=function(U){Object(K.a)(y,U);var B=A(y);function y(x){var j;return Object(V.a)(this,y),j=B.call(this,x),j.domFocus=function(){j.dom&&j.dom.focus()},j.removeStartHandler=function(z){if(z.touches.length>1)return;j.startPos={x:z.touches[0].clientX,y:z.touches[0].clientY}},j.removeMoveHandler=function(z){if(z.changedTouches.length>1)return;var Y=z.currentTarget,$=z.changedTouches[0].clientX-j.startPos.x,ce=z.changedTouches[0].clientY-j.startPos.y;(Y===j.maskDom||Y===j.handlerDom||Y===j.contentDom&&w(Y,z.target,$,ce))&&z.cancelable&&z.preventDefault()},j.transitionEnd=function(z){var Y=z.target;c(Y,i,j.transitionEnd),Y.style.transition=""},j.onKeyDown=function(z){if(z.keyCode===f.a.ESC){var Y=j.props.onClose;z.stopPropagation(),Y&&Y(z)}},j.onWrapperTransitionEnd=function(z){var Y=j.props,$=Y.open,ce=Y.afterVisibleChange;z.target===j.contentWrapper&&z.propertyName.match(/transform$/)&&(j.dom.style.transition="",!$&&j.getCurrentDrawerSome()&&(document.body.style.overflowX="",j.maskDom&&(j.maskDom.style.left="",j.maskDom.style.width="")),ce&&ce(!!$))},j.openLevelTransition=function(){var z=j.props,Y=z.open,$=z.width,ce=z.height,se=j.getHorizontalBoolAndPlacementName(),ne=se.isHorizontal,re=se.placementName,ue=j.contentDom?j.contentDom.getBoundingClientRect()[ne?"width":"height"]:0,ee=(ne?$:ce)||ue;j.setLevelAndScrolling(Y,re,ee)},j.setLevelTransform=function(z,Y,$,ce){var se=j.props,ne=se.placement,re=se.levelMove,ue=se.duration,ee=se.ease,ae=se.showMask;j.levelDom.forEach(function(ge){ge.style.transition="transform ".concat(ue," ").concat(ee),u(ge,i,j.transitionEnd);var Le=z?$:0;if(re){var ke=S(re,{target:ge,open:z});Le=z?ke[0]:ke[1]||0}var De=typeof Le=="number"?"".concat(Le,"px"):Le,Ue=ne==="left"||ne==="top"?De:"-".concat(De);Ue=ae&&ne==="right"&&ce?"calc(".concat(Ue," + ").concat(ce,"px)"):Ue,ge.style.transform=Le?"".concat(Y,"(").concat(Ue,")"):""})},j.setLevelAndScrolling=function(z,Y,$){var ce=j.props.onChange;if(!T){var se=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(_.a)(!0):0;j.setLevelTransform(z,Y,$,se),j.toggleScrollingToDrawerAndBody(se)}ce&&ce(z)},j.toggleScrollingToDrawerAndBody=function(z){var Y=j.props,$=Y.getOpenCount,ce=Y.getContainer,se=Y.showMask,ne=Y.open,re=ce&&ce(),ue=$&&$();if(re&&re.parentNode===document.body&&se){var ee=["touchstart"],ae=[document.body,j.maskDom,j.handlerDom,j.contentDom];ne&&document.body.style.overflow!=="hidden"?(z&&j.addScrollingEffect(z),ue===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ae.forEach(function(ge,Le){if(!ge)return;u(ge,ee[Le]||"touchmove",Le?j.removeMoveHandler:j.removeStartHandler,j.passive)})):j.getCurrentDrawerSome()&&(ue||(document.body.style.overflow=""),document.body.style.touchAction="",z&&j.remScrollingEffect(z),ae.forEach(function(ge,Le){if(!ge)return;c(ge,ee[Le]||"touchmove",Le?j.removeMoveHandler:j.removeStartHandler,j.passive)}))}},j.addScrollingEffect=function(z){var Y=j.props,$=Y.placement,ce=Y.duration,se=Y.ease,ne=Y.getOpenCount,re=Y.switchScrollingEffect,ue=ne&&ne();ue===1&&re();var ee="width ".concat(ce," ").concat(se),ae="transform ".concat(ce," ").concat(se);j.dom.style.transition="none";switch($){case"right":j.dom.style.transform="translateX(-".concat(z,"px)");break;case"top":case"bottom":j.dom.style.width="calc(100% - ".concat(z,"px)"),j.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(j.timeout),j.timeout=setTimeout(function(){j.dom&&(j.dom.style.transition="".concat(ae,",").concat(ee),j.dom.style.width="",j.dom.style.transform="")})},j.remScrollingEffect=function(z){var Y=j.props,$=Y.placement,ce=Y.duration,se=Y.ease,ne=Y.getOpenCount,re=Y.switchScrollingEffect,ue=ne&&ne();ue||re(!0),l&&(document.body.style.overflowX="hidden"),j.dom.style.transition="none";var ee,ae="width ".concat(ce," ").concat(se),ge="transform ".concat(ce," ").concat(se);switch($){case"left":{j.dom.style.width="100%",ae="width 0s ".concat(se," ").concat(ce);break}case"right":{j.dom.style.transform="translateX(".concat(z,"px)"),j.dom.style.width="100%",ae="width 0s ".concat(se," ").concat(ce),j.maskDom&&(j.maskDom.style.left="-".concat(z,"px"),j.maskDom.style.width="calc(100% + ".concat(z,"px)"));break}case"top":case"bottom":{j.dom.style.width="calc(100% + ".concat(z,"px)"),j.dom.style.height="100%",j.dom.style.transform="translateZ(0)",ee="height 0s ".concat(se," ").concat(ce);break}default:break}clearTimeout(j.timeout),j.timeout=setTimeout(function(){j.dom&&(j.dom.style.transition="".concat(ge,",").concat(ee?"".concat(ee,","):"").concat(ae),j.dom.style.transform="",j.dom.style.width="",j.dom.style.height="")})},j.getCurrentDrawerSome=function(){return!Object.keys(v).some(function(z){return v[z]})},j.getLevelDom=function(z){var Y=z.level,$=z.getContainer;if(T)return;var ce=$&&$(),se=ce?ce.parentNode:null;if(j.levelDom=[],Y==="all"){var ne=se?Array.prototype.slice.call(se.children):[];ne.forEach(function(re){re.nodeName!=="SCRIPT"&&re.nodeName!=="STYLE"&&re.nodeName!=="LINK"&&re!==ce&&j.levelDom.push(re)})}else Y&&a(Y).forEach(function(re){document.querySelectorAll(re).forEach(function(ue){j.levelDom.push(ue)})})},j.getHorizontalBoolAndPlacementName=function(){var z=j.props.placement,Y=z==="left"||z==="right",$="translate".concat(Y?"X":"Y");return{isHorizontal:Y,placementName:$}},j.state={_self:Object(D.a)(j)},j}return Object(I.a)(y,[{key:"componentDidMount",value:function(){var j=this;if(!T){var z=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return z=!0,null}}))}catch(ne){}this.passive=z?{passive:!1}:!1}var Y=this.props,$=Y.open,ce=Y.getContainer,se=ce&&ce();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),$&&(se&&se.parentNode===document.body&&(v[this.drawerId]=$),this.openLevelTransition(),this.forceUpdate(function(){j.domFocus()}))}},{key:"componentDidUpdate",value:function(j){var z=this.props,Y=z.open,$=z.getContainer,ce=$&&$();Y!==j.open&&(Y&&this.domFocus(),ce&&ce.parentNode===document.body&&(v[this.drawerId]=!!Y),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var j=this.props,z=j.getOpenCount,Y=j.open,$=j.switchScrollingEffect,ce=typeof z=="function"&&z();delete v[this.drawerId],Y&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ce||(document.body.style.overflow="",$(!0))}},{key:"render",value:function(){var j,z=this,Y=this.props,$=Y.className,ce=Y.children,se=Y.style,ne=Y.width,re=Y.height,ue=Y.defaultOpen,ee=Y.open,ae=Y.prefixCls,ge=Y.placement,Le=Y.level,ke=Y.levelMove,De=Y.ease,Ue=Y.duration,Ie=Y.getContainer,Re=Y.handler,Ve=Y.onChange,$e=Y.afterVisibleChange,Ze=Y.showMask,Qe=Y.maskClosable,Ke=Y.maskStyle,st=Y.onClose,it=Y.onHandleClick,ut=Y.keyboard,Je=Y.getOpenCount,_t=Y.switchScrollingEffect,gt=Object(oe.a)(Y,["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"]),mt=this.dom?ee:!1,We=p()(ae,(j={},Object(R.a)(j,"".concat(ae,"-").concat(ge),!0),Object(R.a)(j,"".concat(ae,"-open"),mt),Object(R.a)(j,$||"",!!$),Object(R.a)(j,"no-mask",!Ze),j)),Et=this.getHorizontalBoolAndPlacementName(),ht=Et.placementName,Ne=ge==="left"||ge==="top"?"-100%":"100%",nt=mt?"":"".concat(ht,"(").concat(Ne,")"),me=Re&&F.cloneElement(Re,{onClick:function(le){Re.props.onClick&&Re.props.onClick(),it&&it(le)},ref:function(le){z.handlerDom=le}});return F.createElement("div",Object.assign({},gt,{tabIndex:-1,className:We,style:se,ref:function(le){z.dom=le},onKeyDown:mt&&ut?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Ze&&F.createElement("div",{className:"".concat(ae,"-mask"),onClick:Qe?st:void 0,style:Ke,ref:function(le){z.maskDom=le}}),F.createElement("div",{className:"".concat(ae,"-content-wrapper"),style:{transform:nt,msTransform:nt,width:C(ne)?"".concat(ne,"px"):ne,height:C(re)?"".concat(re,"px"):re},ref:function(le){z.contentWrapper=le}},F.createElement("div",{className:"".concat(ae,"-content"),ref:function(le){z.contentDom=le},onTouchStart:mt&&Ze?this.removeStartHandler:void 0,onTouchMove:mt&&Ze?this.removeMoveHandler:void 0},ce),me))}}],[{key:"getDerivedStateFromProps",value:function(j,z){var Y=z.prevProps,$=z._self,ce={prevProps:j};if(Y!==void 0){var se=j.placement,ne=j.level;se!==Y.placement&&($.contentDom=null),ne!==Y.level&&$.getLevelDom(j)}return ce}}]),y}(F.Component);s.defaultProps={switchScrollingEffect:function(){}};var o=s;function E(U){var B=g();return function(){var x=Object(N.a)(U),j;if(B){var z=Object(N.a)(this).constructor;j=Reflect.construct(x,arguments,z)}else j=x.apply(this,arguments);return Object(L.a)(this,j)}}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(U){return!1}}var O=function(U){Object(K.a)(y,U);var B=E(y);function y(x){var j;Object(V.a)(this,y),j=B.call(this,x),j.onHandleClick=function(Y){var $=j.props,ce=$.onHandleClick,se=$.open;if(ce&&ce(Y),typeof se=="undefined"){var ne=j.state.open;j.setState({open:!ne})}},j.onClose=function(Y){var $=j.props,ce=$.onClose,se=$.open;ce&&ce(Y),typeof se=="undefined"&&j.setState({open:!1})};var z=typeof x.open!="undefined"?x.open:!!x.defaultOpen;return j.state={open:z},"onMaskClick"in x&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),j}return Object(I.a)(y,[{key:"render",value:function(){var j=this,z=this.props,Y=z.defaultOpen,$=z.getContainer,ce=z.wrapperClassName,se=z.forceRender,ne=z.handler,re=Object(oe.a)(z,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),ue=this.state.open;if(!$)return F.createElement("div",{className:ce,ref:function(ge){j.dom=ge}},F.createElement(o,Object.assign({},re,{open:ue,handler:ne,getContainer:function(){return j.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ee=!!ne||se;return F.createElement(W.a,{visible:ue,forceRender:ee,getContainer:$,wrapperClassName:ce},function(ae){var ge=ae.visible,Le=ae.afterClose,ke=Object(oe.a)(ae,["visible","afterClose"]);return F.createElement(o,Object.assign({},re,ke,{open:ge!==void 0?ge:ue,afterVisibleChange:Le!==void 0?Le:re.afterVisibleChange,handler:ne,onClose:j.onClose,onHandleClick:j.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(j,z){var Y=z.prevProps,$={prevProps:j};return typeof Y!="undefined"&&j.open!==Y.open&&($.open=j.open),$}}]),y}(F.Component);O.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:F.createElement("div",{className:"drawer-handle"},F.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var M=O,k=Be.a=M},i8i3:function(rt,Be,H){rt.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(rt,Be,H){rt.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(rt,Be,H){"use strict";H.d(Be,"a",function(){return _});var oe=H("qVdP"),V=H("jsC+"),I=H("lUTK"),K=H("BvKs"),L=H("tJVT"),N=H("cDcd"),W=H.n(N),F=H("Q0Vu"),R=H.n(F),D=[{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(a){var d=a.showSelectAll,l=d===void 0?!1:d,i=a.disciplinesData,u=i===void 0?[]:i,c=a.knowledgeData,S=c===void 0?[]:c,C=a.directionValue,T=a.subDisciplineValue,w=a.typeValue,A=a.knowledgeValue,m=a.showKnowledge,v=m===void 0?!1:m,s=a.showRandomType,o=s===void 0?!1:s,E=a.difficultyValue,g=a.randomValue,O=a.selectAll,M=a.languagesvalue,k=a.className,U=a.languages,B=U===void 0?[]:U,y=a.isprogram_homework,x=a.showShixun,j=x===void 0?!1:x,z=a.showItemType,Y=z===void 0?!0:z,$=a.onShixunChange,ce=$===void 0?function(){}:$,se=a.onDirectionChange,ne=se===void 0?function(){}:se,re=a.onTypeChange,ue=re===void 0?function(){}:re,ee=a.onDifficultyChange,ae=ee===void 0?function(){}:ee,ge=a.handlelanguagesChange,Le=ge===void 0?function(){}:ge,ke=a.onKnowledgeChange,De=ke===void 0?function(){}:ke,Ue=a.onRandomChange,Ie=Ue===void 0?function(){}:Ue,Re=a.showTeachGroup,Ve=Re===void 0?!1:Re,$e=a.teachGroupData,Ze=$e===void 0?[]:$e,Qe=a.onTeachGroupChange,Ke=Qe===void 0?function(){}:Qe,st=a.teachGroupValue,it=Object(N.useState)(0),ut=Object(L.a)(it,2),Je=ut[0],_t=ut[1],gt=Object(N.useRef)(null),mt=Object(N.useState)(0),We=Object(L.a)(mt,2),Et=We[0],ht=We[1],Ne=Object(N.useRef)(null);Object(N.useEffect)(function(){if(u.length!==0){var me;(gt==null||((me=gt.current)===null||me===void 0)?void 0:me.clientHeight)>108?_t(1):_t(0)}u.length===0&&_t(0)},[u]),Object(N.useEffect)(function(){if(console.log(S.length===0,"\u6570\u91CF"),S.length!==0){var me,ve;console.log(Ne==null||((me=Ne.current)===null||me===void 0)?void 0:me.clientHeight,"\u9AD8\u5EA6"),(Ne==null||((ve=Ne.current)===null||ve===void 0)?void 0:ve.clientHeight)>108?ht(1):ht(0)}S.length===0&&ht(0)},[S]);var nt=function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],le=arguments.length>1?arguments[1]:void 0;return W.a.createElement(K.a,{className:R.a.subMenu},ve.map(function(q){return W.a.createElement(K.a.Item,{key:q.id},W.a.createElement("a",{className:"".concat(R.a.subItem," ").concat(T===q.id?R.a.subActive:""),onClick:function(){return ne(le,q.id)}},q.name))}))};return W.a.createElement("aside",{className:k?"".concat(R.a.main," ").concat(k):R.a.main},W.a.createElement("div",{className:R.a.wrap},y&&W.a.createElement("div",{className:R.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ve&&W.a.createElement("div",{className:R.a.content},W.a.createElement("span",{className:R.a.name},"\u56E2\u961F"),W.a.createElement("div",{className:R.a.directionContentWrap},W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(st?"":R.a.active," "),onClick:function(){return Ke(null)}},"\u5168\u90E8"),Ze==null?void 0:Ze.map(function(me){return W.a.createElement("li",{key:me.group_id,className:"".concat(R.a.directionItem," ").concat(st===me.group_id?R.a.active:""," "),onClick:function(){return Ke(me.group_id)}},me.name)}))),W.a.createElement("div",{className:R.a.content},W.a.createElement("span",{className:R.a.name},"\u65B9\u5411"),W.a.createElement("span",null),W.a.createElement("div",{className:R.a.directionContentWrap,style:{overflow:"hidden",height:Je===1?88:"auto"}},W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(C?"":R.a.active," "),onClick:function(){return ne(null)}},"\u5168\u90E8"),u.map(function(me){var ve;return W.a.createElement(W.a.Fragment,{key:me.id},((ve=me.sub_disciplines)===null||ve===void 0?void 0:ve.length)>0?W.a.createElement(V.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(q){return q.parentNode},overlay:function(){return nt(me.sub_disciplines,me.id)}},W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(C===me.id?R.a.active:""," "),onClick:function(){return ne(me.id)}},me.name)):W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(C===me.id?R.a.active:""," "),onClick:function(){return ne(me.id)}},me.name))})),W.a.createElement("div",{className:R.a.directionContentWrap,ref:gt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},u.map(function(me){var ve;return W.a.createElement(W.a.Fragment,{key:me.id},((ve=me.sub_disciplines)===null||ve===void 0?void 0:ve.length)>0?W.a.createElement(V.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(q){return q.parentNode},overlay:function(){return nt(me.sub_disciplines,me.id)}},W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(C===me.id?R.a.active:""," "),onClick:function(){return ne(me.id)}},me.name)):W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(C===me.id?R.a.active:""," "),onClick:function(){return ne(me.id)}},me.name))})),!!Je&&W.a.createElement("div",{className:R.a.action},Je===1&&W.a.createElement("span",{onClick:function(){return _t(2)}},"\u5C55\u5F00",W.a.createElement("i",{className:"iconfont icon-xiala"})),Je===2&&W.a.createElement("span",{onClick:function(){return _t(1)}},"\u6536\u8D77",W.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),v&&W.a.createElement("div",{className:R.a.content},W.a.createElement("span",{className:R.a.name},"\u77E5\u8BC6\u70B9"),W.a.createElement("div",{className:R.a.directionContentWrap,style:{overflow:"hidden",height:Et===1?106:"auto"}},W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(A===-1?R.a.active:""," "),onClick:function(){return De(-1)}},"\u5168\u90E8"),S.map(function(me){return W.a.createElement("li",{key:me.id,className:"".concat(R.a.directionItem," ").concat(A===me.id?R.a.active:""," "),onClick:function(){return De(me.id)}},me.name)})),W.a.createElement("div",{ref:Ne,className:R.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},S.map(function(me){return W.a.createElement("li",{key:me.id,className:"".concat(R.a.directionItem," ").concat(A===me.id?R.a.active:""," "),onClick:function(){return De(me.id)}},me.name)})),!!Et&&W.a.createElement("div",{className:R.a.action},Et===1&&W.a.createElement("span",{onClick:function(){return ht(2)}},"\u5C55\u5F00",W.a.createElement("i",{className:"iconfont icon-xiala"})),Et===2&&W.a.createElement("span",{onClick:function(){return ht(1)}},"\u6536\u8D77",W.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),Y&&!y&&W.a.createElement("div",{className:R.a.content},W.a.createElement("span",{className:R.a.name},"\u9898\u578B"),W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(w?"":R.a.active," "),onClick:function(){return ue(null)}},"\u5168\u90E8"),W.a.createElement("div",{className:R.a.directionContentWrap},D.map(function(me){return W.a.createElement("li",{key:me.name,className:"".concat(R.a.directionItem," ").concat(w===me.value?R.a.active:""," "),onClick:function(){return ue(me.value)}},me.name)}),j&&W.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:R.a.directionItem,onClick:function(){return ce()}},"\u5B9E\u8BAD\u9898"))),W.a.createElement("div",{className:R.a.content},W.a.createElement("span",{className:R.a.name},"\u96BE\u5EA6"),W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(E?"":R.a.active," "),onClick:function(){return ae(null)}},"\u5168\u90E8"),W.a.createElement("div",{className:R.a.directionContentWrap},b.map(function(me){return W.a.createElement("li",{key:me.name,className:"".concat(R.a.directionItem," ").concat(E===me.value?R.a.active:""," "),onClick:function(){return ae(me.value)}},me.name)}))),o&&W.a.createElement("div",{className:R.a.content},W.a.createElement("span",{className:R.a.name},"\u7C7B\u578B"),W.a.createElement("li",{className:"".concat(R.a.directionItem," ").concat(g?"":R.a.active," "),onClick:function(){return Ie(null)}},"\u5168\u90E8"),W.a.createElement("div",{className:R.a.directionContentWrap},p.map(function(me){return W.a.createElement("li",{key:me.name,className:"".concat(R.a.directionItem," ").concat(g===me.value?R.a.active:""," "),onClick:function(){return Ie(me.value)}},me.name)})))))}},jcZT:function(rt,Be,H){"use strict";var oe=H("2qtc"),V=H("kLXV"),I=H("5NDa"),K=H("5rEg"),L=H("miYZ"),N=H("tsqr"),W=H("9og8"),F=H("tJVT"),R=H("WmNS"),D=H.n(R),b=H("cDcd"),p=H.n(b),_=H("d5o6"),f=H.n(_),a=H("P/tu"),d=H("WCUW"),l=H("9kvl"),i=function(c){var S=c.problemset,C=c.dispatch,T=c.onOk,w=Object(b.useState)(""),A=Object(F.a)(w,2),m=A[0],v=A[1],s=Object(b.useState)([0]),o=Object(F.a)(s,2),E=o[0],g=o[1],O=function(){C({type:"problemset/setActionTabs",payload:{}})};Object(b.useEffect)(function(){if(S.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var k,U;g([(k=S.actionTabs)===null||k===void 0||((U=k.params)===null||U===void 0)?void 0:U.group_id]),v("")}},[S.actionTabs.key]);var M=function(){var k=Object(W.a)(D.a.mark(function U(){var B,y,x;return D.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(B=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],m.trim()){z.next=4;break}return N.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),z.abrupt("return");case 4:if(!(m.charAt(0)===" ")){z.next=7;break}return N.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),z.abrupt("return");case 7:y=0;case 8:if(!(y<m.length)){z.next=15;break}if(!B.includes(m.charAt(y))){z.next=12;break}return N.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),z.abrupt("return",!1);case 12:y++,z.next=8;break;case 15:return z.next=17,Object(d.p)({parent_id:E.length>0?E[0]:0,name:m});case 17:x=z.sent,x.status===0&&(O(),T(x==null?void 0:x.id));case 19:case"end":return z.stop()}},U)}));return function(){return k.apply(this,arguments)}}();return p.a.createElement(V.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:S.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:O,onOk:M,destroyOnClose:!0},p.a.createElement("div",{className:f.a.addModal},p.a.createElement("div",{className:f.a.row},p.a.createElement("span",{className:f.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),p.a.createElement(K.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:m,onChange:function(U){return v(U.target.value)}})),p.a.createElement("div",{className:f.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},p.a.createElement("span",{className:f.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),p.a.createElement(a.a,{value:E,onChange:function(U){return g(U)}}))))};Be.a=Object(l.a)(function(u){var c=u.problemset;return{problemset:c}})(i)},k3GJ:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return ho});var oe=H("rePB"),V=H("ODXe"),I=H("Ff2n"),K=H("VTBJ"),L=H("cDcd"),N=H("TSYQ"),W=H.n(N),F=H("Zm9Q"),R=H("6cGi"),D=H("KQm4"),b=H("xEkU"),p=H.n(b),_=H("t23M");function f(pe){var xe=Object(L.useRef)(),Se=Object(L.useRef)(!1);function _e(){for(var Z=arguments.length,de=new Array(Z),te=0;te<Z;te++)de[te]=arguments[te];Se.current||(p.a.cancel(xe.current),xe.current=p()(function(){pe.apply(void 0,de)}))}return Object(L.useEffect)(function(){return function(){Se.current=!0,p.a.cancel(xe.current)}},[]),_e}function a(pe){var xe=Object(L.useRef)([]),Se=Object(L.useState)({}),_e=Object(V.a)(Se,2),Z=_e[1],de=Object(L.useRef)(typeof pe=="function"?pe():pe),te=f(function(){var he=de.current;xe.current.forEach(function(Ce){he=Ce(he)}),xe.current=[],de.current=he,Z({})});function ye(he){xe.current.push(he),te()}return[de.current,ye]}var d=H("4IlW");function l(pe,xe){var Se,_e=pe.prefixCls,Z=pe.id,de=pe.active,te=pe.rtl,ye=pe.tab,he=ye.key,Ce=ye.tab,we=ye.disabled,Pe=ye.closeIcon,ze=pe.tabBarGutter,ot=pe.tabPosition,dt=pe.closable,Ot=pe.renderWrapper,on=pe.removeAriaLabel,Un=pe.editable,An=pe.onClick,Ln=pe.onRemove,Mn=pe.onFocus,Pn="".concat(_e,"-tab");L.useEffect(function(){return Ln},[]);var wn={};ot==="top"||ot==="bottom"?wn[te?"marginLeft":"marginRight"]=ze:wn.marginBottom=ze;var Bn=Un&&dt!==!1&&!we;function Kn(tn){if(we)return;An(tn)}function xr(tn){tn.preventDefault(),tn.stopPropagation(),Un.onEdit("remove",{key:he,event:tn})}var Gn=L.createElement("div",{key:he,ref:xe,className:W()(Pn,(Se={},Object(oe.a)(Se,"".concat(Pn,"-with-remove"),Bn),Object(oe.a)(Se,"".concat(Pn,"-active"),de),Object(oe.a)(Se,"".concat(Pn,"-disabled"),we),Se)),style:wn,onClick:Kn},L.createElement("div",{role:"tab","aria-selected":de,id:Z&&"".concat(Z,"-tab-").concat(he),className:"".concat(Pn,"-btn"),"aria-controls":Z&&"".concat(Z,"-panel-").concat(he),"aria-disabled":we,tabIndex:we?null:0,onClick:function($t){$t.stopPropagation(),Kn($t)},onKeyDown:function($t){[d.a.SPACE,d.a.ENTER].includes($t.which)&&($t.preventDefault(),Kn($t))},onFocus:Mn},Ce),Bn&&L.createElement("button",{type:"button","aria-label":on||"remove",tabIndex:0,className:"".concat(Pn,"-remove"),onClick:function($t){$t.stopPropagation(),xr($t)}},Pe||Un.removeIcon||"\xD7"));return Ot&&(Gn=Ot(Gn)),Gn}var i=L.forwardRef(l),u={width:0,height:0,left:0,top:0};function c(pe,xe,Se){return Object(L.useMemo)(function(){for(var _e,Z=new Map,de=xe.get((_e=pe[0])===null||_e===void 0?void 0:_e.key)||u,te=de.left+de.width,ye=0;ye<pe.length;ye+=1){var he=pe[ye].key,Ce=xe.get(he);if(!Ce){var we;Ce=xe.get((we=pe[ye-1])===null||we===void 0?void 0:we.key)||u}var Pe=Z.get(he)||Object(K.a)({},Ce);Pe.right=te-Pe.left-Pe.width,Z.set(he,Pe)}return Z},[pe.map(function(_e){return _e.key}).join("_"),xe,Se])}var S={width:0,height:0,left:0,top:0,right:0};function C(pe,xe,Se,_e,Z){var de=Z.tabs,te=Z.tabPosition,ye=Z.rtl,he,Ce,we;["top","bottom"].includes(te)?(he="width",Ce=ye?"right":"left",we=Math.abs(xe.left)):(he="height",Ce="top",we=-xe.top);var Pe=xe[he],ze=Se[he],ot=_e[he],dt=Pe;return ze+ot>Pe&&(dt=Pe-ot),Object(L.useMemo)(function(){if(!de.length)return[0,0];for(var Ot=de.length,on=Ot,Un=0;Un<Ot;Un+=1){var An=pe.get(de[Un].key)||S;if(An[Ce]+An[he]>we+dt){on=Un-1;break}}for(var Ln=0,Mn=Ot-1;Mn>=0;Mn-=1){var Pn=pe.get(de[Mn].key)||S;if(Pn[Ce]<we){Ln=Mn+1;break}}return[Ln,on]},[pe,we,dt,te,de.map(function(Ot){return Ot.key}).join("_"),ye])}var T=H("wx14"),w=H("1OyB"),A=H("vuIU"),m=H("JX7q"),v=H("Ji7U"),s=H("LK+K"),o=H("I8Z2"),E=H("bT9E"),g=H("2GS6"),O=H("Gytx"),M=H.n(O),k=H("U8pU"),U=/iPhone/i,B=/iPod/i,y=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,j=/Android/i,z=/\bAndroid(?:.+)SD4930UR\b/i,Y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,$=/Windows Phone/i,ce=/\bWindows(?:.+)ARM\b/i,se=/BlackBerry/i,ne=/BB10/i,re=/Opera Mini/i,ue=/\b(CriOS|Chrome)(?:.+)Mobile/i,ee=/Mobile(?:.+)Firefox\b/i;function ae(pe,xe){return pe.test(xe)}function ge(pe){var xe=pe||(typeof navigator!="undefined"?navigator.userAgent:""),Se=(xe||"").split("[FBAN");if(typeof Se[1]!="undefined"){var _e=Se,Z=Object(V.a)(_e,1);xe=Z[0]}if(Se=xe.split("Twitter"),typeof Se[1]!="undefined"){var de=Se,te=Object(V.a)(de,1);xe=te[0]}var ye={apple:{phone:ae(U,xe)&&!ae($,xe),ipod:ae(B,xe),tablet:!ae(U,xe)&&ae(y,xe)&&!ae($,xe),device:(ae(U,xe)||ae(B,xe)||ae(y,xe))&&!ae($,xe)},amazon:{phone:ae(z,xe),tablet:!ae(z,xe)&&ae(Y,xe),device:ae(z,xe)||ae(Y,xe)},android:{phone:!ae($,xe)&&ae(z,xe)||!ae($,xe)&&ae(x,xe),tablet:!ae($,xe)&&!ae(z,xe)&&!ae(x,xe)&&(ae(Y,xe)||ae(j,xe)),device:!ae($,xe)&&(ae(z,xe)||ae(Y,xe)||ae(x,xe)||ae(j,xe))||ae(/\bokhttp\b/i,xe)},windows:{phone:ae($,xe),tablet:ae(ce,xe),device:ae($,xe)||ae(ce,xe)},other:{blackberry:ae(se,xe),blackberry10:ae(ne,xe),opera:ae(re,xe),firefox:ae(ee,xe),chrome:ae(ue,xe),device:ae(se,xe)||ae(ne,xe)||ae(re,xe)||ae(ee,xe)||ae(ue,xe)},any:null,phone:null,tablet:null};return ye.any=ye.apple.device||ye.android.device||ye.windows.device||ye.other.device,ye.phone=ye.apple.phone||ye.android.phone||ye.windows.phone,ye.tablet=ye.apple.tablet||ye.android.tablet||ye.windows.tablet,ye}var Le=Object(K.a)(Object(K.a)({},ge()),{},{isMobile:ge}),ke=Le;function De(){}function Ue(pe,xe,Se){var _e=xe||"";return pe.key||"".concat(_e,"item_").concat(Se)}function Ie(pe){return"".concat(pe,"-menu-")}function Re(pe,xe){var Se=-1;L.Children.forEach(pe,function(_e){Se+=1,_e&&_e.type&&_e.type.isMenuItemGroup?L.Children.forEach(_e.props.children,function(Z){Se+=1,xe(Z,Se)}):xe(_e,Se)})}function Ve(pe,xe,Se){if(!pe||Se.find)return;L.Children.forEach(pe,function(_e){if(_e){var Z=_e.type;if(!Z||!(Z.isSubMenu||Z.isMenuItem||Z.isMenuItemGroup))return;xe.indexOf(_e.key)!==-1?Se.find=!0:_e.props.children&&Ve(_e.props.children,xe,Se)}})}var $e=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ze=function(xe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=xe&&typeof xe.getBoundingClientRect=="function"&&xe.getBoundingClientRect().width;if(_e){if(Se){var Z=getComputedStyle(xe),de=Z.marginLeft,te=Z.marginRight;_e+=+de.replace("px","")+ +te.replace("px","")}_e=+_e.toFixed(6)}return _e||0},Qe=function(xe,Se,_e){xe&&Object(k.a)(xe.style)==="object"&&(xe.style[Se]=_e)},Ke=function(){return ke.any},st=H("bdgK"),it=H("faye"),ut=H.n(it),Je=H("wgJM"),_t=H("l4aY"),gt=H("m+aA"),mt=H("c+Xe"),We=H("zT1h"),Et=H("QC+M");function ht(pe,xe,Se){return Se?pe[0]===xe[0]:pe[0]===xe[0]&&pe[1]===xe[1]}function Ne(pe,xe,Se){var _e=pe[xe]||{};return Object(K.a)(Object(K.a)({},_e),Se)}function nt(pe,xe,Se,_e){for(var Z=Se.points,de=Object.keys(pe),te=0;te<de.length;te+=1){var ye=de[te];if(ht(pe[ye].points,Z,_e))return"".concat(xe,"-placement-").concat(ye)}return""}var me=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var pe=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(pe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(pe==null?void 0:pe.substr(0,4)))},ve=H("MNnm");function le(pe,xe){var Se={};return Se[pe.toLowerCase()]=xe.toLowerCase(),Se["Webkit".concat(pe)]="webkit".concat(xe),Se["Moz".concat(pe)]="moz".concat(xe),Se["ms".concat(pe)]="MS".concat(xe),Se["O".concat(pe)]="o".concat(xe.toLowerCase()),Se}function q(pe,xe){var Se={animationend:le("Animation","AnimationEnd"),transitionend:le("Transition","TransitionEnd")};return pe&&("AnimationEvent"in xe||delete Se.animationend.animation,"TransitionEvent"in xe||delete Se.transitionend.transition),Se}var ie=q(Object(ve.a)(),typeof window!="undefined"?window:{}),fe={};if(Object(ve.a)()){var Ee=document.createElement("div");fe=Ee.style}var Oe={};function Ge(pe){if(Oe[pe])return Oe[pe];var xe=ie[pe];if(xe)for(var Se=Object.keys(xe),_e=Se.length,Z=0;Z<_e;Z+=1){var de=Se[Z];if(Object.prototype.hasOwnProperty.call(xe,de)&&de in fe)return Oe[pe]=xe[de],Oe[pe]}return""}var tt=Ge("animationend"),Tt=Ge("transitionend"),jt=!!(tt&&Tt),Ft=tt||"animationend",In=Tt||"transitionend";function sn(pe,xe){if(!pe)return null;if(Object(k.a)(pe)==="object"){var Se=xe.replace(/-\w/g,function(_e){return _e[1].toUpperCase()});return pe[Se]}return"".concat(pe,"-").concat(xe)}var Wt="none",Qn="appear",mn="enter",yr="leave",hr="none",En="prepare",Ar="start",br="active",Jt="end";function ln(pe){var xe=Object(L.useRef)(!1),Se=Object(L.useState)(pe),_e=Object(V.a)(Se,2),Z=_e[0],de=_e[1];function te(ye){xe.current||de(ye)}return Object(L.useEffect)(function(){return function(){xe.current=!0}},[]),[Z,te]}var _n=Object(ve.a)()?L.useLayoutEffect:L.useEffect,qn=_n,Er=function(){var pe=L.useRef(null);function xe(){Je.a.cancel(pe.current)}function Se(_e){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;xe();var de=Object(Je.a)(function(){Z<=1?_e({isCanceled:function(){return de!==pe.current}}):Se(_e,Z-1)});pe.current=de}return L.useEffect(function(){return function(){xe()}},[]),[Se,xe]},Ir=[En,Ar,br,Jt],Oa=!1,xn=!0;function Bt(pe){return pe===br||pe===Jt}var na=function(pe,xe){var Se=L.useState(hr),_e=Object(V.a)(Se,2),Z=_e[0],de=_e[1],te=Er(),ye=Object(V.a)(te,2),he=ye[0],Ce=ye[1];function we(){de(En)}return qn(function(){if(Z!==hr&&Z!==Jt){var Pe=Ir.indexOf(Z),ze=Ir[Pe+1],ot=xe(Z);ot===Oa?de(ze):he(function(dt){function Ot(){if(dt.isCanceled())return;de(ze)}ot===!0?Ot():Promise.resolve(ot).then(Ot)})}},[pe,Z]),L.useEffect(function(){return function(){Ce()}},[]),[we,Z]},ya=function(pe){var xe=Object(L.useRef)(),Se=Object(L.useRef)(pe);Se.current=pe;var _e=L.useCallback(function(te){Se.current(te)},[]);function Z(te){te&&(te.removeEventListener(In,_e),te.removeEventListener(Ft,_e))}function de(te){xe.current&&xe.current!==te&&Z(xe.current),te&&te!==xe.current&&(te.addEventListener(In,_e),te.addEventListener(Ft,_e),xe.current=te)}return L.useEffect(function(){return function(){Z(xe.current)}},[]),[de,Z]};function ra(pe,xe,Se,_e){var Z=_e.motionEnter,de=Z===void 0?!0:Z,te=_e.motionAppear,ye=te===void 0?!0:te,he=_e.motionLeave,Ce=he===void 0?!0:he,we=_e.motionDeadline,Pe=_e.motionLeaveImmediately,ze=_e.onAppearPrepare,ot=_e.onEnterPrepare,dt=_e.onLeavePrepare,Ot=_e.onAppearStart,on=_e.onEnterStart,Un=_e.onLeaveStart,An=_e.onAppearActive,Ln=_e.onEnterActive,Mn=_e.onLeaveActive,Pn=_e.onAppearEnd,wn=_e.onEnterEnd,Bn=_e.onLeaveEnd,Kn=_e.onVisibleChanged,xr=ln(),Gn=Object(V.a)(xr,2),tn=Gn[0],$t=Gn[1],Cn=ln(Wt),Zn=Object(V.a)(Cn,2),Ht=Zn[0],Jn=Zn[1],Tr=ln(null),Vn=Object(V.a)(Tr,2),pr=Vn[0],ur=Vn[1],Dr=Object(L.useRef)(!1),Mr=Object(L.useRef)(null),wr=Object(L.useRef)(!1),aa=Object(L.useRef)(null);function ba(){var mr=Se();return mr||aa.current}var fa=Object(L.useRef)(!1);function kr(mr){var ir=ba();if(mr&&!mr.deadline&&mr.target!==ir)return;var Cr;Ht===Qn&&fa.current?Cr=Pn==null?void 0:Pn(ir,mr):Ht===mn&&fa.current?Cr=wn==null?void 0:wn(ir,mr):Ht===yr&&fa.current&&(Cr=Bn==null?void 0:Bn(ir,mr)),Cr!==!1&&!wr.current&&(Jn(Wt),ur(null))}var gr=ya(kr),dr=Object(V.a)(gr,1),an=dr[0],cr=L.useMemo(function(){var mr,ir,Cr;switch(Ht){case"appear":return mr={},Object(oe.a)(mr,En,ze),Object(oe.a)(mr,Ar,Ot),Object(oe.a)(mr,br,An),mr;case"enter":return ir={},Object(oe.a)(ir,En,ot),Object(oe.a)(ir,Ar,on),Object(oe.a)(ir,br,Ln),ir;case"leave":return Cr={},Object(oe.a)(Cr,En,dt),Object(oe.a)(Cr,Ar,Un),Object(oe.a)(Cr,br,Mn),Cr;default:return{}}},[Ht]),wa=na(Ht,function(mr){if(mr===En){var ir=cr[En];return ir?ir(ba()):Oa}if(fr in cr){var Cr;ur(((Cr=cr[fr])===null||Cr===void 0?void 0:Cr.call(cr,ba(),null))||null)}return fr===br&&(an(ba()),we>0&&(clearTimeout(Mr.current),Mr.current=setTimeout(function(){kr({deadline:!0})},we))),xn}),Ba=Object(V.a)(wa,2),Xa=Ba[0],fr=Ba[1],Ia=Bt(fr);fa.current=Ia,qn(function(){$t(xe);var mr=Dr.current;if(Dr.current=!0,!pe)return;var ir;!mr&&xe&&ye&&(ir=Qn),mr&&xe&&de&&(ir=mn),(mr&&!xe&&Ce||!mr&&Pe&&!xe&&Ce)&&(ir=yr),ir&&(Jn(ir),Xa())},[xe]),Object(L.useEffect)(function(){(Ht===Qn&&!ye||Ht===mn&&!de||Ht===yr&&!Ce)&&Jn(Wt)},[ye,de,Ce]),Object(L.useEffect)(function(){return function(){clearTimeout(Mr.current),wr.current=!0}},[]),Object(L.useEffect)(function(){tn!==void 0&&Ht===Wt&&(Kn==null||Kn(tn))},[tn,Ht]);var Wa=pr;return cr[En]&&fr===Ar&&(Wa=Object(K.a)({transition:"none"},Wa)),[Ht,fr,Wa,tn!=null?tn:xe]}var Wn=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(){return Object(w.a)(this,Se),xe.apply(this,arguments)}return Object(A.a)(Se,[{key:"render",value:function(){return this.props.children}}]),Se}(L.Component),Zr=Wn;function Na(pe){var xe=pe;Object(k.a)(pe)==="object"&&(xe=pe.transitionSupport);function Se(Z){return!!(Z.motionName&&xe)}var _e=L.forwardRef(function(Z,de){var te=Z.visible,ye=te===void 0?!0:te,he=Z.removeOnLeave,Ce=he===void 0?!0:he,we=Z.forceRender,Pe=Z.children,ze=Z.motionName,ot=Z.leavedClassName,dt=Z.eventProps,Ot=Se(Z),on=Object(L.useRef)(),Un=Object(L.useRef)();function An(){try{return Object(gt.a)(on.current||Un.current)}catch(Jn){return null}}var Ln=ra(Ot,ye,An,Z),Mn=Object(V.a)(Ln,4),Pn=Mn[0],wn=Mn[1],Bn=Mn[2],Kn=Mn[3],xr=L.useRef(Kn);Kn&&(xr.current=!0);var Gn=Object(L.useRef)(de);Gn.current=de;var tn=L.useCallback(function(Jn){on.current=Jn,Object(mt.b)(Gn.current,Jn)},[]),$t,Cn=Object(K.a)(Object(K.a)({},dt),{},{visible:ye});if(!Pe)$t=null;else if(Pn===Wt||!Se(Z))Kn?$t=Pe(Object(K.a)({},Cn),tn):!Ce&&xr.current?$t=Pe(Object(K.a)(Object(K.a)({},Cn),{},{className:ot}),tn):we?$t=Pe(Object(K.a)(Object(K.a)({},Cn),{},{style:{display:"none"}}),tn):$t=null;else{var Zn,Ht;wn===En?Ht="prepare":Bt(wn)?Ht="active":wn===Ar&&(Ht="start"),$t=Pe(Object(K.a)(Object(K.a)({},Cn),{},{className:W()(sn(ze,Pn),(Zn={},Object(oe.a)(Zn,sn(ze,"".concat(Pn,"-").concat(Ht)),Ht),Object(oe.a)(Zn,ze,typeof ze=="string"),Zn)),style:Bn}),tn)}return L.createElement(Zr,{ref:Un},$t)});return _e.displayName="CSSMotion",_e}var Ja=Na(jt),ft="add",Zt="keep",qa="remove",za="removed";function ui(pe){var xe;return pe&&Object(k.a)(pe)==="object"&&"key"in pe?xe=pe:xe={key:pe},Object(K.a)(Object(K.a)({},xe),{},{key:String(xe.key)})}function Ua(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return pe.map(ui)}function di(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Se=[],_e=0,Z=xe.length,de=Ua(pe),te=Ua(xe);de.forEach(function(Ce){for(var we=!1,Pe=_e;Pe<Z;Pe+=1){var ze=te[Pe];if(ze.key===Ce.key){_e<Pe&&(Se=Se.concat(te.slice(_e,Pe).map(function(ot){return Object(K.a)(Object(K.a)({},ot),{},{status:ft})})),_e=Pe),Se.push(Object(K.a)(Object(K.a)({},ze),{},{status:Zt})),_e+=1,we=!0;break}}we||Se.push(Object(K.a)(Object(K.a)({},Ce),{},{status:qa}))}),_e<Z&&(Se=Se.concat(te.slice(_e).map(function(Ce){return Object(K.a)(Object(K.a)({},Ce),{},{status:ft})})));var ye={};Se.forEach(function(Ce){var we=Ce.key;ye[we]=(ye[we]||0)+1});var he=Object.keys(ye).filter(function(Ce){return ye[Ce]>1});return he.forEach(function(Ce){Se=Se.filter(function(we){var Pe=we.key,ze=we.status;return Pe!==Ce||ze!==qa}),Se.forEach(function(we){we.key===Ce&&(we.status=Zt)})}),Se}var gn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Pi(pe){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ja,Se=function(_e){Object(v.a)(de,_e);var Z=Object(s.a)(de);function de(){var te;return Object(w.a)(this,de),te=Z.apply(this,arguments),te.state={keyEntities:[]},te.removeKey=function(ye){te.setState(function(he){var Ce=he.keyEntities;return{keyEntities:Ce.map(function(we){return we.key!==ye?we:Object(K.a)(Object(K.a)({},we),{},{status:za})})}})},te}return Object(A.a)(de,[{key:"render",value:function(){var ye=this,he=this.state.keyEntities,Ce=this.props,we=Ce.component,Pe=Ce.children,ze=Ce.onVisibleChanged,ot=Object(I.a)(Ce,["component","children","onVisibleChanged"]),dt=we||L.Fragment,Ot={};return gn.forEach(function(on){Ot[on]=ot[on],delete ot[on]}),delete ot.keys,L.createElement(dt,ot,he.map(function(on){var Un=on.status,An=Object(I.a)(on,["status"]),Ln=Un===ft||Un===Zt;return L.createElement(xe,Object(T.a)({},Ot,{key:An.key,visible:Ln,eventProps:An,onVisibleChanged:function(Pn){ze==null||ze(Pn,{key:An.key}),Pn||ye.removeKey(An.key)}}),Pe)}))}}],[{key:"getDerivedStateFromProps",value:function(ye,he){var Ce=ye.keys,we=he.keyEntities,Pe=Ua(Ce),ze=di(we,Pe);return{keyEntities:ze.filter(function(ot){var dt=we.find(function(Ot){var on=Ot.key;return ot.key===on});return!(dt&&dt.status===za&&ot.status===qa)})}}}]),de}(L.Component);return Se.defaultProps={component:"div"},Se}var yt=Pi(jt),ja=Ja;function pa(pe){var xe=pe.prefixCls,Se=pe.motion,_e=pe.animation,Z=pe.transitionName;return Se||(_e?{motionName:"".concat(xe,"-").concat(_e)}:Z?{motionName:Z}:null)}function bi(pe){var xe=pe.prefixCls,Se=pe.visible,_e=pe.zIndex,Z=pe.mask,de=pe.maskMotion,te=pe.maskAnimation,ye=pe.maskTransitionName;if(!Z)return null;var he={};return(de||ye||te)&&(he=Object(K.a)({motionAppear:!0},pa({motion:de,prefixCls:xe,transitionName:ye,animation:te}))),L.createElement(ja,Object(T.a)({},he,{visible:Se,removeOnLeave:!0}),function(Ce){var we=Ce.className;return L.createElement("div",{style:{zIndex:_e},className:W()("".concat(xe,"-mask"),we)})})}var ei=H("9mu1"),da=H("o0o1"),ci=H.n(da),Ei=H("HaE+"),ar=["measure","align",null,"motion"],xi=function(pe,xe){var Se=Object(L.useState)(null),_e=Object(V.a)(Se,2),Z=_e[0],de=_e[1],te=Object(L.useRef)(),ye=Object(L.useRef)(!1);function he(Pe){ye.current||de(Pe)}function Ce(){Je.a.cancel(te.current)}function we(Pe){Ce(),te.current=Object(Je.a)(function(){he(function(ze){switch(Z){case"align":return"motion";case"motion":return"stable";default:}return ze}),Pe==null||Pe()})}return Object(L.useEffect)(function(){he("measure")},[pe]),Object(L.useEffect)(function(){switch(Z){case"measure":xe();break;default:}Z&&(te.current=Object(Je.a)(Object(Ei.a)(ci.a.mark(function Pe(){var ze,ot;return ci.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:ze=ar.indexOf(Z),ot=ar[ze+1],ot&&ze!==-1&&he(ot);case 3:case"end":return Ot.stop()}},Pe)}))))},[Z]),Object(L.useEffect)(function(){return function(){ye.current=!0,Ce()}},[]),[Z,we]},Yi=function(pe){var xe=L.useState({width:0,height:0}),Se=Object(V.a)(xe,2),_e=Se[0],Z=Se[1];function de(ye){Z({width:ye.offsetWidth,height:ye.offsetHeight})}var te=L.useMemo(function(){var ye={};if(pe){var he=_e.width,Ce=_e.height;pe.indexOf("height")!==-1&&Ce?ye.height=Ce:pe.indexOf("minHeight")!==-1&&Ce&&(ye.minHeight=Ce),pe.indexOf("width")!==-1&&he?ye.width=he:pe.indexOf("minWidth")!==-1&&he&&(ye.minWidth=he)}return ye},[pe,_e]);return[te,de]},Gt=L.forwardRef(function(pe,xe){var Se=pe.visible,_e=pe.prefixCls,Z=pe.className,de=pe.style,te=pe.children,ye=pe.zIndex,he=pe.stretch,Ce=pe.destroyPopupOnHide,we=pe.forceRender,Pe=pe.align,ze=pe.point,ot=pe.getRootDomNode,dt=pe.getClassNameFromAlign,Ot=pe.onAlign,on=pe.onMouseEnter,Un=pe.onMouseLeave,An=pe.onMouseDown,Ln=pe.onTouchStart,Mn=Object(L.useRef)(),Pn=Object(L.useRef)(),wn=Object(L.useState)(),Bn=Object(V.a)(wn,2),Kn=Bn[0],xr=Bn[1],Gn=Yi(he),tn=Object(V.a)(Gn,2),$t=tn[0],Cn=tn[1];function Zn(){he&&Cn(ot())}var Ht=xi(Se,Zn),Jn=Object(V.a)(Ht,2),Tr=Jn[0],Vn=Jn[1],pr=Object(L.useRef)();function ur(){return ze||ot}function Dr(){var gr;(gr=Mn.current)===null||gr===void 0||gr.forceAlign()}function Mr(gr,dr){var an=dt(dr);Kn!==an&&xr(an),Tr==="align"&&(Kn!==an?Promise.resolve().then(function(){Dr()}):Vn(function(){var cr;(cr=pr.current)===null||cr===void 0||cr.call(pr)}),Ot==null||Ot(gr,dr))}var wr=Object(K.a)({},pa(pe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(gr){var dr=wr[gr];wr[gr]=function(an,cr){return Vn(),dr==null?void 0:dr(an,cr)}});function aa(){return new Promise(function(gr){pr.current=gr})}L.useEffect(function(){!wr.motionName&&Tr==="motion"&&Vn()},[wr.motionName,Tr]),L.useImperativeHandle(xe,function(){return{forceAlign:Dr,getElement:function(){return Pn.current}}});var ba=Object(K.a)(Object(K.a)({},$t),{},{zIndex:ye,opacity:Tr==="motion"||Tr==="stable"||!Se?void 0:0,pointerEvents:Tr==="stable"?void 0:"none"},de),fa=!0;(Pe==null?void 0:Pe.points)&&(Tr==="align"||Tr==="stable")&&(fa=!1);var kr=te;return L.Children.count(te)>1&&(kr=L.createElement("div",{className:"".concat(_e,"-content")},te)),L.createElement(ja,Object(T.a)({visible:Se,ref:Pn,leavedClassName:"".concat(_e,"-hidden")},wr,{onAppearPrepare:aa,onEnterPrepare:aa,removeOnLeave:Ce,forceRender:we}),function(gr,dr){var an=gr.className,cr=gr.style,wa=W()(_e,Z,Kn,an);return L.createElement(ei.a,{target:ur(),key:"popup",ref:Mn,monitorWindowResize:!0,disabled:fa,align:Pe,onAlign:Mr},L.createElement("div",{ref:dr,className:wa,onMouseEnter:on,onMouseLeave:Un,onMouseDownCapture:An,onTouchStartCapture:Ln,style:Object(K.a)(Object(K.a)({},cr),ba)},kr))})});Gt.displayName="PopupInner";var at=Gt,Lt=L.forwardRef(function(pe,xe){var Se=pe.prefixCls,_e=pe.visible,Z=pe.zIndex,de=pe.children,te=pe.mobile;te=te===void 0?{}:te;var ye=te.popupClassName,he=te.popupStyle,Ce=te.popupMotion,we=Ce===void 0?{}:Ce,Pe=te.popupRender,ze=L.useRef();L.useImperativeHandle(xe,function(){return{forceAlign:function(){},getElement:function(){return ze.current}}});var ot=Object(K.a)({zIndex:Z},he),dt=de;return L.Children.count(de)>1&&(dt=L.createElement("div",{className:"".concat(Se,"-content")},de)),Pe&&(dt=Pe(dt)),L.createElement(ja,Object(T.a)({visible:_e,ref:ze,removeOnLeave:!0},we),function(Ot,on){var Un=Ot.className,An=Ot.style,Ln=W()(Se,ye,Un);return L.createElement("div",{ref:on,className:Ln,style:Object(K.a)(Object(K.a)({},An),ot)},dt)})});Lt.displayName="MobilePopupInner";var xt=Lt,St=["visible","mobile"],Yt=L.forwardRef(function(pe,xe){var Se=pe.visible,_e=pe.mobile,Z=Object(I.a)(pe,St),de=Object(L.useState)(Se),te=Object(V.a)(de,2),ye=te[0],he=te[1],Ce=Object(L.useState)(!1),we=Object(V.a)(Ce,2),Pe=we[0],ze=we[1],ot=Object(K.a)(Object(K.a)({},Z),{},{visible:ye});Object(L.useEffect)(function(){he(Se),Se&&_e&&ze(me())},[Se,_e]);var dt=Pe?L.createElement(xt,Object(T.a)({},ot,{mobile:_e,ref:xe})):L.createElement(at,Object(T.a)({},ot,{ref:xe}));return L.createElement("div",null,L.createElement(bi,ot),dt)});Yt.displayName="Popup";var hn=Yt,yn=L.createContext(null),qt=yn;function vn(){}function kn(){return""}function en(pe){return pe?pe.ownerDocument:window.document}var un=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function tr(pe){var xe=function(Se){Object(v.a)(Z,Se);var _e=Object(s.a)(Z);function Z(de){var te;Object(w.a)(this,Z),te=_e.call(this,de),te.popupRef=L.createRef(),te.triggerRef=L.createRef(),te.attachId=void 0,te.clickOutsideHandler=void 0,te.touchOutsideHandler=void 0,te.contextMenuOutsideHandler1=void 0,te.contextMenuOutsideHandler2=void 0,te.mouseDownTimeout=void 0,te.focusTime=void 0,te.preClickTime=void 0,te.preTouchTime=void 0,te.delayTimer=void 0,te.hasPopupMouseDown=void 0,te.onMouseEnter=function(he){var Ce=te.props.mouseEnterDelay;te.fireEvents("onMouseEnter",he),te.delaySetPopupVisible(!0,Ce,Ce?null:he)},te.onMouseMove=function(he){te.fireEvents("onMouseMove",he),te.setPoint(he)},te.onMouseLeave=function(he){te.fireEvents("onMouseLeave",he),te.delaySetPopupVisible(!1,te.props.mouseLeaveDelay)},te.onPopupMouseEnter=function(){te.clearDelayTimer()},te.onPopupMouseLeave=function(he){var Ce;if(he.relatedTarget&&!he.relatedTarget.setTimeout&&Object(_t.a)((Ce=te.popupRef.current)===null||Ce===void 0?void 0:Ce.getElement(),he.relatedTarget))return;te.delaySetPopupVisible(!1,te.props.mouseLeaveDelay)},te.onFocus=function(he){te.fireEvents("onFocus",he),te.clearDelayTimer(),te.isFocusToShow()&&(te.focusTime=Date.now(),te.delaySetPopupVisible(!0,te.props.focusDelay))},te.onMouseDown=function(he){te.fireEvents("onMouseDown",he),te.preClickTime=Date.now()},te.onTouchStart=function(he){te.fireEvents("onTouchStart",he),te.preTouchTime=Date.now()},te.onBlur=function(he){te.fireEvents("onBlur",he),te.clearDelayTimer(),te.isBlurToHide()&&te.delaySetPopupVisible(!1,te.props.blurDelay)},te.onContextMenu=function(he){he.preventDefault(),te.fireEvents("onContextMenu",he),te.setPopupVisible(!0,he)},te.onContextMenuClose=function(){te.isContextMenuToShow()&&te.close()},te.onClick=function(he){if(te.fireEvents("onClick",he),te.focusTime){var Ce;if(te.preClickTime&&te.preTouchTime?Ce=Math.min(te.preClickTime,te.preTouchTime):te.preClickTime?Ce=te.preClickTime:te.preTouchTime&&(Ce=te.preTouchTime),Math.abs(Ce-te.focusTime)<20)return;te.focusTime=0}te.preClickTime=0,te.preTouchTime=0,te.isClickToShow()&&(te.isClickToHide()||te.isBlurToHide())&&he&&he.preventDefault&&he.preventDefault();var we=!te.state.popupVisible;(te.isClickToHide()&&!we||we&&te.isClickToShow())&&te.setPopupVisible(!te.state.popupVisible,he)},te.onPopupMouseDown=function(){if(te.hasPopupMouseDown=!0,clearTimeout(te.mouseDownTimeout),te.mouseDownTimeout=window.setTimeout(function(){te.hasPopupMouseDown=!1},0),te.context){var he;(he=te.context).onPopupMouseDown.apply(he,arguments)}},te.onDocumentClick=function(he){if(te.props.mask&&!te.props.maskClosable)return;var Ce=he.target,we=te.getRootDomNode(),Pe=te.getPopupDomNode();(!Object(_t.a)(we,Ce)||te.isContextMenuOnly())&&!Object(_t.a)(Pe,Ce)&&!te.hasPopupMouseDown&&te.close()},te.getRootDomNode=function(){var he=te.props.getTriggerDOMNode;if(he)return he(te.triggerRef.current);try{var Ce=Object(gt.a)(te.triggerRef.current);if(Ce)return Ce}catch(we){}return ut.a.findDOMNode(Object(m.a)(te))},te.getPopupClassNameFromAlign=function(he){var Ce=[],we=te.props,Pe=we.popupPlacement,ze=we.builtinPlacements,ot=we.prefixCls,dt=we.alignPoint,Ot=we.getPopupClassNameFromAlign;return Pe&&ze&&Ce.push(nt(ze,ot,he,dt)),Ot&&Ce.push(Ot(he)),Ce.join(" ")},te.getComponent=function(){var he=te.props,Ce=he.prefixCls,we=he.destroyPopupOnHide,Pe=he.popupClassName,ze=he.onPopupAlign,ot=he.popupMotion,dt=he.popupAnimation,Ot=he.popupTransitionName,on=he.popupStyle,Un=he.mask,An=he.maskAnimation,Ln=he.maskTransitionName,Mn=he.maskMotion,Pn=he.zIndex,wn=he.popup,Bn=he.stretch,Kn=he.alignPoint,xr=he.mobile,Gn=he.forceRender,tn=te.state,$t=tn.popupVisible,Cn=tn.point,Zn=te.getPopupAlign(),Ht={};return te.isMouseEnterToShow()&&(Ht.onMouseEnter=te.onPopupMouseEnter),te.isMouseLeaveToHide()&&(Ht.onMouseLeave=te.onPopupMouseLeave),Ht.onMouseDown=te.onPopupMouseDown,Ht.onTouchStart=te.onPopupMouseDown,L.createElement(hn,Object(T.a)({prefixCls:Ce,destroyPopupOnHide:we,visible:$t,point:Kn&&Cn,className:Pe,align:Zn,onAlign:ze,animation:dt,getClassNameFromAlign:te.getPopupClassNameFromAlign},Ht,{stretch:Bn,getRootDomNode:te.getRootDomNode,style:on,mask:Un,zIndex:Pn,transitionName:Ot,maskAnimation:An,maskTransitionName:Ln,maskMotion:Mn,ref:te.popupRef,motion:ot,mobile:xr,forceRender:Gn}),typeof wn=="function"?wn():wn)},te.attachParent=function(he){Je.a.cancel(te.attachId);var Ce=te.props,we=Ce.getPopupContainer,Pe=Ce.getDocument,ze=te.getRootDomNode(),ot;we?(ze||we.length===0)&&(ot=we(ze)):ot=Pe(te.getRootDomNode()).body,ot?ot.appendChild(he):te.attachId=Object(Je.a)(function(){te.attachParent(he)})},te.getContainer=function(){var he=te.props.getDocument,Ce=he(te.getRootDomNode()).createElement("div");return Ce.style.position="absolute",Ce.style.top="0",Ce.style.left="0",Ce.style.width="100%",te.attachParent(Ce),Ce},te.setPoint=function(he){var Ce=te.props.alignPoint;if(!Ce||!he)return;te.setState({point:{pageX:he.pageX,pageY:he.pageY}})},te.handlePortalUpdate=function(){te.state.prevPopupVisible!==te.state.popupVisible&&te.props.afterPopupVisibleChange(te.state.popupVisible)},te.triggerContextValue={onPopupMouseDown:te.onPopupMouseDown};var ye;return"popupVisible"in de?ye=!!de.popupVisible:ye=!!de.defaultPopupVisible,te.state={prevPopupVisible:ye,popupVisible:ye},un.forEach(function(he){te["fire".concat(he)]=function(Ce){te.fireEvents(he,Ce)}}),te}return Object(A.a)(Z,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var te=this.props,ye=this.state;if(ye.popupVisible){var he;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(he=te.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(We.a)(he,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(he=he||te.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(We.a)(he,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(he=he||te.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(We.a)(he,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(We.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Je.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var te;return((te=this.popupRef.current)===null||te===void 0?void 0:te.getElement())||null}},{key:"getPopupAlign",value:function(){var te=this.props,ye=te.popupPlacement,he=te.popupAlign,Ce=te.builtinPlacements;return ye&&Ce?Ne(Ce,ye,he):he}},{key:"setPopupVisible",value:function(te,ye){var he=this.props.alignPoint,Ce=this.state.popupVisible;this.clearDelayTimer(),Ce!==te&&("popupVisible"in this.props||this.setState({popupVisible:te,prevPopupVisible:Ce}),this.props.onPopupVisibleChange(te)),he&&ye&&te&&this.setPoint(ye)}},{key:"delaySetPopupVisible",value:function(te,ye,he){var Ce=this,we=ye*1e3;if(this.clearDelayTimer(),we){var Pe=he?{pageX:he.pageX,pageY:he.pageY}:null;this.delayTimer=window.setTimeout(function(){Ce.setPopupVisible(te,Pe),Ce.clearDelayTimer()},we)}else this.setPopupVisible(te,he)}},{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(te){var ye=this.props.children.props,he=this.props;return ye[te]&&he[te]?this["fire".concat(te)]:ye[te]||he[te]}},{key:"isClickToShow",value:function(){var te=this.props,ye=te.action,he=te.showAction;return ye.indexOf("click")!==-1||he.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var te=this.props.action;return te==="contextMenu"||te.length===1&&te[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var te=this.props,ye=te.action,he=te.showAction;return ye.indexOf("contextMenu")!==-1||he.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var te=this.props,ye=te.action,he=te.hideAction;return ye.indexOf("click")!==-1||he.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var te=this.props,ye=te.action,he=te.showAction;return ye.indexOf("hover")!==-1||he.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var te=this.props,ye=te.action,he=te.hideAction;return ye.indexOf("hover")!==-1||he.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var te=this.props,ye=te.action,he=te.showAction;return ye.indexOf("focus")!==-1||he.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var te=this.props,ye=te.action,he=te.hideAction;return ye.indexOf("focus")!==-1||he.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var te;(te=this.popupRef.current)===null||te===void 0||te.forceAlign()}}},{key:"fireEvents",value:function(te,ye){var he=this.props.children.props[te];he&&he(ye);var Ce=this.props[te];Ce&&Ce(ye)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var te=this.state.popupVisible,ye=this.props,he=ye.children,Ce=ye.forceRender,we=ye.alignPoint,Pe=ye.className,ze=ye.autoDestroy,ot=L.Children.only(he),dt={key:"trigger"};this.isContextMenuToShow()?dt.onContextMenu=this.onContextMenu:dt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(dt.onClick=this.onClick,dt.onMouseDown=this.onMouseDown,dt.onTouchStart=this.onTouchStart):(dt.onClick=this.createTwoChains("onClick"),dt.onMouseDown=this.createTwoChains("onMouseDown"),dt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(dt.onMouseEnter=this.onMouseEnter,we&&(dt.onMouseMove=this.onMouseMove)):dt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?dt.onMouseLeave=this.onMouseLeave:dt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(dt.onFocus=this.onFocus,dt.onBlur=this.onBlur):(dt.onFocus=this.createTwoChains("onFocus"),dt.onBlur=this.createTwoChains("onBlur"));var Ot=W()(ot&&ot.props&&ot.props.className,Pe);Ot&&(dt.className=Ot);var on=Object(K.a)({},dt);Object(mt.c)(ot)&&(on.ref=Object(mt.a)(this.triggerRef,ot.ref));var Un=L.cloneElement(ot,on),An;return(te||this.popupRef.current||Ce)&&(An=L.createElement(pe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!te&&ze&&(An=null),L.createElement(qt.Provider,{value:this.triggerContextValue},Un,An)}}],[{key:"getDerivedStateFromProps",value:function(te,ye){var he=te.popupVisible,Ce={};return he!==void 0&&ye.popupVisible!==he&&(Ce.popupVisible=he,Ce.prevPopupVisible=ye.popupVisible),Ce}}]),Z}(L.Component);return xe.contextType=qt,xe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:kn,getDocument:en,onPopupVisibleChange:vn,afterPopupVisibleChange:vn,onPopupAlign:vn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},xe}var Nn=tr(Et.a),kt={adjustX:1,adjustY:1},pn={topLeft:{points:["bl","tl"],overflow:kt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:kt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:kt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:kt,offset:[4,0]}},er={topLeft:{points:["bl","tl"],overflow:kt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:kt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:kt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:kt,offset:[4,0]}},Rn=pn,zt=0,rn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Tn=function(xe,Se,_e){var Z=Ie(Se),de=xe.getState();xe.setState({defaultActiveFirst:Object(K.a)(Object(K.a)({},de.defaultActiveFirst),{},Object(oe.a)({},Z,_e))})},Pt=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(_e){var Z;Object(w.a)(this,Se),Z=xe.call(this,_e),Z.onDestroy=function(we){Z.props.onDestroy(we)},Z.onKeyDown=function(we){var Pe=we.keyCode,ze=Z.menuInstance,ot=Z.props.store,dt=Z.getVisible();if(Pe===d.a.ENTER)return Z.onTitleClick(we),Tn(ot,Z.props.eventKey,!0),!0;if(Pe===d.a.RIGHT)return dt?ze.onKeyDown(we):(Z.triggerOpenChange(!0),Tn(ot,Z.props.eventKey,!0)),!0;if(Pe===d.a.LEFT){var Ot;if(dt)Ot=ze.onKeyDown(we);else return;return Ot||(Z.triggerOpenChange(!1),Ot=!0),Ot}return dt&&(Pe===d.a.UP||Pe===d.a.DOWN)?ze.onKeyDown(we):void 0},Z.onOpenChange=function(we){Z.props.onOpenChange(we)},Z.onPopupVisibleChange=function(we){Z.triggerOpenChange(we,we?"mouseenter":"mouseleave")},Z.onMouseEnter=function(we){var Pe=Z.props,ze=Pe.eventKey,ot=Pe.onMouseEnter,dt=Pe.store;Tn(dt,Z.props.eventKey,!1),ot({key:ze,domEvent:we})},Z.onMouseLeave=function(we){var Pe=Z.props,ze=Pe.parentMenu,ot=Pe.eventKey,dt=Pe.onMouseLeave;ze.subMenuInstance=Object(m.a)(Z),dt({key:ot,domEvent:we})},Z.onTitleMouseEnter=function(we){var Pe=Z.props,ze=Pe.eventKey,ot=Pe.onItemHover,dt=Pe.onTitleMouseEnter;ot({key:ze,hover:!0}),dt({key:ze,domEvent:we})},Z.onTitleMouseLeave=function(we){var Pe=Z.props,ze=Pe.parentMenu,ot=Pe.eventKey,dt=Pe.onItemHover,Ot=Pe.onTitleMouseLeave;ze.subMenuInstance=Object(m.a)(Z),dt({key:ot,hover:!1}),Ot({key:ot,domEvent:we})},Z.onTitleClick=function(we){var Pe=Object(m.a)(Z),ze=Pe.props;if(ze.onTitleClick({key:ze.eventKey,domEvent:we}),ze.triggerSubMenuAction==="hover")return;Z.triggerOpenChange(!Z.getVisible(),"click"),Tn(ze.store,Z.props.eventKey,!1)},Z.onSubMenuClick=function(we){typeof Z.props.onClick=="function"&&Z.props.onClick(Z.addKeyPath(we))},Z.onSelect=function(we){Z.props.onSelect(we)},Z.onDeselect=function(we){Z.props.onDeselect(we)},Z.getPrefixCls=function(){return"".concat(Z.props.rootPrefixCls,"-submenu")},Z.getActiveClassName=function(){return"".concat(Z.getPrefixCls(),"-active")},Z.getDisabledClassName=function(){return"".concat(Z.getPrefixCls(),"-disabled")},Z.getSelectedClassName=function(){return"".concat(Z.getPrefixCls(),"-selected")},Z.getOpenClassName=function(){return"".concat(Z.props.rootPrefixCls,"-submenu-open")},Z.getVisible=function(){return Z.state.isOpen},Z.getMode=function(){return Z.state.mode},Z.saveMenuInstance=function(we){Z.menuInstance=we},Z.addKeyPath=function(we){return Object(K.a)(Object(K.a)({},we),{},{keyPath:(we.keyPath||[]).concat(Z.props.eventKey)})},Z.triggerOpenChange=function(we,Pe){var ze=Z.props.eventKey,ot=function(){Z.onOpenChange({key:ze,item:Object(m.a)(Z),trigger:Pe,open:we})};Pe==="mouseenter"?Z.mouseenterTimeout=setTimeout(function(){ot()},0):ot()},Z.isChildrenSelected=function(){var we={find:!1};return Ve(Z.props.children,Z.props.selectedKeys,we),we.find},Z.isInlineMode=function(){return Z.getMode()==="inline"},Z.adjustWidth=function(){if(!Z.subMenuTitle||!Z.menuInstance)return;var we=it.findDOMNode(Z.menuInstance);if(we.offsetWidth>=Z.subMenuTitle.offsetWidth)return;we.style.minWidth="".concat(Z.subMenuTitle.offsetWidth,"px")},Z.saveSubMenuTitle=function(we){Z.subMenuTitle=we},Z.getBaseProps=function(){var we=Object(m.a)(Z),Pe=we.props,ze=Z.getMode();return{mode:ze==="horizontal"?"vertical":ze,visible:Z.getVisible(),level:Pe.level+1,inlineIndent:Pe.inlineIndent,focusable:!1,onClick:Z.onSubMenuClick,onSelect:Z.onSelect,onDeselect:Z.onDeselect,onDestroy:Z.onDestroy,selectedKeys:Pe.selectedKeys,eventKey:"".concat(Pe.eventKey,"-menu-"),openKeys:Pe.openKeys,motion:Pe.motion,onOpenChange:Z.onOpenChange,subMenuOpenDelay:Pe.subMenuOpenDelay,parentMenu:Object(m.a)(Z),subMenuCloseDelay:Pe.subMenuCloseDelay,forceSubMenuRender:Pe.forceSubMenuRender,triggerSubMenuAction:Pe.triggerSubMenuAction,builtinPlacements:Pe.builtinPlacements,defaultActiveFirst:Pe.store.getState().defaultActiveFirst[Ie(Pe.eventKey)],multiple:Pe.multiple,prefixCls:Pe.rootPrefixCls,id:Z.internalMenuId,manualRef:Z.saveMenuInstance,itemIcon:Pe.itemIcon,expandIcon:Pe.expandIcon,direction:Pe.direction}},Z.getMotion=function(we,Pe){var ze=Object(m.a)(Z),ot=ze.haveRendered,dt=Z.props,Ot=dt.motion,on=dt.rootPrefixCls,Un=Object(K.a)(Object(K.a)({},Ot),{},{leavedClassName:"".concat(on,"-hidden"),removeOnLeave:!1,motionAppear:ot||!Pe||we!=="inline"});return Un};var de=_e.store,te=_e.eventKey,ye=de.getState(),he=ye.defaultActiveFirst;Z.isRootMenu=!1;var Ce=!1;return he&&(Ce=he[te]),Tn(de,te,Ce),Z.state={mode:_e.mode,isOpen:_e.isOpen},Z}return Object(A.a)(Se,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Z=this,de=this.props,te=de.mode,ye=de.parentMenu,he=de.manualRef,Ce=de.isOpen,we=function(){Z.setState({mode:te,isOpen:Ce})},Pe=Ce!==this.state.isOpen,ze=te!==this.state.mode;if((ze||Pe)&&(Je.a.cancel(this.updateStateRaf),ze?this.updateStateRaf=Object(Je.a)(we):we()),he&&he(this),te!=="horizontal"||!(ye==null?void 0:ye.isRootMenu)||!Ce)return;this.minWidthTimeout=setTimeout(function(){return Z.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Z=this.props,de=Z.onDestroy,te=Z.eventKey;de&&de(te),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Je.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(Z,de){var te=this.getBaseProps();return L.createElement($n,Object(T.a)({},te,{id:this.internalMenuId,className:Z,style:de}),this.props.children)}},{key:"renderChildren",value:function(){var Z=this,de=this.getBaseProps(),te=de.mode,ye=de.visible,he=de.forceSubMenuRender,Ce=de.direction,we=this.getMotion(te,ye);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ye||he,!this.haveOpened)return L.createElement("div",null);var Pe=W()("".concat(de.prefixCls,"-sub"),Object(oe.a)({},"".concat(de.prefixCls,"-rtl"),Ce==="rtl"));return this.isInlineMode()?L.createElement(ja,Object(T.a)({visible:de.visible,forceRender:he},we),function(ze){var ot=ze.className,dt=ze.style,Ot=W()(Pe,ot);return Z.renderPopupMenu(Ot,dt)}):this.renderPopupMenu(Pe)}},{key:"render",value:function(){var Z,de,te,ye=Object(K.a)({},this.props),he=this.getVisible(),Ce=this.getPrefixCls(),we=this.isInlineMode(),Pe=this.getMode(),ze=W()(Ce,"".concat(Ce,"-").concat(Pe),(Z={},Object(oe.a)(Z,ye.className,!!ye.className),Object(oe.a)(Z,this.getOpenClassName(),he),Object(oe.a)(Z,this.getActiveClassName(),ye.active||he&&!we),Object(oe.a)(Z,this.getDisabledClassName(),ye.disabled),Object(oe.a)(Z,this.getSelectedClassName(),this.isChildrenSelected()),Z));this.internalMenuId||(ye.eventKey?this.internalMenuId="".concat(ye.eventKey,"$Menu"):(zt+=1,this.internalMenuId="$__$".concat(zt,"$Menu")));var ot={},dt={},Ot={};ye.disabled||(ot={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},dt={onClick:this.onTitleClick},Ot={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var on={},Un=ye.direction,An=Un==="rtl";we&&(An?on.paddingRight=ye.inlineIndent*ye.level:on.paddingLeft=ye.inlineIndent*ye.level);var Ln={};this.getVisible()&&(Ln={"aria-owns":this.internalMenuId});var Mn=null;Pe!=="horizontal"&&(Mn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Mn=L.createElement(this.props.expandIcon,Object(K.a)({},this.props))));var Pn=L.createElement("div",Object(T.a)({ref:this.saveSubMenuTitle,style:on,className:"".concat(Ce,"-title"),role:"button"},Ot,dt,{"aria-expanded":he},Ln,{"aria-haspopup":"true",title:typeof ye.title=="string"?ye.title:void 0}),ye.title,Mn||L.createElement("i",{className:"".concat(Ce,"-arrow")})),wn=this.renderChildren(),Bn=((de=ye.parentMenu)===null||de===void 0?void 0:de.isRootMenu)?ye.parentMenu.props.getPopupContainer:function(ur){return ur.parentNode},Kn=rn[Pe],xr=ye.popupOffset?{offset:ye.popupOffset}:{},Gn=W()((te={},Object(oe.a)(te,ye.popupClassName,ye.popupClassName&&!we),Object(oe.a)(te,"".concat(Ce,"-rtl"),An),te)),tn=ye.disabled,$t=ye.triggerSubMenuAction,Cn=ye.subMenuOpenDelay,Zn=ye.forceSubMenuRender,Ht=ye.subMenuCloseDelay,Jn=ye.builtinPlacements;$e.forEach(function(ur){return delete ye[ur]}),delete ye.onClick;var Tr=An?Object(K.a)(Object(K.a)({},er),Jn):Object(K.a)(Object(K.a)({},pn),Jn);delete ye.direction;var Vn=this.getBaseProps(),pr=we?null:this.getMotion(Vn.mode,Vn.visible);return L.createElement("li",Object(T.a)({},ye,ot,{className:ze,role:"menuitem"}),L.createElement(Nn,{prefixCls:Ce,popupClassName:W()("".concat(Ce,"-popup"),Gn),getPopupContainer:Bn,builtinPlacements:Tr,popupPlacement:Kn,popupVisible:we?!1:he,popupAlign:xr,popup:we?null:wn,action:tn||we?[]:[$t],mouseEnterDelay:Cn,mouseLeaveDelay:Ht,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Zn,popupMotion:pr},Pn),we?wn:null)}}]),Se}(L.Component);Pt.defaultProps={onMouseEnter:De,onMouseLeave:De,onTitleMouseEnter:De,onTitleMouseLeave:De,onTitleClick:De,manualRef:De,mode:"vertical",title:""};var It=Object(o.b)(function(pe,xe){var Se=pe.openKeys,_e=pe.activeKey,Z=pe.selectedKeys,de=xe.eventKey,te=xe.subMenuKey;return{isOpen:Se.indexOf(de)>-1,active:_e[te]===de,selectedKeys:Z}})(Pt);It.isSubMenu=!0;var Mt=It,Ae="menuitem-overflowed",Vt=.5,dn=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(){var _e;return Object(w.a)(this,Se),_e=xe.apply(this,arguments),_e.resizeObserver=null,_e.mutationObserver=null,_e.originalTotalWidth=0,_e.overflowedItems=[],_e.menuItemSizes=[],_e.cancelFrameId=null,_e.state={lastVisibleIndex:void 0},_e.childRef=L.createRef(),_e.getMenuItemNodes=function(){var Z=_e.props.prefixCls,de=_e.childRef.current;return de?[].slice.call(de.children).filter(function(te){return te.className.split(" ").indexOf("".concat(Z,"-overflowed-submenu"))<0}):[]},_e.getOverflowedSubMenuItem=function(Z,de,te){var ye=_e.props,he=ye.overflowedIndicator,Ce=ye.level,we=ye.mode,Pe=ye.prefixCls,ze=ye.theme;if(Ce!==1||we!=="horizontal")return null;var ot=_e.props.children[0],dt=ot.props,Ot=dt.children,on=dt.title,Un=dt.style,An=Object(I.a)(dt,["children","title","style"]),Ln=Object(K.a)({},Un),Mn="".concat(Z,"-overflowed-indicator"),Pn="".concat(Z,"-overflowed-indicator");de.length===0&&te!==!0?Ln=Object(K.a)(Object(K.a)({},Ln),{},{display:"none"}):te&&(Ln=Object(K.a)(Object(K.a)({},Ln),{},{visibility:"hidden",position:"absolute"}),Mn="".concat(Mn,"-placeholder"),Pn="".concat(Pn,"-placeholder"));var wn=ze?"".concat(Pe,"-").concat(ze):"",Bn={};return $e.forEach(function(Kn){An[Kn]!==void 0&&(Bn[Kn]=An[Kn])}),L.createElement(Mt,Object(T.a)({title:he,className:"".concat(Pe,"-overflowed-submenu"),popupClassName:wn},Bn,{key:Mn,eventKey:Pn,disabled:!1,style:Ln}),de)},_e.setChildrenWidthAndResize=function(){if(_e.props.mode!=="horizontal")return;var Z=_e.childRef.current;if(!Z)return;var de=Z.children;if(!de||de.length===0)return;var te=Z.children[de.length-1];Qe(te,"display","inline-block");var ye=_e.getMenuItemNodes(),he=ye.filter(function(Ce){return Ce.className.split(" ").indexOf(Ae)>=0});he.forEach(function(Ce){Qe(Ce,"display","inline-block")}),_e.menuItemSizes=ye.map(function(Ce){return Ze(Ce,!0)}),he.forEach(function(Ce){Qe(Ce,"display","none")}),_e.overflowedIndicatorWidth=Ze(Z.children[Z.children.length-1],!0),_e.originalTotalWidth=_e.menuItemSizes.reduce(function(Ce,we){return Ce+we},0),_e.handleResize(),Qe(te,"display","none")},_e.handleResize=function(){if(_e.props.mode!=="horizontal")return;var Z=_e.childRef.current;if(!Z)return;var de=Ze(Z);_e.overflowedItems=[];var te=0,ye;_e.originalTotalWidth>de+Vt&&(ye=-1,_e.menuItemSizes.forEach(function(he){te+=he,te+_e.overflowedIndicatorWidth<=de&&(ye+=1)})),_e.setState({lastVisibleIndex:ye})},_e}return Object(A.a)(Se,[{key:"componentDidMount",value:function(){var Z=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var de=this.childRef.current;if(!de)return;this.resizeObserver=new st.default(function(te){te.forEach(function(){var ye=Z.cancelFrameId;cancelAnimationFrame(ye),Z.cancelFrameId=requestAnimationFrame(Z.setChildrenWidthAndResize)})}),[].slice.call(de.children).concat(de).forEach(function(te){Z.resizeObserver.observe(te)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Z.resizeObserver.disconnect(),[].slice.call(de.children).concat(de).forEach(function(te){Z.resizeObserver.observe(te)}),Z.setChildrenWidthAndResize()}),this.mutationObserver.observe(de,{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(Z){var de=this,te=this.state.lastVisibleIndex;return(Z||[]).reduce(function(ye,he,Ce){var we=he;if(de.props.mode==="horizontal"){var Pe=de.getOverflowedSubMenuItem(he.props.eventKey,[]);te!==void 0&&de.props.className.indexOf("".concat(de.props.prefixCls,"-root"))!==-1&&(Ce>te&&(we=L.cloneElement(he,{style:{display:"none"},eventKey:"".concat(he.props.eventKey,"-hidden"),className:"".concat(Ae)})),Ce===te+1&&(de.overflowedItems=Z.slice(te+1).map(function(ot){return L.cloneElement(ot,{key:ot.props.eventKey,mode:"vertical-left"})}),Pe=de.getOverflowedSubMenuItem(he.props.eventKey,de.overflowedItems)));var ze=[].concat(Object(D.a)(ye),[Pe,we]);return Ce===Z.length-1&&ze.push(de.getOverflowedSubMenuItem(he.props.eventKey,[],!0)),ze}return[].concat(Object(D.a)(ye),[we])},[])}},{key:"render",value:function(){var Z=this.props,de=Z.visible,te=Z.prefixCls,ye=Z.overflowedIndicator,he=Z.mode,Ce=Z.level,we=Z.tag,Pe=Z.children,ze=Z.theme,ot=Object(I.a)(Z,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),dt=we;return L.createElement(dt,Object(T.a)({ref:this.childRef},ot),this.renderChildren(Pe))}}]),Se}(L.Component);dn.defaultProps={tag:"div",className:""};var sr=dn;function cn(pe){return pe.length?pe.every(function(xe){return!!xe.props.disabled}):!0}function Hr(pe,xe,Se){var _e=pe.getState();pe.setState({activeKey:Object(K.a)(Object(K.a)({},_e.activeKey),{},Object(oe.a)({},xe,Se))})}function Kr(pe){return pe.eventKey||"0-menu-"}function Sr(pe,xe){var Se=xe,_e=pe.children,Z=pe.eventKey;if(Se){var de;if(Re(_e,function(te,ye){te&&te.props&&!te.props.disabled&&Se===Ue(te,Z,ye)&&(de=!0)}),de)return Se}return Se=null,pe.defaultActiveFirst&&Re(_e,function(te,ye){!Se&&te&&!te.props.disabled&&(Se=Ue(te,Z,ye))}),Se}function On(pe){if(!pe)return;var xe=this.instanceArray.indexOf(pe);xe!==-1?this.instanceArray[xe]=pe:this.instanceArray.push(pe)}var At=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(_e){var Z;return Object(w.a)(this,Se),Z=xe.call(this,_e),Z.onKeyDown=function(de,te){var ye=de.keyCode,he;if(Z.getFlatInstanceArray().forEach(function(we){we&&we.props.active&&we.onKeyDown&&(he=we.onKeyDown(de))}),he)return 1;var Ce=null;return(ye===d.a.UP||ye===d.a.DOWN)&&(Ce=Z.step(ye===d.a.UP?-1:1)),Ce?(de.preventDefault(),Hr(Z.props.store,Kr(Z.props),Ce.props.eventKey),typeof te=="function"&&te(Ce),1):void 0},Z.onItemHover=function(de){var te=de.key,ye=de.hover;Hr(Z.props.store,Kr(Z.props),ye?te:null)},Z.onDeselect=function(de){Z.props.onDeselect(de)},Z.onSelect=function(de){Z.props.onSelect(de)},Z.onClick=function(de){Z.props.onClick(de)},Z.onOpenChange=function(de){Z.props.onOpenChange(de)},Z.onDestroy=function(de){Z.props.onDestroy(de)},Z.getFlatInstanceArray=function(){return Z.instanceArray},Z.step=function(de){var te=Z.getFlatInstanceArray(),ye=Z.props.store.getState().activeKey[Kr(Z.props)],he=te.length;if(!he)return null;de<0&&(te=te.concat().reverse());var Ce=-1;if(te.every(function(ot,dt){return ot&&ot.props.eventKey===ye?(Ce=dt,!1):!0}),!Z.props.defaultActiveFirst&&Ce!==-1&&cn(te.slice(Ce,he-1)))return;var we=(Ce+1)%he,Pe=we;do{var ze=te[Pe];if(!ze||ze.props.disabled)Pe=(Pe+1)%he;else return ze}while(Pe!==we);return null},Z.renderCommonMenuItem=function(de,te,ye){var he=Z.props.store.getState(),Ce=Object(m.a)(Z),we=Ce.props,Pe=Ue(de,we.eventKey,te),ze=de.props;if(!ze||typeof de.type=="string")return de;var ot=Pe===he.activeKey,dt=Object(K.a)(Object(K.a)({mode:ze.mode||we.mode,level:we.level,inlineIndent:we.inlineIndent,renderMenuItem:Z.renderMenuItem,rootPrefixCls:we.prefixCls,index:te,parentMenu:we.parentMenu,manualRef:ze.disabled?void 0:Object(g.a)(de.ref,On.bind(Object(m.a)(Z))),eventKey:Pe,active:!ze.disabled&&ot,multiple:we.multiple,onClick:function(on){(ze.onClick||De)(on),Z.onClick(on)},onItemHover:Z.onItemHover,motion:we.motion,subMenuOpenDelay:we.subMenuOpenDelay,subMenuCloseDelay:we.subMenuCloseDelay,forceSubMenuRender:we.forceSubMenuRender,onOpenChange:Z.onOpenChange,onDeselect:Z.onDeselect,onSelect:Z.onSelect,builtinPlacements:we.builtinPlacements,itemIcon:ze.itemIcon||Z.props.itemIcon,expandIcon:ze.expandIcon||Z.props.expandIcon},ye),{},{direction:we.direction});return(we.mode==="inline"||Ke())&&(dt.triggerSubMenuAction="click"),L.cloneElement(de,Object(K.a)(Object(K.a)({},dt),{},{key:Pe||te}))},Z.renderMenuItem=function(de,te,ye){if(!de)return null;var he=Z.props.store.getState(),Ce={openKeys:he.openKeys,selectedKeys:he.selectedKeys,triggerSubMenuAction:Z.props.triggerSubMenuAction,subMenuKey:ye};return Z.renderCommonMenuItem(de,te,Ce)},_e.store.setState({activeKey:Object(K.a)(Object(K.a)({},_e.store.getState().activeKey),{},Object(oe.a)({},_e.eventKey,Sr(_e,_e.activeKey)))}),Z.instanceArray=[],Z}return Object(A.a)(Se,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Z){return this.props.visible||Z.visible||this.props.className!==Z.className||!M()(this.props.style,Z.style)}},{key:"componentDidUpdate",value:function(Z){var de=this.props,te="activeKey"in de?de.activeKey:de.store.getState().activeKey[Kr(de)],ye=Sr(de,te);if(ye!==te)Hr(de.store,Kr(de),ye);else if("activeKey"in Z){var he=Sr(Z,Z.activeKey);ye!==he&&Hr(de.store,Kr(de),ye)}}},{key:"render",value:function(){var Z=this,de=Object(T.a)({},this.props);this.instanceArray=[];var te=W()(de.prefixCls,de.className,"".concat(de.prefixCls,"-").concat(de.mode)),ye={className:te,role:de.role||"menu"};de.id&&(ye.id=de.id),de.focusable&&(ye.tabIndex=0,ye.onKeyDown=this.onKeyDown);var he=de.prefixCls,Ce=de.eventKey,we=de.visible,Pe=de.level,ze=de.mode,ot=de.overflowedIndicator,dt=de.theme;return $e.forEach(function(Ot){return delete de[Ot]}),delete de.onClick,L.createElement(sr,Object(T.a)({},de,{prefixCls:he,mode:ze,tag:"ul",level:Pe,theme:dt,visible:we,overflowedIndicator:ot},ye),Object(F.a)(de.children).map(function(Ot,on){return Z.renderMenuItem(Ot,on,Ce||"0-menu-")}))}}]),Se}(L.Component);At.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:De};var lr=Object(o.b)()(At),$n=lr,jn=H("Kwbf");function Gr(pe,xe,Se){var _e=pe.prefixCls,Z=pe.motion,de=pe.defaultMotions,te=de===void 0?{}:de,ye=pe.openAnimation,he=pe.openTransitionName,Ce=xe.switchingModeFromInline;if(Z)return Z;if(Object(k.a)(ye)==="object"&&ye)Object(jn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ye=="string")return{motionName:"".concat(_e,"-open-").concat(ye)};if(he)return{motionName:he};var we=te[Se];return we||(Ce?null:te.other)}var Rt=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(_e){var Z;Object(w.a)(this,Se),Z=xe.call(this,_e),Z.onSelect=function(ye){var he=Object(m.a)(Z),Ce=he.props;if(Ce.selectable){var we=Z.store.getState(),Pe=we.selectedKeys,ze=ye.key;Ce.multiple?Pe=Pe.concat([ze]):Pe=[ze],"selectedKeys"in Ce||Z.store.setState({selectedKeys:Pe}),Ce.onSelect(Object(K.a)(Object(K.a)({},ye),{},{selectedKeys:Pe}))}},Z.onClick=function(ye){var he=Z.getRealMenuMode(),Ce=Object(m.a)(Z),we=Ce.store,Pe=Ce.props.onOpenChange;he!=="inline"&&!("openKeys"in Z.props)&&(we.setState({openKeys:[]}),Pe([])),Z.props.onClick(ye)},Z.onKeyDown=function(ye,he){Z.innerMenu.getWrappedInstance().onKeyDown(ye,he)},Z.onOpenChange=function(ye){var he=Object(m.a)(Z),Ce=he.props,we=Z.store.getState().openKeys.concat(),Pe=!1,ze=function(dt){var Ot=!1;if(dt.open)Ot=we.indexOf(dt.key)===-1,Ot&&we.push(dt.key);else{var on=we.indexOf(dt.key);Ot=on!==-1,Ot&&we.splice(on,1)}Pe=Pe||Ot};Array.isArray(ye)?ye.forEach(ze):ze(ye),Pe&&("openKeys"in Z.props||Z.store.setState({openKeys:we}),Ce.onOpenChange(we))},Z.onDeselect=function(ye){var he=Object(m.a)(Z),Ce=he.props;if(Ce.selectable){var we=Z.store.getState().selectedKeys.concat(),Pe=ye.key,ze=we.indexOf(Pe);ze!==-1&&we.splice(ze,1),"selectedKeys"in Ce||Z.store.setState({selectedKeys:we}),Ce.onDeselect(Object(K.a)(Object(K.a)({},ye),{},{selectedKeys:we}))}},Z.onMouseEnter=function(ye){Z.restoreModeVerticalFromInline();var he=Z.props.onMouseEnter;he&&he(ye)},Z.onTransitionEnd=function(ye){var he=ye.propertyName==="width"&&ye.target===ye.currentTarget,Ce=ye.target.className,we=Object.prototype.toString.call(Ce)==="[object SVGAnimatedString]"?Ce.animVal:Ce,Pe=ye.propertyName==="font-size"&&we.indexOf("anticon")>=0;(he||Pe)&&Z.restoreModeVerticalFromInline()},Z.setInnerMenu=function(ye){Z.innerMenu=ye},Z.isRootMenu=!0;var de=_e.defaultSelectedKeys,te=_e.defaultOpenKeys;return"selectedKeys"in _e&&(de=_e.selectedKeys||[]),"openKeys"in _e&&(te=_e.openKeys||[]),Z.store=Object(o.c)({selectedKeys:de,openKeys:te,activeKey:{"0-menu-":Sr(_e,_e.activeKey)}}),Z.state={switchingModeFromInline:!1,prevProps:_e,inlineOpenKeys:[],store:Z.store},Z}return Object(A.a)(Se,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Z){var de=this.props,te=de.siderCollapsed,ye=de.inlineCollapsed,he=de.onOpenChange;(!Z.inlineCollapsed&&ye||!Z.siderCollapsed&&te)&&he([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var Z=this.props.collapsedWidth,de=this.store,te=this.prevOpenKeys,ye=this.getInlineCollapsed()&&(Z===0||Z==="0"||Z==="0px");ye?(this.prevOpenKeys=de.getState().openKeys.concat(),this.store.setState({openKeys:[]})):te&&(this.store.setState({openKeys:te}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Z=this.props.mode,de=this.state.switchingModeFromInline,te=this.getInlineCollapsed();return de&&te?"inline":te?"vertical":Z}},{key:"getInlineCollapsed",value:function(){var Z=this.props,de=Z.inlineCollapsed,te=Z.siderCollapsed;return te!==void 0?te:de}},{key:"restoreModeVerticalFromInline",value:function(){var Z=this.state.switchingModeFromInline;Z&&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 Z=Object(K.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),de=this.getRealMenuMode();return Z.className+=" ".concat(Z.prefixCls,"-root"),Z.direction==="rtl"&&(Z.className+=" ".concat(Z.prefixCls,"-rtl")),Z=Object(K.a)(Object(K.a)({},Z),{},{mode:de,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Gr(this.props,this.state,de)}),delete Z.openAnimation,delete Z.openTransitionName,L.createElement(o.a,{store:this.store},L.createElement($n,Object(T.a)({},Z,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(Z,de){var te=de.prevProps,ye=de.store,he=ye.getState(),Ce={},we={prevProps:Z};return te.mode==="inline"&&Z.mode!=="inline"&&(we.switchingModeFromInline=!0),"openKeys"in Z?Ce.openKeys=Z.openKeys||[]:((Z.inlineCollapsed&&!te.inlineCollapsed||Z.siderCollapsed&&!te.siderCollapsed)&&(we.switchingModeFromInline=!0,we.inlineOpenKeys=he.openKeys,Ce.openKeys=[]),(!Z.inlineCollapsed&&te.inlineCollapsed||!Z.siderCollapsed&&te.siderCollapsed)&&(Ce.openKeys=de.inlineOpenKeys,we.inlineOpenKeys=[])),Object.keys(Ce).length&&ye.setState(Ce),we}}]),Se}(L.Component);Rt.defaultProps={selectable:!0,onClick:De,onSelect:De,onOpenChange:De,onDeselect:De,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:L.createElement("span",null,"\xB7\xB7\xB7")};var Nt=Rt,Dt=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(){var _e;return Object(w.a)(this,Se),_e=xe.apply(this,arguments),_e.onKeyDown=function(Z){var de=Z.keyCode;return de===d.a.ENTER?(_e.onClick(Z),!0):void 0},_e.onMouseLeave=function(Z){var de=_e.props,te=de.eventKey,ye=de.onItemHover,he=de.onMouseLeave;ye({key:te,hover:!1}),he({key:te,domEvent:Z})},_e.onMouseEnter=function(Z){var de=_e.props,te=de.eventKey,ye=de.onItemHover,he=de.onMouseEnter;ye({key:te,hover:!0}),he({key:te,domEvent:Z})},_e.onClick=function(Z){var de=_e.props,te=de.eventKey,ye=de.multiple,he=de.onClick,Ce=de.onSelect,we=de.onDeselect,Pe=de.isSelected,ze={key:te,keyPath:[te],item:Object(m.a)(_e),domEvent:Z};he(ze),ye?Pe?we(ze):Ce(ze):Pe||Ce(ze)},_e.saveNode=function(Z){_e.node=Z},_e}return Object(A.a)(Se,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Z=this.props;Z.onDestroy&&Z.onDestroy(Z.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 Z,de=Object(K.a)({},this.props),te=W()(this.getPrefixCls(),de.className,(Z={},Object(oe.a)(Z,this.getActiveClassName(),!de.disabled&&de.active),Object(oe.a)(Z,this.getSelectedClassName(),de.isSelected),Object(oe.a)(Z,this.getDisabledClassName(),de.disabled),Z)),ye=Object(K.a)(Object(K.a)({},de.attribute),{},{title:typeof de.title=="string"?de.title:void 0,className:te,role:de.role||"menuitem","aria-disabled":de.disabled});de.role==="option"?ye=Object(K.a)(Object(K.a)({},ye),{},{role:"option","aria-selected":de.isSelected}):(de.role===null||de.role==="none")&&(ye.role="none");var he={onClick:de.disabled?null:this.onClick,onMouseLeave:de.disabled?null:this.onMouseLeave,onMouseEnter:de.disabled?null:this.onMouseEnter},Ce=Object(K.a)({},de.style);de.mode==="inline"&&(de.direction==="rtl"?Ce.paddingRight=de.inlineIndent*de.level:Ce.paddingLeft=de.inlineIndent*de.level),$e.forEach(function(Pe){return delete de[Pe]}),delete de.direction;var we=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(we=L.createElement(this.props.itemIcon,this.props)),L.createElement("li",Object(T.a)({},Object(E.a)(de,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ye,he,{style:Ce,ref:this.saveNode}),de.children,we)}}]),Se}(L.Component);Dt.isMenuItem=!0,Dt.defaultProps={onSelect:De,onMouseEnter:De,onMouseLeave:De,manualRef:De};var Qt=Object(o.b)(function(pe,xe){var Se=pe.activeKey,_e=pe.selectedKeys,Z=xe.eventKey,de=xe.subMenuKey;return{active:Se[de]===Z,isSelected:Array.isArray(_e)?_e.indexOf(Z)!==-1:_e===Z}})(Dt),Dn=Qt,bn=function(pe){Object(v.a)(Se,pe);var xe=Object(s.a)(Se);function Se(){var _e;return Object(w.a)(this,Se),_e=xe.apply(this,arguments),_e.renderInnerMenuItem=function(Z){var de=_e.props,te=de.renderMenuItem,ye=de.index;return te(Z,ye,_e.props.subMenuKey)},_e}return Object(A.a)(Se,[{key:"render",value:function(){var Z=Object(T.a)({},this.props),de=Z.className,te=de===void 0?"":de,ye=Z.rootPrefixCls,he="".concat(ye,"-item-group-title"),Ce="".concat(ye,"-item-group-list"),we=Z.title,Pe=Z.children;return $e.forEach(function(ze){return delete Z[ze]}),delete Z.direction,L.createElement("li",Object(T.a)({},Z,{onClick:function(ot){return ot.stopPropagation()},className:"".concat(te," ").concat(ye,"-item-group")}),L.createElement("div",{className:he,title:typeof we=="string"?we:void 0},we),L.createElement("ul",{className:Ce},L.Children.map(Pe,this.renderInnerMenuItem)))}}]),Se}(L.Component);bn.isMenuItemGroup=!0,bn.defaultProps={disabled:!0};var Hn=bn,nr=function(xe){var Se=xe.className,_e=xe.rootPrefixCls,Z=xe.style;return L.createElement("li",{className:"".concat(Se," ").concat(_e,"-item-divider"),style:Z})};nr.defaultProps={disabled:!0,className:"",style:{}};var ca=nr,Fn=Nt,Fa=H("eDIo");function rr(pe,xe){var Se=pe.prefixCls,_e=pe.editable,Z=pe.locale,de=pe.style;return!_e||_e.showAdd===!1?null:L.createElement("button",{ref:xe,type:"button",className:"".concat(Se,"-nav-add"),style:de,"aria-label":(Z==null?void 0:Z.addAriaLabel)||"Add tab",onClick:function(ye){_e.onEdit("add",{event:ye})}},_e.addIcon||"+")}var Jr=L.forwardRef(rr);function zr(pe,xe){var Se=pe.prefixCls,_e=pe.id,Z=pe.tabs,de=pe.locale,te=pe.mobile,ye=pe.moreIcon,he=ye===void 0?"More":ye,Ce=pe.moreTransitionName,we=pe.style,Pe=pe.className,ze=pe.editable,ot=pe.tabBarGutter,dt=pe.rtl,Ot=pe.onTabClick,on=Object(L.useState)(!1),Un=Object(V.a)(on,2),An=Un[0],Ln=Un[1],Mn=Object(L.useState)(null),Pn=Object(V.a)(Mn,2),wn=Pn[0],Bn=Pn[1],Kn="".concat(_e,"-more-popup"),xr="".concat(Se,"-dropdown"),Gn=wn!==null?"".concat(Kn,"-").concat(wn):null,tn=de==null?void 0:de.dropdownAriaLabel,$t=L.createElement(Fn,{onClick:function(pr){var ur=pr.key,Dr=pr.domEvent;Ot(ur,Dr),Ln(!1)},id:Kn,tabIndex:-1,role:"listbox","aria-activedescendant":Gn,selectedKeys:[wn],"aria-label":tn!==void 0?tn:"expanded dropdown"},Z.map(function(Vn){return L.createElement(Dn,{key:Vn.key,id:"".concat(Kn,"-").concat(Vn.key),role:"option","aria-controls":_e&&"".concat(_e,"-panel-").concat(Vn.key),disabled:Vn.disabled},Vn.tab)}));function Cn(Vn){for(var pr=Z.filter(function(aa){return!aa.disabled}),ur=pr.findIndex(function(aa){return aa.key===wn})||0,Dr=pr.length,Mr=0;Mr<Dr;Mr+=1){ur=(ur+Vn+Dr)%Dr;var wr=pr[ur];if(!wr.disabled){Bn(wr.key);return}}}function Zn(Vn){var pr=Vn.which;if(!An){[d.a.DOWN,d.a.SPACE,d.a.ENTER].includes(pr)&&(Ln(!0),Vn.preventDefault());return}switch(pr){case d.a.UP:Cn(-1),Vn.preventDefault();break;case d.a.DOWN:Cn(1),Vn.preventDefault();break;case d.a.ESC:Ln(!1);break;case d.a.SPACE:case d.a.ENTER:wn!==null&&Ot(wn,Vn);break}}Object(L.useEffect)(function(){var Vn=document.getElementById(Gn);Vn&&Vn.scrollIntoView&&Vn.scrollIntoView(!1)},[wn]),Object(L.useEffect)(function(){An||Bn(null)},[An]);var Ht=Object(oe.a)({},dt?"marginLeft":"marginRight",ot);Z.length||(Ht.visibility="hidden",Ht.order=1);var Jn=W()(Object(oe.a)({},"".concat(xr,"-rtl"),dt)),Tr=te?null:L.createElement(Fa.a,{prefixCls:xr,overlay:$t,trigger:["hover"],visible:An,transitionName:Ce,onVisibleChange:Ln,overlayClassName:Jn,mouseEnterDelay:.1,mouseLeaveDelay:.1},L.createElement("button",{type:"button",className:"".concat(Se,"-nav-more"),style:Ht,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Kn,id:"".concat(_e,"-more"),"aria-expanded":An,onKeyDown:Zn},he));return L.createElement("div",{className:W()("".concat(Se,"-nav-operations"),Pe),style:we,ref:xe},Tr,L.createElement(Jr,{prefixCls:Se,locale:de,editable:ze}))}var Aa=L.forwardRef(zr),Ii=Object(L.createContext)(null),Lo=.1,ti=.01,Rr=20,lo=Math.pow(.995,Rr);function uo(){var pe=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(pe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(pe.substr(0,4)))}function fi(pe,xe){var Se=Object(L.useState)(),_e=Object(V.a)(Se,2),Z=_e[0],de=_e[1],te=Object(L.useState)(0),ye=Object(V.a)(te,2),he=ye[0],Ce=ye[1],we=Object(L.useState)(0),Pe=Object(V.a)(we,2),ze=Pe[0],ot=Pe[1],dt=Object(L.useState)(),Ot=Object(V.a)(dt,2),on=Ot[0],Un=Ot[1],An=Object(L.useRef)();function Ln(tn){var $t=tn.touches[0],Cn=$t.screenX,Zn=$t.screenY;de({x:Cn,y:Zn}),window.clearInterval(An.current)}function Mn(tn){if(!Z)return;tn.preventDefault();var $t=tn.touches[0],Cn=$t.screenX,Zn=$t.screenY;de({x:Cn,y:Zn});var Ht=Cn-Z.x,Jn=Zn-Z.y;xe(Ht,Jn);var Tr=Date.now();Ce(Tr),ot(Tr-he),Un({x:Ht,y:Jn})}function Pn(){if(!Z)return;if(de(null),Un(null),on){var tn=on.x/ze,$t=on.y/ze,Cn=Math.abs(tn),Zn=Math.abs($t);if(Math.max(Cn,Zn)<Lo)return;var Ht=tn,Jn=$t;An.current=window.setInterval(function(){if(Math.abs(Ht)<ti&&Math.abs(Jn)<ti){window.clearInterval(An.current);return}Ht*=lo,Jn*=lo,xe(Ht*Rr,Jn*Rr)},Rr)}}var wn=Object(L.useRef)(0),Bn=Object(L.useRef)(!1),Kn=Object(L.useRef)();function xr(tn){var $t=tn.deltaX,Cn=tn.deltaY,Zn=0,Ht=Math.abs($t),Jn=Math.abs(Cn);Ht===Jn?Zn=Kn.current==="x"?$t:Cn:Ht>Jn?(Zn=$t,Kn.current="x"):(Zn=Cn,Kn.current="y");var Tr=Date.now();Tr-wn.current>100&&(Bn.current=!1),(xe(-Zn,-Zn)||Bn.current)&&(tn.preventDefault(),Bn.current=!0),wn.current=Tr}var Gn=Object(L.useRef)(null);Gn.current={onTouchStart:Ln,onTouchMove:Mn,onTouchEnd:Pn,onWheel:xr},L.useEffect(function(){function tn(Ht){Gn.current.onTouchStart(Ht)}function $t(Ht){Gn.current.onTouchMove(Ht)}function Cn(Ht){Gn.current.onTouchEnd(Ht)}function Zn(Ht){Gn.current.onWheel(Ht)}return document.addEventListener("touchmove",$t,{passive:!1}),document.addEventListener("touchend",Cn,{passive:!1}),pe.current.addEventListener("touchstart",tn,{passive:!1}),pe.current.addEventListener("wheel",Zn),function(){document.removeEventListener("touchmove",$t),document.removeEventListener("touchend",Cn)}},[])}function hi(){var pe=Object(L.useRef)(new Map);function xe(_e){return pe.current.has(_e)||pe.current.set(_e,L.createRef()),pe.current.get(_e)}function Se(_e){pe.current.delete(_e)}return[xe,Se]}function Qi(pe,xe){var Se=L.useRef(pe),_e=L.useState({}),Z=Object(V.a)(_e,2),de=Z[1];function te(ye){var he=typeof ye=="function"?ye(Se.current):ye;he!==Se.current&&xe(he,Se.current),Se.current=he,de({})}return[Se.current,te]}var co=function(xe){var Se=xe.position,_e=xe.prefixCls,Z=xe.extra;if(!Z)return null;var de,te=Z;return Se==="right"&&(de=te.right||!te.left&&te||null),Se==="left"&&(de=te.left||null),de?L.createElement("div",{className:"".concat(_e,"-extra-content")},de):null};function Mi(pe,xe){var Se,_e=L.useContext(Ii),Z=_e.prefixCls,de=_e.tabs,te=pe.className,ye=pe.style,he=pe.id,Ce=pe.animated,we=pe.activeKey,Pe=pe.rtl,ze=pe.extra,ot=pe.editable,dt=pe.locale,Ot=pe.tabPosition,on=pe.tabBarGutter,Un=pe.children,An=pe.onTabClick,Ln=pe.onTabScroll,Mn=Object(L.useRef)(),Pn=Object(L.useRef)(),wn=Object(L.useRef)(),Bn=Object(L.useRef)(),Kn=hi(),xr=Object(V.a)(Kn,2),Gn=xr[0],tn=xr[1],$t=Ot==="top"||Ot==="bottom",Cn=Qi(0,function(or,Yn){$t&&Ln&&Ln({direction:or>Yn?"left":"right"})}),Zn=Object(V.a)(Cn,2),Ht=Zn[0],Jn=Zn[1],Tr=Qi(0,function(or,Yn){!$t&&Ln&&Ln({direction:or>Yn?"top":"bottom"})}),Vn=Object(V.a)(Tr,2),pr=Vn[0],ur=Vn[1],Dr=Object(L.useState)(0),Mr=Object(V.a)(Dr,2),wr=Mr[0],aa=Mr[1],ba=Object(L.useState)(0),fa=Object(V.a)(ba,2),kr=fa[0],gr=fa[1],dr=Object(L.useState)(0),an=Object(V.a)(dr,2),cr=an[0],wa=an[1],Ba=Object(L.useState)(0),Xa=Object(V.a)(Ba,2),fr=Xa[0],Ia=Xa[1],Wa=Object(L.useState)(null),mr=Object(V.a)(Wa,2),ir=mr[0],Cr=mr[1],Ni=Object(L.useState)(null),Zi=Object(V.a)(Ni,2),ni=Zi[0],gi=Zi[1],Fr=Object(L.useState)(0),Ma=Object(V.a)(Fr,2),Ui=Ma[0],Po=Ma[1],Io=Object(L.useState)(0),mo=Object(V.a)(Io,2),Ji=mo[0],qi=mo[1],ri=a(new Map),vi=Object(V.a)(ri,2),go=vi[0],ji=vi[1],_i=c(de,go,wr),ai="".concat(Z,"-nav-operations-hidden"),vr=0,Ea=0;$t?Pe?(vr=0,Ea=Math.max(0,wr-ir)):(vr=Math.min(0,ir-wr),Ea=0):(vr=Math.min(0,ni-kr),Ea=0);function ii(or){return or<vr?[vr,!1]:or>Ea?[Ea,!1]:[or,!0]}var Ya=Object(L.useRef)(),Oi=Object(L.useState)(),oi=Object(V.a)(Oi,2),Fi=oi[0],eo=oi[1];function Bi(){eo(Date.now())}function to(){window.clearTimeout(Ya.current)}fi(Mn,function(or,Yn){var Yr=!1;function ia($a,Ka){$a(function(Ci){var Za=ii(Ci+Ka),Vr=Object(V.a)(Za,2),Si=Vr[0],Xe=Vr[1];return Yr=Xe,Si})}if($t){if(ir>=wr)return Yr;ia(Jn,or)}else{if(ni>=kr)return Yr;ia(ur,Yn)}return to(),Bi(),Yr}),Object(L.useEffect)(function(){return to(),Fi&&(Ya.current=window.setTimeout(function(){eo(0)},100)),to},[Fi]);function Ha(){var or=arguments.length>0&&arguments[0]!==void 0?arguments[0]:we,Yn=_i.get(or);if(!Yn)return;if($t){var Yr=Ht;Pe?Yn.right<Ht?Yr=Yn.right:Yn.right+Yn.width>Ht+ir&&(Yr=Yn.right+Yn.width-ir):Yn.left<-Ht?Yr=-Yn.left:Yn.left+Yn.width>-Ht+ir&&(Yr=-(Yn.left+Yn.width-ir)),ur(0),Jn(ii(Yr)[0])}else{var ia=pr;Yn.top<-pr?ia=-Yn.top:Yn.top+Yn.height>-pr+ni&&(ia=-(Yn.top+Yn.height-ni)),Jn(0),ur(ii(ia)[0])}}var Qa=C(_i,{width:ir,height:ni,left:Ht,top:pr},{width:cr,height:fr},{width:Ui,height:Ji},Object(K.a)(Object(K.a)({},pe),{},{tabs:de})),no=Object(V.a)(Qa,2),ro=no[0],Mo=no[1],ko=de.map(function(or){var Yn=or.key;return L.createElement(i,{id:he,prefixCls:Z,key:Yn,rtl:Pe,tab:or,closable:or.closable,editable:ot,active:Yn===we,tabPosition:Ot,tabBarGutter:on,renderWrapper:Un,removeAriaLabel:dt==null?void 0:dt.removeAriaLabel,ref:Gn(Yn),onClick:function(ia){An(Yn,ia)},onRemove:function(){tn(Yn)},onFocus:function(){Ha(Yn),Bi(),Pe||(Mn.current.scrollLeft=0),Mn.current.scrollTop=0}})}),ao=f(function(){var or,Yn,Yr,ia,$a,Ka,Ci,Za,Vr,Si=((or=Mn.current)===null||or===void 0?void 0:or.offsetWidth)||0,Xe=((Yn=Mn.current)===null||Yn===void 0?void 0:Yn.offsetHeight)||0,He=((Yr=Bn.current)===null||Yr===void 0?void 0:Yr.offsetWidth)||0,je=((ia=Bn.current)===null||ia===void 0?void 0:ia.offsetHeight)||0,Ye=(($a=wn.current)===null||$a===void 0?void 0:$a.offsetWidth)||0,qe=((Ka=wn.current)===null||Ka===void 0?void 0:Ka.offsetHeight)||0;Cr(Si),gi(Xe),Po(He),qi(je);var vt=(((Ci=Pn.current)===null||Ci===void 0?void 0:Ci.offsetWidth)||0)-He,pt=(((Za=Pn.current)===null||Za===void 0?void 0:Za.offsetHeight)||0)-je;aa(vt),gr(pt);var ct=(Vr=wn.current)===null||Vr===void 0?void 0:Vr.className.includes(ai);wa(vt-(ct?0:Ye)),Ia(pt-(ct?0:qe)),ji(function(){var Xt=new Map;return de.forEach(function(zn){var ma=zn.key,Sn=Gn(ma).current;Sn&&Xt.set(ma,{width:Sn.offsetWidth,height:Sn.offsetHeight,left:Sn.offsetLeft,top:Sn.offsetTop})}),Xt})}),No=de.slice(0,ro),Br=de.slice(Mo+1),Nr=[].concat(Object(D.a)(No),Object(D.a)(Br)),qr=Object(L.useState)(),Ur=Object(V.a)(qr,2),Ai=Ur[0],Wi=Ur[1],xa=_i.get(we),io=Object(L.useRef)();function Hi(){p.a.cancel(io.current)}Object(L.useEffect)(function(){var or={};return xa&&($t?(Pe?or.right=xa.right:or.left=xa.left,or.width=xa.width):(or.top=xa.top,or.height=xa.height)),Hi(),io.current=p()(function(){Wi(or)}),Hi},[xa,$t,Pe]),Object(L.useEffect)(function(){Ha()},[we,xa,_i,$t]),Object(L.useEffect)(function(){ao()},[Pe,on,we,de.map(function(or){return or.key}).join("_")]);var vo=!!Nr.length,si="".concat(Z,"-nav-wrap"),Ki,wi,_o,Gi;return $t?Pe?(wi=Ht>0,Ki=Ht+ir<wr):(Ki=Ht<0,wi=-Ht+ir<wr):(_o=pr<0,Gi=-pr+ni<kr),L.createElement("div",{ref:xe,role:"tablist",className:W()("".concat(Z,"-nav"),te),style:ye,onKeyDown:function(){Bi()}},L.createElement(co,{position:"left",extra:ze,prefixCls:Z}),L.createElement(_.a,{onResize:ao},L.createElement("div",{className:W()(si,(Se={},Object(oe.a)(Se,"".concat(si,"-ping-left"),Ki),Object(oe.a)(Se,"".concat(si,"-ping-right"),wi),Object(oe.a)(Se,"".concat(si,"-ping-top"),_o),Object(oe.a)(Se,"".concat(si,"-ping-bottom"),Gi),Se)),ref:Mn},L.createElement(_.a,{onResize:ao},L.createElement("div",{ref:Pn,className:"".concat(Z,"-nav-list"),style:{transform:"translate(".concat(Ht,"px, ").concat(pr,"px)"),transition:Fi?"none":void 0}},ko,L.createElement(Jr,{ref:Bn,prefixCls:Z,locale:dt,editable:ot,style:{visibility:vo?"hidden":null}}),L.createElement("div",{className:W()("".concat(Z,"-ink-bar"),Object(oe.a)({},"".concat(Z,"-ink-bar-animated"),Ce.inkBar)),style:Ai}))))),L.createElement(Aa,Object.assign({},pe,{ref:wn,prefixCls:Z,tabs:Nr,className:!vo&&ai})),L.createElement(co,{position:"right",extra:ze,prefixCls:Z}))}var Ti=L.forwardRef(Mi);function fo(pe){var xe=pe.id,Se=pe.activeKey,_e=pe.animated,Z=pe.tabPosition,de=pe.rtl,te=pe.destroyInactiveTabPane,ye=L.useContext(Ii),he=ye.prefixCls,Ce=ye.tabs,we=_e.tabPane,Pe=Ce.findIndex(function(ze){return ze.key===Se});return L.createElement("div",{className:W()("".concat(he,"-content-holder"))},L.createElement("div",{className:W()("".concat(he,"-content"),"".concat(he,"-content-").concat(Z),Object(oe.a)({},"".concat(he,"-content-animated"),we)),style:Pe&&we?Object(oe.a)({},de?"marginRight":"marginLeft","-".concat(Pe,"00%")):null},Ce.map(function(ze){return L.cloneElement(ze.node,{key:ze.key,prefixCls:he,tabKey:ze.key,id:xe,animated:we,active:ze.key===Se,destroyInactiveTabPane:te})})))}function ho(pe){var xe=pe.prefixCls,Se=pe.forceRender,_e=pe.className,Z=pe.style,de=pe.id,te=pe.active,ye=pe.animated,he=pe.destroyInactiveTabPane,Ce=pe.tabKey,we=pe.children,Pe=L.useState(Se),ze=Object(V.a)(Pe,2),ot=ze[0],dt=ze[1];L.useEffect(function(){te?dt(!0):he&&dt(!1)},[te,he]);var Ot={};return te||(ye?(Ot.visibility="hidden",Ot.height=0,Ot.overflowY="hidden"):Ot.display="none"),L.createElement("div",{id:de&&"".concat(de,"-panel-").concat(Ce),role:"tabpanel",tabIndex:te?0:-1,"aria-labelledby":de&&"".concat(de,"-tab-").concat(Ce),"aria-hidden":!te,style:Object(K.a)(Object(K.a)({},Ot),Z),className:W()("".concat(xe,"-tabpane"),te&&"".concat(xe,"-tabpane-active"),_e)},(te||ot||Se)&&we)}var ki=0;function po(pe){return Object(F.a)(pe).map(function(xe){if(L.isValidElement(xe)){var Se=xe.key!==void 0?String(xe.key):void 0;return Object(K.a)(Object(K.a)({key:Se},xe.props),{},{node:xe})}return null}).filter(function(xe){return xe})}function $i(pe,xe){var Se,_e=pe.id,Z=pe.prefixCls,de=Z===void 0?"rc-tabs":Z,te=pe.className,ye=pe.children,he=pe.direction,Ce=pe.activeKey,we=pe.defaultActiveKey,Pe=pe.editable,ze=pe.animated,ot=pe.tabPosition,dt=ot===void 0?"top":ot,Ot=pe.tabBarGutter,on=pe.tabBarStyle,Un=pe.tabBarExtraContent,An=pe.locale,Ln=pe.moreIcon,Mn=pe.moreTransitionName,Pn=pe.destroyInactiveTabPane,wn=pe.renderTabBar,Bn=pe.onChange,Kn=pe.onTabClick,xr=pe.onTabScroll,Gn=Object(I.a)(pe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),tn=po(ye),$t=he==="rtl",Cn;ze===!1?Cn={inkBar:!1,tabPane:!1}:Cn=Object(K.a)({inkBar:!0,tabPane:!1},ze!==!0?ze:null);var Zn=Object(L.useState)(!1),Ht=Object(V.a)(Zn,2),Jn=Ht[0],Tr=Ht[1];Object(L.useEffect)(function(){Tr(uo())},[]);var Vn=Object(R.a)(function(){var fr;return(fr=tn[0])===null||fr===void 0?void 0:fr.key},{value:Ce,defaultValue:we}),pr=Object(V.a)(Vn,2),ur=pr[0],Dr=pr[1],Mr=Object(L.useState)(function(){return tn.findIndex(function(fr){return fr.key===ur})}),wr=Object(V.a)(Mr,2),aa=wr[0],ba=wr[1];Object(L.useEffect)(function(){var fr=tn.findIndex(function(Wa){return Wa.key===ur});if(fr===-1){var Ia;fr=Math.max(0,Math.min(aa,tn.length-1)),Dr((Ia=tn[fr])===null||Ia===void 0?void 0:Ia.key)}ba(fr)},[tn.map(function(fr){return fr.key}).join("_"),ur,aa]);var fa=Object(R.a)(null,{value:_e}),kr=Object(V.a)(fa,2),gr=kr[0],dr=kr[1],an=dt;Jn&&!["left","right"].includes(dt)&&(an="top"),Object(L.useEffect)(function(){_e||(dr("rc-tabs-".concat(ki)),ki+=1)},[]);function cr(fr,Ia){Kn==null||Kn(fr,Ia),Dr(fr),Bn==null||Bn(fr)}var wa={id:gr,activeKey:ur,animated:Cn,tabPosition:an,rtl:$t,mobile:Jn},Ba,Xa=Object(K.a)(Object(K.a)({},wa),{},{editable:Pe,locale:An,moreIcon:Ln,moreTransitionName:Mn,tabBarGutter:Ot,onTabClick:cr,onTabScroll:xr,extra:Un,style:on,panes:ye});return wn?Ba=wn(Xa,Ti):Ba=L.createElement(Ti,Object.assign({},Xa)),L.createElement(Ii.Provider,{value:{tabs:tn,prefixCls:de}},L.createElement("div",Object.assign({ref:xe,id:_e,className:W()(de,"".concat(de,"-").concat(an),(Se={},Object(oe.a)(Se,"".concat(de,"-mobile"),Jn),Object(oe.a)(Se,"".concat(de,"-editable"),Pe),Object(oe.a)(Se,"".concat(de,"-rtl"),$t),Se),te)},Gn),Ba,L.createElement(fo,Object.assign({destroyInactiveTabPane:Pn},wa,{animated:Cn}))))}var pi=L.forwardRef($i);pi.TabPane=ho;var Va=pi,mi=Be.b=Va},kSUc:function(rt,Be,H){},lZu9:function(rt,Be,H){(function(oe){oe(H("VrN/"),H("1eCo"),H("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function(V,I){var K=oe.getMode(V,"text/html"),L=K.name=="null";function N(y){if(oe.findModeByName){var x=oe.findModeByName(y);x&&(y=x.mime||x.mimes[0])}var j=oe.getMode(V,y);return j.name=="null"?null:j}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var F in W)W.hasOwnProperty(F)&&I.tokenTypeOverrides[F]&&(W[F]=I.tokenTypeOverrides[F]);var R=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,p=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,_=/^ {0,3}(?:\={1,}|-{2,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \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]/,i=" ";function u(y,x,j){return x.f=x.inline=j,j(y,x)}function c(y,x,j){return x.f=x.block=j,j(y,x)}function S(y){return!y||!/\S/.test(y.string)}function C(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==w){var x=L;if(!x){var j=oe.innerMode(K,y.htmlState);x=j.mode.name=="xml"&&j.state.tagStart===null&&!j.state.context&&j.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 j=y.column()===x.indentation,z=S(x.prevLine.stream),Y=x.indentedCode,$=x.prevLine.hr,ce=x.list!==!1,se=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var ne=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,ce)){for(x.list=null;ne<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=ne-x.listStack[x.listStack.length-1])}var re=!z&&!$&&!x.prevLine.header&&(!ce||!Y)&&!x.prevLine.fencedCodeEnd,ue=(x.list===!1||$||z)&&x.indentation<=se&&y.match(R),ee=null;if(x.indentationDiff>=4&&(Y||x.prevLine.fencedCodeEnd||x.prevLine.header||z))return y.skipToEnd(),x.indentedCode=!0,W.code;if(y.eatSpace())return null;if(j&&x.indentation<=se&&(ee=y.match(p))&&ee[1].length<=6)return x.quote=0,x.header=ee[1].length,x.thisLine.header=!0,I.highlightFormatting&&(x.formatting="header"),x.f=x.inline,m(x);if(x.indentation<=se&&y.eat(">"))return x.quote=j?1:x.quote+1,I.highlightFormatting&&(x.formatting="quote"),y.eatSpace(),m(x);if(!ue&&!x.setext&&j&&x.indentation<=se&&(ee=y.match(D))){var ae=ee[1]?"ol":"ul";return x.indentation=ne+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,I.taskLists&&y.match(b,!1)&&(x.taskList=!0),x.f=x.inline,I.highlightFormatting&&(x.formatting=["list","list-"+ae]),m(x)}else{if(j&&x.indentation<=se&&(ee=y.match(a,!0)))return x.quote=0,x.fencedEndRE=new RegExp(ee[1]+"+ *$"),x.localMode=I.fencedCodeBlockHighlighting&&N(ee[2]||I.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=oe.startState(x.localMode)),x.f=x.block=A,I.highlightFormatting&&(x.formatting="code-block"),x.code=-1,m(x);if(x.setext||(!re||!ce)&&!x.quote&&x.list===!1&&!x.code&&!ue&&!d.test(y.string)&&(ee=y.lookAhead(1))&&(ee=ee.match(_)))return x.setext?(x.header=x.setext,x.setext=0,y.skipToEnd(),I.highlightFormatting&&(x.formatting="header")):(x.header=ee[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,m(x);if(ue)return y.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,W.hr;if(y.peek()==="[")return u(y,x,M)}return u(y,x,x.inline)}function w(y,x){var j=K.token(y,x.htmlState);if(!L){var z=oe.innerMode(K,x.htmlState);(z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText||x.md_inside&&y.current().indexOf(">")>-1)&&(x.f=s,x.block=T,x.htmlState=null)}return j}function A(y,x){var j=x.listStack[x.listStack.length-1]||0,z=x.indentation<j,Y=j+3;if(x.fencedEndRE&&x.indentation<=Y&&(z||y.match(x.fencedEndRE))){I.highlightFormatting&&(x.formatting="code-block");var $;return z||($=m(x)),x.localMode=x.localState=null,x.block=T,x.f=s,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,z?c(y,x,x.block):$}else return x.localMode?x.localMode.token(y,x.localState):(y.skipToEnd(),W.code)}function m(y){var x=[];if(y.formatting){x.push(W.formatting),typeof y.formatting=="string"&&(y.formatting=[y.formatting]);for(var j=0;j<y.formatting.length;j++)x.push(W.formatting+"-"+y.formatting[j]),y.formatting[j]==="header"&&x.push(W.formatting+"-"+y.formatting[j]+"-"+y.header),y.formatting[j]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=y.quote?x.push(W.formatting+"-"+y.formatting[j]+"-"+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(W.linkHref,"url"):(y.strong&&x.push(W.strong),y.em&&x.push(W.em),y.strikethrough&&x.push(W.strikethrough),y.emoji&&x.push(W.emoji),y.linkText&&x.push(W.linkText),y.code&&x.push(W.code),y.image&&x.push(W.image),y.imageAltText&&x.push(W.imageAltText,"link"),y.imageMarker&&x.push(W.imageMarker)),y.header&&x.push(W.header,W.header+"-"+y.header),y.quote&&(x.push(W.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=y.quote?x.push(W.quote+"-"+y.quote):x.push(W.quote+"-"+I.maxBlockquoteDepth)),y.list!==!1){var z=(y.listStack.length-1)%3;z?z===1?x.push(W.list2):x.push(W.list3):x.push(W.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(f,!0)?m(x):void 0}function s(y,x){var j=x.text(y,x);if(typeof j!="undefined")return j;if(x.list)return x.list=null,m(x);if(x.taskList){var z=y.match(b,!0)[1]===" ";return z?x.taskOpen=!0:x.taskClosed=!0,I.highlightFormatting&&(x.formatting="task"),x.taskList=!1,m(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&y.match(/^#+$/,!0))return I.highlightFormatting&&(x.formatting="header"),m(x);var Y=y.next();if(x.linkTitle){x.linkTitle=!1;var $=Y;Y==="("&&($=")"),$=($+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ce="^\\s*(?:[^"+$+"\\\\]+|\\\\\\\\|\\\\.)"+$;if(y.match(new RegExp(ce),!0))return W.linkHref}if(Y==="`"){var se=x.formatting;I.highlightFormatting&&(x.formatting="code"),y.eatWhile("`");var ne=y.current().length;if(x.code==0&&(!x.quote||ne==1))return x.code=ne,m(x);if(ne==x.code){var re=m(x);return x.code=0,re}else return x.formatting=se,m(x)}else if(x.code)return m(x);if(Y==="\\"&&(y.next(),I.highlightFormatting)){var ue=m(x),ee=W.formatting+"-escape";return ue?ue+" "+ee:ee}if(Y==="!"&&y.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,I.highlightFormatting&&(x.formatting="image"),m(x);if(Y==="["&&x.imageMarker&&y.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,I.highlightFormatting&&(x.formatting="image"),m(x);if(Y==="]"&&x.imageAltText){I.highlightFormatting&&(x.formatting="image");var ue=m(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=E,ue}if(Y==="["&&!x.image)return x.linkText&&y.match(/^.*?\]/)||(x.linkText=!0,I.highlightFormatting&&(x.formatting="link")),m(x);if(Y==="]"&&x.linkText){I.highlightFormatting&&(x.formatting="link");var ue=m(x);return x.linkText=!1,x.inline=x.f=y.match(/\(.*?\)| ?\[.*?\]/,!1)?E:s,ue}if(Y==="<"&&y.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=o,I.highlightFormatting&&(x.formatting="link");var ue=m(x);return ue?ue+=" ":ue="",ue+W.linkInline}if(Y==="<"&&y.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=o,I.highlightFormatting&&(x.formatting="link");var ue=m(x);return ue?ue+=" ":ue="",ue+W.linkEmail}if(I.xml&&Y==="<"&&y.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ae=y.string.indexOf(">",y.pos);if(ae!=-1){var ge=y.string.substring(y.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ge)&&(x.md_inside=!0)}return y.backUp(1),x.htmlState=oe.startState(K),c(y,x,w)}if(I.xml&&Y==="<"&&y.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(Y==="*"||Y==="_"){for(var Le=1,ke=y.pos==1?" ":y.string.charAt(y.pos-2);Le<3&&y.eat(Y);)Le++;var De=y.peek()||" ",Ue=!/\s/.test(De)&&(!l.test(De)||/\s/.test(ke)||l.test(ke)),Ie=!/\s/.test(ke)&&(!l.test(ke)||/\s/.test(De)||l.test(De)),Re=null,Ve=null;if(Le%2&&(!x.em&&Ue&&(Y==="*"||!Ie||l.test(ke))?Re=!0:x.em==Y&&Ie&&(Y==="*"||!Ue||l.test(De))&&(Re=!1)),Le>1&&(!x.strong&&Ue&&(Y==="*"||!Ie||l.test(ke))?Ve=!0:x.strong==Y&&Ie&&(Y==="*"||!Ue||l.test(De))&&(Ve=!1)),Ve!=null||Re!=null){I.highlightFormatting&&(x.formatting=Re==null?"strong":Ve==null?"em":"strong em"),Re===!0&&(x.em=Y),Ve===!0&&(x.strong=Y);var re=m(x);return Re===!1&&(x.em=!1),Ve===!1&&(x.strong=!1),re}}else if(Y===" "&&(y.eat("*")||y.eat("_"))){if(y.peek()===" ")return m(x);y.backUp(1)}if(I.strikethrough){if(Y==="~"&&y.eatWhile(Y)){if(x.strikethrough){I.highlightFormatting&&(x.formatting="strikethrough");var re=m(x);return x.strikethrough=!1,re}else if(y.match(/^[^\s]/,!1))return x.strikethrough=!0,I.highlightFormatting&&(x.formatting="strikethrough"),m(x)}else if(Y===" "&&y.match(/^~~/,!0)){if(y.peek()===" ")return m(x);y.backUp(2)}}if(I.emoji&&Y===":"&&y.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,I.highlightFormatting&&(x.formatting="emoji");var $e=m(x);return x.emoji=!1,$e}return Y===" "&&(y.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),m(x)}function o(y,x){var j=y.next();if(j===">"){x.f=x.inline=s,I.highlightFormatting&&(x.formatting="link");var z=m(x);return z?z+=" ":z="",z+W.linkInline}return y.match(/^[^>]+/,!0),W.linkInline}function E(y,x){if(y.eatSpace())return null;var j=y.next();return j==="("||j==="["?(x.f=x.inline=O(j==="("?")":"]"),I.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,m(x)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function O(y){return function(x,j){var z=x.next();if(z===y){j.f=j.inline=s,I.highlightFormatting&&(j.formatting="link-string");var Y=m(j);return j.linkHref=!1,Y}return x.match(g[y]),j.linkHref=!0,m(j)}}function M(y,x){return y.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=k,y.next(),I.highlightFormatting&&(x.formatting="link"),x.linkText=!0,m(x)):u(y,x,s)}function k(y,x){if(y.match(/^\]:/,!0)){x.f=x.inline=U,I.highlightFormatting&&(x.formatting="link");var j=m(x);return x.linkText=!1,j}return y.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function U(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,W.linkHref+" url")}var B={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&&oe.copyState(K,y.htmlState),indentation:y.indentation,localMode:y.localMode,localState:y.localMode?oe.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 C(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!=w)){var j=y.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(x.indentation=j,x.indentationDiff=null,j>0)return null}}return x.f(y,x)},innerMode:function(y){return y.block==w?{state:y.htmlState,mode:K}:y.localState?{state:y.localState,mode:y.localMode}:{state:y,mode:B}},indent:function(y,x,j){return y.block==w&&K.indent?K.indent(y.htmlState,x,j):y.localState&&y.localMode.indent?y.localMode.indent(y.localState,x,j):oe.Pass},blankLine:C,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return B},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},mOS8:function(rt,Be,H){rt.exports=H.p+"static/403Qrcode.6c17b6f4.png"},mgmH:function(rt,Be,H){"use strict";H.d(Be,"d",function(){return _}),H.d(Be,"b",function(){return f}),H.d(Be,"e",function(){return a}),H.d(Be,"c",function(){return d}),H.d(Be,"n",function(){return l}),H.d(Be,"g",function(){return i}),H.d(Be,"h",function(){return u}),H.d(Be,"j",function(){return S}),H.d(Be,"a",function(){return C}),H.d(Be,"l",function(){return T}),H.d(Be,"f",function(){return w}),H.d(Be,"k",function(){return A}),H.d(Be,"m",function(){return m}),H.d(Be,"i",function(){return v}),H.d(Be,"o",function(){return s}),H.d(Be,"t",function(){return o}),H.d(Be,"s",function(){return E}),H.d(Be,"p",function(){return g}),H.d(Be,"q",function(){return O}),H.d(Be,"r",function(){return M}),H.d(Be,"v",function(){return k}),H.d(Be,"u",function(){return U});var oe=H("miYZ"),V=H("tsqr"),I=H("k1fw"),K=H("9og8"),L=H("WmNS"),N=H.n(L),W=H("oUNq"),F=H("9kvl"),R=H("1vsH"),D=H("m3rI"),b=function(){Object(F.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(F.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},_=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return b(),Y.next=3,Object(W.t)(Object(I.a)({},x));case 3:if(j=Y.sent,!(j.status===0)){Y.next=7;break}return Y.next=7,Object(R.w)("",Object(R.ab)({url:D.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_couser_info.json"),query:x}));case 7:p();case 8:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),f=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(W.r)(Object(I.a)({},x));case 2:if(j=Y.sent,!(j.status===0)){Y.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")),Y.next=13;break;case 8:if(!(j.status===-2)){Y.next=12;break}return Y.abrupt("return",j);case 12:j.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),a=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(W.u)(Object(I.a)({},x));case 2:if(j=Y.sent,!(j.status===0)){Y.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")),Y.next=13;break;case 8:if(!(j.status===-2)){Y.next=12;break}return Y.abrupt("return",j);case 12:j.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")));case 13:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),d=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(W.s)(Object(I.a)({},x));case 2:if(j=Y.sent,!(j.status===0)){Y.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),Y.next=13;break;case 8:if(!(j.status===-2)){Y.next=12;break}return Y.abrupt("return",j);case 12:j.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),l=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(W.z)(Object(I.a)({},x));case 2:if(j=Y.sent,!(j.status===0)){Y.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),Y.next=13;break;case 8:if(!(j.status===-2)){Y.next=12;break}return Y.abrupt("return",j);case 12:j.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),i=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(W.v)(Object(I.a)({},x));case 2:if(j=Y.sent,!(j.status===0)){Y.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")),Y.next=13;break;case 8:if(!(j.status===-2)){Y.next=12;break}return Y.abrupt("return",j);case 12:j.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),u=function(){var B=Object(K.a)(N.a.mark(function y(x,j){var z;return N.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(W.x)(Object(I.a)({},x));case 2:z=$.sent,z.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(j))):z.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(j)));case 4:case"end":return $.stop()}},y)}));return function(x,j){return B.apply(this,arguments)}}(),c=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return b(),Y.next=3,Object(W.w)(Object(I.a)({},x));case 3:if(j=Y.sent,!(j.status===0)){Y.next=7;break}return Y.next=7,Object(R.w)("",Object(R.ab)({url:D.a.API_SERVER+"/api/homework_commons/".concat(x.categoryId,"/works_list.zip"),query:x}));case 7:p();case 8:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),S=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return b(),Y.next=3,Object(W.A)(Object(I.a)({},x));case 3:if(j=Y.sent,!(j.status===0)){Y.next=7;break}return Y.next=7,Object(R.w)("",Object(R.ab)({url:D.a.API_SERVER+"/api/polls/".concat(x.categoryId,"/commit_result.xlsx"),query:x}));case 7:p();case 8:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),C=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/attendances/export_xlsx_data.xlsx"),query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),T=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/video_study_statics.xlsx"),query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),w=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_course_students_info.xlsx"),query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),A=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/item_banks/export.xlsx",query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),m=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),v=function(){var B=Object(K.a)(N.a.mark(function y(x){var j;return N.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(W.y)(Object(I.a)({},x));case 2:j=Y.sent,j.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score"))):j.status===-3&&(Object(F.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),F.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score")));case 4:case"end":return Y.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),s=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),z.next=3,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/export_records/".concat(x.id,".xlsx"),query:x}));case 3:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),o=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),E=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.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 z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),g=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)(x==null?void 0:x.name,Object(R.ab)({url:D.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),O=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.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 z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),M=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.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 z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),k=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/courses/rank_list.xlsx",query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}(),U=function(){var B=Object(K.a)(N.a.mark(function y(x){return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(R.v)("",Object(R.ab)({url:D.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:x}));case 2:case"end":return z.stop()}},y)}));return function(x){return B.apply(this,arguments)}}()},nSDg:function(rt,Be,H){rt.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(rt,Be,H){(function(oe){oe(H("VrN/"))})(function(oe){"use strict";var V=oe.Pos;function I(l,i){return l.line-i.line||l.ch-i.ch}var K="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",L=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",N=new RegExp("<(/?)(["+K+"]["+L+"]*)","g");function W(l,i,u,c){this.line=i,this.ch=u,this.cm=l,this.text=l.getLine(i),this.min=c?Math.max(c.from,l.firstLine()):l.firstLine(),this.max=c?Math.min(c.to-1,l.lastLine()):l.lastLine()}function F(l,i){var u=l.cm.getTokenTypeAt(V(l.line,i));return u&&/\btag\b/.test(u)}function R(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function D(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 i=l.text.indexOf(">",l.ch);if(i==-1){if(R(l))continue;return}if(!F(l,i+1)){l.ch=i+1;continue}var u=l.text.lastIndexOf("/",i),c=u>-1&&!/\S/.test(l.text.slice(u+1,i));return l.ch=i+1,c?"selfClose":"regular"}}function p(l){for(;;){var i=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(i==-1){if(D(l))continue;return}if(!F(l,i+1)){l.ch=i;continue}N.lastIndex=i,l.ch=i;var u=N.exec(l.text);if(u&&u.index==i)return u}}function _(l){for(;;){N.lastIndex=l.ch;var i=N.exec(l.text);if(!i){if(R(l))continue;return}if(!F(l,i.index+1)){l.ch=i.index+1;continue}return l.ch=i.index+i[0].length,i}}function f(l){for(;;){var i=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(i==-1){if(D(l))continue;return}if(!F(l,i+1)){l.ch=i;continue}var u=l.text.lastIndexOf("/",i),c=u>-1&&!/\S/.test(l.text.slice(u+1,i));return l.ch=i+1,c?"selfClose":"regular"}}function a(l,i){for(var u=[];;){var c=_(l),S,C=l.line,T=l.ch-(c?c[0].length:0);if(!c||!(S=b(l)))return;if(S=="selfClose")continue;if(c[1]){for(var w=u.length-1;w>=0;--w)if(u[w]==c[2]){u.length=w;break}if(w<0&&(!i||i==c[2]))return{tag:c[2],from:V(C,T),to:V(l.line,l.ch)}}else u.push(c[2])}}function d(l,i){for(var u=[];;){var c=f(l);if(!c)return;if(c=="selfClose"){p(l);continue}var S=l.line,C=l.ch,T=p(l);if(!T)return;if(T[1])u.push(T[2]);else{for(var w=u.length-1;w>=0;--w)if(u[w]==T[2]){u.length=w;break}if(w<0&&(!i||i==T[2]))return{tag:T[2],from:V(l.line,l.ch),to:V(S,C)}}}}oe.registerHelper("fold","xml",function(l,i){for(var u=new W(l,i.line,0);;){var c=_(u);if(!c||u.line!=i.line)return;var S=b(u);if(!S)return;if(!c[1]&&S!="selfClose"){var C=V(u.line,u.ch),T=a(u,c[2]);return T&&I(T.from,C)>0?{from:C,to:T.from}:null}}}),oe.findMatchingTag=function(l,i,u){var c=new W(l,i.line,i.ch,u);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var S=b(c),C=S&&V(c.line,c.ch),T=S&&p(c);if(!S||!T||I(c,i)>0)return;var w={from:V(c.line,c.ch),to:C,tag:T[2]};return S=="selfClose"?{open:w,close:null,at:"open"}:T[1]?{open:d(c,T[2]),close:w,at:"close"}:(c=new W(l,C.line,C.ch,u),{open:w,close:a(c,T[2]),at:"open"})},oe.findEnclosingTag=function(l,i,u,c){for(var S=new W(l,i.line,i.ch,u);;){var C=d(S,c);if(!C)break;var T=new W(l,i.line,i.ch,u),w=a(T,C.tag);if(w)return{open:C,close:w}}},oe.scanForClosingTag=function(l,i,u,c){var S=new W(l,i.line,i.ch,c?{from:0,to:c}:null);return a(S,u)}})},p5ED:function(rt,Be,H){"use strict";var oe=H("+L6B"),V=H("2/Rp"),I=H("5Dmo"),K=H("3S7+"),L=H("k1fw"),N=H("tJVT"),W=H("cDcd"),F=H.n(W),R=H("vHTk"),D=H.n(R),b=H("yEEn"),p=H("ZW9T"),_=H("1vsH");Be.a=function(f){var a=f.name,d=f.data,l=f.theme,i=f.type,u=f.filename,c=f.monacoEditor,S=f.className,C=f.style,T=f.close,w=f.onClose,A=f.hasMask,m=Object(W.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),v=Object(N.a)(m,2),s=v[0],o=v[1],E=Object(W.useState)(""),g=Object(N.a)(E,2),O=g[0],M=g[1],k,U=1024*1024,B=10*U,y=Object(W.useRef)();i==="office"&&(k=Object(_.V)(d).filesize,k>B&&(i="other")),u&&(c.filename=u),Object(W.useEffect)(function(){var z,Y,$=(z=document.cookie)===null||z===void 0||((Y=z.replace(/\s/g,""))===null||Y===void 0)?void 0:Y.split(";");$==null||$.map(function(ce){var se=ce.split("=");se[0]==="_educoder_session"&&M(se[1])})},[]);var x=function(){if(d.startsWith("http")||d.startsWith("/")){j();return}Object(_.z)(u||"educoder",d,u)},j=function(){Object(_.x)(u||a,d)};return console.log("data:",d,"fileanme:",u," name:",a),F.a.createElement("div",{style:Object(L.a)({},C||{}),className:"".concat(A&&D.a.bgBlack," ").concat(i?D.a.wrp:"hide")},T&&F.a.createElement("div",{className:D.a.close,ref:y},F.a.createElement(K.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return y.current}},F.a.createElement("span",{onClick:j},F.a.createElement("i",{className:"icon-quxiaozhiding"}))),F.a.createElement(K.a,{title:"\u5173\u95ED",getPopupContainer:function(){return y.current}},F.a.createElement("span",{className:"",onClick:w},F.a.createElement("i",{className:"icon-guanbi1"})))),F.a.createElement("div",{className:"".concat(D.a[S]," ").concat(S," ").concat(D.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&F.a.createElement(p.b,c)),i==="audio"&&F.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}),i==="video"&&F.a.createElement(F.a.Fragment,null,d!=null&&d.startsWith("/")?F.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):F.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),i==="html"&&F.a.createElement("iframe",{src:d+"&disposition=inline"}),i==="pdf"&&F.a.createElement("embed",{className:D.a.embed,src:d}),i==="image"&&F.a.createElement(F.a.Fragment,null,F.a.createElement("img",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(d)})),i==="other"&&F.a.createElement("div",null,F.a.createElement(V.a,{type:"primary",size:"large",onClick:x},F.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&F.a.createElement(V.a,{type:"primary",size:"large",onClick:x},F.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(rt,Be,H){},psGv:function(rt,Be,H){var oe,V;(function(){var I;(function(){"use strict";var W=[,,function(b){function p(a){this.__parent=a,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var a=new p(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},p.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},p.prototype.has_match=function(a){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(a))return!0;return!1},p.prototype.set_indent=function(a,d){this.is_empty()&&(this.__indent_count=a||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 a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(a){this.__items.push(a);var d=a.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=a.length-d:this.__character_count+=a.length},p.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function _(a,d){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),d=d||"",a.indent_level>0&&(d=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}_.prototype.get_indent_size=function(a,d){var l=this.__base_string_length;return d=d||0,a<0&&(l=0),l+=a*this.__indent_size,l+=d,l},_.prototype.get_indent_string=function(a,d){var l=this.__base_string;return d=d||0,a<0&&(a=0,l=""),d+=a*this.__indent_size,this.__ensure_cache(d),l+=this.__cache[d],l},_.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var a=this.__cache.length,d=0,l="";this.__indent_size&&a>=this.__indent_size&&(d=Math.floor(a/this.__indent_size),a-=d*this.__indent_size,l=new Array(d+1).join(this.__indent_string)),a&&(l+=new Array(a+1).join(" ")),this.__cache.push(l)};function f(a,d){this.__indent_cache=new _(a,d),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(a,d){return this.__indent_cache.get_indent_string(a,d)},f.prototype.get_indent_size=function(a,d){return this.__indent_cache.get_indent_size(a,d)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(a){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 a!==`
|
|
`&&(l=l.replace(/[\n]/g,a)),l},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(a,d){return a=a||0,d=d||0,this.next_line.set_indent(a,d),this.__lines.length>1?(this.current_line.set_indent(a,d),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(a){for(var d=0;d<a.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(a){for(var d=this.__lines.length;a<d;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(a,d){for(var l=this.__lines.length-2;l>=0;){var i=this.__lines[l];if(i.is_empty())break;if(i.item(0).indexOf(a)!==0&&i.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=f},function(b){function p(_,f,a,d){this.type=_,this.text=f,this.comments_before=null,this.newlines=a||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(a,d){this.raw_options=_(a,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(a,d){var l=this.raw_options[a],i=d||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(i=l.concat()):typeof l=="string"&&(i=l.split(/[^a-zA-Z0-9_\/\-]+/)),i},p.prototype._get_boolean=function(a,d){var l=this.raw_options[a],i=l===void 0?!!d:!!l;return i},p.prototype._get_characters=function(a,d){var l=this.raw_options[a],i=d||"";return typeof l=="string"&&(i=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),i},p.prototype._get_number=function(a,d){var l=this.raw_options[a];d=parseInt(d,10),isNaN(d)&&(d=0);var i=parseInt(l,10);return isNaN(i)&&(i=d),i},p.prototype._get_selection=function(a,d,l){var i=this._get_selection_list(a,d,l);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[a]+"'");return i[0]},p.prototype._get_selection_list=function(a,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 i=this._get_array(a,l);if(!this._is_valid_selection(i,d))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[a]+"'");return i},p.prototype._is_valid_selection=function(a,d){return a.length&&d.length&&!a.some(function(l){return d.indexOf(l)===-1})};function _(a,d){var l={};a=f(a);var i;for(i in a)i!==d&&(l[i]=a[i]);if(d&&a[d])for(i in a[d])l[i]=a[d][i];return l}function f(a){var d={},l;for(l in a){var i=l.replace(/-/g,"_");d[i]=a[l]}return d}b.exports.Options=p,b.exports.normalizeOpts=f,b.exports.mergeOpts=_},,function(b){var p=RegExp.prototype.hasOwnProperty("sticky");function _(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},_.prototype.peek=function(f){var a=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(a=this.__input.charAt(f)),a},_.prototype.__match=function(f,a){f.lastIndex=a;var d=f.exec(this.__input);return d&&!(p&&f.sticky)&&(d.index!==a&&(d=null)),d},_.prototype.test=function(f,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(f,a):!1},_.prototype.testChar=function(f,a){var d=this.peek(a);return f.lastIndex=0,d!==null&&f.test(d)},_.prototype.match=function(f){var a=this.__match(f,this.__position);return a?this.__position+=a[0].length:a=null,a},_.prototype.read=function(f,a,d){var l="",i;return f&&(i=this.match(f),i&&(l+=i[0])),a&&(i||!f)&&(l+=this.readUntil(a,d)),l},_.prototype.readUntil=function(f,a){var d="",l=this.__position;f.lastIndex=this.__position;var i=f.exec(this.__input);return i?(l=i.index,a&&(l+=i[0].length)):l=this.__input_length,d=this.__input.substring(this.__position,l),this.__position=l,d},_.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},_.prototype.get_regexp=function(f,a){var d=null,l="g";return a&&p&&(l="y"),typeof f=="string"&&f!==""?d=new RegExp(f,l):f&&(d=new RegExp(f.source,l)),d},_.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(f){var a=this.__position,d=this.readUntilAfter(f);return this.__position=a,d},_.prototype.lookBack=function(f){var a=this.__position-1;return a>=f.length&&this.__input.substring(a-f.length,a).toLowerCase()===f},b.exports.InputScanner=_},function(b,p,_){var f=_(8).InputScanner,a=_(3).Token,d=_(10).TokenStream,l=_(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(c,S){this._input=new f(c),this._options=S||{},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,S=new a(i.START,""),C=null,T=[],w=new d;S.type!==i.EOF;){for(c=this._get_next_token(S,C);this._is_comment(c);)w.add(c),c=this._get_next_token(S,C);w.isEmpty()||(c.comments_before=w,w=new d),c.parent=C,this._is_opening(c)?(T.push(C),C=c):C&&this._is_closing(c,C)&&(c.opened=C,C.closed=c,C=T.pop(),c.parent=C),c.previous=S,S.next=c,this.__tokens.add(c),S=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,S){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(i.RAW,C):this._create_token(i.EOF,"")},u.prototype._is_comment=function(c){return!1},u.prototype._is_opening=function(c){return!1},u.prototype._is_closing=function(c,S){return!1},u.prototype._create_token=function(c,S){var C=new a(c,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=u,b.exports.TOKEN=i},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<this.__tokens_length},p.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},p.prototype.peek=function(_){var f=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(f=this.__tokens[_]),f},p.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},b.exports.TokenStream=p},function(b,p,_){var f=_(12).Pattern;function a(d,l){f.call(this,d,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new f,a.prototype.__set_whitespace_patterns=function(d,l){d+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var l=this.__split(this._newline_regexp,d);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return d},a.prototype.matching=function(d,l){var i=this._create();return i.__set_whitespace_patterns(d,l),i._update(),i},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(d,l){d.lastIndex=0;for(var i=0,u=[],c=d.exec(l);c;)u.push(l.substring(i,c.index)),i=c.index+c[0].length,c=d.exec(l);return i<l.length?u.push(l.substring(i,l.length)):u.push(""),u},b.exports.WhitespacePattern=a},function(b){function p(_,f){this._input=_,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}p.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(_){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(_),f._update(),f},p.prototype.until=function(_){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(_),f._update(),f},p.prototype.starting_with=function(_){var f=this._create();return f._starting_pattern=this._input.get_regexp(_,!0),f._update(),f},p.prototype.matching=function(_){var f=this._create();return f._match_pattern=this._input.get_regexp(_,!0),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},b.exports.Pattern=p},function(b){function p(_,f){_=typeof _=="string"?_:_.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+f,"g")}p.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(_);a;)f[a[1]]=a[2],a=this.__directive_pattern.exec(_);return f},p.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=p},function(b,p,_){var f=_(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(l,i){f.call(this,l,i),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),i&&(this.__template_pattern=this._input.get_regexp(i.__template_pattern),this._excluded=Object.assign(this._excluded,i._excluded),this._disabled=Object.assign(this._disabled,i._disabled));var u=new f(l);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),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 f,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(l){var i=this._create();return i._disabled[l]=!0,i._update(),i},d.prototype.read_options=function(l){var i=this._create();for(var u in a)i._disabled[u]=l.templating.indexOf(u)===-1;return i._update(),i},d.prototype.exclude=function(l){var i=this._create();return i._excluded[l]=!0,i._update(),i},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 i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),l+=i,i=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="",i=this._input.peek();if(i==="<"){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 i==="{"&&(!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 f=_(19).Beautifier,a=_(20).Options;function d(l,i,u,c){var S=new f(l,i,u,c);return S.beautify()}b.exports=d,b.exports.defaultOptions=function(){return new a}},function(b,p,_){var f=_(20).Options,a=_(2).Output,d=_(21).Tokenizer,l=_(21).TOKEN,i=/\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 a(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.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var O=0;O<g;O++)this.print_newline(O>0);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 S=function(E){for(var g=null,O=E.next;O.type!==l.EOF&&E.closed!==O;){if(O.type===l.ATTRIBUTE&&O.text==="type"){O.next&&O.next.type===l.EQUALS&&O.next.next&&O.next.next.type===l.VALUE&&(g=O.next.next.text);break}O=O.next}return g},C=function(E,g){var O=null,M=null;return g.closed?(E==="script"?O="text/javascript":E==="style"&&(O="text/css"),O=S(g)||O,O.search("text/css")>-1?M="css":O.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?M="javascript":O.search(/(text|application|dojo)\/(x-)?(html)/)>-1?M="html":O.search(/test\/null/)>-1&&(M="null"),M):null};function T(E,g){return g.indexOf(E)!==-1}function w(E,g,O){this.parent=E||null,this.tag=g?g.tag_name:"",this.indent_level=O||0,this.parser_token=g||null}function A(E){this._printer=E,this._current_frame=null}A.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},A.prototype.record_tag=function(E){var g=new w(this._current_frame,E,this._printer.indent_level);this._current_frame=g},A.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},A.prototype._get_frame=function(E,g){for(var O=this._current_frame;O&&!(E.indexOf(O.tag)!==-1);){if(g&&g.indexOf(O.tag)!==-1){O=null;break}O=O.parent}return O},A.prototype.try_pop=function(E,g){var O=this._get_frame([E],g);return this._try_pop_frame(O)},A.prototype.indent_to_tag=function(E){var g=this._get_frame(E);g&&(this._printer.indent_level=g.indent_level)};function m(E,g,O,M){this._source_text=E||"",g=g||{},this._js_beautify=O,this._css_beautify=M,this._tag_stack=null;var k=new f(g,"html");this._options=k,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&&i.test(E)&&(g=E.match(i)[0])),E=E.replace(u,`
|
|
`);var O=E.match(/^[\t ]*/)[0],M={text:"",type:""},k=new v,U=new c(this._options,O),B=new d(E,this._options).tokenize();this._tag_stack=new A(U);for(var y=null,x=B.next();x.type!==l.EOF;)x.type===l.TAG_OPEN||x.type===l.COMMENT?(y=this._handle_tag_open(U,x,k,M),k=y):x.type===l.ATTRIBUTE||x.type===l.EQUALS||x.type===l.VALUE||x.type===l.TEXT&&!k.tag_complete?y=this._handle_inside_tag(U,x,k,B):x.type===l.TAG_CLOSE?y=this._handle_tag_close(U,x,k):x.type===l.TEXT?y=this._handle_text(U,x,k):U.add_raw_token(x),M=y,x=B.next();var j=U._output.get_code(g);return j},m.prototype._handle_tag_close=function(E,g,O){var M={text:g.text,type:g.type};return E.alignment_size=0,O.tag_complete=!0,E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),O.is_unformatted?E.add_raw_token(g):(O.tag_start_char==="<"&&(E.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&O.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(g)),O.indent_content&&!(O.is_unformatted||O.is_content_unformatted)&&(E.indent(),O.indent_content=!1),!O.is_inline_element&&!(O.is_unformatted||O.is_content_unformatted)&&E.set_wrap_point(),M},m.prototype._handle_inside_tag=function(E,g,O,M){var k=O.has_wrapped_attrs,U={text:g.text,type:g.type};if(E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),O.is_unformatted)E.add_raw_token(g);else if(O.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),O.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&&O.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(g),k=k||g.newlines!==0),this._is_wrap_attributes_force)){var B=O.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&O.attr_count===1){var y=!0,x=0,j;do{if(j=M.peek(x),j.type===l.ATTRIBUTE){y=!1;break}x+=1}while(x<4&&j.type!==l.EOF&&j.type!==l.TAG_CLOSE);B=!y}B&&(E.print_newline(!1),k=!0)}E.print_token(g),k=k||E.previous_token_wrapped(),O.has_wrapped_attrs=k}return U},m.prototype._handle_text=function(E,g,O){var M={text:g.text,type:"TK_CONTENT"};return O.custom_beautifier_name?this._print_custom_beatifier_text(E,g,O):O.is_unformatted||O.is_content_unformatted?E.add_raw_token(g):(E.traverse_whitespace(g),E.print_token(g)),M},m.prototype._print_custom_beatifier_text=function(E,g,O){var M=this;if(g.text!==""){var k=g.text,U,B=1,y="",x="";O.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:O.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:O.custom_beautifier_name==="html"&&(U=function(se,ne){var re=new m(se,ne,M._js_beautify,M._css_beautify);return re.beautify()}),this._options.indent_scripts==="keep"?B=0:this._options.indent_scripts==="separate"&&(B=-E.indent_level);var j=E.get_full_indent(B);if(k=k.replace(/\n[ \t]*$/,""),O.custom_beautifier_name!=="html"&&k[0]==="<"&&k.match(/^(<!--|<!\[CDATA\[)/)){var z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(k);if(!z){E.add_raw_token(g);return}y=j+z[1]+`
|
|
`,k=z[4],z[5]&&(x=j+z[5]),k=k.replace(/\n[ \t]*$/,""),(z[2]||z[3].indexOf(`
|
|
`)!==-1)&&(z=z[3].match(/[ \t]+$/),z&&(g.whitespace_before=z[0]))}if(k)if(U){var Y=function(){this.eol=`
|
|
`};Y.prototype=this._options.raw_options;var $=new Y;k=U(j+k,$)}else{var ce=g.whitespace_before;ce&&(k=k.replace(new RegExp(`
|
|
(`+ce+")?","g"),`
|
|
`)),k=j+k.replace(/\n/g,`
|
|
`+j)}y&&(k?k=y+k+`
|
|
`+x:k=y+x),E.print_newline(!1),k&&(g.text=k,g.whitespace_before="",g.newlines=0,E.add_raw_token(g),E.print_newline(!0))}},m.prototype._handle_tag_open=function(E,g,O,M){var k=this._get_tag_open_token(g);return(O.is_unformatted||O.is_content_unformatted)&&!O.is_empty_element&&g.type===l.TAG_OPEN&&g.text.indexOf("</")===0?(E.add_raw_token(g),k.start_tag_token=this._tag_stack.try_pop(k.tag_name)):(E.traverse_whitespace(g),this._set_tag_position(E,g,k,O,M),k.is_inline_element||E.set_wrap_point(),E.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(k.alignment_size=g.text.length+1),!k.tag_complete&&!k.is_unformatted&&(E.alignment_size=k.alignment_size),k};var v=function(E,g){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!g)this.tag_complete=!0;else{var O;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(O=g.text.match(/^<([^\s>]*)/),this.tag_check=O?O[1]:""):(O=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=O?O[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 M=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(M=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(M)))}};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,O,M,k){if(O.is_empty_element||(O.is_end_tag?O.start_tag_token=this._tag_stack.try_pop(O.tag_name):(this._do_optional_end_element(O)&&(O.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(O),(O.tag_name==="script"||O.tag_name==="style")&&!(O.is_unformatted||O.is_content_unformatted)&&(O.custom_beautifier_name=C(O.tag_check,g)))),T(O.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),O.is_empty_element){if(O.tag_start_char==="{"&&O.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),O.indent_content=!0;var U=E.current_line_has_match(/{{#if/);U||E.print_newline(!1)}O.tag_name==="!--"&&k.type===l.TAG_CLOSE&&M.is_end_tag&&O.text.indexOf(`
|
|
`)===-1||(O.is_inline_element||O.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,O))}else if(O.is_end_tag){var B=!1;B=O.start_tag_token&&O.start_tag_token.multiline_content,B=B||!O.is_inline_element&&!(M.is_inline_element||M.is_unformatted)&&!(k.type===l.TAG_CLOSE&&O.start_tag_token===M)&&k.type!=="TK_CONTENT",(O.is_content_unformatted||O.is_unformatted)&&(B=!1),B&&E.print_newline(!1)}else O.indent_content=!O.custom_beautifier_name,O.tag_start_char==="<"&&(O.tag_name==="html"?O.indent_content=this._options.indent_inner_html:O.tag_name==="head"?O.indent_content=this._options.indent_head_inner_html:O.tag_name==="body"&&(O.indent_content=this._options.indent_body_inner_html)),!(O.is_inline_element||O.is_unformatted)&&(k.type!=="TK_CONTENT"||O.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,O)},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 O=E.parent.parent;(!O||o.indexOf(O.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 f=_(6).Options;function a(d){f.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"])}a.prototype=new f,b.exports.Options=a},function(b,p,_){var f=_(9).Tokenizer,a=_(9).TOKEN,d=_(13).Directives,l=_(14).TemplatablePattern,i=_(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:a.START,RAW:a.RAW,EOF:a.EOF},c=new d(/<\!--/,/-->/),S=function(C,T){f.call(this,C,T),this._current_tag_name="";var w=new l(this._input).read_options(this._options),A=new i(this._input);if(this.__patterns={word:w.until(/[\n\r\t <]/),single_quote:w.until_after(/'/),double_quote:w.until_after(/"/),attribute:w.until(/[\n\r\t =>]|\/>/),element_name:w.until(/[\n\r\t >\/]/),handlebars_comment:A.starting_with(/{{!--/).until_after(/--}}/),handlebars:A.starting_with(/{{/).until_after(/}}/),handlebars_open:A.until(/[\n\r\t }]/),handlebars_raw_close:A.until(/}}/),comment:A.starting_with(/<!--/).until_after(/-->/),cdata:A.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:A.starting_with(/<!\[/).until_after(/]>/),processing:A.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=A.matching(m).until_after(m)}};S.prototype=new f,S.prototype._is_comment=function(C){return!1},S.prototype._is_opening=function(C){return C.type===u.TAG_OPEN},S.prototype._is_closing=function(C,T){return C.type===u.TAG_CLOSE&&T&&((C.text===">"||C.text==="/>")&&T.text[0]==="<"||C.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(C,T){var w=null;this._readWhitespace();var A=this._input.peek();return A===null?this._create_token(u.EOF,""):(w=w||this._read_open_handlebars(A,T),w=w||this._read_attribute(A,C,T),w=w||this._read_close(A,T),w=w||this._read_raw_content(A,C,T),w=w||this._read_content_word(A),w=w||this._read_comment_or_cdata(A),w=w||this._read_processing(A),w=w||this._read_open(A,T),w=w||this._create_token(u.UNKNOWN,this._input.next()),w)},S.prototype._read_comment_or_cdata=function(C){var T=null,w=null,A=null;if(C==="<"){var m=this._input.peek(1);m==="!"&&(w=this.__patterns.comment.read(),w?(A=c.get_directives(w),A&&A.ignore==="start"&&(w+=c.readIgnored(this._input))):w=this.__patterns.cdata.read()),w&&(T=this._create_token(u.COMMENT,w),T.directives=A)}return T},S.prototype._read_processing=function(C){var T=null,w=null,A=null;if(C==="<"){var m=this._input.peek(1);(m==="!"||m==="?")&&(w=this.__patterns.conditional_comment.read(),w=w||this.__patterns.processing.read()),w&&(T=this._create_token(u.COMMENT,w),T.directives=A)}return T},S.prototype._read_open=function(C,T){var w=null,A=null;return T||C==="<"&&(w=this._input.next(),this._input.peek()==="/"&&(w+=this._input.next()),w+=this.__patterns.element_name.read(),A=this._create_token(u.TAG_OPEN,w)),A},S.prototype._read_open_handlebars=function(C,T){var w=null,A=null;return T||this._options.indent_handlebars&&C==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(w=this.__patterns.handlebars_comment.read(),w=w||this.__patterns.handlebars.read(),A=this._create_token(u.COMMENT,w)):(w=this.__patterns.handlebars_open.read(),A=this._create_token(u.TAG_OPEN,w))),A},S.prototype._read_close=function(C,T){var w=null,A=null;return T&&(T.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(w=this._input.next(),C==="/"&&(w+=this._input.next()),A=this._create_token(u.TAG_CLOSE,w)):T.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),A=this._create_token(u.TAG_CLOSE,"}}"))),A},S.prototype._read_attribute=function(C,T,w){var A=null,m="";if(w&&w.text[0]==="<")if(C==="=")A=this._create_token(u.EQUALS,this._input.next());else if(C==='"'||C==="'"){var v=this._input.next();C==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),A=this._create_token(u.VALUE,v)}else m=this.__patterns.attribute.read(),m&&(T.type===u.EQUALS?A=this._create_token(u.VALUE,m):A=this._create_token(u.ATTRIBUTE,m));return A},S.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},S.prototype._read_raw_content=function(C,T,w){var A="";if(w&&w.text[0]==="{")A=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(C);if(v)return v.type=u.TEXT,v;A=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(m)&&(A=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig")))}return A?this._create_token(u.TEXT,A):null},S.prototype._read_content_word=function(C){var T="";if(this._options.unformatted_content_delimiter&&(C===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=S,b.exports.TOKEN=u}],F={};function R(b){var p=F[b];if(p!==void 0)return p.exports;var _=F[b]={exports:{}};return W[b](_,_.exports,R),_.exports}var D=R(18);I=D})();var K=I;if(!0)!(oe=[H,H("6UM0"),H("TXwP")],V=function(W){var F=H("6UM0"),R=H("TXwP");return{html_beautify:function(D,b){return K(D,b,F.js_beautify,R.css_beautify)}}}.apply(Be,oe),V!==void 0&&(rt.exports=V));else var L,N})()},"rAM+":function(rt,Be,H){"use strict";H.d(Be,"a",function(){return V});var oe=H("Qw5x");function V(I,K){var L;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(L=Object(oe.a)(I))||K&&I&&typeof I.length=="number"){L&&(I=L);var N=0,W=function(){};return{s:W,n:function(){return N>=I.length?{done:!0}:{done:!1,value:I[N++]}},e:function(p){throw p},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var F=!0,R=!1,D;return{s:function(){L=I[Symbol.iterator]()},n:function(){var p=L.next();return F=p.done,p},e:function(p){R=!0,D=p},f:function(){try{!F&&L.return!=null&&L.return()}finally{if(R)throw D}}}}},rUJ1:function(rt,Be){const H=/[&<>"']/,oe=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},L=A=>K[A];function N(A,m){if(m){if(H.test(A))return A.replace(oe,L)}else if(V.test(A))return A.replace(I,L);return A}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(A){return A.replace(W,(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 R=/(^|[^\[])\^/g;function D(A,m){A=A.source||A,m=m||"";const v={replace:(s,o)=>(o=o.source||o,o=o.replace(R,"$1"),A=A.replace(s,o),v),getRegex:()=>new RegExp(A,m)};return v}const b=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(A,m,v){if(A){let s;try{s=decodeURIComponent(F(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=i(m,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(s){return null}return v}const f={},a=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(A,m){f[" "+A]||(a.test(A)?f[" "+A]=A+"/":f[" "+A]=C(A,"/",!0)),A=f[" "+A];const v=A.indexOf(":")===-1;return m.substring(0,2)==="//"?v?m:A.replace(d,"$1")+m:m.charAt(0)==="/"?v?m:A.replace(l,"$1")+m:A+m}const u={exec:function(){}};function c(A){let m=1,v,s;for(;m<arguments.length;m++){v=arguments[m];for(s in v)Object.prototype.hasOwnProperty.call(v,s)&&(A[s]=v[s])}return A}function S(A,m){const v=A.replace(/\|/g,(E,g,O)=>{let M=!1,k=g;for(;--k>=0&&O[k]==="\\";)M=!M;return M?"|":" |"}),s=v.split(/ \|/);let o=0;if(s.length>m)s.splice(m);else for(;s.length<m;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(/\\\|/g,"|");return s}function C(A,m,v){const s=A.length;if(s===0)return"";let o=0;for(;o<s;){const E=A.charAt(s-o-1);if(E===m&&!v)o++;else if(E!==m&&v)o++;else break}return A.substr(0,s-o)}function T(A,m){if(A.indexOf(m[1])===-1)return-1;const v=A.length;let s=0,o=0;for(;o<v;o++)if(A[o]==="\\")o++;else if(A[o]===m[0])s++;else if(A[o]===m[1]&&(s--,s<0))return o;return-1}function w(A){A&&A.sanitize&&!A.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}rt.exports={escape:N,unescape:F,edit:D,cleanUrl:_,resolveUrl:i,noopTest:u,merge:c,splitCells:S,rtrim:C,findClosingBracket:T,checkSanitizeDeprecation:w}},sboe:function(rt,Be,H){"use strict";H.d(Be,"a",function(){return I});var oe=H("cDcd"),V=H.n(oe),I=oe.createContext(null)},sesT:function(rt,Be){rt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAoCAYAAACb3CikAAAAAXNSR0IArs4c6QAABJFJREFUWEftWF1oHFUU/u7MZmazm4Q0tS/RmARSba0tDVazqyB9sVYlDzWRllopErWlER9EFFGRIuqDT0UoQaO0adKkQqui+FKhQmqSQn8o1cbYQH9Iia3QNN387Pwemdmdyd472Z0kRMhD7ssddu4997vnfOc7Z5YRkYwlMNgyECEKyx4RabmEPfL39mdham0EqgIYAEJmDg7xrbfSmZ3BGECUmZ3hPWfnFCB/gbXHP3PXillDf754lQhVsxrKQvIO8jHm/SEUKiQluhYPHb0SAGJdajYzXuBvMKtHGAMRgXlXnqceOXsjUrQJj3b9KAD5jZkXDxqePQKBgcGZXQ9ln53ZBSq8DxAwZL1rT2JvFq0/1iYA+TKiXzidnjEY5lr+aMczuR7ynp0572DS58rG7o94IKP7VW10aNLbKJItQN5c9mVcxnE78FoMpRNWST6s1He28ECG3oulUyP3/NAQoNS+Drl0zTyj76UND8y6NwjjWrubPV4yADgZ3dT1HA/kwlsVU8bYbf9UIqhVjZDj1XmAzC901uR1aCM/+7ZcpjF2tvjxjgQHZPqP1kp7YuKGLxuiMATgBJSDd0EAZ1ZUfM4wR0CG4g0d6zgg2vnWWkObuJIvDiIZxXVzImfOpqxHbsYTh6o5IPr5fesMffKiH0SBfcF0FnWXd0FY+ru7mTQeTxxayQFJn9uTNPWp3nw6EaYjhQtCMK0coBKYGUt2RDkgU2dbtpCh/+Ipq5OPal0LImWLkzXm+CC04W+zPMpmDpgWSx6J82Qd2N1sk9XjhdG5ofJgIyIli5M15sQ1aNd/8qtgthZOxJKd5bxHBl55A2Qf9JVQULSwZA0PDU/vTM6xu7Fk5308R87s+sC27P1e+gaVMX9Zn0VYg8VZSDP3nmC348muSt4j/S8fAOzWXOXL7ScClkNdEKb5LvzLseTRDTxH+nYcI6DJ54hYxAL9iChQC6gEDL/Gkj1bRSADYNiUWy3V1Xsglz2ygBOCRdAavwx9+KucCkKQZOlItKH7VR5I//ZREFbNSDxBqd4GuaR2cWpN6ir0Gz/w/Y3EPo0lej6eAXJpX9l06t87fIcappSCshZqUvNcRZbVl5SGzu99IOaZnUnD1Ho9W16Z5sgqGJt3VonNNIDi4hU1qG8f8YFo/U2vEdlt3FniSWLnM19hEe1J0j/R5IkH3Et7Xbzev+0bsq3duUBCinzh74W50JtF2tUnT+zlgfQ1/gWiukL7w9qTMFkRHSJH1GciieOnZoCca16tp6cGuS+g2RAFm1hBswVdKfyFdVN56t0aYLPbOLqhMfteeJ/I+iQARDAkNj4BD+RZb7BSjKeLUEK3XJbpKEdRRf3h0voPW3zxJPpOMU5/PQxQVRj35hL2QNcG4K6pYnLsFmyDYKQJKzfstVZtfHoF8PCUD8T8fcsOss3uhRwStseCjRQB2nQaZtoCiqpRvv5tirKxd9T7nz+Qu58ZvZv7GZBwfgxr7ebSk1pQYbAYdNuEIREiJXWAUoNI+RNQKh6DfOdUj1K5dZd4iSX8t0SYv/+n98seER37H8mkzkc00C7pAAAAAElFTkSuQmCC"},spXi:function(rt,Be,H){rt.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(rt,Be,H){"use strict";var oe=H("VTBJ"),V=H("1OyB"),I=H("vuIU"),K=H("Ji7U"),L=H("LK+K"),N=H("cDcd"),W=H.n(N),F=H("m+aA"),R=H("Zm9Q"),D=H("Kwbf"),b=H("c+Xe"),p=H("bdgK"),_="rc-observer-key",f=function(a){Object(K.a)(l,a);var d=Object(L.a)(l);function l(){var i;return Object(V.a)(this,l),i=d.apply(this,arguments),i.resizeObserver=null,i.childNode=null,i.currentElement=null,i.state={width:0,height:0,offsetHeight:0,offsetWidth:0},i.onResize=function(u){var c=i.props.onResize,S=u[0].target,C=S.getBoundingClientRect(),T=C.width,w=C.height,A=S.offsetWidth,m=S.offsetHeight,v=Math.floor(T),s=Math.floor(w);if(i.state.width!==v||i.state.height!==s||i.state.offsetWidth!==A||i.state.offsetHeight!==m){var o={width:v,height:s,offsetWidth:A,offsetHeight:m};i.setState(o),c&&Promise.resolve().then(function(){c(Object(oe.a)(Object(oe.a)({},o),{},{offsetWidth:A,offsetHeight:m}))})}},i.setChildNode=function(u){i.childNode=u},i}return Object(I.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var c=Object(F.a)(this.childNode||this),S=c!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=c),!this.resizeObserver&&c&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(c))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,c=Object(R.a)(u);if(c.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=c[0];if(N.isValidElement(S)&&Object(b.c)(S)){var C=S.ref;c[0]=N.cloneElement(S,{ref:Object(b.a)(C,this.setChildNode)})}return c.length===1?c[0]:c.map(function(T,w){return!N.isValidElement(T)||"key"in T&&T.key!==null?T:N.cloneElement(T,{key:"".concat(_,"-").concat(w)})})}}]),l}(N.Component);f.displayName="ResizeObserver",Be.a=f},tK3L:function(rt,Be,H){rt.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(rt,Be,H){typeof window!="undefined"&&function(V,I){rt.exports=I()}(this,function(){return function(oe){var V={};function I(K){if(V[K])return V[K].exports;var L=V[K]={i:K,l:!1,exports:{}};return oe[K].call(L.exports,L,L.exports,I),L.l=!0,L.exports}return I.m=oe,I.c=V,I.d=function(K,L,N){I.o(K,L)||Object.defineProperty(K,L,{enumerable:!0,get:N})},I.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},I.t=function(K,L){if(L&1&&(K=I(K)),L&8)return K;if(L&4&&typeof K=="object"&&K&&K.__esModule)return K;var N=Object.create(null);if(I.r(N),Object.defineProperty(N,"default",{enumerable:!0,value:K}),L&2&&typeof K!="string")for(var W in K)I.d(N,W,function(F){return K[F]}.bind(null,W));return N},I.n=function(K){var L=K&&K.__esModule?function(){return K.default}:function(){return K};return I.d(L,"a",L),L},I.o=function(K,L){return Object.prototype.hasOwnProperty.call(K,L)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,V,I){"use strict";var K=Object.prototype.hasOwnProperty,L="~";function N(){}Object.create&&(N.prototype=Object.create(null),new N().__proto__||(L=!1));function W(b,p,_){this.fn=b,this.context=p,this.once=_||!1}function F(b,p,_,f,a){if(typeof _!="function")throw new TypeError("The listener must be a function");var d=new W(_,f||b,a),l=L?L+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 R(b,p){--b._eventsCount===0?b._events=new N:delete b._events[p]}function D(){this._events=new N,this._eventsCount=0}D.prototype.eventNames=function(){var p=[],_,f;if(this._eventsCount===0)return p;for(f in _=this._events)K.call(_,f)&&p.push(L?f.slice(1):f);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(_)):p},D.prototype.listeners=function(p){var _=L?L+p:p,f=this._events[_];if(!f)return[];if(f.fn)return[f.fn];for(var a=0,d=f.length,l=new Array(d);a<d;a++)l[a]=f[a].fn;return l},D.prototype.listenerCount=function(p){var _=L?L+p:p,f=this._events[_];return f?f.fn?1:f.length:0},D.prototype.emit=function(p,_,f,a,d,l){var i=L?L+p:p;if(!this._events[i])return!1;var u=this._events[i],c=arguments.length,S,C;if(u.fn){u.once&&this.removeListener(p,u.fn,void 0,!0);switch(c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,_),!0;case 3:return u.fn.call(u.context,_,f),!0;case 4:return u.fn.call(u.context,_,f,a),!0;case 5:return u.fn.call(u.context,_,f,a,d),!0;case 6:return u.fn.call(u.context,_,f,a,d,l),!0}for(C=1,S=new Array(c-1);C<c;C++)S[C-1]=arguments[C];u.fn.apply(u.context,S)}else{var T=u.length,w;for(C=0;C<T;C++){u[C].once&&this.removeListener(p,u[C].fn,void 0,!0);switch(c){case 1:u[C].fn.call(u[C].context);break;case 2:u[C].fn.call(u[C].context,_);break;case 3:u[C].fn.call(u[C].context,_,f);break;case 4:u[C].fn.call(u[C].context,_,f,a);break;default:if(!S)for(w=1,S=new Array(c-1);w<c;w++)S[w-1]=arguments[w];u[C].fn.apply(u[C].context,S)}}}return!0},D.prototype.on=function(p,_,f){return F(this,p,_,f,!1)},D.prototype.once=function(p,_,f){return F(this,p,_,f,!0)},D.prototype.removeListener=function(p,_,f,a){var d=L?L+p:p;if(!this._events[d])return this;if(!_)return R(this,d),this;var l=this._events[d];if(l.fn)l.fn===_&&(!a||l.once)&&(!f||l.context===f)&&R(this,d);else{for(var i=0,u=[],c=l.length;i<c;i++)(l[i].fn!==_||a&&!l[i].once||f&&l[i].context!==f)&&u.push(l[i]);u.length?this._events[d]=u.length===1?u[0]:u:R(this,d)}return this},D.prototype.removeAllListeners=function(p){var _;return p?(_=L?L+p:p,this._events[_]&&R(this,_)):(this._events=new N,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=L,D.EventEmitter=D,oe.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,V,I){(function(K){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,N=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,R={buildAbsoluteURL:function(D,b,p){if(p=p||{},D=D.trim(),b=b.trim(),!b){if(!p.alwaysNormalize)return D;var _=R.parseURL(D);if(!_)throw new Error("Error trying to parse base URL.");return _.path=R.normalizePath(_.path),R.buildURLFromParts(_)}var f=R.parseURL(b);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return p.alwaysNormalize?(f.path=R.normalizePath(f.path),R.buildURLFromParts(f)):b;var a=R.parseURL(D);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var d=N.exec(a.path);a.netLoc=d[1],a.path=d[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(l.netLoc=a.netLoc,f.path[0]!=="/"))if(!f.path)l.path=a.path,f.params||(l.params=a.params,f.query||(l.query=a.query));else{var i=a.path,u=i.substring(0,i.lastIndexOf("/")+1)+f.path;l.path=R.normalizePath(u)}return l.path===null&&(l.path=p.alwaysNormalize?R.normalizePath(f.path):f.path),R.buildURLFromParts(l)},parseURL:function(D){var b=L.exec(D);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(W,"");D.length!==(D=D.replace(F,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};oe.exports=R})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,V,I){function K(p){var _={};function f(d){if(_[d])return _[d].exports;var l=_[d]={i:d,l:!1,exports:{}};return p[d].call(l.exports,l,l.exports,f),l.l=!0,l.exports}f.m=p,f.c=_,f.i=function(d){return d},f.d=function(d,l,i){f.o(d,l)||Object.defineProperty(d,l,{configurable:!1,enumerable:!0,get:i})},f.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},f.n=function(d){var l=d&&d.__esModule?function(){return d.default}:function(){return d};return f.d(l,"a",l),l},f.o=function(d,l){return Object.prototype.hasOwnProperty.call(d,l)},f.p="/",f.oe=function(d){throw console.error(d),d};var a=f(f.s=ENTRY_MODULE);return a.default||a}var L="[\\.|\\-|\\+|\\w|/|@]+",N="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function W(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(p){return!isNaN(1*p)}function R(p,_,f){var a={};a[f]=[];var d=_.toString(),l=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return a;for(var i=l[1],u=new RegExp("(\\\\n|\\W)"+W(i)+N,"g"),c;c=u.exec(d);){if(c[3]==="dll-reference")continue;a[f].push(c[3])}for(u=new RegExp("\\("+W(i)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+N,"g");c=u.exec(d);)p[c[2]]||(a[f].push(c[1]),p[c[2]]=I(c[1]).m),a[c[2]]=a[c[2]]||[],a[c[2]].push(c[4]);for(var S=Object.keys(a),C=0;C<S.length;C++)for(var T=0;T<a[S[C]].length;T++)F(a[S[C]][T])&&(a[S[C]][T]=1*a[S[C]][T]);return a}function D(p){var _=Object.keys(p);return _.reduce(function(f,a){return f||p[a].length>0},!1)}function b(p,_){for(var f={main:[_]},a={main:[]},d={main:{}};D(f);)for(var l=Object.keys(f),i=0;i<l.length;i++){var u=l[i],c=f[u],S=c.pop();if(d[u]=d[u]||{},d[u][S]||!p[u][S])continue;d[u][S]=!0,a[u]=a[u]||[],a[u].push(S);for(var C=R(p,p[u][S],u),T=Object.keys(C),w=0;w<T.length;w++)f[T[w]]=f[T[w]]||[],f[T[w]]=f[T[w]].concat(C[T[w]])}return a}oe.exports=function(p,_){_=_||{};var f={main:I.m},a=_.all?{main:Object.keys(f.main)}:b(f,p),d="";Object.keys(a).filter(function(S){return S!=="main"}).forEach(function(S){for(var C=0;a[S][C];)C++;a[S].push(C),f[S][C]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+S+" = ("+K.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+a[S].map(function(T){return""+JSON.stringify(T)+": "+f[S][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+K.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a.main.map(function(S){return""+JSON.stringify(S)+": "+f.main[S].toString()}).join(",")+"}))(self);";var l=new window.Blob([d],{type:"text/javascript"});if(_.bare)return l;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,u=i.createObjectURL(l),c=new window.Worker(u);return c.objectURL=u,c}},"./src/config.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"hlsDefaultConfig",function(){return w}),I.d(V,"mergeConfig",function(){return m}),I.d(V,"enableStreamingMode",function(){return v});var K=I("./src/controller/abr-controller.ts"),L=I("./src/controller/audio-stream-controller.ts"),N=I("./src/controller/audio-track-controller.ts"),W=I("./src/controller/subtitle-stream-controller.ts"),F=I("./src/controller/subtitle-track-controller.ts"),R=I("./src/controller/buffer-controller.ts"),D=I("./src/controller/timeline-controller.ts"),b=I("./src/controller/cap-level-controller.ts"),p=I("./src/controller/fps-controller.ts"),_=I("./src/controller/eme-controller.ts"),f=I("./src/controller/cmcd-controller.ts"),a=I("./src/utils/xhr-loader.ts"),d=I("./src/utils/fetch-loader.ts"),l=I("./src/utils/cues.ts"),i=I("./src/utils/mediakeys-helper.ts"),u=I("./src/utils/logger.ts");function c(){return c=Object.assign||function(s){for(var o=1;o<arguments.length;o++){var E=arguments[o];for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&(s[g]=E[g])}return s},c.apply(this,arguments)}function S(s,o){var E=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);o&&(g=g.filter(function(O){return Object.getOwnPropertyDescriptor(s,O).enumerable})),E.push.apply(E,g)}return E}function C(s){for(var o=1;o<arguments.length;o++){var E=arguments[o]!=null?arguments[o]:{};o%2?S(Object(E),!0).forEach(function(g){T(s,g,E[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(E)):S(Object(E)).forEach(function(g){Object.defineProperty(s,g,Object.getOwnPropertyDescriptor(E,g))})}return s}function T(s,o,E){return o in s?Object.defineProperty(s,o,{value:E,enumerable:!0,configurable:!0,writable:!0}):s[o]=E,s}var w=C(C({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:K.default,bufferController:R.default,capLevelController:b.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:F.default,timelineController:D.TimelineController,audioStreamController:L.default,audioTrackController:N.default,emeController:_.default,cmcdController:f.default});function A(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function m(s,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return c({},s,o)}function v(s){var o=s.loader;if(o!==d.default&&o!==a.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var E=Object(d.fetchSupported)();E&&(s.loader=d.default,s.progressive=!0,s.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/polyfills/number.ts"),L=I("./src/utils/ewma-bandwidth-estimator.ts"),N=I("./src/events.ts"),W=I("./src/utils/buffer-helper.ts"),F=I("./src/errors.ts"),R=I("./src/types/loader.ts"),D=I("./src/utils/logger.ts");function b(f,a){for(var d=0;d<a.length;d++){var l=a[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}function p(f,a,d){return a&&b(f.prototype,a),d&&b(f,d),f}var _=function(){function f(d){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=d;var l=d.config;this.bwEstimator=new L.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var a=f.prototype;return a.registerListeners=function(){var l=this.hls;l.on(N.Events.FRAG_LOADING,this.onFragLoading,this),l.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(N.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(N.Events.FRAG_LOADING,this.onFragLoading,this),l.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(N.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(l,i){var u=i.frag;if(u.type===R.PlaylistLevelType.MAIN&&!this.timer){var c;this.fragCurrent=u,this.partCurrent=(c=i.part)!=null?c:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(l,i){var u=this.hls.config;i.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var l=this.fragCurrent,i=this.partCurrent,u=this.hls,c=u.autoLevelEnabled,S=u.config,C=u.media;if(!l||!C)return;var T=i?i.stats:l.stats,w=i?i.duration:l.duration;if(T.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!c||C.paused||!C.playbackRate||!C.readyState)return;var A=performance.now()-T.loading.start,m=Math.abs(C.playbackRate);if(A<=500*w/m)return;var v=u.levels,s=u.minAutoLevel,o=v[l.level],E=T.total||Math.max(T.loaded,Math.round(w*o.maxBitrate/8)),g=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/A),O=(E-T.loaded)/g,M=C.currentTime,k=(W.BufferHelper.bufferInfo(C,M,S.maxBufferHole).end-M)/m;if(k>=2*w/m||O<=k)return;var U=Number.POSITIVE_INFINITY,B;for(B=l.level-1;B>s;B--){var y=v[B].maxBitrate;if(U=w*y/(8*.8*g),U<k)break}if(U>=O)return;var x=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(i?" part "+i.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+B+`
|
|
Current BW estimate: `+(Object(K.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+O.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+U.toFixed(3)+` s
|
|
Time to underbuffer: `+k.toFixed(3)+" s"),u.nextLoadLevel=B,this.bwEstimator.sample(A,T.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),u.trigger(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:i,stats:T})},a.onFragLoaded=function(l,i){var u=i.frag,c=i.part;if(u.type===R.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(u.sn)){var S=c?c.stats:u.stats,C=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],w=(T.loaded?T.loaded.bytes:0)+S.loaded,A=(T.loaded?T.loaded.duration:0)+C;T.loaded={bytes:w,duration:A},T.realBitrate=Math.round(8*w/A)}if(u.bitrateTest){var m={stats:S,frag:u,part:c,id:u.type};this.onFragBuffered(N.Events.FRAG_BUFFERED,m),u.bitrateTest=!1}}},a.onFragBuffered=function(l,i){var u=i.frag,c=i.part,S=c?c.stats:u.stats;if(S.aborted)return;if(u.type!==R.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var C=S.parsing.end-S.loading.start;this.bwEstimator.sample(C,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0},a.onError=function(l,i){switch(i.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var l=this.fragCurrent,i=this.partCurrent,u=this.hls,c=u.maxAutoLevel,S=u.config,C=u.minAutoLevel,T=u.media,w=i?i.duration:l?l.duration:0,A=T?T.currentTime:0,m=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,s=(W.BufferHelper.bufferInfo(T,A,S.maxBufferHole).end-A)/m,o=this.findBestLevel(v,C,c,s,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(o>=0)return o;D.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=w?Math.min(w,S.maxStarvationDelay):S.maxStarvationDelay,g=S.abrBandWidthFactor,O=S.abrBandWidthUpFactor;if(!s){var M=this.bitrateTestDelay;if(M){var k=w?Math.min(w,S.maxLoadingDelay):S.maxLoadingDelay;E=k-M,D.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),g=O=1}}return o=this.findBestLevel(v,C,c,s+E,g,O),Math.max(o,0)},a.findBestLevel=function(l,i,u,c,S,C){for(var T,w=this.fragCurrent,A=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=A?A.duration:w?w.duration:0,O=u;O>=i;O--){var M=v[O];if(!M||E&&M.codecSet!==E)continue;var k=M.details,U=(A?k==null?void 0:k.partTarget:k==null?void 0:k.averagetargetduration)||g,B=void 0;O<=m?B=S*l:B=C*l;var y=v[O].maxBitrate,x=y*U/B;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+O+"/"+Math.round(B)+"/"+y+"/"+U+"/"+c+"/"+x),B>y&&(!x||o&&!this.bitrateTestDelay||x<c))return O}return-1},p(f,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,i=this.bwEstimator;if(l!==-1&&(!i||!i.canEstimate()))return l;var u=this.getNextABRAutoLevel();return l!==-1&&(u=Math.min(l,u)),u},set:function(l){this._nextAutoLevel=l}}]),f}();V.default=_},"./src/controller/audio-stream-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/polyfills/number.ts"),L=I("./src/controller/base-stream-controller.ts"),N=I("./src/events.ts"),W=I("./src/utils/buffer-helper.ts"),F=I("./src/controller/fragment-tracker.ts"),R=I("./src/types/level.ts"),D=I("./src/types/loader.ts"),b=I("./src/loader/fragment.ts"),p=I("./src/demux/chunk-cache.ts"),_=I("./src/demux/transmuxer-interface.ts"),f=I("./src/types/transmuxer.ts"),a=I("./src/controller/fragment-finders.ts"),d=I("./src/utils/discontinuities.ts"),l=I("./src/errors.ts"),i=I("./src/utils/logger.ts");function u(){return u=Object.assign||function(w){for(var A=1;A<arguments.length;A++){var m=arguments[A];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(w[v]=m[v])}return w},u.apply(this,arguments)}function c(w,A){w.prototype=Object.create(A.prototype),w.prototype.constructor=w,S(w,A)}function S(w,A){return S=Object.setPrototypeOf||function(v,s){return v.__proto__=s,v},S(w,A)}var C=100,T=function(w){c(A,w);function A(v,s){var o;return o=w.call(this,v,s,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var m=A.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var s=this.hls;s.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(N.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(N.Events.ERROR,this.onError,this),s.on(N.Events.BUFFER_RESET,this.onBufferReset,this),s.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var s=this.hls;s.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(N.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(N.Events.ERROR,this.onError,this),s.off(N.Events.BUFFER_RESET,this.onBufferReset,this),s.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(s,o){var E=o.frag,g=o.id,O=o.initPTS;if(g==="main"){var M=E.cc;this.initPTS[E.cc]=O,this.log("InitPTS for cc: "+M+" found from main: "+O),this.videoTrackCC=M,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=L.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(C),this.fragLoadError=0,o>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},m.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.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=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var O,M=performance.now(),k=this.retryDate;(!k||M>=k||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var U=this.waitingData;if(U){var B=U.frag,y=U.part,x=U.cache,j=U.complete;if(this.initPTS[B.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var z=x.flush(),Y={frag:B,part:y,payload:z,networkDetails:null};this._handleFragmentLoadProgress(Y),j&&w.prototype._handleFragmentLoadComplete.call(this,Y)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+B.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var $=this.getLoadPosition(),ce=W.BufferHelper.bufferInfo(this.mediaBuffer,$,this.config.maxBufferHole),se=Object(a.fragmentWithinToleranceTest)(ce.end,this.config.maxFragLookUpTolerance,B);se<0&&(i.logger.log("Waiting fragment cc ("+B.cc+") @ "+B.start+" cancelled because another fragment at "+ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.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=L.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,O=this.media,M=this.trackId,k=E.config;if(!g||!g[M])return;if(!O&&(this.startFragRequested||!k.startFragPrefetch))return;var U=g[M],B=U.details;if(!B||B.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(B)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var y=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(y===null)return;var x=y.len,j=this.getMaxBufferLength(),z=this.audioSwitch;if(x>=j&&!z)return;if(!z&&this._streamEnded(y,B)){E.trigger(N.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var Y=B.fragments,$=Y[0].start,ce=y.end;if(z){var se=this.getLoadPosition();ce=se,B.PTSKnown&&se<$&&((y.end>$||y.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),O.currentTime=$+.05))}var ne=this.getNextFragment(ce,B);if(!ne){this.bufferFlushed=!0;return}((s=ne.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((o=ne.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ne,B):this.loadFragment(ne,B,ce)},m.getMaxBufferLength=function(){var s=w.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return o===null?s:Math.max(s,o.len)},m.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(s,o){var E=o.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(g){return new R.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(C):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.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,O=o.details,M=o.id;if(!g){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+O.startSN+","+O.endSN+"],duration:"+O.totalduration);var k=g[M],U=0;if(O.live||(E=k.details)!==null&&E!==void 0&&E.live){var B=this.mainDetails;if(O.fragments[0]||(O.deltaUpdateFailed=!0),O.deltaUpdateFailed||!B)return;!k.details&&O.hasProgramDateTime&&B.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(O,B),U=O.fragments[0].start):U=this.alignPlaylists(O,k.details)}k.details=O,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!O.live)&&this.setStartPosition(k.details,U),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(O)&&(this.state=L.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(s){var o,E=s.frag,g=s.part,O=s.payload,M=this.config,k=this.trackId,U=this.levels;if(!U){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 B=U[k];console.assert(B,"Audio track is defined on fragment load progress");var y=B.details;console.assert(y,"Audio track details are defined on fragment load progress");var x=M.defaultAudioCodec||B.audioCodec||"mp4a.40.2",j=this.transmuxer;j||(j=this.transmuxer=new _.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[E.cc],Y=(o=E.initSegment)===null||o===void 0?void 0:o.data;if(z!==void 0){var $=!1,ce=g?g.index:-1,se=ce!==-1,ne=new f.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,O.byteLength,ce,se);j.push(O,Y,x,"",E,g,y.totalduration,$,ne,z)}else{i.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 "+k);var re=this.waitingData=this.waitingData||{frag:E,part:g,cache:new p.default,complete:!1},ue=re.cache;ue.push(new Uint8Array(O)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}w.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!==D.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(N.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(D.PlaylistLevelType.AUDIO,o);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=o.fatal?L.State.ERROR:L.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===L.State.PARSING||this.state===L.State.PARSED)){var E=!0,g=this.getFwdBufferInfo(this.mediaBuffer,D.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,w.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,O=s.remuxResult,M=s.chunkMeta,k=this.getCurrentContext(M);if(!k){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var U=k.frag,B=k.part,y=O.audio,x=O.text,j=O.id3,z=O.initSegment;if(this.fragContextChanged(U))return;if(this.state=L.State.PARSING,this.audioSwitch&&y&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,U,M),g.trigger(N.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:E,tracks:z.tracks})),y){var Y=y.startPTS,$=y.endPTS,ce=y.startDTS,se=y.endDTS;B&&(B.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:$,startDTS:ce,endDTS:se}),U.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,Y,$,ce,se),this.bufferFragmentData(y,U,B,M)}if(j!=null&&(o=j.samples)!==null&&o!==void 0&&o.length){var ne=u({frag:U,id:E},j);g.trigger(N.Events.FRAG_PARSING_METADATA,ne)}if(x){var re=u({frag:U,id:E},x);g.trigger(N.Events.FRAG_PARSING_USERDATA,re)}},m._bufferInitSegment=function(s,o,E){if(this.state!==L.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(N.Events.BUFFER_CODECS,s);var O=g.initSegment;if(O!=null&&O.byteLength){var M={type:"audio",frag:o,part:null,chunkMeta:E,parent:o.type,data:O};this.hls.trigger(N.Events.BUFFER_APPENDING,M)}this.tick()},m.loadFragment=function(s,o,E){var g=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||g===F.FragmentState.NOT_LOADED||g===F.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):o.live&&!Object(K.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=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.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"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:E})},A}(L.default);V.default=T},"./src/controller/audio-track-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/events.ts"),L=I("./src/errors.ts"),N=I("./src/controller/base-playlist-controller.ts"),W=I("./src/types/loader.ts");function F(_,f){for(var a=0;a<f.length;a++){var d=f[a];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(_,d.key,d)}}function R(_,f,a){return f&&F(_.prototype,f),a&&F(_,a),_}function D(_,f){_.prototype=Object.create(f.prototype),_.prototype.constructor=_,b(_,f)}function b(_,f){return b=Object.setPrototypeOf||function(d,l){return d.__proto__=l,d},b(_,f)}var p=function(_){D(f,_);function f(d){var l;return l=_.call(this,d,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var a=f.prototype;return a.registerListeners=function(){var l=this.hls;l.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(K.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(K.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,_.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(l,i){this.tracks=i.audioTracks||[]},a.onAudioTrackLoaded=function(l,i){var u=i.id,c=i.details,S=this.tracksInGroup[u];if(!S){this.warn("Invalid audio track id "+u);return}var C=S.details;S.details=i.details,this.log("audioTrack "+u+" loaded ["+c.startSN+"-"+c.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,i,C))},a.onLevelLoading=function(l,i){this.switchLevel(i.level)},a.onLevelSwitching=function(l,i){this.switchLevel(i.level)},a.switchLevel=function(l){var i=this.hls.levels[l];if(!(i!=null&&i.audioGroupIds))return;var u=i.audioGroupIds[i.urlId];if(this.groupId!==u){this.groupId=u;var c=this.tracks.filter(function(C){return!u||C.groupId===u});this.selectDefaultTrack&&!c.some(function(C){return C.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=c;var S={audioTracks:c};this.log("Updating audio tracks, "+c.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(K.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},a.onError=function(l,i){if(_.prototype.onError.call(this,l,i),i.fatal||!i.context)return;i.context.type===W.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},a.setAudioTrack=function(l){var i=this.tracksInGroup;if(l<0||l>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=i[this.trackId];this.log("Now switching to audio-track index "+l);var c=i[l],S=c.id,C=c.groupId,T=C===void 0?"":C,w=c.name,A=c.type,m=c.url;if(this.trackId=l,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:T,name:w,type:A,url:m}),c.details&&!c.details.live)return;var v=this.switchParams(c.url,u==null?void 0:u.details);this.loadPlaylist(v)},a.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,u=this.findTrackId(i)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(l){for(var i=this.tracksInGroup,u=0;u<i.length;u++){var c=i[u];if((!this.selectDefaultTrack||c.default)&&(!l||l===c.name))return c.id}return-1},a.loadPlaylist=function(l){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var u=i.id,c=i.groupId,S=i.url;if(l)try{S=l.addDirectives(S)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(K.Events.AUDIO_TRACK_LOADING,{url:S,id:u,groupId:c,deliveryDirectives:l||null})}},R(f,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),f}(N.default);V.default=p},"./src/controller/base-playlist-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return R});var K=I("./src/polyfills/number.ts"),L=I("./src/types/level.ts"),N=I("./src/controller/level-helper.ts"),W=I("./src/utils/logger.ts"),F=I("./src/errors.ts"),R=function(){function D(p,_){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,_+":"),this.warn=W.logger.warn.bind(W.logger,_+":"),this.hls=p}var b=D.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(_,f){f.fatal&&f.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(_,f){var a=f==null?void 0:f.renditionReports;if(a)for(var d=0;d<a.length;d++){var l=a[d],i=""+l.URI;if(i===_.substr(-i.length)){var u=parseInt(l["LAST-MSN"]),c=parseInt(l["LAST-PART"]);if(f&&this.hls.config.lowLatencyMode){var S=Math.min(f.age-f.partTarget,f.targetduration);c!==void 0&&S>f.partTarget&&(c+=1)}if(Object(K.isFiniteNumber)(u))return new L.HlsUrlParameters(u,Object(K.isFiniteNumber)(c)?c:void 0,L.HlsSkip.No)}}},b.loadPlaylist=function(_){},b.shouldLoadTrack=function(_){return this.canLoad&&_&&!!_.url&&(!_.details||_.details.live)},b.playlistLoaded=function(_,f,a){var d=this,l=f.details,i=f.stats,u=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(l.advancedDateTime=Date.now()-u,l.live||a!=null&&a.live){if(l.reloaded(a),a&&this.log("live playlist "+_+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),a&&l.fragments.length>0&&Object(N.mergeDetails)(a,l),!this.canLoad||!l.live)return;var c,S=void 0,C=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var T=this.hls.config.lowLatencyMode,w=l.lastPartSn,A=l.endSN,m=l.lastPartIndex,v=m!==-1,s=w===A,o=T?0:m;v?(S=s?A+1:w,C=s?o:m+1):S=A+1;var E=l.age,g=E+l.ageHeader,O=Math.min(g-l.partTarget,l.targetduration*1.5);if(O>0){if(a&&O>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+O+" with playlist age: "+l.age),O=0;else{var M=Math.floor(O/l.targetduration);if(S+=M,C!==void 0){var k=Math.round(O%l.targetduration/l.partTarget);C+=k}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+O+" skip sn "+M+" to part "+C)}l.tuneInGoal=O}if(c=this.getDeliveryDirectives(l,f.deliveryDirectives,S,C),T||!s){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(l,f.deliveryDirectives,S,C);var U=Object(N.computeReloadInterval)(l,i);S!==void 0&&l.canBlockReload&&(U-=l.partTarget||1),this.log("reload live playlist "+_+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(c)},U)}else this.clearTimer()},b.getDeliveryDirectives=function(_,f,a,d){var l=Object(L.getSkipValue)(_,a);return f!=null&&f.skip&&_.deltaUpdateFailed&&(a=f.msn,d=f.part,l=L.HlsSkip.No),new L.HlsUrlParameters(a,d,l)},b.retryLoadingOrFail=function(_){var f=this,a=this.hls.config,d=this.retryCount<a.levelLoadingMaxRetry;if(d){var l;if(this.retryCount++,_.details.indexOf("LoadTimeOut")>-1&&(l=_.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+_.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return f.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+_.details+'"')}}else this.warn('cannot recover from error "'+_.details+'"'),this.clearTimer(),_.fatal=!0;return d},D}()},"./src/controller/base-stream-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"State",function(){return A}),I.d(V,"default",function(){return m});var K=I("./src/polyfills/number.ts"),L=I("./src/task-loop.ts"),N=I("./src/controller/fragment-tracker.ts"),W=I("./src/utils/buffer-helper.ts"),F=I("./src/utils/logger.ts"),R=I("./src/events.ts"),D=I("./src/errors.ts"),b=I("./src/types/transmuxer.ts"),p=I("./src/utils/mp4-tools.ts"),_=I("./src/utils/discontinuities.ts"),f=I("./src/controller/fragment-finders.ts"),a=I("./src/controller/level-helper.ts"),d=I("./src/loader/fragment-loader.ts"),l=I("./src/crypt/decrypter.ts"),i=I("./src/utils/time-ranges.ts"),u=I("./src/types/loader.ts");function c(v,s){for(var o=0;o<s.length;o++){var E=s[o];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(v,E.key,E)}}function S(v,s,o){return s&&c(v.prototype,s),o&&c(v,o),v}function C(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function T(v,s){v.prototype=Object.create(s.prototype),v.prototype.constructor=v,w(v,s)}function w(v,s){return w=Object.setPrototypeOf||function(E,g){return E.__proto__=g,E},w(v,s)}var A={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},m=function(v){T(s,v);function s(E,g,O){var M;return M=v.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=A.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=O,M.log=F.logger.log.bind(F.logger,O+":"),M.warn=F.logger.warn.bind(F.logger,O+":"),M.hls=E,M.fragmentLoader=new d.default(E.config),M.fragmentTracker=g,M.config=E.config,M.decrypter=new l.default(E,E.config),E.on(R.Events.KEY_LOADED,M.onKeyLoaded,C(M)),M}var o=s.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(g){},o.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},o._streamEnded=function(g,O){var M=this.fragCurrent,k=this.fragmentTracker;if(!O.live&&M&&M.sn===O.endSN&&!g.nextStart){var U=k.getState(M);return U===N.FragmentState.PARTIAL||U===N.FragmentState.OK}return!1},o.onMediaAttached=function(g,O){var M=this.media=this.mediaBuffer=O.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var k=this.config;this.levels&&k.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(k.startPosition)},o.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var g=this.config,O=this.fragCurrent,M=this.media,k=this.mediaBuffer,U=this.state,B=M?M.currentTime:0,y=W.BufferHelper.bufferInfo(k||M,B,g.maxBufferHole);if(this.log("media seeking to "+(Object(K.isFiniteNumber)(B)?B.toFixed(3):B)+", state: "+U),U===A.ENDED)this.resetLoadingState();else if(O&&!y.len){var x=g.maxFragLookUpTolerance,j=O.start-x,z=O.start+O.duration+x,Y=B>z;(B<j||Y)&&(Y&&O.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),O.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=B),!this.loadedmetadata&&!y.len&&(this.nextLoadPosition=this.startPosition=B),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(g,O){if(this.state!==A.KEY_LOADING||O.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var M=this.levels[O.frag.level].details;M&&this.loadFragment(O.frag,M,O.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),v.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(R.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,v.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(g,O){this.log("Loading key for "+g.sn+" of ["+O.startSN+"-"+O.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=A.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(R.Events.KEY_LOADING,{frag:g})},o.loadFragment=function(g,O,M){this._loadFragForPlayback(g,O,M)},o._loadFragForPlayback=function(g,O,M){var k=this,U=function(y){if(k.fragContextChanged(g)){k.warn("Fragment "+g.sn+(y.part?" p: "+y.part.index:"")+" of level "+g.level+" was dropped during download."),k.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,k._handleFragmentLoadProgress(y)};this._doFragLoad(g,O,M,U).then(function(B){if(!B)return;k.fragLoadError=0;var y=k.state;if(k.fragContextChanged(g)){(y===A.FRAG_LOADING||y===A.BACKTRACKING||!k.fragCurrent&&y===A.PARSING)&&(k.fragmentTracker.removeFragment(g),k.state=A.IDLE);return}if("payload"in B&&(k.log("Loaded fragment "+g.sn+" of level "+g.level),k.hls.trigger(R.Events.FRAG_LOADED,B),k.state===A.BACKTRACKING)){k.fragmentTracker.backtrack(g,B),k.resetFragmentLoading(g);return}k._handleFragmentLoadComplete(B)}).catch(function(B){k.warn(B),k.resetFragmentLoading(g)})},o.flushMainBuffer=function(g,O,M){if(M===void 0&&(M=null),!(g-O))return;var k={startOffset:g,endOffset:O,type:M};this.fragLoadError=0,this.hls.trigger(R.Events.BUFFER_FLUSHING,k)},o._loadInitSegment=function(g){var O=this;this._doFragLoad(g).then(function(M){if(!M||O.fragContextChanged(g)||!O.levels)throw new Error("init load aborted");return M}).then(function(M){var k=O.hls,U=M.payload,B=g.decryptdata;if(U&&U.byteLength>0&&B&&B.key&&B.iv&&B.method==="AES-128"){var y=self.performance.now();return O.decrypter.webCryptoDecrypt(new Uint8Array(U),B.key.buffer,B.iv.buffer).then(function(x){var j=self.performance.now();return k.trigger(R.Events.FRAG_DECRYPTED,{frag:g,payload:x,stats:{tstart:y,tdecrypt:j}}),M.payload=x,M})}return M}).then(function(M){var k=O.fragCurrent,U=O.hls,B=O.levels;if(!B)throw new Error("init load aborted, missing levels");var y=B[g.level].details;console.assert(y,"Level details are defined when init segment is loaded");var x=g.stats;O.state=A.IDLE,O.fragLoadError=0,g.data=new Uint8Array(M.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),M.frag===k&&U.trigger(R.Events.FRAG_BUFFERED,{stats:x,frag:k,part:null,id:g.type}),O.tick()}).catch(function(M){O.warn(M),O.resetFragmentLoading(g)})},o.fragContextChanged=function(g){var O=this.fragCurrent;return!g||!O||g.level!==O.level||g.sn!==O.sn||g.urlId!==O.urlId},o.fragBufferedComplete=function(g,O){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(O?" part: "+O.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+i.default.toString(W.BufferHelper.getBuffered(M))),this.state=A.IDLE,this.tick()},o._handleFragmentLoadComplete=function(g){var O=this.transmuxer;if(!O)return;var M=g.frag,k=g.part,U=g.partsLoaded,B=!U||U.length===0||U.some(function(x){return!x}),y=new b.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,k?k.index:-1,!B);O.flush(y)},o._handleFragmentLoadProgress=function(g){},o._doFragLoad=function(g,O,M,k){var U=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(g.start,M||0),this.config.lowLatencyMode&&O){var B=O.partList;if(B&&k){M>g.end&&O.fragmentHint&&(g=O.fragmentHint);var y=this.getNextPart(B,g,M);if(y>-1){var x=B[y];return this.log("Loading part sn: "+g.sn+" p: "+x.index+" cc: "+g.cc+" of playlist ["+O.startSN+"-"+O.endSN+"] parts [0-"+y+"-"+(B.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=A.FRAG_LOADING,this.hls.trigger(R.Events.FRAG_LOADING,{frag:g,part:B[y],targetBufferTime:M}),this.doFragPartsLoad(g,B,y,k).catch(function(j){return U.handleFragLoadError(j)})}else if(!g.url||this.loadedEndOfParts(B,M))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(O?"of ["+O.startSN+"-"+O.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(M.toFixed(3))),Object(K.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=A.FRAG_LOADING,this.hls.trigger(R.Events.FRAG_LOADING,{frag:g,targetBufferTime:M}),this.fragmentLoader.load(g,k).catch(function(j){return U.handleFragLoadError(j)})},o.doFragPartsLoad=function(g,O,M,k){var U=this;return new Promise(function(B,y){var x=[],j=function z(Y){var $=O[Y];U.fragmentLoader.loadPart(g,$,k).then(function(ce){x[$.index]=ce;var se=ce.part;U.hls.trigger(R.Events.FRAG_LOADED,ce);var ne=O[Y+1];if(ne&&ne.fragment===g)z(Y+1);else return B({frag:g,part:se,partsLoaded:x})}).catch(y)};j(M)})},o.handleFragLoadError=function(g){var O=g.data;return O&&O.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(O.frag,O.part):this.hls.trigger(R.Events.ERROR,O),null},o._handleTransmuxerFlush=function(g){var O=this.getCurrentContext(g);if(!O||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var M=O.frag,k=O.part,U=O.level,B=self.performance.now();M.stats.parsing.end=B,k&&(k.stats.parsing.end=B),this.updateLevelTiming(M,k,U,g.partial)},o.getCurrentContext=function(g){var O=this.levels,M=g.level,k=g.sn,U=g.part;if(!O||!O[M])return this.warn("Levels object was unset while buffering fragment "+k+" of level "+M+". The current chunk will not be buffered."),null;var B=O[M],y=U>-1?Object(a.getPartWith)(B,k,U):null,x=y?y.fragment:Object(a.getFragmentWithSN)(B,k,this.fragCurrent);return x?{frag:x,part:y,level:B}:null},o.bufferFragmentData=function(g,O,M,k){if(!g||this.state!==A.PARSING)return;var U=g.data1,B=g.data2,y=U;if(U&&B&&(y=Object(p.appendUint8Array)(U,B)),!y||!y.length)return;var x={type:g.type,frag:O,part:M,chunkMeta:k,parent:O.type,data:y};this.hls.trigger(R.Events.BUFFER_APPENDING,x),g.dropped&&g.independent&&!M&&this.flushBufferGap(O)},o.flushBufferGap=function(g){var O=this.media;if(!O)return;if(!W.BufferHelper.isBuffered(O,O.currentTime)){this.flushMainBuffer(0,g.start);return}var M=O.currentTime,k=W.BufferHelper.bufferInfo(O,M,0),U=g.duration,B=Math.min(this.config.maxFragLookUpTolerance*2,U*.25),y=Math.max(Math.min(g.start-B,k.end-B),M+B);g.start-y>B&&this.flushMainBuffer(y,g.start)},o.getFwdBufferInfo=function(g,O){var M=this.config,k=this.getLoadPosition();if(!Object(K.isFiniteNumber)(k))return null;var U=W.BufferHelper.bufferInfo(g,k,M.maxBufferHole);if(U.len===0&&U.nextStart!==void 0){var B=this.fragmentTracker.getBufferedFrag(k,O);if(B&&U.nextStart<B.end)return W.BufferHelper.bufferInfo(g,k,Math.max(U.nextStart,M.maxBufferHole))}return U},o.getMaxBufferLength=function(g){var O=this.config,M;return g?M=Math.max(8*O.maxBufferSize/g,O.maxBufferLength):M=O.maxBufferLength,Math.min(M,O.maxMaxBufferLength)},o.reduceMaxBufferLength=function(g){var O=this.config,M=g||O.maxBufferLength;return O.maxMaxBufferLength>=M?(O.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+O.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(g,O){var M,k,U=O.fragments,B=U.length;if(!B)return null;var y=this.config,x=U[0].start,j;if(O.live){var z=y.initialLiveManifestSize;if(B<z)return this.warn("Not enough fragments to start playback (have: "+B+", need: "+z+")"),null;!O.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(j=this.getInitialLiveFragment(O,U),this.startPosition=j?this.hls.liveSyncPosition||j.start:g)}else g<=x&&(j=U[0]);if(!j){var Y=y.lowLatencyMode?O.partEnd:O.fragmentEnd;j=this.getFragmentAtPosition(g,Y,O)}return(M=j)!==null&&M!==void 0&&M.initSegment&&!((k=j)!==null&&k!==void 0&&k.initSegment.data)&&!this.bitrateTest&&(j=j.initSegment),j},o.getNextPart=function(g,O,M){for(var k=-1,U=!1,B=!0,y=0,x=g.length;y<x;y++){var j=g[y];if(B=B&&!j.independent,k>-1&&M<j.start)break;var z=j.loaded;!z&&(U||j.independent||B)&&j.fragment===O&&(k=y),U=z}return k},o.loadedEndOfParts=function(g,O){var M=g[g.length-1];return M&&O>M.start&&M.loaded},o.getInitialLiveFragment=function(g,O){var M=this.fragPrevious,k=null;if(M){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),k=Object(f.findFragmentByPDT)(O,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!k){var U=M.sn+1;if(U>=g.startSN&&U<=g.endSN){var B=O[U-g.startSN];M.cc===B.cc&&(k=B,this.log("Live playlist, switching playlist, load frag with next SN: "+k.sn))}k||(k=Object(f.findFragWithCC)(O,M.cc),k&&this.log("Live playlist, switching playlist, load frag with same CC: "+k.sn))}}else{var y=this.hls.liveSyncPosition;y!==null&&(k=this.getFragmentAtPosition(y,this.bitrateTest?g.fragmentEnd:g.edge,g))}return k},o.getFragmentAtPosition=function(g,O,M){var k=this.config,U=this.fragPrevious,B=M.fragments,y=M.endSN,x=M.fragmentHint,j=k.maxFragLookUpTolerance,z=!!(k.lowLatencyMode&&M.partList&&x);z&&x&&!this.bitrateTest&&(B=B.concat(x),y=x.sn);var Y;if(g<O){var $=g>O-j?0:j;Y=Object(f.findFragmentByPTS)(U,B,g,$)}else Y=B[B.length-1];if(Y){var ce=Y.sn-M.startSN,se=U&&Y.level===U.level,ne=B[ce+1],re=this.fragmentTracker.getState(Y);if(re===N.FragmentState.BACKTRACKED){Y=null;for(var ue=ce;B[ue]&&this.fragmentTracker.getState(B[ue])===N.FragmentState.BACKTRACKED;)U?Y=B[ue--]:Y=B[--ue];Y||(Y=ne)}else U&&Y.sn===U.sn&&!z&&(se&&(Y.sn<y&&this.fragmentTracker.getState(ne)!==N.FragmentState.OK?(this.log("SN "+Y.sn+" just loaded, load next one: "+ne.sn),Y=ne):Y=null))}return Y},o.synchronizeToLiveEdge=function(g){var O=this.config,M=this.media;if(!M)return;var k=this.hls.liveSyncPosition,U=M.currentTime,B=g.fragments[0].start,y=g.edge,x=U>=B-O.maxFragLookUpTolerance&&U<=y;if(k!==null&&M.duration>k&&(U<k||!x)){var j=O.liveMaxLatencyDuration!==void 0?O.liveMaxLatencyDuration:O.liveMaxLatencyDurationCount*g.targetduration;(!x&&M.readyState<4||U<y-j)&&(this.loadedmetadata||(this.nextLoadPosition=k),M.readyState&&(this.warn("Playback: "+U.toFixed(3)+" is located too far from the end of live sliding playlist: "+y+", reset currentTime to : "+k.toFixed(3)),M.currentTime=k))}},o.alignPlaylists=function(g,O){var M=this.levels,k=this.levelLastLoaded,U=this.fragPrevious,B=k!==null?M[k]:null,y=g.fragments.length;if(!y)return this.warn("No fragments in live playlist"),0;var x=g.fragments[0].start,j=!O,z=g.alignedSliding&&Object(K.isFiniteNumber)(x);if(j||!z&&!x){Object(_.alignStream)(U,B,g);var Y=g.fragments[0].start;return this.log("Live playlist sliding: "+Y.toFixed(2)+" start-sn: "+(O?O.startSN:"na")+"->"+g.startSN+" prev-sn: "+(U?U.sn:"na")+" fragments: "+y),Y}return x},o.waitForCdnTuneIn=function(g){var O=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*O)},o.setStartPosition=function(g,O){var M=this.startPosition;if(M<O&&(M=-1),M===-1||this.lastCurrentTime===-1){var k=g.startTimeOffset;Object(K.isFiniteNumber)(k)?(M=O+k,k<0&&(M+=g.totalduration),M=Math.min(Math.max(O,M),O+g.totalduration),this.log("Start time offset "+k+" found in playlist, adjust startPosition to "+M),this.startPosition=M):g.live?M=this.hls.liveSyncPosition||O:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},o.getLoadPosition=function(){var g=this.media,O=0;return this.loadedmetadata&&g?O=g.currentTime:this.nextLoadPosition&&(O=this.nextLoadPosition),O},o.handleFragLoadAborted=function(g,O){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(O?" part"+O.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},o.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=A.IDLE)},o.onFragmentOrKeyLoadError=function(g,O){if(O.fatal)return;var M=O.frag;if(!M||M.type!==g)return;var k=this.fragCurrent;console.assert(k&&M.sn===k.sn&&M.level===k.level&&M.urlId===k.urlId,"Frag load error must match current frag to retry");var U=this.config;if(this.fragLoadError+1<=U.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var B=Math.min(Math.pow(2,this.fragLoadError)*U.fragLoadingRetryDelay,U.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+g+" "+M.level+" failed to load, retrying in "+B+"ms"),this.retryDate=self.performance.now()+B,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else O.levelRetry?(g===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(F.logger.error(O.details+" reaches max retry, redispatch as fatal ..."),O.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},o.afterBufferFlushed=function(g,O,M){if(!g)return;var k=W.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(O,k,M),this.state===A.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},o.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var O=this.levels?this.levels[g].details:null;if(O!=null&&O.live)return this.startPosition=-1,this.setStartPosition(O,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(g,O,M,k){var U=this,B=M.details;console.assert(!!B,"level.details must be defined");var y=Object.keys(g.elementaryStreams).reduce(function(x,j){var z=g.elementaryStreams[j];if(z){var Y=z.endPTS-z.startPTS;if(Y<=0)return U.warn("Could not parse fragment "+g.sn+" "+j+" duration reliably ("+Y+") resetting transmuxer to fallback to playlist timing"),U.resetTransmuxer(),x||!1;var $=k?0:Object(a.updateFragPTSDTS)(B,g,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return U.hls.trigger(R.Events.LEVEL_PTS_UPDATED,{details:B,level:M,drift:$,type:j,frag:g,start:z.startPTS,end:z.endPTS}),!0}return x},!1);y?(this.state=A.PARSED,this.hls.trigger(R.Events.FRAG_PARSED,{frag:g,part:O})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(s,[{key:"state",get:function(){return this._state},set:function(g){var O=this._state;O!==g&&(this._state=g,this.log(O+"->"+g))}}]),s}(L.default)},"./src/controller/buffer-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return f});var K=I("./src/polyfills/number.ts"),L=I("./src/events.ts"),N=I("./src/utils/logger.ts"),W=I("./src/errors.ts"),F=I("./src/utils/buffer-helper.ts"),R=I("./src/utils/mediasource-helper.ts"),D=I("./src/loader/fragment.ts"),b=I("./src/controller/buffer-operation-queue.ts"),p=Object(R.getMediaSource)(),_=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function a(l){var i=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=i.hls,c=i.media,S=i.mediaSource;N.logger.log("[buffer-controller]: Media source opened"),c&&(i.updateMediaElementDuration(),u.trigger(L.Events.MEDIA_ATTACHED,{media:c})),S&&S.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){N.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){N.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var d=a.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 i=this.hls;i.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(L.Events.BUFFER_RESET,this.onBufferReset,this),i.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(L.Events.BUFFER_EOS,this.onBufferEos,this),i.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(L.Events.FRAG_PARSED,this.onFragParsed,this),i.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var i=this.hls;i.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(L.Events.BUFFER_RESET,this.onBufferReset,this),i.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(L.Events.BUFFER_EOS,this.onBufferEos,this),i.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(L.Events.FRAG_PARSED,this.onFragParsed,this),i.off(L.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(i,u){var c=2;(u.audio&&!u.video||!u.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,N.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(i,u){var c=this.media=u.media;if(c&&p){var S=this.mediaSource=new p;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(S),this._objectUrl=c.src}},d.onMediaDetaching=function(){var i=this.media,u=this.mediaSource,c=this._objectUrl;if(u){if(N.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(S){N.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(c&&self.URL.revokeObjectURL(c),i.src===c?(i.removeAttribute("src"),i.load()):N.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(L.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(u){var c=i.sourceBuffer[u];try{c&&(i.removeBufferListeners(u),i.mediaSource&&i.mediaSource.removeSourceBuffer(c),i.sourceBuffer[u]=void 0)}catch(S){N.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",S)}}),this._initSourceBuffer()},d.onBufferCodecs=function(i,u){var c=this,S=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(C){if(S){var T=c.tracks[C];if(T&&typeof T.buffer.changeType=="function"){var w=u[C],A=w.codec,m=w.levelCodec,v=w.container,s=(T.levelCodec||T.codec).replace(_,"$1"),o=(m||A).replace(_,"$1");if(s!==o){var E=v+";codecs="+(m||A);c.appendChangeType(C,E)}}}else c.pendingTracks[C]=u[C]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(i,u){var c=this,S=this.operationQueue,C={execute:function(){var w=c.sourceBuffer[i];w&&(N.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+u),w.changeType(u)),S.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(w){N.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",w)}};S.append(C,i)},d.onBufferAppending=function(i,u){var c=this,S=this.hls,C=this.operationQueue,T=this.tracks,w=u.data,A=u.type,m=u.frag,v=u.part,s=u.chunkMeta,o=s.buffering[A],E=self.performance.now();o.start=E;var g=m.stats.buffering,O=v?v.stats.buffering:null;g.start===0&&(g.start=E),O&&O.start===0&&(O.start=E);var M=T.audio,k=A==="audio"&&s.id===1&&(M==null?void 0:M.container)==="audio/mpeg",U={execute:function(){if(o.executeStart=self.performance.now(),k){var y=c.sourceBuffer[A];if(y){var x=m.start-y.timestampOffset;Math.abs(x)>=.1&&(N.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+x+") sn: "+m.sn+")"),y.timestampOffset=m.start)}}c.appendExecutor(w,A)},onStart:function(){},onComplete:function(){var y=self.performance.now();o.executeEnd=o.end=y,g.first===0&&(g.first=y),O&&O.first===0&&(O.first=y);var x=c.sourceBuffer,j={};for(var z in x)j[z]=F.BufferHelper.getBuffered(x[z]);c.appendError=0,c.hls.trigger(L.Events.BUFFER_APPENDED,{type:A,frag:m,part:v,chunkMeta:s,parent:m.type,timeRanges:j})},onError:function(y){N.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",y);var x={type:W.ErrorTypes.MEDIA_ERROR,parent:m.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:y,fatal:!1};y.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=W.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,x.details=W.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>S.config.appendErrorMaxRetry&&(N.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),S.trigger(L.Events.ERROR,x)}};C.append(U,A)},d.onBufferFlushing=function(i,u){var c=this,S=this.operationQueue,C=function(w){return{execute:c.removeExecutor.bind(c,w,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(L.Events.BUFFER_FLUSHED,{type:w})},onError:function(m){N.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",m)}}};u.type?S.append(C(u.type),u.type):this.getSourceBufferTypes().forEach(function(T){S.append(C(T),T)})},d.onFragParsed=function(i,u){var c=this,S=u.frag,C=u.part,T=[],w=C?C.elementaryStreams:S.elementaryStreams;w[D.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(w[D.ElementaryStreamTypes.AUDIO]&&T.push("audio"),w[D.ElementaryStreamTypes.VIDEO]&&T.push("video"));var A=function(){var v=self.performance.now();S.stats.buffering.end=v,C&&(C.stats.buffering.end=v);var s=C?C.stats:S.stats;c.hls.trigger(L.Events.FRAG_BUFFERED,{frag:S,part:C,stats:s,id:S.type})};T.length===0&&N.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(A,T)},d.onFragChanged=function(i,u){this.flushBackBuffer()},d.onBufferEos=function(i,u){var c=this,S=this.getSourceBufferTypes().reduce(function(C,T){var w=c.sourceBuffer[T];return(!u.type||u.type===T)&&(w&&!w.ended&&(w.ended=!0,N.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),C&&!!(!w||w.ended)},!0);S&&this.blockBuffers(function(){var C=c.mediaSource;if(!C||C.readyState!=="open")return;C.endOfStream()})},d.onLevelUpdated=function(i,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 i=this.hls,u=this.details,c=this.media,S=this.sourceBuffer;if(!c||u===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var T=u.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(K.isFiniteNumber)(T)||T<0)return;var w=c.currentTime,A=u.levelTargetDuration,m=Math.max(T,A),v=Math.floor(w/A)*A-m;C.forEach(function(s){var o=S[s];if(o){var E=F.BufferHelper.getBuffered(o);E.length>0&&v>E.start(0)&&(i.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),u.live&&i.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),i.trigger(L.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 i=this.details,u=this.hls,c=this.media,S=this.mediaSource,C=i.fragments[0].start+i.totalduration,T=c.duration,w=Object(K.isFiniteNumber)(S.duration)?S.duration:0;i.live&&u.config.liveDurationInfinity?(N.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(i)):(C>w&&C>T||!Object(K.isFiniteNumber)(T))&&(N.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),S.duration=C)},d.updateSeekableRange=function(i){var u=this.mediaSource,c=i.fragments,S=c.length;if(S&&i.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var C=Math.max(0,c[0].start),T=Math.max(C,C+i.totalduration);u.setLiveSeekableRange(C,T)}},d.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,u=this.operationQueue,c=this.pendingTracks,S=Object.keys(c).length;if(S&&!i||S===2){this.createSourceBuffers(c),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(L.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(T){u.executeNext(T)})}},d.createSourceBuffers=function(i){var u=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var C in i)if(!u[C]){var T=i[C];if(!T)throw Error("source buffer exists for track "+C+", however track does not");var w=T.levelCodec||T.codec,A=T.container+";codecs="+w;N.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var m=u[C]=c.addSourceBuffer(A),v=C;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[C]={buffer:m,codec:w,container:T.container,levelCodec:T.levelCodec,id:T.id},S++}catch(s){N.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(L.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:A})}}S&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(i){var u=this.operationQueue,c=u.current(i);c.onStart()},d._onSBUpdateEnd=function(i){var u=this.operationQueue,c=u.current(i);c.onComplete(),u.shiftAndExecuteNext(i)},d._onSBUpdateError=function(i,u){N.logger.error("[buffer-controller]: "+i+" SourceBuffer error",u),this.hls.trigger(L.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(i);c&&c.onError(u)},d.removeExecutor=function(i,u,c){var S=this.media,C=this.mediaSource,T=this.operationQueue,w=this.sourceBuffer,A=w[i];if(!S||!C||!A){N.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(i);return}var m=Object(K.isFiniteNumber)(S.duration)?S.duration:Infinity,v=Object(K.isFiniteNumber)(C.duration)?C.duration:Infinity,s=Math.max(0,u),o=Math.min(c,m,v);o>s?(N.logger.log("[buffer-controller]: Removing ["+s+","+o+"] from the "+i+" SourceBuffer"),console.assert(!A.updating,i+" sourceBuffer must not be updating"),A.remove(s,o)):T.shiftAndExecuteNext(i)},d.appendExecutor=function(i,u){var c=this.operationQueue,S=this.sourceBuffer,C=S[u];if(!C){N.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(u);return}C.ended=!1,console.assert(!C.updating,u+" sourceBuffer must not be updating"),C.appendBuffer(i)},d.blockBuffers=function(i,u){var c=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){N.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var S=this.operationQueue,C=u.map(function(T){return S.appendBlocker(T)});Promise.all(C).then(function(){i(),u.forEach(function(T){var w=c.sourceBuffer[T];(!w||!w.updating)&&S.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(i,u,c){var S=this.sourceBuffer[i];if(!S)return;var C=c.bind(this,i);this.listeners[i].push({event:u,listener:C}),S.addEventListener(u,C)},d.removeBufferListeners=function(i){var u=this.sourceBuffer[i];if(!u)return;this.listeners[i].forEach(function(c){u.removeEventListener(c.event,c.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return L});var K=I("./src/utils/logger.ts"),L=function(){function N(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var W=N.prototype;return W.append=function(R,D){var b=this.queues[D];b.push(R),b.length===1&&this.buffers[D]&&this.executeNext(D)},W.insertAbort=function(R,D){var b=this.queues[D];b.unshift(R),this.executeNext(D)},W.appendBlocker=function(R){var D,b=new Promise(function(_){D=_}),p={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,R),b},W.executeNext=function(R){var D=this.buffers,b=this.queues,p=D[R],_=b[R];if(_.length){var f=_[0];try{f.execute()}catch(a){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),f.onError(a),(!p||!p.updating)&&(_.shift(),this.executeNext(R))}}},W.shiftAndExecuteNext=function(R){this.queues[R].shift(),this.executeNext(R)},W.current=function(R){return this.queues[R][0]},N}()},"./src/controller/cap-level-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/events.ts");function L(F,R){for(var D=0;D<R.length;D++){var b=R[D];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(F,b.key,b)}}function N(F,R,D){return R&&L(F.prototype,R),D&&L(F,D),F}var W=function(){function F(D){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var R=F.prototype;return R.setStreamController=function(b){this.streamController=b},R.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},R.registerListeners=function(){var b=this.hls;b.on(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},R.unregisterListener=function(){var b=this.hls;b.off(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},R.onFpsDropLevelCapping=function(b,p){F.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},R.onMediaAttaching=function(b,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},R.onManifestParsed=function(b,p){var _=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,_.config.capLevelToPlayerSize&&p.video&&this.startCapping()},R.onBufferCodecs=function(b,p){var _=this.hls;_.config.capLevelToPlayerSize&&p.video&&this.startCapping()},R.onMediaDetaching=function(){this.stopCapping()},R.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&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}}},R.getMaxLevel=function(b){var p=this,_=this.hls.levels;if(!_.length)return-1;var f=_.filter(function(a,d){return F.isLevelAllowed(d,p.restrictedLevels)&&d<=b});return this.clientRect=null,F.getMaxLevelByMediaSize(f,this.mediaWidth,this.mediaHeight)},R.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},R.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},R.getDimensions=function(){if(this.clientRect)return this.clientRect;var 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},F.isLevelAllowed=function(b,p){return p===void 0&&(p=[]),p.indexOf(b)===-1},F.getMaxLevelByMediaSize=function(b,p,_){if(!b||!b.length)return-1;for(var f=function(u,c){return c?u.width!==c.width||u.height!==c.height:!0},a=b.length-1,d=0;d<b.length;d+=1){var l=b[d];if((l.width>=p||l.height>=_)&&f(l,b[d+1])){a=d;break}}return a},N(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(p){}return b}}]),F}();V.default=W},"./src/controller/cmcd-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return f});var K=I("./src/events.ts"),L=I("./src/types/cmcd.ts"),N=I("./src/utils/buffer-helper.ts"),W=I("./src/utils/logger.ts");function F(a,d){for(var l=0;l<d.length;l++){var i=d[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function R(a,d,l){return d&&F(a.prototype,d),l&&F(a,l),a}function D(a,d){var l=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(l)return(l=l.call(a)).next.bind(l);if(Array.isArray(a)||(l=b(a))||d&&a&&typeof a.length=="number"){l&&(a=l);var i=0;return function(){return i>=a.length?{done:!0}:{done:!1,value:a[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(a,d){if(!a)return;if(typeof a=="string")return p(a,d);var l=Object.prototype.toString.call(a).slice(8,-1);if(l==="Object"&&a.constructor&&(l=a.constructor.name),l==="Map"||l==="Set")return Array.from(a);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return p(a,d)}function p(a,d){(d==null||d>a.length)&&(d=a.length);for(var l=0,i=new Array(d);l<d;l++)i[l]=a[l];return i}function _(){return _=Object.assign||function(a){for(var d=1;d<arguments.length;d++){var l=arguments[d];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(a[i]=l[i])}return a},_.apply(this,arguments)}var f=function(){function a(l){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(S){try{i.apply(S,{ot:L.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(C){W.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(S){try{var C=S.frag,T=i.hls.levels[C.level],w=i.getObjectType(C),A={d:C.duration*1e3,ot:w};(w===L.CMCDObjectType.VIDEO||w===L.CMCDObjectType.AUDIO||w==L.CMCDObjectType.MUXED)&&(A.br=T.bitrate/1e3,A.tb=i.getTopBandwidth(w),A.bl=i.getBufferLength(w)),i.apply(S,A)}catch(m){W.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=l;var u=this.config=l.config,c=u.cmcd;c!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=c.sessionId||a.uuid(),this.cid=c.contentId,this.useHeaders=c.useHeaders===!0,this.registerListeners())}var d=a.prototype;return d.registerListeners=function(){var i=this.hls;i.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var i=this.hls;i.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(i,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(i,u){var c,S;this.audioBuffer=(c=u.tracks.audio)===null||c===void 0?void 0:c.buffer,this.videoBuffer=(S=u.tracks.video)===null||S===void 0?void 0:S.buffer},d.createData=function(){var i;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(i,u){u===void 0&&(u={}),_(u,this.createData());var c=u.ot===L.CMCDObjectType.INIT||u.ot===L.CMCDObjectType.VIDEO||u.ot===L.CMCDObjectType.MUXED;if(this.starved&&c&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var S=a.toHeaders(u);if(!Object.keys(S).length)return;i.headers||(i.headers={}),_(i.headers,S)}else{var C=a.toQuery(u);if(!C)return;i.url=a.appendQueryToUri(i.url,C)}},d.getObjectType=function(i){var u=i.type;return u==="subtitle"?L.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?L.CMCDObjectType.INIT:u==="audio"?L.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(i){for(var u=0,c=i===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=D(c),C;!(C=S()).done;){var T=C.value;T.bitrate>u&&(u=T.bitrate)}return u>0?u:NaN},d.getBufferLength=function(i){var u=this.hls.media,c=i===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!u)return NaN;var S=N.BufferHelper.bufferInfo(c,u.currentTime,this.config.maxBufferHole);return S.len*1e3},d.createPlaylistLoader=function(){var i=this.config.pLoader,u=this.applyPlaylistData,c=i||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new c(T)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(w,A,m){u(w),this.loader.load(w,A,m)},R(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},d.createFragmentLoader=function(){var i=this.config.fLoader,u=this.applyFragmentData,c=i||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new c(T)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(w,A,m){u(w),this.loader.load(w,A,m)},R(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},a.uuid=function(){var i=URL.createObjectURL(new Blob),u=i.toString();return URL.revokeObjectURL(i),u.substr(u.lastIndexOf("/")+1)},a.serialize=function(i){for(var u=[],c=function(k){return!Number.isNaN(k)&&k!=null&&k!==""&&k!==!1},S=function(k){return Math.round(k)},C=function(k){return S(k/100)*100},T=function(k){return encodeURIComponent(k)},w={br:S,d:S,bl:C,dl:C,mtp:C,nor:T,rtp:C,tb:S},A=Object.keys(i||{}).sort(),m=D(A),v;!(v=m()).done;){var s=v.value,o=i[s];if(!c(o))continue;if(s==="v"&&o===1)continue;if(s=="pr"&&o===1)continue;var E=w[s];E&&(o=E(o));var g=typeof o,O=void 0;s==="ot"||s==="sf"||s==="st"?O=s+"="+o:g==="boolean"?O=s:g==="number"?O=s+"="+o:O=s+"="+JSON.stringify(o),u.push(O)}return u.join(",")},a.toHeaders=function(i){for(var u=Object.keys(i),c={},S=["Object","Request","Session","Status"],C=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},w=0,A=u;w<A.length;w++){var m=A[w],v=T[m]!=null?T[m]:1;C[v][m]=i[m]}for(var s=0;s<C.length;s++){var o=a.serialize(C[s]);o&&(c["CMCD-"+S[s]]=o)}return c},a.toQuery=function(i){return"CMCD="+encodeURIComponent(a.serialize(i))},a.appendQueryToUri=function(i,u){if(!u)return i;var c=i.includes("?")?"&":"?";return""+i+c+u},a}()},"./src/controller/eme-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/events.ts"),L=I("./src/errors.ts"),N=I("./src/utils/logger.ts"),W=I("./src/utils/mediakeys-helper.ts");function F(f,a){for(var d=0;d<a.length;d++){var l=a[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}function R(f,a,d){return a&&F(f.prototype,a),d&&F(f,d),f}var D=3,b=function(a,d,l){var i={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(u){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:l.audioRobustness||""})}),d.forEach(function(u){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:l.videoRobustness||""})}),[i]},p=function(a,d,l,i){switch(a){case W.KeySystems.WIDEVINE:return b(d,l,i);default:throw new Error("Unknown key-system: "+a)}},_=function(){function f(d){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var a=f.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(l){switch(l){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},a._attemptKeySystemAccess=function(l,i,u){var c=this,S=p(l,i,u,this._drmSystemOptions);N.logger.log("Requesting encrypted media key-system access");var C=this.requestMediaKeySystemAccess(l,S);this.mediaKeysPromise=C.then(function(T){return c._onMediaKeySystemAccessObtained(l,T)}),C.catch(function(T){N.logger.error('Failed to obtain key-system "'+l+'" access:',T)})},a._onMediaKeySystemAccessObtained=function(l,i){var u=this;N.logger.log('Access for key-system "'+l+'" obtained');var c={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:l};this._mediaKeysList.push(c);var S=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(C){return c.mediaKeys=C,N.logger.log('Media-keys created for key-system "'+l+'"'),u._onMediaKeysCreated(),C});return S.catch(function(C){N.logger.error("Failed to create media-keys:",C)}),S},a._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),l._onNewMediaKeySession(i.mediaKeysSession))})},a._onNewMediaKeySession=function(l){var i=this;N.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(u){i._onKeySessionMessage(l,u.message)},!1)},a._onKeySessionMessage=function(l,i){N.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(u){N.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),l.update(u)})},a.onMediaEncrypted=function(l){var i=this;if(N.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){N.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(S){if(!i._media)return;i._attemptSetMediaKeys(S),i._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(u).catch(u)},a._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){N.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}N.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(l,i){var u=this,c=this._mediaKeysList[0];if(!c){N.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(c.mediaKeysSessionInitialized){N.logger.warn("Key-Session already initialized but requested again");return}var S=c.mediaKeysSession;if(!S){N.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){N.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}N.logger.log('Generating key-session request for "'+l+'" init data type'),c.mediaKeysSessionInitialized=!0,S.generateRequest(l,i).then(function(){N.logger.debug("Key-session generation succeeded")}).catch(function(C){N.logger.error("Error generating key-session request:",C),u.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(l,i,u){var c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,c,l,i,u);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,c,l),S=void 0}catch(C){N.logger.error(C)}try{c.readyState||c.open("POST",l,!0),S&&S.call(this.hls,c,l)}catch(C){throw new Error("issue setting up KeySystem license XHR "+C)}return c},a._onLicenseRequestReadyStageChange=function(l,i,u,c){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,N.logger.log("License request succeeded");var S=l.response,C=this._licenseResponseCallback;if(C)try{S=C.call(this.hls,l,i)}catch(w){N.logger.error(w)}c(S)}else{if(N.logger.error("License Request XHR failed ("+i+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=D-this._requestLicenseFailureCount+1;N.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(u,c)}break}},a._generateLicenseRequestChallenge=function(l,i){switch(l.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},a._requestLicense=function(l,i){N.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){N.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(u.mediaKeySystemDomain),S=this._createLicenseXhr(c,l,i);N.logger.log("Sending license request to URL: "+c);var C=this._generateLicenseRequestChallenge(u,l);S.send(C)}catch(T){N.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(l,i){if(!this._emeEnabled)return;var u=i.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var l=this._media,i=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(l,i){if(!this._emeEnabled)return;var u=i.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),c=i.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,u,c)},R(f,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),f}();V.default=_},"./src/controller/fps-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/events.ts"),L=I("./src/utils/logger.ts"),N=function(){function W(R){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=R,this.registerListeners()}var F=W.prototype;return F.setStreamController=function(D){this.streamController=D},F.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(D,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)}},F.checkFPS=function(D,b,p){var _=performance.now();if(b){if(this.lastTime){var f=_-this.lastTime,a=p-this.lastDroppedFrames,d=b-this.lastDecodedFrames,l=1e3*a/f,i=this.hls;if(i.trigger(K.Events.FPS_DROP,{currentDropped:a,currentDecoded:d,totalDroppedFrames:p}),l>0&&a>i.config.fpsDroppedMonitoringThreshold*d){var u=i.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=u)&&(u=u-1,i.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:i.currentLevel}),i.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=p,this.lastDecodedFrames=b}},F.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var b=D.getVideoPlaybackQuality();this.checkFPS(D,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},W}();V.default=N},"./src/controller/fragment-finders.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"findFragmentByPDT",function(){return N}),I.d(V,"findFragmentByPTS",function(){return W}),I.d(V,"fragmentWithinToleranceTest",function(){return F}),I.d(V,"pdtWithinToleranceTest",function(){return R}),I.d(V,"findFragWithCC",function(){return D});var K=I("./src/polyfills/number.ts"),L=I("./src/utils/binary-search.ts");function N(b,p,_){if(p===null||!Array.isArray(b)||!b.length||!Object(K.isFiniteNumber)(p))return null;var f=b[0].programDateTime;if(p<(f||0))return null;var a=b[b.length-1].endProgramDateTime;if(p>=(a||0))return null;_=_||0;for(var d=0;d<b.length;++d){var l=b[d];if(R(p,_,l))return l}return null}function W(b,p,_,f){_===void 0&&(_=0),f===void 0&&(f=0);var a=null;if(b?a=p[b.sn-p[0].sn+1]||null:_===0&&p[0].start===0&&(a=p[0]),a&&F(_,f,a)===0)return a;var d=L.default.search(p,F.bind(null,_,f));return d||a}function F(b,p,_){b===void 0&&(b=0),p===void 0&&(p=0);var f=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0));return _.start+_.duration-f<=b?1:_.start-f>b&&_.start?-1:0}function R(b,p,_){var f=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0))*1e3,a=_.endProgramDateTime||0;return a-f>b}function D(b,p){return L.default.search(b,function(_){return _.cc<p?1:_.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"FragmentState",function(){return N}),I.d(V,"FragmentTracker",function(){return W});var K=I("./src/events.ts"),L=I("./src/types/loader.ts"),N;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(N||(N={}));var W=function(){function D(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=D.prototype;return b._registerListeners=function(){var _=this.hls;_.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var _=this.hls;_.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(_,f){if(f===L.PlaylistLevelType.MAIN){var a=this.activeFragment,d=this.activeParts;if(!a)return null;if(d)for(var l=d.length;l--;){var i=d[l],u=i?i.end:a.appendedPTS;if(i.start<=_&&u!==void 0&&_<=u)return l>9&&(this.activeParts=d.slice(l-9)),i}else if(a.start<=_&&a.appendedPTS!==void 0&&_<=a.appendedPTS)return a}return this.getBufferedFrag(_,f)},b.getBufferedFrag=function(_,f){for(var a=this.fragments,d=Object.keys(a),l=d.length;l--;){var i=a[d[l]];if((i==null?void 0:i.body.type)===f&&i.buffered){var u=i.body;if(u.start<=_&&_<=u.end)return u}}return null},b.detectEvictedFragments=function(_,f,a){var d=this;Object.keys(this.fragments).forEach(function(l){var i=d.fragments[l];if(!i)return;if(!i.buffered){i.body.type===a&&d.removeFragment(i.body);return}var u=i.range[_];if(!u)return;u.time.some(function(c){var S=!d.isTimeBuffered(c.startPTS,c.endPTS,f);return S&&d.removeFragment(i.body),S})})},b.detectPartialFragments=function(_){var f=this,a=this.timeRanges,d=_.frag,l=_.part;if(!a||d.sn==="initSegment")return;var i=R(d),u=this.fragments[i];if(!u)return;Object.keys(a).forEach(function(c){var S=d.elementaryStreams[c];if(!S)return;var C=a[c],T=l!==null||S.partial===!0;u.range[c]=f.getBufferedTimes(d,l,T,C)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},b.fragBuffered=function(_){var f=R(_),a=this.fragments[f];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},b.getBufferedTimes=function(_,f,a,d){for(var l={time:[],partial:a},i=f?f.start:_.start,u=f?f.end:_.end,c=_.minEndPTS||u,S=_.maxStartPTS||i,C=0;C<d.length;C++){var T=d.start(C)-this.bufferPadding,w=d.end(C)+this.bufferPadding;if(S>=T&&c<=w){l.time.push({startPTS:Math.max(i,d.start(C)),endPTS:Math.min(u,d.end(C))});break}else if(i<w&&u>T)l.partial=!0,l.time.push({startPTS:Math.max(i,d.start(C)),endPTS:Math.min(u,d.end(C))});else if(u<=T)break}return l},b.getPartialFragment=function(_){var f=null,a,d,l,i=0,u=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(S){var C=c[S];if(!C)return;F(C)&&(d=C.body.start-u,l=C.body.end+u,_>=d&&_<=l&&(a=Math.min(_-d,l-_),i<=a&&(f=C.body,i=a)))}),f},b.getState=function(_){var f=R(_),a=this.fragments[f];return a?a.buffered?F(a)?N.PARTIAL:N.OK:a.backtrack?N.BACKTRACKED:N.APPENDING:N.NOT_LOADED},b.backtrack=function(_,f){var a=R(_),d=this.fragments[a];if(!d||d.backtrack)return null;var l=d.backtrack=f||d.loaded;return d.loaded=null,l},b.getBacktrackData=function(_){var f=R(_),a=this.fragments[f];if(a){var d,l=a.backtrack;if(l!=null&&(d=l.payload)!==null&&d!==void 0&&d.byteLength)return l;this.removeFragment(_)}return null},b.isTimeBuffered=function(_,f,a){for(var d,l,i=0;i<a.length;i++){if(d=a.start(i)-this.bufferPadding,l=a.end(i)+this.bufferPadding,_>=d&&f<=l)return!0;if(f<=d)return!1}return!1},b.onFragLoaded=function(_,f){var a=f.frag,d=f.part;if(a.sn==="initSegment"||a.bitrateTest||d)return;var l=R(a);this.fragments[l]={body:a,loaded:f,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(_,f){var a=this,d=f.frag,l=f.part,i=f.timeRanges;if(d.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=d,l){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(l)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(c){var S=i[c];if(a.detectEvictedFragments(c,S),!l)for(var C=0;C<S.length;C++)d.appendedPTS=Math.max(S.end(C),d.appendedPTS||0)})},b.onFragBuffered=function(_,f){this.detectPartialFragments(f)},b.hasFragment=function(_){var f=R(_);return!!this.fragments[f]},b.removeFragmentsInRange=function(_,f,a){var d=this;Object.keys(this.fragments).forEach(function(l){var i=d.fragments[l];if(!i)return;if(i.buffered){var u=i.body;u.type===a&&u.start<f&&u.end>_&&d.removeFragment(u)}})},b.removeFragment=function(_){var f=R(_);_.stats.loaded=0,_.clearElementaryStreamInfo(),delete this.fragments[f]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function F(D){var b,p;return D.buffered&&(((b=D.range.video)===null||b===void 0?void 0:b.partial)||((p=D.range.audio)===null||p===void 0?void 0:p.partial))}function R(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"STALL_MINIMUM_DURATION_MS",function(){return F}),I.d(V,"MAX_START_GAP_JUMP",function(){return R}),I.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),I.d(V,"SKIP_BUFFER_RANGE_START",function(){return b}),I.d(V,"default",function(){return p});var K=I("./src/utils/buffer-helper.ts"),L=I("./src/errors.ts"),N=I("./src/events.ts"),W=I("./src/utils/logger.ts"),F=250,R=2,D=.1,b=.05,p=function(){function _(a,d,l,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=a,this.media=d,this.fragmentTracker=l,this.hls=i}var f=_.prototype;return f.destroy=function(){this.hls=this.fragmentTracker=this.media=null},f.poll=function(d){var l=this.config,i=this.media,u=this.stalled,c=i.currentTime,S=i.seeking,C=this.seeking&&!S,T=!this.seeking&&S;if(this.seeking=S,c!==d){if(this.moved=!0,u!==null){if(this.stallReported){var w=self.performance.now()-u;W.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||C)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!K.BufferHelper.getBuffered(i).length)return;var A=K.BufferHelper.bufferInfo(i,c,0),m=A.len>0,v=A.nextStart||0;if(!m&&!v)return;if(S){var s=A.len>R,o=!v||v-c>R&&!this.fragmentTracker.getPartialFragment(c);if(s||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,g=Math.max(v,A.start||0)-c,O=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=O==null||((E=O.details)===null||E===void 0)?void 0:E.live,k=M?O.details.targetduration*2:R;if(g>0&&g<=k){this._trySkipBufferHole(null);return}}var U=self.performance.now();if(u===null){this.stalled=U;return}var B=U-u;!S&&B>=F&&this._reportStall(A.len);var y=K.BufferHelper.bufferInfo(i,c,l.maxBufferHole);this._tryFixBufferStall(y,B)},f._tryFixBufferStall=function(d,l){var i=this.config,u=this.fragmentTracker,c=this.media,S=c.currentTime,C=u.getPartialFragment(S);if(C){var T=this._trySkipBufferHole(C);if(T)return}d.len>i.maxBufferHole&&l>i.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},f._reportStall=function(d){var l=this.hls,i=this.media,u=this.stallReported;u||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+d+")"),l.trigger(N.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},f._trySkipBufferHole=function(d){for(var l=this.config,i=this.hls,u=this.media,c=u.currentTime,S=0,C=K.BufferHelper.getBuffered(u),T=0;T<C.length;T++){var w=C.start(T);if(c+l.maxBufferHole>=S&&c<w){var A=Math.max(w+b,u.currentTime+D);return W.logger.warn("skipping hole, adjusting currentTime from "+c+" to "+A),this.moved=!0,this.stalled=null,u.currentTime=A,d&&i.trigger(N.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+c+" to "+A,frag:d}),A}S=C.end(T)}return 0},f._tryNudgeBuffer=function(){var d=this.config,l=this.hls,i=this.media,u=i.currentTime,c=(this.nudgeRetry||0)+1;if(this.nudgeRetry=c,c<d.nudgeMaxRetry){var S=u+c*d.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+u+" to "+S),i.currentTime=S,l.trigger(N.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+d.nudgeMaxRetry+" nudges"),l.trigger(N.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},_}()},"./src/controller/id3-track-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/events.ts"),L=I("./src/utils/texttrack-utils.ts"),N=I("./src/demux/id3.ts"),W=.25,F=function(){function R(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var D=R.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var p=this.hls;p.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var p=this.hls;p.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(p,_){this.media=_.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(p){if(!this.media)return;for(var _=0;_<p.length;_++){var f=p[_];if(f.kind==="metadata"&&f.label==="id3")return Object(L.sendAddTrackEvent)(f,this.media),f}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(p,_){if(!this.media)return;var f=_.frag,a=_.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<a.length;l++){var i=N.getID3Frames(a[l].data);if(i){var u=a[l].pts,c=l<a.length-1?a[l+1].pts:f.end,S=c-u;S<=0&&(c=u+W);for(var C=0;C<i.length;C++){var T=i[C];if(!N.isTimeStampFrame(T)){var w=new d(u,c,"");w.value=T,this.id3Track.addCue(w)}}}}},D.onBufferFlushing=function(p,_){var f=_.startOffset,a=_.endOffset,d=_.type;if(!d||d==="audio"){var l=this.id3Track;l&&Object(L.removeCuesInRange)(l,f,a)}},R}();V.default=F},"./src/controller/latency-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return R});var K=I("./src/errors.ts"),L=I("./src/events.ts"),N=I("./src/utils/logger.ts");function W(D,b){for(var p=0;p<b.length;p++){var _=b[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(D,_.key,_)}}function F(D,b,p){return b&&W(D.prototype,b),p&&W(D,p),D}var R=function(){function D(p){var _=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return _.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var b=D.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},b.onMediaAttached=function(_,f){this.media=f.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(_,f){var a=f.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(_,f){if(f.details!==K.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,N.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var _=this.media,f=this.levelDetails;if(!_||!f)return;this.currentTime=_.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var d=this.config,l=d.lowLatencyMode,i=d.maxLiveSyncPlaybackRate;if(!l||i===1)return;var u=this.targetLatency;if(u===null)return;var c=a-u,S=Math.min(this.maxLatency,u+f.targetduration),C=c<S;if(f.live&&C&&c>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,i)),w=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;_.playbackRate=Math.min(T,Math.max(1,w))}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},F(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var _=this.config,f=this.levelDetails;return _.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:f?_.liveMaxLatencyDurationCount*f.targetduration:0}},{key:"targetLatency",get:function(){var _=this.levelDetails;if(_===null)return null;var f=_.holdBack,a=_.partHoldBack,d=_.targetduration,l=this.config,i=l.liveSyncDuration,u=l.liveSyncDurationCount,c=l.lowLatencyMode,S=this.hls.userConfig,C=c&&a||f;(S.liveSyncDuration||S.liveSyncDurationCount||C===0)&&(C=i!==void 0?i:u*d);var T=d,w=1;return C+Math.min(this.stallCount*w,T)}},{key:"liveSyncPosition",get:function(){var _=this.estimateLiveEdge(),f=this.targetLatency,a=this.levelDetails;if(_===null||f===null||a===null)return null;var d=a.edge,l=_-f-this.edgeStalled,i=d-a.totalduration,u=d-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(i,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 f=(this.config.lowLatencyMode&&_.partTarget||_.targetduration)*3;return Math.max(_.age-f,0)}},{key:"forwardBufferLength",get:function(){var _=this.media,f=this.levelDetails;if(!_||!f)return 0;var a=_.buffered.length;return a?_.buffered.end(a-1):f.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return l});var K=I("./src/types/level.ts"),L=I("./src/events.ts"),N=I("./src/errors.ts"),W=I("./src/utils/codecs.ts"),F=I("./src/controller/level-helper.ts"),R=I("./src/controller/base-playlist-controller.ts"),D=I("./src/types/loader.ts");function b(){return b=Object.assign||function(i){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var S in c)Object.prototype.hasOwnProperty.call(c,S)&&(i[S]=c[S])}return i},b.apply(this,arguments)}function p(i,u){for(var c=0;c<u.length;c++){var S=u[c];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function _(i,u,c){return u&&p(i.prototype,u),c&&p(i,c),i}function f(i,u){i.prototype=Object.create(u.prototype),i.prototype.constructor=i,a(i,u)}function a(i,u){return a=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},a(i,u)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(i){f(u,i);function u(S){var C;return C=i.call(this,S,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var c=u.prototype;return c._registerListeners=function(){var C=this.hls;C.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(L.Events.ERROR,this.onError,this)},c._unregisterListeners=function(){var C=this.hls;C.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(L.Events.ERROR,this.onError,this)},c.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},c.startLoad=function(){var C=this._levels;C.forEach(function(T){T.loadError=0}),i.prototype.startLoad.call(this)},c.onManifestLoaded=function(C,T){var w=[],A=[],m=[],v,s={},o,E=!1,g=!1,O=!1;if(T.levels.forEach(function(B){var y=B.attrs;E=E||!!(B.width&&B.height),g=g||!!B.videoCodec,O=O||!!B.audioCodec,d&&B.audioCodec&&B.audioCodec.indexOf("mp4a.40.34")!==-1&&(B.audioCodec=void 0);var x=B.bitrate+"-"+B.attrs.RESOLUTION+"-"+B.attrs.CODECS;o=s[x],o?o.url.push(B.url):(o=new K.Level(B),s[x]=o,w.push(o)),y&&(y.AUDIO&&Object(F.addGroupId)(o,"audio",y.AUDIO),y.SUBTITLES&&Object(F.addGroupId)(o,"text",y.SUBTITLES))}),(E||g)&&O&&(w=w.filter(function(B){var y=B.videoCodec,x=B.width,j=B.height;return!!y||!!(x&&j)})),w=w.filter(function(B){var y=B.audioCodec,x=B.videoCodec;return(!y||Object(W.isCodecSupportedInMp4)(y,"audio"))&&(!x||Object(W.isCodecSupportedInMp4)(x,"video"))}),T.audioTracks&&(A=T.audioTracks.filter(function(B){return!B.audioCodec||Object(W.isCodecSupportedInMp4)(B.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(A)),T.subtitles&&(m=T.subtitles,Object(F.assignTrackIdsByGroup)(m)),w.length>0){v=w[0].bitrate,w.sort(function(B,y){return B.bitrate-y.bitrate}),this._levels=w;for(var M=0;M<w.length;M++)if(w[M].bitrate===v){this._firstLevel=M,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+v);break}var k=O&&!g,U={levels:w,audioTracks:A,subtitleTracks:m,firstLevel:this._firstLevel,stats:T.stats,audio:O,video:g,altAudio:!k&&A.some(function(B){return!!B.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,U),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},c.onError=function(C,T){if(i.prototype.onError.call(this,C,T),T.fatal)return;var w=T.context,A=this._levels[this.currentLevelIndex];if(w&&(w.type===D.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&w.groupId===A.audioGroupIds[A.urlId]||w.type===D.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&w.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,v=!0,s;switch(T.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:case N.ErrorDetails.KEY_LOAD_ERROR:case N.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var o=this._levels[T.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=T.frag.level)):s=T.frag.level}break;case N.ErrorDetails.LEVEL_LOAD_ERROR:case N.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(v=!1),s=w.level),m=!0;break;case N.ErrorDetails.REMUX_ALLOC_ERROR:s=T.level,m=!0;break}s!==void 0&&this.recoverLevel(T,s,m,v)},c.recoverLevel=function(C,T,w,A){var m=C.details,v=this._levels[T];if(v.loadError++,w){var s=this.retryLoadingOrFail(C);if(s)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var o=v.url.length;if(o>1&&v.loadError<o)C.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var E=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(m+": switch to "+E),C.levelRetry=!0,this.hls.nextAutoLevel=E)}}},c.redundantFailover=function(C){var T=this._levels[C],w=T.url.length;if(w>1){var A=(T.urlId+1)%w;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(m){m.urlId=A}),this.level=C}},c.onFragLoaded=function(C,T){var w=T.frag;if(w!==void 0&&w.type===D.PlaylistLevelType.MAIN){var A=this._levels[w.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},c.onLevelLoaded=function(C,T){var w,A=T.level,m=T.details,v=this._levels[A];if(!v){var s;this.warn("Invalid level index "+A),(s=T.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(m.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(A,T,v.details)):(w=T.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(m.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(C,T){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var A=-1,m=this.hls.audioTracks[T.id].groupId,v=0;v<w.audioGroupIds.length;v++)if(w.audioGroupIds[v]===m){A=v;break}A!==w.urlId&&(w.urlId=A,this.startLoad())}},c.loadPlaylist=function(C){var T=this.currentLevelIndex,w=this._levels[T];if(this.canLoad&&w&&w.url.length>0){var A=w.urlId,m=w.url[A];if(C)try{m=C.addDirectives(m)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+T+(C?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+A+" "+m),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:m,level:T,id:A,deliveryDirectives:C||null})}},c.removeLevel=function(C,T){var w=function(v,s){return s!==T},A=this._levels.filter(function(m,v){return v!==C?!0:m.url.length>1&&T!==void 0?(m.url=m.url.filter(w),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(w)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(w)),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=A,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:A})},_(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(C){var T,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===C&&(T=w[C])!==null&&T!==void 0&&T.details)return;if(C<0||C>=w.length){var A=C<0;if(this.hls.trigger(L.Events.ERROR,{type:N.ErrorTypes.OTHER_ERROR,details:N.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:A,reason:"invalid level idx"}),A)return;C=Math.min(C,w.length-1)}this.clearTimer();var m=this.currentLevelIndex,v=w[m],s=w[C];this.log("switching to level "+C+" from "+m),this.currentLevelIndex=C;var o=b({},s,{level:C,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete o._urlId,this.hls.trigger(L.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(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),u}(R.default)},"./src/controller/level-helper.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"addGroupId",function(){return N}),I.d(V,"assignTrackIdsByGroup",function(){return W}),I.d(V,"updatePTS",function(){return F}),I.d(V,"updateFragPTSDTS",function(){return D}),I.d(V,"mergeDetails",function(){return b}),I.d(V,"mapPartIntersection",function(){return p}),I.d(V,"mapFragmentIntersection",function(){return _}),I.d(V,"adjustSliding",function(){return f}),I.d(V,"addSliding",function(){return a}),I.d(V,"computeReloadInterval",function(){return d}),I.d(V,"getFragmentWithSN",function(){return l}),I.d(V,"getPartWith",function(){return i});var K=I("./src/polyfills/number.ts"),L=I("./src/utils/logger.ts");function N(u,c,S){switch(c){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(S);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(S);break}}function W(u){var c={};u.forEach(function(S){var C=S.groupId||"";S.id=c[C]=c[C]||0,c[C]++})}function F(u,c,S){var C=u[c],T=u[S];R(C,T)}function R(u,c){var S=c.startPTS;if(Object(K.isFiniteNumber)(S)){var C=0,T;c.sn>u.sn?(C=S-u.start,T=u):(C=u.start-S,T=c),T.duration!==C&&(T.duration=C)}else if(c.sn>u.sn){var w=u.cc===c.cc;w&&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 D(u,c,S,C,T,w){var A=C-S;A<=0&&(L.logger.warn("Fragment should have a positive duration",c),C=S+c.duration,w=T+c.duration);var m=S,v=C,s=c.startPTS,o=c.endPTS;if(Object(K.isFiniteNumber)(s)){var E=Math.abs(s-S);Object(K.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(E,c.deltaPTS):c.deltaPTS=E,m=Math.max(S,s),S=Math.min(S,s),T=Math.min(T,c.startDTS),v=Math.min(C,o),C=Math.max(C,o),w=Math.max(w,c.endDTS)}c.duration=C-S;var g=S-c.start;c.appendedPTS=C,c.start=c.startPTS=S,c.maxStartPTS=m,c.startDTS=T,c.endPTS=C,c.minEndPTS=v,c.endDTS=w;var O=c.sn;if(!u||O<u.startSN||O>u.endSN)return 0;var M,k=O-u.startSN,U=u.fragments;for(U[k]=c,M=k;M>0;M--)R(U[M],U[M-1]);for(M=k;M<U.length-1;M++)R(U[M],U[M+1]);return u.fragmentHint&&R(U[U.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,g}function b(u,c){for(var S=null,C=u.fragments,T=C.length-1;T>=0;T--){var w=C[T].initSegment;if(w){S=w;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var A=0,m;if(_(u,c,function(M,k){M.relurl&&(A=M.cc-k.cc),Object(K.isFiniteNumber)(M.startPTS)&&Object(K.isFiniteNumber)(M.endPTS)&&(k.start=k.startPTS=M.startPTS,k.startDTS=M.startDTS,k.appendedPTS=M.appendedPTS,k.maxStartPTS=M.maxStartPTS,k.endPTS=M.endPTS,k.endDTS=M.endDTS,k.minEndPTS=M.minEndPTS,k.duration=M.endPTS-M.startPTS,k.duration&&(m=k),c.PTSKnown=c.alignedSliding=!0),k.elementaryStreams=M.elementaryStreams,k.loader=M.loader,k.stats=M.stats,k.urlId=M.urlId,M.initSegment&&(k.initSegment=M.initSegment,S=M.initSegment)}),S){var v=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;v.forEach(function(M){var k;(!M.initSegment||M.initSegment.relurl===((k=S)===null||k===void 0?void 0:k.relurl))&&(M.initSegment=S)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(M){return!M}),c.deltaUpdateFailed)){L.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(A){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<o.length;E++)o[E].cc+=A}c.skippedSegments&&(c.startCC=c.fragments[0].cc),p(u.partList,c.partList,function(M,k){k.elementaryStreams=M.elementaryStreams,k.stats=M.stats}),m?D(c,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):f(u,c),o.length&&(c.totalduration=c.edge-o[0].start),c.driftStartTime=u.driftStartTime,c.driftStart=u.driftStart;var g=c.advancedDateTime;if(c.advanced&&g){var O=c.edge;c.driftStart||(c.driftStartTime=g,c.driftStart=O),c.driftEndTime=g,c.driftEnd=O}else c.driftEndTime=u.driftEndTime,c.driftEnd=u.driftEnd,c.advancedDateTime=u.advancedDateTime}function p(u,c,S){if(u&&c)for(var C=0,T=0,w=u.length;T<=w;T++){var A=u[T],m=c[T+C];A&&m&&A.index===m.index&&A.fragment.sn===m.fragment.sn?S(A,m):C--}}function _(u,c,S){for(var C=c.skippedSegments,T=Math.max(u.startSN,c.startSN)-c.startSN,w=(u.fragmentHint?1:0)+(C?c.endSN:Math.min(u.endSN,c.endSN))-c.startSN,A=c.startSN-u.startSN,m=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,v=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,s=T;s<=w;s++){var o=v[A+s],E=m[s];C&&!E&&s<C&&(E=c.fragments[s]=o),o&&E&&S(o,E)}}function f(u,c){var S=c.startSN+c.skippedSegments-u.startSN,C=u.fragments;if(S<0||S>=C.length)return;a(c,C[S].start)}function a(u,c){if(c){for(var S=u.fragments,C=u.skippedSegments;C<S.length;C++)S[C].start+=c;u.fragmentHint&&(u.fragmentHint.start+=c)}}function d(u,c){var S=1e3*u.levelTargetDuration,C=S/2,T=u.age,w=T>0&&T<S*3,A=c.loading.end-c.loading.start,m,v=u.availabilityDelay;if(u.updated===!1)if(w){var s=333*u.misses;m=Math.max(Math.min(C,A*2),s),u.availabilityDelay=(u.availabilityDelay||0)+m}else m=C;else w?(v=Math.min(v||S/2,T),u.availabilityDelay=v,m=v+S-T):m=S-A;return Math.round(m)}function l(u,c,S){if(!u||!u.details)return null;var C=u.details,T=C.fragments[c-C.startSN];return T||(T=C.fragmentHint,T&&T.sn===c?T:c<C.startSN&&S&&S.sn===c?S:null)}function i(u,c,S){if(!u||!u.details)return null;var C=u.details.partList;if(C)for(var T=C.length;T--;){var w=C[T];if(w.index===S&&w.fragment.sn===c)return w}return null}},"./src/controller/stream-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return C});var K=I("./src/polyfills/number.ts"),L=I("./src/controller/base-stream-controller.ts"),N=I("./src/is-supported.ts"),W=I("./src/events.ts"),F=I("./src/utils/buffer-helper.ts"),R=I("./src/controller/fragment-tracker.ts"),D=I("./src/types/loader.ts"),b=I("./src/loader/fragment.ts"),p=I("./src/demux/transmuxer-interface.ts"),_=I("./src/types/transmuxer.ts"),f=I("./src/controller/gap-controller.ts"),a=I("./src/errors.ts"),d=I("./src/utils/logger.ts");function l(T,w){for(var A=0;A<w.length;A++){var m=w[A];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function i(T,w,A){return w&&l(T.prototype,w),A&&l(T,A),T}function u(T,w){T.prototype=Object.create(w.prototype),T.prototype.constructor=T,c(T,w)}function c(T,w){return c=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},c(T,w)}var S=100,C=function(T){u(w,T);function w(m,v){var s;return s=T.call(this,m,v,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var A=w.prototype;return A._registerListeners=function(){var v=this.hls;v.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.on(W.Events.ERROR,this.onError,this),v.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var v=this.hls;v.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.off(W.Events.ERROR,this.onError,this),v.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(v){if(this.levels){var s=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=o.startLevel;E===-1&&(o.config.testBandwidth?(E=0,this.bitrateTest=!0):E=o.nextAutoLevel),this.level=o.nextLoadLevel=E,this.loadedmetadata=!1}s>0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),v=s),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.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=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var g,O=self.performance.now(),M=this.retryDate;(!M||O>=M||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var v,s,o=this.hls,E=this.levelLastLoaded,g=this.levels,O=this.media,M=o.config,k=o.nextLoadLevel;if(E===null||!O&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[k])return;var U=g[k];this.level=o.nextLoadLevel=k;var B=U.details;if(!B||this.state===L.State.WAITING_LEVEL||B.live&&this.levelLastLoaded!==k){this.state=L.State.WAITING_LEVEL;return}var y=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:O,D.PlaylistLevelType.MAIN);if(y===null)return;var x=y.len,j=this.getMaxBufferLength(U.maxBitrate);if(x>=j)return;if(this._streamEnded(y,B)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,z),this.state=L.State.ENDED;return}var Y=y.end,$=this.getNextFragment(Y,B);if(this.couldBacktrack&&!this.fragPrevious&&$&&$.sn!=="initSegment"){var ce=$.sn-B.startSN;ce>1&&($=B.fragments[ce-1],this.fragmentTracker.removeFragment($))}if($&&this.fragmentTracker.getState($)===R.FragmentState.OK&&this.nextLoadPosition>Y){var se=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(O,se,D.PlaylistLevelType.MAIN),$=this.getNextFragment(this.nextLoadPosition,B)}if(!$)return;$.initSegment&&!$.initSegment.data&&!this.bitrateTest&&($=$.initSegment),((v=$.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((s=$.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey($,B):this.loadFragment($,B,Y)},A.loadFragment=function(v,s,o){var E,g=this.fragmentTracker.getState(v);if(this.fragCurrent=v,g===R.FragmentState.BACKTRACKED){var O=this.fragmentTracker.getBacktrackData(v);if(O){this._handleFragmentLoadProgress(O),this._handleFragmentLoadComplete(O);return}else g=R.FragmentState.NOT_LOADED}g===R.FragmentState.NOT_LOADED||g===R.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===R.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()},A.getAppendedFrag=function(v){var s=this.fragmentTracker.getAppendedFrag(v,D.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},A.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,D.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.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,O=v[g],M=this.fragLastKbps;M&&this.fragCurrent?o=this.fragCurrent.duration*O.maxBitrate/(1e3*M)+1:o=0}else o=0;var k=this.getBufferedFrag(s.currentTime+o);if(k){var U=this.followingBufferedFrag(k);if(U){this.abortCurrentFrag();var B=U.maxStartPTS?U.maxStartPTS:U.start,y=U.duration,x=Math.max(k.end,B+Math.min(Math.max(y-this.config.maxFragLookUpTolerance,y*.5),y*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(v,s){T.prototype.flushMainBuffer.call(this,v,s,this.altAudio?"video":null)},A.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 f.default(this.config,o,this.fragmentTracker,this.hls)},A.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)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var v=this.media,s=v?v.currentTime:null;Object(K.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(v,s){var o=!1,E=!1,g;s.levels.forEach(function(O){g=O.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(o=!0),g.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=o&&E&&!Object(N.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},A.onLevelLoading=function(v,s){var o=this.levels;if(!o||this.state!==L.State.IDLE)return;var E=o[s.level];(!E.details||E.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(E.details))&&(this.state=L.State.WAITING_LEVEL)},A.onLevelLoaded=function(v,s){var o,E=this.levels,g=s.level,O=s.details,M=O.totalduration;if(!E){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+O.startSN+","+O.endSN+"], cc ["+O.startCC+", "+O.endCC+"] duration:"+M);var k=this.fragCurrent;k&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(k.level!==s.level&&k.loader&&(this.state=L.State.IDLE,k.loader.abort()));var U=E[g],B=0;if(O.live||(o=U.details)!==null&&o!==void 0&&o.live){if(O.fragments[0]||(O.deltaUpdateFailed=!0),O.deltaUpdateFailed)return;B=this.alignPlaylists(O,U.details)}if(U.details=O,this.levelLastLoaded=g,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:O,level:g}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(O))return;this.state=L.State.IDLE}this.startFragRequested?O.live&&this.synchronizeToLiveEdge(O):this.setStartPosition(O,B),this.tick()},A._handleFragmentLoadProgress=function(v){var s,o=v.frag,E=v.part,g=v.payload,O=this.levels;if(!O){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var M=O[o.level],k=M.details;if(!k){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var U=M.videoCodec,B=k.PTSKnown||!k.live,y=(s=o.initSegment)===null||s===void 0?void 0:s.data,x=this._getAudioCodec(M),j=this.transmuxer=this.transmuxer||new p.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=E?E.index:-1,Y=z!==-1,$=new _.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,g.byteLength,z,Y),ce=this.initPTS[o.cc];j.push(g,y,x,U,o,E,k.totalduration,B,$,ce)},A.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 O=this.fragCurrent;O!=null&&O.loader&&(this.log("Switching to main audio track, cancel main fragment load"),O.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;o&&M.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:g})}},A.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()},A.onBufferCreated=function(v,s){var o=s.tracks,E,g,O=!1;for(var M in o){var k=o[M];if(k.id==="main"){if(g=M,E=k,M==="video"){var U=o[M];U&&(this.videoBuffer=U.buffer)}}else O=!0}O&&E?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(v,s){var o=s.frag,E=s.part;if(o&&o.type!==D.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===L.State.PARSED&&(this.state=L.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)},A.onError=function(v,s){switch(s.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,s);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=L.State.ERROR):!s.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var o=!0,E=this.getFwdBufferInfo(this.media,D.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}},A.checkBuffer=function(){var v=this.media,s=this.gapController;if(!v||!s||!v.readyState)return;var o=F.BufferHelper.getBuffered(v);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.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,D.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(v,s){this.levels=s.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var v=this.media,s=v.currentTime,o=this.startPosition;if(o>=0&&s<o){if(v.seeking){d.logger.log("could not seek to "+o+", already seeking at "+s);return}var E=F.BufferHelper.getBuffered(v),g=E.length?E.start(0):0,O=g-o;O>0&&(O<this.config.maxBufferHole||O<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+O+" to match buffer start"),o+=O,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+s),v.currentTime=o}},A._getAudioCodec=function(v){var s=this.config.defaultAudioCodec||v.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},A._loadBitrateTestFrag=function(v){var s=this;this._doFragLoad(v).then(function(o){var E=s.hls;if(!o||E.nextLoadLevel||s.fragContextChanged(v))return;s.fragLoadError=0,s.state=L.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var g=v.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),E.trigger(W.Events.FRAG_LOADED,o)})},A._handleTransmuxComplete=function(v){var s,o="main",E=this.hls,g=v.remuxResult,O=v.chunkMeta,M=this.getCurrentContext(O);if(!M){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var k=M.frag,U=M.part,B=M.level,y=g.video,x=g.text,j=g.id3,z=g.initSegment,Y=this.altAudio?void 0:g.audio;if(this.fragContextChanged(k))return;if(this.state=L.State.PARSING,z){z.tracks&&(this._bufferInitSegment(B,z.tracks,k,O),E.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:k,id:o,tracks:z.tracks}));var $=z.initPTS,ce=z.timescale;Object(K.isFiniteNumber)($)&&(this.initPTS[k.cc]=$,E.trigger(W.Events.INIT_PTS_FOUND,{frag:k,id:o,initPTS:$,timescale:ce}))}if(y&&g.independent!==!1){if(B.details){var se=y.startPTS,ne=y.endPTS,re=y.startDTS,ue=y.endDTS;if(U)U.elementaryStreams[y.type]={startPTS:se,endPTS:ne,startDTS:re,endDTS:ue};else if(y.firstKeyFrame&&y.independent&&(this.couldBacktrack=!0),y.dropped&&y.independent){var ee=this.getLoadPosition()+this.config.maxBufferHole;if(ee<se){this.backtrack(k);return}k.setElementaryStreamInfo(y.type,k.start,ne,k.start,ue,!0)}k.setElementaryStreamInfo(y.type,se,ne,re,ue),this.bufferFragmentData(y,k,U,O)}}else if(g.independent===!1){this.backtrack(k);return}if(Y){var ae=Y.startPTS,ge=Y.endPTS,Le=Y.startDTS,ke=Y.endDTS;U&&(U.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ge,startDTS:Le,endDTS:ke}),k.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ae,ge,Le,ke),this.bufferFragmentData(Y,k,U,O)}if(j!=null&&(s=j.samples)!==null&&s!==void 0&&s.length){var De={frag:k,id:o,samples:j.samples};E.trigger(W.Events.FRAG_PARSING_METADATA,De)}if(x){var Ue={frag:k,id:o,samples:x.samples};E.trigger(W.Events.FRAG_PARSING_USERDATA,Ue)}},A._bufferInitSegment=function(v,s,o,E){var g=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var O=s.audio,M=s.video,k=s.audiovideo;if(O){var U=v.audioCodec,B=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(U&&(U.indexOf("mp4a.40.5")!==-1?U="mp4a.40.2":U="mp4a.40.5"),O.metadata.channelCount!==1&&B.indexOf("firefox")===-1&&(U="mp4a.40.5")),B.indexOf("android")!==-1&&O.container!=="audio/mpeg"&&(U="mp4a.40.2",this.log("Android: force audio codec to "+U)),v.audioCodec&&v.audioCodec!==U&&this.log('Swapping manifest audio codec "'+v.audioCodec+'" for "'+U+'"'),O.levelCodec=U,O.id="main",this.log("Init audio buffer, container:"+O.container+", codecs[selected/level/parsed]=["+(U||"")+"/"+(v.audioCodec||"")+"/"+O.codec+"]")}M&&(M.levelCodec=v.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(v.videoCodec||"")+"/"+M.codec+"]")),k&&this.log("Init audiovideo buffer, container:"+k.container+", codecs[level/parsed]=["+(v.attrs.CODECS||"")+"/"+k.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(y){var x=s[y],j=x.initSegment;j!=null&&j.byteLength&&g.hls.trigger(W.Events.BUFFER_APPENDING,{type:y,data:j,frag:o,part:null,chunkMeta:E,parent:o.type})}),this.tick()},A.backtrack=function(v){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(v);var s=this.fragmentTracker.backtrack(v);this.fragPrevious=null,this.nextLoadPosition=v.start,s?this.resetFragmentLoading(v):this.state=L.State.BACKTRACKING},A.checkFragmentChanged=function(){var v=this.media,s=null;if(v&&v.readyState>1&&v.seeking===!1){var o=v.currentTime;if(F.BufferHelper.isBuffered(v,o)?s=this.getAppendedFrag(o):F.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(W.Events.FRAG_CHANGED,{frag:s}),(!E||E.level!==g)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=s)}}},i(w,[{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}}]),w}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"SubtitleStreamController",function(){return u});var K=I("./src/events.ts"),L=I("./src/utils/logger.ts"),N=I("./src/utils/buffer-helper.ts"),W=I("./src/controller/fragment-finders.ts"),F=I("./src/utils/discontinuities.ts"),R=I("./src/controller/level-helper.ts"),D=I("./src/controller/fragment-tracker.ts"),b=I("./src/controller/base-stream-controller.ts"),p=I("./src/types/loader.ts"),_=I("./src/types/level.ts");function f(c,S){for(var C=0;C<S.length;C++){var T=S[C];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(c,T.key,T)}}function a(c,S,C){return S&&f(c.prototype,S),C&&f(c,C),c}function d(c,S){c.prototype=Object.create(S.prototype),c.prototype.constructor=c,l(c,S)}function l(c,S){return l=Object.setPrototypeOf||function(T,w){return T.__proto__=w,T},l(c,S)}var i=500,u=function(c){d(S,c);function S(T,w){var A;return A=c.call(this,T,w,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var C=S.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var w=this.hls;w.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(K.Events.ERROR,this.onError,this),w.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var w=this.hls;w.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(K.Events.ERROR,this.onError,this),w.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(i),this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(w,A){this.mainDetails=A.details},C.onSubtitleFragProcessed=function(w,A){var m=A.frag,v=A.success;if(this.fragPrevious=m,this.state=b.State.IDLE,!v)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var o,E=m.start,g=0;g<s.length;g++)if(E>=s[g].start&&E<=s[g].end){o=s[g];break}var O=m.start+m.duration;o?o.end=O:(o={start:E,end:O},s.push(o)),this.fragmentTracker.fragBuffered(m)},C.onBufferFlushing=function(w,A){var m=A.startOffset,v=A.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,O=v-g;if(O<=0)return;A.endOffsetSubtitles=Math.max(0,O),this.tracksBuffered.forEach(function(M){for(var k=0;k<M.length;){if(M[k].end<=O){M.shift();continue}else if(M[k].start<O)M[k].start=O;else break;k++}}),this.fragmentTracker.removeFragmentsInRange(m,O,p.PlaylistLevelType.SUBTITLE)}},C.onError=function(w,A){var m,v=A.frag;if(!v||v.type!==p.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},C.onSubtitleTracksUpdated=function(w,A){var m=this,v=A.subtitleTracks;this.tracksBuffered=[],this.levels=v.map(function(s){return new _.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){m.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},C.onSubtitleTrackSwitch=function(w,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(i)},C.onSubtitleTrackLoaded=function(w,A){var m,v=A.details,s=A.id,o=this.currentTrackId,E=this.levels;if(!E.length)return;var g=E[o];if(s>=E.length||s!==o||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(m=g.details)!==null&&m!==void 0&&m.live){var O=this.mainDetails;if(v.deltaUpdateFailed||!O)return;var M=O.fragments[0];if(!g.details)v.hasProgramDateTime&&O.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(v,O):M&&Object(R.addSliding)(v,M.start);else{var k=this.alignPlaylists(v,g.details);k===0&&M&&Object(R.addSliding)(v,M.start)}}if(g.details=v,this.levelLastLoaded=s,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var U=Object(W.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);U||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},C._handleFragmentLoadComplete=function(w){var A=w.frag,m=w.payload,v=A.decryptdata,s=this.hls;if(this.fragContextChanged(A))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(K.Events.FRAG_DECRYPTED,{frag:A,payload:E,stats:{tstart:o,tdecrypt:g}})})}},C.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var w,A=this.currentTrackId,m=this.levels;if(!m.length||!m[A]||!m[A].details)return;var v=m[A].details,s=v.targetduration,o=this.config,E=this.media,g=N.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-s,o.maxBufferHole),O=g.end,M=g.len,k=this.getMaxBufferLength()+s;if(M>k)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var U=v.fragments,B=U.length,y=v.edge,x,j=this.fragPrevious;if(O<y){var z=o.maxFragLookUpTolerance;j&&v.hasProgramDateTime&&(x=Object(W.findFragmentByPDT)(U,j.endProgramDateTime,z)),x||(x=Object(W.findFragmentByPTS)(j,U,O,z),!x&&j&&j.start<U[0].start&&(x=U[0]))}else x=U[B-1];(w=x)!==null&&w!==void 0&&w.encrypted?(L.logger.log("Loading key for "+x.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(K.Events.KEY_LOADING,{frag:x})):x&&this.fragmentTracker.getState(x)===D.FragmentState.NOT_LOADED&&this.loadFragment(x,v,O)}},C.loadFragment=function(w,A,m){this.fragCurrent=w,c.prototype.loadFragment.call(this,w,A,m)},a(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(b.default)},"./src/controller/subtitle-track-controller.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/events.ts"),L=I("./src/utils/texttrack-utils.ts"),N=I("./src/controller/base-playlist-controller.ts"),W=I("./src/types/loader.ts");function F(f,a){for(var d=0;d<a.length;d++){var l=a[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}function R(f,a,d){return a&&F(f.prototype,a),d&&F(f,d),f}function D(f,a){f.prototype=Object.create(a.prototype),f.prototype.constructor=f,b(f,a)}function b(f,a){return b=Object.setPrototypeOf||function(l,i){return l.__proto__=i,l},b(f,a)}var p=function(f){D(a,f);function a(l){var i;return i=f.call(this,l,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var d=a.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,f.prototype.destroy.call(this)},d.registerListeners=function(){var i=this.hls;i.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(K.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var i=this.hls;i.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(K.Events.ERROR,this.onError,this)},d.onMediaAttached=function(i,u){if(this.media=u.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},d.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},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 i=_(this.media.textTracks);i.forEach(function(u){Object(L.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(i,u){this.tracks=u.subtitleTracks},d.onSubtitleTrackLoaded=function(i,u){var c=u.id,S=u.details,C=this.trackId,T=this.tracksInGroup[C];if(!T){this.warn("Invalid subtitle track id "+c);return}var w=T.details;T.details=u.details,this.log("subtitle track "+c+" loaded ["+S.startSN+"-"+S.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,u,w))},d.onLevelLoading=function(i,u){this.switchLevel(u.level)},d.onLevelSwitching=function(i,u){this.switchLevel(u.level)},d.switchLevel=function(i){var u=this.hls.levels[i];if(!(u!=null&&u.textGroupIds))return;var c=u.textGroupIds[u.urlId];if(this.groupId!==c){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,C=this.tracks.filter(function(A){return!c||A.groupId===c});this.tracksInGroup=C;var T=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=c;var w={subtitleTracks:C};this.log("Updating subtitle tracks, "+C.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,w),T!==-1&&this.setSubtitleTrack(T,S)}},d.findTrackId=function(i){for(var u=this.tracksInGroup,c=0;c<u.length;c++){var S=u[c];if((!this.selectDefaultTrack||S.default)&&(!i||i===S.name))return S.id}return-1},d.onError=function(i,u){if(f.prototype.onError.call(this,i,u),u.fatal||!u.context)return;u.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},d.loadPlaylist=function(i){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var c=u.id,S=u.groupId,C=u.url;if(i)try{C=i.addDirectives(C)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+c),this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADING,{url:C,id:c,groupId:S,deliveryDirectives:i||null})}},d.toggleTrackModes=function(i){var u=this,c=this.media,S=this.subtitleDisplay,C=this.trackId;if(!c)return;var T=_(c.textTracks),w=T.filter(function(v){return v.groupId===u.groupId});if(i===-1)[].slice.call(T).forEach(function(v){v.mode="disabled"});else{var A=w[C];A&&(A.mode="disabled")}var m=w[i];m&&(m.mode=S?"showing":"hidden")},d.setSubtitleTrack=function(i,u){var c,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(c=S[i])!==null&&c!==void 0&&c.details)||i<-1||i>=S.length)return;this.clearTimer();var C=S[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,C){var T=C.id,w=C.groupId,A=w===void 0?"":w,m=C.name,v=C.type,s=C.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:A,name:m,type:v,url:s});var o=this.switchParams(C.url,u==null?void 0:u.details);this.loadPlaylist(o)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:i})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,u=_(this.media.textTracks),c=0;c<u.length;c++)if(u[c].mode==="hidden")i=c;else if(u[c].mode==="showing"){i=c;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},R(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,u)}}]),a}(N.default);function _(f){for(var a=[],d=0;d<f.length;d++){var l=f[d];l.kind==="subtitles"&&l.label&&a.push(f[d])}return a}V.default=p},"./src/controller/timeline-controller.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"TimelineController",function(){return _});var K=I("./src/polyfills/number.ts"),L=I("./src/events.ts"),N=I("./src/utils/cea-608-parser.ts"),W=I("./src/utils/output-filter.ts"),F=I("./src/utils/webvtt-parser.ts"),R=I("./src/utils/texttrack-utils.ts"),D=I("./src/utils/imsc1-ttml-parser.ts"),b=I("./src/types/loader.ts"),p=I("./src/utils/logger.ts"),_=function(){function l(u){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var c=new W.default(this,"textTrack1"),S=new W.default(this,"textTrack2"),C=new W.default(this,"textTrack3"),T=new W.default(this,"textTrack4");this.cea608Parser1=new N.default(1,c,S),this.cea608Parser2=new N.default(3,C,T)}u.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(L.Events.FRAG_LOADING,this.onFragLoading,this),u.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=l.prototype;return i.destroy=function(){var c=this.hls;c.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.off(L.Events.FRAG_LOADING,this.onFragLoading,this),c.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(c,S,C,T,w){for(var A=!1,m=w.length;m--;){var v=w[m],s=a(v[0],v[1],S,C);if(s>=0&&(v[0]=Math.min(v[0],S),v[1]=Math.max(v[1],C),A=!0,s/(C-S)>.5))return}if(A||w.push([S,C]),this.config.renderTextTracksNatively){var o=this.captionsTracks[c];this.Cues.newCue(o,S,C,T)}else{var E=this.Cues.newCue(null,S,C,T);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:E,track:c})}},i.onInitPtsFound=function(c,S){var C=this,T=S.frag,w=S.id,A=S.initPTS,m=S.timescale,v=this.unparsedVttFrags;w==="main"&&(this.initPTS[T.cc]=A,this.timescale[T.cc]=m),v.length&&(this.unparsedVttFrags=[],v.forEach(function(s){C.onFragLoaded(L.Events.FRAG_LOADED,s)}))},i.getExistingTrack=function(c){var S=this.media;if(S)for(var C=0;C<S.textTracks.length;C++){var T=S.textTracks[C];if(T[c])return T}return null},i.createCaptionsTrack=function(c){this.config.renderTextTracksNatively?this.createNativeTrack(c):this.createNonNativeTrack(c)},i.createNativeTrack=function(c){if(this.captionsTracks[c])return;var S=this.captionsProperties,C=this.captionsTracks,T=this.media,w=S[c],A=w.label,m=w.languageCode,v=this.getExistingTrack(c);if(v)C[c]=v,Object(R.clearCurrentCues)(C[c]),Object(R.sendAddTrackEvent)(C[c],T);else{var s=this.createTextTrack("captions",A,m);s&&(s[c]=!0,C[c]=s)}},i.createNonNativeTrack=function(c){if(this.nonNativeCaptionsTracks[c])return;var S=this.captionsProperties[c];if(!S)return;var C=S.label,T={_id:c,label:C,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[c]=T,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},i.createTextTrack=function(c,S,C){var T=this.media;return T?T.addTextTrack(c,S,C):void 0},i.onMediaAttaching=function(c,S){this.media=S.media,this._cleanTracks()},i.onMediaDetaching=function(){var c=this.captionsTracks;Object.keys(c).forEach(function(S){Object(R.clearCurrentCues)(c[S]),delete c[S]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},i._cleanTracks=function(){var c=this.media;if(!c)return;var S=c.textTracks;if(S)for(var C=0;C<S.length;C++)Object(R.clearCurrentCues)(S[C])},i.onSubtitleTracksUpdated=function(c,S){var C=this;this.textTracks=[];var T=S.subtitleTracks||[],w=T.some(function(s){return s.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var A=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,o){var E;if(o<m.length){for(var g=null,O=0;O<m.length;O++)if(f(m[O],s)){g=m[O];break}g&&(E=g)}E?Object(R.clearCurrentCues)(E):(E=C.createTextTrack("subtitles",s.name,s.lang),E&&(E.mode="disabled")),E&&(E.groupId=s.groupId,C.textTracks.push(E))})}else if(!A&&this.tracks&&this.tracks.length){var v=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:v})}}},i.onManifestLoaded=function(c,S){var C=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(T){var w=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!w)return;var A="textTrack"+w[1],m=C.captionsProperties[A];if(!m)return;m.label=T.name,T.lang&&(m.languageCode=T.lang),m.media=T})},i.onFragLoading=function(c,S){var C=this.cea608Parser1,T=this.cea608Parser2,w=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(C&&T))return;if(S.frag.type===b.PlaylistLevelType.MAIN){var m,v,s=S.frag.sn,o=(m=S==null||((v=S.part)===null||v===void 0)?void 0:v.index)!=null?m:-1;s===w+1||s===w&&o===A+1||(C.reset(),T.reset()),this.lastSn=s,this.lastPartIndex=o}},i.onFragLoaded=function(c,S){var C=S.frag,T=S.payload,w=this.initPTS,A=this.unparsedVttFrags;if(C.type===b.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(K.isFiniteNumber)(w[C.cc])){A.push(S),w.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Missing initial subtitle PTS")});return}var m=C.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var v=this.tracks[C.level],s=this.vttCCs;s[C.cc]||(s[C.cc]={start:C.start,prevCC:this.prevCC,new:!0},this.prevCC=C.cc),v&&v.textCodec===D.IMSC1_CODEC?this._parseIMSC1(C,T):this._parseVTTs(C,T,s)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(c,S){var C=this,T=this.hls;Object(D.parseIMSC1)(S,this.initPTS[c.cc],this.timescale[c.cc],function(w){C._appendCues(w,c.level),T.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(w){p.logger.log("Failed to parse IMSC1: "+w),T.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:w})})},i._parseVTTs=function(c,S,C){var T=this,w=this.hls;Object(F.parseWebVTT)(S,this.initPTS[c.cc],this.timescale[c.cc],C,c.cc,c.start,function(A){T._appendCues(A,c.level),w.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(A){T._fallbackToIMSC1(c,S),p.logger.log("Failed to parse VTT cue: "+A),w.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:A})})},i._fallbackToIMSC1=function(c,S){var C=this,T=this.tracks[c.level];T.textCodec||Object(D.parseIMSC1)(S,this.initPTS[c.cc],this.timescale[c.cc],function(){T.textCodec=D.IMSC1_CODEC,C._parseIMSC1(c,S)},function(){T.textCodec="wvtt"})},i._appendCues=function(c,S){var C=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[S];if(T.mode==="disabled")return;c.forEach(function(m){return Object(R.addCueToTrack)(T,m)})}else{var w=this.tracks[S],A=w.default?"default":"subtitles"+S;C.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:c,track:A})}},i.onFragDecrypted=function(c,S){var C=S.frag;if(C.type===b.PlaylistLevelType.SUBTITLE){if(!Object(K.isFiniteNumber)(this.initPTS[C.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(L.Events.FRAG_LOADED,S)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(c,S){var C=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(C&&T))return;for(var w=0;w<S.samples.length;w++){var A=S.samples[w].bytes;if(A){var m=this.extractCea608Data(A);C.addData(S.samples[w].pts,m[0]),T.addData(S.samples[w].pts,m[1])}}},i.onBufferFlushing=function(c,S){var C=S.startOffset,T=S.endOffset,w=S.endOffsetSubtitles,A=S.type,m=this.media;if(!m||m.currentTime<T)return;if(!A||A==="video"){var v=this.captionsTracks;Object.keys(v).forEach(function(o){return Object(R.removeCuesInRange)(v[o],C,T)})}if(this.config.renderTextTracksNatively&&(C===0&&w!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(o){return Object(R.removeCuesInRange)(s[o],C,w)})}},i.extractCea608Data=function(c){for(var S=c[0]&31,C=2,T=[[],[]],w=0;w<S;w++){var A=c[C++],m=127&c[C++],v=127&c[C++],s=(4&A)!==0,o=3&A;if(m===0&&v===0)continue;s&&((o===0||o===1)&&(T[o].push(m),T[o].push(v)))}return T},l}();function f(l,i){return l&&l.label===i.name&&!(l.textTrack1||l.textTrack2)}function a(l,i,u,c){return Math.min(i,c)-Math.max(l,u)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return K});var K=function(){function L(W,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=F}var N=L.prototype;return N.decrypt=function(F,R){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},R,F)},L}()},"./src/crypt/aes-decryptor.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"removePadding",function(){return L}),I.d(V,"default",function(){return N});var K=I("./src/utils/typed-array.ts");function L(W){var F=W.byteLength,R=F&&new DataView(W.buffer).getUint8(F-1);return R?Object(K.sliceUint8)(W,0,F-R):W}var N=function(){function W(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var F=W.prototype;return F.uint8ArrayToUint32Array_=function(D){for(var b=new DataView(D),p=new Uint32Array(4),_=0;_<4;_++)p[_]=b.getUint32(_*4);return p},F.initTable=function(){var D=this.sBox,b=this.invSBox,p=this.subMix,_=p[0],f=p[1],a=p[2],d=p[3],l=this.invSubMix,i=l[0],u=l[1],c=l[2],S=l[3],C=new Uint32Array(256),T=0,w=0,A=0;for(A=0;A<256;A++)A<128?C[A]=A<<1:C[A]=A<<1^283;for(A=0;A<256;A++){var m=w^w<<1^w<<2^w<<3^w<<4;m=m>>>8^m&255^99,D[T]=m,b[m]=T;var v=C[T],s=C[v],o=C[s],E=C[m]*257^m*16843008;_[T]=E<<24|E>>>8,f[T]=E<<16|E>>>16,a[T]=E<<8|E>>>24,d[T]=E,E=o*16843009^s*65537^v*257^T*16843008,i[m]=E<<24|E>>>8,u[m]=E<<16|E>>>16,c[m]=E<<8|E>>>24,S[m]=E,T?(T=v^C[C[C[o^v]]],w^=C[C[w]]):T=w=1}},F.expandKey=function(D){for(var b=this.uint8ArrayToUint32Array_(D),p=!0,_=0;_<b.length&&p;)p=b[_]===this.key[_],_++;if(p)return;this.key=b;var f=this.keySize=b.length;if(f!==4&&f!==6&&f!==8)throw new Error("Invalid aes key size="+f);var a=this.ksRows=(f+6+1)*4,d,l,i=this.keySchedule=new Uint32Array(a),u=this.invKeySchedule=new Uint32Array(a),c=this.sBox,S=this.rcon,C=this.invSubMix,T=C[0],w=C[1],A=C[2],m=C[3],v,s;for(d=0;d<a;d++){if(d<f){v=i[d]=b[d];continue}s=v,d%f===0?(s=s<<8|s>>>24,s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255],s^=S[d/f|0]<<24):f>6&&d%f===4&&(s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255]),i[d]=v=(i[d-f]^s)>>>0}for(l=0;l<a;l++)d=a-l,l&3?s=i[d]:s=i[d-4],l<4||d<=4?u[l]=s:u[l]=T[c[s>>>24]]^w[c[s>>>16&255]]^A[c[s>>>8&255]]^m[c[s&255]],u[l]=u[l]>>>0},F.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},F.decrypt=function(D,b,p){for(var _=this.keySize+6,f=this.invKeySchedule,a=this.invSBox,d=this.invSubMix,l=d[0],i=d[1],u=d[2],c=d[3],S=this.uint8ArrayToUint32Array_(p),C=S[0],T=S[1],w=S[2],A=S[3],m=new Int32Array(D),v=new Int32Array(m.length),s,o,E,g,O,M,k,U,B,y,x,j,z,Y,$=this.networkToHostOrderSwap;b<m.length;){for(B=$(m[b]),y=$(m[b+1]),x=$(m[b+2]),j=$(m[b+3]),O=B^f[0],M=j^f[1],k=x^f[2],U=y^f[3],z=4,Y=1;Y<_;Y++)s=l[O>>>24]^i[M>>16&255]^u[k>>8&255]^c[U&255]^f[z],o=l[M>>>24]^i[k>>16&255]^u[U>>8&255]^c[O&255]^f[z+1],E=l[k>>>24]^i[U>>16&255]^u[O>>8&255]^c[M&255]^f[z+2],g=l[U>>>24]^i[O>>16&255]^u[M>>8&255]^c[k&255]^f[z+3],O=s,M=o,k=E,U=g,z=z+4;s=a[O>>>24]<<24^a[M>>16&255]<<16^a[k>>8&255]<<8^a[U&255]^f[z],o=a[M>>>24]<<24^a[k>>16&255]<<16^a[U>>8&255]<<8^a[O&255]^f[z+1],E=a[k>>>24]<<24^a[U>>16&255]<<16^a[O>>8&255]<<8^a[M&255]^f[z+2],g=a[U>>>24]<<24^a[O>>16&255]<<16^a[M>>8&255]<<8^a[k&255]^f[z+3],v[b]=$(s^C),v[b+1]=$(g^T),v[b+2]=$(E^w),v[b+3]=$(o^A),C=B,T=y,w=x,A=j,b=b+4}return v.buffer},W}()},"./src/crypt/decrypter.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return b});var K=I("./src/crypt/aes-crypto.ts"),L=I("./src/crypt/fast-aes-key.ts"),N=I("./src/crypt/aes-decryptor.ts"),W=I("./src/utils/logger.ts"),F=I("./src/utils/mp4-tools.ts"),R=I("./src/utils/typed-array.ts"),D=16,b=function(){function p(f,a,d){var l=d===void 0?{}:d,i=l.removePKCS7Padding,u=i===void 0?!0:i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=f,this.config=a,this.removePKCS7Padding=u,u)try{var c=self.crypto;c&&(this.subtle=c.subtle||c.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var _=p.prototype;return _.destroy=function(){this.observer=null},_.isSync=function(){return this.config.enableSoftwareAES},_.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var d=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(N.removePadding)(d):d},_.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},_.decrypt=function(a,d,l,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),d,l);var u=this.flush();u&&i(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),d,l).then(i)},_.softwareDecrypt=function(a,d,l){var i=this.currentIV,u=this.currentResult,c=this.remainderData;this.logOnce("JS AES decrypt"),c&&(a=Object(F.appendUint8Array)(c,a),this.remainderData=null);var S=this.getValidChunk(a);if(!S.length)return null;i&&(l=i);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new N.default),C.expandKey(d);var T=u;return this.currentResult=C.decrypt(S.buffer,0,l),this.currentIV=Object(R.sliceUint8)(S,-16).buffer,T||null},_.webCryptoDecrypt=function(a,d,l){var i=this,u=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new L.default(u,d)),this.fastAesKey.expandKey().then(function(c){if(!u)return Promise.reject(new Error("web crypto not initialized"));var S=new K.default(u,l);return S.decrypt(a.buffer,c)}).catch(function(c){return i.onWebCryptoError(c,a,d,l)})},_.onWebCryptoError=function(a,d,l,i){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,l,i)},_.getValidChunk=function(a){var d=a,l=a.length-a.length%D;return l!==a.length&&(d=Object(R.sliceUint8)(a,0,l),this.remainderData=Object(R.sliceUint8)(a,l)),d},_.logOnce=function(a){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return K});var K=function(){function L(W,F){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=F}var N=L.prototype;return N.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/demux/base-audio-demuxer.ts"),L=I("./src/demux/adts.ts"),N=I("./src/utils/logger.ts"),W=I("./src/demux/id3.ts");function F(b,p){b.prototype=Object.create(p.prototype),b.prototype.constructor=b,R(b,p)}function R(b,p){return R=Object.setPrototypeOf||function(f,a){return f.__proto__=a,f},R(b,p)}var D=function(b){F(p,b);function p(f,a){var d;return d=b.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=f,d.config=a,d}var _=p.prototype;return _.resetInitSegment=function(a,d,l){b.prototype.resetInitSegment.call(this,a,d,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var d=W.getID3Data(a,0)||[],l=d.length,i=a.length;l<i;l++)if(L.probe(a,l))return N.logger.log("ADTS sync word found !"),!0;return!1},_.canParse=function(a,d){return L.canParse(a,d)},_.appendFrame=function(a,d,l){L.initTrackConfig(a,this.observer,d,l,a.manifestCodec);var i=L.appendFrame(a,d,l,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},p}(K.default);D.minProbeByteLength=9,V.default=D},"./src/demux/adts.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"getAudioConfig",function(){return W}),I.d(V,"isHeaderPattern",function(){return F}),I.d(V,"getHeaderLength",function(){return R}),I.d(V,"getFullFrameLength",function(){return D}),I.d(V,"canGetFrameLength",function(){return b}),I.d(V,"isHeader",function(){return p}),I.d(V,"canParse",function(){return _}),I.d(V,"probe",function(){return f}),I.d(V,"initTrackConfig",function(){return a}),I.d(V,"getFrameDuration",function(){return d}),I.d(V,"parseFrameHeader",function(){return l}),I.d(V,"appendFrame",function(){return i});var K=I("./src/utils/logger.ts"),L=I("./src/errors.ts"),N=I("./src/events.ts");function W(u,c,S,C){var T,w,A,m,v=navigator.userAgent.toLowerCase(),s=C,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((c[S+2]&192)>>>6)+1;var E=(c[S+2]&60)>>>2;if(E>o.length-1){u.trigger(N.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return A=(c[S+2]&1)<<2,A|=(c[S+3]&192)>>>6,K.logger.log("manifest codec:"+C+", ADTS type:"+T+", samplingIndex:"+E),/firefox/i.test(v)?E>=6?(T=5,m=new Array(4),w=E-3):(T=2,m=new Array(2),w=E):v.indexOf("android")!==-1?(T=2,m=new Array(2),w=E):(T=5,m=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&E>=6?w=E-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(E>=6&&A===1||/vivaldi/i.test(v))||!C&&A===1)&&(T=2,m=new Array(2)),w=E)),m[0]=T<<3,m[0]|=(E&14)>>1,m[1]|=(E&1)<<7,m[1]|=A<<3,T===5&&(m[1]|=(w&14)>>1,m[2]=(w&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:o[E],channelCount:A,codec:"mp4a.40."+T,manifestCodec:s}}function F(u,c){return u[c]===255&&(u[c+1]&246)===240}function R(u,c){return u[c+1]&1?7:9}function D(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}function p(u,c){return c+1<u.length&&F(u,c)}function _(u,c){return b(u,c)&&F(u,c)&&D(u,c)<=u.length-c}function f(u,c){if(p(u,c)){var S=R(u,c);if(c+S>=u.length)return!1;var C=D(u,c);if(C<=S)return!1;var T=c+C;return T===u.length||p(u,T)}return!1}function a(u,c,S,C,T){if(!u.samplerate){var w=W(c,S,C,T);if(!w)return;u.config=w.config,u.samplerate=w.samplerate,u.channelCount=w.channelCount,u.codec=w.codec,u.manifestCodec=w.manifestCodec,K.logger.log("parsed codec:"+u.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function d(u){return 1024*9e4/u}function l(u,c,S,C,T){var w=R(u,c),A=D(u,c);if(A-=w,A>0){var m=S+C*T;return{headerLength:w,frameLength:A,stamp:m}}}function i(u,c,S,C,T){var w=d(u.samplerate),A=l(c,S,C,T,w);if(A){var m=A.frameLength,v=A.headerLength,s=A.stamp,o=v+m,E=Math.max(0,S+o-c.length),g;E?(g=new Uint8Array(o-v),g.set(c.subarray(S+v,c.length),0)):g=c.subarray(S+v,S+o);var O={unit:g,pts:s};return E||u.samples.push(O),{sample:O,length:o,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"initPTSFn",function(){return D});var K=I("./src/polyfills/number.ts"),L=I("./src/demux/id3.ts"),N=I("./src/demux/dummy-demuxed-track.ts"),W=I("./src/utils/mp4-tools.ts"),F=I("./src/utils/typed-array.ts"),R=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(f,a,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(f,a){return!1},p.appendFrame=function(f,a,d){},p.demux=function(f,a){this.cachedData&&(f=Object(W.appendUint8Array)(this.cachedData,f),this.cachedData=null);var d=L.getID3Data(f,0),l=d?d.length:0,i,u,c=this._audioTrack,S=this._id3Track,C=d?L.getTimeStamp(d):void 0,T=f.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(C,a)),d&&d.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),u=this.initPTS;l<T;){if(this.canParse(f,l)){var w=this.appendFrame(c,f,l);w?(this.frameIndex++,u=w.sample.pts,l+=w.length,i=l):l=T}else L.canParse(f,l)?(d=L.getID3Data(f,l),S.samples.push({pts:u,dts:u,data:d}),l+=d.length,i=l):l++;if(l===T&&i!==T){var A=Object(F.sliceUint8)(f,i);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:c,avcTrack:Object(N.dummyTrack)(),id3Track:S,textTrack:Object(N.dummyTrack)()}},p.demuxSampleAes=function(f,a,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(f){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(N.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(N.dummyTrack)()}},p.destroy=function(){},b}(),D=function(p,_){return Object(K.isFiniteNumber)(p)?p*90:_*9e4};V.default=R},"./src/demux/chunk-cache.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return K});var K=function(){function N(){this.chunks=[],this.dataLength=0}var W=N.prototype;return W.push=function(R){this.chunks.push(R),this.dataLength+=R.length},W.flush=function(){var R=this.chunks,D=this.dataLength,b;if(R.length)R.length===1?b=R[0]:b=L(R,D);else return new Uint8Array(0);return this.reset(),b},W.reset=function(){this.chunks.length=0,this.dataLength=0},N}();function L(N,W){for(var F=new Uint8Array(W),R=0,D=0;D<N.length;D++){var b=N[D];F.set(b,R),R+=b.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"dummyTrack",function(){return K});function K(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/utils/logger.ts"),L=function(){function N(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var W=N.prototype;return W.loadWord=function(){var R=this.data,D=this.bytesAvailable,b=R.byteLength-D,p=new Uint8Array(4),_=Math.min(4,D);if(_===0)throw new Error("no bytes available");p.set(R.subarray(b,b+_)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=_*8,this.bytesAvailable-=_},W.skipBits=function(R){var D;this.bitsAvailable>R?(this.word<<=R,this.bitsAvailable-=R):(R-=this.bitsAvailable,D=R>>3,R-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=R,this.bitsAvailable-=R)},W.readBits=function(R){var D=Math.min(this.bitsAvailable,R),b=this.word>>>32-D;return R>32&&K.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=R-D,D>0&&this.bitsAvailable?b<<D|this.readBits(D):b},W.skipLZ=function(){var R;for(R=0;R<this.bitsAvailable;++R)if((this.word&2147483648>>>R)!==0)return this.word<<=R,this.bitsAvailable-=R,R;return this.loadWord(),R+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var R=this.skipLZ();return this.readBits(R+1)-1},W.readEG=function(){var R=this.readUEG();return 1&R?1+R>>>1:-1*(R>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(R){for(var D=8,b=8,p,_=0;_<R;_++)b!==0&&(p=this.readEG(),b=(D+p+256)%256),D=b===0?D:b},W.readSPS=function(){var R=0,D=0,b=0,p=0,_,f,a,d=this.readUByte.bind(this),l=this.readBits.bind(this),i=this.readUEG.bind(this),u=this.readBoolean.bind(this),c=this.skipBits.bind(this),S=this.skipEG.bind(this),C=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var w=d();if(l(5),c(3),d(),C(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var A=i();if(A===3&&c(1),C(),C(),c(1),u())for(f=A!==3?8:12,a=0;a<f;a++)u()&&(a<6?T(16):T(64))}C();var m=i();if(m===0)i();else if(m===1)for(c(1),S(),S(),_=i(),a=0;a<_;a++)S();C(),c(1);var v=i(),s=i(),o=l(1);o===0&&c(1),c(1),u()&&(R=i(),D=i(),b=i(),p=i());var E=[1,1];if(u()&&u()){var g=d();switch(g){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((v+1)*16-R*2-D*2),height:(2-o)*(s+1)*16-(o?2:4)*(b+p),pixelRatio:E}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},N}();V.default=L},"./src/demux/id3.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"isHeader",function(){return K}),I.d(V,"isFooter",function(){return L}),I.d(V,"getID3Data",function(){return N}),I.d(V,"canParse",function(){return F}),I.d(V,"getTimeStamp",function(){return R}),I.d(V,"isTimeStampFrame",function(){return D}),I.d(V,"getID3Frames",function(){return p}),I.d(V,"decodeFrame",function(){return _}),I.d(V,"utf8ArrayToStr",function(){return i}),I.d(V,"testables",function(){return u});var K=function(T,w){return w+10<=T.length&&(T[w]===73&&T[w+1]===68&&T[w+2]===51&&(T[w+3]<255&&T[w+4]<255&&(T[w+6]<128&&T[w+7]<128&&T[w+8]<128&&T[w+9]<128)))},L=function(T,w){return w+10<=T.length&&(T[w]===51&&T[w+1]===68&&T[w+2]===73&&(T[w+3]<255&&T[w+4]<255&&(T[w+6]<128&&T[w+7]<128&&T[w+8]<128&&T[w+9]<128)))},N=function(T,w){for(var A=w,m=0;K(T,w);){m+=10;var v=W(T,w+6);m+=v,L(T,w+10)&&(m+=10),w+=m}return m>0?T.subarray(A,A+m):void 0},W=function(T,w){var A=0;return A=(T[w]&127)<<21,A|=(T[w+1]&127)<<14,A|=(T[w+2]&127)<<7,A|=T[w+3]&127,A},F=function(T,w){return K(T,w)&&W(T,w+6)+10<=T.length-w},R=function(T){for(var w=p(T),A=0;A<w.length;A++){var m=w[A];if(D(m))return l(m)}return},D=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},b=function(T){var w=String.fromCharCode(T[0],T[1],T[2],T[3]),A=W(T,4),m=10;return{type:w,size:A,data:T.subarray(m,m+A)}},p=function(T){for(var w=0,A=[];K(T,w);){var m=W(T,w+6);w+=10;for(var v=w+m;w+8<v;){var s=b(T.subarray(w)),o=_(s);o&&A.push(o),w+=s.size+10}L(T,w)&&(w+=10)}return A},_=function(T){return T.type==="PRIV"?f(T):T.type[0]==="W"?d(T):a(T)},f=function(T){if(T.size<2)return;var w=i(T.data,!0),A=new Uint8Array(T.data.subarray(w.length+1));return{key:T.type,info:w,data:A.buffer}},a=function(T){if(T.size<2)return;if(T.type==="TXXX"){var w=1,A=i(T.data.subarray(w),!0);w+=A.length+1;var m=i(T.data.subarray(w));return{key:T.type,info:A,data:m}}var v=i(T.data.subarray(1));return{key:T.type,data:v}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var w=1,A=i(T.data.subarray(w),!0);w+=A.length+1;var m=i(T.data.subarray(w));return{key:T.type,info:A,data:m}}var v=i(T.data);return{key:T.type,data:v}},l=function(T){if(T.data.byteLength===8){var w=new Uint8Array(T.data),A=w[3]&1,m=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return m/=45,A&&(m+=4772185884e-2),Math.round(m)}return},i=function(T,w){w===void 0&&(w=!1);var A=S();if(A){var m=A.decode(T);if(w){var v=m.indexOf("\0");return v!==-1?m.substring(0,v):m}return m.replace(/\0/g,"")}for(var s=T.length,o,E,g,O="",M=0;M<s;){if(o=T[M++],o===0&&w)return O;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:O+=String.fromCharCode(o);break;case 12:case 13:E=T[M++],O+=String.fromCharCode((o&31)<<6|E&63);break;case 14:E=T[M++],g=T[M++],O+=String.fromCharCode((o&15)<<12|(E&63)<<6|(g&63)<<0);break;default:}}return O},u={decodeTextFrame:a},c;function S(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/demux/base-audio-demuxer.ts"),L=I("./src/demux/id3.ts"),N=I("./src/utils/logger.ts"),W=I("./src/demux/mpegaudio.ts");function F(b,p){b.prototype=Object.create(p.prototype),b.prototype.constructor=b,R(b,p)}function R(b,p){return R=Object.setPrototypeOf||function(f,a){return f.__proto__=a,f},R(b,p)}var D=function(b){F(p,b);function p(){return b.apply(this,arguments)||this}var _=p.prototype;return _.resetInitSegment=function(a,d,l){b.prototype.resetInitSegment.call(this,a,d,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var d=L.getID3Data(a,0)||[],l=d.length,i=a.length;l<i;l++)if(W.probe(a,l))return N.logger.log("MPEG Audio sync word found !"),!0;return!1},_.canParse=function(a,d){return W.canParse(a,d)},_.appendFrame=function(a,d,l){return this.initPTS===null?void 0:W.appendFrame(a,d,l,this.initPTS,this.frameIndex)},p}(K.default);D.minProbeByteLength=4,V.default=D},"./src/demux/mp4demuxer.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/utils/mp4-tools.ts"),L=I("./src/demux/dummy-demuxed-track.ts"),N=function(){function W(R,D){this.remainderData=null,this.config=void 0,this.config=D}var F=W.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},W.probe=function(D){return Object(K.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},F.demux=function(D){var b=D,p=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(K.appendUint8Array)(this.remainderData,D));var _=Object(K.segmentValidRange)(b);this.remainderData=_.remainder,p.samples=_.valid||new Uint8Array}else p.samples=b;return{audioTrack:Object(L.dummyTrack)(),avcTrack:p,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},F.flush=function(){var D=Object(L.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:D,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},F.demuxSampleAes=function(D,b,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},W}();N.minProbeByteLength=1024,V.default=N},"./src/demux/mpegaudio.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"appendFrame",function(){return R}),I.d(V,"parseHeader",function(){return D}),I.d(V,"isHeaderPattern",function(){return b}),I.d(V,"isHeader",function(){return p}),I.d(V,"canParse",function(){return _}),I.d(V,"probe",function(){return f});var K=null,L=[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],N=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function R(a,d,l,i,u){if(l+24>d.length)return;var c=D(d,l);if(c&&l+c.frameLength<=d.length){var S=c.samplesPerFrame*9e4/c.sampleRate,C=i+u*S,T={unit:d.subarray(l,l+c.frameLength),pts:C,dts:C};return a.config=[],a.channelCount=c.channelCount,a.samplerate=c.sampleRate,a.samples.push(T),{sample:T,length:c.frameLength,missing:0}}}function D(a,d){var l=a[d+1]>>3&3,i=a[d+1]>>1&3,u=a[d+2]>>4&15,c=a[d+2]>>2&3;if(l!==1&&u!==0&&u!==15&&c!==3){var S=a[d+2]>>1&1,C=a[d+3]>>6,T=l===3?3-i:i===3?3:4,w=L[T*14+u-1]*1e3,A=l===3?0:l===2?1:2,m=N[A*3+c],v=C===3?1:2,s=W[l][i],o=F[i],E=s*8*o,g=Math.floor(s*w/m+S)*o;if(K===null){var O=navigator.userAgent||"",M=O.match(/Chrome\/(\d+)/i);K=M?parseInt(M[1]):0}var k=!!K&&K<=87;return k&&i===2&&w>=224e3&&C===0&&(a[d+3]=a[d+3]|128),{sampleRate:m,channelCount:v,frameLength:g,samplesPerFrame:E}}}function b(a,d){return a[d]===255&&(a[d+1]&224)===224&&(a[d+1]&6)!==0}function p(a,d){return d+1<a.length&&b(a,d)}function _(a,d){var l=4;return b(a,d)&&l<=a.length-d}function f(a,d){if(d+1<a.length&&b(a,d)){var l=4,i=D(a,d),u=l;i!=null&&i.frameLength&&(u=i.frameLength);var c=d+u;return c===a.length||p(a,c)}return!1}},"./src/demux/sample-aes.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/crypt/decrypter.ts"),L=I("./src/demux/tsdemuxer.ts"),N=function(){function W(R,D,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new K.default(R,D,{removePKCS7Padding:!1})}var F=W.prototype;return F.decryptBuffer=function(D,b){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,b)},F.decryptAacSample=function(D,b,p,_){var f=D[b].unit,a=f.subarray(16,f.length-f.length%16),d=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),l=this;this.decryptBuffer(d,function(i){var u=new Uint8Array(i);f.set(u,16),_||l.decryptAacSamples(D,b+1,p)})},F.decryptAacSamples=function(D,b,p){for(;;b++){if(b>=D.length){p();return}if(D[b].unit.length<32)continue;var _=this.decrypter.isSync();if(this.decryptAacSample(D,b,p,_),!_)return}},F.getAvcEncryptedData=function(D){for(var b=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(b),_=0,f=32;f<=D.length-16;f+=160,_+=16)p.set(D.subarray(f,f+16),_);return p},F.getAvcDecryptedUnit=function(D,b){for(var p=new Uint8Array(b),_=0,f=32;f<=D.length-16;f+=160,_+=16)D.set(p.subarray(_,_+16),f);return D},F.decryptAvcSample=function(D,b,p,_,f,a){var d=Object(L.discardEPB)(f.data),l=this.getAvcEncryptedData(d),i=this;this.decryptBuffer(l.buffer,function(u){f.data=i.getAvcDecryptedUnit(d,u),a||i.decryptAvcSamples(D,b,p+1,_)})},F.decryptAvcSamples=function(D,b,p,_){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,p=0){if(b>=D.length){_();return}for(var f=D[b].units;!(p>=f.length);p++){var a=f[p];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(D,b,p,_,a,d),!d)return}}},W}();V.default=N},"./src/demux/transmuxer-interface.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return f});var K=I("./node_modules/webworkify-webpack/index.js"),L=I.n(K),N=I("./src/events.ts"),W=I("./src/demux/transmuxer.ts"),F=I("./src/utils/logger.ts"),R=I("./src/errors.ts"),D=I("./src/utils/mediasource-helper.ts"),b=I("./node_modules/eventemitter3/index.js"),p=I.n(b),_=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},f=function(){function a(l,i,u,c){var S=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=i,this.onTransmuxComplete=u,this.onFlush=c;var C=l.config,T=function(s,o){o=o||{},o.frag=S.frag,o.id=S.id,l.trigger(s,o)};this.observer=new b.EventEmitter,this.observer.on(N.Events.FRAG_DECRYPTED,T),this.observer.on(N.Events.ERROR,T);var w={mp4:_.isTypeSupported("video/mp4"),mpeg:_.isTypeSupported("audio/mpeg"),mp3:_.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(C.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var m;try{m=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(v){l.trigger(N.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},m.postMessage({cmd:"init",typeSupported:w,vendor:A,id:i,config:JSON.stringify(C)})}catch(v){F.logger.warn("Error in worker:",v),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new W.default(this.observer,w,C,A,i),this.worker=null}}else this.transmuxer=new W.default(this.observer,w,C,A,i)}var d=a.prototype;return d.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.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(i,u,c,S,C,T,w,A,m,v){var s=this;m.transmuxing.start=self.performance.now();var o=this.transmuxer,E=this.worker,g=T?T.start:C.start,O=C.decryptdata,M=this.frag,k=!(M&&C.cc===M.cc),U=!(M&&m.level===M.level),B=M?m.sn-M.sn:-1,y=this.part?m.part-this.part.index:1,x=!U&&(B===1||B===0&&y===1),j=self.performance.now();(U||B||C.stats.parsing.start===0)&&(C.stats.parsing.start=j),T&&(y||!x)&&(T.stats.parsing.start=j);var z=new W.TransmuxState(k,x,A,U,g);if(!x||k){F.logger.log("[transmuxer-interface, "+C.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
|
|
discontinuity: `+k+`
|
|
trackSwitch: `+U+`
|
|
contiguous: `+x+`
|
|
accurateTimeOffset: `+A+`
|
|
timeOffset: `+g);var Y=new W.TransmuxConfig(c,S,u,w,v);this.configureTransmuxer(Y)}if(this.frag=C,this.part=T,E)E.postMessage({cmd:"demux",data:i,decryptdata:O,chunkMeta:m,state:z},i instanceof ArrayBuffer?[i]:[]);else if(o){var $=o.push(i,O,m,z);Object(W.isPromise)($)?$.then(function(ce){s.handleTransmuxComplete(ce)}):this.handleTransmuxComplete($)}},d.flush=function(i){var u=this;i.transmuxing.start=self.performance.now();var c=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:i});else if(c){var C=c.flush(i);Object(W.isPromise)(C)?C.then(function(T){u.handleFlushResult(T,i)}):this.handleFlushResult(C,i)}},d.handleFlushResult=function(i,u){var c=this;i.forEach(function(S){c.handleTransmuxComplete(S)}),this.onFlush(u)},d.onWorkerMessage=function(i){var u=i.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(i){var u=this.worker,c=this.transmuxer;u?u.postMessage({cmd:"configure",config:i}):c&&c.configure(i)},d.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},a}()},"./src/demux/transmuxer-worker.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return R});var K=I("./src/demux/transmuxer.ts"),L=I("./src/events.ts"),N=I("./src/utils/logger.ts"),W=I("./node_modules/eventemitter3/index.js"),F=I.n(W);function R(f){var a=new W.EventEmitter,d=function(i,u){f.postMessage({event:i,data:u})};a.on(L.Events.FRAG_DECRYPTED,d),a.on(L.Events.ERROR,d),f.addEventListener("message",function(l){var i=l.data;switch(i.cmd){case"init":{var u=JSON.parse(i.config);f.transmuxer=new K.default(a,i.typeSupported,u,i.vendor,i.id),Object(N.enableLogs)(u.debug),d("init",null);break}case"configure":{f.transmuxer.configure(i.config);break}case"demux":{var c=f.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(K.isPromise)(c)?c.then(function(T){D(f,T)}):D(f,c);break}case"flush":{var S=i.chunkMeta,C=f.transmuxer.flush(S);Object(K.isPromise)(C)?C.then(function(T){p(f,T,S)}):p(f,C,S);break}default:break}})}function D(f,a){if(_(a.remuxResult))return;var d=[],l=a.remuxResult,i=l.audio,u=l.video;i&&b(d,i),u&&b(d,u),f.postMessage({event:"transmuxComplete",data:a},d)}function b(f,a){a.data1&&f.push(a.data1.buffer),a.data2&&f.push(a.data2.buffer)}function p(f,a,d){a.forEach(function(l){D(f,l)}),f.postMessage({event:"flush",data:d})}function _(f){return!f.audio&&!f.video&&!f.text&&!f.id3&&!f.initSegment}},"./src/demux/transmuxer.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return u}),I.d(V,"isPromise",function(){return C}),I.d(V,"TransmuxConfig",function(){return T}),I.d(V,"TransmuxState",function(){return w});var K=I("./src/events.ts"),L=I("./src/errors.ts"),N=I("./src/crypt/decrypter.ts"),W=I("./src/demux/aacdemuxer.ts"),F=I("./src/demux/mp4demuxer.ts"),R=I("./src/demux/tsdemuxer.ts"),D=I("./src/demux/mp3demuxer.ts"),b=I("./src/remux/mp4-remuxer.ts"),p=I("./src/remux/passthrough-remuxer.ts"),_=I("./src/demux/chunk-cache.ts"),f=I("./src/utils/mp4-tools.ts"),a=I("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(A){a.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var l=[{demux:R.default,remux:b.default},{demux:F.default,remux:p.default},{demux:W.default,remux:b.default},{demux:D.default,remux:b.default}],i=1024;l.forEach(function(A){var m=A.demux;i=Math.max(i,m.minProbeByteLength)});var u=function(){function A(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=A.prototype;return m.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},m.push=function(s,o,E,g){var O=this,M=E.transmuxing;M.executeStart=d();var k=new Uint8Array(s),U=this.cache,B=this.config,y=this.currentTransmuxState,x=this.transmuxConfig;g&&(this.currentTransmuxState=g);var j=c(k,o);if(j&&j.method==="AES-128"){var z=this.getDecrypter();if(B.enableSoftwareAES){var Y=z.softwareDecrypt(k,j.key.buffer,j.iv.buffer);if(!Y)return M.executeEnd=d(),S(E);k=new Uint8Array(Y)}else return this.decryptionPromise=z.webCryptoDecrypt(k,j.key.buffer,j.iv.buffer).then(function(Re){var Ve=O.push(Re,null,E);return O.decryptionPromise=null,Ve}),this.decryptionPromise}var $=g||y,ce=$.contiguous,se=$.discontinuity,ne=$.trackSwitch,re=$.accurateTimeOffset,ue=$.timeOffset,ee=x.audioCodec,ae=x.videoCodec,ge=x.defaultInitPts,Le=x.duration,ke=x.initSegmentData;if((se||ne)&&this.resetInitSegment(ke,ee,ae,Le),se&&this.resetInitialTimestamp(ge),ce||this.resetContiguity(),this.needsProbing(k,se,ne)){if(U.dataLength){var De=U.flush();k=Object(f.appendUint8Array)(De,k)}this.configureTransmuxer(k,x)}var Ue=this.transmux(k,j,ue,re,E),Ie=this.currentTransmuxState;return Ie.contiguous=!0,Ie.discontinuity=!1,Ie.trackSwitch=!1,M.executeEnd=d(),Ue},m.flush=function(s){var o=this,E=s.transmuxing;E.executeStart=d();var g=this.decrypter,O=this.cache,M=this.currentTransmuxState,k=this.decryptionPromise;if(k)return k.then(function(){return o.flush(s)});var U=[],B=M.timeOffset;if(g){var y=g.flush();y&&U.push(this.push(y,null,s))}var x=O.dataLength;O.reset();var j=this.demuxer,z=this.remuxer;if(!j||!z)return x>=i&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=d(),[S(s)];var Y=j.flush(B);return C(Y)?Y.then(function($){return o.flushRemux(U,$,s),U}):(this.flushRemux(U,Y,s),U)},m.flushRemux=function(s,o,E){var g=o.audioTrack,O=o.avcTrack,M=o.id3Track,k=o.textTrack,U=this.currentTransmuxState,B=U.accurateTimeOffset,y=U.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var x=this.remuxer.remux(g,O,M,k,y,B,!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 O=this.demuxer,M=this.remuxer;if(!O||!M)return;O.resetInitSegment(o,E,g),M.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,O){var M;return o&&o.method==="SAMPLE-AES"?M=this.transmuxSampleAes(s,o,E,g,O):M=this.transmuxUnencrypted(s,E,g,O),M},m.transmuxUnencrypted=function(s,o,E,g){var O=this.demuxer.demux(s,o,!1,!this.config.progressive),M=O.audioTrack,k=O.avcTrack,U=O.id3Track,B=O.textTrack,y=this.remuxer.remux(M,k,U,B,o,E,!1,this.id);return{remuxResult:y,chunkMeta:g}},m.transmuxSampleAes=function(s,o,E,g,O){var M=this;return this.demuxer.demuxSampleAes(s,o,E).then(function(k){var U=M.remuxer.remux(k.audioTrack,k.avcTrack,k.id3Track,k.textTrack,E,g,!1,M.id);return{remuxResult:U,chunkMeta:O}})},m.configureTransmuxer=function(s,o){for(var E=this.config,g=this.observer,O=this.typeSupported,M=this.vendor,k=o.audioCodec,U=o.defaultInitPts,B=o.duration,y=o.initSegmentData,x=o.videoCodec,j,z=0,Y=l.length;z<Y;z++)if(l[z].demux.probe(s)){j=l[z];break}j||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),j={demux:F.default,remux:p.default});var $=this.demuxer,ce=this.remuxer,se=j.remux,ne=j.demux;(!ce||!(ce instanceof se))&&(this.remuxer=new se(g,E,O,M)),(!$||!($ instanceof ne))&&(this.demuxer=new ne(g,E,O),this.probe=ne.probe),this.resetInitSegment(y,k,x,B),this.resetInitialTimestamp(U)},m.needsProbing=function(s,o,E){return!this.demuxer||!this.remuxer||o||E},m.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new N.default(this.observer,this.config)),s},A}();function c(A,m){var v=null;return A.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(v=m),v}var S=function(m){return{remuxResult:{},chunkMeta:m}};function C(A){return"then"in A&&A.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},w=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(oe,V,I){"use strict";I.r(V),I.d(V,"discardEPB",function(){return S});var K=I("./src/demux/adts.ts"),L=I("./src/demux/mpegaudio.ts"),N=I("./src/demux/exp-golomb.ts"),W=I("./src/demux/id3.ts"),F=I("./src/demux/sample-aes.ts"),R=I("./src/events.ts"),D=I("./src/utils/mp4-tools.ts"),b=I("./src/utils/logger.ts"),p=I("./src/errors.ts"),_={video:1,audio:2,id3:3,text:4},f=function(){function C(w,A,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=w,this.config=A,this.typeSupported=m}C.probe=function(A){var m=C.syncOffset(A);return m<0?!1:(m&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},C.syncOffset=function(A){for(var m=Math.min(1e3,A.length-3*188),v=0;v<m;){if(A[v]===71&&A[v+188]===71&&A[v+2*188]===71)return v;v++}return-1},C.createTrack=function(A,m){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:_[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?m:void 0}};var T=C.prototype;return T.resetInitSegment=function(A,m,v){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=C.createTrack("video",v),this._audioTrack=C.createTrack("audio",v),this._id3Track=C.createTrack("id3",v),this._txtTrack=C.createTrack("text",v),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=m,this._duration=v},T.resetTimeStamp=function(){},T.resetContiguity=function(){var A=this._audioTrack,m=this._avcTrack,v=this._id3Track;A&&(A.pesData=null),m&&(m.pesData=null),v&&(v.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(A,m,v,s){v===void 0&&(v=!1),s===void 0&&(s=!1),v||(this.sampleAes=null);var o,E=this._avcTrack,g=this._audioTrack,O=this._id3Track,M=E.pid,k=E.pesData,U=g.pid,B=O.pid,y=g.pesData,x=O.pesData,j=!1,z=this.pmtParsed,Y=this._pmtId,$=A.length;if(this.remainderData&&(A=Object(D.appendUint8Array)(this.remainderData,A),$=A.length,this.remainderData=null),$<188&&!s)return this.remainderData=A,{audioTrack:g,avcTrack:E,id3Track:O,textTrack:this._txtTrack};var ce=Math.max(0,C.syncOffset(A));$-=($+ce)%188,$<A.byteLength&&!s&&(this.remainderData=new Uint8Array(A.buffer,$,A.buffer.byteLength-$));for(var se=ce;se<$;se+=188)if(A[se]===71){var ne=!!(A[se+1]&64),re=((A[se+1]&31)<<8)+A[se+2],ue=(A[se+3]&48)>>4,ee=void 0;if(ue>1){if(ee=se+5+A[se+4],ee===se+188)continue}else ee=se+4;switch(re){case M:ne&&(k&&(o=i(k))&&this.parseAVCPES(o,!1),k={data:[],size:0}),k&&(k.data.push(A.subarray(ee,se+188)),k.size+=se+188-ee);break;case U:ne&&(y&&(o=i(y))&&(g.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),y={data:[],size:0}),y&&(y.data.push(A.subarray(ee,se+188)),y.size+=se+188-ee);break;case B:ne&&(x&&(o=i(x))&&this.parseID3PES(o),x={data:[],size:0}),x&&(x.data.push(A.subarray(ee,se+188)),x.size+=se+188-ee);break;case 0:ne&&(ee+=A[ee]+1),Y=this._pmtId=d(A,ee);break;case Y:{ne&&(ee+=A[ee]+1);var ae=l(A,ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);M=ae.avc,M>0&&(E.pid=M),U=ae.audio,U>0&&(g.pid=U,g.isAAC=ae.isAAC),B=ae.id3,B>0&&(O.pid=B),j&&!z&&(b.logger.log("reparse from beginning"),j=!1,se=ce-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:j=!0;break}}else this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=k,g.pesData=y,O.pesData=x;var ge={audioTrack:g,avcTrack:E,id3Track:O,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(ge),ge},T.flush=function(){var A=this.remainderData;this.remainderData=null;var m;return A?m=this.demux(A,-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(A){var m=A.audioTrack,v=A.avcTrack,s=A.id3Track,o=v.pesData,E=m.pesData,g=s.pesData,O;o&&(O=i(o))?(this.parseAVCPES(O,!0),v.pesData=null):v.pesData=o,E&&(O=i(E))?(m.isAAC?this.parseAACPES(O):this.parseMPEGPES(O),m.pesData=null):(E!=null&&E.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=E),g&&(O=i(g))?(this.parseID3PES(O),s.pesData=null):s.pesData=g},T.demuxSampleAes=function(A,m,v){var s=this.demux(A,v,!0,!this.config.progressive),o=this.sampleAes=new F.default(this.observer,this.config,m);return this.decrypt(s,o)},T.decrypt=function(A,m){return new Promise(function(v){var s=A.audioTrack,o=A.avcTrack;s.samples&&s.isAAC?m.decryptAacSamples(s.samples,0,function(){o.samples?m.decryptAvcSamples(o.samples,0,0,function(){v(A)}):v(A)}):o.samples&&m.decryptAvcSamples(o.samples,0,0,function(){v(A)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(A,m){var v=this,s=this._avcTrack,o=this.parseAVCNALu(A.data),E=!1,g=this.avcSample,O,M=!1;A.data=null,g&&o.length&&!s.audFound&&(u(g,s),g=this.avcSample=a(!1,A.pts,A.dts,"")),o.forEach(function(k){switch(k.type){case 1:{O=!0,g||(g=v.avcSample=a(!0,A.pts,A.dts,"")),E&&(g.debug+="NDR "),g.frame=!0;var U=k.data;if(M&&U.length>4){var B=new N.default(U).readSliceType();(B===2||B===4||B===7||B===9)&&(g.key=!0)}break}case 5:O=!0,g||(g=v.avcSample=a(!0,A.pts,A.dts,"")),E&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{O=!0,E&&g&&(g.debug+="SEI ");var y=new N.default(S(k.data));y.readUByte();for(var x=0,j=0,z=!1,Y=0;!z&&y.bytesAvailable>1;){x=0;do Y=y.readUByte(),x+=Y;while(Y===255);j=0;do Y=y.readUByte(),j+=Y;while(Y===255);if(x===4&&y.bytesAvailable!==0){z=!0;var $=y.readUByte();if($===181){var ce=y.readUShort();if(ce===49){var se=y.readUInt();if(se===1195456820){var ne=y.readUByte();if(ne===3){for(var re=y.readUByte(),ue=y.readUByte(),ee=31&re,ae=[re,ue],ge=0;ge<ee;ge++)ae.push(y.readUByte()),ae.push(y.readUByte()),ae.push(y.readUByte());c(v._txtTrack.samples,{type:3,pts:A.pts,bytes:ae})}}}}}else if(x===5&&y.bytesAvailable!==0){if(z=!0,j>16){for(var Le=[],ke=0;ke<16;ke++)Le.push(y.readUByte().toString(16)),(ke===3||ke===5||ke===7||ke===9)&&Le.push("-");for(var De=j-16,Ue=new Uint8Array(De),Ie=0;Ie<De;Ie++)Ue[Ie]=y.readUByte();c(v._txtTrack.samples,{pts:A.pts,payloadType:x,uuid:Le.join(""),userData:Object(W.utf8ArrayToStr)(Ue),userDataBytes:Ue})}}else if(j<y.bytesAvailable)for(var Re=0;Re<j;Re++)y.readUByte()}break}case 7:if(O=!0,M=!0,E&&g&&(g.debug+="SPS "),!s.sps){var Ve=new N.default(k.data),$e=Ve.readSPS();s.width=$e.width,s.height=$e.height,s.pixelRatio=$e.pixelRatio,s.sps=[k.data],s.duration=v._duration;for(var Ze=k.data.subarray(1,4),Qe="avc1.",Ke=0;Ke<3;Ke++){var st=Ze[Ke].toString(16);st.length<2&&(st="0"+st),Qe+=st}s.codec=Qe}break;case 8:O=!0,E&&g&&(g.debug+="PPS "),s.pps||(s.pps=[k.data]);break;case 9:O=!1,s.audFound=!0,g&&u(g,s),g=v.avcSample=a(!1,A.pts,A.dts,E?"AUD ":"");break;case 12:O=!1;break;default:O=!1,g&&(g.debug+="unknown NAL "+k.type+" ");break}if(g&&O){var it=g.units;it.push(k)}}),m&&g&&(u(g,s),this.avcSample=null)},T.getLastNalUnit=function(){var A,m=this.avcSample,v;if(!m||m.units.length===0){var s=this._avcTrack.samples;m=s[s.length-1]}if((A=m)!==null&&A!==void 0&&A.units){var o=m.units;v=o[o.length-1]}return v},T.parseAVCNALu=function(A){var m=A.byteLength,v=this._avcTrack,s=v.naluState||0,o=s,E=[],g=0,O,M,k,U=-1,B=0;for(s===-1&&(U=0,B=A[0]&31,s=0,g=1);g<m;){if(O=A[g++],!s){s=O?0:1;continue}if(s===1){s=O?0:2;continue}if(!O)s=3;else if(O===1){if(U>=0){var y={data:A.subarray(U,g-s-1),type:B};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))),M=g-s-1,M>0)){var j=new Uint8Array(x.data.byteLength+M);j.set(x.data,0),j.set(A.subarray(0,M),x.data.byteLength),x.data=j,x.state=0}}g<m?(k=A[g]&31,U=g,B=k,s=0):s=-1}else s=0}if(U>=0&&s>=0){var z={data:A.subarray(U,m),type:B,state:s};E.push(z)}if(E.length===0){var Y=this.getLastNalUnit();if(Y){var $=new Uint8Array(Y.data.byteLength+A.byteLength);$.set(Y.data,0),$.set(A,Y.data.byteLength),Y.data=$}}return v.naluState=s,E},T.parseAACPES=function(A){var m=0,v=this._audioTrack,s=this.aacOverFlow,o=A.data;if(s){this.aacOverFlow=null;var E=s.sample.unit.byteLength,g=Math.min(s.missing,E),O=E-g;s.sample.unit.set(o.subarray(0,g),O),v.samples.push(s.sample),m=s.missing}var M,k;for(M=m,k=o.length;M<k-1&&!K.isHeader(o,M);M++);if(M!==m){var U,B;if(M<k-1?(U="AAC PES did not start with ADTS header,offset:"+M,B=!1):(U="no ADTS header found in AAC PES",B=!0),b.logger.warn("parsing error:"+U),this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:B,reason:U}),B)return}K.initTrackConfig(v,this.observer,o,M,this.audioCodec);var y;if(A.pts!==void 0)y=A.pts;else if(s){var x=K.getFrameDuration(v.samplerate);y=s.sample.pts+x}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var j=0;M<k;)if(K.isHeader(o,M)){if(M+5<k){var z=K.appendFrame(v,o,M,y,j);if(z)if(z.missing)this.aacOverFlow=z;else{M+=z.length,j++;continue}}break}else M++},T.parseMPEGPES=function(A){var m=A.data,v=m.length,s=0,o=0,E=A.pts;if(E===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<v;)if(L.isHeader(m,o)){var g=L.appendFrame(this._audioTrack,m,o,E,s);if(g)o+=g.length,s++;else break}else o++},T.parseID3PES=function(A){if(A.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},C}();f.minProbeByteLength=188;function a(C,T,w,A){return{key:C,frame:!1,pts:T,dts:w,units:[],debug:A,length:0}}function d(C,T){return(C[T+10]&31)<<8|C[T+11]}function l(C,T,w,A){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},v=(C[T+1]&15)<<8|C[T+2],s=T+3+v-4,o=(C[T+10]&15)<<8|C[T+11];for(T+=12+o;T<s;){var E=(C[T+1]&31)<<8|C[T+2];switch(C[T]){case 207:if(!A){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=E);break;case 21:m.id3===-1&&(m.id3=E);break;case 219:if(!A){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=E);break;case 3:case 4:w?m.audio===-1&&(m.audio=E,m.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((C[T+3]&15)<<8|C[T+4])+5}return m}function i(C){var T=0,w,A,m,v,s,o=C.data;if(!C||C.size===0)return null;for(;o[0].length<19&&o.length>1;){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)}w=o[0];var g=(w[0]<<16)+(w[1]<<8)+w[2];if(g===1){if(A=(w[4]<<8)+w[5],A&&A>C.size-6)return null;var O=w[7];O&192&&(v=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,O&64?(s=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[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=w[8];var M=m+9;if(C.size<=M)return null;C.size-=M;for(var k=new Uint8Array(C.size),U=0,B=o.length;U<B;U++){w=o[U];var y=w.byteLength;if(M)if(M>y){M-=y;continue}else w=w.subarray(M),y-=M,M=0;k.set(w,T),T+=y}return A&&(A-=m+3),{data:k,pts:v,dts:s,len:A}}return null}function u(C,T){if(C.units.length&&C.frame){if(C.pts===void 0){var w=T.samples,A=w.length;if(A){var m=w[A-1];C.pts=m.pts,C.dts=m.dts}else{T.dropped++;return}}T.samples.push(C)}C.debug.length&&b.logger.log(C.pts+"/"+C.dts+":"+C.debug)}function c(C,T){var w=C.length;if(w>0){if(T.pts>=C[w-1].pts)C.push(T);else for(var A=w-1;A>=0;A--)if(T.pts<C[A].pts){C.splice(A,0,T);break}}else C.push(T)}function S(C){for(var T=C.byteLength,w=[],A=1;A<T-2;)C[A]===0&&C[A+1]===0&&C[A+2]===3?(w.push(A+2),A+=2):A++;if(w.length===0)return C;var m=T-w.length,v=new Uint8Array(m),s=0;for(A=0;A<m;s++,A++)s===w[0]&&(s++,w.shift()),v[A]=C[s];return v}V.default=f},"./src/errors.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"ErrorTypes",function(){return K}),I.d(V,"ErrorDetails",function(){return L});var K;(function(N){N.NETWORK_ERROR="networkError",N.MEDIA_ERROR="mediaError",N.KEY_SYSTEM_ERROR="keySystemError",N.MUX_ERROR="muxError",N.OTHER_ERROR="otherError"})(K||(K={}));var L;(function(N){N.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",N.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",N.KEY_SYSTEM_NO_SESSION="keySystemNoSession",N.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",N.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",N.MANIFEST_LOAD_ERROR="manifestLoadError",N.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",N.MANIFEST_PARSING_ERROR="manifestParsingError",N.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",N.LEVEL_EMPTY_ERROR="levelEmptyError",N.LEVEL_LOAD_ERROR="levelLoadError",N.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",N.LEVEL_SWITCH_ERROR="levelSwitchError",N.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",N.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",N.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",N.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",N.FRAG_LOAD_ERROR="fragLoadError",N.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",N.FRAG_DECRYPT_ERROR="fragDecryptError",N.FRAG_PARSING_ERROR="fragParsingError",N.REMUX_ALLOC_ERROR="remuxAllocError",N.KEY_LOAD_ERROR="keyLoadError",N.KEY_LOAD_TIMEOUT="keyLoadTimeOut",N.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",N.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",N.BUFFER_APPEND_ERROR="bufferAppendError",N.BUFFER_APPENDING_ERROR="bufferAppendingError",N.BUFFER_STALLED_ERROR="bufferStalledError",N.BUFFER_FULL_ERROR="bufferFullError",N.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",N.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",N.INTERNAL_EXCEPTION="internalException",N.INTERNAL_ABORTED="aborted",N.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"Events",function(){return K});var K;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(K||(K={}))},"./src/hls.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return C});var K=I("./node_modules/url-toolkit/src/url-toolkit.js"),L=I.n(K),N=I("./src/loader/playlist-loader.ts"),W=I("./src/loader/key-loader.ts"),F=I("./src/controller/id3-track-controller.ts"),R=I("./src/controller/latency-controller.ts"),D=I("./src/controller/level-controller.ts"),b=I("./src/controller/fragment-tracker.ts"),p=I("./src/controller/stream-controller.ts"),_=I("./src/is-supported.ts"),f=I("./src/utils/logger.ts"),a=I("./src/config.ts"),d=I("./node_modules/eventemitter3/index.js"),l=I.n(d),i=I("./src/events.ts"),u=I("./src/errors.ts");function c(T,w){for(var A=0;A<w.length;A++){var m=w[A];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function S(T,w,A){return w&&c(T.prototype,w),A&&c(T,A),T}var C=function(){T.isSupported=function(){return Object(_.isSupported)()};function T(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var m=this.config=Object(a.mergeConfig)(T.DefaultConfig,A);this.userConfig=A,Object(f.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(a.enableStreamingMode)(m);var v=m.abrController,s=m.bufferController,o=m.capLevelController,E=m.fpsController,g=this.abrController=new v(this),O=this.bufferController=new s(this),M=this.capLevelController=new o(this),k=new E(this),U=new N.default(this),B=new W.default(this),y=new F.default(this),x=this.levelController=new D.default(this),j=new b.FragmentTracker(this),z=this.streamController=new p.default(this,j);M.setStreamController(z),k.setStreamController(z);var Y=[x,z];this.networkControllers=Y;var $=[U,B,g,O,M,k,y,j];this.audioTrackController=this.createController(m.audioTrackController,null,Y),this.createController(m.audioStreamController,j,Y),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,Y),this.createController(m.subtitleStreamController,j,Y),this.createController(m.timelineController,null,$),this.emeController=this.createController(m.emeController,null,$),this.cmcdController=this.createController(m.cmcdController,null,$),this.latencyController=this.createController(R.default,null,$),this.coreComponents=$}var w=T.prototype;return w.createController=function(m,v,s){if(m){var o=v?new m(this,v):new m(this);return s&&s.push(o),o}return null},w.on=function(m,v,s){s===void 0&&(s=this),this._emitter.on(m,v,s)},w.once=function(m,v,s){s===void 0&&(s=this),this._emitter.once(m,v,s)},w.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},w.off=function(m,v,s,o){s===void 0&&(s=this),this._emitter.off(m,v,s,o)},w.listeners=function(m){return this._emitter.listeners(m)},w.emit=function(m,v,s){return this._emitter.emit(m,v,s)},w.trigger=function(m,v){if(this.config.debug)return this.emit(m,m,v);try{return this.emit(m,m,v)}catch(s){f.logger.error("An internal error happened while handling event "+m+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(i.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:s})}return!1},w.listenerCount=function(m){return this._emitter.listenerCount(m)},w.destroy=function(){f.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},w.attachMedia=function(m){f.logger.log("attachMedia"),this._media=m,this.trigger(i.Events.MEDIA_ATTACHING,{media:m})},w.detachMedia=function(){f.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(m){this.stopLoad();var v=this.media,s=this.url,o=this.url=K.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});f.logger.log("loadSource:"+o),v&&s&&s!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(v)),this.trigger(i.Events.MANIFEST_LOADING,{url:m})},w.startLoad=function(m){m===void 0&&(m=-1),f.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(v){v.startLoad(m)})},w.stopLoad=function(){f.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},w.swapAudioCodec=function(){f.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){f.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},w.removeLevel=function(m,v){v===void 0&&(v=0),this.levelController.removeLevel(m,v)},S(T,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){f.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){f.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){f.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){f.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){f.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var v=!!m;v!==this.config.capLevelToPlayerSize&&(v?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=v)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(f.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,v=this.config.minAutoBitrate;if(!m)return 0;for(var s=m.length,o=0;o<s;o++)if(m[o].maxBitrate>v)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 i.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:a.hlsDefaultConfig},set:function(m){T.defaultConfig=m}}]),T}();C.defaultConfig=void 0},"./src/is-supported.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"isSupported",function(){return N}),I.d(V,"changeTypeSupported",function(){return W});var K=I("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function N(){var F=Object(K.getMediaSource)();if(!F)return!1;var R=L(),D=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!R||R.prototype&&typeof R.prototype.appendBuffer=="function"&&typeof R.prototype.remove=="function";return!!D&&!!b}function W(){var F,R=L();return typeof(R==null||((F=R.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return f}),I.d(V,"LoadError",function(){return d});var K=I("./src/polyfills/number.ts"),L=I("./src/errors.ts");function N(l,i){l.prototype=Object.create(i.prototype),l.prototype.constructor=l,b(l,i)}function W(l){var i=typeof Map=="function"?new Map:void 0;return W=function(c){if(c===null||!D(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(c))return i.get(c);i.set(c,S)}function S(){return F(c,arguments,p(this).constructor)}return S.prototype=Object.create(c.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b(S,c)},W(l)}function F(l,i,u){return R()?F=Reflect.construct:F=function(S,C,T){var w=[null];w.push.apply(w,C);var A=Function.bind.apply(S,w),m=new A;return T&&b(m,T.prototype),m},F.apply(null,arguments)}function R(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function D(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function b(l,i){return b=Object.setPrototypeOf||function(c,S){return c.__proto__=S,c},b(l,i)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},p(l)}var _=Math.pow(2,17),f=function(){function l(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var i=l.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(c,S){var C=this,T=c.url;if(!T)return Promise.reject(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var w=this.config,A=w.fLoader,m=w.loader;return new Promise(function(v,s){C.loader&&C.loader.destroy();var o=C.loader=c.loader=A?new A(w):new m(w),E=a(c),g={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:_};c.stats=o.stats,o.load(E,g,{onSuccess:function(M,k,U,B){C.resetLoader(c,o),v({frag:c,part:null,payload:M.data,networkDetails:B})},onError:function(M,k,U){C.resetLoader(c,o),s(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:M,networkDetails:U}))},onAbort:function(M,k,U){C.resetLoader(c,o),s(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:U}))},onTimeout:function(M,k,U){C.resetLoader(c,o),s(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:U}))},onProgress:function(M,k,U,B){S&&S({frag:c,part:null,payload:U,networkDetails:B})}})})},i.loadPart=function(c,S,C){var T=this;this.abort();var w=this.config,A=w.fLoader,m=w.loader;return new Promise(function(v,s){T.loader&&T.loader.destroy();var o=T.loader=c.loader=A?new A(w):new m(w),E=a(c,S),g={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:_};S.stats=o.stats,o.load(E,g,{onSuccess:function(M,k,U,B){T.resetLoader(c,o),T.updateStatsFromPart(c,S);var y={frag:c,part:S,payload:M.data,networkDetails:B};C(y),v(y)},onError:function(M,k,U){T.resetLoader(c,o),s(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:S,response:M,networkDetails:U}))},onAbort:function(M,k,U){c.stats.aborted=S.stats.aborted,T.resetLoader(c,o),s(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:S,networkDetails:U}))},onTimeout:function(M,k,U){T.resetLoader(c,o),s(new d({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:S,networkDetails:U}))}})})},i.updateStatsFromPart=function(c,S){var C=c.stats,T=S.stats,w=T.total;if(C.loaded+=T.loaded,w){var A=Math.round(c.duration/S.duration),m=Math.min(Math.round(C.loaded/w),A),v=A-m,s=v*Math.round(C.loaded/m);C.total=C.loaded+s}else C.total=Math.max(C.loaded,C.total);var o=C.loading,E=T.loading;o.start?o.first+=E.first-E.start:(o.start=E.start,o.first=E.first),o.end=E.end},i.resetLoader=function(c,S){c.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},l}();function a(l,i){i===void 0&&(i=null);var u=i||l,c={frag:l,part:i,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},S=u.byteRangeStartOffset,C=u.byteRangeEndOffset;return Object(K.isFiniteNumber)(S)&&Object(K.isFiniteNumber)(C)&&(c.rangeStart=S,c.rangeEnd=C),c}var d=function(l){N(i,l);function i(u){for(var c,S=arguments.length,C=new Array(S>1?S-1:0),T=1;T<S;T++)C[T-1]=arguments[T];return c=l.call.apply(l,[this].concat(C))||this,c.data=void 0,c.data=u,c}return i}(W(Error))},"./src/loader/fragment.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"ElementaryStreamTypes",function(){return f}),I.d(V,"BaseSegment",function(){return a}),I.d(V,"Fragment",function(){return d}),I.d(V,"Part",function(){return l});var K=I("./src/polyfills/number.ts"),L=I("./node_modules/url-toolkit/src/url-toolkit.js"),N=I.n(L),W=I("./src/utils/logger.ts"),F=I("./src/loader/level-key.ts"),R=I("./src/loader/load-stats.ts");function D(i,u){i.prototype=Object.create(u.prototype),i.prototype.constructor=i,b(i,u)}function b(i,u){return b=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},b(i,u)}function p(i,u){for(var c=0;c<u.length;c++){var S=u[c];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function _(i,u,c){return u&&p(i.prototype,u),c&&p(i,c),i}var f;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(f||(f={}));var a=function(){function i(c){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[f.AUDIO]=null,S[f.VIDEO]=null,S[f.AUDIOVIDEO]=null,S),this.baseurl=c}var u=i.prototype;return u.setByteRange=function(S,C){var T=S.split("@",2),w=[];T.length===1?w[0]=C?C.byteRangeEndOffset:0:w[0]=parseInt(T[1]),w[1]=parseInt(T[0])+w[0],this._byteRange=w},_(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),i}(),d=function(i){D(u,i);function u(S,C){var T;return T=i.call(this,C)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new R.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=S,T}var c=u.prototype;return c.createInitializationVector=function(C){for(var T=new Uint8Array(16),w=12;w<16;w++)T[w]=C>>8*(15-w)&255;return T},c.setDecryptDataFromLevelKey=function(C,T){var w=C;return(C==null?void 0:C.method)==="AES-128"&&C.uri&&!C.iv&&(w=F.LevelKey.fromURI(C.uri),w.method=C.method,w.iv=this.createInitializationVector(T),w.keyFormat="identity"),w},c.setElementaryStreamInfo=function(C,T,w,A,m,v){v===void 0&&(v=!1);var s=this.elementaryStreams,o=s[C];if(!o){s[C]={startPTS:T,endPTS:w,startDTS:A,endDTS:m,partial:v};return}o.startPTS=Math.min(o.startPTS,T),o.endPTS=Math.max(o.endPTS,w),o.startDTS=Math.min(o.startDTS,A),o.endDTS=Math.max(o.endDTS,m)},c.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[f.AUDIO]=null,C[f.VIDEO]=null,C[f.AUDIOVIDEO]=null},_(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var C=this.sn;typeof C!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),C=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,C)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(K.isFiniteNumber)(this.programDateTime))return null;var C=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;return!!((C=this.decryptdata)!==null&&C!==void 0&&C.keyFormat&&this.decryptdata.uri)}}]),u}(a),l=function(i){D(u,i);function u(c,S,C,T,w){var A;A=i.call(this,C)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new R.LoadStats,A.duration=c.decimalFloatingPoint("DURATION"),A.gap=c.bool("GAP"),A.independent=c.bool("INDEPENDENT"),A.relurl=c.enumeratedString("URI"),A.fragment=S,A.index=T;var m=c.enumeratedString("BYTERANGE");return m&&A.setByteRange(m,w),w&&(A.fragOffset=w.fragOffset+w.duration),A}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 S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),u}(a)},"./src/loader/key-loader.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return W});var K=I("./src/events.ts"),L=I("./src/errors.ts"),N=I("./src/utils/logger.ts"),W=function(){function F(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var R=F.prototype;return R._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},R._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},R.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var p=this.loaders[b];p&&p.destroy()}this.loaders={}},R.onKeyLoading=function(b,p){var _=p.frag,f=_.type,a=this.loaders[f];if(!_.decryptdata){N.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(a&&(N.logger.warn("abort previous key loader for type:"+f),a.abort()),!d){N.logger.warn("key uri is falsy");return}var i=l.loader,u=_.loader=this.loaders[f]=new i(l);this.decrypturl=d,this.decryptkey=null;var c={url:d,frag:_,responseType:"arraybuffer"},S={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},C={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(c,S,C)}else this.decryptkey&&(_.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:_}))},R.loadsuccess=function(b,p,_){var f=_.frag;if(!f.decryptdata){N.logger.error("after key load, decryptdata unset");return}this.decryptkey=f.decryptdata.key=new Uint8Array(b.data),f.loader=null,delete this.loaders[f.type],this.hls.trigger(K.Events.KEY_LOADED,{frag:f})},R.loaderror=function(b,p){var _=p.frag,f=_.loader;f&&f.abort(),delete this.loaders[_.type],this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:_,response:b})},R.loadtimeout=function(b,p){var _=p.frag,f=_.loader;f&&f.abort(),delete this.loaders[_.type],this.hls.trigger(K.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:_})},F}()},"./src/loader/level-details.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"LevelDetails",function(){return F});var K=I("./src/polyfills/number.ts");function L(R,D){for(var b=0;b<D.length;b++){var p=D[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function N(R,D,b){return D&&L(R.prototype,D),b&&L(R,b),R}var W=10,F=function(){function R(b){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=b}var D=R.prototype;return D.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var _=this.lastPartSn-p.lastPartSn,f=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!f||!!_,this.advanced=this.endSN>p.endSN||_>0||_===0&&f>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},N(R,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(K.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var _=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}}]),R}()},"./src/loader/level-key.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"LevelKey",function(){return F});var K=I("./node_modules/url-toolkit/src/url-toolkit.js"),L=I.n(K);function N(R,D){for(var b=0;b<D.length;b++){var p=D[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function W(R,D,b){return D&&N(R.prototype,D),b&&N(R,b),R}var F=function(){R.fromURL=function(b,p){return new R(b,p)},R.fromURI=function(b){return new R(b)};function R(D,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(K.buildAbsoluteURL)(D,b,{alwaysNormalize:!0}):this._uri=D}return W(R,[{key:"uri",get:function(){return this._uri}}]),R}()},"./src/loader/load-stats.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"LoadStats",function(){return K});var K=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return u});var K=I("./src/polyfills/number.ts"),L=I("./node_modules/url-toolkit/src/url-toolkit.js"),N=I.n(L),W=I("./src/loader/fragment.ts"),F=I("./src/loader/level-details.ts"),R=I("./src/loader/level-key.ts"),D=I("./src/utils/attr-list.ts"),b=I("./src/utils/logger.ts"),p=I("./src/utils/codecs.ts"),_=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,f=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function i(w){var A,m;return l.test((A=(m=L.parseURL(w))===null||m===void 0?void 0:m.path)!=null?A:"")}var u=function(){function w(){}return w.findGroup=function(m,v){for(var s=0;s<m.length;s++){var o=m[s];if(o.id===v)return o}},w.convertAVC1ToAVCOTI=function(m){var v=m.split(".");if(v.length>2){var s=v.shift()+".";return s+=parseInt(v.shift()).toString(16),s+=("000"+parseInt(v.shift()).toString(16)).substr(-4),s}return m},w.resolve=function(m,v){return L.buildAbsoluteURL(v,m,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(m,v){var s=[],o={},E=!1;_.lastIndex=0;for(var g;(g=_.exec(m))!=null;)if(g[1]){var O=new D.AttrList(g[1]),M={attrs:O,bitrate:O.decimalInteger("AVERAGE-BANDWIDTH")||O.decimalInteger("BANDWIDTH"),name:O.NAME,url:w.resolve(g[2],v)},k=O.decimalResolution("RESOLUTION");k&&(M.width=k.width,M.height=k.height),c((O.CODECS||"").split(/[ ,]+/).filter(function(B){return B}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=w.convertAVC1ToAVCOTI(M.videoCodec)),s.push(M)}else if(g[3]){var U=new D.AttrList(g[3]);U["DATA-ID"]&&(E=!0,o[U["DATA-ID"]]=U)}return{levels:s,sessionData:E?o:null}},w.parseMasterPlaylistMedia=function(m,v,s,o){o===void 0&&(o=[]);var E,g=[],O=0;for(f.lastIndex=0;(E=f.exec(m))!==null;){var M=new D.AttrList(E[1]);if(M.TYPE===s){var k={attrs:M,bitrate:0,id:O++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:s,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?w.resolve(M.URI,v):""};if(o.length){var U=w.findGroup(o,k.groupId)||o[0];S(k,U,"audioCodec"),S(k,U,"textCodec")}g.push(k)}}return g},w.parseLevelPlaylist=function(m,v,s,o,E){var g=new F.LevelDetails(v),O=g.fragments,M=null,k=0,U=0,B=0,y=0,x=null,j=new W.Fragment(o,v),z,Y,$,ce=-1,se=!1;for(a.lastIndex=0,g.m3u8=m;(z=a.exec(m))!==null;){se&&(se=!1,j=new W.Fragment(o,v),j.start=B,j.sn=k,j.cc=y,j.level=s,M&&(j.initSegment=M,j.rawProgramDateTime=M.rawProgramDateTime));var ne=z[1];if(ne){j.duration=parseFloat(ne);var re=(" "+z[2]).slice(1);j.title=re||null,j.tagList.push(re?["INF",ne,re]:["INF",ne])}else if(z[3])Object(K.isFiniteNumber)(j.duration)&&(j.start=B,$&&(j.levelkey=$),j.sn=k,j.level=s,j.cc=y,j.urlId=E,O.push(j),j.relurl=(" "+z[3]).slice(1),T(j,x),x=j,B+=j.duration,k++,U=0,se=!0);else if(z[4]){var ue=(" "+z[4]).slice(1);x?j.setByteRange(ue,x):j.setByteRange(ue)}else if(z[5])j.rawProgramDateTime=(" "+z[5]).slice(1),j.tagList.push(["PROGRAM-DATE-TIME",j.rawProgramDateTime]),ce===-1&&(ce=O.length);else{if(z=z[0].match(d),!z){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(Y=1;Y<z.length&&!(typeof z[Y]!="undefined");Y++);var ee=(" "+z[Y]).slice(1),ae=(" "+z[Y+1]).slice(1),ge=z[Y+2]?(" "+z[Y+2]).slice(1):"";switch(ee){case"PLAYLIST-TYPE":g.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":k=g.startSN=parseInt(ae);break;case"SKIP":{var Le=new D.AttrList(ae),ke=Le.decimalInteger("SKIPPED-SEGMENTS");if(Object(K.isFiniteNumber)(ke)){g.skippedSegments=ke;for(var De=ke;De--;)O.unshift(null);k+=ke}var Ue=Le.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ue&&(g.recentlyRemovedDateranges=Ue.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(ae);break;case"VERSION":g.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(ae||ge)&&j.tagList.push(ge?[ae,ge]:[ae]);break;case"DIS":y++;case"GAP":j.tagList.push([ee]);break;case"BITRATE":j.tagList.push([ee,ae]);break;case"DISCONTINUITY-SEQ":y=parseInt(ae);break;case"KEY":{var Ie,Re=new D.AttrList(ae),Ve=Re.enumeratedString("METHOD"),$e=Re.URI,Ze=Re.hexadecimalInteger("IV"),Qe=Re.enumeratedString("KEYFORMATVERSIONS"),Ke=Re.enumeratedString("KEYID"),st=(Ie=Re.enumeratedString("KEYFORMAT"))!=null?Ie:"identity",it=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(it.indexOf(st)>-1){b.logger.warn("Keyformat "+st+" is not supported from the manifest");continue}else if(st!=="identity")continue;Ve&&($=R.LevelKey.fromURL(v,$e),$e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ve)>=0&&($.method=Ve,$.keyFormat=st,Ke&&($.keyID=Ke),Qe&&($.keyFormatVersions=Qe),$.iv=Ze));break}case"START":{var ut=new D.AttrList(ae),Je=ut.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(Je)&&(g.startTimeOffset=Je);break}case"MAP":{var _t=new D.AttrList(ae);j.relurl=_t.URI,_t.BYTERANGE&&j.setByteRange(_t.BYTERANGE),j.level=s,j.sn="initSegment",$&&(j.levelkey=$),j.initSegment=null,M=j,se=!0;break}case"SERVER-CONTROL":{var gt=new D.AttrList(ae);g.canBlockReload=gt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=gt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&>.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=gt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=gt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var mt=new D.AttrList(ae);g.partTarget=mt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var We=g.partList;We||(We=g.partList=[]);var Et=U>0?We[We.length-1]:void 0,ht=U++,Ne=new W.Part(new D.AttrList(ae),j,v,ht,Et);We.push(Ne),j.duration+=Ne.duration;break}case"PRELOAD-HINT":{var nt=new D.AttrList(ae);g.preloadHint=nt;break}case"RENDITION-REPORT":{var me=new D.AttrList(ae);g.renditionReports=g.renditionReports||[],g.renditionReports.push(me);break}default:b.logger.warn("line parsed but not handled: "+z);break}}}x&&!x.relurl?(O.pop(),B-=x.duration,g.partList&&(g.fragmentHint=x)):g.partList&&(T(j,x),j.cc=y,g.fragmentHint=j);var ve=O.length,le=O[0],q=O[ve-1];if(B+=g.skippedSegments*g.targetduration,B>0&&ve&&q){g.averagetargetduration=B/ve;var ie=q.sn;g.endSN=ie!=="initSegment"?ie:0,le&&(g.startCC=le.cc,le.initSegment||g.fragments.every(function(fe){return fe.relurl&&i(fe.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),j=new W.Fragment(o,v),j.relurl=q.relurl,j.level=s,j.sn="initSegment",le.initSegment=j,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(B+=g.fragmentHint.duration),g.totalduration=B,g.endCC=y,ce>0&&C(O,ce),g},w}();function c(w,A){["video","audio","text"].forEach(function(m){var v=w.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});A[m+"Codec"]=s.length>0?s[0]:v[0],w=w.filter(function(o){return v.indexOf(o)===-1})}}),A.unknownCodecs=w}function S(w,A,m){var v=A[m];v&&(w[m]=v)}function C(w,A){for(var m=w[A],v=A;v--;){var s=w[v];if(!s)return;s.programDateTime=m.programDateTime-s.duration*1e3,m=s}}function T(w,A){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):A!=null&&A.programDateTime&&(w.programDateTime=A.endProgramDateTime),Object(K.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/polyfills/number.ts"),L=I("./src/events.ts"),N=I("./src/errors.ts"),W=I("./src/utils/logger.ts"),F=I("./src/utils/mp4-tools.ts"),R=I("./src/loader/m3u8-parser.ts"),D=I("./src/types/loader.ts"),b=I("./src/utils/attr-list.ts");function p(a){var d=a.type;switch(d){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function _(a,d){var l=a.url;return(l===void 0||l.indexOf("data:")===0)&&(l=d.url),l}var f=function(){function a(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var d=a.prototype;return d.registerListeners=function(){var i=this.hls;i.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var i=this.hls;i.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(i){var u=this.hls.config,c=u.pLoader,S=u.loader,C=c||S,T=new C(u);return i.loader=T,this.loaders[i.type]=T,T},d.getInternalLoader=function(i){return this.loaders[i.type]},d.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},d.destroyInternalLoaders=function(){for(var i in this.loaders){var u=this.loaders[i];u&&u.destroy(),this.resetInternalLoader(i)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(i,u){var c=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},d.onLevelLoading=function(i,u){var c=u.id,S=u.level,C=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:null,level:S,responseType:"text",type:D.PlaylistContextType.LEVEL,url:C,deliveryDirectives:T})},d.onAudioTrackLoading=function(i,u){var c=u.id,S=u.groupId,C=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(i,u){var c=u.id,S=u.groupId,C=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:T})},d.load=function(i){var u,c=this.hls.config,S=this.getInternalLoader(i);if(S){var C=S.context;if(C&&C.url===i.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),S.abort()}var T,w,A,m;switch(i.type){case D.PlaylistContextType.MANIFEST:T=c.manifestLoadingMaxRetry,w=c.manifestLoadingTimeOut,A=c.manifestLoadingRetryDelay,m=c.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:T=0,w=c.levelLoadingTimeOut;break;default:T=c.levelLoadingMaxRetry,w=c.levelLoadingTimeOut,A=c.levelLoadingRetryDelay,m=c.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(i),(u=i.deliveryDirectives)!==null&&u!==void 0&&u.part){var v;if(i.type===D.PlaylistContextType.LEVEL&&i.level!==null?v=this.hls.levels[i.level].details:i.type===D.PlaylistContextType.AUDIO_TRACK&&i.id!==null?v=this.hls.audioTracks[i.id].details:i.type===D.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(v=this.hls.subtitleTracks[i.id].details),v){var s=v.partTarget,o=v.targetduration;s&&o&&(w=Math.min(Math.max(s*3,o*.8)*1e3,w))}}var E={timeout:w,maxRetry:T,retryDelay:A,maxRetryDelay:m,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(i,E,g)},d.loadsuccess=function(i,u,c,S){if(S===void 0&&(S=null),c.isSidxRequest){this.handleSidxRequest(i,c),this.handlePlaylistLoaded(i,u,c,S);return}this.resetInternalLoader(c.type);var C=i.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,c,"no EXTM3U delimiter",S);return}u.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,u,c,S):this.handleMasterPlaylist(i,u,c,S)},d.loaderror=function(i,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!1,i)},d.loadtimeout=function(i,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!0)},d.handleMasterPlaylist=function(i,u,c,S){var C=this.hls,T=i.data,w=_(i,c),A=R.default.parseMasterPlaylist(T,w),m=A.levels,v=A.sessionData;if(!m.length){this.handleManifestParsingError(i,c,"no level found in manifest",S);return}var s=m.map(function(k){return{id:k.attrs.AUDIO,audioCodec:k.audioCodec}}),o=m.map(function(k){return{id:k.attrs.SUBTITLES,textCodec:k.textCodec}}),E=R.default.parseMasterPlaylistMedia(T,w,"AUDIO",s),g=R.default.parseMasterPlaylistMedia(T,w,"SUBTITLES",o),O=R.default.parseMasterPlaylistMedia(T,w,"CLOSED-CAPTIONS");if(E.length){var M=E.some(function(k){return!k.url});!M&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(W.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:""}))}C.trigger(L.Events.MANIFEST_LOADED,{levels:m,audioTracks:E,subtitles:g,captions:O,url:w,stats:u,networkDetails:S,sessionData:v})},d.handleTrackOrLevelPlaylist=function(i,u,c,S){var C=this.hls,T=c.id,w=c.level,A=c.type,m=_(i,c),v=Object(K.isFiniteNumber)(T)?T:0,s=Object(K.isFiniteNumber)(w)?w:v,o=p(c),E=R.default.parseLevelPlaylist(i.data,m,s,o,v);if(!E.fragments.length){C.trigger(L.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.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(A===D.PlaylistContextType.MANIFEST){var g={attrs:new b.AttrList({}),bitrate:0,details:E,name:"",url:m};C.trigger(L.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:m,stats:u,networkDetails:S,sessionData:null})}if(u.parsing.end=performance.now(),E.needSidxRanges){var O,M=(O=E.fragments[0].initSegment)===null||O===void 0?void 0:O.url;this.load({url:M,isSidxRequest:!0,type:A,level:w,levelDetails:E,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=E,this.handlePlaylistLoaded(i,u,c,S)},d.handleSidxRequest=function(i,u){var c=Object(F.parseSegmentIndex)(new Uint8Array(i.data));if(!c)return;var S=c.references,C=u.levelDetails;S.forEach(function(T,w){var A=T.info,m=C.fragments[w];m.byteRange.length===0&&m.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),m.initSegment&&m.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(i,u,c,S){this.hls.trigger(L.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===D.PlaylistContextType.MANIFEST,url:i.url,reason:c,response:i,context:u,networkDetails:S})},d.handleNetworkError=function(i,u,c,S){c===void 0&&(c=!1),W.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var C=N.ErrorDetails.UNKNOWN,T=!1,w=this.getInternalLoader(i);switch(i.type){case D.PlaylistContextType.MANIFEST:C=c?N.ErrorDetails.MANIFEST_LOAD_TIMEOUT:N.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case D.PlaylistContextType.LEVEL:C=c?N.ErrorDetails.LEVEL_LOAD_TIMEOUT:N.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.AUDIO_TRACK:C=c?N.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:C=c?N.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:N.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}w&&this.resetInternalLoader(i.type);var A={type:N.ErrorTypes.NETWORK_ERROR,details:C,fatal:T,url:i.url,loader:w,context:i,networkDetails:u};S&&(A.response=S),this.hls.trigger(L.Events.ERROR,A)},d.handlePlaylistLoaded=function(i,u,c,S){var C=c.type,T=c.level,w=c.id,A=c.groupId,m=c.loader,v=c.levelDetails,s=c.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(i,c,"invalid target duration",S);return}if(!m)return;v.live&&(m.getCacheAge&&(v.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(C){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:v,level:T||0,id:w||0,stats:u,networkDetails:S,deliveryDirectives:s});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:v,id:w||0,groupId:A||"",stats:u,networkDetails:S,deliveryDirectives:s});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:v,id:w||0,groupId:A||"",stats:u,networkDetails:S,deliveryDirectives:s});break}},a}();V.default=f},"./src/polyfills/number.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"isFiniteNumber",function(){return K}),I.d(V,"MAX_SAFE_INTEGER",function(){return L});var K=Number.isFinite||function(N){return typeof N=="number"&&isFinite(N)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,V,I){"use strict";I.r(V);var K=function(){function L(){}return L.getSilentFrame=function(W,F){switch(W){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(F===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(F===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(F===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(F===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},L}();V.default=K},"./src/remux/mp4-generator.ts":function(oe,V,I){"use strict";I.r(V);var K=Math.pow(2,32)-1,L=function(){function N(){}return N.init=function(){N.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var F;for(F in N.types)N.types.hasOwnProperty(F)&&(N.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var R=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=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]);N.HDLR_TYPES={video:R,audio:D};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]);N.STTS=N.STSC=N.STCO=p,N.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),N.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),N.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var _=new Uint8Array([105,115,111,109]),f=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);N.FTYP=N.box(N.types.ftyp,_,a,_,f),N.DINF=N.box(N.types.dinf,N.box(N.types.dref,b))},N.box=function(F){for(var R=8,D=arguments.length,b=new Array(D>1?D-1:0),p=1;p<D;p++)b[p-1]=arguments[p];for(var _=b.length,f=_;_--;)R+=b[_].byteLength;var a=new Uint8Array(R);for(a[0]=R>>24&255,a[1]=R>>16&255,a[2]=R>>8&255,a[3]=R&255,a.set(F,4),_=0,R=8;_<f;_++)a.set(b[_],R),R+=b[_].byteLength;return a},N.hdlr=function(F){return N.box(N.types.hdlr,N.HDLR_TYPES[F])},N.mdat=function(F){return N.box(N.types.mdat,F)},N.mdhd=function(F,R){R*=F;var D=Math.floor(R/(K+1)),b=Math.floor(R%(K+1));return N.box(N.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,D>>24,D>>16&255,D>>8&255,D&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},N.mdia=function(F){return N.box(N.types.mdia,N.mdhd(F.timescale,F.duration),N.hdlr(F.type),N.minf(F))},N.mfhd=function(F){return N.box(N.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},N.minf=function(F){return F.type==="audio"?N.box(N.types.minf,N.box(N.types.smhd,N.SMHD),N.DINF,N.stbl(F)):N.box(N.types.minf,N.box(N.types.vmhd,N.VMHD),N.DINF,N.stbl(F))},N.moof=function(F,R,D){return N.box(N.types.moof,N.mfhd(F),N.traf(D,R))},N.moov=function(F){for(var R=F.length,D=[];R--;)D[R]=N.trak(F[R]);return N.box.apply(null,[N.types.moov,N.mvhd(F[0].timescale,F[0].duration)].concat(D).concat(N.mvex(F)))},N.mvex=function(F){for(var R=F.length,D=[];R--;)D[R]=N.trex(F[R]);return N.box.apply(null,[N.types.mvex].concat(D))},N.mvhd=function(F,R){R*=F;var D=Math.floor(R/(K+1)),b=Math.floor(R%(K+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,D>>24,D>>16&255,D>>8&255,D&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 N.box(N.types.mvhd,p)},N.sdtp=function(F){var R=F.samples||[],D=new Uint8Array(4+R.length),b,p;for(b=0;b<R.length;b++)p=R[b].flags,D[b+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return N.box(N.types.sdtp,D)},N.stbl=function(F){return N.box(N.types.stbl,N.stsd(F),N.box(N.types.stts,N.STTS),N.box(N.types.stsc,N.STSC),N.box(N.types.stsz,N.STSZ),N.box(N.types.stco,N.STCO))},N.avc1=function(F){var R=[],D=[],b,p,_;for(b=0;b<F.sps.length;b++)p=F.sps[b],_=p.byteLength,R.push(_>>>8&255),R.push(_&255),R=R.concat(Array.prototype.slice.call(p));for(b=0;b<F.pps.length;b++)p=F.pps[b],_=p.byteLength,D.push(_>>>8&255),D.push(_&255),D=D.concat(Array.prototype.slice.call(p));var f=N.box(N.types.avcC,new Uint8Array([1,R[3],R[4],R[5],252|3,224|F.sps.length].concat(R).concat([F.pps.length]).concat(D))),a=F.width,d=F.height,l=F.pixelRatio[0],i=F.pixelRatio[1];return N.box(N.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,a&255,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]),f,N.box(N.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),N.box(N.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,i>>24,i>>16&255,i>>8&255,i&255])))},N.esds=function(F){var R=F.config.length;return new Uint8Array([0,0,0,0,3,23+R,0,1,0,4,15+R,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([R]).concat(F.config).concat([6,1,2]))},N.mp4a=function(F){var R=F.samplerate;return N.box(N.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,R>>8&255,R&255,0,0]),N.box(N.types.esds,N.esds(F)))},N.mp3=function(F){var R=F.samplerate;return N.box(N.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,R>>8&255,R&255,0,0]))},N.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?N.box(N.types.stsd,N.STSD,N.mp3(F)):N.box(N.types.stsd,N.STSD,N.mp4a(F)):N.box(N.types.stsd,N.STSD,N.avc1(F))},N.tkhd=function(F){var R=F.id,D=F.duration*F.timescale,b=F.width,p=F.height,_=Math.floor(D/(K+1)),f=Math.floor(D%(K+1));return N.box(N.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,R>>24&255,R>>16&255,R>>8&255,R&255,0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,f>>24,f>>16&255,f>>8&255,f&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]))},N.traf=function(F,R){var D=N.sdtp(F),b=F.id,p=Math.floor(R/(K+1)),_=Math.floor(R%(K+1));return N.box(N.types.traf,N.box(N.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),N.box(N.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,_>>24,_>>16&255,_>>8&255,_&255])),N.trun(F,D.length+16+20+8+16+8+8),D)},N.trak=function(F){return F.duration=F.duration||4294967295,N.box(N.types.trak,N.tkhd(F),N.mdia(F))},N.trex=function(F){var R=F.id;return N.box(N.types.trex,new Uint8Array([0,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},N.trun=function(F,R){var D=F.samples||[],b=D.length,p=12+16*b,_=new Uint8Array(p),f,a,d,l,i,u;for(R+=8+p,_.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,R>>>24&255,R>>>16&255,R>>>8&255,R&255],0),f=0;f<b;f++)a=D[f],d=a.duration,l=a.size,i=a.flags,u=a.cts,_.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*f);return N.box(N.types.trun,_)},N.initSegment=function(F){N.types||N.init();var R=N.moov(F),D=new Uint8Array(N.FTYP.byteLength+R.byteLength);return D.set(N.FTYP),D.set(R,N.FTYP.byteLength),D},N}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,V.default=L},"./src/remux/mp4-remuxer.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return u}),I.d(V,"normalizePts",function(){return c});var K=I("./src/polyfills/number.ts"),L=I("./src/remux/aac-helper.ts"),N=I("./src/remux/mp4-generator.ts"),W=I("./src/events.ts"),F=I("./src/errors.ts"),R=I("./src/utils/logger.ts"),D=I("./src/types/loader.ts"),b=I("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(w){for(var A=1;A<arguments.length;A++){var m=arguments[A];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(w[v]=m[v])}return w},p.apply(this,arguments)}var _=10*1e3,f=1024,a=1152,d=null,l=null,i=!1,u=function(){function w(m,v,s,o){if(o===void 0&&(o=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=m,this.config=v,this.typeSupported=s,this.ISGenerated=!1,d===null){var E=navigator.userAgent||"",g=E.match(/Chrome\/(\d+)/i);d=g?parseInt(g[1]):0}if(l===null){var O=navigator.userAgent.match(/Safari\/(\d+)/i);l=O?parseInt(O[1]):0}i=!!d&&d<75||!!l&&l<600}var A=w.prototype;return A.destroy=function(){},A.resetTimeStamp=function(v){R.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=v},A.resetNextTimestamp=function(){R.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){R.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(v){var s=!1,o=v.reduce(function(E,g){var O=g.pts-E;return O<-4294967296?(s=!0,c(E,g.pts)):O>0?E:g.pts},v[0].pts);return s&&R.logger.debug("PTS rollover detected"),o},A.remux=function(v,s,o,E,g,O,M,k){var U,B,y,x,j,z,Y=g,$=g,ce=v.pid>-1,se=s.pid>-1,ne=s.samples.length,re=v.samples.length>0,ue=ne>1,ee=(!ce||re)&&(!se||ue)||this.ISGenerated||M;if(ee){this.ISGenerated||(y=this.generateIS(v,s,g));var ae=this.isVideoContiguous,ge=-1;if(ue&&(ge=S(s.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,ge>0){R.logger.warn("[mp4-remuxer]: Dropped "+ge+" out of "+ne+" video samples due to a missing keyframe");var Le=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(ge),s.dropped+=ge,$+=(s.samples[0].pts-Le)/(s.timescale||9e4)}else ge===-1&&(R.logger.warn("[mp4-remuxer]: No keyframe found out of "+ne+" video samples"),z=!1);if(this.ISGenerated){if(re&&ue){var ke=this.getVideoStartPts(s.samples),De=c(v.samples[0].pts,ke)-ke,Ue=De/s.inputTimeScale;Y+=Math.max(0,Ue),$+=Math.max(0,-Ue)}if(re){if(v.samplerate||(R.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),y=this.generateIS(v,s,g)),B=this.remuxAudio(v,Y,this.isAudioContiguous,O,se||ue||k===D.PlaylistLevelType.AUDIO?$:void 0),ue){var Ie=B?B.endPTS-B.startPTS:0;s.inputTimeScale||(R.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),y=this.generateIS(v,s,g)),U=this.remuxVideo(s,$,ae,Ie)}}else ue&&(U=this.remuxVideo(s,$,ae,0));U&&(U.firstKeyFrame=ge,U.independent=ge!==-1)}}return this.ISGenerated&&(o.samples.length&&(j=this.remuxID3(o,g)),E.samples.length&&(x=this.remuxText(E,g))),{audio:B,video:U,initSegment:y,independent:z,text:x,id3:j}},A.generateIS=function(v,s,o){var E=v.samples,g=s.samples,O=this.typeSupported,M={},k=!Object(K.isFiniteNumber)(this._initPTS),U="audio/mp4",B,y,x;if(k&&(B=y=Infinity),v.config&&E.length&&(v.timescale=v.samplerate,v.isAAC||(O.mpeg?(U="audio/mpeg",v.codec=""):O.mp3&&(v.codec="mp3")),M.audio={id:"audio",container:U,codec:v.codec,initSegment:!v.isAAC&&O.mpeg?new Uint8Array(0):N.default.initSegment([v]),metadata:{channelCount:v.channelCount}},k&&(x=v.inputTimeScale,B=y=E[0].pts-Math.round(x*o))),s.sps&&s.pps&&g.length&&(s.timescale=s.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:N.default.initSegment([s]),metadata:{width:s.width,height:s.height}},k)){x=s.inputTimeScale;var j=this.getVideoStartPts(g),z=Math.round(x*o);y=Math.min(y,c(g[0].dts,j)-z),B=Math.min(B,j-z)}if(Object.keys(M).length)return this.ISGenerated=!0,k&&(this._initPTS=B,this._initDTS=y),{tracks:M,initPTS:B,timescale:x}},A.remuxVideo=function(v,s,o,E){var g=v.inputTimeScale,O=v.samples,M=[],k=O.length,U=this._initPTS,B=this.nextAvcDts,y=8,x,j,z,Y=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,ce=0,se=!1;if(!o||B===null){var ne=s*g,re=O[0].pts-c(O[0].dts,O[0].pts);B=ne-re}for(var ue=0;ue<k;ue++){var ee=O[ue];if(ee.pts=c(ee.pts-U,B),ee.dts=c(ee.dts-U,B),ee.dts>ee.pts){var ae=9e4*.2;ce=Math.max(Math.min(ce,ee.pts-ee.dts),-1*ae)}ee.dts<O[ue>0?ue-1:ue].dts&&(se=!0)}se&&O.sort(function(In,sn){var Wt=In.dts-sn.dts,Qn=In.pts-sn.pts;return Wt||Qn}),j=O[0].dts,z=O[O.length-1].dts;var ge=Math.round((z-j)/(k-1));if(ce<0){if(ce<ge*-2){R.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-ge,!0)+" ms");for(var Le=ce,ke=0;ke<k;ke++)O[ke].dts=Le=Math.max(Le,O[ke].pts-ge),O[ke].pts=Math.max(Le,O[ke].pts)}else{R.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(ce,!0)+" ms to overcome this issue");for(var De=0;De<k;De++)O[De].dts=O[De].dts+ce}j=O[0].dts}if(o){var Ue=j-B,Ie=Ue>ge,Re=Ue<-1;if(Ie||Re){Ie?R.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(Ue,!0)+" ms ("+Ue+"dts) hole between fragments detected, filling it"):R.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-Ue,!0)+" ms ("+Ue+"dts) overlapping between fragments detected"),j=B;var Ve=O[0].pts-Ue;O[0].dts=j,O[0].pts=Ve,R.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Ve,!0)+"/"+Object(b.toMsFromMpegTsClock)(j,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(Ue,!0)+" ms")}}i&&(j=Math.max(0,j));for(var $e=0,Ze=0,Qe=0;Qe<k;Qe++){for(var Ke=O[Qe],st=Ke.units,it=st.length,ut=0,Je=0;Je<it;Je++)ut+=st[Je].data.length;Ze+=ut,$e+=it,Ke.length=ut,Ke.dts=Math.max(Ke.dts,j),Ke.pts=Math.max(Ke.pts,Ke.dts,0),Y=Math.min(Ke.pts,Y),$=Math.max(Ke.pts,$)}z=O[k-1].dts;var _t=Ze+4*$e+8,gt;try{gt=new Uint8Array(_t)}catch(In){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_t,reason:"fail allocating video mdat "+_t});return}var mt=new DataView(gt.buffer);mt.setUint32(0,_t),gt.set(N.default.types.mdat,4);for(var We=0;We<k;We++){for(var Et=O[We],ht=Et.units,Ne=0,nt=0,me=ht.length;nt<me;nt++){var ve=ht[nt],le=ve.data,q=ve.data.byteLength;mt.setUint32(y,q),y+=4,gt.set(le,y),y+=q,Ne+=4+q}if(We<k-1)x=O[We+1].dts-Et.dts;else{var ie=this.config,fe=Et.dts-O[We>0?We-1:We].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ee=Math.floor(ie.maxBufferHole*g),Oe=(E?Y+E*g:this.nextAudioPts)-Et.pts;Oe>Ee?(x=Oe-fe,x<0&&(x=fe),R.logger.log("[mp4-remuxer]: It is approximately "+Oe/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=fe}else x=fe}var Ge=Math.round(Et.pts-Et.dts);M.push(new C(Et.key,x,Ne,Ge))}if(M.length&&d&&d<70){var tt=M[0].flags;tt.dependsOn=2,tt.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=B=z+x,this.isVideoContiguous=!0;var Tt=N.default.moof(v.sequenceNumber++,j,p({},v,{samples:M})),jt="video",Ft={data1:Tt,data2:gt,startPTS:Y/g,endPTS:($+x)/g,startDTS:j/g,endDTS:B/g,type:jt,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(gt.length,"MDAT length must not be zero"),Ft},A.remuxAudio=function(v,s,o,E,g){var O=v.inputTimeScale,M=v.samplerate?v.samplerate:O,k=O/M,U=v.isAAC?f:a,B=U*k,y=this._initPTS,x=!v.isAAC&&this.typeSupported.mpeg,j=[],z=v.samples,Y=x?0:8,$=this.nextAudioPts||-1,ce=s*O;if(this.isAudioContiguous=o=o||z.length&&$>0&&(E&&Math.abs(ce-$)<9e3||Math.abs(c(z[0].pts-y,ce)-$)<20*B),z.forEach(function(le){le.pts=c(le.pts-y,ce)}),!o||$<0){if(z=z.filter(function(le){return le.pts>=0}),!z.length)return;g===0?$=0:E?$=Math.max(0,ce):$=z[0].pts}if(v.isAAC)for(var se=g!==void 0,ne=this.config.maxAudioFramesDrift,re=0,ue=$;re<z.length;re++){var ee=z[re],ae=ee.pts,ge=ae-ue,Le=Math.abs(1e3*ge/O);if(ge<=-ne*B&&se)re===0&&(R.logger.warn("Audio frame @ "+(ae/O).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ge/O)+" ms."),this.nextAudioPts=$=ue=ae);else if(ge>=ne*B&&Le<_&&se){var ke=Math.round(ge/B);ue=ae-ke*B,ue<0&&(ke--,ue+=B),re===0&&(this.nextAudioPts=$=ue),R.logger.warn("[mp4-remuxer]: Injecting "+ke+" audio frame @ "+(ue/O).toFixed(3)+"s due to "+Math.round(1e3*ge/O)+" ms gap.");for(var De=0;De<ke;De++){var Ue=Math.max(ue,0),Ie=L.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);Ie||(R.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ie=ee.unit.subarray()),z.splice(re,0,{unit:Ie,pts:Ue}),ue+=B,re++}}ee.pts=ue,ue+=B}for(var Re=null,Ve=null,$e,Ze=0,Qe=z.length;Qe--;)Ze+=z[Qe].unit.byteLength;for(var Ke=0,st=z.length;Ke<st;Ke++){var it=z[Ke],ut=it.unit,Je=it.pts;if(Ve!==null){var _t=j[Ke-1];_t.duration=Math.round((Je-Ve)/k)}else if(o&&v.isAAC&&(Je=$),Re=Je,Ze>0){Ze+=Y;try{$e=new Uint8Array(Ze)}catch(le){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ze,reason:"fail allocating audio mdat "+Ze});return}if(!x){var gt=new DataView($e.buffer);gt.setUint32(0,Ze),$e.set(N.default.types.mdat,4)}}else return;$e.set(ut,Y);var mt=ut.byteLength;Y+=mt,j.push(new C(!0,U,mt,0)),Ve=Je}var We=j.length;if(!We)return;var Et=j[j.length-1];this.nextAudioPts=$=Ve+k*Et.duration;var ht=x?new Uint8Array(0):N.default.moof(v.sequenceNumber++,Re/k,p({},v,{samples:j}));v.samples=[];var Ne=Re/O,nt=$/O,me="audio",ve={data1:ht,data2:$e,startPTS:Ne,endPTS:nt,startDTS:Ne,endDTS:nt,type:me,hasAudio:!0,hasVideo:!1,nb:We};return this.isAudioContiguous=!0,console.assert($e.length,"MDAT length must not be zero"),ve},A.remuxEmptyAudio=function(v,s,o,E){var g=v.inputTimeScale,O=v.samplerate?v.samplerate:g,M=g/O,k=this.nextAudioPts,U=(k!==null?k:E.startDTS*g)+this._initDTS,B=E.endDTS*g+this._initDTS,y=M*f,x=Math.ceil((B-U)/y),j=L.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(R.logger.warn("[mp4-remuxer]: remux empty Audio"),!j){R.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var z=[],Y=0;Y<x;Y++){var $=U+Y*y;z.push({unit:j,pts:$,dts:$})}return v.samples=z,this.remuxAudio(v,s,o,!1)},A.remuxID3=function(v,s){var o=v.samples.length;if(!o)return;for(var E=v.inputTimeScale,g=this._initPTS,O=this._initDTS,M=0;M<o;M++){var k=v.samples[M];k.pts=c(k.pts-g,s*E)/E,k.dts=c(k.dts-O,s*E)/E}var U=v.samples;return v.samples=[],{samples:U}},A.remuxText=function(v,s){var o=v.samples.length;if(!o)return;for(var E=v.inputTimeScale,g=this._initPTS,O=0;O<o;O++){var M=v.samples[O];M.pts=c(M.pts-g,s*E)/E}v.samples.sort(function(U,B){return U.pts-B.pts});var k=v.samples;return v.samples=[],{samples:k}},w}();function c(w,A){var m;if(A===null)return w;for(A<w?m=-8589934592:m=8589934592;Math.abs(w-A)>4294967296;)w+=m;return w}function S(w){for(var A=0;A<w.length;A++)if(w[A].key)return A;return-1}var C=function(A,m,v,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=v,this.cts=s,this.flags=new T(A)},T=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/polyfills/number.ts"),L=I("./src/utils/mp4-tools.ts"),N=I("./src/loader/fragment.ts"),W=I("./src/utils/logger.ts"),F=function(){function b(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var p=b.prototype;return p.destroy=function(){},p.resetTimeStamp=function(f){this.initPTS=f,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(f,a,d){this.audioCodec=a,this.videoCodec=d,this.generateInitSegment(f),this.emitInitSegment=!0},p.generateInitSegment=function(f){var a=this.audioCodec,d=this.videoCodec;if(!f||!f.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(L.parseInitSegment)(f);a||(a=D(l.audio,N.ElementaryStreamTypes.AUDIO)),d||(d=D(l.video,N.ElementaryStreamTypes.VIDEO));var i={};l.audio&&l.video?i.audiovideo={container:"video/mp4",codec:a+","+d,initSegment:f,id:"main"}:l.audio?i.audio={container:"audio/mp4",codec:a,initSegment:f,id:"audio"}:l.video?i.video={container:"video/mp4",codec:d,initSegment:f,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},p.remux=function(f,a,d,l,i){var u=this.initPTS,c=this.lastEndDTS,S={audio:void 0,video:void 0,text:l,id3:d,initSegment:void 0};Object(K.isFiniteNumber)(c)||(c=this.lastEndDTS=i||0);var C=a.samples;if(!C||!C.length)return S;var T={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(C),w=this.initData),!w||!w.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(K.isFiniteNumber)(u)||(this.initPTS=T.initPTS=u=R(w,C,c));var A=Object(L.getDuration)(C,w),m=c,v=A+m;Object(L.offsetStartDTS)(w,C,u),A>0?this.lastEndDTS=v:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!w.audio,o=!!w.video,E="";s&&(E+="audio"),o&&(E+="video");var g={data1:C,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:E,hasAudio:s,hasVideo:o,nb:1,dropped:0};return S.audio=g.type==="audio"?g:void 0,S.video=g.type!=="audio"?g:void 0,S.text=l,S.id3=d,S.initSegment=T,S},b}(),R=function(p,_,f){return Object(L.getStartDTS)(p,_)-f};function D(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===N.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=F},"./src/task-loop.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return K});var K=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var N=L.prototype;return N.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},N.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},N.onHandlerDestroyed=function(){},N.hasInterval=function(){return!!this._tickInterval},N.hasNextTick=function(){return!!this._tickTimer},N.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},N.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},N.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},N.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},N.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},N.doTick=function(){},L}()},"./src/types/cmcd.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"CMCDVersion",function(){return K}),I.d(V,"CMCDObjectType",function(){return L}),I.d(V,"CMCDStreamingFormat",function(){return N}),I.d(V,"CMCDStreamType",function(){return W});var K=1,L;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(L||(L={}));var N;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(N||(N={}));var W;(function(F){F.VOD="v",F.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"HlsSkip",function(){return N}),I.d(V,"getSkipValue",function(){return W}),I.d(V,"HlsUrlParameters",function(){return F}),I.d(V,"Level",function(){return R});function K(D,b){for(var p=0;p<b.length;p++){var _=b[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(D,_.key,_)}}function L(D,b,p){return b&&K(D.prototype,b),p&&K(D,p),D}var N;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(N||(N={}));function W(D,b){var p=D.canSkipUntil,_=D.canSkipDateRanges,f=D.endSN,a=b!==void 0?b-f:0;return p&&a<p?_?N.v2:N.Yes:N.No}var F=function(){function D(p,_,f){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=_,this.skip=f}var b=D.prototype;return b.addDirectives=function(_){var f=new self.URL(_);return this.msn!==void 0&&f.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&f.searchParams.set("_HLS_part",this.part.toString()),this.skip&&f.searchParams.set("_HLS_skip",this.skip),f.toString()},D}(),R=function(){function D(b){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return L(D,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var _=p%this.url.length;this._urlId!==_&&(this.details=void 0,this._urlId=_)}}]),D}()},"./src/types/loader.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"PlaylistContextType",function(){return K}),I.d(V,"PlaylistLevelType",function(){return L});var K;(function(N){N.MANIFEST="manifest",N.LEVEL="level",N.AUDIO_TRACK="audioTrack",N.SUBTITLE_TRACK="subtitleTrack"})(K||(K={}));var L;(function(N){N.MAIN="main",N.AUDIO="audio",N.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"ChunkMetadata",function(){return K});var K=function(W,F,R,D,b,p){D===void 0&&(D=0),b===void 0&&(b=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=W,this.sn=F,this.id=R,this.size=D,this.part=b,this.partial=p};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"AttrList",function(){return N});var K=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,N=function(){function W(R){typeof R=="string"&&(R=W.parseAttrList(R));for(var D in R)R.hasOwnProperty(D)&&(this[D]=R[D])}var F=W.prototype;return F.decimalInteger=function(D){var b=parseInt(this[D],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},F.hexadecimalInteger=function(D){if(this[D]){var b=(this[D]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var p=new Uint8Array(b.length/2),_=0;_<b.length/2;_++)p[_]=parseInt(b.slice(_*2,_*2+2),16);return p}else return null},F.hexadecimalIntegerAsNumber=function(D){var b=parseInt(this[D],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},F.decimalFloatingPoint=function(D){return parseFloat(this[D])},F.optionalFloat=function(D,b){var p=this[D];return p?parseFloat(p):b},F.enumeratedString=function(D){return this[D]},F.bool=function(D){return this[D]==="YES"},F.decimalResolution=function(D){var b=K.exec(this[D]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},W.parseAttrList=function(D){var b,p={},_='"';for(L.lastIndex=0;(b=L.exec(D))!==null;){var f=b[2];f.indexOf(_)===0&&f.lastIndexOf(_)===f.length-1&&(f=f.slice(1,-1)),p[b[1]]=f}return p},W}()},"./src/utils/binary-search.ts":function(oe,V,I){"use strict";I.r(V);var K={search:function(N,W){for(var F=0,R=N.length-1,D=null,b=null;F<=R;){D=(F+R)/2|0,b=N[D];var p=W(b);if(p>0)F=D+1;else if(p<0)R=D-1;else return b}return null}};V.default=K},"./src/utils/buffer-helper.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"BufferHelper",function(){return N});var K=I("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},N=function(){function W(){}return W.isBuffered=function(R,D){try{if(R){for(var b=W.getBuffered(R),p=0;p<b.length;p++)if(D>=b.start(p)&&D<=b.end(p))return!0}}catch(_){}return!1},W.bufferInfo=function(R,D,b){try{if(R){var p=W.getBuffered(R),_=[],f;for(f=0;f<p.length;f++)_.push({start:p.start(f),end:p.end(f)});return this.bufferedInfo(_,D,b)}}catch(a){}return{len:0,start:D,end:D,nextStart:void 0}},W.bufferedInfo=function(R,D,b){D=Math.max(0,D),R.sort(function(T,w){var A=T.start-w.start;return A||w.end-T.end});var p=[];if(b)for(var _=0;_<R.length;_++){var f=p.length;if(f){var a=p[f-1].end;R[_].start-a<b?R[_].end>a&&(p[f-1].end=R[_].end):p.push(R[_])}else p.push(R[_])}else p=R;for(var d=0,l,i=D,u=D,c=0;c<p.length;c++){var S=p[c].start,C=p[c].end;if(D+b>=S&&D<C)i=S,u=C,d=u-D;else if(D+b<S){l=S;break}}return{len:d,start:i||0,end:u||0,nextStart:l}},W.getBuffered=function(R){try{return R.buffered}catch(D){return K.logger.log("failed to get media.buffered",D),L}},W}()},"./src/utils/cea-608-parser.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"Row",function(){return u}),I.d(V,"CaptionScreen",function(){return c});var K=I("./src/utils/logger.ts"),L={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},N=function(v){var s=v;return L.hasOwnProperty(v)&&(s=L[v]),String.fromCharCode(s)},W=15,F=100,R={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},_=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],f;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(f||(f={}));var a=function(){function m(){this.time=null,this.verboseLevel=f.ERROR}var v=m.prototype;return v.log=function(o,E){this.verboseLevel>=o&&K.logger.log(this.time+" ["+o+"] "+E)},m}(),d=function(v){for(var s=[],o=0;o<v.length;o++)s.push(v[o].toString(16));return s},l=function(){function m(s,o,E,g,O){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=o||!1,this.italics=E||!1,this.background=g||"black",this.flash=O||!1}var v=m.prototype;return v.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},v.setStyles=function(o){for(var E=["foreground","underline","italics","background","flash"],g=0;g<E.length;g++){var O=E[g];o.hasOwnProperty(O)&&(this[O]=o[O])}},v.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},v.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},v.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},v.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),i=function(){function m(s,o,E,g,O,M){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new l(o,E,g,O,M)}var v=m.prototype;return v.reset=function(){this.uchar=" ",this.penState.reset()},v.setChar=function(o,E){this.uchar=o,this.penState.copy(E)},v.setPenState=function(o){this.penState.copy(o)},v.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},v.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},v.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),u=function(){function m(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<F;o++)this.chars.push(new i);this.logger=s,this.pos=0,this.currPenState=new l}var v=m.prototype;return v.equals=function(o){for(var E=!0,g=0;g<F;g++)if(!this.chars[g].equals(o.chars[g])){E=!1;break}return E},v.copy=function(o){for(var E=0;E<F;E++)this.chars[E].copy(o.chars[E])},v.isEmpty=function(){for(var o=!0,E=0;E<F;E++)if(!this.chars[E].isEmpty()){o=!1;break}return o},v.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(f.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(f.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},v.moveCursor=function(o){var E=this.pos+o;if(o>1)for(var g=this.pos+1;g<E+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(E)},v.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},v.insertChar=function(o){o>=144&&this.backSpace();var E=N(o);if(this.pos>=F){this.logger.log(f.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;E<F;E++)this.chars[E].reset()},v.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},v.clearToEndOfRow=function(){this.clearFromPos(this.pos)},v.getTextString=function(){for(var o=[],E=!0,g=0;g<F;g++){var O=this.chars[g].uchar;O!==" "&&(E=!1),o.push(O)}return E?"":o.join("")},v.setPenStyles=function(o){this.currPenState.setStyles(o);var E=this.chars[this.pos];E.setPenState(this.currPenState)},m}(),c=function(){function m(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<W;o++)this.rows.push(new u(s));this.logger=s,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var v=m.prototype;return v.reset=function(){for(var o=0;o<W;o++)this.rows[o].clear();this.currRow=W-1},v.equals=function(o){for(var E=!0,g=0;g<W;g++)if(!this.rows[g].equals(o.rows[g])){E=!1;break}return E},v.copy=function(o){for(var E=0;E<W;E++)this.rows[E].copy(o.rows[E])},v.isEmpty=function(){for(var o=!0,E=0;E<W;E++)if(!this.rows[E].isEmpty()){o=!1;break}return o},v.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},v.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},v.insertChar=function(o){var E=this.rows[this.currRow];E.insertChar(o)},v.setPen=function(o){var E=this.rows[this.currRow];E.setPenStyles(o)},v.moveCursor=function(o){var E=this.rows[this.currRow];E.moveCursor(o)},v.setCursor=function(o){this.logger.log(f.INFO,"setCursor: "+o);var E=this.rows[this.currRow];E.setCursor(o)},v.setPAC=function(o){this.logger.log(f.INFO,"pacData = "+JSON.stringify(o));var E=o.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var g=0;g<W;g++)this.rows[g].clear();var O=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var k=M.rows[O].cueStartTime,U=this.logger.time;if(k&&U!==null&&k<U)for(var B=0;B<this.nrRollUpRows;B++)this.rows[E-this.nrRollUpRows+B+1].copy(M.rows[O+B])}}this.currRow=E;var y=this.rows[this.currRow];if(o.indent!==null){var x=o.indent,j=Math.max(x-1,0);y.setCursor(o.indent),o.color=y.chars[j].penState.foreground}var z={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(z)},v.setBkgData=function(o){this.logger.log(f.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},v.setRollUpRows=function(o){this.nrRollUpRows=o},v.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(f.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(f.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(o,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(f.INFO,"Rolling up")},v.getDisplayText=function(o){o=o||!1;for(var E=[],g="",O=-1,M=0;M<W;M++){var k=this.rows[M].getTextString();k&&(O=M+1,o?E.push("Row "+O+": '"+k+"'"):E.push(k.trim()))}return E.length>0&&(o?g="["+E.join(" | ")+"]":g=E.join(`
|
|
`)),g},v.getTextAndFormat=function(){return this.rows},m}(),S=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[W-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[W-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(f.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<o.length;E++)this.writeScreen.insertChar(o[E]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(f.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(f.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},v.ccRCL=function(){this.logger.log(f.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},v.ccBS=function(){if(this.logger.log(f.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},v.ccAOF=function(){},v.ccAON=function(){},v.ccDER=function(){this.logger.log(f.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},v.ccRU=function(o){this.logger.log(f.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},v.ccFON=function(){this.logger.log(f.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},v.ccRDC=function(){this.logger.log(f.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},v.ccTR=function(){this.logger.log(f.INFO,"TR"),this.setMode("MODE_TEXT")},v.ccRTD=function(){this.logger.log(f.INFO,"RTD"),this.setMode("MODE_TEXT")},v.ccEDM=function(){this.logger.log(f.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},v.ccCR=function(){this.logger.log(f.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},v.ccENM=function(){this.logger.log(f.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},v.ccEOC=function(){if(this.logger.log(f.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(f.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},v.ccTO=function(o){this.logger.log(f.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},v.ccMIDROW=function(o){var E={flash:!1};if(E.underline=o%2===1,E.italics=o>=46,E.italics)E.foreground="white";else{var g=Math.floor(o/2)-16,O=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=O[g]}this.logger.log(f.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}(),C=function(){function m(s,o,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new a;this.channels=[null,new S(s,o,g),new S(s+1,E,g)],this.cmdHistory=A(),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,O,M,k=!1;this.logger.time=o;for(var U=0;U<E.length;U+=2){if(O=E[U]&127,M=E[U+1]&127,O===0&&M===0)continue;if(this.logger.log(f.DATA,"["+d([E[U],E[U+1]])+"] -> ("+d([O,M])+")"),g=this.parseCmd(O,M),g||(g=this.parseMidrow(O,M)),g||(g=this.parsePAC(O,M)),g||(g=this.parseBackgroundAttributes(O,M)),!g&&(k=this.parseChars(O,M),k)){var B=this.currentChannel;if(B&&B>0){var y=this.channels[B];y.insertChars(k)}else this.logger.log(f.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!k&&this.logger.log(f.WARNING,"Couldn't parse cleaned data "+d([O,M])+" orig: "+d([E[U],E[U+1]]))}},v.parseCmd=function(o,E){var g=this.cmdHistory,O=(o===20||o===28||o===21||o===29)&&E>=32&&E<=47,M=(o===23||o===31)&&E>=33&&E<=35;if(!(O||M))return!1;if(w(o,E,g))return T(null,null,g),this.logger.log(f.DEBUG,"Repeated command ("+d([o,E])+") is dropped"),!0;var k=o===20||o===21||o===23?1:2,U=this.channels[k];return o===20||o===21||o===28||o===29?E===32?U.ccRCL():E===33?U.ccBS():E===34?U.ccAOF():E===35?U.ccAON():E===36?U.ccDER():E===37?U.ccRU(2):E===38?U.ccRU(3):E===39?U.ccRU(4):E===40?U.ccFON():E===41?U.ccRDC():E===42?U.ccTR():E===43?U.ccRTD():E===44?U.ccEDM():E===45?U.ccCR():E===46?U.ccENM():E===47&&U.ccEOC():U.ccTO(E-32),T(o,E,g),this.currentChannel=k,!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(f.ERROR,"Mismatch channel in midrow parsing"),!1;var O=this.channels[g];return O?(O.ccMIDROW(E),this.logger.log(f.DEBUG,"MIDROW ("+d([o,E])+")"),!0):!1}return!1},v.parsePAC=function(o,E){var g,O=this.cmdHistory,M=(o>=17&&o<=23||o>=25&&o<=31)&&E>=64&&E<=127,k=(o===16||o===24)&&E>=64&&E<=95;if(!(M||k))return!1;if(w(o,E,O))return T(null,null,O),!0;var U=o<=23?1:2;E>=64&&E<=95?g=U===1?R[o]:b[o]:g=U===1?D[o]:p[o];var B=this.channels[U];return B?(B.setPAC(this.interpretPAC(g,E)),T(o,E,O),this.currentChannel=U,!0):!1},v.interpretPAC=function(o,E){var g,O={color:null,italics:!1,indent:null,underline:!1,row:o};return E>95?g=E-96:g=E-64,O.underline=(g&1)===1,g<=13?O.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(O.italics=!0,O.color="white"):O.indent=Math.floor((g-16)/2)*4,O},v.parseChars=function(o,E){var g,O=null,M=null;if(o>=25?(g=2,M=o-8):(g=1,M=o),M>=17&&M<=19){var k;M===17?k=E+80:M===18?k=E+112:k=E+144,this.logger.log(f.INFO,"Special char '"+N(k)+"' in channel "+g),O=[k]}else o>=32&&o<=127&&(O=E===0?[o]:[o,E]);if(O){var U=d(O);this.logger.log(f.DEBUG,"Char codes = "+U.join(",")),T(o,E,this.cmdHistory)}return O},v.parseBackgroundAttributes=function(o,E){var g=(o===16||o===24)&&E>=32&&E<=47,O=(o===23||o===31)&&E>=45&&E<=47;if(!(g||O))return!1;var M,k={};o===16||o===24?(M=Math.floor((E-32)/2),k.background=_[M],E%2===1&&(k.background=k.background+"_semi")):E===45?k.background="transparent":(k.foreground="black",E===47&&(k.underline=!0));var U=o<=23?1:2,B=this.channels[U];return B.setBkgData(k),T(o,E,this.cmdHistory),!0},v.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var E=this.channels[o];E&&E.reset()}this.cmdHistory=A()},v.cueSplitAtTime=function(o){for(var E=0;E<this.channels.length;E++){var g=this.channels[E];g&&g.cueSplitAtTime(o)}},m}();function T(m,v,s){s.a=m,s.b=v}function w(m,v,s){return s.a===m&&s.b===v}function A(){return{a:null,b:null}}V.default=C},"./src/utils/codecs.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"isCodecType",function(){return L}),I.d(V,"isCodecSupportedInMp4",function(){return N});var K={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function L(W,F){var R=K[F];return!!R&&R[W.slice(0,4)]===!0}function N(W,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/utils/vttparser.ts"),L=I("./src/utils/webvtt-parser.ts"),N=I("./src/utils/texttrack-utils.ts"),W=/\s/,F={newCue:function(D,b,p,_){for(var f=[],a,d,l,i,u,c=self.VTTCue||self.TextTrackCue,S=0;S<_.rows.length;S++)if(a=_.rows[S],l=!0,i=0,u="",!a.isEmpty()){for(var C=0;C<a.chars.length;C++)W.test(a.chars[C].uchar)&&l?i++:(u+=a.chars[C].uchar,l=!1);a.cueStartTime=b,b===p&&(p+=1e-4),i>=16?i--:i++;var T=Object(K.fixLineBreaks)(u.trim()),w=Object(L.generateCueId)(b,p,T);(!D||!D.cues||!D.cues.getCueById(w))&&(d=new c(b,p,T),d.id=w,d.line=S+1,d.align="left",d.position=10+Math.min(80,Math.floor(i*8/32)*10),f.push(d))}return D&&f.length&&(f.sort(function(A,m){return A.line==="auto"||m.line==="auto"?0:A.line>8&&m.line>8?m.line-A.line:A.line-m.line}),f.forEach(function(A){return Object(N.addCueToTrack)(D,A)})),f}};V.default=F},"./src/utils/discontinuities.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"findFirstFragWithCC",function(){return W}),I.d(V,"shouldAlignOnDiscontinuities",function(){return F}),I.d(V,"findDiscontinuousReferenceFrag",function(){return R}),I.d(V,"adjustSlidingStart",function(){return b}),I.d(V,"alignStream",function(){return p}),I.d(V,"alignPDT",function(){return f}),I.d(V,"alignFragmentByPDTDelta",function(){return a}),I.d(V,"alignMediaPlaylistByPDT",function(){return d});var K=I("./src/polyfills/number.ts"),L=I("./src/utils/logger.ts"),N=I("./src/controller/level-helper.ts");function W(l,i){for(var u=null,c=0,S=l.length;c<S;c++){var C=l[c];if(C&&C.cc===i){u=C;break}}return u}function F(l,i,u){return!!(i.details&&(u.endCC>u.startCC||l&&l.cc<u.startCC))}function R(l,i){var u=l.fragments,c=i.fragments;if(!c.length||!u.length){L.logger.log("No fragments to align");return}var S=W(u,c[0].cc);if(!S||S&&!S.startPTS){L.logger.log("No frag in previous level to align on");return}return S}function D(l,i){if(l){var u=l.start+i;l.start=l.startPTS=u,l.endPTS=u+l.duration}}function b(l,i){for(var u=i.fragments,c=0,S=u.length;c<S;c++)D(u[c],l);i.fragmentHint&&D(i.fragmentHint,l),i.alignedSliding=!0}function p(l,i,u){if(!i)return;_(l,u,i),!u.alignedSliding&&i.details&&f(u,i.details),!u.alignedSliding&&i.details&&!u.skippedSegments&&Object(N.adjustSliding)(i.details,u)}function _(l,i,u){if(F(l,u,i)){var c=R(u.details,i);c&&Object(K.isFiniteNumber)(c.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),b(c.start,i))}}function f(l,i){if(!i.fragments.length||!l.hasProgramDateTime||!i.hasProgramDateTime)return;var u=i.fragments[0].programDateTime,c=l.fragments[0].programDateTime,S=(c-u)/1e3+i.fragments[0].start;S&&Object(K.isFiniteNumber)(S)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(c-u)+"ms, sliding:"+S.toFixed(3)+" "+l.url+" "),b(S,l))}function a(l,i){var u=l.programDateTime;if(!u)return;var c=(u-i)/1e3;l.start=l.startPTS=c,l.endPTS=c+l.duration}function d(l,i){if(!i.fragments.length||!l.hasProgramDateTime||!i.hasProgramDateTime)return;var u=i.fragments[0].programDateTime,c=i.fragments[0].start,S=u-c*1e3;l.fragments.forEach(function(C){a(C,S)}),l.fragmentHint&&a(l.fragmentHint,S),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/utils/ewma.ts"),L=function(){function N(F,R,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new K.default(F),this.fast_=new K.default(R)}var W=N.prototype;return W.update=function(R,D){var b=this.slow_,p=this.fast_;this.slow_.halfLife!==R&&(this.slow_=new K.default(R,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new K.default(D,p.getEstimate(),p.getTotalWeight()))},W.sample=function(R,D){R=Math.max(R,this.minDelayMs_);var b=8*D,p=R/1e3,_=b/p;this.fast_.sample(p,_),this.slow_.sample(p,_)},W.canEstimate=function(){var R=this.fast_;return R&&R.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},N}();V.default=L},"./src/utils/ewma.ts":function(oe,V,I){"use strict";I.r(V);var K=function(){function L(W,F,R){F===void 0&&(F=0),R===void 0&&(R=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=F,this.totalWeight_=R}var N=L.prototype;return N.sample=function(F,R){var D=Math.pow(this.alpha_,F);this.estimate_=R*(1-D)+D*this.estimate_,this.totalWeight_+=F},N.getTotalWeight=function(){return this.totalWeight_},N.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},L}();V.default=K},"./src/utils/fetch-loader.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"fetchSupported",function(){return a});var K=I("./src/polyfills/number.ts"),L=I("./src/loader/load-stats.ts"),N=I("./src/demux/chunk-cache.ts");function W(c,S){c.prototype=Object.create(S.prototype),c.prototype.constructor=c,p(c,S)}function F(c){var S=typeof Map=="function"?new Map:void 0;return F=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 S!="undefined"){if(S.has(T))return S.get(T);S.set(T,w)}function w(){return R(T,arguments,_(this).constructor)}return w.prototype=Object.create(T.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p(w,T)},F(c)}function R(c,S,C){return D()?R=Reflect.construct:R=function(w,A,m){var v=[null];v.push.apply(v,A);var s=Function.bind.apply(w,v),o=new s;return m&&p(o,m.prototype),o},R.apply(null,arguments)}function D(){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,S){return p=Object.setPrototypeOf||function(T,w){return T.__proto__=w,T},p(c,S)}function _(c){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(c)}function f(){return f=Object.assign||function(c){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var T in C)Object.prototype.hasOwnProperty.call(C,T)&&(c[T]=C[T])}return c},f.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(c){}return!1}var d=function(){function c(C){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=C.fetchSetup||i,this.controller=new self.AbortController,this.stats=new L.LoadStats}var S=c.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(T,w,A){var m=this,v=this.stats;if(v.loading.start)throw new Error("Loader can only be used once.");v.loading.start=self.performance.now();var s=l(T,this.controller.signal),o=A.onProgress,E=T.responseType==="arraybuffer",g=E?"byteLength":"length";this.context=T,this.config=w,this.callbacks=A,this.request=this.fetchSetup(T,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),A.onTimeout(v,T,m.response)},w.timeout),self.fetch(this.request).then(function(O){if(m.response=m.loader=O,!O.ok){var M=O.status,k=O.statusText;throw new u(k||"fetch, bad network response",M,O)}return v.loading.first=Math.max(self.performance.now(),v.loading.start),v.total=parseInt(O.headers.get("Content-Length")||"0"),o&&Object(K.isFiniteNumber)(w.highWaterMark)?m.loadProgressively(O,v,T,w.highWaterMark,o):E?O.arrayBuffer():O.text()}).then(function(O){var M=m.response;self.clearTimeout(m.requestTimeout),v.loading.end=Math.max(self.performance.now(),v.loading.first),v.loaded=v.total=O[g];var k={url:M.url,data:O};o&&!Object(K.isFiniteNumber)(w.highWaterMark)&&o(v,T,O,M),A.onSuccess(k,v,T,M)}).catch(function(O){if(self.clearTimeout(m.requestTimeout),v.aborted)return;var M=O.code||0;A.onError({code:M,text:O.message},T,O.details)})},S.getCacheAge=function(){var T=null;if(this.response){var w=this.response.headers.get("age");T=w?parseFloat(w):null}return T},S.loadProgressively=function(T,w,A,m,v){m===void 0&&(m=0);var s=new N.default,o=T.body.getReader(),E=function g(){return o.read().then(function(O){if(O.done)return s.dataLength&&v(w,A,s.flush(),T),Promise.resolve(new ArrayBuffer(0));var M=O.value,k=M.length;return w.loaded+=k,k<m||s.dataLength?(s.push(M),s.dataLength>=m&&v(w,A,s.flush(),T)):v(w,A,M,T),g()}).catch(function(){return Promise.reject()})};return E()},c}();function l(c,S){var C={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(f({},c.headers))};return c.rangeEnd&&C.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),C}function i(c,S){return new self.Request(c.url,S)}var u=function(c){W(S,c);function S(C,T,w){var A;return A=c.call(this,C)||this,A.code=void 0,A.details=void 0,A.code=T,A.details=w,A}return S}(F(Error));V.default=d},"./src/utils/imsc1-ttml-parser.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"IMSC1_CODEC",function(){return b}),I.d(V,"parseIMSC1",function(){return a});var K=I("./src/utils/mp4-tools.ts"),L=I("./src/utils/vttparser.ts"),N=I("./src/utils/vttcue.ts"),W=I("./src/demux/id3.ts"),F=I("./src/utils/timescale-conversion.ts"),R=I("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(m){for(var v=1;v<arguments.length;v++){var s=arguments[v];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(m[o]=s[o])}return m},D.apply(this,arguments)}var b="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,_=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(m,v,s,o,E){var g=Object(K.findBox)(new Uint8Array(m),["mdat"]);if(g.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var O=g[0],M=Object(W.utf8ArrayToStr)(new Uint8Array(m,O.start,O.end-O.start)),k=Object(F.toTimescaleFromScale)(v,1,s);try{o(d(M,k))}catch(U){E(U)}}function d(m,v){var s=new DOMParser,o=s.parseFromString(m,"text/xml"),E=o.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},O=Object.keys(g).reduce(function(y,x){return y[x]=E.getAttribute("ttp:"+x)||g[x],y},{}),M=E.getAttribute("xml:space")!=="preserve",k=i(l(E,"styling","style")),U=i(l(E,"layout","region")),B=l(E,"body","[begin]");return[].map.call(B,function(y){var x=u(y,M);if(!x||!y.hasAttribute("begin"))return null;var j=T(y.getAttribute("begin"),O),z=T(y.getAttribute("dur"),O),Y=T(y.getAttribute("end"),O);if(j===null)throw C(y);if(Y===null){if(z===null)throw C(y);Y=j+z}var $=new N.default(j-v,Y-v,x);$.id=Object(R.generateCueId)($.startTime,$.endTime,$.text);var ce=U[y.getAttribute("region")],se=k[y.getAttribute("style")];$.position=10,$.size=80;var ne=c(ce,se),re=ne.textAlign;if(re){var ue=f[re];ue&&($.lineAlign=ue),$.align=re}return D($,ne),$}).filter(function(y){return y!==null})}function l(m,v,s){var o=m.getElementsByTagName(v)[0];return o?[].slice.call(o.querySelectorAll(s)):[]}function i(m){return m.reduce(function(v,s){var o=s.getAttribute("xml:id");return o&&(v[o]=s),v},{})}function u(m,v){return[].slice.call(m.childNodes).reduce(function(s,o,E){var g;return o.nodeName==="br"&&E?s+`
|
|
`:(g=o.childNodes)!==null&&g!==void 0&&g.length?u(o,v):v?s+o.textContent.trim().replace(/\s+/g," "):s+o.textContent},"")}function c(m,v){var s="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(E,g){var O=S(v,s,g)||S(m,s,g);return O&&(E[g]=O),E},{})}function S(m,v,s){return m.hasAttributeNS(v,s)?m.getAttributeNS(v,s):null}function C(m){return new Error("Could not parse ttml timestamp "+m)}function T(m,v){if(!m)return null;var s=Object(L.parseTimeStamp)(m);return s===null&&(p.test(m)?s=w(m,v):_.test(m)&&(s=A(m,v))),s}function w(m,v){var s=p.exec(m),o=(s[4]|0)+(s[5]|0)/v.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+o/v.frameRate}function A(m,v){var s=_.exec(m),o=Number(s[1]),E=s[2];switch(E){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/v.frameRate;case"t":return o/v.tickRate}return o}},"./src/utils/logger.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"enableLogs",function(){return R}),I.d(V,"logger",function(){return D});var K=function(){},L={trace:K,debug:K,log:K,warn:K,info:K,error:K},N=L;function W(b){var p=self.console[b];return p?p.bind(self.console,"["+b+"] >"):K}function F(b){for(var p=arguments.length,_=new Array(p>1?p-1:0),f=1;f<p;f++)_[f-1]=arguments[f];_.forEach(function(a){N[a]=b[a]?b[a].bind(b):W(a)})}function R(b){if(self.console&&b===!0||typeof b=="object"){F(b,"debug","log","info","warn","error");try{N.log()}catch(p){N=L}}else N=L}var D=N},"./src/utils/mediakeys-helper.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"KeySystems",function(){return K}),I.d(V,"requestMediaKeySystemAccess",function(){return L});var K;(function(N){N.WIDEVINE="com.widevine.alpha",N.PLAYREADY="com.microsoft.playready"})(K||(K={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"getMediaSource",function(){return K});function K(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"bin2str",function(){return F}),I.d(V,"readUint16",function(){return R}),I.d(V,"readUint32",function(){return D}),I.d(V,"writeUint32",function(){return b}),I.d(V,"findBox",function(){return p}),I.d(V,"parseSegmentIndex",function(){return _}),I.d(V,"parseInitSegment",function(){return f}),I.d(V,"getStartDTS",function(){return a}),I.d(V,"getDuration",function(){return d}),I.d(V,"computeRawDurationFromSamples",function(){return l}),I.d(V,"offsetStartDTS",function(){return i}),I.d(V,"segmentValidRange",function(){return u}),I.d(V,"appendUint8Array",function(){return c});var K=I("./src/utils/typed-array.ts"),L=I("./src/loader/fragment.ts"),N=Math.pow(2,32)-1,W=[].push;function F(S){return String.fromCharCode.apply(null,S)}function R(S,C){"data"in S&&(C+=S.start,S=S.data);var T=S[C]<<8|S[C+1];return T<0?65536+T:T}function D(S,C){"data"in S&&(C+=S.start,S=S.data);var T=S[C]<<24|S[C+1]<<16|S[C+2]<<8|S[C+3];return T<0?4294967296+T:T}function b(S,C,T){"data"in S&&(C+=S.start,S=S.data),S[C]=T>>24,S[C+1]=T>>16&255,S[C+2]=T>>8&255,S[C+3]=T&255}function p(S,C){var T=[];if(!C.length)return T;var w,A,m;"data"in S?(w=S.data,A=S.start,m=S.end):(w=S,A=0,m=w.byteLength);for(var v=A;v<m;){var s=D(w,v),o=F(w.subarray(v+4,v+8)),E=s>1?v+s:m;if(o===C[0])if(C.length===1)T.push({data:w,start:v+8,end:E});else{var g=p({data:w,start:v+8,end:E},C.slice(1));g.length&&W.apply(T,g)}v=E}return T}function _(S){var C=p(S,["moov"]),T=C[0],w=T?T.end:null,A=p(S,["sidx"]);if(!A||!A[0])return null;var m=[],v=A[0],s=v.data[0],o=s===0?8:16,E=D(v,o);o+=4;var g=0,O=0;s===0?o+=8:o+=16,o+=2;var M=v.end+O,k=R(v,o);o+=2;for(var U=0;U<k;U++){var B=o,y=D(v,B);B+=4;var x=y&2147483647,j=(y&2147483648)>>>31;if(j===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=D(v,B);B+=4,m.push({referenceSize:x,subsegmentDuration:z,info:{duration:z/E,start:M,end:M+x-1}}),M+=x,B+=4,o=B}return{earliestPresentationTime:g,timescale:E,version:s,referencesCount:k,references:m,moovEndOffset:w}}function f(S){for(var C=[],T=p(S,["moov","trak"]),w=0;w<T.length;w++){var A=T[w],m=p(A,["tkhd"])[0];if(m){var v=m.data[m.start],s=v===0?12:20,o=D(m,s),E=p(A,["mdia","mdhd"])[0];if(E){v=E.data[E.start],s=v===0?12:20;var g=D(E,s),O=p(A,["mdia","hdlr"])[0];if(O){var M=F(O.data.subarray(O.start+8,O.start+12)),k={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[M];if(k){var U=p(A,["mdia","minf","stbl","stsd"])[0],B=void 0;U&&(B=F(U.data.subarray(U.start+12,U.start+16))),C[o]={timescale:g,type:k},C[k]={timescale:g,id:o,codec:B}}}}}}var y=p(S,["moov","mvex","trex"]);return y.forEach(function(x){var j=D(x,4),z=C[j];z&&(z.default={duration:D(x,12),flags:D(x,20)})}),C}function a(S,C){return p(C,["moof","traf"]).reduce(function(T,w){var A=p(w,["tfdt"])[0],m=A.data[A.start],v=p(w,["tfhd"]).reduce(function(s,o){var E=D(o,4),g=S[E];if(g){var O=D(A,4);m===1&&(O*=Math.pow(2,32),O+=D(A,8));var M=g.timescale||9e4,k=O/M;if(isFinite(k)&&(s===null||k<s))return k}return s},null);return v!==null&&isFinite(v)&&(T===null||v<T)?v:T},null)||0}function d(S,C){for(var T=0,w=0,A=0,m=p(S,["moof","traf"]),v=0;v<m.length;v++){var s=m[v],o=p(s,["tfhd"])[0],E=D(o,4),g=C[E];if(!g)continue;var O=g.default,M=D(o,0)|(O==null?void 0:O.flags),k=O==null?void 0:O.duration;M&8&&(M&2?k=D(o,12):k=D(o,8));for(var U=g.timescale||9e4,B=p(s,["trun"]),y=0;y<B.length;y++){if(k){var x=D(B[y],4);T=k*x}else T=l(B[y]);g.type===L.ElementaryStreamTypes.VIDEO?w+=T/U:g.type===L.ElementaryStreamTypes.AUDIO&&(A+=T/U)}}if(w===0&&A===0){var j=_(S);if(j!=null&&j.references)return j.references.reduce(function(z,Y){return z+Y.info.duration||0},0)}return w||A}function l(S){var C=D(S,0),T=8;C&1&&(T+=4),C&4&&(T+=4);for(var w=0,A=D(S,4),m=0;m<A;m++){if(C&256){var v=D(S,T);w+=v,T+=4}C&512&&(T+=4),C&1024&&(T+=4),C&2048&&(T+=4)}return w}function i(S,C,T){p(C,["moof","traf"]).forEach(function(w){p(w,["tfhd"]).forEach(function(A){var m=D(A,4),v=S[m];if(!v)return;var s=v.timescale||9e4;p(w,["tfdt"]).forEach(function(o){var E=o.data[o.start],g=D(o,4);if(E===0)b(o,4,g-T*s);else{g*=Math.pow(2,32),g+=D(o,8),g-=T*s,g=Math.max(g,0);var O=Math.floor(g/(N+1)),M=Math.floor(g%(N+1));b(o,4,O),b(o,8,M)}})})})}function u(S){var C={valid:null,remainder:null},T=p(S,["moof"]);if(T){if(T.length<2)return C.remainder=S,C}else return C;var w=T[T.length-1];return C.valid=Object(K.sliceUint8)(S,0,w.start-8),C.remainder=Object(K.sliceUint8)(S,w.start-8),C}function c(S,C){var T=new Uint8Array(S.length+C.length);return T.set(S),T.set(C,S.length),T}},"./src/utils/output-filter.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"default",function(){return K});var K=function(){function L(W,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=F}var N=L.prototype;return N.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},N.newCue=function(F,R,D){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=R,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},N.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"sendAddTrackEvent",function(){return L}),I.d(V,"addCueToTrack",function(){return N}),I.d(V,"clearCurrentCues",function(){return W}),I.d(V,"removeCuesInRange",function(){return F}),I.d(V,"getCuesInRange",function(){return D});var K=I("./src/utils/logger.ts");function L(b,p){var _;try{_=new Event("addtrack")}catch(f){_=document.createEvent("Event"),_.initEvent("addtrack",!1,!1)}_.track=b,p.dispatchEvent(_)}function N(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(a){K.logger.debug("[texttrack-utils]: "+a);var f=new self.TextTrackCue(p.startTime,p.endTime,p.text);f.id=p.id,b.addCue(f)}_==="disabled"&&(b.mode=_)}function W(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 F(b,p,_){var f=b.mode;if(f==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var a=D(b.cues,p,_),d=0;d<a.length;d++)b.removeCue(a[d]);f==="disabled"&&(b.mode=f)}function R(b,p){if(p<b[0].startTime)return 0;var _=b.length-1;if(p>b[_].endTime)return-1;for(var f=0,a=_;f<=a;){var d=Math.floor((a+f)/2);if(p<b[d].startTime)a=d-1;else if(p>b[d].startTime&&f<_)f=d+1;else return d}return b[f].startTime-p<p-b[a].startTime?f:a}function D(b,p,_){var f=[],a=R(b,p);if(a>-1)for(var d=a,l=b.length;d<l;d++){var i=b[d];if(i.startTime>=p&&i.endTime<=_)f.push(i);else if(i.startTime>_)return f}return f}},"./src/utils/time-ranges.ts":function(oe,V,I){"use strict";I.r(V);var K={toString:function(N){for(var W="",F=N.length,R=0;R<F;R++)W+="["+N.start(R).toFixed(3)+","+N.end(R).toFixed(3)+"]";return W}};V.default=K},"./src/utils/timescale-conversion.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"toTimescaleFromBase",function(){return L}),I.d(V,"toTimescaleFromScale",function(){return N}),I.d(V,"toMsFromMpegTsClock",function(){return W}),I.d(V,"toMpegTsClockFromTimescale",function(){return F});var K=9e4;function L(R,D,b,p){b===void 0&&(b=1),p===void 0&&(p=!1);var _=R*D*b;return p?Math.round(_):_}function N(R,D,b,p){return b===void 0&&(b=1),p===void 0&&(p=!1),L(R,D,1/b,p)}function W(R,D){return D===void 0&&(D=!1),L(R,1e3,1/K,D)}function F(R,D){return D===void 0&&(D=1),L(R,K,1/D)}},"./src/utils/typed-array.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"sliceUint8",function(){return K});function K(L,N,W){return Uint8Array.prototype.slice?L.slice(N,W):new Uint8Array(Array.prototype.slice.call(L,N,W))}},"./src/utils/vttcue.ts":function(oe,V,I){"use strict";I.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],L=["start","middle","end","left","right"];function N(b,p){if(typeof p!="string")return!1;if(!Array.isArray(b))return!1;var _=p.toLowerCase();return~b.indexOf(_)?_:!1}function W(b){return N(K,b)}function F(b){return N(L,b)}function R(b){for(var p=arguments.length,_=new Array(p>1?p-1:0),f=1;f<p;f++)_[f-1]=arguments[f];for(var a=1;a<arguments.length;a++){var d=arguments[a];for(var l in d)b[l]=d[l]}return b}function D(b,p,_){var f=this,a={enumerable:!0};f.hasBeenReset=!1;var d="",l=!1,i=b,u=p,c=_,S=null,C="",T=!0,w="auto",A="start",m=50,v="middle",s=50,o="middle";Object.defineProperty(f,"id",R({},a,{get:function(){return d},set:function(g){d=""+g}})),Object.defineProperty(f,"pauseOnExit",R({},a,{get:function(){return l},set:function(g){l=!!g}})),Object.defineProperty(f,"startTime",R({},a,{get:function(){return i},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");i=g,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",R({},a,{get:function(){return u},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");u=g,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",R({},a,{get:function(){return c},set:function(g){c=""+g,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",R({},a,{get:function(){return S},set:function(g){S=g,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",R({},a,{get:function(){return C},set:function(g){var O=W(g);if(O===!1)throw new SyntaxError("An invalid or illegal string was specified.");C=O,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",R({},a,{get:function(){return T},set:function(g){T=!!g,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",R({},a,{get:function(){return w},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=g,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",R({},a,{get:function(){return A},set:function(g){var O=F(g);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");A=O,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",R({},a,{get:function(){return m},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");m=g,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",R({},a,{get:function(){return v},set:function(g){var O=F(g);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");v=O,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",R({},a,{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(f,"align",R({},a,{get:function(){return o},set:function(g){var O=F(g);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");o=O,this.hasBeenReset=!0}})),f.displayState=void 0}return D.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"parseTimeStamp",function(){return N}),I.d(V,"fixLineBreaks",function(){return p}),I.d(V,"VTTParser",function(){return _});var K=I("./src/utils/vttcue.ts"),L=function(){function f(){}var a=f.prototype;return a.decode=function(l,i){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},f}();function N(f){function a(l,i,u,c){return(l|0)*3600+(i|0)*60+(u|0)+parseFloat(c||0)}var d=f.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?a(d[2],d[3],0,d[4]):a(d[1],d[2],d[3],d[4]):null}var W=function(){function f(){this.values=Object.create(null)}var a=f.prototype;return a.set=function(l,i){!this.get(l)&&i!==""&&(this.values[l]=i)},a.get=function(l,i,u){return u?this.has(l)?this.values[l]:i[u]:this.has(l)?this.values[l]:i},a.has=function(l){return l in this.values},a.alt=function(l,i,u){for(var c=0;c<u.length;++c)if(i===u[c]){this.set(l,i);break}},a.integer=function(l,i){/^-?\d+$/.test(i)&&this.set(l,parseInt(i,10))},a.percent=function(l,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var u=parseFloat(i);if(u>=0&&u<=100)return this.set(l,u),!0}return!1},f}();function F(f,a,d,l){var i=l?f.split(l):[f];for(var u in i){if(typeof i[u]!="string")continue;var c=i[u].split(d);if(c.length!==2)continue;var S=c[0],C=c[1];a(S,C)}}var R=new K.default(0,0,""),D=R.align==="middle"?"middle":"center";function b(f,a,d){var l=f;function i(){var S=N(f);if(S===null)throw new Error("Malformed timestamp: "+l);return f=f.replace(/^[^\sa-zA-Z-]+/,""),S}function u(S,C){var T=new W;F(S,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",D,"end"]);break;case"position":s=v.split(","),T.percent(m,s[0]),s.length===2&&T.alt("positionAlign",s[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":T.percent(m,v);break;case"align":T.alt(m,v,["start",D,"end","left","right"]);break}},/:/,/\s/),C.region=T.get("region",null),C.vertical=T.get("vertical","");var w=T.get("line","auto");w==="auto"&&R.line===-1&&(w=-1),C.line=w,C.lineAlign=T.get("lineAlign","start"),C.snapToLines=T.get("snapToLines",!0),C.size=T.get("size",100),C.align=T.get("align",D);var A=T.get("position","auto");A==="auto"&&R.position===50&&(A=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=A}function c(){f=f.replace(/^\s+/,"")}if(c(),a.startTime=i(),c(),f.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);f=f.substr(3),c(),a.endTime=i(),c(),u(f,a)}function p(f){return f.replace(/<br(?: \/)?>/gi,`
|
|
`)}var _=function(){function f(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=f.prototype;return a.parse=function(l){var i=this;l&&(i.buffer+=i.decoder.decode(l,{stream:!0}));function u(){var A=i.buffer,m=0;for(A=p(A);m<A.length&&A[m]!=="\r"&&A[m]!==`
|
|
`;)++m;var v=A.substr(0,m);return A[m]==="\r"&&++m,A[m]===`
|
|
`&&++m,i.buffer=A.substr(m),v}function c(A){F(A,function(m,v){},/:/)}try{var S="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;S=u();var C=S.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var T=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;T?T=!1:S=u();switch(i.state){case"HEADER":/:/.test(S)?c(S):S||(i.state="ID");continue;case"NOTE":S||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){i.state="NOTE";break}if(!S)continue;if(i.cue=new K.default(0,0,""),i.state="CUE",S.indexOf("-->")===-1){i.cue.id=S;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{b(S,i.cue,i.regionList)}catch(A){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var w=S.indexOf("-->")!==-1;if(!S||w&&(T=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
|
|
`),i.cue.text+=S}continue;case"BADCUE":S||(i.state="ID")}}}catch(A){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
|
|
|
|
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){l.onparsingerror&&l.onparsingerror(i)}return l.onflush&&l.onflush(),this},f}()},"./src/utils/webvtt-parser.ts":function(oe,V,I){"use strict";I.r(V),I.d(V,"generateCueId",function(){return _}),I.d(V,"parseWebVTT",function(){return a});var K=I("./src/polyfills/number.ts"),L=I("./src/utils/vttparser.ts"),N=I("./src/demux/id3.ts"),W=I("./src/utils/timescale-conversion.ts"),F=I("./src/remux/mp4-remuxer.ts"),R=/\r\n|\n\r|\n|\r/g,D=function(l,i,u){return u===void 0&&(u=0),l.substr(u,i.length)===i},b=function(l){var i=parseInt(l.substr(-3)),u=parseInt(l.substr(-6,2)),c=parseInt(l.substr(-9,2)),S=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(i)||!Object(K.isFiniteNumber)(u)||!Object(K.isFiniteNumber)(c)||!Object(K.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return i+=1e3*u,i+=60*1e3*c,i+=60*60*1e3*S,i},p=function(l){for(var i=5381,u=l.length;u;)i=i*33^l.charCodeAt(--u);return(i>>>0).toString()};function _(d,l,i){return p(d.toString())+p(l.toString())+p(i)}var f=function(l,i,u){var c=l[i],S=l[c.prevCC];if(!S||!S.new&&c.new){l.ccOffset=l.presentationOffset=c.start,c.new=!1;return}for(;(C=S)!==null&&C!==void 0&&C.new;){var C;l.ccOffset+=c.start-S.start,c.new=!1,c=S,S=l[c.prevCC]}l.presentationOffset=u};function a(d,l,i,u,c,S,C,T){var w=new L.VTTParser,A=Object(N.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(R,`
|
|
`).split(`
|
|
`),m=[],v=Object(W.toMpegTsClockFromTimescale)(l,i),s="00:00.000",o=0,E=0,g,O=!0,M=!1;w.oncue=function(k){var U=u[c],B=u.ccOffset,y=(o-v)/9e4;if(U!=null&&U.new&&(E!==void 0?B=u.ccOffset=U.start:f(u,c,y)),y&&(B=y-u.presentationOffset),M){var x=k.endTime-k.startTime,j=Object(F.normalizePts)((k.startTime+B-E)*9e4,S*9e4)/9e4;k.startTime=j,k.endTime=j+x}var z=k.text.trim();k.text=decodeURIComponent(encodeURIComponent(z)),k.id||(k.id=_(k.startTime,k.endTime,z)),k.endTime>0&&m.push(k)},w.onparsingerror=function(k){g=k},w.onflush=function(){if(g){T(g);return}C(m)},A.forEach(function(k){if(O)if(D(k,"X-TIMESTAMP-MAP=")){O=!1,M=!0,k.substr(16).split(",").forEach(function(U){D(U,"LOCAL:")?s=U.substr(6):D(U,"MPEGTS:")&&(o=parseInt(U.substr(7)))});try{E=b(s)/1e3}catch(U){M=!1,g=U}return}else k===""&&(O=!1);w.parse(k+`
|
|
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(oe,V,I){"use strict";I.r(V);var K=I("./src/utils/logger.ts"),L=I("./src/loader/load-stats.ts"),N=/^age:\s*[\d.]+\s*$/m,W=function(){function F(D){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=D?D.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var R=F.prototype;return R.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},R.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()))},R.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},R.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()},R.loadInternal=function(){var b=this.config,p=this.context;if(!b)return;var _=this.loader=new self.XMLHttpRequest,f=this.stats;f.loading.first=0,f.loaded=0;var a=this.xhrSetup;try{if(a)try{a(_,p.url)}catch(i){_.open("GET",p.url,!0),a(_,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(i){this.callbacks.onError({code:_.status,text:i.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()},R.readystatechange=function(){var b=this.context,p=this.loader,_=this.stats;if(!b||!p)return;var f=p.readyState,a=this.config;if(_.aborted)return;if(f>=2)if(self.clearTimeout(this.requestTimeout),_.loading.first===0&&(_.loading.first=Math.max(self.performance.now(),_.loading.start)),f===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,i;if(b.responseType==="arraybuffer"?(l=p.response,i=l.byteLength):(l=p.responseText,i=l.length),_.loaded=_.total=i,!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>=a.maxRetry||d>=400&&d<499?(K.logger.error(d+" while loading "+b.url),this.callbacks.onError({code:d,text:p.statusText},b,p)):(K.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,a.maxRetryDelay),_.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},R.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},R.loadprogress=function(b){var p=this.stats;p.loaded=b.loaded,b.lengthComputable&&(p.total=b.total)},R.getCacheAge=function(){var b=null;if(this.loader&&N.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");b=p?parseFloat(p):null}return b},F}();V.default=W}}).default})},vHTk:function(rt,Be,H){rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(rt,Be,H){"use strict";var oe=H("+L6B"),V=H("2/Rp"),I=H("5NDa"),K=H("5rEg"),L=H("y8nQ"),N=H("Vl3Y"),W=H("tJVT"),F=H("cDcd"),R=H.n(F),D=H("a+yL"),b=H.n(D),p=function(f){var a=f.value,d=f.onChange,l=N.a.useForm(),i=Object(W.a)(l,1),u=i[0];Object(F.useEffect)(function(){a&&u.setFieldsValue(a)},a);var c=function(C){d(C)};return R.a.createElement("div",{className:b.a.search},R.a.createElement(N.a,{className:b.a.formWrap,colon:!1,form:u,size:"large",layout:"inline",onFinish:c},R.a.createElement(N.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},R.a.createElement(K.a,{style:{width:280,height:40}})),R.a.createElement(N.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},R.a.createElement(K.a,{style:{width:280,height:40}})),R.a.createElement(N.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},R.a.createElement(K.a,{style:{width:200,height:40}})),R.a.createElement(V.a,{className:b.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};Be.a=p},wNkr:function(rt,Be){rt.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(rt,Be){rt.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(rt,Be,H){rt.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"}}}]);
|