You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Paperlibrary__Random__Ex...

166 lines
772 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[196,5,7,8,13],{"+ua5":function(Xe,Fe,B){},"+vTd":function(Xe,Fe,B){Xe.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(Xe,Fe,B){Xe.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"}},"1vnw":function(Xe,Fe,B){Xe.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"5VLF":function(Xe,Fe,B){"use strict";var fe,N;function S(L,T,w){var D=function(I,A){return L.js_beautify(I,A)};return D.js=L.js_beautify,D.css=T.css_beautify,D.html=w.html_beautify,D.js_beautify=L.js_beautify,D.css_beautify=T.css_beautify,D.html_beautify=w.html_beautify,D}!(fe=[B("6UM0"),B("TXwP"),B("psGv")],N=function(L,T,w){return S(L,T,w)}.apply(Fe,fe),N!==void 0&&(Xe.exports=N))},"6+eU":function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return p});var fe=B("wx14"),N=B("rePB"),S=B("VTBJ"),L=B("1OyB"),T=B("vuIU"),w=B("Ji7U"),D=B("LK+K"),I=B("cDcd"),A=B.n(I),O=B("TSYQ"),_=B.n(O),f=function(v){var a,c="".concat(v.rootPrefixCls,"-item"),i=_()(c,"".concat(c,"-").concat(v.page),(a={},Object(N.a)(a,"".concat(c,"-active"),v.active),Object(N.a)(a,v.className,!!v.className),Object(N.a)(a,"".concat(c,"-disabled"),!v.page),a)),l=function(){v.onClick(v.page)},g=function(b){v.onKeyPress(b,v.onClick,v.page)};return A.a.createElement("li",{title:v.showTitle?v.page:null,className:i,onClick:l,onKeyPress:g,tabIndex:"0"},v.itemRender(v.page,"page",A.a.createElement("a",{rel:"nofollow"},v.page)))},d=f,o={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},e=function(y){Object(w.a)(a,y);var v=Object(D.a)(a);function a(){var c;Object(L.a)(this,a);for(var i=arguments.length,l=new Array(i),g=0;g<i;g++)l[g]=arguments[g];return c=v.call.apply(v,[this].concat(l)),c.state={goInputText:""},c.buildOptionText=function(h){return"".concat(h," ").concat(c.props.locale.items_per_page)},c.changeSize=function(h){c.props.changeSize(Number(h))},c.handleChange=function(h){c.setState({goInputText:h.target.value})},c.handleBlur=function(h){var b=c.props,R=b.goButton,x=b.quickGo,P=b.rootPrefixCls,M=c.state.goInputText;if(R||M==="")return;if(h.relatedTarget&&(h.relatedTarget.className.indexOf("".concat(P,"-prev"))>=0||h.relatedTarget.className.indexOf("".concat(P,"-next"))>=0))return;c.setState({goInputText:""}),x(c.getValidValue())},c.go=function(h){var b=c.state.goInputText;if(b==="")return;(h.keyCode===o.ENTER||h.type==="click")&&(c.setState({goInputText:""}),c.props.quickGo(c.getValidValue()))},c}return Object(T.a)(a,[{key:"getValidValue",value:function(){var i=this.state,l=i.goInputText,g=i.current;return!l||isNaN(l)?g:Number(l)}},{key:"getPageSizeOptions",value:function(){var i=this.props,l=i.pageSize,g=i.pageSizeOptions;return g.some(function(h){return h.toString()===l.toString()})?g:g.concat([l.toString()]).sort(function(h,b){var R=isNaN(Number(h))?0:Number(h),x=isNaN(Number(b))?0:Number(b);return R-x})}},{key:"render",value:function(){var i=this,l=this.props,g=l.pageSize,h=l.locale,b=l.rootPrefixCls,R=l.changeSize,x=l.quickGo,P=l.goButton,M=l.selectComponentClass,k=l.buildOptionText,C=l.selectPrefixCls,U=l.disabled,K=this.state.goInputText,ee="".concat(b,"-options"),z=M,ae=null,se=null,V=null;if(!R&&!x)return null;var Y=this.getPageSizeOptions();if(R&&z){var q=Y.map(function(G,X){return A.a.createElement(z.Option,{key:X,value:G.toString()},(k||i.buildOptionText)(G))});ae=A.a.createElement(z,{disabled:U,prefixCls:C,showSearch:!1,className:"".concat(ee,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(g||Y[0]).toString(),onChange:this.changeSize,getPopupContainer:function(X){return X.parentNode}},q)}return x&&(P&&(V=typeof P=="boolean"?A.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:U,className:"".concat(ee,"-quick-jumper-button")},h.jump_to_confirm):A.a.createElement("span",{onClick:this.go,onKeyUp:this.go},P)),se=A.a.createElement("div",{className:"".concat(ee,"-quick-jumper")},h.jump_to,A.a.createElement("input",{disabled:U,type:"text",value:K,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),h.page,V)),A.a.createElement("li",{className:"".concat(ee)},ae,se)}}]),a}(A.a.Component);e.defaultProps={pageSizeOptions:["10","20","50","100"]};var u=e,s=B("N2Kk");function t(){}function n(y){return typeof y=="number"&&isFinite(y)&&Math.floor(y)===y}function r(y,v,a){return a}function E(y,v,a){var c=typeof y=="undefined"?v.pageSize:y;return Math.floor((a.total-1)/c)+1}var m=function(y){Object(w.a)(a,y);var v=Object(D.a)(a);function a(c){var i;Object(L.a)(this,a),i=v.call(this,c),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(E(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(R,x){var P=i.props.prefixCls,M=R||A.a.createElement("button",{type:"button","aria-label":x,className:"".concat(P,"-item-link")});return typeof R=="function"&&(M=A.a.createElement(R,Object(S.a)({},i.props))),M},i.savePaginationNode=function(R){i.paginationNode=R},i.isValid=function(R){return n(R)&&R!==i.state.current},i.shouldDisplayQuickJumper=function(){var R=i.props,x=R.showQuickJumper,P=R.pageSize,M=R.total;return M<=P?!1:x},i.handleKeyDown=function(R){(R.keyCode===o.ARROW_UP||R.keyCode===o.ARROW_DOWN)&&R.preventDefault()},i.handleKeyUp=function(R){var x=i.getValidValue(R),P=i.state.currentInputValue;x!==P&&i.setState({currentInputValue:x}),R.keyCode===o.ENTER?i.handleChange(x):R.keyCode===o.ARROW_UP?i.handleChange(x-1):R.keyCode===o.ARROW_DOWN&&i.handleChange(x+1)},i.changePageSize=function(R){var x=i.state.current,P=E(R,i.state,i.props);x=x>P?P:x,P===0&&(x=i.state.current),typeof R=="number"&&("pageSize"in i.props||i.setState({pageSize:R}),"current"in i.props||i.setState({current:x,currentInputValue:x})),i.props.onShowSizeChange(x,R),"onChange"in i.props&&i.props.onChange&&i.props.onChange(x,R)},i.handleChange=function(R){var x=i.props.disabled,P=R;if(i.isValid(P)&&!x){var M=E(void 0,i.state,i.props);P>M?P=M:P<1&&(P=1),"current"in i.props||i.setState({current:P,currentInputValue:P});var k=i.state.pageSize;return i.props.onChange(P,k),P}return i.state.current},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current<E(void 0,i.state,i.props)},i.runIfEnter=function(R,x){if(R.key==="Enter"||R.charCode===13){for(var P=arguments.length,M=new Array(P>2?P-2:0),k=2;k<P;k++)M[k-2]=arguments[k];x.apply(void 0,M)}},i.runIfEnterPrev=function(R){i.runIfEnter(R,i.prev)},i.runIfEnterNext=function(R){i.runIfEnter(R,i.next)},i.runIfEnterJumpPrev=function(R){i.runIfEnter(R,i.jumpPrev)},i.runIfEnterJumpNext=function(R){i.runIfEnter(R,i.jumpNext)},i.handleGoTO=function(R){(R.keyCode===o.ENTER||R.type==="click")&&i.handleChange(i.state.currentInputValue)};var l=c.onChange!==t,g="current"in c;g&&!l&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var h=c.defaultCurrent;"current"in c&&(h=c.current);var b=c.defaultPageSize;return"pageSize"in c&&(b=c.pageSize),h=Math.min(h,E(b,void 0,c)),i.state={current:h,currentInputValue:h,pageSize:b},i}return Object(T.a)(a,[{key:"componentDidUpdate",value:function(i,l){var g=this.props.prefixCls;if(l.current!==this.state.current&&this.paginationNode){var h=this.paginationNode.querySelector(".".concat(g,"-item-").concat(l.current));h&&document.activeElement===h&&h.blur()}}},{key:"getValidValue",value:function(i){var l=i.target.value,g=E(void 0,this.state,this.props),h=this.state.currentInputValue,b;return l===""?b=l:isNaN(Number(l))?b=h:l>=g?b=g:b=Number(l),b}},{key:"getShowSizeChanger",value:function(){var i=this.props,l=i.showSizeChanger,g=i.total,h=i.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:g>h}},{key:"renderPrev",value:function(i){var l=this.props,g=l.prevIcon,h=l.itemRender,b=h(i,"prev",this.getItemIcon(g,"prev page")),R=!this.hasPrev();return Object(I.isValidElement)(b)?Object(I.cloneElement)(b,{disabled:R}):b}},{key:"renderNext",value:function(i){var l=this.props,g=l.nextIcon,h=l.itemRender,b=h(i,"next",this.getItemIcon(g,"next page")),R=!this.hasNext();return Object(I.isValidElement)(b)?Object(I.cloneElement)(b,{disabled:R}):b}},{key:"render",value:function(){var i=this,l=this.props,g=l.prefixCls,h=l.className,b=l.style,R=l.disabled,x=l.hideOnSinglePage,P=l.total,M=l.locale,k=l.showQuickJumper,C=l.showLessItems,U=l.showTitle,K=l.showTotal,ee=l.simple,z=l.itemRender,ae=l.showPrevNextJumpers,se=l.jumpPrevIcon,V=l.jumpNextIcon,Y=l.selectComponentClass,q=l.selectPrefixCls,G=l.pageSizeOptions,X=this.state,de=X.current,Ee=X.pageSize,Oe=X.currentInputValue;if(x===!0&&P<=Ee)return null;var me=E(void 0,this.state,this.props),Se=[],ve=null,be=null,Ae=null,Re=null,Le=null,Ce=k&&k.goButton,xe=C?1:2,Be=de-1>0?de-1:0,Me=de+1<me?de+1:me,ge=Object.keys(this.props).reduce(function(W,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(W[H]=i.props[H]),W},{});if(ee)return Ce&&(typeof Ce=="boolean"?Le=A.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},M.jump_to_confirm):Le=A.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ce),Le=A.a.createElement("li",{title:U?"".concat(M.jump_to).concat(de,"/").concat(me):null,className:"".concat(g,"-simple-pager")},Le)),A.a.createElement("ul",Object(fe.a)({className:_()(g,"".concat(g,"-simple"),Object(N.a)({},"".concat(g,"-disabled"),R),h),style:b,ref:this.savePaginationNode},ge),A.a.createElement("li",{title:U?M.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:_()("".concat(g,"-prev"),Object(N.a)({},"".concat(g,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Be)),A.a.createElement("li",{title:U?"".concat(de,"/").concat(me):null,className:"".concat(g,"-simple-pager")},A.a.createElement("input",{type:"text",value:Oe,disabled:R,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),A.a.createElement("span",{className:"".concat(g,"-slash")},"/"),me),A.a.createElement("li",{title:U?M.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:_()("".concat(g,"-next"),Object(N.a)({},"".concat(g,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Me)),Le);if(me<=3+xe*2){var De={locale:M,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:U,itemRender:z};me||Se.push(A.a.createElement(d,Object(fe.a)({},De,{key:"noPager",page:me,className:"".concat(g,"-disabled")})));for(var Ge=1;Ge<=me;Ge+=1){var We=de===Ge;Se.push(A.a.createElement(d,Object(fe.a)({},De,{key:Ge,page:Ge,active:We})))}}else{var Ke=C?M.prev_3:M.prev_5,Pe=C?M.next_3:M.next_5;ae&&(ve=A.a.createElement("li",{title:U?Ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:_()("".concat(g,"-jump-prev"),Object(N.a)({},"".concat(g,"-jump-prev-custom-icon"),!!se))},z(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(se,"prev page"))),be=A.a.createElement("li",{title:U?Pe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:_()("".concat(g,"-jump-next"),Object(N.a)({},"".concat(g,"-jump-next-custom-icon"),!!V))},z(this.getJumpNextPage(),"jump-next",this.getItemIcon(V,"next page")))),Re=A.a.createElement(d,{locale:M,last:!0,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:me,page:me,active:!1,showTitle:U,itemRender:z}),Ae=A.a.createElement(d,{locale:M,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:U,itemRender:z});var Ve=Math.max(1,de-xe),He=Math.min(de+xe,me);de-1<=xe&&(He=1+xe*2),me-de<=xe&&(Ve=me-xe*2);for(var Te=Ve;Te<=He;Te+=1){var Ue=de===Te;Se.push(A.a.createElement(d,{locale:M,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Te,page:Te,active:Ue,showTitle:U,itemRender:z}))}de-1>=xe*2&&de!==1+2&&(Se[0]=Object(I.cloneElement)(Se[0],{className:"".concat(g,"-item-after-jump-prev")}),Se.unshift(ve)),me-de>=xe*2&&de!==me-2&&(Se[Se.length-1]=Object(I.cloneElement)(Se[Se.length-1],{className:"".concat(g,"-item-before-jump-next")}),Se.push(be)),Ve!==1&&Se.unshift(Ae),He!==me&&Se.push(Re)}var J=null;K&&(J=A.a.createElement("li",{className:"".concat(g,"-total-text")},K(P,[P===0?0:(de-1)*Ee+1,de*Ee>P?P:de*Ee])));var re=!this.hasPrev()||!me,oe=!this.hasNext()||!me;return A.a.createElement("ul",Object(fe.a)({className:_()(g,h,Object(N.a)({},"".concat(g,"-disabled"),R)),style:b,unselectable:"unselectable",ref:this.savePaginationNode},ge),J,A.a.createElement("li",{title:U?M.prev_page:null,onClick:this.prev,tabIndex:re?null:0,onKeyPress:this.runIfEnterPrev,className:_()("".concat(g,"-prev"),Object(N.a)({},"".concat(g,"-disabled"),re)),"aria-disabled":re},this.renderPrev(Be)),Se,A.a.createElement("li",{title:U?M.next_page:null,onClick:this.next,tabIndex:oe?null:0,onKeyPress:this.runIfEnterNext,className:_()("".concat(g,"-next"),Object(N.a)({},"".concat(g,"-disabled"),oe)),"aria-disabled":oe},this.renderNext(Me)),A.a.createElement(u,{disabled:R,locale:M,rootPrefixCls:g,selectComponentClass:Y,selectPrefixCls:q,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:de,pageSize:Ee,pageSizeOptions:G,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ce}))}}],[{key:"getDerivedStateFromProps",value:function(i,l){var g={};if("current"in i&&(g.current=i.current,i.current!==l.current&&(g.currentInputValue=g.current)),"pageSize"in i&&i.pageSize!==l.pageSize){var h=l.current,b=E(i.pageSize,l,i);h=h>b?b:h,"current"in i||(g.current=h,g.currentInputValue=h),g.pageSize=i.pageSize}return g}}]),a}(A.a.Component);m.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:s.a,style:{},itemRender:r,totalBoundaryShowSizeChanger:50};var p=m},"6UM0":function(Xe,Fe,B){var fe,N;(function(){var S;(function(){"use strict";var T=[function(A,O,_){var f=_(1).Beautifier,d=_(5).Options;function o(e,u){var s=new f(e,u);return s.beautify()}A.exports=o,A.exports.defaultOptions=function(){return new d}},function(A,O,_){var f=_(2).Output,d=_(3).Token,o=_(4),e=_(5).Options,u=_(7).Tokenizer,s=_(7).line_starters,t=_(7).positionable_operators,n=_(7).TOKEN;function r(C,U){return U.indexOf(C)!==-1}function E(C){return C.replace(/^\s+/g,"")}function m(C){for(var U={},K=0;K<C.length;K++)U[C[K].replace(/-/g,"_")]=C[K];return U}function p(C,U){return C&&C.type===n.RESERVED&&C.text===U}function y(C,U){return C&&C.type===n.RESERVED&&r(C.text,U)}var v=["case","return","do","if","throw","else","await","break","continue","async"],a=["before-newline","after-newline","preserve-newline"],c=m(a),i=[c.before_newline,c.preserve_newline],l={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function g(C,U){if(U.multiline_frame||U.mode===l.ForInitializer||U.mode===l.Conditional)return;C.remove_indent(U.start_line_index)}function h(C){C=C.replace(o.allLineBreaks,`
`);for(var U=[],K=C.indexOf(`
`);K!==-1;)U.push(C.substring(0,K)),C=C.substring(K+1),K=C.indexOf(`
`);return C.length&&U.push(C),U}function b(C){return C===l.ArrayLiteral}function R(C){return r(C,[l.Expression,l.ForInitializer,l.Conditional])}function x(C,U){for(var K=0;K<C.length;K++){var ee=C[K].trim();if(ee.charAt(0)!==U)return!1}return!0}function P(C,U){for(var K=0,ee=C.length,z;K<ee;K++)if(z=C[K],z&&z.indexOf(U)!==0)return!1;return!0}function M(C,U){U=U||{},this._source_text=C||"",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 e(U)}M.prototype.create_flags=function(C,U){var K=0;C&&(K=C.indentation_level,!this._output.just_added_newline()&&C.line_indent_level>K&&(K=C.line_indent_level));var ee={mode:U,parent:C,last_token:C?C.last_token:new d(n.START_BLOCK,""),last_word:C?C.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:K,alignment:0,line_indent_level:C?C.line_indent_level:K,start_line_index:this._output.get_line_number(),ternary_depth:0};return ee},M.prototype._reset=function(C){var U=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,U),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(l.BlockStatement);var K=new u(C,this._options);return this._tokens=K.tokenize(),C},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,U=this._reset(this._source_text),K=this._options.eol;this._options.eol==="auto"&&(K=`
`,U&&o.lineBreak.test(U||"")&&(K=U.match(o.lineBreak)[0]));for(var ee=this._tokens.next();ee;)this.handle_token(ee),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ee,ee=this._tokens.next();return C=this._output.get_code(K),C},M.prototype.handle_token=function(C,U){C.type===n.START_EXPR?this.handle_start_expr(C):C.type===n.END_EXPR?this.handle_end_expr(C):C.type===n.START_BLOCK?this.handle_start_block(C):C.type===n.END_BLOCK?this.handle_end_block(C):C.type===n.WORD?this.handle_word(C):C.type===n.RESERVED?this.handle_word(C):C.type===n.SEMICOLON?this.handle_semicolon(C):C.type===n.STRING?this.handle_string(C):C.type===n.EQUALS?this.handle_equals(C):C.type===n.OPERATOR?this.handle_operator(C):C.type===n.COMMA?this.handle_comma(C):C.type===n.BLOCK_COMMENT?this.handle_block_comment(C,U):C.type===n.COMMENT?this.handle_comment(C,U):C.type===n.DOT?this.handle_dot(C):C.type===n.EOF?this.handle_eof(C):C.type===n.UNKNOWN?this.handle_unknown(C,U):this.handle_unknown(C,U)},M.prototype.handle_whitespace_and_comments=function(C,U){var K=C.newlines,ee=this._options.keep_array_indentation&&b(this._flags.mode);if(C.comments_before)for(var z=C.comments_before.next();z;)this.handle_whitespace_and_comments(z,U),this.handle_token(z,U),z=C.comments_before.next();if(ee)for(var ae=0;ae<K;ae+=1)this.print_newline(ae>0,U);else if(this._options.max_preserve_newlines&&K>this._options.max_preserve_newlines&&(K=this._options.max_preserve_newlines),this._options.preserve_newlines&&K>1){this.print_newline(!1,U);for(var se=1;se<K;se+=1)this.print_newline(!0,U)}};var k=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(C,U){if(U=U===void 0?!1:U,this._output.just_added_newline())return;var K=this._options.preserve_newlines&&C.newlines||U,ee=r(this._flags.last_token.text,t)||r(C.text,t);if(ee){var z=r(this._flags.last_token.text,t)&&r(this._options.operator_position,i)||r(C.text,t);K=K&&z}if(K)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(y(this._flags.last_token,k))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(C,U){if(!U&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var K=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&p(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(C)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(C){this._output.just_added_newline()&&(this._options.keep_array_indentation&&C.newlines&&(C.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(C.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))},M.prototype.print_token=function(C){if(this._output.raw){this._output.add_raw_token(C);return}if(this._options.comma_first&&C.previous&&C.previous.type===n.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var U=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(U),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(C),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(C),this._output.non_breaking_space=!0,this._output.add_token(C.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.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))},M.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===l.Statement&&g(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(C){var U=!1;return U=U||y(this._flags.last_token,["var","let","const"])&&C.type===n.WORD,U=U||p(this._flags.last_token,"do"),U=U||!(this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement)&&y(this._flags.last_token,k)&&!C.newlines,U=U||p(this._flags.last_token,"else")&&!(p(C,"if")&&!C.comments_before),U=U||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===l.ForInitializer||this._previous_flags.mode===l.Conditional),U=U||this._flags.last_token.type===n.WORD&&this._flags.mode===l.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==n.WORD&&C.type!==n.RESERVED,U=U||this._flags.mode===l.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"])),U?(this.set_mode(l.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,y(C,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var U=l.Expression;if(C.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){y(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(C),this.set_mode(U),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}U=l.ArrayLiteral,b(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())),r(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,U=l.ForInitializer):r(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,U=l.Conditional):r(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(r(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var K=this._tokens.peek(-3);if(this._options.space_after_named_function&&K){var ee=this._tokens.peek(-4);y(K,["async","function"])||K.text==="*"&&y(ee,["async","function"])?this._output.space_before_token=!0:this._flags.mode===l.ObjectLiteral?(K.text==="{"||K.text===","||K.text==="*"&&(ee.text==="{"||ee.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(C);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(r(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&r(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===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(C,C.newlines),this.print_token(C),this.set_mode(U),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(C){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.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(C),this.restore_mode(),g(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===l.Conditional&&(this._previous_flags.mode=l.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var U=this._tokens.peek(),K=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(l.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(l.BlockStatement):K&&(r(K.text,[":",","])&&r(U.type,[n.STRING,n.WORD,n.RESERVED])||r(U.text,["get","set","..."])&&r(K.type,[n.WORD,n.RESERVED]))?r(this._last_last_text,["class","interface"])&&!r(K.text,[":",","])?this.set_mode(l.BlockStatement):this.set_mode(l.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(l.BlockStatement):r(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||y(this._flags.last_token,["return","throw","import","default"])?this.set_mode(l.ObjectLiteral):this.set_mode(l.BlockStatement),this._flags.last_token&&(y(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ee=!U.comments_before&&U.text==="}",z=ee&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var ae=0,se=null;this._flags.inline_frame=!0;do if(ae+=1,se=this._tokens.peek(ae-1),se.newlines){this._flags.inline_frame=!1;break}while(se.type!==n.EOF&&!(se.type===n.END_BLOCK&&se.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(z||this._flags.last_token.type===n.EQUALS||y(this._flags.last_token,v)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!ee&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===l.Statement;)this.restore_mode();var U=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!U?this._output.space_before_token=!0:this._options.brace_style==="expand"?U||this.print_newline():U||(b(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(C)},M.prototype.handle_word=function(C){if(C.type===n.RESERVED){if(r(C.text,["set","get"])&&this._flags.mode!==l.ObjectLiteral)C.type=n.WORD;else if(C.text==="import"&&r(this._tokens.peek().text,["(","."]))C.type=n.WORD;else if(r(C.text,["as","from"])&&!this._flags.import_block)C.type=n.WORD;else if(this._flags.mode===l.ObjectLiteral){var U=this._tokens.peek();U.text===":"&&(C.type=n.WORD)}}if(this.start_of_statement(C)?y(this._flags.last_token,["var","let","const"])&&C.type===n.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!R(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!y(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(p(C,"while")){this._output.space_before_token=!0,this.print_token(C),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&&p(C,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===l.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&y(C,["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(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),p(C,"function")){(r(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(r(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!C.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?y(this._flags.last_token,["get","set","new","export"])||y(this._flags.last_token,k)?this._output.space_before_token=!0:p(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===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var K="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?K="SPACE":y(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?K="NEWLINE":(K="SPACE",this._output.space_before_token=!0):K="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===l.BlockStatement?K="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&R(this._flags.mode)?K="SPACE":this._flags.last_token.type===n.STRING?K="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(r(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&r(this._last_last_text,["{",","]))?K="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?K="SPACE":K="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,K="NEWLINE"),y(C,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?K="SPACE":K="NEWLINE"),y(C,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===l.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ee=this._output.current_line;ee.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else K==="NEWLINE"?y(this._flags.last_token,v)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&y(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!y(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(p(C,"if")&&p(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):y(C,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():K==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===n.WORD||C.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===n.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&p(C,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var U=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&p(U,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},M.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},M.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},M.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(R(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(C)):this._flags.mode===l.ObjectLiteral||this._flags.mode===l.Statement&&this._flags.parent.mode===l.ObjectLiteral?(this._flags.mode===l.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)},M.prototype.handle_operator=function(C){var U=C.text==="*"&&(y(this._flags.last_token,["function","yield"])||r(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),K=r(C.text,["-","+"])&&(r(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||r(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(C)){var ee=!U;this.handle_whitespace_and_comments(C,ee)}if(C.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===n.OPERATOR&&r(this._options.operator_position,i)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.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 z=!0,ae=!0,se=!1;if(C.text===":"?this._flags.ternary_depth===0?z=!1:(this._flags.ternary_depth-=1,se=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!K&&!U&&this._options.preserve_newlines&&r(C.text,t)){var V=C.text===":",Y=V&&se,q=V&&!se;switch(this._options.operator_position){case c.before_newline:this._output.space_before_token=!q,this.print_token(C),(!V||Y)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case c.after_newline:this._output.space_before_token=!0,!V||Y?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case c.preserve_newline:q||this.allow_wrap_or_preserved_newline(C),z=!(this._output.just_added_newline()||q),this._output.space_before_token=z,this.print_token(C),this._output.space_before_token=!0;return}}if(U){this.allow_wrap_or_preserved_newline(C),z=!1;var G=this._tokens.peek();ae=G&&r(G.type,[n.WORD,n.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),z=this._flags.last_token.type===n.START_BLOCK,ae=!1;else if(r(C.text,["--","++","!","~"])||K){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),z=!1,ae=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var X=y(this._flags.last_token,v)&&C.newlines;X&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(X,!0)}this._flags.last_token.text===";"&&R(this._flags.mode)&&(z=!0),this._flags.last_token.type===n.RESERVED?z=!0:this._flags.last_token.type===n.END_EXPR?z=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===n.OPERATOR&&(z=r(C.text,["--","-","++","+"])&&r(this._flags.last_token.text,["--","-","++","+"]),r(C.text,["+","-"])&&r(this._flags.last_token.text,["--","++"])&&(ae=!0)),(this._flags.mode===l.BlockStatement&&!this._flags.inline_frame||this._flags.mode===l.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||z,this.print_token(C),this._output.space_before_token=ae},M.prototype.handle_block_comment=function(C,U){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,U),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!o.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,U)},M.prototype.print_block_commment=function(C,U){var K=h(C.text),ee,z=!1,ae=!1,se=C.whitespace_before,V=se.length;if(this.print_newline(!1,U),this.print_token_line_indentation(C),this._output.add_token(K[0]),this.print_newline(!1,U),K.length>1){for(K=K.slice(1),z=x(K,"*"),ae=P(K,se),z&&(this._flags.alignment=1),ee=0;ee<K.length;ee++)z?(this.print_token_line_indentation(C),this._output.add_token(E(K[ee]))):ae&&K[ee]?(this.print_token_line_indentation(C),this._output.add_token(K[ee].substring(V))):(this._output.current_line.set_indent(-1),this._output.add_token(K[ee])),this.print_newline(!1,U);this._flags.alignment=0}},M.prototype.handle_comment=function(C,U){C.newlines?this.print_newline(!1,U):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(C),this.print_newline(!1,U)},M.prototype.handle_dot=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),y(this._flags.last_token,v)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(C,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(C)},M.prototype.handle_unknown=function(C,U){this.print_token(C),C.text[C.text.length-1]===`
`&&this.print_newline(!1,U)},M.prototype.handle_eof=function(C){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C)},A.exports.Beautifier=M},function(A){function O(d){this.__parent=d,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=[]}O.prototype.clone_empty=function(){var d=new O(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},O.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},O.prototype.has_match=function(d){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(d))return!0;return!1},O.prototype.set_indent=function(d,o){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},O.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)},O.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},O.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},O.prototype.is_empty=function(){return this.__items.length===0},O.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},O.prototype.push=function(d){this.__items.push(d);var o=d.lastIndexOf(`
`);o!==-1?this.__character_count=d.length-o:this.__character_count+=d.length},O.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},O.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},O.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},O.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},O.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function _(d,o){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),o=o||"",d.indent_level>0&&(o=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}_.prototype.get_indent_size=function(d,o){var e=this.__base_string_length;return o=o||0,d<0&&(e=0),e+=d*this.__indent_size,e+=o,e},_.prototype.get_indent_string=function(d,o){var e=this.__base_string;return o=o||0,d<0&&(d=0,e=""),o+=d*this.__indent_size,this.__ensure_cache(o),e+=this.__cache[o],e},_.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var d=this.__cache.length,o=0,e="";this.__indent_size&&d>=this.__indent_size&&(o=Math.floor(d/this.__indent_size),d-=o*this.__indent_size,e=new Array(o+1).join(this.__indent_string)),d&&(e+=new Array(d+1).join(" ")),this.__cache.push(e)};function f(d,o){this.__indent_cache=new _(d,o),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new O(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(d,o){return this.__indent_cache.get_indent_string(d,o)},f.prototype.get_indent_size=function(d,o){return this.__indent_cache.get_indent_size(d,o)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(d){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var e=this.__lines.join(`
`);return d!==`
`&&(e=e.replace(/[\n]/g,d)),e},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(d,o){return d=d||0,o=o||0,this.next_line.set_indent(d,o),this.__lines.length>1?(this.current_line.set_indent(d,o),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(d){for(var o=0;o<d.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),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(d){for(var o=this.__lines.length;d<o;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&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(d,o){for(var e=this.__lines.length-2;e>=0;){var u=this.__lines[e];if(u.is_empty())break;if(u.item(0).indexOf(d)!==0&&u.item(-1)!==o){this.__lines.splice(e+1,0,new O(this)),this.previous_line=this.__lines[this.__lines.length-2];break}e--}},A.exports.Output=f},function(A){function O(_,f,d,o){this.type=_,this.text=f,this.comments_before=null,this.newlines=d||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}A.exports.Token=O},function(A,O){var _="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\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",o="\\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",e="(?:\\\\u[0-9a-fA-F]{4}|["+_+d+"])",u="(?:\\\\u[0-9a-fA-F]{4}|["+f+d+o+"])*";O.identifier=new RegExp(e+u,"g"),O.identifierStart=new RegExp(e),O.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+d+o+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;O.newline=/[\n\r\u2028\u2029]/,O.lineBreak=new RegExp(`\r
|`+O.newline.source),O.allLineBreaks=new RegExp(O.lineBreak.source,"g")},function(A,O,_){var f=_(6).Options,d=["before-newline","after-newline","preserve-newline"];function o(e){f.call(this,e,"js");var u=this.raw_options.brace_style||null;u==="expand-strict"?this.raw_options.brace_style="expand":u==="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 s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t<s.length;t++)s[t]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[t];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",d),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}o.prototype=new f,A.exports.Options=o},function(A){function O(d,o){this.raw_options=_(d,o),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"])}O.prototype._get_array=function(d,o){var e=this.raw_options[d],u=o||[];return typeof e=="object"?e!==null&&typeof e.concat=="function"&&(u=e.concat()):typeof e=="string"&&(u=e.split(/[^a-zA-Z0-9_\/\-]+/)),u},O.prototype._get_boolean=function(d,o){var e=this.raw_options[d],u=e===void 0?!!o:!!e;return u},O.prototype._get_characters=function(d,o){var e=this.raw_options[d],u=o||"";return typeof e=="string"&&(u=e.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},O.prototype._get_number=function(d,o){var e=this.raw_options[d];o=parseInt(o,10),isNaN(o)&&(o=0);var u=parseInt(e,10);return isNaN(u)&&(u=o),u},O.prototype._get_selection=function(d,o,e){var u=this._get_selection_list(d,o,e);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[d]+"'");return u[0]},O.prototype._get_selection_list=function(d,o,e){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(e=e||[o[0]],!this._is_valid_selection(e,o))throw new Error("Invalid Default Value!");var u=this._get_array(d,e);if(!this._is_valid_selection(u,o))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[d]+"'");return u},O.prototype._is_valid_selection=function(d,o){return d.length&&o.length&&!d.some(function(e){return o.indexOf(e)===-1})};function _(d,o){var e={};d=f(d);var u;for(u in d)u!==o&&(e[u]=d[u]);if(o&&d[o])for(u in d[o])e[u]=d[o][u];return e}function f(d){var o={},e;for(e in d){var u=e.replace(/-/g,"_");o[u]=d[e]}return o}A.exports.Options=O,A.exports.normalizeOpts=f,A.exports.mergeOpts=_},function(A,O,_){var f=_(8).InputScanner,d=_(9).Tokenizer,o=_(9).TOKEN,e=_(13).Directives,u=_(4),s=_(12).Pattern,t=_(14).TemplatablePattern;function n(x,P){return P.indexOf(x)!==-1}var r={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:o.START,RAW:o.RAW,EOF:o.EOF},E=new e(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,p=/[0-9]/,y=/[^\d\.]/,v=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),a=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";a=a.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),a="\\?\\.(?!\\d) "+a,a=a.replace(/ /g,"|");var c=new RegExp(a),i="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),l=i.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),g=new RegExp("^(?:"+l.join("|")+")$"),h,b=function(x,P){d.call(this,x,P),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new s(this._input),k=new t(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(u.identifier).matching(u.identifierMatch),number:M.matching(m),punct:M.matching(c),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(u.lineBreak),shebang:M.starting_with(/#!/).until_after(u.lineBreak),xml:M.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:k.until(/['\\\n\r\u2028\u2029]/),double_quote:k.until(/["\\\n\r\u2028\u2029]/),template_text:k.until(/[`\\$]/),template_expression:k.until(/[`}\\]/)}};b.prototype=new d,b.prototype._is_comment=function(x){return x.type===r.COMMENT||x.type===r.BLOCK_COMMENT||x.type===r.UNKNOWN},b.prototype._is_opening=function(x){return x.type===r.START_BLOCK||x.type===r.START_EXPR},b.prototype._is_closing=function(x,P){return(x.type===r.END_BLOCK||x.type===r.END_EXPR)&&P&&(x.text==="]"&&P.text==="["||x.text===")"&&P.text==="("||x.text==="}"&&P.text==="{")},b.prototype._reset=function(){h=!1},b.prototype._get_next_token=function(x,P){var M=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(r.EOF,""):(M=M||this._read_non_javascript(k),M=M||this._read_string(k),M=M||this._read_word(x),M=M||this._read_singles(k),M=M||this._read_comment(k),M=M||this._read_regexp(k,x),M=M||this._read_xml(k,x),M=M||this._read_punctuation(),M=M||this._create_token(r.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(x){var P;if(P=this.__patterns.identifier.read(),P!=="")return P=P.replace(u.allLineBreaks,`
`),!(x.type===r.DOT||x.type===r.RESERVED&&(x.text==="set"||x.text==="get"))&&g.test(P)?(P==="in"||P==="of")&&(x.type===r.WORD||x.type===r.STRING)?this._create_token(r.OPERATOR,P):this._create_token(r.RESERVED,P):this._create_token(r.WORD,P);if(P=this.__patterns.number.read(),P!=="")return this._create_token(r.WORD,P)},b.prototype._read_singles=function(x){var P=null;return x==="("||x==="["?P=this._create_token(r.START_EXPR,x):x===")"||x==="]"?P=this._create_token(r.END_EXPR,x):x==="{"?P=this._create_token(r.START_BLOCK,x):x==="}"?P=this._create_token(r.END_BLOCK,x):x===";"?P=this._create_token(r.SEMICOLON,x):x==="."&&y.test(this._input.peek(1))?P=this._create_token(r.DOT,x):x===","&&(P=this._create_token(r.COMMA,x)),P&&this._input.next(),P},b.prototype._read_punctuation=function(){var x=this.__patterns.punct.read();if(x!=="")return x==="="?this._create_token(r.EQUALS,x):x==="?."?this._create_token(r.DOT,x):this._create_token(r.OPERATOR,x)},b.prototype._read_non_javascript=function(x){var P="";if(x==="#"){if(this._is_first_token()&&(P=this.__patterns.shebang.read(),P))return this._create_token(r.UNKNOWN,P.trim()+`
`);if(P=this.__patterns.include.read(),P)return this._create_token(r.UNKNOWN,P.trim()+`
`);x=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(p)){do x=this._input.next(),M+=x;while(this._input.hasNext()&&x!=="#"&&x!=="=");return x==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(r.WORD,M)}this._input.back()}else if(x==="<"&&this._is_first_token()){if(P=this.__patterns.html_comment_start.read(),P){for(;this._input.hasNext()&&!this._input.testChar(u.newline);)P+=this._input.next();return h=!0,this._create_token(r.COMMENT,P)}}else if(h&&x==="-"&&(P=this.__patterns.html_comment_end.read(),P))return h=!1,this._create_token(r.COMMENT,P);return null},b.prototype._read_comment=function(x){var P=null;if(x==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var k=E.get_directives(M);k&&k.ignore==="start"&&(M+=E.readIgnored(this._input)),M=M.replace(u.allLineBreaks,`
`),P=this._create_token(r.BLOCK_COMMENT,M),P.directives=k}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),P=this._create_token(r.COMMENT,M))}return P},b.prototype._read_string=function(x){if(x==="`"||x==="'"||x==='"'){var P=this._input.next();return this.has_char_escapes=!1,x==="`"?P+=this._read_string_recursive("`",!0,"${"):P+=this._read_string_recursive(x),this.has_char_escapes&&this._options.unescape_strings&&(P=R(P)),this._input.peek()===x&&(P+=this._input.next()),P=P.replace(u.allLineBreaks,`
`),this._create_token(r.STRING,P)}return null},b.prototype._allow_regexp_or_xml=function(x){return x.type===r.RESERVED&&n(x.text,["return","case","throw","else","do","typeof","yield"])||x.type===r.END_EXPR&&x.text===")"&&x.opened.previous.type===r.RESERVED&&n(x.opened.previous.text,["if","while","for"])||n(x.type,[r.COMMENT,r.START_EXPR,r.START_BLOCK,r.START,r.END_BLOCK,r.OPERATOR,r.EQUALS,r.EOF,r.SEMICOLON,r.COMMA])},b.prototype._read_regexp=function(x,P){if(x==="/"&&this._allow_regexp_or_xml(P)){for(var M=this._input.next(),k=!1,C=!1;this._input.hasNext()&&(k||C||this._input.peek()!==x)&&!this._input.testChar(u.newline);)M+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===x&&(M+=this._input.next(),M+=this._input.read(u.identifier)),this._create_token(r.STRING,M)}return null},b.prototype._read_xml=function(x,P){if(this._options.e4x&&x==="<"&&this._allow_regexp_or_xml(P)){var M="",k=this.__patterns.xml.read_match();if(k){for(var C=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),U=C.indexOf("{")===0,K=0;k;){var ee=!!k[1],z=k[2],ae=!!k[k.length-1]||z.slice(0,8)==="![CDATA[";if(!ae&&(z===C||U&&z.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ee?--K:++K),M+=k[0],K<=0)break;k=this.__patterns.xml.read_match()}return k||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(u.allLineBreaks,`
`),this._create_token(r.STRING,M)}}return null};function R(x){for(var P="",M=0,k=new f(x),C=null;k.hasNext();)if(C=k.match(/([\s]|[^\\]|\\\\)+/g),C&&(P+=C[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")C=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")C=k.match(/u([0-9A-Fa-f]{4})/g);else{P+="\\",k.hasNext()&&(P+=k.next());continue}if(!C)return x;if(M=parseInt(C[1],16),M>126&&M<=255&&C[0].indexOf("x")===0)return x;if(M>=0&&M<32){P+="\\"+C[0];continue}else M===34||M===39||M===92?P+="\\"+String.fromCharCode(M):P+=String.fromCharCode(M)}return P}b.prototype._read_string_recursive=function(x,P,M){var k,C;x==="'"?C=this.__patterns.single_quote:x==='"'?C=this.__patterns.double_quote:x==="`"?C=this.__patterns.template_text:x==="}"&&(C=this.__patterns.template_expression);for(var U=C.read(),K="";this._input.hasNext();){if(K=this._input.next(),K===x||!P&&u.newline.test(K)){this._input.back();break}else K==="\\"&&this._input.hasNext()?(k=this._input.peek(),k==="x"||k==="u"?this.has_char_escapes=!0:k==="\r"&&this._input.peek(1)===`
`&&this._input.next(),K+=this._input.next()):M&&(M==="${"&&K==="$"&&this._input.peek()==="{"&&(K+=this._input.next()),M===K&&(x==="`"?K+=this._read_string_recursive("}",P,"`"):K+=this._read_string_recursive("`",P,"${"),this._input.hasNext()&&(K+=this._input.next())));K+=C.read(),U+=K}return U},A.exports.Tokenizer=b,A.exports.TOKEN=r,A.exports.positionable_operators=v.slice(),A.exports.line_starters=i.slice()},function(A){var O=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 d=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(d=this.__input.charAt(f)),d},_.prototype.__match=function(f,d){f.lastIndex=d;var o=f.exec(this.__input);return o&&!(O&&f.sticky)&&(o.index!==d&&(o=null)),o},_.prototype.test=function(f,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(f,d):!1},_.prototype.testChar=function(f,d){var o=this.peek(d);return f.lastIndex=0,o!==null&&f.test(o)},_.prototype.match=function(f){var d=this.__match(f,this.__position);return d?this.__position+=d[0].length:d=null,d},_.prototype.read=function(f,d,o){var e="",u;return f&&(u=this.match(f),u&&(e+=u[0])),d&&(u||!f)&&(e+=this.readUntil(d,o)),e},_.prototype.readUntil=function(f,d){var o="",e=this.__position;f.lastIndex=this.__position;var u=f.exec(this.__input);return u?(e=u.index,d&&(e+=u[0].length)):e=this.__input_length,o=this.__input.substring(this.__position,e),this.__position=e,o},_.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},_.prototype.get_regexp=function(f,d){var o=null,e="g";return d&&O&&(e="y"),typeof f=="string"&&f!==""?o=new RegExp(f,e):f&&(o=new RegExp(f.source,e)),o},_.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(f){var d=this.__position,o=this.readUntilAfter(f);return this.__position=d,o},_.prototype.lookBack=function(f){var d=this.__position-1;return d>=f.length&&this.__input.substring(d-f.length,d).toLowerCase()===f},A.exports.InputScanner=_},function(A,O,_){var f=_(8).InputScanner,d=_(3).Token,o=_(10).TokenStream,e=_(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(t,n){this._input=new f(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new e(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,n=new d(u.START,""),r=null,E=[],m=new o;n.type!==u.EOF;){for(t=this._get_next_token(n,r);this._is_comment(t);)m.add(t),t=this._get_next_token(n,r);m.isEmpty()||(t.comments_before=m,m=new o),t.parent=r,this._is_opening(t)?(E.push(r),r=t):r&&this._is_closing(t,r)&&(t.opened=r,r.closed=t,r=E.pop(),t.parent=r),t.previous=n,n.next=t,this.__tokens.add(t),n=t}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(t,n){this._readWhitespace();var r=this._input.read(/.+/g);return r?this._create_token(u.RAW,r):this._create_token(u.EOF,"")},s.prototype._is_comment=function(t){return!1},s.prototype._is_opening=function(t){return!1},s.prototype._is_closing=function(t,n){return!1},s.prototype._create_token=function(t,n){var r=new d(t,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return r},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},A.exports.Tokenizer=s,A.exports.TOKEN=u},function(A){function O(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}O.prototype.restart=function(){this.__position=0},O.prototype.isEmpty=function(){return this.__tokens_length===0},O.prototype.hasNext=function(){return this.__position<this.__tokens_length},O.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},O.prototype.peek=function(_){var f=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(f=this.__tokens[_]),f},O.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},A.exports.TokenStream=O},function(A,O,_){var f=_(12).Pattern;function d(o,e){f.call(this,o,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new f,d.prototype.__set_whitespace_patterns=function(o,e){o+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var e=this.__split(this._newline_regexp,o);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return o},d.prototype.matching=function(o,e){var u=this._create();return u.__set_whitespace_patterns(o,e),u._update(),u},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(o,e){o.lastIndex=0;for(var u=0,s=[],t=o.exec(e);t;)s.push(e.substring(u,t.index)),u=t.index+t[0].length,t=o.exec(e);return u<e.length?s.push(e.substring(u,e.length)):s.push(""),s},A.exports.WhitespacePattern=d},function(A){function O(_,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)}O.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)),_},O.prototype.read_match=function(){return this._input.match(this._match_pattern)},O.prototype.until_after=function(_){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(_),f._update(),f},O.prototype.until=function(_){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(_),f._update(),f},O.prototype.starting_with=function(_){var f=this._create();return f._starting_pattern=this._input.get_regexp(_,!0),f._update(),f},O.prototype.matching=function(_){var f=this._create();return f._match_pattern=this._input.get_regexp(_,!0),f._update(),f},O.prototype._create=function(){return new O(this._input,this)},O.prototype._update=function(){},A.exports.Pattern=O},function(A){function O(_,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")}O.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(_);d;)f[d[1]]=d[2],d=this.__directive_pattern.exec(_);return f},O.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=O},function(A,O,_){var f=_(12).Pattern,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(e,u){f.call(this,e,u),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new f(e);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new f,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(e){var u=this._create();return u._disabled[e]=!0,u._update(),u},o.prototype.read_options=function(e){var u=this._create();for(var s in d)u._disabled[s]=e.templating.indexOf(s)===-1;return u._update(),u},o.prototype.exclude=function(e){var u=this._create();return u._excluded[e]=!0,u._update(),u},o.prototype.read=function(){var e="";this._match_pattern?e=this._input.read(this._starting_pattern):e=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),e+=u,u=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},o.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},o.prototype._read_template=function(){var e="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(e=e||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(e=e||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(e=e||this.__patterns.handlebars_comment.read(),e=e||this.__patterns.handlebars_unescaped.read(),e=e||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=e||this.__patterns.django_comment.read(),e=e||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=e||this.__patterns.smarty_comment.read(),e=e||this.__patterns.smarty_literal.read(),e=e||this.__patterns.smarty.read()));return e},A.exports.TemplatablePattern=o}],w={};function D(A){var O=w[A];if(O!==void 0)return O.exports;var _=w[A]={exports:{}};return T[A](_,_.exports,D),_.exports}var I=D(0);S=I})();var L=S;!(fe=[],N=function(){return{js_beautify:L}}.apply(Fe,fe),N!==void 0&&(Xe.exports=N))})()},"815F":function(Xe,Fe,B){"use strict";B.d(Fe,"e",function(){return D}),B.d(Fe,"c",function(){return A}),B.d(Fe,"d",function(){return O}),B.d(Fe,"a",function(){return f}),B.d(Fe,"f",function(){return d}),B.d(Fe,"b",function(){return o});var fe=B("KQm4"),N=B("VTBJ"),S=B("Ff2n"),L=B("Zm9Q"),T=B("Kwbf"),w=B("OZM5");function D(e,u){return e!=null?e:u}function I(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=new Map;function s(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(r){var E=r.key,m=r.children;Object(T.a)(E!=null,"Tree node must have a certain key: [".concat(n).concat(E,"]"));var p=String(E);Object(T.a)(!u.has(p)||E===null||E===void 0,"Same 'key' exist in the Tree: ".concat(p)),u.set(p,!0),s(m,"".concat(n).concat(p," > "))})}s(e)}function A(e){function u(s){var t=Object(L.a)(s);return t.map(function(n){if(!Object(w.i)(n))return Object(T.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var r=n.key,E=n.props,m=E.children,p=Object(S.a)(E,["children"]),y=Object(N.a)({key:r},p),v=u(m);return v.length&&(y.children=v),y}).filter(function(n){return n})}return u(e)}function O(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(u===!0?[]:u),t=[];function n(r){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return r.map(function(m,p){var y=Object(w.h)(E?E.pos:"0",p),v=D(m.key,y),a=Object(N.a)(Object(N.a)({},m),{},{parent:E,pos:y,children:null,data:m,isStart:[].concat(Object(fe.a)(E?E.isStart:[]),[p===0]),isEnd:[].concat(Object(fe.a)(E?E.isEnd:[]),[p===r.length-1])});return t.push(a),u===!0||s.has(v)?a.children=n(m.children||[],a):a.children=[],a})}return n(e),t}function _(e,u,s){var t;s?typeof s=="string"?t=function(E){return E[s]}:typeof s=="function"&&(t=function(E){return s(E)}):t=function(E,m){return D(E.key,m)};function n(r,E,m){var p=r?r.children:e,y=r?Object(w.h)(m.pos,E):"0";if(r){var v=t(r,y),a={node:r,index:E,pos:y,key:v,parentPos:m.node?m.pos:null,level:m.level+1};u(a)}p&&p.forEach(function(c,i){n(c,i,{node:r,pos:y,level:m?m.level+1:-1})})}n(null)}function f(e){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=u.initWrapper,t=u.processEntity,n=u.onProcessFinished,r=arguments.length>2?arguments[2]:void 0,E={},m={},p={posEntities:E,keyEntities:m};return s&&(p=s(p)||p),_(e,function(y){var v=y.node,a=y.index,c=y.pos,i=y.key,l=y.parentPos,g=y.level,h={node:v,index:a,key:i,pos:c,level:g},b=D(i,c);E[c]=h,m[b]=h,h.parent=E[l],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),t&&t(h,p)},r),n&&n(p),p}function d(e,u){var s=u.expandedKeys,t=u.selectedKeys,n=u.loadedKeys,r=u.loadingKeys,E=u.checkedKeys,m=u.halfCheckedKeys,p=u.dragOverNodeKey,y=u.dropPosition,v=u.keyEntities,a=v[e],c={eventKey:e,expanded:s.indexOf(e)!==-1,selected:t.indexOf(e)!==-1,loaded:n.indexOf(e)!==-1,loading:r.indexOf(e)!==-1,checked:E.indexOf(e)!==-1,halfChecked:m.indexOf(e)!==-1,pos:String(a?a.pos:""),dragOver:p===e&&y===0,dragOverGapTop:p===e&&y===-1,dragOverGapBottom:p===e&&y===1};return c}function o(e){var u=e.data,s=e.expanded,t=e.selected,n=e.checked,r=e.loaded,E=e.loading,m=e.halfChecked,p=e.dragOver,y=e.dragOverGapTop,v=e.dragOverGapBottom,a=e.pos,c=e.active,i=Object(N.a)(Object(N.a)({},u),{},{expanded:s,selected:t,checked:n,loaded:r,loading:E,halfChecked:m,dragOver:p,dragOverGapTop:y,dragOverGapBottom:v,pos:a,active:c});return"props"in i||Object.defineProperty(i,"props",{get:function(){return Object(T.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),i}},"8hTe":function(Xe,Fe,B){Xe.exports={button:"button___1wy9m"}},"9Bee":function(Xe,Fe,B){"use strict";var fe=B("DYRE"),N=B("zeV3"),S=B("+L6B"),L=B("2/Rp"),T=B("k1fw"),w=B("tJVT"),D=B("cDcd"),I=B.n(D),A=B("vg9a"),O=B("DlQD"),_=B.n(O),f=B("rUJ1");function d(V,Y){var q=V.match(/^(\s+)(?:```)/);if(q===null)return Y;var G=q[1];return Y.split(`
`).map(function(X){var de=X.match(/^\s+/);if(de===null)return X;var Ee=Object(w.a)(de,1),Oe=Ee[0];return Oe.length>=G.length?X.slice(G.length):X}).join(`
`)}var o=[],e=["<ul>"],u=new _.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function t(){o.length=0,e=["<ul>"]}var n={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function r(V,Y,q,G){if(Y>=V.length||V[Y].level<=q)return Y;var X=V[Y];G.push("<li><a href='#"+X.anchor+"'>"+X.text+"</a>"),Y++;var de=[];return Y=r(V,Y,X.level,de),de.length>0&&(G.push("<ul>"),de.forEach(function(Ee){G.push(Ee)}),G.push("</ul>")),G.push("</li>"),Y=r(V,Y,q,G),Y}function E(){return r(o,0,0,e),e.push("</ul>"),e.join("")}var m={heading:function(Y){var q=s.exec(Y);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},fences:function(Y){var q=this.rules.block.fences.exec(Y);if(q){var G=q[0],X=d(G,q[3]||""),de=q[2]?q[2].trim():q[2];if(["latex","katex","math"].indexOf(de)>=0){var Ee=v(),Oe=X;X=Ee,a[Ee]={type:"block",expression:Oe}}return{type:"code",raw:G,lang:de,text:X}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,v=function(){return"__special_katext_id_".concat(y++,"__")},a={};function c(){return a}function i(){y=0,a={}}function l(V){return V=V.replace(p,function(Y,q){var G=v();return a[G]={type:"inline",expression:q},G}),V}var g=u.listitem;u.listitem=function(V){return g(l(V))};var h=u.paragraph;u.paragraph=function(V){return h(l(V))};var b=u.tablecell;u.tablecell=function(V,Y){return b(l(V),Y)},u.code=function(V,Y,q){var G=(Y||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"<p class='editormd-tex'>".concat(V,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Y,'">').concat(q?V:Object(f.escape)(V,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(q?V:Object(f.escape)(V,!0))+"</code></pre>"},u.heading=function(V,Y,q){var G=this.options.headerPrefix+q.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:G,level:Y,text:V}),"<h"+Y+' id="'+G+'">'+V+"</h"+Y+">"},_.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),_.a.use({tokenizer:m,renderer:u});var R=_.a,x=B("SJMd"),P=B("ulZh"),M=B.n(P),k=B("m3rI"),C=B("Oy/b"),U=B("p5ED"),K=B("8hTe"),ee=B.n(K),z=/<pre[^>]*>/g;function ae(V){var Y=document.createElement("div");return Y.innerHTML=V,Y.childNodes.length===0?"":Y.childNodes[0].nodeValue}var se=Fe.a=function(V){var Y=V.value,q=Y===void 0?"":Y,G=V.edit,X=G===void 0?!1:G,de=V.className,Ee=V.showTextOnly,Oe=V.showLines,me=V.replaces,Se=V.zoomImg,ve=V.hasMask,be=V.style,Ae=be===void 0?{}:be,Re=V.stylesPrev,Le=Re===void 0?{}:Re,Ce=String(q),xe=Object(D.useRef)(),Be=Object(D.useRef)(),Me=Object(D.useState)(""),ge=Object(w.a)(Me,2),De=ge[0],Ge=ge[1],We=Object(D.useState)("office"),Ke=Object(w.a)(We,2),Pe=Ke[0],Ve=Ke[1],He=Object(D.useMemo)(function(){try{var oe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,W=/\"\/api\/attachments\/|\"\/attachments\/download\//g,H=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ce=Ce.replace(oe,"("+k.a.API_SERVER+"/api/attachments/").replace(W,'"'+k.a.API_SERVER+"/api/attachments/").replace(H,'"'+k.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(we){}var Q=R(Ce),le=c();if(Ce.match(/\[TOC\]/)&&(Q=Q.replace("<p>[TOC]</p>",E()),t()),Q=Q.replace(/(__special_katext_id_\d+__)/g,function(we,Ne){var $e=le[Ne],nt=$e.type,Ze=$e.expression;return Object(C.renderToString)(ae(Ze)||"",{displayMode:nt==="block",throwOnError:!1,output:"html"})}),Q=Q.replace(/▁/g,"\u2581\u2581\u2581"),i(),Ee){var ye=document.createElement("div");return ye.innerHTML=Q,ye.innerText}return setTimeout(function(){return J()},500),Q},[Ce]),Te=Object(D.useRef)();n.WebkitLineClamp=Oe,Oe&&(Ae=Object(T.a)(Object(T.a)({},Ae),n));function Ue(oe){var W=oe.target;if(W.tagName.toUpperCase()==="IMG"){if(Se){var H=W.getAttribute("src");Ge(H),Ve("image")}}else if(W.tagName.toUpperCase()==="A"){var Q=W.getAttribute("href");if(Q.indexOf("office")>-1)oe.preventDefault(),Ge(Q),Ve("office");else if(Q.indexOf("application/pdf")>-1)oe.preventDefault(),Ge(Q),Ve("pdf");else if(Q.indexOf("text/html")>-1)oe.preventDefault(),Ge(Q),Ve("html");else if(Q.startsWith("#")){oe.preventDefault();var le=document.getElementById(Q.replace("#",""));le&&le.scrollIntoView(!0)}}}var J=function(){var W,H=(W=Te.current)===null||W===void 0?void 0:W.querySelectorAll("video");H==null||H.forEach(function(Q){if(Q.oncontextmenu=function(){return!1},Q.src.indexOf(".m3u8")>-1&&!Q.canPlayType("application/vnd.apple.mpegurl")){if(M.a.isSupported()){var le=new M.a;le.loadSource(Q.src),le.attachMedia(Q)}}})};Object(D.useEffect)(function(){if(Te.current&&He&&(He.match(z)&&window.PR.prettyPrint()),Te.current)return Te.current.addEventListener("click",Ue),function(){Te.current.removeEventListener("click",Ue),i(),t()}},[He,Te.current,Ue]);var re=function(W){if(!X)return;W.target.nodeName==="IMG"?(xe.current.style.display="flex",xe.current.style.width=W.target.clientWidth+"px",xe.current.style.height=W.target.clientHeight+"px",xe.current.style.top=W.target.offsetTop+"px",xe.current.style.left=W.target.offsetLeft+"px",Be.current.src=W.target.getAttribute("src")):xe.current.style.display="none"};return I.a.createElement("div",{style:{position:"relative"}},I.a.createElement("div",{ref:Te,style:Object(T.a)({},Ae),className:"".concat(de||""," markdown-body ").concat(ee.a.mdBody),onMouseOver:re,dangerouslySetInnerHTML:{__html:He}}),I.a.createElement("div",{ref:xe,className:ee.a.button},I.a.createElement(N.a,null,I.a.createElement(L.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),I.a.createElement(L.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),I.a.createElement("img",{ref:Be,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),I.a.createElement(U.a,{close:!0,data:De,type:De!=null&&De.length?Pe:"",style:Object(T.a)({},Le),onClose:function(){return Ge("")}}))}},BU3w:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return w});var fe=B("MNnm"),N="rc-util-key";function S(D){if(D.attachTo)return D.attachTo;var I=document.querySelector("head");return I||document.body}function L(D){var I,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(fe.a)())return null;var O=document.createElement("style");if((I=A.csp)===null||I===void 0?void 0:I.nonce){var _;O.nonce=(_=A.csp)===null||_===void 0?void 0:_.nonce}O.innerHTML=D;var f=S(A),d=f.firstChild;return A.prepend&&f.prepend?f.prepend(O):A.prepend&&d?f.insertBefore(O,d):f.appendChild(O),O}var T=new Map;function w(D,I){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},O=S(A);if(!T.has(O)){var _=L("",A),f=_.parentNode;T.set(O,f),f.removeChild(_)}var d=Array.from(T.get(O).children).find(function(t){return t.tagName==="STYLE"&&t[N]===I});if(d){var o,e;if(((o=A.csp)===null||o===void 0?void 0:o.nonce)&&d.nonce!==((e=A.csp)===null||e===void 0?void 0:e.nonce)){var u;d.nonce=(u=A.csp)===null||u===void 0?void 0:u.nonce}return d.innerHTML!==D&&(d.innerHTML=D),d}var s=L(D,A);return s[N]=I,s}},BdwD:function(Xe,Fe,B){"use strict";var fe=B("+L6B"),N=B("2/Rp"),S=B("0Owb"),L=B("k1fw"),T=B("cDcd"),w=B.n(T),D=B("FOrL"),I=B.n(D),A=function(_){var f=_.buttonProps,d=f===void 0?{}:f,o=_.styles,e=o===void 0?{}:o,u=_.customText,s=_.ButtonText,t=_.ButtonClick,n=_.Buttonclass,r=_.ButtonTwo;return w.a.createElement("section",{className:"tc animated fadeIn",style:Object(L.a)(Object(L.a)({},{color:"#999",margin:"200px auto"}),e)},w.a.createElement("img",{src:I.a}),w.a.createElement("p",{className:"mt20 font14"},u||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&w.a.createElement(N.a,Object(S.a)({className:n,onClick:t},d),s),r&&r)};Fe.a=A},DlQD:function(Xe,Fe,B){(function(fe,N){Xe.exports=N()})(this,function(){"use strict";function fe(J,re){for(var oe=0;oe<re.length;oe++){var W=re[oe];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(J,W.key,W)}}function N(J,re,oe){return re&&fe(J.prototype,re),oe&&fe(J,oe),J}function S(J,re){if(!J)return;if(typeof J=="string")return L(J,re);var oe=Object.prototype.toString.call(J).slice(8,-1);if(oe==="Object"&&J.constructor&&(oe=J.constructor.name),oe==="Map"||oe==="Set")return Array.from(J);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return L(J,re)}function L(J,re){(re==null||re>J.length)&&(re=J.length);for(var oe=0,W=new Array(re);oe<re;oe++)W[oe]=J[oe];return W}function T(J,re){var oe;if(typeof Symbol=="undefined"||J[Symbol.iterator]==null){if(Array.isArray(J)||(oe=S(J))||re&&J&&typeof J.length=="number"){oe&&(J=oe);var W=0;return function(){return W>=J.length?{done:!0}:{done:!1,value:J[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.`)}return oe=J[Symbol.iterator](),oe.next.bind(oe)}function w(J,re){return re={exports:{}},J(re,re.exports),re.exports}var D=w(function(J){function re(){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 oe(W){J.exports.defaults=W}J.exports={defaults:re(),getDefaults:re,changeDefaults:oe}}),I=D.defaults,A=D.getDefaults,O=D.changeDefaults,_=/[&<>"']/,f=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},u=function(re){return e[re]};function s(J,re){if(re){if(_.test(J))return J.replace(f,u)}else if(d.test(J))return J.replace(o,u);return J}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(J){return J.replace(t,function(re,oe){return oe=oe.toLowerCase(),oe==="colon"?":":oe.charAt(0)==="#"?oe.charAt(1)==="x"?String.fromCharCode(parseInt(oe.substring(2),16)):String.fromCharCode(+oe.substring(1)):""})}var r=/(^|[^\[])\^/g;function E(J,re){J=J.source||J,re=re||"";var oe={replace:function(H,Q){return Q=Q.source||Q,Q=Q.replace(r,"$1"),J=J.replace(H,Q),oe},getRegex:function(){return new RegExp(J,re)}};return oe}var m=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function y(J,re,oe){if(J){var W;try{W=decodeURIComponent(n(oe)).replace(m,"").toLowerCase()}catch(H){return null}if(W.indexOf("javascript:")===0||W.indexOf("vbscript:")===0||W.indexOf("data:")===0)return null}re&&!p.test(oe)&&(oe=l(re,oe));try{oe=encodeURI(oe).replace(/%25/g,"%")}catch(H){return null}return oe}var v={},a=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(J,re){v[" "+J]||(a.test(J)?v[" "+J]=J+"/":v[" "+J]=R(J,"/",!0)),J=v[" "+J];var oe=J.indexOf(":")===-1;return re.substring(0,2)==="//"?oe?re:J.replace(c,"$1")+re:re.charAt(0)==="/"?oe?re:J.replace(i,"$1")+re:J+re}var g={exec:function(){}};function h(J){for(var re=1,oe,W;re<arguments.length;re++){oe=arguments[re];for(W in oe)Object.prototype.hasOwnProperty.call(oe,W)&&(J[W]=oe[W])}return J}function b(J,re){var oe=J.replace(/\|/g,function(Q,le,ye){for(var we=!1,Ne=le;--Ne>=0&&ye[Ne]==="\\";)we=!we;return we?"|":" |"}),W=oe.split(/ \|/),H=0;if(W.length>re)W.splice(re);else for(;W.length<re;)W.push("");for(;H<W.length;H++)W[H]=W[H].trim().replace(/\\\|/g,"|");return W}function R(J,re,oe){var W=J.length;if(W===0)return"";for(var H=0;H<W;){var Q=J.charAt(W-H-1);if(Q===re&&!oe)H++;else if(Q!==re&&oe)H++;else break}return J.substr(0,W-H)}function x(J,re){if(J.indexOf(re[1])===-1)return-1;for(var oe=J.length,W=0,H=0;H<oe;H++)if(J[H]==="\\")H++;else if(J[H]===re[0])W++;else if(J[H]===re[1]&&(W--,W<0))return H;return-1}function P(J){J&&J.sanitize&&!J.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 M={escape:s,unescape:n,edit:E,cleanUrl:y,resolveUrl:l,noopTest:g,merge:h,splitCells:b,rtrim:R,findClosingBracket:x,checkSanitizeDeprecation:P},k=D.defaults,C=M.rtrim,U=M.splitCells,K=M.escape,ee=M.findClosingBracket;function z(J,re,oe){var W=re.href,H=re.title?K(re.title):null,Q=J[1].replace(/\\([\[\]])/g,"$1");return J[0].charAt(0)!=="!"?{type:"link",raw:oe,href:W,title:H,text:Q}:{type:"image",raw:oe,href:W,title:H,text:K(Q)}}function ae(J,re){var oe=J.match(/^(\s+)(?:```)/);if(oe===null)return re;var W=oe[1];return re.split(`
`).map(function(H){var Q=H.match(/^\s+/);if(Q===null)return H;var le=Q[0];return le.length>=W.length?H.slice(W.length):H}).join(`
`)}var se=function(){function J(oe){this.options=oe||k}var re=J.prototype;return re.space=function(W){var H=this.rules.block.newline.exec(W);if(H)return H[0].length>1?{type:"space",raw:H[0]}:{raw:`
`}},re.code=function(W,H){var Q=this.rules.block.code.exec(W);if(Q){var le=H[H.length-1];if(le&&le.type==="paragraph")return{raw:Q[0],text:Q[0].trimRight()};var ye=Q[0].replace(/^ {4}/gm,"");return{type:"code",raw:Q[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:C(ye,`
`)}}},re.fences=function(W){var H=this.rules.block.fences.exec(W);if(H){var Q=H[0],le=ae(Q,H[3]||"");return{type:"code",raw:Q,lang:H[2]?H[2].trim():H[2],text:le}}},re.heading=function(W){var H=this.rules.block.heading.exec(W);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},re.nptable=function(W){var H=this.rules.block.nptable.exec(W);if(H){var Q={type:"table",header:U(H[1].replace(/^ *| *\| *$/g,"")),align:H[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:H[3]?H[3].replace(/\n$/,"").split(`
`):[],raw:H[0]};if(Q.header.length===Q.align.length){var le=Q.align.length,ye;for(ye=0;ye<le;ye++)/^ *-+: *$/.test(Q.align[ye])?Q.align[ye]="right":/^ *:-+: *$/.test(Q.align[ye])?Q.align[ye]="center":/^ *:-+ *$/.test(Q.align[ye])?Q.align[ye]="left":Q.align[ye]=null;for(le=Q.cells.length,ye=0;ye<le;ye++)Q.cells[ye]=U(Q.cells[ye],Q.header.length);return Q}}},re.hr=function(W){var H=this.rules.block.hr.exec(W);if(H)return{type:"hr",raw:H[0]}},re.blockquote=function(W){var H=this.rules.block.blockquote.exec(W);if(H){var Q=H[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:H[0],text:Q}}},re.list=function(W){var H=this.rules.block.list.exec(W);if(H){for(var Q=H[0],le=H[2],ye=le.length>1,we=le[le.length-1]===")",Ne={type:"list",raw:Q,ordered:ye,start:ye?+le.slice(0,-1):"",loose:!1,items:[]},$e=H[0].match(this.rules.block.item),nt=!1,Ze,bt,ut,Qe,Dt,Tt,jt,Lt=$e.length,lt=0;lt<Lt;lt++)Ze=$e[lt],Q=Ze,bt=Ze.length,Ze=Ze.replace(/^ *([*+-]|\d+[.)]) */,""),~Ze.indexOf(`
`)&&(bt-=Ze.length,Ze=this.options.pedantic?Ze.replace(/^ {1,4}/gm,""):Ze.replace(new RegExp("^ {1,"+bt+"}","gm"),"")),lt!==Lt-1&&(ut=this.rules.block.bullet.exec($e[lt+1])[0],(ye?ut.length===1||!we&&ut[ut.length-1]===")":ut.length>1||this.options.smartLists&&ut!==le)&&(Qe=$e.slice(lt+1).join(`
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-Qe.length),lt=Lt-1)),Dt=nt||/\n\n(?!\s*$)/.test(Ze),lt!==Lt-1&&(nt=Ze.charAt(Ze.length-1)===`
`,Dt||(Dt=nt)),Dt&&(Ne.loose=!0),Tt=/^\[[ xX]\] /.test(Ze),jt=void 0,Tt&&(jt=Ze[1]!==" ",Ze=Ze.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:Q,task:Tt,checked:jt,loose:Dt,text:Ze});return Ne}},re.html=function(W){var H=this.rules.block.html.exec(W);if(H)return{type:this.options.sanitize?"paragraph":"html",raw:H[0],pre:!this.options.sanitizer&&(H[1]==="pre"||H[1]==="script"||H[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(H[0]):K(H[0]):H[0]}},re.def=function(W){var H=this.rules.block.def.exec(W);if(H){H[3]&&(H[3]=H[3].substring(1,H[3].length-1));var Q=H[1].toLowerCase().replace(/\s+/g," ");return{tag:Q,raw:H[0],href:H[2],title:H[3]}}},re.table=function(W){var H=this.rules.block.table.exec(W);if(H){var Q={type:"table",header:U(H[1].replace(/^ *| *\| *$/g,"")),align:H[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:H[3]?H[3].replace(/\n$/,"").split(`
`):[]};if(Q.header.length===Q.align.length){Q.raw=H[0];var le=Q.align.length,ye;for(ye=0;ye<le;ye++)/^ *-+: *$/.test(Q.align[ye])?Q.align[ye]="right":/^ *:-+: *$/.test(Q.align[ye])?Q.align[ye]="center":/^ *:-+ *$/.test(Q.align[ye])?Q.align[ye]="left":Q.align[ye]=null;for(le=Q.cells.length,ye=0;ye<le;ye++)Q.cells[ye]=U(Q.cells[ye].replace(/^ *\| *| *\| *$/g,""),Q.header.length);return Q}}},re.lheading=function(W){var H=this.rules.block.lheading.exec(W);if(H)return{type:"heading",raw:H[0],depth:H[2].charAt(0)==="="?1:2,text:H[1]}},re.paragraph=function(W){var H=this.rules.block.paragraph.exec(W);if(H)return{type:"paragraph",raw:H[0],text:H[1].charAt(H[1].length-1)===`
`?H[1].slice(0,-1):H[1]}},re.text=function(W,H){var Q=this.rules.block.text.exec(W);if(Q){var le=H[H.length-1];return le&&le.type==="text"?{raw:Q[0],text:Q[0]}:{type:"text",raw:Q[0],text:Q[0]}}},re.escape=function(W){var H=this.rules.inline.escape.exec(W);if(H)return{type:"escape",raw:H[0],text:K(H[1])}},re.tag=function(W,H,Q){var le=this.rules.inline.tag.exec(W);if(le)return!H&&/^<a /i.test(le[0])?H=!0:H&&/^<\/a>/i.test(le[0])&&(H=!1),!Q&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?Q=!0:Q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(Q=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:H,inRawBlock:Q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):K(le[0]):le[0]}},re.link=function(W){var H=this.rules.inline.link.exec(W);if(H){var Q=ee(H[2],"()");if(Q>-1){var le=H[0].indexOf("!")===0?5:4,ye=le+H[1].length+Q;H[2]=H[2].substring(0,Q),H[0]=H[0].substring(0,ye).trim(),H[3]=""}var we=H[2],Ne="";if(this.options.pedantic){var $e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);$e?(we=$e[1],Ne=$e[3]):Ne=""}else Ne=H[3]?H[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var nt=z(H,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},H[0]);return nt}},re.reflink=function(W,H){var Q;if((Q=this.rules.inline.reflink.exec(W))||(Q=this.rules.inline.nolink.exec(W))){var le=(Q[2]||Q[1]).replace(/\s+/g," ");if(le=H[le.toLowerCase()],!le||!le.href){var ye=Q[0].charAt(0);return{type:"text",raw:ye,text:ye}}var we=z(Q,le,Q[0]);return we}},re.strong=function(W,H,Q){Q===void 0&&(Q="");var le=this.rules.inline.strong.start.exec(W);if(le&&(!le[1]||le[1]&&(Q===""||this.rules.inline.punctuation.exec(Q)))){H=H.slice(-1*W.length);var ye=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var we;(le=ye.exec(H))!=null;)if(we=this.rules.inline.strong.middle.exec(H.slice(0,le.index+3)),we)return{type:"strong",raw:W.slice(0,we[0].length),text:W.slice(2,we[0].length-2)}}},re.em=function(W,H,Q){Q===void 0&&(Q="");var le=this.rules.inline.em.start.exec(W);if(le&&(!le[1]||le[1]&&(Q===""||this.rules.inline.punctuation.exec(Q)))){H=H.slice(-1*W.length);var ye=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var we;(le=ye.exec(H))!=null;)if(we=this.rules.inline.em.middle.exec(H.slice(0,le.index+2)),we)return{type:"em",raw:W.slice(0,we[0].length),text:W.slice(1,we[0].length-1)}}},re.codespan=function(W){var H=this.rules.inline.code.exec(W);if(H){var Q=H[2].replace(/\n/g," "),le=/[^ ]/.test(Q),ye=Q.startsWith(" ")&&Q.endsWith(" ");return le&&ye&&(Q=Q.substring(1,Q.length-1)),Q=K(Q,!0),{type:"codespan",raw:H[0],text:Q}}},re.br=function(W){var H=this.rules.inline.br.exec(W);if(H)return{type:"br",raw:H[0]}},re.del=function(W){var H=this.rules.inline.del.exec(W);if(H)return{type:"del",raw:H[0],text:H[1]}},re.autolink=function(W,H){var Q=this.rules.inline.autolink.exec(W);if(Q){var le,ye;return Q[2]==="@"?(le=K(this.options.mangle?H(Q[1]):Q[1]),ye="mailto:"+le):(le=K(Q[1]),ye=le),{type:"link",raw:Q[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},re.url=function(W,H){var Q;if(Q=this.rules.inline.url.exec(W)){var le,ye;if(Q[2]==="@")le=K(this.options.mangle?H(Q[0]):Q[0]),ye="mailto:"+le;else{var we;do we=Q[0],Q[0]=this.rules.inline._backpedal.exec(Q[0])[0];while(we!==Q[0]);le=K(Q[0]),Q[1]==="www."?ye="http://"+le:ye=le}return{type:"link",raw:Q[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},re.inlineText=function(W,H,Q){var le=this.rules.inline.text.exec(W);if(le){var ye;return H?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):K(le[0]):le[0]:ye=K(this.options.smartypants?Q(le[0]):le[0]),{type:"text",raw:le[0],text:ye}}},J}(),V=M.noopTest,Y=M.edit,q=M.merge,G={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:V,table:V,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};G._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,G._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,G.def=Y(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,G.item=Y(G.item,"gm").replace(/bull/g,G.bullet).getRegex(),G.list=Y(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._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",G._comment=/<!--(?!-?>)[\s\S]*?-->/,G.html=Y(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=Y(G._paragraph).replace("hr",G.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",G._tag).getRegex(),G.blockquote=Y(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=q({},G),G.gfm=q({},G.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*|$)"}),G.gfm.nptable=Y(G.gfm.nptable).replace("hr",G.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",G._tag).getRegex(),G.gfm.table=Y(G.gfm.table).replace("hr",G.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",G._tag).getRegex(),G.pedantic=q({},G.normal,{html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",G._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:V,paragraph:Y(G.normal._paragraph).replace("hr",G.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:V,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:V,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=Y(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=Y(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=Y(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=Y(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=Y(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=Y(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=Y(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=Y(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=Y(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=Y(X._blockSkip,"g").getRegex(),X.overlapSkip=Y(X._overlapSkip,"g").getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._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])?)+(?![-_])/,X.autolink=Y(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=Y(X.tag).replace("comment",G._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=Y(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=Y(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=Y(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=q({},X),X.pedantic=q({},X.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:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=q({},X.normal,{escape:Y(X.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),X.gfm.url=Y(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=q({},X.gfm,{br:Y(X.br).replace("{2,}","*").getRegex(),text:Y(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var de={block:G,inline:X},Ee=D.defaults,Oe=de.block,me=de.inline;function Se(J){return J.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 ve(J){var re="",oe,W,H=J.length;for(oe=0;oe<H;oe++)W=J.charCodeAt(oe),Math.random()>.5&&(W="x"+W.toString(16)),re+="&#"+W+";";return re}var be=function(){function J(oe){this.tokens=[],this.tokens.links=Object.create(null),this.options=oe||Ee,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var W={block:Oe.normal,inline:me.normal};this.options.pedantic?(W.block=Oe.pedantic,W.inline=me.pedantic):this.options.gfm&&(W.block=Oe.gfm,this.options.breaks?W.inline=me.breaks:W.inline=me.gfm),this.tokenizer.rules=W}J.lex=function(W,H){var Q=new J(H);return Q.lex(W)};var re=J.prototype;return re.lex=function(W){return W=W.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(W,this.tokens,!0),this.inline(this.tokens),this.tokens},re.blockTokens=function(W,H,Q){H===void 0&&(H=[]),Q===void 0&&(Q=!0),W=W.replace(/^ +$/gm,"");for(var le,ye,we,Ne;W;){if(le=this.tokenizer.space(W)){W=W.substring(le.raw.length),le.type&&H.push(le);continue}if(le=this.tokenizer.code(W,H)){W=W.substring(le.raw.length),le.type?H.push(le):(Ne=H[H.length-1],Ne.raw+=`
`+le.raw,Ne.text+=`
`+le.text);continue}if(le=this.tokenizer.fences(W)){W=W.substring(le.raw.length),H.push(le);continue}if(le=this.tokenizer.heading(W)){W=W.substring(le.raw.length),H.push(le);continue}if(le=this.tokenizer.nptable(W)){W=W.substring(le.raw.length),H.push(le);continue}if(le=this.tokenizer.hr(W)){W=W.substring(le.raw.length),H.push(le);continue}if(le=this.tokenizer.blockquote(W)){W=W.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],Q),H.push(le);continue}if(le=this.tokenizer.list(W)){for(W=W.substring(le.raw.length),we=le.items.length,ye=0;ye<we;ye++)le.items[ye].tokens=this.blockTokens(le.items[ye].text,[],!1);H.push(le);continue}if(le=this.tokenizer.html(W)){W=W.substring(le.raw.length),H.push(le);continue}if(Q&&(le=this.tokenizer.def(W))){W=W.substring(le.raw.length),this.tokens.links[le.tag]||(this.tokens.links[le.tag]={href:le.href,title:le.title});continue}if(le=this.tokenizer.table(W)){W=W.substring(le.raw.length),H.push(le);continue}if(le=this.tokenizer.lheading(W)){W=W.substring(le.raw.length),H.push(le);continue}if(Q&&(le=this.tokenizer.paragraph(W))){W=W.substring(le.raw.length),H.push(le);continue}if(le=this.tokenizer.text(W,H)){W=W.substring(le.raw.length),le.type?H.push(le):(Ne=H[H.length-1],Ne.raw+=`
`+le.raw,Ne.text+=`
`+le.text);continue}if(W){var $e="Infinite loop on byte: "+W.charCodeAt(0);if(this.options.silent){console.error($e);break}else throw new Error($e)}}return H},re.inline=function(W){var H,Q,le,ye,we,Ne,$e=W.length;for(H=0;H<$e;H++){Ne=W[H];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},ye=Ne.header.length,Q=0;Q<ye;Q++)Ne.tokens.header[Q]=[],this.inlineTokens(Ne.header[Q],Ne.tokens.header[Q]);for(ye=Ne.cells.length,Q=0;Q<ye;Q++)for(we=Ne.cells[Q],Ne.tokens.cells[Q]=[],le=0;le<we.length;le++)Ne.tokens.cells[Q][le]=[],this.inlineTokens(we[le],Ne.tokens.cells[Q][le]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(ye=Ne.items.length,Q=0;Q<ye;Q++)this.inline(Ne.items[Q].tokens);break}}}return W},re.inlineTokens=function(W,H,Q,le,ye){H===void 0&&(H=[]),Q===void 0&&(Q=!1),le===void 0&&(le=!1),ye===void 0&&(ye="");var we,Ne=W,$e;if(this.tokens.links){var nt=Object.keys(this.tokens.links);if(nt.length>0)for(;($e=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)nt.includes($e[0].slice($e[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,$e.index)+"["+"a".repeat($e[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;($e=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,$e.index)+"["+"a".repeat($e[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;W;){if(we=this.tokenizer.escape(W)){W=W.substring(we.raw.length),H.push(we);continue}if(we=this.tokenizer.tag(W,Q,le)){W=W.substring(we.raw.length),Q=we.inLink,le=we.inRawBlock,H.push(we);continue}if(we=this.tokenizer.link(W)){W=W.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,le)),H.push(we);continue}if(we=this.tokenizer.reflink(W,this.tokens.links)){W=W.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,le)),H.push(we);continue}if(we=this.tokenizer.strong(W,Ne,ye)){W=W.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],Q,le),H.push(we);continue}if(we=this.tokenizer.em(W,Ne,ye)){W=W.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],Q,le),H.push(we);continue}if(we=this.tokenizer.codespan(W)){W=W.substring(we.raw.length),H.push(we);continue}if(we=this.tokenizer.br(W)){W=W.substring(we.raw.length),H.push(we);continue}if(we=this.tokenizer.del(W)){W=W.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],Q,le),H.push(we);continue}if(we=this.tokenizer.autolink(W,ve)){W=W.substring(we.raw.length),H.push(we);continue}if(!Q&&(we=this.tokenizer.url(W,ve))){W=W.substring(we.raw.length),H.push(we);continue}if(we=this.tokenizer.inlineText(W,le,Se)){W=W.substring(we.raw.length),ye=we.raw.slice(-1),H.push(we);continue}if(W){var Ze="Infinite loop on byte: "+W.charCodeAt(0);if(this.options.silent){console.error(Ze);break}else throw new Error(Ze)}}return H},N(J,null,[{key:"rules",get:function(){return{block:Oe,inline:me}}}]),J}(),Ae=D.defaults,Re=M.cleanUrl,Le=M.escape,Ce=function(){function J(oe){this.options=oe||Ae}var re=J.prototype;return re.code=function(W,H,Q){var le=(H||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(W,le);ye!=null&&ye!==W&&(Q=!0,W=ye)}return le?'<pre><code class="'+this.options.langPrefix+Le(le,!0)+'">'+(Q?W:Le(W,!0))+`</code></pre>
`:"<pre><code>"+(Q?W:Le(W,!0))+`</code></pre>
`},re.blockquote=function(W){return`<blockquote>
`+W+`</blockquote>
`},re.html=function(W){return W},re.heading=function(W,H,Q,le){return this.options.headerIds?"<h"+H+' id="'+this.options.headerPrefix+le.slug(Q)+'">'+W+"</h"+H+`>
`:"<h"+H+">"+W+"</h"+H+`>
`},re.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},re.list=function(W,H,Q){var le=H?"ol":"ul",ye=H&&Q!==1?' start="'+Q+'"':"";return"<"+le+ye+`>
`+W+"</"+le+`>
`},re.listitem=function(W){return"<li>"+W+`</li>
`},re.checkbox=function(W){return"<input "+(W?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},re.paragraph=function(W){return"<p>"+W+`</p>
`},re.table=function(W,H){return H&&(H="<tbody>"+H+"</tbody>"),`<table>
<thead>
`+W+`</thead>
`+H+`</table>
`},re.tablerow=function(W){return`<tr>
`+W+`</tr>
`},re.tablecell=function(W,H){var Q=H.header?"th":"td",le=H.align?"<"+Q+' align="'+H.align+'">':"<"+Q+">";return le+W+"</"+Q+`>
`},re.strong=function(W){return"<strong>"+W+"</strong>"},re.em=function(W){return"<em>"+W+"</em>"},re.codespan=function(W){return"<code>"+W+"</code>"},re.br=function(){return this.options.xhtml?"<br/>":"<br>"},re.del=function(W){return"<del>"+W+"</del>"},re.link=function(W,H,Q){if(W=Re(this.options.sanitize,this.options.baseUrl,W),W===null)return Q;var le='<a href="'+Le(W)+'"';return H&&(le+=' title="'+H+'"'),le+=">"+Q+"</a>",le},re.image=function(W,H,Q){if(W=Re(this.options.sanitize,this.options.baseUrl,W),W===null)return Q;var le='<img src="'+W+'" alt="'+Q+'"';return H&&(le+=' title="'+H+'"'),le+=this.options.xhtml?"/>":">",le},re.text=function(W){return W},J}(),xe=function(){function J(){}var re=J.prototype;return re.strong=function(W){return W},re.em=function(W){return W},re.codespan=function(W){return W},re.del=function(W){return W},re.html=function(W){return W},re.text=function(W){return W},re.link=function(W,H,Q){return""+Q},re.image=function(W,H,Q){return""+Q},re.br=function(){return""},J}(),Be=function(){function J(){this.seen={}}var re=J.prototype;return re.slug=function(W){var H=W.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(H)){var Q=H;do this.seen[Q]++,H=Q+"-"+this.seen[Q];while(this.seen.hasOwnProperty(H))}return this.seen[H]=0,H},J}(),Me=D.defaults,ge=M.unescape,De=function(){function J(oe){this.options=oe||Me,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xe,this.slugger=new Be}J.parse=function(W,H){var Q=new J(H);return Q.parse(W)};var re=J.prototype;return re.parse=function(W,H){H===void 0&&(H=!0);var Q="",le,ye,we,Ne,$e,nt,Ze,bt,ut,Qe,Dt,Tt,jt,Lt,lt,Bt,zt,rt,at=W.length;for(le=0;le<at;le++){Qe=W[le];switch(Qe.type){case"space":continue;case"hr":{Q+=this.renderer.hr();continue}case"heading":{Q+=this.renderer.heading(this.parseInline(Qe.tokens),Qe.depth,ge(this.parseInline(Qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{Q+=this.renderer.code(Qe.text,Qe.lang,Qe.escaped);continue}case"table":{for(bt="",Ze="",Ne=Qe.header.length,ye=0;ye<Ne;ye++)Ze+=this.renderer.tablecell(this.parseInline(Qe.tokens.header[ye]),{header:!0,align:Qe.align[ye]});for(bt+=this.renderer.tablerow(Ze),ut="",Ne=Qe.cells.length,ye=0;ye<Ne;ye++){for(nt=Qe.tokens.cells[ye],Ze="",$e=nt.length,we=0;we<$e;we++)Ze+=this.renderer.tablecell(this.parseInline(nt[we]),{header:!1,align:Qe.align[we]});ut+=this.renderer.tablerow(Ze)}Q+=this.renderer.table(bt,ut);continue}case"blockquote":{ut=this.parse(Qe.tokens),Q+=this.renderer.blockquote(ut);continue}case"list":{for(Dt=Qe.ordered,Tt=Qe.start,jt=Qe.loose,Ne=Qe.items.length,ut="",ye=0;ye<Ne;ye++)lt=Qe.items[ye],Bt=lt.checked,zt=lt.task,Lt="",lt.task&&(rt=this.renderer.checkbox(Bt),jt?lt.tokens.length>0&&lt.tokens[0].type==="text"?(lt.tokens[0].text=rt+" "+lt.tokens[0].text,lt.tokens[0].tokens&&lt.tokens[0].tokens.length>0&&lt.tokens[0].tokens[0].type==="text"&&(lt.tokens[0].tokens[0].text=rt+" "+lt.tokens[0].tokens[0].text)):lt.tokens.unshift({type:"text",text:rt}):Lt+=rt),Lt+=this.parse(lt.tokens,jt),ut+=this.renderer.listitem(Lt,zt,Bt);Q+=this.renderer.list(ut,Dt,Tt);continue}case"html":{Q+=this.renderer.html(Qe.text);continue}case"paragraph":{Q+=this.renderer.paragraph(this.parseInline(Qe.tokens));continue}case"text":{for(ut=Qe.tokens?this.parseInline(Qe.tokens):Qe.text;le+1<at&&W[le+1].type==="text";)Qe=W[++le],ut+=`
`+(Qe.tokens?this.parseInline(Qe.tokens):Qe.text);Q+=H?this.renderer.paragraph(ut):ut;continue}default:{var ot='Token with "'+Qe.type+'" type was not found.';if(this.options.silent){console.error(ot);return}else throw new Error(ot)}}}return Q},re.parseInline=function(W,H){H=H||this.renderer;var Q="",le,ye,we=W.length;for(le=0;le<we;le++){ye=W[le];switch(ye.type){case"escape":{Q+=H.text(ye.text);break}case"html":{Q+=H.html(ye.text);break}case"link":{Q+=H.link(ye.href,ye.title,this.parseInline(ye.tokens,H));break}case"image":{Q+=H.image(ye.href,ye.title,ye.text);break}case"strong":{Q+=H.strong(this.parseInline(ye.tokens,H));break}case"em":{Q+=H.em(this.parseInline(ye.tokens,H));break}case"codespan":{Q+=H.codespan(ye.text);break}case"br":{Q+=H.br();break}case"del":{Q+=H.del(this.parseInline(ye.tokens,H));break}case"text":{Q+=H.text(ye.text);break}default:{var Ne='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return Q},J}(),Ge=M.merge,We=M.checkSanitizeDeprecation,Ke=M.escape,Pe=D.getDefaults,Ve=D.changeDefaults,He=D.defaults;function Te(J,re,oe){if(typeof J=="undefined"||J===null)throw new Error("marked(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");if(typeof re=="function"&&(oe=re,re=null),re=Ge({},Te.defaults,re||{}),We(re),oe){var W=re.highlight,H;try{H=be.lex(J,re)}catch(we){return oe(we)}var Q=function(Ne){var $e;if(!Ne)try{$e=De.parse(H,re)}catch(nt){Ne=nt}return re.highlight=W,Ne?oe(Ne):oe(null,$e)};if(!W||W.length<3)return Q();if(delete re.highlight,!H.length)return Q();var le=0;Te.walkTokens(H,function(we){we.type==="code"&&(le++,setTimeout(function(){W(we.text,we.lang,function(Ne,$e){if(Ne)return Q(Ne);$e!=null&&$e!==we.text&&(we.text=$e,we.escaped=!0),le--,le===0&&Q()})},0))}),le===0&&Q();return}try{var ye=be.lex(J,re);return re.walkTokens&&Te.walkTokens(ye,re.walkTokens),De.parse(ye,re)}catch(we){if(we.message+=`
Please report this to https://github.com/markedjs/marked.`,re.silent)return"<p>An error occurred:</p><pre>"+Ke(we.message+"",!0)+"</pre>";throw we}}Te.options=Te.setOptions=function(J){return Ge(Te.defaults,J),Ve(Te.defaults),Te},Te.getDefaults=Pe,Te.defaults=He,Te.use=function(J){var re=Ge({},J);if(J.renderer&&function(){var W=Te.defaults.renderer||new Ce,H=function(ye){var we=W[ye];W[ye]=function(){for(var Ne=arguments.length,$e=new Array(Ne),nt=0;nt<Ne;nt++)$e[nt]=arguments[nt];var Ze=J.renderer[ye].apply(W,$e);return Ze===!1&&(Ze=we.apply(W,$e)),Ze}};for(var Q in J.renderer)H(Q);re.renderer=W}(),J.tokenizer&&function(){var W=Te.defaults.tokenizer||new se,H=function(ye){var we=W[ye];W[ye]=function(){for(var Ne=arguments.length,$e=new Array(Ne),nt=0;nt<Ne;nt++)$e[nt]=arguments[nt];var Ze=J.tokenizer[ye].apply(W,$e);return Ze===!1&&(Ze=we.apply(W,$e)),Ze}};for(var Q in J.tokenizer)H(Q);re.tokenizer=W}(),J.walkTokens){var oe=Te.defaults.walkTokens;re.walkTokens=function(W){J.walkTokens(W),oe&&oe(W)}}Te.setOptions(re)},Te.walkTokens=function(J,re){for(var oe=T(J),W;!(W=oe()).done;){var H=W.value;re(H);switch(H.type){case"table":{for(var Q=T(H.tokens.header),le;!(le=Q()).done;){var ye=le.value;Te.walkTokens(ye,re)}for(var we=T(H.tokens.cells),Ne;!(Ne=we()).done;)for(var $e=Ne.value,nt=T($e),Ze;!(Ze=nt()).done;){var bt=Ze.value;Te.walkTokens(bt,re)}break}case"list":{Te.walkTokens(H.items,re);break}default:H.tokens&&Te.walkTokens(H.tokens,re)}}},Te.Parser=De,Te.parser=De.parse,Te.Renderer=Ce,Te.TextRenderer=xe,Te.Lexer=be,Te.lexer=be.lex,Te.Tokenizer=se,Te.Slugger=Be,Te.parse=Te;var Ue=Te;return Ue})},EJTS:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return m});var fe=B("qVdP"),N=B("jsC+"),S=B("lUTK"),L=B("BvKs"),T=B("sRBo"),w=B("kaz8"),D=B("oBTY"),I=B("7Kak"),A=B("9yH6"),O=B("tJVT"),_=B("cDcd"),f=B.n(_),d=B("9Bee"),o=B("+vTd"),e=B.n(o),u=B("xKgJ"),s=B("Is5a"),t=B.n(s),n=["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"],r=["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"],E=function(y){var v,a=y.data,c=y.selectIds,i=y.onSelectCheckBox,l=i===void 0?function(){}:i,g=y.showCheckbox,h=g===void 0?!0:g,b=Object(_.useState)(!1),R=Object(O.a)(b,2),x=R[0],P=R[1],M=function(){if(a.item_type==="JUDGMENT")return f.a.createElement("div",{className:e.a.judgmentContent},a.choices.map(function(ae,se){return f.a.createElement(A.a,{key:se,disabled:!0},ae.choice_text)}));if(a.item_type==="PROGRAM"){var ee;return f.a.createElement("div",{className:e.a.programContent},f.a.createElement(d.a,{value:(ee=a.program_attr)===null||ee===void 0?void 0:ee.description}))}if(a.item_type==="COMBINATION"){var z;return f.a.createElement("div",{className:e.a.combinationContent},a==null||((z=a.sub_item_banks)===null||z===void 0)?void 0:z.map(function(ae,se){var V,Y="(\u9898\u76EE".concat(se+1,"-\u5355\u9009\u9898) ");return f.a.createElement(_.Fragment,null,f.a.createElement("div",{style:{marginTop:10,marginBottom:10}},f.a.createElement(d.a,{value:Y+ae.name})),ae.choices.map(function(q,G){return f.a.createElement("div",{key:G,className:e.a.otherContentItem},f.a.createElement("p",null,n[G]),f.a.createElement(d.a,{className:e.a.otehrContentHtml,value:q.choice_text}))}),f.a.createElement("div",{className:e.a.con},f.a.createElement("b",{className:"c-grey-333 font14"}," \u7B54\u6848\uFF1A",r==null?void 0:r[ae==null||((V=ae.choices)===null||V===void 0)?void 0:V.findIndex(function(q){return q==null?void 0:q.is_answer})]," "),f.a.createElement("div",null,f.a.createElement("span",null,"\u89E3\u6790\uFF1A"),f.a.createElement(d.a,{className:e.a.parseAnswerHtml,value:ae.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return f.a.createElement("div",{className:e.a.otherContent},a.choices.map(function(ae,se){return f.a.createElement("div",{key:se,className:e.a.otherContentItem},f.a.createElement("p",null,n[se]),f.a.createElement(d.a,{className:e.a.otehrContentHtml,value:ae.choice_text}))}))},k=function(){var ee;return f.a.createElement("div",null,(ee=a.standard_answer)===null||ee===void 0?void 0:ee.map(function(z,ae){return f.a.createElement(d.a,{key:ae,className:e.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(z.position,"\uFF09\uFF1A").concat(z.answer_text.join("\u3001"))})}))},C=function(){var ee,z,ae,se={SUBJECTIVE:(ee=a.answer_texts)===null||ee===void 0?void 0:ee[0],JUDGMENT:(z=a.choices)===null||z===void 0||((ae=z.find(function(Ee){return Ee.is_answer}))===null||ae===void 0)?void 0:ae.choice_text},V=a.choices.map(function(Ee){return Ee.is_answer}).findIndex(function(Ee){return Ee}),Y=V>-1?r[V]:"",q="";a.choices.map(function(Ee,Oe){Ee.is_answer&&(q+=r[Oe])});var G=se[a.item_type],X={SINGLE:f.a.createElement(d.a,{className:e.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Y||"\u65E0")}),MULTIPLE:f.a.createElement(d.a,{className:e.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(q||"\u65E0")}),COMPLETION:k()},de=f.a.createElement(d.a,{className:e.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(G||"\u65E0")});return X[a.item_type]||de},U=function(ee){var z=Object(D.a)(c);ee.target.checked?z.push(a.id):z=z.filter(function(ae){return ae!==a.id}),l(z)};return f.a.createElement("div",{className:e.a.itemWrap},f.a.createElement("div",{className:e.a.list},h&&f.a.createElement(w.a,{className:"mr10",onChange:U,checked:c.includes(a.id)}),f.a.createElement("div",{className:e.a.title},f.a.createElement(d.a,{key:1,showLines:1,showTextOnly:!0,className:e.a.topicTitleContent,value:a.name})),f.a.createElement("div",{className:e.a.line},f.a.createElement("b",{className:e.a.b1}),f.a.createElement("b",{className:e.a.b2})),f.a.createElement("div",{onClick:function(){return P(!x)},className:e.a.tr},x?"\u6536\u8D77":"\u5C55\u5F00",f.a.createElement("i",{style:{transform:x?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),f.a.createElement("aside",{style:x?{display:"block"}:{display:"none"},className:e.a.itemDetail},f.a.createElement("div",{style:{marginBottom:44}},f.a.createElement(d.a,{key:2,className:e.a.topicTitleContent,value:a.name}),f.a.createElement("div",{className:"".concat(e.a.row," mt15")},M()),f.a.createElement("div",{className:e.a.row},f.a.createElement("div",{className:e.a.updateTimeRow},f.a.createElement("div",{className:e.a.updateTimeWrap},a.item_type==="PROGRAM"&&f.a.createElement("p",{className:e.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(v=a.program_attr)===null||v===void 0?void 0:v.language))))),a.item_type!=="PROGRAM"&&a.item_type!=="COMBINATION"&&f.a.createElement("div",{className:e.a.answerWrapper},f.a.createElement("img",{src:t.a,alt:"",className:e.a.decoration}),f.a.createElement("div",{className:e.a.answer},C()),f.a.createElement("div",{className:e.a.parse},f.a.createElement("div",{className:e.a.parseText},"\u89E3\u6790\uFF1A"),f.a.createElement("div",{className:e.a.parseAnswer},a.analysis?f.a.createElement(d.a,{className:e.a.parseAnswerHtml,value:a.analysis}):"\u6682\u65E0\u89E3\u6790")))))},m=function(y){var v,a,c,i,l,g,h,b,R,x,P,M,k,C,U,K,ee=y.isProblemset,z=y.data,ae=y.user,se=y.activeTabsKey,V=y.onPublicReview,Y=V===void 0?function(){}:V,q=y.onStartExperience,G=q===void 0?function(){}:q,X=y.onSetPrivate,de=X===void 0?function(){}:X,Ee=y.onCorrection,Oe=Ee===void 0?function(){}:Ee,me=y.onCollect,Se=me===void 0?function(){}:me,ve=y.onSetPublic,be=ve===void 0?function(){}:ve,Ae=y.onDelete,Re=Ae===void 0?function(){}:Ae,Le=y.onCancel,Ce=Le===void 0?function(){}:Le,xe=y.onSelect,Be=xe===void 0?function(){}:xe,Me=y.onMoveTo,ge=Me===void 0?function(){}:Me,De=y.onSetShare,Ge=De===void 0?function(){}:De,We=y.onCancelShare,Ke=We===void 0?function(){}:We,Pe=y.onPublish,Ve=Pe===void 0?function(){}:Pe,He=y.onCancelPublish,Te=He===void 0?function(){}:He,Ue=z.item_type==="PROGRAM"?"/problems/".concat((v=z.program_attr)===null||v===void 0?void 0:v.identifier,"/edit"):"/problemset/edit/".concat(z.id),J=se==="0"&&!z.public&&!z.apply&&(z.item_type==="PROGRAM"&&((a=z.program_attr)===null||a===void 0?void 0:a.status)!==0||z.item_type!=="PROGRAM"),re=f.a.createElement(L.a,{forceSubMenuRender:!0,className:e.a.menu},se==="0"&&!z.public&&f.a.createElement(L.a.Item,{key:"-1"},f.a.createElement("a",{className:e.a.actionLink,target:"_blank",href:Ue},"\u7F16\u8F91")),(se==="0"||se==="3")&&z.item_type==="PROGRAM"&&((c=z.program_attr)===null||c===void 0?void 0:c.status)!==0&&!z.public&&((i=z.author)===null||i===void 0?void 0:i.login)===((l=ae.userInfo)===null||l===void 0?void 0:l.login)&&f.a.createElement(L.a.Item,{key:"0"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){var Q;return Te(z==null||((Q=z.program_attr)===null||Q===void 0)?void 0:Q.identifier)}},"\u64A4\u9500\u53D1\u5E03")),se==="0"&&f.a.createElement(L.a.Item,{key:"1"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return ge(z.id)}},"\u79FB\u52A8\u5230")),se==="0"&&!(z!=null&&z.is_share)&&f.a.createElement(L.a.Item,{key:"3"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Ge(z.id)}},"\u5171\u4EAB")),(se==="0"&&(z==null?void 0:z.is_share)||se==="3"&&((g=z.author)===null||g===void 0?void 0:g.login)===((h=ae.userInfo)===null||h===void 0?void 0:h.login))&&f.a.createElement(L.a.Item,{key:"3"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Ke(z.id)}},"\u64A4\u9500\u5171\u4EAB")),J&&f.a.createElement(L.a.Item,{key:"4"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return be(z.id)}},"\u516C\u5F00")),se==="0"&&!z.public&&z.apply&&(z.item_type==="PROGRAM"&&z.program_attr.status!==0||z.item_type!=="PROGRAM")&&f.a.createElement(L.a.Item,{key:"5"},f.a.createElement("a",{className:e.a.reviewFlag,onClick:Y},"\u5BA1\u6838\u4E2D")),(se==="0"||se==="1")&&z.public&&((b=z.author)===null||b===void 0?void 0:b.login)===((R=ae.userInfo)===null||R===void 0?void 0:R.login)&&f.a.createElement(L.a.Item,{key:"6"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return de(z.id)}},"\u64A4\u9500\u516C\u5F00")),se==="2"&&f.a.createElement(L.a.Item,{key:"7"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Se(z.id,z.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(se==="0"||se==="3")&&z.item_type==="PROGRAM"&&((x=z.program_attr)===null||x===void 0?void 0:x.status)===0&&!z.public&&((P=z.author)===null||P===void 0?void 0:P.login)===((M=ae.userInfo)===null||M===void 0?void 0:M.login)&&f.a.createElement(L.a.Item,{key:"8"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){var Q;return Ve(z==null||((Q=z.program_attr)===null||Q===void 0)?void 0:Q.identifier)}},"\u53D1\u5E03")),(se==="1"||se==="3")&&!Object(u.o)()&&!Object(u.m)()&&((k=z.author)===null||k===void 0?void 0:k.login)!==((C=ae.userInfo)===null||C===void 0?void 0:C.login)&&f.a.createElement(L.a.Item,{key:"9"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Se(z.id,z.is_collected)}},z.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),se!=="0"&&!Object(u.o)()&&!Object(u.m)()&&f.a.createElement(L.a.Item,{key:"10"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Oe(z.id)}},"\u7EA0\u9519")),(se==="0"&&!z.public||se==="1"&&Object(u.o)()&&((U=z.author)===null||U===void 0?void 0:U.login)!==((K=ae.userInfo)===null||K===void 0?void 0:K.login))&&f.a.createElement(L.a.Item,{key:"11"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Re(z.id)}},"\u5220\u9664"))),oe=f.a.createElement(L.a,{forceSubMenuRender:!0,className:e.a.menu},f.a.createElement(L.a.Item,{key:"10"},f.a.createElement("a",{className:e.a.actionLink,onClick:function(){return Oe(z.id)}},"\u7EA0\u9519"))),W=se!=="0"&&!Object(u.o)()&&!Object(u.m)();return f.a.createElement(f.a.Fragment,null,ee?f.a.createElement(f.a.Fragment,null,z.item_type!=="SUBJECTIVE"&&z.item_type!=="COMBINATION"&&f.a.createElement("span",{className:e.a.textBtn,style:{cursor:"pointer"},onClick:function(){return G(z)}},"\u4F53\u9A8C"),f.a.createElement(N.a,{overlay:re},f.a.createElement("span",{style:{cursor:"default"},onClick:function(Q){return Q.preventDefault()}},f.a.createElement("span",{className:e.a.textBtn},"\u66F4\u591A")))):W?f.a.createElement(N.a,{className:"ml40",overlay:oe},f.a.createElement("span",{style:{cursor:"default"},onClick:function(Q){return Q.preventDefault()}},f.a.createElement("span",null,"\u66F4\u591A"))):f.a.createElement("span",null))};Fe.b=E},FKdj:function(Xe,Fe,B){Xe.exports={flex_box_center:"flex_box_center___3uXpC",flex_space_between:"flex_space_between___1R5l3",flex_box_vertical_center:"flex_box_vertical_center___2whw-",flex_box_center_end:"flex_box_center_end___Jni7d",flex_box_column:"flex_box_column___bQWh0",page:"page___2wqIC",wrap:"wrap___3ThhU",title:"title___3BwkD",select:"select___2Ozsr",contentWrap:"contentWrap___3srp0",pngIcon:"pngIcon___2ckkq",tabsWrap:"tabsWrap___2Y959",searchWrap:"searchWrap___H9GsL",addQuestionBtn:"addQuestionBtn___1b8s_",search:"search___3d1EJ",searchIcon:"searchIcon___1mrzV",batchWrap:"batchWrap___j1Er3",contentListWrap:"contentListWrap___3pty2",li:"li___2UOPB",bottom:"bottom___I7MVG",actionLeftItem:"actionLeftItem___3bGeH",questionTypeName:"questionTypeName___Aiyux",more:"more___YExtS",btnAdd:"btnAdd___2RrWf",treeWrapper:"treeWrapper___U0OPC",treeHeader:"treeHeader___1LB2p",treeContent:"treeContent___Ckfqx",action:"action___Xn5RP",headerWrapper:"headerWrapper___3ECJD",exportBtn:"exportBtn___35cZE"}},FOrL:function(Xe,Fe,B){Xe.exports=B.p+"static/nodata.a6b3f948.png"},Is5a:function(Xe,Fe){Xe.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(Xe,Fe){Xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},KMxT:function(Xe,Fe,B){"use strict";B.r(Fe);var fe=B("DjyN"),N=B("NUBc"),S=B("qVdP"),L=B("jsC+"),T=B("lUTK"),w=B("BvKs"),D=B("T2oS"),I=B("W9HT"),A=B("+L6B"),O=B("2/Rp"),_=B("k1fw"),f=B("9og8"),d=B("tJVT"),o=B("PpiC"),e=B("5NDa"),u=B("5rEg"),s=B("Znn+"),t=B("ZTPi"),n=B("WmNS"),r=B.n(n),E=B("cDcd"),m=B.n(E),p=B("9kvl"),y=B("iris"),v=B("jcZT"),a=B("BdwD"),c=B("SAoR"),i=B("FKdj"),l=B.n(i),g=B("EJTS"),h=B("LE3n"),b=B("xKgJ"),R=B("SVaM"),x=B("xTzM"),P=B.n(x),M=B("1vsH"),k=B("ErOA"),C=t.a.TabPane,U=u.a.Search,K;(function(z){z.Mine="0",z.Public="1",z.Collection="2",z.TeachGroupShare="3"})(K||(K={}));var ee=function(ae){var se,V,Y,q,G,X,de,Ee,Oe=ae.classroomList,me=ae.problemset,Se=ae.user,ve=ae.globalSetting,be=ae.loading,Ae=ae.dispatch,Re=ae.match,Le=ae.shixunHomeworks,Ce=Object(o.a)(ae,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),xe=Object(M.J)(),Be=Object(E.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:xe.qtype,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((se=Ce.location)===null||se===void 0||((V=se.query)===null||V===void 0)?void 0:V.id)||null,exam_id:(Re==null||((Y=Re.params)===null||Y===void 0)?void 0:Y.id)||null,exercise_id:(Re==null||((q=Re.params)===null||q===void 0)?void 0:q.categoryId)||null}),Me=Object(d.a)(Be,2),ge=Me[0],De=Me[1],Ge=Object(E.useState)(0),We=Object(d.a)(Ge,2),Ke=We[0],Pe=We[1],Ve=Object(E.useState)([]),He=Object(d.a)(Ve,2),Te=He[0],Ue=He[1],J=Object(E.useState)(K.Mine),re=Object(d.a)(J,2),oe=re[0],W=re[1],H=Object(E.useState)(-1),Q=Object(d.a)(H,2),le=Q[0],ye=Q[1],we=Object(E.useState)([]),Ne=Object(d.a)(we,2),$e=Ne[0],nt=Ne[1],Ze=Object(E.useState)([]),bt=Object(d.a)(Ze,2),ut=bt[0],Qe=bt[1],Dt=Object(E.useState)(!1),Tt=Object(d.a)(Dt,2),jt=Tt[0],Lt=Tt[1],lt=Object(E.useRef)(!1),Bt=Object(E.useState)([]),zt=Object(d.a)(Bt,2),rt=zt[0],at=zt[1],ot=Object(E.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),yt=Object(d.a)(ot,2),Ht=yt[0],qt=yt[1],ln=Object(E.useState)([]),fn=Object(d.a)(ln,2),un=fn[0],sn=fn[1],dn=Object(E.useRef)(null),jn=Object(E.useState)(!1),Bn=Object(d.a)(jn,2),er=Bn[0],xn=Bn[1],Fn=Object(E.useState)(""),yn=Object(d.a)(Fn,2),Sn=yn[0],Rn=yn[1],En=[{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(E.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(E.useEffect)(function(){var qe;Ae({type:"problemset/getDisciplines",payload:{source:"question"}});var Je=((qe=Ce.location.query)===null||qe===void 0?void 0:qe.group_id)||0;ge.group_id=Number(Je),De(ge),Vt(ge).then(function(ft){ft!=null&&ft.status||sn(ft==null?void 0:ft.item_banks_group),xn(!1)}),nr(),tr()},[]),Object(E.useEffect)(function(){return Ae({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Ae({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Ae({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Ae({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(E.useEffect)(function(){return Ae({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Ae({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(E.useEffect)(function(){return Ae({type:"globalSetting/headerFooterToggle",payload:!1}),function(){Ae({type:"globalSetting/headerFooterToggle",payload:!0})}},[]);var tr=function(){var qe=Object(f.a)(r.a.mark(function Je(){return r.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:Ae({type:"problemset/getTeachGroupData"});case 1:case"end":return St.stop()}},Je)}));return function(){return qe.apply(this,arguments)}}(),Vt=function(){var qe=Object(f.a)(r.a.mark(function Je(ft){var St;return r.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return ft.item_type=ft.item_type,xn(!0),Ft.next=4,Ae({type:"problemset/getItemBanks",payload:ft});case 4:if(St=Ft.sent,!(St&&St.status!==403&&St.status!==401&&St.status!==500)){Ft.next=14;break}return Pe(St.items_count||0),Ue(St.items||[]),nt(St.tag_disciplines||[]),rr(St.items||[]),at([]),Qe((St==null?void 0:St.navigation)||[]),xn(!1),Ft.abrupt("return",St);case 14:case"end":return Ft.stop()}},Je)}));return function(ft){return qe.apply(this,arguments)}}(),nr=function(){Ae({type:"problemset/getBasketList",payload:{}})},rr=function(Je){var ft=Je.every(function(St){var Gt;return((Gt=St.program_attr)===null||Gt===void 0?void 0:Gt.status)===0});lt.current=ft},ir=function(Je,ft){if(ge.discipline_id=Je||"",ge.sub_discipline_id=ft||"",ge.tag_discipline_id="",ge.page=1,ge.per_page=20,delete ge.id,ye(Je===null?-1:null),De(ge),Vt(ge),Je===null)return},xr=function(Je){ge.difficulty=Je||"",ge.page=1,ge.per_page=20,delete ge.id,De(ge),Vt(ge)},bn=function(Je){ge.tag_discipline_id=Je,ge.page=1,ge.per_page=20,delete ge.id,Je===-1&&(ge.discipline_id="",ge.sub_discipline_id="",ge.tag_discipline_id=""),ye(Je),De(ge),Vt(ge)},Kn=Object(E.useState)(!1),Wn=Object(d.a)(Kn,2),ar=Wn[0],Hn=Wn[1],Gn=function(Je){Ae({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:Je}}),ge.discipline_id="",ge.sub_discipline_id="",ge.tag_discipline_id="",ge.difficulty=null,ge.type=Je,Je==="0"?ge.group_id=0:ge.group_id=null,Je==="3"?Hn(!0):Hn(!1),ge.page=1,ge.per_page=20,delete ge.id,ye(-1),W(Je),De(ge),Vt(ge)},sr=function(Je,ft){ge.page=Je,ge.per_page=ft,De(ge),Vt(ge)},wn=function(Je){ge.discipline_id="",ge.sub_discipline_id="",ge.tag_discipline_id="",ge.difficulty=null,ge.page=1,ge.keyword=Je,delete ge.id,Je?(Lt(!0),Object(R.a)({name:Je,copywriting:Je,position:"ItemBank"})):Lt(!1),ye(-1),De(ge),Vt(ge)},or=function(){ge.per_page=20,De(ge),Vt(ge)},zn=function(){var qe=Object(f.a)(r.a.mark(function Je(ft){return r.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:Ae({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(ft),group_type:K.Mine}}),ge.page=1,ge.per_page=20,ge.group_id=Math.abs(ft),De(ge),Vt(ge).then(function(Ft){return sn(Ft==null?void 0:Ft.item_banks_group)});case 6:case"end":return Gt.stop()}},Je)}));return function(ft){return qe.apply(this,arguments)}}(),Vn=function(){Ae({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:ge}});return},lr=function(){Ae({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Xn=function(){var qe=Object(f.a)(r.a.mark(function Je(ft){return r.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:Ae({type:"problemset/getDisciplines",payload:{source:"question",group_id:ft,group_type:K.TeachGroupShare}}),ge.page=1,ge.group_id=ft||null,delete ge.id,De(Object(_.a)({},ge)),Vt(ge);case 6:case"end":return Gt.stop()}},Je)}));return function(ft){return qe.apply(this,arguments)}}(),ur=function(Je){ge.sort_by=Je.type,ge.sort_direction=Je.direction,ge.page=1,ge.per_page=20,qt(Je.name),De(ge),Vt(ge)},dr=function(Je){ge.discipline_id="",ge.sub_discipline_id="",ge.tag_discipline_id="",ge.difficulty=null,ge.page=1,ge.per_page=20,ge.group_id=Je,ye(-1),De(ge),Vt(ge).then(function(ft){return sn(ft==null?void 0:ft.item_banks_group)})},Yn=function(Je){at(Je)},cr=[{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"}],fr={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},$n=function(){var qe=Object(f.a)(r.a.mark(function Je(ft){var St;return r.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:if(!(xe.type==="exercise")){Ft.next=6;break}return Ft.next=3,Object(k.a)("/api/exercises/".concat(xe.exerciseid,"/toggle_random_question.json"),{method:"post",body:{question_id:xe.qid,item_bank_id:ft}});case 3:return St=Ft.sent,St!=null&&St.status||p.d.push(xe.from),Ft.abrupt("return");case 6:case"end":return Ft.stop()}},Je)}));return function(ft){return qe.apply(this,arguments)}}();return m.a.createElement("div",{className:l.a.page},m.a.createElement("section",null,m.a.createElement("div",{className:l.a.wrap},m.a.createElement("div",{className:l.a.title},"\u8BD5\u9898\u5E93"),m.a.createElement("div",{className:l.a.headerWrapper},m.a.createElement("div",{className:l.a.tabsWrap},m.a.createElement(t.a,{activeKey:oe,onChange:Gn,tabBarExtraContent:m.a.createElement("div",{className:l.a.searchWrap},m.a.createElement(U,{allowClear:!0,suffix:m.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(l.a.searchIcon),onClick:function(){return wn(ge.keyword)}}),className:l.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",value:ge.keyword,onChange:function(Je){ge.keyword=Je.target.value,De(Object(_.a)({},ge))},onSearch:wn}))},m.a.createElement(C,{tab:"\u516C\u5171",key:"1"}),((G=me.teachGroupData)===null||G===void 0||((X=G.groups)===null||X===void 0)?void 0:X.length)&&m.a.createElement(C,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(b.o)()&&!Object(b.m)()&&m.a.createElement(C,{tab:"\u6536\u85CF\u5939",key:"2"}),m.a.createElement(C,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),m.a.createElement(y.a,{showSelectAll:!1,className:l.a.select,disciplinesData:(de=me.disciplinesData)===null||de===void 0?void 0:de.disciplines,knowledgeData:$e,directionValue:ge.discipline_id,subDisciplineValue:ge.sub_discipline_id,typeValue:ge.item_type,isprogram_homework:!1,showItemType:!1,showKnowledge:!0,name:Sn,setname:Rn,difficultyValue:ge.difficulty,showShixun:!1,onShixunChange:lr,onDirectionChange:ir,onTypeChange:function(){},onDifficultyChange:xr,knowledgeValue:le,onKnowledgeChange:bn,teachGroupData:(Ee=me.teachGroupData)===null||Ee===void 0?void 0:Ee.groups,onTeachGroupChange:Xn,teachGroupValue:ge.group_id,showTeachGroup:ar})),m.a.createElement("div",{className:l.a.treeWrapper,style:{display:oe===K.Mine?"block":"none"}},m.a.createElement("div",{className:l.a.treeHeader},m.a.createElement(c.a,{data:ut,onClick:zn}),m.a.createElement(O.a,{type:"link",onClick:Vn,className:l.a.exportBtn},m.a.createElement("img",{src:P.a,alt:"",className:l.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),m.a.createElement(I.a,{spinning:er},m.a.createElement("div",{ref:dn,className:l.a.treeContent},m.a.createElement(h.a,{isProblemset:!1,reloadData:or,data:un,onShare:function(){},onOpen:zn})))),m.a.createElement("div",{className:l.a.contentWrap},m.a.createElement("div",{className:l.a.batchWrap},m.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},m.a.createElement("div",{className:"font14"},m.a.createElement(L.a,{overlay:m.a.createElement(w.a,{selectedKeys:[Ht]},En==null?void 0:En.map(function(qe,Je){return m.a.createElement(w.a.Item,{key:qe.name,onClick:function(){return ur(qe)}},qe.name)}))},m.a.createElement("span",{style:{color:"#464F66"}},m.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),Ht))))),jt?m.a.createElement("div",null,m.a.createElement(O.a,{style:{paddingLeft:0},onClick:function(){ge.page=1,ge.keyword=null,delete ge.id,De(ge),Lt(!1),Vt(ge)},type:"link"},m.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),m.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",ge.keyword,"\u201D")):null,m.a.createElement("div",{className:l.a.contentListWrap},Ke!==0?m.a.createElement(I.a,{size:"large",spinning:be["problemset/getItemBanks"]},Te.map(function(qe,Je){var ft,St;return m.a.createElement("div",{className:l.a.li,key:qe.id},m.a.createElement("div",{className:l.a.top},m.a.createElement(g.b,{showCheckbox:!1,data:qe,selectIds:rt,onSelectCheckBox:Yn})),m.a.createElement("div",{className:l.a.bottom},m.a.createElement("p",{className:"".concat(l.a.actionLeftItem," ").concat(l.a.questionTypeName)},(ft=cr.find(function(Gt){return Gt.type===qe.item_type}))===null||ft===void 0?void 0:ft.name),m.a.createElement("p",{className:l.a.actionLeftItem},fr[qe.difficulty]),m.a.createElement("p",{className:l.a.actionLeftItem},"\u521B\u5EFA\u8005",m.a.createElement("span",{className:"c-grey-333"},qe==null||((St=qe.author)===null||St===void 0)?void 0:St.name)),m.a.createElement("p",{className:l.a.actionLeftItem},"\u66F4\u65B0",m.a.createElement("span",{className:"c-grey-333"},qe==null?void 0:qe.updated_at)),m.a.createElement("p",{className:l.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",m.a.createElement("span",{className:"c-grey-333"},qe==null?void 0:qe.quotes)),m.a.createElement("div",{className:l.a.more},m.a.createElement("span",{className:l.a.btnAdd,onClick:function(){return $n(qe.id)}},"\u66FF\u6362"))))})):m.a.createElement(I.a,{size:"large",spinning:be["problemset/getItemBanks"]},m.a.createElement(a.a,null))),Ke!==0&&m.a.createElement(N.a,{showQuickJumper:!0,onChange:sr,defaultCurrent:1,pageSize:ge==null?void 0:ge.per_page,current:ge.page||1,total:Ke,showTotal:function(Je){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},Je),"\u6761\u6570\u636E")}}))),m.a.createElement(v.a,{onOk:dr})))};Fe.default=Object(p.a)(function(z){var ae=z.classroomList,se=z.problemset,V=z.user,Y=z.loading,q=z.globalSetting,G=z.shixunHomeworks;return{classroomList:ae,problemset:se,user:V,globalSetting:q,loading:Y.effects,shixunHomeworks:G}})(ee)},LE3n:function(Xe,Fe,B){"use strict";var fe=B("ozfa"),N=B("MJZm"),S=B("k1fw"),L=B("+L6B"),T=B("2/Rp"),w=B("5NDa"),D=B("5rEg"),I=B("2qtc"),A=B("kLXV"),O=B("miYZ"),_=B("tsqr"),f=B("9og8"),d=B("tJVT"),o=B("WmNS"),e=B.n(o),u=B("cDcd"),s=B.n(u),t=B("1vnw"),n=B.n(t),r=B("ErOA"),E=B("Ix/O"),m=B.n(E),p=B("xTzM"),y=B.n(p),v=B("WCUW"),a=B("LvDl"),c=B.n(a),i=function(h){var b=h.isProblemset,R=h.name,x=h.id,P=h.itemBanksCount,M=h.onOpen,k=M===void 0?function(){}:M,C=h.onShare,U=C===void 0?function(){}:C,K=h.onMove,ee=K===void 0?function(){}:K,z=h.onDeleteOk,ae=z===void 0?function(){}:z,se=Object(u.useState)(!1),V=Object(d.a)(se,2),Y=V[0],q=V[1],G=Object(u.useState)(R),X=Object(d.a)(G,2),de=X[0],Ee=X[1],Oe=Object(u.useState)(R),me=Object(d.a)(Oe,2),Se=me[0],ve=me[1],be=function(){var Re=Object(f.a)(e.a.mark(function Le(Ce){var xe,Be,Me;return e.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:if(xe=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Se.trim()){De.next=4;break}return _.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),De.abrupt("return");case 4:if(!(Se.charAt(0)===" ")){De.next=7;break}return _.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),De.abrupt("return");case 7:Be=0;case 8:if(!(Be<Se.length)){De.next=15;break}if(!xe.includes(Se.charAt(Be))){De.next=12;break}return _.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),De.abrupt("return",!1);case 12:Be++,De.next=8;break;case 15:return De.next=17,Object(r.a)("/api/item_banks_groups/".concat(Math.abs(Ce),".json"),{method:"put",body:{name:Se}});case 17:Me=De.sent,Me.status===0&&(q(!1),Ee(Se));case 19:case"end":return De.stop()}},Le)}));return function(Ce){return Re.apply(this,arguments)}}(),Ae=function(Le){A.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:s.a.createElement("div",null,s.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"),s.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 Ce=Object(f.a)(e.a.mark(function Be(){var Me;return e.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.next=2,Object(r.a)("/api/item_banks_groups/".concat(Math.abs(Le),".json"),{method:"delete",body:{}});case 2:Me=De.sent,Me.status===0&&ae(Le);case 4:case"end":return De.stop()}},Be)}));function xe(){return Ce.apply(this,arguments)}return xe}()})};return s.a.createElement("div",{className:n.a.list},Y?s.a.createElement(D.a,{style:{maxWidth:780},value:Se,onChange:function(Le){return ve(Le.target.value)}}):s.a.createElement("div",{title:de,onClick:function(){return k(x)},className:n.a.name},de),b&&s.a.createElement("div",{className:n.a.btns},Y?s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{style:{height:16},onClick:function(){return be(x)},className:"ml0"},s.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),s.a.createElement("div",{style:{height:16},onClick:function(){ve(de),q(!1)},className:"ml10"},s.a.createElement("i",{className:"iconfont icon-qingchu"}))):s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{onClick:function(){return ee(x,"up")},className:"ml0"},s.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),s.a.createElement("div",{onClick:function(){return ee(x,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},s.a.createElement("i",{className:"iconfont icon-shangyi3"}))),s.a.createElement(T.a,{className:"ml10",onClick:function(){if(!P){_.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}U(Math.abs(x))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),s.a.createElement(T.a,{className:"ml10",onClick:function(){return q(!0)},type:"link"},"\u91CD\u547D\u540D"),s.a.createElement(T.a,{onClick:function(){return Ae(x)},type:"link",danger:!0},"\u5220\u9664")))},l=function(h){var b=h.isProblemset,R=h.data,x=h.onOpen,P=x===void 0?function(){}:x,M=h.onShare,k=M===void 0?function(){}:M,C=h.reloadData,U=Object(u.useState)(),K=Object(d.a)(U,2),ee=K[0],z=K[1];Object(u.useEffect)(function(){z(R==null?void 0:R.map(function(de){return{title:s.a.createElement(i,{isProblemset:b,name:de.name,id:de.id,itemBanksCount:de.item_banks_count,onMove:se,onOpen:P,onShare:k,onDeleteOk:Y}),key:de.id,icon:s.a.createElement("img",{src:m.a,className:n.a.folderIcon}),isLeaf:!1}}))},[R]);var ae=function de(Ee,Oe,me){for(var Se=Object(a.cloneDeep)(Ee),ve=0;ve<Se.length;ve++){if(Se[ve].key===Oe){if(me==="up"){var be=[Se[ve],Se[ve-1]];Se[ve-1]=be[0],Se[ve]=be[1]}else{var Ae=[Se[ve+1],Se[ve]];Se[ve]=Ae[0],Se[ve+1]=Ae[1]}break}Se[ve].children&&(Se[ve].children=de(Se[ve].children,Oe,me))}return Se},se=function(){var de=Object(f.a)(e.a.mark(function Ee(Oe,me){var Se;return e.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:if(!(me==="up")){be.next=6;break}return be.next=3,Object(v.I)({id:Math.abs(Oe)});case 3:be.t0=be.sent,be.next=9;break;case 6:return be.next=8,Object(v.H)({id:Math.abs(Oe)});case 8:be.t0=be.sent;case 9:Se=be.t0,Se.status===0&&z(function(Ae){return ae(Ae,Oe,me)});case 11:case"end":return be.stop()}},Ee)}));return function(Oe,me){return de.apply(this,arguments)}}(),V=function de(Ee,Oe){return Ee.filter(function(me){return me.key===Oe?!1:(me.children&&(me.children=de(me.children,Oe)),!0)})},Y=function(Ee){z(function(Oe){return V(Oe,Ee)}),C()},q=function de(Ee,Oe,me){return Ee.map(function(Se){return Se.key===Oe?Object(S.a)(Object(S.a)({},Se),me):Se.children?Object(S.a)(Object(S.a)({},Se),{},{children:de(Se.children,Oe,me)}):Se})},G=function(){var de=Object(f.a)(e.a.mark(function Ee(Oe){var me,Se,ve,be,Ae;return e.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return me=Oe.key,Le.next=3,Object(v.B)({group_id:Math.abs(me)});case 3:Se=Le.sent,ve=Se||{},be=ve.item_banks_group,Ae=ve.item_banks_group_count,Ae>0?z(function(Ce){return q(Ce,me,{children:be.map(function(xe){return{title:s.a.createElement(i,{isProblemset:b,name:xe.name,id:xe.id,itemBanksCount:xe.item_banks_count,onMove:se,onOpen:P,onShare:k,onDeleteOk:Y}),key:xe.id,icon:s.a.createElement("img",{src:m.a,className:n.a.folderIcon}),isLeaf:!1}})})}):z(function(Ce){return q(Ce,me,{isLeaf:!0})});case 6:case"end":return Le.stop()}},Ee)}));return function(Oe){return de.apply(this,arguments)}}(),X=function(Ee,Oe){var me=Oe.node,Se=Oe.expanded;z(function(ve){return q(ve,me.key,{icon:Se?s.a.createElement("img",{src:y.a,className:n.a.folderIcon}):s.a.createElement("img",{src:m.a,className:n.a.folderIcon})})})};return(ee==null?void 0:ee.length)>0&&s.a.createElement(N.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:ee,loadData:G,onExpand:X,className:n.a.folderWrapper,selectable:!1})};Fe.a=l},LdHM:function(Xe,Fe,B){"use strict";B.d(Fe,"b",function(){return r}),B.d(Fe,"a",function(){return m});var fe=B("1OyB"),N=B("vuIU"),S=B("Ji7U"),L=B("LK+K"),T=B("cDcd"),w=B("rePB"),D=B("Ff2n"),I=B("ODXe"),A=B("4IlW"),O=B("bX4T"),_=B("YrtM"),f=B("TSYQ"),d=B.n(f),o=B("+nKL"),e=B("8OUc"),u=function(U,K){var ee=U.prefixCls,z=U.id,ae=U.flattenOptions,se=U.childrenAsData,V=U.values,Y=U.searchValue,q=U.multiple,G=U.defaultActiveFirstOption,X=U.height,de=U.itemHeight,Ee=U.notFoundContent,Oe=U.open,me=U.menuItemSelectedIcon,Se=U.virtual,ve=U.onSelect,be=U.onToggleOpen,Ae=U.onActiveValue,Re=U.onScroll,Le=U.onMouseEnter,Ce="".concat(ee,"-item"),xe=Object(_.a)(function(){return ae},[Oe,ae],function(Ue,J){return J[0]&&Ue[1]!==J[1]}),Be=T.useRef(null),Me=function(J){J.preventDefault()},ge=function(J){Be.current&&Be.current.scrollTo({index:J})},De=function(J){for(var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,oe=xe.length,W=0;W<oe;W+=1){var H=(J+W*re+oe)%oe,Q=xe[H],le=Q.group,ye=Q.data;if(!le&&!ye.disabled)return H}return-1},Ge=T.useState(function(){return De(0)}),We=Object(I.a)(Ge,2),Ke=We[0],Pe=We[1],Ve=function(J){Pe(J);var re=xe[J];if(!re){Ae(null,-1);return}Ae(re.data.value,J)};T.useEffect(function(){Ve(G!==!1?De(0):-1)},[xe.length,Y]),T.useEffect(function(){var Ue=setTimeout(function(){if(!q&&Oe&&V.size===1){var J=Array.from(V)[0],re=xe.findIndex(function(oe){var W=oe.data;return W.value===J});Ve(re),ge(re)}});return function(){return clearTimeout(Ue)}},[Oe]);var He=function(J){J!==void 0&&ve(J,{selected:!V.has(J)}),q||be(!1)};if(T.useImperativeHandle(K,function(){return{onKeyDown:function(J){var re=J.which;switch(re){case A.a.UP:case A.a.DOWN:{var oe=0;if(re===A.a.UP?oe=-1:re===A.a.DOWN&&(oe=1),oe!==0){var W=De(Ke+oe,oe);ge(W),Ve(W)}break}case A.a.ENTER:{var H=xe[Ke];H&&!H.data.disabled?He(H.data.value):He(void 0),Oe&&J.preventDefault();break}case A.a.ESC:be(!1)}},onKeyUp:function(){},scrollTo:function(J){ge(J)}}}),xe.length===0)return T.createElement("div",{role:"listbox",id:"".concat(z,"_list"),className:"".concat(Ce,"-empty"),onMouseDown:Me},Ee);function Te(Ue){var J=xe[Ue];if(!J)return null;var re=J.data||{},oe=re.value,W=re.label,H=re.children,Q=Object(O.a)(re,!0),le=se?H:W;return J?T.createElement("div",Object.assign({"aria-label":typeof le=="string"?le:null},Q,{key:Ue,role:"option",id:"".concat(z,"_list_").concat(Ue),"aria-selected":V.has(oe)}),oe):null}return T.createElement(T.Fragment,null,T.createElement("div",{role:"listbox",id:"".concat(z,"_list"),style:{height:0,width:0,overflow:"hidden"}},Te(Ke-1),Te(Ke),Te(Ke+1)),T.createElement(o.a,{itemKey:"key",ref:Be,data:xe,height:X,itemHeight:de,fullHeight:!1,onMouseDown:Me,onScroll:Re,virtual:Se,onMouseEnter:Le},function(Ue,J){var re,oe=Ue.group,W=Ue.groupOption,H=Ue.data,Q=H.label,le=H.key;if(oe)return T.createElement("div",{className:d()(Ce,"".concat(Ce,"-group"))},Q!==void 0?Q:le);var ye=H.disabled,we=H.value,Ne=H.title,$e=H.children,nt=H.style,Ze=H.className,bt=Object(D.a)(H,["disabled","value","title","children","style","className"]),ut=V.has(we),Qe="".concat(Ce,"-option"),Dt=d()(Ce,Qe,Ze,(re={},Object(w.a)(re,"".concat(Qe,"-grouped"),W),Object(w.a)(re,"".concat(Qe,"-active"),Ke===J&&!ye),Object(w.a)(re,"".concat(Qe,"-disabled"),ye),Object(w.a)(re,"".concat(Qe,"-selected"),ut),re)),Tt=se?$e:Q,jt=!me||typeof me=="function"||ut;return T.createElement("div",Object.assign({},bt,{"aria-selected":ut,className:Dt,title:Ne,onMouseMove:function(){if(Ke===J||ye)return;Ve(J)},onClick:function(){ye||He(we)},style:nt}),T.createElement("div",{className:"".concat(Qe,"-content")},Tt||we),T.isValidElement(me)||ut,jt&&T.createElement(e.a,{className:"".concat(Ce,"-option-state"),customizeIcon:me,customizeIconProps:{isSelected:ut}},ut?"\u2713":null))}))},s=T.forwardRef(u);s.displayName="OptionList";var t=s,n=function(){return null};n.isSelectOption=!0;var r=n,E=function(){return null};E.isSelectOptGroup=!0;var m=E,p=B("VTBJ"),y=B("Zm9Q");function v(C){var U=C.key,K=C.props,ee=K.children,z=K.value,ae=Object(D.a)(K,["children","value"]);return Object(p.a)({key:U,value:z!==void 0?z:U,children:ee},ae)}function a(C){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(y.a)(C).map(function(K,ee){if(!T.isValidElement(K)||!K.type)return null;var z=K.type.isSelectOptGroup,ae=K.key,se=K.props,V=se.children,Y=Object(D.a)(se,["children"]);return U||!z?v(K):Object(p.a)(Object(p.a)({key:"__RC_SELECT_GRP__".concat(ae===null?ee:ae,"__"),label:ae},Y),{},{options:a(V)})}).filter(function(K){return K})}var c=B("2Qr1"),i=B("qNPg"),l=B("U8pU"),g=B("Kwbf"),h=B("WKfj");function b(C){var U=C.mode,K=C.options,ee=C.children,z=C.backfill,ae=C.allowClear,se=C.placeholder,V=C.getInputElement,Y=C.showSearch,q=C.onSearch,G=C.defaultOpen,X=C.autoFocus,de=C.labelInValue,Ee=C.value,Oe=C.inputValue,me=C.optionLabelProp,Se=U==="multiple"||U==="tags",ve=Y!==void 0?Y:Se||U==="combobox",be=K||a(ee);if(Object(g.a)(U!=="tags"||be.every(function(Ce){return!Ce.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),U==="tags"||U==="combobox"){var Ae=be.some(function(Ce){return Ce.options?Ce.options.some(function(xe){return typeof("value"in xe?xe.value:xe.key)=="number"}):typeof("value"in Ce?Ce.value:Ce.key)=="number"});Object(g.a)(!Ae,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(g.a)(U!=="combobox"||!me,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(g.a)(U==="combobox"||!z,"`backfill` only works with `combobox` mode."),Object(g.a)(U==="combobox"||!V,"`getInputElement` only work with `combobox` mode."),Object(g.b)(U!=="combobox"||!V||!ae||!se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),q&&!ve&&U!=="combobox"&&U!=="tags"&&Object(g.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(g.b)(!G||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ee!=null){var Re=Object(h.d)(Ee);Object(g.a)(!de||Re.every(function(Ce){return Object(l.a)(Ce)==="object"&&("key"in Ce||"value"in Ce)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(g.a)(!Se||Array.isArray(Ee),"`value` should be array when `mode` is `multiple` or `tags`")}if(ee){var Le=null;Object(y.a)(ee).some(function(Ce){if(!T.isValidElement(Ce)||!Ce.type)return!1;var xe=Ce.type;if(xe.isSelectOption)return!1;if(xe.isSelectOptGroup){var Be=Object(y.a)(Ce.props.children).every(function(Me){return!T.isValidElement(Me)||!Ce.type||Me.type.isSelectOption?!0:(Le=Me.type,!1)});return!Be}return Le=xe,!0}),Le&&Object(g.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Le.displayName||Le.name||Le,"`.")),Object(g.a)(Oe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var R=b,x=Object(i.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:a,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:R,fillOptionsWithMissingValue:c.a}),P=function(C){Object(S.a)(K,C);var U=Object(L.a)(K);function K(){var ee;return Object(fe.a)(this,K),ee=U.apply(this,arguments),ee.selectRef=T.createRef(),ee.focus=function(){ee.selectRef.current.focus()},ee.blur=function(){ee.selectRef.current.blur()},ee}return Object(N.a)(K,[{key:"render",value:function(){return T.createElement(x,Object.assign({ref:this.selectRef},this.props))}}]),K}(T.Component);P.Option=r,P.OptGroup=m;var M=P,k=Fe.c=M},NvD2:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return w});var fe=B("Kwbf");function N(D,I){var A=new Set;return D.forEach(function(O){I.has(O)||A.add(O)}),A}function S(D){var I=D||{},A=I.disabled,O=I.disableCheckbox,_=I.checkable;return!!(A||O)||_===!1}function L(D,I,A,O){for(var _=new Set(D),f=new Set,d=0;d<=A;d+=1){var o=I.get(d)||new Set;o.forEach(function(t){var n=t.key,r=t.node,E=t.children,m=E===void 0?[]:E;_.has(n)&&!O(r)&&m.filter(function(p){return!O(p.node)}).forEach(function(p){_.add(p.key)})})}for(var e=new Set,u=A;u>=0;u-=1){var s=I.get(u)||new Set;s.forEach(function(t){var n=t.parent,r=t.node;if(O(r)||!t.parent||e.has(t.parent.key))return;if(O(t.parent.node)){e.add(n.key);return}var E=!0,m=!1;(n.children||[]).filter(function(p){return!O(p.node)}).forEach(function(p){var y=p.key,v=_.has(y);E&&!v&&(E=!1),!m&&(v||f.has(y))&&(m=!0)}),E&&_.add(n.key),m&&f.add(n.key),e.add(n.key)})}return{checkedKeys:Array.from(_),halfCheckedKeys:Array.from(N(f,_))}}function T(D,I,A,O,_){for(var f=new Set(D),d=new Set(I),o=0;o<=O;o+=1){var e=A.get(o)||new Set;e.forEach(function(n){var r=n.key,E=n.node,m=n.children,p=m===void 0?[]:m;!f.has(r)&&!d.has(r)&&!_(E)&&p.filter(function(y){return!_(y.node)}).forEach(function(y){f.delete(y.key)})})}d=new Set;for(var u=new Set,s=O;s>=0;s-=1){var t=A.get(s)||new Set;t.forEach(function(n){var r=n.parent,E=n.node;if(_(E)||!n.parent||u.has(n.parent.key))return;if(_(n.parent.node)){u.add(r.key);return}var m=!0,p=!1;(r.children||[]).filter(function(y){return!_(y.node)}).forEach(function(y){var v=y.key,a=f.has(v);m&&!a&&(m=!1),!p&&(a||d.has(v))&&(p=!0)}),m||f.delete(r.key),p&&d.add(r.key),u.add(r.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(N(d,f))}}function w(D,I,A,O){var _=[],f;O?f=O:f=S;var d=new Set(D.filter(function(s){var t=!!A[s];return t||_.push(s),t})),o=new Map,e=0;Object.keys(A).forEach(function(s){var t=A[s],n=t.level,r=o.get(n);r||(r=new Set,o.set(n,r)),r.add(t),e=Math.max(e,n)}),Object(fe.a)(!_.length,"Tree missing follow keys: ".concat(_.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var u;return I===!0?u=L(d,o,e,f):u=T(d,I.halfCheckedKeys,o,e,f),u}},OZM5:function(Xe,Fe,B){"use strict";B.d(Fe,"b",function(){return O}),B.d(Fe,"a",function(){return _}),B.d(Fe,"k",function(){return f}),B.d(Fe,"h",function(){return d}),B.d(Fe,"i",function(){return o}),B.d(Fe,"g",function(){return e}),B.d(Fe,"c",function(){return u}),B.d(Fe,"d",function(){return s}),B.d(Fe,"j",function(){return r}),B.d(Fe,"e",function(){return E}),B.d(Fe,"f",function(){return m});var fe=B("KQm4"),N=B("U8pU"),S=B("Ff2n"),L=B("cDcd"),T=B.n(L),w=B("Kwbf"),D=B("WaYH"),I=.25,A=2;function O(p,y){var v=p.slice(),a=v.indexOf(y);return a>=0&&v.splice(a,1),v}function _(p,y){var v=p.slice();return v.indexOf(y)===-1&&v.push(y),v}function f(p){return p.split("-")}function d(p,y){return"".concat(p,"-").concat(y)}function o(p){return p&&p.type&&p.type.isTreeNode}function e(p,y){var v=[p],a=y[p];function c(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];i.forEach(function(l){var g=l.key,h=l.children;v.push(g),c(h)})}return c(a.children),v}function u(p,y){var v=p.clientY,a=y.selectHandle.getBoundingClientRect(),c=a.top,i=a.bottom,l=a.height,g=Math.max(l*I,A);return v<=c+g?-1:v>=i-g?1:0}function s(p,y){if(!p)return;var v=y.multiple;return v?p.slice():p.length?[p[0]]:p}var t=function(y){return y};function n(p,y){if(!p)return[];var v=y||{},a=v.processProps,c=a===void 0?t:a,i=Array.isArray(p)?p:[p];return i.map(function(l){var g=l.children,h=Object(S.a)(l,["children"]),b=n(g,y);return T.a.createElement(D.a,Object.assign({},c(h)),b)})}function r(p){if(!p)return null;var y;if(Array.isArray(p))y={checkedKeys:p,halfCheckedKeys:void 0};else if(Object(N.a)(p)==="object")y={checkedKeys:p.checked||void 0,halfCheckedKeys:p.halfChecked||void 0};else return Object(w.a)(!1,"`checkedKeys` is not an array or an object"),null;return y}function E(p,y){var v=new Set;function a(c){if(v.has(c))return;var i=y[c];if(!i)return;v.add(c);var l=i.parent,g=i.node;if(g.disabled)return;l&&a(l.key)}return(p||[]).forEach(function(c){a(c)}),Object(fe.a)(v)}function m(p){var y={};return Object.keys(p).forEach(function(v){(v.startsWith("data-")||v.startsWith("aria-"))&&(y[v]=p[v])}),y}},"P/tu":function(Xe,Fe,B){"use strict";var fe=B("ozfa"),N=B("MJZm"),S=B("0Owb"),L=B("9og8"),T=B("tJVT"),w=B("PpiC"),D=B("WmNS"),I=B.n(D),A=B("cDcd"),O=B.n(A),_=B("WCUW"),f=B("spXi"),d=B.n(f),o=function(u){var s=u.value,t=u.onChange,n=u.defaultValue,r=u.disabled,E=Object(w.a)(u,["value","onChange","defaultValue","disabled"]),m=Object(A.useState)([]),p=Object(T.a)(m,2),y=p[0],v=p[1],a=Object(A.useState)("1"),c=Object(T.a)(a,2),i=c[0],l=c[1];Object(A.useEffect)(function(){g()},[]);var g=function(){var R=Object(L.a)(I.a.mark(function x(){var P,M;return I.a.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,Object(_.A)({});case 2:P=C.sent,P!=null&&P.data&&(M=[{title:O.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:d.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:O.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:h(P.data||[])}],v(M),l("2"));case 4:case"end":return C.stop()}},x)}));return function(){return R.apply(this,arguments)}}(),h=function(x){function P(M){var k=M.children,C=Array.isArray(k)&&k.length>0,U=M==null?void 0:M.group_id;return{title:O.a.createElement("div",{title:M==null?void 0:M.name,className:d.a.name},M==null?void 0:M.name),value:U,key:U,icon:O.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:C?k==null?void 0:k.map(function(K){return P(K)}):[]}}return x==null?void 0:x.map(function(M){return P(M)})},b=n?{defaultExpandedKeys:[0]}:{selectedKeys:s,defaultExpandedKeys:s};return O.a.createElement("div",{className:d.a.customTree},O.a.createElement(N.a,Object(S.a)({key:i},b,{showIcon:!0,treeData:y,onSelect:t,disabled:r},E)))};Fe.a=o},Q0Vu:function(Xe,Fe,B){Xe.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(Xe,Fe,B){"use strict";var fe=B("Q9mQ"),N=B("diRs"),S=B("cDcd"),L=B.n(S),T=B("+z73"),w=B.n(T),D=function(A){var O=A.data,_=O===void 0?[]:O,f=A.onClick,d=function(){return _.map(function(u,s){return L.a.createElement("div",{key:s,className:w.a.few},L.a.createElement("b",{title:u.name,style:{color:s===0?"#333333":"#999999"},onClick:function(){return f(u.id)}},u.name),s<_.length-1&&L.a.createElement("span",null,"/"))})},o=function(){var u=!0,s=_.slice(2,-2),t=L.a.createElement("div",{className:w.a.pWrap},s.map(function(n){return L.a.createElement("span",{title:n.name,onClick:function(){return f(n.id)},key:n.id},n.name)}));return _.map(function(n,r){var E=null;return r>1&&r<_.length-2?u&&(E=L.a.createElement(N.a,{key:r,placement:"bottom",content:t},L.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),u=!1):E=L.a.createElement("div",{key:r,className:w.a.few},L.a.createElement("b",{title:n.name,style:{color:r===0?"#333333":"#999999"},onClick:function(){return f(n.id)}},n.name),r<_.length-1&&L.a.createElement("span",null,"/")),E})};return L.a.createElement("aside",{style:{overflowX:"auto"}},(_==null?void 0:_.length)>5?o():d())};Fe.a=D},SJMd:function(Xe,Fe){/**
* @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 B,fe,N,S=!1,L,T;window.PR_SHOULD_USE_CONTINUATION=!0;var w,D;(function(){var I=window,A=["break,continue,do,else,for,if,return,while"],O=[A,"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"],_=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[_,"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"],d=[_,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[_,"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"],e="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",u=[_,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="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",t=[A,"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"],n=[A,"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"],r=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],E=[f,o,d,u,s,t,n,r],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",y="kwd",v="com",a="typ",c="lit",i="pun",l="pln",g="tag",h="dec",b="src",R="atn",x="atv",P="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(ve){for(var be=0,Ae=!1,Re=!1,Le=0,Ce=ve.length;Le<Ce;++Le){var xe=ve[Le];if(xe.ignoreCase)Re=!0;else if(/[a-z]/i.test(xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,Re=!1;break}}var Be={b:8,t:9,n:10,v:11,f:12,r:13};function Me(Ke){var Pe=Ke.charCodeAt(0);if(Pe!==92)return Pe;var Ve=Ke.charAt(1);return Pe=Be[Ve],Pe||("0"<=Ve&&Ve<="7"?parseInt(Ke.substring(1),8):Ve==="u"||Ve==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function ge(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var Pe=String.fromCharCode(Ke);return Pe==="\\"||Pe==="-"||Pe==="]"||Pe==="^"?"\\"+Pe:Pe}function De(Ke){var Pe=Ke.substring(1,Ke.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")),Ve=[],He=Pe[0]==="^",Te=["["];He&&Te.push("^");for(var Ue=He?1:0,J=Pe.length;Ue<J;++Ue){var re=Pe[Ue];if(/\\[bdsw]/i.test(re))Te.push(re);else{var oe=Me(re),W;Ue+2<J&&Pe[Ue+1]==="-"?(W=Me(Pe[Ue+2]),Ue+=2):W=oe,Ve.push([oe,W]),W<65||oe>122||(W<65||oe>90||Ve.push([Math.max(65,oe)|32,Math.min(W,90)|32]),W<97||oe>122||Ve.push([Math.max(97,oe)&~32,Math.min(W,122)&~32]))}}Ve.sort(function(ye,we){return ye[0]-we[0]||we[1]-ye[1]});for(var H=[],Q=[],Ue=0;Ue<Ve.length;++Ue){var le=Ve[Ue];le[0]<=Q[1]+1?Q[1]=Math.max(Q[1],le[1]):H.push(Q=le)}for(var Ue=0;Ue<H.length;++Ue){var le=H[Ue];Te.push(ge(le[0])),le[1]>le[0]&&(le[1]+1>le[0]&&Te.push("-"),Te.push(ge(le[1])))}return Te.push("]"),Te.join("")}function Ge(Ke){for(var Pe=Ke.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")),Ve=Pe.length,He=[],Te=0,Ue=0;Te<Ve;++Te){var J=Pe[Te];if(J==="(")++Ue;else if(J.charAt(0)==="\\"){var re=+J.substring(1);re&&(re<=Ue?He[re]=-1:Pe[Te]=ge(re))}}for(var Te=1;Te<He.length;++Te)He[Te]===-1&&(He[Te]=++be);for(var Te=0,Ue=0;Te<Ve;++Te){var J=Pe[Te];if(J==="(")++Ue,He[Ue]||(Pe[Te]="(?:");else if(J.charAt(0)==="\\"){var re=+J.substring(1);re&&re<=Ue&&(Pe[Te]="\\"+He[re])}}for(var Te=0;Te<Ve;++Te)Pe[Te]==="^"&&Pe[Te+1]!=="^"&&(Pe[Te]="");if(Ke.ignoreCase&&Ae)for(var Te=0;Te<Ve;++Te){var J=Pe[Te],oe=J.charAt(0);J.length>=2&&oe==="["?Pe[Te]=De(J):oe!=="\\"&&(Pe[Te]=J.replace(/[a-zA-Z]/g,function(Q){var le=Q.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Pe.join("")}for(var We=[],Le=0,Ce=ve.length;Le<Ce;++Le){var xe=ve[Le];if(xe.global||xe.multiline)throw new Error(""+xe);We.push("(?:"+Ge(xe)+")")}return new RegExp(We.join("|"),Re?"gi":"g")}function C(ve,be){var Ae=/(?:^|\s)nocode(?:\s|$)/,Re=[],Le=0,Ce=[],xe=0;function Be(Me){var ge=Me.nodeType;if(ge==1){if(Ae.test(Me.className))return;for(var De=Me.firstChild;De;De=De.nextSibling)Be(De);var Ge=Me.nodeName.toLowerCase();(Ge==="br"||Ge==="li")&&(Re[xe]=`
`,Ce[xe<<1]=Le++,Ce[xe++<<1|1]=Me)}else if(ge==3||ge==4){var We=Me.nodeValue;We.length&&(be?We=We.replace(/\r\n?/g,`
`):We=We.replace(/[ \t\r\n]+/g," "),Re[xe]=We,Ce[xe<<1]=Le,Le+=We.length,Ce[xe++<<1|1]=Me)}}return Be(ve),{sourceCode:Re.join("").replace(/\n$/,""),spans:Ce}}function U(ve,be,Ae,Re,Le){if(!Ae)return;var Ce={sourceNode:ve,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:be,decorations:null};Re(Ce),Le.push.apply(Le,Ce.decorations)}var K=/\S/;function ee(ve){for(var be=void 0,Ae=ve.firstChild;Ae;Ae=Ae.nextSibling){var Re=Ae.nodeType;be=Re===1?be?ve:Ae:Re===3&&K.test(Ae.nodeValue)?ve:be}return be===ve?void 0:be}function z(ve,be){var Ae={},Re;(function(){for(var xe=ve.concat(be),Be=[],Me={},ge=0,De=xe.length;ge<De;++ge){var Ge=xe[ge],We=Ge[3];if(We)for(var Ke=We.length;--Ke>=0;)Ae[We.charAt(Ke)]=Ge;var Pe=Ge[1],Ve=""+Pe;Me.hasOwnProperty(Ve)||(Be.push(Pe),Me[Ve]=null)}Be.push(/[\0-\uffff]/),Re=k(Be)})();var Le=be.length,Ce=function(xe){for(var Be=xe.sourceCode,Me=xe.basePos,ge=xe.sourceNode,De=[Me,l],Ge=0,We=Be.match(Re)||[],Ke={},Pe=0,Ve=We.length;Pe<Ve;++Pe){var He=We[Pe],Te=Ke[He],Ue=void 0,J;if(typeof Te=="string")J=!1;else{var re=Ae[He.charAt(0)];if(re)Ue=He.match(re[1]),Te=re[0];else{for(var oe=0;oe<Le;++oe)if(re=be[oe],Ue=He.match(re[1]),Ue){Te=re[0];break}Ue||(Te=l)}J=Te.length>=5&&Te.substring(0,5)==="lang-",J&&!(Ue&&typeof Ue[1]=="string")&&(J=!1,Te=b),J||(Ke[He]=Te)}var W=Ge;if(Ge+=He.length,!J)De.push(Me+W,Te);else{var H=Ue[1],Q=He.indexOf(H),le=Q+H.length;Ue[2]&&(le=He.length-Ue[2].length,Q=le-H.length);var ye=Te.substring(5);U(ge,Me+W,He.substring(0,Q),Ce,De),U(ge,Me+W+Q,H,X(ye,H),De),U(ge,Me+W+le,He.substring(le),Ce,De)}}xe.decorations=De};return Ce}function ae(ve){var be=[],Ae=[];ve.tripleQuotedStrings?be.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ve.multiLineStrings?be.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):be.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ve.verbatimStrings&&Ae.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Re=ve.hashComments;Re&&(ve.cStyleComments?(Re>1?be.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):be.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):be.push([v,/^#[^\r\n]*/,null,"#"])),ve.cStyleComments&&(Ae.push([v,/^\/\/[^\r\n]*/,null]),Ae.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Le=ve.regexLiterals;if(Le){var Ce=Le>1?"":`
\r`,xe=Ce?".":"[\\S\\s]",Be="/(?=[^/*"+Ce+"])(?:[^/\\x5B\\x5C"+Ce+"]|\\x5C"+xe+"|\\x5B(?:[^\\x5C\\x5D"+Ce+"]|\\x5C"+xe+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+M+"("+Be+")")])}var Me=ve.types;Me&&Ae.push([a,Me]);var ge=(""+ve.keywords).replace(/^ | $/g,"");ge.length&&Ae.push([y,new RegExp("^(?:"+ge.replace(/[\s,]+/g,"|")+")\\b"),null]),be.push([l,/^\s+/,null,` \r
\xA0`]);var De="^.[^\\s\\w.$@'\"`/\\\\]*";return ve.regexLiterals&&(De+="(?!s*/)"),Ae.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[a,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[i,new RegExp(De),null]),z(be,Ae)}var se=ae({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function V(ve,be,Ae){for(var Re=/(?:^|\s)nocode(?:\s|$)/,Le=/\r\n?|\n/,Ce=ve.ownerDocument,xe=Ce.createElement("li");ve.firstChild;)xe.appendChild(ve.firstChild);var Be=[xe];function Me(Pe){var Ve=Pe.nodeType;if(Ve==1&&!Re.test(Pe.className))if(Pe.nodeName==="br")ge(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var He=Pe.firstChild;He;He=He.nextSibling)Me(He);else if((Ve==3||Ve==4)&&Ae){var Te=Pe.nodeValue,Ue=Te.match(Le);if(Ue){var J=Te.substring(0,Ue.index);Pe.nodeValue=J;var re=Te.substring(Ue.index+Ue[0].length);if(re){var oe=Pe.parentNode;oe.insertBefore(Ce.createTextNode(re),Pe.nextSibling)}ge(Pe),J||Pe.parentNode.removeChild(Pe)}}}function ge(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function Ve(Ue,J){var re=J?Ue.cloneNode(!1):Ue,oe=Ue.parentNode;if(oe){var W=Ve(oe,1),H=Ue.nextSibling;W.appendChild(re);for(var Q=H;Q;Q=H)H=Q.nextSibling,W.appendChild(Q)}return re}for(var He=Ve(Pe.nextSibling,0),Te;(Te=He.parentNode)&&Te.nodeType===1;)He=Te;Be.push(He)}for(var De=0;De<Be.length;++De)Me(Be[De]);be===(be|0)&&Be[0].setAttribute("value",be);var Ge=Ce.createElement("ol");Ge.className="linenums";for(var We=Math.max(0,be-1|0)||0,De=0,Ke=Be.length;De<Ke;++De)xe=Be[De],xe.className="L"+(De+We)%10,xe.firstChild||xe.appendChild(Ce.createTextNode("\xA0")),Ge.appendChild(xe);ve.appendChild(Ge)}function Y(ve){var be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);be=be&&+be[1]<=8;var Ae=/\n/g,Re=ve.sourceCode,Le=Re.length,Ce=0,xe=ve.spans,Be=xe.length,Me=0,ge=ve.decorations,De=ge.length,Ge=0;ge[De]=Le;var We,Ke;for(Ke=We=0;Ke<De;)ge[Ke]!==ge[Ke+2]?(ge[We++]=ge[Ke++],ge[We++]=ge[Ke++]):Ke+=2;for(De=We,Ke=We=0;Ke<De;){for(var Pe=ge[Ke],Ve=ge[Ke+1],He=Ke+2;He+2<=De&&ge[He+1]===Ve;)He+=2;ge[We++]=Pe,ge[We++]=Ve,Ke=He}De=ge.length=We;var Te=ve.sourceNode,Ue="";Te&&(Ue=Te.style.display,Te.style.display="none");try{for(var J=null;Me<Be;){var re=xe[Me],oe=xe[Me+2]||Le,W=ge[Ge+2]||Le,He=Math.min(oe,W),H=xe[Me+1],Q;if(H.nodeType!==1&&(Q=Re.substring(Ce,He))){be&&(Q=Q.replace(Ae,"\r")),H.nodeValue=Q;var le=H.ownerDocument,ye=le.createElement("span");ye.className=ge[Ge+1];var we=H.parentNode;we.replaceChild(ye,H),ye.appendChild(H),Ce<oe&&(xe[Me+1]=H=le.createTextNode(Re.substring(He,oe)),we.insertBefore(H,ye.nextSibling))}Ce=He,Ce>=oe&&(Me+=2),Ce>=W&&(Ge+=2)}}finally{Te&&(Te.style.display=Ue)}}var q={};function G(ve,be){for(var Ae=be.length;--Ae>=0;){var Re=be[Ae];q.hasOwnProperty(Re)?I.console&&console.warn("cannot override language handler %s",Re):q[Re]=ve}}function X(ve,be){return ve&&q.hasOwnProperty(ve)||(ve=/^\s*</.test(be)?"default-markup":"default-code"),q[ve]}G(se,["default-code"]),G(z([],[[l,/^[^<?]+/],[h,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[i,/^(?:<[%?]|[%?]>)/],["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"]),G(z([[l,/^[\s]+/,null,` \r
`],[x,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[g,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[i,/^[=<>\/]+/],["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"]),G(z([],[[x,/^[\s\S]+/]]),["uq.val"]),G(ae({keywords:f,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),G(ae({keywords:"null,true,false"}),["json"]),G(ae({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),G(ae({keywords:d,cStyleComments:!0}),["java"]),G(ae({keywords:r,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),G(ae({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),G(ae({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),G(ae({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),G(ae({keywords:u,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),G(ae({keywords:e,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),G(z([],[[p,/^[\s\S]+/]]),["regex"]);function de(ve){var be=ve.langExtension;try{var Ae=C(ve.sourceNode,ve.pre),Re=Ae.sourceCode;ve.sourceCode=Re,ve.spans=Ae.spans,ve.basePos=0,X(be,Re)(ve),Y(ve)}catch(Le){I.console&&console.log(Le&&Le.stack||Le)}}function Ee(ve,be,Ae){var Re=Ae||!1,Le=be||null,Ce=document.createElement("div");Ce.innerHTML="<pre>"+ve+"</pre>",Ce=Ce.firstChild,Re&&V(Ce,Re,!0);var xe={langExtension:Le,numberLines:Re,sourceNode:Ce,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return de(xe),Ce.innerHTML}function Oe(ve,be){var Ae=be||document.body,Re=Ae.ownerDocument||document;function Le(re){return Ae.getElementsByTagName(re)}for(var Ce=[Le("pre"),Le("code"),Le("xmp")],xe=[],Be=0;Be<Ce.length;++Be)for(var Me=0,ge=Ce[Be].length;Me<ge;++Me)xe.push(Ce[Be][Me]);Ce=null;var De=Date;De.now||(De={now:function(){return+new Date}});var Ge=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,Pe=/\bprettyprinted\b/,Ve=/pre|xmp/i,He=/^code$/i,Te=/^(?:pre|code|xmp)$/i,Ue={};function J(){for(var re=I.PR_SHOULD_USE_CONTINUATION?De.now()+250:Infinity;Ge<xe.length&&De.now()<re;Ge++){for(var oe=xe[Ge],W=Ue,H=oe;H=H.previousSibling;){var Q=H.nodeType,le=(Q===7||Q===8)&&H.nodeValue;if(le?!/^\??prettify\b/.test(le):Q!==3||/\S/.test(H.nodeValue))break;if(le){W={},le.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Lt,lt,Bt){W[lt]=Bt});break}}var ye=oe.className;if((W!==Ue||Ke.test(ye))&&!Pe.test(ye)){for(var we=!1,Ne=oe.parentNode;Ne;Ne=Ne.parentNode){var $e=Ne.tagName;if(Te.test($e)&&Ne.className&&Ke.test(Ne.className)){we=!0;break}}if(!we){oe.className+=" prettyprinted";var nt=W.lang;if(!nt){nt=ye.match(We);var Ze;!nt&&(Ze=ee(oe))&&He.test(Ze.tagName)&&(nt=Ze.className.match(We)),nt&&(nt=nt[1])}var bt;if(Ve.test(oe.tagName))bt=1;else{var ut=oe.currentStyle,Qe=Re.defaultView,Dt=ut?ut.whiteSpace:Qe&&Qe.getComputedStyle?Qe.getComputedStyle(oe,null).getPropertyValue("white-space"):0;bt=Dt&&Dt.substring(0,3)==="pre"}var Tt=W.linenums;(Tt=Tt==="true"||+Tt)||(Tt=ye.match(/\blinenums\b(?::(\d+))?/),Tt=Tt?Tt[1]&&Tt[1].length?+Tt[1]:!0:!1),Tt&&V(oe,Tt,bt);var jt={langExtension:nt,sourceNode:oe,numberLines:Tt,pre:bt,sourceCode:null,basePos:null,spans:null,decorations:null};de(jt)}}}Ge<xe.length?I.setTimeout(J,250):typeof ve=="function"&&ve()}J()}var me=I.PR={createSimpleLexer:z,registerLangHandler:G,sourceDecorator:ae,PR_ATTRIB_NAME:R,PR_ATTRIB_VALUE:x,PR_COMMENT:v,PR_DECLARATION:h,PR_KEYWORD:y,PR_LITERAL:c,PR_NOCODE:P,PR_PLAIN:l,PR_PUNCTUATION:i,PR_SOURCE:b,PR_STRING:p,PR_TAG:g,PR_TYPE:a,prettyPrintOne:S?I.prettyPrintOne=Ee:w=Ee,prettyPrint:D=S?I.prettyPrint=Oe:D=Oe},Se=I.define;typeof Se=="function"&&Se.amd&&Se("google-code-prettify",[],function(){return me})})()},TXwP:function(Xe,Fe,B){var fe,N;(function(){var S;(function(){"use strict";var T=[,,function(A){function O(d){this.__parent=d,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=[]}O.prototype.clone_empty=function(){var d=new O(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},O.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},O.prototype.has_match=function(d){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(d))return!0;return!1},O.prototype.set_indent=function(d,o){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},O.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)},O.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},O.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},O.prototype.is_empty=function(){return this.__items.length===0},O.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},O.prototype.push=function(d){this.__items.push(d);var o=d.lastIndexOf(`
`);o!==-1?this.__character_count=d.length-o:this.__character_count+=d.length},O.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},O.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},O.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},O.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},O.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function _(d,o){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),o=o||"",d.indent_level>0&&(o=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}_.prototype.get_indent_size=function(d,o){var e=this.__base_string_length;return o=o||0,d<0&&(e=0),e+=d*this.__indent_size,e+=o,e},_.prototype.get_indent_string=function(d,o){var e=this.__base_string;return o=o||0,d<0&&(d=0,e=""),o+=d*this.__indent_size,this.__ensure_cache(o),e+=this.__cache[o],e},_.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var d=this.__cache.length,o=0,e="";this.__indent_size&&d>=this.__indent_size&&(o=Math.floor(d/this.__indent_size),d-=o*this.__indent_size,e=new Array(o+1).join(this.__indent_string)),d&&(e+=new Array(d+1).join(" ")),this.__cache.push(e)};function f(d,o){this.__indent_cache=new _(d,o),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new O(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(d,o){return this.__indent_cache.get_indent_string(d,o)},f.prototype.get_indent_size=function(d,o){return this.__indent_cache.get_indent_size(d,o)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(d){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var e=this.__lines.join(`
`);return d!==`
`&&(e=e.replace(/[\n]/g,d)),e},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(d,o){return d=d||0,o=o||0,this.next_line.set_indent(d,o),this.__lines.length>1?(this.current_line.set_indent(d,o),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(d){for(var o=0;o<d.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),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(d){for(var o=this.__lines.length;d<o;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&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(d,o){for(var e=this.__lines.length-2;e>=0;){var u=this.__lines[e];if(u.is_empty())break;if(u.item(0).indexOf(d)!==0&&u.item(-1)!==o){this.__lines.splice(e+1,0,new O(this)),this.previous_line=this.__lines[this.__lines.length-2];break}e--}},A.exports.Output=f},,,,function(A){function O(d,o){this.raw_options=_(d,o),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"])}O.prototype._get_array=function(d,o){var e=this.raw_options[d],u=o||[];return typeof e=="object"?e!==null&&typeof e.concat=="function"&&(u=e.concat()):typeof e=="string"&&(u=e.split(/[^a-zA-Z0-9_\/\-]+/)),u},O.prototype._get_boolean=function(d,o){var e=this.raw_options[d],u=e===void 0?!!o:!!e;return u},O.prototype._get_characters=function(d,o){var e=this.raw_options[d],u=o||"";return typeof e=="string"&&(u=e.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},O.prototype._get_number=function(d,o){var e=this.raw_options[d];o=parseInt(o,10),isNaN(o)&&(o=0);var u=parseInt(e,10);return isNaN(u)&&(u=o),u},O.prototype._get_selection=function(d,o,e){var u=this._get_selection_list(d,o,e);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[d]+"'");return u[0]},O.prototype._get_selection_list=function(d,o,e){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(e=e||[o[0]],!this._is_valid_selection(e,o))throw new Error("Invalid Default Value!");var u=this._get_array(d,e);if(!this._is_valid_selection(u,o))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[d]+"'");return u},O.prototype._is_valid_selection=function(d,o){return d.length&&o.length&&!d.some(function(e){return o.indexOf(e)===-1})};function _(d,o){var e={};d=f(d);var u;for(u in d)u!==o&&(e[u]=d[u]);if(o&&d[o])for(u in d[o])e[u]=d[o][u];return e}function f(d){var o={},e;for(e in d){var u=e.replace(/-/g,"_");o[u]=d[e]}return o}A.exports.Options=O,A.exports.normalizeOpts=f,A.exports.mergeOpts=_},,function(A){var O=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 d=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(d=this.__input.charAt(f)),d},_.prototype.__match=function(f,d){f.lastIndex=d;var o=f.exec(this.__input);return o&&!(O&&f.sticky)&&(o.index!==d&&(o=null)),o},_.prototype.test=function(f,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(f,d):!1},_.prototype.testChar=function(f,d){var o=this.peek(d);return f.lastIndex=0,o!==null&&f.test(o)},_.prototype.match=function(f){var d=this.__match(f,this.__position);return d?this.__position+=d[0].length:d=null,d},_.prototype.read=function(f,d,o){var e="",u;return f&&(u=this.match(f),u&&(e+=u[0])),d&&(u||!f)&&(e+=this.readUntil(d,o)),e},_.prototype.readUntil=function(f,d){var o="",e=this.__position;f.lastIndex=this.__position;var u=f.exec(this.__input);return u?(e=u.index,d&&(e+=u[0].length)):e=this.__input_length,o=this.__input.substring(this.__position,e),this.__position=e,o},_.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},_.prototype.get_regexp=function(f,d){var o=null,e="g";return d&&O&&(e="y"),typeof f=="string"&&f!==""?o=new RegExp(f,e):f&&(o=new RegExp(f.source,e)),o},_.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(f){var d=this.__position,o=this.readUntilAfter(f);return this.__position=d,o},_.prototype.lookBack=function(f){var d=this.__position-1;return d>=f.length&&this.__input.substring(d-f.length,d).toLowerCase()===f},A.exports.InputScanner=_},,,,,function(A){function O(_,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")}O.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(_);d;)f[d[1]]=d[2],d=this.__directive_pattern.exec(_);return f},O.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=O},,function(A,O,_){var f=_(16).Beautifier,d=_(17).Options;function o(e,u){var s=new f(e,u);return s.beautify()}A.exports=o,A.exports.defaultOptions=function(){return new d}},function(A,O,_){var f=_(17).Options,d=_(2).Output,o=_(8).InputScanner,e=_(13).Directives,u=new e(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,n=/\s/,r=/(?:\s|\n)+/g,E=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function p(y,v){this._source_text=y||"",this._options=new f(v),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"]}p.prototype.eatString=function(y){var v="";for(this._ch=this._input.next();this._ch;){if(v+=this._ch,this._ch==="\\")v+=this._input.next();else if(y.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return v},p.prototype.eatWhitespace=function(y){for(var v=n.test(this._input.peek()),a=0;n.test(this._input.peek());)this._ch=this._input.next(),y&&this._ch===`
`&&((a===0||a<this._options.max_preserve_newlines)&&(a++,this._output.add_new_line(!0)));return v},p.prototype.foundNestedPseudoClass=function(){for(var y=0,v=1,a=this._input.peek(v);a;){if(a==="{")return!0;if(a==="(")y+=1;else if(a===")"){if(y===0)return!1;y-=1}else if(a===";"||a==="}")return!1;v++,a=this._input.peek(v)}return!1},p.prototype.print_string=function(y){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(y)},p.prototype.preserveSingleSpace=function(y){y&&(this._output.space_before_token=!0)},p.prototype.indent=function(){this._indentLevel++},p.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,v=this._options.eol;v==="auto"&&(v=`
`,y&&s.test(y||"")&&(v=y.match(s)[0])),y=y.replace(t,`
`);var a=y.match(/^[\t ]*/)[0];this._output=new d(this._options,a),this._input=new o(y),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var c=0,i=!1,l=!1,g=!1,h=!1,b=!1,R=!1,x=this._ch,P=!1,M,k,C;M=this._input.read(r),k=M!=="",C=x,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),x=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var U=this._input.read(E),K=u.get_directives(U);K&&K.ignore==="start"&&(U+=u.readIgnored(this._input)),this.print_string(U),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(m)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(k),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ee=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ee.match(/[ :]$/)&&(ee=this.eatString(": ").replace(/\s$/,""),this.print_string(ee),this._output.space_before_token=!0),ee=ee.replace(/\s$/,""),ee==="extend"?h=!0:ee==="import"&&(b=!0),ee in this.NESTED_AT_RULE?(this._nestedLevel+=1,ee in this.CONDITIONAL_GROUP_RULE&&(g=!0)):!i&&c===0&&ee.indexOf(":")!==-1&&(l=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")l&&(l=!1,this.outdent()),g?(g=!1,i=this._indentLevel>=this._nestedLevel):i=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&i&&(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)):(C==="("?this._output.space_before_token=!1:C!==","&&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(),C==="{"&&this._output.trim(!0),b=!1,h=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),i=!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 z=0;z<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;z++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[z])){P=!0;break}(i||g)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!h&&c===0?(this.print_string(":"),l||(l=!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 ae=C==='"'||C==="'";this.preserveSingleSpace(ae||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")P=!1,c===0?(l&&(this.outdent(),l=!1),h=!1,b=!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(),c++,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(")")),c&&(c--,this.outdent()));else{var se=!1;this._input.lookBack("with")&&(se=!0),this.preserveSingleSpace(k||se),this.print_string(this._ch),l&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),R=!0):(this.eatWhitespace(),c++,this.indent())}else if(this._ch===")")c&&(c--,this.outdent()),R&&this._input.peek()===";"&&this._options.selector_separator_newline&&(R=!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&&(!l||R)&&c===0&&!b&&!h?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!l&&c===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(k),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.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 V=C==='"'||C==="'";this.preserveSingleSpace(V||k),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&P&&this._output.add_new_line()}var Y=this._output.get_code(v);return Y},A.exports.Beautifier=p},function(A,O,_){var f=_(6).Options;function d(o){f.call(this,o,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<u.length;s++)u[s]!=="expand"?this.brace_style="collapse":this.brace_style=u[s]}d.prototype=new f,A.exports.Options=d}],w={};function D(A){var O=w[A];if(O!==void 0)return O.exports;var _=w[A]={exports:{}};return T[A](_,_.exports,D),_.exports}var I=D(15);S=I})();var L=S;!(fe=[],N=function(){return{css_beautify:L}}.apply(Fe,fe),N!==void 0&&(Xe.exports=N))})()},WaYH:function(Xe,Fe,B){"use strict";var fe=B("rePB"),N=B("Ff2n"),S=B("VTBJ"),L=B("1OyB"),T=B("vuIU"),w=B("JX7q"),D=B("Ji7U"),I=B("LK+K"),A=B("cDcd"),O=B("TSYQ"),_=B.n(O),f=B("sboe"),d=B("OZM5"),o=function(y){var v=y.prefixCls,a=y.level,c=y.isStart,i=y.isEnd;if(!a)return null;for(var l="".concat(v,"-indent-unit"),g=[],h=0;h<a;h+=1){var b;g.push(A.createElement("span",{key:h,className:_()(l,(b={},Object(fe.a)(b,"".concat(l,"-start"),c[h+1]),Object(fe.a)(b,"".concat(l,"-end"),i[h+1]),Object(fe.a)(b,"".concat(l,"-end-first-level"),!h&&i[0]),b))}))}return A.createElement("span",{"aria-hidden":"true",className:"".concat(v,"-indent")},g)},e=o,u=B("815F"),s="open",t="close",n="---",r=function(p){Object(D.a)(v,p);var y=Object(I.a)(v);function v(){var a;return Object(L.a)(this,v),a=y.apply(this,arguments),a.state={dragNodeHighlight:!1},a.onSelectorClick=function(c){var i=a.props.context.onNodeClick;i(c,Object(u.b)(a.props)),a.isSelectable()?a.onSelect(c):a.onCheck(c)},a.onSelectorDoubleClick=function(c){var i=a.props.context.onNodeDoubleClick;i(c,Object(u.b)(a.props))},a.onSelect=function(c){if(a.isDisabled())return;var i=a.props.context.onNodeSelect;c.preventDefault(),i(c,Object(u.b)(a.props))},a.onCheck=function(c){if(a.isDisabled())return;var i=a.props,l=i.disableCheckbox,g=i.checked,h=a.props.context.onNodeCheck;if(!a.isCheckable()||l)return;c.preventDefault();var b=!g;h(c,Object(u.b)(a.props),b)},a.onMouseEnter=function(c){var i=a.props.context.onNodeMouseEnter;i(c,Object(u.b)(a.props))},a.onMouseLeave=function(c){var i=a.props.context.onNodeMouseLeave;i(c,Object(u.b)(a.props))},a.onContextMenu=function(c){var i=a.props.context.onNodeContextMenu;i(c,Object(u.b)(a.props))},a.onDragStart=function(c){var i=a.props.context.onNodeDragStart;c.stopPropagation(),a.setState({dragNodeHighlight:!0}),i(c,Object(w.a)(a));try{c.dataTransfer.setData("text/plain","")}catch(l){}},a.onDragEnter=function(c){var i=a.props.context.onNodeDragEnter;c.preventDefault(),c.stopPropagation(),i(c,Object(w.a)(a))},a.onDragOver=function(c){var i=a.props.context.onNodeDragOver;c.preventDefault(),c.stopPropagation(),i(c,Object(w.a)(a))},a.onDragLeave=function(c){var i=a.props.context.onNodeDragLeave;c.stopPropagation(),i(c,Object(w.a)(a))},a.onDragEnd=function(c){var i=a.props.context.onNodeDragEnd;c.stopPropagation(),a.setState({dragNodeHighlight:!1}),i(c,Object(w.a)(a))},a.onDrop=function(c){var i=a.props.context.onNodeDrop;c.preventDefault(),c.stopPropagation(),a.setState({dragNodeHighlight:!1}),i(c,Object(w.a)(a))},a.onExpand=function(c){var i=a.props.context.onNodeExpand;i(c,Object(u.b)(a.props))},a.setSelectHandle=function(c){a.selectHandle=c},a.getNodeState=function(){var c=a.props.expanded;return a.isLeaf()?null:c?s:t},a.hasChildren=function(){var c=a.props.eventKey,i=a.props.context.keyEntities,l=i[c]||{},g=l.children;return!!(g||[]).length},a.isLeaf=function(){var c=a.props,i=c.isLeaf,l=c.loaded,g=a.props.context.loadData,h=a.hasChildren();return i===!1?!1:i||!g&&!h||g&&l&&!h},a.isDisabled=function(){var c=a.props.disabled,i=a.props.context.disabled;return!!(i||c)},a.isCheckable=function(){var c=a.props.checkable,i=a.props.context.checkable;return!i||c===!1?!1:i},a.syncLoadData=function(c){var i=c.expanded,l=c.loading,g=c.loaded,h=a.props.context,b=h.loadData,R=h.onNodeLoad;if(l)return;b&&i&&!a.isLeaf()&&(!a.hasChildren()&&!g&&R(Object(u.b)(a.props)))},a.renderSwitcher=function(){var c=a.props,i=c.expanded,l=c.switcherIcon,g=a.props.context,h=g.prefixCls,b=g.switcherIcon,R=l||b;if(a.isLeaf())return A.createElement("span",{className:_()("".concat(h,"-switcher"),"".concat(h,"-switcher-noop"))},typeof R=="function"?R(Object(S.a)(Object(S.a)({},a.props),{},{isLeaf:!0})):R);var x=_()("".concat(h,"-switcher"),"".concat(h,"-switcher_").concat(i?s:t));return A.createElement("span",{onClick:a.onExpand,className:x},typeof R=="function"?R(Object(S.a)(Object(S.a)({},a.props),{},{isLeaf:!1})):R)},a.renderCheckbox=function(){var c=a.props,i=c.checked,l=c.halfChecked,g=c.disableCheckbox,h=a.props.context.prefixCls,b=a.isDisabled(),R=a.isCheckable();if(!R)return null;var x=typeof R!="boolean"?R:null;return A.createElement("span",{className:_()("".concat(h,"-checkbox"),i&&"".concat(h,"-checkbox-checked"),!i&&l&&"".concat(h,"-checkbox-indeterminate"),(b||g)&&"".concat(h,"-checkbox-disabled")),onClick:a.onCheck},x)},a.renderIcon=function(){var c=a.props.loading,i=a.props.context.prefixCls;return A.createElement("span",{className:_()("".concat(i,"-iconEle"),"".concat(i,"-icon__").concat(a.getNodeState()||"docu"),c&&"".concat(i,"-icon_loading"))})},a.renderSelector=function(){var c=a.state.dragNodeHighlight,i=a.props,l=i.title,g=i.selected,h=i.icon,b=i.loading,R=i.data,x=a.props.context,P=x.prefixCls,M=x.showIcon,k=x.icon,C=x.draggable,U=x.loadData,K=x.titleRender,ee=a.isDisabled(),z="".concat(P,"-node-content-wrapper"),ae;if(M){var se=h||k;ae=se?A.createElement("span",{className:_()("".concat(P,"-iconEle"),"".concat(P,"-icon__customize"))},typeof se=="function"?se(a.props):se):a.renderIcon()}else U&&b&&(ae=a.renderIcon());var V;typeof l=="function"?V=l(R):K?V=K(R):V=l;var Y=A.createElement("span",{className:"".concat(P,"-title")},V);return A.createElement("span",{ref:a.setSelectHandle,title:typeof l=="string"?l:"",className:_()("".concat(z),"".concat(z,"-").concat(a.getNodeState()||"normal"),!ee&&(g||c)&&"".concat(P,"-node-selected"),!ee&&C&&"draggable"),draggable:!ee&&C||void 0,"aria-grabbed":!ee&&C||void 0,onMouseEnter:a.onMouseEnter,onMouseLeave:a.onMouseLeave,onContextMenu:a.onContextMenu,onClick:a.onSelectorClick,onDoubleClick:a.onSelectorDoubleClick,onDragStart:C?a.onDragStart:void 0},ae,Y)},a}return Object(T.a)(v,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var c=this.props.selectable,i=this.props.context.selectable;return typeof c=="boolean"?c:i}},{key:"render",value:function(){var c,i=this.props,l=i.eventKey,g=i.className,h=i.style,b=i.dragOver,R=i.dragOverGapTop,x=i.dragOverGapBottom,P=i.isLeaf,M=i.isStart,k=i.isEnd,C=i.expanded,U=i.selected,K=i.checked,ee=i.halfChecked,z=i.loading,ae=i.domRef,se=i.active,V=i.onMouseMove,Y=Object(N.a)(i,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),q=this.props.context,G=q.prefixCls,X=q.filterTreeNode,de=q.draggable,Ee=q.keyEntities,Oe=this.isDisabled(),me=Object(d.f)(Y),Se=Ee[l]||{},ve=Se.level,be=k[k.length-1];return A.createElement("div",Object.assign({ref:ae,className:_()(g,"".concat(G,"-treenode"),(c={},Object(fe.a)(c,"".concat(G,"-treenode-disabled"),Oe),Object(fe.a)(c,"".concat(G,"-treenode-switcher-").concat(C?"open":"close"),!P),Object(fe.a)(c,"".concat(G,"-treenode-checkbox-checked"),K),Object(fe.a)(c,"".concat(G,"-treenode-checkbox-indeterminate"),ee),Object(fe.a)(c,"".concat(G,"-treenode-selected"),U),Object(fe.a)(c,"".concat(G,"-treenode-loading"),z),Object(fe.a)(c,"".concat(G,"-treenode-active"),se),Object(fe.a)(c,"".concat(G,"-treenode-leaf-last"),be),Object(fe.a)(c,"drag-over",!Oe&&b),Object(fe.a)(c,"drag-over-gap-top",!Oe&&R),Object(fe.a)(c,"drag-over-gap-bottom",!Oe&&x),Object(fe.a)(c,"filter-node",X&&X(Object(u.b)(this.props))),c)),style:h,onDragEnter:de?this.onDragEnter:void 0,onDragOver:de?this.onDragOver:void 0,onDragLeave:de?this.onDragLeave:void 0,onDrop:de?this.onDrop:void 0,onDragEnd:de?this.onDragEnd:void 0,onMouseMove:V},me),A.createElement(e,{prefixCls:G,level:ve,isStart:M,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),v}(A.Component),E=function(y){return A.createElement(f.a.Consumer,null,function(v){return A.createElement(r,Object.assign({},y,{context:v}))})};E.displayName="TreeNode",E.defaultProps={title:n},E.isTreeNode=1;var m=Fe.a=E},Y1PL:function(Xe,Fe,B){"use strict";B.r(Fe),B.d(Fe,"ResizableTextArea",function(){return ee});var fe=B("wx14"),N=B("1OyB"),S=B("vuIU"),L=B("Ji7U"),T=B("LK+K"),w=B("cDcd"),D=B("VTBJ"),I=B("rePB"),A=B("Zm9Q"),O=B("Kwbf"),_=B("c+Xe"),f=B("m+aA"),d=B("bdgK"),o=new Map;function e(se){se.forEach(function(V){var Y,q=V.target;(Y=o.get(q))===null||Y===void 0||Y.forEach(function(G){return G(q)})})}var u=new d.default(e),s=null,t=null;function n(se,V){o.has(se)||(o.set(se,new Set),u.observe(se)),o.get(se).add(V)}function r(se,V){o.has(se)&&(o.get(se).delete(V),o.get(se).size||(u.unobserve(se),o.delete(se)))}var E=function(se){Object(L.a)(Y,se);var V=Object(T.a)(Y);function Y(){return Object(N.a)(this,Y),V.apply(this,arguments)}return Object(S.a)(Y,[{key:"render",value:function(){return this.props.children}}]),Y}(w.Component),m=w.createContext(null);function p(se){var V=se.children,Y=se.onBatchResize,q=w.useRef(0),G=w.useRef([]),X=w.useContext(m),de=w.useCallback(function(Ee,Oe,me){q.current+=1;var Se=q.current;G.current.push({size:Ee,element:Oe,data:me}),Promise.resolve().then(function(){Se===q.current&&(Y==null||Y(G.current),G.current=[])}),X==null||X(Ee,Oe,me)},[Y,X]);return w.createElement(m.Provider,{value:de},V)}function y(se){var V=se.children,Y=se.disabled,q=w.useRef(null),G=w.useRef(null),X=w.useContext(m),de=w.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ee=w.isValidElement(V)&&Object(_.c)(V),Oe=Ee?V.ref:null,me=w.useMemo(function(){return Object(_.a)(Oe,q)},[Oe,q]),Se=w.useRef(se);Se.current=se;var ve=w.useCallback(function(be){var Ae=Se.current,Re=Ae.onResize,Le=Ae.data,Ce=be.getBoundingClientRect(),xe=Ce.width,Be=Ce.height,Me=be.offsetWidth,ge=be.offsetHeight,De=Math.floor(xe),Ge=Math.floor(Be);if(de.current.width!==De||de.current.height!==Ge||de.current.offsetWidth!==Me||de.current.offsetHeight!==ge){var We={width:De,height:Ge,offsetWidth:Me,offsetHeight:ge};de.current=We;var Ke=Me===Math.round(xe)?xe:Me,Pe=ge===Math.round(Be)?Be:ge,Ve=Object(D.a)(Object(D.a)({},We),{},{offsetWidth:Ke,offsetHeight:Pe});X==null||X(Ve,be,Le),Re&&Promise.resolve().then(function(){Re(Ve,be)})}},[]);return w.useEffect(function(){var be=Object(f.a)(q.current)||Object(f.a)(G.current);return be&&!Y&&n(be,ve),function(){return r(be,ve)}},[q.current,Y]),w.createElement(E,{ref:G},Ee?w.cloneElement(V,{ref:me}):V)}var v="rc-observer-key";function a(se){var V=se.children,Y=Object(A.a)(V);return Y.map(function(q,G){var X=(q==null?void 0:q.key)||"".concat(v,"-").concat(G);return w.createElement(y,Object(fe.a)({},se,{key:X}),q)})}a.Collection=p;var c=a,i=B("bT9E"),l=B("TSYQ"),g=B.n(l),h=`
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
`,b=["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"],R={},x;function P(se){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Y=se.getAttribute("id")||se.getAttribute("data-reactid")||se.getAttribute("name");if(V&&R[Y])return R[Y];var q=window.getComputedStyle(se),G=q.getPropertyValue("box-sizing")||q.getPropertyValue("-moz-box-sizing")||q.getPropertyValue("-webkit-box-sizing"),X=parseFloat(q.getPropertyValue("padding-bottom"))+parseFloat(q.getPropertyValue("padding-top")),de=parseFloat(q.getPropertyValue("border-bottom-width"))+parseFloat(q.getPropertyValue("border-top-width")),Ee=b.map(function(me){return"".concat(me,":").concat(q.getPropertyValue(me))}).join(";"),Oe={sizingStyle:Ee,paddingSize:X,borderSize:de,boxSizing:G};return V&&Y&&(R[Y]=Oe),Oe}function M(se){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;x||(x=document.createElement("textarea"),x.setAttribute("tab-index","-1"),x.setAttribute("aria-hidden","true"),document.body.appendChild(x)),se.getAttribute("wrap")?x.setAttribute("wrap",se.getAttribute("wrap")):x.removeAttribute("wrap");var G=P(se,V),X=G.paddingSize,de=G.borderSize,Ee=G.boxSizing,Oe=G.sizingStyle;x.setAttribute("style","".concat(Oe,";").concat(h)),x.value=se.value||se.placeholder||"";var me=Number.MIN_SAFE_INTEGER,Se=Number.MAX_SAFE_INTEGER,ve=x.scrollHeight,be;if(Ee==="border-box"?ve+=de:Ee==="content-box"&&(ve-=X),Y!==null||q!==null){x.value=" ";var Ae=x.scrollHeight-X;Y!==null&&(me=Ae*Y,Ee==="border-box"&&(me=me+X+de),ve=Math.max(me,ve)),q!==null&&(Se=Ae*q,Ee==="border-box"&&(Se=Se+X+de),be=ve>Se?"":"hidden",ve=Math.min(Se,ve))}return{height:ve,minHeight:me,maxHeight:Se,overflowY:be,resize:"none"}}var k=B("Gytx"),C=B.n(k),U;(function(se){se[se.NONE=0]="NONE",se[se.RESIZING=1]="RESIZING",se[se.RESIZED=2]="RESIZED"})(U||(U={}));var K=function(se){Object(L.a)(Y,se);var V=Object(T.a)(Y);function Y(q){var G;return Object(N.a)(this,Y),G=V.call(this,q),G.nextFrameActionId=void 0,G.resizeFrameId=void 0,G.textArea=void 0,G.saveTextArea=function(X){G.textArea=X},G.handleResize=function(X){var de=G.state.resizeStatus,Ee=G.props,Oe=Ee.autoSize,me=Ee.onResize;if(de!==U.NONE)return;typeof me=="function"&&me(X),Oe&&G.resizeOnNextFrame()},G.resizeOnNextFrame=function(){cancelAnimationFrame(G.nextFrameActionId),G.nextFrameActionId=requestAnimationFrame(G.resizeTextarea)},G.resizeTextarea=function(){var X=G.props.autoSize;if(!X||!G.textArea)return;var de=X.minRows,Ee=X.maxRows,Oe=M(G.textArea,!1,de,Ee);G.setState({textareaStyles:Oe,resizeStatus:U.RESIZING},function(){cancelAnimationFrame(G.resizeFrameId),G.resizeFrameId=requestAnimationFrame(function(){G.setState({resizeStatus:U.RESIZED},function(){G.resizeFrameId=requestAnimationFrame(function(){G.setState({resizeStatus:U.NONE}),G.fixFirefoxAutoScroll()})})})})},G.renderTextArea=function(){var X=G.props,de=X.prefixCls,Ee=de===void 0?"rc-textarea":de,Oe=X.autoSize,me=X.onResize,Se=X.className,ve=X.disabled,be=G.state,Ae=be.textareaStyles,Re=be.resizeStatus,Le=Object(i.a)(G.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ce=g()(Ee,Se,Object(I.a)({},"".concat(Ee,"-disabled"),ve));"value"in Le&&(Le.value=Le.value||"");var xe=Object(D.a)(Object(D.a)(Object(D.a)({},G.props.style),Ae),Re===U.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return w.createElement(c,{onResize:G.handleResize,disabled:!(Oe||me)},w.createElement("textarea",Object(fe.a)({},Le,{className:Ce,style:xe,ref:G.saveTextArea})))},G.state={textareaStyles:{},resizeStatus:U.NONE},G}return Object(S.a)(Y,[{key:"componentDidUpdate",value:function(G){(G.value!==this.props.value||!C()(G.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 G=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(G,X)}}catch(de){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Y}(w.Component),ee=K,z=function(se){Object(L.a)(Y,se);var V=Object(T.a)(Y);function Y(q){var G;Object(N.a)(this,Y),G=V.call(this,q),G.resizableTextArea=void 0,G.focus=function(){G.resizableTextArea.textArea.focus()},G.saveTextArea=function(de){G.resizableTextArea=de},G.handleChange=function(de){var Ee=G.props.onChange;G.setValue(de.target.value,function(){G.resizableTextArea.resizeTextarea()}),Ee&&Ee(de)},G.handleKeyDown=function(de){var Ee=G.props,Oe=Ee.onPressEnter,me=Ee.onKeyDown;de.keyCode===13&&Oe&&Oe(de),me&&me(de)};var X=typeof q.value=="undefined"||q.value===null?q.defaultValue:q.value;return G.state={value:X},G}return Object(S.a)(Y,[{key:"setValue",value:function(G,X){"value"in this.props||this.setState({value:G},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return w.createElement(ee,Object(fe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(G){return"value"in G?{value:G.value}:null}}]),Y}(w.Component),ae=Fe.default=z},ZW9T:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return M});var fe=B("k1fw"),N=B("miYZ"),S=B("tsqr"),L=B("rAM+"),T=B("tJVT"),w=B("PpiC"),D=B("cDcd"),I=B.n(D),A=B("bdgK"),O=B("oBTY"),_=B("9og8"),f=B("WmNS"),d=B.n(f),o={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"]},e={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"]},u={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(`
`)}]},s={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(`
`)}]},t=B("5VLF"),n=B.n(t),r={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"]}},E=function(C,U){return U.map(function(K){return{label:K,kind:C.languages.CompletionItemKind.Keyword,insertText:K}})},m=function(C){return Object.keys(r.tables).map(function(U){return{label:U,kind:C.languages.CompletionItemKind.Variable,insertText:U}})},p=function(C,U){var K=r.tables[C];return K?K.map(function(ee){return{label:ee,kind:U.languages.CompletionItemKind.Field,insertText:ee}}):[]};function y(k,C,U,K,ee){var z=C.getWordUntilPosition(U),ae={startLineNumber:U.lineNumber,endLineNumber:U.lineNumber,startColumn:z.startColumn,endColumn:z.endColumn},se=K.map(function(V){return{label:V,kind:k.languages.CompletionItemKind.Keyword,insertText:V,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ae}});return ee.map(function(V){se.push(Object(fe.a)(Object(fe.a)({},V),{},{range:ae}))}),se}var v=function(k){r.languages.map(function(ee){return k.languages.registerDocumentFormattingEditProvider(ee,{provideDocumentFormattingEdits:function(ae,se,V){return Object(_.a)(d.a.mark(function Y(){var q;return d.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return q=n()(ae.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}),X.abrupt("return",[{range:ae.getFullModelRange(),text:q}]);case 2:case"end":return X.stop()}},Y)}))()}}),ee});var C=u.quickKey.map(function(ee){return{label:ee.label,kind:k.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),U=s.quickKey.map(function(ee){return{label:ee.label,kind:k.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),K=e.quickKey.map(function(ee){return{label:ee.label,kind:k.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}});k.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(O.a)(u.keywords),Object(O.a)(u.quickKey.map(function(ee){return ee.label}))),provideCompletionItems:function(z,ae){var se=z.getValueInRange({startLineNumber:ae.lineNumber,startColumn:1,endLineNumber:ae.lineNumber,endColumn:ae.column}),V=se.match(/cu/gim);console.log("match:",V,ae,se,z);var Y=[],q=ae.lineNumber,G=ae.column,X=z.getValueInRange({startLineNumber:q,startColumn:0,endLineNumber:q,endColumn:G}),de=X.trim().split(/\s+/),Ee=de[de.length-1];if(Ee.endsWith(".")){var Oe=Ee.slice(0,Ee.length-1);Object.keys(r.tables).includes(Oe)&&(Y=Object(O.a)(p(Oe,k)))}else Ee==="."?Y=[]:Y=[].concat(Object(O.a)(m(k)),Object(O.a)(E(k,u.keywords)),Object(O.a)(C));return{suggestions:Y}}}),k.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(O.a)(o.keywords)),provideCompletionItems:function(z,ae){var se=z.getValueInRange({startLineNumber:ae.lineNumber,startColumn:1,endLineNumber:ae.lineNumber,endColumn:ae.column}),V=se.match(/cu/gim);console.log("match:",V,ae,se,z);var Y=[],q=ae.lineNumber,G=ae.column,X=z.getValueInRange({startLineNumber:q,startColumn:0,endLineNumber:q,endColumn:G}),de=X.trim().split(/\s+/),Ee=de[de.length-1];if(Ee.endsWith(".")){var Oe=Ee.slice(0,Ee.length-1);Object.keys(r.tables).includes(Oe)&&(Y=Object(O.a)(p(Oe,k)))}else Ee==="."?Y=[]:Y=[].concat(Object(O.a)(m(k)),Object(O.a)(E(k,o.keywords)));return{suggestions:Y}}}),k.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(O.a)(e.keywords)),provideCompletionItems:function(z,ae){var se=[],V=ae.lineNumber,Y=ae.column,q=z.getValueInRange({startLineNumber:V,startColumn:0,endLineNumber:V,endColumn:Y}),G=q.trim().split(/\s+/),X=G[G.length-1];if(X.endsWith(".")){var de=X.slice(0,X.length-1);Object.keys(r.tables).includes(de)&&(se=Object(O.a)(p(de,k)))}else X==="."?se=[]:se=[].concat(Object(O.a)(m(k)),Object(O.a)(E(k,e.keywords)),Object(O.a)(K));return{suggestions:se}}}),k.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(O.a)(s.keywords)),provideCompletionItems:function(z,ae){var se=[],V=ae.lineNumber,Y=ae.column,q=z.getValueInRange({startLineNumber:V,startColumn:0,endLineNumber:V,endColumn:Y}),G=q.trim().split(/\s+/),X=G[G.length-1];if(X.endsWith(".")){var de=X.slice(0,X.length-1);Object.keys(r.tables).includes(de)&&(se=Object(O.a)(p(de,k)))}else X==="."?se=[]:se=[].concat(Object(O.a)(m(k)),Object(O.a)(E(k,s.keywords)),Object(O.a)(U));return{suggestions:se}}})},a="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",c=B("LvDl"),i=B("+ua5");function l(k){return/^\d+$/.test(k)?"".concat(k,"px"):k}function g(){}var h=!1,b={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function R(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=k;if(Array.isArray(k)){for(var U=0;U<k.length;U++){var K=b[k[U]];if(K)return K}return C[0]}return b[C]||C}var x=null,P=Fe.b=function(k){var C=k.width,U=C===void 0?"100%":C,K=k.height,ee=K===void 0?"100%":K,z=k.value,ae=k.language,se=ae===void 0?"javascript":ae,V=k.style,Y=V===void 0?{}:V,q=k.options,G=q===void 0?{}:q,X=k.overrideServices,de=X===void 0?{}:X,Ee=k.theme,Oe=Ee===void 0?"vs-dark":Ee,me=k.onEditBlur,Se=k.onSave,ve=k.autoHeight,be=ve===void 0?!1:ve,Ae=k.forbidCopy,Re=Ae===void 0?!1:Ae,Le=k.onChange,Ce=Le===void 0?g:Le,xe=k.editorDidMount,Be=xe===void 0?g:xe,Me=k.onFocus,ge=Me===void 0?g:Me,De=k.filename,Ge=De===void 0?"educoder.txt":De,We=k.errorLine,Ke=k.errorContent,Pe=Ke===void 0?"":Ke,Ve=Object(w.a)(k,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),He=Object(D.useRef)(),Te=Object(D.useRef)({}),Ue=Object(D.useRef)(),J=Object(D.useRef)(!1),re=Object(D.useRef)(),oe=Object(D.useState)(!1),W=Object(T.a)(oe,2),H=W[0],Q=W[1];function le(){var rt;return He.current&&(rt=new A.default(function(at){var ot=Object(L.a)(at),yt;try{for(ot.s();!(yt=ot.n()).done;){var Ht=yt.value;(Ht.target.offsetHeight>0||Ht.target.offsetWidth>0)&&Te.current.instance.layout()}}catch(qt){ot.e(qt)}finally{ot.f()}}),rt.observe(He.current)),rt}function ye(){S.b.warn(decodeURIComponent(a))}var we=function(){var at=Te.current.instance;if(z!=null&&at&&H){var ot=at.getModel();ot&&z!==ot.getValue()&&(h=!0,ot.setValue(z),at.layout(),h=!1)}};Object(D.useEffect)(function(){Ue.current&&clearTimeout(Ue.current),Ue.current=setTimeout(function(){we()},500)},[z,H,Te.current]),Object(D.useEffect)(function(){if(We&&Te.current&&Te.current.instance){var rt=Te.current.instance;rt.changeViewZones(function(ot){var yt=document.createElement("div");yt.style.padding="10px 20px",yt.style.width="calc(100% - 20px)",yt.className="my-error-line-wrp",yt.innerHTML=Pe,ot.addZone({afterLineNumber:We||11,heightInLines:3,domNode:yt})});var at={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}};rt.addOverlayWidget(at),rt.revealPositionInCenter({lineNumber:20,column:1})}},[We,Te.current,H]);function Ne(){var rt=Te.current.instance;if(rt){var at=rt.getSelection(),ot=Te.current.pastePos||{},yt=new x.Range(ot.startLineNumber||at.endLineNumber,ot.startColumn||at.endColumn,ot.endLineNumber||at.endLineNumber,ot.endColumn||at.endColumn);setTimeout(function(){rt.executeEdits("",[{range:yt,text:""}])},300)}}function $e(rt){(window.navigator.platform.match("Mac")?rt.metaKey:rt.ctrlKey)&&rt.keyCode==83&&(rt.preventDefault(),Se())}var nt=function(){if(be&&Te.current.instance){var at=Te.current.instance.getContentHeight();Bt(at<ee?ee:at)}else Bt(ee)};function Ze(rt){var at=document.createEvent("MouseEvents");at.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),rt.dispatchEvent(at)}function bt(rt,at){var ot=window.URL||window.webkitURL||window,yt=new Blob([at]),Ht=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ht.href=ot.createObjectURL(yt),Ht.download=rt,Ze(Ht)}Object(D.useEffect)(function(){nt()},[nt]),Object(D.useEffect)(function(){He.current&&!H&&B.e(27).then(B.t.bind(null,"M/lh",7)).then(function(rt){try{x=rt,Te.current.instance=x.editor.create(He.current,{value:z,language:R(se),theme:Oe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},de);var at=Te.current.instance;if(Be(at,x),setTimeout(function(){nt(),Te.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){bt(Ge||"educoder.txt",at.getValue())}})},500),Te.current.subscription=at.onDidChangeModelContent(function(yt){J.current?clearTimeout(re.current):(nt(),Ce(at.getValue(),yt)),re.current=setTimeout(function(){J.current=!1},500)}),window.Monaco||v(x),Re&&(at.addCommand(x.KeyMod.CtrlCmd|x.KeyMod.Shift|x.KeyCode.KEY_V,function(){return ye(),null}),at.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_C,function(){return ye(),null})),window.Monaco=x,me&&at.onDidBlurEditorWidget(function(){me(at.getValue())}),ge&&at.onDidFocusEditorText(function(){ge(at.getValue())}),Re){at.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return ye(),null}),at.onDidPaste(function(yt){Te.current.pastePos=yt});try{window.addEventListener("paste",Ne)}catch(yt){}}var ot=le();return Q(!0),function(){var yt=Te.current.instance;yt.dispose();var Ht=yt.getModel();Ht&&Ht.dispose(),Te.current.subscription&&Te.current.subscription.dispose(),Re&&window.removeEventListener("paste",Ne),ot.unobserve(He.current)}}catch(yt){}})},[]),Object(D.useEffect)(function(){var rt=Te.current.instance;if(rt&&H)return document.addEventListener("keydown",$e,!1),function(){document.removeEventListener("keydown",$e)}},[Se,H]),Object(D.useEffect)(function(){var rt=Te.current.instance;if(rt&&H){var at=R(se);x.editor.setModelLanguage(rt.getModel(),at),console.log("language:",se,rt.getModel(),at)}},[se,H]),Object(D.useEffect)(function(){var rt=Te.current.instance;rt&&H&&x.editor.setTheme(Oe)},[Oe,H]),Object(D.useEffect)(function(){var rt=Te.current.instance;rt&&H&&(rt.updateOptions(Object(fe.a)({},G)),setTimeout(function(){rt.getModel().updateOptions(Object(fe.a)({},G))},200))},[JSON.stringify(G),H]),Object(D.useEffect)(function(){var rt=Te.current.instance;rt&&H&&rt.layout()},[U,ee,H]);var ut=Object(D.useState)(l(U)),Qe=Object(T.a)(ut,2),Dt=Qe[0],Tt=Qe[1],jt=Object(D.useState)(l(ee)),Lt=Object(T.a)(jt,2),lt=Lt[0],Bt=Lt[1],zt=Object(fe.a)(Object(fe.a)({},Y),{},{width:Dt,height:lt});return I.a.createElement("div",{className:"my-monaco-editor",ref:He,style:zt})};function M(k){var C=k.width,U=C===void 0?"100%":C,K=k.height,ee=K===void 0?"100%":K,z=k.original,ae=k.modified,se=k.language,V=k.options,Y=V===void 0?{}:V,q=Object(D.useRef)(),G=Object(D.useState)(null),X=Object(T.a)(G,2),de=X[0],Ee=X[1];function Oe(be){var Ae;return q.current&&(Ae=new A.default(function(Re){var Le=Object(L.a)(Re),Ce;try{for(Le.s();!(Ce=Le.n()).done;){var xe=Ce.value;(xe.target.offsetHeight>0||xe.target.offsetWidth>0)&&be.layout()}}catch(Be){Le.e(Be)}finally{Le.f()}}),Ae.observe(q.current)),Ae}Object(D.useEffect)(function(){q.current&&B.e(27).then(B.t.bind(null,"M/lh",7)).then(function(be){x=be;var Ae=x.editor.createDiffEditor(q.current,Object(fe.a)(Object(fe.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},Y),{},{wordWrap:!0}));Ee(Ae);var Re=Oe(Ae);return function(){Ae.dispose();var Le=Ae.getModel();Le&&Le.dispose(),Re.unobserve(q.current)}})},[]),Object(D.useEffect)(function(){de&&de.setModel({original:x.editor.createModel(z,se),modified:x.editor.createModel(ae,se)})},[z,ae,se,de]);var me=l(U),Se=l(ee),ve={width:me,height:Se};return I.a.createElement("div",{className:"my-diff-editor",ref:q,style:ve})}},bT9E:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return N});var fe=B("VTBJ");function N(S,L){var T=Object(fe.a)({},S);return Array.isArray(L)&&L.forEach(function(w){delete T[w]}),T}},d5o6:function(Xe,Fe,B){Xe.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"}},fAei:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return r.a});var fe=B("rePB"),N=B("VTBJ"),S=B("KQm4"),L=B("1OyB"),T=B("vuIU"),w=B("Ji7U"),D=B("LK+K"),I=B("cDcd"),A=B("4IlW"),O=B("Kwbf"),_=B("TSYQ"),f=B.n(_),d=B("sboe"),o=B("OZM5"),e=B("815F"),u=B("ODXe"),s=B("Ff2n"),t=B("+nKL"),n=B("8XRh"),r=B("WaYH"),E=function(ae,se){var V=ae.className,Y=ae.style,q=ae.motion,G=ae.motionNodes,X=ae.motionType,de=ae.onMotionStart,Ee=ae.onMotionEnd,Oe=ae.active,me=ae.treeNodeRequiredProps,Se=Object(s.a)(ae,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ve=I.useState(!0),be=Object(u.a)(ve,2),Ae=be[0],Re=be[1],Le=I.useContext(d.a),Ce=Le.prefixCls,xe=I.useRef(!1),Be=function(){xe.current||Ee(),xe.current=!0};return Object(I.useEffect)(function(){G&&X==="hide"&&Ae&&Re(!1)},[G]),Object(I.useEffect)(function(){return G&&de(),function(){G&&Be()}},[]),G?I.createElement(n.default,Object.assign({ref:se,visible:Ae},q,{motionAppear:X==="show",onAppearEnd:Be,onLeaveEnd:Be}),function(Me,ge){var De=Me.className,Ge=Me.style;return I.createElement("div",{ref:ge,className:f()("".concat(Ce,"-treenode-motion"),De),style:Ge},G.map(function(We){var Ke=We.data,Pe=Ke.key,Ve=Object(s.a)(Ke,["key"]),He=We.isStart,Te=We.isEnd;delete Ve.children;var Ue=Object(e.f)(Pe,me);return I.createElement(r.a,Object.assign({},Ve,Ue,{active:Oe,data:We.data,key:Pe,isStart:He,isEnd:Te}))}))}):I.createElement(r.a,Object.assign({domRef:se,className:V,style:Y},Se,{active:Oe}))};E.displayName="MotionTreeNode";var m=I.forwardRef(E),p=m;function y(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],se=z.length,V=ae.length;if(Math.abs(se-V)!==1)return{add:!1,key:null};function Y(q,G){var X=new Map;q.forEach(function(Ee){X.set(Ee,!0)});var de=G.filter(function(Ee){return!X.has(Ee)});return de.length===1?de[0]:null}return se<V?{add:!0,key:Y(z,ae)}:{add:!1,key:Y(ae,z)}}function v(z,ae,se){var V=z.findIndex(function(X){var de=X.data;return de.key===se}),Y=z[V+1],q=ae.findIndex(function(X){var de=X.data;return de.key===se});if(Y){var G=ae.findIndex(function(X){var de=X.data;return de.key===Y.data.key});return ae.slice(q+1,G)}return ae.slice(q+1)}var a={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},c=function(){},i="RC_TREE_MOTION_".concat(Math.random()),l={key:i},g={key:i,level:0,index:0,pos:"0",node:l},h={parent:null,children:[],pos:g.pos,data:l,isStart:[],isEnd:[]};function b(z,ae,se,V){return ae===!1||!se?z:z.slice(0,Math.ceil(se/V)+1)}function R(z){var ae=z.data.key,se=z.pos;return Object(e.e)(ae,se)}function x(z){for(var ae=String(z.data.key),se=z;se.parent;)se=se.parent,ae="".concat(se.data.key," > ").concat(ae);return ae}var P=function(ae,se){var V=ae.prefixCls,Y=ae.data,q=ae.selectable,G=ae.checkable,X=ae.expandedKeys,de=ae.selectedKeys,Ee=ae.checkedKeys,Oe=ae.loadedKeys,me=ae.loadingKeys,Se=ae.halfCheckedKeys,ve=ae.keyEntities,be=ae.disabled,Ae=ae.dragging,Re=ae.dragOverNodeKey,Le=ae.dropPosition,Ce=ae.motion,xe=ae.height,Be=ae.itemHeight,Me=ae.virtual,ge=ae.focusable,De=ae.activeItem,Ge=ae.focused,We=ae.tabIndex,Ke=ae.onKeyDown,Pe=ae.onFocus,Ve=ae.onBlur,He=ae.onActiveChange,Te=ae.onListChangeStart,Ue=ae.onListChangeEnd,J=Object(s.a)(ae,["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"]),re=I.useRef(null);I.useImperativeHandle(se,function(){return{scrollTo:function(yt){re.current.scrollTo(yt)}}});var oe=I.useState(X),W=Object(u.a)(oe,2),H=W[0],Q=W[1],le=I.useState(Y),ye=Object(u.a)(le,2),we=ye[0],Ne=ye[1],$e=I.useState(Y),nt=Object(u.a)($e,2),Ze=nt[0],bt=nt[1],ut=I.useState([]),Qe=Object(u.a)(ut,2),Dt=Qe[0],Tt=Qe[1],jt=I.useState(null),Lt=Object(u.a)(jt,2),lt=Lt[0],Bt=Lt[1];function zt(){Ne(Y),bt(Y),Tt([]),Bt(null),Ue()}I.useEffect(function(){Q(X);var ot=y(H,X);if(ot.key!==null)if(ot.add){var yt=we.findIndex(function(sn){var dn=sn.data.key;return dn===ot.key}),Ht=b(v(we,Y,ot.key),Me,xe,Be),qt=we.slice();qt.splice(yt+1,0,h),bt(qt),Tt(Ht),Bt("show")}else{var ln=Y.findIndex(function(sn){var dn=sn.data.key;return dn===ot.key}),fn=b(v(Y,we,ot.key),Me,xe,Be),un=Y.slice();un.splice(ln+1,0,h),bt(un),Tt(fn),Bt("hide")}else we!==Y&&(Ne(Y),bt(Y))},[X,Y]),I.useEffect(function(){Ae||zt()},[Ae]);var rt=Ce?Ze:Y,at={expandedKeys:X,selectedKeys:de,loadedKeys:Oe,loadingKeys:me,checkedKeys:Ee,halfCheckedKeys:Se,dragOverNodeKey:Re,dropPosition:Le,keyEntities:ve};return I.createElement(I.Fragment,null,Ge&&De&&I.createElement("span",{style:a,"aria-live":"assertive"},x(De)),I.createElement("div",{role:"tree"},I.createElement("input",{style:a,disabled:ge===!1||be,tabIndex:ge!==!1?We:null,onKeyDown:Ke,onFocus:Pe,onBlur:Ve,value:"",onChange:c})),I.createElement(t.a,Object.assign({},J,{data:rt,itemKey:R,height:xe,fullHeight:!1,virtual:Me,itemHeight:Be,prefixCls:"".concat(V,"-list"),ref:re}),function(ot){var yt=ot.pos,Ht=ot.data,qt=Ht.key,ln=Object(s.a)(Ht,["key"]),fn=ot.isStart,un=ot.isEnd,sn=Object(e.e)(qt,yt);delete ln.children;var dn=Object(e.f)(sn,at);return I.createElement(p,Object.assign({},ln,dn,{active:De&&qt===De.data.key,pos:yt,data:ot.data,isStart:fn,isEnd:un,motion:Ce,motionNodes:qt===i?Dt:null,motionType:lt,onMotionStart:Te,onMotionEnd:zt,treeNodeRequiredProps:at,onMouseMove:function(){He(null)}}))}))},M=I.forwardRef(P);M.displayName="NodeList";var k=M,C=B("NvD2"),U=function(z){Object(w.a)(se,z);var ae=Object(D.a)(se);function se(){var V;return Object(L.a)(this,se),V=ae.apply(this,arguments),V.destroyed=!1,V.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},V.listRef=I.createRef(),V.onNodeDragStart=function(Y,q){var G=V.state,X=G.expandedKeys,de=G.keyEntities,Ee=V.props.onDragStart,Oe=q.props.eventKey;V.dragNode=q;var me=Object(o.b)(X,Oe);V.setState({dragging:!0,dragNodesKeys:Object(o.g)(Oe,de)}),V.setExpandedKeys(me),Ee&&Ee({event:Y,node:Object(e.b)(q.props)})},V.onNodeDragEnter=function(Y,q){var G=V.state,X=G.expandedKeys,de=G.keyEntities,Ee=G.dragNodesKeys,Oe=V.props.onDragEnter,me=q.props,Se=me.pos,ve=me.eventKey;if(!V.dragNode||Ee.indexOf(ve)!==-1)return;var be=Object(o.c)(Y,q);if(V.dragNode.props.eventKey===ve&&be===0){V.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){V.setState({dragOverNodeKey:ve,dropPosition:be}),V.delayedDragEnterLogic||(V.delayedDragEnterLogic={}),Object.keys(V.delayedDragEnterLogic).forEach(function(Ae){clearTimeout(V.delayedDragEnterLogic[Ae])}),V.delayedDragEnterLogic[Se]=window.setTimeout(function(){if(!V.state.dragging)return;var Ae=Object(S.a)(X),Re=de[ve];Re&&(Re.children||[]).length&&(Ae=Object(o.a)(X,ve)),"expandedKeys"in V.props||V.setExpandedKeys(Ae),Oe&&Oe({event:Y,node:Object(e.b)(q.props),expandedKeys:Ae})},400)},0)},V.onNodeDragOver=function(Y,q){var G=V.state.dragNodesKeys,X=V.props.onDragOver,de=q.props.eventKey;if(G.indexOf(de)!==-1)return;if(V.dragNode&&de===V.state.dragOverNodeKey){var Ee=Object(o.c)(Y,q);if(Ee===V.state.dropPosition)return;V.setState({dropPosition:Ee})}X&&X({event:Y,node:Object(e.b)(q.props)})},V.onNodeDragLeave=function(Y,q){var G=V.props.onDragLeave;V.setState({dragOverNodeKey:""}),G&&G({event:Y,node:Object(e.b)(q.props)})},V.onNodeDragEnd=function(Y,q){var G=V.props.onDragEnd;V.setState({dragOverNodeKey:""}),V.cleanDragState(),G&&G({event:Y,node:Object(e.b)(q.props)}),V.dragNode=null},V.onNodeDrop=function(Y,q){var G=V.state,X=G.dragNodesKeys,de=X===void 0?[]:X,Ee=G.dropPosition,Oe=V.props.onDrop,me=q.props,Se=me.eventKey,ve=me.pos;if(V.setState({dragOverNodeKey:""}),V.cleanDragState(),de.indexOf(Se)!==-1){Object(O.a)(!1,"Can not drop to dragNode(include it's children node)");return}var be=Object(o.k)(ve),Ae={event:Y,node:Object(e.b)(q.props),dragNode:V.dragNode?Object(e.b)(V.dragNode.props):null,dragNodesKeys:de.slice(),dropPosition:Ee+Number(be[be.length-1]),dropToGap:!1};Ee!==0&&(Ae.dropToGap=!0),Oe&&Oe(Ae),V.dragNode=null},V.cleanDragState=function(){var Y=V.state.dragging;Y&&V.setState({dragging:!1})},V.onNodeClick=function(Y,q){var G=V.props.onClick;G&&G(Y,q)},V.onNodeDoubleClick=function(Y,q){var G=V.props.onDoubleClick;G&&G(Y,q)},V.onNodeSelect=function(Y,q){var G=V.state.selectedKeys,X=V.state.keyEntities,de=V.props,Ee=de.onSelect,Oe=de.multiple,me=q.selected,Se=q.key,ve=!me;ve?Oe?G=Object(o.a)(G,Se):G=[Se]:G=Object(o.b)(G,Se);var be=G.map(function(Ae){var Re=X[Ae];return Re?Re.node:null}).filter(function(Ae){return Ae});V.setUncontrolledState({selectedKeys:G}),Ee&&Ee(G,{event:"select",selected:ve,node:q,selectedNodes:be,nativeEvent:Y.nativeEvent})},V.onNodeCheck=function(Y,q,G){var X=V.state,de=X.keyEntities,Ee=X.checkedKeys,Oe=X.halfCheckedKeys,me=V.props,Se=me.checkStrictly,ve=me.onCheck,be=q.key,Ae,Re={event:"check",node:q,checked:G,nativeEvent:Y.nativeEvent};if(Se){var Le=G?Object(o.a)(Ee,be):Object(o.b)(Ee,be),Ce=Object(o.b)(Oe,be);Ae={checked:Le,halfChecked:Ce},Re.checkedNodes=Le.map(function(Ge){return de[Ge]}).filter(function(Ge){return Ge}).map(function(Ge){return Ge.node}),V.setUncontrolledState({checkedKeys:Le})}else{var xe=Object(C.a)([].concat(Object(S.a)(Ee),[be]),!0,de),Be=xe.checkedKeys,Me=xe.halfCheckedKeys;if(!G){var ge=new Set(Be);ge.delete(be);var De=Object(C.a)(Array.from(ge),{checked:!1,halfCheckedKeys:Me},de);Be=De.checkedKeys,Me=De.halfCheckedKeys}Ae=Be,Re.checkedNodes=[],Re.checkedNodesPositions=[],Re.halfCheckedKeys=Me,Be.forEach(function(Ge){var We=de[Ge];if(!We)return;var Ke=We.node,Pe=We.pos;Re.checkedNodes.push(Ke),Re.checkedNodesPositions.push({node:Ke,pos:Pe})}),V.setUncontrolledState({checkedKeys:Be},!1,{halfCheckedKeys:Me})}ve&&ve(Ae,Re)},V.onNodeLoad=function(Y){return new Promise(function(q){V.setState(function(G){var X=G.loadedKeys,de=X===void 0?[]:X,Ee=G.loadingKeys,Oe=Ee===void 0?[]:Ee,me=V.props,Se=me.loadData,ve=me.onLoad,be=Y.key;if(!Se||de.indexOf(be)!==-1||Oe.indexOf(be)!==-1)return{};var Ae=Se(Y);return Ae.then(function(){var Re=V.state,Le=Re.loadedKeys,Ce=Re.loadingKeys,xe=Object(o.a)(Le,be),Be=Object(o.b)(Ce,be);ve&&ve(xe,{event:"load",node:Y}),V.setUncontrolledState({loadedKeys:xe}),V.setState({loadingKeys:Be}),q()}),{loadingKeys:Object(o.a)(Oe,be)}})})},V.onNodeMouseEnter=function(Y,q){var G=V.props.onMouseEnter;G&&G({event:Y,node:q})},V.onNodeMouseLeave=function(Y,q){var G=V.props.onMouseLeave;G&&G({event:Y,node:q})},V.onNodeContextMenu=function(Y,q){var G=V.props.onRightClick;G&&(Y.preventDefault(),G({event:Y,node:q}))},V.onFocus=function(){var Y=V.props.onFocus;V.setState({focused:!0}),Y&&Y.apply(void 0,arguments)},V.onBlur=function(){var Y=V.props.onBlur;V.setState({focused:!1}),V.onActiveChange(null),Y&&Y.apply(void 0,arguments)},V.getTreeNodeRequiredProps=function(){var Y=V.state,q=Y.expandedKeys,G=Y.selectedKeys,X=Y.loadedKeys,de=Y.loadingKeys,Ee=Y.checkedKeys,Oe=Y.halfCheckedKeys,me=Y.dragOverNodeKey,Se=Y.dropPosition,ve=Y.keyEntities;return{expandedKeys:q||[],selectedKeys:G||[],loadedKeys:X||[],loadingKeys:de||[],checkedKeys:Ee||[],halfCheckedKeys:Oe||[],dragOverNodeKey:me,dropPosition:Se,keyEntities:ve}},V.setExpandedKeys=function(Y){var q=V.state.treeData,G=Object(e.d)(q,Y);V.setUncontrolledState({expandedKeys:Y,flattenNodes:G},!0)},V.onNodeExpand=function(Y,q){var G=V.state.expandedKeys,X=V.state.listChanging,de=V.props,Ee=de.onExpand,Oe=de.loadData,me=q.key,Se=q.expanded;if(X)return;var ve=G.indexOf(me),be=!Se;if(Object(O.a)(Se&&ve!==-1||!Se&&ve===-1,"Expand state not sync with index check"),be?G=Object(o.a)(G,me):G=Object(o.b)(G,me),V.setExpandedKeys(G),Ee&&Ee(G,{node:q,expanded:be,nativeEvent:Y.nativeEvent}),be&&Oe){var Ae=V.onNodeLoad(q);Ae&&Ae.then(function(){var Re=Object(e.d)(V.state.treeData,G);V.setUncontrolledState({flattenNodes:Re})})}},V.onListChangeStart=function(){V.setUncontrolledState({listChanging:!0})},V.onListChangeEnd=function(){setTimeout(function(){V.setUncontrolledState({listChanging:!1})})},V.onActiveChange=function(Y){var q=V.state.activeKey,G=V.props.onActiveChange;if(q===Y)return;V.setState({activeKey:Y}),Y!==null&&V.scrollTo({key:Y}),G&&G(Y)},V.getActiveItem=function(){var Y=V.state,q=Y.activeKey,G=Y.flattenNodes;return q===null?null:G.find(function(X){var de=X.data.key;return de===q})||null},V.offsetActiveKey=function(Y){var q=V.state,G=q.flattenNodes,X=q.activeKey,de=G.findIndex(function(me){var Se=me.data.key;return Se===X});de===-1&&Y<0&&(de=G.length),de=(de+Y+G.length)%G.length;var Ee=G[de];if(Ee){var Oe=Ee.data.key;V.onActiveChange(Oe)}else V.onActiveChange(null)},V.onKeyDown=function(Y){var q=V.state,G=q.activeKey,X=q.expandedKeys,de=q.checkedKeys,Ee=V.props,Oe=Ee.onKeyDown,me=Ee.checkable,Se=Ee.selectable;switch(Y.which){case A.a.UP:{V.offsetActiveKey(-1),Y.preventDefault();break}case A.a.DOWN:{V.offsetActiveKey(1),Y.preventDefault();break}}var ve=V.getActiveItem();if(ve&&ve.data){var be=V.getTreeNodeRequiredProps(),Ae=ve.data.isLeaf===!1||!!(ve.data.children||[]).length,Re=Object(e.b)(Object(N.a)(Object(N.a)({},Object(e.f)(G,be)),{},{data:ve.data,active:!0}));switch(Y.which){case A.a.LEFT:{Ae&&X.includes(G)?V.onNodeExpand({},Re):ve.parent&&V.onActiveChange(ve.parent.data.key),Y.preventDefault();break}case A.a.RIGHT:{Ae&&!X.includes(G)?V.onNodeExpand({},Re):ve.children&&ve.children.length&&V.onActiveChange(ve.children[0].data.key),Y.preventDefault();break}case A.a.ENTER:case A.a.SPACE:{me&&!Re.disabled&&Re.checkable!==!1&&!Re.disableCheckbox?V.onNodeCheck({},Re,!de.includes(G)):!me&&Se&&!Re.disabled&&Re.selectable!==!1&&V.onNodeSelect({},Re);break}}}Oe&&Oe(Y)},V.setUncontrolledState=function(Y){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(V.destroyed)return;var X=!1,de=!0,Ee={};Object.keys(Y).forEach(function(Oe){if(Oe in V.props){de=!1;return}X=!0,Ee[Oe]=Y[Oe]}),X&&(!q||de)&&V.setState(Object(N.a)(Object(N.a)({},Ee),G))},V.scrollTo=function(Y){V.listRef.current.scrollTo(Y)},V}return Object(T.a)(se,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var Y,q=this.state,G=q.focused,X=q.flattenNodes,de=q.keyEntities,Ee=q.dragging,Oe=q.activeKey,me=this.props,Se=me.prefixCls,ve=me.className,be=me.style,Ae=me.showLine,Re=me.focusable,Le=me.tabIndex,Ce=Le===void 0?0:Le,xe=me.selectable,Be=me.showIcon,Me=me.icon,ge=me.switcherIcon,De=me.draggable,Ge=me.checkable,We=me.checkStrictly,Ke=me.disabled,Pe=me.motion,Ve=me.loadData,He=me.filterTreeNode,Te=me.height,Ue=me.itemHeight,J=me.virtual,re=me.titleRender,oe=me.onContextMenu,W=Object(o.f)(this.props);return I.createElement(d.a.Provider,{value:{prefixCls:Se,selectable:xe,showIcon:Be,icon:Me,switcherIcon:ge,draggable:De,checkable:Ge,checkStrictly:We,disabled:Ke,keyEntities:de,loadData:Ve,filterTreeNode:He,titleRender:re,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}},I.createElement("div",{className:f()(Se,ve,(Y={},Object(fe.a)(Y,"".concat(Se,"-show-line"),Ae),Object(fe.a)(Y,"".concat(Se,"-focused"),G),Object(fe.a)(Y,"".concat(Se,"-active-focused"),Oe!==null),Y))},I.createElement(k,Object.assign({ref:this.listRef,prefixCls:Se,style:be,data:X,disabled:Ke,selectable:xe,checkable:!!Ge,motion:Pe,dragging:Ee,height:Te,itemHeight:Ue,virtual:J,focusable:Re,focused:G,tabIndex:Ce,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:oe},this.getTreeNodeRequiredProps(),W))))}}],[{key:"getDerivedStateFromProps",value:function(Y,q){var G=q.prevProps,X={prevProps:Y};function de(Me){return!G&&Me in Y||G&&G[Me]!==Y[Me]}var Ee;if(de("treeData")?Ee=Y.treeData:de("children")&&(Object(O.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Ee=Object(e.c)(Y.children)),Ee){X.treeData=Ee;var Oe=Object(e.a)(Ee);X.keyEntities=Object(N.a)(Object(fe.a)({},i,g),Oe.keyEntities)}var me=X.keyEntities||q.keyEntities;if(de("expandedKeys")||G&&de("autoExpandParent"))X.expandedKeys=Y.autoExpandParent||!G&&Y.defaultExpandParent?Object(o.e)(Y.expandedKeys,me):Y.expandedKeys;else if(!G&&Y.defaultExpandAll){var Se=Object(N.a)({},me);delete Se[i],X.expandedKeys=Object.keys(Se).map(function(Me){return Se[Me].key})}else!G&&Y.defaultExpandedKeys&&(X.expandedKeys=Y.autoExpandParent||Y.defaultExpandParent?Object(o.e)(Y.defaultExpandedKeys,me):Y.defaultExpandedKeys);if(X.expandedKeys||delete X.expandedKeys,Ee||X.expandedKeys){var ve=Object(e.d)(Ee||q.treeData,X.expandedKeys||q.expandedKeys);X.flattenNodes=ve}if(Y.selectable&&(de("selectedKeys")?X.selectedKeys=Object(o.d)(Y.selectedKeys,Y):!G&&Y.defaultSelectedKeys&&(X.selectedKeys=Object(o.d)(Y.defaultSelectedKeys,Y))),Y.checkable){var be;if(de("checkedKeys")?be=Object(o.j)(Y.checkedKeys)||{}:!G&&Y.defaultCheckedKeys?be=Object(o.j)(Y.defaultCheckedKeys)||{}:Ee&&(be=Object(o.j)(Y.checkedKeys)||{checkedKeys:q.checkedKeys,halfCheckedKeys:q.halfCheckedKeys}),be){var Ae=be,Re=Ae.checkedKeys,Le=Re===void 0?[]:Re,Ce=Ae.halfCheckedKeys,xe=Ce===void 0?[]:Ce;if(!Y.checkStrictly){var Be=Object(C.a)(Le,!0,me);Le=Be.checkedKeys,xe=Be.halfCheckedKeys}X.checkedKeys=Le,X.halfCheckedKeys=xe}}return de("loadedKeys")&&(X.loadedKeys=Y.loadedKeys),X}}]),se}(I.Component);U.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:[]},U.TreeNode=r.a;var K=U,ee=Fe.b=K},iris:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return d});var fe=B("qVdP"),N=B("jsC+"),S=B("lUTK"),L=B("BvKs"),T=B("tJVT"),w=B("cDcd"),D=B.n(w),I=B("Q0Vu"),A=B.n(I),O=[{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"}],_=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],f=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],d=function(e){var u=e.showSelectAll,s=u===void 0?!1:u,t=e.disciplinesData,n=t===void 0?[]:t,r=e.knowledgeData,E=r===void 0?[]:r,m=e.directionValue,p=e.subDisciplineValue,y=e.typeValue,v=e.knowledgeValue,a=e.showKnowledge,c=a===void 0?!1:a,i=e.showRandomType,l=i===void 0?!1:i,g=e.difficultyValue,h=e.randomValue,b=e.selectAll,R=e.languagesvalue,x=e.className,P=e.languages,M=P===void 0?[]:P,k=e.isprogram_homework,C=e.showShixun,U=C===void 0?!1:C,K=e.showItemType,ee=K===void 0?!0:K,z=e.onShixunChange,ae=z===void 0?function(){}:z,se=e.onDirectionChange,V=se===void 0?function(){}:se,Y=e.onTypeChange,q=Y===void 0?function(){}:Y,G=e.onDifficultyChange,X=G===void 0?function(){}:G,de=e.handlelanguagesChange,Ee=de===void 0?function(){}:de,Oe=e.onKnowledgeChange,me=Oe===void 0?function(){}:Oe,Se=e.onRandomChange,ve=Se===void 0?function(){}:Se,be=e.showTeachGroup,Ae=be===void 0?!1:be,Re=e.teachGroupData,Le=Re===void 0?[]:Re,Ce=e.onTeachGroupChange,xe=Ce===void 0?function(){}:Ce,Be=e.teachGroupValue,Me=Object(w.useState)(0),ge=Object(T.a)(Me,2),De=ge[0],Ge=ge[1],We=Object(w.useRef)(null),Ke=Object(w.useState)(0),Pe=Object(T.a)(Ke,2),Ve=Pe[0],He=Pe[1],Te=Object(w.useRef)(null);Object(w.useEffect)(function(){if(n.length!==0){var J;(We==null||((J=We.current)===null||J===void 0)?void 0:J.clientHeight)>108?Ge(1):Ge(0)}n.length===0&&Ge(0)},[n]),Object(w.useEffect)(function(){if(console.log(E.length===0,"\u6570\u91CF"),E.length!==0){var J,re;console.log(Te==null||((J=Te.current)===null||J===void 0)?void 0:J.clientHeight,"\u9AD8\u5EA6"),(Te==null||((re=Te.current)===null||re===void 0)?void 0:re.clientHeight)>108?He(1):He(0)}E.length===0&&He(0)},[E]);var Ue=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],oe=arguments.length>1?arguments[1]:void 0;return D.a.createElement(L.a,{className:A.a.subMenu},re.map(function(W){return D.a.createElement(L.a.Item,{key:W.id},D.a.createElement("a",{className:"".concat(A.a.subItem," ").concat(p===W.id?A.a.subActive:""),onClick:function(){return V(oe,W.id)}},W.name))}))};return D.a.createElement("aside",{className:x?"".concat(A.a.main," ").concat(x):A.a.main},D.a.createElement("div",{className:A.a.wrap},k&&D.a.createElement("div",{className:A.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ae&&D.a.createElement("div",{className:A.a.content},D.a.createElement("span",{className:A.a.name},"\u56E2\u961F"),D.a.createElement("div",{className:A.a.directionContentWrap},D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(Be?"":A.a.active," "),onClick:function(){return xe(null)}},"\u5168\u90E8"),Le==null?void 0:Le.map(function(J){return D.a.createElement("li",{key:J.group_id,className:"".concat(A.a.directionItem," ").concat(Be===J.group_id?A.a.active:""," "),onClick:function(){return xe(J.group_id)}},J.name)}))),D.a.createElement("div",{className:A.a.content},D.a.createElement("span",{className:A.a.name},"\u65B9\u5411"),D.a.createElement("span",null),D.a.createElement("div",{className:A.a.directionContentWrap,style:{overflow:"hidden",height:De===1?88:"auto"}},D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(m?"":A.a.active," "),onClick:function(){return V(null)}},"\u5168\u90E8"),n.map(function(J){var re;return D.a.createElement(D.a.Fragment,{key:J.id},((re=J.sub_disciplines)===null||re===void 0?void 0:re.length)>0?D.a.createElement(N.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(W){return W.parentNode},overlay:function(){return Ue(J.sub_disciplines,J.id)}},D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(m===J.id?A.a.active:""," "),onClick:function(){return V(J.id)}},J.name)):D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(m===J.id?A.a.active:""," "),onClick:function(){return V(J.id)}},J.name))})),D.a.createElement("div",{className:A.a.directionContentWrap,ref:We,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},n.map(function(J){var re;return D.a.createElement(D.a.Fragment,{key:J.id},((re=J.sub_disciplines)===null||re===void 0?void 0:re.length)>0?D.a.createElement(N.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(W){return W.parentNode},overlay:function(){return Ue(J.sub_disciplines,J.id)}},D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(m===J.id?A.a.active:""," "),onClick:function(){return V(J.id)}},J.name)):D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(m===J.id?A.a.active:""," "),onClick:function(){return V(J.id)}},J.name))})),!!De&&D.a.createElement("div",{className:A.a.action},De===1&&D.a.createElement("span",{onClick:function(){return Ge(2)}},"\u5C55\u5F00",D.a.createElement("i",{className:"iconfont icon-xiala"})),De===2&&D.a.createElement("span",{onClick:function(){return Ge(1)}},"\u6536\u8D77",D.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),c&&D.a.createElement("div",{className:A.a.content},D.a.createElement("span",{className:A.a.name},"\u77E5\u8BC6\u70B9"),D.a.createElement("div",{className:A.a.directionContentWrap,style:{overflow:"hidden",height:Ve===1?106:"auto"}},D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(v===-1?A.a.active:""," "),onClick:function(){return me(-1)}},"\u5168\u90E8"),E.map(function(J){return D.a.createElement("li",{key:J.id,className:"".concat(A.a.directionItem," ").concat(v===J.id?A.a.active:""," "),onClick:function(){return me(J.id)}},J.name)})),D.a.createElement("div",{ref:Te,className:A.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},E.map(function(J){return D.a.createElement("li",{key:J.id,className:"".concat(A.a.directionItem," ").concat(v===J.id?A.a.active:""," "),onClick:function(){return me(J.id)}},J.name)})),!!Ve&&D.a.createElement("div",{className:A.a.action},Ve===1&&D.a.createElement("span",{onClick:function(){return He(2)}},"\u5C55\u5F00",D.a.createElement("i",{className:"iconfont icon-xiala"})),Ve===2&&D.a.createElement("span",{onClick:function(){return He(1)}},"\u6536\u8D77",D.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),ee&&!k&&D.a.createElement("div",{className:A.a.content},D.a.createElement("span",{className:A.a.name},"\u9898\u578B"),D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(y?"":A.a.active," "),onClick:function(){return q(null)}},"\u5168\u90E8"),D.a.createElement("div",{className:A.a.directionContentWrap},O.map(function(J){return D.a.createElement("li",{key:J.name,className:"".concat(A.a.directionItem," ").concat(y===J.value?A.a.active:""," "),onClick:function(){return q(J.value)}},J.name)}),U&&D.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:A.a.directionItem,onClick:function(){return ae()}},"\u5B9E\u8BAD\u9898"))),D.a.createElement("div",{className:A.a.content},D.a.createElement("span",{className:A.a.name},"\u96BE\u5EA6"),D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(g?"":A.a.active," "),onClick:function(){return X(null)}},"\u5168\u90E8"),D.a.createElement("div",{className:A.a.directionContentWrap},_.map(function(J){return D.a.createElement("li",{key:J.name,className:"".concat(A.a.directionItem," ").concat(g===J.value?A.a.active:""," "),onClick:function(){return X(J.value)}},J.name)}))),l&&D.a.createElement("div",{className:A.a.content},D.a.createElement("span",{className:A.a.name},"\u7C7B\u578B"),D.a.createElement("li",{className:"".concat(A.a.directionItem," ").concat(h?"":A.a.active," "),onClick:function(){return ve(null)}},"\u5168\u90E8"),D.a.createElement("div",{className:A.a.directionContentWrap},f.map(function(J){return D.a.createElement("li",{key:J.name,className:"".concat(A.a.directionItem," ").concat(h===J.value?A.a.active:""," "),onClick:function(){return ve(J.value)}},J.name)})))))}},jcZT:function(Xe,Fe,B){"use strict";var fe=B("2qtc"),N=B("kLXV"),S=B("5NDa"),L=B("5rEg"),T=B("miYZ"),w=B("tsqr"),D=B("9og8"),I=B("tJVT"),A=B("WmNS"),O=B.n(A),_=B("cDcd"),f=B.n(_),d=B("d5o6"),o=B.n(d),e=B("P/tu"),u=B("WCUW"),s=B("9kvl"),t=function(r){var E=r.problemset,m=r.dispatch,p=r.onOk,y=Object(_.useState)(""),v=Object(I.a)(y,2),a=v[0],c=v[1],i=Object(_.useState)([0]),l=Object(I.a)(i,2),g=l[0],h=l[1],b=function(){m({type:"problemset/setActionTabs",payload:{}})};Object(_.useEffect)(function(){if(E.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var x,P;h([(x=E.actionTabs)===null||x===void 0||((P=x.params)===null||P===void 0)?void 0:P.group_id]),c("")}},[E.actionTabs.key]);var R=function(){var x=Object(D.a)(O.a.mark(function P(){var M,k,C;return O.a.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(M=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],a.trim()){K.next=4;break}return w.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),K.abrupt("return");case 4:if(!(a.charAt(0)===" ")){K.next=7;break}return w.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),K.abrupt("return");case 7:k=0;case 8:if(!(k<a.length)){K.next=15;break}if(!M.includes(a.charAt(k))){K.next=12;break}return w.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),K.abrupt("return",!1);case 12:k++,K.next=8;break;case 15:return K.next=17,Object(u.p)({parent_id:g.length>0?g[0]:0,name:a});case 17:C=K.sent,C.status===0&&(b(),p(C==null?void 0:C.id));case 19:case"end":return K.stop()}},P)}));return function(){return x.apply(this,arguments)}}();return f.a.createElement(N.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:E.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:b,onOk:R,destroyOnClose:!0},f.a.createElement("div",{className:o.a.addModal},f.a.createElement("div",{className:o.a.row},f.a.createElement("span",{className:o.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),f.a.createElement(L.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:a,onChange:function(P){return c(P.target.value)}})),f.a.createElement("div",{className:o.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},f.a.createElement("span",{className:o.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),f.a.createElement(e.a,{value:g,onChange:function(P){return h(P)}}))))};Fe.a=Object(s.a)(function(n){var r=n.problemset;return{problemset:r}})(t)},k3GJ:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return Wr});var fe=B("rePB"),N=B("ODXe"),S=B("Ff2n"),L=B("VTBJ"),T=B("cDcd"),w=B("TSYQ"),D=B.n(w),I=B("Zm9Q"),A=B("6cGi"),O=B("KQm4"),_=B("xEkU"),f=B.n(_),d=B("t23M");function o(Z){var ue=Object(T.useRef)(),he=Object(T.useRef)(!1);function ne(){for(var j=arguments.length,$=new Array(j),F=0;F<j;F++)$[F]=arguments[F];he.current||(f.a.cancel(ue.current),ue.current=f()(function(){Z.apply(void 0,$)}))}return Object(T.useEffect)(function(){return function(){he.current=!0,f.a.cancel(ue.current)}},[]),ne}function e(Z){var ue=Object(T.useRef)([]),he=Object(T.useState)({}),ne=Object(N.a)(he,2),j=ne[1],$=Object(T.useRef)(typeof Z=="function"?Z():Z),F=o(function(){var ie=$.current;ue.current.forEach(function(pe){ie=pe(ie)}),ue.current=[],$.current=ie,j({})});function te(ie){ue.current.push(ie),F()}return[$.current,te]}var u=B("4IlW");function s(Z,ue){var he,ne=Z.prefixCls,j=Z.id,$=Z.active,F=Z.rtl,te=Z.tab,ie=te.key,pe=te.tab,ce=te.disabled,_e=te.closeIcon,Ie=Z.tabBarGutter,je=Z.tabPosition,ke=Z.closable,ze=Z.renderWrapper,it=Z.removeAriaLabel,ht=Z.editable,st=Z.onClick,mt=Z.onRemove,pt=Z.onFocus,dt="".concat(ne,"-tab");T.useEffect(function(){return mt},[]);var ct={};je==="top"||je==="bottom"?ct[F?"marginLeft":"marginRight"]=Ie:ct.marginBottom=Ie;var Ot=ht&&ke!==!1&&!ce;function gt(tt){if(ce)return;st(tt)}function Ut(tt){tt.preventDefault(),tt.stopPropagation(),ht.onEdit("remove",{key:ie,event:tt})}var wt=T.createElement("div",{key:ie,ref:ue,className:D()(dt,(he={},Object(fe.a)(he,"".concat(dt,"-with-remove"),Ot),Object(fe.a)(he,"".concat(dt,"-active"),$),Object(fe.a)(he,"".concat(dt,"-disabled"),ce),he)),style:ct,onClick:gt},T.createElement("div",{role:"tab","aria-selected":$,id:j&&"".concat(j,"-tab-").concat(ie),className:"".concat(dt,"-btn"),"aria-controls":j&&"".concat(j,"-panel-").concat(ie),"aria-disabled":ce,tabIndex:ce?null:0,onClick:function(et){et.stopPropagation(),gt(et)},onKeyDown:function(et){[u.a.SPACE,u.a.ENTER].includes(et.which)&&(et.preventDefault(),gt(et))},onFocus:pt},pe),Ot&&T.createElement("button",{type:"button","aria-label":it||"remove",tabIndex:0,className:"".concat(dt,"-remove"),onClick:function(et){et.stopPropagation(),Ut(et)}},_e||ht.removeIcon||"\xD7"));return ze&&(wt=ze(wt)),wt}var t=T.forwardRef(s),n={width:0,height:0,left:0,top:0};function r(Z,ue,he){return Object(T.useMemo)(function(){for(var ne,j=new Map,$=ue.get((ne=Z[0])===null||ne===void 0?void 0:ne.key)||n,F=$.left+$.width,te=0;te<Z.length;te+=1){var ie=Z[te].key,pe=ue.get(ie);if(!pe){var ce;pe=ue.get((ce=Z[te-1])===null||ce===void 0?void 0:ce.key)||n}var _e=j.get(ie)||Object(L.a)({},pe);_e.right=F-_e.left-_e.width,j.set(ie,_e)}return j},[Z.map(function(ne){return ne.key}).join("_"),ue,he])}var E={width:0,height:0,left:0,top:0,right:0};function m(Z,ue,he,ne,j){var $=j.tabs,F=j.tabPosition,te=j.rtl,ie,pe,ce;["top","bottom"].includes(F)?(ie="width",pe=te?"right":"left",ce=Math.abs(ue.left)):(ie="height",pe="top",ce=-ue.top);var _e=ue[ie],Ie=he[ie],je=ne[ie],ke=_e;return Ie+je>_e&&(ke=_e-je),Object(T.useMemo)(function(){if(!$.length)return[0,0];for(var ze=$.length,it=ze,ht=0;ht<ze;ht+=1){var st=Z.get($[ht].key)||E;if(st[pe]+st[ie]>ce+ke){it=ht-1;break}}for(var mt=0,pt=ze-1;pt>=0;pt-=1){var dt=Z.get($[pt].key)||E;if(dt[pe]<ce){mt=pt+1;break}}return[mt,it]},[Z,ce,ke,F,$.map(function(ze){return ze.key}).join("_"),te])}var p=B("wx14"),y=B("1OyB"),v=B("vuIU"),a=B("JX7q"),c=B("Ji7U"),i=B("LK+K"),l=B("I8Z2"),g=B("bT9E"),h=B("2GS6"),b=B("Gytx"),R=B.n(b),x=B("U8pU"),P=/iPhone/i,M=/iPod/i,k=/iPad/i,C=/\bAndroid(?:.+)Mobile\b/i,U=/Android/i,K=/\bAndroid(?:.+)SD4930UR\b/i,ee=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,z=/Windows Phone/i,ae=/\bWindows(?:.+)ARM\b/i,se=/BlackBerry/i,V=/BB10/i,Y=/Opera Mini/i,q=/\b(CriOS|Chrome)(?:.+)Mobile/i,G=/Mobile(?:.+)Firefox\b/i;function X(Z,ue){return Z.test(ue)}function de(Z){var ue=Z||(typeof navigator!="undefined"?navigator.userAgent:""),he=(ue||"").split("[FBAN");if(typeof he[1]!="undefined"){var ne=he,j=Object(N.a)(ne,1);ue=j[0]}if(he=ue.split("Twitter"),typeof he[1]!="undefined"){var $=he,F=Object(N.a)($,1);ue=F[0]}var te={apple:{phone:X(P,ue)&&!X(z,ue),ipod:X(M,ue),tablet:!X(P,ue)&&X(k,ue)&&!X(z,ue),device:(X(P,ue)||X(M,ue)||X(k,ue))&&!X(z,ue)},amazon:{phone:X(K,ue),tablet:!X(K,ue)&&X(ee,ue),device:X(K,ue)||X(ee,ue)},android:{phone:!X(z,ue)&&X(K,ue)||!X(z,ue)&&X(C,ue),tablet:!X(z,ue)&&!X(K,ue)&&!X(C,ue)&&(X(ee,ue)||X(U,ue)),device:!X(z,ue)&&(X(K,ue)||X(ee,ue)||X(C,ue)||X(U,ue))||X(/\bokhttp\b/i,ue)},windows:{phone:X(z,ue),tablet:X(ae,ue),device:X(z,ue)||X(ae,ue)},other:{blackberry:X(se,ue),blackberry10:X(V,ue),opera:X(Y,ue),firefox:X(G,ue),chrome:X(q,ue),device:X(se,ue)||X(V,ue)||X(Y,ue)||X(G,ue)||X(q,ue)},any:null,phone:null,tablet:null};return te.any=te.apple.device||te.android.device||te.windows.device||te.other.device,te.phone=te.apple.phone||te.android.phone||te.windows.phone,te.tablet=te.apple.tablet||te.android.tablet||te.windows.tablet,te}var Ee=Object(L.a)(Object(L.a)({},de()),{},{isMobile:de}),Oe=Ee;function me(){}function Se(Z,ue,he){var ne=ue||"";return Z.key||"".concat(ne,"item_").concat(he)}function ve(Z){return"".concat(Z,"-menu-")}function be(Z,ue){var he=-1;T.Children.forEach(Z,function(ne){he+=1,ne&&ne.type&&ne.type.isMenuItemGroup?T.Children.forEach(ne.props.children,function(j){he+=1,ue(j,he)}):ue(ne,he)})}function Ae(Z,ue,he){if(!Z||he.find)return;T.Children.forEach(Z,function(ne){if(ne){var j=ne.type;if(!j||!(j.isSubMenu||j.isMenuItem||j.isMenuItemGroup))return;ue.indexOf(ne.key)!==-1?he.find=!0:ne.props.children&&Ae(ne.props.children,ue,he)}})}var Re=["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"],Le=function(ue){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ne=ue&&typeof ue.getBoundingClientRect=="function"&&ue.getBoundingClientRect().width;if(ne){if(he){var j=getComputedStyle(ue),$=j.marginLeft,F=j.marginRight;ne+=+$.replace("px","")+ +F.replace("px","")}ne=+ne.toFixed(6)}return ne||0},Ce=function(ue,he,ne){ue&&Object(x.a)(ue.style)==="object"&&(ue.style[he]=ne)},xe=function(){return Oe.any},Be=B("bdgK"),Me=B("faye"),ge=B.n(Me),De=B("wgJM"),Ge=B("l4aY"),We=B("m+aA"),Ke=B("c+Xe"),Pe=B("zT1h"),Ve=B("QC+M");function He(Z,ue,he){return he?Z[0]===ue[0]:Z[0]===ue[0]&&Z[1]===ue[1]}function Te(Z,ue,he){var ne=Z[ue]||{};return Object(L.a)(Object(L.a)({},ne),he)}function Ue(Z,ue,he,ne){for(var j=he.points,$=Object.keys(Z),F=0;F<$.length;F+=1){var te=$[F];if(He(Z[te].points,j,ne))return"".concat(ue,"-placement-").concat(te)}return""}var J=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Z=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(Z)||/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(Z==null?void 0:Z.substr(0,4)))},re=B("MNnm");function oe(Z,ue){var he={};return he[Z.toLowerCase()]=ue.toLowerCase(),he["Webkit".concat(Z)]="webkit".concat(ue),he["Moz".concat(Z)]="moz".concat(ue),he["ms".concat(Z)]="MS".concat(ue),he["O".concat(Z)]="o".concat(ue.toLowerCase()),he}function W(Z,ue){var he={animationend:oe("Animation","AnimationEnd"),transitionend:oe("Transition","TransitionEnd")};return Z&&("AnimationEvent"in ue||delete he.animationend.animation,"TransitionEvent"in ue||delete he.transitionend.transition),he}var H=W(Object(re.a)(),typeof window!="undefined"?window:{}),Q={};if(Object(re.a)()){var le=document.createElement("div");Q=le.style}var ye={};function we(Z){if(ye[Z])return ye[Z];var ue=H[Z];if(ue)for(var he=Object.keys(ue),ne=he.length,j=0;j<ne;j+=1){var $=he[j];if(Object.prototype.hasOwnProperty.call(ue,$)&&$ in Q)return ye[Z]=ue[$],ye[Z]}return""}var Ne=we("animationend"),$e=we("transitionend"),nt=!!(Ne&&$e),Ze=Ne||"animationend",bt=$e||"transitionend";function ut(Z,ue){if(!Z)return null;if(Object(x.a)(Z)==="object"){var he=ue.replace(/-\w/g,function(ne){return ne[1].toUpperCase()});return Z[he]}return"".concat(Z,"-").concat(ue)}var Qe="none",Dt="appear",Tt="enter",jt="leave",Lt="none",lt="prepare",Bt="start",zt="active",rt="end";function at(Z){var ue=Object(T.useRef)(!1),he=Object(T.useState)(Z),ne=Object(N.a)(he,2),j=ne[0],$=ne[1];function F(te){ue.current||$(te)}return Object(T.useEffect)(function(){return function(){ue.current=!0}},[]),[j,F]}var ot=Object(re.a)()?T.useLayoutEffect:T.useEffect,yt=ot,Ht=function(){var Z=T.useRef(null);function ue(){De.a.cancel(Z.current)}function he(ne){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;ue();var $=Object(De.a)(function(){j<=1?ne({isCanceled:function(){return $!==Z.current}}):he(ne,j-1)});Z.current=$}return T.useEffect(function(){return function(){ue()}},[]),[he,ue]},qt=[lt,Bt,zt,rt],ln=!1,fn=!0;function un(Z){return Z===zt||Z===rt}var sn=function(Z,ue){var he=T.useState(Lt),ne=Object(N.a)(he,2),j=ne[0],$=ne[1],F=Ht(),te=Object(N.a)(F,2),ie=te[0],pe=te[1];function ce(){$(lt)}return yt(function(){if(j!==Lt&&j!==rt){var _e=qt.indexOf(j),Ie=qt[_e+1],je=ue(j);je===ln?$(Ie):ie(function(ke){function ze(){if(ke.isCanceled())return;$(Ie)}je===!0?ze():Promise.resolve(je).then(ze)})}},[Z,j]),T.useEffect(function(){return function(){pe()}},[]),[ce,j]},dn=function(Z){var ue=Object(T.useRef)(),he=Object(T.useRef)(Z);he.current=Z;var ne=T.useCallback(function(F){he.current(F)},[]);function j(F){F&&(F.removeEventListener(bt,ne),F.removeEventListener(Ze,ne))}function $(F){ue.current&&ue.current!==F&&j(ue.current),F&&F!==ue.current&&(F.addEventListener(bt,ne),F.addEventListener(Ze,ne),ue.current=F)}return T.useEffect(function(){return function(){j(ue.current)}},[]),[$,j]};function jn(Z,ue,he,ne){var j=ne.motionEnter,$=j===void 0?!0:j,F=ne.motionAppear,te=F===void 0?!0:F,ie=ne.motionLeave,pe=ie===void 0?!0:ie,ce=ne.motionDeadline,_e=ne.motionLeaveImmediately,Ie=ne.onAppearPrepare,je=ne.onEnterPrepare,ke=ne.onLeavePrepare,ze=ne.onAppearStart,it=ne.onEnterStart,ht=ne.onLeaveStart,st=ne.onAppearActive,mt=ne.onEnterActive,pt=ne.onLeaveActive,dt=ne.onAppearEnd,ct=ne.onEnterEnd,Ot=ne.onLeaveEnd,gt=ne.onVisibleChanged,Ut=at(),wt=Object(N.a)(Ut,2),tt=wt[0],et=wt[1],vt=at(Qe),Et=Object(N.a)(vt,2),Ye=Et[0],At=Et[1],Mt=at(null),xt=Object(N.a)(Mt,2),It=xt[0],kt=xt[1],$t=Object(T.useRef)(!1),en=Object(T.useRef)(null),Kt=Object(T.useRef)(!1),tn=Object(T.useRef)(null);function on(){var Nt=he();return Nt||tn.current}var nn=Object(T.useRef)(!1);function rn(Nt){var Rt=on();if(Nt&&!Nt.deadline&&Nt.target!==Rt)return;var Zt;Ye===Dt&&nn.current?Zt=dt==null?void 0:dt(Rt,Nt):Ye===Tt&&nn.current?Zt=ct==null?void 0:ct(Rt,Nt):Ye===jt&&nn.current&&(Zt=Ot==null?void 0:Ot(Rt,Nt)),Zt!==!1&&!Kt.current&&(At(Qe),kt(null))}var Wt=dn(rn),Jt=Object(N.a)(Wt,1),Qt=Jt[0],Xt=T.useMemo(function(){var Nt,Rt,Zt;switch(Ye){case"appear":return Nt={},Object(fe.a)(Nt,lt,Ie),Object(fe.a)(Nt,Bt,ze),Object(fe.a)(Nt,zt,st),Nt;case"enter":return Rt={},Object(fe.a)(Rt,lt,je),Object(fe.a)(Rt,Bt,it),Object(fe.a)(Rt,zt,mt),Rt;case"leave":return Zt={},Object(fe.a)(Zt,lt,ke),Object(fe.a)(Zt,Bt,ht),Object(fe.a)(Zt,zt,pt),Zt;default:return{}}},[Ye]),pn=sn(Ye,function(Nt){if(Nt===lt){var Rt=Xt[lt];return Rt?Rt(on()):ln}if(Pt in Xt){var Zt;kt(((Zt=Xt[Pt])===null||Zt===void 0?void 0:Zt.call(Xt,on(),null))||null)}return Pt===zt&&(Qt(on()),ce>0&&(clearTimeout(en.current),en.current=setTimeout(function(){rn({deadline:!0})},ce))),fn}),mn=Object(N.a)(pn,2),vn=mn[0],Pt=mn[1],cn=un(Pt);nn.current=cn,yt(function(){et(ue);var Nt=$t.current;if($t.current=!0,!Z)return;var Rt;!Nt&&ue&&te&&(Rt=Dt),Nt&&ue&&$&&(Rt=Tt),(Nt&&!ue&&pe||!Nt&&_e&&!ue&&pe)&&(Rt=jt),Rt&&(At(Rt),vn())},[ue]),Object(T.useEffect)(function(){(Ye===Dt&&!te||Ye===Tt&&!$||Ye===jt&&!pe)&&At(Qe)},[te,$,pe]),Object(T.useEffect)(function(){return function(){clearTimeout(en.current),Kt.current=!0}},[]),Object(T.useEffect)(function(){tt!==void 0&&Ye===Qe&&(gt==null||gt(tt))},[tt,Ye]);var _n=It;return Xt[lt]&&Pt===Bt&&(_n=Object(L.a)({transition:"none"},_n)),[Ye,Pt,_n,tt!=null?tt:ue]}var Bn=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(){return Object(y.a)(this,he),ue.apply(this,arguments)}return Object(v.a)(he,[{key:"render",value:function(){return this.props.children}}]),he}(T.Component),er=Bn;function xn(Z){var ue=Z;Object(x.a)(Z)==="object"&&(ue=Z.transitionSupport);function he(j){return!!(j.motionName&&ue)}var ne=T.forwardRef(function(j,$){var F=j.visible,te=F===void 0?!0:F,ie=j.removeOnLeave,pe=ie===void 0?!0:ie,ce=j.forceRender,_e=j.children,Ie=j.motionName,je=j.leavedClassName,ke=j.eventProps,ze=he(j),it=Object(T.useRef)(),ht=Object(T.useRef)();function st(){try{return Object(We.a)(it.current||ht.current)}catch(At){return null}}var mt=jn(ze,te,st,j),pt=Object(N.a)(mt,4),dt=pt[0],ct=pt[1],Ot=pt[2],gt=pt[3],Ut=T.useRef(gt);gt&&(Ut.current=!0);var wt=Object(T.useRef)($);wt.current=$;var tt=T.useCallback(function(At){it.current=At,Object(Ke.b)(wt.current,At)},[]),et,vt=Object(L.a)(Object(L.a)({},ke),{},{visible:te});if(!_e)et=null;else if(dt===Qe||!he(j))gt?et=_e(Object(L.a)({},vt),tt):!pe&&Ut.current?et=_e(Object(L.a)(Object(L.a)({},vt),{},{className:je}),tt):ce?et=_e(Object(L.a)(Object(L.a)({},vt),{},{style:{display:"none"}}),tt):et=null;else{var Et,Ye;ct===lt?Ye="prepare":un(ct)?Ye="active":ct===Bt&&(Ye="start"),et=_e(Object(L.a)(Object(L.a)({},vt),{},{className:D()(ut(Ie,dt),(Et={},Object(fe.a)(Et,ut(Ie,"".concat(dt,"-").concat(Ye)),Ye),Object(fe.a)(Et,Ie,typeof Ie=="string"),Et)),style:Ot}),tt)}return T.createElement(er,{ref:ht},et)});return ne.displayName="CSSMotion",ne}var Fn=xn(nt),yn="add",Sn="keep",Rn="remove",En="removed";function tr(Z){var ue;return Z&&Object(x.a)(Z)==="object"&&"key"in Z?ue=Z:ue={key:Z},Object(L.a)(Object(L.a)({},ue),{},{key:String(ue.key)})}function Vt(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Z.map(tr)}function nr(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],he=[],ne=0,j=ue.length,$=Vt(Z),F=Vt(ue);$.forEach(function(pe){for(var ce=!1,_e=ne;_e<j;_e+=1){var Ie=F[_e];if(Ie.key===pe.key){ne<_e&&(he=he.concat(F.slice(ne,_e).map(function(je){return Object(L.a)(Object(L.a)({},je),{},{status:yn})})),ne=_e),he.push(Object(L.a)(Object(L.a)({},Ie),{},{status:Sn})),ne+=1,ce=!0;break}}ce||he.push(Object(L.a)(Object(L.a)({},pe),{},{status:Rn}))}),ne<j&&(he=he.concat(F.slice(ne).map(function(pe){return Object(L.a)(Object(L.a)({},pe),{},{status:yn})})));var te={};he.forEach(function(pe){var ce=pe.key;te[ce]=(te[ce]||0)+1});var ie=Object.keys(te).filter(function(pe){return te[pe]>1});return ie.forEach(function(pe){he=he.filter(function(ce){var _e=ce.key,Ie=ce.status;return _e!==pe||Ie!==Rn}),he.forEach(function(ce){ce.key===pe&&(ce.status=Sn)})}),he}var rr=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ir(Z){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fn,he=function(ne){Object(c.a)($,ne);var j=Object(i.a)($);function $(){var F;return Object(y.a)(this,$),F=j.apply(this,arguments),F.state={keyEntities:[]},F.removeKey=function(te){F.setState(function(ie){var pe=ie.keyEntities;return{keyEntities:pe.map(function(ce){return ce.key!==te?ce:Object(L.a)(Object(L.a)({},ce),{},{status:En})})}})},F}return Object(v.a)($,[{key:"render",value:function(){var te=this,ie=this.state.keyEntities,pe=this.props,ce=pe.component,_e=pe.children,Ie=pe.onVisibleChanged,je=Object(S.a)(pe,["component","children","onVisibleChanged"]),ke=ce||T.Fragment,ze={};return rr.forEach(function(it){ze[it]=je[it],delete je[it]}),delete je.keys,T.createElement(ke,je,ie.map(function(it){var ht=it.status,st=Object(S.a)(it,["status"]),mt=ht===yn||ht===Sn;return T.createElement(ue,Object(p.a)({},ze,{key:st.key,visible:mt,eventProps:st,onVisibleChanged:function(dt){Ie==null||Ie(dt,{key:st.key}),dt||te.removeKey(st.key)}}),_e)}))}}],[{key:"getDerivedStateFromProps",value:function(te,ie){var pe=te.keys,ce=ie.keyEntities,_e=Vt(pe),Ie=nr(ce,_e);return{keyEntities:Ie.filter(function(je){var ke=ce.find(function(ze){var it=ze.key;return je.key===it});return!(ke&&ke.status===En&&je.status===Rn)})}}}]),$}(T.Component);return he.defaultProps={component:"div"},he}var xr=ir(nt),bn=Fn;function Kn(Z){var ue=Z.prefixCls,he=Z.motion,ne=Z.animation,j=Z.transitionName;return he||(ne?{motionName:"".concat(ue,"-").concat(ne)}:j?{motionName:j}:null)}function Wn(Z){var ue=Z.prefixCls,he=Z.visible,ne=Z.zIndex,j=Z.mask,$=Z.maskMotion,F=Z.maskAnimation,te=Z.maskTransitionName;if(!j)return null;var ie={};return($||te||F)&&(ie=Object(L.a)({motionAppear:!0},Kn({motion:$,prefixCls:ue,transitionName:te,animation:F}))),T.createElement(bn,Object(p.a)({},ie,{visible:he,removeOnLeave:!0}),function(pe){var ce=pe.className;return T.createElement("div",{style:{zIndex:ne},className:D()("".concat(ue,"-mask"),ce)})})}var ar=B("9mu1"),Hn=B("o0o1"),Gn=B.n(Hn),sr=B("HaE+"),wn=["measure","align",null,"motion"],or=function(Z,ue){var he=Object(T.useState)(null),ne=Object(N.a)(he,2),j=ne[0],$=ne[1],F=Object(T.useRef)(),te=Object(T.useRef)(!1);function ie(_e){te.current||$(_e)}function pe(){De.a.cancel(F.current)}function ce(_e){pe(),F.current=Object(De.a)(function(){ie(function(Ie){switch(j){case"align":return"motion";case"motion":return"stable";default:}return Ie}),_e==null||_e()})}return Object(T.useEffect)(function(){ie("measure")},[Z]),Object(T.useEffect)(function(){switch(j){case"measure":ue();break;default:}j&&(F.current=Object(De.a)(Object(sr.a)(Gn.a.mark(function _e(){var Ie,je;return Gn.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:Ie=wn.indexOf(j),je=wn[Ie+1],je&&Ie!==-1&&ie(je);case 3:case"end":return ze.stop()}},_e)}))))},[j]),Object(T.useEffect)(function(){return function(){te.current=!0,pe()}},[]),[j,ce]},zn=function(Z){var ue=T.useState({width:0,height:0}),he=Object(N.a)(ue,2),ne=he[0],j=he[1];function $(te){j({width:te.offsetWidth,height:te.offsetHeight})}var F=T.useMemo(function(){var te={};if(Z){var ie=ne.width,pe=ne.height;Z.indexOf("height")!==-1&&pe?te.height=pe:Z.indexOf("minHeight")!==-1&&pe&&(te.minHeight=pe),Z.indexOf("width")!==-1&&ie?te.width=ie:Z.indexOf("minWidth")!==-1&&ie&&(te.minWidth=ie)}return te},[Z,ne]);return[F,$]},Vn=T.forwardRef(function(Z,ue){var he=Z.visible,ne=Z.prefixCls,j=Z.className,$=Z.style,F=Z.children,te=Z.zIndex,ie=Z.stretch,pe=Z.destroyPopupOnHide,ce=Z.forceRender,_e=Z.align,Ie=Z.point,je=Z.getRootDomNode,ke=Z.getClassNameFromAlign,ze=Z.onAlign,it=Z.onMouseEnter,ht=Z.onMouseLeave,st=Z.onMouseDown,mt=Z.onTouchStart,pt=Object(T.useRef)(),dt=Object(T.useRef)(),ct=Object(T.useState)(),Ot=Object(N.a)(ct,2),gt=Ot[0],Ut=Ot[1],wt=zn(ie),tt=Object(N.a)(wt,2),et=tt[0],vt=tt[1];function Et(){ie&&vt(je())}var Ye=or(he,Et),At=Object(N.a)(Ye,2),Mt=At[0],xt=At[1],It=Object(T.useRef)();function kt(){return Ie||je}function $t(){var Wt;(Wt=pt.current)===null||Wt===void 0||Wt.forceAlign()}function en(Wt,Jt){var Qt=ke(Jt);gt!==Qt&&Ut(Qt),Mt==="align"&&(gt!==Qt?Promise.resolve().then(function(){$t()}):xt(function(){var Xt;(Xt=It.current)===null||Xt===void 0||Xt.call(It)}),ze==null||ze(Wt,Jt))}var Kt=Object(L.a)({},Kn(Z));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Wt){var Jt=Kt[Wt];Kt[Wt]=function(Qt,Xt){return xt(),Jt==null?void 0:Jt(Qt,Xt)}});function tn(){return new Promise(function(Wt){It.current=Wt})}T.useEffect(function(){!Kt.motionName&&Mt==="motion"&&xt()},[Kt.motionName,Mt]),T.useImperativeHandle(ue,function(){return{forceAlign:$t,getElement:function(){return dt.current}}});var on=Object(L.a)(Object(L.a)({},et),{},{zIndex:te,opacity:Mt==="motion"||Mt==="stable"||!he?void 0:0,pointerEvents:Mt==="stable"?void 0:"none"},$),nn=!0;(_e==null?void 0:_e.points)&&(Mt==="align"||Mt==="stable")&&(nn=!1);var rn=F;return T.Children.count(F)>1&&(rn=T.createElement("div",{className:"".concat(ne,"-content")},F)),T.createElement(bn,Object(p.a)({visible:he,ref:dt,leavedClassName:"".concat(ne,"-hidden")},Kt,{onAppearPrepare:tn,onEnterPrepare:tn,removeOnLeave:pe,forceRender:ce}),function(Wt,Jt){var Qt=Wt.className,Xt=Wt.style,pn=D()(ne,j,gt,Qt);return T.createElement(ar.a,{target:kt(),key:"popup",ref:pt,monitorWindowResize:!0,disabled:nn,align:_e,onAlign:en},T.createElement("div",{ref:Jt,className:pn,onMouseEnter:it,onMouseLeave:ht,onMouseDownCapture:st,onTouchStartCapture:mt,style:Object(L.a)(Object(L.a)({},Xt),on)},rn))})});Vn.displayName="PopupInner";var lr=Vn,Xn=T.forwardRef(function(Z,ue){var he=Z.prefixCls,ne=Z.visible,j=Z.zIndex,$=Z.children,F=Z.mobile;F=F===void 0?{}:F;var te=F.popupClassName,ie=F.popupStyle,pe=F.popupMotion,ce=pe===void 0?{}:pe,_e=F.popupRender,Ie=T.useRef();T.useImperativeHandle(ue,function(){return{forceAlign:function(){},getElement:function(){return Ie.current}}});var je=Object(L.a)({zIndex:j},ie),ke=$;return T.Children.count($)>1&&(ke=T.createElement("div",{className:"".concat(he,"-content")},$)),_e&&(ke=_e(ke)),T.createElement(bn,Object(p.a)({visible:ne,ref:Ie,removeOnLeave:!0},ce),function(ze,it){var ht=ze.className,st=ze.style,mt=D()(he,te,ht);return T.createElement("div",{ref:it,className:mt,style:Object(L.a)(Object(L.a)({},st),je)},ke)})});Xn.displayName="MobilePopupInner";var ur=Xn,dr=["visible","mobile"],Yn=T.forwardRef(function(Z,ue){var he=Z.visible,ne=Z.mobile,j=Object(S.a)(Z,dr),$=Object(T.useState)(he),F=Object(N.a)($,2),te=F[0],ie=F[1],pe=Object(T.useState)(!1),ce=Object(N.a)(pe,2),_e=ce[0],Ie=ce[1],je=Object(L.a)(Object(L.a)({},j),{},{visible:te});Object(T.useEffect)(function(){ie(he),he&&ne&&Ie(J())},[he,ne]);var ke=_e?T.createElement(ur,Object(p.a)({},je,{mobile:ne,ref:ue})):T.createElement(lr,Object(p.a)({},je,{ref:ue}));return T.createElement("div",null,T.createElement(Wn,je),ke)});Yn.displayName="Popup";var cr=Yn,fr=T.createContext(null),$n=fr;function qe(){}function Je(){return""}function ft(Z){return Z?Z.ownerDocument:window.document}var St=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Gt(Z){var ue=function(he){Object(c.a)(j,he);var ne=Object(i.a)(j);function j($){var F;Object(y.a)(this,j),F=ne.call(this,$),F.popupRef=T.createRef(),F.triggerRef=T.createRef(),F.attachId=void 0,F.clickOutsideHandler=void 0,F.touchOutsideHandler=void 0,F.contextMenuOutsideHandler1=void 0,F.contextMenuOutsideHandler2=void 0,F.mouseDownTimeout=void 0,F.focusTime=void 0,F.preClickTime=void 0,F.preTouchTime=void 0,F.delayTimer=void 0,F.hasPopupMouseDown=void 0,F.onMouseEnter=function(ie){var pe=F.props.mouseEnterDelay;F.fireEvents("onMouseEnter",ie),F.delaySetPopupVisible(!0,pe,pe?null:ie)},F.onMouseMove=function(ie){F.fireEvents("onMouseMove",ie),F.setPoint(ie)},F.onMouseLeave=function(ie){F.fireEvents("onMouseLeave",ie),F.delaySetPopupVisible(!1,F.props.mouseLeaveDelay)},F.onPopupMouseEnter=function(){F.clearDelayTimer()},F.onPopupMouseLeave=function(ie){var pe;if(ie.relatedTarget&&!ie.relatedTarget.setTimeout&&Object(Ge.a)((pe=F.popupRef.current)===null||pe===void 0?void 0:pe.getElement(),ie.relatedTarget))return;F.delaySetPopupVisible(!1,F.props.mouseLeaveDelay)},F.onFocus=function(ie){F.fireEvents("onFocus",ie),F.clearDelayTimer(),F.isFocusToShow()&&(F.focusTime=Date.now(),F.delaySetPopupVisible(!0,F.props.focusDelay))},F.onMouseDown=function(ie){F.fireEvents("onMouseDown",ie),F.preClickTime=Date.now()},F.onTouchStart=function(ie){F.fireEvents("onTouchStart",ie),F.preTouchTime=Date.now()},F.onBlur=function(ie){F.fireEvents("onBlur",ie),F.clearDelayTimer(),F.isBlurToHide()&&F.delaySetPopupVisible(!1,F.props.blurDelay)},F.onContextMenu=function(ie){ie.preventDefault(),F.fireEvents("onContextMenu",ie),F.setPopupVisible(!0,ie)},F.onContextMenuClose=function(){F.isContextMenuToShow()&&F.close()},F.onClick=function(ie){if(F.fireEvents("onClick",ie),F.focusTime){var pe;if(F.preClickTime&&F.preTouchTime?pe=Math.min(F.preClickTime,F.preTouchTime):F.preClickTime?pe=F.preClickTime:F.preTouchTime&&(pe=F.preTouchTime),Math.abs(pe-F.focusTime)<20)return;F.focusTime=0}F.preClickTime=0,F.preTouchTime=0,F.isClickToShow()&&(F.isClickToHide()||F.isBlurToHide())&&ie&&ie.preventDefault&&ie.preventDefault();var ce=!F.state.popupVisible;(F.isClickToHide()&&!ce||ce&&F.isClickToShow())&&F.setPopupVisible(!F.state.popupVisible,ie)},F.onPopupMouseDown=function(){if(F.hasPopupMouseDown=!0,clearTimeout(F.mouseDownTimeout),F.mouseDownTimeout=window.setTimeout(function(){F.hasPopupMouseDown=!1},0),F.context){var ie;(ie=F.context).onPopupMouseDown.apply(ie,arguments)}},F.onDocumentClick=function(ie){if(F.props.mask&&!F.props.maskClosable)return;var pe=ie.target,ce=F.getRootDomNode(),_e=F.getPopupDomNode();(!Object(Ge.a)(ce,pe)||F.isContextMenuOnly())&&!Object(Ge.a)(_e,pe)&&!F.hasPopupMouseDown&&F.close()},F.getRootDomNode=function(){var ie=F.props.getTriggerDOMNode;if(ie)return ie(F.triggerRef.current);try{var pe=Object(We.a)(F.triggerRef.current);if(pe)return pe}catch(ce){}return ge.a.findDOMNode(Object(a.a)(F))},F.getPopupClassNameFromAlign=function(ie){var pe=[],ce=F.props,_e=ce.popupPlacement,Ie=ce.builtinPlacements,je=ce.prefixCls,ke=ce.alignPoint,ze=ce.getPopupClassNameFromAlign;return _e&&Ie&&pe.push(Ue(Ie,je,ie,ke)),ze&&pe.push(ze(ie)),pe.join(" ")},F.getComponent=function(){var ie=F.props,pe=ie.prefixCls,ce=ie.destroyPopupOnHide,_e=ie.popupClassName,Ie=ie.onPopupAlign,je=ie.popupMotion,ke=ie.popupAnimation,ze=ie.popupTransitionName,it=ie.popupStyle,ht=ie.mask,st=ie.maskAnimation,mt=ie.maskTransitionName,pt=ie.maskMotion,dt=ie.zIndex,ct=ie.popup,Ot=ie.stretch,gt=ie.alignPoint,Ut=ie.mobile,wt=ie.forceRender,tt=F.state,et=tt.popupVisible,vt=tt.point,Et=F.getPopupAlign(),Ye={};return F.isMouseEnterToShow()&&(Ye.onMouseEnter=F.onPopupMouseEnter),F.isMouseLeaveToHide()&&(Ye.onMouseLeave=F.onPopupMouseLeave),Ye.onMouseDown=F.onPopupMouseDown,Ye.onTouchStart=F.onPopupMouseDown,T.createElement(cr,Object(p.a)({prefixCls:pe,destroyPopupOnHide:ce,visible:et,point:gt&&vt,className:_e,align:Et,onAlign:Ie,animation:ke,getClassNameFromAlign:F.getPopupClassNameFromAlign},Ye,{stretch:Ot,getRootDomNode:F.getRootDomNode,style:it,mask:ht,zIndex:dt,transitionName:ze,maskAnimation:st,maskTransitionName:mt,maskMotion:pt,ref:F.popupRef,motion:je,mobile:Ut,forceRender:wt}),typeof ct=="function"?ct():ct)},F.attachParent=function(ie){De.a.cancel(F.attachId);var pe=F.props,ce=pe.getPopupContainer,_e=pe.getDocument,Ie=F.getRootDomNode(),je;ce?(Ie||ce.length===0)&&(je=ce(Ie)):je=_e(F.getRootDomNode()).body,je?je.appendChild(ie):F.attachId=Object(De.a)(function(){F.attachParent(ie)})},F.getContainer=function(){var ie=F.props.getDocument,pe=ie(F.getRootDomNode()).createElement("div");return pe.style.position="absolute",pe.style.top="0",pe.style.left="0",pe.style.width="100%",F.attachParent(pe),pe},F.setPoint=function(ie){var pe=F.props.alignPoint;if(!pe||!ie)return;F.setState({point:{pageX:ie.pageX,pageY:ie.pageY}})},F.handlePortalUpdate=function(){F.state.prevPopupVisible!==F.state.popupVisible&&F.props.afterPopupVisibleChange(F.state.popupVisible)},F.triggerContextValue={onPopupMouseDown:F.onPopupMouseDown};var te;return"popupVisible"in $?te=!!$.popupVisible:te=!!$.defaultPopupVisible,F.state={prevPopupVisible:te,popupVisible:te},St.forEach(function(ie){F["fire".concat(ie)]=function(pe){F.fireEvents(ie,pe)}}),F}return Object(v.a)(j,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var F=this.props,te=this.state;if(te.popupVisible){var ie;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ie=F.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Pe.a)(ie,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ie=ie||F.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Pe.a)(ie,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ie=ie||F.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Pe.a)(ie,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Pe.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),De.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var F;return((F=this.popupRef.current)===null||F===void 0?void 0:F.getElement())||null}},{key:"getPopupAlign",value:function(){var F=this.props,te=F.popupPlacement,ie=F.popupAlign,pe=F.builtinPlacements;return te&&pe?Te(pe,te,ie):ie}},{key:"setPopupVisible",value:function(F,te){var ie=this.props.alignPoint,pe=this.state.popupVisible;this.clearDelayTimer(),pe!==F&&("popupVisible"in this.props||this.setState({popupVisible:F,prevPopupVisible:pe}),this.props.onPopupVisibleChange(F)),ie&&te&&F&&this.setPoint(te)}},{key:"delaySetPopupVisible",value:function(F,te,ie){var pe=this,ce=te*1e3;if(this.clearDelayTimer(),ce){var _e=ie?{pageX:ie.pageX,pageY:ie.pageY}:null;this.delayTimer=window.setTimeout(function(){pe.setPopupVisible(F,_e),pe.clearDelayTimer()},ce)}else this.setPopupVisible(F,ie)}},{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(F){var te=this.props.children.props,ie=this.props;return te[F]&&ie[F]?this["fire".concat(F)]:te[F]||ie[F]}},{key:"isClickToShow",value:function(){var F=this.props,te=F.action,ie=F.showAction;return te.indexOf("click")!==-1||ie.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var F=this.props.action;return F==="contextMenu"||F.length===1&&F[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var F=this.props,te=F.action,ie=F.showAction;return te.indexOf("contextMenu")!==-1||ie.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var F=this.props,te=F.action,ie=F.hideAction;return te.indexOf("click")!==-1||ie.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var F=this.props,te=F.action,ie=F.showAction;return te.indexOf("hover")!==-1||ie.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var F=this.props,te=F.action,ie=F.hideAction;return te.indexOf("hover")!==-1||ie.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var F=this.props,te=F.action,ie=F.showAction;return te.indexOf("focus")!==-1||ie.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var F=this.props,te=F.action,ie=F.hideAction;return te.indexOf("focus")!==-1||ie.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var F;(F=this.popupRef.current)===null||F===void 0||F.forceAlign()}}},{key:"fireEvents",value:function(F,te){var ie=this.props.children.props[F];ie&&ie(te);var pe=this.props[F];pe&&pe(te)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var F=this.state.popupVisible,te=this.props,ie=te.children,pe=te.forceRender,ce=te.alignPoint,_e=te.className,Ie=te.autoDestroy,je=T.Children.only(ie),ke={key:"trigger"};this.isContextMenuToShow()?ke.onContextMenu=this.onContextMenu:ke.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ke.onClick=this.onClick,ke.onMouseDown=this.onMouseDown,ke.onTouchStart=this.onTouchStart):(ke.onClick=this.createTwoChains("onClick"),ke.onMouseDown=this.createTwoChains("onMouseDown"),ke.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ke.onMouseEnter=this.onMouseEnter,ce&&(ke.onMouseMove=this.onMouseMove)):ke.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ke.onMouseLeave=this.onMouseLeave:ke.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ke.onFocus=this.onFocus,ke.onBlur=this.onBlur):(ke.onFocus=this.createTwoChains("onFocus"),ke.onBlur=this.createTwoChains("onBlur"));var ze=D()(je&&je.props&&je.props.className,_e);ze&&(ke.className=ze);var it=Object(L.a)({},ke);Object(Ke.c)(je)&&(it.ref=Object(Ke.a)(this.triggerRef,je.ref));var ht=T.cloneElement(je,it),st;return(F||this.popupRef.current||pe)&&(st=T.createElement(Z,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!F&&Ie&&(st=null),T.createElement($n.Provider,{value:this.triggerContextValue},ht,st)}}],[{key:"getDerivedStateFromProps",value:function(F,te){var ie=F.popupVisible,pe={};return ie!==void 0&&te.popupVisible!==ie&&(pe.popupVisible=ie,pe.prevPopupVisible=te.popupVisible),pe}}]),j}(T.Component);return ue.contextType=$n,ue.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Je,getDocument:ft,onPopupVisibleChange:qe,afterPopupVisibleChange:qe,onPopupAlign:qe,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},ue}var Ft=Gt(Ve.a),hn={adjustX:1,adjustY:1},Sr={topLeft:{points:["bl","tl"],overflow:hn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:hn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:hn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:hn,offset:[4,0]}},mi={topLeft:{points:["bl","tl"],overflow:hn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:hn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:hn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:hn,offset:[4,0]}},fa=Sr,Rr=0,gi={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Cn=function(ue,he,ne){var j=ve(he),$=ue.getState();ue.setState({defaultActiveFirst:Object(L.a)(Object(L.a)({},$.defaultActiveFirst),{},Object(fe.a)({},j,ne))})},wr=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(ne){var j;Object(y.a)(this,he),j=ue.call(this,ne),j.onDestroy=function(ce){j.props.onDestroy(ce)},j.onKeyDown=function(ce){var _e=ce.keyCode,Ie=j.menuInstance,je=j.props.store,ke=j.getVisible();if(_e===u.a.ENTER)return j.onTitleClick(ce),Cn(je,j.props.eventKey,!0),!0;if(_e===u.a.RIGHT)return ke?Ie.onKeyDown(ce):(j.triggerOpenChange(!0),Cn(je,j.props.eventKey,!0)),!0;if(_e===u.a.LEFT){var ze;if(ke)ze=Ie.onKeyDown(ce);else return;return ze||(j.triggerOpenChange(!1),ze=!0),ze}return ke&&(_e===u.a.UP||_e===u.a.DOWN)?Ie.onKeyDown(ce):void 0},j.onOpenChange=function(ce){j.props.onOpenChange(ce)},j.onPopupVisibleChange=function(ce){j.triggerOpenChange(ce,ce?"mouseenter":"mouseleave")},j.onMouseEnter=function(ce){var _e=j.props,Ie=_e.eventKey,je=_e.onMouseEnter,ke=_e.store;Cn(ke,j.props.eventKey,!1),je({key:Ie,domEvent:ce})},j.onMouseLeave=function(ce){var _e=j.props,Ie=_e.parentMenu,je=_e.eventKey,ke=_e.onMouseLeave;Ie.subMenuInstance=Object(a.a)(j),ke({key:je,domEvent:ce})},j.onTitleMouseEnter=function(ce){var _e=j.props,Ie=_e.eventKey,je=_e.onItemHover,ke=_e.onTitleMouseEnter;je({key:Ie,hover:!0}),ke({key:Ie,domEvent:ce})},j.onTitleMouseLeave=function(ce){var _e=j.props,Ie=_e.parentMenu,je=_e.eventKey,ke=_e.onItemHover,ze=_e.onTitleMouseLeave;Ie.subMenuInstance=Object(a.a)(j),ke({key:je,hover:!1}),ze({key:je,domEvent:ce})},j.onTitleClick=function(ce){var _e=Object(a.a)(j),Ie=_e.props;if(Ie.onTitleClick({key:Ie.eventKey,domEvent:ce}),Ie.triggerSubMenuAction==="hover")return;j.triggerOpenChange(!j.getVisible(),"click"),Cn(Ie.store,j.props.eventKey,!1)},j.onSubMenuClick=function(ce){typeof j.props.onClick=="function"&&j.props.onClick(j.addKeyPath(ce))},j.onSelect=function(ce){j.props.onSelect(ce)},j.onDeselect=function(ce){j.props.onDeselect(ce)},j.getPrefixCls=function(){return"".concat(j.props.rootPrefixCls,"-submenu")},j.getActiveClassName=function(){return"".concat(j.getPrefixCls(),"-active")},j.getDisabledClassName=function(){return"".concat(j.getPrefixCls(),"-disabled")},j.getSelectedClassName=function(){return"".concat(j.getPrefixCls(),"-selected")},j.getOpenClassName=function(){return"".concat(j.props.rootPrefixCls,"-submenu-open")},j.getVisible=function(){return j.state.isOpen},j.getMode=function(){return j.state.mode},j.saveMenuInstance=function(ce){j.menuInstance=ce},j.addKeyPath=function(ce){return Object(L.a)(Object(L.a)({},ce),{},{keyPath:(ce.keyPath||[]).concat(j.props.eventKey)})},j.triggerOpenChange=function(ce,_e){var Ie=j.props.eventKey,je=function(){j.onOpenChange({key:Ie,item:Object(a.a)(j),trigger:_e,open:ce})};_e==="mouseenter"?j.mouseenterTimeout=setTimeout(function(){je()},0):je()},j.isChildrenSelected=function(){var ce={find:!1};return Ae(j.props.children,j.props.selectedKeys,ce),ce.find},j.isInlineMode=function(){return j.getMode()==="inline"},j.adjustWidth=function(){if(!j.subMenuTitle||!j.menuInstance)return;var ce=Me.findDOMNode(j.menuInstance);if(ce.offsetWidth>=j.subMenuTitle.offsetWidth)return;ce.style.minWidth="".concat(j.subMenuTitle.offsetWidth,"px")},j.saveSubMenuTitle=function(ce){j.subMenuTitle=ce},j.getBaseProps=function(){var ce=Object(a.a)(j),_e=ce.props,Ie=j.getMode();return{mode:Ie==="horizontal"?"vertical":Ie,visible:j.getVisible(),level:_e.level+1,inlineIndent:_e.inlineIndent,focusable:!1,onClick:j.onSubMenuClick,onSelect:j.onSelect,onDeselect:j.onDeselect,onDestroy:j.onDestroy,selectedKeys:_e.selectedKeys,eventKey:"".concat(_e.eventKey,"-menu-"),openKeys:_e.openKeys,motion:_e.motion,onOpenChange:j.onOpenChange,subMenuOpenDelay:_e.subMenuOpenDelay,parentMenu:Object(a.a)(j),subMenuCloseDelay:_e.subMenuCloseDelay,forceSubMenuRender:_e.forceSubMenuRender,triggerSubMenuAction:_e.triggerSubMenuAction,builtinPlacements:_e.builtinPlacements,defaultActiveFirst:_e.store.getState().defaultActiveFirst[ve(_e.eventKey)],multiple:_e.multiple,prefixCls:_e.rootPrefixCls,id:j.internalMenuId,manualRef:j.saveMenuInstance,itemIcon:_e.itemIcon,expandIcon:_e.expandIcon,direction:_e.direction}},j.getMotion=function(ce,_e){var Ie=Object(a.a)(j),je=Ie.haveRendered,ke=j.props,ze=ke.motion,it=ke.rootPrefixCls,ht=Object(L.a)(Object(L.a)({},ze),{},{leavedClassName:"".concat(it,"-hidden"),removeOnLeave:!1,motionAppear:je||!_e||ce!=="inline"});return ht};var $=ne.store,F=ne.eventKey,te=$.getState(),ie=te.defaultActiveFirst;j.isRootMenu=!1;var pe=!1;return ie&&(pe=ie[F]),Cn($,F,pe),j.state={mode:ne.mode,isOpen:ne.isOpen},j}return Object(v.a)(he,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var j=this,$=this.props,F=$.mode,te=$.parentMenu,ie=$.manualRef,pe=$.isOpen,ce=function(){j.setState({mode:F,isOpen:pe})},_e=pe!==this.state.isOpen,Ie=F!==this.state.mode;if((Ie||_e)&&(De.a.cancel(this.updateStateRaf),Ie?this.updateStateRaf=Object(De.a)(ce):ce()),ie&&ie(this),F!=="horizontal"||!(te==null?void 0:te.isRootMenu)||!pe)return;this.minWidthTimeout=setTimeout(function(){return j.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var j=this.props,$=j.onDestroy,F=j.eventKey;$&&$(F),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),De.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(j,$){var F=this.getBaseProps();return T.createElement(Pr,Object(p.a)({},F,{id:this.internalMenuId,className:j,style:$}),this.props.children)}},{key:"renderChildren",value:function(){var j=this,$=this.getBaseProps(),F=$.mode,te=$.visible,ie=$.forceSubMenuRender,pe=$.direction,ce=this.getMotion(F,te);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||te||ie,!this.haveOpened)return T.createElement("div",null);var _e=D()("".concat($.prefixCls,"-sub"),Object(fe.a)({},"".concat($.prefixCls,"-rtl"),pe==="rtl"));return this.isInlineMode()?T.createElement(bn,Object(p.a)({visible:$.visible,forceRender:ie},ce),function(Ie){var je=Ie.className,ke=Ie.style,ze=D()(_e,je);return j.renderPopupMenu(ze,ke)}):this.renderPopupMenu(_e)}},{key:"render",value:function(){var j,$,F,te=Object(L.a)({},this.props),ie=this.getVisible(),pe=this.getPrefixCls(),ce=this.isInlineMode(),_e=this.getMode(),Ie=D()(pe,"".concat(pe,"-").concat(_e),(j={},Object(fe.a)(j,te.className,!!te.className),Object(fe.a)(j,this.getOpenClassName(),ie),Object(fe.a)(j,this.getActiveClassName(),te.active||ie&&!ce),Object(fe.a)(j,this.getDisabledClassName(),te.disabled),Object(fe.a)(j,this.getSelectedClassName(),this.isChildrenSelected()),j));this.internalMenuId||(te.eventKey?this.internalMenuId="".concat(te.eventKey,"$Menu"):(Rr+=1,this.internalMenuId="$__$".concat(Rr,"$Menu")));var je={},ke={},ze={};te.disabled||(je={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ke={onClick:this.onTitleClick},ze={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var it={},ht=te.direction,st=ht==="rtl";ce&&(st?it.paddingRight=te.inlineIndent*te.level:it.paddingLeft=te.inlineIndent*te.level);var mt={};this.getVisible()&&(mt={"aria-owns":this.internalMenuId});var pt=null;_e!=="horizontal"&&(pt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(pt=T.createElement(this.props.expandIcon,Object(L.a)({},this.props))));var dt=T.createElement("div",Object(p.a)({ref:this.saveSubMenuTitle,style:it,className:"".concat(pe,"-title"),role:"button"},ze,ke,{"aria-expanded":ie},mt,{"aria-haspopup":"true",title:typeof te.title=="string"?te.title:void 0}),te.title,pt||T.createElement("i",{className:"".concat(pe,"-arrow")})),ct=this.renderChildren(),Ot=(($=te.parentMenu)===null||$===void 0?void 0:$.isRootMenu)?te.parentMenu.props.getPopupContainer:function(kt){return kt.parentNode},gt=gi[_e],Ut=te.popupOffset?{offset:te.popupOffset}:{},wt=D()((F={},Object(fe.a)(F,te.popupClassName,te.popupClassName&&!ce),Object(fe.a)(F,"".concat(pe,"-rtl"),st),F)),tt=te.disabled,et=te.triggerSubMenuAction,vt=te.subMenuOpenDelay,Et=te.forceSubMenuRender,Ye=te.subMenuCloseDelay,At=te.builtinPlacements;Re.forEach(function(kt){return delete te[kt]}),delete te.onClick;var Mt=st?Object(L.a)(Object(L.a)({},mi),At):Object(L.a)(Object(L.a)({},Sr),At);delete te.direction;var xt=this.getBaseProps(),It=ce?null:this.getMotion(xt.mode,xt.visible);return T.createElement("li",Object(p.a)({},te,je,{className:Ie,role:"menuitem"}),T.createElement(Ft,{prefixCls:pe,popupClassName:D()("".concat(pe,"-popup"),wt),getPopupContainer:Ot,builtinPlacements:Mt,popupPlacement:gt,popupVisible:ce?!1:ie,popupAlign:Ut,popup:ce?null:ct,action:tt||ce?[]:[et],mouseEnterDelay:vt,mouseLeaveDelay:Ye,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Et,popupMotion:It},dt),ce?ct:null)}}]),he}(T.Component);wr.defaultProps={onMouseEnter:me,onMouseLeave:me,onTitleMouseEnter:me,onTitleMouseLeave:me,onTitleClick:me,manualRef:me,mode:"vertical",title:""};var Cr=Object(l.b)(function(Z,ue){var he=Z.openKeys,ne=Z.activeKey,j=Z.selectedKeys,$=ue.eventKey,F=ue.subMenuKey;return{isOpen:he.indexOf($)>-1,active:ne[F]===$,selectedKeys:j}})(wr);Cr.isSubMenu=!0;var vi=Cr,Ir="menuitem-overflowed",_i=.5,Dr=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(){var ne;return Object(y.a)(this,he),ne=ue.apply(this,arguments),ne.resizeObserver=null,ne.mutationObserver=null,ne.originalTotalWidth=0,ne.overflowedItems=[],ne.menuItemSizes=[],ne.cancelFrameId=null,ne.state={lastVisibleIndex:void 0},ne.childRef=T.createRef(),ne.getMenuItemNodes=function(){var j=ne.props.prefixCls,$=ne.childRef.current;return $?[].slice.call($.children).filter(function(F){return F.className.split(" ").indexOf("".concat(j,"-overflowed-submenu"))<0}):[]},ne.getOverflowedSubMenuItem=function(j,$,F){var te=ne.props,ie=te.overflowedIndicator,pe=te.level,ce=te.mode,_e=te.prefixCls,Ie=te.theme;if(pe!==1||ce!=="horizontal")return null;var je=ne.props.children[0],ke=je.props,ze=ke.children,it=ke.title,ht=ke.style,st=Object(S.a)(ke,["children","title","style"]),mt=Object(L.a)({},ht),pt="".concat(j,"-overflowed-indicator"),dt="".concat(j,"-overflowed-indicator");$.length===0&&F!==!0?mt=Object(L.a)(Object(L.a)({},mt),{},{display:"none"}):F&&(mt=Object(L.a)(Object(L.a)({},mt),{},{visibility:"hidden",position:"absolute"}),pt="".concat(pt,"-placeholder"),dt="".concat(dt,"-placeholder"));var ct=Ie?"".concat(_e,"-").concat(Ie):"",Ot={};return Re.forEach(function(gt){st[gt]!==void 0&&(Ot[gt]=st[gt])}),T.createElement(vi,Object(p.a)({title:ie,className:"".concat(_e,"-overflowed-submenu"),popupClassName:ct},Ot,{key:pt,eventKey:dt,disabled:!1,style:mt}),$)},ne.setChildrenWidthAndResize=function(){if(ne.props.mode!=="horizontal")return;var j=ne.childRef.current;if(!j)return;var $=j.children;if(!$||$.length===0)return;var F=j.children[$.length-1];Ce(F,"display","inline-block");var te=ne.getMenuItemNodes(),ie=te.filter(function(pe){return pe.className.split(" ").indexOf(Ir)>=0});ie.forEach(function(pe){Ce(pe,"display","inline-block")}),ne.menuItemSizes=te.map(function(pe){return Le(pe,!0)}),ie.forEach(function(pe){Ce(pe,"display","none")}),ne.overflowedIndicatorWidth=Le(j.children[j.children.length-1],!0),ne.originalTotalWidth=ne.menuItemSizes.reduce(function(pe,ce){return pe+ce},0),ne.handleResize(),Ce(F,"display","none")},ne.handleResize=function(){if(ne.props.mode!=="horizontal")return;var j=ne.childRef.current;if(!j)return;var $=Le(j);ne.overflowedItems=[];var F=0,te;ne.originalTotalWidth>$+_i&&(te=-1,ne.menuItemSizes.forEach(function(ie){F+=ie,F+ne.overflowedIndicatorWidth<=$&&(te+=1)})),ne.setState({lastVisibleIndex:te})},ne}return Object(v.a)(he,[{key:"componentDidMount",value:function(){var j=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var $=this.childRef.current;if(!$)return;this.resizeObserver=new Be.default(function(F){F.forEach(function(){var te=j.cancelFrameId;cancelAnimationFrame(te),j.cancelFrameId=requestAnimationFrame(j.setChildrenWidthAndResize)})}),[].slice.call($.children).concat($).forEach(function(F){j.resizeObserver.observe(F)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){j.resizeObserver.disconnect(),[].slice.call($.children).concat($).forEach(function(F){j.resizeObserver.observe(F)}),j.setChildrenWidthAndResize()}),this.mutationObserver.observe($,{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(j){var $=this,F=this.state.lastVisibleIndex;return(j||[]).reduce(function(te,ie,pe){var ce=ie;if($.props.mode==="horizontal"){var _e=$.getOverflowedSubMenuItem(ie.props.eventKey,[]);F!==void 0&&$.props.className.indexOf("".concat($.props.prefixCls,"-root"))!==-1&&(pe>F&&(ce=T.cloneElement(ie,{style:{display:"none"},eventKey:"".concat(ie.props.eventKey,"-hidden"),className:"".concat(Ir)})),pe===F+1&&($.overflowedItems=j.slice(F+1).map(function(je){return T.cloneElement(je,{key:je.props.eventKey,mode:"vertical-left"})}),_e=$.getOverflowedSubMenuItem(ie.props.eventKey,$.overflowedItems)));var Ie=[].concat(Object(O.a)(te),[_e,ce]);return pe===j.length-1&&Ie.push($.getOverflowedSubMenuItem(ie.props.eventKey,[],!0)),Ie}return[].concat(Object(O.a)(te),[ce])},[])}},{key:"render",value:function(){var j=this.props,$=j.visible,F=j.prefixCls,te=j.overflowedIndicator,ie=j.mode,pe=j.level,ce=j.tag,_e=j.children,Ie=j.theme,je=Object(S.a)(j,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ke=ce;return T.createElement(ke,Object(p.a)({ref:this.childRef},je),this.renderChildren(_e))}}]),he}(T.Component);Dr.defaultProps={tag:"div",className:""};var yi=Dr;function Ei(Z){return Z.length?Z.every(function(ue){return!!ue.props.disabled}):!0}function Qn(Z,ue,he){var ne=Z.getState();Z.setState({activeKey:Object(L.a)(Object(L.a)({},ne.activeKey),{},Object(fe.a)({},ue,he))})}function Tn(Z){return Z.eventKey||"0-menu-"}function Zn(Z,ue){var he=ue,ne=Z.children,j=Z.eventKey;if(he){var $;if(be(ne,function(F,te){F&&F.props&&!F.props.disabled&&he===Se(F,j,te)&&($=!0)}),$)return he}return he=null,Z.defaultActiveFirst&&be(ne,function(F,te){!he&&F&&!F.props.disabled&&(he=Se(F,j,te))}),he}function bi(Z){if(!Z)return;var ue=this.instanceArray.indexOf(Z);ue!==-1?this.instanceArray[ue]=Z:this.instanceArray.push(Z)}var Lr=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(ne){var j;return Object(y.a)(this,he),j=ue.call(this,ne),j.onKeyDown=function($,F){var te=$.keyCode,ie;if(j.getFlatInstanceArray().forEach(function(ce){ce&&ce.props.active&&ce.onKeyDown&&(ie=ce.onKeyDown($))}),ie)return 1;var pe=null;return(te===u.a.UP||te===u.a.DOWN)&&(pe=j.step(te===u.a.UP?-1:1)),pe?($.preventDefault(),Qn(j.props.store,Tn(j.props),pe.props.eventKey),typeof F=="function"&&F(pe),1):void 0},j.onItemHover=function($){var F=$.key,te=$.hover;Qn(j.props.store,Tn(j.props),te?F:null)},j.onDeselect=function($){j.props.onDeselect($)},j.onSelect=function($){j.props.onSelect($)},j.onClick=function($){j.props.onClick($)},j.onOpenChange=function($){j.props.onOpenChange($)},j.onDestroy=function($){j.props.onDestroy($)},j.getFlatInstanceArray=function(){return j.instanceArray},j.step=function($){var F=j.getFlatInstanceArray(),te=j.props.store.getState().activeKey[Tn(j.props)],ie=F.length;if(!ie)return null;$<0&&(F=F.concat().reverse());var pe=-1;if(F.every(function(je,ke){return je&&je.props.eventKey===te?(pe=ke,!1):!0}),!j.props.defaultActiveFirst&&pe!==-1&&Ei(F.slice(pe,ie-1)))return;var ce=(pe+1)%ie,_e=ce;do{var Ie=F[_e];if(!Ie||Ie.props.disabled)_e=(_e+1)%ie;else return Ie}while(_e!==ce);return null},j.renderCommonMenuItem=function($,F,te){var ie=j.props.store.getState(),pe=Object(a.a)(j),ce=pe.props,_e=Se($,ce.eventKey,F),Ie=$.props;if(!Ie||typeof $.type=="string")return $;var je=_e===ie.activeKey,ke=Object(L.a)(Object(L.a)({mode:Ie.mode||ce.mode,level:ce.level,inlineIndent:ce.inlineIndent,renderMenuItem:j.renderMenuItem,rootPrefixCls:ce.prefixCls,index:F,parentMenu:ce.parentMenu,manualRef:Ie.disabled?void 0:Object(h.a)($.ref,bi.bind(Object(a.a)(j))),eventKey:_e,active:!Ie.disabled&&je,multiple:ce.multiple,onClick:function(it){(Ie.onClick||me)(it),j.onClick(it)},onItemHover:j.onItemHover,motion:ce.motion,subMenuOpenDelay:ce.subMenuOpenDelay,subMenuCloseDelay:ce.subMenuCloseDelay,forceSubMenuRender:ce.forceSubMenuRender,onOpenChange:j.onOpenChange,onDeselect:j.onDeselect,onSelect:j.onSelect,builtinPlacements:ce.builtinPlacements,itemIcon:Ie.itemIcon||j.props.itemIcon,expandIcon:Ie.expandIcon||j.props.expandIcon},te),{},{direction:ce.direction});return(ce.mode==="inline"||xe())&&(ke.triggerSubMenuAction="click"),T.cloneElement($,Object(L.a)(Object(L.a)({},ke),{},{key:_e||F}))},j.renderMenuItem=function($,F,te){if(!$)return null;var ie=j.props.store.getState(),pe={openKeys:ie.openKeys,selectedKeys:ie.selectedKeys,triggerSubMenuAction:j.props.triggerSubMenuAction,subMenuKey:te};return j.renderCommonMenuItem($,F,pe)},ne.store.setState({activeKey:Object(L.a)(Object(L.a)({},ne.store.getState().activeKey),{},Object(fe.a)({},ne.eventKey,Zn(ne,ne.activeKey)))}),j.instanceArray=[],j}return Object(v.a)(he,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(j){return this.props.visible||j.visible||this.props.className!==j.className||!R()(this.props.style,j.style)}},{key:"componentDidUpdate",value:function(j){var $=this.props,F="activeKey"in $?$.activeKey:$.store.getState().activeKey[Tn($)],te=Zn($,F);if(te!==F)Qn($.store,Tn($),te);else if("activeKey"in j){var ie=Zn(j,j.activeKey);te!==ie&&Qn($.store,Tn($),te)}}},{key:"render",value:function(){var j=this,$=Object(p.a)({},this.props);this.instanceArray=[];var F=D()($.prefixCls,$.className,"".concat($.prefixCls,"-").concat($.mode)),te={className:F,role:$.role||"menu"};$.id&&(te.id=$.id),$.focusable&&(te.tabIndex=0,te.onKeyDown=this.onKeyDown);var ie=$.prefixCls,pe=$.eventKey,ce=$.visible,_e=$.level,Ie=$.mode,je=$.overflowedIndicator,ke=$.theme;return Re.forEach(function(ze){return delete $[ze]}),delete $.onClick,T.createElement(yi,Object(p.a)({},$,{prefixCls:ie,mode:Ie,tag:"ul",level:_e,theme:ke,visible:ce,overflowedIndicator:je},te),Object(I.a)($.children).map(function(ze,it){return j.renderMenuItem(ze,it,pe||"0-menu-")}))}}]),he}(T.Component);Lr.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:me};var Ti=Object(l.b)()(Lr),Pr=Ti,Oi=B("Kwbf");function Ai(Z,ue,he){var ne=Z.prefixCls,j=Z.motion,$=Z.defaultMotions,F=$===void 0?{}:$,te=Z.openAnimation,ie=Z.openTransitionName,pe=ue.switchingModeFromInline;if(j)return j;if(Object(x.a)(te)==="object"&&te)Object(Oi.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof te=="string")return{motionName:"".concat(ne,"-open-").concat(te)};if(ie)return{motionName:ie};var ce=F[he];return ce||(pe?null:F.other)}var Mr=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(ne){var j;Object(y.a)(this,he),j=ue.call(this,ne),j.onSelect=function(te){var ie=Object(a.a)(j),pe=ie.props;if(pe.selectable){var ce=j.store.getState(),_e=ce.selectedKeys,Ie=te.key;pe.multiple?_e=_e.concat([Ie]):_e=[Ie],"selectedKeys"in pe||j.store.setState({selectedKeys:_e}),pe.onSelect(Object(L.a)(Object(L.a)({},te),{},{selectedKeys:_e}))}},j.onClick=function(te){var ie=j.getRealMenuMode(),pe=Object(a.a)(j),ce=pe.store,_e=pe.props.onOpenChange;ie!=="inline"&&!("openKeys"in j.props)&&(ce.setState({openKeys:[]}),_e([])),j.props.onClick(te)},j.onKeyDown=function(te,ie){j.innerMenu.getWrappedInstance().onKeyDown(te,ie)},j.onOpenChange=function(te){var ie=Object(a.a)(j),pe=ie.props,ce=j.store.getState().openKeys.concat(),_e=!1,Ie=function(ke){var ze=!1;if(ke.open)ze=ce.indexOf(ke.key)===-1,ze&&ce.push(ke.key);else{var it=ce.indexOf(ke.key);ze=it!==-1,ze&&ce.splice(it,1)}_e=_e||ze};Array.isArray(te)?te.forEach(Ie):Ie(te),_e&&("openKeys"in j.props||j.store.setState({openKeys:ce}),pe.onOpenChange(ce))},j.onDeselect=function(te){var ie=Object(a.a)(j),pe=ie.props;if(pe.selectable){var ce=j.store.getState().selectedKeys.concat(),_e=te.key,Ie=ce.indexOf(_e);Ie!==-1&&ce.splice(Ie,1),"selectedKeys"in pe||j.store.setState({selectedKeys:ce}),pe.onDeselect(Object(L.a)(Object(L.a)({},te),{},{selectedKeys:ce}))}},j.onMouseEnter=function(te){j.restoreModeVerticalFromInline();var ie=j.props.onMouseEnter;ie&&ie(te)},j.onTransitionEnd=function(te){var ie=te.propertyName==="width"&&te.target===te.currentTarget,pe=te.target.className,ce=Object.prototype.toString.call(pe)==="[object SVGAnimatedString]"?pe.animVal:pe,_e=te.propertyName==="font-size"&&ce.indexOf("anticon")>=0;(ie||_e)&&j.restoreModeVerticalFromInline()},j.setInnerMenu=function(te){j.innerMenu=te},j.isRootMenu=!0;var $=ne.defaultSelectedKeys,F=ne.defaultOpenKeys;return"selectedKeys"in ne&&($=ne.selectedKeys||[]),"openKeys"in ne&&(F=ne.openKeys||[]),j.store=Object(l.c)({selectedKeys:$,openKeys:F,activeKey:{"0-menu-":Zn(ne,ne.activeKey)}}),j.state={switchingModeFromInline:!1,prevProps:ne,inlineOpenKeys:[],store:j.store},j}return Object(v.a)(he,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(j){var $=this.props,F=$.siderCollapsed,te=$.inlineCollapsed,ie=$.onOpenChange;(!j.inlineCollapsed&&te||!j.siderCollapsed&&F)&&ie([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var j=this.props.collapsedWidth,$=this.store,F=this.prevOpenKeys,te=this.getInlineCollapsed()&&(j===0||j==="0"||j==="0px");te?(this.prevOpenKeys=$.getState().openKeys.concat(),this.store.setState({openKeys:[]})):F&&(this.store.setState({openKeys:F}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var j=this.props.mode,$=this.state.switchingModeFromInline,F=this.getInlineCollapsed();return $&&F?"inline":F?"vertical":j}},{key:"getInlineCollapsed",value:function(){var j=this.props,$=j.inlineCollapsed,F=j.siderCollapsed;return F!==void 0?F:$}},{key:"restoreModeVerticalFromInline",value:function(){var j=this.state.switchingModeFromInline;j&&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 j=Object(L.a)({},Object(g.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),$=this.getRealMenuMode();return j.className+=" ".concat(j.prefixCls,"-root"),j.direction==="rtl"&&(j.className+=" ".concat(j.prefixCls,"-rtl")),j=Object(L.a)(Object(L.a)({},j),{},{mode:$,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ai(this.props,this.state,$)}),delete j.openAnimation,delete j.openTransitionName,T.createElement(l.a,{store:this.store},T.createElement(Pr,Object(p.a)({},j,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(j,$){var F=$.prevProps,te=$.store,ie=te.getState(),pe={},ce={prevProps:j};return F.mode==="inline"&&j.mode!=="inline"&&(ce.switchingModeFromInline=!0),"openKeys"in j?pe.openKeys=j.openKeys||[]:((j.inlineCollapsed&&!F.inlineCollapsed||j.siderCollapsed&&!F.siderCollapsed)&&(ce.switchingModeFromInline=!0,ce.inlineOpenKeys=ie.openKeys,pe.openKeys=[]),(!j.inlineCollapsed&&F.inlineCollapsed||!j.siderCollapsed&&F.siderCollapsed)&&(pe.openKeys=$.inlineOpenKeys,ce.inlineOpenKeys=[])),Object.keys(pe).length&&te.setState(pe),ce}}]),he}(T.Component);Mr.defaultProps={selectable:!0,onClick:me,onSelect:me,onOpenChange:me,onDeselect:me,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var xi=Mr,hr=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(){var ne;return Object(y.a)(this,he),ne=ue.apply(this,arguments),ne.onKeyDown=function(j){var $=j.keyCode;return $===u.a.ENTER?(ne.onClick(j),!0):void 0},ne.onMouseLeave=function(j){var $=ne.props,F=$.eventKey,te=$.onItemHover,ie=$.onMouseLeave;te({key:F,hover:!1}),ie({key:F,domEvent:j})},ne.onMouseEnter=function(j){var $=ne.props,F=$.eventKey,te=$.onItemHover,ie=$.onMouseEnter;te({key:F,hover:!0}),ie({key:F,domEvent:j})},ne.onClick=function(j){var $=ne.props,F=$.eventKey,te=$.multiple,ie=$.onClick,pe=$.onSelect,ce=$.onDeselect,_e=$.isSelected,Ie={key:F,keyPath:[F],item:Object(a.a)(ne),domEvent:j};ie(Ie),te?_e?ce(Ie):pe(Ie):_e||pe(Ie)},ne.saveNode=function(j){ne.node=j},ne}return Object(v.a)(he,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var j=this.props;j.onDestroy&&j.onDestroy(j.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 j,$=Object(L.a)({},this.props),F=D()(this.getPrefixCls(),$.className,(j={},Object(fe.a)(j,this.getActiveClassName(),!$.disabled&&$.active),Object(fe.a)(j,this.getSelectedClassName(),$.isSelected),Object(fe.a)(j,this.getDisabledClassName(),$.disabled),j)),te=Object(L.a)(Object(L.a)({},$.attribute),{},{title:typeof $.title=="string"?$.title:void 0,className:F,role:$.role||"menuitem","aria-disabled":$.disabled});$.role==="option"?te=Object(L.a)(Object(L.a)({},te),{},{role:"option","aria-selected":$.isSelected}):($.role===null||$.role==="none")&&(te.role="none");var ie={onClick:$.disabled?null:this.onClick,onMouseLeave:$.disabled?null:this.onMouseLeave,onMouseEnter:$.disabled?null:this.onMouseEnter},pe=Object(L.a)({},$.style);$.mode==="inline"&&($.direction==="rtl"?pe.paddingRight=$.inlineIndent*$.level:pe.paddingLeft=$.inlineIndent*$.level),Re.forEach(function(_e){return delete $[_e]}),delete $.direction;var ce=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ce=T.createElement(this.props.itemIcon,this.props)),T.createElement("li",Object(p.a)({},Object(g.a)($,["onClick","onMouseEnter","onMouseLeave","onSelect"]),te,ie,{style:pe,ref:this.saveNode}),$.children,ce)}}]),he}(T.Component);hr.isMenuItem=!0,hr.defaultProps={onSelect:me,onMouseEnter:me,onMouseLeave:me,manualRef:me};var Si=Object(l.b)(function(Z,ue){var he=Z.activeKey,ne=Z.selectedKeys,j=ue.eventKey,$=ue.subMenuKey;return{active:he[$]===j,isSelected:Array.isArray(ne)?ne.indexOf(j)!==-1:ne===j}})(hr),Ri=Si,pr=function(Z){Object(c.a)(he,Z);var ue=Object(i.a)(he);function he(){var ne;return Object(y.a)(this,he),ne=ue.apply(this,arguments),ne.renderInnerMenuItem=function(j){var $=ne.props,F=$.renderMenuItem,te=$.index;return F(j,te,ne.props.subMenuKey)},ne}return Object(v.a)(he,[{key:"render",value:function(){var j=Object(p.a)({},this.props),$=j.className,F=$===void 0?"":$,te=j.rootPrefixCls,ie="".concat(te,"-item-group-title"),pe="".concat(te,"-item-group-list"),ce=j.title,_e=j.children;return Re.forEach(function(Ie){return delete j[Ie]}),delete j.direction,T.createElement("li",Object(p.a)({},j,{onClick:function(je){return je.stopPropagation()},className:"".concat(F," ").concat(te,"-item-group")}),T.createElement("div",{className:ie,title:typeof ce=="string"?ce:void 0},ce),T.createElement("ul",{className:pe},T.Children.map(_e,this.renderInnerMenuItem)))}}]),he}(T.Component);pr.isMenuItemGroup=!0,pr.defaultProps={disabled:!0};var ha=pr,Nr=function(ue){var he=ue.className,ne=ue.rootPrefixCls,j=ue.style;return T.createElement("li",{className:"".concat(he," ").concat(ne,"-item-divider"),style:j})};Nr.defaultProps={disabled:!0,className:"",style:{}};var pa=Nr,wi=xi,Ci=B("eDIo");function Ii(Z,ue){var he=Z.prefixCls,ne=Z.editable,j=Z.locale,$=Z.style;return!ne||ne.showAdd===!1?null:T.createElement("button",{ref:ue,type:"button",className:"".concat(he,"-nav-add"),style:$,"aria-label":(j==null?void 0:j.addAriaLabel)||"Add tab",onClick:function(te){ne.onEdit("add",{event:te})}},ne.addIcon||"+")}var kr=T.forwardRef(Ii);function Di(Z,ue){var he=Z.prefixCls,ne=Z.id,j=Z.tabs,$=Z.locale,F=Z.mobile,te=Z.moreIcon,ie=te===void 0?"More":te,pe=Z.moreTransitionName,ce=Z.style,_e=Z.className,Ie=Z.editable,je=Z.tabBarGutter,ke=Z.rtl,ze=Z.onTabClick,it=Object(T.useState)(!1),ht=Object(N.a)(it,2),st=ht[0],mt=ht[1],pt=Object(T.useState)(null),dt=Object(N.a)(pt,2),ct=dt[0],Ot=dt[1],gt="".concat(ne,"-more-popup"),Ut="".concat(he,"-dropdown"),wt=ct!==null?"".concat(gt,"-").concat(ct):null,tt=$==null?void 0:$.dropdownAriaLabel,et=T.createElement(wi,{onClick:function(It){var kt=It.key,$t=It.domEvent;ze(kt,$t),mt(!1)},id:gt,tabIndex:-1,role:"listbox","aria-activedescendant":wt,selectedKeys:[ct],"aria-label":tt!==void 0?tt:"expanded dropdown"},j.map(function(xt){return T.createElement(Ri,{key:xt.key,id:"".concat(gt,"-").concat(xt.key),role:"option","aria-controls":ne&&"".concat(ne,"-panel-").concat(xt.key),disabled:xt.disabled},xt.tab)}));function vt(xt){for(var It=j.filter(function(tn){return!tn.disabled}),kt=It.findIndex(function(tn){return tn.key===ct})||0,$t=It.length,en=0;en<$t;en+=1){kt=(kt+xt+$t)%$t;var Kt=It[kt];if(!Kt.disabled){Ot(Kt.key);return}}}function Et(xt){var It=xt.which;if(!st){[u.a.DOWN,u.a.SPACE,u.a.ENTER].includes(It)&&(mt(!0),xt.preventDefault());return}switch(It){case u.a.UP:vt(-1),xt.preventDefault();break;case u.a.DOWN:vt(1),xt.preventDefault();break;case u.a.ESC:mt(!1);break;case u.a.SPACE:case u.a.ENTER:ct!==null&&ze(ct,xt);break}}Object(T.useEffect)(function(){var xt=document.getElementById(wt);xt&&xt.scrollIntoView&&xt.scrollIntoView(!1)},[ct]),Object(T.useEffect)(function(){st||Ot(null)},[st]);var Ye=Object(fe.a)({},ke?"marginLeft":"marginRight",je);j.length||(Ye.visibility="hidden",Ye.order=1);var At=D()(Object(fe.a)({},"".concat(Ut,"-rtl"),ke)),Mt=F?null:T.createElement(Ci.a,{prefixCls:Ut,overlay:et,trigger:["hover"],visible:st,transitionName:pe,onVisibleChange:mt,overlayClassName:At,mouseEnterDelay:.1,mouseLeaveDelay:.1},T.createElement("button",{type:"button",className:"".concat(he,"-nav-more"),style:Ye,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":gt,id:"".concat(ne,"-more"),"aria-expanded":st,onKeyDown:Et},ie));return T.createElement("div",{className:D()("".concat(he,"-nav-operations"),_e),style:ce,ref:ue},Mt,T.createElement(kr,{prefixCls:he,locale:$,editable:Ie}))}var Li=T.forwardRef(Di),mr=Object(T.createContext)(null),Pi=.1,Ur=.01,Jn=20,jr=Math.pow(.995,Jn);function Mi(){var Z=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(Z)||/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(Z.substr(0,4)))}function Ni(Z,ue){var he=Object(T.useState)(),ne=Object(N.a)(he,2),j=ne[0],$=ne[1],F=Object(T.useState)(0),te=Object(N.a)(F,2),ie=te[0],pe=te[1],ce=Object(T.useState)(0),_e=Object(N.a)(ce,2),Ie=_e[0],je=_e[1],ke=Object(T.useState)(),ze=Object(N.a)(ke,2),it=ze[0],ht=ze[1],st=Object(T.useRef)();function mt(tt){var et=tt.touches[0],vt=et.screenX,Et=et.screenY;$({x:vt,y:Et}),window.clearInterval(st.current)}function pt(tt){if(!j)return;tt.preventDefault();var et=tt.touches[0],vt=et.screenX,Et=et.screenY;$({x:vt,y:Et});var Ye=vt-j.x,At=Et-j.y;ue(Ye,At);var Mt=Date.now();pe(Mt),je(Mt-ie),ht({x:Ye,y:At})}function dt(){if(!j)return;if($(null),ht(null),it){var tt=it.x/Ie,et=it.y/Ie,vt=Math.abs(tt),Et=Math.abs(et);if(Math.max(vt,Et)<Pi)return;var Ye=tt,At=et;st.current=window.setInterval(function(){if(Math.abs(Ye)<Ur&&Math.abs(At)<Ur){window.clearInterval(st.current);return}Ye*=jr,At*=jr,ue(Ye*Jn,At*Jn)},Jn)}}var ct=Object(T.useRef)(0),Ot=Object(T.useRef)(!1),gt=Object(T.useRef)();function Ut(tt){var et=tt.deltaX,vt=tt.deltaY,Et=0,Ye=Math.abs(et),At=Math.abs(vt);Ye===At?Et=gt.current==="x"?et:vt:Ye>At?(Et=et,gt.current="x"):(Et=vt,gt.current="y");var Mt=Date.now();Mt-ct.current>100&&(Ot.current=!1),(ue(-Et,-Et)||Ot.current)&&(tt.preventDefault(),Ot.current=!0),ct.current=Mt}var wt=Object(T.useRef)(null);wt.current={onTouchStart:mt,onTouchMove:pt,onTouchEnd:dt,onWheel:Ut},T.useEffect(function(){function tt(Ye){wt.current.onTouchStart(Ye)}function et(Ye){wt.current.onTouchMove(Ye)}function vt(Ye){wt.current.onTouchEnd(Ye)}function Et(Ye){wt.current.onWheel(Ye)}return document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",vt,{passive:!1}),Z.current.addEventListener("touchstart",tt,{passive:!1}),Z.current.addEventListener("wheel",Et),function(){document.removeEventListener("touchmove",et),document.removeEventListener("touchend",vt)}},[])}function ki(){var Z=Object(T.useRef)(new Map);function ue(ne){return Z.current.has(ne)||Z.current.set(ne,T.createRef()),Z.current.get(ne)}function he(ne){Z.current.delete(ne)}return[ue,he]}function Br(Z,ue){var he=T.useRef(Z),ne=T.useState({}),j=Object(N.a)(ne,2),$=j[1];function F(te){var ie=typeof te=="function"?te(he.current):te;ie!==he.current&&ue(ie,he.current),he.current=ie,$({})}return[he.current,F]}var Fr=function(ue){var he=ue.position,ne=ue.prefixCls,j=ue.extra;if(!j)return null;var $,F=j;return he==="right"&&($=F.right||!F.left&&F||null),he==="left"&&($=F.left||null),$?T.createElement("div",{className:"".concat(ne,"-extra-content")},$):null};function Ui(Z,ue){var he,ne=T.useContext(mr),j=ne.prefixCls,$=ne.tabs,F=Z.className,te=Z.style,ie=Z.id,pe=Z.animated,ce=Z.activeKey,_e=Z.rtl,Ie=Z.extra,je=Z.editable,ke=Z.locale,ze=Z.tabPosition,it=Z.tabBarGutter,ht=Z.children,st=Z.onTabClick,mt=Z.onTabScroll,pt=Object(T.useRef)(),dt=Object(T.useRef)(),ct=Object(T.useRef)(),Ot=Object(T.useRef)(),gt=ki(),Ut=Object(N.a)(gt,2),wt=Ut[0],tt=Ut[1],et=ze==="top"||ze==="bottom",vt=Br(0,function(Ct,_t){et&&mt&&mt({direction:Ct>_t?"left":"right"})}),Et=Object(N.a)(vt,2),Ye=Et[0],At=Et[1],Mt=Br(0,function(Ct,_t){!et&&mt&&mt({direction:Ct>_t?"top":"bottom"})}),xt=Object(N.a)(Mt,2),It=xt[0],kt=xt[1],$t=Object(T.useState)(0),en=Object(N.a)($t,2),Kt=en[0],tn=en[1],on=Object(T.useState)(0),nn=Object(N.a)(on,2),rn=nn[0],Wt=nn[1],Jt=Object(T.useState)(0),Qt=Object(N.a)(Jt,2),Xt=Qt[0],pn=Qt[1],mn=Object(T.useState)(0),vn=Object(N.a)(mn,2),Pt=vn[0],cn=vn[1],_n=Object(T.useState)(null),Nt=Object(N.a)(_n,2),Rt=Nt[0],Zt=Nt[1],Wi=Object(T.useState)(null),zr=Object(N.a)(Wi,2),On=zr[0],Hi=zr[1],Gi=Object(T.useState)(0),Vr=Object(N.a)(Gi,2),zi=Vr[0],Vi=Vr[1],Xi=Object(T.useState)(0),Xr=Object(N.a)(Xi,2),Yi=Xr[0],$i=Xr[1],Qi=e(new Map),Yr=Object(N.a)(Qi,2),Zi=Yr[0],Ji=Yr[1],qn=r($,Zi,Kt),$r="".concat(j,"-nav-operations-hidden"),In=0,Dn=0;et?_e?(In=0,Dn=Math.max(0,Kt-Rt)):(In=Math.min(0,Rt-Kt),Dn=0):(In=Math.min(0,On-rn),Dn=0);function gr(Ct){return Ct<In?[In,!1]:Ct>Dn?[Dn,!1]:[Ct,!0]}var Qr=Object(T.useRef)(),qi=Object(T.useState)(),Zr=Object(N.a)(qi,2),vr=Zr[0],Jr=Zr[1];function _r(){Jr(Date.now())}function yr(){window.clearTimeout(Qr.current)}Ni(pt,function(Ct,_t){var Yt=!1;function an(Pn,Mn){Pn(function(Nn){var kn=gr(Nn+Mn),An=Object(N.a)(kn,2),Or=An[0],Ar=An[1];return Yt=Ar,Or})}if(et){if(Rt>=Kt)return Yt;an(At,Ct)}else{if(On>=rn)return Yt;an(kt,_t)}return yr(),_r(),Yt}),Object(T.useEffect)(function(){return yr(),vr&&(Qr.current=window.setTimeout(function(){Jr(0)},100)),yr},[vr]);function qr(){var Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ce,_t=qn.get(Ct);if(!_t)return;if(et){var Yt=Ye;_e?_t.right<Ye?Yt=_t.right:_t.right+_t.width>Ye+Rt&&(Yt=_t.right+_t.width-Rt):_t.left<-Ye?Yt=-_t.left:_t.left+_t.width>-Ye+Rt&&(Yt=-(_t.left+_t.width-Rt)),kt(0),At(gr(Yt)[0])}else{var an=It;_t.top<-It?an=-_t.top:_t.top+_t.height>-It+On&&(an=-(_t.top+_t.height-On)),At(0),kt(gr(an)[0])}}var ea=m(qn,{width:Rt,height:On,left:Ye,top:It},{width:Xt,height:Pt},{width:zi,height:Yi},Object(L.a)(Object(L.a)({},Z),{},{tabs:$})),ei=Object(N.a)(ea,2),ta=ei[0],na=ei[1],ra=$.map(function(Ct){var _t=Ct.key;return T.createElement(t,{id:ie,prefixCls:j,key:_t,rtl:_e,tab:Ct,closable:Ct.closable,editable:je,active:_t===ce,tabPosition:ze,tabBarGutter:it,renderWrapper:ht,removeAriaLabel:ke==null?void 0:ke.removeAriaLabel,ref:wt(_t),onClick:function(an){st(_t,an)},onRemove:function(){tt(_t)},onFocus:function(){qr(_t),_r(),_e||(pt.current.scrollLeft=0),pt.current.scrollTop=0}})}),Er=o(function(){var Ct,_t,Yt,an,Pn,Mn,Nn,kn,An,Or=((Ct=pt.current)===null||Ct===void 0?void 0:Ct.offsetWidth)||0,Ar=((_t=pt.current)===null||_t===void 0?void 0:_t.offsetHeight)||0,li=((Yt=Ot.current)===null||Yt===void 0?void 0:Yt.offsetWidth)||0,ui=((an=Ot.current)===null||an===void 0?void 0:an.offsetHeight)||0,ua=((Pn=ct.current)===null||Pn===void 0?void 0:Pn.offsetWidth)||0,da=((Mn=ct.current)===null||Mn===void 0?void 0:Mn.offsetHeight)||0;Zt(Or),Hi(Ar),Vi(li),$i(ui);var di=(((Nn=dt.current)===null||Nn===void 0?void 0:Nn.offsetWidth)||0)-li,ci=(((kn=dt.current)===null||kn===void 0?void 0:kn.offsetHeight)||0)-ui;tn(di),Wt(ci);var fi=(An=ct.current)===null||An===void 0?void 0:An.className.includes($r);pn(di-(fi?0:ua)),cn(ci-(fi?0:da)),Ji(function(){var hi=new Map;return $.forEach(function(ca){var pi=ca.key,Un=wt(pi).current;Un&&hi.set(pi,{width:Un.offsetWidth,height:Un.offsetHeight,left:Un.offsetLeft,top:Un.offsetTop})}),hi})}),ia=$.slice(0,ta),aa=$.slice(na+1),ti=[].concat(Object(O.a)(ia),Object(O.a)(aa)),sa=Object(T.useState)(),ni=Object(N.a)(sa,2),oa=ni[0],la=ni[1],gn=qn.get(ce),ri=Object(T.useRef)();function ii(){f.a.cancel(ri.current)}Object(T.useEffect)(function(){var Ct={};return gn&&(et?(_e?Ct.right=gn.right:Ct.left=gn.left,Ct.width=gn.width):(Ct.top=gn.top,Ct.height=gn.height)),ii(),ri.current=f()(function(){la(Ct)}),ii},[gn,et,_e]),Object(T.useEffect)(function(){qr()},[ce,gn,qn,et]),Object(T.useEffect)(function(){Er()},[_e,it,ce,$.map(function(Ct){return Ct.key}).join("_")]);var ai=!!ti.length,Ln="".concat(j,"-nav-wrap"),br,Tr,si,oi;return et?_e?(Tr=Ye>0,br=Ye+Rt<Kt):(br=Ye<0,Tr=-Ye+Rt<Kt):(si=It<0,oi=-It+On<rn),T.createElement("div",{ref:ue,role:"tablist",className:D()("".concat(j,"-nav"),F),style:te,onKeyDown:function(){_r()}},T.createElement(Fr,{position:"left",extra:Ie,prefixCls:j}),T.createElement(d.a,{onResize:Er},T.createElement("div",{className:D()(Ln,(he={},Object(fe.a)(he,"".concat(Ln,"-ping-left"),br),Object(fe.a)(he,"".concat(Ln,"-ping-right"),Tr),Object(fe.a)(he,"".concat(Ln,"-ping-top"),si),Object(fe.a)(he,"".concat(Ln,"-ping-bottom"),oi),he)),ref:pt},T.createElement(d.a,{onResize:Er},T.createElement("div",{ref:dt,className:"".concat(j,"-nav-list"),style:{transform:"translate(".concat(Ye,"px, ").concat(It,"px)"),transition:vr?"none":void 0}},ra,T.createElement(kr,{ref:Ot,prefixCls:j,locale:ke,editable:je,style:{visibility:ai?"hidden":null}}),T.createElement("div",{className:D()("".concat(j,"-ink-bar"),Object(fe.a)({},"".concat(j,"-ink-bar-animated"),pe.inkBar)),style:oa}))))),T.createElement(Li,Object.assign({},Z,{ref:ct,prefixCls:j,tabs:ti,className:!ai&&$r})),T.createElement(Fr,{position:"right",extra:Ie,prefixCls:j}))}var Kr=T.forwardRef(Ui);function ji(Z){var ue=Z.id,he=Z.activeKey,ne=Z.animated,j=Z.tabPosition,$=Z.rtl,F=Z.destroyInactiveTabPane,te=T.useContext(mr),ie=te.prefixCls,pe=te.tabs,ce=ne.tabPane,_e=pe.findIndex(function(Ie){return Ie.key===he});return T.createElement("div",{className:D()("".concat(ie,"-content-holder"))},T.createElement("div",{className:D()("".concat(ie,"-content"),"".concat(ie,"-content-").concat(j),Object(fe.a)({},"".concat(ie,"-content-animated"),ce)),style:_e&&ce?Object(fe.a)({},$?"marginRight":"marginLeft","-".concat(_e,"00%")):null},pe.map(function(Ie){return T.cloneElement(Ie.node,{key:Ie.key,prefixCls:ie,tabKey:Ie.key,id:ue,animated:ce,active:Ie.key===he,destroyInactiveTabPane:F})})))}function Wr(Z){var ue=Z.prefixCls,he=Z.forceRender,ne=Z.className,j=Z.style,$=Z.id,F=Z.active,te=Z.animated,ie=Z.destroyInactiveTabPane,pe=Z.tabKey,ce=Z.children,_e=T.useState(he),Ie=Object(N.a)(_e,2),je=Ie[0],ke=Ie[1];T.useEffect(function(){F?ke(!0):ie&&ke(!1)},[F,ie]);var ze={};return F||(te?(ze.visibility="hidden",ze.height=0,ze.overflowY="hidden"):ze.display="none"),T.createElement("div",{id:$&&"".concat($,"-panel-").concat(pe),role:"tabpanel",tabIndex:F?0:-1,"aria-labelledby":$&&"".concat($,"-tab-").concat(pe),"aria-hidden":!F,style:Object(L.a)(Object(L.a)({},ze),j),className:D()("".concat(ue,"-tabpane"),F&&"".concat(ue,"-tabpane-active"),ne)},(F||je||he)&&ce)}var Hr=0;function Bi(Z){return Object(I.a)(Z).map(function(ue){if(T.isValidElement(ue)){var he=ue.key!==void 0?String(ue.key):void 0;return Object(L.a)(Object(L.a)({key:he},ue.props),{},{node:ue})}return null}).filter(function(ue){return ue})}function Fi(Z,ue){var he,ne=Z.id,j=Z.prefixCls,$=j===void 0?"rc-tabs":j,F=Z.className,te=Z.children,ie=Z.direction,pe=Z.activeKey,ce=Z.defaultActiveKey,_e=Z.editable,Ie=Z.animated,je=Z.tabPosition,ke=je===void 0?"top":je,ze=Z.tabBarGutter,it=Z.tabBarStyle,ht=Z.tabBarExtraContent,st=Z.locale,mt=Z.moreIcon,pt=Z.moreTransitionName,dt=Z.destroyInactiveTabPane,ct=Z.renderTabBar,Ot=Z.onChange,gt=Z.onTabClick,Ut=Z.onTabScroll,wt=Object(S.a)(Z,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),tt=Bi(te),et=ie==="rtl",vt;Ie===!1?vt={inkBar:!1,tabPane:!1}:vt=Object(L.a)({inkBar:!0,tabPane:!1},Ie!==!0?Ie:null);var Et=Object(T.useState)(!1),Ye=Object(N.a)(Et,2),At=Ye[0],Mt=Ye[1];Object(T.useEffect)(function(){Mt(Mi())},[]);var xt=Object(A.a)(function(){var Pt;return(Pt=tt[0])===null||Pt===void 0?void 0:Pt.key},{value:pe,defaultValue:ce}),It=Object(N.a)(xt,2),kt=It[0],$t=It[1],en=Object(T.useState)(function(){return tt.findIndex(function(Pt){return Pt.key===kt})}),Kt=Object(N.a)(en,2),tn=Kt[0],on=Kt[1];Object(T.useEffect)(function(){var Pt=tt.findIndex(function(_n){return _n.key===kt});if(Pt===-1){var cn;Pt=Math.max(0,Math.min(tn,tt.length-1)),$t((cn=tt[Pt])===null||cn===void 0?void 0:cn.key)}on(Pt)},[tt.map(function(Pt){return Pt.key}).join("_"),kt,tn]);var nn=Object(A.a)(null,{value:ne}),rn=Object(N.a)(nn,2),Wt=rn[0],Jt=rn[1],Qt=ke;At&&!["left","right"].includes(ke)&&(Qt="top"),Object(T.useEffect)(function(){ne||(Jt("rc-tabs-".concat(Hr)),Hr+=1)},[]);function Xt(Pt,cn){gt==null||gt(Pt,cn),$t(Pt),Ot==null||Ot(Pt)}var pn={id:Wt,activeKey:kt,animated:vt,tabPosition:Qt,rtl:et,mobile:At},mn,vn=Object(L.a)(Object(L.a)({},pn),{},{editable:_e,locale:st,moreIcon:mt,moreTransitionName:pt,tabBarGutter:ze,onTabClick:Xt,onTabScroll:Ut,extra:ht,style:it,panes:te});return ct?mn=ct(vn,Kr):mn=T.createElement(Kr,Object.assign({},vn)),T.createElement(mr.Provider,{value:{tabs:tt,prefixCls:$}},T.createElement("div",Object.assign({ref:ue,id:ne,className:D()($,"".concat($,"-").concat(Qt),(he={},Object(fe.a)(he,"".concat($,"-mobile"),At),Object(fe.a)(he,"".concat($,"-editable"),_e),Object(fe.a)(he,"".concat($,"-rtl"),et),he),F)},wt),mn,T.createElement(ji,Object.assign({destroyInactiveTabPane:dt},pn,{animated:vt}))))}var Gr=T.forwardRef(Fi);Gr.TabPane=Wr;var Ki=Gr,ma=Fe.b=Ki},p5ED:function(Xe,Fe,B){"use strict";var fe=B("+L6B"),N=B("2/Rp"),S=B("5Dmo"),L=B("3S7+"),T=B("k1fw"),w=B("tJVT"),D=B("cDcd"),I=B.n(D),A=B("vHTk"),O=B.n(A),_=B("yEEn"),f=B("ZW9T"),d=B("1vsH");Fe.a=function(o){var e=o.name,u=o.data,s=o.theme,t=o.type,n=o.filename,r=o.monacoEditor,E=o.className,m=o.style,p=o.close,y=o.onClose,v=o.hasMask,a=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),c=Object(w.a)(a,2),i=c[0],l=c[1],g=Object(D.useState)(""),h=Object(w.a)(g,2),b=h[0],R=h[1],x,P=1024*1024,M=10*P,k=Object(D.useRef)();t==="office"&&(x=Object(d.V)(u).filesize,x>M&&(t="other")),n&&(r.filename=n),Object(D.useEffect)(function(){var K,ee,z=(K=document.cookie)===null||K===void 0||((ee=K.replace(/\s/g,""))===null||ee===void 0)?void 0:ee.split(";");z==null||z.map(function(ae){var se=ae.split("=");se[0]==="_educoder_session"&&R(se[1])})},[]);var C=function(){if(u.startsWith("http")||u.startsWith("/")){U();return}Object(d.z)(n||"educoder",u,n)},U=function(){Object(d.x)(n||e,u)};return console.log("data:",u,"fileanme:",n," name:",e),I.a.createElement("div",{style:Object(T.a)({},m||{}),className:"".concat(v&&O.a.bgBlack," ").concat(t?O.a.wrp:"hide")},p&&I.a.createElement("div",{className:O.a.close,ref:k},I.a.createElement(L.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return k.current}},I.a.createElement("span",{onClick:U},I.a.createElement("i",{className:"icon-quxiaozhiding"}))),I.a.createElement(L.a,{title:"\u5173\u95ED",getPopupContainer:function(){return k.current}},I.a.createElement("span",{className:"",onClick:y},I.a.createElement("i",{className:"icon-guanbi1"})))),I.a.createElement("div",{className:"".concat(O.a[E]," ").concat(E," ").concat(O.a.monaco," ").concat(t==="txt"?"show":"hide")},t==="txt"&&I.a.createElement(f.b,r)),t==="audio"&&I.a.createElement("audio",{src:"".concat(u!=null&&u.startsWith("/")||(u==null?void 0:u.indexOf("https://"))>-1?u:"data:audio/mp3;base64,").concat(u),autoPlay:!0}),t==="video"&&I.a.createElement(I.a.Fragment,null,u!=null&&u.startsWith("/")?I.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):I.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),t==="html"&&I.a.createElement("iframe",{src:u+"&disposition=inline"}),t==="pdf"&&I.a.createElement("embed",{className:O.a.embed,src:u}),t==="image"&&I.a.createElement(I.a.Fragment,null,I.a.createElement("img",{src:"".concat(u!=null&&u.startsWith("/")||(u==null?void 0:u.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(u)})),t==="other"&&I.a.createElement("div",null,I.a.createElement(N.a,{type:"primary",size:"large",onClick:C},I.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(t==="download"||t==="office")&&I.a.createElement(N.a,{type:"primary",size:"large",onClick:C},I.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},psGv:function(Xe,Fe,B){var fe,N;(function(){var S;(function(){"use strict";var D=[,,function(_){function f(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var e=new f(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},f.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},f.prototype.has_match=function(e){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(e))return!0;return!1},f.prototype.set_indent=function(e,u){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,e.__items[0]===" "&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(e){this.__items.push(e);var u=e.lastIndexOf(`
`);u!==-1?this.__character_count=e.length-u:this.__character_count+=e.length},f.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e};function d(e,u){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),u=u||"",e.indent_level>0&&(u=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}d.prototype.get_indent_size=function(e,u){var s=this.__base_string_length;return u=u||0,e<0&&(s=0),s+=e*this.__indent_size,s+=u,s},d.prototype.get_indent_string=function(e,u){var s=this.__base_string;return u=u||0,e<0&&(e=0,s=""),u+=e*this.__indent_size,this.__ensure_cache(u),s+=this.__cache[u],s},d.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var e=this.__cache.length,u=0,s="";this.__indent_size&&e>=this.__indent_size&&(u=Math.floor(e/this.__indent_size),e-=u*this.__indent_size,s=new Array(u+1).join(this.__indent_string)),e&&(s+=new Array(e+1).join(" ")),this.__cache.push(s)};function o(e,u){this.__indent_cache=new d(e,u),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(e,u){return this.__indent_cache.get_indent_string(e,u)},o.prototype.get_indent_size=function(e,u){return this.__indent_cache.get_indent_size(e,u)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(e){return this.is_empty()||!e&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(e){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return e!==`
`&&(s=s.replace(/[\n]/g,e)),s},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(e,u){return e=e||0,u=u||0,this.next_line.set_indent(e,u),this.__lines.length>1?(this.current_line.set_indent(e,u),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(e){for(var u=0;u<e.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},o.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},o.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(" "))},o.prototype.remove_indent=function(e){for(var u=this.__lines.length;e<u;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},o.prototype.trim=function(e){for(e=e===void 0?!1:e,this.current_line.trim();e&&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},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(e,u){for(var s=this.__lines.length-2;s>=0;){var t=this.__lines[s];if(t.is_empty())break;if(t.item(0).indexOf(e)!==0&&t.item(-1)!==u){this.__lines.splice(s+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},_.exports.Output=o},function(_){function f(d,o,e,u){this.type=d,this.text=o,this.comments_before=null,this.newlines=e||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}_.exports.Token=f},,,function(_){function f(e,u){this.raw_options=d(e,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(e,u){var s=this.raw_options[e],t=u||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(t=s.concat()):typeof s=="string"&&(t=s.split(/[^a-zA-Z0-9_\/\-]+/)),t},f.prototype._get_boolean=function(e,u){var s=this.raw_options[e],t=s===void 0?!!u:!!s;return t},f.prototype._get_characters=function(e,u){var s=this.raw_options[e],t=u||"";return typeof s=="string"&&(t=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),t},f.prototype._get_number=function(e,u){var s=this.raw_options[e];u=parseInt(u,10),isNaN(u)&&(u=0);var t=parseInt(s,10);return isNaN(t)&&(t=u),t},f.prototype._get_selection=function(e,u,s){var t=this._get_selection_list(e,u,s);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+e+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[e]+"'");return t[0]},f.prototype._get_selection_list=function(e,u,s){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[u[0]],!this._is_valid_selection(s,u))throw new Error("Invalid Default Value!");var t=this._get_array(e,s);if(!this._is_valid_selection(t,u))throw new Error("Invalid Option Value: The option '"+e+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[e]+"'");return t},f.prototype._is_valid_selection=function(e,u){return e.length&&u.length&&!e.some(function(s){return u.indexOf(s)===-1})};function d(e,u){var s={};e=o(e);var t;for(t in e)t!==u&&(s[t]=e[t]);if(u&&e[u])for(t in e[u])s[t]=e[u][t];return s}function o(e){var u={},s;for(s in e){var t=s.replace(/-/g,"_");u[t]=e[s]}return u}_.exports.Options=f,_.exports.normalizeOpts=o,_.exports.mergeOpts=d},,function(_){var f=RegExp.prototype.hasOwnProperty("sticky");function d(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}d.prototype.restart=function(){this.__position=0},d.prototype.back=function(){this.__position>0&&(this.__position-=1)},d.prototype.hasNext=function(){return this.__position<this.__input_length},d.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__input.charAt(this.__position),this.__position+=1),o},d.prototype.peek=function(o){var e=null;return o=o||0,o+=this.__position,o>=0&&o<this.__input_length&&(e=this.__input.charAt(o)),e},d.prototype.__match=function(o,e){o.lastIndex=e;var u=o.exec(this.__input);return u&&!(f&&o.sticky)&&(u.index!==e&&(u=null)),u},d.prototype.test=function(o,e){return e=e||0,e+=this.__position,e>=0&&e<this.__input_length?!!this.__match(o,e):!1},d.prototype.testChar=function(o,e){var u=this.peek(e);return o.lastIndex=0,u!==null&&o.test(u)},d.prototype.match=function(o){var e=this.__match(o,this.__position);return e?this.__position+=e[0].length:e=null,e},d.prototype.read=function(o,e,u){var s="",t;return o&&(t=this.match(o),t&&(s+=t[0])),e&&(t||!o)&&(s+=this.readUntil(e,u)),s},d.prototype.readUntil=function(o,e){var u="",s=this.__position;o.lastIndex=this.__position;var t=o.exec(this.__input);return t?(s=t.index,e&&(s+=t[0].length)):s=this.__input_length,u=this.__input.substring(this.__position,s),this.__position=s,u},d.prototype.readUntilAfter=function(o){return this.readUntil(o,!0)},d.prototype.get_regexp=function(o,e){var u=null,s="g";return e&&f&&(s="y"),typeof o=="string"&&o!==""?u=new RegExp(o,s):o&&(u=new RegExp(o.source,s)),u},d.prototype.get_literal_regexp=function(o){return RegExp(o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},d.prototype.peekUntilAfter=function(o){var e=this.__position,u=this.readUntilAfter(o);return this.__position=e,u},d.prototype.lookBack=function(o){var e=this.__position-1;return e>=o.length&&this.__input.substring(e-o.length,e).toLowerCase()===o},_.exports.InputScanner=d},function(_,f,d){var o=d(8).InputScanner,e=d(3).Token,u=d(10).TokenStream,s=d(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(r,E){this._input=new o(r),this._options=E||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var r,E=new e(t.START,""),m=null,p=[],y=new u;E.type!==t.EOF;){for(r=this._get_next_token(E,m);this._is_comment(r);)y.add(r),r=this._get_next_token(E,m);y.isEmpty()||(r.comments_before=y,y=new u),r.parent=m,this._is_opening(r)?(p.push(m),m=r):m&&this._is_closing(r,m)&&(r.opened=m,m.closed=r,m=p.pop(),r.parent=m),r.previous=E,E.next=r,this.__tokens.add(r),E=r}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(r,E){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(t.RAW,m):this._create_token(t.EOF,"")},n.prototype._is_comment=function(r){return!1},n.prototype._is_opening=function(r){return!1},n.prototype._is_closing=function(r,E){return!1},n.prototype._create_token=function(r,E){var m=new e(r,E,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},_.exports.Tokenizer=n,_.exports.TOKEN=t},function(_){function f(d){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=d}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__tokens[this.__position],this.__position+=1),d},f.prototype.peek=function(d){var o=null;return d=d||0,d+=this.__position,d>=0&&d<this.__tokens_length&&(o=this.__tokens[d]),o},f.prototype.add=function(d){this.__parent_token&&(d.parent=this.__parent_token),this.__tokens.push(d),this.__tokens_length+=1},_.exports.TokenStream=f},function(_,f,d){var o=d(12).Pattern;function e(u,s){o.call(this,u,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}e.prototype=new o,e.prototype.__set_whitespace_patterns=function(u,s){u+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},e.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var s=this.__split(this._newline_regexp,u);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return u},e.prototype.matching=function(u,s){var t=this._create();return t.__set_whitespace_patterns(u,s),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype.__split=function(u,s){u.lastIndex=0;for(var t=0,n=[],r=u.exec(s);r;)n.push(s.substring(t,r.index)),t=r.index+r[0].length,r=u.exec(s);return t<s.length?n.push(s.substring(t,s.length)):n.push(""),n},_.exports.WhitespacePattern=e},function(_){function f(d,o){this._input=d,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,o&&(this._starting_pattern=this._input.get_regexp(o._starting_pattern,!0),this._match_pattern=this._input.get_regexp(o._match_pattern,!0),this._until_pattern=this._input.get_regexp(o._until_pattern),this._until_after=o._until_after)}f.prototype.read=function(){var d=this._input.read(this._starting_pattern);return(!this._starting_pattern||d)&&(d+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),d},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(d){var o=this._create();return o._until_after=!0,o._until_pattern=this._input.get_regexp(d),o._update(),o},f.prototype.until=function(d){var o=this._create();return o._until_after=!1,o._until_pattern=this._input.get_regexp(d),o._update(),o},f.prototype.starting_with=function(d){var o=this._create();return o._starting_pattern=this._input.get_regexp(d,!0),o._update(),o},f.prototype.matching=function(d){var o=this._create();return o._match_pattern=this._input.get_regexp(d,!0),o._update(),o},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},_.exports.Pattern=f},function(_){function f(d,o){d=typeof d=="string"?d:d.source,o=typeof o=="string"?o:o.source,this.__directives_block_pattern=new RegExp(d+/ beautify( \w+[:]\w+)+ /.source+o,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(d+/\sbeautify\signore:end\s/.source+o,"g")}f.prototype.get_directives=function(d){if(!d.match(this.__directives_block_pattern))return null;var o={};this.__directive_pattern.lastIndex=0;for(var e=this.__directive_pattern.exec(d);e;)o[e[1]]=e[2],e=this.__directive_pattern.exec(d);return o},f.prototype.readIgnored=function(d){return d.readUntilAfter(this.__directives_end_ignore_pattern)},_.exports.Directives=f},function(_,f,d){var o=d(12).Pattern,e={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(s,t){o.call(this,s,t),this.__template_pattern=null,this._disabled=Object.assign({},e),this._excluded=Object.assign({},e),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var n=new o(s);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new o,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(s){var t=this._create();return t._disabled[s]=!0,t._update(),t},u.prototype.read_options=function(s){var t=this._create();for(var n in e)t._disabled[n]=s.templating.indexOf(n)===-1;return t._update(),t},u.prototype.exclude=function(s){var t=this._create();return t._excluded[s]=!0,t._update(),t},u.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),s+=t,t=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},u.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},u.prototype._read_template=function(){var s="",t=this._input.peek();if(t==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(s=s||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},_.exports.TemplatablePattern=u},,,,function(_,f,d){var o=d(19).Beautifier,e=d(20).Options;function u(s,t,n,r){var E=new o(s,t,n,r);return E.beautify()}_.exports=u,_.exports.defaultOptions=function(){return new e}},function(_,f,d){var o=d(20).Options,e=d(2).Output,u=d(21).Tokenizer,s=d(21).TOKEN,t=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,r=function(g,h){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=g.max_preserve_newlines,this.preserve_newlines=g.preserve_newlines,this._output=new e(g,h)};r.prototype.current_line_has_match=function(g){return this._output.current_line.has_match(g)},r.prototype.set_space_before_token=function(g,h){this._output.space_before_token=g,this._output.non_breaking_space=h},r.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},r.prototype.add_raw_token=function(g){this._output.add_raw_token(g)},r.prototype.print_preserved_newlines=function(g){var h=0;g.type!==s.TEXT&&g.previous.type!==s.TEXT&&(h=g.newlines?1:0),this.preserve_newlines&&(h=g.newlines<this.max_preserve_newlines+1?g.newlines:this.max_preserve_newlines+1);for(var b=0;b<h;b++)this.print_newline(b>0);return h!==0},r.prototype.traverse_whitespace=function(g){return g.whitespace_before||g.newlines?(this.print_preserved_newlines(g)||(this._output.space_before_token=!0),!0):!1},r.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},r.prototype.print_newline=function(g){this._output.add_new_line(g)},r.prototype.print_token=function(g){g.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(g.text))},r.prototype.indent=function(){this.indent_level++},r.prototype.get_full_indent=function(g){return g=this.indent_level+(g||0),g<1?"":this._output.get_indent_string(g)};var E=function(g){for(var h=null,b=g.next;b.type!==s.EOF&&g.closed!==b;){if(b.type===s.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===s.EQUALS&&b.next.next&&b.next.next.type===s.VALUE&&(h=b.next.next.text);break}b=b.next}return h},m=function(g,h){var b=null,R=null;return h.closed?(g==="script"?b="text/javascript":g==="style"&&(b="text/css"),b=E(h)||b,b.search("text/css")>-1?R="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?R="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?R="html":b.search(/test\/null/)>-1&&(R="null"),R):null};function p(g,h){return h.indexOf(g)!==-1}function y(g,h,b){this.parent=g||null,this.tag=h?h.tag_name:"",this.indent_level=b||0,this.parser_token=h||null}function v(g){this._printer=g,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(g){var h=new y(this._current_frame,g,this._printer.indent_level);this._current_frame=h},v.prototype._try_pop_frame=function(g){var h=null;return g&&(h=g.parser_token,this._printer.indent_level=g.indent_level,this._current_frame=g.parent),h},v.prototype._get_frame=function(g,h){for(var b=this._current_frame;b&&!(g.indexOf(b.tag)!==-1);){if(h&&h.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},v.prototype.try_pop=function(g,h){var b=this._get_frame([g],h);return this._try_pop_frame(b)},v.prototype.indent_to_tag=function(g){var h=this._get_frame(g);h&&(this._printer.indent_level=h.indent_level)};function a(g,h,b,R){this._source_text=g||"",h=h||{},this._js_beautify=b,this._css_beautify=R,this._tag_stack=null;var x=new o(h,"html");this._options=x,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"}a.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g=this._source_text,h=this._options.eol;this._options.eol==="auto"&&(h=`
`,g&&t.test(g)&&(h=g.match(t)[0])),g=g.replace(n,`
`);var b=g.match(/^[\t ]*/)[0],R={text:"",type:""},x=new c,P=new r(this._options,b),M=new u(g,this._options).tokenize();this._tag_stack=new v(P);for(var k=null,C=M.next();C.type!==s.EOF;)C.type===s.TAG_OPEN||C.type===s.COMMENT?(k=this._handle_tag_open(P,C,x,R),x=k):C.type===s.ATTRIBUTE||C.type===s.EQUALS||C.type===s.VALUE||C.type===s.TEXT&&!x.tag_complete?k=this._handle_inside_tag(P,C,x,M):C.type===s.TAG_CLOSE?k=this._handle_tag_close(P,C,x):C.type===s.TEXT?k=this._handle_text(P,C,x):P.add_raw_token(C),R=k,C=M.next();var U=P._output.get_code(h);return U},a.prototype._handle_tag_close=function(g,h,b){var R={text:h.text,type:h.type};return g.alignment_size=0,b.tag_complete=!0,g.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),b.is_unformatted?g.add_raw_token(h):(b.tag_start_char==="<"&&(g.set_space_before_token(h.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&g.print_newline(!1)),g.print_token(h)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(g.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&g.set_wrap_point(),R},a.prototype._handle_inside_tag=function(g,h,b,R){var x=b.has_wrapped_attrs,P={text:h.text,type:h.type};if(g.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),b.is_unformatted)g.add_raw_token(h);else if(b.tag_start_char==="{"&&h.type===s.TEXT)g.print_preserved_newlines(h)?(h.newlines=0,g.add_raw_token(h)):g.print_token(h);else{if(h.type===s.ATTRIBUTE?(g.set_space_before_token(!0),b.attr_count+=1):(h.type===s.EQUALS||h.type===s.VALUE&&h.previous.type===s.EQUALS)&&g.set_space_before_token(!1),h.type===s.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(g.traverse_whitespace(h),x=x||h.newlines!==0),this._is_wrap_attributes_force)){var M=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var k=!0,C=0,U;do{if(U=R.peek(C),U.type===s.ATTRIBUTE){k=!1;break}C+=1}while(C<4&&U.type!==s.EOF&&U.type!==s.TAG_CLOSE);M=!k}M&&(g.print_newline(!1),x=!0)}g.print_token(h),x=x||g.previous_token_wrapped(),b.has_wrapped_attrs=x}return P},a.prototype._handle_text=function(g,h,b){var R={text:h.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(g,h,b):b.is_unformatted||b.is_content_unformatted?g.add_raw_token(h):(g.traverse_whitespace(h),g.print_token(h)),R},a.prototype._print_custom_beatifier_text=function(g,h,b){var R=this;if(h.text!==""){var x=h.text,P,M=1,k="",C="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?P=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?P=this._css_beautify:b.custom_beautifier_name==="html"&&(P=function(se,V){var Y=new a(se,V,R._js_beautify,R._css_beautify);return Y.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-g.indent_level);var U=g.get_full_indent(M);if(x=x.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&x[0]==="<"&&x.match(/^(<!--|<!\[CDATA\[)/)){var K=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(x);if(!K){g.add_raw_token(h);return}k=U+K[1]+`
`,x=K[4],K[5]&&(C=U+K[5]),x=x.replace(/\n[ \t]*$/,""),(K[2]||K[3].indexOf(`
`)!==-1)&&(K=K[3].match(/[ \t]+$/),K&&(h.whitespace_before=K[0]))}if(x)if(P){var ee=function(){this.eol=`
`};ee.prototype=this._options.raw_options;var z=new ee;x=P(U+x,z)}else{var ae=h.whitespace_before;ae&&(x=x.replace(new RegExp(`
(`+ae+")?","g"),`
`)),x=U+x.replace(/\n/g,`
`+U)}k&&(x?x=k+x+`
`+C:x=k+C),g.print_newline(!1),x&&(h.text=x,h.whitespace_before="",h.newlines=0,g.add_raw_token(h),g.print_newline(!0))}},a.prototype._handle_tag_open=function(g,h,b,R){var x=this._get_tag_open_token(h);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&h.type===s.TAG_OPEN&&h.text.indexOf("</")===0?(g.add_raw_token(h),x.start_tag_token=this._tag_stack.try_pop(x.tag_name)):(g.traverse_whitespace(h),this._set_tag_position(g,h,x,b,R),x.is_inline_element||g.set_wrap_point(),g.print_token(h)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(x.alignment_size=h.text.length+1),!x.tag_complete&&!x.is_unformatted&&(g.alignment_size=x.alignment_size),x};var c=function(g,h){if(this.parent=g||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="",!h)this.tag_complete=!0;else{var b;this.tag_start_char=h.text[0],this.text=h.text,this.tag_start_char==="<"?(b=h.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=h.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(h.text.startsWith("{{#>")||h.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&h.next!==null?this.tag_check=h.next.text.split(" ")[0]:this.tag_check=h.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),h.type===s.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||h.closed&&h.closed.text==="/>";var R=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(R=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(R)))}};a.prototype._get_tag_open_token=function(g){var h=new c(this._tag_stack.get_parser_token(),g);return h.alignment_size=this._options.wrap_attributes_indent_size,h.is_end_tag=h.is_end_tag||p(h.tag_check,this._options.void_elements),h.is_empty_element=h.tag_complete||h.is_start_tag&&h.is_end_tag,h.is_unformatted=!h.tag_complete&&p(h.tag_check,this._options.unformatted),h.is_content_unformatted=!h.is_empty_element&&p(h.tag_check,this._options.content_unformatted),h.is_inline_element=p(h.tag_name,this._options.inline)||h.tag_name.includes("-")||h.tag_start_char==="{",h},a.prototype._set_tag_position=function(g,h,b,R,x){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||g.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=m(b.tag_check,h)))),p(b.tag_check,this._options.extra_liners)&&(g.print_newline(!1),g._output.just_added_blankline()||g.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var P=g.current_line_has_match(/{{#if/);P||g.print_newline(!1)}b.tag_name==="!--"&&x.type===s.TAG_CLOSE&&R.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||g.print_newline(!1),this._calcluate_parent_multiline(g,b))}else if(b.is_end_tag){var M=!1;M=b.start_tag_token&&b.start_tag_token.multiline_content,M=M||!b.is_inline_element&&!(R.is_inline_element||R.is_unformatted)&&!(x.type===s.TAG_CLOSE&&b.start_tag_token===R)&&x.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(M=!1),M&&g.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(x.type!=="TK_CONTENT"||b.is_content_unformatted)&&g.print_newline(!1),this._calcluate_parent_multiline(g,b)},a.prototype._calcluate_parent_multiline=function(g,h){h.parent&&g._output.just_added_newline()&&!((h.is_inline_element||h.is_unformatted)&&h.parent.is_inline_element)&&(h.parent.multiline_content=!0)};var i=["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"],l=["a","audio","del","ins","map","noscript","video"];a.prototype._do_optional_end_element=function(g){var h=null;if(g.is_empty_element||!g.is_start_tag||!g.parent)return;if(g.tag_name==="body")h=h||this._tag_stack.try_pop("head");else if(g.tag_name==="li")h=h||this._tag_stack.try_pop("li",["ol","ul"]);else if(g.tag_name==="dd"||g.tag_name==="dt")h=h||this._tag_stack.try_pop("dt",["dl"]),h=h||this._tag_stack.try_pop("dd",["dl"]);else if(g.parent.tag_name==="p"&&i.indexOf(g.tag_name)!==-1){var b=g.parent.parent;(!b||l.indexOf(b.tag_name)===-1)&&(h=h||this._tag_stack.try_pop("p"))}else g.tag_name==="rp"||g.tag_name==="rt"?(h=h||this._tag_stack.try_pop("rt",["ruby","rtc"]),h=h||this._tag_stack.try_pop("rp",["ruby","rtc"])):g.tag_name==="optgroup"?h=h||this._tag_stack.try_pop("optgroup",["select"]):g.tag_name==="option"?h=h||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):g.tag_name==="colgroup"?h=h||this._tag_stack.try_pop("caption",["table"]):g.tag_name==="thead"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"])):g.tag_name==="tbody"||g.tag_name==="tfoot"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("thead",["table"]),h=h||this._tag_stack.try_pop("tbody",["table"])):g.tag_name==="tr"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(g.tag_name==="th"||g.tag_name==="td")&&(h=h||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),h=h||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return g.parent=this._tag_stack.get_parser_token(),h},_.exports.Beautifier=a},function(_,f,d){var o=d(6).Options;function e(u){o.call(this,u,"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"])}e.prototype=new o,_.exports.Options=e},function(_,f,d){var o=d(9).Tokenizer,e=d(9).TOKEN,u=d(13).Directives,s=d(14).TemplatablePattern,t=d(12).Pattern,n={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:e.START,RAW:e.RAW,EOF:e.EOF},r=new u(/<\!--/,/-->/),E=function(m,p){o.call(this,m,p),this._current_tag_name="";var y=new s(this._input).read_options(this._options),v=new t(this._input);if(this.__patterns={word:y.until(/[\n\r\t <]/),single_quote:y.until_after(/'/),double_quote:y.until_after(/"/),attribute:y.until(/[\n\r\t =>]|\/>/),element_name:y.until(/[\n\r\t >\/]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(/<!--/).until_after(/-->/),cdata:v.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:v.starting_with(/<!\[/).until_after(/]>/),processing:v.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 a=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(a).until_after(a)}};E.prototype=new o,E.prototype._is_comment=function(m){return!1},E.prototype._is_opening=function(m){return m.type===n.TAG_OPEN},E.prototype._is_closing=function(m,p){return m.type===n.TAG_CLOSE&&p&&((m.text===">"||m.text==="/>")&&p.text[0]==="<"||m.text==="}}"&&p.text[0]==="{"&&p.text[1]==="{")},E.prototype._reset=function(){this._current_tag_name=""},E.prototype._get_next_token=function(m,p){var y=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(n.EOF,""):(y=y||this._read_open_handlebars(v,p),y=y||this._read_attribute(v,m,p),y=y||this._read_close(v,p),y=y||this._read_raw_content(v,m,p),y=y||this._read_content_word(v),y=y||this._read_comment_or_cdata(v),y=y||this._read_processing(v),y=y||this._read_open(v,p),y=y||this._create_token(n.UNKNOWN,this._input.next()),y)},E.prototype._read_comment_or_cdata=function(m){var p=null,y=null,v=null;if(m==="<"){var a=this._input.peek(1);a==="!"&&(y=this.__patterns.comment.read(),y?(v=r.get_directives(y),v&&v.ignore==="start"&&(y+=r.readIgnored(this._input))):y=this.__patterns.cdata.read()),y&&(p=this._create_token(n.COMMENT,y),p.directives=v)}return p},E.prototype._read_processing=function(m){var p=null,y=null,v=null;if(m==="<"){var a=this._input.peek(1);(a==="!"||a==="?")&&(y=this.__patterns.conditional_comment.read(),y=y||this.__patterns.processing.read()),y&&(p=this._create_token(n.COMMENT,y),p.directives=v)}return p},E.prototype._read_open=function(m,p){var y=null,v=null;return p||m==="<"&&(y=this._input.next(),this._input.peek()==="/"&&(y+=this._input.next()),y+=this.__patterns.element_name.read(),v=this._create_token(n.TAG_OPEN,y)),v},E.prototype._read_open_handlebars=function(m,p){var y=null,v=null;return p||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(y=this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars.read(),v=this._create_token(n.COMMENT,y)):(y=this.__patterns.handlebars_open.read(),v=this._create_token(n.TAG_OPEN,y))),v},E.prototype._read_close=function(m,p){var y=null,v=null;return p&&(p.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(y=this._input.next(),m==="/"&&(y+=this._input.next()),v=this._create_token(n.TAG_CLOSE,y)):p.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(n.TAG_CLOSE,"}}"))),v},E.prototype._read_attribute=function(m,p,y){var v=null,a="";if(y&&y.text[0]==="<")if(m==="=")v=this._create_token(n.EQUALS,this._input.next());else if(m==='"'||m==="'"){var c=this._input.next();m==='"'?c+=this.__patterns.double_quote.read():c+=this.__patterns.single_quote.read(),v=this._create_token(n.VALUE,c)}else a=this.__patterns.attribute.read(),a&&(p.type===n.EQUALS?v=this._create_token(n.VALUE,a):v=this._create_token(n.ATTRIBUTE,a));return v},E.prototype._is_content_unformatted=function(m){return this._options.void_elements.indexOf(m)===-1&&(this._options.content_unformatted.indexOf(m)!==-1||this._options.unformatted.indexOf(m)!==-1)},E.prototype._read_raw_content=function(m,p,y){var v="";if(y&&y.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(p.type===n.TAG_CLOSE&&p.opened.text[0]==="<"&&p.text[0]!=="/"){var a=p.opened.text.substr(1).toLowerCase();if(a==="script"||a==="style"){var c=this._read_comment_or_cdata(m);if(c)return c.type=n.TEXT,c;v=this._input.readUntil(new RegExp("</"+a+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(a)&&(v=this._input.readUntil(new RegExp("</"+a+"[\\n\\r\\t ]*?>","ig")))}return v?this._create_token(n.TEXT,v):null},E.prototype._read_content_word=function(m){var p="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(p=this.__patterns.unformatted_content_delimiter.read())),p||(p=this.__patterns.word.read()),p)return this._create_token(n.TEXT,p)},_.exports.Tokenizer=E,_.exports.TOKEN=n}],I={};function A(_){var f=I[_];if(f!==void 0)return f.exports;var d=I[_]={exports:{}};return D[_](d,d.exports,A),d.exports}var O=A(18);S=O})();var L=S;if(!0)!(fe=[B,B("6UM0"),B("TXwP")],N=function(D){var I=B("6UM0"),A=B("TXwP");return{html_beautify:function(O,_){return L(O,_,I.js_beautify,A.css_beautify)}}}.apply(Fe,fe),N!==void 0&&(Xe.exports=N));else var T,w})()},"rAM+":function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return N});var fe=B("Qw5x");function N(S,L){var T;if(typeof Symbol=="undefined"||S[Symbol.iterator]==null){if(Array.isArray(S)||(T=Object(fe.a)(S))||L&&S&&typeof S.length=="number"){T&&(S=T);var w=0,D=function(){};return{s:D,n:function(){return w>=S.length?{done:!0}:{done:!1,value:S[w++]}},e:function(f){throw f},f:D}}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 I=!0,A=!1,O;return{s:function(){T=S[Symbol.iterator]()},n:function(){var f=T.next();return I=f.done,f},e:function(f){A=!0,O=f},f:function(){try{!I&&T.return!=null&&T.return()}finally{if(A)throw O}}}}},rUJ1:function(Xe,Fe){const B=/[&<>"']/,fe=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},T=v=>L[v];function w(v,a){if(a){if(B.test(v))return v.replace(fe,T)}else if(N.test(v))return v.replace(S,T);return v}const D=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(v){return v.replace(D,(a,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const A=/(^|[^\[])\^/g;function O(v,a){v=v.source||v,a=a||"";const c={replace:(i,l)=>(l=l.source||l,l=l.replace(A,"$1"),v=v.replace(i,l),c),getRegex:()=>new RegExp(v,a)};return c}const _=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(v,a,c){if(v){let i;try{i=decodeURIComponent(I(c)).replace(_,"").toLowerCase()}catch(l){return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}a&&!f.test(c)&&(c=t(a,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(i){return null}return c}const o={},e=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(v,a){o[" "+v]||(e.test(v)?o[" "+v]=v+"/":o[" "+v]=m(v,"/",!0)),v=o[" "+v];const c=v.indexOf(":")===-1;return a.substring(0,2)==="//"?c?a:v.replace(u,"$1")+a:a.charAt(0)==="/"?c?a:v.replace(s,"$1")+a:v+a}const n={exec:function(){}};function r(v){let a=1,c,i;for(;a<arguments.length;a++){c=arguments[a];for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(v[i]=c[i])}return v}function E(v,a){const c=v.replace(/\|/g,(g,h,b)=>{let R=!1,x=h;for(;--x>=0&&b[x]==="\\";)R=!R;return R?"|":" |"}),i=c.split(/ \|/);let l=0;if(i.length>a)i.splice(a);else for(;i.length<a;)i.push("");for(;l<i.length;l++)i[l]=i[l].trim().replace(/\\\|/g,"|");return i}function m(v,a,c){const i=v.length;if(i===0)return"";let l=0;for(;l<i;){const g=v.charAt(i-l-1);if(g===a&&!c)l++;else if(g!==a&&c)l++;else break}return v.substr(0,i-l)}function p(v,a){if(v.indexOf(a[1])===-1)return-1;const c=v.length;let i=0,l=0;for(;l<c;l++)if(v[l]==="\\")l++;else if(v[l]===a[0])i++;else if(v[l]===a[1]&&(i--,i<0))return l;return-1}function y(v){v&&v.sanitize&&!v.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")}Xe.exports={escape:w,unescape:I,edit:O,cleanUrl:d,resolveUrl:t,noopTest:n,merge:r,splitCells:E,rtrim:m,findClosingBracket:p,checkSanitizeDeprecation:y}},sboe:function(Xe,Fe,B){"use strict";B.d(Fe,"a",function(){return S});var fe=B("cDcd"),N=B.n(fe),S=fe.createContext(null)},spXi:function(Xe,Fe,B){Xe.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(Xe,Fe,B){"use strict";var fe=B("VTBJ"),N=B("1OyB"),S=B("vuIU"),L=B("Ji7U"),T=B("LK+K"),w=B("cDcd"),D=B.n(w),I=B("m+aA"),A=B("Zm9Q"),O=B("Kwbf"),_=B("c+Xe"),f=B("bdgK"),d="rc-observer-key",o=function(e){Object(L.a)(s,e);var u=Object(T.a)(s);function s(){var t;return Object(N.a)(this,s),t=u.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(n){var r=t.props.onResize,E=n[0].target,m=E.getBoundingClientRect(),p=m.width,y=m.height,v=E.offsetWidth,a=E.offsetHeight,c=Math.floor(p),i=Math.floor(y);if(t.state.width!==c||t.state.height!==i||t.state.offsetWidth!==v||t.state.offsetHeight!==a){var l={width:c,height:i,offsetWidth:v,offsetHeight:a};t.setState(l),r&&Promise.resolve().then(function(){r(Object(fe.a)(Object(fe.a)({},l),{},{offsetWidth:v,offsetHeight:a}))})}},t.setChildNode=function(n){t.childNode=n},t}return Object(S.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var r=Object(I.a)(this.childNode||this),E=r!==this.currentElement;E&&(this.destroyObserver(),this.currentElement=r),!this.resizeObserver&&r&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(r))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,r=Object(A.a)(n);if(r.length>1)Object(O.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(r.length===0)return Object(O.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var E=r[0];if(w.isValidElement(E)&&Object(_.c)(E)){var m=E.ref;r[0]=w.cloneElement(E,{ref:Object(_.a)(m,this.setChildNode)})}return r.length===1?r[0]:r.map(function(p,y){return!w.isValidElement(p)||"key"in p&&p.key!==null?p:w.cloneElement(p,{key:"".concat(d,"-").concat(y)})})}}]),s}(w.Component);o.displayName="ResizeObserver",Fe.a=o},ulZh:function(Xe,Fe,B){typeof window!="undefined"&&function(N,S){Xe.exports=S()}(this,function(){return function(fe){var N={};function S(L){if(N[L])return N[L].exports;var T=N[L]={i:L,l:!1,exports:{}};return fe[L].call(T.exports,T,T.exports,S),T.l=!0,T.exports}return S.m=fe,S.c=N,S.d=function(L,T,w){S.o(L,T)||Object.defineProperty(L,T,{enumerable:!0,get:w})},S.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},S.t=function(L,T){if(T&1&&(L=S(L)),T&8)return L;if(T&4&&typeof L=="object"&&L&&L.__esModule)return L;var w=Object.create(null);if(S.r(w),Object.defineProperty(w,"default",{enumerable:!0,value:L}),T&2&&typeof L!="string")for(var D in L)S.d(w,D,function(I){return L[I]}.bind(null,D));return w},S.n=function(L){var T=L&&L.__esModule?function(){return L.default}:function(){return L};return S.d(T,"a",T),T},S.o=function(L,T){return Object.prototype.hasOwnProperty.call(L,T)},S.p="/dist/",S(S.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(fe,N,S){"use strict";var L=Object.prototype.hasOwnProperty,T="~";function w(){}Object.create&&(w.prototype=Object.create(null),new w().__proto__||(T=!1));function D(_,f,d){this.fn=_,this.context=f,this.once=d||!1}function I(_,f,d,o,e){if(typeof d!="function")throw new TypeError("The listener must be a function");var u=new D(d,o||_,e),s=T?T+f:f;return _._events[s]?_._events[s].fn?_._events[s]=[_._events[s],u]:_._events[s].push(u):(_._events[s]=u,_._eventsCount++),_}function A(_,f){--_._eventsCount===0?_._events=new w:delete _._events[f]}function O(){this._events=new w,this._eventsCount=0}O.prototype.eventNames=function(){var f=[],d,o;if(this._eventsCount===0)return f;for(o in d=this._events)L.call(d,o)&&f.push(T?o.slice(1):o);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(d)):f},O.prototype.listeners=function(f){var d=T?T+f:f,o=this._events[d];if(!o)return[];if(o.fn)return[o.fn];for(var e=0,u=o.length,s=new Array(u);e<u;e++)s[e]=o[e].fn;return s},O.prototype.listenerCount=function(f){var d=T?T+f:f,o=this._events[d];return o?o.fn?1:o.length:0},O.prototype.emit=function(f,d,o,e,u,s){var t=T?T+f:f;if(!this._events[t])return!1;var n=this._events[t],r=arguments.length,E,m;if(n.fn){n.once&&this.removeListener(f,n.fn,void 0,!0);switch(r){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,d),!0;case 3:return n.fn.call(n.context,d,o),!0;case 4:return n.fn.call(n.context,d,o,e),!0;case 5:return n.fn.call(n.context,d,o,e,u),!0;case 6:return n.fn.call(n.context,d,o,e,u,s),!0}for(m=1,E=new Array(r-1);m<r;m++)E[m-1]=arguments[m];n.fn.apply(n.context,E)}else{var p=n.length,y;for(m=0;m<p;m++){n[m].once&&this.removeListener(f,n[m].fn,void 0,!0);switch(r){case 1:n[m].fn.call(n[m].context);break;case 2:n[m].fn.call(n[m].context,d);break;case 3:n[m].fn.call(n[m].context,d,o);break;case 4:n[m].fn.call(n[m].context,d,o,e);break;default:if(!E)for(y=1,E=new Array(r-1);y<r;y++)E[y-1]=arguments[y];n[m].fn.apply(n[m].context,E)}}}return!0},O.prototype.on=function(f,d,o){return I(this,f,d,o,!1)},O.prototype.once=function(f,d,o){return I(this,f,d,o,!0)},O.prototype.removeListener=function(f,d,o,e){var u=T?T+f:f;if(!this._events[u])return this;if(!d)return A(this,u),this;var s=this._events[u];if(s.fn)s.fn===d&&(!e||s.once)&&(!o||s.context===o)&&A(this,u);else{for(var t=0,n=[],r=s.length;t<r;t++)(s[t].fn!==d||e&&!s[t].once||o&&s[t].context!==o)&&n.push(s[t]);n.length?this._events[u]=n.length===1?n[0]:n:A(this,u)}return this},O.prototype.removeAllListeners=function(f){var d;return f?(d=T?T+f:f,this._events[d]&&A(this,d)):(this._events=new w,this._eventsCount=0),this},O.prototype.off=O.prototype.removeListener,O.prototype.addListener=O.prototype.on,O.prefixed=T,O.EventEmitter=O,fe.exports=O},"./node_modules/url-toolkit/src/url-toolkit.js":function(fe,N,S){(function(L){var T=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,w=/^([^\/?#]*)([^]*)$/,D=/(?:\/|^)\.(?=\/)/g,I=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,A={buildAbsoluteURL:function(O,_,f){if(f=f||{},O=O.trim(),_=_.trim(),!_){if(!f.alwaysNormalize)return O;var d=A.parseURL(O);if(!d)throw new Error("Error trying to parse base URL.");return d.path=A.normalizePath(d.path),A.buildURLFromParts(d)}var o=A.parseURL(_);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return f.alwaysNormalize?(o.path=A.normalizePath(o.path),A.buildURLFromParts(o)):_;var e=A.parseURL(O);if(!e)throw new Error("Error trying to parse base URL.");if(!e.netLoc&&e.path&&e.path[0]!=="/"){var u=w.exec(e.path);e.netLoc=u[1],e.path=u[2]}e.netLoc&&!e.path&&(e.path="/");var s={scheme:e.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(s.netLoc=e.netLoc,o.path[0]!=="/"))if(!o.path)s.path=e.path,o.params||(s.params=e.params,o.query||(s.query=e.query));else{var t=e.path,n=t.substring(0,t.lastIndexOf("/")+1)+o.path;s.path=A.normalizePath(n)}return s.path===null&&(s.path=f.alwaysNormalize?A.normalizePath(o.path):o.path),A.buildURLFromParts(s)},parseURL:function(O){var _=T.exec(O);return _?{scheme:_[1]||"",netLoc:_[2]||"",path:_[3]||"",params:_[4]||"",query:_[5]||"",fragment:_[6]||""}:null},normalizePath:function(O){for(O=O.split("").reverse().join("").replace(D,"");O.length!==(O=O.replace(I,"")).length;);return O.split("").reverse().join("")},buildURLFromParts:function(O){return O.scheme+O.netLoc+O.path+O.params+O.query+O.fragment}};fe.exports=A})(this)},"./node_modules/webworkify-webpack/index.js":function(fe,N,S){function L(f){var d={};function o(u){if(d[u])return d[u].exports;var s=d[u]={i:u,l:!1,exports:{}};return f[u].call(s.exports,s,s.exports,o),s.l=!0,s.exports}o.m=f,o.c=d,o.i=function(u){return u},o.d=function(u,s,t){o.o(u,s)||Object.defineProperty(u,s,{configurable:!1,enumerable:!0,get:t})},o.r=function(u){Object.defineProperty(u,"__esModule",{value:!0})},o.n=function(u){var s=u&&u.__esModule?function(){return u.default}:function(){return u};return o.d(s,"a",s),s},o.o=function(u,s){return Object.prototype.hasOwnProperty.call(u,s)},o.p="/",o.oe=function(u){throw console.error(u),u};var e=o(o.s=ENTRY_MODULE);return e.default||e}var T="[\\.|\\-|\\+|\\w|/|@]+",w="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+T+").*?\\)";function D(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function I(f){return!isNaN(1*f)}function A(f,d,o){var e={};e[o]=[];var u=d.toString(),s=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return e;for(var t=s[1],n=new RegExp("(\\\\n|\\W)"+D(t)+w,"g"),r;r=n.exec(u);){if(r[3]==="dll-reference")continue;e[o].push(r[3])}for(n=new RegExp("\\("+D(t)+'\\("(dll-reference\\s('+T+'))"\\)\\)'+w,"g");r=n.exec(u);)f[r[2]]||(e[o].push(r[1]),f[r[2]]=S(r[1]).m),e[r[2]]=e[r[2]]||[],e[r[2]].push(r[4]);for(var E=Object.keys(e),m=0;m<E.length;m++)for(var p=0;p<e[E[m]].length;p++)I(e[E[m]][p])&&(e[E[m]][p]=1*e[E[m]][p]);return e}function O(f){var d=Object.keys(f);return d.reduce(function(o,e){return o||f[e].length>0},!1)}function _(f,d){for(var o={main:[d]},e={main:[]},u={main:{}};O(o);)for(var s=Object.keys(o),t=0;t<s.length;t++){var n=s[t],r=o[n],E=r.pop();if(u[n]=u[n]||{},u[n][E]||!f[n][E])continue;u[n][E]=!0,e[n]=e[n]||[],e[n].push(E);for(var m=A(f,f[n][E],n),p=Object.keys(m),y=0;y<p.length;y++)o[p[y]]=o[p[y]]||[],o[p[y]]=o[p[y]].concat(m[p[y]])}return e}fe.exports=function(f,d){d=d||{};var o={main:S.m},e=d.all?{main:Object.keys(o.main)}:_(o,f),u="";Object.keys(e).filter(function(E){return E!=="main"}).forEach(function(E){for(var m=0;e[E][m];)m++;e[E].push(m),o[E][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+"var "+E+" = ("+L.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+e[E].map(function(p){return""+JSON.stringify(p)+": "+o[E][p].toString()}).join(",")+`});
`}),u=u+"new (("+L.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+e.main.map(function(E){return""+JSON.stringify(E)+": "+o.main[E].toString()}).join(",")+"}))(self);";var s=new window.Blob([u],{type:"text/javascript"});if(d.bare)return s;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,n=t.createObjectURL(s),r=new window.Worker(n);return r.objectURL=n,r}},"./src/config.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"hlsDefaultConfig",function(){return y}),S.d(N,"mergeConfig",function(){return a}),S.d(N,"enableStreamingMode",function(){return c});var L=S("./src/controller/abr-controller.ts"),T=S("./src/controller/audio-stream-controller.ts"),w=S("./src/controller/audio-track-controller.ts"),D=S("./src/controller/subtitle-stream-controller.ts"),I=S("./src/controller/subtitle-track-controller.ts"),A=S("./src/controller/buffer-controller.ts"),O=S("./src/controller/timeline-controller.ts"),_=S("./src/controller/cap-level-controller.ts"),f=S("./src/controller/fps-controller.ts"),d=S("./src/controller/eme-controller.ts"),o=S("./src/controller/cmcd-controller.ts"),e=S("./src/utils/xhr-loader.ts"),u=S("./src/utils/fetch-loader.ts"),s=S("./src/utils/cues.ts"),t=S("./src/utils/mediakeys-helper.ts"),n=S("./src/utils/logger.ts");function r(){return r=Object.assign||function(i){for(var l=1;l<arguments.length;l++){var g=arguments[l];for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(i[h]=g[h])}return i},r.apply(this,arguments)}function E(i,l){var g=Object.keys(i);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(i);l&&(h=h.filter(function(b){return Object.getOwnPropertyDescriptor(i,b).enumerable})),g.push.apply(g,h)}return g}function m(i){for(var l=1;l<arguments.length;l++){var g=arguments[l]!=null?arguments[l]:{};l%2?E(Object(g),!0).forEach(function(h){p(i,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(g)):E(Object(g)).forEach(function(h){Object.defineProperty(i,h,Object.getOwnPropertyDescriptor(g,h))})}return i}function p(i,l,g){return l in i?Object.defineProperty(i,l,{value:g,enumerable:!0,configurable:!0,writable:!0}):i[l]=g,i}var y=m(m({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:e.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:L.default,bufferController:A.default,capLevelController:_.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},v()),{},{subtitleStreamController:D.SubtitleStreamController,subtitleTrackController:I.default,timelineController:O.TimelineController,audioStreamController:T.default,audioTrackController:w.default,emeController:d.default,cmcdController:o.default});function v(){return{cueHandler:s.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 a(i,l){if((l.liveSyncDurationCount||l.liveMaxLatencyDurationCount)&&(l.liveSyncDuration||l.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(l.liveMaxLatencyDurationCount!==void 0&&(l.liveSyncDurationCount===void 0||l.liveMaxLatencyDurationCount<=l.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(l.liveMaxLatencyDuration!==void 0&&(l.liveSyncDuration===void 0||l.liveMaxLatencyDuration<=l.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return r({},i,l)}function c(i){var l=i.loader;if(l!==u.default&&l!==e.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),i.progressive=!1;else{var g=Object(u.fetchSupported)();g&&(i.loader=u.default,i.progressive=!0,i.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/polyfills/number.ts"),T=S("./src/utils/ewma-bandwidth-estimator.ts"),w=S("./src/events.ts"),D=S("./src/utils/buffer-helper.ts"),I=S("./src/errors.ts"),A=S("./src/types/loader.ts"),O=S("./src/utils/logger.ts");function _(o,e){for(var u=0;u<e.length;u++){var s=e[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function f(o,e,u){return e&&_(o.prototype,e),u&&_(o,u),o}var d=function(){function o(u){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=u;var s=u.config;this.bwEstimator=new T.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var e=o.prototype;return e.registerListeners=function(){var s=this.hls;s.on(w.Events.FRAG_LOADING,this.onFragLoading,this),s.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(w.Events.ERROR,this.onError,this)},e.unregisterListeners=function(){var s=this.hls;s.off(w.Events.FRAG_LOADING,this.onFragLoading,this),s.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(w.Events.ERROR,this.onError,this)},e.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},e.onFragLoading=function(s,t){var n=t.frag;if(n.type===A.PlaylistLevelType.MAIN&&!this.timer){var r;this.fragCurrent=n,this.partCurrent=(r=t.part)!=null?r:null,this.timer=self.setInterval(this.onCheck,100)}},e.onLevelLoaded=function(s,t){var n=this.hls.config;t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},e._abandonRulesCheck=function(){var s=this.fragCurrent,t=this.partCurrent,n=this.hls,r=n.autoLevelEnabled,E=n.config,m=n.media;if(!s||!m)return;var p=t?t.stats:s.stats,y=t?t.duration:s.duration;if(p.aborted){O.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||m.paused||!m.playbackRate||!m.readyState)return;var v=performance.now()-p.loading.start,a=Math.abs(m.playbackRate);if(v<=500*y/a)return;var c=n.levels,i=n.minAutoLevel,l=c[s.level],g=p.total||Math.max(p.loaded,Math.round(y*l.maxBitrate/8)),h=Math.max(1,p.bwEstimate?p.bwEstimate/8:p.loaded*1e3/v),b=(g-p.loaded)/h,R=m.currentTime,x=(D.BufferHelper.bufferInfo(m,R,E.maxBufferHole).end-R)/a;if(x>=2*y/a||b<=x)return;var P=Number.POSITIVE_INFINITY,M;for(M=s.level-1;M>i;M--){var k=c[M].maxBitrate;if(P=y*k/(8*.8*h),P<x)break}if(P>=b)return;var C=this.bwEstimator.getEstimate();O.logger.warn("Fragment "+s.sn+(t?" part "+t.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
Current BW estimate: `+(Object(L.isFiniteNumber)(C)?(C/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+P.toFixed(3)+` s
Time to underbuffer: `+x.toFixed(3)+" s"),n.nextLoadLevel=M,this.bwEstimator.sample(v,p.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),n.trigger(w.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:t,stats:p})},e.onFragLoaded=function(s,t){var n=t.frag,r=t.part;if(n.type===A.PlaylistLevelType.MAIN&&Object(L.isFiniteNumber)(n.sn)){var E=r?r.stats:n.stats,m=r?r.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var p=this.hls.levels[n.level],y=(p.loaded?p.loaded.bytes:0)+E.loaded,v=(p.loaded?p.loaded.duration:0)+m;p.loaded={bytes:y,duration:v},p.realBitrate=Math.round(8*y/v)}if(n.bitrateTest){var a={stats:E,frag:n,part:r,id:n.type};this.onFragBuffered(w.Events.FRAG_BUFFERED,a),n.bitrateTest=!1}}},e.onFragBuffered=function(s,t){var n=t.frag,r=t.part,E=r?r.stats:n.stats;if(E.aborted)return;if(n.type!==A.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var m=E.parsing.end-E.loading.start;this.bwEstimator.sample(m,E.loaded),E.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},e.onError=function(s,t){switch(t.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},e.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},e.getNextABRAutoLevel=function(){var s=this.fragCurrent,t=this.partCurrent,n=this.hls,r=n.maxAutoLevel,E=n.config,m=n.minAutoLevel,p=n.media,y=t?t.duration:s?s.duration:0,v=p?p.currentTime:0,a=p&&p.playbackRate!==0?Math.abs(p.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():E.abrEwmaDefaultEstimate,i=(D.BufferHelper.bufferInfo(p,v,E.maxBufferHole).end-v)/a,l=this.findBestLevel(c,m,r,i,E.abrBandWidthFactor,E.abrBandWidthUpFactor);if(l>=0)return l;O.logger.trace((i?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=y?Math.min(y,E.maxStarvationDelay):E.maxStarvationDelay,h=E.abrBandWidthFactor,b=E.abrBandWidthUpFactor;if(!i){var R=this.bitrateTestDelay;if(R){var x=y?Math.min(y,E.maxLoadingDelay):E.maxLoadingDelay;g=x-R,O.logger.trace("bitrate test took "+Math.round(1e3*R)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),h=b=1}}return l=this.findBestLevel(c,m,r,i+g,h,b),Math.max(l,0)},e.findBestLevel=function(s,t,n,r,E,m){for(var p,y=this.fragCurrent,v=this.partCurrent,a=this.lastLoadedFragLevel,c=this.hls.levels,i=c[a],l=!!(i!=null&&(p=i.details)!==null&&p!==void 0&&p.live),g=i==null?void 0:i.codecSet,h=v?v.duration:y?y.duration:0,b=n;b>=t;b--){var R=c[b];if(!R||g&&R.codecSet!==g)continue;var x=R.details,P=(v?x==null?void 0:x.partTarget:x==null?void 0:x.averagetargetduration)||h,M=void 0;b<=a?M=E*s:M=m*s;var k=c[b].maxBitrate,C=k*P/M;if(O.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(M)+"/"+k+"/"+P+"/"+r+"/"+C),M>k&&(!C||l&&!this.bitrateTestDelay||C<r))return b}return-1},f(o,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,t=this.bwEstimator;if(s!==-1&&(!t||!t.canEstimate()))return s;var n=this.getNextABRAutoLevel();return s!==-1&&(n=Math.min(s,n)),n},set:function(s){this._nextAutoLevel=s}}]),o}();N.default=d},"./src/controller/audio-stream-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),w=S("./src/events.ts"),D=S("./src/utils/buffer-helper.ts"),I=S("./src/controller/fragment-tracker.ts"),A=S("./src/types/level.ts"),O=S("./src/types/loader.ts"),_=S("./src/loader/fragment.ts"),f=S("./src/demux/chunk-cache.ts"),d=S("./src/demux/transmuxer-interface.ts"),o=S("./src/types/transmuxer.ts"),e=S("./src/controller/fragment-finders.ts"),u=S("./src/utils/discontinuities.ts"),s=S("./src/errors.ts"),t=S("./src/utils/logger.ts");function n(){return n=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var a=arguments[v];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(y[c]=a[c])}return y},n.apply(this,arguments)}function r(y,v){y.prototype=Object.create(v.prototype),y.prototype.constructor=y,E(y,v)}function E(y,v){return E=Object.setPrototypeOf||function(c,i){return c.__proto__=i,c},E(y,v)}var m=100,p=function(y){r(v,y);function v(c,i){var l;return l=y.call(this,c,i,"[audio-stream-controller]")||this,l.videoBuffer=null,l.videoTrackCC=-1,l.waitingVideoCC=-1,l.audioSwitch=!1,l.trackId=-1,l.waitingData=null,l.mainDetails=null,l.bufferFlushed=!1,l._registerListeners(),l}var a=v.prototype;return a.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},a._registerListeners=function(){var i=this.hls;i.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(w.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),i.on(w.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),i.on(w.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(w.Events.ERROR,this.onError,this),i.on(w.Events.BUFFER_RESET,this.onBufferReset,this),i.on(w.Events.BUFFER_CREATED,this.onBufferCreated,this),i.on(w.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),i.on(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(w.Events.FRAG_BUFFERED,this.onFragBuffered,this)},a._unregisterListeners=function(){var i=this.hls;i.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(w.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),i.off(w.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),i.off(w.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(w.Events.ERROR,this.onError,this),i.off(w.Events.BUFFER_RESET,this.onBufferReset,this),i.off(w.Events.BUFFER_CREATED,this.onBufferCreated,this),i.off(w.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),i.off(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(w.Events.FRAG_BUFFERED,this.onFragBuffered,this)},a.onInitPtsFound=function(i,l){var g=l.frag,h=l.id,b=l.initPTS;if(h==="main"){var R=g.cc;this.initPTS[g.cc]=b,this.log("InitPTS for cc: "+R+" found from main: "+b),this.videoTrackCC=R,this.state===T.State.WAITING_INIT_PTS&&this.tick()}},a.startLoad=function(i){if(!this.levels){this.startPosition=i,this.state=T.State.STOPPED;return}var l=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,l>0&&i===-1?(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),this.state=T.State.IDLE):(this.loadedmetadata=!1,this.state=T.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=i,this.tick()},a.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_TRACK:{var i,l=this.levels,g=this.trackId,h=l==null||((i=l[g])===null||i===void 0)?void 0:i.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=T.State.WAITING_INIT_PTS}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var b,R=performance.now(),x=this.retryDate;(!x||R>=x||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=T.State.IDLE);break}case T.State.WAITING_INIT_PTS:{var P=this.waitingData;if(P){var M=P.frag,k=P.part,C=P.cache,U=P.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.FRAG_LOADING;var K=C.flush(),ee={frag:M,part:k,payload:K,networkDetails:null};this._handleFragmentLoadProgress(ee),U&&y.prototype._handleFragmentLoadComplete.call(this,ee)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var z=this.getLoadPosition(),ae=D.BufferHelper.bufferInfo(this.mediaBuffer,z,this.config.maxBufferHole),se=Object(e.fragmentWithinToleranceTest)(ae.end,this.config.maxFragLookUpTolerance,M);se<0&&(t.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+ae.end+" is needed"),this.clearWaitingFragment())}}else this.state=T.State.IDLE}}this.onTickEnd()},a.clearWaitingFragment=function(){var i=this.waitingData;i&&(this.fragmentTracker.removeFragment(i.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.IDLE)},a.onTickEnd=function(){var i=this.media;if(!i||!i.readyState)return;var l=this.mediaBuffer?this.mediaBuffer:i,g=l.buffered;!this.loadedmetadata&&g.length&&(this.loadedmetadata=!0),this.lastCurrentTime=i.currentTime},a.doTickIdle=function(){var i,l,g=this.hls,h=this.levels,b=this.media,R=this.trackId,x=g.config;if(!h||!h[R])return;if(!b&&(this.startFragRequested||!x.startFragPrefetch))return;var P=h[R],M=P.details;if(!M||M.live&&this.levelLastLoaded!==R||this.waitForCdnTuneIn(M)){this.state=T.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,_.ElementaryStreamTypes.AUDIO,O.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,O.PlaylistLevelType.AUDIO);if(k===null)return;var C=k.len,U=this.getMaxBufferLength(),K=this.audioSwitch;if(C>=U&&!K)return;if(!K&&this._streamEnded(k,M)){g.trigger(w.Events.BUFFER_EOS,{type:"audio"}),this.state=T.State.ENDED;return}var ee=M.fragments,z=ee[0].start,ae=k.end;if(K){var se=this.getLoadPosition();ae=se,M.PTSKnown&&se<z&&((k.end>z||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=z+.05))}var V=this.getNextFragment(ae,M);if(!V){this.bufferFlushed=!0;return}((i=V.decryptdata)===null||i===void 0?void 0:i.keyFormat)==="identity"&&!((l=V.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(V,M):this.loadFragment(V,M,ae)},a.getMaxBufferLength=function(){var i=y.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,O.PlaylistLevelType.MAIN);return l===null?i:Math.max(i,l.len)},a.onMediaDetaching=function(){this.videoBuffer=null,y.prototype.onMediaDetaching.call(this)},a.onAudioTracksUpdated=function(i,l){var g=l.audioTracks;this.resetTransmuxer(),this.levels=g.map(function(h){return new A.Level(h)})},a.onAudioTrackSwitching=function(i,l){var g=!!l.url;this.trackId=l.id;var h=this.fragCurrent;h!=null&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),g?this.setInterval(m):this.resetTransmuxer(),g?(this.audioSwitch=!0,this.state=T.State.IDLE):this.state=T.State.STOPPED,this.tick()},a.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},a.onLevelLoaded=function(i,l){this.mainDetails=l.details},a.onAudioTrackLoaded=function(i,l){var g,h=this.levels,b=l.details,R=l.id;if(!h){this.warn("Audio tracks were reset while loading level "+R);return}this.log("Track "+R+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var x=h[R],P=0;if(b.live||(g=x.details)!==null&&g!==void 0&&g.live){var M=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!M)return;!x.details&&b.hasProgramDateTime&&M.hasProgramDateTime?(Object(u.alignMediaPlaylistByPDT)(b,M),P=b.fragments[0].start):P=this.alignPlaylists(b,x.details)}x.details=b,this.levelLastLoaded=R,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(x.details,P),this.state===T.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=T.State.IDLE),this.tick()},a._handleFragmentLoadProgress=function(i){var l,g=i.frag,h=i.part,b=i.payload,R=this.config,x=this.trackId,P=this.levels;if(!P){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var M=P[x];console.assert(M,"Audio track is defined on fragment load progress");var k=M.details;console.assert(k,"Audio track details are defined on fragment load progress");var C=R.defaultAudioCodec||M.audioCodec||"mp4a.40.2",U=this.transmuxer;U||(U=this.transmuxer=new d.default(this.hls,O.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var K=this.initPTS[g.cc],ee=(l=g.initSegment)===null||l===void 0?void 0:l.data;if(K!==void 0){var z=!1,ae=h?h.index:-1,se=ae!==-1,V=new o.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,b.byteLength,ae,se);U.push(b,ee,C,"",g,h,k.totalduration,z,V,K)}else{t.logger.log("Unknown video PTS for cc "+g.cc+", waiting for video PTS before demuxing audio frag "+g.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+x);var Y=this.waitingData=this.waitingData||{frag:g,part:h,cache:new f.default,complete:!1},q=Y.cache;q.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=T.State.WAITING_INIT_PTS}},a._handleFragmentLoadComplete=function(i){if(this.waitingData){this.waitingData.complete=!0;return}y.prototype._handleFragmentLoadComplete.call(this,i)},a.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},a.onBufferCreated=function(i,l){var g=l.tracks.audio;g&&(this.mediaBuffer=g.buffer),l.tracks.video&&(this.videoBuffer=l.tracks.video.buffer)},a.onFragBuffered=function(i,l){var g=l.frag,h=l.part;if(g.type!==O.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(h?" p: "+h.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}g.sn!=="initSegment"&&(this.fragPrevious=g,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(g,h)},a.onError=function(i,l){switch(l.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(O.PlaylistLevelType.AUDIO,l);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==T.State.ERROR&&this.state!==T.State.STOPPED&&(this.state=l.fatal?T.State.ERROR:T.State.IDLE,this.warn(l.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="audio"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var g=!0,h=this.getFwdBufferInfo(this.mediaBuffer,O.PlaylistLevelType.AUDIO);h&&h.len>.5&&(g=!this.reduceMaxBufferLength(h.len)),g&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,y.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},a.onBufferFlushed=function(i,l){var g=l.type;g===_.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},a._handleTransmuxComplete=function(i){var l,g="audio",h=this.hls,b=i.remuxResult,R=i.chunkMeta,x=this.getCurrentContext(R);if(!x){this.warn("The loading context changed while buffering fragment "+R.sn+" of level "+R.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(R.level);return}var P=x.frag,M=x.part,k=b.audio,C=b.text,U=b.id3,K=b.initSegment;if(this.fragContextChanged(P))return;if(this.state=T.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),K!=null&&K.tracks&&(this._bufferInitSegment(K.tracks,P,R),h.trigger(w.Events.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:g,tracks:K.tracks})),k){var ee=k.startPTS,z=k.endPTS,ae=k.startDTS,se=k.endDTS;M&&(M.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:ee,endPTS:z,startDTS:ae,endDTS:se}),P.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,ee,z,ae,se),this.bufferFragmentData(k,P,M,R)}if(U!=null&&(l=U.samples)!==null&&l!==void 0&&l.length){var V=n({frag:P,id:g},U);h.trigger(w.Events.FRAG_PARSING_METADATA,V)}if(C){var Y=n({frag:P,id:g},C);h.trigger(w.Events.FRAG_PARSING_USERDATA,Y)}},a._bufferInitSegment=function(i,l,g){if(this.state!==T.State.PARSING)return;i.video&&delete i.video;var h=i.audio;if(!h)return;h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(w.Events.BUFFER_CODECS,i);var b=h.initSegment;if(b!=null&&b.byteLength){var R={type:"audio",frag:l,part:null,chunkMeta:g,parent:l.type,data:b};this.hls.trigger(w.Events.BUFFER_APPENDING,R)}this.tick()},a.loadFragment=function(i,l,g){var h=this.fragmentTracker.getState(i);this.fragCurrent=i,(this.audioSwitch||h===I.FragmentState.NOT_LOADED||h===I.FragmentState.PARTIAL)&&(i.sn==="initSegment"?this._loadInitSegment(i):l.live&&!Object(L.isFiniteNumber)(this.initPTS[i.cc])?(this.log("Waiting for video PTS in continuity counter "+i.cc+" of live stream before loading audio fragment "+i.sn+" of level "+this.trackId),this.state=T.State.WAITING_INIT_PTS):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,i,l,g)))},a.completeAudioSwitch=function(){var i=this.hls,l=this.media,g=this.trackId;l&&(this.log("Switching audio track : flushing all audio"),y.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,i.trigger(w.Events.AUDIO_TRACK_SWITCHED,{id:g})},v}(T.default);N.default=p},"./src/controller/audio-track-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/events.ts"),T=S("./src/errors.ts"),w=S("./src/controller/base-playlist-controller.ts"),D=S("./src/types/loader.ts");function I(d,o){for(var e=0;e<o.length;e++){var u=o[e];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function A(d,o,e){return o&&I(d.prototype,o),e&&I(d,e),d}function O(d,o){d.prototype=Object.create(o.prototype),d.prototype.constructor=d,_(d,o)}function _(d,o){return _=Object.setPrototypeOf||function(u,s){return u.__proto__=s,u},_(d,o)}var f=function(d){O(o,d);function o(u){var s;return s=d.call(this,u,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var e=o.prototype;return e.registerListeners=function(){var s=this.hls;s.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(L.Events.ERROR,this.onError,this)},e.unregisterListeners=function(){var s=this.hls;s.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(L.Events.ERROR,this.onError,this)},e.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,d.prototype.destroy.call(this)},e.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},e.onManifestParsed=function(s,t){this.tracks=t.audioTracks||[]},e.onAudioTrackLoaded=function(s,t){var n=t.id,r=t.details,E=this.tracksInGroup[n];if(!E){this.warn("Invalid audio track id "+n);return}var m=E.details;E.details=t.details,this.log("audioTrack "+n+" loaded ["+r.startSN+"-"+r.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,t,m))},e.onLevelLoading=function(s,t){this.switchLevel(t.level)},e.onLevelSwitching=function(s,t){this.switchLevel(t.level)},e.switchLevel=function(s){var t=this.hls.levels[s];if(!(t!=null&&t.audioGroupIds))return;var n=t.audioGroupIds[t.urlId];if(this.groupId!==n){this.groupId=n;var r=this.tracks.filter(function(m){return!n||m.groupId===n});this.selectDefaultTrack&&!r.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;var E={audioTracks:r};this.log("Updating audio tracks, "+r.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(L.Events.AUDIO_TRACKS_UPDATED,E),this.selectInitialTrack()}},e.onError=function(s,t){if(d.prototype.onError.call(this,s,t),t.fatal||!t.context)return;t.context.type===D.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},e.setAudioTrack=function(s){var t=this.tracksInGroup;if(s<0||s>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=t[this.trackId];this.log("Now switching to audio-track index "+s);var r=t[s],E=r.id,m=r.groupId,p=m===void 0?"":m,y=r.name,v=r.type,a=r.url;if(this.trackId=s,this.trackName=y,this.selectDefaultTrack=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHING,{id:E,groupId:p,name:y,type:v,url:a}),r.details&&!r.details.live)return;var c=this.switchParams(r.url,n==null?void 0:n.details);this.loadPlaylist(c)},e.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,n=this.findTrackId(t)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},e.findTrackId=function(s){for(var t=this.tracksInGroup,n=0;n<t.length;n++){var r=t[n];if((!this.selectDefaultTrack||r.default)&&(!s||s===r.name))return r.id}return-1},e.loadPlaylist=function(s){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var n=t.id,r=t.groupId,E=t.url;if(s)try{E=s.addDirectives(E)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(L.Events.AUDIO_TRACK_LOADING,{url:E,id:n,groupId:r,deliveryDirectives:s||null})}},A(o,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),o}(w.default);N.default=f},"./src/controller/base-playlist-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return A});var L=S("./src/polyfills/number.ts"),T=S("./src/types/level.ts"),w=S("./src/controller/level-helper.ts"),D=S("./src/utils/logger.ts"),I=S("./src/errors.ts"),A=function(){function O(f,d){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=D.logger.log.bind(D.logger,d+":"),this.warn=D.logger.warn.bind(D.logger,d+":"),this.hls=f}var _=O.prototype;return _.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},_.onError=function(d,o){o.fatal&&o.type===I.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},_.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},_.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},_.stopLoad=function(){this.canLoad=!1,this.clearTimer()},_.switchParams=function(d,o){var e=o==null?void 0:o.renditionReports;if(e)for(var u=0;u<e.length;u++){var s=e[u],t=""+s.URI;if(t===d.substr(-t.length)){var n=parseInt(s["LAST-MSN"]),r=parseInt(s["LAST-PART"]);if(o&&this.hls.config.lowLatencyMode){var E=Math.min(o.age-o.partTarget,o.targetduration);r!==void 0&&E>o.partTarget&&(r+=1)}if(Object(L.isFiniteNumber)(n))return new T.HlsUrlParameters(n,Object(L.isFiniteNumber)(r)?r:void 0,T.HlsSkip.No)}}},_.loadPlaylist=function(d){},_.shouldLoadTrack=function(d){return this.canLoad&&d&&!!d.url&&(!d.details||d.details.live)},_.playlistLoaded=function(d,o,e){var u=this,s=o.details,t=o.stats,n=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(s.advancedDateTime=Date.now()-n,s.live||e!=null&&e.live){if(s.reloaded(e),e&&this.log("live playlist "+d+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),e&&s.fragments.length>0&&Object(w.mergeDetails)(e,s),!this.canLoad||!s.live)return;var r,E=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var p=this.hls.config.lowLatencyMode,y=s.lastPartSn,v=s.endSN,a=s.lastPartIndex,c=a!==-1,i=y===v,l=p?0:a;c?(E=i?v+1:y,m=i?l:a+1):E=v+1;var g=s.age,h=g+s.ageHeader,b=Math.min(h-s.partTarget,s.targetduration*1.5);if(b>0){if(e&&b>e.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+e.tuneInGoal+" to: "+b+" with playlist age: "+s.age),b=0;else{var R=Math.floor(b/s.targetduration);if(E+=R,m!==void 0){var x=Math.round(b%s.targetduration/s.partTarget);m+=x}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+b+" skip sn "+R+" to part "+m)}s.tuneInGoal=b}if(r=this.getDeliveryDirectives(s,o.deliveryDirectives,E,m),p||!i){this.loadPlaylist(r);return}}else r=this.getDeliveryDirectives(s,o.deliveryDirectives,E,m);var P=Object(w.computeReloadInterval)(s,t);E!==void 0&&s.canBlockReload&&(P-=s.partTarget||1),this.log("reload live playlist "+d+" in "+Math.round(P)+" ms"),this.timer=self.setTimeout(function(){return u.loadPlaylist(r)},P)}else this.clearTimer()},_.getDeliveryDirectives=function(d,o,e,u){var s=Object(T.getSkipValue)(d,e);return o!=null&&o.skip&&d.deltaUpdateFailed&&(e=o.msn,u=o.part,s=T.HlsSkip.No),new T.HlsUrlParameters(e,u,s)},_.retryLoadingOrFail=function(d){var o=this,e=this.hls.config,u=this.retryCount<e.levelLoadingMaxRetry;if(u){var s;if(this.retryCount++,d.details.indexOf("LoadTimeOut")>-1&&(s=d.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+d.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*e.levelLoadingRetryDelay,e.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return o.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+d.details+'"')}}else this.warn('cannot recover from error "'+d.details+'"'),this.clearTimer(),d.fatal=!0;return u},O}()},"./src/controller/base-stream-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"State",function(){return v}),S.d(N,"default",function(){return a});var L=S("./src/polyfills/number.ts"),T=S("./src/task-loop.ts"),w=S("./src/controller/fragment-tracker.ts"),D=S("./src/utils/buffer-helper.ts"),I=S("./src/utils/logger.ts"),A=S("./src/events.ts"),O=S("./src/errors.ts"),_=S("./src/types/transmuxer.ts"),f=S("./src/utils/mp4-tools.ts"),d=S("./src/utils/discontinuities.ts"),o=S("./src/controller/fragment-finders.ts"),e=S("./src/controller/level-helper.ts"),u=S("./src/loader/fragment-loader.ts"),s=S("./src/crypt/decrypter.ts"),t=S("./src/utils/time-ranges.ts"),n=S("./src/types/loader.ts");function r(c,i){for(var l=0;l<i.length;l++){var g=i[l];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}function E(c,i,l){return i&&r(c.prototype,i),l&&r(c,l),c}function m(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function p(c,i){c.prototype=Object.create(i.prototype),c.prototype.constructor=c,y(c,i)}function y(c,i){return y=Object.setPrototypeOf||function(g,h){return g.__proto__=h,g},y(c,i)}var v={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"},a=function(c){p(i,c);function i(g,h,b){var R;return R=c.call(this)||this,R.hls=void 0,R.fragPrevious=null,R.fragCurrent=null,R.fragmentTracker=void 0,R.transmuxer=null,R._state=v.STOPPED,R.media=void 0,R.mediaBuffer=void 0,R.config=void 0,R.bitrateTest=!1,R.lastCurrentTime=0,R.nextLoadPosition=0,R.startPosition=0,R.loadedmetadata=!1,R.fragLoadError=0,R.retryDate=0,R.levels=null,R.fragmentLoader=void 0,R.levelLastLoaded=null,R.startFragRequested=!1,R.decrypter=void 0,R.initPTS=[],R.onvseeking=null,R.onvended=null,R.logPrefix="",R.log=void 0,R.warn=void 0,R.logPrefix=b,R.log=I.logger.log.bind(I.logger,b+":"),R.warn=I.logger.warn.bind(I.logger,b+":"),R.hls=g,R.fragmentLoader=new u.default(g.config),R.fragmentTracker=h,R.config=g.config,R.decrypter=new s.default(g,g.config),g.on(A.Events.KEY_LOADED,R.onKeyLoaded,m(R)),R}var l=i.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(h){},l.stopLoad=function(){this.fragmentLoader.abort();var h=this.fragCurrent;h&&this.fragmentTracker.removeFragment(h),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},l._streamEnded=function(h,b){var R=this.fragCurrent,x=this.fragmentTracker;if(!b.live&&R&&R.sn===b.endSN&&!h.nextStart){var P=x.getState(R);return P===w.FragmentState.PARTIAL||P===w.FragmentState.OK}return!1},l.onMediaAttached=function(h,b){var R=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),R.addEventListener("seeking",this.onvseeking),R.addEventListener("ended",this.onvended);var x=this.config;this.levels&&x.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(x.startPosition)},l.onMediaDetaching=function(){var h=this.media;h!=null&&h.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),h&&(h.removeEventListener("seeking",this.onvseeking),h.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},l.onMediaSeeking=function(){var h=this.config,b=this.fragCurrent,R=this.media,x=this.mediaBuffer,P=this.state,M=R?R.currentTime:0,k=D.BufferHelper.bufferInfo(x||R,M,h.maxBufferHole);if(this.log("media seeking to "+(Object(L.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+P),P===v.ENDED)this.resetLoadingState();else if(b&&!k.len){var C=h.maxFragLookUpTolerance,U=b.start-C,K=b.start+b.duration+C,ee=M>K;(M<U||ee)&&(ee&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}R&&(this.lastCurrentTime=M),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(h,b){if(this.state!==v.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var R=this.levels[b.frag.level].details;R&&this.loadFragment(b.frag,R,b.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},l.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(A.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,c.prototype.onHandlerDestroyed.call(this)},l.loadKey=function(h,b){this.log("Loading key for "+h.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level),this.state=v.KEY_LOADING,this.fragCurrent=h,this.hls.trigger(A.Events.KEY_LOADING,{frag:h})},l.loadFragment=function(h,b,R){this._loadFragForPlayback(h,b,R)},l._loadFragForPlayback=function(h,b,R){var x=this,P=function(k){if(x.fragContextChanged(h)){x.warn("Fragment "+h.sn+(k.part?" p: "+k.part.index:"")+" of level "+h.level+" was dropped during download."),x.fragmentTracker.removeFragment(h);return}h.stats.chunkCount++,x._handleFragmentLoadProgress(k)};this._doFragLoad(h,b,R,P).then(function(M){if(!M)return;x.fragLoadError=0;var k=x.state;if(x.fragContextChanged(h)){(k===v.FRAG_LOADING||k===v.BACKTRACKING||!x.fragCurrent&&k===v.PARSING)&&(x.fragmentTracker.removeFragment(h),x.state=v.IDLE);return}if("payload"in M&&(x.log("Loaded fragment "+h.sn+" of level "+h.level),x.hls.trigger(A.Events.FRAG_LOADED,M),x.state===v.BACKTRACKING)){x.fragmentTracker.backtrack(h,M),x.resetFragmentLoading(h);return}x._handleFragmentLoadComplete(M)}).catch(function(M){x.warn(M),x.resetFragmentLoading(h)})},l.flushMainBuffer=function(h,b,R){if(R===void 0&&(R=null),!(h-b))return;var x={startOffset:h,endOffset:b,type:R};this.fragLoadError=0,this.hls.trigger(A.Events.BUFFER_FLUSHING,x)},l._loadInitSegment=function(h){var b=this;this._doFragLoad(h).then(function(R){if(!R||b.fragContextChanged(h)||!b.levels)throw new Error("init load aborted");return R}).then(function(R){var x=b.hls,P=R.payload,M=h.decryptdata;if(P&&P.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var k=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(P),M.key.buffer,M.iv.buffer).then(function(C){var U=self.performance.now();return x.trigger(A.Events.FRAG_DECRYPTED,{frag:h,payload:C,stats:{tstart:k,tdecrypt:U}}),R.payload=C,R})}return R}).then(function(R){var x=b.fragCurrent,P=b.hls,M=b.levels;if(!M)throw new Error("init load aborted, missing levels");var k=M[h.level].details;console.assert(k,"Level details are defined when init segment is loaded");var C=h.stats;b.state=v.IDLE,b.fragLoadError=0,h.data=new Uint8Array(R.payload),C.parsing.start=C.buffering.start=self.performance.now(),C.parsing.end=C.buffering.end=self.performance.now(),R.frag===x&&P.trigger(A.Events.FRAG_BUFFERED,{stats:C,frag:x,part:null,id:h.type}),b.tick()}).catch(function(R){b.warn(R),b.resetFragmentLoading(h)})},l.fragContextChanged=function(h){var b=this.fragCurrent;return!h||!b||h.level!==b.level||h.sn!==b.sn||h.urlId!==b.urlId},l.fragBufferedComplete=function(h,b){var R=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+h.type+" sn: "+h.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level+" "+t.default.toString(D.BufferHelper.getBuffered(R))),this.state=v.IDLE,this.tick()},l._handleFragmentLoadComplete=function(h){var b=this.transmuxer;if(!b)return;var R=h.frag,x=h.part,P=h.partsLoaded,M=!P||P.length===0||P.some(function(C){return!C}),k=new _.ChunkMetadata(R.level,R.sn,R.stats.chunkCount+1,0,x?x.index:-1,!M);b.flush(k)},l._handleFragmentLoadProgress=function(h){},l._doFragLoad=function(h,b,R,x){var P=this;if(R===void 0&&(R=null),!this.levels)throw new Error("frag load aborted, missing levels");if(R=Math.max(h.start,R||0),this.config.lowLatencyMode&&b){var M=b.partList;if(M&&x){R>h.end&&b.fragmentHint&&(h=b.fragmentHint);var k=this.getNextPart(M,h,R);if(k>-1){var C=M[k];return this.log("Loading part sn: "+h.sn+" p: "+C.index+" cc: "+h.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+k+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(R.toFixed(3))),this.nextLoadPosition=C.start+C.duration,this.state=v.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:h,part:M[k],targetBufferTime:R}),this.doFragPartsLoad(h,M,k,x).catch(function(U){return P.handleFragLoadError(U)})}else if(!h.url||this.loadedEndOfParts(M,R))return Promise.resolve(null)}}return this.log("Loading fragment "+h.sn+" cc: "+h.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(R.toFixed(3))),Object(L.isFiniteNumber)(h.sn)&&!this.bitrateTest&&(this.nextLoadPosition=h.start+h.duration),this.state=v.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:h,targetBufferTime:R}),this.fragmentLoader.load(h,x).catch(function(U){return P.handleFragLoadError(U)})},l.doFragPartsLoad=function(h,b,R,x){var P=this;return new Promise(function(M,k){var C=[],U=function K(ee){var z=b[ee];P.fragmentLoader.loadPart(h,z,x).then(function(ae){C[z.index]=ae;var se=ae.part;P.hls.trigger(A.Events.FRAG_LOADED,ae);var V=b[ee+1];if(V&&V.fragment===h)K(ee+1);else return M({frag:h,part:se,partsLoaded:C})}).catch(k)};U(R)})},l.handleFragLoadError=function(h){var b=h.data;return b&&b.details===O.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(A.Events.ERROR,b),null},l._handleTransmuxerFlush=function(h){var b=this.getCurrentContext(h);if(!b||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var R=b.frag,x=b.part,P=b.level,M=self.performance.now();R.stats.parsing.end=M,x&&(x.stats.parsing.end=M),this.updateLevelTiming(R,x,P,h.partial)},l.getCurrentContext=function(h){var b=this.levels,R=h.level,x=h.sn,P=h.part;if(!b||!b[R])return this.warn("Levels object was unset while buffering fragment "+x+" of level "+R+". The current chunk will not be buffered."),null;var M=b[R],k=P>-1?Object(e.getPartWith)(M,x,P):null,C=k?k.fragment:Object(e.getFragmentWithSN)(M,x,this.fragCurrent);return C?{frag:C,part:k,level:M}:null},l.bufferFragmentData=function(h,b,R,x){if(!h||this.state!==v.PARSING)return;var P=h.data1,M=h.data2,k=P;if(P&&M&&(k=Object(f.appendUint8Array)(P,M)),!k||!k.length)return;var C={type:h.type,frag:b,part:R,chunkMeta:x,parent:b.type,data:k};this.hls.trigger(A.Events.BUFFER_APPENDING,C),h.dropped&&h.independent&&!R&&this.flushBufferGap(b)},l.flushBufferGap=function(h){var b=this.media;if(!b)return;if(!D.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,h.start);return}var R=b.currentTime,x=D.BufferHelper.bufferInfo(b,R,0),P=h.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,P*.25),k=Math.max(Math.min(h.start-M,x.end-M),R+M);h.start-k>M&&this.flushMainBuffer(k,h.start)},l.getFwdBufferInfo=function(h,b){var R=this.config,x=this.getLoadPosition();if(!Object(L.isFiniteNumber)(x))return null;var P=D.BufferHelper.bufferInfo(h,x,R.maxBufferHole);if(P.len===0&&P.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(x,b);if(M&&P.nextStart<M.end)return D.BufferHelper.bufferInfo(h,x,Math.max(P.nextStart,R.maxBufferHole))}return P},l.getMaxBufferLength=function(h){var b=this.config,R;return h?R=Math.max(8*b.maxBufferSize/h,b.maxBufferLength):R=b.maxBufferLength,Math.min(R,b.maxMaxBufferLength)},l.reduceMaxBufferLength=function(h){var b=this.config,R=h||b.maxBufferLength;return b.maxMaxBufferLength>=R?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(h,b){var R,x,P=b.fragments,M=P.length;if(!M)return null;var k=this.config,C=P[0].start,U;if(b.live){var K=k.initialLiveManifestSize;if(M<K)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+K+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(U=this.getInitialLiveFragment(b,P),this.startPosition=U?this.hls.liveSyncPosition||U.start:h)}else h<=C&&(U=P[0]);if(!U){var ee=k.lowLatencyMode?b.partEnd:b.fragmentEnd;U=this.getFragmentAtPosition(h,ee,b)}return(R=U)!==null&&R!==void 0&&R.initSegment&&!((x=U)!==null&&x!==void 0&&x.initSegment.data)&&!this.bitrateTest&&(U=U.initSegment),U},l.getNextPart=function(h,b,R){for(var x=-1,P=!1,M=!0,k=0,C=h.length;k<C;k++){var U=h[k];if(M=M&&!U.independent,x>-1&&R<U.start)break;var K=U.loaded;!K&&(P||U.independent||M)&&U.fragment===b&&(x=k),P=K}return x},l.loadedEndOfParts=function(h,b){var R=h[h.length-1];return R&&b>R.start&&R.loaded},l.getInitialLiveFragment=function(h,b){var R=this.fragPrevious,x=null;if(R){if(h.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),x=Object(o.findFragmentByPDT)(b,R.endProgramDateTime,this.config.maxFragLookUpTolerance)),!x){var P=R.sn+1;if(P>=h.startSN&&P<=h.endSN){var M=b[P-h.startSN];R.cc===M.cc&&(x=M,this.log("Live playlist, switching playlist, load frag with next SN: "+x.sn))}x||(x=Object(o.findFragWithCC)(b,R.cc),x&&this.log("Live playlist, switching playlist, load frag with same CC: "+x.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(x=this.getFragmentAtPosition(k,this.bitrateTest?h.fragmentEnd:h.edge,h))}return x},l.getFragmentAtPosition=function(h,b,R){var x=this.config,P=this.fragPrevious,M=R.fragments,k=R.endSN,C=R.fragmentHint,U=x.maxFragLookUpTolerance,K=!!(x.lowLatencyMode&&R.partList&&C);K&&C&&!this.bitrateTest&&(M=M.concat(C),k=C.sn);var ee;if(h<b){var z=h>b-U?0:U;ee=Object(o.findFragmentByPTS)(P,M,h,z)}else ee=M[M.length-1];if(ee){var ae=ee.sn-R.startSN,se=P&&ee.level===P.level,V=M[ae+1],Y=this.fragmentTracker.getState(ee);if(Y===w.FragmentState.BACKTRACKED){ee=null;for(var q=ae;M[q]&&this.fragmentTracker.getState(M[q])===w.FragmentState.BACKTRACKED;)P?ee=M[q--]:ee=M[--q];ee||(ee=V)}else P&&ee.sn===P.sn&&!K&&(se&&(ee.sn<k&&this.fragmentTracker.getState(V)!==w.FragmentState.OK?(this.log("SN "+ee.sn+" just loaded, load next one: "+V.sn),ee=V):ee=null))}return ee},l.synchronizeToLiveEdge=function(h){var b=this.config,R=this.media;if(!R)return;var x=this.hls.liveSyncPosition,P=R.currentTime,M=h.fragments[0].start,k=h.edge,C=P>=M-b.maxFragLookUpTolerance&&P<=k;if(x!==null&&R.duration>x&&(P<x||!C)){var U=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*h.targetduration;(!C&&R.readyState<4||P<k-U)&&(this.loadedmetadata||(this.nextLoadPosition=x),R.readyState&&(this.warn("Playback: "+P.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+x.toFixed(3)),R.currentTime=x))}},l.alignPlaylists=function(h,b){var R=this.levels,x=this.levelLastLoaded,P=this.fragPrevious,M=x!==null?R[x]:null,k=h.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var C=h.fragments[0].start,U=!b,K=h.alignedSliding&&Object(L.isFiniteNumber)(C);if(U||!K&&!C){Object(d.alignStream)(P,M,h);var ee=h.fragments[0].start;return this.log("Live playlist sliding: "+ee.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+h.startSN+" prev-sn: "+(P?P.sn:"na")+" fragments: "+k),ee}return C},l.waitForCdnTuneIn=function(h){var b=3;return h.live&&h.canBlockReload&&h.tuneInGoal>Math.max(h.partHoldBack,h.partTarget*b)},l.setStartPosition=function(h,b){var R=this.startPosition;if(R<b&&(R=-1),R===-1||this.lastCurrentTime===-1){var x=h.startTimeOffset;Object(L.isFiniteNumber)(x)?(R=b+x,x<0&&(R+=h.totalduration),R=Math.min(Math.max(b,R),b+h.totalduration),this.log("Start time offset "+x+" found in playlist, adjust startPosition to "+R),this.startPosition=R):h.live?R=this.hls.liveSyncPosition||b:this.startPosition=R=0,this.lastCurrentTime=R}this.nextLoadPosition=R},l.getLoadPosition=function(){var h=this.media,b=0;return this.loadedmetadata&&h?b=h.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},l.handleFragLoadAborted=function(h,b){this.transmuxer&&h.sn!=="initSegment"&&h.stats.aborted&&(this.warn("Fragment "+h.sn+(b?" part"+b.index:"")+" of level "+h.level+" was aborted"),this.resetFragmentLoading(h))},l.resetFragmentLoading=function(h){(!this.fragCurrent||!this.fragContextChanged(h))&&(this.state=v.IDLE)},l.onFragmentOrKeyLoadError=function(h,b){if(b.fatal)return;var R=b.frag;if(!R||R.type!==h)return;var x=this.fragCurrent;console.assert(x&&R.sn===x.sn&&R.level===x.level&&R.urlId===x.urlId,"Frag load error must match current frag to retry");var P=this.config;if(this.fragLoadError+1<=P.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(R.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*P.fragLoadingRetryDelay,P.fragLoadingMaxRetryTimeout);this.warn("Fragment "+R.sn+" of "+h+" "+R.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(h===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(I.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},l.afterBufferFlushed=function(h,b,R){if(!h)return;var x=D.BufferHelper.getBuffered(h);this.fragmentTracker.detectEvictedFragments(b,x,R),this.state===v.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},l.resetLiveStartWhenNotLoaded=function(h){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[h].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(h,b,R,x){var P=this,M=R.details;console.assert(!!M,"level.details must be defined");var k=Object.keys(h.elementaryStreams).reduce(function(C,U){var K=h.elementaryStreams[U];if(K){var ee=K.endPTS-K.startPTS;if(ee<=0)return P.warn("Could not parse fragment "+h.sn+" "+U+" duration reliably ("+ee+") resetting transmuxer to fallback to playlist timing"),P.resetTransmuxer(),C||!1;var z=x?0:Object(e.updateFragPTSDTS)(M,h,K.startPTS,K.endPTS,K.startDTS,K.endDTS);return P.hls.trigger(A.Events.LEVEL_PTS_UPDATED,{details:M,level:R,drift:z,type:U,frag:h,start:K.startPTS,end:K.endPTS}),!0}return C},!1);k?(this.state=v.PARSED,this.hls.trigger(A.Events.FRAG_PARSED,{frag:h,part:b})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},E(i,[{key:"state",get:function(){return this._state},set:function(h){var b=this._state;b!==h&&(this._state=h,this.log(b+"->"+h))}}]),i}(T.default)},"./src/controller/buffer-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return o});var L=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),w=S("./src/utils/logger.ts"),D=S("./src/errors.ts"),I=S("./src/utils/buffer-helper.ts"),A=S("./src/utils/mediasource-helper.ts"),O=S("./src/loader/fragment.ts"),_=S("./src/controller/buffer-operation-queue.ts"),f=Object(A.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,o=function(){function e(s){var t=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 n=t.hls,r=t.media,E=t.mediaSource;w.logger.log("[buffer-controller]: Media source opened"),r&&(t.updateMediaElementDuration(),n.trigger(T.Events.MEDIA_ATTACHED,{media:r})),E&&E.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){w.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){w.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var u=e.prototype;return u.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},u.destroy=function(){this.unregisterListeners(),this.details=null},u.registerListeners=function(){var t=this.hls;t.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(T.Events.BUFFER_RESET,this.onBufferReset,this),t.on(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(T.Events.BUFFER_EOS,this.onBufferEos,this),t.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(T.Events.FRAG_PARSED,this.onFragParsed,this),t.on(T.Events.FRAG_CHANGED,this.onFragChanged,this)},u.unregisterListeners=function(){var t=this.hls;t.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(T.Events.BUFFER_RESET,this.onBufferReset,this),t.off(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(T.Events.BUFFER_EOS,this.onBufferEos,this),t.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(T.Events.FRAG_PARSED,this.onFragParsed,this),t.off(T.Events.FRAG_CHANGED,this.onFragChanged,this)},u._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new _.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},u.onManifestParsed=function(t,n){var r=2;(n.audio&&!n.video||!n.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,w.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(t,n){var r=this.media=n.media;if(r&&f){var E=this.mediaSource=new f;E.addEventListener("sourceopen",this._onMediaSourceOpen),E.addEventListener("sourceended",this._onMediaSourceEnded),E.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(E),this._objectUrl=r.src}},u.onMediaDetaching=function(){var t=this.media,n=this.mediaSource,r=this._objectUrl;if(n){if(w.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(E){w.logger.warn("[buffer-controller]: onMediaDetaching: "+E.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(r&&self.URL.revokeObjectURL(r),t.src===r?(t.removeAttribute("src"),t.load()):w.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(T.Events.MEDIA_DETACHED,void 0)},u.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(n){var r=t.sourceBuffer[n];try{r&&(t.removeBufferListeners(n),t.mediaSource&&t.mediaSource.removeSourceBuffer(r),t.sourceBuffer[n]=void 0)}catch(E){w.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",E)}}),this._initSourceBuffer()},u.onBufferCodecs=function(t,n){var r=this,E=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(m){if(E){var p=r.tracks[m];if(p&&typeof p.buffer.changeType=="function"){var y=n[m],v=y.codec,a=y.levelCodec,c=y.container,i=(p.levelCodec||p.codec).replace(d,"$1"),l=(a||v).replace(d,"$1");if(i!==l){var g=c+";codecs="+(a||v);r.appendChangeType(m,g)}}}else r.pendingTracks[m]=n[m]}),E)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},u.appendChangeType=function(t,n){var r=this,E=this.operationQueue,m={execute:function(){var y=r.sourceBuffer[t];y&&(w.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+n),y.changeType(n)),E.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(y){w.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",y)}};E.append(m,t)},u.onBufferAppending=function(t,n){var r=this,E=this.hls,m=this.operationQueue,p=this.tracks,y=n.data,v=n.type,a=n.frag,c=n.part,i=n.chunkMeta,l=i.buffering[v],g=self.performance.now();l.start=g;var h=a.stats.buffering,b=c?c.stats.buffering:null;h.start===0&&(h.start=g),b&&b.start===0&&(b.start=g);var R=p.audio,x=v==="audio"&&i.id===1&&(R==null?void 0:R.container)==="audio/mpeg",P={execute:function(){if(l.executeStart=self.performance.now(),x){var k=r.sourceBuffer[v];if(k){var C=a.start-k.timestampOffset;Math.abs(C)>=.1&&(w.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+a.start+" (delta: "+C+") sn: "+a.sn+")"),k.timestampOffset=a.start)}}r.appendExecutor(y,v)},onStart:function(){},onComplete:function(){var k=self.performance.now();l.executeEnd=l.end=k,h.first===0&&(h.first=k),b&&b.first===0&&(b.first=k);var C=r.sourceBuffer,U={};for(var K in C)U[K]=I.BufferHelper.getBuffered(C[K]);r.appendError=0,r.hls.trigger(T.Events.BUFFER_APPENDED,{type:v,frag:a,part:c,chunkMeta:i,parent:a.type,timeRanges:U})},onError:function(k){w.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",k);var C={type:D.ErrorTypes.MEDIA_ERROR,parent:a.type,details:D.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=D.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,C.details=D.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>E.config.appendErrorMaxRetry&&(w.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),C.fatal=!0)),E.trigger(T.Events.ERROR,C)}};m.append(P,v)},u.onBufferFlushing=function(t,n){var r=this,E=this.operationQueue,m=function(y){return{execute:r.removeExecutor.bind(r,y,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(T.Events.BUFFER_FLUSHED,{type:y})},onError:function(a){w.logger.warn("[buffer-controller]: Failed to remove from "+y+" SourceBuffer",a)}}};n.type?E.append(m(n.type),n.type):this.getSourceBufferTypes().forEach(function(p){E.append(m(p),p)})},u.onFragParsed=function(t,n){var r=this,E=n.frag,m=n.part,p=[],y=m?m.elementaryStreams:E.elementaryStreams;y[O.ElementaryStreamTypes.AUDIOVIDEO]?p.push("audiovideo"):(y[O.ElementaryStreamTypes.AUDIO]&&p.push("audio"),y[O.ElementaryStreamTypes.VIDEO]&&p.push("video"));var v=function(){var c=self.performance.now();E.stats.buffering.end=c,m&&(m.stats.buffering.end=c);var i=m?m.stats:E.stats;r.hls.trigger(T.Events.FRAG_BUFFERED,{frag:E,part:m,stats:i,id:E.type})};p.length===0&&w.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+E.type+" level: "+E.level+" sn: "+E.sn),this.blockBuffers(v,p)},u.onFragChanged=function(t,n){this.flushBackBuffer()},u.onBufferEos=function(t,n){var r=this,E=this.getSourceBufferTypes().reduce(function(m,p){var y=r.sourceBuffer[p];return(!n.type||n.type===p)&&(y&&!y.ended&&(y.ended=!0,w.logger.log("[buffer-controller]: "+p+" sourceBuffer now EOS"))),m&&!!(!y||y.ended)},!0);E&&this.blockBuffers(function(){var m=r.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},u.onLevelUpdated=function(t,n){var r=n.details;if(!r.fragments.length)return;this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},u.flushBackBuffer=function(){var t=this.hls,n=this.details,r=this.media,E=this.sourceBuffer;if(!r||n===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var p=n.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(L.isFiniteNumber)(p)||p<0)return;var y=r.currentTime,v=n.levelTargetDuration,a=Math.max(p,v),c=Math.floor(y/v)*v-a;m.forEach(function(i){var l=E[i];if(l){var g=I.BufferHelper.getBuffered(l);g.length>0&&c>g.start(0)&&(t.trigger(T.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),n.live&&t.trigger(T.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),t.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:i}))}})},u.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,n=this.hls,r=this.media,E=this.mediaSource,m=t.fragments[0].start+t.totalduration,p=r.duration,y=Object(L.isFiniteNumber)(E.duration)?E.duration:0;t.live&&n.config.liveDurationInfinity?(w.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),E.duration=Infinity,this.updateSeekableRange(t)):(m>y&&m>p||!Object(L.isFiniteNumber)(p))&&(w.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),E.duration=m)},u.updateSeekableRange=function(t){var n=this.mediaSource,r=t.fragments,E=r.length;if(E&&t.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var m=Math.max(0,r[0].start),p=Math.max(m,m+t.totalduration);n.setLiveSeekableRange(m,p)}},u.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,n=this.operationQueue,r=this.pendingTracks,E=Object.keys(r).length;if(E&&!t||E===2){this.createSourceBuffers(r),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(p){n.executeNext(p)})}},u.createSourceBuffers=function(t){var n=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var E=0;for(var m in t)if(!n[m]){var p=t[m];if(!p)throw Error("source buffer exists for track "+m+", however track does not");var y=p.levelCodec||p.codec,v=p.container+";codecs="+y;w.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var a=n[m]=r.addSourceBuffer(v),c=m;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[m]={buffer:a,codec:y,container:p.container,levelCodec:p.levelCodec,id:p.id},E++}catch(i){w.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+i.message),this.hls.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:i,mimeType:v})}}E&&this.hls.trigger(T.Events.BUFFER_CREATED,{tracks:this.tracks})},u._onSBUpdateStart=function(t){var n=this.operationQueue,r=n.current(t);r.onStart()},u._onSBUpdateEnd=function(t){var n=this.operationQueue,r=n.current(t);r.onComplete(),n.shiftAndExecuteNext(t)},u._onSBUpdateError=function(t,n){w.logger.error("[buffer-controller]: "+t+" SourceBuffer error",n),this.hls.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(t);r&&r.onError(n)},u.removeExecutor=function(t,n,r){var E=this.media,m=this.mediaSource,p=this.operationQueue,y=this.sourceBuffer,v=y[t];if(!E||!m||!v){w.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(t);return}var a=Object(L.isFiniteNumber)(E.duration)?E.duration:Infinity,c=Object(L.isFiniteNumber)(m.duration)?m.duration:Infinity,i=Math.max(0,n),l=Math.min(r,a,c);l>i?(w.logger.log("[buffer-controller]: Removing ["+i+","+l+"] from the "+t+" SourceBuffer"),console.assert(!v.updating,t+" sourceBuffer must not be updating"),v.remove(i,l)):p.shiftAndExecuteNext(t)},u.appendExecutor=function(t,n){var r=this.operationQueue,E=this.sourceBuffer,m=E[n];if(!m){w.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),r.shiftAndExecuteNext(n);return}m.ended=!1,console.assert(!m.updating,n+" sourceBuffer must not be updating"),m.appendBuffer(t)},u.blockBuffers=function(t,n){var r=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){w.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var E=this.operationQueue,m=n.map(function(p){return E.appendBlocker(p)});Promise.all(m).then(function(){t(),n.forEach(function(p){var y=r.sourceBuffer[p];(!y||!y.updating)&&E.shiftAndExecuteNext(p)})})},u.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},u.addBufferListener=function(t,n,r){var E=this.sourceBuffer[t];if(!E)return;var m=r.bind(this,t);this.listeners[t].push({event:n,listener:m}),E.addEventListener(n,m)},u.removeBufferListeners=function(t){var n=this.sourceBuffer[t];if(!n)return;this.listeners[t].forEach(function(r){n.removeEventListener(r.event,r.listener)})},e}()},"./src/controller/buffer-operation-queue.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return T});var L=S("./src/utils/logger.ts"),T=function(){function w(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var D=w.prototype;return D.append=function(A,O){var _=this.queues[O];_.push(A),_.length===1&&this.buffers[O]&&this.executeNext(O)},D.insertAbort=function(A,O){var _=this.queues[O];_.unshift(A),this.executeNext(O)},D.appendBlocker=function(A){var O,_=new Promise(function(d){O=d}),f={execute:O,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,A),_},D.executeNext=function(A){var O=this.buffers,_=this.queues,f=O[A],d=_[A];if(d.length){var o=d[0];try{o.execute()}catch(e){L.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(e),(!f||!f.updating)&&(d.shift(),this.executeNext(A))}}},D.shiftAndExecuteNext=function(A){this.queues[A].shift(),this.executeNext(A)},D.current=function(A){return this.queues[A][0]},w}()},"./src/controller/cap-level-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/events.ts");function T(I,A){for(var O=0;O<A.length;O++){var _=A[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(I,_.key,_)}}function w(I,A,O){return A&&T(I.prototype,A),O&&T(I,O),I}var D=function(){function I(O){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=O,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var A=I.prototype;return A.setStreamController=function(_){this.streamController=_},A.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},A.registerListeners=function(){var _=this.hls;_.on(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},A.unregisterListener=function(){var _=this.hls;_.off(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},A.onFpsDropLevelCapping=function(_,f){I.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},A.onMediaAttaching=function(_,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},A.onManifestParsed=function(_,f){var d=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,d.config.capLevelToPlayerSize&&f.video&&this.startCapping()},A.onBufferCodecs=function(_,f){var d=this.hls;d.config.capLevelToPlayerSize&&f.video&&this.startCapping()},A.onMediaDetaching=function(){this.stopCapping()},A.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var _=this.hls.levels;if(_.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(_.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},A.getMaxLevel=function(_){var f=this,d=this.hls.levels;if(!d.length)return-1;var o=d.filter(function(e,u){return I.isLevelAllowed(u,f.restrictedLevels)&&u<=_});return this.clientRect=null,I.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},A.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()},A.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},A.getDimensions=function(){if(this.clientRect)return this.clientRect;var _=this.media,f={width:0,height:0};if(_){var d=_.getBoundingClientRect();f.width=d.width,f.height=d.height,!f.width&&!f.height&&(f.width=d.right-d.left||_.width||0,f.height=d.bottom-d.top||_.height||0)}return this.clientRect=f,f},I.isLevelAllowed=function(_,f){return f===void 0&&(f=[]),f.indexOf(_)===-1},I.getMaxLevelByMediaSize=function(_,f,d){if(!_||!_.length)return-1;for(var o=function(n,r){return r?n.width!==r.width||n.height!==r.height:!0},e=_.length-1,u=0;u<_.length;u+=1){var s=_[u];if((s.width>=f||s.height>=d)&&o(s,_[u+1])){e=u;break}}return e},w(I,[{key:"mediaWidth",get:function(){return this.getDimensions().width*I.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*I.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var _=1;try{_=self.devicePixelRatio}catch(f){}return _}}]),I}();N.default=D},"./src/controller/cmcd-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return o});var L=S("./src/events.ts"),T=S("./src/types/cmcd.ts"),w=S("./src/utils/buffer-helper.ts"),D=S("./src/utils/logger.ts");function I(e,u){for(var s=0;s<u.length;s++){var t=u[s];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function A(e,u,s){return u&&I(e.prototype,u),s&&I(e,s),e}function O(e,u){var s=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(s)return(s=s.call(e)).next.bind(s);if(Array.isArray(e)||(s=_(e))||u&&e&&typeof e.length=="number"){s&&(e=s);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}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 _(e,u){if(!e)return;if(typeof e=="string")return f(e,u);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor&&(s=e.constructor.name),s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return f(e,u)}function f(e,u){(u==null||u>e.length)&&(u=e.length);for(var s=0,t=new Array(u);s<u;s++)t[s]=e[s];return t}function d(){return d=Object.assign||function(e){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e},d.apply(this,arguments)}var o=function(){function e(s){var t=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(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(E){try{t.apply(E,{ot:T.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(m){D.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(E){try{var m=E.frag,p=t.hls.levels[m.level],y=t.getObjectType(m),v={d:m.duration*1e3,ot:y};(y===T.CMCDObjectType.VIDEO||y===T.CMCDObjectType.AUDIO||y==T.CMCDObjectType.MUXED)&&(v.br=p.bitrate/1e3,v.tb=t.getTopBandwidth(y),v.bl=t.getBufferLength(y)),t.apply(E,v)}catch(a){D.logger.warn("Could not generate segment CMCD data.",a)}},this.hls=s;var n=this.config=s.config,r=n.cmcd;r!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.uuid(),this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.registerListeners())}var u=e.prototype;return u.registerListeners=function(){var t=this.hls;t.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this)},u.unregisterListeners=function(){var t=this.hls;t.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},u.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},u.onMediaAttached=function(t,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},u.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},u.onBufferCreated=function(t,n){var r,E;this.audioBuffer=(r=n.tracks.audio)===null||r===void 0?void 0:r.buffer,this.videoBuffer=(E=n.tracks.video)===null||E===void 0?void 0:E.buffer},u.createData=function(){var t;return{v:T.CMCDVersion,sf:T.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},u.apply=function(t,n){n===void 0&&(n={}),d(n,this.createData());var r=n.ot===T.CMCDObjectType.INIT||n.ot===T.CMCDObjectType.VIDEO||n.ot===T.CMCDObjectType.MUXED;if(this.starved&&r&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var E=e.toHeaders(n);if(!Object.keys(E).length)return;t.headers||(t.headers={}),d(t.headers,E)}else{var m=e.toQuery(n);if(!m)return;t.url=e.appendQueryToUri(t.url,m)}},u.getObjectType=function(t){var n=t.type;return n==="subtitle"?T.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?T.CMCDObjectType.INIT:n==="audio"?T.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?T.CMCDObjectType.VIDEO:T.CMCDObjectType.MUXED:void 0},u.getTopBandwidth=function(t){for(var n=0,r=t===T.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,E=O(r),m;!(m=E()).done;){var p=m.value;p.bitrate>n&&(n=p.bitrate)}return n>0?n:NaN},u.getBufferLength=function(t){var n=this.hls.media,r=t===T.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!r||!n)return NaN;var E=w.BufferHelper.bufferInfo(r,n.currentTime,this.config.maxBufferHole);return E.len*1e3},u.createPlaylistLoader=function(){var t=this.config.pLoader,n=this.applyPlaylistData,r=t||this.config.loader;return function(){function E(p){this.loader=void 0,this.loader=new r(p)}var m=E.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(y,v,a){n(y),this.loader.load(y,v,a)},A(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},u.createFragmentLoader=function(){var t=this.config.fLoader,n=this.applyFragmentData,r=t||this.config.loader;return function(){function E(p){this.loader=void 0,this.loader=new r(p)}var m=E.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(y,v,a){n(y),this.loader.load(y,v,a)},A(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},e.uuid=function(){var t=URL.createObjectURL(new Blob),n=t.toString();return URL.revokeObjectURL(t),n.substr(n.lastIndexOf("/")+1)},e.serialize=function(t){for(var n=[],r=function(x){return!Number.isNaN(x)&&x!=null&&x!==""&&x!==!1},E=function(x){return Math.round(x)},m=function(x){return E(x/100)*100},p=function(x){return encodeURIComponent(x)},y={br:E,d:E,bl:m,dl:m,mtp:m,nor:p,rtp:m,tb:E},v=Object.keys(t||{}).sort(),a=O(v),c;!(c=a()).done;){var i=c.value,l=t[i];if(!r(l))continue;if(i==="v"&&l===1)continue;if(i=="pr"&&l===1)continue;var g=y[i];g&&(l=g(l));var h=typeof l,b=void 0;i==="ot"||i==="sf"||i==="st"?b=i+"="+l:h==="boolean"?b=i:h==="number"?b=i+"="+l:b=i+"="+JSON.stringify(l),n.push(b)}return n.join(",")},e.toHeaders=function(t){for(var n=Object.keys(t),r={},E=["Object","Request","Session","Status"],m=[{},{},{},{}],p={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},y=0,v=n;y<v.length;y++){var a=v[y],c=p[a]!=null?p[a]:1;m[c][a]=t[a]}for(var i=0;i<m.length;i++){var l=e.serialize(m[i]);l&&(r["CMCD-"+E[i]]=l)}return r},e.toQuery=function(t){return"CMCD="+encodeURIComponent(e.serialize(t))},e.appendQueryToUri=function(t,n){if(!n)return t;var r=t.includes("?")?"&":"?";return""+t+r+n},e}()},"./src/controller/eme-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/events.ts"),T=S("./src/errors.ts"),w=S("./src/utils/logger.ts"),D=S("./src/utils/mediakeys-helper.ts");function I(o,e){for(var u=0;u<e.length;u++){var s=e[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function A(o,e,u){return e&&I(o.prototype,e),u&&I(o,u),o}var O=3,_=function(e,u,s){var t={audioCapabilities:[],videoCapabilities:[]};return e.forEach(function(n){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:s.audioRobustness||""})}),u.forEach(function(n){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:s.videoRobustness||""})}),[t]},f=function(e,u,s,t){switch(e){case D.KeySystems.WIDEVINE:return _(u,s,t);default:throw new Error("Unknown key-system: "+e)}},d=function(){function o(u){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=u,this._config=u.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 e=o.prototype;return e.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},e._registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},e._unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},e.getLicenseServerUrl=function(s){switch(s){case D.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},e._attemptKeySystemAccess=function(s,t,n){var r=this,E=f(s,t,n,this._drmSystemOptions);w.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,E);this.mediaKeysPromise=m.then(function(p){return r._onMediaKeySystemAccessObtained(s,p)}),m.catch(function(p){w.logger.error('Failed to obtain key-system "'+s+'" access:',p)})},e._onMediaKeySystemAccessObtained=function(s,t){var n=this;w.logger.log('Access for key-system "'+s+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:s};this._mediaKeysList.push(r);var E=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(m){return r.mediaKeys=m,w.logger.log('Media-keys created for key-system "'+s+'"'),n._onMediaKeysCreated(),m});return E.catch(function(m){w.logger.error("Failed to create media-keys:",m)}),E},e._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),s._onNewMediaKeySession(t.mediaKeysSession))})},e._onNewMediaKeySession=function(s){var t=this;w.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(n){t._onKeySessionMessage(s,n.message)},!1)},e._onKeySessionMessage=function(s,t){w.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(n){w.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),s.update(n)})},e.onMediaEncrypted=function(s){var t=this;if(w.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){w.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(E){if(!t._media)return;t._attemptSetMediaKeys(E),t._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(n).catch(n)},e._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){w.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}w.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},e._generateRequestWithPreferredKeySession=function(s,t){var n=this,r=this._mediaKeysList[0];if(!r){w.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(r.mediaKeysSessionInitialized){w.logger.warn("Key-Session already initialized but requested again");return}var E=r.mediaKeysSession;if(!E){w.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){w.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}w.logger.log('Generating key-session request for "'+s+'" init data type'),r.mediaKeysSessionInitialized=!0,E.generateRequest(s,t).then(function(){w.logger.debug("Key-session generation succeeded")}).catch(function(m){w.logger.error("Error generating key-session request:",m),n.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},e._createLicenseXhr=function(s,t,n){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,s,t,n);var E=this._licenseXhrSetup;if(E)try{E.call(this.hls,r,s),E=void 0}catch(m){w.logger.error(m)}try{r.readyState||r.open("POST",s,!0),E&&E.call(this.hls,r,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return r},e._onLicenseRequestReadyStageChange=function(s,t,n,r){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,w.logger.log("License request succeeded");var E=s.response,m=this._licenseResponseCallback;if(m)try{E=m.call(this.hls,s,t)}catch(y){w.logger.error(y)}r(E)}else{if(w.logger.error("License Request XHR failed ("+t+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>O){this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var p=O-this._requestLicenseFailureCount+1;w.logger.warn("Retrying license request, "+p+" attempts left"),this._requestLicense(n,r)}break}},e._generateLicenseRequestChallenge=function(s,t){switch(s.mediaKeySystemDomain){case D.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},e._requestLicense=function(s,t){w.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){w.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var r=this.getLicenseServerUrl(n.mediaKeySystemDomain),E=this._createLicenseXhr(r,s,t);w.logger.log("Sending license request to URL: "+r);var m=this._generateLicenseRequestChallenge(n,s);E.send(m)}catch(p){w.logger.error("Failure requesting DRM license: "+p),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},e.onMediaAttached=function(s,t){if(!this._emeEnabled)return;var n=t.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},e.onMediaDetached=function(){var s=this._media,t=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},e.onManifestParsed=function(s,t){if(!this._emeEnabled)return;var n=t.levels.map(function(E){return E.audioCodec}).filter(function(E){return!!E}),r=t.levels.map(function(E){return E.videoCodec}).filter(function(E){return!!E});this._attemptKeySystemAccess(D.KeySystems.WIDEVINE,n,r)},A(o,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),o}();N.default=d},"./src/controller/fps-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/events.ts"),T=S("./src/utils/logger.ts"),w=function(){function D(A){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=A,this.registerListeners()}var I=D.prototype;return I.setStreamController=function(O){this.streamController=O},I.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},I.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching)},I.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},I.onMediaAttaching=function(O,_){var f=this.hls.config;if(f.capLevelOnFPSDrop){var d=_.media instanceof self.HTMLVideoElement?_.media:null;this.media=d,d&&typeof d.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},I.checkFPS=function(O,_,f){var d=performance.now();if(_){if(this.lastTime){var o=d-this.lastTime,e=f-this.lastDroppedFrames,u=_-this.lastDecodedFrames,s=1e3*e/o,t=this.hls;if(t.trigger(L.Events.FPS_DROP,{currentDropped:e,currentDecoded:u,totalDroppedFrames:f}),s>0&&e>t.config.fpsDroppedMonitoringThreshold*u){var n=t.currentLevel;T.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=n)&&(n=n-1,t.trigger(L.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:t.currentLevel}),t.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=f,this.lastDecodedFrames=_}},I.checkFPSInterval=function(){var O=this.media;if(O)if(this.isVideoPlaybackQualityAvailable){var _=O.getVideoPlaybackQuality();this.checkFPS(O,_.totalVideoFrames,_.droppedVideoFrames)}else this.checkFPS(O,O.webkitDecodedFrameCount,O.webkitDroppedFrameCount)},D}();N.default=w},"./src/controller/fragment-finders.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"findFragmentByPDT",function(){return w}),S.d(N,"findFragmentByPTS",function(){return D}),S.d(N,"fragmentWithinToleranceTest",function(){return I}),S.d(N,"pdtWithinToleranceTest",function(){return A}),S.d(N,"findFragWithCC",function(){return O});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/binary-search.ts");function w(_,f,d){if(f===null||!Array.isArray(_)||!_.length||!Object(L.isFiniteNumber)(f))return null;var o=_[0].programDateTime;if(f<(o||0))return null;var e=_[_.length-1].endProgramDateTime;if(f>=(e||0))return null;d=d||0;for(var u=0;u<_.length;++u){var s=_[u];if(A(f,d,s))return s}return null}function D(_,f,d,o){d===void 0&&(d=0),o===void 0&&(o=0);var e=null;if(_?e=f[_.sn-f[0].sn+1]||null:d===0&&f[0].start===0&&(e=f[0]),e&&I(d,o,e)===0)return e;var u=T.default.search(f,I.bind(null,d,o));return u||e}function I(_,f,d){_===void 0&&(_=0),f===void 0&&(f=0);var o=Math.min(f,d.duration+(d.deltaPTS?d.deltaPTS:0));return d.start+d.duration-o<=_?1:d.start-o>_&&d.start?-1:0}function A(_,f,d){var o=Math.min(f,d.duration+(d.deltaPTS?d.deltaPTS:0))*1e3,e=d.endProgramDateTime||0;return e-o>_}function O(_,f){return T.default.search(_,function(d){return d.cc<f?1:d.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"FragmentState",function(){return w}),S.d(N,"FragmentTracker",function(){return D});var L=S("./src/events.ts"),T=S("./src/types/loader.ts"),w;(function(O){O.NOT_LOADED="NOT_LOADED",O.BACKTRACKED="BACKTRACKED",O.APPENDING="APPENDING",O.PARTIAL="PARTIAL",O.OK="OK"})(w||(w={}));var D=function(){function O(f){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=f,this._registerListeners()}var _=O.prototype;return _._registerListeners=function(){var d=this.hls;d.on(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(L.Events.FRAG_LOADED,this.onFragLoaded,this)},_._unregisterListeners=function(){var d=this.hls;d.off(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(L.Events.FRAG_LOADED,this.onFragLoaded,this)},_.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},_.getAppendedFrag=function(d,o){if(o===T.PlaylistLevelType.MAIN){var e=this.activeFragment,u=this.activeParts;if(!e)return null;if(u)for(var s=u.length;s--;){var t=u[s],n=t?t.end:e.appendedPTS;if(t.start<=d&&n!==void 0&&d<=n)return s>9&&(this.activeParts=u.slice(s-9)),t}else if(e.start<=d&&e.appendedPTS!==void 0&&d<=e.appendedPTS)return e}return this.getBufferedFrag(d,o)},_.getBufferedFrag=function(d,o){for(var e=this.fragments,u=Object.keys(e),s=u.length;s--;){var t=e[u[s]];if((t==null?void 0:t.body.type)===o&&t.buffered){var n=t.body;if(n.start<=d&&d<=n.end)return n}}return null},_.detectEvictedFragments=function(d,o,e){var u=this;Object.keys(this.fragments).forEach(function(s){var t=u.fragments[s];if(!t)return;if(!t.buffered){t.body.type===e&&u.removeFragment(t.body);return}var n=t.range[d];if(!n)return;n.time.some(function(r){var E=!u.isTimeBuffered(r.startPTS,r.endPTS,o);return E&&u.removeFragment(t.body),E})})},_.detectPartialFragments=function(d){var o=this,e=this.timeRanges,u=d.frag,s=d.part;if(!e||u.sn==="initSegment")return;var t=A(u),n=this.fragments[t];if(!n)return;Object.keys(e).forEach(function(r){var E=u.elementaryStreams[r];if(!E)return;var m=e[r],p=s!==null||E.partial===!0;n.range[r]=o.getBufferedTimes(u,s,p,m)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},_.fragBuffered=function(d){var o=A(d),e=this.fragments[o];e&&(e.backtrack=e.loaded=null,e.buffered=!0)},_.getBufferedTimes=function(d,o,e,u){for(var s={time:[],partial:e},t=o?o.start:d.start,n=o?o.end:d.end,r=d.minEndPTS||n,E=d.maxStartPTS||t,m=0;m<u.length;m++){var p=u.start(m)-this.bufferPadding,y=u.end(m)+this.bufferPadding;if(E>=p&&r<=y){s.time.push({startPTS:Math.max(t,u.start(m)),endPTS:Math.min(n,u.end(m))});break}else if(t<y&&n>p)s.partial=!0,s.time.push({startPTS:Math.max(t,u.start(m)),endPTS:Math.min(n,u.end(m))});else if(n<=p)break}return s},_.getPartialFragment=function(d){var o=null,e,u,s,t=0,n=this.bufferPadding,r=this.fragments;return Object.keys(r).forEach(function(E){var m=r[E];if(!m)return;I(m)&&(u=m.body.start-n,s=m.body.end+n,d>=u&&d<=s&&(e=Math.min(d-u,s-d),t<=e&&(o=m.body,t=e)))}),o},_.getState=function(d){var o=A(d),e=this.fragments[o];return e?e.buffered?I(e)?w.PARTIAL:w.OK:e.backtrack?w.BACKTRACKED:w.APPENDING:w.NOT_LOADED},_.backtrack=function(d,o){var e=A(d),u=this.fragments[e];if(!u||u.backtrack)return null;var s=u.backtrack=o||u.loaded;return u.loaded=null,s},_.getBacktrackData=function(d){var o=A(d),e=this.fragments[o];if(e){var u,s=e.backtrack;if(s!=null&&(u=s.payload)!==null&&u!==void 0&&u.byteLength)return s;this.removeFragment(d)}return null},_.isTimeBuffered=function(d,o,e){for(var u,s,t=0;t<e.length;t++){if(u=e.start(t)-this.bufferPadding,s=e.end(t)+this.bufferPadding,d>=u&&o<=s)return!0;if(o<=u)return!1}return!1},_.onFragLoaded=function(d,o){var e=o.frag,u=o.part;if(e.sn==="initSegment"||e.bitrateTest||u)return;var s=A(e);this.fragments[s]={body:e,loaded:o,backtrack:null,buffered:!1,range:Object.create(null)}},_.onBufferAppended=function(d,o){var e=this,u=o.frag,s=o.part,t=o.timeRanges;if(u.type===T.PlaylistLevelType.MAIN)if(this.activeFragment=u,s){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(s)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(r){var E=t[r];if(e.detectEvictedFragments(r,E),!s)for(var m=0;m<E.length;m++)u.appendedPTS=Math.max(E.end(m),u.appendedPTS||0)})},_.onFragBuffered=function(d,o){this.detectPartialFragments(o)},_.hasFragment=function(d){var o=A(d);return!!this.fragments[o]},_.removeFragmentsInRange=function(d,o,e){var u=this;Object.keys(this.fragments).forEach(function(s){var t=u.fragments[s];if(!t)return;if(t.buffered){var n=t.body;n.type===e&&n.start<o&&n.end>d&&u.removeFragment(n)}})},_.removeFragment=function(d){var o=A(d);d.stats.loaded=0,d.clearElementaryStreamInfo(),delete this.fragments[o]},_.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},O}();function I(O){var _,f;return O.buffered&&(((_=O.range.video)===null||_===void 0?void 0:_.partial)||((f=O.range.audio)===null||f===void 0?void 0:f.partial))}function A(O){return O.type+"_"+O.level+"_"+O.urlId+"_"+O.sn}},"./src/controller/gap-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"STALL_MINIMUM_DURATION_MS",function(){return I}),S.d(N,"MAX_START_GAP_JUMP",function(){return A}),S.d(N,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return O}),S.d(N,"SKIP_BUFFER_RANGE_START",function(){return _}),S.d(N,"default",function(){return f});var L=S("./src/utils/buffer-helper.ts"),T=S("./src/errors.ts"),w=S("./src/events.ts"),D=S("./src/utils/logger.ts"),I=250,A=2,O=.1,_=.05,f=function(){function d(e,u,s,t){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=e,this.media=u,this.fragmentTracker=s,this.hls=t}var o=d.prototype;return o.destroy=function(){this.hls=this.fragmentTracker=this.media=null},o.poll=function(u){var s=this.config,t=this.media,n=this.stalled,r=t.currentTime,E=t.seeking,m=this.seeking&&!E,p=!this.seeking&&E;if(this.seeking=E,r!==u){if(this.moved=!0,n!==null){if(this.stallReported){var y=self.performance.now()-n;D.logger.warn("playback not stuck anymore @"+r+", after "+Math.round(y)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((p||m)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!L.BufferHelper.getBuffered(t).length)return;var v=L.BufferHelper.bufferInfo(t,r,0),a=v.len>0,c=v.nextStart||0;if(!a&&!c)return;if(E){var i=v.len>A,l=!c||c-r>A&&!this.fragmentTracker.getPartialFragment(r);if(i||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,h=Math.max(c,v.start||0)-r,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,R=b==null||((g=b.details)===null||g===void 0)?void 0:g.live,x=R?b.details.targetduration*2:A;if(h>0&&h<=x){this._trySkipBufferHole(null);return}}var P=self.performance.now();if(n===null){this.stalled=P;return}var M=P-n;!E&&M>=I&&this._reportStall(v.len);var k=L.BufferHelper.bufferInfo(t,r,s.maxBufferHole);this._tryFixBufferStall(k,M)},o._tryFixBufferStall=function(u,s){var t=this.config,n=this.fragmentTracker,r=this.media,E=r.currentTime,m=n.getPartialFragment(E);if(m){var p=this._trySkipBufferHole(m);if(p)return}u.len>t.maxBufferHole&&s>t.highBufferWatchdogPeriod*1e3&&(D.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},o._reportStall=function(u){var s=this.hls,t=this.media,n=this.stallReported;n||(this.stallReported=!0,D.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+u+")"),s.trigger(w.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:u}))},o._trySkipBufferHole=function(u){for(var s=this.config,t=this.hls,n=this.media,r=n.currentTime,E=0,m=L.BufferHelper.getBuffered(n),p=0;p<m.length;p++){var y=m.start(p);if(r+s.maxBufferHole>=E&&r<y){var v=Math.max(y+_,n.currentTime+O);return D.logger.warn("skipping hole, adjusting currentTime from "+r+" to "+v),this.moved=!0,this.stalled=null,n.currentTime=v,u&&t.trigger(w.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+r+" to "+v,frag:u}),v}E=m.end(p)}return 0},o._tryNudgeBuffer=function(){var u=this.config,s=this.hls,t=this.media,n=t.currentTime,r=(this.nudgeRetry||0)+1;if(this.nudgeRetry=r,r<u.nudgeMaxRetry){var E=n+r*u.nudgeOffset;D.logger.warn("Nudging 'currentTime' from "+n+" to "+E),t.currentTime=E,s.trigger(w.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else D.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+u.nudgeMaxRetry+" nudges"),s.trigger(w.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},d}()},"./src/controller/id3-track-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),w=S("./src/demux/id3.ts"),D=.25,I=function(){function A(_){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=_,this._registerListeners()}var O=A.prototype;return O.destroy=function(){this._unregisterListeners()},O._registerListeners=function(){var f=this.hls;f.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O._unregisterListeners=function(){var f=this.hls;f.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O.onMediaAttached=function(f,d){this.media=d.media},O.onMediaDetaching=function(){if(!this.id3Track)return;Object(T.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},O.getID3Track=function(f){if(!this.media)return;for(var d=0;d<f.length;d++){var o=f[d];if(o.kind==="metadata"&&o.label==="id3")return Object(T.sendAddTrackEvent)(o,this.media),o}return this.media.addTextTrack("metadata","id3")},O.onFragParsingMetadata=function(f,d){if(!this.media)return;var o=d.frag,e=d.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var u=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<e.length;s++){var t=w.getID3Frames(e[s].data);if(t){var n=e[s].pts,r=s<e.length-1?e[s+1].pts:o.end,E=r-n;E<=0&&(r=n+D);for(var m=0;m<t.length;m++){var p=t[m];if(!w.isTimeStampFrame(p)){var y=new u(n,r,"");y.value=p,this.id3Track.addCue(y)}}}}},O.onBufferFlushing=function(f,d){var o=d.startOffset,e=d.endOffset,u=d.type;if(!u||u==="audio"){var s=this.id3Track;s&&Object(T.removeCuesInRange)(s,o,e)}},A}();N.default=I},"./src/controller/latency-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return A});var L=S("./src/errors.ts"),T=S("./src/events.ts"),w=S("./src/utils/logger.ts");function D(O,_){for(var f=0;f<_.length;f++){var d=_[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(O,d.key,d)}}function I(O,_,f){return _&&D(O.prototype,_),f&&D(O,f),O}var A=function(){function O(f){var d=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 d.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var _=O.prototype;return _.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},_.registerListeners=function(){this.hls.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(T.Events.ERROR,this.onError,this)},_.unregisterListeners=function(){this.hls.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(T.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(T.Events.ERROR,this.onError)},_.onMediaAttached=function(d,o){this.media=o.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},_.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},_.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},_.onLevelUpdated=function(d,o){var e=o.details;this.levelDetails=e,e.advanced&&this.timeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},_.onError=function(d,o){if(o.details!==L.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,w.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},_.timeupdate=function(){var d=this.media,o=this.levelDetails;if(!d||!o)return;this.currentTime=d.currentTime;var e=this.computeLatency();if(e===null)return;this._latency=e;var u=this.config,s=u.lowLatencyMode,t=u.maxLiveSyncPlaybackRate;if(!s||t===1)return;var n=this.targetLatency;if(n===null)return;var r=e-n,E=Math.min(this.maxLatency,n+o.targetduration),m=r<E;if(o.live&&m&&r>.05&&this.forwardBufferLength>1){var p=Math.min(2,Math.max(1,t)),y=Math.round(2/(1+Math.exp(-.75*r-this.edgeStalled))*20)/20;d.playbackRate=Math.min(p,Math.max(1,y))}else d.playbackRate!==1&&d.playbackRate!==0&&(d.playbackRate=1)},_.estimateLiveEdge=function(){var d=this.levelDetails;return d===null?null:d.edge+d.age},_.computeLatency=function(){var d=this.estimateLiveEdge();return d===null?null:d-this.currentTime},I(O,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var d=this.config,o=this.levelDetails;return d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:o?d.liveMaxLatencyDurationCount*o.targetduration:0}},{key:"targetLatency",get:function(){var d=this.levelDetails;if(d===null)return null;var o=d.holdBack,e=d.partHoldBack,u=d.targetduration,s=this.config,t=s.liveSyncDuration,n=s.liveSyncDurationCount,r=s.lowLatencyMode,E=this.hls.userConfig,m=r&&e||o;(E.liveSyncDuration||E.liveSyncDurationCount||m===0)&&(m=t!==void 0?t:n*u);var p=u,y=1;return m+Math.min(this.stallCount*y,p)}},{key:"liveSyncPosition",get:function(){var d=this.estimateLiveEdge(),o=this.targetLatency,e=this.levelDetails;if(d===null||o===null||e===null)return null;var u=e.edge,s=d-o-this.edgeStalled,t=u-e.totalduration,n=u-(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.min(Math.max(t,s),n)}},{key:"drift",get:function(){var d=this.levelDetails;return d===null?1:d.drift}},{key:"edgeStalled",get:function(){var d=this.levelDetails;if(d===null)return 0;var o=(this.config.lowLatencyMode&&d.partTarget||d.targetduration)*3;return Math.max(d.age-o,0)}},{key:"forwardBufferLength",get:function(){var d=this.media,o=this.levelDetails;if(!d||!o)return 0;var e=d.buffered.length;return e?d.buffered.end(e-1):o.edge-this.currentTime}}]),O}()},"./src/controller/level-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return s});var L=S("./src/types/level.ts"),T=S("./src/events.ts"),w=S("./src/errors.ts"),D=S("./src/utils/codecs.ts"),I=S("./src/controller/level-helper.ts"),A=S("./src/controller/base-playlist-controller.ts"),O=S("./src/types/loader.ts");function _(){return _=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var E in r)Object.prototype.hasOwnProperty.call(r,E)&&(t[E]=r[E])}return t},_.apply(this,arguments)}function f(t,n){for(var r=0;r<n.length;r++){var E=n[r];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(t,E.key,E)}}function d(t,n,r){return n&&f(t.prototype,n),r&&f(t,r),t}function o(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,e(t,n)}function e(t,n){return e=Object.setPrototypeOf||function(E,m){return E.__proto__=m,E},e(t,n)}var u=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(t){o(n,t);function n(E){var m;return m=t.call(this,E,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var r=n.prototype;return r._registerListeners=function(){var m=this.hls;m.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(T.Events.ERROR,this.onError,this)},r._unregisterListeners=function(){var m=this.hls;m.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(T.Events.ERROR,this.onError,this)},r.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},r.startLoad=function(){var m=this._levels;m.forEach(function(p){p.loadError=0}),t.prototype.startLoad.call(this)},r.onManifestLoaded=function(m,p){var y=[],v=[],a=[],c,i={},l,g=!1,h=!1,b=!1;if(p.levels.forEach(function(M){var k=M.attrs;g=g||!!(M.width&&M.height),h=h||!!M.videoCodec,b=b||!!M.audioCodec,u&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var C=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;l=i[C],l?l.url.push(M.url):(l=new L.Level(M),i[C]=l,y.push(l)),k&&(k.AUDIO&&Object(I.addGroupId)(l,"audio",k.AUDIO),k.SUBTITLES&&Object(I.addGroupId)(l,"text",k.SUBTITLES))}),(g||h)&&b&&(y=y.filter(function(M){var k=M.videoCodec,C=M.width,U=M.height;return!!k||!!(C&&U)})),y=y.filter(function(M){var k=M.audioCodec,C=M.videoCodec;return(!k||Object(D.isCodecSupportedInMp4)(k,"audio"))&&(!C||Object(D.isCodecSupportedInMp4)(C,"video"))}),p.audioTracks&&(v=p.audioTracks.filter(function(M){return!M.audioCodec||Object(D.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(I.assignTrackIdsByGroup)(v)),p.subtitles&&(a=p.subtitles,Object(I.assignTrackIdsByGroup)(a)),y.length>0){c=y[0].bitrate,y.sort(function(M,k){return M.bitrate-k.bitrate}),this._levels=y;for(var R=0;R<y.length;R++)if(y[R].bitrate===c){this._firstLevel=R,this.log("manifest loaded, "+y.length+" level(s) found, first bitrate: "+c);break}var x=b&&!h,P={levels:y,audioTracks:v,subtitleTracks:a,firstLevel:this._firstLevel,stats:p.stats,audio:b,video:h,altAudio:!x&&v.some(function(M){return!!M.url})};this.hls.trigger(T.Events.MANIFEST_PARSED,P),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(T.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:p.url,reason:"no level with compatible codecs found in manifest"})},r.onError=function(m,p){if(t.prototype.onError.call(this,m,p),p.fatal)return;var y=p.context,v=this._levels[this.currentLevelIndex];if(y&&(y.type===O.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&y.groupId===v.audioGroupIds[v.urlId]||y.type===O.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&y.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var a=!1,c=!0,i;switch(p.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:case w.ErrorDetails.KEY_LOAD_ERROR:case w.ErrorDetails.KEY_LOAD_TIMEOUT:if(p.frag){var l=this._levels[p.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(i=p.frag.level)):i=p.frag.level}break;case w.ErrorDetails.LEVEL_LOAD_ERROR:case w.ErrorDetails.LEVEL_LOAD_TIMEOUT:y&&(y.deliveryDirectives&&(c=!1),i=y.level),a=!0;break;case w.ErrorDetails.REMUX_ALLOC_ERROR:i=p.level,a=!0;break}i!==void 0&&this.recoverLevel(p,i,a,c)},r.recoverLevel=function(m,p,y,v){var a=m.details,c=this._levels[p];if(c.loadError++,y){var i=this.retryLoadingOrFail(m);if(i)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var l=c.url.length;if(l>1&&c.loadError<l)m.levelRetry=!0,this.redundantFailover(p);else if(this.manualLevelIndex===-1){var g=p===0?this._levels.length-1:p-1;this.currentLevelIndex!==g&&this._levels[g].loadError===0&&(this.warn(a+": switch to "+g),m.levelRetry=!0,this.hls.nextAutoLevel=g)}}},r.redundantFailover=function(m){var p=this._levels[m],y=p.url.length;if(y>1){var v=(p.urlId+1)%y;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(a){a.urlId=v}),this.level=m}},r.onFragLoaded=function(m,p){var y=p.frag;if(y!==void 0&&y.type===O.PlaylistLevelType.MAIN){var v=this._levels[y.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},r.onLevelLoaded=function(m,p){var y,v=p.level,a=p.details,c=this._levels[v];if(!c){var i;this.warn("Invalid level index "+v),(i=p.deliveryDirectives)!==null&&i!==void 0&&i.skip&&(a.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(v,p,c.details)):(y=p.deliveryDirectives)!==null&&y!==void 0&&y.skip&&(a.deltaUpdateFailed=!0)},r.onAudioTrackSwitched=function(m,p){var y=this.hls.levels[this.currentLevelIndex];if(!y)return;if(y.audioGroupIds){for(var v=-1,a=this.hls.audioTracks[p.id].groupId,c=0;c<y.audioGroupIds.length;c++)if(y.audioGroupIds[c]===a){v=c;break}v!==y.urlId&&(y.urlId=v,this.startLoad())}},r.loadPlaylist=function(m){var p=this.currentLevelIndex,y=this._levels[p];if(this.canLoad&&y&&y.url.length>0){var v=y.urlId,a=y.url[v];if(m)try{a=m.addDirectives(a)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+p+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+v+" "+a),this.clearTimer(),this.hls.trigger(T.Events.LEVEL_LOADING,{url:a,level:p,id:v,deliveryDirectives:m||null})}},r.removeLevel=function(m,p){var y=function(c,i){return i!==p},v=this._levels.filter(function(a,c){return c!==m?!0:a.url.length>1&&p!==void 0?(a.url=a.url.filter(y),a.audioGroupIds&&(a.audioGroupIds=a.audioGroupIds.filter(y)),a.textGroupIds&&(a.textGroupIds=a.textGroupIds.filter(y)),a.urlId=0,!0):!1}).map(function(a,c){var i=a.details;return i!=null&&i.fragments&&i.fragments.forEach(function(l){l.level=c}),a});this._levels=v,this.hls.trigger(T.Events.LEVELS_UPDATED,{levels:v})},d(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var p,y=this._levels;if(y.length===0)return;if(this.currentLevelIndex===m&&(p=y[m])!==null&&p!==void 0&&p.details)return;if(m<0||m>=y.length){var v=m<0;if(this.hls.trigger(T.Events.ERROR,{type:w.ErrorTypes.OTHER_ERROR,details:w.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:v,reason:"invalid level idx"}),v)return;m=Math.min(m,y.length-1)}this.clearTimer();var a=this.currentLevelIndex,c=y[a],i=y[m];this.log("switching to level "+m+" from "+a),this.currentLevelIndex=m;var l=_({},i,{level:m,maxBitrate:i.maxBitrate,uri:i.uri,urlId:i.urlId});delete l._urlId,this.hls.trigger(T.Events.LEVEL_SWITCHING,l);var g=i.details;if(!g||g.live){var h=this.switchParams(i.uri,c==null?void 0:c.details);this.loadPlaylist(h)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),n}(A.default)},"./src/controller/level-helper.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"addGroupId",function(){return w}),S.d(N,"assignTrackIdsByGroup",function(){return D}),S.d(N,"updatePTS",function(){return I}),S.d(N,"updateFragPTSDTS",function(){return O}),S.d(N,"mergeDetails",function(){return _}),S.d(N,"mapPartIntersection",function(){return f}),S.d(N,"mapFragmentIntersection",function(){return d}),S.d(N,"adjustSliding",function(){return o}),S.d(N,"addSliding",function(){return e}),S.d(N,"computeReloadInterval",function(){return u}),S.d(N,"getFragmentWithSN",function(){return s}),S.d(N,"getPartWith",function(){return t});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts");function w(n,r,E){switch(r){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(E);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(E);break}}function D(n){var r={};n.forEach(function(E){var m=E.groupId||"";E.id=r[m]=r[m]||0,r[m]++})}function I(n,r,E){var m=n[r],p=n[E];A(m,p)}function A(n,r){var E=r.startPTS;if(Object(L.isFiniteNumber)(E)){var m=0,p;r.sn>n.sn?(m=E-n.start,p=n):(m=n.start-E,p=r),p.duration!==m&&(p.duration=m)}else if(r.sn>n.sn){var y=n.cc===r.cc;y&&n.minEndPTS?r.start=n.start+(n.minEndPTS-n.start):r.start=n.start+n.duration}else r.start=Math.max(n.start-r.duration,0)}function O(n,r,E,m,p,y){var v=m-E;v<=0&&(T.logger.warn("Fragment should have a positive duration",r),m=E+r.duration,y=p+r.duration);var a=E,c=m,i=r.startPTS,l=r.endPTS;if(Object(L.isFiniteNumber)(i)){var g=Math.abs(i-E);Object(L.isFiniteNumber)(r.deltaPTS)?r.deltaPTS=Math.max(g,r.deltaPTS):r.deltaPTS=g,a=Math.max(E,i),E=Math.min(E,i),p=Math.min(p,r.startDTS),c=Math.min(m,l),m=Math.max(m,l),y=Math.max(y,r.endDTS)}r.duration=m-E;var h=E-r.start;r.appendedPTS=m,r.start=r.startPTS=E,r.maxStartPTS=a,r.startDTS=p,r.endPTS=m,r.minEndPTS=c,r.endDTS=y;var b=r.sn;if(!n||b<n.startSN||b>n.endSN)return 0;var R,x=b-n.startSN,P=n.fragments;for(P[x]=r,R=x;R>0;R--)A(P[R],P[R-1]);for(R=x;R<P.length-1;R++)A(P[R],P[R+1]);return n.fragmentHint&&A(P[P.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,h}function _(n,r){for(var E=null,m=n.fragments,p=m.length-1;p>=0;p--){var y=m[p].initSegment;if(y){E=y;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var v=0,a;if(d(n,r,function(R,x){R.relurl&&(v=R.cc-x.cc),Object(L.isFiniteNumber)(R.startPTS)&&Object(L.isFiniteNumber)(R.endPTS)&&(x.start=x.startPTS=R.startPTS,x.startDTS=R.startDTS,x.appendedPTS=R.appendedPTS,x.maxStartPTS=R.maxStartPTS,x.endPTS=R.endPTS,x.endDTS=R.endDTS,x.minEndPTS=R.minEndPTS,x.duration=R.endPTS-R.startPTS,x.duration&&(a=x),r.PTSKnown=r.alignedSliding=!0),x.elementaryStreams=R.elementaryStreams,x.loader=R.loader,x.stats=R.stats,x.urlId=R.urlId,R.initSegment&&(x.initSegment=R.initSegment,E=R.initSegment)}),E){var c=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;c.forEach(function(R){var x;(!R.initSegment||R.initSegment.relurl===((x=E)===null||x===void 0?void 0:x.relurl))&&(R.initSegment=E)})}if(r.skippedSegments&&(r.deltaUpdateFailed=r.fragments.some(function(R){return!R}),r.deltaUpdateFailed)){T.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var i=r.skippedSegments;i--;)r.fragments.shift();r.startSN=r.fragments[0].sn,r.startCC=r.fragments[0].cc}var l=r.fragments;if(v){T.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<l.length;g++)l[g].cc+=v}r.skippedSegments&&(r.startCC=r.fragments[0].cc),f(n.partList,r.partList,function(R,x){x.elementaryStreams=R.elementaryStreams,x.stats=R.stats}),a?O(r,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS):o(n,r),l.length&&(r.totalduration=r.edge-l[0].start),r.driftStartTime=n.driftStartTime,r.driftStart=n.driftStart;var h=r.advancedDateTime;if(r.advanced&&h){var b=r.edge;r.driftStart||(r.driftStartTime=h,r.driftStart=b),r.driftEndTime=h,r.driftEnd=b}else r.driftEndTime=n.driftEndTime,r.driftEnd=n.driftEnd,r.advancedDateTime=n.advancedDateTime}function f(n,r,E){if(n&&r)for(var m=0,p=0,y=n.length;p<=y;p++){var v=n[p],a=r[p+m];v&&a&&v.index===a.index&&v.fragment.sn===a.fragment.sn?E(v,a):m--}}function d(n,r,E){for(var m=r.skippedSegments,p=Math.max(n.startSN,r.startSN)-r.startSN,y=(n.fragmentHint?1:0)+(m?r.endSN:Math.min(n.endSN,r.endSN))-r.startSN,v=r.startSN-n.startSN,a=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,c=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,i=p;i<=y;i++){var l=c[v+i],g=a[i];m&&!g&&i<m&&(g=r.fragments[i]=l),l&&g&&E(l,g)}}function o(n,r){var E=r.startSN+r.skippedSegments-n.startSN,m=n.fragments;if(E<0||E>=m.length)return;e(r,m[E].start)}function e(n,r){if(r){for(var E=n.fragments,m=n.skippedSegments;m<E.length;m++)E[m].start+=r;n.fragmentHint&&(n.fragmentHint.start+=r)}}function u(n,r){var E=1e3*n.levelTargetDuration,m=E/2,p=n.age,y=p>0&&p<E*3,v=r.loading.end-r.loading.start,a,c=n.availabilityDelay;if(n.updated===!1)if(y){var i=333*n.misses;a=Math.max(Math.min(m,v*2),i),n.availabilityDelay=(n.availabilityDelay||0)+a}else a=m;else y?(c=Math.min(c||E/2,p),n.availabilityDelay=c,a=c+E-p):a=E-v;return Math.round(a)}function s(n,r,E){if(!n||!n.details)return null;var m=n.details,p=m.fragments[r-m.startSN];return p||(p=m.fragmentHint,p&&p.sn===r?p:r<m.startSN&&E&&E.sn===r?E:null)}function t(n,r,E){if(!n||!n.details)return null;var m=n.details.partList;if(m)for(var p=m.length;p--;){var y=m[p];if(y.index===E&&y.fragment.sn===r)return y}return null}},"./src/controller/stream-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return m});var L=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),w=S("./src/is-supported.ts"),D=S("./src/events.ts"),I=S("./src/utils/buffer-helper.ts"),A=S("./src/controller/fragment-tracker.ts"),O=S("./src/types/loader.ts"),_=S("./src/loader/fragment.ts"),f=S("./src/demux/transmuxer-interface.ts"),d=S("./src/types/transmuxer.ts"),o=S("./src/controller/gap-controller.ts"),e=S("./src/errors.ts"),u=S("./src/utils/logger.ts");function s(p,y){for(var v=0;v<y.length;v++){var a=y[v];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function t(p,y,v){return y&&s(p.prototype,y),v&&s(p,v),p}function n(p,y){p.prototype=Object.create(y.prototype),p.prototype.constructor=p,r(p,y)}function r(p,y){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(p,y)}var E=100,m=function(p){n(y,p);function y(a,c){var i;return i=p.call(this,a,c,"[stream-controller]")||this,i.audioCodecSwap=!1,i.gapController=null,i.level=-1,i._forceStartLoad=!1,i.altAudio=!1,i.audioOnly=!1,i.fragPlaying=null,i.onvplaying=null,i.onvseeked=null,i.fragLastKbps=0,i.stalled=!1,i.couldBacktrack=!1,i.audioCodecSwitch=!1,i.videoBuffer=null,i._registerListeners(),i}var v=y.prototype;return v._registerListeners=function(){var c=this.hls;c.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(D.Events.ERROR,this.onError,this),c.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var c=this.hls;c.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(D.Events.ERROR,this.onError,this),c.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(c){if(this.levels){var i=this.lastCurrentTime,l=this.hls;if(this.stopLoad(),this.setInterval(E),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var g=l.startLevel;g===-1&&(l.config.testBandwidth?(g=0,this.bitrateTest=!0):g=l.nextAutoLevel),this.level=l.nextLoadLevel=g,this.loadedmetadata=!1}i>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+i.toFixed(3)),c=i),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=T.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,p.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_LEVEL:{var c,i=this.levels,l=this.level,g=i==null||((c=i[l])===null||c===void 0)?void 0:c.details;if(g&&(!g.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(g))break;this.state=T.State.IDLE;break}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var h,b=self.performance.now(),R=this.retryDate;(!R||b>=R||(h=this.media)!==null&&h!==void 0&&h.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=T.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){p.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var c,i,l=this.hls,g=this.levelLastLoaded,h=this.levels,b=this.media,R=l.config,x=l.nextLoadLevel;if(g===null||!b&&(this.startFragRequested||!R.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!h||!h[x])return;var P=h[x];this.level=l.nextLoadLevel=x;var M=P.details;if(!M||this.state===T.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==x){this.state=T.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,O.PlaylistLevelType.MAIN);if(k===null)return;var C=k.len,U=this.getMaxBufferLength(P.maxBitrate);if(C>=U)return;if(this._streamEnded(k,M)){var K={};this.altAudio&&(K.type="video"),this.hls.trigger(D.Events.BUFFER_EOS,K),this.state=T.State.ENDED;return}var ee=k.end,z=this.getNextFragment(ee,M);if(this.couldBacktrack&&!this.fragPrevious&&z&&z.sn!=="initSegment"){var ae=z.sn-M.startSN;ae>1&&(z=M.fragments[ae-1],this.fragmentTracker.removeFragment(z))}if(z&&this.fragmentTracker.getState(z)===A.FragmentState.OK&&this.nextLoadPosition>ee){var se=this.audioOnly&&!this.altAudio?_.ElementaryStreamTypes.AUDIO:_.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,se,O.PlaylistLevelType.MAIN),z=this.getNextFragment(this.nextLoadPosition,M)}if(!z)return;z.initSegment&&!z.initSegment.data&&!this.bitrateTest&&(z=z.initSegment),((c=z.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((i=z.decryptdata)!==null&&i!==void 0&&i.key)?this.loadKey(z,M):this.loadFragment(z,M,ee)},v.loadFragment=function(c,i,l){var g,h=this.fragmentTracker.getState(c);if(this.fragCurrent=c,h===A.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(c);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else h=A.FragmentState.NOT_LOADED}h===A.FragmentState.NOT_LOADED||h===A.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,c,i,l)):h===A.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(c){var i=this.fragmentTracker.getAppendedFrag(c,O.PlaylistLevelType.MAIN);return i&&"fragment"in i?i.fragment:i},v.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,O.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var c=this.levels,i=this.media;if(i!=null&&i.readyState){var l,g=this.getAppendedFrag(i.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!i.paused&&c){var h=this.hls.nextLoadLevel,b=c[h],R=this.fragLastKbps;R&&this.fragCurrent?l=this.fragCurrent.duration*b.maxBitrate/(1e3*R)+1:l=0}else l=0;var x=this.getBufferedFrag(i.currentTime+l);if(x){var P=this.followingBufferedFrag(x);if(P){this.abortCurrentFrag();var M=P.maxStartPTS?P.maxStartPTS:P.start,k=P.duration,C=Math.max(x.end,M+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(C,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===T.State.KEY_LOADING&&(this.state=T.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(c,i){p.prototype.flushMainBuffer.call(this,c,i,this.altAudio?"video":null)},v.onMediaAttached=function(c,i){p.prototype.onMediaAttached.call(this,c,i);var l=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),l.addEventListener("playing",this.onvplaying),l.addEventListener("seeked",this.onvseeked),this.gapController=new o.default(this.config,l,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),p.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var c=this.media,i=c?c.currentTime:null;Object(L.isFiniteNumber)(i)&&this.log("Media seeked to "+i.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(D.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(c,i){var l=!1,g=!1,h;i.levels.forEach(function(b){h=b.audioCodec,h&&(h.indexOf("mp4a.40.2")!==-1&&(l=!0),h.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=l&&g&&!Object(w.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=i.levels,this.startFragRequested=!1},v.onLevelLoading=function(c,i){var l=this.levels;if(!l||this.state!==T.State.IDLE)return;var g=l[i.level];(!g.details||g.details.live&&this.levelLastLoaded!==i.level||this.waitForCdnTuneIn(g.details))&&(this.state=T.State.WAITING_LEVEL)},v.onLevelLoaded=function(c,i){var l,g=this.levels,h=i.level,b=i.details,R=b.totalduration;if(!g){this.warn("Levels were reset while loading level "+h);return}this.log("Level "+h+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+R);var x=this.fragCurrent;x&&(this.state===T.State.FRAG_LOADING||this.state===T.State.FRAG_LOADING_WAITING_RETRY)&&(x.level!==i.level&&x.loader&&(this.state=T.State.IDLE,x.loader.abort()));var P=g[h],M=0;if(b.live||(l=P.details)!==null&&l!==void 0&&l.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;M=this.alignPlaylists(b,P.details)}if(P.details=b,this.levelLastLoaded=h,this.hls.trigger(D.Events.LEVEL_UPDATED,{details:b,level:h}),this.state===T.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=T.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,M),this.tick()},v._handleFragmentLoadProgress=function(c){var i,l=c.frag,g=c.part,h=c.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var R=b[l.level],x=R.details;if(!x){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var P=R.videoCodec,M=x.PTSKnown||!x.live,k=(i=l.initSegment)===null||i===void 0?void 0:i.data,C=this._getAudioCodec(R),U=this.transmuxer=this.transmuxer||new f.default(this.hls,O.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),K=g?g.index:-1,ee=K!==-1,z=new d.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,h.byteLength,K,ee),ae=this.initPTS[l.cc];U.push(h,k,C,P,l,g,x.totalduration,M,z,ae)},v.onAudioTrackSwitching=function(c,i){var l=this.altAudio,g=!!i.url,h=i.id;if(!g){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var R=this.hls;l&&R.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:h})}},v.onAudioTrackSwitched=function(c,i){var l=i.id,g=!!this.hls.audioTracks[l].url;if(g){var h=this.videoBuffer;h&&this.mediaBuffer!==h&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=h)}this.altAudio=g,this.tick()},v.onBufferCreated=function(c,i){var l=i.tracks,g,h,b=!1;for(var R in l){var x=l[R];if(x.id==="main"){if(h=R,g=x,R==="video"){var P=l[R];P&&(this.videoBuffer=P.buffer)}}else b=!0}b&&g?(this.log("Alternate track found, use "+h+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(c,i){var l=i.frag,g=i.part;if(l&&l.type!==O.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(l)){this.warn("Fragment "+l.sn+(g?" p: "+g.index:"")+" of level "+l.level+" finished buffering, but was aborted. state: "+this.state),this.state===T.State.PARSED&&(this.state=T.State.IDLE);return}var h=g?g.stats:l.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,g)},v.onError=function(c,i){switch(i.details){case e.ErrorDetails.FRAG_LOAD_ERROR:case e.ErrorDetails.FRAG_LOAD_TIMEOUT:case e.ErrorDetails.KEY_LOAD_ERROR:case e.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(O.PlaylistLevelType.MAIN,i);break;case e.ErrorDetails.LEVEL_LOAD_ERROR:case e.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(i.fatal?(this.warn(""+i.details),this.state=T.State.ERROR):!i.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case e.ErrorDetails.BUFFER_FULL_ERROR:if(i.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var l=!0,g=this.getFwdBufferInfo(this.media,O.PlaylistLevelType.MAIN);g&&g.len>.5&&(l=!this.reduceMaxBufferLength(g.len)),l&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var c=this.media,i=this.gapController;if(!c||!i||!c.readyState)return;var l=I.BufferHelper.getBuffered(c);!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this.seekToStartPos()):i.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(c,i){var l=i.type;if(l!==_.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(l===_.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,l,O.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(c,i){this.levels=i.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var c=this.media,i=c.currentTime,l=this.startPosition;if(l>=0&&i<l){if(c.seeking){u.logger.log("could not seek to "+l+", already seeking at "+i);return}var g=I.BufferHelper.getBuffered(c),h=g.length?g.start(0):0,b=h-l;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(u.logger.log("adjusting start position by "+b+" to match buffer start"),l+=b,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+i),c.currentTime=l}},v._getAudioCodec=function(c){var i=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&i&&(this.log("Swapping audio codec"),i.indexOf("mp4a.40.5")!==-1?i="mp4a.40.2":i="mp4a.40.5"),i},v._loadBitrateTestFrag=function(c){var i=this;this._doFragLoad(c).then(function(l){var g=i.hls;if(!l||g.nextLoadLevel||i.fragContextChanged(c))return;i.fragLoadError=0,i.state=T.State.IDLE,i.startFragRequested=!1,i.bitrateTest=!1;var h=c.stats;h.parsing.start=h.parsing.end=h.buffering.start=h.buffering.end=self.performance.now(),g.trigger(D.Events.FRAG_LOADED,l)})},v._handleTransmuxComplete=function(c){var i,l="main",g=this.hls,h=c.remuxResult,b=c.chunkMeta,R=this.getCurrentContext(b);if(!R){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var x=R.frag,P=R.part,M=R.level,k=h.video,C=h.text,U=h.id3,K=h.initSegment,ee=this.altAudio?void 0:h.audio;if(this.fragContextChanged(x))return;if(this.state=T.State.PARSING,K){K.tracks&&(this._bufferInitSegment(M,K.tracks,x,b),g.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:l,tracks:K.tracks}));var z=K.initPTS,ae=K.timescale;Object(L.isFiniteNumber)(z)&&(this.initPTS[x.cc]=z,g.trigger(D.Events.INIT_PTS_FOUND,{frag:x,id:l,initPTS:z,timescale:ae}))}if(k&&h.independent!==!1){if(M.details){var se=k.startPTS,V=k.endPTS,Y=k.startDTS,q=k.endDTS;if(P)P.elementaryStreams[k.type]={startPTS:se,endPTS:V,startDTS:Y,endDTS:q};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var G=this.getLoadPosition()+this.config.maxBufferHole;if(G<se){this.backtrack(x);return}x.setElementaryStreamInfo(k.type,x.start,V,x.start,q,!0)}x.setElementaryStreamInfo(k.type,se,V,Y,q),this.bufferFragmentData(k,x,P,b)}}else if(h.independent===!1){this.backtrack(x);return}if(ee){var X=ee.startPTS,de=ee.endPTS,Ee=ee.startDTS,Oe=ee.endDTS;P&&(P.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:de,startDTS:Ee,endDTS:Oe}),x.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,X,de,Ee,Oe),this.bufferFragmentData(ee,x,P,b)}if(U!=null&&(i=U.samples)!==null&&i!==void 0&&i.length){var me={frag:x,id:l,samples:U.samples};g.trigger(D.Events.FRAG_PARSING_METADATA,me)}if(C){var Se={frag:x,id:l,samples:C.samples};g.trigger(D.Events.FRAG_PARSING_USERDATA,Se)}},v._bufferInitSegment=function(c,i,l,g){var h=this;if(this.state!==T.State.PARSING)return;this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&delete i.audio;var b=i.audio,R=i.video,x=i.audiovideo;if(b){var P=c.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(P&&(P.indexOf("mp4a.40.5")!==-1?P="mp4a.40.2":P="mp4a.40.5"),b.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(P="mp4a.40.5")),M.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(P="mp4a.40.2",this.log("Android: force audio codec to "+P)),c.audioCodec&&c.audioCodec!==P&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+P+'"'),b.levelCodec=P,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(P||"")+"/"+(c.audioCodec||"")+"/"+b.codec+"]")}R&&(R.levelCodec=c.videoCodec,R.id="main",this.log("Init video buffer, container:"+R.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+R.codec+"]")),x&&this.log("Init audiovideo buffer, container:"+x.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+x.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,i),Object.keys(i).forEach(function(k){var C=i[k],U=C.initSegment;U!=null&&U.byteLength&&h.hls.trigger(D.Events.BUFFER_APPENDING,{type:k,data:U,frag:l,part:null,chunkMeta:g,parent:l.type})}),this.tick()},v.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var i=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,i?this.resetFragmentLoading(c):this.state=T.State.BACKTRACKING},v.checkFragmentChanged=function(){var c=this.media,i=null;if(c&&c.readyState>1&&c.seeking===!1){var l=c.currentTime;if(I.BufferHelper.isBuffered(c,l)?i=this.getAppendedFrag(l):I.BufferHelper.isBuffered(c,l+.1)&&(i=this.getAppendedFrag(l+.1)),i){var g=this.fragPlaying,h=i.level;(!g||i.sn!==g.sn||g.level!==h||i.urlId!==g.urlId)&&(this.hls.trigger(D.Events.FRAG_CHANGED,{frag:i}),(!g||g.level!==h)&&this.hls.trigger(D.Events.LEVEL_SWITCHED,{level:h}),this.fragPlaying=i)}}},t(y,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var i=this.getAppendedFrag(c.currentTime);if(i)return i.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var i=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(i)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),y}(T.default)},"./src/controller/subtitle-stream-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"SubtitleStreamController",function(){return n});var L=S("./src/events.ts"),T=S("./src/utils/logger.ts"),w=S("./src/utils/buffer-helper.ts"),D=S("./src/controller/fragment-finders.ts"),I=S("./src/utils/discontinuities.ts"),A=S("./src/controller/level-helper.ts"),O=S("./src/controller/fragment-tracker.ts"),_=S("./src/controller/base-stream-controller.ts"),f=S("./src/types/loader.ts"),d=S("./src/types/level.ts");function o(r,E){for(var m=0;m<E.length;m++){var p=E[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function e(r,E,m){return E&&o(r.prototype,E),m&&o(r,m),r}function u(r,E){r.prototype=Object.create(E.prototype),r.prototype.constructor=r,s(r,E)}function s(r,E){return s=Object.setPrototypeOf||function(p,y){return p.__proto__=y,p},s(r,E)}var t=500,n=function(r){u(E,r);function E(p,y){var v;return v=r.call(this,p,y,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var m=E.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var y=this.hls;y.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(L.Events.ERROR,this.onError,this),y.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),y.on(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),y.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),y.on(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),y.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var y=this.hls;y.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(L.Events.ERROR,this.onError,this),y.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),y.off(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),y.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),y.off(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),y.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=_.State.IDLE,this.setInterval(t),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(y,v){this.mainDetails=v.details},m.onSubtitleFragProcessed=function(y,v){var a=v.frag,c=v.success;if(this.fragPrevious=a,this.state=_.State.IDLE,!c)return;var i=this.tracksBuffered[this.currentTrackId];if(!i)return;for(var l,g=a.start,h=0;h<i.length;h++)if(g>=i[h].start&&g<=i[h].end){l=i[h];break}var b=a.start+a.duration;l?l.end=b:(l={start:g,end:b},i.push(l)),this.fragmentTracker.fragBuffered(a)},m.onBufferFlushing=function(y,v){var a=v.startOffset,c=v.endOffset;if(a===0&&c!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,l=this.levels;if(!l.length||!l[i]||!l[i].details)return;var g=l[i].details,h=g.targetduration,b=c-h;if(b<=0)return;v.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(R){for(var x=0;x<R.length;){if(R[x].end<=b){R.shift();continue}else if(R[x].start<b)R[x].start=b;else break;x++}}),this.fragmentTracker.removeFragmentsInRange(a,b,f.PlaylistLevelType.SUBTITLE)}},m.onError=function(y,v){var a,c=v.frag;if(!c||c.type!==f.PlaylistLevelType.SUBTITLE)return;(a=this.fragCurrent)!==null&&a!==void 0&&a.loader&&this.fragCurrent.loader.abort(),this.state=_.State.IDLE},m.onSubtitleTracksUpdated=function(y,v){var a=this,c=v.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(i){return new d.Level(i)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(i){a.tracksBuffered[i.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(y,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.levels[this.currentTrackId];a!=null&&a.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,a&&this.setInterval(t)},m.onSubtitleTrackLoaded=function(y,v){var a,c=v.details,i=v.id,l=this.currentTrackId,g=this.levels;if(!g.length)return;var h=g[l];if(i>=g.length||i!==l||!h)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(a=h.details)!==null&&a!==void 0&&a.live){var b=this.mainDetails;if(c.deltaUpdateFailed||!b)return;var R=b.fragments[0];if(!h.details)c.hasProgramDateTime&&b.hasProgramDateTime?Object(I.alignMediaPlaylistByPDT)(c,b):R&&Object(A.addSliding)(c,R.start);else{var x=this.alignPlaylists(c,h.details);x===0&&R&&Object(A.addSliding)(c,R.start)}}if(h.details=c,this.levelLastLoaded=i,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===_.State.IDLE){var P=Object(D.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);P||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)}},m._handleFragmentLoadComplete=function(y){var v=y.frag,a=y.payload,c=v.decryptdata,i=this.hls;if(this.fragContextChanged(v))return;if(a&&a.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var l=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(a),c.key.buffer,c.iv.buffer).then(function(g){var h=performance.now();i.trigger(L.Events.FRAG_DECRYPTED,{frag:v,payload:g,stats:{tstart:l,tdecrypt:h}})})}},m.doTick=function(){if(!this.media){this.state=_.State.IDLE;return}if(this.state===_.State.IDLE){var y,v=this.currentTrackId,a=this.levels;if(!a.length||!a[v]||!a[v].details)return;var c=a[v].details,i=c.targetduration,l=this.config,g=this.media,h=w.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,g.currentTime-i,l.maxBufferHole),b=h.end,R=h.len,x=this.getMaxBufferLength()+i;if(R>x)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var P=c.fragments,M=P.length,k=c.edge,C,U=this.fragPrevious;if(b<k){var K=l.maxFragLookUpTolerance;U&&c.hasProgramDateTime&&(C=Object(D.findFragmentByPDT)(P,U.endProgramDateTime,K)),C||(C=Object(D.findFragmentByPTS)(U,P,b,K),!C&&U&&U.start<P[0].start&&(C=P[0]))}else C=P[M-1];(y=C)!==null&&y!==void 0&&y.encrypted?(T.logger.log("Loading key for "+C.sn),this.state=_.State.KEY_LOADING,this.hls.trigger(L.Events.KEY_LOADING,{frag:C})):C&&this.fragmentTracker.getState(C)===O.FragmentState.NOT_LOADED&&this.loadFragment(C,c,b)}},m.loadFragment=function(y,v,a){this.fragCurrent=y,r.prototype.loadFragment.call(this,y,v,a)},e(E,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),E}(_.default)},"./src/controller/subtitle-track-controller.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),w=S("./src/controller/base-playlist-controller.ts"),D=S("./src/types/loader.ts");function I(o,e){for(var u=0;u<e.length;u++){var s=e[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function A(o,e,u){return e&&I(o.prototype,e),u&&I(o,u),o}function O(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,_(o,e)}function _(o,e){return _=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},_(o,e)}var f=function(o){O(e,o);function e(s){var t;return t=o.call(this,s,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var u=e.prototype;return u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,o.prototype.destroy.call(this)},u.registerListeners=function(){var t=this.hls;t.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(L.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var t=this.hls;t.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(L.Events.ERROR,this.onError,this)},u.onMediaAttached=function(t,n){if(this.media=n.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)},u.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},u.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 t=d(this.media.textTracks);t.forEach(function(n){Object(T.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(t,n){this.tracks=n.subtitleTracks},u.onSubtitleTrackLoaded=function(t,n){var r=n.id,E=n.details,m=this.trackId,p=this.tracksInGroup[m];if(!p){this.warn("Invalid subtitle track id "+r);return}var y=p.details;p.details=n.details,this.log("subtitle track "+r+" loaded ["+E.startSN+"-"+E.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,n,y))},u.onLevelLoading=function(t,n){this.switchLevel(n.level)},u.onLevelSwitching=function(t,n){this.switchLevel(n.level)},u.switchLevel=function(t){var n=this.hls.levels[t];if(!(n!=null&&n.textGroupIds))return;var r=n.textGroupIds[n.urlId];if(this.groupId!==r){var E=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(v){return!r||v.groupId===r});this.tracksInGroup=m;var p=this.findTrackId(E==null?void 0:E.name)||this.findTrackId();this.groupId=r;var y={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(L.Events.SUBTITLE_TRACKS_UPDATED,y),p!==-1&&this.setSubtitleTrack(p,E)}},u.findTrackId=function(t){for(var n=this.tracksInGroup,r=0;r<n.length;r++){var E=n[r];if((!this.selectDefaultTrack||E.default)&&(!t||t===E.name))return E.id}return-1},u.onError=function(t,n){if(o.prototype.onError.call(this,t,n),n.fatal||!n.context)return;n.context.type===D.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},u.loadPlaylist=function(t){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var r=n.id,E=n.groupId,m=n.url;if(t)try{m=t.addDirectives(m)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADING,{url:m,id:r,groupId:E,deliveryDirectives:t||null})}},u.toggleTrackModes=function(t){var n=this,r=this.media,E=this.subtitleDisplay,m=this.trackId;if(!r)return;var p=d(r.textTracks),y=p.filter(function(c){return c.groupId===n.groupId});if(t===-1)[].slice.call(p).forEach(function(c){c.mode="disabled"});else{var v=y[m];v&&(v.mode="disabled")}var a=y[t];a&&(a.mode=E?"showing":"hidden")},u.setSubtitleTrack=function(t,n){var r,E=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(r=E[t])!==null&&r!==void 0&&r.details)||t<-1||t>=E.length)return;this.clearTimer();var m=E[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,m){var p=m.id,y=m.groupId,v=y===void 0?"":y,a=m.name,c=m.type,i=m.url;this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:p,groupId:v,name:a,type:c,url:i});var l=this.switchParams(m.url,n==null?void 0:n.details);this.loadPlaylist(l)}else this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:t})},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,n=d(this.media.textTracks),r=0;r<n.length;r++)if(n[r].mode==="hidden")t=r;else if(n[r].mode==="showing"){t=r;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},A(e,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,n)}}]),e}(w.default);function d(o){for(var e=[],u=0;u<o.length;u++){var s=o[u];s.kind==="subtitles"&&s.label&&e.push(o[u])}return e}N.default=f},"./src/controller/timeline-controller.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"TimelineController",function(){return d});var L=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),w=S("./src/utils/cea-608-parser.ts"),D=S("./src/utils/output-filter.ts"),I=S("./src/utils/webvtt-parser.ts"),A=S("./src/utils/texttrack-utils.ts"),O=S("./src/utils/imsc1-ttml-parser.ts"),_=S("./src/types/loader.ts"),f=S("./src/utils/logger.ts"),d=function(){function s(n){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=u(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.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 r=new D.default(this,"textTrack1"),E=new D.default(this,"textTrack2"),m=new D.default(this,"textTrack3"),p=new D.default(this,"textTrack4");this.cea608Parser1=new w.default(1,r,E),this.cea608Parser2=new w.default(3,m,p)}n.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(T.Events.FRAG_LOADING,this.onFragLoading,this),n.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=s.prototype;return t.destroy=function(){var r=this.hls;r.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.off(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.off(T.Events.FRAG_LOADING,this.onFragLoading,this),r.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.off(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.off(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(r,E,m,p,y){for(var v=!1,a=y.length;a--;){var c=y[a],i=e(c[0],c[1],E,m);if(i>=0&&(c[0]=Math.min(c[0],E),c[1]=Math.max(c[1],m),v=!0,i/(m-E)>.5))return}if(v||y.push([E,m]),this.config.renderTextTracksNatively){var l=this.captionsTracks[r];this.Cues.newCue(l,E,m,p)}else{var g=this.Cues.newCue(null,E,m,p);this.hls.trigger(T.Events.CUES_PARSED,{type:"captions",cues:g,track:r})}},t.onInitPtsFound=function(r,E){var m=this,p=E.frag,y=E.id,v=E.initPTS,a=E.timescale,c=this.unparsedVttFrags;y==="main"&&(this.initPTS[p.cc]=v,this.timescale[p.cc]=a),c.length&&(this.unparsedVttFrags=[],c.forEach(function(i){m.onFragLoaded(T.Events.FRAG_LOADED,i)}))},t.getExistingTrack=function(r){var E=this.media;if(E)for(var m=0;m<E.textTracks.length;m++){var p=E.textTracks[m];if(p[r])return p}return null},t.createCaptionsTrack=function(r){this.config.renderTextTracksNatively?this.createNativeTrack(r):this.createNonNativeTrack(r)},t.createNativeTrack=function(r){if(this.captionsTracks[r])return;var E=this.captionsProperties,m=this.captionsTracks,p=this.media,y=E[r],v=y.label,a=y.languageCode,c=this.getExistingTrack(r);if(c)m[r]=c,Object(A.clearCurrentCues)(m[r]),Object(A.sendAddTrackEvent)(m[r],p);else{var i=this.createTextTrack("captions",v,a);i&&(i[r]=!0,m[r]=i)}},t.createNonNativeTrack=function(r){if(this.nonNativeCaptionsTracks[r])return;var E=this.captionsProperties[r];if(!E)return;var m=E.label,p={_id:r,label:m,kind:"captions",default:E.media?!!E.media.default:!1,closedCaptions:E.media};this.nonNativeCaptionsTracks[r]=p,this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[p]})},t.createTextTrack=function(r,E,m){var p=this.media;return p?p.addTextTrack(r,E,m):void 0},t.onMediaAttaching=function(r,E){this.media=E.media,this._cleanTracks()},t.onMediaDetaching=function(){var r=this.captionsTracks;Object.keys(r).forEach(function(E){Object(A.clearCurrentCues)(r[E]),delete r[E]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=u(),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())},t._cleanTracks=function(){var r=this.media;if(!r)return;var E=r.textTracks;if(E)for(var m=0;m<E.length;m++)Object(A.clearCurrentCues)(E[m])},t.onSubtitleTracksUpdated=function(r,E){var m=this;this.textTracks=[];var p=E.subtitleTracks||[],y=p.some(function(i){return i.textCodec===O.IMSC1_CODEC});if(this.config.enableWebVTT||y&&this.config.enableIMSC1){var v=this.tracks&&p&&this.tracks.length===p.length;if(this.tracks=p||[],this.config.renderTextTracksNatively){var a=this.media?this.media.textTracks:[];this.tracks.forEach(function(i,l){var g;if(l<a.length){for(var h=null,b=0;b<a.length;b++)if(o(a[b],i)){h=a[b];break}h&&(g=h)}g?Object(A.clearCurrentCues)(g):(g=m.createTextTrack("subtitles",i.name,i.lang),g&&(g.mode="disabled")),g&&(g.groupId=i.groupId,m.textTracks.push(g))})}else if(!v&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(i){return{label:i.name,kind:i.type.toLowerCase(),default:i.default,subtitleTrack:i}});this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},t.onManifestLoaded=function(r,E){var m=this;this.config.enableCEA708Captions&&E.captions&&E.captions.forEach(function(p){var y=/(?:CC|SERVICE)([1-4])/.exec(p.instreamId);if(!y)return;var v="textTrack"+y[1],a=m.captionsProperties[v];if(!a)return;a.label=p.name,p.lang&&(a.languageCode=p.lang),a.media=p})},t.onFragLoading=function(r,E){var m=this.cea608Parser1,p=this.cea608Parser2,y=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(m&&p))return;if(E.frag.type===_.PlaylistLevelType.MAIN){var a,c,i=E.frag.sn,l=(a=E==null||((c=E.part)===null||c===void 0)?void 0:c.index)!=null?a:-1;i===y+1||i===y&&l===v+1||(m.reset(),p.reset()),this.lastSn=i,this.lastPartIndex=l}},t.onFragLoaded=function(r,E){var m=E.frag,p=E.payload,y=this.initPTS,v=this.unparsedVttFrags;if(m.type===_.PlaylistLevelType.SUBTITLE)if(p.byteLength){if(!Object(L.isFiniteNumber)(y[m.cc])){v.push(E),y.length&&this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var a=m.decryptdata;if(a==null||a.key==null||a.method!=="AES-128"){var c=this.tracks[m.level],i=this.vttCCs;i[m.cc]||(i[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),c&&c.textCodec===O.IMSC1_CODEC?this._parseIMSC1(m,p):this._parseVTTs(m,p,i)}}else this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(r,E){var m=this,p=this.hls;Object(O.parseIMSC1)(E,this.initPTS[r.cc],this.timescale[r.cc],function(y){m._appendCues(y,r.level),p.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},function(y){f.logger.log("Failed to parse IMSC1: "+y),p.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:y})})},t._parseVTTs=function(r,E,m){var p=this,y=this.hls;Object(I.parseWebVTT)(E,this.initPTS[r.cc],this.timescale[r.cc],m,r.cc,r.start,function(v){p._appendCues(v,r.level),y.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},function(v){p._fallbackToIMSC1(r,E),f.logger.log("Failed to parse VTT cue: "+v),y.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:v})})},t._fallbackToIMSC1=function(r,E){var m=this,p=this.tracks[r.level];p.textCodec||Object(O.parseIMSC1)(E,this.initPTS[r.cc],this.timescale[r.cc],function(){p.textCodec=O.IMSC1_CODEC,m._parseIMSC1(r,E)},function(){p.textCodec="wvtt"})},t._appendCues=function(r,E){var m=this.hls;if(this.config.renderTextTracksNatively){var p=this.textTracks[E];if(p.mode==="disabled")return;r.forEach(function(a){return Object(A.addCueToTrack)(p,a)})}else{var y=this.tracks[E],v=y.default?"default":"subtitles"+E;m.trigger(T.Events.CUES_PARSED,{type:"subtitles",cues:r,track:v})}},t.onFragDecrypted=function(r,E){var m=E.frag;if(m.type===_.PlaylistLevelType.SUBTITLE){if(!Object(L.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(E);return}this.onFragLoaded(T.Events.FRAG_LOADED,E)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(r,E){var m=this.cea608Parser1,p=this.cea608Parser2;if(!this.enabled||!(m&&p))return;for(var y=0;y<E.samples.length;y++){var v=E.samples[y].bytes;if(v){var a=this.extractCea608Data(v);m.addData(E.samples[y].pts,a[0]),p.addData(E.samples[y].pts,a[1])}}},t.onBufferFlushing=function(r,E){var m=E.startOffset,p=E.endOffset,y=E.endOffsetSubtitles,v=E.type,a=this.media;if(!a||a.currentTime<p)return;if(!v||v==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(l){return Object(A.removeCuesInRange)(c[l],m,p)})}if(this.config.renderTextTracksNatively&&(m===0&&y!==void 0)){var i=this.textTracks;Object.keys(i).forEach(function(l){return Object(A.removeCuesInRange)(i[l],m,y)})}},t.extractCea608Data=function(r){for(var E=r[0]&31,m=2,p=[[],[]],y=0;y<E;y++){var v=r[m++],a=127&r[m++],c=127&r[m++],i=(4&v)!==0,l=3&v;if(a===0&&c===0)continue;i&&((l===0||l===1)&&(p[l].push(a),p[l].push(c)))}return p},s}();function o(s,t){return s&&s.label===t.name&&!(s.textTrack1||s.textTrack2)}function e(s,t,n,r){return Math.min(t,r)-Math.max(s,n)}function u(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return L});var L=function(){function T(D,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=D,this.aesIV=I}var w=T.prototype;return w.decrypt=function(I,A){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},A,I)},T}()},"./src/crypt/aes-decryptor.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"removePadding",function(){return T}),S.d(N,"default",function(){return w});var L=S("./src/utils/typed-array.ts");function T(D){var I=D.byteLength,A=I&&new DataView(D.buffer).getUint8(I-1);return A?Object(L.sliceUint8)(D,0,I-A):D}var w=function(){function D(){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 I=D.prototype;return I.uint8ArrayToUint32Array_=function(O){for(var _=new DataView(O),f=new Uint32Array(4),d=0;d<4;d++)f[d]=_.getUint32(d*4);return f},I.initTable=function(){var O=this.sBox,_=this.invSBox,f=this.subMix,d=f[0],o=f[1],e=f[2],u=f[3],s=this.invSubMix,t=s[0],n=s[1],r=s[2],E=s[3],m=new Uint32Array(256),p=0,y=0,v=0;for(v=0;v<256;v++)v<128?m[v]=v<<1:m[v]=v<<1^283;for(v=0;v<256;v++){var a=y^y<<1^y<<2^y<<3^y<<4;a=a>>>8^a&255^99,O[p]=a,_[a]=p;var c=m[p],i=m[c],l=m[i],g=m[a]*257^a*16843008;d[p]=g<<24|g>>>8,o[p]=g<<16|g>>>16,e[p]=g<<8|g>>>24,u[p]=g,g=l*16843009^i*65537^c*257^p*16843008,t[a]=g<<24|g>>>8,n[a]=g<<16|g>>>16,r[a]=g<<8|g>>>24,E[a]=g,p?(p=c^m[m[m[l^c]]],y^=m[m[y]]):p=y=1}},I.expandKey=function(O){for(var _=this.uint8ArrayToUint32Array_(O),f=!0,d=0;d<_.length&&f;)f=_[d]===this.key[d],d++;if(f)return;this.key=_;var o=this.keySize=_.length;if(o!==4&&o!==6&&o!==8)throw new Error("Invalid aes key size="+o);var e=this.ksRows=(o+6+1)*4,u,s,t=this.keySchedule=new Uint32Array(e),n=this.invKeySchedule=new Uint32Array(e),r=this.sBox,E=this.rcon,m=this.invSubMix,p=m[0],y=m[1],v=m[2],a=m[3],c,i;for(u=0;u<e;u++){if(u<o){c=t[u]=_[u];continue}i=c,u%o===0?(i=i<<8|i>>>24,i=r[i>>>24]<<24|r[i>>>16&255]<<16|r[i>>>8&255]<<8|r[i&255],i^=E[u/o|0]<<24):o>6&&u%o===4&&(i=r[i>>>24]<<24|r[i>>>16&255]<<16|r[i>>>8&255]<<8|r[i&255]),t[u]=c=(t[u-o]^i)>>>0}for(s=0;s<e;s++)u=e-s,s&3?i=t[u]:i=t[u-4],s<4||u<=4?n[s]=i:n[s]=p[r[i>>>24]]^y[r[i>>>16&255]]^v[r[i>>>8&255]]^a[r[i&255]],n[s]=n[s]>>>0},I.networkToHostOrderSwap=function(O){return O<<24|(O&65280)<<8|(O&16711680)>>8|O>>>24},I.decrypt=function(O,_,f){for(var d=this.keySize+6,o=this.invKeySchedule,e=this.invSBox,u=this.invSubMix,s=u[0],t=u[1],n=u[2],r=u[3],E=this.uint8ArrayToUint32Array_(f),m=E[0],p=E[1],y=E[2],v=E[3],a=new Int32Array(O),c=new Int32Array(a.length),i,l,g,h,b,R,x,P,M,k,C,U,K,ee,z=this.networkToHostOrderSwap;_<a.length;){for(M=z(a[_]),k=z(a[_+1]),C=z(a[_+2]),U=z(a[_+3]),b=M^o[0],R=U^o[1],x=C^o[2],P=k^o[3],K=4,ee=1;ee<d;ee++)i=s[b>>>24]^t[R>>16&255]^n[x>>8&255]^r[P&255]^o[K],l=s[R>>>24]^t[x>>16&255]^n[P>>8&255]^r[b&255]^o[K+1],g=s[x>>>24]^t[P>>16&255]^n[b>>8&255]^r[R&255]^o[K+2],h=s[P>>>24]^t[b>>16&255]^n[R>>8&255]^r[x&255]^o[K+3],b=i,R=l,x=g,P=h,K=K+4;i=e[b>>>24]<<24^e[R>>16&255]<<16^e[x>>8&255]<<8^e[P&255]^o[K],l=e[R>>>24]<<24^e[x>>16&255]<<16^e[P>>8&255]<<8^e[b&255]^o[K+1],g=e[x>>>24]<<24^e[P>>16&255]<<16^e[b>>8&255]<<8^e[R&255]^o[K+2],h=e[P>>>24]<<24^e[b>>16&255]<<16^e[R>>8&255]<<8^e[x&255]^o[K+3],c[_]=z(i^m),c[_+1]=z(h^p),c[_+2]=z(g^y),c[_+3]=z(l^v),m=M,p=k,y=C,v=U,_=_+4}return c.buffer},D}()},"./src/crypt/decrypter.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return _});var L=S("./src/crypt/aes-crypto.ts"),T=S("./src/crypt/fast-aes-key.ts"),w=S("./src/crypt/aes-decryptor.ts"),D=S("./src/utils/logger.ts"),I=S("./src/utils/mp4-tools.ts"),A=S("./src/utils/typed-array.ts"),O=16,_=function(){function f(o,e,u){var s=u===void 0?{}:u,t=s.removePKCS7Padding,n=t===void 0?!0:t;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=o,this.config=e,this.removePKCS7Padding=n,n)try{var r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(E){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var d=f.prototype;return d.destroy=function(){this.observer=null},d.isSync=function(){return this.config.enableSoftwareAES},d.flush=function(){var e=this.currentResult;if(!e){this.reset();return}var u=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Object(w.removePadding)(u):u},d.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},d.decrypt=function(e,u,s,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(e),u,s);var n=this.flush();n&&t(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(e),u,s).then(t)},d.softwareDecrypt=function(e,u,s){var t=this.currentIV,n=this.currentResult,r=this.remainderData;this.logOnce("JS AES decrypt"),r&&(e=Object(I.appendUint8Array)(r,e),this.remainderData=null);var E=this.getValidChunk(e);if(!E.length)return null;t&&(s=t);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new w.default),m.expandKey(u);var p=n;return this.currentResult=m.decrypt(E.buffer,0,s),this.currentIV=Object(A.sliceUint8)(E,-16).buffer,p||null},d.webCryptoDecrypt=function(e,u,s){var t=this,n=this.subtle;return(this.key!==u||!this.fastAesKey)&&(this.key=u,this.fastAesKey=new T.default(n,u)),this.fastAesKey.expandKey().then(function(r){if(!n)return Promise.reject(new Error("web crypto not initialized"));var E=new L.default(n,s);return E.decrypt(e.buffer,r)}).catch(function(r){return t.onWebCryptoError(r,e,u,s)})},d.onWebCryptoError=function(e,u,s,t){return D.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",e),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(u,s,t)},d.getValidChunk=function(e){var u=e,s=e.length-e.length%O;return s!==e.length&&(u=Object(A.sliceUint8)(e,0,s),this.remainderData=Object(A.sliceUint8)(e,s)),u},d.logOnce=function(e){if(!this.logEnabled)return;D.logger.log("[decrypter.ts]: "+e),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return L});var L=function(){function T(D,I){this.subtle=void 0,this.key=void 0,this.subtle=D,this.key=I}var w=T.prototype;return w.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},T}()},"./src/demux/aacdemuxer.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/adts.ts"),w=S("./src/utils/logger.ts"),D=S("./src/demux/id3.ts");function I(_,f){_.prototype=Object.create(f.prototype),_.prototype.constructor=_,A(_,f)}function A(_,f){return A=Object.setPrototypeOf||function(o,e){return o.__proto__=e,o},A(_,f)}var O=function(_){I(f,_);function f(o,e){var u;return u=_.call(this)||this,u.observer=void 0,u.config=void 0,u.observer=o,u.config=e,u}var d=f.prototype;return d.resetInitSegment=function(e,u,s){_.prototype.resetInitSegment.call(this,e,u,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:e,duration:s,inputTimeScale:9e4,dropped:0}},f.probe=function(e){if(!e)return!1;for(var u=D.getID3Data(e,0)||[],s=u.length,t=e.length;s<t;s++)if(T.probe(e,s))return w.logger.log("ADTS sync word found !"),!0;return!1},d.canParse=function(e,u){return T.canParse(e,u)},d.appendFrame=function(e,u,s){T.initTrackConfig(e,this.observer,u,s,e.manifestCodec);var t=T.appendFrame(e,u,s,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},f}(L.default);O.minProbeByteLength=9,N.default=O},"./src/demux/adts.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"getAudioConfig",function(){return D}),S.d(N,"isHeaderPattern",function(){return I}),S.d(N,"getHeaderLength",function(){return A}),S.d(N,"getFullFrameLength",function(){return O}),S.d(N,"canGetFrameLength",function(){return _}),S.d(N,"isHeader",function(){return f}),S.d(N,"canParse",function(){return d}),S.d(N,"probe",function(){return o}),S.d(N,"initTrackConfig",function(){return e}),S.d(N,"getFrameDuration",function(){return u}),S.d(N,"parseFrameHeader",function(){return s}),S.d(N,"appendFrame",function(){return t});var L=S("./src/utils/logger.ts"),T=S("./src/errors.ts"),w=S("./src/events.ts");function D(n,r,E,m){var p,y,v,a,c=navigator.userAgent.toLowerCase(),i=m,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];p=((r[E+2]&192)>>>6)+1;var g=(r[E+2]&60)>>>2;if(g>l.length-1){n.trigger(w.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g});return}return v=(r[E+2]&1)<<2,v|=(r[E+3]&192)>>>6,L.logger.log("manifest codec:"+m+", ADTS type:"+p+", samplingIndex:"+g),/firefox/i.test(c)?g>=6?(p=5,a=new Array(4),y=g-3):(p=2,a=new Array(2),y=g):c.indexOf("android")!==-1?(p=2,a=new Array(2),y=g):(p=5,a=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&g>=6?y=g-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(g>=6&&v===1||/vivaldi/i.test(c))||!m&&v===1)&&(p=2,a=new Array(2)),y=g)),a[0]=p<<3,a[0]|=(g&14)>>1,a[1]|=(g&1)<<7,a[1]|=v<<3,p===5&&(a[1]|=(y&14)>>1,a[2]=(y&1)<<7,a[2]|=2<<2,a[3]=0),{config:a,samplerate:l[g],channelCount:v,codec:"mp4a.40."+p,manifestCodec:i}}function I(n,r){return n[r]===255&&(n[r+1]&246)===240}function A(n,r){return n[r+1]&1?7:9}function O(n,r){return(n[r+3]&3)<<11|n[r+4]<<3|(n[r+5]&224)>>>5}function _(n,r){return r+5<n.length}function f(n,r){return r+1<n.length&&I(n,r)}function d(n,r){return _(n,r)&&I(n,r)&&O(n,r)<=n.length-r}function o(n,r){if(f(n,r)){var E=A(n,r);if(r+E>=n.length)return!1;var m=O(n,r);if(m<=E)return!1;var p=r+m;return p===n.length||f(n,p)}return!1}function e(n,r,E,m,p){if(!n.samplerate){var y=D(r,E,m,p);if(!y)return;n.config=y.config,n.samplerate=y.samplerate,n.channelCount=y.channelCount,n.codec=y.codec,n.manifestCodec=y.manifestCodec,L.logger.log("parsed codec:"+n.codec+", rate:"+y.samplerate+", channels:"+y.channelCount)}}function u(n){return 1024*9e4/n}function s(n,r,E,m,p){var y=A(n,r),v=O(n,r);if(v-=y,v>0){var a=E+m*p;return{headerLength:y,frameLength:v,stamp:a}}}function t(n,r,E,m,p){var y=u(n.samplerate),v=s(r,E,m,p,y);if(v){var a=v.frameLength,c=v.headerLength,i=v.stamp,l=c+a,g=Math.max(0,E+l-r.length),h;g?(h=new Uint8Array(l-c),h.set(r.subarray(E+c,r.length),0)):h=r.subarray(E+c,E+l);var b={unit:h,pts:i};return g||n.samples.push(b),{sample:b,length:l,missing:g}}}},"./src/demux/base-audio-demuxer.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"initPTSFn",function(){return O});var L=S("./src/polyfills/number.ts"),T=S("./src/demux/id3.ts"),w=S("./src/demux/dummy-demuxed-track.ts"),D=S("./src/utils/mp4-tools.ts"),I=S("./src/utils/typed-array.ts"),A=function(){function _(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=_.prototype;return f.resetInitSegment=function(o,e,u){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(o,e){return!1},f.appendFrame=function(o,e,u){},f.demux=function(o,e){this.cachedData&&(o=Object(D.appendUint8Array)(this.cachedData,o),this.cachedData=null);var u=T.getID3Data(o,0),s=u?u.length:0,t,n,r=this._audioTrack,E=this._id3Track,m=u?T.getTimeStamp(u):void 0,p=o.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=O(m,e)),u&&u.length>0&&E.samples.push({pts:this.initPTS,dts:this.initPTS,data:u}),n=this.initPTS;s<p;){if(this.canParse(o,s)){var y=this.appendFrame(r,o,s);y?(this.frameIndex++,n=y.sample.pts,s+=y.length,t=s):s=p}else T.canParse(o,s)?(u=T.getID3Data(o,s),E.samples.push({pts:n,dts:n,data:u}),s+=u.length,t=s):s++;if(s===p&&t!==p){var v=Object(I.sliceUint8)(o,t);this.cachedData?this.cachedData=Object(D.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:r,avcTrack:Object(w.dummyTrack)(),id3Track:E,textTrack:Object(w.dummyTrack)()}},f.demuxSampleAes=function(o,e,u){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(o){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(w.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(w.dummyTrack)()}},f.destroy=function(){},_}(),O=function(f,d){return Object(L.isFiniteNumber)(f)?f*90:d*9e4};N.default=A},"./src/demux/chunk-cache.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return L});var L=function(){function w(){this.chunks=[],this.dataLength=0}var D=w.prototype;return D.push=function(A){this.chunks.push(A),this.dataLength+=A.length},D.flush=function(){var A=this.chunks,O=this.dataLength,_;if(A.length)A.length===1?_=A[0]:_=T(A,O);else return new Uint8Array(0);return this.reset(),_},D.reset=function(){this.chunks.length=0,this.dataLength=0},w}();function T(w,D){for(var I=new Uint8Array(D),A=0,O=0;O<w.length;O++){var _=w[O];I.set(_,A),A+=_.length}return I}},"./src/demux/dummy-demuxed-track.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"dummyTrack",function(){return L});function L(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/utils/logger.ts"),T=function(){function w(I){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=I,this.bytesAvailable=I.byteLength,this.word=0,this.bitsAvailable=0}var D=w.prototype;return D.loadWord=function(){var A=this.data,O=this.bytesAvailable,_=A.byteLength-O,f=new Uint8Array(4),d=Math.min(4,O);if(d===0)throw new Error("no bytes available");f.set(A.subarray(_,_+d)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=d*8,this.bytesAvailable-=d},D.skipBits=function(A){var O;this.bitsAvailable>A?(this.word<<=A,this.bitsAvailable-=A):(A-=this.bitsAvailable,O=A>>3,A-=O>>3,this.bytesAvailable-=O,this.loadWord(),this.word<<=A,this.bitsAvailable-=A)},D.readBits=function(A){var O=Math.min(this.bitsAvailable,A),_=this.word>>>32-O;return A>32&&L.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=O,this.bitsAvailable>0?this.word<<=O:this.bytesAvailable>0&&this.loadWord(),O=A-O,O>0&&this.bitsAvailable?_<<O|this.readBits(O):_},D.skipLZ=function(){var A;for(A=0;A<this.bitsAvailable;++A)if((this.word&2147483648>>>A)!==0)return this.word<<=A,this.bitsAvailable-=A,A;return this.loadWord(),A+this.skipLZ()},D.skipUEG=function(){this.skipBits(1+this.skipLZ())},D.skipEG=function(){this.skipBits(1+this.skipLZ())},D.readUEG=function(){var A=this.skipLZ();return this.readBits(A+1)-1},D.readEG=function(){var A=this.readUEG();return 1&A?1+A>>>1:-1*(A>>>1)},D.readBoolean=function(){return this.readBits(1)===1},D.readUByte=function(){return this.readBits(8)},D.readUShort=function(){return this.readBits(16)},D.readUInt=function(){return this.readBits(32)},D.skipScalingList=function(A){for(var O=8,_=8,f,d=0;d<A;d++)_!==0&&(f=this.readEG(),_=(O+f+256)%256),O=_===0?O:_},D.readSPS=function(){var A=0,O=0,_=0,f=0,d,o,e,u=this.readUByte.bind(this),s=this.readBits.bind(this),t=this.readUEG.bind(this),n=this.readBoolean.bind(this),r=this.skipBits.bind(this),E=this.skipEG.bind(this),m=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);u();var y=u();if(s(5),r(3),u(),m(),y===100||y===110||y===122||y===244||y===44||y===83||y===86||y===118||y===128){var v=t();if(v===3&&r(1),m(),m(),r(1),n())for(o=v!==3?8:12,e=0;e<o;e++)n()&&(e<6?p(16):p(64))}m();var a=t();if(a===0)t();else if(a===1)for(r(1),E(),E(),d=t(),e=0;e<d;e++)E();m(),r(1);var c=t(),i=t(),l=s(1);l===0&&r(1),r(1),n()&&(A=t(),O=t(),_=t(),f=t());var g=[1,1];if(n()&&n()){var h=u();switch(h){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[u()<<8|u(),u()<<8|u()];break}}}return{width:Math.ceil((c+1)*16-A*2-O*2),height:(2-l)*(i+1)*16-(l?2:4)*(_+f),pixelRatio:g}},D.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},w}();N.default=T},"./src/demux/id3.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"isHeader",function(){return L}),S.d(N,"isFooter",function(){return T}),S.d(N,"getID3Data",function(){return w}),S.d(N,"canParse",function(){return I}),S.d(N,"getTimeStamp",function(){return A}),S.d(N,"isTimeStampFrame",function(){return O}),S.d(N,"getID3Frames",function(){return f}),S.d(N,"decodeFrame",function(){return d}),S.d(N,"utf8ArrayToStr",function(){return t}),S.d(N,"testables",function(){return n});var L=function(p,y){return y+10<=p.length&&(p[y]===73&&p[y+1]===68&&p[y+2]===51&&(p[y+3]<255&&p[y+4]<255&&(p[y+6]<128&&p[y+7]<128&&p[y+8]<128&&p[y+9]<128)))},T=function(p,y){return y+10<=p.length&&(p[y]===51&&p[y+1]===68&&p[y+2]===73&&(p[y+3]<255&&p[y+4]<255&&(p[y+6]<128&&p[y+7]<128&&p[y+8]<128&&p[y+9]<128)))},w=function(p,y){for(var v=y,a=0;L(p,y);){a+=10;var c=D(p,y+6);a+=c,T(p,y+10)&&(a+=10),y+=a}return a>0?p.subarray(v,v+a):void 0},D=function(p,y){var v=0;return v=(p[y]&127)<<21,v|=(p[y+1]&127)<<14,v|=(p[y+2]&127)<<7,v|=p[y+3]&127,v},I=function(p,y){return L(p,y)&&D(p,y+6)+10<=p.length-y},A=function(p){for(var y=f(p),v=0;v<y.length;v++){var a=y[v];if(O(a))return s(a)}return},O=function(p){return p&&p.key==="PRIV"&&p.info==="com.apple.streaming.transportStreamTimestamp"},_=function(p){var y=String.fromCharCode(p[0],p[1],p[2],p[3]),v=D(p,4),a=10;return{type:y,size:v,data:p.subarray(a,a+v)}},f=function(p){for(var y=0,v=[];L(p,y);){var a=D(p,y+6);y+=10;for(var c=y+a;y+8<c;){var i=_(p.subarray(y)),l=d(i);l&&v.push(l),y+=i.size+10}T(p,y)&&(y+=10)}return v},d=function(p){return p.type==="PRIV"?o(p):p.type[0]==="W"?u(p):e(p)},o=function(p){if(p.size<2)return;var y=t(p.data,!0),v=new Uint8Array(p.data.subarray(y.length+1));return{key:p.type,info:y,data:v.buffer}},e=function(p){if(p.size<2)return;if(p.type==="TXXX"){var y=1,v=t(p.data.subarray(y),!0);y+=v.length+1;var a=t(p.data.subarray(y));return{key:p.type,info:v,data:a}}var c=t(p.data.subarray(1));return{key:p.type,data:c}},u=function(p){if(p.type==="WXXX"){if(p.size<2)return;var y=1,v=t(p.data.subarray(y),!0);y+=v.length+1;var a=t(p.data.subarray(y));return{key:p.type,info:v,data:a}}var c=t(p.data);return{key:p.type,data:c}},s=function(p){if(p.data.byteLength===8){var y=new Uint8Array(p.data),v=y[3]&1,a=(y[4]<<23)+(y[5]<<15)+(y[6]<<7)+y[7];return a/=45,v&&(a+=4772185884e-2),Math.round(a)}return},t=function(p,y){y===void 0&&(y=!1);var v=E();if(v){var a=v.decode(p);if(y){var c=a.indexOf("\0");return c!==-1?a.substring(0,c):a}return a.replace(/\0/g,"")}for(var i=p.length,l,g,h,b="",R=0;R<i;){if(l=p[R++],l===0&&y)return b;if(l===0||l===3)continue;switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(l);break;case 12:case 13:g=p[R++],b+=String.fromCharCode((l&31)<<6|g&63);break;case 14:g=p[R++],h=p[R++],b+=String.fromCharCode((l&15)<<12|(g&63)<<6|(h&63)<<0);break;default:}}return b},n={decodeTextFrame:e},r;function E(){return!r&&typeof self.TextDecoder!="undefined"&&(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/id3.ts"),w=S("./src/utils/logger.ts"),D=S("./src/demux/mpegaudio.ts");function I(_,f){_.prototype=Object.create(f.prototype),_.prototype.constructor=_,A(_,f)}function A(_,f){return A=Object.setPrototypeOf||function(o,e){return o.__proto__=e,o},A(_,f)}var O=function(_){I(f,_);function f(){return _.apply(this,arguments)||this}var d=f.prototype;return d.resetInitSegment=function(e,u,s){_.prototype.resetInitSegment.call(this,e,u,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:e,duration:s,inputTimeScale:9e4,dropped:0}},f.probe=function(e){if(!e)return!1;for(var u=T.getID3Data(e,0)||[],s=u.length,t=e.length;s<t;s++)if(D.probe(e,s))return w.logger.log("MPEG Audio sync word found !"),!0;return!1},d.canParse=function(e,u){return D.canParse(e,u)},d.appendFrame=function(e,u,s){return this.initPTS===null?void 0:D.appendFrame(e,u,s,this.initPTS,this.frameIndex)},f}(L.default);O.minProbeByteLength=4,N.default=O},"./src/demux/mp4demuxer.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/utils/mp4-tools.ts"),T=S("./src/demux/dummy-demuxed-track.ts"),w=function(){function D(A,O){this.remainderData=null,this.config=void 0,this.config=O}var I=D.prototype;return I.resetTimeStamp=function(){},I.resetInitSegment=function(){},I.resetContiguity=function(){},D.probe=function(O){return Object(L.findBox)({data:O,start:0,end:Math.min(O.length,16384)},["moof"]).length>0},I.demux=function(O){var _=O,f=Object(T.dummyTrack)();if(this.config.progressive){this.remainderData&&(_=Object(L.appendUint8Array)(this.remainderData,O));var d=Object(L.segmentValidRange)(_);this.remainderData=d.remainder,f.samples=d.valid||new Uint8Array}else f.samples=_;return{audioTrack:Object(T.dummyTrack)(),avcTrack:f,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},I.flush=function(){var O=Object(T.dummyTrack)();return O.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(T.dummyTrack)(),avcTrack:O,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},I.demuxSampleAes=function(O,_,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},I.destroy=function(){},D}();w.minProbeByteLength=1024,N.default=w},"./src/demux/mpegaudio.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"appendFrame",function(){return A}),S.d(N,"parseHeader",function(){return O}),S.d(N,"isHeaderPattern",function(){return _}),S.d(N,"isHeader",function(){return f}),S.d(N,"canParse",function(){return d}),S.d(N,"probe",function(){return o});var L=null,T=[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],w=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],D=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function A(e,u,s,t,n){if(s+24>u.length)return;var r=O(u,s);if(r&&s+r.frameLength<=u.length){var E=r.samplesPerFrame*9e4/r.sampleRate,m=t+n*E,p={unit:u.subarray(s,s+r.frameLength),pts:m,dts:m};return e.config=[],e.channelCount=r.channelCount,e.samplerate=r.sampleRate,e.samples.push(p),{sample:p,length:r.frameLength,missing:0}}}function O(e,u){var s=e[u+1]>>3&3,t=e[u+1]>>1&3,n=e[u+2]>>4&15,r=e[u+2]>>2&3;if(s!==1&&n!==0&&n!==15&&r!==3){var E=e[u+2]>>1&1,m=e[u+3]>>6,p=s===3?3-t:t===3?3:4,y=T[p*14+n-1]*1e3,v=s===3?0:s===2?1:2,a=w[v*3+r],c=m===3?1:2,i=D[s][t],l=I[t],g=i*8*l,h=Math.floor(i*y/a+E)*l;if(L===null){var b=navigator.userAgent||"",R=b.match(/Chrome\/(\d+)/i);L=R?parseInt(R[1]):0}var x=!!L&&L<=87;return x&&t===2&&y>=224e3&&m===0&&(e[u+3]=e[u+3]|128),{sampleRate:a,channelCount:c,frameLength:h,samplesPerFrame:g}}}function _(e,u){return e[u]===255&&(e[u+1]&224)===224&&(e[u+1]&6)!==0}function f(e,u){return u+1<e.length&&_(e,u)}function d(e,u){var s=4;return _(e,u)&&s<=e.length-u}function o(e,u){if(u+1<e.length&&_(e,u)){var s=4,t=O(e,u),n=s;t!=null&&t.frameLength&&(n=t.frameLength);var r=u+n;return r===e.length||f(e,r)}return!1}},"./src/demux/sample-aes.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/crypt/decrypter.ts"),T=S("./src/demux/tsdemuxer.ts"),w=function(){function D(A,O,_){this.keyData=void 0,this.decrypter=void 0,this.keyData=_,this.decrypter=new L.default(A,O,{removePKCS7Padding:!1})}var I=D.prototype;return I.decryptBuffer=function(O,_){this.decrypter.decrypt(O,this.keyData.key.buffer,this.keyData.iv.buffer,_)},I.decryptAacSample=function(O,_,f,d){var o=O[_].unit,e=o.subarray(16,o.length-o.length%16),u=e.buffer.slice(e.byteOffset,e.byteOffset+e.length),s=this;this.decryptBuffer(u,function(t){var n=new Uint8Array(t);o.set(n,16),d||s.decryptAacSamples(O,_+1,f)})},I.decryptAacSamples=function(O,_,f){for(;;_++){if(_>=O.length){f();return}if(O[_].unit.length<32)continue;var d=this.decrypter.isSync();if(this.decryptAacSample(O,_,f,d),!d)return}},I.getAvcEncryptedData=function(O){for(var _=Math.floor((O.length-48)/160)*16+16,f=new Int8Array(_),d=0,o=32;o<=O.length-16;o+=160,d+=16)f.set(O.subarray(o,o+16),d);return f},I.getAvcDecryptedUnit=function(O,_){for(var f=new Uint8Array(_),d=0,o=32;o<=O.length-16;o+=160,d+=16)O.set(f.subarray(d,d+16),o);return O},I.decryptAvcSample=function(O,_,f,d,o,e){var u=Object(T.discardEPB)(o.data),s=this.getAvcEncryptedData(u),t=this;this.decryptBuffer(s.buffer,function(n){o.data=t.getAvcDecryptedUnit(u,n),e||t.decryptAvcSamples(O,_,f+1,d)})},I.decryptAvcSamples=function(O,_,f,d){if(O instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;_++,f=0){if(_>=O.length){d();return}for(var o=O[_].units;!(f>=o.length);f++){var e=o[f];if(e.data.length<=48||e.type!==1&&e.type!==5)continue;var u=this.decrypter.isSync();if(this.decryptAvcSample(O,_,f,d,e,u),!u)return}}},D}();N.default=w},"./src/demux/transmuxer-interface.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return o});var L=S("./node_modules/webworkify-webpack/index.js"),T=S.n(L),w=S("./src/events.ts"),D=S("./src/demux/transmuxer.ts"),I=S("./src/utils/logger.ts"),A=S("./src/errors.ts"),O=S("./src/utils/mediasource-helper.ts"),_=S("./node_modules/eventemitter3/index.js"),f=S.n(_),d=Object(O.getMediaSource)()||{isTypeSupported:function(){return!1}},o=function(){function e(s,t,n,r){var E=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=s,this.id=t,this.onTransmuxComplete=n,this.onFlush=r;var m=s.config,p=function(i,l){l=l||{},l.frag=E.frag,l.id=E.id,s.trigger(i,l)};this.observer=new _.EventEmitter,this.observer.on(w.Events.FRAG_DECRYPTED,p),this.observer.on(w.Events.ERROR,p);var y={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){I.logger.log("demuxing in webworker");var a;try{a=this.worker=L("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),a.addEventListener("message",this.onwmsg),a.onerror=function(c){s.trigger(w.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},a.postMessage({cmd:"init",typeSupported:y,vendor:v,id:t,config:JSON.stringify(m)})}catch(c){I.logger.warn("Error in worker:",c),I.logger.error("Error while initializing DemuxerWorker, fallback to inline"),a&&self.URL.revokeObjectURL(a.objectURL),this.transmuxer=new D.default(this.observer,y,m,v,t),this.worker=null}}else this.transmuxer=new D.default(this.observer,y,m,v,t)}var u=e.prototype;return u.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},u.push=function(t,n,r,E,m,p,y,v,a,c){var i=this;a.transmuxing.start=self.performance.now();var l=this.transmuxer,g=this.worker,h=p?p.start:m.start,b=m.decryptdata,R=this.frag,x=!(R&&m.cc===R.cc),P=!(R&&a.level===R.level),M=R?a.sn-R.sn:-1,k=this.part?a.part-this.part.index:1,C=!P&&(M===1||M===0&&k===1),U=self.performance.now();(P||M||m.stats.parsing.start===0)&&(m.stats.parsing.start=U),p&&(k||!C)&&(p.stats.parsing.start=U);var K=new D.TransmuxState(x,C,v,P,h);if(!C||x){I.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+a.sn+" p: "+a.part+" level: "+a.level+" id: "+a.id+`
discontinuity: `+x+`
trackSwitch: `+P+`
contiguous: `+C+`
accurateTimeOffset: `+v+`
timeOffset: `+h);var ee=new D.TransmuxConfig(r,E,n,y,c);this.configureTransmuxer(ee)}if(this.frag=m,this.part=p,g)g.postMessage({cmd:"demux",data:t,decryptdata:b,chunkMeta:a,state:K},t instanceof ArrayBuffer?[t]:[]);else if(l){var z=l.push(t,b,a,K);Object(D.isPromise)(z)?z.then(function(ae){i.handleTransmuxComplete(ae)}):this.handleTransmuxComplete(z)}},u.flush=function(t){var n=this;t.transmuxing.start=self.performance.now();var r=this.transmuxer,E=this.worker;if(E)E.postMessage({cmd:"flush",chunkMeta:t});else if(r){var m=r.flush(t);Object(D.isPromise)(m)?m.then(function(p){n.handleFlushResult(p,t)}):this.handleFlushResult(m,t)}},u.handleFlushResult=function(t,n){var r=this;t.forEach(function(E){r.handleTransmuxComplete(E)}),this.onFlush(n)},u.onWorkerMessage=function(t){var n=t.data,r=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,r.trigger(n.event,n.data);break}}},u.configureTransmuxer=function(t){var n=this.worker,r=this.transmuxer;n?n.postMessage({cmd:"configure",config:t}):r&&r.configure(t)},u.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},e}()},"./src/demux/transmuxer-worker.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return A});var L=S("./src/demux/transmuxer.ts"),T=S("./src/events.ts"),w=S("./src/utils/logger.ts"),D=S("./node_modules/eventemitter3/index.js"),I=S.n(D);function A(o){var e=new D.EventEmitter,u=function(t,n){o.postMessage({event:t,data:n})};e.on(T.Events.FRAG_DECRYPTED,u),e.on(T.Events.ERROR,u),o.addEventListener("message",function(s){var t=s.data;switch(t.cmd){case"init":{var n=JSON.parse(t.config);o.transmuxer=new L.default(e,t.typeSupported,n,t.vendor,t.id),Object(w.enableLogs)(n.debug),u("init",null);break}case"configure":{o.transmuxer.configure(t.config);break}case"demux":{var r=o.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(L.isPromise)(r)?r.then(function(p){O(o,p)}):O(o,r);break}case"flush":{var E=t.chunkMeta,m=o.transmuxer.flush(E);Object(L.isPromise)(m)?m.then(function(p){f(o,p,E)}):f(o,m,E);break}default:break}})}function O(o,e){if(d(e.remuxResult))return;var u=[],s=e.remuxResult,t=s.audio,n=s.video;t&&_(u,t),n&&_(u,n),o.postMessage({event:"transmuxComplete",data:e},u)}function _(o,e){e.data1&&o.push(e.data1.buffer),e.data2&&o.push(e.data2.buffer)}function f(o,e,u){e.forEach(function(s){O(o,s)}),o.postMessage({event:"flush",data:u})}function d(o){return!o.audio&&!o.video&&!o.text&&!o.id3&&!o.initSegment}},"./src/demux/transmuxer.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return n}),S.d(N,"isPromise",function(){return m}),S.d(N,"TransmuxConfig",function(){return p}),S.d(N,"TransmuxState",function(){return y});var L=S("./src/events.ts"),T=S("./src/errors.ts"),w=S("./src/crypt/decrypter.ts"),D=S("./src/demux/aacdemuxer.ts"),I=S("./src/demux/mp4demuxer.ts"),A=S("./src/demux/tsdemuxer.ts"),O=S("./src/demux/mp3demuxer.ts"),_=S("./src/remux/mp4-remuxer.ts"),f=S("./src/remux/passthrough-remuxer.ts"),d=S("./src/demux/chunk-cache.ts"),o=S("./src/utils/mp4-tools.ts"),e=S("./src/utils/logger.ts"),u;try{u=self.performance.now.bind(self.performance)}catch(v){e.logger.debug("Unable to use Performance API on this environment"),u=self.Date.now}var s=[{demux:A.default,remux:_.default},{demux:I.default,remux:f.default},{demux:D.default,remux:_.default},{demux:O.default,remux:_.default}],t=1024;s.forEach(function(v){var a=v.demux;t=Math.max(t,a.minProbeByteLength)});var n=function(){function v(c,i,l,g,h){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 d.default,this.observer=c,this.typeSupported=i,this.config=l,this.vendor=g,this.id=h}var a=v.prototype;return a.configure=function(i){this.transmuxConfig=i,this.decrypter&&this.decrypter.reset()},a.push=function(i,l,g,h){var b=this,R=g.transmuxing;R.executeStart=u();var x=new Uint8Array(i),P=this.cache,M=this.config,k=this.currentTransmuxState,C=this.transmuxConfig;h&&(this.currentTransmuxState=h);var U=r(x,l);if(U&&U.method==="AES-128"){var K=this.getDecrypter();if(M.enableSoftwareAES){var ee=K.softwareDecrypt(x,U.key.buffer,U.iv.buffer);if(!ee)return R.executeEnd=u(),E(g);x=new Uint8Array(ee)}else return this.decryptionPromise=K.webCryptoDecrypt(x,U.key.buffer,U.iv.buffer).then(function(be){var Ae=b.push(be,null,g);return b.decryptionPromise=null,Ae}),this.decryptionPromise}var z=h||k,ae=z.contiguous,se=z.discontinuity,V=z.trackSwitch,Y=z.accurateTimeOffset,q=z.timeOffset,G=C.audioCodec,X=C.videoCodec,de=C.defaultInitPts,Ee=C.duration,Oe=C.initSegmentData;if((se||V)&&this.resetInitSegment(Oe,G,X,Ee),se&&this.resetInitialTimestamp(de),ae||this.resetContiguity(),this.needsProbing(x,se,V)){if(P.dataLength){var me=P.flush();x=Object(o.appendUint8Array)(me,x)}this.configureTransmuxer(x,C)}var Se=this.transmux(x,U,q,Y,g),ve=this.currentTransmuxState;return ve.contiguous=!0,ve.discontinuity=!1,ve.trackSwitch=!1,R.executeEnd=u(),Se},a.flush=function(i){var l=this,g=i.transmuxing;g.executeStart=u();var h=this.decrypter,b=this.cache,R=this.currentTransmuxState,x=this.decryptionPromise;if(x)return x.then(function(){return l.flush(i)});var P=[],M=R.timeOffset;if(h){var k=h.flush();k&&P.push(this.push(k,null,i))}var C=b.dataLength;b.reset();var U=this.demuxer,K=this.remuxer;if(!U||!K)return C>=t&&this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),g.executeEnd=u(),[E(i)];var ee=U.flush(M);return m(ee)?ee.then(function(z){return l.flushRemux(P,z,i),P}):(this.flushRemux(P,ee,i),P)},a.flushRemux=function(i,l,g){var h=l.audioTrack,b=l.avcTrack,R=l.id3Track,x=l.textTrack,P=this.currentTransmuxState,M=P.accurateTimeOffset,k=P.timeOffset;e.logger.log("[transmuxer.ts]: Flushed fragment "+g.sn+(g.part>-1?" p: "+g.part:"")+" of level "+g.level);var C=this.remuxer.remux(h,b,R,x,k,M,!0,this.id);i.push({remuxResult:C,chunkMeta:g}),g.transmuxing.executeEnd=u()},a.resetInitialTimestamp=function(i){var l=this.demuxer,g=this.remuxer;if(!l||!g)return;l.resetTimeStamp(i),g.resetTimeStamp(i)},a.resetContiguity=function(){var i=this.demuxer,l=this.remuxer;if(!i||!l)return;i.resetContiguity(),l.resetNextTimestamp()},a.resetInitSegment=function(i,l,g,h){var b=this.demuxer,R=this.remuxer;if(!b||!R)return;b.resetInitSegment(l,g,h),R.resetInitSegment(i,l,g)},a.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},a.transmux=function(i,l,g,h,b){var R;return l&&l.method==="SAMPLE-AES"?R=this.transmuxSampleAes(i,l,g,h,b):R=this.transmuxUnencrypted(i,g,h,b),R},a.transmuxUnencrypted=function(i,l,g,h){var b=this.demuxer.demux(i,l,!1,!this.config.progressive),R=b.audioTrack,x=b.avcTrack,P=b.id3Track,M=b.textTrack,k=this.remuxer.remux(R,x,P,M,l,g,!1,this.id);return{remuxResult:k,chunkMeta:h}},a.transmuxSampleAes=function(i,l,g,h,b){var R=this;return this.demuxer.demuxSampleAes(i,l,g).then(function(x){var P=R.remuxer.remux(x.audioTrack,x.avcTrack,x.id3Track,x.textTrack,g,h,!1,R.id);return{remuxResult:P,chunkMeta:b}})},a.configureTransmuxer=function(i,l){for(var g=this.config,h=this.observer,b=this.typeSupported,R=this.vendor,x=l.audioCodec,P=l.defaultInitPts,M=l.duration,k=l.initSegmentData,C=l.videoCodec,U,K=0,ee=s.length;K<ee;K++)if(s[K].demux.probe(i)){U=s[K];break}U||(e.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),U={demux:I.default,remux:f.default});var z=this.demuxer,ae=this.remuxer,se=U.remux,V=U.demux;(!ae||!(ae instanceof se))&&(this.remuxer=new se(h,g,b,R)),(!z||!(z instanceof V))&&(this.demuxer=new V(h,g,b),this.probe=V.probe),this.resetInitSegment(k,x,C,M),this.resetInitialTimestamp(P)},a.needsProbing=function(i,l,g){return!this.demuxer||!this.remuxer||l||g},a.getDecrypter=function(){var i=this.decrypter;return i||(i=this.decrypter=new w.default(this.observer,this.config)),i},v}();function r(v,a){var c=null;return v.byteLength>0&&a!=null&&a.key!=null&&a.iv!==null&&a.method!=null&&(c=a),c}var E=function(a){return{remuxResult:{},chunkMeta:a}};function m(v){return"then"in v&&v.then instanceof Function}var p=function(a,c,i,l,g){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=a,this.videoCodec=c,this.initSegmentData=i,this.duration=l,this.defaultInitPts=g},y=function(a,c,i,l,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=a,this.contiguous=c,this.accurateTimeOffset=i,this.trackSwitch=l,this.timeOffset=g}},"./src/demux/tsdemuxer.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"discardEPB",function(){return E});var L=S("./src/demux/adts.ts"),T=S("./src/demux/mpegaudio.ts"),w=S("./src/demux/exp-golomb.ts"),D=S("./src/demux/id3.ts"),I=S("./src/demux/sample-aes.ts"),A=S("./src/events.ts"),O=S("./src/utils/mp4-tools.ts"),_=S("./src/utils/logger.ts"),f=S("./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},o=function(){function m(y,v,a){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=y,this.config=v,this.typeSupported=a}m.probe=function(v){var a=m.syncOffset(v);return a<0?!1:(a&&_.logger.warn("MPEG2-TS detected but first sync word found @ offset "+a+", junk ahead ?"),!0)},m.syncOffset=function(v){for(var a=Math.min(1e3,v.length-3*188),c=0;c<a;){if(v[c]===71&&v[c+188]===71&&v[c+2*188]===71)return c;c++}return-1},m.createTrack=function(v,a){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:d[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?a:void 0}};var p=m.prototype;return p.resetInitSegment=function(v,a,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",c),this._audioTrack=m.createTrack("audio",c),this._id3Track=m.createTrack("id3",c),this._txtTrack=m.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=a,this._duration=c},p.resetTimeStamp=function(){},p.resetContiguity=function(){var v=this._audioTrack,a=this._avcTrack,c=this._id3Track;v&&(v.pesData=null),a&&(a.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},p.demux=function(v,a,c,i){c===void 0&&(c=!1),i===void 0&&(i=!1),c||(this.sampleAes=null);var l,g=this._avcTrack,h=this._audioTrack,b=this._id3Track,R=g.pid,x=g.pesData,P=h.pid,M=b.pid,k=h.pesData,C=b.pesData,U=!1,K=this.pmtParsed,ee=this._pmtId,z=v.length;if(this.remainderData&&(v=Object(O.appendUint8Array)(this.remainderData,v),z=v.length,this.remainderData=null),z<188&&!i)return this.remainderData=v,{audioTrack:h,avcTrack:g,id3Track:b,textTrack:this._txtTrack};var ae=Math.max(0,m.syncOffset(v));z-=(z+ae)%188,z<v.byteLength&&!i&&(this.remainderData=new Uint8Array(v.buffer,z,v.buffer.byteLength-z));for(var se=ae;se<z;se+=188)if(v[se]===71){var V=!!(v[se+1]&64),Y=((v[se+1]&31)<<8)+v[se+2],q=(v[se+3]&48)>>4,G=void 0;if(q>1){if(G=se+5+v[se+4],G===se+188)continue}else G=se+4;switch(Y){case R:V&&(x&&(l=t(x))&&this.parseAVCPES(l,!1),x={data:[],size:0}),x&&(x.data.push(v.subarray(G,se+188)),x.size+=se+188-G);break;case P:V&&(k&&(l=t(k))&&(h.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),k={data:[],size:0}),k&&(k.data.push(v.subarray(G,se+188)),k.size+=se+188-G);break;case M:V&&(C&&(l=t(C))&&this.parseID3PES(l),C={data:[],size:0}),C&&(C.data.push(v.subarray(G,se+188)),C.size+=se+188-G);break;case 0:V&&(G+=v[G]+1),ee=this._pmtId=u(v,G);break;case ee:{V&&(G+=v[G]+1);var X=s(v,G,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);R=X.avc,R>0&&(g.pid=R),P=X.audio,P>0&&(h.pid=P,h.isAAC=X.isAAC),M=X.id3,M>0&&(b.pid=M),U&&!K&&(_.logger.log("reparse from beginning"),U=!1,se=ae-188),K=this.pmtParsed=!0;break}case 17:case 8191:break;default:U=!0;break}}else this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});g.pesData=x,h.pesData=k,b.pesData=C;var de={audioTrack:h,avcTrack:g,id3Track:b,textTrack:this._txtTrack};return i&&this.extractRemainingSamples(de),de},p.flush=function(){var v=this.remainderData;this.remainderData=null;var a;return v?a=this.demux(v,-1,!1,!0):a={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(a),this.sampleAes?this.decrypt(a,this.sampleAes):a},p.extractRemainingSamples=function(v){var a=v.audioTrack,c=v.avcTrack,i=v.id3Track,l=c.pesData,g=a.pesData,h=i.pesData,b;l&&(b=t(l))?(this.parseAVCPES(b,!0),c.pesData=null):c.pesData=l,g&&(b=t(g))?(a.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),a.pesData=null):(g!=null&&g.size&&_.logger.log("last AAC PES packet truncated,might overlap between fragments"),a.pesData=g),h&&(b=t(h))?(this.parseID3PES(b),i.pesData=null):i.pesData=h},p.demuxSampleAes=function(v,a,c){var i=this.demux(v,c,!0,!this.config.progressive),l=this.sampleAes=new I.default(this.observer,this.config,a);return this.decrypt(i,l)},p.decrypt=function(v,a){return new Promise(function(c){var i=v.audioTrack,l=v.avcTrack;i.samples&&i.isAAC?a.decryptAacSamples(i.samples,0,function(){l.samples?a.decryptAvcSamples(l.samples,0,0,function(){c(v)}):c(v)}):l.samples&&a.decryptAvcSamples(l.samples,0,0,function(){c(v)})})},p.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},p.parseAVCPES=function(v,a){var c=this,i=this._avcTrack,l=this.parseAVCNALu(v.data),g=!1,h=this.avcSample,b,R=!1;v.data=null,h&&l.length&&!i.audFound&&(n(h,i),h=this.avcSample=e(!1,v.pts,v.dts,"")),l.forEach(function(x){switch(x.type){case 1:{b=!0,h||(h=c.avcSample=e(!0,v.pts,v.dts,"")),g&&(h.debug+="NDR "),h.frame=!0;var P=x.data;if(R&&P.length>4){var M=new w.default(P).readSliceType();(M===2||M===4||M===7||M===9)&&(h.key=!0)}break}case 5:b=!0,h||(h=c.avcSample=e(!0,v.pts,v.dts,"")),g&&(h.debug+="IDR "),h.key=!0,h.frame=!0;break;case 6:{b=!0,g&&h&&(h.debug+="SEI ");var k=new w.default(E(x.data));k.readUByte();for(var C=0,U=0,K=!1,ee=0;!K&&k.bytesAvailable>1;){C=0;do ee=k.readUByte(),C+=ee;while(ee===255);U=0;do ee=k.readUByte(),U+=ee;while(ee===255);if(C===4&&k.bytesAvailable!==0){K=!0;var z=k.readUByte();if(z===181){var ae=k.readUShort();if(ae===49){var se=k.readUInt();if(se===1195456820){var V=k.readUByte();if(V===3){for(var Y=k.readUByte(),q=k.readUByte(),G=31&Y,X=[Y,q],de=0;de<G;de++)X.push(k.readUByte()),X.push(k.readUByte()),X.push(k.readUByte());r(c._txtTrack.samples,{type:3,pts:v.pts,bytes:X})}}}}}else if(C===5&&k.bytesAvailable!==0){if(K=!0,U>16){for(var Ee=[],Oe=0;Oe<16;Oe++)Ee.push(k.readUByte().toString(16)),(Oe===3||Oe===5||Oe===7||Oe===9)&&Ee.push("-");for(var me=U-16,Se=new Uint8Array(me),ve=0;ve<me;ve++)Se[ve]=k.readUByte();r(c._txtTrack.samples,{pts:v.pts,payloadType:C,uuid:Ee.join(""),userData:Object(D.utf8ArrayToStr)(Se),userDataBytes:Se})}}else if(U<k.bytesAvailable)for(var be=0;be<U;be++)k.readUByte()}break}case 7:if(b=!0,R=!0,g&&h&&(h.debug+="SPS "),!i.sps){var Ae=new w.default(x.data),Re=Ae.readSPS();i.width=Re.width,i.height=Re.height,i.pixelRatio=Re.pixelRatio,i.sps=[x.data],i.duration=c._duration;for(var Le=x.data.subarray(1,4),Ce="avc1.",xe=0;xe<3;xe++){var Be=Le[xe].toString(16);Be.length<2&&(Be="0"+Be),Ce+=Be}i.codec=Ce}break;case 8:b=!0,g&&h&&(h.debug+="PPS "),i.pps||(i.pps=[x.data]);break;case 9:b=!1,i.audFound=!0,h&&n(h,i),h=c.avcSample=e(!1,v.pts,v.dts,g?"AUD ":"");break;case 12:b=!1;break;default:b=!1,h&&(h.debug+="unknown NAL "+x.type+" ");break}if(h&&b){var Me=h.units;Me.push(x)}}),a&&h&&(n(h,i),this.avcSample=null)},p.getLastNalUnit=function(){var v,a=this.avcSample,c;if(!a||a.units.length===0){var i=this._avcTrack.samples;a=i[i.length-1]}if((v=a)!==null&&v!==void 0&&v.units){var l=a.units;c=l[l.length-1]}return c},p.parseAVCNALu=function(v){var a=v.byteLength,c=this._avcTrack,i=c.naluState||0,l=i,g=[],h=0,b,R,x,P=-1,M=0;for(i===-1&&(P=0,M=v[0]&31,i=0,h=1);h<a;){if(b=v[h++],!i){i=b?0:1;continue}if(i===1){i=b?0:2;continue}if(!b)i=3;else if(b===1){if(P>=0){var k={data:v.subarray(P,h-i-1),type:M};g.push(k)}else{var C=this.getLastNalUnit();if(C&&(l&&h<=4-l&&(C.state&&(C.data=C.data.subarray(0,C.data.byteLength-l))),R=h-i-1,R>0)){var U=new Uint8Array(C.data.byteLength+R);U.set(C.data,0),U.set(v.subarray(0,R),C.data.byteLength),C.data=U,C.state=0}}h<a?(x=v[h]&31,P=h,M=x,i=0):i=-1}else i=0}if(P>=0&&i>=0){var K={data:v.subarray(P,a),type:M,state:i};g.push(K)}if(g.length===0){var ee=this.getLastNalUnit();if(ee){var z=new Uint8Array(ee.data.byteLength+v.byteLength);z.set(ee.data,0),z.set(v,ee.data.byteLength),ee.data=z}}return c.naluState=i,g},p.parseAACPES=function(v){var a=0,c=this._audioTrack,i=this.aacOverFlow,l=v.data;if(i){this.aacOverFlow=null;var g=i.sample.unit.byteLength,h=Math.min(i.missing,g),b=g-h;i.sample.unit.set(l.subarray(0,h),b),c.samples.push(i.sample),a=i.missing}var R,x;for(R=a,x=l.length;R<x-1&&!L.isHeader(l,R);R++);if(R!==a){var P,M;if(R<x-1?(P="AAC PES did not start with ADTS header,offset:"+R,M=!1):(P="no ADTS header found in AAC PES",M=!0),_.logger.warn("parsing error:"+P),this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:P}),M)return}L.initTrackConfig(c,this.observer,l,R,this.audioCodec);var k;if(v.pts!==void 0)k=v.pts;else if(i){var C=L.getFrameDuration(c.samplerate);k=i.sample.pts+C}else{_.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var U=0;R<x;)if(L.isHeader(l,R)){if(R+5<x){var K=L.appendFrame(c,l,R,k,U);if(K)if(K.missing)this.aacOverFlow=K;else{R+=K.length,U++;continue}}break}else R++},p.parseMPEGPES=function(v){var a=v.data,c=a.length,i=0,l=0,g=v.pts;if(g===void 0){_.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<c;)if(T.isHeader(a,l)){var h=T.appendFrame(this._audioTrack,a,l,g,i);if(h)l+=h.length,i++;else break}else l++},p.parseID3PES=function(v){if(v.pts===void 0){_.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},m}();o.minProbeByteLength=188;function e(m,p,y,v){return{key:m,frame:!1,pts:p,dts:y,units:[],debug:v,length:0}}function u(m,p){return(m[p+10]&31)<<8|m[p+11]}function s(m,p,y,v){var a={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(m[p+1]&15)<<8|m[p+2],i=p+3+c-4,l=(m[p+10]&15)<<8|m[p+11];for(p+=12+l;p<i;){var g=(m[p+1]&31)<<8|m[p+2];switch(m[p]){case 207:if(!v){_.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:a.audio===-1&&(a.audio=g);break;case 21:a.id3===-1&&(a.id3=g);break;case 219:if(!v){_.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:a.avc===-1&&(a.avc=g);break;case 3:case 4:y?a.audio===-1&&(a.audio=g,a.isAAC=!1):_.logger.log("MPEG audio found, not supported in this browser");break;case 36:_.logger.warn("Unsupported HEVC stream type found");break;default:break}p+=((m[p+3]&15)<<8|m[p+4])+5}return a}function t(m){var p=0,y,v,a,c,i,l=m.data;if(!m||m.size===0)return null;for(;l[0].length<19&&l.length>1;){var g=new Uint8Array(l[0].length+l[1].length);g.set(l[0]),g.set(l[1],l[0].length),l[0]=g,l.splice(1,1)}y=l[0];var h=(y[0]<<16)+(y[1]<<8)+y[2];if(h===1){if(v=(y[4]<<8)+y[5],v&&v>m.size-6)return null;var b=y[7];b&192&&(c=(y[9]&14)*536870912+(y[10]&255)*4194304+(y[11]&254)*16384+(y[12]&255)*128+(y[13]&254)/2,b&64?(i=(y[14]&14)*536870912+(y[15]&255)*4194304+(y[16]&254)*16384+(y[17]&255)*128+(y[18]&254)/2,c-i>60*9e4&&(_.logger.warn(Math.round((c-i)/9e4)+"s delta between PTS and DTS, align them"),c=i)):i=c),a=y[8];var R=a+9;if(m.size<=R)return null;m.size-=R;for(var x=new Uint8Array(m.size),P=0,M=l.length;P<M;P++){y=l[P];var k=y.byteLength;if(R)if(R>k){R-=k;continue}else y=y.subarray(R),k-=R,R=0;x.set(y,p),p+=k}return v&&(v-=a+3),{data:x,pts:c,dts:i,len:v}}return null}function n(m,p){if(m.units.length&&m.frame){if(m.pts===void 0){var y=p.samples,v=y.length;if(v){var a=y[v-1];m.pts=a.pts,m.dts=a.dts}else{p.dropped++;return}}p.samples.push(m)}m.debug.length&&_.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function r(m,p){var y=m.length;if(y>0){if(p.pts>=m[y-1].pts)m.push(p);else for(var v=y-1;v>=0;v--)if(p.pts<m[v].pts){m.splice(v,0,p);break}}else m.push(p)}function E(m){for(var p=m.byteLength,y=[],v=1;v<p-2;)m[v]===0&&m[v+1]===0&&m[v+2]===3?(y.push(v+2),v+=2):v++;if(y.length===0)return m;var a=p-y.length,c=new Uint8Array(a),i=0;for(v=0;v<a;i++,v++)i===y[0]&&(i++,y.shift()),c[v]=m[i];return c}N.default=o},"./src/errors.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"ErrorTypes",function(){return L}),S.d(N,"ErrorDetails",function(){return T});var L;(function(w){w.NETWORK_ERROR="networkError",w.MEDIA_ERROR="mediaError",w.KEY_SYSTEM_ERROR="keySystemError",w.MUX_ERROR="muxError",w.OTHER_ERROR="otherError"})(L||(L={}));var T;(function(w){w.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",w.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",w.KEY_SYSTEM_NO_SESSION="keySystemNoSession",w.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",w.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",w.MANIFEST_LOAD_ERROR="manifestLoadError",w.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",w.MANIFEST_PARSING_ERROR="manifestParsingError",w.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",w.LEVEL_EMPTY_ERROR="levelEmptyError",w.LEVEL_LOAD_ERROR="levelLoadError",w.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",w.LEVEL_SWITCH_ERROR="levelSwitchError",w.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",w.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",w.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",w.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",w.FRAG_LOAD_ERROR="fragLoadError",w.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",w.FRAG_DECRYPT_ERROR="fragDecryptError",w.FRAG_PARSING_ERROR="fragParsingError",w.REMUX_ALLOC_ERROR="remuxAllocError",w.KEY_LOAD_ERROR="keyLoadError",w.KEY_LOAD_TIMEOUT="keyLoadTimeOut",w.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",w.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",w.BUFFER_APPEND_ERROR="bufferAppendError",w.BUFFER_APPENDING_ERROR="bufferAppendingError",w.BUFFER_STALLED_ERROR="bufferStalledError",w.BUFFER_FULL_ERROR="bufferFullError",w.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",w.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",w.INTERNAL_EXCEPTION="internalException",w.INTERNAL_ABORTED="aborted",w.UNKNOWN="unknown"})(T||(T={}))},"./src/events.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"Events",function(){return L});var L;(function(T){T.MEDIA_ATTACHING="hlsMediaAttaching",T.MEDIA_ATTACHED="hlsMediaAttached",T.MEDIA_DETACHING="hlsMediaDetaching",T.MEDIA_DETACHED="hlsMediaDetached",T.BUFFER_RESET="hlsBufferReset",T.BUFFER_CODECS="hlsBufferCodecs",T.BUFFER_CREATED="hlsBufferCreated",T.BUFFER_APPENDING="hlsBufferAppending",T.BUFFER_APPENDED="hlsBufferAppended",T.BUFFER_EOS="hlsBufferEos",T.BUFFER_FLUSHING="hlsBufferFlushing",T.BUFFER_FLUSHED="hlsBufferFlushed",T.MANIFEST_LOADING="hlsManifestLoading",T.MANIFEST_LOADED="hlsManifestLoaded",T.MANIFEST_PARSED="hlsManifestParsed",T.LEVEL_SWITCHING="hlsLevelSwitching",T.LEVEL_SWITCHED="hlsLevelSwitched",T.LEVEL_LOADING="hlsLevelLoading",T.LEVEL_LOADED="hlsLevelLoaded",T.LEVEL_UPDATED="hlsLevelUpdated",T.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",T.LEVELS_UPDATED="hlsLevelsUpdated",T.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",T.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",T.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",T.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",T.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",T.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",T.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",T.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",T.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",T.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",T.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",T.CUES_PARSED="hlsCuesParsed",T.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",T.INIT_PTS_FOUND="hlsInitPtsFound",T.FRAG_LOADING="hlsFragLoading",T.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",T.FRAG_LOADED="hlsFragLoaded",T.FRAG_DECRYPTED="hlsFragDecrypted",T.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",T.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",T.FRAG_PARSING_METADATA="hlsFragParsingMetadata",T.FRAG_PARSED="hlsFragParsed",T.FRAG_BUFFERED="hlsFragBuffered",T.FRAG_CHANGED="hlsFragChanged",T.FPS_DROP="hlsFpsDrop",T.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",T.ERROR="hlsError",T.DESTROYING="hlsDestroying",T.KEY_LOADING="hlsKeyLoading",T.KEY_LOADED="hlsKeyLoaded",T.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",T.BACK_BUFFER_REACHED="hlsBackBufferReached"})(L||(L={}))},"./src/hls.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return m});var L=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(L),w=S("./src/loader/playlist-loader.ts"),D=S("./src/loader/key-loader.ts"),I=S("./src/controller/id3-track-controller.ts"),A=S("./src/controller/latency-controller.ts"),O=S("./src/controller/level-controller.ts"),_=S("./src/controller/fragment-tracker.ts"),f=S("./src/controller/stream-controller.ts"),d=S("./src/is-supported.ts"),o=S("./src/utils/logger.ts"),e=S("./src/config.ts"),u=S("./node_modules/eventemitter3/index.js"),s=S.n(u),t=S("./src/events.ts"),n=S("./src/errors.ts");function r(p,y){for(var v=0;v<y.length;v++){var a=y[v];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function E(p,y,v){return y&&r(p.prototype,y),v&&r(p,v),p}var m=function(){p.isSupported=function(){return Object(d.isSupported)()};function p(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new u.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 a=this.config=Object(e.mergeConfig)(p.DefaultConfig,v);this.userConfig=v,Object(o.enableLogs)(a.debug),this._autoLevelCapping=-1,a.progressive&&Object(e.enableStreamingMode)(a);var c=a.abrController,i=a.bufferController,l=a.capLevelController,g=a.fpsController,h=this.abrController=new c(this),b=this.bufferController=new i(this),R=this.capLevelController=new l(this),x=new g(this),P=new w.default(this),M=new D.default(this),k=new I.default(this),C=this.levelController=new O.default(this),U=new _.FragmentTracker(this),K=this.streamController=new f.default(this,U);R.setStreamController(K),x.setStreamController(K);var ee=[C,K];this.networkControllers=ee;var z=[P,M,h,b,R,x,k,U];this.audioTrackController=this.createController(a.audioTrackController,null,ee),this.createController(a.audioStreamController,U,ee),this.subtitleTrackController=this.createController(a.subtitleTrackController,null,ee),this.createController(a.subtitleStreamController,U,ee),this.createController(a.timelineController,null,z),this.emeController=this.createController(a.emeController,null,z),this.cmcdController=this.createController(a.cmcdController,null,z),this.latencyController=this.createController(A.default,null,z),this.coreComponents=z}var y=p.prototype;return y.createController=function(a,c,i){if(a){var l=c?new a(this,c):new a(this);return i&&i.push(l),l}return null},y.on=function(a,c,i){i===void 0&&(i=this),this._emitter.on(a,c,i)},y.once=function(a,c,i){i===void 0&&(i=this),this._emitter.once(a,c,i)},y.removeAllListeners=function(a){this._emitter.removeAllListeners(a)},y.off=function(a,c,i,l){i===void 0&&(i=this),this._emitter.off(a,c,i,l)},y.listeners=function(a){return this._emitter.listeners(a)},y.emit=function(a,c,i){return this._emitter.emit(a,c,i)},y.trigger=function(a,c){if(this.config.debug)return this.emit(a,a,c);try{return this.emit(a,a,c)}catch(i){o.logger.error("An internal error happened while handling event "+a+'. Error message: "'+i.message+'". Here is a stacktrace:',i),this.trigger(t.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:a,error:i})}return!1},y.listenerCount=function(a){return this._emitter.listenerCount(a)},y.destroy=function(){o.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(a){return a.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(a){return a.destroy()}),this.coreComponents.length=0},y.attachMedia=function(a){o.logger.log("attachMedia"),this._media=a,this.trigger(t.Events.MEDIA_ATTACHING,{media:a})},y.detachMedia=function(){o.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},y.loadSource=function(a){this.stopLoad();var c=this.media,i=this.url,l=this.url=L.buildAbsoluteURL(self.location.href,a,{alwaysNormalize:!0});o.logger.log("loadSource:"+l),c&&i&&i!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(t.Events.MANIFEST_LOADING,{url:a})},y.startLoad=function(a){a===void 0&&(a=-1),o.logger.log("startLoad("+a+")"),this.networkControllers.forEach(function(c){c.startLoad(a)})},y.stopLoad=function(){o.logger.log("stopLoad"),this.networkControllers.forEach(function(a){a.stopLoad()})},y.swapAudioCodec=function(){o.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},y.recoverMediaError=function(){o.logger.log("recoverMediaError");var a=this._media;this.detachMedia(),a&&this.attachMedia(a)},y.removeLevel=function(a,c){c===void 0&&(c=0),this.levelController.removeLevel(a,c)},E(p,[{key:"levels",get:function(){var a=this.levelController.levels;return a||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(a){o.logger.log("set currentLevel:"+a),this.loadLevel=a,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(a){o.logger.log("set nextLevel:"+a),this.levelController.manualLevel=a,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(a){o.logger.log("set loadLevel:"+a),this.levelController.manualLevel=a}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(a){this.levelController.nextLoadLevel=a}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(a){o.logger.log("set firstLevel:"+a),this.levelController.firstLevel=a}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(a){o.logger.log("set startLevel:"+a),a!==-1&&(a=Math.max(a,this.minAutoLevel)),this.levelController.startLevel=a}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(a){var c=!!a;c!==this.config.capLevelToPlayerSize&&(c?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=c)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(a){this._autoLevelCapping!==a&&(o.logger.log("set autoLevelCapping:"+a),this._autoLevelCapping=a)}},{key:"bandwidthEstimate",get:function(){var a=this.abrController.bwEstimator;return a?a.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var a=this.levels,c=this.config.minAutoBitrate;if(!a)return 0;for(var i=a.length,l=0;l<i;l++)if(a[l].maxBitrate>c)return l;return 0}},{key:"maxAutoLevel",get:function(){var a=this.levels,c=this.autoLevelCapping,i;return c===-1&&a&&a.length?i=a.length-1:i=c,i}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(a){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,a)}},{key:"audioTracks",get:function(){var a=this.audioTrackController;return a?a.audioTracks:[]}},{key:"audioTrack",get:function(){var a=this.audioTrackController;return a?a.audioTrack:-1},set:function(a){var c=this.audioTrackController;c&&(c.audioTrack=a)}},{key:"subtitleTracks",get:function(){var a=this.subtitleTrackController;return a?a.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var a=this.subtitleTrackController;return a?a.subtitleTrack:-1},set:function(a){var c=this.subtitleTrackController;c&&(c.subtitleTrack=a)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var a=this.subtitleTrackController;return a?a.subtitleDisplay:!1},set:function(a){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=a)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(a){this.config.lowLatencyMode=a}},{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 t.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return p.defaultConfig?p.defaultConfig:e.hlsDefaultConfig},set:function(a){p.defaultConfig=a}}]),p}();m.defaultConfig=void 0},"./src/is-supported.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"isSupported",function(){return w}),S.d(N,"changeTypeSupported",function(){return D});var L=S("./src/utils/mediasource-helper.ts");function T(){return self.SourceBuffer||self.WebKitSourceBuffer}function w(){var I=Object(L.getMediaSource)();if(!I)return!1;var A=T(),O=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),_=!A||A.prototype&&typeof A.prototype.appendBuffer=="function"&&typeof A.prototype.remove=="function";return!!O&&!!_}function D(){var I,A=T();return typeof(A==null||((I=A.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return o}),S.d(N,"LoadError",function(){return u});var L=S("./src/polyfills/number.ts"),T=S("./src/errors.ts");function w(s,t){s.prototype=Object.create(t.prototype),s.prototype.constructor=s,_(s,t)}function D(s){var t=typeof Map=="function"?new Map:void 0;return D=function(r){if(r===null||!O(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,E)}function E(){return I(r,arguments,f(this).constructor)}return E.prototype=Object.create(r.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),_(E,r)},D(s)}function I(s,t,n){return A()?I=Reflect.construct:I=function(E,m,p){var y=[null];y.push.apply(y,m);var v=Function.bind.apply(E,y),a=new v;return p&&_(a,p.prototype),a},I.apply(null,arguments)}function A(){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(s){return!1}}function O(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function _(s,t){return _=Object.setPrototypeOf||function(r,E){return r.__proto__=E,r},_(s,t)}function f(s){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},f(s)}var d=Math.pow(2,17),o=function(){function s(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var t=s.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(r,E){var m=this,p=r.url;if(!p)return Promise.reject(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,networkDetails:null},"Fragment does not have a "+(p?"part list":"url")));this.abort();var y=this.config,v=y.fLoader,a=y.loader;return new Promise(function(c,i){m.loader&&m.loader.destroy();var l=m.loader=r.loader=v?new v(y):new a(y),g=e(r),h={timeout:y.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:y.fragLoadingMaxRetryTimeout,highWaterMark:d};r.stats=l.stats,l.load(g,h,{onSuccess:function(R,x,P,M){m.resetLoader(r,l),c({frag:r,part:null,payload:R.data,networkDetails:M})},onError:function(R,x,P){m.resetLoader(r,l),i(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,response:R,networkDetails:P}))},onAbort:function(R,x,P){m.resetLoader(r,l),i(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,networkDetails:P}))},onTimeout:function(R,x,P){m.resetLoader(r,l),i(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,networkDetails:P}))},onProgress:function(R,x,P,M){E&&E({frag:r,part:null,payload:P,networkDetails:M})}})})},t.loadPart=function(r,E,m){var p=this;this.abort();var y=this.config,v=y.fLoader,a=y.loader;return new Promise(function(c,i){p.loader&&p.loader.destroy();var l=p.loader=r.loader=v?new v(y):new a(y),g=e(r,E),h={timeout:y.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:y.fragLoadingMaxRetryTimeout,highWaterMark:d};E.stats=l.stats,l.load(g,h,{onSuccess:function(R,x,P,M){p.resetLoader(r,l),p.updateStatsFromPart(r,E);var k={frag:r,part:E,payload:R.data,networkDetails:M};m(k),c(k)},onError:function(R,x,P){p.resetLoader(r,l),i(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,part:E,response:R,networkDetails:P}))},onAbort:function(R,x,P){r.stats.aborted=E.stats.aborted,p.resetLoader(r,l),i(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,part:E,networkDetails:P}))},onTimeout:function(R,x,P){p.resetLoader(r,l),i(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,part:E,networkDetails:P}))}})})},t.updateStatsFromPart=function(r,E){var m=r.stats,p=E.stats,y=p.total;if(m.loaded+=p.loaded,y){var v=Math.round(r.duration/E.duration),a=Math.min(Math.round(m.loaded/y),v),c=v-a,i=c*Math.round(m.loaded/a);m.total=m.loaded+i}else m.total=Math.max(m.loaded,m.total);var l=m.loading,g=p.loading;l.start?l.first+=g.first-g.start:(l.start=g.start,l.first=g.first),l.end=g.end},t.resetLoader=function(r,E){r.loader=null,this.loader===E&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),E.destroy()},s}();function e(s,t){t===void 0&&(t=null);var n=t||s,r={frag:s,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},E=n.byteRangeStartOffset,m=n.byteRangeEndOffset;return Object(L.isFiniteNumber)(E)&&Object(L.isFiniteNumber)(m)&&(r.rangeStart=E,r.rangeEnd=m),r}var u=function(s){w(t,s);function t(n){for(var r,E=arguments.length,m=new Array(E>1?E-1:0),p=1;p<E;p++)m[p-1]=arguments[p];return r=s.call.apply(s,[this].concat(m))||this,r.data=void 0,r.data=n,r}return t}(D(Error))},"./src/loader/fragment.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"ElementaryStreamTypes",function(){return o}),S.d(N,"BaseSegment",function(){return e}),S.d(N,"Fragment",function(){return u}),S.d(N,"Part",function(){return s});var L=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),w=S.n(T),D=S("./src/utils/logger.ts"),I=S("./src/loader/level-key.ts"),A=S("./src/loader/load-stats.ts");function O(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,_(t,n)}function _(t,n){return _=Object.setPrototypeOf||function(E,m){return E.__proto__=m,E},_(t,n)}function f(t,n){for(var r=0;r<n.length;r++){var E=n[r];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(t,E.key,E)}}function d(t,n,r){return n&&f(t.prototype,n),r&&f(t,r),t}var o;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(o||(o={}));var e=function(){function t(r){var E;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(E={},E[o.AUDIO]=null,E[o.VIDEO]=null,E[o.AUDIOVIDEO]=null,E),this.baseurl=r}var n=t.prototype;return n.setByteRange=function(E,m){var p=E.split("@",2),y=[];p.length===1?y[0]=m?m.byteRangeEndOffset:0:y[0]=parseInt(p[1]),y[1]=parseInt(p[0])+y[0],this._byteRange=y},d(t,[{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(T.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(E){this._url=E}}]),t}(),u=function(t){O(n,t);function n(E,m){var p;return p=t.call(this,m)||this,p._decryptdata=null,p.rawProgramDateTime=null,p.programDateTime=null,p.tagList=[],p.duration=0,p.sn=0,p.levelkey=void 0,p.type=void 0,p.loader=null,p.level=-1,p.cc=0,p.startPTS=void 0,p.endPTS=void 0,p.appendedPTS=void 0,p.startDTS=void 0,p.endDTS=void 0,p.start=0,p.deltaPTS=void 0,p.maxStartPTS=void 0,p.minEndPTS=void 0,p.stats=new A.LoadStats,p.urlId=0,p.data=void 0,p.bitrateTest=!1,p.title=null,p.initSegment=null,p.type=E,p}var r=n.prototype;return r.createInitializationVector=function(m){for(var p=new Uint8Array(16),y=12;y<16;y++)p[y]=m>>8*(15-y)&255;return p},r.setDecryptDataFromLevelKey=function(m,p){var y=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(y=I.LevelKey.fromURI(m.uri),y.method=m.method,y.iv=this.createInitializationVector(p),y.keyFormat="identity"),y},r.setElementaryStreamInfo=function(m,p,y,v,a,c){c===void 0&&(c=!1);var i=this.elementaryStreams,l=i[m];if(!l){i[m]={startPTS:p,endPTS:y,startDTS:v,endDTS:a,partial:c};return}l.startPTS=Math.min(l.startPTS,p),l.endPTS=Math.max(l.endPTS,y),l.startDTS=Math.min(l.startDTS,v),l.endDTS=Math.max(l.endDTS,a)},r.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[o.AUDIO]=null,m[o.VIDEO]=null,m[o.AUDIOVIDEO]=null},d(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&D.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(L.isFiniteNumber)(this.programDateTime))return null;var m=Object(L.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),n}(e),s=function(t){O(n,t);function n(r,E,m,p,y){var v;v=t.call(this,m)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new A.LoadStats,v.duration=r.decimalFloatingPoint("DURATION"),v.gap=r.bool("GAP"),v.independent=r.bool("INDEPENDENT"),v.relurl=r.enumeratedString("URI"),v.fragment=E,v.index=p;var a=r.enumeratedString("BYTERANGE");return a&&v.setByteRange(a,y),y&&(v.fragOffset=y.fragOffset+y.duration),v}return d(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var E=this.elementaryStreams;return!!(E.audio||E.video||E.audiovideo)}}]),n}(e)},"./src/loader/key-loader.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return D});var L=S("./src/events.ts"),T=S("./src/errors.ts"),w=S("./src/utils/logger.ts"),D=function(){function I(O){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=O,this._registerListeners()}var A=I.prototype;return A._registerListeners=function(){this.hls.on(L.Events.KEY_LOADING,this.onKeyLoading,this)},A._unregisterListeners=function(){this.hls.off(L.Events.KEY_LOADING,this.onKeyLoading)},A.destroy=function(){this._unregisterListeners();for(var _ in this.loaders){var f=this.loaders[_];f&&f.destroy()}this.loaders={}},A.onKeyLoading=function(_,f){var d=f.frag,o=d.type,e=this.loaders[o];if(!d.decryptdata){w.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var u=d.decryptdata.uri;if(u!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(e&&(w.logger.warn("abort previous key loader for type:"+o),e.abort()),!u){w.logger.warn("key uri is falsy");return}var t=s.loader,n=d.loader=this.loaders[o]=new t(s);this.decrypturl=u,this.decryptkey=null;var r={url:u,frag:d,responseType:"arraybuffer"},E={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(r,E,m)}else this.decryptkey&&(d.decryptdata.key=this.decryptkey,this.hls.trigger(L.Events.KEY_LOADED,{frag:d}))},A.loadsuccess=function(_,f,d){var o=d.frag;if(!o.decryptdata){w.logger.error("after key load, decryptdata unset");return}this.decryptkey=o.decryptdata.key=new Uint8Array(_.data),o.loader=null,delete this.loaders[o.type],this.hls.trigger(L.Events.KEY_LOADED,{frag:o})},A.loaderror=function(_,f){var d=f.frag,o=d.loader;o&&o.abort(),delete this.loaders[d.type],this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:d,response:_})},A.loadtimeout=function(_,f){var d=f.frag,o=d.loader;o&&o.abort(),delete this.loaders[d.type],this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:d})},I}()},"./src/loader/level-details.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"LevelDetails",function(){return I});var L=S("./src/polyfills/number.ts");function T(A,O){for(var _=0;_<O.length;_++){var f=O[_];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(A,f.key,f)}}function w(A,O,_){return O&&T(A.prototype,O),_&&T(A,_),A}var D=10,I=function(){function A(_){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=_}var O=A.prototype;return O.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var d=this.lastPartSn-f.lastPartSn,o=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!o||!!d,this.advanced=this.endSN>f.endSN||d>0||d===0&&o>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},w(A,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(L.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||D}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var d=this.driftEnd-this.driftStart;return d*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),A}()},"./src/loader/level-key.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"LevelKey",function(){return I});var L=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(L);function w(A,O){for(var _=0;_<O.length;_++){var f=O[_];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(A,f.key,f)}}function D(A,O,_){return O&&w(A.prototype,O),_&&w(A,_),A}var I=function(){A.fromURL=function(_,f){return new A(_,f)},A.fromURI=function(_){return new A(_)};function A(O,_){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,_?this._uri=Object(L.buildAbsoluteURL)(O,_,{alwaysNormalize:!0}):this._uri=O}return D(A,[{key:"uri",get:function(){return this._uri}}]),A}()},"./src/loader/load-stats.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"LoadStats",function(){return L});var L=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(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return n});var L=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),w=S.n(T),D=S("./src/loader/fragment.ts"),I=S("./src/loader/level-details.ts"),A=S("./src/loader/level-key.ts"),O=S("./src/utils/attr-list.ts"),_=S("./src/utils/logger.ts"),f=S("./src/utils/codecs.ts"),d=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,o=/#EXT-X-MEDIA:(.*)/g,e=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),u=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("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function t(y){var v,a;return s.test((v=(a=T.parseURL(y))===null||a===void 0?void 0:a.path)!=null?v:"")}var n=function(){function y(){}return y.findGroup=function(a,c){for(var i=0;i<a.length;i++){var l=a[i];if(l.id===c)return l}},y.convertAVC1ToAVCOTI=function(a){var c=a.split(".");if(c.length>2){var i=c.shift()+".";return i+=parseInt(c.shift()).toString(16),i+=("000"+parseInt(c.shift()).toString(16)).substr(-4),i}return a},y.resolve=function(a,c){return T.buildAbsoluteURL(c,a,{alwaysNormalize:!0})},y.parseMasterPlaylist=function(a,c){var i=[],l={},g=!1;d.lastIndex=0;for(var h;(h=d.exec(a))!=null;)if(h[1]){var b=new O.AttrList(h[1]),R={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:y.resolve(h[2],c)},x=b.decimalResolution("RESOLUTION");x&&(R.width=x.width,R.height=x.height),r((b.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),R),R.videoCodec&&R.videoCodec.indexOf("avc1")!==-1&&(R.videoCodec=y.convertAVC1ToAVCOTI(R.videoCodec)),i.push(R)}else if(h[3]){var P=new O.AttrList(h[3]);P["DATA-ID"]&&(g=!0,l[P["DATA-ID"]]=P)}return{levels:i,sessionData:g?l:null}},y.parseMasterPlaylistMedia=function(a,c,i,l){l===void 0&&(l=[]);var g,h=[],b=0;for(o.lastIndex=0;(g=o.exec(a))!==null;){var R=new O.AttrList(g[1]);if(R.TYPE===i){var x={attrs:R,bitrate:0,id:b++,groupId:R["GROUP-ID"],instreamId:R["INSTREAM-ID"],name:R.NAME||R.LANGUAGE||"",type:i,default:R.bool("DEFAULT"),autoselect:R.bool("AUTOSELECT"),forced:R.bool("FORCED"),lang:R.LANGUAGE,url:R.URI?y.resolve(R.URI,c):""};if(l.length){var P=y.findGroup(l,x.groupId)||l[0];E(x,P,"audioCodec"),E(x,P,"textCodec")}h.push(x)}}return h},y.parseLevelPlaylist=function(a,c,i,l,g){var h=new I.LevelDetails(c),b=h.fragments,R=null,x=0,P=0,M=0,k=0,C=null,U=new D.Fragment(l,c),K,ee,z,ae=-1,se=!1;for(e.lastIndex=0,h.m3u8=a;(K=e.exec(a))!==null;){se&&(se=!1,U=new D.Fragment(l,c),U.start=M,U.sn=x,U.cc=k,U.level=i,R&&(U.initSegment=R,U.rawProgramDateTime=R.rawProgramDateTime));var V=K[1];if(V){U.duration=parseFloat(V);var Y=(" "+K[2]).slice(1);U.title=Y||null,U.tagList.push(Y?["INF",V,Y]:["INF",V])}else if(K[3])Object(L.isFiniteNumber)(U.duration)&&(U.start=M,z&&(U.levelkey=z),U.sn=x,U.level=i,U.cc=k,U.urlId=g,b.push(U),U.relurl=(" "+K[3]).slice(1),p(U,C),C=U,M+=U.duration,x++,P=0,se=!0);else if(K[4]){var q=(" "+K[4]).slice(1);C?U.setByteRange(q,C):U.setByteRange(q)}else if(K[5])U.rawProgramDateTime=(" "+K[5]).slice(1),U.tagList.push(["PROGRAM-DATE-TIME",U.rawProgramDateTime]),ae===-1&&(ae=b.length);else{if(K=K[0].match(u),!K){_.logger.warn("No matches on slow regex match for level playlist!");continue}for(ee=1;ee<K.length&&!(typeof K[ee]!="undefined");ee++);var G=(" "+K[ee]).slice(1),X=(" "+K[ee+1]).slice(1),de=K[ee+2]?(" "+K[ee+2]).slice(1):"";switch(G){case"PLAYLIST-TYPE":h.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":x=h.startSN=parseInt(X);break;case"SKIP":{var Ee=new O.AttrList(X),Oe=Ee.decimalInteger("SKIPPED-SEGMENTS");if(Object(L.isFiniteNumber)(Oe)){h.skippedSegments=Oe;for(var me=Oe;me--;)b.unshift(null);x+=Oe}var Se=Ee.enumeratedString("RECENTLY-REMOVED-DATERANGES");Se&&(h.recentlyRemovedDateranges=Se.split(" "));break}case"TARGETDURATION":h.targetduration=parseFloat(X);break;case"VERSION":h.version=parseInt(X);break;case"EXTM3U":break;case"ENDLIST":h.live=!1;break;case"#":(X||de)&&U.tagList.push(de?[X,de]:[X]);break;case"DIS":k++;case"GAP":U.tagList.push([G]);break;case"BITRATE":U.tagList.push([G,X]);break;case"DISCONTINUITY-SEQ":k=parseInt(X);break;case"KEY":{var ve,be=new O.AttrList(X),Ae=be.enumeratedString("METHOD"),Re=be.URI,Le=be.hexadecimalInteger("IV"),Ce=be.enumeratedString("KEYFORMATVERSIONS"),xe=be.enumeratedString("KEYID"),Be=(ve=be.enumeratedString("KEYFORMAT"))!=null?ve:"identity",Me=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Me.indexOf(Be)>-1){_.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;Ae&&(z=A.LevelKey.fromURL(c,Re),Re&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ae)>=0&&(z.method=Ae,z.keyFormat=Be,xe&&(z.keyID=xe),Ce&&(z.keyFormatVersions=Ce),z.iv=Le));break}case"START":{var ge=new O.AttrList(X),De=ge.decimalFloatingPoint("TIME-OFFSET");Object(L.isFiniteNumber)(De)&&(h.startTimeOffset=De);break}case"MAP":{var Ge=new O.AttrList(X);U.relurl=Ge.URI,Ge.BYTERANGE&&U.setByteRange(Ge.BYTERANGE),U.level=i,U.sn="initSegment",z&&(U.levelkey=z),U.initSegment=null,R=U,se=!0;break}case"SERVER-CONTROL":{var We=new O.AttrList(X);h.canBlockReload=We.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=We.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&We.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=We.optionalFloat("PART-HOLD-BACK",0),h.holdBack=We.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ke=new O.AttrList(X);h.partTarget=Ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Pe=h.partList;Pe||(Pe=h.partList=[]);var Ve=P>0?Pe[Pe.length-1]:void 0,He=P++,Te=new D.Part(new O.AttrList(X),U,c,He,Ve);Pe.push(Te),U.duration+=Te.duration;break}case"PRELOAD-HINT":{var Ue=new O.AttrList(X);h.preloadHint=Ue;break}case"RENDITION-REPORT":{var J=new O.AttrList(X);h.renditionReports=h.renditionReports||[],h.renditionReports.push(J);break}default:_.logger.warn("line parsed but not handled: "+K);break}}}C&&!C.relurl?(b.pop(),M-=C.duration,h.partList&&(h.fragmentHint=C)):h.partList&&(p(U,C),U.cc=k,h.fragmentHint=U);var re=b.length,oe=b[0],W=b[re-1];if(M+=h.skippedSegments*h.targetduration,M>0&&re&&W){h.averagetargetduration=M/re;var H=W.sn;h.endSN=H!=="initSegment"?H:0,oe&&(h.startCC=oe.cc,oe.initSegment||h.fragments.every(function(Q){return Q.relurl&&t(Q.relurl)})&&(_.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),U=new D.Fragment(l,c),U.relurl=W.relurl,U.level=i,U.sn="initSegment",oe.initSegment=U,h.needSidxRanges=!0))}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(M+=h.fragmentHint.duration),h.totalduration=M,h.endCC=k,ae>0&&m(b,ae),h},y}();function r(y,v){["video","audio","text"].forEach(function(a){var c=y.filter(function(l){return Object(f.isCodecType)(l,a)});if(c.length){var i=c.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});v[a+"Codec"]=i.length>0?i[0]:c[0],y=y.filter(function(l){return c.indexOf(l)===-1})}}),v.unknownCodecs=y}function E(y,v,a){var c=v[a];c&&(y[a]=c)}function m(y,v){for(var a=y[v],c=v;c--;){var i=y[c];if(!i)return;i.programDateTime=a.programDateTime-i.duration*1e3,a=i}}function p(y,v){y.rawProgramDateTime?y.programDateTime=Date.parse(y.rawProgramDateTime):v!=null&&v.programDateTime&&(y.programDateTime=v.endProgramDateTime),Object(L.isFiniteNumber)(y.programDateTime)||(y.programDateTime=null,y.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),w=S("./src/errors.ts"),D=S("./src/utils/logger.ts"),I=S("./src/utils/mp4-tools.ts"),A=S("./src/loader/m3u8-parser.ts"),O=S("./src/types/loader.ts"),_=S("./src/utils/attr-list.ts");function f(e){var u=e.type;switch(u){case O.PlaylistContextType.AUDIO_TRACK:return O.PlaylistLevelType.AUDIO;case O.PlaylistContextType.SUBTITLE_TRACK:return O.PlaylistLevelType.SUBTITLE;default:return O.PlaylistLevelType.MAIN}}function d(e,u){var s=e.url;return(s===void 0||s.indexOf("data:")===0)&&(s=u.url),s}var o=function(){function e(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var u=e.prototype;return u.registerListeners=function(){var t=this.hls;t.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.unregisterListeners=function(){var t=this.hls;t.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(T.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.createInternalLoader=function(t){var n=this.hls.config,r=n.pLoader,E=n.loader,m=r||E,p=new m(n);return t.loader=p,this.loaders[t.type]=p,p},u.getInternalLoader=function(t){return this.loaders[t.type]},u.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},u.destroyInternalLoaders=function(){for(var t in this.loaders){var n=this.loaders[t];n&&n.destroy(),this.resetInternalLoader(t)}},u.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},u.onManifestLoading=function(t,n){var r=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:O.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},u.onLevelLoading=function(t,n){var r=n.id,E=n.level,m=n.url,p=n.deliveryDirectives;this.load({id:r,groupId:null,level:E,responseType:"text",type:O.PlaylistContextType.LEVEL,url:m,deliveryDirectives:p})},u.onAudioTrackLoading=function(t,n){var r=n.id,E=n.groupId,m=n.url,p=n.deliveryDirectives;this.load({id:r,groupId:E,level:null,responseType:"text",type:O.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:p})},u.onSubtitleTrackLoading=function(t,n){var r=n.id,E=n.groupId,m=n.url,p=n.deliveryDirectives;this.load({id:r,groupId:E,level:null,responseType:"text",type:O.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:p})},u.load=function(t){var n,r=this.hls.config,E=this.getInternalLoader(t);if(E){var m=E.context;if(m&&m.url===t.url){D.logger.trace("[playlist-loader]: playlist request ongoing");return}D.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),E.abort()}var p,y,v,a;switch(t.type){case O.PlaylistContextType.MANIFEST:p=r.manifestLoadingMaxRetry,y=r.manifestLoadingTimeOut,v=r.manifestLoadingRetryDelay,a=r.manifestLoadingMaxRetryTimeout;break;case O.PlaylistContextType.LEVEL:case O.PlaylistContextType.AUDIO_TRACK:case O.PlaylistContextType.SUBTITLE_TRACK:p=0,y=r.levelLoadingTimeOut;break;default:p=r.levelLoadingMaxRetry,y=r.levelLoadingTimeOut,v=r.levelLoadingRetryDelay,a=r.levelLoadingMaxRetryTimeout;break}if(E=this.createInternalLoader(t),(n=t.deliveryDirectives)!==null&&n!==void 0&&n.part){var c;if(t.type===O.PlaylistContextType.LEVEL&&t.level!==null?c=this.hls.levels[t.level].details:t.type===O.PlaylistContextType.AUDIO_TRACK&&t.id!==null?c=this.hls.audioTracks[t.id].details:t.type===O.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(c=this.hls.subtitleTracks[t.id].details),c){var i=c.partTarget,l=c.targetduration;i&&l&&(y=Math.min(Math.max(i*3,l*.8)*1e3,y))}}var g={timeout:y,maxRetry:p,retryDelay:v,maxRetryDelay:a,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};E.load(t,g,h)},u.loadsuccess=function(t,n,r,E){if(E===void 0&&(E=null),r.isSidxRequest){this.handleSidxRequest(t,r),this.handlePlaylistLoaded(t,n,r,E);return}this.resetInternalLoader(r.type);var m=t.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,r,"no EXTM3U delimiter",E);return}n.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,n,r,E):this.handleMasterPlaylist(t,n,r,E)},u.loaderror=function(t,n,r){r===void 0&&(r=null),this.handleNetworkError(n,r,!1,t)},u.loadtimeout=function(t,n,r){r===void 0&&(r=null),this.handleNetworkError(n,r,!0)},u.handleMasterPlaylist=function(t,n,r,E){var m=this.hls,p=t.data,y=d(t,r),v=A.default.parseMasterPlaylist(p,y),a=v.levels,c=v.sessionData;if(!a.length){this.handleManifestParsingError(t,r,"no level found in manifest",E);return}var i=a.map(function(x){return{id:x.attrs.AUDIO,audioCodec:x.audioCodec}}),l=a.map(function(x){return{id:x.attrs.SUBTITLES,textCodec:x.textCodec}}),g=A.default.parseMasterPlaylistMedia(p,y,"AUDIO",i),h=A.default.parseMasterPlaylistMedia(p,y,"SUBTITLES",l),b=A.default.parseMasterPlaylistMedia(p,y,"CLOSED-CAPTIONS");if(g.length){var R=g.some(function(x){return!x.url});!R&&a[0].audioCodec&&!a[0].attrs.AUDIO&&(D.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new _.AttrList({}),bitrate:0,url:""}))}m.trigger(T.Events.MANIFEST_LOADED,{levels:a,audioTracks:g,subtitles:h,captions:b,url:y,stats:n,networkDetails:E,sessionData:c})},u.handleTrackOrLevelPlaylist=function(t,n,r,E){var m=this.hls,p=r.id,y=r.level,v=r.type,a=d(t,r),c=Object(L.isFiniteNumber)(p)?p:0,i=Object(L.isFiniteNumber)(y)?y:c,l=f(r),g=A.default.parseLevelPlaylist(t.data,a,i,l,c);if(!g.fragments.length){m.trigger(T.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:a,reason:"no fragments found in level",level:typeof r.level=="number"?r.level:void 0});return}if(v===O.PlaylistContextType.MANIFEST){var h={attrs:new _.AttrList({}),bitrate:0,details:g,name:"",url:a};m.trigger(T.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:a,stats:n,networkDetails:E,sessionData:null})}if(n.parsing.end=performance.now(),g.needSidxRanges){var b,R=(b=g.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:R,isSidxRequest:!0,type:v,level:y,levelDetails:g,id:p,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}r.levelDetails=g,this.handlePlaylistLoaded(t,n,r,E)},u.handleSidxRequest=function(t,n){var r=Object(I.parseSegmentIndex)(new Uint8Array(t.data));if(!r)return;var E=r.references,m=n.levelDetails;E.forEach(function(p,y){var v=p.info,a=m.fragments[y];a.byteRange.length===0&&a.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),a.initSegment&&a.initSegment.setByteRange(String(r.moovEndOffset)+"@0")})},u.handleManifestParsingError=function(t,n,r,E){this.hls.trigger(T.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===O.PlaylistContextType.MANIFEST,url:t.url,reason:r,response:t,context:n,networkDetails:E})},u.handleNetworkError=function(t,n,r,E){r===void 0&&(r=!1),D.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var m=w.ErrorDetails.UNKNOWN,p=!1,y=this.getInternalLoader(t);switch(t.type){case O.PlaylistContextType.MANIFEST:m=r?w.ErrorDetails.MANIFEST_LOAD_TIMEOUT:w.ErrorDetails.MANIFEST_LOAD_ERROR,p=!0;break;case O.PlaylistContextType.LEVEL:m=r?w.ErrorDetails.LEVEL_LOAD_TIMEOUT:w.ErrorDetails.LEVEL_LOAD_ERROR,p=!1;break;case O.PlaylistContextType.AUDIO_TRACK:m=r?w.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:w.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case O.PlaylistContextType.SUBTITLE_TRACK:m=r?w.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:w.ErrorDetails.SUBTITLE_LOAD_ERROR,p=!1;break}y&&this.resetInternalLoader(t.type);var v={type:w.ErrorTypes.NETWORK_ERROR,details:m,fatal:p,url:t.url,loader:y,context:t,networkDetails:n};E&&(v.response=E),this.hls.trigger(T.Events.ERROR,v)},u.handlePlaylistLoaded=function(t,n,r,E){var m=r.type,p=r.level,y=r.id,v=r.groupId,a=r.loader,c=r.levelDetails,i=r.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(t,r,"invalid target duration",E);return}if(!a)return;c.live&&(a.getCacheAge&&(c.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(m){case O.PlaylistContextType.MANIFEST:case O.PlaylistContextType.LEVEL:this.hls.trigger(T.Events.LEVEL_LOADED,{details:c,level:p||0,id:y||0,stats:n,networkDetails:E,deliveryDirectives:i});break;case O.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(T.Events.AUDIO_TRACK_LOADED,{details:c,id:y||0,groupId:v||"",stats:n,networkDetails:E,deliveryDirectives:i});break;case O.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(T.Events.SUBTITLE_TRACK_LOADED,{details:c,id:y||0,groupId:v||"",stats:n,networkDetails:E,deliveryDirectives:i});break}},e}();N.default=o},"./src/polyfills/number.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"isFiniteNumber",function(){return L}),S.d(N,"MAX_SAFE_INTEGER",function(){return T});var L=Number.isFinite||function(w){return typeof w=="number"&&isFinite(w)},T=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(fe,N,S){"use strict";S.r(N);var L=function(){function T(){}return T.getSilentFrame=function(D,I){switch(D){case"mp4a.40.2":if(I===1)return new Uint8Array([0,200,0,128,35,128]);if(I===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(I===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(I===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(I===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(I===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(I===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(I===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(I===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},T}();N.default=L},"./src/remux/mp4-generator.ts":function(fe,N,S){"use strict";S.r(N);var L=Math.pow(2,32)-1,T=function(){function w(){}return w.init=function(){w.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 I;for(I in w.types)w.types.hasOwnProperty(I)&&(w.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var A=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]),O=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]);w.HDLR_TYPES={video:A,audio:O};var _=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);w.STTS=w.STSC=w.STCO=f,w.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),w.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),w.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),w.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var d=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),e=new Uint8Array([0,0,0,1]);w.FTYP=w.box(w.types.ftyp,d,e,d,o),w.DINF=w.box(w.types.dinf,w.box(w.types.dref,_))},w.box=function(I){for(var A=8,O=arguments.length,_=new Array(O>1?O-1:0),f=1;f<O;f++)_[f-1]=arguments[f];for(var d=_.length,o=d;d--;)A+=_[d].byteLength;var e=new Uint8Array(A);for(e[0]=A>>24&255,e[1]=A>>16&255,e[2]=A>>8&255,e[3]=A&255,e.set(I,4),d=0,A=8;d<o;d++)e.set(_[d],A),A+=_[d].byteLength;return e},w.hdlr=function(I){return w.box(w.types.hdlr,w.HDLR_TYPES[I])},w.mdat=function(I){return w.box(w.types.mdat,I)},w.mdhd=function(I,A){A*=I;var O=Math.floor(A/(L+1)),_=Math.floor(A%(L+1));return w.box(w.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,O>>24,O>>16&255,O>>8&255,O&255,_>>24,_>>16&255,_>>8&255,_&255,85,196,0,0]))},w.mdia=function(I){return w.box(w.types.mdia,w.mdhd(I.timescale,I.duration),w.hdlr(I.type),w.minf(I))},w.mfhd=function(I){return w.box(w.types.mfhd,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255]))},w.minf=function(I){return I.type==="audio"?w.box(w.types.minf,w.box(w.types.smhd,w.SMHD),w.DINF,w.stbl(I)):w.box(w.types.minf,w.box(w.types.vmhd,w.VMHD),w.DINF,w.stbl(I))},w.moof=function(I,A,O){return w.box(w.types.moof,w.mfhd(I),w.traf(O,A))},w.moov=function(I){for(var A=I.length,O=[];A--;)O[A]=w.trak(I[A]);return w.box.apply(null,[w.types.moov,w.mvhd(I[0].timescale,I[0].duration)].concat(O).concat(w.mvex(I)))},w.mvex=function(I){for(var A=I.length,O=[];A--;)O[A]=w.trex(I[A]);return w.box.apply(null,[w.types.mvex].concat(O))},w.mvhd=function(I,A){A*=I;var O=Math.floor(A/(L+1)),_=Math.floor(A%(L+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,O>>24,O>>16&255,O>>8&255,O&255,_>>24,_>>16&255,_>>8&255,_&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return w.box(w.types.mvhd,f)},w.sdtp=function(I){var A=I.samples||[],O=new Uint8Array(4+A.length),_,f;for(_=0;_<A.length;_++)f=A[_].flags,O[_+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return w.box(w.types.sdtp,O)},w.stbl=function(I){return w.box(w.types.stbl,w.stsd(I),w.box(w.types.stts,w.STTS),w.box(w.types.stsc,w.STSC),w.box(w.types.stsz,w.STSZ),w.box(w.types.stco,w.STCO))},w.avc1=function(I){var A=[],O=[],_,f,d;for(_=0;_<I.sps.length;_++)f=I.sps[_],d=f.byteLength,A.push(d>>>8&255),A.push(d&255),A=A.concat(Array.prototype.slice.call(f));for(_=0;_<I.pps.length;_++)f=I.pps[_],d=f.byteLength,O.push(d>>>8&255),O.push(d&255),O=O.concat(Array.prototype.slice.call(f));var o=w.box(w.types.avcC,new Uint8Array([1,A[3],A[4],A[5],252|3,224|I.sps.length].concat(A).concat([I.pps.length]).concat(O))),e=I.width,u=I.height,s=I.pixelRatio[0],t=I.pixelRatio[1];return w.box(w.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,e>>8&255,e&255,u>>8&255,u&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]),o,w.box(w.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),w.box(w.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,t>>24,t>>16&255,t>>8&255,t&255])))},w.esds=function(I){var A=I.config.length;return new Uint8Array([0,0,0,0,3,23+A,0,1,0,4,15+A,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([A]).concat(I.config).concat([6,1,2]))},w.mp4a=function(I){var A=I.samplerate;return w.box(w.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]),w.box(w.types.esds,w.esds(I)))},w.mp3=function(I){var A=I.samplerate;return w.box(w.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]))},w.stsd=function(I){return I.type==="audio"?!I.isAAC&&I.codec==="mp3"?w.box(w.types.stsd,w.STSD,w.mp3(I)):w.box(w.types.stsd,w.STSD,w.mp4a(I)):w.box(w.types.stsd,w.STSD,w.avc1(I))},w.tkhd=function(I){var A=I.id,O=I.duration*I.timescale,_=I.width,f=I.height,d=Math.floor(O/(L+1)),o=Math.floor(O%(L+1));return w.box(w.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,A>>24&255,A>>16&255,A>>8&255,A&255,0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,_>>8&255,_&255,0,0,f>>8&255,f&255,0,0]))},w.traf=function(I,A){var O=w.sdtp(I),_=I.id,f=Math.floor(A/(L+1)),d=Math.floor(A%(L+1));return w.box(w.types.traf,w.box(w.types.tfhd,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255])),w.box(w.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,d>>24,d>>16&255,d>>8&255,d&255])),w.trun(I,O.length+16+20+8+16+8+8),O)},w.trak=function(I){return I.duration=I.duration||4294967295,w.box(w.types.trak,w.tkhd(I),w.mdia(I))},w.trex=function(I){var A=I.id;return w.box(w.types.trex,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},w.trun=function(I,A){var O=I.samples||[],_=O.length,f=12+16*_,d=new Uint8Array(f),o,e,u,s,t,n;for(A+=8+f,d.set([0,0,15,1,_>>>24&255,_>>>16&255,_>>>8&255,_&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255],0),o=0;o<_;o++)e=O[o],u=e.duration,s=e.size,t=e.flags,n=e.cts,d.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*o);return w.box(w.types.trun,d)},w.initSegment=function(I){w.types||w.init();var A=w.moov(I),O=new Uint8Array(w.FTYP.byteLength+A.byteLength);return O.set(w.FTYP),O.set(A,w.FTYP.byteLength),O},w}();T.types=void 0,T.HDLR_TYPES=void 0,T.STTS=void 0,T.STSC=void 0,T.STCO=void 0,T.STSZ=void 0,T.VMHD=void 0,T.SMHD=void 0,T.STSD=void 0,T.FTYP=void 0,T.DINF=void 0,N.default=T},"./src/remux/mp4-remuxer.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return n}),S.d(N,"normalizePts",function(){return r});var L=S("./src/polyfills/number.ts"),T=S("./src/remux/aac-helper.ts"),w=S("./src/remux/mp4-generator.ts"),D=S("./src/events.ts"),I=S("./src/errors.ts"),A=S("./src/utils/logger.ts"),O=S("./src/types/loader.ts"),_=S("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var a=arguments[v];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(y[c]=a[c])}return y},f.apply(this,arguments)}var d=10*1e3,o=1024,e=1152,u=null,s=null,t=!1,n=function(){function y(a,c,i,l){if(l===void 0&&(l=""),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=a,this.config=c,this.typeSupported=i,this.ISGenerated=!1,u===null){var g=navigator.userAgent||"",h=g.match(/Chrome\/(\d+)/i);u=h?parseInt(h[1]):0}if(s===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);s=b?parseInt(b[1]):0}t=!!u&&u<75||!!s&&s<600}var v=y.prototype;return v.destroy=function(){},v.resetTimeStamp=function(c){A.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},v.resetNextTimestamp=function(){A.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){A.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(c){var i=!1,l=c.reduce(function(g,h){var b=h.pts-g;return b<-4294967296?(i=!0,r(g,h.pts)):b>0?g:h.pts},c[0].pts);return i&&A.logger.debug("PTS rollover detected"),l},v.remux=function(c,i,l,g,h,b,R,x){var P,M,k,C,U,K,ee=h,z=h,ae=c.pid>-1,se=i.pid>-1,V=i.samples.length,Y=c.samples.length>0,q=V>1,G=(!ae||Y)&&(!se||q)||this.ISGenerated||R;if(G){this.ISGenerated||(k=this.generateIS(c,i,h));var X=this.isVideoContiguous,de=-1;if(q&&(de=E(i.samples),!X&&this.config.forceKeyFrameOnDiscontinuity))if(K=!0,de>0){A.logger.warn("[mp4-remuxer]: Dropped "+de+" out of "+V+" video samples due to a missing keyframe");var Ee=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(de),i.dropped+=de,z+=(i.samples[0].pts-Ee)/(i.timescale||9e4)}else de===-1&&(A.logger.warn("[mp4-remuxer]: No keyframe found out of "+V+" video samples"),K=!1);if(this.ISGenerated){if(Y&&q){var Oe=this.getVideoStartPts(i.samples),me=r(c.samples[0].pts,Oe)-Oe,Se=me/i.inputTimeScale;ee+=Math.max(0,Se),z+=Math.max(0,-Se)}if(Y){if(c.samplerate||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(c,i,h)),M=this.remuxAudio(c,ee,this.isAudioContiguous,b,se||q||x===O.PlaylistLevelType.AUDIO?z:void 0),q){var ve=M?M.endPTS-M.startPTS:0;i.inputTimeScale||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(c,i,h)),P=this.remuxVideo(i,z,X,ve)}}else q&&(P=this.remuxVideo(i,z,X,0));P&&(P.firstKeyFrame=de,P.independent=de!==-1)}}return this.ISGenerated&&(l.samples.length&&(U=this.remuxID3(l,h)),g.samples.length&&(C=this.remuxText(g,h))),{audio:M,video:P,initSegment:k,independent:K,text:C,id3:U}},v.generateIS=function(c,i,l){var g=c.samples,h=i.samples,b=this.typeSupported,R={},x=!Object(L.isFiniteNumber)(this._initPTS),P="audio/mp4",M,k,C;if(x&&(M=k=Infinity),c.config&&g.length&&(c.timescale=c.samplerate,c.isAAC||(b.mpeg?(P="audio/mpeg",c.codec=""):b.mp3&&(c.codec="mp3")),R.audio={id:"audio",container:P,codec:c.codec,initSegment:!c.isAAC&&b.mpeg?new Uint8Array(0):w.default.initSegment([c]),metadata:{channelCount:c.channelCount}},x&&(C=c.inputTimeScale,M=k=g[0].pts-Math.round(C*l))),i.sps&&i.pps&&h.length&&(i.timescale=i.inputTimeScale,R.video={id:"main",container:"video/mp4",codec:i.codec,initSegment:w.default.initSegment([i]),metadata:{width:i.width,height:i.height}},x)){C=i.inputTimeScale;var U=this.getVideoStartPts(h),K=Math.round(C*l);k=Math.min(k,r(h[0].dts,U)-K),M=Math.min(M,U-K)}if(Object.keys(R).length)return this.ISGenerated=!0,x&&(this._initPTS=M,this._initDTS=k),{tracks:R,initPTS:M,timescale:C}},v.remuxVideo=function(c,i,l,g){var h=c.inputTimeScale,b=c.samples,R=[],x=b.length,P=this._initPTS,M=this.nextAvcDts,k=8,C,U,K,ee=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,ae=0,se=!1;if(!l||M===null){var V=i*h,Y=b[0].pts-r(b[0].dts,b[0].pts);M=V-Y}for(var q=0;q<x;q++){var G=b[q];if(G.pts=r(G.pts-P,M),G.dts=r(G.dts-P,M),G.dts>G.pts){var X=9e4*.2;ae=Math.max(Math.min(ae,G.pts-G.dts),-1*X)}G.dts<b[q>0?q-1:q].dts&&(se=!0)}se&&b.sort(function(bt,ut){var Qe=bt.dts-ut.dts,Dt=bt.pts-ut.pts;return Qe||Dt}),U=b[0].dts,K=b[b.length-1].dts;var de=Math.round((K-U)/(x-1));if(ae<0){if(ae<de*-2){A.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(_.toMsFromMpegTsClock)(-de,!0)+" ms");for(var Ee=ae,Oe=0;Oe<x;Oe++)b[Oe].dts=Ee=Math.max(Ee,b[Oe].pts-de),b[Oe].pts=Math.max(Ee,b[Oe].pts)}else{A.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(_.toMsFromMpegTsClock)(ae,!0)+" ms to overcome this issue");for(var me=0;me<x;me++)b[me].dts=b[me].dts+ae}U=b[0].dts}if(l){var Se=U-M,ve=Se>de,be=Se<-1;if(ve||be){ve?A.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(Se,!0)+" ms ("+Se+"dts) hole between fragments detected, filling it"):A.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(-Se,!0)+" ms ("+Se+"dts) overlapping between fragments detected"),U=M;var Ae=b[0].pts-Se;b[0].dts=U,b[0].pts=Ae,A.logger.log("Video: First PTS/DTS adjusted: "+Object(_.toMsFromMpegTsClock)(Ae,!0)+"/"+Object(_.toMsFromMpegTsClock)(U,!0)+", delta: "+Object(_.toMsFromMpegTsClock)(Se,!0)+" ms")}}t&&(U=Math.max(0,U));for(var Re=0,Le=0,Ce=0;Ce<x;Ce++){for(var xe=b[Ce],Be=xe.units,Me=Be.length,ge=0,De=0;De<Me;De++)ge+=Be[De].data.length;Le+=ge,Re+=Me,xe.length=ge,xe.dts=Math.max(xe.dts,U),xe.pts=Math.max(xe.pts,xe.dts,0),ee=Math.min(xe.pts,ee),z=Math.max(xe.pts,z)}K=b[x-1].dts;var Ge=Le+4*Re+8,We;try{We=new Uint8Array(Ge)}catch(bt){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ge,reason:"fail allocating video mdat "+Ge});return}var Ke=new DataView(We.buffer);Ke.setUint32(0,Ge),We.set(w.default.types.mdat,4);for(var Pe=0;Pe<x;Pe++){for(var Ve=b[Pe],He=Ve.units,Te=0,Ue=0,J=He.length;Ue<J;Ue++){var re=He[Ue],oe=re.data,W=re.data.byteLength;Ke.setUint32(k,W),k+=4,We.set(oe,k),k+=W,Te+=4+W}if(Pe<x-1)C=b[Pe+1].dts-Ve.dts;else{var H=this.config,Q=Ve.dts-b[Pe>0?Pe-1:Pe].dts;if(H.stretchShortVideoTrack&&this.nextAudioPts!==null){var le=Math.floor(H.maxBufferHole*h),ye=(g?ee+g*h:this.nextAudioPts)-Ve.pts;ye>le?(C=ye-Q,C<0&&(C=Q),A.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+C/90+" ms for the last video frame.")):C=Q}else C=Q}var we=Math.round(Ve.pts-Ve.dts);R.push(new m(Ve.key,C,Te,we))}if(R.length&&u&&u<70){var Ne=R[0].flags;Ne.dependsOn=2,Ne.isNonSync=0}console.assert(C!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=K+C,this.isVideoContiguous=!0;var $e=w.default.moof(c.sequenceNumber++,U,f({},c,{samples:R})),nt="video",Ze={data1:$e,data2:We,startPTS:ee/h,endPTS:(z+C)/h,startDTS:U/h,endDTS:M/h,type:nt,hasAudio:!1,hasVideo:!0,nb:R.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(We.length,"MDAT length must not be zero"),Ze},v.remuxAudio=function(c,i,l,g,h){var b=c.inputTimeScale,R=c.samplerate?c.samplerate:b,x=b/R,P=c.isAAC?o:e,M=P*x,k=this._initPTS,C=!c.isAAC&&this.typeSupported.mpeg,U=[],K=c.samples,ee=C?0:8,z=this.nextAudioPts||-1,ae=i*b;if(this.isAudioContiguous=l=l||K.length&&z>0&&(g&&Math.abs(ae-z)<9e3||Math.abs(r(K[0].pts-k,ae)-z)<20*M),K.forEach(function(oe){oe.pts=r(oe.pts-k,ae)}),!l||z<0){if(K=K.filter(function(oe){return oe.pts>=0}),!K.length)return;h===0?z=0:g?z=Math.max(0,ae):z=K[0].pts}if(c.isAAC)for(var se=h!==void 0,V=this.config.maxAudioFramesDrift,Y=0,q=z;Y<K.length;Y++){var G=K[Y],X=G.pts,de=X-q,Ee=Math.abs(1e3*de/b);if(de<=-V*M&&se)Y===0&&(A.logger.warn("Audio frame @ "+(X/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*de/b)+" ms."),this.nextAudioPts=z=q=X);else if(de>=V*M&&Ee<d&&se){var Oe=Math.round(de/M);q=X-Oe*M,q<0&&(Oe--,q+=M),Y===0&&(this.nextAudioPts=z=q),A.logger.warn("[mp4-remuxer]: Injecting "+Oe+" audio frame @ "+(q/b).toFixed(3)+"s due to "+Math.round(1e3*de/b)+" ms gap.");for(var me=0;me<Oe;me++){var Se=Math.max(q,0),ve=T.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);ve||(A.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ve=G.unit.subarray()),K.splice(Y,0,{unit:ve,pts:Se}),q+=M,Y++}}G.pts=q,q+=M}for(var be=null,Ae=null,Re,Le=0,Ce=K.length;Ce--;)Le+=K[Ce].unit.byteLength;for(var xe=0,Be=K.length;xe<Be;xe++){var Me=K[xe],ge=Me.unit,De=Me.pts;if(Ae!==null){var Ge=U[xe-1];Ge.duration=Math.round((De-Ae)/x)}else if(l&&c.isAAC&&(De=z),be=De,Le>0){Le+=ee;try{Re=new Uint8Array(Le)}catch(oe){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Le,reason:"fail allocating audio mdat "+Le});return}if(!C){var We=new DataView(Re.buffer);We.setUint32(0,Le),Re.set(w.default.types.mdat,4)}}else return;Re.set(ge,ee);var Ke=ge.byteLength;ee+=Ke,U.push(new m(!0,P,Ke,0)),Ae=De}var Pe=U.length;if(!Pe)return;var Ve=U[U.length-1];this.nextAudioPts=z=Ae+x*Ve.duration;var He=C?new Uint8Array(0):w.default.moof(c.sequenceNumber++,be/x,f({},c,{samples:U}));c.samples=[];var Te=be/b,Ue=z/b,J="audio",re={data1:He,data2:Re,startPTS:Te,endPTS:Ue,startDTS:Te,endDTS:Ue,type:J,hasAudio:!0,hasVideo:!1,nb:Pe};return this.isAudioContiguous=!0,console.assert(Re.length,"MDAT length must not be zero"),re},v.remuxEmptyAudio=function(c,i,l,g){var h=c.inputTimeScale,b=c.samplerate?c.samplerate:h,R=h/b,x=this.nextAudioPts,P=(x!==null?x:g.startDTS*h)+this._initDTS,M=g.endDTS*h+this._initDTS,k=R*o,C=Math.ceil((M-P)/k),U=T.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(A.logger.warn("[mp4-remuxer]: remux empty Audio"),!U){A.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var K=[],ee=0;ee<C;ee++){var z=P+ee*k;K.push({unit:U,pts:z,dts:z})}return c.samples=K,this.remuxAudio(c,i,l,!1)},v.remuxID3=function(c,i){var l=c.samples.length;if(!l)return;for(var g=c.inputTimeScale,h=this._initPTS,b=this._initDTS,R=0;R<l;R++){var x=c.samples[R];x.pts=r(x.pts-h,i*g)/g,x.dts=r(x.dts-b,i*g)/g}var P=c.samples;return c.samples=[],{samples:P}},v.remuxText=function(c,i){var l=c.samples.length;if(!l)return;for(var g=c.inputTimeScale,h=this._initPTS,b=0;b<l;b++){var R=c.samples[b];R.pts=r(R.pts-h,i*g)/g}c.samples.sort(function(P,M){return P.pts-M.pts});var x=c.samples;return c.samples=[],{samples:x}},y}();function r(y,v){var a;if(v===null)return y;for(v<y?a=-8589934592:a=8589934592;Math.abs(y-v)>4294967296;)y+=a;return y}function E(y){for(var v=0;v<y.length;v++)if(y[v].key)return v;return-1}var m=function(v,a,c,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=a,this.size=c,this.cts=i,this.flags=new p(v)},p=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/polyfills/number.ts"),T=S("./src/utils/mp4-tools.ts"),w=S("./src/loader/fragment.ts"),D=S("./src/utils/logger.ts"),I=function(){function _(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var f=_.prototype;return f.destroy=function(){},f.resetTimeStamp=function(o){this.initPTS=o,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(o,e,u){this.audioCodec=e,this.videoCodec=u,this.generateInitSegment(o),this.emitInitSegment=!0},f.generateInitSegment=function(o){var e=this.audioCodec,u=this.videoCodec;if(!o||!o.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(T.parseInitSegment)(o);e||(e=O(s.audio,w.ElementaryStreamTypes.AUDIO)),u||(u=O(s.video,w.ElementaryStreamTypes.VIDEO));var t={};s.audio&&s.video?t.audiovideo={container:"video/mp4",codec:e+","+u,initSegment:o,id:"main"}:s.audio?t.audio={container:"audio/mp4",codec:e,initSegment:o,id:"audio"}:s.video?t.video={container:"video/mp4",codec:u,initSegment:o,id:"main"}:D.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},f.remux=function(o,e,u,s,t){var n=this.initPTS,r=this.lastEndDTS,E={audio:void 0,video:void 0,text:s,id3:u,initSegment:void 0};Object(L.isFiniteNumber)(r)||(r=this.lastEndDTS=t||0);var m=e.samples;if(!m||!m.length)return E;var p={initPTS:void 0,timescale:1},y=this.initData;if((!y||!y.length)&&(this.generateInitSegment(m),y=this.initData),!y||!y.length)return D.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),E;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(L.isFiniteNumber)(n)||(this.initPTS=p.initPTS=n=A(y,m,r));var v=Object(T.getDuration)(m,y),a=r,c=v+a;Object(T.offsetStartDTS)(y,m,n),v>0?this.lastEndDTS=c:(D.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var i=!!y.audio,l=!!y.video,g="";i&&(g+="audio"),l&&(g+="video");var h={data1:m,startPTS:a,startDTS:a,endPTS:c,endDTS:c,type:g,hasAudio:i,hasVideo:l,nb:1,dropped:0};return E.audio=h.type==="audio"?h:void 0,E.video=h.type!=="audio"?h:void 0,E.text=s,E.id3=u,E.initSegment=p,E},_}(),A=function(f,d,o){return Object(T.getStartDTS)(f,d)-o};function O(_,f){var d=_==null?void 0:_.codec;return d&&d.length>4?d:d==="hvc1"?"hvc1.1.c.L120.90":d==="av01"?"av01.0.04M.08":d==="avc1"||f===w.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}N.default=I},"./src/task-loop.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return L});var L=function(){function T(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var w=T.prototype;return w.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},w.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},w.onHandlerDestroyed=function(){},w.hasInterval=function(){return!!this._tickInterval},w.hasNextTick=function(){return!!this._tickTimer},w.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},w.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},w.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},w.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},w.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},w.doTick=function(){},T}()},"./src/types/cmcd.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"CMCDVersion",function(){return L}),S.d(N,"CMCDObjectType",function(){return T}),S.d(N,"CMCDStreamingFormat",function(){return w}),S.d(N,"CMCDStreamType",function(){return D});var L=1,T;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(T||(T={}));var w;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(w||(w={}));var D;(function(I){I.VOD="v",I.LIVE="l"})(D||(D={}))},"./src/types/level.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"HlsSkip",function(){return w}),S.d(N,"getSkipValue",function(){return D}),S.d(N,"HlsUrlParameters",function(){return I}),S.d(N,"Level",function(){return A});function L(O,_){for(var f=0;f<_.length;f++){var d=_[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(O,d.key,d)}}function T(O,_,f){return _&&L(O.prototype,_),f&&L(O,f),O}var w;(function(O){O.No="",O.Yes="YES",O.v2="v2"})(w||(w={}));function D(O,_){var f=O.canSkipUntil,d=O.canSkipDateRanges,o=O.endSN,e=_!==void 0?_-o:0;return f&&e<f?d?w.v2:w.Yes:w.No}var I=function(){function O(f,d,o){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=d,this.skip=o}var _=O.prototype;return _.addDirectives=function(d){var o=new self.URL(d);return this.msn!==void 0&&o.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&o.searchParams.set("_HLS_part",this.part.toString()),this.skip&&o.searchParams.set("_HLS_skip",this.skip),o.toString()},O}(),A=function(){function O(_){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[_.url],this.attrs=_.attrs,this.bitrate=_.bitrate,_.details&&(this.details=_.details),this.id=_.id||0,this.name=_.name,this.width=_.width||0,this.height=_.height||0,this.audioCodec=_.audioCodec,this.videoCodec=_.videoCodec,this.unknownCodecs=_.unknownCodecs,this.codecSet=[_.videoCodec,_.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return T(O,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(f){var d=f%this.url.length;this._urlId!==d&&(this.details=void 0,this._urlId=d)}}]),O}()},"./src/types/loader.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"PlaylistContextType",function(){return L}),S.d(N,"PlaylistLevelType",function(){return T});var L;(function(w){w.MANIFEST="manifest",w.LEVEL="level",w.AUDIO_TRACK="audioTrack",w.SUBTITLE_TRACK="subtitleTrack"})(L||(L={}));var T;(function(w){w.MAIN="main",w.AUDIO="audio",w.SUBTITLE="subtitle"})(T||(T={}))},"./src/types/transmuxer.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"ChunkMetadata",function(){return L});var L=function(D,I,A,O,_,f){O===void 0&&(O=0),_===void 0&&(_=-1),f===void 0&&(f=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=T(),this.buffering={audio:T(),video:T(),audiovideo:T()},this.level=D,this.sn=I,this.id=A,this.size=O,this.part=_,this.partial=f};function T(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"AttrList",function(){return w});var L=/^(\d+)x(\d+)$/,T=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,w=function(){function D(A){typeof A=="string"&&(A=D.parseAttrList(A));for(var O in A)A.hasOwnProperty(O)&&(this[O]=A[O])}var I=D.prototype;return I.decimalInteger=function(O){var _=parseInt(this[O],10);return _>Number.MAX_SAFE_INTEGER?Infinity:_},I.hexadecimalInteger=function(O){if(this[O]){var _=(this[O]||"0x").slice(2);_=(_.length&1?"0":"")+_;for(var f=new Uint8Array(_.length/2),d=0;d<_.length/2;d++)f[d]=parseInt(_.slice(d*2,d*2+2),16);return f}else return null},I.hexadecimalIntegerAsNumber=function(O){var _=parseInt(this[O],16);return _>Number.MAX_SAFE_INTEGER?Infinity:_},I.decimalFloatingPoint=function(O){return parseFloat(this[O])},I.optionalFloat=function(O,_){var f=this[O];return f?parseFloat(f):_},I.enumeratedString=function(O){return this[O]},I.bool=function(O){return this[O]==="YES"},I.decimalResolution=function(O){var _=L.exec(this[O]);return _===null?void 0:{width:parseInt(_[1],10),height:parseInt(_[2],10)}},D.parseAttrList=function(O){var _,f={},d='"';for(T.lastIndex=0;(_=T.exec(O))!==null;){var o=_[2];o.indexOf(d)===0&&o.lastIndexOf(d)===o.length-1&&(o=o.slice(1,-1)),f[_[1]]=o}return f},D}()},"./src/utils/binary-search.ts":function(fe,N,S){"use strict";S.r(N);var L={search:function(w,D){for(var I=0,A=w.length-1,O=null,_=null;I<=A;){O=(I+A)/2|0,_=w[O];var f=D(_);if(f>0)I=O+1;else if(f<0)A=O-1;else return _}return null}};N.default=L},"./src/utils/buffer-helper.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"BufferHelper",function(){return w});var L=S("./src/utils/logger.ts"),T={length:0,start:function(){return 0},end:function(){return 0}},w=function(){function D(){}return D.isBuffered=function(A,O){try{if(A){for(var _=D.getBuffered(A),f=0;f<_.length;f++)if(O>=_.start(f)&&O<=_.end(f))return!0}}catch(d){}return!1},D.bufferInfo=function(A,O,_){try{if(A){var f=D.getBuffered(A),d=[],o;for(o=0;o<f.length;o++)d.push({start:f.start(o),end:f.end(o)});return this.bufferedInfo(d,O,_)}}catch(e){}return{len:0,start:O,end:O,nextStart:void 0}},D.bufferedInfo=function(A,O,_){O=Math.max(0,O),A.sort(function(p,y){var v=p.start-y.start;return v||y.end-p.end});var f=[];if(_)for(var d=0;d<A.length;d++){var o=f.length;if(o){var e=f[o-1].end;A[d].start-e<_?A[d].end>e&&(f[o-1].end=A[d].end):f.push(A[d])}else f.push(A[d])}else f=A;for(var u=0,s,t=O,n=O,r=0;r<f.length;r++){var E=f[r].start,m=f[r].end;if(O+_>=E&&O<m)t=E,n=m,u=n-O;else if(O+_<E){s=E;break}}return{len:u,start:t||0,end:n||0,nextStart:s}},D.getBuffered=function(A){try{return A.buffered}catch(O){return L.logger.log("failed to get media.buffered",O),T}},D}()},"./src/utils/cea-608-parser.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"Row",function(){return n}),S.d(N,"CaptionScreen",function(){return r});var L=S("./src/utils/logger.ts"),T={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},w=function(c){var i=c;return T.hasOwnProperty(c)&&(i=T[c]),String.fromCharCode(i)},D=15,I=100,A={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},O={17:2,18:4,21:6,22:8,23:10,19:13,20:15},_={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},d=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],o;(function(a){a[a.ERROR=0]="ERROR",a[a.TEXT=1]="TEXT",a[a.WARNING=2]="WARNING",a[a.INFO=2]="INFO",a[a.DEBUG=3]="DEBUG",a[a.DATA=3]="DATA"})(o||(o={}));var e=function(){function a(){this.time=null,this.verboseLevel=o.ERROR}var c=a.prototype;return c.log=function(l,g){this.verboseLevel>=l&&L.logger.log(this.time+" ["+l+"] "+g)},a}(),u=function(c){for(var i=[],l=0;l<c.length;l++)i.push(c[l].toString(16));return i},s=function(){function a(i,l,g,h,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=i||"white",this.underline=l||!1,this.italics=g||!1,this.background=h||"black",this.flash=b||!1}var c=a.prototype;return c.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},c.setStyles=function(l){for(var g=["foreground","underline","italics","background","flash"],h=0;h<g.length;h++){var b=g[h];l.hasOwnProperty(b)&&(this[b]=l[b])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(l){return this.foreground===l.foreground&&this.underline===l.underline&&this.italics===l.italics&&this.background===l.background&&this.flash===l.flash},c.copy=function(l){this.foreground=l.foreground,this.underline=l.underline,this.italics=l.italics,this.background=l.background,this.flash=l.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},a}(),t=function(){function a(i,l,g,h,b,R){this.uchar=void 0,this.penState=void 0,this.uchar=i||" ",this.penState=new s(l,g,h,b,R)}var c=a.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(l,g){this.uchar=l,this.penState.copy(g)},c.setPenState=function(l){this.penState.copy(l)},c.equals=function(l){return this.uchar===l.uchar&&this.penState.equals(l.penState)},c.copy=function(l){this.uchar=l.uchar,this.penState.copy(l.penState)},c.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},a}(),n=function(){function a(i){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var l=0;l<I;l++)this.chars.push(new t);this.logger=i,this.pos=0,this.currPenState=new s}var c=a.prototype;return c.equals=function(l){for(var g=!0,h=0;h<I;h++)if(!this.chars[h].equals(l.chars[h])){g=!1;break}return g},c.copy=function(l){for(var g=0;g<I;g++)this.chars[g].copy(l.chars[g])},c.isEmpty=function(){for(var l=!0,g=0;g<I;g++)if(!this.chars[g].isEmpty()){l=!1;break}return l},c.setCursor=function(l){this.pos!==l&&(this.pos=l),this.pos<0?(this.logger.log(o.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(o.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},c.moveCursor=function(l){var g=this.pos+l;if(l>1)for(var h=this.pos+1;h<g+1;h++)this.chars[h].setPenState(this.currPenState);this.setCursor(g)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(l){l>=144&&this.backSpace();var g=w(l);if(this.pos>=I){this.logger.log(o.ERROR,"Cannot insert "+l.toString(16)+" ("+g+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(g,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(l){var g;for(g=l;g<I;g++)this.chars[g].reset()},c.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},c.clearToEndOfRow=function(){this.clearFromPos(this.pos)},c.getTextString=function(){for(var l=[],g=!0,h=0;h<I;h++){var b=this.chars[h].uchar;b!==" "&&(g=!1),l.push(b)}return g?"":l.join("")},c.setPenStyles=function(l){this.currPenState.setStyles(l);var g=this.chars[this.pos];g.setPenState(this.currPenState)},a}(),r=function(){function a(i){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var l=0;l<D;l++)this.rows.push(new n(i));this.logger=i,this.currRow=D-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=a.prototype;return c.reset=function(){for(var l=0;l<D;l++)this.rows[l].clear();this.currRow=D-1},c.equals=function(l){for(var g=!0,h=0;h<D;h++)if(!this.rows[h].equals(l.rows[h])){g=!1;break}return g},c.copy=function(l){for(var g=0;g<D;g++)this.rows[g].copy(l.rows[g])},c.isEmpty=function(){for(var l=!0,g=0;g<D;g++)if(!this.rows[g].isEmpty()){l=!1;break}return l},c.backSpace=function(){var l=this.rows[this.currRow];l.backSpace()},c.clearToEndOfRow=function(){var l=this.rows[this.currRow];l.clearToEndOfRow()},c.insertChar=function(l){var g=this.rows[this.currRow];g.insertChar(l)},c.setPen=function(l){var g=this.rows[this.currRow];g.setPenStyles(l)},c.moveCursor=function(l){var g=this.rows[this.currRow];g.moveCursor(l)},c.setCursor=function(l){this.logger.log(o.INFO,"setCursor: "+l);var g=this.rows[this.currRow];g.setCursor(l)},c.setPAC=function(l){this.logger.log(o.INFO,"pacData = "+JSON.stringify(l));var g=l.row-1;if(this.nrRollUpRows&&g<this.nrRollUpRows-1&&(g=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==g){for(var h=0;h<D;h++)this.rows[h].clear();var b=this.currRow+1-this.nrRollUpRows,R=this.lastOutputScreen;if(R){var x=R.rows[b].cueStartTime,P=this.logger.time;if(x&&P!==null&&x<P)for(var M=0;M<this.nrRollUpRows;M++)this.rows[g-this.nrRollUpRows+M+1].copy(R.rows[b+M])}}this.currRow=g;var k=this.rows[this.currRow];if(l.indent!==null){var C=l.indent,U=Math.max(C-1,0);k.setCursor(l.indent),l.color=k.chars[U].penState.foreground}var K={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(K)},c.setBkgData=function(l){this.logger.log(o.INFO,"bkgData = "+JSON.stringify(l)),this.backSpace(),this.setPen(l),this.insertChar(32)},c.setRollUpRows=function(l){this.nrRollUpRows=l},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(o.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(o.TEXT,this.getDisplayText());var l=this.currRow+1-this.nrRollUpRows,g=this.rows.splice(l,1)[0];g.clear(),this.rows.splice(this.currRow,0,g),this.logger.log(o.INFO,"Rolling up")},c.getDisplayText=function(l){l=l||!1;for(var g=[],h="",b=-1,R=0;R<D;R++){var x=this.rows[R].getTextString();x&&(b=R+1,l?g.push("Row "+b+": '"+x+"'"):g.push(x.trim()))}return g.length>0&&(l?h="["+g.join(" | ")+"]":h=g.join(`
`)),h},c.getTextAndFormat=function(){return this.rows},a}(),E=function(){function a(i,l,g){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=i,this.outputFilter=l,this.mode=null,this.verbose=0,this.displayedMemory=new r(g),this.nonDisplayedMemory=new r(g),this.lastOutputScreen=new r(g),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var c=a.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(l){this.outputFilter=l},c.setPAC=function(l){this.writeScreen.setPAC(l)},c.setBkgData=function(l){this.writeScreen.setBkgData(l)},c.setMode=function(l){if(l===this.mode)return;this.mode=l,this.logger.log(o.INFO,"MODE="+l),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=l},c.insertChars=function(l){for(var g=0;g<l.length;g++)this.writeScreen.insertChar(l[g]);var h=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(o.INFO,h+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(o.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(o.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(o.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},c.ccAOF=function(){},c.ccAON=function(){},c.ccDER=function(){this.logger.log(o.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(l){this.logger.log(o.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},c.ccFON=function(){this.logger.log(o.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(o.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(o.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(o.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(o.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(o.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(o.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(o.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var l=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=l,this.writeScreen=this.nonDisplayedMemory,this.logger.log(o.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(l){this.logger.log(o.INFO,"TO("+l+") - Tab Offset"),this.writeScreen.moveCursor(l)},c.ccMIDROW=function(l){var g={flash:!1};if(g.underline=l%2===1,g.italics=l>=46,g.italics)g.foreground="white";else{var h=Math.floor(l/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=b[h]}this.logger.log(o.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},c.outputDataUpdate=function(l){l===void 0&&(l=!1);var g=this.logger.time;if(g===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=g:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,g,this.lastOutputScreen),l&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:g),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(l){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,l,this.displayedMemory),this.cueStartTime=l))},a}(),m=function(){function a(i,l,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var h=new e;this.channels=[null,new E(i,l,h),new E(i+1,g,h)],this.cmdHistory=v(),this.logger=h}var c=a.prototype;return c.getHandler=function(l){return this.channels[l].getHandler()},c.setHandler=function(l,g){this.channels[l].setHandler(g)},c.addData=function(l,g){var h,b,R,x=!1;this.logger.time=l;for(var P=0;P<g.length;P+=2){if(b=g[P]&127,R=g[P+1]&127,b===0&&R===0)continue;if(this.logger.log(o.DATA,"["+u([g[P],g[P+1]])+"] -> ("+u([b,R])+")"),h=this.parseCmd(b,R),h||(h=this.parseMidrow(b,R)),h||(h=this.parsePAC(b,R)),h||(h=this.parseBackgroundAttributes(b,R)),!h&&(x=this.parseChars(b,R),x)){var M=this.currentChannel;if(M&&M>0){var k=this.channels[M];k.insertChars(x)}else this.logger.log(o.WARNING,"No channel found yet. TEXT-MODE?")}!h&&!x&&this.logger.log(o.WARNING,"Couldn't parse cleaned data "+u([b,R])+" orig: "+u([g[P],g[P+1]]))}},c.parseCmd=function(l,g){var h=this.cmdHistory,b=(l===20||l===28||l===21||l===29)&&g>=32&&g<=47,R=(l===23||l===31)&&g>=33&&g<=35;if(!(b||R))return!1;if(y(l,g,h))return p(null,null,h),this.logger.log(o.DEBUG,"Repeated command ("+u([l,g])+") is dropped"),!0;var x=l===20||l===21||l===23?1:2,P=this.channels[x];return l===20||l===21||l===28||l===29?g===32?P.ccRCL():g===33?P.ccBS():g===34?P.ccAOF():g===35?P.ccAON():g===36?P.ccDER():g===37?P.ccRU(2):g===38?P.ccRU(3):g===39?P.ccRU(4):g===40?P.ccFON():g===41?P.ccRDC():g===42?P.ccTR():g===43?P.ccRTD():g===44?P.ccEDM():g===45?P.ccCR():g===46?P.ccENM():g===47&&P.ccEOC():P.ccTO(g-32),p(l,g,h),this.currentChannel=x,!0},c.parseMidrow=function(l,g){var h=0;if((l===17||l===25)&&g>=32&&g<=47){if(l===17?h=1:h=2,h!==this.currentChannel)return this.logger.log(o.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[h];return b?(b.ccMIDROW(g),this.logger.log(o.DEBUG,"MIDROW ("+u([l,g])+")"),!0):!1}return!1},c.parsePAC=function(l,g){var h,b=this.cmdHistory,R=(l>=17&&l<=23||l>=25&&l<=31)&&g>=64&&g<=127,x=(l===16||l===24)&&g>=64&&g<=95;if(!(R||x))return!1;if(y(l,g,b))return p(null,null,b),!0;var P=l<=23?1:2;g>=64&&g<=95?h=P===1?A[l]:_[l]:h=P===1?O[l]:f[l];var M=this.channels[P];return M?(M.setPAC(this.interpretPAC(h,g)),p(l,g,b),this.currentChannel=P,!0):!1},c.interpretPAC=function(l,g){var h,b={color:null,italics:!1,indent:null,underline:!1,row:l};return g>95?h=g-96:h=g-64,b.underline=(h&1)===1,h<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(h/2)]:h<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((h-16)/2)*4,b},c.parseChars=function(l,g){var h,b=null,R=null;if(l>=25?(h=2,R=l-8):(h=1,R=l),R>=17&&R<=19){var x;R===17?x=g+80:R===18?x=g+112:x=g+144,this.logger.log(o.INFO,"Special char '"+w(x)+"' in channel "+h),b=[x]}else l>=32&&l<=127&&(b=g===0?[l]:[l,g]);if(b){var P=u(b);this.logger.log(o.DEBUG,"Char codes = "+P.join(",")),p(l,g,this.cmdHistory)}return b},c.parseBackgroundAttributes=function(l,g){var h=(l===16||l===24)&&g>=32&&g<=47,b=(l===23||l===31)&&g>=45&&g<=47;if(!(h||b))return!1;var R,x={};l===16||l===24?(R=Math.floor((g-32)/2),x.background=d[R],g%2===1&&(x.background=x.background+"_semi")):g===45?x.background="transparent":(x.foreground="black",g===47&&(x.underline=!0));var P=l<=23?1:2,M=this.channels[P];return M.setBkgData(x),p(l,g,this.cmdHistory),!0},c.reset=function(){for(var l=0;l<Object.keys(this.channels).length;l++){var g=this.channels[l];g&&g.reset()}this.cmdHistory=v()},c.cueSplitAtTime=function(l){for(var g=0;g<this.channels.length;g++){var h=this.channels[g];h&&h.cueSplitAtTime(l)}},a}();function p(a,c,i){i.a=a,i.b=c}function y(a,c,i){return i.a===a&&i.b===c}function v(){return{a:null,b:null}}N.default=m},"./src/utils/codecs.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"isCodecType",function(){return T}),S.d(N,"isCodecSupportedInMp4",function(){return w});var L={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 T(D,I){var A=L[I];return!!A&&A[D.slice(0,4)]===!0}function w(D,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+D+'"')}},"./src/utils/cues.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/utils/vttparser.ts"),T=S("./src/utils/webvtt-parser.ts"),w=S("./src/utils/texttrack-utils.ts"),D=/\s/,I={newCue:function(O,_,f,d){for(var o=[],e,u,s,t,n,r=self.VTTCue||self.TextTrackCue,E=0;E<d.rows.length;E++)if(e=d.rows[E],s=!0,t=0,n="",!e.isEmpty()){for(var m=0;m<e.chars.length;m++)D.test(e.chars[m].uchar)&&s?t++:(n+=e.chars[m].uchar,s=!1);e.cueStartTime=_,_===f&&(f+=1e-4),t>=16?t--:t++;var p=Object(L.fixLineBreaks)(n.trim()),y=Object(T.generateCueId)(_,f,p);(!O||!O.cues||!O.cues.getCueById(y))&&(u=new r(_,f,p),u.id=y,u.line=E+1,u.align="left",u.position=10+Math.min(80,Math.floor(t*8/32)*10),o.push(u))}return O&&o.length&&(o.sort(function(v,a){return v.line==="auto"||a.line==="auto"?0:v.line>8&&a.line>8?a.line-v.line:v.line-a.line}),o.forEach(function(v){return Object(w.addCueToTrack)(O,v)})),o}};N.default=I},"./src/utils/discontinuities.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"findFirstFragWithCC",function(){return D}),S.d(N,"shouldAlignOnDiscontinuities",function(){return I}),S.d(N,"findDiscontinuousReferenceFrag",function(){return A}),S.d(N,"adjustSlidingStart",function(){return _}),S.d(N,"alignStream",function(){return f}),S.d(N,"alignPDT",function(){return o}),S.d(N,"alignFragmentByPDTDelta",function(){return e}),S.d(N,"alignMediaPlaylistByPDT",function(){return u});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts"),w=S("./src/controller/level-helper.ts");function D(s,t){for(var n=null,r=0,E=s.length;r<E;r++){var m=s[r];if(m&&m.cc===t){n=m;break}}return n}function I(s,t,n){return!!(t.details&&(n.endCC>n.startCC||s&&s.cc<n.startCC))}function A(s,t){var n=s.fragments,r=t.fragments;if(!r.length||!n.length){T.logger.log("No fragments to align");return}var E=D(n,r[0].cc);if(!E||E&&!E.startPTS){T.logger.log("No frag in previous level to align on");return}return E}function O(s,t){if(s){var n=s.start+t;s.start=s.startPTS=n,s.endPTS=n+s.duration}}function _(s,t){for(var n=t.fragments,r=0,E=n.length;r<E;r++)O(n[r],s);t.fragmentHint&&O(t.fragmentHint,s),t.alignedSliding=!0}function f(s,t,n){if(!t)return;d(s,n,t),!n.alignedSliding&&t.details&&o(n,t.details),!n.alignedSliding&&t.details&&!n.skippedSegments&&Object(w.adjustSliding)(t.details,n)}function d(s,t,n){if(I(s,n,t)){var r=A(n.details,t);r&&Object(L.isFiniteNumber)(r.start)&&(T.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),_(r.start,t))}}function o(s,t){if(!t.fragments.length||!s.hasProgramDateTime||!t.hasProgramDateTime)return;var n=t.fragments[0].programDateTime,r=s.fragments[0].programDateTime,E=(r-n)/1e3+t.fragments[0].start;E&&Object(L.isFiniteNumber)(E)&&(T.logger.log("Adjusting PTS using programDateTime delta "+(r-n)+"ms, sliding:"+E.toFixed(3)+" "+s.url+" "),_(E,s))}function e(s,t){var n=s.programDateTime;if(!n)return;var r=(n-t)/1e3;s.start=s.startPTS=r,s.endPTS=r+s.duration}function u(s,t){if(!t.fragments.length||!s.hasProgramDateTime||!t.hasProgramDateTime)return;var n=t.fragments[0].programDateTime,r=t.fragments[0].start,E=n-r*1e3;s.fragments.forEach(function(m){e(m,E)}),s.fragmentHint&&e(s.fragmentHint,E),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/utils/ewma.ts"),T=function(){function w(I,A,O){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=O,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new L.default(I),this.fast_=new L.default(A)}var D=w.prototype;return D.update=function(A,O){var _=this.slow_,f=this.fast_;this.slow_.halfLife!==A&&(this.slow_=new L.default(A,_.getEstimate(),_.getTotalWeight())),this.fast_.halfLife!==O&&(this.fast_=new L.default(O,f.getEstimate(),f.getTotalWeight()))},D.sample=function(A,O){A=Math.max(A,this.minDelayMs_);var _=8*O,f=A/1e3,d=_/f;this.fast_.sample(f,d),this.slow_.sample(f,d)},D.canEstimate=function(){var A=this.fast_;return A&&A.getTotalWeight()>=this.minWeight_},D.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},D.destroy=function(){},w}();N.default=T},"./src/utils/ewma.ts":function(fe,N,S){"use strict";S.r(N);var L=function(){function T(D,I,A){I===void 0&&(I=0),A===void 0&&(A=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=D,this.alpha_=D?Math.exp(Math.log(.5)/D):0,this.estimate_=I,this.totalWeight_=A}var w=T.prototype;return w.sample=function(I,A){var O=Math.pow(this.alpha_,I);this.estimate_=A*(1-O)+O*this.estimate_,this.totalWeight_+=I},w.getTotalWeight=function(){return this.totalWeight_},w.getEstimate=function(){if(this.alpha_){var I=1-Math.pow(this.alpha_,this.totalWeight_);if(I)return this.estimate_/I}return this.estimate_},T}();N.default=L},"./src/utils/fetch-loader.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"fetchSupported",function(){return e});var L=S("./src/polyfills/number.ts"),T=S("./src/loader/load-stats.ts"),w=S("./src/demux/chunk-cache.ts");function D(r,E){r.prototype=Object.create(E.prototype),r.prototype.constructor=r,f(r,E)}function I(r){var E=typeof Map=="function"?new Map:void 0;return I=function(p){if(p===null||!_(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E!="undefined"){if(E.has(p))return E.get(p);E.set(p,y)}function y(){return A(p,arguments,d(this).constructor)}return y.prototype=Object.create(p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f(y,p)},I(r)}function A(r,E,m){return O()?A=Reflect.construct:A=function(y,v,a){var c=[null];c.push.apply(c,v);var i=Function.bind.apply(y,c),l=new i;return a&&f(l,a.prototype),l},A.apply(null,arguments)}function O(){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(r){return!1}}function _(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function f(r,E){return f=Object.setPrototypeOf||function(p,y){return p.__proto__=y,p},f(r,E)}function d(r){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},d(r)}function o(){return o=Object.assign||function(r){for(var E=1;E<arguments.length;E++){var m=arguments[E];for(var p in m)Object.prototype.hasOwnProperty.call(m,p)&&(r[p]=m[p])}return r},o.apply(this,arguments)}function e(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(r){}return!1}var u=function(){function r(m){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=m.fetchSetup||t,this.controller=new self.AbortController,this.stats=new T.LoadStats}var E=r.prototype;return E.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},E.abortInternal=function(){var p=this.response;(!p||!p.ok)&&(this.stats.aborted=!0,this.controller.abort())},E.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},E.load=function(p,y,v){var a=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var i=s(p,this.controller.signal),l=v.onProgress,g=p.responseType==="arraybuffer",h=g?"byteLength":"length";this.context=p,this.config=y,this.callbacks=v,this.request=this.fetchSetup(p,i),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){a.abortInternal(),v.onTimeout(c,p,a.response)},y.timeout),self.fetch(this.request).then(function(b){if(a.response=a.loader=b,!b.ok){var R=b.status,x=b.statusText;throw new n(x||"fetch, bad network response",R,b)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(b.headers.get("Content-Length")||"0"),l&&Object(L.isFiniteNumber)(y.highWaterMark)?a.loadProgressively(b,c,p,y.highWaterMark,l):g?b.arrayBuffer():b.text()}).then(function(b){var R=a.response;self.clearTimeout(a.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=b[h];var x={url:R.url,data:b};l&&!Object(L.isFiniteNumber)(y.highWaterMark)&&l(c,p,b,R),v.onSuccess(x,c,p,R)}).catch(function(b){if(self.clearTimeout(a.requestTimeout),c.aborted)return;var R=b.code||0;v.onError({code:R,text:b.message},p,b.details)})},E.getCacheAge=function(){var p=null;if(this.response){var y=this.response.headers.get("age");p=y?parseFloat(y):null}return p},E.loadProgressively=function(p,y,v,a,c){a===void 0&&(a=0);var i=new w.default,l=p.body.getReader(),g=function h(){return l.read().then(function(b){if(b.done)return i.dataLength&&c(y,v,i.flush(),p),Promise.resolve(new ArrayBuffer(0));var R=b.value,x=R.length;return y.loaded+=x,x<a||i.dataLength?(i.push(R),i.dataLength>=a&&c(y,v,i.flush(),p)):c(y,v,R,p),h()}).catch(function(){return Promise.reject()})};return g()},r}();function s(r,E){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:E,headers:new self.Headers(o({},r.headers))};return r.rangeEnd&&m.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),m}function t(r,E){return new self.Request(r.url,E)}var n=function(r){D(E,r);function E(m,p,y){var v;return v=r.call(this,m)||this,v.code=void 0,v.details=void 0,v.code=p,v.details=y,v}return E}(I(Error));N.default=u},"./src/utils/imsc1-ttml-parser.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"IMSC1_CODEC",function(){return _}),S.d(N,"parseIMSC1",function(){return e});var L=S("./src/utils/mp4-tools.ts"),T=S("./src/utils/vttparser.ts"),w=S("./src/utils/vttcue.ts"),D=S("./src/demux/id3.ts"),I=S("./src/utils/timescale-conversion.ts"),A=S("./src/utils/webvtt-parser.ts");function O(){return O=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var i=arguments[c];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(a[l]=i[l])}return a},O.apply(this,arguments)}var _="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,o={left:"start",center:"center",right:"end",start:"start",end:"end"};function e(a,c,i,l,g){var h=Object(L.findBox)(new Uint8Array(a),["mdat"]);if(h.length===0){g(new Error("Could not parse IMSC1 mdat"));return}var b=h[0],R=Object(D.utf8ArrayToStr)(new Uint8Array(a,b.start,b.end-b.start)),x=Object(I.toTimescaleFromScale)(c,1,i);try{l(u(R,x))}catch(P){g(P)}}function u(a,c){var i=new DOMParser,l=i.parseFromString(a,"text/xml"),g=l.getElementsByTagName("tt")[0];if(!g)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(h).reduce(function(k,C){return k[C]=g.getAttribute("ttp:"+C)||h[C],k},{}),R=g.getAttribute("xml:space")!=="preserve",x=t(s(g,"styling","style")),P=t(s(g,"layout","region")),M=s(g,"body","[begin]");return[].map.call(M,function(k){var C=n(k,R);if(!C||!k.hasAttribute("begin"))return null;var U=p(k.getAttribute("begin"),b),K=p(k.getAttribute("dur"),b),ee=p(k.getAttribute("end"),b);if(U===null)throw m(k);if(ee===null){if(K===null)throw m(k);ee=U+K}var z=new w.default(U-c,ee-c,C);z.id=Object(A.generateCueId)(z.startTime,z.endTime,z.text);var ae=P[k.getAttribute("region")],se=x[k.getAttribute("style")];z.position=10,z.size=80;var V=r(ae,se),Y=V.textAlign;if(Y){var q=o[Y];q&&(z.lineAlign=q),z.align=Y}return O(z,V),z}).filter(function(k){return k!==null})}function s(a,c,i){var l=a.getElementsByTagName(c)[0];return l?[].slice.call(l.querySelectorAll(i)):[]}function t(a){return a.reduce(function(c,i){var l=i.getAttribute("xml:id");return l&&(c[l]=i),c},{})}function n(a,c){return[].slice.call(a.childNodes).reduce(function(i,l,g){var h;return l.nodeName==="br"&&g?i+`
`:(h=l.childNodes)!==null&&h!==void 0&&h.length?n(l,c):c?i+l.textContent.trim().replace(/\s+/g," "):i+l.textContent},"")}function r(a,c){var i="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(g,h){var b=E(c,i,h)||E(a,i,h);return b&&(g[h]=b),g},{})}function E(a,c,i){return a.hasAttributeNS(c,i)?a.getAttributeNS(c,i):null}function m(a){return new Error("Could not parse ttml timestamp "+a)}function p(a,c){if(!a)return null;var i=Object(T.parseTimeStamp)(a);return i===null&&(f.test(a)?i=y(a,c):d.test(a)&&(i=v(a,c))),i}function y(a,c){var i=f.exec(a),l=(i[4]|0)+(i[5]|0)/c.subFrameRate;return(i[1]|0)*3600+(i[2]|0)*60+(i[3]|0)+l/c.frameRate}function v(a,c){var i=d.exec(a),l=Number(i[1]),g=i[2];switch(g){case"h":return l*3600;case"m":return l*60;case"ms":return l*1e3;case"f":return l/c.frameRate;case"t":return l/c.tickRate}return l}},"./src/utils/logger.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"enableLogs",function(){return A}),S.d(N,"logger",function(){return O});var L=function(){},T={trace:L,debug:L,log:L,warn:L,info:L,error:L},w=T;function D(_){var f=self.console[_];return f?f.bind(self.console,"["+_+"] >"):L}function I(_){for(var f=arguments.length,d=new Array(f>1?f-1:0),o=1;o<f;o++)d[o-1]=arguments[o];d.forEach(function(e){w[e]=_[e]?_[e].bind(_):D(e)})}function A(_){if(self.console&&_===!0||typeof _=="object"){I(_,"debug","log","info","warn","error");try{w.log()}catch(f){w=T}}else w=T}var O=w},"./src/utils/mediakeys-helper.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"KeySystems",function(){return L}),S.d(N,"requestMediaKeySystemAccess",function(){return T});var L;(function(w){w.WIDEVINE="com.widevine.alpha",w.PLAYREADY="com.microsoft.playready"})(L||(L={}));var T=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"getMediaSource",function(){return L});function L(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"bin2str",function(){return I}),S.d(N,"readUint16",function(){return A}),S.d(N,"readUint32",function(){return O}),S.d(N,"writeUint32",function(){return _}),S.d(N,"findBox",function(){return f}),S.d(N,"parseSegmentIndex",function(){return d}),S.d(N,"parseInitSegment",function(){return o}),S.d(N,"getStartDTS",function(){return e}),S.d(N,"getDuration",function(){return u}),S.d(N,"computeRawDurationFromSamples",function(){return s}),S.d(N,"offsetStartDTS",function(){return t}),S.d(N,"segmentValidRange",function(){return n}),S.d(N,"appendUint8Array",function(){return r});var L=S("./src/utils/typed-array.ts"),T=S("./src/loader/fragment.ts"),w=Math.pow(2,32)-1,D=[].push;function I(E){return String.fromCharCode.apply(null,E)}function A(E,m){"data"in E&&(m+=E.start,E=E.data);var p=E[m]<<8|E[m+1];return p<0?65536+p:p}function O(E,m){"data"in E&&(m+=E.start,E=E.data);var p=E[m]<<24|E[m+1]<<16|E[m+2]<<8|E[m+3];return p<0?4294967296+p:p}function _(E,m,p){"data"in E&&(m+=E.start,E=E.data),E[m]=p>>24,E[m+1]=p>>16&255,E[m+2]=p>>8&255,E[m+3]=p&255}function f(E,m){var p=[];if(!m.length)return p;var y,v,a;"data"in E?(y=E.data,v=E.start,a=E.end):(y=E,v=0,a=y.byteLength);for(var c=v;c<a;){var i=O(y,c),l=I(y.subarray(c+4,c+8)),g=i>1?c+i:a;if(l===m[0])if(m.length===1)p.push({data:y,start:c+8,end:g});else{var h=f({data:y,start:c+8,end:g},m.slice(1));h.length&&D.apply(p,h)}c=g}return p}function d(E){var m=f(E,["moov"]),p=m[0],y=p?p.end:null,v=f(E,["sidx"]);if(!v||!v[0])return null;var a=[],c=v[0],i=c.data[0],l=i===0?8:16,g=O(c,l);l+=4;var h=0,b=0;i===0?l+=8:l+=16,l+=2;var R=c.end+b,x=A(c,l);l+=2;for(var P=0;P<x;P++){var M=l,k=O(c,M);M+=4;var C=k&2147483647,U=(k&2147483648)>>>31;if(U===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var K=O(c,M);M+=4,a.push({referenceSize:C,subsegmentDuration:K,info:{duration:K/g,start:R,end:R+C-1}}),R+=C,M+=4,l=M}return{earliestPresentationTime:h,timescale:g,version:i,referencesCount:x,references:a,moovEndOffset:y}}function o(E){for(var m=[],p=f(E,["moov","trak"]),y=0;y<p.length;y++){var v=p[y],a=f(v,["tkhd"])[0];if(a){var c=a.data[a.start],i=c===0?12:20,l=O(a,i),g=f(v,["mdia","mdhd"])[0];if(g){c=g.data[g.start],i=c===0?12:20;var h=O(g,i),b=f(v,["mdia","hdlr"])[0];if(b){var R=I(b.data.subarray(b.start+8,b.start+12)),x={soun:T.ElementaryStreamTypes.AUDIO,vide:T.ElementaryStreamTypes.VIDEO}[R];if(x){var P=f(v,["mdia","minf","stbl","stsd"])[0],M=void 0;P&&(M=I(P.data.subarray(P.start+12,P.start+16))),m[l]={timescale:h,type:x},m[x]={timescale:h,id:l,codec:M}}}}}}var k=f(E,["moov","mvex","trex"]);return k.forEach(function(C){var U=O(C,4),K=m[U];K&&(K.default={duration:O(C,12),flags:O(C,20)})}),m}function e(E,m){return f(m,["moof","traf"]).reduce(function(p,y){var v=f(y,["tfdt"])[0],a=v.data[v.start],c=f(y,["tfhd"]).reduce(function(i,l){var g=O(l,4),h=E[g];if(h){var b=O(v,4);a===1&&(b*=Math.pow(2,32),b+=O(v,8));var R=h.timescale||9e4,x=b/R;if(isFinite(x)&&(i===null||x<i))return x}return i},null);return c!==null&&isFinite(c)&&(p===null||c<p)?c:p},null)||0}function u(E,m){for(var p=0,y=0,v=0,a=f(E,["moof","traf"]),c=0;c<a.length;c++){var i=a[c],l=f(i,["tfhd"])[0],g=O(l,4),h=m[g];if(!h)continue;var b=h.default,R=O(l,0)|(b==null?void 0:b.flags),x=b==null?void 0:b.duration;R&8&&(R&2?x=O(l,12):x=O(l,8));for(var P=h.timescale||9e4,M=f(i,["trun"]),k=0;k<M.length;k++){if(x){var C=O(M[k],4);p=x*C}else p=s(M[k]);h.type===T.ElementaryStreamTypes.VIDEO?y+=p/P:h.type===T.ElementaryStreamTypes.AUDIO&&(v+=p/P)}}if(y===0&&v===0){var U=d(E);if(U!=null&&U.references)return U.references.reduce(function(K,ee){return K+ee.info.duration||0},0)}return y||v}function s(E){var m=O(E,0),p=8;m&1&&(p+=4),m&4&&(p+=4);for(var y=0,v=O(E,4),a=0;a<v;a++){if(m&256){var c=O(E,p);y+=c,p+=4}m&512&&(p+=4),m&1024&&(p+=4),m&2048&&(p+=4)}return y}function t(E,m,p){f(m,["moof","traf"]).forEach(function(y){f(y,["tfhd"]).forEach(function(v){var a=O(v,4),c=E[a];if(!c)return;var i=c.timescale||9e4;f(y,["tfdt"]).forEach(function(l){var g=l.data[l.start],h=O(l,4);if(g===0)_(l,4,h-p*i);else{h*=Math.pow(2,32),h+=O(l,8),h-=p*i,h=Math.max(h,0);var b=Math.floor(h/(w+1)),R=Math.floor(h%(w+1));_(l,4,b),_(l,8,R)}})})})}function n(E){var m={valid:null,remainder:null},p=f(E,["moof"]);if(p){if(p.length<2)return m.remainder=E,m}else return m;var y=p[p.length-1];return m.valid=Object(L.sliceUint8)(E,0,y.start-8),m.remainder=Object(L.sliceUint8)(E,y.start-8),m}function r(E,m){var p=new Uint8Array(E.length+m.length);return p.set(E),p.set(m,E.length),p}},"./src/utils/output-filter.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"default",function(){return L});var L=function(){function T(D,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=D,this.trackName=I}var w=T.prototype;return w.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},w.newCue=function(I,A,O){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=A,this.screen=O,this.timelineController.createCaptionsTrack(this.trackName)},w.reset=function(){this.cueRanges=[]},T}()},"./src/utils/texttrack-utils.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"sendAddTrackEvent",function(){return T}),S.d(N,"addCueToTrack",function(){return w}),S.d(N,"clearCurrentCues",function(){return D}),S.d(N,"removeCuesInRange",function(){return I}),S.d(N,"getCuesInRange",function(){return O});var L=S("./src/utils/logger.ts");function T(_,f){var d;try{d=new Event("addtrack")}catch(o){d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=_,f.dispatchEvent(d)}function w(_,f){var d=_.mode;if(d==="disabled"&&(_.mode="hidden"),_.cues&&!_.cues.getCueById(f.id))try{if(_.addCue(f),!_.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(e){L.logger.debug("[texttrack-utils]: "+e);var o=new self.TextTrackCue(f.startTime,f.endTime,f.text);o.id=f.id,_.addCue(o)}d==="disabled"&&(_.mode=d)}function D(_){var f=_.mode;if(f==="disabled"&&(_.mode="hidden"),_.cues)for(var d=_.cues.length;d--;)_.removeCue(_.cues[d]);f==="disabled"&&(_.mode=f)}function I(_,f,d){var o=_.mode;if(o==="disabled"&&(_.mode="hidden"),_.cues&&_.cues.length>0)for(var e=O(_.cues,f,d),u=0;u<e.length;u++)_.removeCue(e[u]);o==="disabled"&&(_.mode=o)}function A(_,f){if(f<_[0].startTime)return 0;var d=_.length-1;if(f>_[d].endTime)return-1;for(var o=0,e=d;o<=e;){var u=Math.floor((e+o)/2);if(f<_[u].startTime)e=u-1;else if(f>_[u].startTime&&o<d)o=u+1;else return u}return _[o].startTime-f<f-_[e].startTime?o:e}function O(_,f,d){var o=[],e=A(_,f);if(e>-1)for(var u=e,s=_.length;u<s;u++){var t=_[u];if(t.startTime>=f&&t.endTime<=d)o.push(t);else if(t.startTime>d)return o}return o}},"./src/utils/time-ranges.ts":function(fe,N,S){"use strict";S.r(N);var L={toString:function(w){for(var D="",I=w.length,A=0;A<I;A++)D+="["+w.start(A).toFixed(3)+","+w.end(A).toFixed(3)+"]";return D}};N.default=L},"./src/utils/timescale-conversion.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"toTimescaleFromBase",function(){return T}),S.d(N,"toTimescaleFromScale",function(){return w}),S.d(N,"toMsFromMpegTsClock",function(){return D}),S.d(N,"toMpegTsClockFromTimescale",function(){return I});var L=9e4;function T(A,O,_,f){_===void 0&&(_=1),f===void 0&&(f=!1);var d=A*O*_;return f?Math.round(d):d}function w(A,O,_,f){return _===void 0&&(_=1),f===void 0&&(f=!1),T(A,O,1/_,f)}function D(A,O){return O===void 0&&(O=!1),T(A,1e3,1/L,O)}function I(A,O){return O===void 0&&(O=1),T(A,L,1/O)}},"./src/utils/typed-array.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"sliceUint8",function(){return L});function L(T,w,D){return Uint8Array.prototype.slice?T.slice(w,D):new Uint8Array(Array.prototype.slice.call(T,w,D))}},"./src/utils/vttcue.ts":function(fe,N,S){"use strict";S.r(N),N.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var L=["","lr","rl"],T=["start","middle","end","left","right"];function w(_,f){if(typeof f!="string")return!1;if(!Array.isArray(_))return!1;var d=f.toLowerCase();return~_.indexOf(d)?d:!1}function D(_){return w(L,_)}function I(_){return w(T,_)}function A(_){for(var f=arguments.length,d=new Array(f>1?f-1:0),o=1;o<f;o++)d[o-1]=arguments[o];for(var e=1;e<arguments.length;e++){var u=arguments[e];for(var s in u)_[s]=u[s]}return _}function O(_,f,d){var o=this,e={enumerable:!0};o.hasBeenReset=!1;var u="",s=!1,t=_,n=f,r=d,E=null,m="",p=!0,y="auto",v="start",a=50,c="middle",i=50,l="middle";Object.defineProperty(o,"id",A({},e,{get:function(){return u},set:function(h){u=""+h}})),Object.defineProperty(o,"pauseOnExit",A({},e,{get:function(){return s},set:function(h){s=!!h}})),Object.defineProperty(o,"startTime",A({},e,{get:function(){return t},set:function(h){if(typeof h!="number")throw new TypeError("Start time must be set to a number.");t=h,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",A({},e,{get:function(){return n},set:function(h){if(typeof h!="number")throw new TypeError("End time must be set to a number.");n=h,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",A({},e,{get:function(){return r},set:function(h){r=""+h,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",A({},e,{get:function(){return E},set:function(h){E=h,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",A({},e,{get:function(){return m},set:function(h){var b=D(h);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=b,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",A({},e,{get:function(){return p},set:function(h){p=!!h,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",A({},e,{get:function(){return y},set:function(h){if(typeof h!="number"&&h!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");y=h,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",A({},e,{get:function(){return v},set:function(h){var b=I(h);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",A({},e,{get:function(){return a},set:function(h){if(h<0||h>100)throw new Error("Position must be between 0 and 100.");a=h,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",A({},e,{get:function(){return c},set:function(h){var b=I(h);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",A({},e,{get:function(){return i},set:function(h){if(h<0||h>100)throw new Error("Size must be between 0 and 100.");i=h,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",A({},e,{get:function(){return l},set:function(h){var b=I(h);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");l=b,this.hasBeenReset=!0}})),o.displayState=void 0}return O.prototype.getCueAsHTML=function(){var _=self.WebVTT;return _.convertCueToDOMTree(self,this.text)},O}()},"./src/utils/vttparser.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"parseTimeStamp",function(){return w}),S.d(N,"fixLineBreaks",function(){return f}),S.d(N,"VTTParser",function(){return d});var L=S("./src/utils/vttcue.ts"),T=function(){function o(){}var e=o.prototype;return e.decode=function(s,t){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},o}();function w(o){function e(s,t,n,r){return(s|0)*3600+(t|0)*60+(n|0)+parseFloat(r||0)}var u=o.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return u?parseFloat(u[2])>59?e(u[2],u[3],0,u[4]):e(u[1],u[2],u[3],u[4]):null}var D=function(){function o(){this.values=Object.create(null)}var e=o.prototype;return e.set=function(s,t){!this.get(s)&&t!==""&&(this.values[s]=t)},e.get=function(s,t,n){return n?this.has(s)?this.values[s]:t[n]:this.has(s)?this.values[s]:t},e.has=function(s){return s in this.values},e.alt=function(s,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(s,t);break}},e.integer=function(s,t){/^-?\d+$/.test(t)&&this.set(s,parseInt(t,10))},e.percent=function(s,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var n=parseFloat(t);if(n>=0&&n<=100)return this.set(s,n),!0}return!1},o}();function I(o,e,u,s){var t=s?o.split(s):[o];for(var n in t){if(typeof t[n]!="string")continue;var r=t[n].split(u);if(r.length!==2)continue;var E=r[0],m=r[1];e(E,m)}}var A=new L.default(0,0,""),O=A.align==="middle"?"middle":"center";function _(o,e,u){var s=o;function t(){var E=w(o);if(E===null)throw new Error("Malformed timestamp: "+s);return o=o.replace(/^[^\sa-zA-Z-]+/,""),E}function n(E,m){var p=new D;I(E,function(a,c){var i;switch(a){case"region":for(var l=u.length-1;l>=0;l--)if(u[l].id===c){p.set(a,u[l].region);break}break;case"vertical":p.alt(a,c,["rl","lr"]);break;case"line":i=c.split(","),p.integer(a,i[0]),p.percent(a,i[0])&&p.set("snapToLines",!1),p.alt(a,i[0],["auto"]),i.length===2&&p.alt("lineAlign",i[1],["start",O,"end"]);break;case"position":i=c.split(","),p.percent(a,i[0]),i.length===2&&p.alt("positionAlign",i[1],["start",O,"end","line-left","line-right","auto"]);break;case"size":p.percent(a,c);break;case"align":p.alt(a,c,["start",O,"end","left","right"]);break}},/:/,/\s/),m.region=p.get("region",null),m.vertical=p.get("vertical","");var y=p.get("line","auto");y==="auto"&&A.line===-1&&(y=-1),m.line=y,m.lineAlign=p.get("lineAlign","start"),m.snapToLines=p.get("snapToLines",!0),m.size=p.get("size",100),m.align=p.get("align",O);var v=p.get("position","auto");v==="auto"&&A.position===50&&(v=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=v}function r(){o=o.replace(/^\s+/,"")}if(r(),e.startTime=t(),r(),o.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);o=o.substr(3),r(),e.endTime=t(),r(),n(o,e)}function f(o){return o.replace(/<br(?: \/)?>/gi,`
`)}var d=function(){function o(){this.state="INITIAL",this.buffer="",this.decoder=new T,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=o.prototype;return e.parse=function(s){var t=this;s&&(t.buffer+=t.decoder.decode(s,{stream:!0}));function n(){var v=t.buffer,a=0;for(v=f(v);a<v.length&&v[a]!=="\r"&&v[a]!==`
`;)++a;var c=v.substr(0,a);return v[a]==="\r"&&++a,v[a]===`
`&&++a,t.buffer=v.substr(a),c}function r(v){I(v,function(a,c){},/:/)}try{var E="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;E=n();var m=E.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var p=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;p?p=!1:E=n();switch(t.state){case"HEADER":/:/.test(E)?r(E):E||(t.state="ID");continue;case"NOTE":E||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(E)){t.state="NOTE";break}if(!E)continue;if(t.cue=new L.default(0,0,""),t.state="CUE",E.indexOf("-->")===-1){t.cue.id=E;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{_(E,t.cue,t.regionList)}catch(v){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var y=E.indexOf("-->")!==-1;if(!E||y&&(p=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=E}continue;case"BADCUE":E||(t.state="ID")}}}catch(v){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){s.onparsingerror&&s.onparsingerror(t)}return s.onflush&&s.onflush(),this},o}()},"./src/utils/webvtt-parser.ts":function(fe,N,S){"use strict";S.r(N),S.d(N,"generateCueId",function(){return d}),S.d(N,"parseWebVTT",function(){return e});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/vttparser.ts"),w=S("./src/demux/id3.ts"),D=S("./src/utils/timescale-conversion.ts"),I=S("./src/remux/mp4-remuxer.ts"),A=/\r\n|\n\r|\n|\r/g,O=function(s,t,n){return n===void 0&&(n=0),s.substr(n,t.length)===t},_=function(s){var t=parseInt(s.substr(-3)),n=parseInt(s.substr(-6,2)),r=parseInt(s.substr(-9,2)),E=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(L.isFiniteNumber)(t)||!Object(L.isFiniteNumber)(n)||!Object(L.isFiniteNumber)(r)||!Object(L.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return t+=1e3*n,t+=60*1e3*r,t+=60*60*1e3*E,t},f=function(s){for(var t=5381,n=s.length;n;)t=t*33^s.charCodeAt(--n);return(t>>>0).toString()};function d(u,s,t){return f(u.toString())+f(s.toString())+f(t)}var o=function(s,t,n){var r=s[t],E=s[r.prevCC];if(!E||!E.new&&r.new){s.ccOffset=s.presentationOffset=r.start,r.new=!1;return}for(;(m=E)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=r.start-E.start,r.new=!1,r=E,E=s[r.prevCC]}s.presentationOffset=n};function e(u,s,t,n,r,E,m,p){var y=new T.VTTParser,v=Object(w.utf8ArrayToStr)(new Uint8Array(u)).trim().replace(A,`
`).split(`
`),a=[],c=Object(D.toMpegTsClockFromTimescale)(s,t),i="00:00.000",l=0,g=0,h,b=!0,R=!1;y.oncue=function(x){var P=n[r],M=n.ccOffset,k=(l-c)/9e4;if(P!=null&&P.new&&(g!==void 0?M=n.ccOffset=P.start:o(n,r,k)),k&&(M=k-n.presentationOffset),R){var C=x.endTime-x.startTime,U=Object(I.normalizePts)((x.startTime+M-g)*9e4,E*9e4)/9e4;x.startTime=U,x.endTime=U+C}var K=x.text.trim();x.text=decodeURIComponent(encodeURIComponent(K)),x.id||(x.id=d(x.startTime,x.endTime,K)),x.endTime>0&&a.push(x)},y.onparsingerror=function(x){h=x},y.onflush=function(){if(h){p(h);return}m(a)},v.forEach(function(x){if(b)if(O(x,"X-TIMESTAMP-MAP=")){b=!1,R=!0,x.substr(16).split(",").forEach(function(P){O(P,"LOCAL:")?i=P.substr(6):O(P,"MPEGTS:")&&(l=parseInt(P.substr(7)))});try{g=_(i)/1e3}catch(P){R=!1,h=P}return}else x===""&&(b=!1);y.parse(x+`
`)}),y.flush()}},"./src/utils/xhr-loader.ts":function(fe,N,S){"use strict";S.r(N);var L=S("./src/utils/logger.ts"),T=S("./src/loader/load-stats.ts"),w=/^age:\s*[\d.]+\s*$/m,D=function(){function I(O){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=O?O.xhrSetup:null,this.stats=new T.LoadStats,this.retryDelay=0}var A=I.prototype;return A.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},A.abortInternal=function(){var _=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),_&&(_.onreadystatechange=null,_.onprogress=null,_.readyState!==4&&(this.stats.aborted=!0,_.abort()))},A.abort=function(){var _;this.abortInternal(),(_=this.callbacks)!==null&&_!==void 0&&_.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},A.load=function(_,f,d){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=_,this.config=f,this.callbacks=d,this.retryDelay=f.retryDelay,this.loadInternal()},A.loadInternal=function(){var _=this.config,f=this.context;if(!_)return;var d=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0;var e=this.xhrSetup;try{if(e)try{e(d,f.url)}catch(t){d.open("GET",f.url,!0),e(d,f.url)}d.readyState||d.open("GET",f.url,!0);var u=this.context.headers;if(u)for(var s in u)d.setRequestHeader(s,u[s])}catch(t){this.callbacks.onError({code:d.status,text:t.message},f,d);return}f.rangeEnd&&d.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),d.onreadystatechange=this.readystatechange.bind(this),d.onprogress=this.loadprogress.bind(this),d.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),_.timeout),d.send()},A.readystatechange=function(){var _=this.context,f=this.loader,d=this.stats;if(!_||!f)return;var o=f.readyState,e=this.config;if(d.aborted)return;if(o>=2)if(self.clearTimeout(this.requestTimeout),d.loading.first===0&&(d.loading.first=Math.max(self.performance.now(),d.loading.start)),o===4){f.onreadystatechange=null,f.onprogress=null;var u=f.status;if(u>=200&&u<300){d.loading.end=Math.max(self.performance.now(),d.loading.first);var s,t;if(_.responseType==="arraybuffer"?(s=f.response,t=s.byteLength):(s=f.responseText,t=s.length),d.loaded=d.total=t,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(d,_,s,f),!this.callbacks)return;var r={url:f.responseURL,data:s};this.callbacks.onSuccess(r,d,_,f)}else d.retry>=e.maxRetry||u>=400&&u<499?(L.logger.error(u+" while loading "+_.url),this.callbacks.onError({code:u,text:f.statusText},_,f)):(L.logger.warn(u+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,e.maxRetryDelay),d.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout)},A.loadtimeout=function(){L.logger.warn("timeout while loading "+this.context.url);var _=this.callbacks;_&&(this.abortInternal(),_.onTimeout(this.stats,this.context,this.loader))},A.loadprogress=function(_){var f=this.stats;f.loaded=_.loaded,_.lengthComputable&&(f.total=_.total)},A.getCacheAge=function(){var _=null;if(this.loader&&w.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");_=f?parseFloat(f):null}return _},I}();N.default=D}}).default})},vHTk:function(Xe,Fe,B){Xe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},xTzM:function(Xe,Fe){Xe.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="}}]);