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

330 lines
964 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[198,5,7,8,10],{"+vTd":function(Ct,Fe,j){Ct.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",list:"list___1gpez",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",line:"line___-rzSr",know:"know___y8QKK",title:"title___21uOv",tr:"tr___3kTJL",menu:"menu___SYdg7",bottom:"bottom___2dFIa"}},"+z73":function(Ct,Fe,j){Ct.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"}},"1ZF9":function(Ct,Fe,j){Ct.exports=j.p+"static/Authorize.cc9c212f.png"},"6+eU":function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return o});var he=j("wx14"),B=j("rePB"),w=j("VTBJ"),U=j("1OyB"),_=j("vuIU"),x=j("Ji7U"),N=j("LK+K"),I=j("q1tI"),S=j.n(I),P=j("TSYQ"),E=j.n(P),O=function(f){var i,r="".concat(f.rootPrefixCls,"-item"),t=E()(r,"".concat(r,"-").concat(f.page),(i={},Object(B.a)(i,"".concat(r,"-active"),f.active),Object(B.a)(i,f.className,!!f.className),Object(B.a)(i,"".concat(r,"-disabled"),!f.page),i)),a=function(){f.onClick(f.page)},g=function(d){f.onKeyPress(d,f.onClick,f.page)};return S.a.createElement("li",{title:f.showTitle?f.page:null,className:t,onClick:a,onKeyPress:g,tabIndex:"0"},f.itemRender(f.page,"page",S.a.createElement("a",{rel:"nofollow"},f.page)))},R=O,T={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},C=function(v){Object(x.a)(i,v);var f=Object(N.a)(i);function i(){var r;Object(U.a)(this,i);for(var t=arguments.length,a=new Array(t),g=0;g<t;g++)a[g]=arguments[g];return r=f.call.apply(f,[this].concat(a)),r.state={goInputText:""},r.buildOptionText=function(h){return"".concat(h," ").concat(r.props.locale.items_per_page)},r.changeSize=function(h){r.props.changeSize(Number(h))},r.handleChange=function(h){r.setState({goInputText:h.target.value})},r.handleBlur=function(h){var d=r.props,e=d.goButton,A=d.quickGo,M=d.rootPrefixCls,F=r.state.goInputText;if(e||F==="")return;if(h.relatedTarget&&(h.relatedTarget.className.indexOf("".concat(M,"-prev"))>=0||h.relatedTarget.className.indexOf("".concat(M,"-next"))>=0))return;r.setState({goInputText:""}),A(r.getValidValue())},r.go=function(h){var d=r.state.goInputText;if(d==="")return;(h.keyCode===T.ENTER||h.type==="click")&&(r.setState({goInputText:""}),r.props.quickGo(r.getValidValue()))},r}return Object(_.a)(i,[{key:"getValidValue",value:function(){var t=this.state,a=t.goInputText,g=t.current;return!a||isNaN(a)?g:Number(a)}},{key:"getPageSizeOptions",value:function(){var t=this.props,a=t.pageSize,g=t.pageSizeOptions;return g.some(function(h){return h.toString()===a.toString()})?g:g.concat([a.toString()]).sort(function(h,d){var e=isNaN(Number(h))?0:Number(h),A=isNaN(Number(d))?0:Number(d);return e-A})}},{key:"render",value:function(){var t=this,a=this.props,g=a.pageSize,h=a.locale,d=a.rootPrefixCls,e=a.changeSize,A=a.quickGo,M=a.goButton,F=a.selectComponentClass,W=a.buildOptionText,Z=a.selectPrefixCls,K=a.disabled,J=this.state.goInputText,oe="".concat(d,"-options"),se=F,pe=null,be=null,Q=null;if(!e&&!A)return null;var te=this.getPageSizeOptions();if(e&&se){var ve=te.map(function(q,X){return S.a.createElement(se.Option,{key:X,value:q.toString()},(W||t.buildOptionText)(q))});pe=S.a.createElement(se,{disabled:K,prefixCls:Z,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(g||te[0]).toString(),onChange:this.changeSize,getPopupContainer:function(X){return X.parentNode}},ve)}return A&&(M&&(Q=typeof M=="boolean"?S.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(oe,"-quick-jumper-button")},h.jump_to_confirm):S.a.createElement("span",{onClick:this.go,onKeyUp:this.go},M)),be=S.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},h.jump_to,S.a.createElement("input",{disabled:K,type:"text",value:J,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),h.page,Q)),S.a.createElement("li",{className:"".concat(oe)},pe,be)}}]),i}(S.a.Component);C.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=C,m=j("N2Kk");function n(){}function s(v){return typeof v=="number"&&isFinite(v)&&Math.floor(v)===v}function l(v,f,i){return i}function y(v,f,i){var r=typeof v=="undefined"?f.pageSize:v;return Math.floor((i.total-1)/r)+1}var c=function(v){Object(x.a)(i,v);var f=Object(N.a)(i);function i(r){var t;Object(U.a)(this,i),t=f.call(this,r),t.getJumpPrevPage=function(){return Math.max(1,t.state.current-(t.props.showLessItems?3:5))},t.getJumpNextPage=function(){return Math.min(y(void 0,t.state,t.props),t.state.current+(t.props.showLessItems?3:5))},t.getItemIcon=function(e,A){var M=t.props.prefixCls,F=e||S.a.createElement("button",{type:"button","aria-label":A,className:"".concat(M,"-item-link")});return typeof e=="function"&&(F=S.a.createElement(e,Object(w.a)({},t.props))),F},t.savePaginationNode=function(e){t.paginationNode=e},t.isValid=function(e){return s(e)&&e!==t.state.current},t.shouldDisplayQuickJumper=function(){var e=t.props,A=e.showQuickJumper,M=e.pageSize,F=e.total;return F<=M?!1:A},t.handleKeyDown=function(e){(e.keyCode===T.ARROW_UP||e.keyCode===T.ARROW_DOWN)&&e.preventDefault()},t.handleKeyUp=function(e){var A=t.getValidValue(e),M=t.state.currentInputValue;A!==M&&t.setState({currentInputValue:A}),e.keyCode===T.ENTER?t.handleChange(A):e.keyCode===T.ARROW_UP?t.handleChange(A-1):e.keyCode===T.ARROW_DOWN&&t.handleChange(A+1)},t.changePageSize=function(e){var A=t.state.current,M=y(e,t.state,t.props);A=A>M?M:A,M===0&&(A=t.state.current),typeof e=="number"&&("pageSize"in t.props||t.setState({pageSize:e}),"current"in t.props||t.setState({current:A,currentInputValue:A})),t.props.onShowSizeChange(A,e),"onChange"in t.props&&t.props.onChange&&t.props.onChange(A,e)},t.handleChange=function(e){var A=t.props.disabled,M=e;if(t.isValid(M)&&!A){var F=y(void 0,t.state,t.props);M>F?M=F:M<1&&(M=1),"current"in t.props||t.setState({current:M,currentInputValue:M});var W=t.state.pageSize;return t.props.onChange(M,W),M}return t.state.current},t.prev=function(){t.hasPrev()&&t.handleChange(t.state.current-1)},t.next=function(){t.hasNext()&&t.handleChange(t.state.current+1)},t.jumpPrev=function(){t.handleChange(t.getJumpPrevPage())},t.jumpNext=function(){t.handleChange(t.getJumpNextPage())},t.hasPrev=function(){return t.state.current>1},t.hasNext=function(){return t.state.current<y(void 0,t.state,t.props)},t.runIfEnter=function(e,A){if(e.key==="Enter"||e.charCode===13){for(var M=arguments.length,F=new Array(M>2?M-2:0),W=2;W<M;W++)F[W-2]=arguments[W];A.apply(void 0,F)}},t.runIfEnterPrev=function(e){t.runIfEnter(e,t.prev)},t.runIfEnterNext=function(e){t.runIfEnter(e,t.next)},t.runIfEnterJumpPrev=function(e){t.runIfEnter(e,t.jumpPrev)},t.runIfEnterJumpNext=function(e){t.runIfEnter(e,t.jumpNext)},t.handleGoTO=function(e){(e.keyCode===T.ENTER||e.type==="click")&&t.handleChange(t.state.currentInputValue)};var a=r.onChange!==n,g="current"in r;g&&!a&&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=r.defaultCurrent;"current"in r&&(h=r.current);var d=r.defaultPageSize;return"pageSize"in r&&(d=r.pageSize),h=Math.min(h,y(d,void 0,r)),t.state={current:h,currentInputValue:h,pageSize:d},t}return Object(_.a)(i,[{key:"componentDidUpdate",value:function(t,a){var g=this.props.prefixCls;if(a.current!==this.state.current&&this.paginationNode){var h=this.paginationNode.querySelector(".".concat(g,"-item-").concat(a.current));h&&document.activeElement===h&&h.blur()}}},{key:"getValidValue",value:function(t){var a=t.target.value,g=y(void 0,this.state,this.props),h=this.state.currentInputValue,d;return a===""?d=a:isNaN(Number(a))?d=h:a>=g?d=g:d=Number(a),d}},{key:"getShowSizeChanger",value:function(){var t=this.props,a=t.showSizeChanger,g=t.total,h=t.totalBoundaryShowSizeChanger;return typeof a!="undefined"?a:g>h}},{key:"renderPrev",value:function(t){var a=this.props,g=a.prevIcon,h=a.itemRender,d=h(t,"prev",this.getItemIcon(g,"prev page")),e=!this.hasPrev();return Object(I.isValidElement)(d)?Object(I.cloneElement)(d,{disabled:e}):d}},{key:"renderNext",value:function(t){var a=this.props,g=a.nextIcon,h=a.itemRender,d=h(t,"next",this.getItemIcon(g,"next page")),e=!this.hasNext();return Object(I.isValidElement)(d)?Object(I.cloneElement)(d,{disabled:e}):d}},{key:"render",value:function(){var t=this,a=this.props,g=a.prefixCls,h=a.className,d=a.style,e=a.disabled,A=a.hideOnSinglePage,M=a.total,F=a.locale,W=a.showQuickJumper,Z=a.showLessItems,K=a.showTitle,J=a.showTotal,oe=a.simple,se=a.itemRender,pe=a.showPrevNextJumpers,be=a.jumpPrevIcon,Q=a.jumpNextIcon,te=a.selectComponentClass,ve=a.selectPrefixCls,q=a.pageSizeOptions,X=this.state,Te=X.current,Ie=X.pageSize,Ge=X.currentInputValue;if(A===!0&&M<=Ie)return null;var Ae=y(void 0,this.state,this.props),Me=[],Se=null,Le=null,Ve=null,$e=null,Qe=null,Be=W&&W.goButton,ze=Z?1:2,ot=Te-1>0?Te-1:0,Re=Te+1<Ae?Te+1:Ae,nt=Object.keys(this.props).reduce(function($,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&($[Y]=t.props[Y]),$},{});if(oe)return Be&&(typeof Be=="boolean"?Qe=S.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F.jump_to_confirm):Qe=S.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Be),Qe=S.a.createElement("li",{title:K?"".concat(F.jump_to).concat(Te,"/").concat(Ae):null,className:"".concat(g,"-simple-pager")},Qe)),S.a.createElement("ul",Object(he.a)({className:E()(g,"".concat(g,"-simple"),Object(B.a)({},"".concat(g,"-disabled"),e),h),style:d,ref:this.savePaginationNode},nt),S.a.createElement("li",{title:K?F.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:E()("".concat(g,"-prev"),Object(B.a)({},"".concat(g,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ot)),S.a.createElement("li",{title:K?"".concat(Te,"/").concat(Ae):null,className:"".concat(g,"-simple-pager")},S.a.createElement("input",{type:"text",value:Ge,disabled:e,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),S.a.createElement("span",{className:"".concat(g,"-slash")},"/"),Ae),S.a.createElement("li",{title:K?F.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:E()("".concat(g,"-next"),Object(B.a)({},"".concat(g,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Re)),Qe);if(Ae<=3+ze*2){var rt={locale:F,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:se};Ae||Me.push(S.a.createElement(R,Object(he.a)({},rt,{key:"noPager",page:Ae,className:"".concat(g,"-disabled")})));for(var lt=1;lt<=Ae;lt+=1){var bt=Te===lt;Me.push(S.a.createElement(R,Object(he.a)({},rt,{key:lt,page:lt,active:bt})))}}else{var Ee=Z?F.prev_3:F.prev_5,Oe=Z?F.next_3:F.next_5;pe&&(Se=S.a.createElement("li",{title:K?Ee:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:E()("".concat(g,"-jump-prev"),Object(B.a)({},"".concat(g,"-jump-prev-custom-icon"),!!be))},se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(be,"prev page"))),Le=S.a.createElement("li",{title:K?Oe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:E()("".concat(g,"-jump-next"),Object(B.a)({},"".concat(g,"-jump-next-custom-icon"),!!Q))},se(this.getJumpNextPage(),"jump-next",this.getItemIcon(Q,"next page")))),$e=S.a.createElement(R,{locale:F,last:!0,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ae,page:Ae,active:!1,showTitle:K,itemRender:se}),Ve=S.a.createElement(R,{locale:F,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:se});var je=Math.max(1,Te-ze),Ye=Math.min(Te+ze,Ae);Te-1<=ze&&(Ye=1+ze*2),Ae-Te<=ze&&(je=Ae-ze*2);for(var De=je;De<=Ye;De+=1){var Ke=Te===De;Me.push(S.a.createElement(R,{locale:F,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:De,page:De,active:Ke,showTitle:K,itemRender:se}))}Te-1>=ze*2&&Te!==1+2&&(Me[0]=Object(I.cloneElement)(Me[0],{className:"".concat(g,"-item-after-jump-prev")}),Me.unshift(Se)),Ae-Te>=ze*2&&Te!==Ae-2&&(Me[Me.length-1]=Object(I.cloneElement)(Me[Me.length-1],{className:"".concat(g,"-item-before-jump-next")}),Me.push(Le)),je!==1&&Me.unshift(Ve),Ye!==Ae&&Me.push($e)}var ce=null;J&&(ce=S.a.createElement("li",{className:"".concat(g,"-total-text")},J(M,[M===0?0:(Te-1)*Ie+1,Te*Ie>M?M:Te*Ie])));var re=!this.hasPrev()||!Ae,ie=!this.hasNext()||!Ae;return S.a.createElement("ul",Object(he.a)({className:E()(g,h,Object(B.a)({},"".concat(g,"-disabled"),e)),style:d,unselectable:"unselectable",ref:this.savePaginationNode},nt),ce,S.a.createElement("li",{title:K?F.prev_page:null,onClick:this.prev,tabIndex:re?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(g,"-prev"),Object(B.a)({},"".concat(g,"-disabled"),re)),"aria-disabled":re},this.renderPrev(ot)),Me,S.a.createElement("li",{title:K?F.next_page:null,onClick:this.next,tabIndex:ie?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(g,"-next"),Object(B.a)({},"".concat(g,"-disabled"),ie)),"aria-disabled":ie},this.renderNext(Re)),S.a.createElement(b,{disabled:e,locale:F,rootPrefixCls:g,selectComponentClass:te,selectPrefixCls:ve,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Te,pageSize:Ie,pageSizeOptions:q,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Be}))}}],[{key:"getDerivedStateFromProps",value:function(t,a){var g={};if("current"in t&&(g.current=t.current,t.current!==a.current&&(g.currentInputValue=g.current)),"pageSize"in t&&t.pageSize!==a.pageSize){var h=a.current,d=y(t.pageSize,a,t);h=h>d?d:h,"current"in t||(g.current=h,g.currentInputValue=h),g.pageSize=t.pageSize}return g}}]),i}(S.a.Component);c.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:m.a,style:{},itemRender:l,totalBoundaryShowSizeChanger:50};var o=c},"6RRn":function(Ct,Fe,j){"use strict";var he=j("wCXF"),B=j("n6Qo");j.d(Fe,"b",function(){return B.a});var w=j("IBYe"),U=j("6eGT"),_=j("hW8S");j.d(Fe,"a",function(){return _.a}),Fe.c=he.b},"6eGT":function(Ct,Fe,j){"use strict";function he(B){return null}Fe.a=he},"815F":function(Ct,Fe,j){"use strict";j.d(Fe,"e",function(){return N}),j.d(Fe,"c",function(){return S}),j.d(Fe,"d",function(){return P}),j.d(Fe,"a",function(){return O}),j.d(Fe,"f",function(){return R}),j.d(Fe,"b",function(){return T});var he=j("KQm4"),B=j("VTBJ"),w=j("Ff2n"),U=j("Zm9Q"),_=j("Kwbf"),x=j("OZM5");function N(C,b){return C!=null?C:b}function I(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],b=new Map;function m(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(l){var y=l.key,c=l.children;Object(_.a)(y!=null,"Tree node must have a certain key: [".concat(s).concat(y,"]"));var o=String(y);Object(_.a)(!b.has(o)||y===null||y===void 0,"Same 'key' exist in the Tree: ".concat(o)),b.set(o,!0),m(c,"".concat(s).concat(o," > "))})}m(C)}function S(C){function b(m){var n=Object(U.a)(m);return n.map(function(s){if(!Object(x.i)(s))return Object(_.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var l=s.key,y=s.props,c=y.children,o=Object(w.a)(y,["children"]),v=Object(B.a)({key:l},o),f=b(c);return f.length&&(v.children=f),v}).filter(function(s){return s})}return b(C)}function P(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=new Set(b===!0?[]:b),n=[];function s(l){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return l.map(function(c,o){var v=Object(x.h)(y?y.pos:"0",o),f=N(c.key,v),i=Object(B.a)(Object(B.a)({},c),{},{parent:y,pos:v,children:null,data:c,isStart:[].concat(Object(he.a)(y?y.isStart:[]),[o===0]),isEnd:[].concat(Object(he.a)(y?y.isEnd:[]),[o===l.length-1])});return n.push(i),b===!0||m.has(f)?i.children=s(c.children||[],i):i.children=[],i})}return s(C),n}function E(C,b,m){var n;m?typeof m=="string"?n=function(y){return y[m]}:typeof m=="function"&&(n=function(y){return m(y)}):n=function(y,c){return N(y.key,c)};function s(l,y,c){var o=l?l.children:C,v=l?Object(x.h)(c.pos,y):"0";if(l){var f=n(l,v),i={node:l,index:y,pos:v,key:f,parentPos:c.node?c.pos:null,level:c.level+1};b(i)}o&&o.forEach(function(r,t){s(r,t,{node:l,pos:v,level:c?c.level+1:-1})})}s(null)}function O(C){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=b.initWrapper,n=b.processEntity,s=b.onProcessFinished,l=arguments.length>2?arguments[2]:void 0,y={},c={},o={posEntities:y,keyEntities:c};return m&&(o=m(o)||o),E(C,function(v){var f=v.node,i=v.index,r=v.pos,t=v.key,a=v.parentPos,g=v.level,h={node:f,index:i,key:t,pos:r,level:g},d=N(t,r);y[r]=h,c[d]=h,h.parent=y[a],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),n&&n(h,o)},l),s&&s(o),o}function R(C,b){var m=b.expandedKeys,n=b.selectedKeys,s=b.loadedKeys,l=b.loadingKeys,y=b.checkedKeys,c=b.halfCheckedKeys,o=b.dragOverNodeKey,v=b.dropPosition,f=b.keyEntities,i=f[C],r={eventKey:C,expanded:m.indexOf(C)!==-1,selected:n.indexOf(C)!==-1,loaded:s.indexOf(C)!==-1,loading:l.indexOf(C)!==-1,checked:y.indexOf(C)!==-1,halfChecked:c.indexOf(C)!==-1,pos:String(i?i.pos:""),dragOver:o===C&&v===0,dragOverGapTop:o===C&&v===-1,dragOverGapBottom:o===C&&v===1};return r}function T(C){var b=C.data,m=C.expanded,n=C.selected,s=C.checked,l=C.loaded,y=C.loading,c=C.halfChecked,o=C.dragOver,v=C.dragOverGapTop,f=C.dragOverGapBottom,i=C.pos,r=C.active,t=Object(B.a)(Object(B.a)({},b),{},{expanded:m,selected:n,checked:s,loaded:l,loading:y,halfChecked:c,dragOver:o,dragOverGapTop:v,dragOverGapBottom:f,pos:i,active:r});return"props"in t||Object.defineProperty(t,"props",{get:function(){return Object(_.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),C}}),t}},"8hTe":function(Ct,Fe,j){Ct.exports={button:"button___1wy9m"}},"9Bee":function(Ct,Fe,j){"use strict";var he=j("DYRE"),B=j("zeV3"),w=j("+L6B"),U=j("2/Rp"),_=j("k1fw"),x=j("9og8"),N=j("tJVT"),I=j("WmNS"),S=j.n(I),P=j("q1tI"),E=j.n(P),O=j("vg9a"),R=j("DlQD"),T=j.n(R),C=j("rUJ1");function b(L,u){var p=L.match(/^(\s+)(?:```)/);if(p===null)return u;var D=p[1];return u.split(`
`).map(function(H){var k=H.match(/^\s+/);if(k===null)return H;var ge=Object(N.a)(k,1),qe=ge[0];return qe.length>=D.length?H.slice(D.length):H}).join(`
`)}var m=[],n=["<ul>"],s=new T.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function y(){m.length=0,n=["<ul>"]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function o(L,u,p,D){if(u>=L.length||L[u].level<=p)return u;var H=L[u];D.push("<li><a href='#"+H.anchor+"'>"+H.text+"</a>"),u++;var k=[];return u=o(L,u,H.level,k),k.length>0&&(D.push("<ul>"),k.forEach(function(ge){D.push(ge)}),D.push("</ul>")),D.push("</li>"),u=o(L,u,p,D),u}function v(){return o(m,0,0,n),n.push("</ul>"),n.join("")}var f={heading:function(u){var p=l.exec(u);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(u){var p=this.rules.block.fences.exec(u);if(p){var D=p[0],H=b(D,p[3]||""),k=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(k)>=0){var ge=t(),qe=H;H=ge,a[ge]={type:"block",expression:qe}}return{type:"code",raw:D,lang:k,text:H}}}},i=/(?:\${2})([^\n`]+?)(?:\${2})/gi,r=0,t=function(){return"__special_katext_id_".concat(r++,"__")},a={};function g(){return a}function h(){r=0,a={}}function d(L){return L=L.replace(i,function(u,p){var D=t();return a[D]={type:"inline",expression:p},D}),L}var e=s.listitem;s.listitem=function(L){return e(d(L))};var A=s.paragraph;s.paragraph=function(L){return A(d(L))};var M=s.tablecell;s.tablecell=function(L,u){return M(d(L),u)},s.code=function(L,u,p){var D=(u||"").match(/\S*/)[0];return D?["latex","katex","math"].indexOf(D)>=0?"<p class='editormd-tex'>".concat(L,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(u,'">').concat(p?L:Object(C.escape)(L,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(p?L:Object(C.escape)(L,!0))+"</code></pre>"},s.heading=function(L,u,p){var D=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:D,level:u,text:L}),"<h"+u+' id="'+D+'">'+L+"</h"+u+">"},T.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),T.a.use({tokenizer:f,renderer:s});var F=T.a,W=j("SJMd"),Z=j("ulZh"),K=j.n(Z),J=j("m3rI"),oe=j("Oy/b"),se=j("p5ED"),pe=j("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var be=function(L,u){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,D){p.__proto__=D}||function(p,D){for(var H in D)Object.prototype.hasOwnProperty.call(D,H)&&(p[H]=D[H])})(L,u)};function Q(L,u){function p(){this.constructor=L}be(L,u),L.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}function te(L,u,p,D){return new(p||(p=Promise))(function(H,k){function ge(Kt){try{st(D.next(Kt))}catch(tt){k(tt)}}function qe(Kt){try{st(D.throw(Kt))}catch(tt){k(tt)}}function st(Kt){var tt;Kt.done?H(Kt.value):(tt=Kt.value,tt instanceof p?tt:new p(function(nn){nn(tt)})).then(ge,qe)}st((D=D.apply(L,u||[])).next())})}function ve(L,u){var p,D,H,k,ge={label:0,sent:function(){if(1&H[0])throw H[1];return H[1]},trys:[],ops:[]};return k={next:qe(0),throw:qe(1),return:qe(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function qe(st){return function(Kt){return function(tt){if(p)throw new TypeError("Generator is already executing.");for(;ge;)try{if(p=1,D&&(H=2&tt[0]?D.return:tt[0]?D.throw||((H=D.return)&&H.call(D),0):D.next)&&!(H=H.call(D,tt[1])).done)return H;switch(D=0,H&&(tt=[2&tt[0],H.value]),tt[0]){case 0:case 1:H=tt;break;case 4:return ge.label++,{value:tt[1],done:!1};case 5:ge.label++,D=tt[1],tt=[0];continue;case 7:tt=ge.ops.pop(),ge.trys.pop();continue;default:if(!(H=ge.trys,(H=H.length>0&&H[H.length-1])||tt[0]!==6&&tt[0]!==2)){ge=0;continue}if(tt[0]===3&&(!H||tt[1]>H[0]&&tt[1]<H[3])){ge.label=tt[1];break}if(tt[0]===6&&ge.label<H[1]){ge.label=H[1],H=tt;break}if(H&&ge.label<H[2]){ge.label=H[2],ge.ops.push(tt);break}H[2]&&ge.ops.pop(),ge.trys.pop();continue}tt=u.call(L,ge)}catch(nn){tt=[6,nn],D=0}finally{p=H=0}if(5&tt[0])throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}([st,Kt])}}}function q(){for(var L=0,u=0,p=arguments.length;u<p;u++)L+=arguments[u].length;var D=Array(L),H=0;for(u=0;u<p;u++)for(var k=arguments[u],ge=0,qe=k.length;ge<qe;ge++,H++)D[H]=k[ge];return D}var X=function(){function L(){}return L.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},L.setAttributes=function(u,p){for(var D=0,H=p;D<H.length;D++){var k=H[D],ge=k[0],qe=k[1];u.setAttribute(ge,qe)}},L.createRect=function(u,p,D){var H=document.createElementNS("http://www.w3.org/2000/svg","rect");return H.setAttribute("width",u.toString()),H.setAttribute("height",p.toString()),D&&L.setAttributes(H,D),H},L.createLine=function(u,p,D,H,k){var ge=document.createElementNS("http://www.w3.org/2000/svg","line");return ge.setAttribute("x1",u.toString()),ge.setAttribute("y1",p.toString()),ge.setAttribute("x2",D.toString()),ge.setAttribute("y2",H.toString()),k&&L.setAttributes(ge,k),ge},L.createPolygon=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","polygon");return D.setAttribute("points",u),p&&L.setAttributes(D,p),D},L.createCircle=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","circle");return D.setAttribute("cx",(u/2).toString()),D.setAttribute("cy",(u/2).toString()),D.setAttribute("r",u.toString()),p&&L.setAttributes(D,p),D},L.createEllipse=function(u,p,D){var H=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return H.setAttribute("cx",(u/2).toString()),H.setAttribute("cy",(p/2).toString()),H.setAttribute("rx",(u/2).toString()),H.setAttribute("ry",(p/2).toString()),D&&L.setAttributes(H,D),H},L.createGroup=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return u&&L.setAttributes(p,u),p},L.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},L.createMarker=function(u,p,D,H,k,ge,qe){var st=document.createElementNS("http://www.w3.org/2000/svg","marker");return L.setAttributes(st,[["id",u],["orient",p],["markerWidth",D.toString()],["markerHeight",H.toString()],["refX",k.toString()],["refY",ge.toString()]]),st.appendChild(qe),st},L.createText=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),u&&L.setAttributes(p,u),p},L.createTSpan=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","tspan");return D.textContent=u,p&&L.setAttributes(D,p),D},L.createImage=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return u&&L.setAttributes(p,u),p},L.createPoint=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return D.x=u,D.y=p,D},L.createPath=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","path");return D.setAttribute("d",u),p&&L.setAttributes(D,p),D},L}(),Te=function(){function L(){}return L.addKey=function(u){L.key=u},Object.defineProperty(L,"isLicensed",{get:function(){return!!L.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(L.key)},enumerable:!1,configurable:!0}),L}(),Ie=function(){function L(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return L.prototype.rasterize=function(u,p,D){var H=this;return new Promise(function(k){var ge=D!==void 0?D:document.createElement("canvas");u===null&&(H.markersOnly=!0,H.naturalSize=!1);var qe=document.createElementNS("http://www.w3.org/2000/svg","svg");qe.setAttribute("xmlns","http://www.w3.org/2000/svg"),qe.setAttribute("width",p.width.baseVal.valueAsString),qe.setAttribute("height",p.height.baseVal.valueAsString),qe.setAttribute("viewBox","0 0 "+p.viewBox.baseVal.width.toString()+" "+p.viewBox.baseVal.height.toString()),qe.innerHTML=p.innerHTML,H.naturalSize===!0?(qe.width.baseVal.value=u.naturalWidth,qe.height.baseVal.value=u.naturalHeight):H.width!==void 0&&H.height!==void 0&&(qe.width.baseVal.value=H.width,qe.height.baseVal.value=H.height),ge.width=qe.width.baseVal.value,ge.height=qe.height.baseVal.value;var st=qe.outerHTML,Kt=ge.getContext("2d");H.markersOnly!==!0&&Kt.drawImage(u,0,0,ge.width,ge.height);var tt=window.URL,nn=new Image(ge.width,ge.height);nn.setAttribute("crossOrigin","anonymous");var Yt=new Blob([st],{type:"image/svg+xml"}),kn=tt.createObjectURL(Yt);nn.onload=function(){Kt.drawImage(nn,0,0),tt.revokeObjectURL(kn);var Pr=ge.toDataURL(H.imageType,H.imageQuality);k(Pr)},nn.src=kn})},L}(),Ge=function(){},Ae=function(){function L(u){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+u+"_"}return Object.defineProperty(L.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),L.prototype.addClass=function(u){return this.styleSheet===void 0&&this.addStyleSheet(),u.name=""+this.classNamePrefix+u.localName,this.classes.push(u),this.styleSheet.sheet.insertRule("."+u.name+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length),u},L.prototype.addRule=function(u){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(u),this.styleSheet.sheet.insertRule(u.selector+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length)},L.prototype.addStyleSheet=function(){var u;this.styleSheet=document.createElement("style"),((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).appendChild(this.styleSheet),this.addRule(new Me("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Me("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Me("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Se("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Se("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},L.prototype.removeStyleSheet=function(){var u;this.styleSheet&&(((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},L}(),Me=function(L,u){this.selector=L,this.style=u},Se=function(L,u){this.localName=L,this.style=u},Le=function(){function L(u,p,D,H,k){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=u,this.displayMode=p,this.markerItems=D,this.uiStyleSettings=H,this.styles=k,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return L.prototype.show=function(u){var p=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var D=document.createElement("div");D.className=this.toolbarBlockStyleClass.name,D.style.whiteSpace="nowrap",this.uiContainer.appendChild(D),this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(k){var ge=document.createElement("div");ge.className=""+p.toolbarButtonStyleClass.name,ge.setAttribute("data-type-name",k.typeName),ge.innerHTML=k.icon,ge.addEventListener("click",function(){p.markerToolbarButtonClicked(ge,k)}),p.buttons.push(ge),p.markerButtons.push(ge)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",H.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(H),this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},L.prototype.addButtonClickListener=function(u){this.buttonClickListeners.push(u)},L.prototype.removeButtonClickListener=function(u){this.buttonClickListeners.indexOf(u)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(u),1)},L.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},L.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var u=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var p=0;p<this.markerButtons.length;p++)p<u||p===u&&this.markerButtons.length-1===u?this.markerButtonBlock.appendChild(this.markerButtons[p]):(p===u&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[p]))}},L.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},L.prototype.resetButtonStyles=function(){var u=this;this.buttons.forEach(function(p){p.className=p.className.replace(u.uiStyleSettings.toolbarButtonStyleColorsClassName?u.uiStyleSettings.toolbarButtonStyleColorsClassName:u.toolbarButtonStyleColorsClass.name,"").trim(),p.className=p.className.replace(u.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?u.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:u.toolbarActiveButtonStyleColorsClass.name,"").trim(),p.className+=" "+(u.uiStyleSettings.toolbarButtonStyleColorsClassName?u.uiStyleSettings.toolbarButtonStyleColorsClassName:u.toolbarButtonStyleColorsClass.name)})},L.prototype.addActionButton=function(u,p,D){var H=this,k=document.createElement("div");switch(k.className=""+this.toolbarButtonStyleClass.name,k.innerHTML=p,k.setAttribute("data-action",D),k.addEventListener("click",function(){H.actionToolbarButtonClicked(k,D)}),D){case"select":k.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":k.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":k.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":k.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":k.style.fill=this.uiStyleSettings.closeButtonColor}u.appendChild(k),this.buttons.push(k)},L.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Se("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Se("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Se("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Se("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Se("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var u=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Se("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*u)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*u)+`px;
padding: `+u+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Se("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Me("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Me("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},L.prototype.markerToolbarButtonClicked=function(u,p){this.setActiveButton(u),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(D){return D("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},L.prototype.actionToolbarButtonClicked=function(u,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(D){return D("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},L.prototype.setActiveButton=function(u){this.resetButtonStyles(),u.className=u.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),u.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},L.prototype.setActiveMarkerButton=function(u){var p=this.markerButtons.find(function(D){return D.getAttribute("data-type-name")===u});p&&this.setActiveButton(p)},L.prototype.setCurrentMarker=function(u){var p=this;this.currentMarker=u,this.buttons.filter(function(D){return/delete|notes/.test(D.getAttribute("data-action"))}).forEach(function(D){p.currentMarker===void 0?(D.style.fillOpacity="0.4",D.style.pointerEvents="none"):(D.style.fillOpacity="1",D.style.pointerEvents="all")})},L}(),Ve=function(){function L(u,p,D,H){this.panels=[],this.panelButtons=[],this.markerjsContainer=u,this.displayMode=p,this.uiStyleSettings=D,this.styles=H,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return L.prototype.addStyles=function(){var u;this.toolboxStyleClass=this.styles.addClass(new Se("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Se("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Se("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Se("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Se("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Se("toolbox-panel-row_colors",`
background-color: `+((u=this.uiStyleSettings.toolboxBackgroundColor)!==null&&u!==void 0?u:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Se("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
padding: `+p+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Me("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Me("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},L.prototype.show=function(u){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},L.prototype.setPanelButtons=function(u){var p,D,H=this;this.panels=u,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(k){var ge;k.uiStyleSettings=H.uiStyleSettings;var qe=document.createElement("div");qe.className=H.toolboxButtonStyleClass.name+" "+((ge=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ge!==void 0?ge:H.toolboxButtonStyleColorsClass.name),qe.innerHTML=k.icon,qe.title=k.title,qe.addEventListener("click",function(){H.panelButtonClick(k)}),H.panelButtons.push(qe),H.buttonRow.appendChild(qe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},L.prototype.panelButtonClick=function(u){var p=this,D=-1;if(u!==this.activePanel){D=this.panels.indexOf(u),this.panelRow.innerHTML="";var H=u.getUi();H.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(H),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=u}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(k,ge){var qe,st;k.className=p.toolboxButtonStyleClass.name+" "+(ge===D?""+((qe=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&qe!==void 0?qe:p.toolboxActiveButtonStyleColorsClass.name):""+((st=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&st!==void 0?st:p.toolboxButtonStyleColorsClass.name))})},L}(),$e=function(L,u){this.title=L,this.icon=u},Qe=function(L){function u(p,D,H,k){var ge=L.call(this,p,k||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ge.colors=[],ge.addTransparent=!1,ge.colorBoxes=[],ge.colors=D,ge.currentColor=H,ge.setCurrentColor=ge.setCurrentColor.bind(ge),ge.getColorBox=ge.getColorBox.bind(ge),ge}return Q(u,L),u.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.whiteSpace="nowrap",this.colors.forEach(function(H){var k=p.getColorBox(H);D.appendChild(k),p.colorBoxes.push(k)}),D},u.prototype.getColorBox=function(p){var D=this,H=this.uiStyleSettings.toolbarHeight/4,k=this.uiStyleSettings.toolbarHeight-H,ge=document.createElement("div");ge.style.display="inline-block",ge.style.boxSizing="content-box",ge.style.width=k-2+"px",ge.style.height=k-2+"px",ge.style.padding="1px",ge.style.marginRight="2px",ge.style.marginBottom="2px",ge.style.borderWidth="2px",ge.style.borderStyle="solid",ge.style.borderRadius=(k+2)/2+"px",ge.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ge.addEventListener("click",function(){D.setCurrentColor(p,ge)});var qe=document.createElement("div");return qe.style.display="inline-block",qe.style.width=k-2+"px",qe.style.height=k-2+"px",qe.style.backgroundColor=p,qe.style.borderRadius=k/2+"px",p==="transparent"&&(qe.style.fill=this.uiStyleSettings.toolboxAccentColor,qe.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ge.appendChild(qe),ge},u.prototype.setCurrentColor=function(p,D){var H=this;this.currentColor=p,this.colorBoxes.forEach(function(k){k.style.borderColor=k===D?H.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},u}($e),Be=function(){function L(u,p,D){this._state="new",this._isSelected=!1,this._container=u,this._overlayContainer=p,this.globalSettings=D,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(L.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(u){return!1},Object.defineProperty(L.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},L.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},L.prototype.pointerDown=function(u,p){},L.prototype.dblClick=function(u,p){},L.prototype.manipulate=function(u){},L.prototype.pointerUp=function(u){this.stateChanged()},L.prototype.dispose=function(){},L.prototype.addMarkerVisualToContainer=function(u){this.container.childNodes.length>0?this.container.insertBefore(u,this.container.childNodes[0]):this.container.appendChild(u)},L.prototype.getState=function(){return{typeName:L.typeName,state:this.state,notes:this.notes}},L.prototype.restoreState=function(u){this._state=u.state,this.notes=u.notes},L.prototype.scale=function(u,p){},L.prototype.colorChanged=function(u){this.onColorChanged&&this.onColorChanged(u),this.stateChanged()},L.prototype.fillColorChanged=function(u){this.onFillColorChanged&&this.onFillColorChanged(u),this.stateChanged()},L.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var u=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),u.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(u)&&this.onStateChanged(this)}},L.typeName="MarkerBase",L}(),ze=function(){function L(){this.findGripByVisual=this.findGripByVisual.bind(this)}return L.prototype.findGripByVisual=function(u){return this.topLeft.ownsTarget(u)?this.topLeft:this.topCenter.ownsTarget(u)?this.topCenter:this.topRight.ownsTarget(u)?this.topRight:this.centerLeft.ownsTarget(u)?this.centerLeft:this.centerRight.ownsTarget(u)?this.centerRight:this.bottomLeft.ownsTarget(u)?this.bottomLeft:this.bottomCenter.ownsTarget(u)?this.bottomCenter:this.bottomRight.ownsTarget(u)?this.bottomRight:void 0},L}(),ot=function(){function L(){this.GRIP_SIZE=10,this.visual=X.createGroup(),this.visual.appendChild(X.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(X.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return L.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},L}(),Re=function(){function L(){}return L.toITransformMatrix=function(u){return{a:u.a,b:u.b,c:u.c,d:u.d,e:u.e,f:u.f}},L.toSVGMatrix=function(u,p){return u.a=p.a,u.b=p.b,u.c=p.c,u.d=p.d,u.e=p.e,u.f=p.f,u},L}(),nt=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.left=0,k.top=0,k.width=0,k.height=0,k.defaultSize={x:50,y:20},k.offsetX=0,k.offsetY=0,k.rotationAngle=0,k.CB_DISTANCE=10,k._suppressMarkerCreateEvent=!1,k.container.transform.baseVal.appendItem(X.createTransform()),k.setupControlBox(),k}return Q(u,L),Object.defineProperty(u.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"visual",{get:function(){return this._visual},set:function(p){this._visual=p;var D=X.createTransform();this._visual.transform.baseVal.appendItem(D)},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(p){return!!L.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var H=this.unrotatePoint(p);if(this.manipulationStartX=H.x,this.manipulationStartY=H.y,this.offsetX=H.x-this.left,this.offsetY=H.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(D),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D)){this.activeGrip=this.rotatorGrip;var k=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=k.x-this.width/2,this.top=k.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ge=this.container.transform.baseVal.getItem(0);ge.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ge,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},u.prototype.pointerUp=function(p){var D=this.state;L.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",D==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},u.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},u.prototype.manipulate=function(p){var D=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(D.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(D.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(D):this.state==="rotate"&&this.rotate(p)},u.prototype.resize=function(p){var D=this.manipulationStartLeft,H=this.manipulationStartWidth,k=this.manipulationStartTop,ge=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:D=this.manipulationStartLeft+p.x-this.manipulationStartX,H=this.manipulationStartWidth+this.manipulationStartLeft-D;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:H=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:k=this.manipulationStartTop+p.y-this.manipulationStartY,ge=this.manipulationStartHeight+this.manipulationStartTop-k;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ge=this.manipulationStartHeight+p.y-this.manipulationStartY}H>=0?(this.left=D,this.width=H):(this.left=D+H,this.width=-H),ge>=0?(this.top=k,this.height=ge):(this.top=k+ge,this.height=-ge),this.setSize()},u.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},u.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var D=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*D,this.applyRotation()}},u.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},u.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var D=this.container.getCTM(),H=X.createPoint(p.x,p.y);return{x:(H=H.matrixTransform(D)).x,y:H.y}},u.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var D=this.container.getCTM();D=D.inverse();var H=X.createPoint(p.x,p.y);return{x:(H=H.matrixTransform(D)).x,y:H.y}},u.prototype.select=function(){L.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){L.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=X.createGroup();var p=X.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=X.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=X.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new ze,this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},u.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},u.prototype.createGrip=function(){var p=new ot;return p.visual.transform.baseVal.appendItem(X.createTransform()),this.controlBox.appendChild(p.visual),p},u.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,D=-p/2,H=D,k=(this.width+this.CB_DISTANCE)/2-p/2,ge=(this.height+this.CB_DISTANCE)/2-p/2,qe=this.height+this.CB_DISTANCE-p/2,st=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,D,H),this.positionGrip(this.controlGrips.topCenter.visual,k,H),this.positionGrip(this.controlGrips.topRight.visual,st,H),this.positionGrip(this.controlGrips.centerLeft.visual,D,ge),this.positionGrip(this.controlGrips.centerRight.visual,st,ge),this.positionGrip(this.controlGrips.bottomLeft.visual,D,qe),this.positionGrip(this.controlGrips.bottomCenter.visual,k,qe),this.positionGrip(this.controlGrips.bottomRight.visual,st,qe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,k,H-3*this.CB_DISTANCE)},u.prototype.positionGrip=function(p,D,H){var k=p.transform.baseVal.getItem(0);k.setTranslate(D,H),p.transform.baseVal.replaceItem(k,0)},u.prototype.hideControlBox=function(){this.controlBox.style.display="none"},u.prototype.showControlBox=function(){this.controlBox.style.display=""},u.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Re.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Re.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},L.prototype.getState.call(this))},u.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.left=D.left,this.top=D.top,this.width=D.width,this.height=D.height,this.rotationAngle=D.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Re.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,D.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Re.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,D.containerTransformMatrix))},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D);var H=this.rotatePoint({x:this.left,y:this.top}),k=this.unrotatePoint({x:H.x*p,y:H.y*D});this.left=k.x,this.top=k.y,this.width=this.width*p,this.height=this.height*D,this.adjustControlBox()},u}(Be),rt=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.fillColor="transparent",k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.opacity=1,k.setStrokeColor=k.setStrokeColor.bind(k),k.setFillColor=k.setFillColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.createVisual=k.createVisual.bind(k),k}return Q(u,L),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual)},u.prototype.createVisual=function(){this.visual=X.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.manipulate=function(p){L.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){L.prototype.resize.call(this,p),this.setSize()},u.prototype.setSize=function(){L.prototype.setSize.call(this),X.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(p){L.prototype.pointerUp.call(this,p),this.setSize()},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&X.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},u.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&X.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&X.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&X.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},L.prototype.getState.call(this))},u.prototype.restoreState=function(p){var D=p;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),L.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setSize()},u.title="Rectangle marker",u}(nt),lt=function(L){function u(p,D,H,k){var ge=L.call(this,p,k||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ge.widths=[],ge.widthBoxes=[],ge.widths=D,ge.currentWidth=H,ge.setCurrentWidth=ge.setCurrentWidth.bind(ge),ge}return Q(u,L),u.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.widths.forEach(function(H){var k=document.createElement("div");k.style.display="flex",k.style.flexGrow="2",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.borderColor=H===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){p.setCurrentWidth(H,k)}),D.appendChild(k);var ge=document.createElement("div");ge.innerText=H.toString(),ge.style.marginRight="5px",k.appendChild(ge);var qe=document.createElement("div");qe.style.minHeight="20px",qe.style.flexGrow="2",qe.style.display="flex",qe.style.alignItems="center";var st=document.createElement("hr");st.style.minWidth="20px",st.style.border="0px",st.style.borderTop=H+"px solid "+p.uiStyleSettings.toolboxColor,st.style.flexGrow="2",qe.appendChild(st),k.appendChild(qe),p.widthBoxes.push(k)}),D},u.prototype.setCurrentWidth=function(p,D){var H=this;this.currentWidth=p,this.widthBoxes.forEach(function(k){k.style.borderColor=k===D?H.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},u}($e),bt=function(L){function u(p,D,H,k){var ge=L.call(this,p,k||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ge.styles=[],ge.styleBoxes=[],ge.styles=D,ge.currentStyle=H,ge.setCurrentStyle=ge.setCurrentStyle.bind(ge),ge}return Q(u,L),u.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.styles.forEach(function(H){var k=document.createElement("div");k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.overflow="hidden",k.style.maxWidth=100/p.styles.length-5+"%",k.style.borderColor=H===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){p.setCurrentStyle(H,k)}),D.appendChild(k);var ge=document.createElement("div");ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.overflow="hidden";var qe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+p.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(H!==""?'stroke-dasharray="'+H+'"':"")+` />
</svg>`;ge.innerHTML=qe,k.appendChild(ge),p.styleBoxes.push(k)}),D},u.prototype.setCurrentStyle=function(p,D){var H=this;this.currentStyle=p,this.styleBoxes.forEach(function(k){k.style.borderColor=k===D?H.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},u}($e),Ee=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.strokeColor=H.defaultColor,k.strokeWidth=H.defaultStrokeWidth,k.strokeDasharray=H.defaultStrokeDasharray,k.strokePanel=new Qe("Line color",H.defaultColorSet,H.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new lt("Line width",H.defaultStrokeWidths,H.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new bt("Line style",H.defaultStrokeDasharrays,H.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return Q(u,L),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="FrameMarker",u.title="Frame marker",u.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',u}(rt),Oe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},je=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.x1=0,k.y1=0,k.x2=0,k.y2=0,k.defaultLength=50,k.manipulationStartX=0,k.manipulationStartY=0,k.manipulationStartX1=0,k.manipulationStartY1=0,k.manipulationStartX2=0,k.manipulationStartY2=0,k.setupControlBox(),k}return Q(u,L),u.prototype.ownsTarget=function(p){return!!L.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(D)?this.activeGrip=this.grip1:this.grip2.ownsTarget(D)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},u.prototype.pointerUp=function(p){var D=this.state;L.prototype.pointerUp.call(this,p),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(p),this._state="select",D==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},u.prototype.adjustVisual=function(){},u.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},u.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},u.prototype.select=function(){L.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){L.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=X.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){this.positionGrips()},u.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},u.prototype.createGrip=function(){var p=new ot;return p.visual.transform.baseVal.appendItem(X.createTransform()),this.controlBox.appendChild(p.visual),p},u.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},u.prototype.positionGrip=function(p,D,H){var k=p.transform.baseVal.getItem(0);k.setTranslate(D,H),p.transform.baseVal.replaceItem(k,0)},u.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},L.prototype.getState.call(this))},u.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.x1=D.x1,this.y1=D.y1,this.x2=D.x2,this.y2=D.y2},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.x1=this.x1*p,this.y1=this.y1*D,this.x2=this.x2*p,this.y2=this.y2*D,this.adjustVisual(),this.adjustControlBox()},u}(Be),Ye=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.setStrokeColor=k.setStrokeColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.strokeColor=H.defaultColor,k.strokeWidth=H.defaultStrokeWidth,k.strokeDasharray=H.defaultStrokeDasharray,k.strokePanel=new Qe("Line color",H.defaultColorSet,H.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new lt("Line width",H.defaultStrokeWidths,H.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new bt("Line style",H.defaultStrokeDasharrays,H.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return Q(u,L),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},u.prototype.createVisual=function(){this.visual=X.createGroup(),this.selectorLine=X.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=X.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},u.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),X.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),X.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),X.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.createVisual(),this.adjustVisual()},u.typeName="LineMarker",u.title="Line marker",u.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',u}(je),De=function(L){function u(p,D,H,k){var ge=L.call(this,p,k||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ge.fonts=[],ge.fontBoxes=[],ge.fonts=D,ge.currentFont=H,ge.setCurrentFont=ge.setCurrentFont.bind(ge),ge}return Q(u,L),u.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.flexGrow="2",this.fonts.forEach(function(H){var k=document.createElement("div");k.style.display="inline-block",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.overflow="hidden",k.style.maxWidth=100/p.fonts.length-5+"%",k.style.borderColor=H===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){p.setCurrentFont(H,k)}),D.appendChild(k);var ge=document.createElement("div");ge.style.display="flex",ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.fontFamily=H,ge.style.overflow="hidden";var qe=document.createElement("div");qe.style.whiteSpace="nowrap",qe.style.overflow="hidden",qe.style.textOverflow="ellipsis",qe.innerHTML="The quick brown fox jumps over the lazy dog",ge.appendChild(qe),k.appendChild(ge),p.fontBoxes.push(k)}),D},u.prototype.setCurrentFont=function(p,D){var H=this;this.currentFont=p,this.fontBoxes.forEach(function(k){k.style.borderColor=k===D?H.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},u}($e),Ke=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.color="transparent",k.padding=5,k.DEFAULT_TEXT="your text here",k.text=k.DEFAULT_TEXT,k.isMoved=!1,k.color=H.defaultColor,k.fontFamily=H.defaultFontFamily,k.defaultSize={x:100,y:30},k.setColor=k.setColor.bind(k),k.setFont=k.setFont.bind(k),k.renderText=k.renderText.bind(k),k.sizeText=k.sizeText.bind(k),k.textEditDivClicked=k.textEditDivClicked.bind(k),k.showTextEditor=k.showTextEditor.bind(k),k.setSize=k.setSize.bind(k),k.positionTextEditor=k.positionTextEditor.bind(k),k.colorPanel=new Qe("Color",H.defaultColorSet,H.defaultColor),k.colorPanel.onColorChanged=k.setColor,k.fontFamilyPanel=new De("Font",H.defaultFontFamilies,H.defaultFontFamily),k.fontFamilyPanel.onFontChanged=k.setFont,k}return Q(u,L),u.prototype.ownsTarget=function(p){if(L.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var D=!1;return this.textElement.childNodes.forEach(function(H){H===p&&(D=!0)}),D},u.prototype.createVisual=function(){this.visual=X.createGroup(),this.bgRectangle=X.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=X.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(X.createTransform()),this.textElement.transform.baseVal.appendItem(X.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.renderText=function(){var p=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(D){p.textElement.appendChild(X.createTSpan(D.trim()===""?" ":D.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},u.prototype.getTextScale=function(){var p=this.textElement.getBBox(),D=1;if(p.width>0&&p.height>0){var H=(1*this.width-this.width*this.padding*2/100)/p.width,k=(1*this.height-this.height*this.padding*2/100)/p.height;D=Math.min(H,k)}return D},u.prototype.getTextPosition=function(p){var D=this.textElement.getBBox(),H=0,k=0;return D.width>0&&D.height>0&&(H=(this.width-D.width*p)/2,k=this.height/2-D.height*p/2),{x:H,y:k}},u.prototype.sizeText=function(){var p=this.textElement.getBBox(),D=this.getTextScale(),H=this.getTextPosition(D);H.y-=p.y*D,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+H.x+"px, "+H.y+"px) scale("+D+", "+D+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(H.x,H.y),this.textElement.transform.baseVal.getItem(1).setScale(D,D))},u.prototype.manipulate=function(p){L.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},u.prototype.resize=function(p){L.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},u.prototype.setSize=function(){L.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(X.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),X.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},u.prototype.pointerUp=function(p){var D=this.state;D==="creating"&&(this._suppressMarkerCreateEvent=!0),L.prototype.pointerUp.call(this,p),this.setSize(),(D==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},u.prototype.showTextEditor=function(){var p=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(D){D.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var D=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&D>.9;)D-=.1,p.textEditor.style.fontSize=Math.max(D,.9)+"em"}),this.textEditor.addEventListener("keyup",function(D){D.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(D){if(D.clipboardData){var H=D.clipboardData.getData("text"),k=window.getSelection();if(!k.rangeCount)return!1;k.deleteFromDocument(),k.getRangeAt(0).insertNode(document.createTextNode(H)),D.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},u.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var p=this.getTextScale(),D=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),H=this.textElement.getBBox(),k={x:H.width*p,y:H.height*p};D.x-=k.x/2,D.y-=k.y/2,this.textEditor.style.top=D.y+"px",this.textEditor.style.left=D.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-D.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},u.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},u.prototype.select=function(){L.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},u.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),L.prototype.deselect.call(this)},u.prototype.dblClick=function(p,D){L.prototype.dblClick.call(this,p,D),this.showTextEditor()},u.prototype.setColor=function(p){this.textElement&&X.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},u.prototype.setFont=function(p){this.textElement&&X.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},u.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},u.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var D=p;this.color=D.color,this.fontFamily=D.fontFamily,this.padding=D.padding,this.text=D.text,this.createVisual(),L.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setSize(),this.sizeText(),this.positionTextEditor()},u.typeName="TextMarker",u.title="Text marker",u.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',u}(nt),ce=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.color="transparent",k.lineWidth=3,k.drawing=!1,k.pixelRatio=1,k.color=H.defaultColor,k.lineWidth=H.defaultStrokeWidth,k.pixelRatio=H.freehandPixelRatio,k.setColor=k.setColor.bind(k),k.addCanvas=k.addCanvas.bind(k),k.finishCreation=k.finishCreation.bind(k),k.setLineWidth=k.setLineWidth.bind(k),k.colorPanel=new Qe("Color",H.defaultColorSet,H.defaultColor),k.colorPanel.onColorChanged=k.setColor,k.lineWidthPanel=new lt("Line width",H.defaultStrokeWidths,H.defaultStrokeWidth),k.lineWidthPanel.onWidthChanged=k.setLineWidth,k}return Q(u,L),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},u.prototype.createVisual=function(){this.visual=X.createGroup(),this.drawingImage=X.createImage(),this.visual.appendChild(this.drawingImage);var p=X.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,D){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(p.x,p.y),this.drawing=!0):L.prototype.pointerDown.call(this,p,D)},u.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):L.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){L.prototype.resize.call(this,p),X.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),X.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):L.prototype.pointerUp.call(this,p)},u.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},u.prototype.select=function(){this.state==="creating"&&this.finishCreation(),L.prototype.select.call(this)},u.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),L.prototype.deselect.call(this)},u.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),D=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],H=D[0],k=D[1],ge=D[2],qe=D[3],st=!1,Kt=0;Kt<this.canvasElement.height;Kt++)for(var tt=0;tt<this.canvasElement.width;tt++)p.data[Kt*this.canvasElement.width*4+4*tt+3]>0&&(st=!0,Kt<k&&(k=Kt),tt<H&&(H=tt),Kt>qe&&(qe=Kt),tt>ge&&(ge=tt));if(st){this.left=H/this.pixelRatio,this.top=k/this.pixelRatio,this.width=(ge-H)/this.pixelRatio,this.height=(qe-k)/this.pixelRatio;var nn=document.createElement("canvas");nn.width=ge-H,nn.height=qe-k,nn.getContext("2d").putImageData(this.canvasContext.getImageData(H,k,ge-H,qe-k),0,0),this.drawingImgUrl=nn.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},u.prototype.setDrawingImage=function(){X.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),X.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},u.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},u.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){this.createVisual(),L.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setDrawingImage()},u.typeName="FreehandMarker",u.title="Freehand marker",u.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',u}(nt),re=function(L){function u(p,D,H){var k=L.call(this,p,H||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return k.typeBoxes=[],k.currentType=D,k.setCurrentType=k.setCurrentType.bind(k),k}return Q(u,L),u.prototype.getUi=function(){var p=this,D=document.createElement("div");D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2";for(var H=function(qe){var st="both";switch(qe){case 0:st="both";break;case 1:st="start";break;case 2:st="end";break;case 3:st="none"}var Kt=document.createElement("div");if(Kt.style.display="flex",Kt.style.flexGrow="2",Kt.style.alignItems="center",Kt.style.justifyContent="space-between",Kt.style.padding="5px",Kt.style.borderWidth="2px",Kt.style.borderStyle="solid",Kt.style.borderColor=st===k.currentType?k.uiStyleSettings.toolboxAccentColor:"transparent",Kt.addEventListener("click",function(){p.setCurrentType(st,Kt)}),D.appendChild(Kt),st==="both"||st==="start"){var tt=document.createElement("div");tt.style.display="flex",tt.style.alignItems="center",tt.style.minHeight="20px",tt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,tt.style.marginLeft="5px",Kt.appendChild(tt)}var nn=document.createElement("div");nn.style.display="flex",nn.style.alignItems="center",nn.style.minHeight="20px",nn.style.flexGrow="2";var Yt=document.createElement("hr");if(Yt.style.minWidth="20px",Yt.style.border="0px",Yt.style.borderTop="3px solid "+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee"),Yt.style.flexGrow="2",nn.appendChild(Yt),Kt.appendChild(nn),st==="both"||st==="end"){var kn=document.createElement("div");kn.style.display="flex",kn.style.alignItems="center",kn.style.minHeight="20px",kn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,kn.style.marginRight="5px",Kt.appendChild(kn)}k.typeBoxes.push(Kt)},k=this,ge=0;ge<4;ge++)H(ge);return D},u.prototype.setCurrentType=function(p,D){var H=this;this.currentType=p,this.typeBoxes.forEach(function(k){k.style.borderColor=k===D?H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},u}($e),ie=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.arrowType="end",k.arrowBaseHeight=10,k.arrowBaseWidth=10,k.getArrowPoints=k.getArrowPoints.bind(k),k.setArrowType=k.setArrowType.bind(k),k.arrowTypePanel=new re("Arrow type","end"),k.arrowTypePanel.onArrowTypeChanged=k.setArrowType,k}return Q(u,L),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},u.prototype.getArrowPoints=function(p,D){var H=this.arrowBaseWidth+2*this.strokeWidth,k=this.arrowBaseHeight+2*this.strokeWidth;return p-H/2+","+(D+k/2)+" "+p+","+(D-k/2)+" "+(p+H/2)+","+(D+k/2)},u.prototype.createTips=function(){this.arrow1=X.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(X.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=X.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(X.createTransform()),this.visual.appendChild(this.arrow2)},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(L.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",X.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),X.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.arrow1.transform.baseVal.getItem(0);D.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(D,0);var H=this.arrow2.transform.baseVal.getItem(0);H.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(H,0)}},u.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.arrowType=D.arrowType,this.createTips(),this.adjustVisual()},u.typeName="ArrowMarker",u.title="Arrow marker",u.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',u}(Ye),$=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.fillColor=H.defaultFillColor,k.strokeWidth=0,k.fillPanel=new Qe("Color",H.defaultColorSet,H.defaultFillColor),k.fillPanel.onColorChanged=k.setFillColor,k}return Q(u,L),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="CoverMarker",u.title="Cover marker",u.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',u}(rt),Y=function(L){function u(p,D,H,k){var ge=L.call(this,p,k||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ge.opacities=[],ge.opacityBoxes=[],ge.opacities=D,ge.currentOpacity=H,ge.setCurrentOpacity=ge.setCurrentOpacity.bind(ge),ge}return Q(u,L),u.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",D.style.justifyContent="space-between",this.opacities.forEach(function(H){var k=document.createElement("div");k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="center",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.borderColor=H===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){p.setCurrentOpacity(H,k)}),D.appendChild(k);var ge=document.createElement("div");ge.innerText=100*H+"%",k.appendChild(ge),p.opacityBoxes.push(k)}),D},u.prototype.setCurrentOpacity=function(p,D){var H=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(k){k.style.borderColor=k===D?H.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},u}($e),V=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.setOpacity=k.setOpacity.bind(k),k.fillColor=H.defaultHighlightColor,k.strokeWidth=0,k.opacity=H.defaultHighlightOpacity,k.fillPanel=new Qe("Color",H.defaultColorSet,k.fillColor),k.fillPanel.onColorChanged=k.setFillColor,k.opacityPanel=new Y("Opacity",H.defaultOpacitySteps,k.opacity),k.opacityPanel.onOpacityChanged=k.setOpacity,k}return Q(u,L),u.prototype.setOpacity=function(p){this.opacity=p,this.visual&&X.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="HighlightMarker",u.title="Highlight marker",u.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',u}($),ne='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',_e=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.bgColor="transparent",k.tipPosition={x:0,y:0},k.tipBase1Position={x:0,y:0},k.tipBase2Position={x:0,y:0},k.tipMoving=!1,k.color=H.defaultStrokeColor,k.bgColor=H.defaultFillColor,k.fontFamily=H.defaultFontFamily,k.defaultSize={x:100,y:30},k.setBgColor=k.setBgColor.bind(k),k.getTipPoints=k.getTipPoints.bind(k),k.positionTip=k.positionTip.bind(k),k.setTipPoints=k.setTipPoints.bind(k),k.colorPanel=new Qe("Text color",H.defaultColorSet,k.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),k.colorPanel.onColorChanged=k.setColor,k.bgColorPanel=new Qe("Fill color",H.defaultColorSet,k.bgColor,ne),k.bgColorPanel.onColorChanged=k.setBgColor,k.fontFamilyPanel=new De("Font",H.defaultFontFamilies,H.defaultFontFamily),k.fontFamilyPanel.onFontChanged=k.setFont,k.tipGrip=new ot,k.tipGrip.visual.transform.baseVal.appendItem(X.createTransform()),k.controlBox.appendChild(k.tipGrip.visual),k}return Q(u,L),u.prototype.ownsTarget=function(p){return L.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},u.prototype.createTip=function(){X.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=X.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},u.prototype.pointerDown=function(p,D){this.state==="new"&&L.prototype.pointerDown.call(this,p,D),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(D)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):L.prototype.pointerDown.call(this,p,D)},u.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,L.prototype.pointerUp.call(this,p);else{var D=this.state==="creating";L.prototype.pointerUp.call(this,p),this.setTipPoints(D),this.positionTip()}},u.prototype.manipulate=function(p){if(this.tipMoving){var D=this.unrotatePoint(p);this.tipPosition={x:D.x-this.manipulationStartLeft,y:D.y-this.manipulationStartTop},this.positionTip()}else L.prototype.manipulate.call(this,p)},u.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(X.setAttributes(this.bgRectangle,[["fill",p]]),X.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},u.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},u.prototype.setTipPoints=function(p){p===void 0&&(p=!1);var D=Math.min(this.height/2,15),H=this.height/5;p&&(this.tipPosition={x:D+H/2,y:this.height+20});var k=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?k<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(H=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:D,y:0},this.tipBase2Position={x:D+H,y:0}):(this.tipBase1Position={x:0,y:D},this.tipBase2Position={x:0,y:D+H}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?k<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(H=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-D-H,y:0},this.tipBase2Position={x:this.width-D,y:0}):(this.tipBase1Position={x:this.width,y:D},this.tipBase2Position={x:this.width,y:D+H}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?k<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(H=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-D-H,y:this.height},this.tipBase2Position={x:this.width-D,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-D-H},this.tipBase2Position={x:this.width,y:this.height-D}):k<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(H=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:D,y:this.height},this.tipBase2Position={x:D+H,y:this.height}):(this.tipBase1Position={x:0,y:this.height-D},this.tipBase2Position={x:0,y:this.height-D-H})},u.prototype.resize=function(p){L.prototype.resize.call(this,p),this.positionTip()},u.prototype.positionTip=function(){X.setAttributes(this.tip,[["points",this.getTipPoints()]]);var p=this.tipGrip.visual.transform.baseVal.getItem(0);p.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(p,0)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),u.prototype.select=function(){this.positionTip(),L.prototype.select.call(this)},u.prototype.getState=function(){var p=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var D=p;this.bgColor=D.bgColor,this.tipPosition=D.tipPosition,L.prototype.restoreState.call(this,p),this.createTip(),this.setTipPoints()},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.tipPosition={x:this.tipPosition.x*p,y:this.tipPosition.y*D},this.positionTip()},u.typeName="CalloutMarker",u.title="Callout marker",u.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',u}(Ke),we=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.fillColor="transparent",k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.opacity=1,k.strokeColor=H.defaultColor,k.strokeWidth=H.defaultStrokeWidth,k.strokeDasharray=H.defaultStrokeDasharray,k.fillColor=H.defaultFillColor,k.setStrokeColor=k.setStrokeColor.bind(k),k.setFillColor=k.setFillColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.setOpacity=k.setOpacity.bind(k),k.createVisual=k.createVisual.bind(k),k.strokePanel=new Qe("Line color",q(H.defaultColorSet,["transparent"]),H.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.fillPanel=new Qe("Fill color",q(H.defaultColorSet,["transparent"]),k.fillColor,ne),k.fillPanel.onColorChanged=k.setFillColor,k.strokeWidthPanel=new lt("Line width",H.defaultStrokeWidths,H.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new bt("Line style",H.defaultStrokeDasharrays,H.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k.opacityPanel=new Y("Opacity",H.defaultOpacitySteps,k.opacity),k.opacityPanel.onOpacityChanged=k.setOpacity,k}return Q(u,L),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual)},u.prototype.createVisual=function(){this.visual=X.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.manipulate=function(p){L.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){L.prototype.resize.call(this,p),this.setSize()},u.prototype.setSize=function(){L.prototype.setSize.call(this),X.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},u.prototype.pointerUp=function(p){L.prototype.pointerUp.call(this,p),this.setSize()},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&X.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},u.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&X.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&X.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&X.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.setOpacity=function(p){this.opacity=p,this.visual&&X.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var D=p;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),L.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setSize()},u.typeName="EllipseMarker",u.title="Ellipse marker",u.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',u}(nt),Xe=function(L){function u(p,D,H){return L.call(this,p,D,H)||this}return Q(u,L),Object.defineProperty(u.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},u.prototype.createTips=function(){this.tip1=X.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(X.createTransform()),this.visual.appendChild(this.tip1),this.tip2=X.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(X.createTransform()),this.visual.appendChild(this.tip2)},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(L.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(X.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),X.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.tip1.transform.baseVal.getItem(0);D.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(D,0);var H=this.tip2.transform.baseVal.getItem(0);H.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(H,0)}},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},u.typeName="MeasurementMarker",u.title="Measurement marker",u.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',u}(Ye),gt=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.strokePanel.colors=H.defaultColorSet,k.fillColor="transparent",k}return Q(u,L),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="EllipseFrameMarker",u.title="Ellipse frame marker",u.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',u}(we),Nt=function(){function L(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(L.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),L.prototype.addUndoStep=function(u){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(u)||(this.undoStack.push(u),JSON.stringify(this.lastRedoStep)!==JSON.stringify(u)&&this.redoStack.splice(0,this.redoStack.length))},L.prototype.replaceLastUndoStep=function(u){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=u)},L.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},L.prototype.undo=function(){if(this.undoStack.length>1){var u=this.undoStack.pop();return u!==void 0&&this.redoStack.push(u),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},L.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},L}(),ht=function(L){function u(p,D,H){var k=L.call(this,p,D,H)||this;return k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.curveX=0,k.curveY=0,k.manipulationStartCurveX=0,k.manipulationStartCurveY=0,k.setStrokeColor=k.setStrokeColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.positionGrips=k.positionGrips.bind(k),k.addControlGrips=k.addControlGrips.bind(k),k.adjustVisual=k.adjustVisual.bind(k),k.setupControlBox=k.setupControlBox.bind(k),k.resize=k.resize.bind(k),k.strokeColor=H.defaultColor,k.strokeWidth=H.defaultStrokeWidth,k.strokeDasharray=H.defaultStrokeDasharray,k.strokePanel=new Qe("Line color",H.defaultColorSet,H.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new lt("Line width",H.defaultStrokeWidths,H.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new bt("Line style",H.defaultStrokeDasharrays,H.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return Q(u,L),u.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},u.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},u.prototype.createVisual=function(){this.visual=X.createGroup(),this.selectorCurve=X.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=X.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(D)&&(this.activeGrip=this.curveGrip,this._state="resize")},u.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),X.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),X.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),X.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setupControlBox=function(){L.prototype.setupControlBox.call(this),this.curveControlLine1=X.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=X.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},u.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,L.prototype.addControlGrips.call(this)},u.prototype.positionGrips=function(){L.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},u.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),L.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),L.prototype.resize.call(this,p),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},u.prototype.scale=function(p,D){this.curveX=this.curveX*p,this.curveY=this.curveY*D,L.prototype.scale.call(this,p,D)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},L.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.curveX=D.curveX,this.curveY=D.curveY,this.createVisual(),this.adjustVisual()},u.typeName="CurveMarker",u.title="Curve marker",u.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',u}(je),en=function(){function L(u,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=u,this.cancelable=p}return Object.defineProperty(L.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),L.prototype.preventDefault=function(){this._defaultPrevented=!0},L}(),tn=function(L){function u(p,D,H){var k=L.call(this,p,!1)||this;return k.dataUrl=D,k.state=H,k}return Q(u,L),u}(en),Dt=function(L){function u(p,D,H){H===void 0&&(H=!1);var k=L.call(this,p,H)||this;return k.marker=D,k}return Q(u,L),u}(en),_n=function(){function L(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return L.prototype.addEventListener=function(u,p){this[u].push(p)},L.prototype.removeEventListener=function(u,p){var D=this[u].indexOf(p);D>-1&&this[u].splice(D,1)},L}(),fn=function(){function L(u){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Oe,this._isOpen=!1,this.undoRedoManager=new Nt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new _n,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=L.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=u,this.targetRoot=document.body,this.width=u.clientWidth,this.height=u.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(L.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ee,ce,ie,Ke,gt,we,V,_e,Xe,$,Ye,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ee,ce,ie,Ke,we,V,_e]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ee,ce,ie,Ke,V]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(u){var p=this;this._availableMarkerTypes.splice(0),u.forEach(function(D){if(typeof D=="string"){var H=p.ALL_MARKER_TYPES.find(function(k){return k.typeName===D});H!==void 0&&p._availableMarkerTypes.push(H)}else p._availableMarkerTypes.push(D)})},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(u){this._zoomLevel=u,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),L.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},L.prototype.show=function(){var u=this;this.styles.styleSheetRoot===void 0&&Ge.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ge.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new en(u))})},L.prototype.render=function(){return te(this,void 0,void 0,function(){var u;return ve(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(u=new Ie).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.markersOnly=this.renderMarkersOnly,u.width=this.renderWidth,u.height=this.renderHeight,[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},L.prototype.close=function(u){var p=this;if(u===void 0&&(u=!1),this.isOpen){var D=!1;u||this.eventListeners.beforeclose.forEach(function(H){var k=new en(p,!0);H(k),k.defaultPrevented&&(D=!0)}),D||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(H){return H(new en(p))}),this.detachEvents(),this._isOpen=!1)}},L.prototype.addMarkersToToolbar=function(){for(var u,p=[],D=0;D<arguments.length;D++)p[D]=arguments[D];(u=this._availableMarkerTypes).push.apply(u,p)},L.prototype.addRenderEventListener=function(u){this.addEventListener("render",function(p){u(p.dataUrl,p.state)})},L.prototype.removeRenderEventListener=function(u){},L.prototype.addCloseEventListener=function(u){this.addEventListener("close",function(){u()})},L.prototype.removeCloseEventListener=function(u){},L.prototype.setupResizeObserver=function(){var u=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){u.resize(u.target.clientWidth,u.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return u.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},L.prototype.onPopupTargetResize=function(){var u=1*this.target.clientWidth/this.target.clientHeight,p=this.editorCanvas.clientWidth/u>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*u:this.editorCanvas.clientWidth,D=p<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/u;this.resize(p,D)},L.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},L.prototype.resize=function(u,p){this._isResizing=!0;var D=u/this.imageWidth,H=p/this.imageHeight;this.imageWidth=Math.round(u),this.imageHeight=Math.round(p),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(D,H),this._isResizing=!1},L.prototype.scaleMarkers=function(u,p){var D,H=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(u,p):(D=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(k){k!==H._currentMarker&&k.scale(u,p)}),D!==void 0&&this.setCurrentMarker(D)},L.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},L.prototype.setTopLeft=function(){var u=this.editingTarget.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=u.left-p.left,this.top=u.top-p.top},L.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},L.prototype.addDefs=function(){for(var u,p=[],D=0;D<arguments.length;D++)p[D]=arguments[D];this.defs=X.createDefs(),this.addDefsToImage(),(u=this.defs).append.apply(u,p)},L.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},L.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},L.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},L.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},L.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},L.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},L.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},L.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var u=document.createElement("a");u.href="https://markerjs.com/",u.target="_blank",u.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',u.title="Powered by marker.js",u.style.display="grid",u.style.alignItems="center",u.style.justifyItems="center",u.style.padding="3px",u.style.width="20px",u.style.height="20px",this.logoUI.appendChild(u),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},L.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},L.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},L.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},L.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Le(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ve(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},L.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},L.prototype.removeMarker=function(u){this.markerImage.removeChild(u.container),this.markers.indexOf(u)>-1&&this.markers.splice(this.markers.indexOf(u),1),u.dispose()},L.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},L.prototype.toolbarButtonClicked=function(u,p){if(u==="marker"&&p!==void 0)this.createNewMarker(p);else if(u==="action")switch(p){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},L.prototype.deleteSelectedMarker=function(){var u=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(H){var k=new Dt(u,u._currentMarker,!0);H(k),k.defaultPrevented&&(p=!0)}),!p){var D=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(H){return H(new Dt(u,D))})}}},L.prototype.clear=function(){var u=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ge){var qe=new Dt(u,void 0,!0);ge(qe),qe.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var D=function(ge){var qe=H.markers[ge];H.setCurrentMarker(H.markers[ge]),H._currentMarker.dispose(),H.markerImage.removeChild(H._currentMarker.container),H.markers.splice(H.markers.indexOf(H._currentMarker),1),H.eventListeners.markerdelete.forEach(function(st){return st(new Dt(u,qe))})},H=this,k=this.markers.length-1;k>=0;k--)D(k);this.addUndoStep()}},Object.defineProperty(L.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),L.prototype.showNotesEditor=function(){var u;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(u=this._currentMarker.notes)!==null&&u!==void 0?u:"",this.overlayContainer.appendChild(this.notesArea))},L.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},L.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},L.prototype.addUndoStep=function(){var u=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),D=this.undoRedoManager.getLastUndoStep();if(!D||D.width===p.width&&D.height===p.height){var H=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),H<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(k){return k(new en(u))})}else this.undoRedoManager.replaceLastUndoStep(p),this.eventListeners.statechange.forEach(function(k){return k(new en(u))})}},L.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},L.prototype.undoStep=function(){var u=this,p=this.undoRedoManager.undo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(D){return D(new en(u))}))},L.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},L.prototype.redoStep=function(){var u=this,p=this.undoRedoManager.redo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(D){return D(new en(u))}))},L.prototype.stepZoom=function(){var u=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=u<this.zoomSteps.length-1?this.zoomSteps[u+1]:this.zoomSteps[0]},L.prototype.panTo=function(u){this.contentDiv.scrollBy({left:this.prevPanPoint.x-u.x,top:this.prevPanPoint.y-u.y}),this.prevPanPoint=u},L.prototype.startRenderAndClose=function(){return te(this,void 0,void 0,function(){var u,p,D=this;return ve(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return u=H.sent(),p=this.getState(),this.eventListeners.render.forEach(function(k){return k(new tn(D,u,p))}),this.close(!0),[2]}})})},L.prototype.getState=function(u){u===!0&&this.setCurrentMarker();var p={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(D){return p.markers.push(D.getState())}),p},L.prototype.restoreState=function(u){var p=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);u.markers.forEach(function(D){var H=p._availableMarkerTypes.find(function(ge){return ge.typeName===D.typeName});if(H!==void 0){var k=p.addNewMarker(H);k.restoreState(D),p.markers.push(k)}}),u.width&&u.height&&(u.width!==this.imageWidth||u.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/u.width,this.imageHeight/u.height),this.eventListeners.restorestate.forEach(function(D){return D(new en(p))})},L.prototype.addNewMarker=function(u){var p=X.createGroup();return this.markerImage.appendChild(p),new u(p,this.overlayContainer,this.settings)},L.prototype.createNewMarker=function(u){var p,D=this;(p=typeof u=="string"?this._availableMarkerTypes.find(function(H){return H.typeName===u}):u)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(p),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(p.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(H){return H(new Dt(D,D._currentMarker))}))},L.prototype.markerCreated=function(u){var p=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(u),this.setCurrentMarker(u),u instanceof ce&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ce):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(D){return D(new Dt(p,p._currentMarker))})},L.prototype.colorChanged=function(u){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=u,this.settings.defaultStrokeColor=u)},L.prototype.fillColorChanged=function(u){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=u)},L.prototype.markerStateChanged=function(u){var p=this;this.eventListeners.markerchange.forEach(function(D){return D(new Dt(p,u))})},L.prototype.setCurrentMarker=function(u){var p=this;this._currentMarker!==u&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(D){return D(new Dt(p,p._currentMarker))})),this._currentMarker=u,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(D){return D(new Dt(p,p._currentMarker))}))},L.prototype.onPointerDown=function(u){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||u.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var p=this.markers.find(function(D){return D.ownsTarget(u.target)});p!==void 0?(this.setCurrentMarker(p),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(u.clientX,u.clientY),u.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:u.clientX,y:u.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(u.clientX,u.clientY))},L.prototype.onDblClick=function(u){if(this._isFocused||this.focus(),this.mode==="select"){var p=this.markers.find(function(D){return D.ownsTarget(u.target)});p!==void 0&&p!==this._currentMarker&&this.setCurrentMarker(p),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(u.clientX,u.clientY),u.target):this.setCurrentMarker()}},L.prototype.onPointerMove=function(u){this.touchPoints!==1&&u.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||u.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(u.clientX,u.clientY)):this.zoomLevel>1&&this.panTo({x:u.clientX,y:u.clientY}))},L.prototype.onPointerUp=function(u){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(u.clientX,u.clientY)),this.isDragging=!1,this.addUndoStep()},L.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},L.prototype.onKeyUp=function(u){this._currentMarker===void 0||this.notesArea!==void 0||u.key!=="Delete"&&u.key!=="Backspace"||this.deleteSelectedMarker()},L.prototype.clientToLocalCoordinates=function(u,p){var D=this.markerImage.getBoundingClientRect();return{x:(u-D.left)/this.zoomLevel,y:(p-D.top)/this.zoomLevel}},L.prototype.onWindowResize=function(){this.positionUI()},L.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},L.prototype.addLicenseKey=function(u){Te.addKey(u)},L.prototype.addEventListener=function(u,p){this.eventListeners.addEventListener(u,p)},L.prototype.removeEventListener=function(u,p){this.eventListeners.removeEventListener(u,p)},L.prototype.renderState=function(u){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(u),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(L.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),L.prototype.focus=function(){var u=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(p){return p(new en(u))}))},L.prototype.blur=function(){var u=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new en(u))}))},L.instanceCounter=0,L}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var sn=function(L,u){return(sn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,D){p.__proto__=D}||function(p,D){for(var H in D)Object.prototype.hasOwnProperty.call(D,H)&&(p[H]=D[H])})(L,u)};function Ln(L,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=L}sn(L,u),L.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}function Wt(L,u,p,D){return new(p||(p=Promise))(function(H,k){function ge(Kt){try{st(D.next(Kt))}catch(tt){k(tt)}}function qe(Kt){try{st(D.throw(Kt))}catch(tt){k(tt)}}function st(Kt){var tt;Kt.done?H(Kt.value):(tt=Kt.value,tt instanceof p?tt:new p(function(nn){nn(tt)})).then(ge,qe)}st((D=D.apply(L,u||[])).next())})}function yn(L,u){var p,D,H,k,ge={label:0,sent:function(){if(1&H[0])throw H[1];return H[1]},trys:[],ops:[]};return k={next:qe(0),throw:qe(1),return:qe(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function qe(st){return function(Kt){return function(tt){if(p)throw new TypeError("Generator is already executing.");for(;ge;)try{if(p=1,D&&(H=2&tt[0]?D.return:tt[0]?D.throw||((H=D.return)&&H.call(D),0):D.next)&&!(H=H.call(D,tt[1])).done)return H;switch(D=0,H&&(tt=[2&tt[0],H.value]),tt[0]){case 0:case 1:H=tt;break;case 4:return ge.label++,{value:tt[1],done:!1};case 5:ge.label++,D=tt[1],tt=[0];continue;case 7:tt=ge.ops.pop(),ge.trys.pop();continue;default:if(!(H=ge.trys,(H=H.length>0&&H[H.length-1])||tt[0]!==6&&tt[0]!==2)){ge=0;continue}if(tt[0]===3&&(!H||tt[1]>H[0]&&tt[1]<H[3])){ge.label=tt[1];break}if(tt[0]===6&&ge.label<H[1]){ge.label=H[1],H=tt;break}if(H&&ge.label<H[2]){ge.label=H[2],ge.ops.push(tt);break}H[2]&&ge.ops.pop(),ge.trys.pop();continue}tt=u.call(L,ge)}catch(nn){tt=[6,nn],D=0}finally{p=H=0}if(5&tt[0])throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}([st,Kt])}}}var xn=function(){function L(){}return L.addKey=function(u){L.key=u},Object.defineProperty(L,"isLicensed",{get:function(){return!!L.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(L.key)},enumerable:!1,configurable:!0}),L}(),pt=function(){function L(){}return L.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},L.setAttributes=function(u,p){for(var D=0,H=p;D<H.length;D++){var k=H[D],ge=k[0],qe=k[1];u.setAttribute(ge,qe)}},L.createRect=function(u,p,D){var H=document.createElementNS("http://www.w3.org/2000/svg","rect");return H.setAttribute("width",u.toString()),H.setAttribute("height",p.toString()),D&&L.setAttributes(H,D),H},L.createLine=function(u,p,D,H,k){var ge=document.createElementNS("http://www.w3.org/2000/svg","line");return ge.setAttribute("x1",u.toString()),ge.setAttribute("y1",p.toString()),ge.setAttribute("x2",D.toString()),ge.setAttribute("y2",H.toString()),k&&L.setAttributes(ge,k),ge},L.createPolygon=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","polygon");return D.setAttribute("points",u),p&&L.setAttributes(D,p),D},L.createCircle=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","circle");return D.setAttribute("cx",(u/2).toString()),D.setAttribute("cy",(u/2).toString()),D.setAttribute("r",u.toString()),p&&L.setAttributes(D,p),D},L.createEllipse=function(u,p,D){var H=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return H.setAttribute("cx",(u/2).toString()),H.setAttribute("cy",(p/2).toString()),H.setAttribute("rx",(u/2).toString()),H.setAttribute("ry",(p/2).toString()),D&&L.setAttributes(H,D),H},L.createGroup=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return u&&L.setAttributes(p,u),p},L.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},L.createMarker=function(u,p,D,H,k,ge,qe){var st=document.createElementNS("http://www.w3.org/2000/svg","marker");return L.setAttributes(st,[["id",u],["orient",p],["markerWidth",D.toString()],["markerHeight",H.toString()],["refX",k.toString()],["refY",ge.toString()]]),st.appendChild(qe),st},L.createText=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),u&&L.setAttributes(p,u),p},L.createTSpan=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","tspan");return D.textContent=u,p&&L.setAttributes(D,p),D},L.createImage=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return u&&L.setAttributes(p,u),p},L.createPoint=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return D.x=u,D.y=p,D},L.createPath=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg","path");return D.setAttribute("d",u),p&&L.setAttributes(D,p),D},L.createElement=function(u,p){var D=document.createElementNS("http://www.w3.org/2000/svg",u);return p&&L.setAttributes(D,p),D},L.getHollowRectanglePath=function(u,p,D,H,k,ge,qe,st){return"M"+u+","+p+"V"+(p+H)+"H"+(u+D)+"V"+p+"H"+k+"V"+ge+"H"+(k+qe)+"V"+(ge+st)+"H"+k+"V"+p+"Z"},L}(),zn=function(){function L(u){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+u+"_"}return Object.defineProperty(L.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),L.prototype.addClass=function(u){return this.styleSheet===void 0&&this.addStyleSheet(),u.name=""+this.classNamePrefix+u.localName,this.classes.push(u),this.styleSheet.sheet.insertRule("."+u.name+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length),u},L.prototype.addRule=function(u){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(u),this.styleSheet.sheet.insertRule(u.selector+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length)},L.prototype.addStyleSheet=function(){var u;this.styleSheet=document.createElement("style"),((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).appendChild(this.styleSheet),this.addRule(new Cn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Cn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Cn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Rn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Rn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},L.prototype.removeStyleSheet=function(){var u;this.styleSheet&&(((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},L}(),Cn=function(L,u){this.selector=L,this.style=u},Rn=function(L,u){this.localName=L,this.style=u},Rt=function(){function L(){this.blocks=[],this.display=""}return L.prototype.addButtonBlock=function(u){u.className=this.blockClassName,u.buttonClassName=this.buttonClassName,u.buttonColorsClassName=this.buttonColorsClassName,u.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(u)},L.prototype.addElementBlock=function(u){u.className===void 0&&(u.className=this.blockClassName),this.blocks.push(u)},L.prototype.getUI=function(){var u=document.createElement("div");return u.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,u.style.display=this.display,this.blocks.forEach(function(p){return u.appendChild(p.getUI())}),u},L}(),Gn=function(){function L(){}return L.prototype.getUI=function(){var u=document.createElement("div");if(u.className=this.className,this.minWidth!==void 0&&(u.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":u.style.justifyContent="flex-start";break;case"center":u.style.justifyContent="center";break;case"end":u.style.justifyContent="flex-end"}return u.style.whiteSpace="nowrap",u},L}(),er=function(L){function u(){var p=L!==null&&L.apply(this,arguments)||this;return p.buttons=[],p}return Ln(u,L),u.prototype.addButton=function(p){p.className=this.buttonClassName,p.colorsClassName=this.buttonColorsClassName,p.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(p)},u.prototype.getUI=function(){var p=L.prototype.getUI.call(this);return this.buttons.forEach(function(D){return p.appendChild(D.getUI())}),p},u}(Gn),ur=function(){function L(u,p){this._isActive=!1,this._isHidden=!1,this._icon=u,this.title=p,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(L.prototype,"icon",{get:function(){return this._icon},set:function(u){this._icon=u,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isActive",{get:function(){return this._isActive},set:function(u){this._isActive=u,this.adjustClassName()},enumerable:!1,configurable:!0}),L.prototype.getUI=function(){var u=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return u.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},L.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},L.prototype.hide=function(){this._isHidden=!0},L}(),tr=function(L){function u(){var p=L!==null&&L.apply(this,arguments)||this;return p.elements=[],p}return Ln(u,L),u.prototype.addElement=function(p){this.elements.push(p)},u.prototype.getUI=function(){var p=L.prototype.getUI.call(this);return this.elements.forEach(function(D){return p.appendChild(D)}),p},u}(Gn),fr=function(){function L(u,p){this.horizontal=u,this.vertical=p}return Object.defineProperty(L.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),L.prototype.getVerticalLength=function(u){return u/this.ratio},L.prototype.getHorizontalLength=function(u){return u*this.ratio},L}(),br=function(){function L(){}return L.getIcon=function(u,p){if(u>0&&p>0){var D=new fr(u,p),H=D.ratio>=1?20:D.getHorizontalLength(20),k=D.ratio<1?20:D.getVerticalLength(20),ge=document.createElementNS("http://www.w3.org/2000/svg","svg");ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),ge.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ge);var qe=pt.createDefs();ge.appendChild(qe);var st=pt.createElement("clipPath",[["id","text-bg-clip"]]);qe.appendChild(st);var Kt=pt.createPath(pt.getHollowRectanglePath((24-H)/2,(24-k)/2,H,k,(24-H)/2+2,(24-k)/2+2,H-4,k-4));ge.appendChild(Kt);var tt=pt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);tt.appendChild(pt.createTSpan(u+":"+p)),ge.appendChild(tt);var nn=tt.getBBox();pt.setAttributes(tt,[["x",((24-nn.width)/2).toString()],["y",((24-nn.height)/2-nn.y).toString()]]);var Yt=pt.createPath(pt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(nn.width))/2,(24-Math.ceil(nn.height))/2,Math.ceil(nn.width),Math.ceil(nn.height)));return st.appendChild(Yt),pt.setAttributes(Kt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ge),ge.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},L}(),Vr=function(L){function u(p,D,H){var k=L.call(this,p,D)||this;return k.isDropdownOpen=!1,k.onClick=k.dropdownButtonClicked,k.dropdownButtons=H,k}return Ln(u,L),u.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(D){D.className=p.className,D.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(D.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},u.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},u.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},u.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},u.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},u.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},u}(ur),Fr=function(){function L(u,p){this.GRIP_SIZE=10,this.color=u,this.fillColor=p,this.visual=pt.createGroup(),this.visual.appendChild(pt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return L.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},L.prototype.setCenter=function(u,p){this.visual.childNodes.forEach(function(D){return pt.setAttributes(D,[["cx",u.toString()],["cy",p.toString()]])})},L}(),Rr=function(){function L(u,p,D,H){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=u,this.canvasHeight=p,this.margin=D,this.container=H,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(L.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(u){this._aspectRatio=u,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.gridContainer&&pt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(u){this._zoomFactor=u,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),L.prototype.open=function(){var u=this;this.cropShadeElement=pt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=pt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;p<this.numberOfGridLines;p++)this.horizontalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(D){return u.gridContainer.appendChild(D)}),this.verticalGridLines.forEach(function(D){return u.gridContainer.appendChild(D)}),this.cropRectElement=pt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Fr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Fr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Fr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Fr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},L.prototype.setCropRectangle=function(u){this.cropRect=u;var p=Object.assign({},this.cropRect);this.zoomFactor!==1&&(p.width=this.cropRect.width*this.zoomFactor,p.height=this.cropRect.height*this.zoomFactor,p.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-p.width/2,p.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),pt.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var D=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(k,ge){var qe=p.y+D*(ge+1);pt.setAttributes(k,[["x1",""+p.x],["y1",""+qe],["x2",""+(p.x+p.width)],["y2",""+qe]])});var H=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(k,ge){var qe=p.x+H*(ge+1);pt.setAttributes(k,[["x1",""+qe],["y1",""+p.y],["x2",""+qe],["y2",""+(p.y+p.height)]])}),pt.setAttributes(this.cropShadeElement,[["d",pt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},L.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},L.prototype.clientToLocalCoordinates=function(u,p){var D=this.container.getBoundingClientRect();return{x:u-D.left+this.margin,y:p-D.top+this.margin}},L.prototype.onPointerDown=function(u){this.container.setPointerCapture(u.pointerId),this.previousPoint=this.clientToLocalCoordinates(u.clientX,u.clientY),this.cropRectElement===u.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(u.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(u.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(u.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(u.target)&&(this.activeGrip=this.bottomRightGrip)},L.prototype.onPointerMove=function(u){if(this.isMoving)this.move(this.clientToLocalCoordinates(u.clientX,u.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(u.clientX,u.clientY);this.resize(p)}u.preventDefault()},L.prototype.onPointerUp=function(u){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(u.pointerId)},L.prototype.move=function(u){var p=u.x-this.previousPoint.x,D=u.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,D=-D/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+D),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=u},L.prototype.resize=function(u){var p=Object.assign({},this.cropRect),D=u.x-this.previousPoint.x,H=u.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+D<this.margin&&(D=this.margin-p.x),p.x+=D,p.width=this.cropRect.x+this.cropRect.width-p.x;break;case this.bottomRightGrip:case this.topRightGrip:p.width+D>this.canvasWidth*this.zoomFactor&&(D=this.canvasWidth*this.zoomFactor-p.width),p.width+=D}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(D),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=H,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=H}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=u,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},L.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var u=this.cropRect.x+this.cropRect.width/2,p=this.cropRect.y+this.cropRect.height/2,D=this.aspectRatio.getHorizontalLength(this.cropRect.height),H=this.aspectRatio.getVerticalLength(this.cropRect.width);D/this.canvasWidth<H/this.canvasHeight?this.cropRect.width=D:this.cropRect.height=H,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=u-this.cropRect.width/2,this.cropRect.y=p-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},L.prototype.getRescaledRect=function(u,p,D,H,k,ge){var qe=D/u,st=H/p;return{x:(k.x-ge)*qe+ge,y:(k.y-ge)*st+ge,width:k.width*qe,height:k.height*st}},L.prototype.scaleCanvas=function(u,p){var D=this.getRescaledRect(this.canvasWidth,this.canvasHeight,u,p,this.cropRect,this.margin);this.canvasWidth=u,this.canvasHeight=p,this.onCropChange&&this.onCropChange(D),this.setCropRectangle(D)},L}(),Xr=function(){function L(u){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=u,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(L.prototype,"angle",{get:function(){return this._angle},set:function(u){this._angle=u,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),L.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},L.prototype.onPointerDown=function(u){this.controlContainer.setPointerCapture(u.pointerId),this.isDragging=!0,this.previousPoint={x:u.clientX,y:u.clientY}},L.prototype.onPointerMove=function(u){this.isDragging&&(this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.previousPoint.x=u.clientX)},L.prototype.onPointerUp=function(u){this.isDragging&&this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(u.pointerId)},L.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var u=this.angleLabelText.getBBox();pt.setAttributes(this.angleLabelElement,[["x",((this.width-u.width)/2).toString()],["y",(this.height/2).toString()]])}},L.prototype.positionScaleShape=function(){if(this.scaleShape){var u=this.scaleShape.transform.baseVal.getItem(0);u.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(u,0)}},L.prototype.getVisual=function(){var u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("xmlns","http://www.w3.org/2000/svg"),u.setAttribute("width",this.width+"px"),u.setAttribute("height",this.height+"px"),u.setAttribute("viewBox","0 0 "+this.width+" "+this.height),u.style.flexShrink="0",document.body.appendChild(u);for(var p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,D=1;D<=this.width/5+10;D++){var H=D%5==0?this.height/3:this.height/6;p+="h4v"+-H+"h1v"+H}p+="v1H0Z",this.scaleShape=pt.createPath(p);var k=pt.createTransform();this.scaleShape.transform.baseVal.appendItem(k),u.appendChild(this.scaleShape),this.angleLabelElement=pt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=pt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ge=pt.createTSpan("");return ge.innerHTML="&deg;",this.angleLabelElement.appendChild(ge),u.appendChild(this.angleLabelElement),document.body.removeChild(u),u},L}(),$r=function(){function L(){this.naturalSize=!1,this.imageType="image/png"}return L.prototype.rasterize=function(u,p,D,H,k,ge,qe){var st=this;return new Promise(function(Kt){var tt=document.createElement("canvas");tt.width=u.width.baseVal.value-2*H,tt.height=u.height.baseVal.value-2*H;var nn=1,Yt=1;st.naturalSize===!0?(nn=p.naturalWidth/(u.width.baseVal.value-2*H)/ge,Yt=p.naturalHeight/(u.height.baseVal.value-2*H)/qe,tt.width=p.naturalWidth/ge,tt.height=p.naturalHeight/qe):st.width!==void 0&&st.height!==void 0&&(nn=st.width/D.width,Yt=st.height/D.height,tt.width*=nn,tt.height*=Yt);var kn=tt.getContext("2d");kn.translate(tt.width/2,tt.height/2),kn.rotate(k*Math.PI/180),kn.scale(ge,qe),kn.translate(-tt.width/2,-tt.height/2),kn.drawImage(p,0,0,tt.width,tt.height);var Pr=document.createElement("canvas");Pr.width=D.width*nn,Pr.height=D.height*Yt,Pr.getContext("2d").putImageData(kn.getImageData((D.x-H)*nn,(D.y-H)*Yt,D.width*nn,D.height*Yt),0,0),Kt(Pr.toDataURL(st.imageType,st.imageQuality))})},L}(),ea=function(){function L(u){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=L.instanceCounter++,this.styles=new zn(this.instanceNo),this.target=u,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(L.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(u){this._zoomToCropEnabled=u,u?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"gridLines",{get:function(){return this._gridLines},set:function(u){this._gridLines=u,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(u){this._rotationAngle=u,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"aspectRatio",{get:function(){var u;return(u=this._aspectRatio)!==null&&u!==void 0?u:this.aspectRatios[0]},set:function(u){this._aspectRatio=u},enumerable:!1,configurable:!0}),L.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},L.prototype.show=function(){this.showUI(),this.open()},L.prototype.close=function(u){u===void 0&&(u=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),u||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},L.prototype.addRenderEventListener=function(u){this.renderEventListeners.push(u)},L.prototype.removeRenderEventListener=function(u){this.renderEventListeners.indexOf(u)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(u),1)},L.prototype.addCloseEventListener=function(u){this.closeEventListeners.push(u)},L.prototype.removeCloseEventListener=function(u){this.closeEventListeners.indexOf(u)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(u),1)},L.prototype.setupResizeObserver=function(){var u=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){u.resize(u.target.clientWidth,u.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},L.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var u=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/u>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*u:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,D=p+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/u;this.resize(p,D)}},L.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},L.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",pt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},L.prototype.resize=function(u,p){this.imageWidth=Math.round(u),this.imageHeight=Math.round(p),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},L.prototype.setEditingTarget=function(){var u=document.createElement("canvas");u.width=this.target.naturalWidth,u.height=this.target.naturalHeight,u.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var p=u.toDataURL();pt.setAttributes(this.editingTarget,[["href",p]]),this.setEditingTargetSize()},L.prototype.setTopLeft=function(){var u=this.target.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=u.left-p.left-this.CANVAS_MARGIN,this.top=u.top-p.top-this.CANVAS_MARGIN},L.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=pt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=pt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=pt.createGroup(),this.editingTargetRotationScaleContainer=pt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var u=pt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(u);var p=pt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(p),this.editingTargetContainer=pt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},L.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},L.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=pt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Rr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},L.prototype.zoomToCrop=function(){if(this.cropRect){var u=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,p=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=u+"px "+p+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-u+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-p+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},L.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},L.prototype.cropRectChanged=function(u){this.cropRect=u,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},L.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},L.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},L.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},L.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var u=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,p=this.target.offsetTop>u+this.CANVAS_MARGIN?this.target.offsetTop-(u+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},L.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},L.prototype.addTopToolbar=function(){var u=this;this.topToolbar=new Rt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var p=new er;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var D=[];this.aspectRatios.forEach(function(Yt){var kn=new ur(br.getIcon(Yt.horizontal,Yt.vertical),Yt.horizontal===0&&Yt.vertical===0?"FREE":Yt.horizontal+":"+Yt.vertical);kn.onClick=function(){return u.ratioButtonClicked(Yt)},D.push(kn)}),this.aspectRatioButton=new Vr(br.getIcon(0,0),"Aspect ratio",D),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var H=new ur('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");H.isActive=this.isGridVisible,H.onClick=function(){u.isGridVisible=!u.isGridVisible,H.isActive=u.isGridVisible},p.addButton(H);var k=new ur('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(k.isActive=this.zoomToCropEnabled,k.onClick=function(){u.zoomToCropEnabled=!u.zoomToCropEnabled,k.isActive=u.zoomToCropEnabled},p.addButton(k),!xn.isLicensed){var ge=new tr;this.topToolbar.addElementBlock(ge);var qe=document.createElement("div");qe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var st=document.createElement("a");st.style.color="currentColor",st.href="https://markerjs.com/products/cropro",st.target="_blank",st.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',qe.appendChild(st),ge.addElement(qe)}var Kt=new er;Kt.minWidth=3*this.toolbarHeight+"px",Kt.contentAlign="end",this.topToolbar.addButtonBlock(Kt);var tt=new ur('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");tt.onClick=this.startRenderAndClose,Kt.addButton(tt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(tt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var nn=new ur('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");nn.onClick=this.close,Kt.addButton(nn),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(nn.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},L.prototype.addBottomToolbar=function(){var u=this;this.bottomToolbar=new Rt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var p=new er;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var D=new ur('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");D.onClick=this.rotateLeftButtonClicked,p.addButton(D);var H=new ur('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");H.onClick=this.rotateRightButtonClicked,p.addButton(H);var k=new tr;k.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(k),this.straightener=new Xr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Kt){u.rotateBy(Kt),u.straightener.angle=u.rotationAngle},k.addElement(this.straightener.getUI());var ge=new er;ge.minWidth=2*this.toolbarHeight+"px",ge.contentAlign="end",this.bottomToolbar.addButtonBlock(ge);var qe=new ur('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");qe.onClick=this.flipHorizontallyButtonClicked,ge.addButton(qe);var st=new ur('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");st.onClick=this.flipVerticallyButtonClicked,ge.addButton(st)},L.prototype.ratioButtonClicked=function(u){this.aspectRatio=u,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},L.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=br.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},L.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new fr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},L.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},L.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},L.prototype.restoreState=function(u){if(u){var p=this.cropLayer.getRescaledRect(u.width,u.height,this.imageWidth,this.imageHeight,u.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=u.flippedHorizontally,this.flippedVertically=u.flippedVertically,this.applyFlip(),this.rotationAngle=u.rotationAngle,this.applyRotation()}},L.prototype.clientToLocalCoordinates=function(u,p){var D=this.cropImage.getBoundingClientRect();return{x:u-D.left,y:p-D.top}},L.prototype.onWindowResize=function(){this.positionUI()},L.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var u=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},L.prototype.rotateLeftButtonClicked=function(){var u=this.rotationAngle-90;this.rotationAngle%90!=0&&(u+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(u)},L.prototype.rotateRightButtonClicked=function(){var u=this.rotationAngle+90;this.rotationAngle%90!=0&&(u-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(u)},L.prototype.rotateTo=function(u){u=(u=u>180?u-360:u)<=-180?u+360:u,this.rotationAngle=u,this.applyRotation()},L.prototype.rotateBy=function(u){this.rotateTo((this.rotationAngle+u)%360)},L.prototype.applyRotation=function(){var u=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var D=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/D.width,this.imageHeight/D.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=u},L.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},L.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},L.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},L.prototype.startRenderAndClose=function(){return Wt(this,void 0,void 0,function(){var u,p;return yn(this,function(D){switch(D.label){case 0:return[4,this.render()];case 1:return u=D.sent(),p=this.getState(),this.renderEventListeners.forEach(function(H){return H(u,p)}),this.close(!0),[2]}})})},L.prototype.render=function(){return Wt(this,void 0,void 0,function(){var u;return yn(this,function(p){switch(p.label){case 0:return(u=new $r).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.width=this.renderWidth,u.height=this.renderHeight,this.unzoomFromCrop(),pt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,u.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return p.sent(),[4,u.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,p.sent()]}})})},L.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Rn("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Rn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Rn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var u=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Rn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*u)+`px;
height: `+(this.toolbarHeight-2*u)+`px;
padding: `+u+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Rn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Rn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Cn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Cn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Rn("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Rn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Rn("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Rn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*u)+`px;
padding: `+u+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Rn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},L.instanceCounter=0,L}(),ta=j("8hTe"),pr=j.n(ta),na=/<pre[^>]*>/g;function aa(L){var u=document.createElement("div");return u.innerHTML=L,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var sa=Fe.a=function(L){var u=L.value,p=u===void 0?"":u,D=L.edit,H=D===void 0?!1:D,k=L.className,ge=L.showTextOnly,qe=L.showLines,st=L.replaces,Kt=L.zoomImg,tt=L.hasMask,nn=L.style,Yt=nn===void 0?{}:nn,kn=L.stylesPrev,Pr=kn===void 0?{}:kn,Kr=String(p),nr=Object(P.useRef)(),Yr=Object(P.useRef)(),ga=Object(P.useState)(""),la=Object(N.a)(ga,2),fa=la[0],Bt=la[1],ke=Object(P.useState)("office"),ut=Object(N.a)(ke,2),Je=ut[0],et=ut[1],Xt=function(){var Lt=new ea(Yr.current);Lt.displayMode="popup",Lt.addRenderEventListener(function(){var mt=Object(x.a)(S.a.mark(function dt(Mt){var $t;return S.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return nr.current.style.display="none",de.next=3,Object(pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt}});case 3:$t=de.sent,$t!=null&&$t.id&&st(Yr.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return de.stop()}},dt)}));return function(dt){return mt.apply(this,arguments)}}()),Lt.show()},Ht=function(){var Lt=new fn(Yr.current);Lt.settings.displayMode="popup",Lt.addEventListener("render",function(){var mt=Object(x.a)(S.a.mark(function dt(Mt){var $t;return S.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:if(nr.current.style.display="none",!Yr.current){de.next=6;break}return de.next=4,Object(pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt.dataUrl}});case 4:$t=de.sent,$t!=null&&$t.id&&st(Yr.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return de.stop()}},dt)}));return function(dt){return mt.apply(this,arguments)}}()),Lt.show(),window.markerArea=Lt},Ut=Object(P.useMemo)(function(){try{var vt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Lt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,mt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kr=Kr.replace(vt,"("+J.a.API_SERVER+"/api/attachments/").replace(Lt,'"'+J.a.API_SERVER+"/api/attachments/").replace(mt,'"'+J.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,`
`),Kr=Kr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(rn){}var dt=F(Kr),Mt=g();if(Kr.match(/\[TOC\]/)&&(dt=dt.replace("<p>[TOC]</p>",v()),y()),dt=dt.replace(/(__special_katext_id_\d+__)/g,function(rn,de){var on=Mt[de],Pt=on.type,At=on.expression;return Object(oe.renderToString)(aa(At)||"",{displayMode:Pt==="block",throwOnError:!1,output:"html"})}),dt=dt.replace(/▁/g,"\u2581\u2581\u2581"),h(),ge){var $t=document.createElement("div");return $t.innerHTML=dt,$t.innerText}return setTimeout(function(){return ft()},500),dt},[Kr]),xt=Object(P.useRef)();c.WebkitLineClamp=qe,qe&&(Yt=Object(_.a)(Object(_.a)({},Yt),c));function zt(vt){var Lt=vt.target;if(Lt.tagName.toUpperCase()==="IMG"){if(Kt){var mt=Lt.getAttribute("src");Bt(mt),et("image")}}else if(Lt.tagName.toUpperCase()==="A"){var dt=Lt.getAttribute("href");if(dt.indexOf("office")>-1)vt.preventDefault(),Bt(dt),et("office");else if(dt.indexOf("application/pdf")>-1)vt.preventDefault(),Bt(dt),et("pdf");else if(dt.indexOf("type=text")>-1)vt.preventDefault(),Bt(dt),et("html");else if(dt.startsWith("#")){vt.preventDefault();var Mt=document.getElementById(dt.replace("#",""));Mt&&Mt.scrollIntoView(!0)}}}var ft=function(){var Lt,mt=(Lt=xt.current)===null||Lt===void 0?void 0:Lt.querySelectorAll("video");mt==null||mt.forEach(function(dt){if(dt.oncontextmenu=function(){return!1},dt.src.indexOf(".m3u8")>-1&&!dt.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var Mt=new K.a;Mt.loadSource(dt.src),Mt.attachMedia(dt)}}})};Object(P.useEffect)(function(){if(xt.current&&Ut&&(Ut.match(na)&&window.PR.prettyPrint()),xt.current)return xt.current.addEventListener("click",zt),function(){xt.current.removeEventListener("click",zt),h(),y()}},[Ut,xt.current,zt]);var Et=function(Lt){if(!H)return;Lt.target.nodeName==="IMG"?(nr.current.style.display="flex",nr.current.style.width=Lt.target.clientWidth+"px",nr.current.style.height=Lt.target.clientHeight+"px",nr.current.style.top=Lt.target.offsetTop+"px",nr.current.style.left=Lt.target.offsetLeft+"px",Yr.current.src=Lt.target.getAttribute("src")):nr.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:xt,style:Object(_.a)({},Yt),className:"".concat(k||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:Et,dangerouslySetInnerHTML:{__html:Ut}}),E.a.createElement("div",{ref:nr,className:pr.a.button},E.a.createElement(B.a,null,E.a.createElement(U.a,{onClick:function(){return Xt()}},"\u88C1\u526A"),E.a.createElement(U.a,{onClick:function(){return Ht()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:Yr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),E.a.createElement(se.a,{close:!0,data:fa,hasMask:tt,type:fa!=null&&fa.length?Je:"",style:Object(_.a)({},Pr),onClose:function(){return Bt("")}}))}},"A60/":function(Ct,Fe,j){Ct.exports={wrap:"wrap___37dvp",right20:"right20___2yZBe",right180:"right180___14fSn",basket:"basket___32ZdA",count:"count___2ydNT",iconWrap:"iconWrap___2cEp5",icon:"icon___3fYs3",name:"name___7IPYm"}},BU3w:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return x});var he=j("MNnm"),B="rc-util-key";function w(N){if(N.attachTo)return N.attachTo;var I=document.querySelector("head");return I||document.body}function U(N){var I,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(he.a)())return null;var P=document.createElement("style");if((I=S.csp)===null||I===void 0?void 0:I.nonce){var E;P.nonce=(E=S.csp)===null||E===void 0?void 0:E.nonce}P.innerHTML=N;var O=w(S),R=O.firstChild;return S.prepend&&O.prepend?O.prepend(P):S.prepend&&R?O.insertBefore(P,R):O.appendChild(P),P}var _=new Map;function x(N,I){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=w(S);if(!_.has(P)){var E=U("",S),O=E.parentNode;_.set(P,O),O.removeChild(E)}var R=Array.from(_.get(P).children).find(function(n){return n.tagName==="STYLE"&&n[B]===I});if(R){var T,C;if(((T=S.csp)===null||T===void 0?void 0:T.nonce)&&R.nonce!==((C=S.csp)===null||C===void 0?void 0:C.nonce)){var b;R.nonce=(b=S.csp)===null||b===void 0?void 0:b.nonce}return R.innerHTML!==N&&(R.innerHTML=N),R}var m=U(N,S);return m[B]=I,m}},BdwD:function(Ct,Fe,j){"use strict";var he=j("+L6B"),B=j("2/Rp"),w=j("0Owb"),U=j("k1fw"),_=j("q1tI"),x=j.n(_),N=j("FOrL"),I=j.n(N),S=function(E){var O=E.buttonProps,R=O===void 0?{}:O,T=E.styles,C=T===void 0?{}:T,b=E.customText,m=E.ButtonText,n=E.ButtonClick,s=E.Buttonclass,l=E.ButtonTwo;return x.a.createElement("section",{className:"tc animated fadeIn",style:Object(U.a)(Object(U.a)({},{color:"#999",margin:"200px auto"}),C)},x.a.createElement("img",{src:I.a}),x.a.createElement("p",{className:"mt20 font14"},b||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),m&&x.a.createElement(B.a,Object(w.a)({className:s,onClick:n},R),m),l&&l)};Fe.a=S},DlQD:function(Ct,Fe,j){(function(he,B){Ct.exports=B()})(this,function(){"use strict";function he(ce,re){for(var ie=0;ie<re.length;ie++){var $=re[ie];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(ce,$.key,$)}}function B(ce,re,ie){return re&&he(ce.prototype,re),ie&&he(ce,ie),ce}function w(ce,re){if(!ce)return;if(typeof ce=="string")return U(ce,re);var ie=Object.prototype.toString.call(ce).slice(8,-1);if(ie==="Object"&&ce.constructor&&(ie=ce.constructor.name),ie==="Map"||ie==="Set")return Array.from(ce);if(ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ie))return U(ce,re)}function U(ce,re){(re==null||re>ce.length)&&(re=ce.length);for(var ie=0,$=new Array(re);ie<re;ie++)$[ie]=ce[ie];return $}function _(ce,re){var ie;if(typeof Symbol=="undefined"||ce[Symbol.iterator]==null){if(Array.isArray(ce)||(ie=w(ce))||re&&ce&&typeof ce.length=="number"){ie&&(ce=ie);var $=0;return function(){return $>=ce.length?{done:!0}:{done:!1,value:ce[$++]}}}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 ie=ce[Symbol.iterator](),ie.next.bind(ie)}function x(ce,re){return re={exports:{}},ce(re,re.exports),re.exports}var N=x(function(ce){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 ie($){ce.exports.defaults=$}ce.exports={defaults:re(),getDefaults:re,changeDefaults:ie}}),I=N.defaults,S=N.getDefaults,P=N.changeDefaults,E=/[&<>"']/,O=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,T=/[<>"']|&(?!#?\w+;)/g,C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},b=function(re){return C[re]};function m(ce,re){if(re){if(E.test(ce))return ce.replace(O,b)}else if(R.test(ce))return ce.replace(T,b);return ce}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ce){return ce.replace(n,function(re,ie){return ie=ie.toLowerCase(),ie==="colon"?":":ie.charAt(0)==="#"?ie.charAt(1)==="x"?String.fromCharCode(parseInt(ie.substring(2),16)):String.fromCharCode(+ie.substring(1)):""})}var l=/(^|[^\[])\^/g;function y(ce,re){ce=ce.source||ce,re=re||"";var ie={replace:function(Y,V){return V=V.source||V,V=V.replace(l,"$1"),ce=ce.replace(Y,V),ie},getRegex:function(){return new RegExp(ce,re)}};return ie}var c=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(ce,re,ie){if(ce){var $;try{$=decodeURIComponent(s(ie)).replace(c,"").toLowerCase()}catch(Y){return null}if($.indexOf("javascript:")===0||$.indexOf("vbscript:")===0||$.indexOf("data:")===0)return null}re&&!o.test(ie)&&(ie=a(re,ie));try{ie=encodeURI(ie).replace(/%25/g,"%")}catch(Y){return null}return ie}var f={},i=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,t=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ce,re){f[" "+ce]||(i.test(ce)?f[" "+ce]=ce+"/":f[" "+ce]=e(ce,"/",!0)),ce=f[" "+ce];var ie=ce.indexOf(":")===-1;return re.substring(0,2)==="//"?ie?re:ce.replace(r,"$1")+re:re.charAt(0)==="/"?ie?re:ce.replace(t,"$1")+re:ce+re}var g={exec:function(){}};function h(ce){for(var re=1,ie,$;re<arguments.length;re++){ie=arguments[re];for($ in ie)Object.prototype.hasOwnProperty.call(ie,$)&&(ce[$]=ie[$])}return ce}function d(ce,re){var ie=ce.replace(/\|/g,function(V,ne,_e){for(var we=!1,Xe=ne;--Xe>=0&&_e[Xe]==="\\";)we=!we;return we?"|":" |"}),$=ie.split(/ \|/),Y=0;if($.length>re)$.splice(re);else for(;$.length<re;)$.push("");for(;Y<$.length;Y++)$[Y]=$[Y].trim().replace(/\\\|/g,"|");return $}function e(ce,re,ie){var $=ce.length;if($===0)return"";for(var Y=0;Y<$;){var V=ce.charAt($-Y-1);if(V===re&&!ie)Y++;else if(V!==re&&ie)Y++;else break}return ce.substr(0,$-Y)}function A(ce,re){if(ce.indexOf(re[1])===-1)return-1;for(var ie=ce.length,$=0,Y=0;Y<ie;Y++)if(ce[Y]==="\\")Y++;else if(ce[Y]===re[0])$++;else if(ce[Y]===re[1]&&($--,$<0))return Y;return-1}function M(ce){ce&&ce.sanitize&&!ce.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 F={escape:m,unescape:s,edit:y,cleanUrl:v,resolveUrl:a,noopTest:g,merge:h,splitCells:d,rtrim:e,findClosingBracket:A,checkSanitizeDeprecation:M},W=N.defaults,Z=F.rtrim,K=F.splitCells,J=F.escape,oe=F.findClosingBracket;function se(ce,re,ie){var $=re.href,Y=re.title?J(re.title):null,V=ce[1].replace(/\\([\[\]])/g,"$1");return ce[0].charAt(0)!=="!"?{type:"link",raw:ie,href:$,title:Y,text:V}:{type:"image",raw:ie,href:$,title:Y,text:J(V)}}function pe(ce,re){var ie=ce.match(/^(\s+)(?:```)/);if(ie===null)return re;var $=ie[1];return re.split(`
`).map(function(Y){var V=Y.match(/^\s+/);if(V===null)return Y;var ne=V[0];return ne.length>=$.length?Y.slice($.length):Y}).join(`
`)}var be=function(){function ce(ie){this.options=ie||W}var re=ce.prototype;return re.space=function($){var Y=this.rules.block.newline.exec($);if(Y)return Y[0].length>1?{type:"space",raw:Y[0]}:{raw:`
`}},re.code=function($,Y){var V=this.rules.block.code.exec($);if(V){var ne=Y[Y.length-1];if(ne&&ne.type==="paragraph")return{raw:V[0],text:V[0].trimRight()};var _e=V[0].replace(/^ {4}/gm,"");return{type:"code",raw:V[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:Z(_e,`
`)}}},re.fences=function($){var Y=this.rules.block.fences.exec($);if(Y){var V=Y[0],ne=pe(V,Y[3]||"");return{type:"code",raw:V,lang:Y[2]?Y[2].trim():Y[2],text:ne}}},re.heading=function($){var Y=this.rules.block.heading.exec($);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},re.nptable=function($){var Y=this.rules.block.nptable.exec($);if(Y){var V={type:"table",header:K(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[],raw:Y[0]};if(V.header.length===V.align.length){var ne=V.align.length,_e;for(_e=0;_e<ne;_e++)/^ *-+: *$/.test(V.align[_e])?V.align[_e]="right":/^ *:-+: *$/.test(V.align[_e])?V.align[_e]="center":/^ *:-+ *$/.test(V.align[_e])?V.align[_e]="left":V.align[_e]=null;for(ne=V.cells.length,_e=0;_e<ne;_e++)V.cells[_e]=K(V.cells[_e],V.header.length);return V}}},re.hr=function($){var Y=this.rules.block.hr.exec($);if(Y)return{type:"hr",raw:Y[0]}},re.blockquote=function($){var Y=this.rules.block.blockquote.exec($);if(Y){var V=Y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Y[0],text:V}}},re.list=function($){var Y=this.rules.block.list.exec($);if(Y){for(var V=Y[0],ne=Y[2],_e=ne.length>1,we=ne[ne.length-1]===")",Xe={type:"list",raw:V,ordered:_e,start:_e?+ne.slice(0,-1):"",loose:!1,items:[]},gt=Y[0].match(this.rules.block.item),Nt=!1,ht,en,tn,Dt,_n,fn,sn,Ln=gt.length,Wt=0;Wt<Ln;Wt++)ht=gt[Wt],V=ht,en=ht.length,ht=ht.replace(/^ *([*+-]|\d+[.)]) */,""),~ht.indexOf(`
`)&&(en-=ht.length,ht=this.options.pedantic?ht.replace(/^ {1,4}/gm,""):ht.replace(new RegExp("^ {1,"+en+"}","gm"),"")),Wt!==Ln-1&&(tn=this.rules.block.bullet.exec(gt[Wt+1])[0],(_e?tn.length===1||!we&&tn[tn.length-1]===")":tn.length>1||this.options.smartLists&&tn!==ne)&&(Dt=gt.slice(Wt+1).join(`
`),Xe.raw=Xe.raw.substring(0,Xe.raw.length-Dt.length),Wt=Ln-1)),_n=Nt||/\n\n(?!\s*$)/.test(ht),Wt!==Ln-1&&(Nt=ht.charAt(ht.length-1)===`
`,_n||(_n=Nt)),_n&&(Xe.loose=!0),fn=/^\[[ xX]\] /.test(ht),sn=void 0,fn&&(sn=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),Xe.items.push({type:"list_item",raw:V,task:fn,checked:sn,loose:_n,text:ht});return Xe}},re.html=function($){var Y=this.rules.block.html.exec($);if(Y)return{type:this.options.sanitize?"paragraph":"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):J(Y[0]):Y[0]}},re.def=function($){var Y=this.rules.block.def.exec($);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var V=Y[1].toLowerCase().replace(/\s+/g," ");return{tag:V,raw:Y[0],href:Y[2],title:Y[3]}}},re.table=function($){var Y=this.rules.block.table.exec($);if(Y){var V={type:"table",header:K(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[]};if(V.header.length===V.align.length){V.raw=Y[0];var ne=V.align.length,_e;for(_e=0;_e<ne;_e++)/^ *-+: *$/.test(V.align[_e])?V.align[_e]="right":/^ *:-+: *$/.test(V.align[_e])?V.align[_e]="center":/^ *:-+ *$/.test(V.align[_e])?V.align[_e]="left":V.align[_e]=null;for(ne=V.cells.length,_e=0;_e<ne;_e++)V.cells[_e]=K(V.cells[_e].replace(/^ *\| *| *\| *$/g,""),V.header.length);return V}}},re.lheading=function($){var Y=this.rules.block.lheading.exec($);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1]}},re.paragraph=function($){var Y=this.rules.block.paragraph.exec($);if(Y)return{type:"paragraph",raw:Y[0],text:Y[1].charAt(Y[1].length-1)===`
`?Y[1].slice(0,-1):Y[1]}},re.text=function($,Y){var V=this.rules.block.text.exec($);if(V){var ne=Y[Y.length-1];return ne&&ne.type==="text"?{raw:V[0],text:V[0]}:{type:"text",raw:V[0],text:V[0]}}},re.escape=function($){var Y=this.rules.inline.escape.exec($);if(Y)return{type:"escape",raw:Y[0],text:J(Y[1])}},re.tag=function($,Y,V){var ne=this.rules.inline.tag.exec($);if(ne)return!Y&&/^<a /i.test(ne[0])?Y=!0:Y&&/^<\/a>/i.test(ne[0])&&(Y=!1),!V&&/^<(pre|code|kbd|script)(\s|>)/i.test(ne[0])?V=!0:V&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ne[0])&&(V=!1),{type:this.options.sanitize?"text":"html",raw:ne[0],inLink:Y,inRawBlock:V,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):J(ne[0]):ne[0]}},re.link=function($){var Y=this.rules.inline.link.exec($);if(Y){var V=oe(Y[2],"()");if(V>-1){var ne=Y[0].indexOf("!")===0?5:4,_e=ne+Y[1].length+V;Y[2]=Y[2].substring(0,V),Y[0]=Y[0].substring(0,_e).trim(),Y[3]=""}var we=Y[2],Xe="";if(this.options.pedantic){var gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);gt?(we=gt[1],Xe=gt[3]):Xe=""}else Xe=Y[3]?Y[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var Nt=se(Y,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},Y[0]);return Nt}},re.reflink=function($,Y){var V;if((V=this.rules.inline.reflink.exec($))||(V=this.rules.inline.nolink.exec($))){var ne=(V[2]||V[1]).replace(/\s+/g," ");if(ne=Y[ne.toLowerCase()],!ne||!ne.href){var _e=V[0].charAt(0);return{type:"text",raw:_e,text:_e}}var we=se(V,ne,V[0]);return we}},re.strong=function($,Y,V){V===void 0&&(V="");var ne=this.rules.inline.strong.start.exec($);if(ne&&(!ne[1]||ne[1]&&(V===""||this.rules.inline.punctuation.exec(V)))){Y=Y.slice(-1*$.length);var _e=ne[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var we;(ne=_e.exec(Y))!=null;)if(we=this.rules.inline.strong.middle.exec(Y.slice(0,ne.index+3)),we)return{type:"strong",raw:$.slice(0,we[0].length),text:$.slice(2,we[0].length-2)}}},re.em=function($,Y,V){V===void 0&&(V="");var ne=this.rules.inline.em.start.exec($);if(ne&&(!ne[1]||ne[1]&&(V===""||this.rules.inline.punctuation.exec(V)))){Y=Y.slice(-1*$.length);var _e=ne[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var we;(ne=_e.exec(Y))!=null;)if(we=this.rules.inline.em.middle.exec(Y.slice(0,ne.index+2)),we)return{type:"em",raw:$.slice(0,we[0].length),text:$.slice(1,we[0].length-1)}}},re.codespan=function($){var Y=this.rules.inline.code.exec($);if(Y){var V=Y[2].replace(/\n/g," "),ne=/[^ ]/.test(V),_e=V.startsWith(" ")&&V.endsWith(" ");return ne&&_e&&(V=V.substring(1,V.length-1)),V=J(V,!0),{type:"codespan",raw:Y[0],text:V}}},re.br=function($){var Y=this.rules.inline.br.exec($);if(Y)return{type:"br",raw:Y[0]}},re.del=function($){var Y=this.rules.inline.del.exec($);if(Y)return{type:"del",raw:Y[0],text:Y[1]}},re.autolink=function($,Y){var V=this.rules.inline.autolink.exec($);if(V){var ne,_e;return V[2]==="@"?(ne=J(this.options.mangle?Y(V[1]):V[1]),_e="mailto:"+ne):(ne=J(V[1]),_e=ne),{type:"link",raw:V[0],text:ne,href:_e,tokens:[{type:"text",raw:ne,text:ne}]}}},re.url=function($,Y){var V;if(V=this.rules.inline.url.exec($)){var ne,_e;if(V[2]==="@")ne=J(this.options.mangle?Y(V[0]):V[0]),_e="mailto:"+ne;else{var we;do we=V[0],V[0]=this.rules.inline._backpedal.exec(V[0])[0];while(we!==V[0]);ne=J(V[0]),V[1]==="www."?_e="http://"+ne:_e=ne}return{type:"link",raw:V[0],text:ne,href:_e,tokens:[{type:"text",raw:ne,text:ne}]}}},re.inlineText=function($,Y,V){var ne=this.rules.inline.text.exec($);if(ne){var _e;return Y?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):J(ne[0]):ne[0]:_e=J(this.options.smartypants?V(ne[0]):ne[0]),{type:"text",raw:ne[0],text:_e}}},ce}(),Q=F.noopTest,te=F.edit,ve=F.merge,q={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:Q,table:Q,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};q._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,q._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,q.def=te(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}[.)])/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,q.item=te(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.list=te(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._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",q._comment=/<!--(?!-?>)[\s\S]*?-->/,q.html=te(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=te(q._paragraph).replace("hr",q.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",q._tag).getRegex(),q.blockquote=te(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=ve({},q),q.gfm=ve({},q.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*|$)"}),q.gfm.nptable=te(q.gfm.nptable).replace("hr",q.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",q._tag).getRegex(),q.gfm.table=te(q.gfm.table).replace("hr",q.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",q._tag).getRegex(),q.pedantic=ve({},q.normal,{html:te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",q._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:Q,paragraph:te(q.normal._paragraph).replace("hr",q.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Q,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:Q,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=te(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=te(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=te(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=te(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=te(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=te(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=te(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=te(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=te(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=te(X._blockSkip,"g").getRegex(),X.overlapSkip=te(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=te(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=te(X.tag).replace("comment",q._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=te(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=te(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=te(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=ve({},X),X.pedantic=ve({},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:te(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=ve({},X.normal,{escape:te(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=te(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=ve({},X.gfm,{br:te(X.br).replace("{2,}","*").getRegex(),text:te(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Te={block:q,inline:X},Ie=N.defaults,Ge=Te.block,Ae=Te.inline;function Me(ce){return ce.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 Se(ce){var re="",ie,$,Y=ce.length;for(ie=0;ie<Y;ie++)$=ce.charCodeAt(ie),Math.random()>.5&&($="x"+$.toString(16)),re+="&#"+$+";";return re}var Le=function(){function ce(ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=ie||Ie,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var $={block:Ge.normal,inline:Ae.normal};this.options.pedantic?($.block=Ge.pedantic,$.inline=Ae.pedantic):this.options.gfm&&($.block=Ge.gfm,this.options.breaks?$.inline=Ae.breaks:$.inline=Ae.gfm),this.tokenizer.rules=$}ce.lex=function($,Y){var V=new ce(Y);return V.lex($)};var re=ce.prototype;return re.lex=function($){return $=$.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens($,this.tokens,!0),this.inline(this.tokens),this.tokens},re.blockTokens=function($,Y,V){Y===void 0&&(Y=[]),V===void 0&&(V=!0),$=$.replace(/^ +$/gm,"");for(var ne,_e,we,Xe;$;){if(ne=this.tokenizer.space($)){$=$.substring(ne.raw.length),ne.type&&Y.push(ne);continue}if(ne=this.tokenizer.code($,Y)){$=$.substring(ne.raw.length),ne.type?Y.push(ne):(Xe=Y[Y.length-1],Xe.raw+=`
`+ne.raw,Xe.text+=`
`+ne.text);continue}if(ne=this.tokenizer.fences($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(ne=this.tokenizer.heading($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(ne=this.tokenizer.nptable($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(ne=this.tokenizer.hr($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(ne=this.tokenizer.blockquote($)){$=$.substring(ne.raw.length),ne.tokens=this.blockTokens(ne.text,[],V),Y.push(ne);continue}if(ne=this.tokenizer.list($)){for($=$.substring(ne.raw.length),we=ne.items.length,_e=0;_e<we;_e++)ne.items[_e].tokens=this.blockTokens(ne.items[_e].text,[],!1);Y.push(ne);continue}if(ne=this.tokenizer.html($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(V&&(ne=this.tokenizer.def($))){$=$.substring(ne.raw.length),this.tokens.links[ne.tag]||(this.tokens.links[ne.tag]={href:ne.href,title:ne.title});continue}if(ne=this.tokenizer.table($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(ne=this.tokenizer.lheading($)){$=$.substring(ne.raw.length),Y.push(ne);continue}if(V&&(ne=this.tokenizer.paragraph($))){$=$.substring(ne.raw.length),Y.push(ne);continue}if(ne=this.tokenizer.text($,Y)){$=$.substring(ne.raw.length),ne.type?Y.push(ne):(Xe=Y[Y.length-1],Xe.raw+=`
`+ne.raw,Xe.text+=`
`+ne.text);continue}if($){var gt="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(gt);break}else throw new Error(gt)}}return Y},re.inline=function($){var Y,V,ne,_e,we,Xe,gt=$.length;for(Y=0;Y<gt;Y++){Xe=$[Y];switch(Xe.type){case"paragraph":case"text":case"heading":{Xe.tokens=[],this.inlineTokens(Xe.text,Xe.tokens);break}case"table":{for(Xe.tokens={header:[],cells:[]},_e=Xe.header.length,V=0;V<_e;V++)Xe.tokens.header[V]=[],this.inlineTokens(Xe.header[V],Xe.tokens.header[V]);for(_e=Xe.cells.length,V=0;V<_e;V++)for(we=Xe.cells[V],Xe.tokens.cells[V]=[],ne=0;ne<we.length;ne++)Xe.tokens.cells[V][ne]=[],this.inlineTokens(we[ne],Xe.tokens.cells[V][ne]);break}case"blockquote":{this.inline(Xe.tokens);break}case"list":{for(_e=Xe.items.length,V=0;V<_e;V++)this.inline(Xe.items[V].tokens);break}}}return $},re.inlineTokens=function($,Y,V,ne,_e){Y===void 0&&(Y=[]),V===void 0&&(V=!1),ne===void 0&&(ne=!1),_e===void 0&&(_e="");var we,Xe=$,gt;if(this.tokens.links){var Nt=Object.keys(this.tokens.links);if(Nt.length>0)for(;(gt=this.tokenizer.rules.inline.reflinkSearch.exec(Xe))!=null;)Nt.includes(gt[0].slice(gt[0].lastIndexOf("[")+1,-1))&&(Xe=Xe.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(gt=this.tokenizer.rules.inline.blockSkip.exec(Xe))!=null;)Xe=Xe.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;$;){if(we=this.tokenizer.escape($)){$=$.substring(we.raw.length),Y.push(we);continue}if(we=this.tokenizer.tag($,V,ne)){$=$.substring(we.raw.length),V=we.inLink,ne=we.inRawBlock,Y.push(we);continue}if(we=this.tokenizer.link($)){$=$.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ne)),Y.push(we);continue}if(we=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ne)),Y.push(we);continue}if(we=this.tokenizer.strong($,Xe,_e)){$=$.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],V,ne),Y.push(we);continue}if(we=this.tokenizer.em($,Xe,_e)){$=$.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],V,ne),Y.push(we);continue}if(we=this.tokenizer.codespan($)){$=$.substring(we.raw.length),Y.push(we);continue}if(we=this.tokenizer.br($)){$=$.substring(we.raw.length),Y.push(we);continue}if(we=this.tokenizer.del($)){$=$.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],V,ne),Y.push(we);continue}if(we=this.tokenizer.autolink($,Se)){$=$.substring(we.raw.length),Y.push(we);continue}if(!V&&(we=this.tokenizer.url($,Se))){$=$.substring(we.raw.length),Y.push(we);continue}if(we=this.tokenizer.inlineText($,ne,Me)){$=$.substring(we.raw.length),_e=we.raw.slice(-1),Y.push(we);continue}if($){var ht="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return Y},B(ce,null,[{key:"rules",get:function(){return{block:Ge,inline:Ae}}}]),ce}(),Ve=N.defaults,$e=F.cleanUrl,Qe=F.escape,Be=function(){function ce(ie){this.options=ie||Ve}var re=ce.prototype;return re.code=function($,Y,V){var ne=(Y||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight($,ne);_e!=null&&_e!==$&&(V=!0,$=_e)}return ne?'<pre><code class="'+this.options.langPrefix+Qe(ne,!0)+'">'+(V?$:Qe($,!0))+`</code></pre>
`:"<pre><code>"+(V?$:Qe($,!0))+`</code></pre>
`},re.blockquote=function($){return`<blockquote>
`+$+`</blockquote>
`},re.html=function($){return $},re.heading=function($,Y,V,ne){return this.options.headerIds?"<h"+Y+' id="'+this.options.headerPrefix+ne.slug(V)+'">'+$+"</h"+Y+`>
`:"<h"+Y+">"+$+"</h"+Y+`>
`},re.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},re.list=function($,Y,V){var ne=Y?"ol":"ul",_e=Y&&V!==1?' start="'+V+'"':"";return"<"+ne+_e+`>
`+$+"</"+ne+`>
`},re.listitem=function($){return"<li>"+$+`</li>
`},re.checkbox=function($){return"<input "+($?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},re.paragraph=function($){return"<p>"+$+`</p>
`},re.table=function($,Y){return Y&&(Y="<tbody>"+Y+"</tbody>"),`<table>
<thead>
`+$+`</thead>
`+Y+`</table>
`},re.tablerow=function($){return`<tr>
`+$+`</tr>
`},re.tablecell=function($,Y){var V=Y.header?"th":"td",ne=Y.align?"<"+V+' align="'+Y.align+'">':"<"+V+">";return ne+$+"</"+V+`>
`},re.strong=function($){return"<strong>"+$+"</strong>"},re.em=function($){return"<em>"+$+"</em>"},re.codespan=function($){return"<code>"+$+"</code>"},re.br=function(){return this.options.xhtml?"<br/>":"<br>"},re.del=function($){return"<del>"+$+"</del>"},re.link=function($,Y,V){if($=$e(this.options.sanitize,this.options.baseUrl,$),$===null)return V;var ne='<a href="'+Qe($)+'"';return Y&&(ne+=' title="'+Y+'"'),ne+=">"+V+"</a>",ne},re.image=function($,Y,V){if($=$e(this.options.sanitize,this.options.baseUrl,$),$===null)return V;var ne='<img src="'+$+'" alt="'+V+'"';return Y&&(ne+=' title="'+Y+'"'),ne+=this.options.xhtml?"/>":">",ne},re.text=function($){return $},ce}(),ze=function(){function ce(){}var re=ce.prototype;return re.strong=function($){return $},re.em=function($){return $},re.codespan=function($){return $},re.del=function($){return $},re.html=function($){return $},re.text=function($){return $},re.link=function($,Y,V){return""+V},re.image=function($,Y,V){return""+V},re.br=function(){return""},ce}(),ot=function(){function ce(){this.seen={}}var re=ce.prototype;return re.slug=function($){var Y=$.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Y)){var V=Y;do this.seen[V]++,Y=V+"-"+this.seen[V];while(this.seen.hasOwnProperty(Y))}return this.seen[Y]=0,Y},ce}(),Re=N.defaults,nt=F.unescape,rt=function(){function ce(ie){this.options=ie||Re,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ze,this.slugger=new ot}ce.parse=function($,Y){var V=new ce(Y);return V.parse($)};var re=ce.prototype;return re.parse=function($,Y){Y===void 0&&(Y=!0);var V="",ne,_e,we,Xe,gt,Nt,ht,en,tn,Dt,_n,fn,sn,Ln,Wt,yn,xn,pt,zn=$.length;for(ne=0;ne<zn;ne++){Dt=$[ne];switch(Dt.type){case"space":continue;case"hr":{V+=this.renderer.hr();continue}case"heading":{V+=this.renderer.heading(this.parseInline(Dt.tokens),Dt.depth,nt(this.parseInline(Dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{V+=this.renderer.code(Dt.text,Dt.lang,Dt.escaped);continue}case"table":{for(en="",ht="",Xe=Dt.header.length,_e=0;_e<Xe;_e++)ht+=this.renderer.tablecell(this.parseInline(Dt.tokens.header[_e]),{header:!0,align:Dt.align[_e]});for(en+=this.renderer.tablerow(ht),tn="",Xe=Dt.cells.length,_e=0;_e<Xe;_e++){for(Nt=Dt.tokens.cells[_e],ht="",gt=Nt.length,we=0;we<gt;we++)ht+=this.renderer.tablecell(this.parseInline(Nt[we]),{header:!1,align:Dt.align[we]});tn+=this.renderer.tablerow(ht)}V+=this.renderer.table(en,tn);continue}case"blockquote":{tn=this.parse(Dt.tokens),V+=this.renderer.blockquote(tn);continue}case"list":{for(_n=Dt.ordered,fn=Dt.start,sn=Dt.loose,Xe=Dt.items.length,tn="",_e=0;_e<Xe;_e++)Wt=Dt.items[_e],yn=Wt.checked,xn=Wt.task,Ln="",Wt.task&&(pt=this.renderer.checkbox(yn),sn?Wt.tokens.length>0&&Wt.tokens[0].type==="text"?(Wt.tokens[0].text=pt+" "+Wt.tokens[0].text,Wt.tokens[0].tokens&&Wt.tokens[0].tokens.length>0&&Wt.tokens[0].tokens[0].type==="text"&&(Wt.tokens[0].tokens[0].text=pt+" "+Wt.tokens[0].tokens[0].text)):Wt.tokens.unshift({type:"text",text:pt}):Ln+=pt),Ln+=this.parse(Wt.tokens,sn),tn+=this.renderer.listitem(Ln,xn,yn);V+=this.renderer.list(tn,_n,fn);continue}case"html":{V+=this.renderer.html(Dt.text);continue}case"paragraph":{V+=this.renderer.paragraph(this.parseInline(Dt.tokens));continue}case"text":{for(tn=Dt.tokens?this.parseInline(Dt.tokens):Dt.text;ne+1<zn&&$[ne+1].type==="text";)Dt=$[++ne],tn+=`
`+(Dt.tokens?this.parseInline(Dt.tokens):Dt.text);V+=Y?this.renderer.paragraph(tn):tn;continue}default:{var Cn='Token with "'+Dt.type+'" type was not found.';if(this.options.silent){console.error(Cn);return}else throw new Error(Cn)}}}return V},re.parseInline=function($,Y){Y=Y||this.renderer;var V="",ne,_e,we=$.length;for(ne=0;ne<we;ne++){_e=$[ne];switch(_e.type){case"escape":{V+=Y.text(_e.text);break}case"html":{V+=Y.html(_e.text);break}case"link":{V+=Y.link(_e.href,_e.title,this.parseInline(_e.tokens,Y));break}case"image":{V+=Y.image(_e.href,_e.title,_e.text);break}case"strong":{V+=Y.strong(this.parseInline(_e.tokens,Y));break}case"em":{V+=Y.em(this.parseInline(_e.tokens,Y));break}case"codespan":{V+=Y.codespan(_e.text);break}case"br":{V+=Y.br();break}case"del":{V+=Y.del(this.parseInline(_e.tokens,Y));break}case"text":{V+=Y.text(_e.text);break}default:{var Xe='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(Xe);return}else throw new Error(Xe)}}}return V},ce}(),lt=F.merge,bt=F.checkSanitizeDeprecation,Ee=F.escape,Oe=N.getDefaults,je=N.changeDefaults,Ye=N.defaults;function De(ce,re,ie){if(typeof ce=="undefined"||ce===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ce!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ce)+", string expected");if(typeof re=="function"&&(ie=re,re=null),re=lt({},De.defaults,re||{}),bt(re),ie){var $=re.highlight,Y;try{Y=Le.lex(ce,re)}catch(we){return ie(we)}var V=function(Xe){var gt;if(!Xe)try{gt=rt.parse(Y,re)}catch(Nt){Xe=Nt}return re.highlight=$,Xe?ie(Xe):ie(null,gt)};if(!$||$.length<3)return V();if(delete re.highlight,!Y.length)return V();var ne=0;De.walkTokens(Y,function(we){we.type==="code"&&(ne++,setTimeout(function(){$(we.text,we.lang,function(Xe,gt){if(Xe)return V(Xe);gt!=null&&gt!==we.text&&(we.text=gt,we.escaped=!0),ne--,ne===0&&V()})},0))}),ne===0&&V();return}try{var _e=Le.lex(ce,re);return re.walkTokens&&De.walkTokens(_e,re.walkTokens),rt.parse(_e,re)}catch(we){if(we.message+=`
Please report this to https://github.com/markedjs/marked.`,re.silent)return"<p>An error occurred:</p><pre>"+Ee(we.message+"",!0)+"</pre>";throw we}}De.options=De.setOptions=function(ce){return lt(De.defaults,ce),je(De.defaults),De},De.getDefaults=Oe,De.defaults=Ye,De.use=function(ce){var re=lt({},ce);if(ce.renderer&&function(){var $=De.defaults.renderer||new Be,Y=function(_e){var we=$[_e];$[_e]=function(){for(var Xe=arguments.length,gt=new Array(Xe),Nt=0;Nt<Xe;Nt++)gt[Nt]=arguments[Nt];var ht=ce.renderer[_e].apply($,gt);return ht===!1&&(ht=we.apply($,gt)),ht}};for(var V in ce.renderer)Y(V);re.renderer=$}(),ce.tokenizer&&function(){var $=De.defaults.tokenizer||new be,Y=function(_e){var we=$[_e];$[_e]=function(){for(var Xe=arguments.length,gt=new Array(Xe),Nt=0;Nt<Xe;Nt++)gt[Nt]=arguments[Nt];var ht=ce.tokenizer[_e].apply($,gt);return ht===!1&&(ht=we.apply($,gt)),ht}};for(var V in ce.tokenizer)Y(V);re.tokenizer=$}(),ce.walkTokens){var ie=De.defaults.walkTokens;re.walkTokens=function($){ce.walkTokens($),ie&&ie($)}}De.setOptions(re)},De.walkTokens=function(ce,re){for(var ie=_(ce),$;!($=ie()).done;){var Y=$.value;re(Y);switch(Y.type){case"table":{for(var V=_(Y.tokens.header),ne;!(ne=V()).done;){var _e=ne.value;De.walkTokens(_e,re)}for(var we=_(Y.tokens.cells),Xe;!(Xe=we()).done;)for(var gt=Xe.value,Nt=_(gt),ht;!(ht=Nt()).done;){var en=ht.value;De.walkTokens(en,re)}break}case"list":{De.walkTokens(Y.items,re);break}default:Y.tokens&&De.walkTokens(Y.tokens,re)}}},De.Parser=rt,De.parser=rt.parse,De.Renderer=Be,De.TextRenderer=ze,De.Lexer=Le,De.lexer=Le.lex,De.Tokenizer=be,De.Slugger=ot,De.parse=De;var Ke=De;return Ke})},FOrL:function(Ct,Fe,j){Ct.exports=j.p+"static/nodata.a6b3f948.png"},IBYe:function(Ct,Fe,j){"use strict";function he(B){return null}Fe.a=he},IPdS:function(Ct,Fe,j){Ct.exports={drawerWrap:"drawerWrap___nRvfD",title:"title___e_1lX",problemset:"problemset___1u9oP",content:"content___1WwQ5",delete:"delete___3Q7nc",deleteIcon:"deleteIcon___ObOyh",previewWrap:"previewWrap___25lTY",preview:"preview___3uiyE"}},JUtD:function(Ct,Fe,j){"use strict";j.r(Fe);var he=j("DjyN"),B=j("NUBc"),w=j("T2oS"),U=j("W9HT"),_=j("qVdP"),x=j("jsC+"),N=j("k1fw"),I=j("+L6B"),S=j("2/Rp"),P=j("5Dmo"),E=j("3S7+"),O=j("lUTK"),R=j("BvKs"),T=j("oBTY"),C=j("sRBo"),b=j("kaz8"),m=j("miYZ"),n=j("tsqr"),s=j("7Kak"),l=j("9yH6"),y=j("2qtc"),c=j("kLXV"),o=j("9og8"),v=j("tJVT"),f=j("PpiC"),i=j("5NDa"),r=j("5rEg"),t=j("Znn+"),a=j("ZTPi"),g=j("WmNS"),h=j.n(g),d=j("q1tI"),e=j.n(d),A=j("9kvl"),M=j("iris"),F=j("x9r5"),W=j("d5o6"),Z=j.n(W),K=j("P/tu"),J=j("WCUW"),oe=function(ke){var ut=ke.problemset,Je=ke.dispatch,et=ke.onOk,Xt=Object(d.useState)(""),Ht=Object(v.a)(Xt,2),Ut=Ht[0],xt=Ht[1],zt=Object(d.useState)([0]),ft=Object(v.a)(zt,2),Et=ft[0],vt=ft[1],Lt=function(){Je({type:"problemset/setActionTabs",payload:{}})};Object(d.useEffect)(function(){if(ut.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var dt,Mt;vt([(dt=ut.actionTabs)===null||dt===void 0||((Mt=dt.params)===null||Mt===void 0)?void 0:Mt.group_id]),xt("")}},[ut.actionTabs.key]);var mt=function(){var dt=Object(o.a)(h.a.mark(function Mt(){var $t,rn,de;return h.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if($t=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Ut.trim()){Pt.next=4;break}return n.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Pt.abrupt("return");case 4:if(!(Ut.charAt(0)===" ")){Pt.next=7;break}return n.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Pt.abrupt("return");case 7:rn=0;case 8:if(!(rn<Ut.length)){Pt.next=15;break}if(!$t.includes(Ut.charAt(rn))){Pt.next=12;break}return n.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Pt.abrupt("return",!1);case 12:rn++,Pt.next=8;break;case 15:return Pt.next=17,Object(J.o)({parent_id:Et.length>0?Et[0]:0,name:Ut});case 17:de=Pt.sent,de.status===0&&(Lt(),et(de==null?void 0:de.id));case 19:case"end":return Pt.stop()}},Mt)}));return function(){return dt.apply(this,arguments)}}();return e.a.createElement(c.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:ut.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:Lt,onOk:mt,destroyOnClose:!0},e.a.createElement("div",{className:Z.a.addModal},e.a.createElement("div",{className:Z.a.row},e.a.createElement("span",{className:Z.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),e.a.createElement(r.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:Ut,onChange:function(Mt){return xt(Mt.target.value)}})),e.a.createElement("div",{className:Z.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},e.a.createElement("span",{className:Z.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),e.a.createElement(K.a,{value:Et,onChange:function(Mt){return vt(Mt)}}))))},se=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(oe),pe=j("BdwD"),be=j("iNYN"),Q=j.n(be),te=function(ke){var ut=ke.problemset,Je=ke.globalSetting,et=ke.loading,Xt=ke.dispatch,Ht=Object(f.a)(ke,["problemset","globalSetting","loading","dispatch"]);return e.a.createElement(c.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:ut.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){Xt({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){Xt({type:"problemset/setActionTabs",payload:{}})}},e.a.createElement("div",{className:Q.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),e.a.createElement("div",{className:Q.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},ve=Object(A.a)(function(Bt){var ke=Bt.problemset,ut=Bt.loading,Je=Bt.globalSetting;return{problemset:ke,globalSetting:Je,loading:ut.effects}})(te),q=j("xlxt"),X=j.n(q),Te=j("mgmH"),Ie=function(ke){var ut=ke.problemset,Je=ke.dispatch,et=Object(d.useState)([]),Xt=Object(v.a)(et,2),Ht=Xt[0],Ut=Xt[1],xt=function(){Je({type:"problemset/setActionTabs",payload:{}})};Object(d.useEffect)(function(){if(ut.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var ft,Et;Ut([(ft=ut.actionTabs)===null||ft===void 0||((Et=ft.params)===null||Et===void 0)?void 0:Et.group_id])}},[ut.actionTabs.key]);var zt=function(){if(Ht.length===0){n.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}Object(Te.k)({group_id:Ht[0]}),xt()};return e.a.createElement(c.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:ut.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:X.a.customModal,onCancel:xt,onOk:zt},e.a.createElement("aside",{className:X.a.exportModal},e.a.createElement(K.a,{value:Ht,onChange:function(Et){return Ut(Et)}})))},Ge=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(Ie),Ae=j("i8i3"),Me=j.n(Ae),Se=j("Ty5D"),Le=function(ke){var ut,Je,et=ke.problemset,Xt=ke.dispatch,Ht=ke.onOk,Ut=Object(Se.i)(),xt=Object(d.useState)([]),zt=Object(v.a)(xt,2),ft=zt[0],Et=zt[1],vt=Object(d.useState)(1),Lt=Object(v.a)(vt,2),mt=Lt[0],dt=Lt[1],Mt=Object(d.useState)([]),$t=Object(v.a)(Mt,2),rn=$t[0],de=$t[1],on=Object(d.useState)([]),Pt=Object(v.a)(on,2),At=Pt[0],yt=Pt[1],_t=Object(d.useState)(!0),jt=Object(v.a)(_t,2),Gt=jt[0],kt=jt[1],gn=Object(d.useState)(!1),Vt=Object(v.a)(gn,2),dn=Vt[0],Kn=Vt[1],Cr=Object(d.useState)(!1),Mr=Object(v.a)(Cr,2),St=Mr[0],Xn=Mr[1];Object(d.useEffect)(function(){if(et.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var Dn,Qn;Tn(),de([(Dn=et.actionTabs)===null||Dn===void 0||((Qn=Dn.params)===null||Qn===void 0)?void 0:Qn.group_id])}},[et.actionTabs.key]);var Tn=function(){var Dn=Object(o.a)(h.a.mark(function Qn(){var Vn,Ar,Wn;return h.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return kt(!0),mr.next=3,Object(J.x)({type:0,page:1,per_page:10,order_by:"new"});case 3:Vn=mr.sent,Vn!=null&&Vn.item_banks_group&&(Ar={id:-1,item_banks_count:(Vn==null?void 0:Vn.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},Wn=[Ar].concat((Vn==null?void 0:Vn.item_banks_group)||[]),Et(Wn)),kt(!1);case 6:case"end":return mr.stop()}},Qn)}));return function(){return Dn.apply(this,arguments)}}(),rr=function(){Xt({type:"problemset/setActionTabs",payload:{}})},ar=function(){var Dn=Object(o.a)(h.a.mark(function Qn(){var Vn;return h.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:if(!(rn.length===0)){Wn.next=3;break}return n.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),Wn.abrupt("return");case 3:if(!(mt===1)){Wn.next=6;break}return dt(2),Wn.abrupt("return");case 6:return Kn(!0),Wn.next=9,Object(J.k)({item_banks_group_ids:rn,clazz:"ItemBank",group_ids:At});case 9:Vn=Wn.sent,(Vn==null?void 0:Vn.status)===0&&(Ht(),rr()),Kn(!1);case 12:case"end":return Wn.stop()}},Qn)}));return function(){return Dn.apply(this,arguments)}}(),dr=function(Qn){de(Qn),Xn(Qn.length===ft.length)};return e.a.createElement(c.a,{centered:!0,afterClose:function(){yt([]),dt(1),Xn(!1),Et([])},title:"\u5171\u4EAB\u8BD5\u9898".concat(mt,"/2"),visible:et.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:Me.a.customModal,onCancel:rr},e.a.createElement("aside",{className:Me.a.shareModal},e.a.createElement(U.a,{spinning:Gt},e.a.createElement("div",{className:Me.a.content},mt===1&&e.a.createElement("div",{className:Me.a.group},e.a.createElement(K.a,{value:rn,onChange:function(Qn){return de(Qn)}})),mt===2&&e.a.createElement("div",{className:Me.a.teachGroup},e.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),e.a.createElement(b.a.Group,{value:At,onChange:function(Qn){return yt(Qn)}},et==null||((ut=et.teachGroupData)===null||ut===void 0||((Je=ut.groups)===null||Je===void 0))?void 0:Je.map(function(Dn){return e.a.createElement(b.a,{key:Dn.group_id,value:Dn.group_id},Dn==null?void 0:Dn.name)})))),e.a.createElement("div",{className:Me.a.footer},e.a.createElement(S.a,{onClick:rr},"\u53D6\u6D88"),e.a.createElement(S.a,{loading:dn,onClick:ar,type:"primary"},mt===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},Ve=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(Le),$e=function(ke){var ut=ke.problemset,Je=ke.globalSetting,et=ke.loading,Xt=ke.dispatch,Ht=ke.onReloadData,Ut=Ht===void 0?function(){}:Ht,xt=Object(f.a)(ke,["problemset","globalSetting","loading","dispatch","onReloadData"]),zt=Object(d.useRef)(!1),ft=Object(d.useState)(!1),Et=Object(v.a)(ft,2),vt=Et[0],Lt=Et[1];Object(d.useEffect)(function(){ut.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?mt():Lt(!0):Lt(!1)},[ut.actionTabs.key]);var mt=function(){var dt=Object(o.a)(h.a.mark(function Mt(){var $t;return h.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return zt.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),de.next=3,Xt({type:"problemset/setPrivate",payload:ut.actionTabs.params});case 3:$t=de.sent,Xt({type:"problemset/setActionTabs",payload:{}}),zt.current=!1,$t.status===0&&Ut();case 7:case"end":return de.stop()}},Mt)}));return function(){return dt.apply(this,arguments)}}();return e.a.createElement(c.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:vt,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:et["problemset/setPrivate"],width:"442px",onOk:mt,onCancel:function(){Xt({type:"problemset/setActionTabs",payload:{}}),zt.current=!1}},e.a.createElement("div",{className:Q.a.modalContentLeft},"\u672C\u9898\u5DF2\u516C\u5F00\uFF0C\u64A4\u9500\u516C\u5F00\u53EF\u80FD\u5BFC\u81F4\u90E8\u5206\u7528\u6237\u5BF9\u672C\u9898\u7684\u4F7F\u7528\u53D7\u635F\u3002"),e.a.createElement("div",{className:Q.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),e.a.createElement("div",null,e.a.createElement(b.a,{className:"mt10",defaultChecked:!1,onChange:function(Mt){return zt.current=Mt.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},Qe=Object(A.a)(function(Bt){var ke=Bt.problemset,ut=Bt.loading,Je=Bt.globalSetting;return{problemset:ke,globalSetting:Je,loading:ut.effects}})($e),Be=function(ke){var ut=ke.problemset,Je=ke.globalSetting,et=ke.loading,Xt=ke.dispatch,Ht=ke.onReloadData,Ut=Ht===void 0?function(){}:Ht,xt=Object(f.a)(ke,["problemset","globalSetting","loading","dispatch","onReloadData"]),zt=function(){var ft=Object(o.a)(h.a.mark(function Et(){var vt;return h.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Xt({type:"problemset/handleDelete",payload:ut.actionTabs.params});case 2:vt=mt.sent,Xt({type:"problemset/setActionTabs",payload:{}}),vt.status===0&&Ut();case 5:case"end":return mt.stop()}},Et)}));return function(){return ft.apply(this,arguments)}}();return e.a.createElement(c.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:ut.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:et["problemset/handleDelete"],width:"442px",onOk:zt,onCancel:function(){Xt({type:"problemset/setActionTabs",payload:{}})}},e.a.createElement("div",{className:Q.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),e.a.createElement("div",{className:Q.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},ze=Object(A.a)(function(Bt){var ke=Bt.problemset,ut=Bt.loading,Je=Bt.globalSetting;return{problemset:ke,globalSetting:Je,loading:ut.effects}})(Be),ot=j("LvDl"),Re=j("9Bee"),nt=function(ke){var ut,Je=ke.problemset,et=ke.dispatch,Xt=Object(d.useState)({}),Ht=Object(v.a)(Xt,2),Ut=Ht[0],xt=Ht[1],zt=Object(d.useState)([]),ft=Object(v.a)(zt,2),Et=ft[0],vt=ft[1],Lt=Object(d.useState)(!1),mt=Object(v.a)(Lt,2),dt=mt[0],Mt=mt[1],$t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(d.useEffect)(function(){var Pt;if((Je==null||((Pt=Je.actionTabs)===null||Pt===void 0)?void 0:Pt.key)==="SINGLE"){var At,yt=Object(ot.cloneDeep)(Je==null||((At=Je.actionTabs)===null||At===void 0)?void 0:At.params);xt(yt),vt(yt.choices)}},[Je==null||((ut=Je.actionTabs)===null||ut===void 0)?void 0:ut.key]);var rn=function(){var Pt=Object(o.a)(h.a.mark(function At(){var yt,_t;return h.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:if(Et.some(function(kt){return kt==null?void 0:kt.checked})){Gt.next=3;break}return n.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Gt.abrupt("return");case 3:dt&&(_t=Object(ot.cloneDeep)(Je==null||((yt=Je.actionTabs)===null||yt===void 0)?void 0:yt.params),vt(_t.choices)),Mt(!dt);case 5:case"end":return Gt.stop()}},At)}));return function(){return Pt.apply(this,arguments)}}(),de=function(At,yt){console.log(At.target.checked);var _t=Et.map(function(jt,Gt){return Object(N.a)(Object(N.a)({},jt),{},{checked:Gt===yt?At.target.checked:!1})});vt(_t)},on=function(){xt({}),vt([]),Mt(!1),et({type:"problemset/setActionTabs",payload:{}})};return e.a.createElement(c.a,{centered:!0,destroyOnClose:!0,visible:Je.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:dt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:rn,onCancel:on},e.a.createElement("div",null,e.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),e.a.createElement(Re.a,{value:Ut==null?void 0:Ut.name}),Et==null?void 0:Et.map(function(Pt,At){var yt=Pt.is_answer,_t=Pt.checked,jt=Pt.choice_text,Gt="";return dt&&yt&&(Gt=Q.a.green),dt&&!yt&&_t&&(Gt=Q.a.red),e.a.createElement("div",{key:At,style:{pointerEvents:dt?"none":"auto"},className:"".concat(Q.a.row," ").concat(Gt)},e.a.createElement(l.a,{onChange:function(gn){return de(gn,At)},checked:_t}),e.a.createElement("span",null,$t[At],".\xA0"),e.a.createElement(Re.a,{className:Q.a.html,value:jt}),dt&&yt&&e.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),dt&&!yt&&_t&&e.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),dt&&e.a.createElement(d.Fragment,null,e.a.createElement("div",{className:Q.a.line}),e.a.createElement("div",{className:"c-grey-333 mb5"},e.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),$t[Et.findIndex(function(Pt){return Pt.is_answer})]),e.a.createElement("div",{className:"c-grey-333 mb10"},e.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Ut==null?void 0:Ut.analysis)||"\u6682\u65E0\u89E3\u6790"))))},rt=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(nt),lt=function(ke){var ut,Je=ke.problemset,et=ke.dispatch,Xt=Object(d.useState)({}),Ht=Object(v.a)(Xt,2),Ut=Ht[0],xt=Ht[1],zt=Object(d.useState)([]),ft=Object(v.a)(zt,2),Et=ft[0],vt=ft[1],Lt=Object(d.useState)(!1),mt=Object(v.a)(Lt,2),dt=mt[0],Mt=mt[1],$t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(d.useEffect)(function(){var At;if((Je==null||((At=Je.actionTabs)===null||At===void 0)?void 0:At.key)==="MULTIPLE"){var yt,_t=Object(ot.cloneDeep)(Je==null||((yt=Je.actionTabs)===null||yt===void 0)?void 0:yt.params);xt(_t),vt(_t.choices)}},[Je==null||((ut=Je.actionTabs)===null||ut===void 0)?void 0:ut.key]);var rn=function(){var At=Object(o.a)(h.a.mark(function yt(){var _t,jt;return h.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(Et.some(function(gn){return gn==null?void 0:gn.checked})){kt.next=3;break}return n.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),kt.abrupt("return");case 3:dt&&(jt=Object(ot.cloneDeep)(Je==null||((_t=Je.actionTabs)===null||_t===void 0)?void 0:_t.params),vt(jt.choices)),Mt(!dt);case 5:case"end":return kt.stop()}},yt)}));return function(){return At.apply(this,arguments)}}(),de=function(yt,_t){console.log(yt.target.checked);var jt=Et.map(function(Gt,kt){return Object(N.a)(Object(N.a)({},Gt),{},{checked:kt===_t?yt.target.checked:Gt.checked})});vt(jt)},on=function(){xt({}),vt([]),Mt(!1),et({type:"problemset/setActionTabs",payload:{}})},Pt=function(){var yt="";return Et.forEach(function(_t,jt){_t.is_answer&&(yt=yt+$t[jt])}),yt};return e.a.createElement(c.a,{centered:!0,destroyOnClose:!0,visible:Je.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:dt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:rn,onCancel:on},e.a.createElement("div",null,e.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),e.a.createElement(Re.a,{value:Ut==null?void 0:Ut.name}),Et==null?void 0:Et.map(function(At,yt){var _t=At.is_answer,jt=At.checked,Gt=At.choice_text,kt="";return dt&&_t&&(kt=Q.a.green),dt&&!_t&&jt&&(kt=Q.a.red),e.a.createElement("div",{key:yt,style:{pointerEvents:dt?"none":"auto"},className:"".concat(Q.a.row," ").concat(kt)},e.a.createElement(b.a,{style:{padding:3},onChange:function(Vt){return de(Vt,yt)},checked:jt}),e.a.createElement("span",null,$t[yt],".\xA0"),e.a.createElement(Re.a,{className:Q.a.html,value:Gt}),dt&&_t&&e.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),dt&&!_t&&jt&&e.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),dt&&e.a.createElement(d.Fragment,null,e.a.createElement("div",{className:Q.a.line}),e.a.createElement("div",{className:"c-grey-333 mb5"},e.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),Pt()),e.a.createElement("div",{className:"c-grey-333 mb10"},e.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Ut==null?void 0:Ut.analysis)||"\u6682\u65E0\u89E3\u6790"))))},bt=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(lt),Ee=function(ke){var ut,Je,et=ke.problemset,Xt=ke.dispatch,Ht=Object(d.useState)({}),Ut=Object(v.a)(Ht,2),xt=Ut[0],zt=Ut[1],ft=Object(d.useState)([]),Et=Object(v.a)(ft,2),vt=Et[0],Lt=Et[1],mt=Object(d.useState)(!1),dt=Object(v.a)(mt,2),Mt=dt[0],$t=dt[1],rn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(d.useEffect)(function(){var At;if((et==null||((At=et.actionTabs)===null||At===void 0)?void 0:At.key)==="JUDGMENT"){var yt,_t=Object(ot.cloneDeep)(et==null||((yt=et.actionTabs)===null||yt===void 0)?void 0:yt.params);zt(_t),Lt(_t.choices)}},[et==null||((ut=et.actionTabs)===null||ut===void 0)?void 0:ut.key]);var de=function(){var At=Object(o.a)(h.a.mark(function yt(){var _t,jt;return h.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(vt.some(function(gn){return gn==null?void 0:gn.checked})){kt.next=3;break}return n.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),kt.abrupt("return");case 3:Mt&&(jt=Object(ot.cloneDeep)(et==null||((_t=et.actionTabs)===null||_t===void 0)?void 0:_t.params),Lt(jt.choices)),$t(!Mt);case 5:case"end":return kt.stop()}},yt)}));return function(){return At.apply(this,arguments)}}(),on=function(yt,_t){console.log(yt.target.checked);var jt=vt.map(function(Gt,kt){return Object(N.a)(Object(N.a)({},Gt),{},{checked:kt===_t?yt.target.checked:!1})});Lt(jt)},Pt=function(){zt({}),Lt([]),$t(!1),Xt({type:"problemset/setActionTabs",payload:{}})};return e.a.createElement(c.a,{centered:!0,destroyOnClose:!0,visible:et.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Mt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:de,onCancel:Pt},e.a.createElement("div",null,e.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),e.a.createElement(Re.a,{value:xt==null?void 0:xt.name}),vt==null?void 0:vt.map(function(At,yt){var _t=At.is_answer,jt=At.checked,Gt=At.choice_text,kt="";return Mt&&_t&&(kt=Q.a.green),Mt&&!_t&&jt&&(kt=Q.a.red),e.a.createElement("div",{key:yt,style:{pointerEvents:Mt?"none":"auto"},className:"".concat(Q.a.row," ").concat(kt)},e.a.createElement(l.a,{onChange:function(Vt){return on(Vt,yt)},checked:jt}),e.a.createElement(Re.a,{className:Q.a.html,value:Gt}),Mt&&_t&&e.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Mt&&!_t&&jt&&e.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Mt&&e.a.createElement(d.Fragment,null,e.a.createElement("div",{className:Q.a.line}),e.a.createElement("div",{className:"c-grey-333 mb5"},e.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(Je=vt.find(function(At){return At.is_answer}))===null||Je===void 0?void 0:Je.choice_text),e.a.createElement("div",{className:"c-grey-333 mb10"},e.a.createElement("b",null,"\u89E3\u6790:\xA0"),(xt==null?void 0:xt.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Oe=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(Ee),je=function(ke){var ut,Je,et=ke.problemset,Xt=ke.dispatch,Ht=Object(d.useState)({}),Ut=Object(v.a)(Ht,2),xt=Ut[0],zt=Ut[1],ft=Object(d.useState)([]),Et=Object(v.a)(ft,2),vt=Et[0],Lt=Et[1],mt=Object(d.useState)(!1),dt=Object(v.a)(mt,2),Mt=dt[0],$t=dt[1],rn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(d.useEffect)(function(){var At;if((et==null||((At=et.actionTabs)===null||At===void 0)?void 0:At.key)==="COMPLETION"){var yt,_t,jt=Object(ot.cloneDeep)(et==null||((yt=et.actionTabs)===null||yt===void 0)?void 0:yt.params);zt(jt),Lt(jt==null||((_t=jt.standard_answer)===null||_t===void 0)?void 0:_t.map(function(Gt){return{value:"",answer:(Gt==null?void 0:Gt.answer_text)||[]}}))}},[et==null||((ut=et.actionTabs)===null||ut===void 0)?void 0:ut.key]);var de=function(){var At=Object(o.a)(h.a.mark(function yt(){var _t,jt,Gt;return h.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(!vt.some(function(Vt){return(Vt==null?void 0:Vt.value)===""})){gn.next=3;break}return n.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),gn.abrupt("return");case 3:Mt&&(Gt=Object(ot.cloneDeep)(et==null||((_t=et.actionTabs)===null||_t===void 0)?void 0:_t.params),Lt(Gt==null||((jt=Gt.standard_answer)===null||jt===void 0)?void 0:jt.map(function(Vt){return{value:"",answer:(Vt==null?void 0:Vt.answer_text)||[]}}))),$t(!Mt);case 5:case"end":return gn.stop()}},yt)}));return function(){return At.apply(this,arguments)}}(),on=function(yt,_t){var jt=vt.map(function(Gt,kt){return Object(N.a)(Object(N.a)({},Gt),{},{value:kt===_t?yt.target.value:Gt.value})});Lt(jt)},Pt=function(){zt({}),Lt([]),$t(!1),Xt({type:"problemset/setActionTabs",payload:{}})};return e.a.createElement(c.a,{centered:!0,destroyOnClose:!0,visible:et.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Mt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:de,onCancel:Pt},e.a.createElement("div",null,e.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),e.a.createElement(Re.a,{value:xt==null?void 0:xt.name}),vt==null?void 0:vt.map(function(At,yt){var _t=At.value,jt=At.answer,Gt="";return Mt&&jt!==null&&jt!==void 0&&jt.includes(_t)&&(Gt=Q.a.green),Mt&&!(jt!=null&&jt.includes(_t))&&(Gt=Q.a.red),e.a.createElement("div",{key:yt,style:{pointerEvents:Mt?"none":"auto",marginTop:10},className:"".concat(Q.a.row," ").concat(Gt)},e.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",yt+1,"\u7B54\u6848:"),e.a.createElement(r.a.TextArea,{className:Q.a.textArea,style:{width:610,marginRight:10},onChange:function(gn){return on(gn,yt)},value:_t}),Mt&&(jt==null?void 0:jt.includes(_t))&&e.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Mt&&!(jt!=null&&jt.includes(_t))&&e.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Mt&&e.a.createElement(d.Fragment,null,e.a.createElement("div",{className:Q.a.line}),xt==null||((Je=xt.standard_answer)===null||Je===void 0)?void 0:Je.map(function(At,yt){var _t;return e.a.createElement("div",{className:"c-grey-333 mb5"},e.a.createElement("b",null,"\u586B\u7A7A",yt+1,"\u7B54\u6848:\xA0"),(At==null||((_t=At.answer_text)===null||_t===void 0)?void 0:_t.join("\u3001"))||"")}),e.a.createElement("div",{className:"c-grey-333 mb10"},e.a.createElement("b",null,"\u89E3\u6790:\xA0"),(xt==null?void 0:xt.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ye=Object(A.a)(function(Bt){var ke=Bt.problemset;return{problemset:ke}})(je),De=j("Q9mQ"),Ke=j("diRs"),ce=j("+z73"),re=j.n(ce),ie=function(ke){var ut=ke.data,Je=ut===void 0?[]:ut,et=ke.onClick,Xt=function(){return Je.map(function(xt,zt){return e.a.createElement("div",{key:zt,className:re.a.few},e.a.createElement("b",{title:xt.name,style:{color:zt===0?"#333333":"#999999"},onClick:function(){return et(xt.id)}},xt.name),zt<Je.length-1&&e.a.createElement("span",null,"/"))})},Ht=function(){var xt=!0,zt=Je.slice(2,-2),ft=e.a.createElement("div",{className:re.a.pWrap},zt.map(function(Et){return e.a.createElement("span",{title:Et.name,onClick:function(){return et(Et.id)},key:Et.id},Et.name)}));return Je.map(function(Et,vt){var Lt=null;return vt>1&&vt<Je.length-2?xt&&(Lt=e.a.createElement(Ke.a,{key:vt,placement:"bottom",content:ft},e.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),xt=!1):Lt=e.a.createElement("div",{key:vt,className:re.a.few},e.a.createElement("b",{title:Et.name,style:{color:vt===0?"#333333":"#999999"},onClick:function(){return et(Et.id)}},Et.name),vt<Je.length-1&&e.a.createElement("span",null,"/")),Lt})};return e.a.createElement("aside",{style:{overflowX:"auto"}},(Je==null?void 0:Je.length)>5?Ht():Xt())},$=ie,Y=j("tK3L"),V=j.n(Y),ne=j("bbsP"),_e=j("/wGt"),we=j("IPdS"),Xe=j.n(we),gt=[],Nt=function(ke){gt.forEach(function(ut){if(ke.target===ut.element||ht.isParent(ke.target,ut.element))return;ut.callbacks.forEach(function(Je){return Je()})})};window.document.body?window.document.body.addEventListener("click",Nt):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",Nt)});var ht={isParent:function(ke,ut){for(var Je=ke;Je&&Je.tagName&&Je.tagName.toLowerCase()!=="body";){if(Je===ut)return!0;Je=Je.parentNode}return!1},init:function(ke,ut){var Je=gt.filter(function(et){return et.element===ke});return Je.length>0?Je[0].callbacks.push(ut):gt.push({element:ke,callbacks:[ut]}),{clear:function(){gt=gt.filter(function(Xt){return Xt.element!==ke})}}}},en=ht,tn=[{stateName:"single_questions_count",type:"SINGLE",typeName:"\u5355\u9009\u9898"},{stateName:"multiple_questions_count",type:"MULTIPLE",typeName:"\u591A\u9009\u9898"},{stateName:"judgement_questions_count",type:"JUDGMENT",typeName:"\u5224\u65AD\u9898"},{stateName:"completion_questions_count",type:"COMPLETION",typeName:"\u586B\u7A7A\u9898"},{stateName:"subjective_questions_count",type:"SUBJECTIVE",typeName:"\u7B80\u7B54\u9898"},{stateName:"program_questions_count",type:"PROGRAM",typeName:"\u7F16\u7A0B\u9898"},{stateName:"practical_questions_count",type:"PRACTICAL",typeName:"\u9879\u76EE\u9898"},{stateName:"fileupload_questions_count",type:"FILEUPLOAD",typeName:"\u6587\u4EF6\u4E0A\u4F20\u9898"},{stateName:"photograph_questions_count",type:"PHOTOGRAPH",typeName:"\u62CD\u7167\u4E0A\u4F20\u9898"},{stateName:"combination_questions_count",type:"COMBINATION",typeName:"\u63A5\u9F99\u9898"}],Dt=function(ke){var ut=ke.visible,Je=ke.basketData,et=ke.basketTotal,Xt=ke.onClose,Ht=Xt===void 0?function(){}:Xt,Ut=ke.onDelete,xt=Ut===void 0?function(){}:Ut,zt=Object(d.useRef)(),ft=Object(d.useRef)();return Object(d.useEffect)(function(){return ft.current?(et>=0&&!zt.current&&(zt.current=en.init(ft.current,function(){Ht()})),function(){zt.current&&zt.current.clear()}):void 0},[ft.current]),console.log(ut,"visible"),e.a.createElement(_e.a,{className:Xe.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:ut,forceRender:!0,onClose:Ht},et>0?e.a.createElement("div",{style:{height:"100%"},ref:ft},e.a.createElement("div",{className:Xe.a.title},"\u9898\u76EE\u7BEE"),tn.map(function(Et){return Je[Et.stateName]>0&&e.a.createElement("div",{className:Xe.a.problemset,key:Et.type},e.a.createElement("div",{className:Xe.a.content},Et.typeName,"(",Je[Et.stateName],")"),e.a.createElement("div",{className:Xe.a.delete,onClick:function(){return xt(Et.type)}},e.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Xe.a.deleteIcon)})))}),e.a.createElement("div",{className:Xe.a.previewWrap},e.a.createElement("div",{className:Xe.a.preview,onClick:function(){return A.d.push("/problemset/preview")}},"\u9884\u89C8"))):e.a.createElement("div",{ref:ft},e.a.createElement(pe.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},_n={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",PRACTICAL:"\u9879\u76EE\u9898",COMBINATION:"\u63A5\u9F99\u9898"},fn=function(ke){var ut,Je,et=ke.problemset,Xt=ke.globalSetting,Ht=ke.loading,Ut=ke.dispatch,xt=ke.onReloadData,zt=xt===void 0?function(){}:xt,ft=ke.onReloadBasketData,Et=ft===void 0?function(){}:ft,vt=Object(f.a)(ke,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),Lt=function(){var mt=Object(o.a)(h.a.mark(function dt(){var Mt;return h.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Ut({type:"problemset/basketDelete",payload:et.actionTabs.params});case 2:Mt=rn.sent,Ut({type:"problemset/setActionTabs",payload:{}}),Mt.status===0&&(zt(),Et());case 5:case"end":return rn.stop()}},dt)}));return function(){return mt.apply(this,arguments)}}();return e.a.createElement(c.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:et.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ht["problemset/handleDelete"],width:"442px",onOk:Lt,onCancel:function(){Ut({type:"problemset/setActionTabs",payload:{}})}},e.a.createElement("div",{className:Q.a.modalContent},"\u662F\u5426\u5220\u9664\u9898\u76EE\u7BEE\u4E2D",_n[(ut=et.actionTabs)===null||ut===void 0||((Je=ut.params)===null||Je===void 0)?void 0:Je.type]))},sn=Object(A.a)(function(Bt){var ke=Bt.problemset,ut=Bt.loading,Je=Bt.globalSetting;return{problemset:ke,globalSetting:Je,loading:ut.effects}})(fn),Ln=j("A60/"),Wt=j.n(Ln),yn=function(ke){var ut=ke.count,Je=ke.visibleBasket,et=ke.onToggleVisible,Xt=et===void 0?function(){}:et;return e.a.createElement("div",{className:"".concat(Je?Wt.a.right180:Wt.a.right20," ").concat(Wt.a.wrap)},e.a.createElement(E.a,{title:"\u9898\u76EE\u7BEE",placement:"left"},e.a.createElement("div",{className:Wt.a.basket,onClick:Xt},ut>0&&e.a.createElement("div",{className:Wt.a.count},ut),e.a.createElement("span",{className:Wt.a.iconWrap},e.a.createElement("i",{className:"".concat(Wt.a.icon," iconfont icon-shitilan")})),e.a.createElement("p",{className:Wt.a.name},"\u9898\u76EE\u7BEE"))))},xn=j("g9YV"),pt=j("wCAj"),zn=j("giR+"),Cn=j("fyUT"),Rn=j("+vTd"),Rt=j.n(Rn),Gn=j("xKgJ"),er=j("ErOA"),ur=["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"],tr=["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"],fr=[{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:"\u63A5\u9F99\u9898"}],br=function(ke){var ut,Je=ke.isProblemset,et=ke.data,Xt=ke.user,Ht=ke.selectIds,Ut=ke.activeTabsKey,xt=ke.onPublicReview,zt=xt===void 0?function(){}:xt,ft=ke.onStartExperience,Et=ft===void 0?function(){}:ft,vt=ke.onSelectCheckBox,Lt=vt===void 0?function(){}:vt,mt=ke.onSetPrivate,dt=mt===void 0?function(){}:mt,Mt=ke.onCorrection,$t=Mt===void 0?function(){}:Mt,rn=ke.onCollect,de=rn===void 0?function(){}:rn,on=ke.onSetPublic,Pt=on===void 0?function(){}:on,At=ke.onDelete,yt=At===void 0?function(){}:At,_t=ke.onCancel,jt=_t===void 0?function(){}:_t,Gt=ke.onSelect,kt=Gt===void 0?function(){}:Gt,gn=ke.onMoveTo,Vt=gn===void 0?function(){}:gn,dn=ke.onSetShare,Kn=dn===void 0?function(){}:dn,Cr=ke.onCancelShare,Mr=Cr===void 0?function(){}:Cr,St=ke.onPublish,Xn=St===void 0?function(){}:St,Tn=ke.onCancelPublish,rr=Tn===void 0?function(){}:Tn,ar=Object(d.useState)(!1),dr=Object(v.a)(ar,2),Dn=dr[0],Qn=dr[1],Vn=function(){if(et.item_type==="JUDGMENT")return e.a.createElement("div",{className:Rt.a.judgmentContent},et.choices.map(function(Jt,Mn){return e.a.createElement(l.a,{key:Mn,disabled:!0},Jt.choice_text)}));if(et.item_type==="PROGRAM"){var vr;return e.a.createElement("div",{className:Rt.a.programContent},e.a.createElement(Re.a,{value:(vr=et.program_attr)===null||vr===void 0?void 0:vr.description}))}if(et.item_type==="COMBINATION"){var qt;return e.a.createElement("div",{className:Rt.a.combinationContent},et==null||((qt=et.sub_item_banks)===null||qt===void 0)?void 0:qt.map(function(Jt,Mn){var ir,Nr="(\u9898\u76EE".concat(Mn+1,"-\u5355\u9009\u9898) ");return e.a.createElement(d.Fragment,null,e.a.createElement("div",{style:{marginTop:10,marginBottom:10}},e.a.createElement(Re.a,{value:Nr+Jt.name})),Jt.choices.map(function(Or,Ur){return e.a.createElement("div",{key:Ur,className:Rt.a.otherContentItem},e.a.createElement("p",null,ur[Ur]),e.a.createElement(Re.a,{className:Rt.a.otehrContentHtml,value:Or.choice_text}))}),e.a.createElement("div",{className:Rt.a.con},e.a.createElement("b",{className:"c-grey-333 font14"},"\u7B54\u6848\uFF1A",tr==null?void 0:tr[Jt==null||((ir=Jt.choices)===null||ir===void 0)?void 0:ir.findIndex(function(Or){return Or==null?void 0:Or.is_answer})]),e.a.createElement("div",null,e.a.createElement("span",null,"\u89E3\u6790\uFF1A"),e.a.createElement(Re.a,{className:Rt.a.parseAnswerHtml,value:Jt.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return e.a.createElement("div",{className:Rt.a.otherContent},et.choices.map(function(Jt,Mn){return e.a.createElement("div",{key:Mn,className:Rt.a.otherContentItem},e.a.createElement("p",null,ur[Mn]),e.a.createElement(Re.a,{className:Rt.a.otehrContentHtml,value:Jt.choice_text}))}))},Ar=function(){var vr;return e.a.createElement("div",null,(vr=et.standard_answer)===null||vr===void 0?void 0:vr.map(function(qt,Jt){return e.a.createElement(Re.a,{key:Jt,className:Rt.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(qt.position,"\uFF09\uFF1A").concat(qt.answer_text.join("\u3001"))})}))},Wn=function(){var vr,qt,Jt,Mn={SUBJECTIVE:(vr=et.answer_texts)===null||vr===void 0?void 0:vr[0],JUDGMENT:(qt=et.choices)===null||qt===void 0||((Jt=qt.find(function(Wr){return Wr.is_answer}))===null||Jt===void 0)?void 0:Jt.choice_text},ir=et.choices.map(function(Wr){return Wr.is_answer}).findIndex(function(Wr){return Wr}),Nr=ir>-1?tr[ir]:"",Or="";et.choices.map(function(Wr,Hr){Wr.is_answer&&(Or+=tr[Hr])});var Ur=Mn[et.item_type],Lr={SINGLE:e.a.createElement(Re.a,{className:Rt.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Nr||"\u65E0")}),MULTIPLE:e.a.createElement(Re.a,{className:Rt.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Or||"\u65E0")}),COMPLETION:Ar()},ua=e.a.createElement(Re.a,{className:Rt.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Ur||"\u65E0")});return Lr[et.item_type]||ua},ra=function(vr){var qt=Object(T.a)(Ht);vr.target.checked?qt.push(et.id):qt=qt.filter(function(Jt){return Jt!==et.id}),Lt(qt)};return e.a.createElement("div",{className:Rt.a.itemWrap},e.a.createElement("div",{className:Rt.a.list},e.a.createElement(b.a,{className:"mr10",onChange:ra,checked:Ht.includes(et.id)}),e.a.createElement("div",{className:Rt.a.title},e.a.createElement(Re.a,{key:1,showLines:1,showTextOnly:!0,className:Rt.a.topicTitleContent,value:"\u3010ID\uFF1A".concat(et.id,"\u3011").concat(et.name)})),!Dn&&e.a.createElement("div",{onClick:function(){return Qn(!Dn)},className:Rt.a.tr},"\u5C55\u5F00",e.a.createElement("i",{style:{transform:"rotate(90deg)"},className:"iconfont icon-lujing"}))),e.a.createElement("aside",{style:Dn?{height:"auto"}:{overflow:"hidden",height:0}},e.a.createElement(Re.a,{key:2,className:"".concat(Rt.a.topicTitleContent," mt20"),value:et.name}),e.a.createElement("div",{className:"".concat(Rt.a.row," mt15")},Vn()),e.a.createElement("div",{className:Rt.a.row},e.a.createElement("div",{className:Rt.a.updateTimeRow},e.a.createElement("div",{className:Rt.a.updateTimeWrap},et.item_type==="PROGRAM"&&e.a.createElement("p",{className:Rt.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(ut=et.program_attr)===null||ut===void 0?void 0:ut.language)))),et.item_type!=="PROGRAM"&&et.item_type!=="COMBINATION"&&e.a.createElement("div",null,e.a.createElement("div",{className:Rt.a.parseAnswerBorder}),e.a.createElement("div",{className:Rt.a.answer},Wn()),e.a.createElement("div",{className:Rt.a.parse},e.a.createElement("div",{className:Rt.a.parseText},"\u89E3\u6790\uFF1A"),e.a.createElement("div",{className:Rt.a.parseAnswer},et.analysis?e.a.createElement(Re.a,{className:Rt.a.parseAnswerHtml,value:et.analysis}):"\u6682\u65E0\u89E3\u6790"))),e.a.createElement("div",{className:Rt.a.bottom},et.item_type!=="SUBJECTIVE"&&et.item_type!=="COMBINATION"&&e.a.createElement("span",{onClick:function(){return Et(et)}},"\u4F53\u9A8C"),e.a.createElement("span",{onClick:function(){return Qn(!1)}},"\u6536\u8D77",e.a.createElement("i",{className:"iconfont icon-zhankaijiantou"})," "))))},Vr=function(ke){var ut,Je,et,Xt,Ht,Ut,xt,zt,ft,Et,vt,Lt,mt,dt,Mt,$t,rn=ke.isProblemset,de=ke.data,on=ke.user,Pt=ke.activeTabsKey,At=ke.onPublicReview,yt=At===void 0?function(){}:At,_t=ke.onStartExperience,jt=_t===void 0?function(){}:_t,Gt=ke.onSetPrivate,kt=Gt===void 0?function(){}:Gt,gn=ke.onCorrection,Vt=gn===void 0?function(){}:gn,dn=ke.onCollect,Kn=dn===void 0?function(){}:dn,Cr=ke.onSetPublic,Mr=Cr===void 0?function(){}:Cr,St=ke.onDelete,Xn=St===void 0?function(){}:St,Tn=ke.onCancel,rr=Tn===void 0?function(){}:Tn,ar=ke.onSelect,dr=ar===void 0?function(){}:ar,Dn=ke.onMoveTo,Qn=Dn===void 0?function(){}:Dn,Vn=ke.onSetShare,Ar=Vn===void 0?function(){}:Vn,Wn=ke.onCancelShare,ra=Wn===void 0?function(){}:Wn,mr=ke.onPublish,vr=mr===void 0?function(){}:mr,qt=ke.onCancelPublish,Jt=qt===void 0?function(){}:qt,Mn=de.item_type==="PROGRAM"?"/problems/".concat((ut=de.program_attr)===null||ut===void 0?void 0:ut.identifier,"/edit"):"/problemset/edit/".concat(de.id),ir=Pt==="0"&&!de.public&&!de.apply&&(de.item_type==="PROGRAM"&&((Je=de.program_attr)===null||Je===void 0?void 0:Je.status)!==0||de.item_type!=="PROGRAM"),Nr=Object(d.useState)(!1),Or=Object(v.a)(Nr,2),Ur=Or[0],Lr=Or[1],ua=Object(d.useState)([]),Wr=Object(v.a)(ua,2),Hr=Wr[0],ba=Wr[1],Ea=e.a.createElement(R.a,{forceSubMenuRender:!0,className:Rt.a.menu},Pt==="0"&&!de.public&&e.a.createElement(R.a.Item,{key:"-1"},e.a.createElement("a",{className:Rt.a.actionLink,target:"_blank",href:Mn},"\u7F16\u8F91")),(Pt==="0"||Pt==="3")&&de.item_type==="PROGRAM"&&((et=de.program_attr)===null||et===void 0?void 0:et.status)!==0&&!de.public&&((Xt=de.author)===null||Xt===void 0?void 0:Xt.login)===((Ht=on.userInfo)===null||Ht===void 0?void 0:Ht.login)&&e.a.createElement(R.a.Item,{key:"0"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){var Zn;return Jt(de==null||((Zn=de.program_attr)===null||Zn===void 0)?void 0:Zn.identifier)}},"\u64A4\u9500\u53D1\u5E03")),Pt==="0"&&e.a.createElement(R.a.Item,{key:"1"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Qn(de.id)}},"\u79FB\u52A8\u5230")),Pt==="0"&&!(de!=null&&de.is_share)&&e.a.createElement(R.a.Item,{key:"3"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Ar(de.id)}},"\u5171\u4EAB")),(Pt==="0"&&(de==null?void 0:de.is_share)||Pt==="3"&&((Ut=de.author)===null||Ut===void 0?void 0:Ut.login)===((xt=on.userInfo)===null||xt===void 0?void 0:xt.login))&&e.a.createElement(R.a.Item,{key:"3"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return ra(de.id)}},"\u64A4\u9500\u5171\u4EAB")),ir&&e.a.createElement(R.a.Item,{key:"4"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Mr(de.id)}},"\u516C\u5F00")),Pt==="0"&&!de.public&&de.apply&&(de.item_type==="PROGRAM"&&de.program_attr.status!==0||de.item_type!=="PROGRAM")&&e.a.createElement(R.a.Item,{key:"5"},e.a.createElement("a",{className:Rt.a.reviewFlag,onClick:yt},"\u5BA1\u6838\u4E2D")),(Pt==="0"||Pt==="1")&&de.public&&((zt=de.author)===null||zt===void 0?void 0:zt.login)===((ft=on.userInfo)===null||ft===void 0?void 0:ft.login)&&e.a.createElement(R.a.Item,{key:"6"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return kt(de.id)}},"\u64A4\u9500\u516C\u5F00")),Pt==="2"&&e.a.createElement(R.a.Item,{key:"7"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Kn(de.id,de.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(Pt==="0"||Pt==="3")&&de.item_type==="PROGRAM"&&((Et=de.program_attr)===null||Et===void 0?void 0:Et.status)===0&&!de.public&&((vt=de.author)===null||vt===void 0?void 0:vt.login)===((Lt=on.userInfo)===null||Lt===void 0?void 0:Lt.login)&&e.a.createElement(R.a.Item,{key:"8"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){var Zn;return vr(de==null||((Zn=de.program_attr)===null||Zn===void 0)?void 0:Zn.identifier)}},"\u53D1\u5E03")),(Pt==="1"||Pt==="3")&&!Object(Gn.o)()&&!Object(Gn.m)()&&((mt=de.author)===null||mt===void 0?void 0:mt.login)!==((dt=on.userInfo)===null||dt===void 0?void 0:dt.login)&&e.a.createElement(R.a.Item,{key:"9"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Kn(de.id,de.is_collected)}},de.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),Pt!=="0"&&!Object(Gn.o)()&&!Object(Gn.m)()&&e.a.createElement(R.a.Item,{key:"10"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Vt(de.id)}},"\u7EA0\u9519")),Pt==="0"&&e.a.createElement(R.a.Item,{key:"11"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:Object(o.a)(h.a.mark(function cr(){var Zn;return h.a.wrap(function(Qr){for(;;)switch(Qr.prev=Qr.next){case 0:c.a.confirm({title:"\u8BD5\u9898\u67E5\u91CD",content:e.a.createElement("div",{style:{display:"flex"}},e.a.createElement("span",null,"\u91CD\u590D\u5EA6\u8BBE\u7F6E:",e.a.createElement(Cn.a,{min:0,max:100,onChange:function(ye){return Zn=ye}}),"%")),onOk:function(){var ae=Object(o.a)(h.a.mark(function xe(){var le,z;return h.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(er.a)("/api/item_banks/item_similar.json",{method:"get",params:{id:de==null?void 0:de.id,similar:Zn,page:1,per_page:1e4}});case 2:z=G.sent,ba(z),(z==null||((le=z.data)===null||le===void 0)?void 0:le.length)>0?Lr(!0):n.b.info("\u6682\u65E0\u91CD\u590D\u6570\u636E");case 5:case"end":return G.stop()}},xe)}));function ye(){return ae.apply(this,arguments)}return ye}(),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88"});case 1:case"end":return Qr.stop()}},cr)}))},"\u67E5\u91CD")),(Pt==="0"&&!de.public||Pt==="1"&&Object(Gn.o)()&&((Mt=de.author)===null||Mt===void 0?void 0:Mt.login)!==(($t=on.userInfo)===null||$t===void 0?void 0:$t.login))&&e.a.createElement(R.a.Item,{key:"11"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Xn(de.id)}},"\u5220\u9664"))),Ca=e.a.createElement(R.a,{forceSubMenuRender:!0,className:Rt.a.menu},e.a.createElement(R.a.Item,{key:"10"},e.a.createElement("a",{className:Rt.a.actionLink,onClick:function(){return Vt(de.id)}},"\u7EA0\u9519"))),xa=Pt!=="0"&&!Object(Gn.o)()&&!Object(Gn.m)();return e.a.createElement(e.a.Fragment,null,rn?e.a.createElement(x.a,{className:"ml40",overlay:Ea},e.a.createElement("span",{style:{cursor:"default"},onClick:function(Zn){return Zn.preventDefault()}},e.a.createElement("span",{className:"c-light-primary"},"\u66F4\u591A"))):xa?e.a.createElement(x.a,{className:"ml40",overlay:Ca},e.a.createElement("span",{style:{cursor:"default"},onClick:function(Zn){return Zn.preventDefault()}},e.a.createElement("span",{className:"c-light-primary"},"\u66F4\u591A"))):e.a.createElement("span",null),e.a.createElement(c.a,{title:"\u67E5\u91CD\u7ED3\u679C",visible:Ur,footer:e.a.createElement(e.a.Fragment,null),width:700,onCancel:function(){Lr(!1)}},e.a.createElement("div",null,e.a.createElement("p",null,"\u67E5\u91CD\u8BD5\u9898"),e.a.createElement(pt.a,{pagination:!1,dataSource:[Object(N.a)({},Hr==null?void 0:Hr.curr_item)],columns:[{title:"\u9898\u578B",dataIndex:"item_type",key:"item_type",render:function(Zn){var kr;return(kr=fr.find(function(Qr){return Qr.type===Zn}))===null||kr===void 0?void 0:kr.name}},{title:"\u9898\u5E72",dataIndex:"name",key:"name"},{title:"\u66F4\u65B0\u65F6\u95F4",dataIndex:"updated_at",key:"updated_at"},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"quotes",key:"quotes"},{title:"\u64CD\u4F5C",dataIndex:"id",key:"id",render:function(Zn){return e.a.createElement("a",{className:Rt.a.actionLink,target:"_blank",href:Mn},"\u67E5\u770B")}}]}),e.a.createElement("p",null,"\u91CD\u590D\u8BD5\u9898"),e.a.createElement(pt.a,{scroll:{y:300},dataSource:Hr==null?void 0:Hr.data,columns:[{title:"\u9898\u578B",dataIndex:"item_type",width:"10%",ellipsis:!0,key:"item_type",render:function(Zn){var kr;return(kr=fr.find(function(Qr){return Qr.type===Zn}))===null||kr===void 0?void 0:kr.name}},{title:"\u9898\u5E72",dataIndex:"name",width:"30%",ellipsis:!0,key:"name"},{title:"\u66F4\u65B0\u65F6\u95F4",dataIndex:"updated_at",width:"30%",ellipsis:!0,key:"updated_at"},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"quotes",width:"20%",ellipsis:!0,key:"quotes"},{title:"\u64CD\u4F5C",dataIndex:"id",width:"10%",ellipsis:!0,key:"id",render:function(Zn,kr){var Qr;return e.a.createElement("a",{className:Rt.a.actionLink,target:"_blank",href:kr.item_type==="PROGRAM"?"/problems/".concat((Qr=kr.program_attr)===null||Qr===void 0?void 0:Qr.identifier,"/edit"):"/problemset/edit/".concat(kr.id)},"\u67E5\u770B")}}]}))))},Fr=br,Rr=j("YaiT"),Xr=j.n(Rr),$r=function(ke){var ut=ke.isProblemset,Je=ke.data,et=ke.user,Xt=ke.onOpen,Ht=Xt===void 0?function(){}:Xt,Ut=ke.onMove,xt=Ut===void 0?function(){}:Ut,zt=ke.onRenameOk,ft=zt===void 0?function(){}:zt,Et=ke.onDeleteOk,vt=Et===void 0?function(){}:Et,Lt=Object(d.useState)(!1),mt=Object(v.a)(Lt,2),dt=mt[0],Mt=mt[1],$t=Object(d.useState)(""),rn=Object(v.a)($t,2),de=rn[0],on=rn[1];Object(d.useEffect)(function(){Je.name&&on(Je==null?void 0:Je.name)},[Je==null?void 0:Je.name]);var Pt=function(){var yt=Object(o.a)(h.a.mark(function _t(jt){var Gt,kt,gn;return h.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(Gt=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],de.trim()){dn.next=4;break}return n.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),dn.abrupt("return");case 4:if(!(de.charAt(0)===" ")){dn.next=7;break}return n.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),dn.abrupt("return");case 7:kt=0;case 8:if(!(kt<de.length)){dn.next=15;break}if(!Gt.includes(de.charAt(kt))){dn.next=12;break}return n.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),dn.abrupt("return",!1);case 12:kt++,dn.next=8;break;case 15:return dn.next=17,Object(er.a)("/api/item_banks_groups/".concat(Math.abs(jt),".json"),{method:"put",body:{name:de}});case 17:gn=dn.sent,gn.status===0&&(Mt(!1),ft());case 19:case"end":return dn.stop()}},_t)}));return function(jt){return yt.apply(this,arguments)}}(),At=function(_t){c.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:e.a.createElement("div",null,e.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"),e.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 jt=Object(o.a)(h.a.mark(function kt(){var gn;return h.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return dn.next=2,Object(er.a)("/api/item_banks_groups/".concat(Math.abs(_t),".json"),{method:"delete",body:{}});case 2:gn=dn.sent,gn.status===0&&vt([_t]);case 4:case"end":return dn.stop()}},kt)}));function Gt(){return jt.apply(this,arguments)}return Gt}()})};return e.a.createElement("div",{className:Xr.a.list},e.a.createElement("div",{className:"iconfont icon-wenjianjia2 c-light-primary mr10"}),dt?e.a.createElement(r.a,{style:{maxWidth:800},value:de,onChange:function(_t){return on(_t.target.value)}}):e.a.createElement("div",{title:Je==null?void 0:Je.name,onClick:function(){return Ht(Je.id)},className:Xr.a.name},Je==null?void 0:Je.name),ut&&e.a.createElement("div",{className:Xr.a.btns},dt?e.a.createElement(e.a.Fragment,null,e.a.createElement("div",{onClick:function(){return Pt(Je.id)},className:"ml0"},e.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),e.a.createElement("div",{onClick:function(){return Mt(!1)},className:"ml10"},e.a.createElement("i",{className:"iconfont icon-qingchu"}))):e.a.createElement(e.a.Fragment,null,e.a.createElement("div",{onClick:function(){return xt(Je.id,!0)},className:"ml0"},e.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),e.a.createElement("div",{onClick:function(){return xt(Je.id,!1)},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},e.a.createElement("i",{className:"iconfont icon-shangyi3"}))),e.a.createElement(S.a,{style:{marginLeft:16},onClick:function(){return Mt(!0)},type:"link"},"\u91CD\u547D\u540D"),e.a.createElement(S.a,{onClick:function(){return At(Je.id)},type:"link",danger:!0},"\u5220\u9664")))},ea=$r,ta=j("rCGY"),pr=j.n(ta),na=function(ke){var ut,Je,et=ke.dispatch,Xt=ke.problemset,Ht=ke.groupIds,Ut=Ht===void 0?[]:Ht,xt=ke.onChangeTeachGroup,zt=xt===void 0?function(){}:xt,ft=Xt.teachGroupData;return!!(ft!=null&&(ut=ft.groups)!==null&&ut!==void 0&&ut.length)&&e.a.createElement("div",{className:pr.a.groupWrap},e.a.createElement("span",{className:"".concat(pr.a.minWidth73," ml20 mt3")},"\u6559\u7814\u56E2\u961F\uFF1A"),e.a.createElement("span",null,e.a.createElement("li",{className:"mr10 mb10 ".concat(pr.a.minWidth60," ").concat(pr.a.directionItem," ").concat(Ut!=null&&Ut.length?"":pr.a.active),onClick:function(){return zt([])}},"\u5168\u90E8")),e.a.createElement("div",{className:pr.a.directionContentWrap},ft==null||((Je=ft.groups)===null||Je===void 0)?void 0:Je.map(function(Et){return e.a.createElement("span",null,e.a.createElement("li",{key:Et.group_id,onClick:function(){return zt([Et.group_id])},className:"".concat(pr.a.directionItem," ").concat(Ut!=null&&Ut.includes(Et.group_id)?pr.a.active:"")},Et.name))})))},aa=j("1vsH"),sa=j("/zsF"),L=j("PArb"),u=j("14J3"),p=j("BMrR"),D=j("jCWc"),H=j("kPKH"),k=j("y8nQ"),ge=j("Vl3Y"),qe=j("nSDg"),st=j.n(qe),Kt=j("HBuW"),tt=j("NLgs"),nn=r.a.Search,Yt={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},kn={id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]},Pr=function(ke){var ut,Je,et,Xt,Ht=ke.classroomList,Ut=ke.loading,xt=ke.dispatch,zt=ke.cb,ft=ke.shixunIds,Et=ft===void 0?[]:ft,vt=Object(Se.i)(),Lt=Object(Se.h)(),mt=Ht.actionTabs,dt=ge.a.useForm(),Mt=Object(v.a)(dt,1),$t=Mt[0],rn=Ht.shixunLists,de=Object(d.useState)([]),on=Object(v.a)(de,2),Pt=on[0],At=on[1],yt=Object(d.useState)([]),_t=Object(v.a)(yt,2),jt=_t[0],Gt=_t[1],kt=Object(d.useState)({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null}),gn=Object(v.a)(kt,2),Vt=gn[0],dn=gn[1];Object(d.useEffect)(function(){Ht.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&xt({type:"classroomList/getShixunLists",payload:Object(N.a)({},Vt)})},[Ht.actionTabs.key,Vt]),Object(d.useEffect)(function(){try{Ht.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?(document.body.removeAttribute("data-custom"),document.body.setAttribute("data-self","height")):document.body.removeAttribute("data-self")}catch(St){}return function(){document.body.removeAttribute("data-self"),document.body.setAttribute("data-custom","initial")}},[Ht.actionTabs.key]),Object(d.useEffect)(function(){Kn()},[vt]);var Kn=function(){var St=Object(o.a)(h.a.mark(function Xn(){var Tn;return h.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return ar.next=2,Object(Kt.ob)({});case 2:Tn=ar.sent,Gt((Tn==null?void 0:Tn.disciplines)||[]);case 4:case"end":return ar.stop()}},Xn)}));return function(){return St.apply(this,arguments)}}(),Cr=function(Xn,Tn,rr){Vt.tag_level=Xn,Vt.sub_discipline_id=Tn,Vt.discipline_id=rr,dn(Object(N.a)({},Vt)),xt({type:"classroomList/getShixunLists",payload:Object(N.a)({},Vt)})},Mr=function(){xt({type:"classroomList/setActionTabs",payload:{}}),dn({page:1,type:"all",diff:0,status:"all",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null})};return Ht.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:e.a.createElement(_e.a,{placement:"bottom",height:"100%",closable:!0,onClose:Mr,visible:Ht.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:st.a.drawer,footer:e.a.createElement("div",{className:"tc"},e.a.createElement(S.a,{size:"large",onClick:function(){Mr(),At([])},style:{marginRight:8}},"\u53D6\u6D88"),e.a.createElement(S.a,{size:"large",onClick:Object(o.a)(h.a.mark(function St(){var Xn,Tn,rr;return h.a.wrap(function(dr){for(;;)switch(dr.prev=dr.next){case 0:Xn=function(Qn){var Vn=Pt[Qn];if(Et.includes(Vn)){var Ar,Wn;return n.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(rn==null||((Ar=rn.shixun_list)===null||Ar===void 0||((Wn=Ar.find(function(ra){return ra.id===Vn}))===null||Wn===void 0))?void 0:Wn.title)),{v:void 0}}},Tn=0;case 2:if(!(Tn<(Pt==null?void 0:Pt.length))){dr.next=9;break}if(rr=Xn(Tn),!(typeof rr=="object")){dr.next=6;break}return dr.abrupt("return",rr.v);case 6:Tn++,dr.next=2;break;case 9:Mr(),zt(Pt),At([]);case 12:case"end":return dr.stop()}},St)})),type:"primary"},"\u786E\u5B9A"))},e.a.createElement("section",{className:"tc"},e.a.createElement(nn,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",className:st.a.search,onSearch:function(Xn){Vt.keyword=Xn,Vt.page=1,xt({type:"classroomList/getShixunLists",payload:Object(N.a)({},Vt)})}})),e.a.createElement("section",{className:"edu-container"},e.a.createElement("ul",{className:st.a.menu},e.a.createElement("li",null,Yt.name),Yt==null||((ut=Yt.children)===null||ut===void 0)?void 0:ut.map(function(St,Xn){return e.a.createElement("li",{className:Vt[Yt.id]==St.id?st.a.actived:"",onClick:function(){Vt[Yt.id]=St.id,dn(Object(N.a)({},Vt)),xt({type:"classroomList/getShixunLists",payload:Object(N.a)({},Vt)})}},e.a.createElement("strong",null,St.name))})),e.a.createElement("ul",{className:st.a.menuDirection},e.a.createElement("li",{className:st.a.directionName},"\u65B9\u5411"),e.a.createElement("li",{className:Vt.discipline_id?"":st.a.actived,onClick:function(){Cr(null,null,null)}},e.a.createElement("strong",null,"\u5168\u90E8")),jt==null?void 0:jt.map(function(St,Xn){return e.a.createElement("li",{key:Xn,className:Vt.discipline_id==St.id?st.a.actived:""},e.a.createElement("strong",{onClick:function(){Cr(1,null,St.id)}},St.name),e.a.createElement("div",null,St.sub_disciplines.map(function(Tn,rr){return e.a.createElement("div",{key:rr,className:"mt5"},e.a.createElement("div",{className:Vt.sub_discipline_id==Tn.id?"".concat(st.a.actived2," ").concat(st.a.subTag):st.a.subTag,onClick:function(){Cr(2,Tn.id,St.id)}},Tn.name),e.a.createElement("ul",{className:"mt5"},Tn.tags&&Tn.tags.map(function(ar,dr){return e.a.createElement("li",{key:dr,className:Vt.sub_discipline_id==ar.id&&Vt.tag_level===3?st.a.actived2:"",onClick:function(){Cr(3,ar.id,St.id)}},ar.name)})))})))})),e.a.createElement("ul",{className:st.a.menu},e.a.createElement("li",null,kn.name),kn==null||((Je=kn.children)===null||Je===void 0)?void 0:Je.map(function(St,Xn){return e.a.createElement("li",{className:Vt[kn.id]==St.id?st.a.actived:"",onClick:function(){Vt[kn.id]=St.id,dn(Object(N.a)({},Vt)),xt({type:"classroomList/getShixunLists",payload:Object(N.a)({},Vt)})}},e.a.createElement("strong",null,St.name))})),e.a.createElement(p.a,null,e.a.createElement(H.a,{flex:"1"},e.a.createElement("div",{className:st.a.menuCourse,style:{margin:"0px 15px"}},e.a.createElement("ul",null,e.a.createElement("li",null,"\u5DF2\u9009",e.a.createElement("span",{className:"c-blue"},Pt.length),"\u4E2A\u5B9E\u8BAD"),e.a.createElement("li",null,"\u5171",e.a.createElement("span",{className:"c-blue"},rn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),e.a.createElement("li",{className:"current",onClick:function(){Vt.order=Vt.order==="asc"?"desc":"asc",dn(Object(N.a)({},Vt))}},"\u5B66\u4E60\u4EBA\u6570",e.a.createElement("p",{className:"edu-sorter current ".concat(Vt.order)},Vt.order==="asc"?e.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):e.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),e.a.createElement(H.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),rn==null||((et=rn.shixun_list)===null||et===void 0)?void 0:et.map(function(St,Xn){return e.a.createElement("div",{className:st.a.listItem,key:Xn},e.a.createElement(b.a,{checked:Pt.includes(St.id),value:St.id,disabled:St==null?void 0:St.need_authorize,onChange:function(rr){var ar=Pt.indexOf(St.id);Pt.indexOf(St.id)>-1?At(Pt.filter(function(dr){return dr!==St.id})):At(Pt.concat(St.id))}}),e.a.createElement("div",{className:st.a.info},e.a.createElement("div",{className:st.a.title},e.a.createElement("div",{className:st.a.titleLeft},e.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(St==null?void 0:St.identifier,"/challenges"),target:"_blank"},e.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:St.title}})),(St==null?void 0:St.need_authorize)&&e.a.createElement("span",{onClick:function(){Object(tt.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(Gn.v)()&&(St==null?void 0:St.mark_status)===1&&e.a.createElement(E.a,{title:St==null?void 0:St.mark_content},e.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(Gn.v)()&&(St==null?void 0:St.mark_status)===2&&e.a.createElement(E.a,{title:St==null?void 0:St.mark_content},e.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(Gn.v)()&&(St==null?void 0:St.mark_status)===3&&e.a.createElement(E.a,{title:St==null?void 0:St.mark_content},e.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),e.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},e.a.createElement("span",{className:st.a.description,dangerouslySetInnerHTML:{__html:St.description}})),e.a.createElement("div",{className:" mt15"},St.challenge_names.map(function(Tn,rr){return e.a.createElement("span",{key:rr,className:"mr30 font12"},"\u7B2C",rr+1,"\u5173 ",Tn," ")})),e.a.createElement(L.a,{dashed:!0}),e.a.createElement("div",{className:"c-light-black mt20 font12"},e.a.createElement("span",null,St.author_name),e.a.createElement("span",{className:"ml15 mr15"},"|"),e.a.createElement("span",null,St.author_school_name),e.a.createElement("span",{className:"ml15 mr15"},"|"),e.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",St.level),e.a.createElement("span",{className:"ml15 mr15"},"|"),e.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),e.a.createElement("span",null,St.study_count))))}),(rn==null||((Xt=rn.shixun_list)===null||Xt===void 0)?void 0:Xt.length)===0&&e.a.createElement(pe.a,null),e.a.createElement("p",null)),e.a.createElement("div",{className:"tc mt20"},e.a.createElement(B.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showSizeChanger:!1,current:Vt.page||1,showQuickJumper:!0,total:rn==null?void 0:rn.shixuns_count,onChange:function(Xn){Vt.page=Xn,dn(Object(N.a)({},Vt))}})))},Kr=Object(A.a)(function(Bt){var ke=Bt.classroomList,ut=Bt.loading;return{classroomList:ke,loading:ut}})(Pr),nr=a.a.TabPane,Yr=r.a.Search,ga=r.a.TextArea,la=function(ke){var ut,Je,et,Xt,Ht,Ut,xt,zt,ft=ke.problemset,Et=ke.user,vt=ke.globalSetting,Lt=ke.loading,mt=ke.dispatch,dt=ke.match,Mt=Object(f.a)(ke,["problemset","user","globalSetting","loading","dispatch","match"]),$t=Object(d.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:null,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((ut=Mt.location)===null||ut===void 0||((Je=ut.query)===null||Je===void 0)?void 0:Je.id)||null,exam_id:(dt==null||((et=dt.params)===null||et===void 0)?void 0:et.id)||null,exercise_id:(dt==null||((Xt=dt.params)===null||Xt===void 0)?void 0:Xt.categoryId)||null}),rn=Object(v.a)($t,2),de=rn[0],on=rn[1],Pt=Object(d.useState)(0),At=Object(v.a)(Pt,2),yt=At[0],_t=At[1],jt=Object(d.useState)([]),Gt=Object(v.a)(jt,2),kt=Gt[0],gn=Gt[1],Vt=Object(d.useState)("0"),dn=Object(v.a)(Vt,2),Kn=dn[0],Cr=dn[1],Mr=Object(d.useState)(0),St=Object(v.a)(Mr,2),Xn=St[0],Tn=St[1],rr=Object(d.useState)(-1),ar=Object(v.a)(rr,2),dr=ar[0],Dn=ar[1],Qn=Object(d.useState)([]),Vn=Object(v.a)(Qn,2),Ar=Vn[0],Wn=Vn[1],ra=Object(d.useState)(!1),mr=Object(v.a)(ra,2),vr=mr[0],qt=mr[1],Jt=Object(d.useState)([]),Mn=Object(v.a)(Jt,2),ir=Mn[0],Nr=Mn[1],Or=Object(d.useState)(0),Ur=Object(v.a)(Or,2),Lr=Ur[0],ua=Ur[1],Wr=Object(d.useState)(!1),Hr=Object(v.a)(Wr,2),ba=Hr[0],Ea=Hr[1],Ca=Object(d.useState)(!1),xa=Object(v.a)(Ca,2),cr=xa[0],Zn=xa[1],kr=Object(d.useRef)(!1),Qr=Object(d.useRef)(""),ae=Object(d.useRef)(),ye=Object(d.useRef)(),xe=Object(d.useRef)(),le=Object(d.useState)(),z=Object(v.a)(le,2),ee=z[0],G=z[1],ue=Object(d.useState)([]),fe=Object(v.a)(ue,2),me=fe[0],Ce=fe[1],Pe=Object(d.useRef)(!1),Ne=(dt==null?void 0:dt.url)==="/problemset",at=Et.userInfo||{},it=at.admin,Tt=at.business,an=at.is_shixun_marker,bn=at.is_teacher,cn=at.user_identity,un=it||Tt||an||bn||cn!=="\u5B66\u751F",En=Object(d.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),mn=Object(v.a)(En,2),vn=mn[0],In=mn[1],Sn=Object(d.useState)([]),sr=Object(v.a)(Sn,2),Hn=sr[0],Zt=sr[1],Qt=Object(d.useState)(0),Pn=Object(v.a)(Qt,2),On=Pn[0],Ft=Pn[1],Nn=Object(d.useRef)(null),$n=Object(d.useRef)(!1),Un=Object(d.useState)(!1),Yn=Object(v.a)(Un,2),lr=Yn[0],Er=Yn[1],Dr=[{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(d.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(d.useEffect)(function(){var We;mt({type:"problemset/getDisciplines",payload:{source:"question"}});var Ue=((We=Mt.location.query)===null||We===void 0?void 0:We.group_id)||0;de.group_id=Number(Ue),on(de),qn(de),yr(),jr()},[]),Object(d.useEffect)(function(){return mt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),mt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){mt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),mt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(d.useEffect)(function(){return mt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){mt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(d.useEffect)(function(){return mt({type:"globalSetting/headerFooterToggle",payload:Ne}),function(){mt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(d.useEffect)(function(){if(ft.disciplinesData){var We;Wn((ft==null||((We=ft.disciplinesData)===null||We===void 0)?void 0:We.tag_disciplines)||[])}Object(aa.V)("\u8BD5\u9898\u5E93")},[ft==null?void 0:ft.disciplinesData]);var hr=function(Ue,He){var Ze=[];if(!Ue){var ct,Ot;ft==null||((ct=ft.disciplinesData)===null||ct===void 0||((Ot=ct.disciplines)===null||Ot===void 0))||Ot.forEach(function(wn){var or;wn==null||((or=wn.sub_disciplines)===null||or===void 0)||or.forEach(function(Tr){var qr;Tr==null||((qr=Tr.tag_disciplines)===null||qr===void 0)||qr.forEach(function(Sr){Sr.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&Ze.push(Sr)})})})}if(Ue&&!He){var wt,It,Fn,jn=ft==null||((wt=ft.disciplinesData)===null||wt===void 0||((It=wt.disciplines)===null||It===void 0))?void 0:It.find(function(wn){return wn.id===Ue});jn==null||((Fn=jn.sub_disciplines)===null||Fn===void 0)||Fn.forEach(function(wn){var or;wn==null||((or=wn.tag_disciplines)===null||or===void 0)||or.forEach(function(Tr){Tr.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&Ze.push(Tr)})})}if(Ue&&He){var Gr,An,Br,Zr,hn=ft==null||((Gr=ft.disciplinesData)===null||Gr===void 0||((An=Gr.disciplines)===null||An===void 0))?void 0:An.find(function(wn){return wn.id===Ue}),pn=hn==null||((Br=hn.sub_disciplines)===null||Br===void 0)?void 0:Br.find(function(wn){return wn.id===He});pn==null||((Zr=pn.tag_disciplines)===null||Zr===void 0)||Zr.forEach(function(wn){wn.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&Ze.push(wn)})}return Ze},jr=function(){var We=Object(o.a)(h.a.mark(function Ue(){return h.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:mt({type:"problemset/getTeachGroupData"});case 1:case"end":return Ze.stop()}},Ue)}));return function(){return We.apply(this,arguments)}}();Object(d.useEffect)(function(){var We=ft.basketData||{},Ue=We.completion_questions_count,He=Ue===void 0?0:Ue,Ze=We.judgement_questions_count,ct=Ze===void 0?0:Ze,Ot=We.multiple_questions_count,wt=Ot===void 0?0:Ot,It=We.practical_questions_count,Fn=It===void 0?0:It,jn=We.program_questions_count,Gr=jn===void 0?0:jn,An=We.single_questions_count,Br=An===void 0?0:An,Zr=We.subjective_questions_count,hn=Zr===void 0?0:Zr,pn=We.combination_questions_count,wn=pn===void 0?0:pn,or=We.photograph_questions_count,Tr=or===void 0?0:or,qr=We.fileupload_questions_count,Sr=qr===void 0?0:qr,oa=He+ct+wt+Fn+Gr+Br+hn+wn+Tr+Sr;ua(oa)},[ft.basketData]);var qn=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze,ct;return h.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,mt({type:"problemset/getItemBanks",payload:He});case 2:Ze=wt.sent,Ze&&Ze.status!==403&&Ze.status!==401&&Ze.status!==500&&(_t(Ze.items_count||0),gn(Ze.items||[]),G(Ze.used_shixun_ids||[]),zr(Ze.items||[]),Ce([]),Nr((Ze==null?void 0:Ze.navigation)||[]),Zt((Ze==null?void 0:Ze.item_banks_group)||[]),$n.current||(Ft((Ze==null||((ct=Ze.item_banks_group)===null||ct===void 0)?void 0:ct.length)>5?1:0),$n.current=!1),Tn((Ze==null?void 0:Ze.added_num)||0),Er(!1));case 4:case"end":return wt.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),yr=function(){mt({type:"problemset/getBasketList",payload:{}})},zr=function(Ue){var He=Ue.every(function(Ze){var ct;return((ct=Ze.program_attr)===null||ct===void 0?void 0:ct.status)===0});kr.current=He},gr=function(Ue,He){if(de.discipline_id=Ue||"",de.sub_discipline_id=He||"",de.tag_discipline_id="",de.page=1,de.per_page=20,delete de.id,Dn(Ue===null?-1:null),on(de),qn(de),Ue===null){var Ze;Wn((ft==null||((Ze=ft.disciplinesData)===null||Ze===void 0)?void 0:Ze.tag_disciplines)||[]);return}Wn(hr(Ue,He))},Ir=function(Ue){de.item_type=Ue||"",de.page=1,de.per_page=20,on(de),qn(de)},wr=function(Ue){de.difficulty=Ue||"",de.page=1,de.per_page=20,delete de.id,on(de),qn(de)},xr=function(Ue){if(de.tag_discipline_id=Ue,de.page=1,de.per_page=20,delete de.id,Ue===-1){var He;de.discipline_id="",de.sub_discipline_id="",de.tag_discipline_id="",Wn((ft==null||((He=ft.disciplinesData)===null||He===void 0)?void 0:He.tag_disciplines)||[])}Dn(Ue),on(de),qn(de)},da=function(Ue){de.discipline_id="",de.sub_discipline_id="",de.tag_discipline_id="",de.item_type=null,de.difficulty=null,de.type=Ue,Ue==="0"?de.group_id=0:de.group_id=null,de.page=1,de.per_page=20,delete de.id,Dn(-1),Cr(Ue),on(de),qn(de)},ca=function(Ue,He){de.page=Ue,de.per_page=20,on(de),qn(de)},pa=function(Ue){de.discipline_id="",de.sub_discipline_id="",de.tag_discipline_id="",de.item_type=null,de.difficulty=null,de.page=1,de.keyword=Ue,delete de.id,Zn(!!Ue),Dn(-1),on(de),qn(de)},ln=function(){de.per_page=20,on(de),qn(de)},Jr=function(Ue){var He=Ue.length===kt.length&&de.page>1?de.page-1:de.page;de.page=He,de.per_page=20,yr(),on(de),qn(de)},ia=function(){mt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},Jn=function(){var We=Object(o.a)(h.a.mark(function Ue(He,Ze){var ct;return h.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Ze){wt.next=6;break}return wt.next=3,Object(J.m)({id:He});case 3:wt.t0=wt.sent,wt.next=9;break;case 6:return wt.next=8,Object(J.E)({id:He});case 8:wt.t0=wt.sent;case 9:ct=wt.t0,(ct==null?void 0:ct.status)===0&&ln();case 11:case"end":return wt.stop()}},Ue)}));return function(He,Ze){return We.apply(this,arguments)}}(),Bn=function(){var We=Object(o.a)(h.a.mark(function Ue(He){return h.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:Da(He);case 1:case"end":return ct.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),_r=function(){var We=Object(o.a)(h.a.mark(function Ue(He){return h.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:va(He);case 1:case"end":return ct.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Ia=function(Ue){ye.current="",ae.current="",c.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:e.a.createElement("div",{className:"font14"},e.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),e.a.createElement(l.a.Group,{className:"mt10",onChange:function(Ze){return ae.current=Ze.target.value}},e.a.createElement(l.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),e.a.createElement(l.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),e.a.createElement(l.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),e.a.createElement(l.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),e.a.createElement(l.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),e.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),e.a.createElement(ga,{className:"mt10",rows:4,defaultValue:ye.current,onChange:function(Ze){return ye.current=Ze.target.value}})),onOk:function(){return new Promise(function(){var Ze=Object(o.a)(h.a.mark(function ct(Ot,wt){var It;return h.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:if(ae.current&&ye.current){jn.next=3;break}return n.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),jn.abrupt("return",wt());case 3:return jn.next=5,Object(J.n)({id:Ue,clazz:ae.current,description:ye.current});case 5:It=jn.sent,It.status===0&&n.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),Ot();case 8:case"end":return jn.stop()}},ct)}));return function(ct,Ot){return Ze.apply(this,arguments)}}())}})},Ta=function(Ue){mt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:Ue}}})},ha=function(Ue){mt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:Ue}}})},Na=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze,ct,Ot,wt;return h.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:if(Ze=He.item_type,!(Ze==="PROGRAM")){Fn.next=12;break}return ct=He.program_attr.identifier,Fn.next=5,mt({type:"problemset/startExperience",payload:{id:ct}});case 5:if(Ot=Fn.sent,!(Ot.status===0)){Fn.next=10;break}return wt=Ot.identifier,Object(aa.Q)("/myproblems/".concat(wt)),Fn.abrupt("return");case 10:return n.b.warn(Ot.message),Fn.abrupt("return");case 12:mt({type:"problemset/setActionTabs",payload:{key:Ze,params:He}});case 13:case"end":return Fn.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Sa=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze,ct,Ot;return h.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(!de.exam_id){It.next=6;break}return It.next=3,Object(J.K)({item_id:He,id:de.exam_id});case 3:return Ze=It.sent,Ze.status===0&&ln(),It.abrupt("return");case 6:if(!(de!=null&&de.exercise_id)){It.next=12;break}return It.next=9,Object(er.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:de==null?void 0:de.exercise_id,item_bank_ids:[He]}});case 9:return ct=It.sent,ct.status===0&&ln(),It.abrupt("return");case 12:return It.next=14,mt({type:"problemset/cancel",payload:{id:He,item_bank:1}});case 14:Ot=It.sent,Ot.status===0&&(ln(),yr());case 16:case"end":return It.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Oa=function(){var We=Object(o.a)(h.a.mark(function Ue(He){return h.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:de.page=1,de.per_page=20,de.group_id=Math.abs(He),on(de),qn(de);case 5:case"end":return ct.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Wa=function(){var We=Object(o.a)(h.a.mark(function Ue(He,Ze){var ct;return h.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if($n.current=!0,Er(!0),!Ze){wt.next=8;break}return wt.next=5,Object(J.G)({id:Math.abs(He)});case 5:wt.t0=wt.sent,wt.next=11;break;case 8:return wt.next=10,Object(J.F)({id:Math.abs(He)});case 10:wt.t0=wt.sent;case 11:ct=wt.t0,ct.status===0?ln():($n.current=!1,Er(!1));case 13:case"end":return wt.stop()}},Ue)}));return function(He,Ze){return We.apply(this,arguments)}}(),wa=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze,ct,Ot;return h.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(!de.exam_id){It.next=6;break}return It.next=3,Object(J.r)({exam_id:de.exam_id,item_bank_ids:[He]});case 3:return Ze=It.sent,Ze.status===0&&ln(),It.abrupt("return");case 6:if(!(de!=null&&de.exercise_id)){It.next=12;break}return It.next=9,Object(er.a)("/api/exercises/".concat(de==null?void 0:de.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[He]}});case 9:return ct=It.sent,ct.status===0&&ln(),It.abrupt("return");case 12:if(!(Lr===200)){It.next=15;break}return n.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),It.abrupt("return");case 15:return It.next=17,mt({type:"problemset/select",payload:{item_bank_ids:[He]}});case 17:Ot=It.sent,Ot.status===0&&(ln(),yr());case 19:case"end":return It.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),_a=function(){var We=Object(o.a)(h.a.mark(function Ue(He){return h.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(He){ct.next=3;break}if(me!=null&&me.length){ct.next=3;break}return ct.abrupt("return",n.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:xe.current=[0],c.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u79FB\u52A8\u5230",maskClosable:!0,className:"custom-modal-divider",icon:null,content:e.a.createElement("div",{className:"font14 ".concat(V.a.overflow),style:{maxHeight:500,overflow:"auto"}},e.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),e.a.createElement(K.a,{defaultValue:!0,value:xe.current,onChange:function(wt){return xe.current=wt}})),onOk:function(){var Ot=Object(o.a)(h.a.mark(function It(){var Fn,jn;return h.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return An.next=2,Object(J.g)({ids:He?[He]:me,groups_ids:(Fn=xe.current)===null||Fn===void 0?void 0:Fn[0]});case 2:jn=An.sent,xe.current=[],(jn==null?void 0:jn.status)===0&&ln();case 5:case"end":return An.stop()}},It)}));function wt(){return Ot.apply(this,arguments)}return wt}()});case 5:case"end":return ct.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Ra=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze,ct;return h.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(J.B)({clazz:"ItemBank",id:He});case 2:Ze=wt.sent,ct=(Ze==null?void 0:Ze.groups)||[],xe.current=[],c.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A\u64A4\u9500",cancelText:"\u53D6\u6D88",title:"\u672C\u9898\u5DF2\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:e.a.createElement("div",{className:"font14 ".concat(V.a.overflow)},e.a.createElement("p",{className:"c-grey-999"},"\u9009\u4E2D\u5E76\u786E\u5B9A\uFF0C\u5373\u64A4\u9500\u672C\u9898\u5BF9\u9009\u4E2D\u6559\u7814\u56E2\u961F\u7684\u5206\u4EAB"),e.a.createElement(b.a.Group,{className:V.a.checkbox,defaultValue:xe.current,onChange:function(Fn){return xe.current=Fn}},ct==null?void 0:ct.map(function(It){return e.a.createElement(b.a,{key:It.group_id,value:It.group_id},It.name)}))),onOk:function(){var It=Object(o.a)(h.a.mark(function jn(){return h.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return An.abrupt("return",new Promise(function(){var Br=Object(o.a)(h.a.mark(function Zr(hn,pn){var wn,or,Tr;return h.a.wrap(function(Sr){for(;;)switch(Sr.prev=Sr.next){case 0:if(xe.current.length){Sr.next=3;break}return n.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Sr.abrupt("return",pn());case 3:return or=ct==null||((wn=ct.map(function(oa){return oa.group_id}))===null||wn===void 0)?void 0:wn.filter(function(oa){return!xe.current.includes(oa)}),Sr.next=6,Object(J.k)({ids:[He],clazz:"ItemBank",group_ids:or});case 6:return Tr=Sr.sent,xe.current=[],(Tr==null?void 0:Tr.status)===0&&(n.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),ln()),Sr.abrupt("return",hn());case 10:case"end":return Sr.stop()}},Zr)}));return function(Zr,hn){return Br.apply(this,arguments)}}()));case 1:case"end":return An.stop()}},jn)}));function Fn(){return It.apply(this,arguments)}return Fn}()});case 6:case"end":return wt.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Qa=function(Ue){mt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:Ue}}})},Ja=function(){mt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:de}});return},Za=function(){var Ue={discipline_id:"&discipline_id=".concat(de.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(de.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(de.tag_discipline_id),difficulty:"&difficulty=".concat(de.difficulty),item_type:"&item_type=".concat(de.item_type),group_id:"&group_id=".concat(de.group_id||0)},He="/problemset/newitem?pages=".concat(de.page);Object.keys(Ue).forEach(function(Ze){de[Ze]&&(He=He+Ue[Ze])}),A.d===null||A.d===void 0||A.d.push(He)},ma=function(Ue){var He=me;if(!(He!=null&&He.length))return n.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(Lr+He.length>200&&Ue&&Ne){n.b.info("\u9898\u76EE\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-Lr,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(He.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}Ue?qa(He):ei(He)},qa=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze;return h.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:Ze=Object(T.a)(He),kt.forEach(function(wt){if(Ze.includes(wt.id)){var It;wt.item_type==="PROGRAM"&&((It=wt.program_attr)===null||It===void 0?void 0:It.status)===0&&Object(ot.remove)(Ze,function(Fn){return Fn===wt.id})}}),c.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",He.length,"\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u6216\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165"," "),onOk:function(){var wt=Object(o.a)(h.a.mark(function Fn(){var jn;return h.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if(!de.exam_id){An.next=6;break}return An.next=3,Object(J.r)({exam_id:de.exam_id,item_bank_ids:Ze});case 3:jn=An.sent,An.next=15;break;case 6:if(!(de!=null&&de.exercise_id)){An.next=12;break}return An.next=9,Object(er.a)("/api/exercises/".concat(de==null?void 0:de.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:Ze}});case 9:jn=An.sent,An.next=15;break;case 12:return An.next=14,mt({type:"problemset/select",payload:{item_bank_ids:Ze}});case 14:jn=An.sent;case 15:jn.status===0&&(ln(),yr());case 16:case"end":return An.stop()}},Fn)}));function It(){return wt.apply(this,arguments)}return It}()});case 3:case"end":return Ot.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),ei=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze;return h.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:if(!de.exam_id){Ot.next=6;break}return Ot.next=3,Object(er.a)("/api/examination_banks/".concat(de.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:He}});case 3:Ze=Ot.sent,Ot.next=15;break;case 6:if(!(de!=null&&de.exercise_id)){Ot.next=12;break}return Ot.next=9,Object(er.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:de==null?void 0:de.exercise_id,item_bank_ids:He}});case 9:Ze=Ot.sent,Ot.next=15;break;case 12:return Ot.next=14,mt({type:"problemset/unselectAll",payload:{item_ids:He}});case 14:Ze=Ot.sent;case 15:Ze.status===0&&(ln(),yr());case 16:case"end":return Ot.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Pa=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze;return h.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:if(!(Ne&&Lr===200)){Ot.next=3;break}return n.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),Ot.abrupt("return");case 3:if(!de.exam_id){Ot.next=10;break}return Ot.next=6,Object(J.r)({exam_id:de.exam_id,shixun_ids:He});case 6:Ze=Ot.sent,Ze.status===0&&ln(),Ot.next=14;break;case 10:return Ot.next=12,mt({type:"problemset/select",payload:{shixun_ids:He}});case 12:Ze=Ot.sent,Ze.status===0&&(yr(),ln());case 14:case"end":return Ot.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Ha=function(){mt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},va=function(Ue){var He,Ze,ct,Ot;if(!(me!=null&&me.length)&&!Ue){mt({type:"problemset/setActionTabs",payload:{key:"\u5171\u4EAB\u8BD5\u9898",params:de}});return}if(!((He=ft.teachGroupData)!==null&&He!==void 0&&(Ze=He.groups)!==null&&Ze!==void 0&&Ze.length))return n.b.info("\u60A8\u6682\u672A\u521B\u5EFA\u6216\u52A0\u5165\u4EFB\u4F55\u6559\u7814\u56E2\u961F\uFF0C\u8BF7\u524D\u5F80\u201C\u6211\u7684\u4E2A\u4EBA\u4E2D\u5FC3-\u6559\u7814\u56E2\u961F\u201D\u67E5\u770B");c.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:e.a.createElement("div",{className:"font14 ".concat(V.a.overflow)},e.a.createElement(b.a.Group,{className:V.a.checkbox,defaultValue:xe.current,onChange:function(It){return xe.current=It}},(ct=ft.teachGroupData)===null||ct===void 0||((Ot=ct.groups)===null||Ot===void 0)?void 0:Ot.map(function(wt){return e.a.createElement(b.a,{key:wt.group_id,value:wt.group_id},wt.name)}))),onOk:function(){return new Promise(function(){var It=Object(o.a)(h.a.mark(function Fn(jn,Gr){var An,Br;return h.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:if((An=xe.current)!==null&&An!==void 0&&An.length){hn.next=3;break}return n.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),hn.abrupt("return",Gr());case 3:return hn.next=5,Object(J.k)({ids:Ue?[Ue]:me,clazz:"ItemBank",group_ids:xe.current});case 5:Br=hn.sent,(Br==null?void 0:Br.status)===0&&(n.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),xe.current=[],Ce([]),ln(),jn());case 7:case"end":return hn.stop()}},Fn)}));return function(Fn,jn){return It.apply(this,arguments)}}())}})},ya=function(){var Ue=function(){var He=Object(o.a)(h.a.mark(function Ze(){var ct;return h.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return qt(!0),wt.next=3,Object(J.i)({ids:me});case 3:ct=wt.sent,qt(!1),(ct==null?void 0:ct.status)===0&&c.a.info({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u5220\u9664\u7ED3\u679C",maskClosable:!1,keyboard:!1,icon:null,content:"\u672C\u6B21\u6210\u529F\u5220\u9664".concat(ct.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(ct.fail,"\u6761\u8BD5\u9898\u56E0\u4E3A\u516C\u5F00\u65E0\u6CD5\u5220\u9664\uFF0C\u8BF7\u64A4\u9500\u540E\u518D\u8FDB\u884C\u5220\u9664\u3002"),onOk:function(){Jr(new Array(ct.success))}});case 6:case"end":return wt.stop()}},Ze)}));return function(){return He.apply(this,arguments)}}();if(me!=null&&me.length){c.a.confirm({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u63D0\u793A",cancelText:"\u53D6\u6D88",icon:null,content:"\u672C\u6B21\u9009\u4E2D\u4E86".concat(me==null?void 0:me.length,"\u6761\u8BD5\u9898\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF0C\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"),onOk:Ue});return}n.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},Aa=function(){var Ue,He;if(!(me!=null&&me.length))return n.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(kt!=null&&(Ue=kt.filter(function(Ze){return me.includes(Ze.id)}))!==null&&Ue!==void 0&&Ue.every(function(Ze){return Ze.public}))return n.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(kt!=null&&(He=kt.filter(function(Ze){return me.includes(Ze.id)}))!==null&&He!==void 0&&He.find(function(Ze){var ct;return Ze.item_type==="PROGRAM"&&((ct=Ze.program_attr)===null||ct===void 0?void 0:ct.status)===0}))return n.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||Et.userInfo.professional_certification?Da():c.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:e.a.createElement("div",{className:"font16 c-grey-333"},"\u516C\u5F00\u5E76\u7ECF\u5E73\u53F0\u5BA1\u6838\u540E\uFF0C\u8BE5\u9898\u5C06\u5728\u516C\u5171\u8BD5\u9898\u5E93\u53EF\u89C1\uFF0CEducoder\u6240\u6709\u7528\u6237\u5747\u53EF\u4F7F\u7528\u8BE5\u9898\u3002",e.a.createElement("br",null),"\u516C\u5F00\u540E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u4F46\u53EF\u4EE5\u64A4\u9500\uFF1B\u64A4\u9500\u516C\u5F00\u540E\u53EF\u4EE5\u4FEE\u6539\u3002",e.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",e.a.createElement("br",null),e.a.createElement(b.a,{className:"mt10",defaultChecked:!1,onChange:function(ct){return Pe.current=ct.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Da()}})},Da=function(){var We=Object(o.a)(h.a.mark(function Ue(He){var Ze,ct;return h.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return Ze=Kn==="3"?1:2,wt.next=3,Object(J.h)({ids:He?[He]:me,source:Ze});case 3:ct=wt.sent,ct.status===0&&(Pe.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Pe.current=!1,Ce([]),ln());case 5:case"end":return wt.stop()}},Ue)}));return function(He){return We.apply(this,arguments)}}(),Ua=function(Ue){c.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:e.a.createElement(e.a.Fragment,null,e.a.createElement("div",{className:V.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),e.a.createElement("div",{className:V.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var He=Object(o.a)(h.a.mark(function ct(){var Ot;return h.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(J.J)({identifier:Ue});case 2:Ot=It.sent,(Ot==null?void 0:Ot.status)===0&&(n.b.success("\u53D1\u5E03\u6210\u529F"),ln());case 4:case"end":return It.stop()}},ct)}));function Ze(){return He.apply(this,arguments)}return Ze}()})},Ma=function(Ue){c.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:e.a.createElement("p",{className:V.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var He=Object(o.a)(h.a.mark(function ct(){var Ot;return h.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(J.I)({identifier:Ue});case 2:Ot=It.sent,(Ot==null?void 0:Ot.status)===0&&(n.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),ln());case 4:case"end":return It.stop()}},ct)}));function Ze(){return He.apply(this,arguments)}return Ze}()})},ja=function(Ue){de.page=1,de.group_id=Ue[0]||null,delete de.id,on(de),qn(de)},za=function(Ue){de.sort_by=Ue.type,de.sort_direction=Ue.direction,de.page=1,de.per_page=20,In(Ue.name),on(de),qn(de)},Ba=function(){de.page=1,on(de),qn(de)},Fa=function(Ue){de.discipline_id="",de.sub_discipline_id="",de.tag_discipline_id="",de.item_type=null,de.difficulty=null,de.page=1,de.per_page=20,de.group_id=Ue,Dn(-1),on(de),qn(de)},Ga=function(){if(!(me!=null&&me.length)){mt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:de}});return}c.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:e.a.createElement("div",{className:"font14 ".concat(V.a.overflow)},"\u5DF2\u9009\u4E2D",me==null?void 0:me.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(Te.k)({ids:me})}})},ai=e.a.createElement(R.a,null,un&&e.a.createElement(R.a.Item,{onClick:function(){return ma(!0)}},"\u6279\u91CF\u52A0\u5165"),un&&e.a.createElement(R.a.Item,{onClick:function(){return ma(!1)}},"\u6279\u91CF\u79FB\u51FA"),Kn==="0"&&Ne&&e.a.createElement(R.a.Item,{onClick:function(){return _a()}},"\u79FB\u52A8\u5230"),Kn==="0"&&Ne&&e.a.createElement(R.a.Item,{onClick:Aa},"\u6279\u91CF\u516C\u5F00"),Kn==="0"&&Ne&&e.a.createElement(R.a.Item,{onClick:function(){return va()}},"\u6279\u91CF\u5171\u4EAB"),Kn==="0"&&Ne&&e.a.createElement(R.a.Item,{onClick:ya},"\u6279\u91CF\u5220\u9664")),Va=function(Ue){Ce(Ue)},Xa=function(Ue){Ce(Ue?kt==null?void 0:kt.map(function(He){return He.id}):[])},ti=function(){var Ue="/problemset/preview";if(de.exam_id&&(Ue="/paperlibrary/edit/".concat(de.exam_id)),de!=null&&de.exercise_id){var He;Ue="/classrooms/".concat(dt==null||((He=dt.params)===null||He===void 0)?void 0:He.coursesId,"/exercise/").concat(de==null?void 0:de.exercise_id,"/edit")}A.d.push(Ue)},$a=[{value:"SINGLE",name:"\u5355\u9009\u9898"},{value:"MULTIPLE",name:"\u591A\u9009\u9898"},{value:"JUDGMENT",name:"\u5224\u65AD\u9898"},{value:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{value:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{value:"COMPLETION",name:"\u586B\u7A7A\u9898"},{value:"COMBINATION",name:"\u63A5\u9F99\u9898"}],La={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Ya=function(Ue,He){var Ze,ct=He.id<0?"--":un?He[de.exercise_id?"added":"choosed"]?e.a.createElement("span",{key:1,className:V.a.btnCancel,onClick:function(It){It.target.style.pointerEvents="none",Sa(He.id)}},Ne?"\u79FB\u51FA\u9898\u76EE\u7BEE":e.a.createElement("span",null,e.a.createElement("b",{className:"iconfont icon-yichu ".concat(V.a.cancelC)}),"\u79FB\u51FA")):He.item_type==="PROGRAM"&&((Ze=He.program_attr)===null||Ze===void 0?void 0:Ze.status)===0?e.a.createElement(E.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},e.a.createElement("span",{className:V.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}},Ne?"\u52A0\u5165\u9898\u76EE\u7BEE":e.a.createElement("span",{style:{padding:"0 3px"}},e.a.createElement("b",{className:"iconfont icon-jiaru ".concat(V.a.addC)}),"\u52A0\u5165")," ")):e.a.createElement("span",{className:V.a.btnAdd,onClick:function(){return wa(He.id)}},Ne?"\u52A0\u5165\u9898\u76EE\u7BEE":e.a.createElement("span",{style:{padding:"0 3px"}},e.a.createElement("b",{className:"iconfont icon-jiaru ".concat(V.a.addC)}),"\u52A0\u5165")):e.a.createElement(e.a.Fragment,null),Ot=e.a.createElement("span",{className:V.a.actonBtn},ct,He.id>0&&e.a.createElement(Vr,{isProblemset:Ne,user:Et,key:He.id,data:He,activeTabsKey:Kn,selectIds:me,onCollect:Jn,onSetPublic:Bn,onStartExperience:Na,onCorrection:Ia,onPublicReview:ia,onSetPrivate:Ta,onDelete:ha,onCancel:Sa,onSelect:wa,onMoveTo:_a,onSetShare:_r,onCancelShare:Ra,onPublish:Ua,onCancelPublish:Ma}));return Ot},ii=[{title:Kn==="0"?"\u6587\u4EF6\u5939/\u9898\u76EE":"\u9898\u76EE",dataIndex:"name",key:"name",align:"left",render:function(Ue,He){return He.id>0?e.a.createElement(Fr,{isProblemset:Ne,user:Et,key:He.id,data:He,activeTabsKey:Kn,selectIds:me,onCollect:Jn,onSetPublic:Bn,onStartExperience:Na,onCorrection:Ia,onPublicReview:ia,onSetPrivate:Ta,onDelete:ha,onCancel:Sa,onSelect:wa,onMoveTo:_a,onSetShare:_r,onCancelShare:Ra,onPublish:Ua,onCancelPublish:Ma}):e.a.createElement(ea,{isProblemset:Ne,onRenameOk:ln,onDeleteOk:Jr,user:Et,key:He.id,data:He,onOpen:Oa,onMove:Wa})}},{title:"\u9898\u578B",dataIndex:"item_type",key:"item_type",align:"center",width:60,render:function(Ue){var He,Ze;return e.a.createElement("div",null,((He=((vt==null||((Ze=vt.setting)===null||Ze===void 0)?void 0:Ze.question_type_alias)||$a).find(function(ct){return ct.value===Ue}))===null||He===void 0?void 0:He.name)||"--")}},{title:"\u96BE\u6613\u5EA6",dataIndex:"difficulty",key:"difficulty",align:"center",width:60,render:function(Ue,He){return e.a.createElement("span",null,(He==null?void 0:He.id)<0?"--":La[Ue])}},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"quotes",key:"quotes",align:"center",ellipsis:!0,width:80,render:function(Ue,He){return e.a.createElement("span",null,(He==null?void 0:He.id)<0?"--":Ue)}},{title:"\u521B\u5EFA\u8005",dataIndex:"author",key:"author",ellipsis:!0,align:"center",width:94,render:function(Ue){return e.a.createElement("span",null,Ue==null?void 0:Ue.name)}},{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline",key:"tag_discipline",align:"center",width:146,render:function(Ue){return e.a.createElement("span",null,Ue||"--")}},{title:"\u66F4\u65B0\u65F6\u95F4",dataIndex:"updated_at",key:"updated_at",align:"center",width:146,render:function(Ue,He){return e.a.createElement("span",null,(He==null?void 0:He.id)<0?"--":Ue)}},{title:"\u64CD\u4F5C",dataIndex:"choosed",key:"choosed",align:"center",width:146,render:Ya}];return e.a.createElement(d.Fragment,null,e.a.createElement("section",null,e.a.createElement("div",{className:V.a.wrap},e.a.createElement("div",{className:V.a.title},"\u8BD5\u9898\u5E93"),e.a.createElement(M.a,{showSelectAll:!1,className:V.a.select,question_type_alias:vt==null||((Ht=vt.setting)===null||Ht===void 0)?void 0:Ht.question_type_alias,disciplinesData:(Ut=ft.disciplinesData)===null||Ut===void 0?void 0:Ut.disciplines,knowledgeData:Ar,directionValue:de.discipline_id,subDisciplineValue:de.sub_discipline_id,typeValue:de.item_type,showKnowledge:!0,knowledgeValue:dr,difficultyValue:de.difficulty,showShixun:!Object(Gn.m)()&&!de.exercise_id,onShixunChange:Ha,onDirectionChange:gr,onTypeChange:Ir,onDifficultyChange:wr,onKnowledgeChange:xr}),e.a.createElement("div",{className:V.a.contentWrap},e.a.createElement("div",{className:V.a.tabsWrap},e.a.createElement(a.a,{activeKey:Kn,onChange:da,tabBarExtraContent:e.a.createElement("div",{className:V.a.searchWrap},Kn==="0"&&Ne&&e.a.createElement("div",{className:V.a.searchContent},e.a.createElement(S.a,{type:"primary",ghost:!0,onClick:Ja,className:"mr20"},e.a.createElement("i",{className:"iconfont icon-xinjianwenjianjia mr5 font14"}),"\u65B0\u5EFA\u6587\u4EF6\u5939"),e.a.createElement(S.a,{type:"primary",className:"mr30",ghost:!0,onClick:Za},e.a.createElement("i",{className:"iconfont icon-xinzengshiti2 mr5 font14"}),"\u65B0\u589E\u8BD5\u9898")),e.a.createElement(Yr,{allowClear:!0,className:V.a.search,style:{width:300},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",value:de.keyword,onChange:function(Ue){de.keyword=Ue.target.value,on(Object(N.a)({},de))},onSearch:pa}))},e.a.createElement(nr,{tab:"\u516C\u5171",key:"1"}),((xt=ft.teachGroupData)===null||xt===void 0||((zt=xt.groups)===null||zt===void 0)?void 0:zt.length)&&e.a.createElement(nr,{tab:"\u6559\u7814\u5171\u4EAB",key:"3"}),!Object(Gn.o)()&&!Object(Gn.m)()&&e.a.createElement(nr,{tab:"\u6536\u85CF\u5939",key:"2"}),e.a.createElement(nr,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),e.a.createElement("div",{className:V.a.batchWrap},e.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},e.a.createElement("div",{className:"font14"},e.a.createElement(x.a,{overlay:e.a.createElement(R.a,{selectedKeys:[vn]},Dr==null?void 0:Dr.map(function(We,Ue){return e.a.createElement(R.a.Item,{key:We.name,onClick:function(){return za(We)}},We.name)}))},e.a.createElement("span",{style:{color:"#464F66"}},e.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),vn))),Kn==="3"&&e.a.createElement("div",{style:{paddingTop:20,marginLeft:20}},e.a.createElement(na,{dispatch:mt,problemset:ft,groupIds:de.group_id?[de.group_id]:[],onChangeTeachGroup:ja}))),e.a.createElement("div",null,Kn==="0"&&Ne&&e.a.createElement(e.a.Fragment,null,e.a.createElement(S.a,{onClick:function(){return A.d.push("/problemset/statistics")},type:"link"},e.a.createElement(F.a,{style:{color:"#0152d9"}}),e.a.createElement("span",{className:"c-light-primary"},"\u7EDF\u8BA1\u5206\u6790")),e.a.createElement(S.a,{onClick:Ga,type:"link"},e.a.createElement("i",{className:"iconfont icon-daochushiti mr5 c-light-primary"}),e.a.createElement("span",{className:"c-light-primary"},"\u5BFC\u51FA\u8BD5\u9898"))))),cr?e.a.createElement("div",null,e.a.createElement(S.a,{style:{paddingLeft:0,marginLeft:25},onClick:function(){de.page=1,de.keyword=null,delete de.id,on(de),Zn(!1),qn(de)},type:"link"},e.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),e.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",de.keyword,"\u201D")):Kn==="0"?e.a.createElement("div",{style:{overflow:"hidden",height:On===1?208:"auto"},ref:Nn,className:V.a.treeWarp},e.a.createElement($,{data:ir,onClick:Oa}),e.a.createElement(U.a,{spinning:lr},Hn==null?void 0:Hn.map(function(We){return e.a.createElement(ea,{isProblemset:Ne,onRenameOk:function(){$n.current=!0,ln()},onDeleteOk:function(){$n.current=!0,ln()},user:Et,key:We.id,data:We,onOpen:Oa,onMove:Wa})})),!!On&&e.a.createElement("div",{className:V.a.action},On===1&&e.a.createElement("span",{onClick:function(){return Ft(2)}},"\u5C55\u5F00",e.a.createElement("i",{className:"iconfont icon-xiala"})),On===2&&e.a.createElement("span",{onClick:function(){return Ft(1)}},"\u6536\u8D77",e.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))):null,e.a.createElement("div",{className:V.a.contentListWrap},yt!==0?e.a.createElement(U.a,{size:"large",spinning:Lt["problemset/getItemBanks"]},kt.map(function(We,Ue){var He,Ze,ct;return e.a.createElement("div",{className:V.a.li},e.a.createElement("div",{className:V.a.top},e.a.createElement(Fr,{isProblemset:Ne,user:Et,key:We.id,data:We,activeTabsKey:Kn,selectIds:me,onCollect:Jn,onSetPublic:Bn,onStartExperience:Na,onCorrection:Ia,onPublicReview:ia,onSetPrivate:Ta,onDelete:ha,onCancel:Sa,onSelect:wa,onSelectCheckBox:Va,onMoveTo:_a,onSetShare:_r,onCancelShare:Ra,onPublish:Ua,onCancelPublish:Ma})),e.a.createElement("div",{className:V.a.bottom},e.a.createElement("p",{className:V.a.actionLeftItem},(He=((vt==null||((Ze=vt.setting)===null||Ze===void 0)?void 0:Ze.question_type_alias)||$a).find(function(Ot){return Ot.value===We.item_type}))===null||He===void 0?void 0:He.name),e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},La[We.difficulty]),e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},"\u521B\u5EFA\u8005:",e.a.createElement("span",{className:"c-grey-333"},We==null||((ct=We.author)===null||ct===void 0)?void 0:ct.name)),e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},"\u66F4\u65B0:",e.a.createElement("span",{className:"c-grey-333"},We==null?void 0:We.updated_at)),e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},"\u4F7F\u7528\u9891\u5EA6:",e.a.createElement("span",{className:"c-grey-333"},We==null?void 0:We.quotes)),e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},"\u6B63\u786E\u7387:",e.a.createElement("span",{className:"c-grey-333"},We==null?void 0:We.right_rate)),(We==null?void 0:We.item_type)==="PROGRAM"&&e.a.createElement(e.a.Fragment,null,e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},"\u5E73\u5747\u5B8C\u6210\u65F6\u95F4:",e.a.createElement("span",{className:"c-grey-333"},We==null?void 0:We.cost_time))),(We==null?void 0:We.item_type)==="PROGRAM"&&e.a.createElement(e.a.Fragment,null,e.a.createElement("i",{className:V.a.line}),e.a.createElement("p",{className:V.a.actionLeftItem},"\u5E73\u5747\u6B63\u786E\u4EE3\u7801\u884C\u6570:",e.a.createElement("span",{className:"c-grey-333"},We==null?void 0:We.right_code_count))),e.a.createElement("div",{className:V.a.more},Ya({},We))))})):e.a.createElement(U.a,{size:"large",spinning:Lt["problemset/getItemBanks"]},e.a.createElement(pe.a,null))),yt!==0&&e.a.createElement(B.a,{showSizeChanger:!1,showQuickJumper:!0,onChange:ca,defaultCurrent:1,pageSize:de==null?void 0:de.per_page,current:de.page||1,total:yt,showTotal:function(Ue){return e.a.createElement("span",{className:"mr10"},"\u5171",e.a.createElement("span",{className:"c-orange"},Ue),"\u6761\u6570\u636E")}})),Ne&&e.a.createElement(Dt,{basketData:ft.basketData,visible:ba,basketTotal:Lr,onClose:function(){return Ea(!1)},onDelete:Qa}),!Object(Gn.m)()&&Ne&&e.a.createElement(yn,{visibleBasket:ba,onToggleVisible:function(){return Ea(!ba)},count:Lr})),e.a.createElement(ve,null),e.a.createElement(Qe,{onReloadData:ln}),e.a.createElement(ze,{onReloadData:function(){return Jr([null])}}),e.a.createElement(sn,{onReloadData:ln,onReloadBasketData:yr}),e.a.createElement(Kr,{shixunIds:ee,cb:Pa}),e.a.createElement(rt,null),e.a.createElement(bt,null),e.a.createElement(Oe,null),e.a.createElement(Ye,null),e.a.createElement(Ge,null),e.a.createElement(Ve,{onOk:Ba}),e.a.createElement(se,{onOk:Fa})),Ne?e.a.createElement(d.Fragment,null,!!(me!=null&&me.length)&&e.a.createElement("div",{className:V.a.batch},e.a.createElement("aside",null,e.a.createElement("div",{style:{flexShrink:0,marginRight:20}},e.a.createElement(b.a,{className:"font14",checked:kt!=null&&kt.length?me.length===(kt==null?void 0:kt.length):!1,onChange:function(Ue){return Xa(Ue.target.checked)}},"\u672C\u9875\u5168\u9009",e.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",me==null?void 0:me.length,")"))),e.a.createElement("div",{className:V.a.btns},un&&e.a.createElement("div",{className:V.a.btn,onClick:function(){return ma(!0)}},e.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),un&&e.a.createElement("div",{className:V.a.btn,onClick:function(){return ma(!1)}},e.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),Kn==="0"&&e.a.createElement("div",{className:V.a.btn,onClick:function(){return _a()}},e.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),Kn==="0"&&e.a.createElement("div",{className:V.a.btn,onClick:Aa},e.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Kn==="0"&&e.a.createElement("div",{className:V.a.btn,onClick:function(){return va()}},e.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),Kn==="0"&&e.a.createElement("div",{className:V.a.btn,onClick:ya},e.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),e.a.createElement("div",{onClick:function(){return Ce([])},style:{marginLeft:"auto"},className:V.a.btn},e.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):e.a.createElement("div",{className:V.a.batch},e.a.createElement("aside",null,e.a.createElement("div",{style:{flexShrink:0,marginRight:20}},e.a.createElement(b.a,{className:"font14",checked:kt!=null&&kt.length?me.length===(kt==null?void 0:kt.length):!1,onChange:function(Ue){return Xa(Ue.target.checked)}},"\u672C\u9875\u5168\u9009",e.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",me==null?void 0:me.length,")"))),e.a.createElement("div",{className:V.a.btns},un&&!!(me!=null&&me.length)&&e.a.createElement("div",{className:V.a.btn,onClick:function(){return ma(!0)}},e.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),un&&!!(me!=null&&me.length)&&e.a.createElement("div",{className:V.a.btn,onClick:function(){return ma(!1)}},e.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),e.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",Xn,"\u9898"),e.a.createElement("div",{onClick:ti,className:V.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))))},fa=Fe.default=Object(A.a)(function(Bt){var ke=Bt.problemset,ut=Bt.user,Je=Bt.loading,et=Bt.globalSetting;return{problemset:ke,user:ut,globalSetting:et,loading:Je.effects}})(la)},LdHM:function(Ct,Fe,j){"use strict";j.d(Fe,"b",function(){return l}),j.d(Fe,"a",function(){return c});var he=j("1OyB"),B=j("vuIU"),w=j("Ji7U"),U=j("LK+K"),_=j("q1tI"),x=j("rePB"),N=j("Ff2n"),I=j("ODXe"),S=j("4IlW"),P=j("bX4T"),E=j("YrtM"),O=j("TSYQ"),R=j.n(O),T=j("+nKL"),C=j("8OUc"),b=function(K,J){var oe=K.prefixCls,se=K.id,pe=K.flattenOptions,be=K.childrenAsData,Q=K.values,te=K.searchValue,ve=K.multiple,q=K.defaultActiveFirstOption,X=K.height,Te=K.itemHeight,Ie=K.notFoundContent,Ge=K.open,Ae=K.menuItemSelectedIcon,Me=K.virtual,Se=K.onSelect,Le=K.onToggleOpen,Ve=K.onActiveValue,$e=K.onScroll,Qe=K.onMouseEnter,Be="".concat(oe,"-item"),ze=Object(E.a)(function(){return pe},[Ge,pe],function(Ke,ce){return ce[0]&&Ke[1]!==ce[1]}),ot=_.useRef(null),Re=function(ce){ce.preventDefault()},nt=function(ce){ot.current&&ot.current.scrollTo({index:ce})},rt=function(ce){for(var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=ze.length,$=0;$<ie;$+=1){var Y=(ce+$*re+ie)%ie,V=ze[Y],ne=V.group,_e=V.data;if(!ne&&!_e.disabled)return Y}return-1},lt=_.useState(function(){return rt(0)}),bt=Object(I.a)(lt,2),Ee=bt[0],Oe=bt[1],je=function(ce){Oe(ce);var re=ze[ce];if(!re){Ve(null,-1);return}Ve(re.data.value,ce)};_.useEffect(function(){je(q!==!1?rt(0):-1)},[ze.length,te]),_.useEffect(function(){var Ke=setTimeout(function(){if(!ve&&Ge&&Q.size===1){var ce=Array.from(Q)[0],re=ze.findIndex(function(ie){var $=ie.data;return $.value===ce});je(re),nt(re)}});return function(){return clearTimeout(Ke)}},[Ge]);var Ye=function(ce){ce!==void 0&&Se(ce,{selected:!Q.has(ce)}),ve||Le(!1)};if(_.useImperativeHandle(J,function(){return{onKeyDown:function(ce){var re=ce.which;switch(re){case S.a.UP:case S.a.DOWN:{var ie=0;if(re===S.a.UP?ie=-1:re===S.a.DOWN&&(ie=1),ie!==0){var $=rt(Ee+ie,ie);nt($),je($)}break}case S.a.ENTER:{var Y=ze[Ee];Y&&!Y.data.disabled?Ye(Y.data.value):Ye(void 0),Ge&&ce.preventDefault();break}case S.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(ce){nt(ce)}}}),ze.length===0)return _.createElement("div",{role:"listbox",id:"".concat(se,"_list"),className:"".concat(Be,"-empty"),onMouseDown:Re},Ie);function De(Ke){var ce=ze[Ke];if(!ce)return null;var re=ce.data||{},ie=re.value,$=re.label,Y=re.children,V=Object(P.a)(re,!0),ne=be?Y:$;return ce?_.createElement("div",Object.assign({"aria-label":typeof ne=="string"?ne:null},V,{key:Ke,role:"option",id:"".concat(se,"_list_").concat(Ke),"aria-selected":Q.has(ie)}),ie):null}return _.createElement(_.Fragment,null,_.createElement("div",{role:"listbox",id:"".concat(se,"_list"),style:{height:0,width:0,overflow:"hidden"}},De(Ee-1),De(Ee),De(Ee+1)),_.createElement(T.a,{itemKey:"key",ref:ot,data:ze,height:X,itemHeight:Te,fullHeight:!1,onMouseDown:Re,onScroll:$e,virtual:Me,onMouseEnter:Qe},function(Ke,ce){var re,ie=Ke.group,$=Ke.groupOption,Y=Ke.data,V=Y.label,ne=Y.key;if(ie)return _.createElement("div",{className:R()(Be,"".concat(Be,"-group"))},V!==void 0?V:ne);var _e=Y.disabled,we=Y.value,Xe=Y.title,gt=Y.children,Nt=Y.style,ht=Y.className,en=Object(N.a)(Y,["disabled","value","title","children","style","className"]),tn=Q.has(we),Dt="".concat(Be,"-option"),_n=R()(Be,Dt,ht,(re={},Object(x.a)(re,"".concat(Dt,"-grouped"),$),Object(x.a)(re,"".concat(Dt,"-active"),Ee===ce&&!_e),Object(x.a)(re,"".concat(Dt,"-disabled"),_e),Object(x.a)(re,"".concat(Dt,"-selected"),tn),re)),fn=be?gt:V,sn=!Ae||typeof Ae=="function"||tn;return _.createElement("div",Object.assign({},en,{"aria-selected":tn,className:_n,title:Xe,onMouseMove:function(){if(Ee===ce||_e)return;je(ce)},onClick:function(){_e||Ye(we)},style:Nt}),_.createElement("div",{className:"".concat(Dt,"-content")},fn||we),_.isValidElement(Ae)||tn,sn&&_.createElement(C.a,{className:"".concat(Be,"-option-state"),customizeIcon:Ae,customizeIconProps:{isSelected:tn}},tn?"\u2713":null))}))},m=_.forwardRef(b);m.displayName="OptionList";var n=m,s=function(){return null};s.isSelectOption=!0;var l=s,y=function(){return null};y.isSelectOptGroup=!0;var c=y,o=j("VTBJ"),v=j("Zm9Q");function f(Z){var K=Z.key,J=Z.props,oe=J.children,se=J.value,pe=Object(N.a)(J,["children","value"]);return Object(o.a)({key:K,value:se!==void 0?se:K,children:oe},pe)}function i(Z){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(v.a)(Z).map(function(J,oe){if(!_.isValidElement(J)||!J.type)return null;var se=J.type.isSelectOptGroup,pe=J.key,be=J.props,Q=be.children,te=Object(N.a)(be,["children"]);return K||!se?f(J):Object(o.a)(Object(o.a)({key:"__RC_SELECT_GRP__".concat(pe===null?oe:pe,"__"),label:pe},te),{},{options:i(Q)})}).filter(function(J){return J})}var r=j("2Qr1"),t=j("qNPg"),a=j("U8pU"),g=j("Kwbf"),h=j("WKfj");function d(Z){var K=Z.mode,J=Z.options,oe=Z.children,se=Z.backfill,pe=Z.allowClear,be=Z.placeholder,Q=Z.getInputElement,te=Z.showSearch,ve=Z.onSearch,q=Z.defaultOpen,X=Z.autoFocus,Te=Z.labelInValue,Ie=Z.value,Ge=Z.inputValue,Ae=Z.optionLabelProp,Me=K==="multiple"||K==="tags",Se=te!==void 0?te:Me||K==="combobox",Le=J||i(oe);if(Object(g.a)(K!=="tags"||Le.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Ve=Le.some(function(Be){return Be.options?Be.options.some(function(ze){return typeof("value"in ze?ze.value:ze.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(g.a)(!Ve,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(g.a)(K!=="combobox"||!Ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(g.a)(K==="combobox"||!se,"`backfill` only works with `combobox` mode."),Object(g.a)(K==="combobox"||!Q,"`getInputElement` only work with `combobox` mode."),Object(g.b)(K!=="combobox"||!Q||!pe||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ve&&!Se&&K!=="combobox"&&K!=="tags"&&Object(g.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(g.b)(!q||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ie!=null){var $e=Object(h.d)(Ie);Object(g.a)(!Te||$e.every(function(Be){return Object(a.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(g.a)(!Me||Array.isArray(Ie),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Qe=null;Object(v.a)(oe).some(function(Be){if(!_.isValidElement(Be)||!Be.type)return!1;var ze=Be.type;if(ze.isSelectOption)return!1;if(ze.isSelectOptGroup){var ot=Object(v.a)(Be.props.children).every(function(Re){return!_.isValidElement(Re)||!Be.type||Re.type.isSelectOption?!0:(Qe=Re.type,!1)});return!ot}return Qe=ze,!0}),Qe&&Object(g.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Qe.displayName||Qe.name||Qe,"`.")),Object(g.a)(Ge===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var e=d,A=Object(t.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:i,flattenOptions:r.d,getLabeledValue:r.e,filterOptions:r.b,isValueDisabled:r.g,findValueOption:r.c,warningProps:e,fillOptionsWithMissingValue:r.a}),M=function(Z){Object(w.a)(J,Z);var K=Object(U.a)(J);function J(){var oe;return Object(he.a)(this,J),oe=K.apply(this,arguments),oe.selectRef=_.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(B.a)(J,[{key:"render",value:function(){return _.createElement(A,Object.assign({ref:this.selectRef},this.props))}}]),J}(_.Component);M.Option=l,M.OptGroup=c;var F=M,W=Fe.c=F},NLgs:function(Ct,Fe,j){"use strict";j.d(Fe,"e",function(){return y}),j.d(Fe,"f",function(){return c}),j.d(Fe,"d",function(){return v}),j.d(Fe,"c",function(){return f}),j.d(Fe,"a",function(){return i}),j.d(Fe,"b",function(){return r});var he=j("miYZ"),B=j("tsqr"),w=j("9og8"),U=j("2qtc"),_=j("kLXV"),x=j("WmNS"),N=j.n(x),I=j("q1tI"),S=j.n(I),P=j("9kvl"),E=j("xKgJ"),O=j("1vsH"),R=j("RCxd"),T=j("mOS8"),C=j.n(T),b=j("1ZF9"),m=j.n(b),n=j("WdTA"),s=j.n(n),l=j("m3rI"),y=function(a){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(c(a)&&o(g))},c=function(a){return Object(E.p)()?!0:(a({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},o=function(){var a,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,h=Object(P.c)()._store.getState(),d=h.user;return(a=d.userInfo)!==null&&a!==void 0&&a.profile_completed?!0:(_.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:g?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){P.d.push("/account/profile/edit")}}),!1)},v=function(){var a,g=Object(P.c)()._store.getState(),h=g.user;return(a=h.userInfo)!==null&&a!==void 0&&a.professional_certification?!0:(_.a.confirm({title:"\u63D0\u793A",centered:!0,content:S.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(O.Q)("/account/certification")}}),!1)},f=function(){return Object(E.a)()?!0:(_.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:S.a.createElement("div",{className:"tc",style:{marginLeft:-38}},S.a.createElement("p",null,"\u60A8\u53EF\u4EE5\u626B\u7801\u52A0\u7FA4@\u7FA4\u7BA1\u7406\u5458\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650\u54E6\uFF01"),S.a.createElement("img",{src:Object(E.t)()?s.a:"".concat(l.a.IMG_SERVER,"/images/educoder/qqqun20191230.png"),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},i=function(a,g){return a?!0:(_.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:S.a.createElement("div",null,S.a.createElement("p",null,g||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),S.a.createElement("div",{style:{marginLeft:"110px"}},S.a.createElement("img",{src:m.a,width:200}),S.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(O.Q)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},r=function(a){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",h=Object(P.c)()._store.getState(),d=h.shixunsDetail.detail;return(d==null?void 0:d.public)===2||(d==null?void 0:d.public)===1||(d==null?void 0:d.shixun_status)===3?(_.a.info({centered:!0,icon:S.a.createElement(R.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:S.a.createElement("div",{className:"tc",style:{marginLeft:-38}},S.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},S.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(d==null?void 0:d.public)===2?"\u5DF2\u516C\u5F00":(d==null?void 0:d.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",g,"\u3002"),S.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),S.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:C.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(d==null?void 0:d.shixun_status)===2?(_.a.confirm({centered:!0,icon:S.a.createElement(R.a,null),title:"\u63D0\u793A",content:S.a.createElement("div",null,S.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",g,"\u3002"),S.a.createElement("br",null),S.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){_.a.confirm({width:440,centered:!0,icon:S.a.createElement(R.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var A=Object(w.a)(N.a.mark(function F(){var W;return N.a.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return K.next=2,a({type:"shixunsDetail/cancelRelease",payload:{id:d==null?void 0:d.identifier}});case 2:W=K.sent,W.status!==401&&(B.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),a({type:"shixunsDetail/getShixunsDetail",payload:{id:d==null?void 0:d.identifier}}),a({type:"practiceSetting/getCommonData",payload:{id:d==null?void 0:d.identifier}}));case 4:case"end":return K.stop()}},F)}));function M(){return A.apply(this,arguments)}return M}()})}}),!0):!1}},NvD2:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return x});var he=j("Kwbf");function B(N,I){var S=new Set;return N.forEach(function(P){I.has(P)||S.add(P)}),S}function w(N){var I=N||{},S=I.disabled,P=I.disableCheckbox,E=I.checkable;return!!(S||P)||E===!1}function U(N,I,S,P){for(var E=new Set(N),O=new Set,R=0;R<=S;R+=1){var T=I.get(R)||new Set;T.forEach(function(n){var s=n.key,l=n.node,y=n.children,c=y===void 0?[]:y;E.has(s)&&!P(l)&&c.filter(function(o){return!P(o.node)}).forEach(function(o){E.add(o.key)})})}for(var C=new Set,b=S;b>=0;b-=1){var m=I.get(b)||new Set;m.forEach(function(n){var s=n.parent,l=n.node;if(P(l)||!n.parent||C.has(n.parent.key))return;if(P(n.parent.node)){C.add(s.key);return}var y=!0,c=!1;(s.children||[]).filter(function(o){return!P(o.node)}).forEach(function(o){var v=o.key,f=E.has(v);y&&!f&&(y=!1),!c&&(f||O.has(v))&&(c=!0)}),y&&E.add(s.key),c&&O.add(s.key),C.add(s.key)})}return{checkedKeys:Array.from(E),halfCheckedKeys:Array.from(B(O,E))}}function _(N,I,S,P,E){for(var O=new Set(N),R=new Set(I),T=0;T<=P;T+=1){var C=S.get(T)||new Set;C.forEach(function(s){var l=s.key,y=s.node,c=s.children,o=c===void 0?[]:c;!O.has(l)&&!R.has(l)&&!E(y)&&o.filter(function(v){return!E(v.node)}).forEach(function(v){O.delete(v.key)})})}R=new Set;for(var b=new Set,m=P;m>=0;m-=1){var n=S.get(m)||new Set;n.forEach(function(s){var l=s.parent,y=s.node;if(E(y)||!s.parent||b.has(s.parent.key))return;if(E(s.parent.node)){b.add(l.key);return}var c=!0,o=!1;(l.children||[]).filter(function(v){return!E(v.node)}).forEach(function(v){var f=v.key,i=O.has(f);c&&!i&&(c=!1),!o&&(i||R.has(f))&&(o=!0)}),c||O.delete(l.key),o&&R.add(l.key),b.add(l.key)})}return{checkedKeys:Array.from(O),halfCheckedKeys:Array.from(B(R,O))}}function x(N,I,S,P){var E=[],O;P?O=P:O=w;var R=new Set(N.filter(function(m){var n=!!S[m];return n||E.push(m),n})),T=new Map,C=0;Object.keys(S).forEach(function(m){var n=S[m],s=n.level,l=T.get(s);l||(l=new Set,T.set(s,l)),l.add(n),C=Math.max(C,s)}),Object(he.a)(!E.length,"Tree missing follow keys: ".concat(E.slice(0,100).map(function(m){return"'".concat(m,"'")}).join(", ")));var b;return I===!0?b=U(R,T,C,O):b=_(R,I.halfCheckedKeys,T,C,O),b}},OZM5:function(Ct,Fe,j){"use strict";j.d(Fe,"b",function(){return P}),j.d(Fe,"a",function(){return E}),j.d(Fe,"k",function(){return O}),j.d(Fe,"h",function(){return R}),j.d(Fe,"i",function(){return T}),j.d(Fe,"g",function(){return C}),j.d(Fe,"c",function(){return b}),j.d(Fe,"d",function(){return m}),j.d(Fe,"j",function(){return l}),j.d(Fe,"e",function(){return y}),j.d(Fe,"f",function(){return c});var he=j("KQm4"),B=j("U8pU"),w=j("Ff2n"),U=j("q1tI"),_=j.n(U),x=j("Kwbf"),N=j("WaYH"),I=.25,S=2;function P(o,v){var f=o.slice(),i=f.indexOf(v);return i>=0&&f.splice(i,1),f}function E(o,v){var f=o.slice();return f.indexOf(v)===-1&&f.push(v),f}function O(o){return o.split("-")}function R(o,v){return"".concat(o,"-").concat(v)}function T(o){return o&&o.type&&o.type.isTreeNode}function C(o,v){var f=[o],i=v[o];function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];t.forEach(function(a){var g=a.key,h=a.children;f.push(g),r(h)})}return r(i.children),f}function b(o,v){var f=o.clientY,i=v.selectHandle.getBoundingClientRect(),r=i.top,t=i.bottom,a=i.height,g=Math.max(a*I,S);return f<=r+g?-1:f>=t-g?1:0}function m(o,v){if(!o)return;var f=v.multiple;return f?o.slice():o.length?[o[0]]:o}var n=function(v){return v};function s(o,v){if(!o)return[];var f=v||{},i=f.processProps,r=i===void 0?n:i,t=Array.isArray(o)?o:[o];return t.map(function(a){var g=a.children,h=Object(w.a)(a,["children"]),d=s(g,v);return _.a.createElement(N.a,Object.assign({},r(h)),d)})}function l(o){if(!o)return null;var v;if(Array.isArray(o))v={checkedKeys:o,halfCheckedKeys:void 0};else if(Object(B.a)(o)==="object")v={checkedKeys:o.checked||void 0,halfCheckedKeys:o.halfChecked||void 0};else return Object(x.a)(!1,"`checkedKeys` is not an array or an object"),null;return v}function y(o,v){var f=new Set;function i(r){if(f.has(r))return;var t=v[r];if(!t)return;f.add(r);var a=t.parent,g=t.node;if(g.disabled)return;a&&i(a.key)}return(o||[]).forEach(function(r){i(r)}),Object(he.a)(f)}function c(o){var v={};return Object.keys(o).forEach(function(f){(f.startsWith("data-")||f.startsWith("aria-"))&&(v[f]=o[f])}),v}},"P/tu":function(Ct,Fe,j){"use strict";var he=j("ozfa"),B=j("MJZm"),w=j("0Owb"),U=j("9og8"),_=j("tJVT"),x=j("PpiC"),N=j("WmNS"),I=j.n(N),S=j("q1tI"),P=j.n(S),E=j("WCUW"),O=j("spXi"),R=j.n(O),T=function(b){var m=b.value,n=b.onChange,s=b.defaultValue,l=b.disabled,y=Object(x.a)(b,["value","onChange","defaultValue","disabled"]),c=Object(S.useState)([]),o=Object(_.a)(c,2),v=o[0],f=o[1],i=Object(S.useState)("1"),r=Object(_.a)(i,2),t=r[0],a=r[1];Object(S.useEffect)(function(){g()},[]);var g=function(){var e=Object(U.a)(I.a.mark(function A(){var M,F;return I.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(E.z)({});case 2:M=Z.sent,M!=null&&M.data&&(F=[{title:P.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:R.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:h(M.data||[])}],f(F),a("2"));case 4:case"end":return Z.stop()}},A)}));return function(){return e.apply(this,arguments)}}(),h=function(A){function M(F){var W=F.children,Z=Array.isArray(W)&&W.length>0,K=F==null?void 0:F.group_id;return{title:P.a.createElement("div",{title:F==null?void 0:F.name,className:R.a.name},F==null?void 0:F.name),value:K,key:K,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Z?W==null?void 0:W.map(function(J){return M(J)}):[]}}return A==null?void 0:A.map(function(F){return M(F)})},d=s?{defaultExpandedKeys:[0]}:{selectedKeys:m,defaultExpandedKeys:m};return P.a.createElement("div",{className:R.a.customTree},P.a.createElement(B.a,Object(w.a)({key:t},d,{showIcon:!0,treeData:v,onSelect:n,disabled:l},y)))};Fe.a=T},Q0Vu:function(Ct,Fe,j){Ct.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",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"}},"SA+Z":function(Ct,Fe,j){var he=j("wTVA"),B=j("EbDI"),w=j("ZhPi"),U=j("wkBT");function _(x){return he(x)||B(x)||w(x)||U()}Ct.exports=_,Ct.exports.__esModule=!0,Ct.exports.default=Ct.exports},SJMd:function(Ct,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 j,he,B,w=!1,U,_;window.PR_SHOULD_USE_CONTINUATION=!0;var x,N;(function(){var I=window,S=["break,continue,do,else,for,if,return,while"],P=[S,"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"],E=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],O=[E,"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"],R=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],T=[E,"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"],C="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",b=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],m="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",n=[S,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[S,"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"],l=[S,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],y=[O,T,R,b,m,n,s,l],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,o="str",v="kwd",f="com",i="typ",r="lit",t="pun",a="pln",g="tag",h="dec",d="src",e="atn",A="atv",M="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(Se){for(var Le=0,Ve=!1,$e=!1,Qe=0,Be=Se.length;Qe<Be;++Qe){var ze=Se[Qe];if(ze.ignoreCase)$e=!0;else if(/[a-z]/i.test(ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ve=!0,$e=!1;break}}var ot={b:8,t:9,n:10,v:11,f:12,r:13};function Re(Ee){var Oe=Ee.charCodeAt(0);if(Oe!==92)return Oe;var je=Ee.charAt(1);return Oe=ot[je],Oe||("0"<=je&&je<="7"?parseInt(Ee.substring(1),8):je==="u"||je==="x"?parseInt(Ee.substring(2),16):Ee.charCodeAt(1))}function nt(Ee){if(Ee<32)return(Ee<16?"\\x0":"\\x")+Ee.toString(16);var Oe=String.fromCharCode(Ee);return Oe==="\\"||Oe==="-"||Oe==="]"||Oe==="^"?"\\"+Oe:Oe}function rt(Ee){var Oe=Ee.substring(1,Ee.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")),je=[],Ye=Oe[0]==="^",De=["["];Ye&&De.push("^");for(var Ke=Ye?1:0,ce=Oe.length;Ke<ce;++Ke){var re=Oe[Ke];if(/\\[bdsw]/i.test(re))De.push(re);else{var ie=Re(re),$;Ke+2<ce&&Oe[Ke+1]==="-"?($=Re(Oe[Ke+2]),Ke+=2):$=ie,je.push([ie,$]),$<65||ie>122||($<65||ie>90||je.push([Math.max(65,ie)|32,Math.min($,90)|32]),$<97||ie>122||je.push([Math.max(97,ie)&~32,Math.min($,122)&~32]))}}je.sort(function(_e,we){return _e[0]-we[0]||we[1]-_e[1]});for(var Y=[],V=[],Ke=0;Ke<je.length;++Ke){var ne=je[Ke];ne[0]<=V[1]+1?V[1]=Math.max(V[1],ne[1]):Y.push(V=ne)}for(var Ke=0;Ke<Y.length;++Ke){var ne=Y[Ke];De.push(nt(ne[0])),ne[1]>ne[0]&&(ne[1]+1>ne[0]&&De.push("-"),De.push(nt(ne[1])))}return De.push("]"),De.join("")}function lt(Ee){for(var Oe=Ee.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")),je=Oe.length,Ye=[],De=0,Ke=0;De<je;++De){var ce=Oe[De];if(ce==="(")++Ke;else if(ce.charAt(0)==="\\"){var re=+ce.substring(1);re&&(re<=Ke?Ye[re]=-1:Oe[De]=nt(re))}}for(var De=1;De<Ye.length;++De)Ye[De]===-1&&(Ye[De]=++Le);for(var De=0,Ke=0;De<je;++De){var ce=Oe[De];if(ce==="(")++Ke,Ye[Ke]||(Oe[De]="(?:");else if(ce.charAt(0)==="\\"){var re=+ce.substring(1);re&&re<=Ke&&(Oe[De]="\\"+Ye[re])}}for(var De=0;De<je;++De)Oe[De]==="^"&&Oe[De+1]!=="^"&&(Oe[De]="");if(Ee.ignoreCase&&Ve)for(var De=0;De<je;++De){var ce=Oe[De],ie=ce.charAt(0);ce.length>=2&&ie==="["?Oe[De]=rt(ce):ie!=="\\"&&(Oe[De]=ce.replace(/[a-zA-Z]/g,function(V){var ne=V.charCodeAt(0);return"["+String.fromCharCode(ne&~32,ne|32)+"]"}))}return Oe.join("")}for(var bt=[],Qe=0,Be=Se.length;Qe<Be;++Qe){var ze=Se[Qe];if(ze.global||ze.multiline)throw new Error(""+ze);bt.push("(?:"+lt(ze)+")")}return new RegExp(bt.join("|"),$e?"gi":"g")}function Z(Se,Le){var Ve=/(?:^|\s)nocode(?:\s|$)/,$e=[],Qe=0,Be=[],ze=0;function ot(Re){var nt=Re.nodeType;if(nt==1){if(Ve.test(Re.className))return;for(var rt=Re.firstChild;rt;rt=rt.nextSibling)ot(rt);var lt=Re.nodeName.toLowerCase();(lt==="br"||lt==="li")&&($e[ze]=`
`,Be[ze<<1]=Qe++,Be[ze++<<1|1]=Re)}else if(nt==3||nt==4){var bt=Re.nodeValue;bt.length&&(Le?bt=bt.replace(/\r\n?/g,`
`):bt=bt.replace(/[ \t\r\n]+/g," "),$e[ze]=bt,Be[ze<<1]=Qe,Qe+=bt.length,Be[ze++<<1|1]=Re)}}return ot(Se),{sourceCode:$e.join("").replace(/\n$/,""),spans:Be}}function K(Se,Le,Ve,$e,Qe){if(!Ve)return;var Be={sourceNode:Se,pre:1,langExtension:null,numberLines:null,sourceCode:Ve,spans:null,basePos:Le,decorations:null};$e(Be),Qe.push.apply(Qe,Be.decorations)}var J=/\S/;function oe(Se){for(var Le=void 0,Ve=Se.firstChild;Ve;Ve=Ve.nextSibling){var $e=Ve.nodeType;Le=$e===1?Le?Se:Ve:$e===3&&J.test(Ve.nodeValue)?Se:Le}return Le===Se?void 0:Le}function se(Se,Le){var Ve={},$e;(function(){for(var ze=Se.concat(Le),ot=[],Re={},nt=0,rt=ze.length;nt<rt;++nt){var lt=ze[nt],bt=lt[3];if(bt)for(var Ee=bt.length;--Ee>=0;)Ve[bt.charAt(Ee)]=lt;var Oe=lt[1],je=""+Oe;Re.hasOwnProperty(je)||(ot.push(Oe),Re[je]=null)}ot.push(/[\0-\uffff]/),$e=W(ot)})();var Qe=Le.length,Be=function(ze){for(var ot=ze.sourceCode,Re=ze.basePos,nt=ze.sourceNode,rt=[Re,a],lt=0,bt=ot.match($e)||[],Ee={},Oe=0,je=bt.length;Oe<je;++Oe){var Ye=bt[Oe],De=Ee[Ye],Ke=void 0,ce;if(typeof De=="string")ce=!1;else{var re=Ve[Ye.charAt(0)];if(re)Ke=Ye.match(re[1]),De=re[0];else{for(var ie=0;ie<Qe;++ie)if(re=Le[ie],Ke=Ye.match(re[1]),Ke){De=re[0];break}Ke||(De=a)}ce=De.length>=5&&De.substring(0,5)==="lang-",ce&&!(Ke&&typeof Ke[1]=="string")&&(ce=!1,De=d),ce||(Ee[Ye]=De)}var $=lt;if(lt+=Ye.length,!ce)rt.push(Re+$,De);else{var Y=Ke[1],V=Ye.indexOf(Y),ne=V+Y.length;Ke[2]&&(ne=Ye.length-Ke[2].length,V=ne-Y.length);var _e=De.substring(5);K(nt,Re+$,Ye.substring(0,V),Be,rt),K(nt,Re+$+V,Y,X(_e,Y),rt),K(nt,Re+$+ne,Ye.substring(ne),Be,rt)}}ze.decorations=rt};return Be}function pe(Se){var Le=[],Ve=[];Se.tripleQuotedStrings?Le.push([o,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Le.push([o,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([o,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&Ve.push([o,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $e=Se.hashComments;$e&&(Se.cStyleComments?($e>1?Le.push([f,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([f,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ve.push([o,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([f,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&(Ve.push([f,/^\/\/[^\r\n]*/,null]),Ve.push([f,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=Se.regexLiterals;if(Qe){var Be=Qe>1?"":`
\r`,ze=Be?".":"[\\S\\s]",ot="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+ze+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+ze+")*(?:\\x5D|$))+/";Ve.push(["lang-regex",RegExp("^"+F+"("+ot+")")])}var Re=Se.types;Re&&Ve.push([i,Re]);var nt=(""+Se.keywords).replace(/^ | $/g,"");nt.length&&Ve.push([v,new RegExp("^(?:"+nt.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([a,/^\s+/,null,` \r
\xA0`]);var rt="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&(rt+="(?!s*/)"),Ve.push([r,/^@[a-z_$][a-z_$@0-9]*/i,null],[i,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[r,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[t,new RegExp(rt),null]),se(Le,Ve)}var be=pe({keywords:y,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Q(Se,Le,Ve){for(var $e=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,Be=Se.ownerDocument,ze=Be.createElement("li");Se.firstChild;)ze.appendChild(Se.firstChild);var ot=[ze];function Re(Oe){var je=Oe.nodeType;if(je==1&&!$e.test(Oe.className))if(Oe.nodeName==="br")nt(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var Ye=Oe.firstChild;Ye;Ye=Ye.nextSibling)Re(Ye);else if((je==3||je==4)&&Ve){var De=Oe.nodeValue,Ke=De.match(Qe);if(Ke){var ce=De.substring(0,Ke.index);Oe.nodeValue=ce;var re=De.substring(Ke.index+Ke[0].length);if(re){var ie=Oe.parentNode;ie.insertBefore(Be.createTextNode(re),Oe.nextSibling)}nt(Oe),ce||Oe.parentNode.removeChild(Oe)}}}function nt(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function je(Ke,ce){var re=ce?Ke.cloneNode(!1):Ke,ie=Ke.parentNode;if(ie){var $=je(ie,1),Y=Ke.nextSibling;$.appendChild(re);for(var V=Y;V;V=Y)Y=V.nextSibling,$.appendChild(V)}return re}for(var Ye=je(Oe.nextSibling,0),De;(De=Ye.parentNode)&&De.nodeType===1;)Ye=De;ot.push(Ye)}for(var rt=0;rt<ot.length;++rt)Re(ot[rt]);Le===(Le|0)&&ot[0].setAttribute("value",Le);var lt=Be.createElement("ol");lt.className="linenums";for(var bt=Math.max(0,Le-1|0)||0,rt=0,Ee=ot.length;rt<Ee;++rt)ze=ot[rt],ze.className="L"+(rt+bt)%10,ze.firstChild||ze.appendChild(Be.createTextNode("\xA0")),lt.appendChild(ze);Se.appendChild(lt)}function te(Se){var Le=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Le=Le&&+Le[1]<=8;var Ve=/\n/g,$e=Se.sourceCode,Qe=$e.length,Be=0,ze=Se.spans,ot=ze.length,Re=0,nt=Se.decorations,rt=nt.length,lt=0;nt[rt]=Qe;var bt,Ee;for(Ee=bt=0;Ee<rt;)nt[Ee]!==nt[Ee+2]?(nt[bt++]=nt[Ee++],nt[bt++]=nt[Ee++]):Ee+=2;for(rt=bt,Ee=bt=0;Ee<rt;){for(var Oe=nt[Ee],je=nt[Ee+1],Ye=Ee+2;Ye+2<=rt&&nt[Ye+1]===je;)Ye+=2;nt[bt++]=Oe,nt[bt++]=je,Ee=Ye}rt=nt.length=bt;var De=Se.sourceNode,Ke="";De&&(Ke=De.style.display,De.style.display="none");try{for(var ce=null;Re<ot;){var re=ze[Re],ie=ze[Re+2]||Qe,$=nt[lt+2]||Qe,Ye=Math.min(ie,$),Y=ze[Re+1],V;if(Y.nodeType!==1&&(V=$e.substring(Be,Ye))){Le&&(V=V.replace(Ve,"\r")),Y.nodeValue=V;var ne=Y.ownerDocument,_e=ne.createElement("span");_e.className=nt[lt+1];var we=Y.parentNode;we.replaceChild(_e,Y),_e.appendChild(Y),Be<ie&&(ze[Re+1]=Y=ne.createTextNode($e.substring(Ye,ie)),we.insertBefore(Y,_e.nextSibling))}Be=Ye,Be>=ie&&(Re+=2),Be>=$&&(lt+=2)}}finally{De&&(De.style.display=Ke)}}var ve={};function q(Se,Le){for(var Ve=Le.length;--Ve>=0;){var $e=Le[Ve];ve.hasOwnProperty($e)?I.console&&console.warn("cannot override language handler %s",$e):ve[$e]=Se}}function X(Se,Le){return Se&&ve.hasOwnProperty(Se)||(Se=/^\s*</.test(Le)?"default-markup":"default-code"),ve[Se]}q(be,["default-code"]),q(se([],[[a,/^[^<?]+/],[h,/^<!\w[^>]*(?:>|$)/],[f,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[t,/^(?:<[%?]|[%?]>)/],["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"]),q(se([[a,/^[\s]+/,null,` \r
`],[A,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[g,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[e,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[t,/^[=<>\/]+/],["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"]),q(se([],[[A,/^[\s\S]+/]]),["uq.val"]),q(pe({keywords:O,hashComments:!0,cStyleComments:!0,types:c}),["c","cc","cpp","cxx","cyc","m"]),q(pe({keywords:"null,true,false"}),["json"]),q(pe({keywords:T,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:c}),["cs"]),q(pe({keywords:R,cStyleComments:!0}),["java"]),q(pe({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),q(pe({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),q(pe({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),q(pe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),q(pe({keywords:b,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),q(pe({keywords:C,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),q(se([],[[o,/^[\s\S]+/]]),["regex"]);function Te(Se){var Le=Se.langExtension;try{var Ve=Z(Se.sourceNode,Se.pre),$e=Ve.sourceCode;Se.sourceCode=$e,Se.spans=Ve.spans,Se.basePos=0,X(Le,$e)(Se),te(Se)}catch(Qe){I.console&&console.log(Qe&&Qe.stack||Qe)}}function Ie(Se,Le,Ve){var $e=Ve||!1,Qe=Le||null,Be=document.createElement("div");Be.innerHTML="<pre>"+Se+"</pre>",Be=Be.firstChild,$e&&Q(Be,$e,!0);var ze={langExtension:Qe,numberLines:$e,sourceNode:Be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Te(ze),Be.innerHTML}function Ge(Se,Le){var Ve=Le||document.body,$e=Ve.ownerDocument||document;function Qe(re){return Ve.getElementsByTagName(re)}for(var Be=[Qe("pre"),Qe("code"),Qe("xmp")],ze=[],ot=0;ot<Be.length;++ot)for(var Re=0,nt=Be[ot].length;Re<nt;++Re)ze.push(Be[ot][Re]);Be=null;var rt=Date;rt.now||(rt={now:function(){return+new Date}});var lt=0,bt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ee=/\bprettyprint\b/,Oe=/\bprettyprinted\b/,je=/pre|xmp/i,Ye=/^code$/i,De=/^(?:pre|code|xmp)$/i,Ke={};function ce(){for(var re=I.PR_SHOULD_USE_CONTINUATION?rt.now()+250:Infinity;lt<ze.length&&rt.now()<re;lt++){for(var ie=ze[lt],$=Ke,Y=ie;Y=Y.previousSibling;){var V=Y.nodeType,ne=(V===7||V===8)&&Y.nodeValue;if(ne?!/^\??prettify\b/.test(ne):V!==3||/\S/.test(Y.nodeValue))break;if(ne){$={},ne.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ln,Wt,yn){$[Wt]=yn});break}}var _e=ie.className;if(($!==Ke||Ee.test(_e))&&!Oe.test(_e)){for(var we=!1,Xe=ie.parentNode;Xe;Xe=Xe.parentNode){var gt=Xe.tagName;if(De.test(gt)&&Xe.className&&Ee.test(Xe.className)){we=!0;break}}if(!we){ie.className+=" prettyprinted";var Nt=$.lang;if(!Nt){Nt=_e.match(bt);var ht;!Nt&&(ht=oe(ie))&&Ye.test(ht.tagName)&&(Nt=ht.className.match(bt)),Nt&&(Nt=Nt[1])}var en;if(je.test(ie.tagName))en=1;else{var tn=ie.currentStyle,Dt=$e.defaultView,_n=tn?tn.whiteSpace:Dt&&Dt.getComputedStyle?Dt.getComputedStyle(ie,null).getPropertyValue("white-space"):0;en=_n&&_n.substring(0,3)==="pre"}var fn=$.linenums;(fn=fn==="true"||+fn)||(fn=_e.match(/\blinenums\b(?::(\d+))?/),fn=fn?fn[1]&&fn[1].length?+fn[1]:!0:!1),fn&&Q(ie,fn,en);var sn={langExtension:Nt,sourceNode:ie,numberLines:fn,pre:en,sourceCode:null,basePos:null,spans:null,decorations:null};Te(sn)}}}lt<ze.length?I.setTimeout(ce,250):typeof Se=="function"&&Se()}ce()}var Ae=I.PR={createSimpleLexer:se,registerLangHandler:q,sourceDecorator:pe,PR_ATTRIB_NAME:e,PR_ATTRIB_VALUE:A,PR_COMMENT:f,PR_DECLARATION:h,PR_KEYWORD:v,PR_LITERAL:r,PR_NOCODE:M,PR_PLAIN:a,PR_PUNCTUATION:t,PR_SOURCE:d,PR_STRING:o,PR_TAG:g,PR_TYPE:i,prettyPrintOne:w?I.prettyPrintOne=Ie:x=Ie,prettyPrint:N=w?I.prettyPrint=Ge:N=Ge},Me=I.define;typeof Me=="function"&&Me.amd&&Me("google-code-prettify",[],function(){return Ae})})()},WaYH:function(Ct,Fe,j){"use strict";var he=j("rePB"),B=j("Ff2n"),w=j("VTBJ"),U=j("1OyB"),_=j("vuIU"),x=j("JX7q"),N=j("Ji7U"),I=j("LK+K"),S=j("q1tI"),P=j("TSYQ"),E=j.n(P),O=j("sboe"),R=j("OZM5"),T=function(v){var f=v.prefixCls,i=v.level,r=v.isStart,t=v.isEnd;if(!i)return null;for(var a="".concat(f,"-indent-unit"),g=[],h=0;h<i;h+=1){var d;g.push(S.createElement("span",{key:h,className:E()(a,(d={},Object(he.a)(d,"".concat(a,"-start"),r[h+1]),Object(he.a)(d,"".concat(a,"-end"),t[h+1]),Object(he.a)(d,"".concat(a,"-end-first-level"),!h&&t[0]),d))}))}return S.createElement("span",{"aria-hidden":"true",className:"".concat(f,"-indent")},g)},C=T,b=j("815F"),m="open",n="close",s="---",l=function(o){Object(N.a)(f,o);var v=Object(I.a)(f);function f(){var i;return Object(U.a)(this,f),i=v.apply(this,arguments),i.state={dragNodeHighlight:!1},i.onSelectorClick=function(r){var t=i.props.context.onNodeClick;t(r,Object(b.b)(i.props)),i.isSelectable()?i.onSelect(r):i.onCheck(r)},i.onSelectorDoubleClick=function(r){var t=i.props.context.onNodeDoubleClick;t(r,Object(b.b)(i.props))},i.onSelect=function(r){if(i.isDisabled())return;var t=i.props.context.onNodeSelect;r.preventDefault(),t(r,Object(b.b)(i.props))},i.onCheck=function(r){if(i.isDisabled())return;var t=i.props,a=t.disableCheckbox,g=t.checked,h=i.props.context.onNodeCheck;if(!i.isCheckable()||a)return;r.preventDefault();var d=!g;h(r,Object(b.b)(i.props),d)},i.onMouseEnter=function(r){var t=i.props.context.onNodeMouseEnter;t(r,Object(b.b)(i.props))},i.onMouseLeave=function(r){var t=i.props.context.onNodeMouseLeave;t(r,Object(b.b)(i.props))},i.onContextMenu=function(r){var t=i.props.context.onNodeContextMenu;t(r,Object(b.b)(i.props))},i.onDragStart=function(r){var t=i.props.context.onNodeDragStart;r.stopPropagation(),i.setState({dragNodeHighlight:!0}),t(r,Object(x.a)(i));try{r.dataTransfer.setData("text/plain","")}catch(a){}},i.onDragEnter=function(r){var t=i.props.context.onNodeDragEnter;r.preventDefault(),r.stopPropagation(),t(r,Object(x.a)(i))},i.onDragOver=function(r){var t=i.props.context.onNodeDragOver;r.preventDefault(),r.stopPropagation(),t(r,Object(x.a)(i))},i.onDragLeave=function(r){var t=i.props.context.onNodeDragLeave;r.stopPropagation(),t(r,Object(x.a)(i))},i.onDragEnd=function(r){var t=i.props.context.onNodeDragEnd;r.stopPropagation(),i.setState({dragNodeHighlight:!1}),t(r,Object(x.a)(i))},i.onDrop=function(r){var t=i.props.context.onNodeDrop;r.preventDefault(),r.stopPropagation(),i.setState({dragNodeHighlight:!1}),t(r,Object(x.a)(i))},i.onExpand=function(r){var t=i.props.context.onNodeExpand;t(r,Object(b.b)(i.props))},i.setSelectHandle=function(r){i.selectHandle=r},i.getNodeState=function(){var r=i.props.expanded;return i.isLeaf()?null:r?m:n},i.hasChildren=function(){var r=i.props.eventKey,t=i.props.context.keyEntities,a=t[r]||{},g=a.children;return!!(g||[]).length},i.isLeaf=function(){var r=i.props,t=r.isLeaf,a=r.loaded,g=i.props.context.loadData,h=i.hasChildren();return t===!1?!1:t||!g&&!h||g&&a&&!h},i.isDisabled=function(){var r=i.props.disabled,t=i.props.context.disabled;return!!(t||r)},i.isCheckable=function(){var r=i.props.checkable,t=i.props.context.checkable;return!t||r===!1?!1:t},i.syncLoadData=function(r){var t=r.expanded,a=r.loading,g=r.loaded,h=i.props.context,d=h.loadData,e=h.onNodeLoad;if(a)return;d&&t&&!i.isLeaf()&&(!i.hasChildren()&&!g&&e(Object(b.b)(i.props)))},i.renderSwitcher=function(){var r=i.props,t=r.expanded,a=r.switcherIcon,g=i.props.context,h=g.prefixCls,d=g.switcherIcon,e=a||d;if(i.isLeaf())return S.createElement("span",{className:E()("".concat(h,"-switcher"),"".concat(h,"-switcher-noop"))},typeof e=="function"?e(Object(w.a)(Object(w.a)({},i.props),{},{isLeaf:!0})):e);var A=E()("".concat(h,"-switcher"),"".concat(h,"-switcher_").concat(t?m:n));return S.createElement("span",{onClick:i.onExpand,className:A},typeof e=="function"?e(Object(w.a)(Object(w.a)({},i.props),{},{isLeaf:!1})):e)},i.renderCheckbox=function(){var r=i.props,t=r.checked,a=r.halfChecked,g=r.disableCheckbox,h=i.props.context.prefixCls,d=i.isDisabled(),e=i.isCheckable();if(!e)return null;var A=typeof e!="boolean"?e:null;return S.createElement("span",{className:E()("".concat(h,"-checkbox"),t&&"".concat(h,"-checkbox-checked"),!t&&a&&"".concat(h,"-checkbox-indeterminate"),(d||g)&&"".concat(h,"-checkbox-disabled")),onClick:i.onCheck},A)},i.renderIcon=function(){var r=i.props.loading,t=i.props.context.prefixCls;return S.createElement("span",{className:E()("".concat(t,"-iconEle"),"".concat(t,"-icon__").concat(i.getNodeState()||"docu"),r&&"".concat(t,"-icon_loading"))})},i.renderSelector=function(){var r=i.state.dragNodeHighlight,t=i.props,a=t.title,g=t.selected,h=t.icon,d=t.loading,e=t.data,A=i.props.context,M=A.prefixCls,F=A.showIcon,W=A.icon,Z=A.draggable,K=A.loadData,J=A.titleRender,oe=i.isDisabled(),se="".concat(M,"-node-content-wrapper"),pe;if(F){var be=h||W;pe=be?S.createElement("span",{className:E()("".concat(M,"-iconEle"),"".concat(M,"-icon__customize"))},typeof be=="function"?be(i.props):be):i.renderIcon()}else K&&d&&(pe=i.renderIcon());var Q;typeof a=="function"?Q=a(e):J?Q=J(e):Q=a;var te=S.createElement("span",{className:"".concat(M,"-title")},Q);return S.createElement("span",{ref:i.setSelectHandle,title:typeof a=="string"?a:"",className:E()("".concat(se),"".concat(se,"-").concat(i.getNodeState()||"normal"),!oe&&(g||r)&&"".concat(M,"-node-selected"),!oe&&Z&&"draggable"),draggable:!oe&&Z||void 0,"aria-grabbed":!oe&&Z||void 0,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onContextMenu:i.onContextMenu,onClick:i.onSelectorClick,onDoubleClick:i.onSelectorDoubleClick,onDragStart:Z?i.onDragStart:void 0},pe,te)},i}return Object(_.a)(f,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var r=this.props.selectable,t=this.props.context.selectable;return typeof r=="boolean"?r:t}},{key:"render",value:function(){var r,t=this.props,a=t.eventKey,g=t.className,h=t.style,d=t.dragOver,e=t.dragOverGapTop,A=t.dragOverGapBottom,M=t.isLeaf,F=t.isStart,W=t.isEnd,Z=t.expanded,K=t.selected,J=t.checked,oe=t.halfChecked,se=t.loading,pe=t.domRef,be=t.active,Q=t.onMouseMove,te=Object(B.a)(t,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ve=this.props.context,q=ve.prefixCls,X=ve.filterTreeNode,Te=ve.draggable,Ie=ve.keyEntities,Ge=this.isDisabled(),Ae=Object(R.f)(te),Me=Ie[a]||{},Se=Me.level,Le=W[W.length-1];return S.createElement("div",Object.assign({ref:pe,className:E()(g,"".concat(q,"-treenode"),(r={},Object(he.a)(r,"".concat(q,"-treenode-disabled"),Ge),Object(he.a)(r,"".concat(q,"-treenode-switcher-").concat(Z?"open":"close"),!M),Object(he.a)(r,"".concat(q,"-treenode-checkbox-checked"),J),Object(he.a)(r,"".concat(q,"-treenode-checkbox-indeterminate"),oe),Object(he.a)(r,"".concat(q,"-treenode-selected"),K),Object(he.a)(r,"".concat(q,"-treenode-loading"),se),Object(he.a)(r,"".concat(q,"-treenode-active"),be),Object(he.a)(r,"".concat(q,"-treenode-leaf-last"),Le),Object(he.a)(r,"drag-over",!Ge&&d),Object(he.a)(r,"drag-over-gap-top",!Ge&&e),Object(he.a)(r,"drag-over-gap-bottom",!Ge&&A),Object(he.a)(r,"filter-node",X&&X(Object(b.b)(this.props))),r)),style:h,onDragEnter:Te?this.onDragEnter:void 0,onDragOver:Te?this.onDragOver:void 0,onDragLeave:Te?this.onDragLeave:void 0,onDrop:Te?this.onDrop:void 0,onDragEnd:Te?this.onDragEnd:void 0,onMouseMove:Q},Ae),S.createElement(C,{prefixCls:q,level:Se,isStart:F,isEnd:W}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),f}(S.Component),y=function(v){return S.createElement(O.a.Consumer,null,function(f){return S.createElement(l,Object.assign({},v,{context:f}))})};y.displayName="TreeNode",y.defaultProps={title:s},y.isTreeNode=1;var c=Fe.a=y},WdTA:function(Ct,Fe,j){Ct.exports=j.p+"static/studnetqun.598eeb43.png"},Y1PL:function(Ct,Fe,j){"use strict";j.r(Fe),j.d(Fe,"ResizableTextArea",function(){return oe});var he=j("wx14"),B=j("1OyB"),w=j("vuIU"),U=j("Ji7U"),_=j("LK+K"),x=j("q1tI"),N=j("VTBJ"),I=j("rePB"),S=j("Zm9Q"),P=j("Kwbf"),E=j("c+Xe"),O=j("m+aA"),R=j("bdgK"),T=new Map;function C(be){be.forEach(function(Q){var te,ve=Q.target;(te=T.get(ve))===null||te===void 0||te.forEach(function(q){return q(ve)})})}var b=new R.default(C),m=null,n=null;function s(be,Q){T.has(be)||(T.set(be,new Set),b.observe(be)),T.get(be).add(Q)}function l(be,Q){T.has(be)&&(T.get(be).delete(Q),T.get(be).size||(b.unobserve(be),T.delete(be)))}var y=function(be){Object(U.a)(te,be);var Q=Object(_.a)(te);function te(){return Object(B.a)(this,te),Q.apply(this,arguments)}return Object(w.a)(te,[{key:"render",value:function(){return this.props.children}}]),te}(x.Component),c=x.createContext(null);function o(be){var Q=be.children,te=be.onBatchResize,ve=x.useRef(0),q=x.useRef([]),X=x.useContext(c),Te=x.useCallback(function(Ie,Ge,Ae){ve.current+=1;var Me=ve.current;q.current.push({size:Ie,element:Ge,data:Ae}),Promise.resolve().then(function(){Me===ve.current&&(te==null||te(q.current),q.current=[])}),X==null||X(Ie,Ge,Ae)},[te,X]);return x.createElement(c.Provider,{value:Te},Q)}function v(be){var Q=be.children,te=be.disabled,ve=x.useRef(null),q=x.useRef(null),X=x.useContext(c),Te=x.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ie=x.isValidElement(Q)&&Object(E.c)(Q),Ge=Ie?Q.ref:null,Ae=x.useMemo(function(){return Object(E.a)(Ge,ve)},[Ge,ve]),Me=x.useRef(be);Me.current=be;var Se=x.useCallback(function(Le){var Ve=Me.current,$e=Ve.onResize,Qe=Ve.data,Be=Le.getBoundingClientRect(),ze=Be.width,ot=Be.height,Re=Le.offsetWidth,nt=Le.offsetHeight,rt=Math.floor(ze),lt=Math.floor(ot);if(Te.current.width!==rt||Te.current.height!==lt||Te.current.offsetWidth!==Re||Te.current.offsetHeight!==nt){var bt={width:rt,height:lt,offsetWidth:Re,offsetHeight:nt};Te.current=bt;var Ee=Re===Math.round(ze)?ze:Re,Oe=nt===Math.round(ot)?ot:nt,je=Object(N.a)(Object(N.a)({},bt),{},{offsetWidth:Ee,offsetHeight:Oe});X==null||X(je,Le,Qe),$e&&Promise.resolve().then(function(){$e(je,Le)})}},[]);return x.useEffect(function(){var Le=Object(O.a)(ve.current)||Object(O.a)(q.current);return Le&&!te&&s(Le,Se),function(){return l(Le,Se)}},[ve.current,te]),x.createElement(y,{ref:q},Ie?x.cloneElement(Q,{ref:Ae}):Q)}var f="rc-observer-key";function i(be){var Q=be.children,te=Object(S.a)(Q);return te.map(function(ve,q){var X=(ve==null?void 0:ve.key)||"".concat(f,"-").concat(q);return x.createElement(v,Object(he.a)({},be,{key:X}),ve)})}i.Collection=o;var r=i,t=j("bT9E"),a=j("TSYQ"),g=j.n(a),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
`,d=["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"],e={},A;function M(be){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Q&&e[te])return e[te];var ve=window.getComputedStyle(be),q=ve.getPropertyValue("box-sizing")||ve.getPropertyValue("-moz-box-sizing")||ve.getPropertyValue("-webkit-box-sizing"),X=parseFloat(ve.getPropertyValue("padding-bottom"))+parseFloat(ve.getPropertyValue("padding-top")),Te=parseFloat(ve.getPropertyValue("border-bottom-width"))+parseFloat(ve.getPropertyValue("border-top-width")),Ie=d.map(function(Ae){return"".concat(Ae,":").concat(ve.getPropertyValue(Ae))}).join(";"),Ge={sizingStyle:Ie,paddingSize:X,borderSize:Te,boxSizing:q};return Q&&te&&(e[te]=Ge),Ge}function F(be){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;A||(A=document.createElement("textarea"),A.setAttribute("tab-index","-1"),A.setAttribute("aria-hidden","true"),document.body.appendChild(A)),be.getAttribute("wrap")?A.setAttribute("wrap",be.getAttribute("wrap")):A.removeAttribute("wrap");var q=M(be,Q),X=q.paddingSize,Te=q.borderSize,Ie=q.boxSizing,Ge=q.sizingStyle;A.setAttribute("style","".concat(Ge,";").concat(h)),A.value=be.value||be.placeholder||"";var Ae=Number.MIN_SAFE_INTEGER,Me=Number.MAX_SAFE_INTEGER,Se=A.scrollHeight,Le;if(Ie==="border-box"?Se+=Te:Ie==="content-box"&&(Se-=X),te!==null||ve!==null){A.value=" ";var Ve=A.scrollHeight-X;te!==null&&(Ae=Ve*te,Ie==="border-box"&&(Ae=Ae+X+Te),Se=Math.max(Ae,Se)),ve!==null&&(Me=Ve*ve,Ie==="border-box"&&(Me=Me+X+Te),Le=Se>Me?"":"hidden",Se=Math.min(Me,Se))}return{height:Se,minHeight:Ae,maxHeight:Me,overflowY:Le,resize:"none"}}var W=j("Gytx"),Z=j.n(W),K;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(K||(K={}));var J=function(be){Object(U.a)(te,be);var Q=Object(_.a)(te);function te(ve){var q;return Object(B.a)(this,te),q=Q.call(this,ve),q.nextFrameActionId=void 0,q.resizeFrameId=void 0,q.textArea=void 0,q.saveTextArea=function(X){q.textArea=X},q.handleResize=function(X){var Te=q.state.resizeStatus,Ie=q.props,Ge=Ie.autoSize,Ae=Ie.onResize;if(Te!==K.NONE)return;typeof Ae=="function"&&Ae(X),Ge&&q.resizeOnNextFrame()},q.resizeOnNextFrame=function(){cancelAnimationFrame(q.nextFrameActionId),q.nextFrameActionId=requestAnimationFrame(q.resizeTextarea)},q.resizeTextarea=function(){var X=q.props.autoSize;if(!X||!q.textArea)return;var Te=X.minRows,Ie=X.maxRows,Ge=F(q.textArea,!1,Te,Ie);q.setState({textareaStyles:Ge,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(q.resizeFrameId),q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:K.RESIZED},function(){q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:K.NONE}),q.fixFirefoxAutoScroll()})})})})},q.renderTextArea=function(){var X=q.props,Te=X.prefixCls,Ie=Te===void 0?"rc-textarea":Te,Ge=X.autoSize,Ae=X.onResize,Me=X.className,Se=X.disabled,Le=q.state,Ve=Le.textareaStyles,$e=Le.resizeStatus,Qe=Object(t.a)(q.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Be=g()(Ie,Me,Object(I.a)({},"".concat(Ie,"-disabled"),Se));"value"in Qe&&(Qe.value=Qe.value||"");var ze=Object(N.a)(Object(N.a)(Object(N.a)({},q.props.style),Ve),$e===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return x.createElement(r,{onResize:q.handleResize,disabled:!(Ge||Ae)},x.createElement("textarea",Object(he.a)({},Qe,{className:Be,style:ze,ref:q.saveTextArea})))},q.state={textareaStyles:{},resizeStatus:K.NONE},q}return Object(w.a)(te,[{key:"componentDidUpdate",value:function(q){(q.value!==this.props.value||!Z()(q.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 q=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(q,X)}}catch(Te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),te}(x.Component),oe=J,se=function(be){Object(U.a)(te,be);var Q=Object(_.a)(te);function te(ve){var q;Object(B.a)(this,te),q=Q.call(this,ve),q.resizableTextArea=void 0,q.focus=function(){q.resizableTextArea.textArea.focus()},q.saveTextArea=function(Te){q.resizableTextArea=Te},q.handleChange=function(Te){var Ie=q.props.onChange;q.setValue(Te.target.value,function(){q.resizableTextArea.resizeTextarea()}),Ie&&Ie(Te)},q.handleKeyDown=function(Te){var Ie=q.props,Ge=Ie.onPressEnter,Ae=Ie.onKeyDown;Te.keyCode===13&&Ge&&Ge(Te),Ae&&Ae(Te)};var X=typeof ve.value=="undefined"||ve.value===null?ve.defaultValue:ve.value;return q.state={value:X},q}return Object(w.a)(te,[{key:"setValue",value:function(q,X){"value"in this.props||this.setState({value:q},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return x.createElement(oe,Object(he.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(q){return"value"in q?{value:q.value}:null}}]),te}(x.Component),pe=Fe.default=se},YaiT:function(Ct,Fe,j){Ct.exports={list:"list___mDipN",btns:"btns___2c8h_",name:"name___eV55A"}},ZW9T:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return y});var he=j("k1fw"),B=j("miYZ"),w=j("tsqr"),U=j("rAM+"),_=j("tJVT"),x=j("PpiC"),N=j("q1tI"),I=j.n(N),S=j("bdgK");function P(c,o,v,f,i){var r=o.getWordUntilPosition(v),t={startLineNumber:v.lineNumber,endLineNumber:v.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},a=f.map(function(g){return{label:g,kind:c.languages.CompletionItemKind.Keyword,insertText:g,insertTextRules:c.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:t}});return i.map(function(g){a.push(Object(he.a)(Object(he.a)({},g),{},{range:t}))}),a}var E=function(c){var o={label:"ifelse",kind:c.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:c.languages.CompletionItemInsertTextRule.InsertAsSnippet},v=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];c.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(t,a){var g=P(c,t,a,v,[o]);return{suggestions:g}}});var f=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];c.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(t,a){var g=[{label:"print",kind:c.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:c.languages.CompletionItemInsertTextRule.InsertAsSnippet}],h=P(c,t,a,f,g);return{suggestions:h}}});var i=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];c.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(t,a){var g=[o,{label:"main",kind:c.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:c.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:c.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:c.languages.CompletionItemInsertTextRule.InsertAsSnippet}],h=P(c,t,a,i,g);return{suggestions:h}}})},O="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",R=j("LvDl");function T(c){return/^\d+$/.test(c)?"".concat(c,"px"):c}function C(){}var b=!1,m={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function n(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=c;if(Array.isArray(c)){for(var v=0;v<c.length;v++){var f=m[c[v]];if(f)return f}return o[0]}return m[o]||o}var s=null,l=Fe.b=function(c){var o=c.width,v=o===void 0?"100%":o,f=c.height,i=f===void 0?"100%":f,r=c.value,t=c.language,a=t===void 0?"javascript":t,g=c.style,h=g===void 0?{}:g,d=c.options,e=d===void 0?{}:d,A=c.overrideServices,M=A===void 0?{}:A,F=c.theme,W=F===void 0?"vs-dark":F,Z=c.onEditBlur,K=c.onSave,J=c.autoHeight,oe=J===void 0?!1:J,se=c.forbidCopy,pe=se===void 0?!1:se,be=c.onChange,Q=be===void 0?C:be,te=c.editorDidMount,ve=te===void 0?C:te,q=c.onFocus,X=q===void 0?C:q,Te=c.filename,Ie=Te===void 0?"educoder.txt":Te,Ge=Object(x.a)(c,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Ae=Object(N.useRef)(),Me=Object(N.useRef)({}),Se=Object(N.useRef)(),Le=Object(N.useRef)(!1),Ve=Object(N.useRef)(),$e=Object(N.useState)(!1),Qe=Object(_.a)($e,2),Be=Qe[0],ze=Qe[1];function ot(){var V;return Ae.current&&(V=new S.default(function(ne){var _e=Object(U.a)(ne),we;try{for(_e.s();!(we=_e.n()).done;){var Xe=we.value;(Xe.target.offsetHeight>0||Xe.target.offsetWidth>0)&&Me.current.instance.layout()}}catch(gt){_e.e(gt)}finally{_e.f()}}),V.observe(Ae.current)),V}function Re(){w.b.warn(decodeURIComponent(O))}var nt=function(){var ne=Me.current.instance;if(r!=null&&ne&&Be){var _e=ne.getModel();_e&&r!==_e.getValue()&&(b=!0,_e.setValue(r),ne.layout(),b=!1)}};Object(N.useEffect)(function(){Se.current&&clearTimeout(Se.current),Se.current=setTimeout(function(){nt()},500)},[r,Be,Me.current]);function rt(){var V=Me.current.instance;if(V){var ne=V.getSelection(),_e=Me.current.pastePos||{},we=new s.Range(_e.startLineNumber||ne.endLineNumber,_e.startColumn||ne.endColumn,_e.endLineNumber||ne.endLineNumber,_e.endColumn||ne.endColumn);setTimeout(function(){V.executeEdits("",[{range:we,text:""}])},300)}}function lt(V){(window.navigator.platform.match("Mac")?V.metaKey:V.ctrlKey)&&V.keyCode==83&&(V.preventDefault(),K())}var bt=function(){if(oe&&Me.current.instance){var ne=Me.current.instance.getContentHeight();$(ne<i?i:ne)}else $(i)};function Ee(V){var ne=document.createEvent("MouseEvents");ne.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),V.dispatchEvent(ne)}function Oe(V,ne){var _e=window.URL||window.webkitURL||window,we=new Blob([ne]),Xe=document.createElementNS("http://www.w3.org/1999/xhtml","a");Xe.href=_e.createObjectURL(we),Xe.download=V,Ee(Xe)}Object(N.useEffect)(function(){bt()},[bt]),Object(N.useEffect)(function(){Ae.current&&!Be&&j.e(27).then(j.t.bind(null,"M/lh",7)).then(function(V){try{s=V,Me.current.instance=s.editor.create(Ae.current,{value:r,language:n(a),theme:W,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},M);var ne=Me.current.instance;if(ve(ne,s),setTimeout(function(){bt(),Me.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Oe(Ie||"educoder.txt",ne.getValue())}})},500),Me.current.subscription=ne.onDidChangeModelContent(function(we){Le.current?clearTimeout(Ve.current):(bt(),Q(ne.getValue(),we)),Ve.current=setTimeout(function(){Le.current=!1},500)}),window.Monaco||E(s),pe&&(ne.addCommand(s.KeyMod.CtrlCmd|s.KeyMod.Shift|s.KeyCode.KEY_V,function(){return Re(),null}),ne.addCommand(s.KeyMod.CtrlCmd|s.KeyCode.KEY_C,function(){return Re(),null})),window.Monaco=s,Z&&ne.onDidBlurEditorWidget(function(){Z(ne.getValue())}),X&&ne.onDidFocusEditorText(function(){X(ne.getValue())}),pe){ne.addCommand(s.KeyMod.CtrlCmd|s.KeyCode.KEY_V,function(){return Re(),null}),ne.onDidPaste(function(we){Me.current.pastePos=we});try{window.addEventListener("paste",rt)}catch(we){}}var _e=ot();return ze(!0),function(){var we=Me.current.instance;we.dispose();var Xe=we.getModel();Xe&&Xe.dispose(),Me.current.subscription&&Me.current.subscription.dispose(),pe&&window.removeEventListener("paste",rt),_e.unobserve(Ae.current)}}catch(we){}})},[]),Object(N.useEffect)(function(){var V=Me.current.instance;if(V&&Be)return document.addEventListener("keydown",lt,!1),function(){document.removeEventListener("keydown",lt)}},[K,Be]),Object(N.useEffect)(function(){var V=Me.current.instance;if(V&&Be){var ne=n(a);s.editor.setModelLanguage(V.getModel(),ne),console.log("language:",a,V.getModel(),ne)}},[a,Be]),Object(N.useEffect)(function(){var V=Me.current.instance;V&&Be&&s.editor.setTheme(W)},[W,Be]),Object(N.useEffect)(function(){var V=Me.current.instance;V&&Be&&(V.updateOptions(Object(he.a)({},e)),setTimeout(function(){V.getModel().updateOptions(Object(he.a)({},e))},200))},[JSON.stringify(e),Be]),Object(N.useEffect)(function(){var V=Me.current.instance;V&&Be&&V.layout()},[v,i,Be]);var je=Object(N.useState)(T(v)),Ye=Object(_.a)(je,2),De=Ye[0],Ke=Ye[1],ce=Object(N.useState)(T(i)),re=Object(_.a)(ce,2),ie=re[0],$=re[1],Y=Object(he.a)(Object(he.a)({},h),{},{width:De,height:ie});return I.a.createElement("div",{className:"my-monaco-editor",ref:Ae,style:Y})};function y(c){var o=c.width,v=o===void 0?"100%":o,f=c.height,i=f===void 0?"100%":f,r=c.original,t=c.modified,a=c.language,g=c.options,h=g===void 0?{}:g,d=Object(N.useRef)(),e=Object(N.useState)(null),A=Object(_.a)(e,2),M=A[0],F=A[1];function W(oe){var se;return d.current&&(se=new S.default(function(pe){var be=Object(U.a)(pe),Q;try{for(be.s();!(Q=be.n()).done;){var te=Q.value;(te.target.offsetHeight>0||te.target.offsetWidth>0)&&oe.layout()}}catch(ve){be.e(ve)}finally{be.f()}}),se.observe(d.current)),se}Object(N.useEffect)(function(){d.current&&j.e(27).then(j.t.bind(null,"M/lh",7)).then(function(oe){s=oe;var se=s.editor.createDiffEditor(d.current,Object(he.a)(Object(he.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},h),{},{wordWrap:!0}));F(se);var pe=W(se);return function(){se.dispose();var be=se.getModel();be&&be.dispose(),pe.unobserve(d.current)}})},[]),Object(N.useEffect)(function(){M&&M.setModel({original:s.editor.createModel(r,a),modified:s.editor.createModel(t,a)})},[r,t,a,M]);var Z=T(v),K=T(i),J={width:Z,height:K};return I.a.createElement("div",{className:"my-diff-editor",ref:d,style:J})}},ZpRC:function(Ct,Fe,j){"use strict";function he(E){return typeof E=="object"&&E!=null&&E.nodeType===1}function B(E,O){return(!O||E!=="hidden")&&E!=="visible"&&E!=="clip"}function w(E,O){if(E.clientHeight<E.scrollHeight||E.clientWidth<E.scrollWidth){var R=getComputedStyle(E,null);return B(R.overflowY,O)||B(R.overflowX,O)||function(T){var C=function(b){if(!b.ownerDocument||!b.ownerDocument.defaultView)return null;try{return b.ownerDocument.defaultView.frameElement}catch(m){return null}}(T);return!!C&&(C.clientHeight<T.scrollHeight||C.clientWidth<T.scrollWidth)}(E)}return!1}function U(E,O,R,T,C,b,m,n){return b<E&&m>O||b>E&&m<O?0:b<=E&&n<=R||m>=O&&n>=R?b-E-T:m>O&&n<R||b<E&&n>R?m-O+C:0}var _=function(E,O){var R=window,T=O.scrollMode,C=O.block,b=O.inline,m=O.boundary,n=O.skipOverflowHiddenElements,s=typeof m=="function"?m:function(Ve){return Ve!==m};if(!he(E))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,y=[],c=E;he(c)&&s(c);){if((c=c.parentElement)===l){y.push(c);break}c!=null&&c===document.body&&w(c)&&!w(document.documentElement)||c!=null&&w(c,n)&&y.push(c)}for(var o=R.visualViewport?R.visualViewport.width:innerWidth,v=R.visualViewport?R.visualViewport.height:innerHeight,f=window.scrollX||pageXOffset,i=window.scrollY||pageYOffset,r=E.getBoundingClientRect(),t=r.height,a=r.width,g=r.top,h=r.right,d=r.bottom,e=r.left,A=C==="start"||C==="nearest"?g:C==="end"?d:g+t/2,M=b==="center"?e+a/2:b==="end"?h:e,F=[],W=0;W<y.length;W++){var Z=y[W],K=Z.getBoundingClientRect(),J=K.height,oe=K.width,se=K.top,pe=K.right,be=K.bottom,Q=K.left;if(T==="if-needed"&&g>=0&&e>=0&&d<=v&&h<=o&&g>=se&&d<=be&&e>=Q&&h<=pe)return F;var te=getComputedStyle(Z),ve=parseInt(te.borderLeftWidth,10),q=parseInt(te.borderTopWidth,10),X=parseInt(te.borderRightWidth,10),Te=parseInt(te.borderBottomWidth,10),Ie=0,Ge=0,Ae="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-ve-X:0,Me="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-q-Te:0;if(l===Z)Ie=C==="start"?A:C==="end"?A-v:C==="nearest"?U(i,i+v,v,q,Te,i+A,i+A+t,t):A-v/2,Ge=b==="start"?M:b==="center"?M-o/2:b==="end"?M-o:U(f,f+o,o,ve,X,f+M,f+M+a,a),Ie=Math.max(0,Ie+i),Ge=Math.max(0,Ge+f);else{Ie=C==="start"?A-se-q:C==="end"?A-be+Te+Me:C==="nearest"?U(se,be,J,q,Te+Me,A,A+t,t):A-(se+J/2)+Me/2,Ge=b==="start"?M-Q-ve:b==="center"?M-(Q+oe/2)+Ae/2:b==="end"?M-pe+X+Ae:U(Q,pe,oe,ve,X+Ae,M,M+a,a);var Se=Z.scrollLeft,Le=Z.scrollTop;A+=Le-(Ie=Math.max(0,Math.min(Le+Ie,Z.scrollHeight-J+Me))),M+=Se-(Ge=Math.max(0,Math.min(Se+Ge,Z.scrollWidth-oe+Ae)))}F.push({el:Z,top:Ie,left:Ge})}return F};function x(E){return E===Object(E)&&Object.keys(E).length!==0}function N(E,O){O===void 0&&(O="auto");var R="scrollBehavior"in document.body.style;E.forEach(function(T){var C=T.el,b=T.top,m=T.left;C.scroll&&R?C.scroll({top:b,left:m,behavior:O}):(C.scrollTop=b,C.scrollLeft=m)})}function I(E){return E===!1?{block:"end",inline:"nearest"}:x(E)?E:{block:"start",inline:"nearest"}}function S(E,O){var R=!E.ownerDocument.documentElement.contains(E);if(x(O)&&typeof O.behavior=="function")return O.behavior(R?[]:_(E,O));if(R)return;var T=I(O);return N(_(E,T),T.behavior)}var P=Fe.a=S},bT9E:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return B});var he=j("VTBJ");function B(w,U){var _=Object(he.a)({},w);return Array.isArray(U)&&U.forEach(function(x){delete _[x]}),_}},biw7:function(Ct,Fe,j){"use strict";var he=j("q1tI"),B=j.n(he),w=he.createContext(null);Fe.a=w},d5o6:function(Ct,Fe,j){Ct.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"}},dmUQ:function(Ct,Fe,j){"use strict";var he=j("Ff2n"),B=j("rePB"),w=j("1OyB"),U=j("vuIU"),_=j("Ji7U"),x=j("md7G"),N=j("foSv"),I=j("q1tI"),S=j.n(I),P=j("TSYQ"),E=j.n(P),O=j("4IlW");function R(t,a){var g=Object.keys(t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);a&&(h=h.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),g.push.apply(g,h)}return g}function T(t){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?R(Object(g),!0).forEach(function(h){Object(B.a)(t,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(g)):R(Object(g)).forEach(function(h){Object.defineProperty(t,h,Object.getOwnPropertyDescriptor(g,h))})}return t}function C(t){var a=b();return function(){var h=Object(N.a)(t),d;if(a){var e=Object(N.a)(this).constructor;d=Reflect.construct(h,arguments,e)}else d=h.apply(this,arguments);return Object(x.a)(this,d)}}function b(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function m(){}function n(t){t.preventDefault()}var s=function(a){return a.replace(/[^\w.-]+/g,"")},l=200,y=600,c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,o=function(a){return a!=null},v=function(a,g){return g===a||typeof g=="number"&&typeof a=="number"&&isNaN(g)&&isNaN(a)},f=function(t){Object(_.a)(g,t);var a=C(g);function g(h){var d;Object(w.a)(this,g),d=a.call(this,h),d.onKeyDown=function(M){var F=d.props,W=F.onKeyDown,Z=F.onPressEnter;if(M.keyCode===O.a.UP){var K=d.getRatio(M);d.up(M,K,null),d.stop()}else if(M.keyCode===O.a.DOWN){var J=d.getRatio(M);d.down(M,J,null),d.stop()}else M.keyCode===O.a.ENTER&&Z&&Z(M);if(d.recordCursorPosition(),d.lastKeyCode=M.keyCode,W){for(var oe=arguments.length,se=new Array(oe>1?oe-1:0),pe=1;pe<oe;pe++)se[pe-1]=arguments[pe];W.apply(void 0,[M].concat(se))}},d.onKeyUp=function(M){var F=d.props.onKeyUp;if(d.stop(),d.recordCursorPosition(),F){for(var W=arguments.length,Z=new Array(W>1?W-1:0),K=1;K<W;K++)Z[K-1]=arguments[K];F.apply(void 0,[M].concat(Z))}},d.onChange=function(M){var F=d.props.onChange;d.state.focused&&(d.inputting=!0),d.rawInput=d.props.parser(d.getValueFromEvent(M)),d.setState({inputValue:d.rawInput}),F(d.toNumber(d.rawInput))},d.onMouseUp=function(){var M=d.props.onMouseUp;d.recordCursorPosition(),M&&M.apply(void 0,arguments)},d.onFocus=function(){var M;d.setState({focused:!0}),(M=d.props).onFocus.apply(M,arguments)},d.onBlur=function(){var M=d.props.onBlur;d.inputting=!1,d.setState({focused:!1});var F=d.getCurrentValidValue(d.state.inputValue),W=d.setValue(F,m);if(M){var Z=d.input.value,K=d.getInputDisplayValue({focus:!1,value:W});d.input.value=K&&Number(K),M.apply(void 0,arguments),d.input.value=Z}},d.getRatio=function(M){var F=1;return M.metaKey||M.ctrlKey?F=.1:M.shiftKey&&(F=10),F},d.getFullNum=function(M){return isNaN(M)?M:/e/i.test(String(M))?Number(M).toFixed(18).replace(/\.?0+$/,""):M},d.getPrecision=function(M){if(o(d.props.precision))return d.props.precision;var F=String(M);if(F.indexOf("e-")>=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var W=0;return F.indexOf(".")>=0&&(W=F.length-F.indexOf(".")-1),W},d.getInputDisplayValue=function(M){var F=M||d.state,W=F.focused,Z=F.inputValue,K=F.value,J;W?J=Z:J=d.toPrecisionAsStep(K),J==null&&(J="");var oe=d.formatWrapper(J);return o(d.props.decimalSeparator)&&(oe=oe.toString().replace(".",d.props.decimalSeparator)),oe},d.recordCursorPosition=function(){try{d.cursorStart=d.input.selectionStart,d.cursorEnd=d.input.selectionEnd,d.currentValue=d.input.value,d.cursorBefore=d.input.value.substring(0,d.cursorStart),d.cursorAfter=d.input.value.substring(d.cursorEnd)}catch(M){}},d.restoreByAfter=function(M){if(M===void 0)return!1;var F=d.input.value,W=F.lastIndexOf(M);if(W===-1)return!1;var Z=d.cursorBefore.length;return d.lastKeyCode===O.a.DELETE&&d.cursorBefore.charAt(Z-1)===M[0]?(d.fixCaret(Z,Z),!0):W+M.length===F.length?(d.fixCaret(W,W),!0):!1},d.partRestoreByAfter=function(M){return M===void 0?!1:Array.prototype.some.call(M,function(F,W){var Z=M.substring(W);return d.restoreByAfter(Z)})},d.isNotCompleteNumber=function(M){return isNaN(M)||M===""||M===null||M&&M.toString().indexOf(".")===M.toString().length-1},d.stop=function(){d.autoStepTimer&&clearTimeout(d.autoStepTimer)},d.down=function(M,F,W){d.pressingUpOrDown=!0,d.step("down",M,F,W)},d.up=function(M,F,W){d.pressingUpOrDown=!0,d.step("up",M,F,W)},d.saveInput=function(M){d.input=M};var e=h.value;e===void 0&&(e=h.defaultValue),d.state={focused:h.autoFocus};var A=d.getValidValue(d.toNumber(e));return d.state=T(T({},d.state),{},{inputValue:d.toPrecisionAsStep(A),value:A}),d}return Object(U.a)(g,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(d){var e=this.props,A=e.value,M=e.onChange,F=e.max,W=e.min,Z=this.state.focused;if(d){if(!v(d.value,A)||!v(d.max,F)||!v(d.min,W)){var K=Z?A:this.getValidValue(A),J;this.pressingUpOrDown?J=K:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(K),this.setState({value:K,inputValue:J})}var oe="value"in this.props?A:this.state.value;"max"in this.props&&d.max!==F&&typeof oe=="number"&&oe>F&&M&&M(F),"min"in this.props&&d.min!==W&&typeof oe=="number"&&oe<W&&M&&M(W)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===O.a.BACKSPACE?se=this.cursorStart-1:this.lastKeyCode===O.a.DELETE&&(se=this.cursorStart):se=this.input.value.length,this.fixCaret(se,se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case O.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case O.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(pe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(d){var e=d;return e===""?e="":this.isNotCompleteNumber(parseFloat(e))?e=this.state.value:e=this.getValidValue(e),this.toNumber(e)}},{key:"getValueFromEvent",value:function(d){var e=d.target.value.trim().replace(/。/g,".");return o(this.props.decimalSeparator)&&(e=e.replace(this.props.decimalSeparator,".")),e}},{key:"getValidValue",value:function(d){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,M=parseFloat(d);return isNaN(M)?d:(M<e&&(M=e),M>A&&(M=A),M)}},{key:"setValue",value:function(d,e){var A=this.props.precision,M=this.isNotCompleteNumber(parseFloat(d))?null:parseFloat(d),F=this.state.value,W=F===void 0?null:F,Z=this.state.inputValue,K=Z===void 0?null:Z,J=typeof M=="number"?M.toFixed(A):"".concat(M),oe=M!==W||J!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},e)):this.setState({value:M,inputValue:this.toPrecisionAsStep(d)},e),oe&&this.props.onChange(M),M}},{key:"getMaxPrecision",value:function(d){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=this.props,M=A.precision,F=A.step;if(o(M))return M;var W=this.getPrecision(e),Z=this.getPrecision(F),K=this.getPrecision(d);return d?Math.max(K,W+Z):W+Z}},{key:"getPrecisionFactor",value:function(d){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=this.getMaxPrecision(d,e);return Math.pow(10,A)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(d){return this.props.formatter?this.props.formatter(d):d}},{key:"toPrecisionAsStep",value:function(d){if(this.isNotCompleteNumber(d)||d==="")return d;var e=Math.abs(this.getMaxPrecision(d));return isNaN(e)?d.toString():Number(d).toFixed(e)}},{key:"toNumber",value:function(d){var e=this.props.precision,A=this.state.focused,M=d&&d.length>16&&A;return this.isNotCompleteNumber(d)||M?d:o(e)?Math.round(d*Math.pow(10,e))/Math.pow(10,e):Number(d)}},{key:"upStep",value:function(d,e){var A=this.props.step,M=this.getPrecisionFactor(d,e),F=Math.abs(this.getMaxPrecision(d,e)),W=((M*d+M*A*e)/M).toFixed(F);return this.toNumber(W)}},{key:"downStep",value:function(d,e){var A=this.props.step,M=this.getPrecisionFactor(d,e),F=Math.abs(this.getMaxPrecision(d,e)),W=((M*d-M*A*e)/M).toFixed(F);return this.toNumber(W)}},{key:"step",value:function(d,e){var A=this,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0;this.stop(),e&&(e.persist(),e.preventDefault());var W=this.props;if(W.disabled)return;var Z=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(Z))return;var K=this["".concat(d,"Step")](Z,M),J=K>W.max||K<W.min;if(K>W.max?K=W.max:K<W.min&&(K=W.min),this.setValue(K,null),this.setState({focused:!0},function(){A.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){A[d](e,M,!0)},F?l:y)}},{key:"fixCaret",value:function(d,e){if(d===void 0||e===void 0||!this.input||!this.input.value)return;try{var A=this.input.selectionStart,M=this.input.selectionEnd;(d!==A||e!==M)&&this.input.setSelectionRange(d,e)}catch(F){}}},{key:"render",value:function(){var d,e=this.props,A=e.prefixCls,M=e.disabled,F=e.readOnly,W=e.useTouch,Z=e.autoComplete,K=e.upHandler,J=e.downHandler,oe=e.className,se=e.max,pe=e.min,be=e.style,Q=e.title,te=e.onMouseEnter,ve=e.onMouseLeave,q=e.onMouseOver,X=e.onMouseOut,Te=e.required,Ie=e.onClick,Ge=e.tabIndex,Ae=e.type,Me=e.placeholder,Se=e.id,Le=e.inputMode,Ve=e.pattern,$e=e.step,Qe=e.maxLength,Be=e.autoFocus,ze=e.name,ot=e.onPaste,Re=e.onInput,nt=Object(he.a)(e,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),rt=this.state,lt=rt.value,bt=rt.focused,Ee=E()(A,(d={},Object(B.a)(d,oe,!!oe),Object(B.a)(d,"".concat(A,"-disabled"),M),Object(B.a)(d,"".concat(A,"-focused"),bt),d)),Oe={};Object.keys(nt).forEach(function(ne){(ne.substr(0,5)==="data-"||ne.substr(0,5)==="aria-"||ne==="role")&&(Oe[ne]=nt[ne])});var je=!F&&!M,Ye=this.getInputDisplayValue(null),De=(lt||lt===0)&&(isNaN(lt)||Number(lt)>=se),Ke=(lt||lt===0)&&(isNaN(lt)||Number(lt)<=pe),ce=De||M||F,re=Ke||M||F,ie=E()("".concat(A,"-handler"),"".concat(A,"-handler-up"),Object(B.a)({},"".concat(A,"-handler-up-disabled"),ce)),$=E()("".concat(A,"-handler"),"".concat(A,"-handler-down"),Object(B.a)({},"".concat(A,"-handler-down-disabled"),re)),Y=W?{onTouchStart:ce?m:this.up,onTouchEnd:this.stop}:{onMouseDown:ce?m:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},V=W?{onTouchStart:re?m:this.down,onTouchEnd:this.stop}:{onMouseDown:re?m:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return S.a.createElement("div",{className:Ee,style:be,title:Q,onMouseEnter:te,onMouseLeave:ve,onMouseOver:q,onMouseOut:X,onFocus:function(){return null},onBlur:function(){return null}},S.a.createElement("div",{className:"".concat(A,"-handler-wrap")},S.a.createElement("span",Object.assign({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":ce,className:ie}),K||S.a.createElement("span",{unselectable:"on",className:"".concat(A,"-handler-up-inner"),onClick:n})),S.a.createElement("span",Object.assign({unselectable:"on"},V,{role:"button","aria-label":"Decrease Value","aria-disabled":re,className:$}),J||S.a.createElement("span",{unselectable:"on",className:"".concat(A,"-handler-down-inner"),onClick:n}))),S.a.createElement("div",{className:"".concat(A,"-input-wrap")},S.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":pe,"aria-valuemax":se,"aria-valuenow":lt,required:Te,type:Ae,placeholder:Me,onPaste:ot,onClick:Ie,onMouseUp:this.onMouseUp,className:"".concat(A,"-input"),tabIndex:Ge,autoComplete:Z,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:je?this.onKeyDown:m,onKeyUp:je?this.onKeyUp:m,autoFocus:Be,maxLength:Qe,readOnly:F,disabled:M,max:se,min:pe,step:$e,name:ze,title:Q,id:Se,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ye),pattern:Ve,inputMode:Le,onInput:Re},Oe))))}}]),g}(S.a.Component);f.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:c,min:-c,step:1,style:{},onChange:m,onKeyDown:m,onPressEnter:m,onFocus:m,onBlur:m,parser:s,required:!1,autoComplete:"off"};var i=f,r=Fe.a=i},fAei:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return l.a});var he=j("rePB"),B=j("VTBJ"),w=j("KQm4"),U=j("1OyB"),_=j("vuIU"),x=j("Ji7U"),N=j("LK+K"),I=j("q1tI"),S=j("4IlW"),P=j("Kwbf"),E=j("TSYQ"),O=j.n(E),R=j("sboe"),T=j("OZM5"),C=j("815F"),b=j("ODXe"),m=j("Ff2n"),n=j("+nKL"),s=j("8XRh"),l=j("WaYH"),y=function(pe,be){var Q=pe.className,te=pe.style,ve=pe.motion,q=pe.motionNodes,X=pe.motionType,Te=pe.onMotionStart,Ie=pe.onMotionEnd,Ge=pe.active,Ae=pe.treeNodeRequiredProps,Me=Object(m.a)(pe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Se=I.useState(!0),Le=Object(b.a)(Se,2),Ve=Le[0],$e=Le[1],Qe=I.useContext(R.a),Be=Qe.prefixCls,ze=I.useRef(!1),ot=function(){ze.current||Ie(),ze.current=!0};return Object(I.useEffect)(function(){q&&X==="hide"&&Ve&&$e(!1)},[q]),Object(I.useEffect)(function(){return q&&Te(),function(){q&&ot()}},[]),q?I.createElement(s.default,Object.assign({ref:be,visible:Ve},ve,{motionAppear:X==="show",onAppearEnd:ot,onLeaveEnd:ot}),function(Re,nt){var rt=Re.className,lt=Re.style;return I.createElement("div",{ref:nt,className:O()("".concat(Be,"-treenode-motion"),rt),style:lt},q.map(function(bt){var Ee=bt.data,Oe=Ee.key,je=Object(m.a)(Ee,["key"]),Ye=bt.isStart,De=bt.isEnd;delete je.children;var Ke=Object(C.f)(Oe,Ae);return I.createElement(l.a,Object.assign({},je,Ke,{active:Ge,data:bt.data,key:Oe,isStart:Ye,isEnd:De}))}))}):I.createElement(l.a,Object.assign({domRef:be,className:Q,style:te},Me,{active:Ge}))};y.displayName="MotionTreeNode";var c=I.forwardRef(y),o=c;function v(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],be=se.length,Q=pe.length;if(Math.abs(be-Q)!==1)return{add:!1,key:null};function te(ve,q){var X=new Map;ve.forEach(function(Ie){X.set(Ie,!0)});var Te=q.filter(function(Ie){return!X.has(Ie)});return Te.length===1?Te[0]:null}return be<Q?{add:!0,key:te(se,pe)}:{add:!1,key:te(pe,se)}}function f(se,pe,be){var Q=se.findIndex(function(X){var Te=X.data;return Te.key===be}),te=se[Q+1],ve=pe.findIndex(function(X){var Te=X.data;return Te.key===be});if(te){var q=pe.findIndex(function(X){var Te=X.data;return Te.key===te.data.key});return pe.slice(ve+1,q)}return pe.slice(ve+1)}var i={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},r=function(){},t="RC_TREE_MOTION_".concat(Math.random()),a={key:t},g={key:t,level:0,index:0,pos:"0",node:a},h={parent:null,children:[],pos:g.pos,data:a,isStart:[],isEnd:[]};function d(se,pe,be,Q){return pe===!1||!be?se:se.slice(0,Math.ceil(be/Q)+1)}function e(se){var pe=se.data.key,be=se.pos;return Object(C.e)(pe,be)}function A(se){for(var pe=String(se.data.key),be=se;be.parent;)be=be.parent,pe="".concat(be.data.key," > ").concat(pe);return pe}var M=function(pe,be){var Q=pe.prefixCls,te=pe.data,ve=pe.selectable,q=pe.checkable,X=pe.expandedKeys,Te=pe.selectedKeys,Ie=pe.checkedKeys,Ge=pe.loadedKeys,Ae=pe.loadingKeys,Me=pe.halfCheckedKeys,Se=pe.keyEntities,Le=pe.disabled,Ve=pe.dragging,$e=pe.dragOverNodeKey,Qe=pe.dropPosition,Be=pe.motion,ze=pe.height,ot=pe.itemHeight,Re=pe.virtual,nt=pe.focusable,rt=pe.activeItem,lt=pe.focused,bt=pe.tabIndex,Ee=pe.onKeyDown,Oe=pe.onFocus,je=pe.onBlur,Ye=pe.onActiveChange,De=pe.onListChangeStart,Ke=pe.onListChangeEnd,ce=Object(m.a)(pe,["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(be,function(){return{scrollTo:function(Rn){re.current.scrollTo(Rn)}}});var ie=I.useState(X),$=Object(b.a)(ie,2),Y=$[0],V=$[1],ne=I.useState(te),_e=Object(b.a)(ne,2),we=_e[0],Xe=_e[1],gt=I.useState(te),Nt=Object(b.a)(gt,2),ht=Nt[0],en=Nt[1],tn=I.useState([]),Dt=Object(b.a)(tn,2),_n=Dt[0],fn=Dt[1],sn=I.useState(null),Ln=Object(b.a)(sn,2),Wt=Ln[0],yn=Ln[1];function xn(){Xe(te),en(te),fn([]),yn(null),Ke()}I.useEffect(function(){V(X);var Cn=v(Y,X);if(Cn.key!==null)if(Cn.add){var Rn=we.findIndex(function(fr){var br=fr.data.key;return br===Cn.key}),Rt=d(f(we,te,Cn.key),Re,ze,ot),Gn=we.slice();Gn.splice(Rn+1,0,h),en(Gn),fn(Rt),yn("show")}else{var er=te.findIndex(function(fr){var br=fr.data.key;return br===Cn.key}),ur=d(f(te,we,Cn.key),Re,ze,ot),tr=te.slice();tr.splice(er+1,0,h),en(tr),fn(ur),yn("hide")}else we!==te&&(Xe(te),en(te))},[X,te]),I.useEffect(function(){Ve||xn()},[Ve]);var pt=Be?ht:te,zn={expandedKeys:X,selectedKeys:Te,loadedKeys:Ge,loadingKeys:Ae,checkedKeys:Ie,halfCheckedKeys:Me,dragOverNodeKey:$e,dropPosition:Qe,keyEntities:Se};return I.createElement(I.Fragment,null,lt&&rt&&I.createElement("span",{style:i,"aria-live":"assertive"},A(rt)),I.createElement("div",{role:"tree"},I.createElement("input",{style:i,disabled:nt===!1||Le,tabIndex:nt!==!1?bt:null,onKeyDown:Ee,onFocus:Oe,onBlur:je,value:"",onChange:r})),I.createElement(n.a,Object.assign({},ce,{data:pt,itemKey:e,height:ze,fullHeight:!1,virtual:Re,itemHeight:ot,prefixCls:"".concat(Q,"-list"),ref:re}),function(Cn){var Rn=Cn.pos,Rt=Cn.data,Gn=Rt.key,er=Object(m.a)(Rt,["key"]),ur=Cn.isStart,tr=Cn.isEnd,fr=Object(C.e)(Gn,Rn);delete er.children;var br=Object(C.f)(fr,zn);return I.createElement(o,Object.assign({},er,br,{active:rt&&Gn===rt.data.key,pos:Rn,data:Cn.data,isStart:ur,isEnd:tr,motion:Be,motionNodes:Gn===t?_n:null,motionType:Wt,onMotionStart:De,onMotionEnd:xn,treeNodeRequiredProps:zn,onMouseMove:function(){Ye(null)}}))}))},F=I.forwardRef(M);F.displayName="NodeList";var W=F,Z=j("NvD2"),K=function(se){Object(x.a)(be,se);var pe=Object(N.a)(be);function be(){var Q;return Object(U.a)(this,be),Q=pe.apply(this,arguments),Q.destroyed=!1,Q.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},Q.listRef=I.createRef(),Q.onNodeDragStart=function(te,ve){var q=Q.state,X=q.expandedKeys,Te=q.keyEntities,Ie=Q.props.onDragStart,Ge=ve.props.eventKey;Q.dragNode=ve;var Ae=Object(T.b)(X,Ge);Q.setState({dragging:!0,dragNodesKeys:Object(T.g)(Ge,Te)}),Q.setExpandedKeys(Ae),Ie&&Ie({event:te,node:Object(C.b)(ve.props)})},Q.onNodeDragEnter=function(te,ve){var q=Q.state,X=q.expandedKeys,Te=q.keyEntities,Ie=q.dragNodesKeys,Ge=Q.props.onDragEnter,Ae=ve.props,Me=Ae.pos,Se=Ae.eventKey;if(!Q.dragNode||Ie.indexOf(Se)!==-1)return;var Le=Object(T.c)(te,ve);if(Q.dragNode.props.eventKey===Se&&Le===0){Q.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){Q.setState({dragOverNodeKey:Se,dropPosition:Le}),Q.delayedDragEnterLogic||(Q.delayedDragEnterLogic={}),Object.keys(Q.delayedDragEnterLogic).forEach(function(Ve){clearTimeout(Q.delayedDragEnterLogic[Ve])}),Q.delayedDragEnterLogic[Me]=window.setTimeout(function(){if(!Q.state.dragging)return;var Ve=Object(w.a)(X),$e=Te[Se];$e&&($e.children||[]).length&&(Ve=Object(T.a)(X,Se)),"expandedKeys"in Q.props||Q.setExpandedKeys(Ve),Ge&&Ge({event:te,node:Object(C.b)(ve.props),expandedKeys:Ve})},400)},0)},Q.onNodeDragOver=function(te,ve){var q=Q.state.dragNodesKeys,X=Q.props.onDragOver,Te=ve.props.eventKey;if(q.indexOf(Te)!==-1)return;if(Q.dragNode&&Te===Q.state.dragOverNodeKey){var Ie=Object(T.c)(te,ve);if(Ie===Q.state.dropPosition)return;Q.setState({dropPosition:Ie})}X&&X({event:te,node:Object(C.b)(ve.props)})},Q.onNodeDragLeave=function(te,ve){var q=Q.props.onDragLeave;Q.setState({dragOverNodeKey:""}),q&&q({event:te,node:Object(C.b)(ve.props)})},Q.onNodeDragEnd=function(te,ve){var q=Q.props.onDragEnd;Q.setState({dragOverNodeKey:""}),Q.cleanDragState(),q&&q({event:te,node:Object(C.b)(ve.props)}),Q.dragNode=null},Q.onNodeDrop=function(te,ve){var q=Q.state,X=q.dragNodesKeys,Te=X===void 0?[]:X,Ie=q.dropPosition,Ge=Q.props.onDrop,Ae=ve.props,Me=Ae.eventKey,Se=Ae.pos;if(Q.setState({dragOverNodeKey:""}),Q.cleanDragState(),Te.indexOf(Me)!==-1){Object(P.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Le=Object(T.k)(Se),Ve={event:te,node:Object(C.b)(ve.props),dragNode:Q.dragNode?Object(C.b)(Q.dragNode.props):null,dragNodesKeys:Te.slice(),dropPosition:Ie+Number(Le[Le.length-1]),dropToGap:!1};Ie!==0&&(Ve.dropToGap=!0),Ge&&Ge(Ve),Q.dragNode=null},Q.cleanDragState=function(){var te=Q.state.dragging;te&&Q.setState({dragging:!1})},Q.onNodeClick=function(te,ve){var q=Q.props.onClick;q&&q(te,ve)},Q.onNodeDoubleClick=function(te,ve){var q=Q.props.onDoubleClick;q&&q(te,ve)},Q.onNodeSelect=function(te,ve){var q=Q.state.selectedKeys,X=Q.state.keyEntities,Te=Q.props,Ie=Te.onSelect,Ge=Te.multiple,Ae=ve.selected,Me=ve.key,Se=!Ae;Se?Ge?q=Object(T.a)(q,Me):q=[Me]:q=Object(T.b)(q,Me);var Le=q.map(function(Ve){var $e=X[Ve];return $e?$e.node:null}).filter(function(Ve){return Ve});Q.setUncontrolledState({selectedKeys:q}),Ie&&Ie(q,{event:"select",selected:Se,node:ve,selectedNodes:Le,nativeEvent:te.nativeEvent})},Q.onNodeCheck=function(te,ve,q){var X=Q.state,Te=X.keyEntities,Ie=X.checkedKeys,Ge=X.halfCheckedKeys,Ae=Q.props,Me=Ae.checkStrictly,Se=Ae.onCheck,Le=ve.key,Ve,$e={event:"check",node:ve,checked:q,nativeEvent:te.nativeEvent};if(Me){var Qe=q?Object(T.a)(Ie,Le):Object(T.b)(Ie,Le),Be=Object(T.b)(Ge,Le);Ve={checked:Qe,halfChecked:Be},$e.checkedNodes=Qe.map(function(lt){return Te[lt]}).filter(function(lt){return lt}).map(function(lt){return lt.node}),Q.setUncontrolledState({checkedKeys:Qe})}else{var ze=Object(Z.a)([].concat(Object(w.a)(Ie),[Le]),!0,Te),ot=ze.checkedKeys,Re=ze.halfCheckedKeys;if(!q){var nt=new Set(ot);nt.delete(Le);var rt=Object(Z.a)(Array.from(nt),{checked:!1,halfCheckedKeys:Re},Te);ot=rt.checkedKeys,Re=rt.halfCheckedKeys}Ve=ot,$e.checkedNodes=[],$e.checkedNodesPositions=[],$e.halfCheckedKeys=Re,ot.forEach(function(lt){var bt=Te[lt];if(!bt)return;var Ee=bt.node,Oe=bt.pos;$e.checkedNodes.push(Ee),$e.checkedNodesPositions.push({node:Ee,pos:Oe})}),Q.setUncontrolledState({checkedKeys:ot},!1,{halfCheckedKeys:Re})}Se&&Se(Ve,$e)},Q.onNodeLoad=function(te){return new Promise(function(ve){Q.setState(function(q){var X=q.loadedKeys,Te=X===void 0?[]:X,Ie=q.loadingKeys,Ge=Ie===void 0?[]:Ie,Ae=Q.props,Me=Ae.loadData,Se=Ae.onLoad,Le=te.key;if(!Me||Te.indexOf(Le)!==-1||Ge.indexOf(Le)!==-1)return{};var Ve=Me(te);return Ve.then(function(){var $e=Q.state,Qe=$e.loadedKeys,Be=$e.loadingKeys,ze=Object(T.a)(Qe,Le),ot=Object(T.b)(Be,Le);Se&&Se(ze,{event:"load",node:te}),Q.setUncontrolledState({loadedKeys:ze}),Q.setState({loadingKeys:ot}),ve()}),{loadingKeys:Object(T.a)(Ge,Le)}})})},Q.onNodeMouseEnter=function(te,ve){var q=Q.props.onMouseEnter;q&&q({event:te,node:ve})},Q.onNodeMouseLeave=function(te,ve){var q=Q.props.onMouseLeave;q&&q({event:te,node:ve})},Q.onNodeContextMenu=function(te,ve){var q=Q.props.onRightClick;q&&(te.preventDefault(),q({event:te,node:ve}))},Q.onFocus=function(){var te=Q.props.onFocus;Q.setState({focused:!0}),te&&te.apply(void 0,arguments)},Q.onBlur=function(){var te=Q.props.onBlur;Q.setState({focused:!1}),Q.onActiveChange(null),te&&te.apply(void 0,arguments)},Q.getTreeNodeRequiredProps=function(){var te=Q.state,ve=te.expandedKeys,q=te.selectedKeys,X=te.loadedKeys,Te=te.loadingKeys,Ie=te.checkedKeys,Ge=te.halfCheckedKeys,Ae=te.dragOverNodeKey,Me=te.dropPosition,Se=te.keyEntities;return{expandedKeys:ve||[],selectedKeys:q||[],loadedKeys:X||[],loadingKeys:Te||[],checkedKeys:Ie||[],halfCheckedKeys:Ge||[],dragOverNodeKey:Ae,dropPosition:Me,keyEntities:Se}},Q.setExpandedKeys=function(te){var ve=Q.state.treeData,q=Object(C.d)(ve,te);Q.setUncontrolledState({expandedKeys:te,flattenNodes:q},!0)},Q.onNodeExpand=function(te,ve){var q=Q.state.expandedKeys,X=Q.state.listChanging,Te=Q.props,Ie=Te.onExpand,Ge=Te.loadData,Ae=ve.key,Me=ve.expanded;if(X)return;var Se=q.indexOf(Ae),Le=!Me;if(Object(P.a)(Me&&Se!==-1||!Me&&Se===-1,"Expand state not sync with index check"),Le?q=Object(T.a)(q,Ae):q=Object(T.b)(q,Ae),Q.setExpandedKeys(q),Ie&&Ie(q,{node:ve,expanded:Le,nativeEvent:te.nativeEvent}),Le&&Ge){var Ve=Q.onNodeLoad(ve);Ve&&Ve.then(function(){var $e=Object(C.d)(Q.state.treeData,q);Q.setUncontrolledState({flattenNodes:$e})})}},Q.onListChangeStart=function(){Q.setUncontrolledState({listChanging:!0})},Q.onListChangeEnd=function(){setTimeout(function(){Q.setUncontrolledState({listChanging:!1})})},Q.onActiveChange=function(te){var ve=Q.state.activeKey,q=Q.props.onActiveChange;if(ve===te)return;Q.setState({activeKey:te}),te!==null&&Q.scrollTo({key:te}),q&&q(te)},Q.getActiveItem=function(){var te=Q.state,ve=te.activeKey,q=te.flattenNodes;return ve===null?null:q.find(function(X){var Te=X.data.key;return Te===ve})||null},Q.offsetActiveKey=function(te){var ve=Q.state,q=ve.flattenNodes,X=ve.activeKey,Te=q.findIndex(function(Ae){var Me=Ae.data.key;return Me===X});Te===-1&&te<0&&(Te=q.length),Te=(Te+te+q.length)%q.length;var Ie=q[Te];if(Ie){var Ge=Ie.data.key;Q.onActiveChange(Ge)}else Q.onActiveChange(null)},Q.onKeyDown=function(te){var ve=Q.state,q=ve.activeKey,X=ve.expandedKeys,Te=ve.checkedKeys,Ie=Q.props,Ge=Ie.onKeyDown,Ae=Ie.checkable,Me=Ie.selectable;switch(te.which){case S.a.UP:{Q.offsetActiveKey(-1),te.preventDefault();break}case S.a.DOWN:{Q.offsetActiveKey(1),te.preventDefault();break}}var Se=Q.getActiveItem();if(Se&&Se.data){var Le=Q.getTreeNodeRequiredProps(),Ve=Se.data.isLeaf===!1||!!(Se.data.children||[]).length,$e=Object(C.b)(Object(B.a)(Object(B.a)({},Object(C.f)(q,Le)),{},{data:Se.data,active:!0}));switch(te.which){case S.a.LEFT:{Ve&&X.includes(q)?Q.onNodeExpand({},$e):Se.parent&&Q.onActiveChange(Se.parent.data.key),te.preventDefault();break}case S.a.RIGHT:{Ve&&!X.includes(q)?Q.onNodeExpand({},$e):Se.children&&Se.children.length&&Q.onActiveChange(Se.children[0].data.key),te.preventDefault();break}case S.a.ENTER:case S.a.SPACE:{Ae&&!$e.disabled&&$e.checkable!==!1&&!$e.disableCheckbox?Q.onNodeCheck({},$e,!Te.includes(q)):!Ae&&Me&&!$e.disabled&&$e.selectable!==!1&&Q.onNodeSelect({},$e);break}}}Ge&&Ge(te)},Q.setUncontrolledState=function(te){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(Q.destroyed)return;var X=!1,Te=!0,Ie={};Object.keys(te).forEach(function(Ge){if(Ge in Q.props){Te=!1;return}X=!0,Ie[Ge]=te[Ge]}),X&&(!ve||Te)&&Q.setState(Object(B.a)(Object(B.a)({},Ie),q))},Q.scrollTo=function(te){Q.listRef.current.scrollTo(te)},Q}return Object(_.a)(be,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var te,ve=this.state,q=ve.focused,X=ve.flattenNodes,Te=ve.keyEntities,Ie=ve.dragging,Ge=ve.activeKey,Ae=this.props,Me=Ae.prefixCls,Se=Ae.className,Le=Ae.style,Ve=Ae.showLine,$e=Ae.focusable,Qe=Ae.tabIndex,Be=Qe===void 0?0:Qe,ze=Ae.selectable,ot=Ae.showIcon,Re=Ae.icon,nt=Ae.switcherIcon,rt=Ae.draggable,lt=Ae.checkable,bt=Ae.checkStrictly,Ee=Ae.disabled,Oe=Ae.motion,je=Ae.loadData,Ye=Ae.filterTreeNode,De=Ae.height,Ke=Ae.itemHeight,ce=Ae.virtual,re=Ae.titleRender,ie=Ae.onContextMenu,$=Object(T.f)(this.props);return I.createElement(R.a.Provider,{value:{prefixCls:Me,selectable:ze,showIcon:ot,icon:Re,switcherIcon:nt,draggable:rt,checkable:lt,checkStrictly:bt,disabled:Ee,keyEntities:Te,loadData:je,filterTreeNode:Ye,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:O()(Me,Se,(te={},Object(he.a)(te,"".concat(Me,"-show-line"),Ve),Object(he.a)(te,"".concat(Me,"-focused"),q),Object(he.a)(te,"".concat(Me,"-active-focused"),Ge!==null),te))},I.createElement(W,Object.assign({ref:this.listRef,prefixCls:Me,style:Le,data:X,disabled:Ee,selectable:ze,checkable:!!lt,motion:Oe,dragging:Ie,height:De,itemHeight:Ke,virtual:ce,focusable:$e,focused:q,tabIndex:Be,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ie},this.getTreeNodeRequiredProps(),$))))}}],[{key:"getDerivedStateFromProps",value:function(te,ve){var q=ve.prevProps,X={prevProps:te};function Te(Re){return!q&&Re in te||q&&q[Re]!==te[Re]}var Ie;if(Te("treeData")?Ie=te.treeData:Te("children")&&(Object(P.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Ie=Object(C.c)(te.children)),Ie){X.treeData=Ie;var Ge=Object(C.a)(Ie);X.keyEntities=Object(B.a)(Object(he.a)({},t,g),Ge.keyEntities)}var Ae=X.keyEntities||ve.keyEntities;if(Te("expandedKeys")||q&&Te("autoExpandParent"))X.expandedKeys=te.autoExpandParent||!q&&te.defaultExpandParent?Object(T.e)(te.expandedKeys,Ae):te.expandedKeys;else if(!q&&te.defaultExpandAll){var Me=Object(B.a)({},Ae);delete Me[t],X.expandedKeys=Object.keys(Me).map(function(Re){return Me[Re].key})}else!q&&te.defaultExpandedKeys&&(X.expandedKeys=te.autoExpandParent||te.defaultExpandParent?Object(T.e)(te.defaultExpandedKeys,Ae):te.defaultExpandedKeys);if(X.expandedKeys||delete X.expandedKeys,Ie||X.expandedKeys){var Se=Object(C.d)(Ie||ve.treeData,X.expandedKeys||ve.expandedKeys);X.flattenNodes=Se}if(te.selectable&&(Te("selectedKeys")?X.selectedKeys=Object(T.d)(te.selectedKeys,te):!q&&te.defaultSelectedKeys&&(X.selectedKeys=Object(T.d)(te.defaultSelectedKeys,te))),te.checkable){var Le;if(Te("checkedKeys")?Le=Object(T.j)(te.checkedKeys)||{}:!q&&te.defaultCheckedKeys?Le=Object(T.j)(te.defaultCheckedKeys)||{}:Ie&&(Le=Object(T.j)(te.checkedKeys)||{checkedKeys:ve.checkedKeys,halfCheckedKeys:ve.halfCheckedKeys}),Le){var Ve=Le,$e=Ve.checkedKeys,Qe=$e===void 0?[]:$e,Be=Ve.halfCheckedKeys,ze=Be===void 0?[]:Be;if(!te.checkStrictly){var ot=Object(Z.a)(Qe,!0,Ae);Qe=ot.checkedKeys,ze=ot.halfCheckedKeys}X.checkedKeys=Qe,X.halfCheckedKeys=ze}}return Te("loadedKeys")&&(X.loadedKeys=te.loadedKeys),X}}]),be}(I.Component);K.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:[]},K.TreeNode=l.a;var J=K,oe=Fe.b=J},fcSX:function(Ct,Fe,j){"use strict";var he=j("Ff2n"),B=j("1OyB"),w=j("vuIU"),U=j("Ji7U"),_=j("md7G"),x=j("foSv"),N=j("1W/9"),I=j("q1tI"),S=j("rePB"),P=j("JX7q"),E=j("TSYQ"),O=j.n(E),R=j("qx4F"),T=j("4IlW");function C(M){return Array.isArray(M)?M:[M]}var b={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},m=Object.keys(b).filter(function(M){if(typeof document=="undefined")return!1;var F=document.getElementsByTagName("html")[0];return M in(F?F.style:{})})[0],n=b[m];function s(M,F,W,Z){M.addEventListener?M.addEventListener(F,W,Z):M.attachEvent&&M.attachEvent("on".concat(F),W)}function l(M,F,W,Z){M.removeEventListener?M.removeEventListener(F,W,Z):M.attachEvent&&M.detachEvent("on".concat(F),W)}function y(M,F){var W=typeof M=="function"?M(F):M;return Array.isArray(W)?W.length===2?W:[W[0],W[1]]:[W]}var c=function(F){return!isNaN(parseFloat(F))&&isFinite(F)},o=!(typeof window!="undefined"&&window.document&&window.document.createElement),v=function M(F,W,Z,K){if(!W||W===document||W instanceof Document)return!1;if(W===F.parentNode)return!0;var J=Math.max(Math.abs(Z),Math.abs(K))===Math.abs(K),oe=Math.max(Math.abs(Z),Math.abs(K))===Math.abs(Z),se=W.scrollHeight-W.clientHeight,pe=W.scrollWidth-W.clientWidth,be=document.defaultView.getComputedStyle(W),Q=be.overflowY==="auto"||be.overflowY==="scroll",te=be.overflowX==="auto"||be.overflowX==="scroll",ve=se&&Q,q=pe&&te;return J&&(!ve||ve&&(W.scrollTop>=se&&K<0||W.scrollTop<=0&&K>0))||oe&&(!q||q&&(W.scrollLeft>=pe&&Z<0||W.scrollLeft<=0&&Z>0))?M(F,W.parentNode,Z,K):!1};function f(M){var F=i();return function(){var Z=Object(x.a)(M),K;if(F){var J=Object(x.a)(this).constructor;K=Reflect.construct(Z,arguments,J)}else K=Z.apply(this,arguments);return Object(_.a)(this,K)}}function i(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(M){return!1}}var r={},t=function(M){Object(U.a)(W,M);var F=f(W);function W(Z){var K;return Object(B.a)(this,W),K=F.call(this,Z),K.domFocus=function(){K.dom&&K.dom.focus()},K.removeStartHandler=function(J){if(J.touches.length>1)return;K.startPos={x:J.touches[0].clientX,y:J.touches[0].clientY}},K.removeMoveHandler=function(J){if(J.changedTouches.length>1)return;var oe=J.currentTarget,se=J.changedTouches[0].clientX-K.startPos.x,pe=J.changedTouches[0].clientY-K.startPos.y;(oe===K.maskDom||oe===K.handlerDom||oe===K.contentDom&&v(oe,J.target,se,pe))&&J.cancelable&&J.preventDefault()},K.transitionEnd=function(J){var oe=J.target;l(oe,n,K.transitionEnd),oe.style.transition=""},K.onKeyDown=function(J){if(J.keyCode===T.a.ESC){var oe=K.props.onClose;J.stopPropagation(),oe&&oe(J)}},K.onWrapperTransitionEnd=function(J){var oe=K.props,se=oe.open,pe=oe.afterVisibleChange;J.target===K.contentWrapper&&J.propertyName.match(/transform$/)&&(K.dom.style.transition="",!se&&K.getCurrentDrawerSome()&&(document.body.style.overflowX="",K.maskDom&&(K.maskDom.style.left="",K.maskDom.style.width="")),pe&&pe(!!se))},K.openLevelTransition=function(){var J=K.props,oe=J.open,se=J.width,pe=J.height,be=K.getHorizontalBoolAndPlacementName(),Q=be.isHorizontal,te=be.placementName,ve=K.contentDom?K.contentDom.getBoundingClientRect()[Q?"width":"height"]:0,q=(Q?se:pe)||ve;K.setLevelAndScrolling(oe,te,q)},K.setLevelTransform=function(J,oe,se,pe){var be=K.props,Q=be.placement,te=be.levelMove,ve=be.duration,q=be.ease,X=be.showMask;K.levelDom.forEach(function(Te){Te.style.transition="transform ".concat(ve," ").concat(q),s(Te,n,K.transitionEnd);var Ie=J?se:0;if(te){var Ge=y(te,{target:Te,open:J});Ie=J?Ge[0]:Ge[1]||0}var Ae=typeof Ie=="number"?"".concat(Ie,"px"):Ie,Me=Q==="left"||Q==="top"?Ae:"-".concat(Ae);Me=X&&Q==="right"&&pe?"calc(".concat(Me," + ").concat(pe,"px)"):Me,Te.style.transform=Ie?"".concat(oe,"(").concat(Me,")"):""})},K.setLevelAndScrolling=function(J,oe,se){var pe=K.props.onChange;if(!o){var be=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(R.a)(!0):0;K.setLevelTransform(J,oe,se,be),K.toggleScrollingToDrawerAndBody(be)}pe&&pe(J)},K.toggleScrollingToDrawerAndBody=function(J){var oe=K.props,se=oe.getOpenCount,pe=oe.getContainer,be=oe.showMask,Q=oe.open,te=pe&&pe(),ve=se&&se();if(te&&te.parentNode===document.body&&be){var q=["touchstart"],X=[document.body,K.maskDom,K.handlerDom,K.contentDom];Q&&document.body.style.overflow!=="hidden"?(J&&K.addScrollingEffect(J),ve===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",X.forEach(function(Te,Ie){if(!Te)return;s(Te,q[Ie]||"touchmove",Ie?K.removeMoveHandler:K.removeStartHandler,K.passive)})):K.getCurrentDrawerSome()&&(ve||(document.body.style.overflow=""),document.body.style.touchAction="",J&&K.remScrollingEffect(J),X.forEach(function(Te,Ie){if(!Te)return;l(Te,q[Ie]||"touchmove",Ie?K.removeMoveHandler:K.removeStartHandler,K.passive)}))}},K.addScrollingEffect=function(J){var oe=K.props,se=oe.placement,pe=oe.duration,be=oe.ease,Q=oe.getOpenCount,te=oe.switchScrollingEffect,ve=Q&&Q();ve===1&&te();var q="width ".concat(pe," ").concat(be),X="transform ".concat(pe," ").concat(be);K.dom.style.transition="none";switch(se){case"right":K.dom.style.transform="translateX(-".concat(J,"px)");break;case"top":case"bottom":K.dom.style.width="calc(100% - ".concat(J,"px)"),K.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(X,",").concat(q),K.dom.style.width="",K.dom.style.transform="")})},K.remScrollingEffect=function(J){var oe=K.props,se=oe.placement,pe=oe.duration,be=oe.ease,Q=oe.getOpenCount,te=oe.switchScrollingEffect,ve=Q&&Q();ve||te(!0),m&&(document.body.style.overflowX="hidden"),K.dom.style.transition="none";var q,X="width ".concat(pe," ").concat(be),Te="transform ".concat(pe," ").concat(be);switch(se){case"left":{K.dom.style.width="100%",X="width 0s ".concat(be," ").concat(pe);break}case"right":{K.dom.style.transform="translateX(".concat(J,"px)"),K.dom.style.width="100%",X="width 0s ".concat(be," ").concat(pe),K.maskDom&&(K.maskDom.style.left="-".concat(J,"px"),K.maskDom.style.width="calc(100% + ".concat(J,"px)"));break}case"top":case"bottom":{K.dom.style.width="calc(100% + ".concat(J,"px)"),K.dom.style.height="100%",K.dom.style.transform="translateZ(0)",q="height 0s ".concat(be," ").concat(pe);break}default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(Te,",").concat(q?"".concat(q,","):"").concat(X),K.dom.style.transform="",K.dom.style.width="",K.dom.style.height="")})},K.getCurrentDrawerSome=function(){return!Object.keys(r).some(function(J){return r[J]})},K.getLevelDom=function(J){var oe=J.level,se=J.getContainer;if(o)return;var pe=se&&se(),be=pe?pe.parentNode:null;if(K.levelDom=[],oe==="all"){var Q=be?Array.prototype.slice.call(be.children):[];Q.forEach(function(te){te.nodeName!=="SCRIPT"&&te.nodeName!=="STYLE"&&te.nodeName!=="LINK"&&te!==pe&&K.levelDom.push(te)})}else oe&&C(oe).forEach(function(te){document.querySelectorAll(te).forEach(function(ve){K.levelDom.push(ve)})})},K.getHorizontalBoolAndPlacementName=function(){var J=K.props.placement,oe=J==="left"||J==="right",se="translate".concat(oe?"X":"Y");return{isHorizontal:oe,placementName:se}},K.state={_self:Object(P.a)(K)},K}return Object(w.a)(W,[{key:"componentDidMount",value:function(){var K=this;if(!o){var J=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return J=!0,null}}))}catch(Q){}this.passive=J?{passive:!1}:!1}var oe=this.props,se=oe.open,pe=oe.getContainer,be=pe&&pe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),se&&(be&&be.parentNode===document.body&&(r[this.drawerId]=se),this.openLevelTransition(),this.forceUpdate(function(){K.domFocus()}))}},{key:"componentDidUpdate",value:function(K){var J=this.props,oe=J.open,se=J.getContainer,pe=se&&se();oe!==K.open&&(oe&&this.domFocus(),pe&&pe.parentNode===document.body&&(r[this.drawerId]=!!oe),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var K=this.props,J=K.getOpenCount,oe=K.open,se=K.switchScrollingEffect,pe=typeof J=="function"&&J();delete r[this.drawerId],oe&&(this.setLevelTransform(!1),document.body.style.touchAction=""),pe||(document.body.style.overflow="",se(!0))}},{key:"render",value:function(){var K,J=this,oe=this.props,se=oe.className,pe=oe.children,be=oe.style,Q=oe.width,te=oe.height,ve=oe.defaultOpen,q=oe.open,X=oe.prefixCls,Te=oe.placement,Ie=oe.level,Ge=oe.levelMove,Ae=oe.ease,Me=oe.duration,Se=oe.getContainer,Le=oe.handler,Ve=oe.onChange,$e=oe.afterVisibleChange,Qe=oe.showMask,Be=oe.maskClosable,ze=oe.maskStyle,ot=oe.onClose,Re=oe.onHandleClick,nt=oe.keyboard,rt=oe.getOpenCount,lt=oe.switchScrollingEffect,bt=Object(he.a)(oe,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ee=this.dom?q:!1,Oe=O()(X,(K={},Object(S.a)(K,"".concat(X,"-").concat(Te),!0),Object(S.a)(K,"".concat(X,"-open"),Ee),Object(S.a)(K,se||"",!!se),Object(S.a)(K,"no-mask",!Qe),K)),je=this.getHorizontalBoolAndPlacementName(),Ye=je.placementName,De=Te==="left"||Te==="top"?"-100%":"100%",Ke=Ee?"":"".concat(Ye,"(").concat(De,")"),ce=Le&&I.cloneElement(Le,{onClick:function(ie){Le.props.onClick&&Le.props.onClick(),Re&&Re(ie)},ref:function(ie){J.handlerDom=ie}});return I.createElement("div",Object.assign({},bt,{tabIndex:-1,className:Oe,style:be,ref:function(ie){J.dom=ie},onKeyDown:Ee&&nt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Qe&&I.createElement("div",{className:"".concat(X,"-mask"),onClick:Be?ot:void 0,style:ze,ref:function(ie){J.maskDom=ie}}),I.createElement("div",{className:"".concat(X,"-content-wrapper"),style:{transform:Ke,msTransform:Ke,width:c(Q)?"".concat(Q,"px"):Q,height:c(te)?"".concat(te,"px"):te},ref:function(ie){J.contentWrapper=ie}},I.createElement("div",{className:"".concat(X,"-content"),ref:function(ie){J.contentDom=ie},onTouchStart:Ee&&Qe?this.removeStartHandler:void 0,onTouchMove:Ee&&Qe?this.removeMoveHandler:void 0},pe),ce))}}],[{key:"getDerivedStateFromProps",value:function(K,J){var oe=J.prevProps,se=J._self,pe={prevProps:K};if(oe!==void 0){var be=K.placement,Q=K.level;be!==oe.placement&&(se.contentDom=null),Q!==oe.level&&se.getLevelDom(K)}return pe}}]),W}(I.Component);t.defaultProps={switchScrollingEffect:function(){}};var a=t;function g(M){var F=h();return function(){var Z=Object(x.a)(M),K;if(F){var J=Object(x.a)(this).constructor;K=Reflect.construct(Z,arguments,J)}else K=Z.apply(this,arguments);return Object(_.a)(this,K)}}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(M){return!1}}var d=function(M){Object(U.a)(W,M);var F=g(W);function W(Z){var K;Object(B.a)(this,W),K=F.call(this,Z),K.onHandleClick=function(oe){var se=K.props,pe=se.onHandleClick,be=se.open;if(pe&&pe(oe),typeof be=="undefined"){var Q=K.state.open;K.setState({open:!Q})}},K.onClose=function(oe){var se=K.props,pe=se.onClose,be=se.open;pe&&pe(oe),typeof be=="undefined"&&K.setState({open:!1})};var J=typeof Z.open!="undefined"?Z.open:!!Z.defaultOpen;return K.state={open:J},"onMaskClick"in Z&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),K}return Object(w.a)(W,[{key:"render",value:function(){var K=this,J=this.props,oe=J.defaultOpen,se=J.getContainer,pe=J.wrapperClassName,be=J.forceRender,Q=J.handler,te=Object(he.a)(J,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),ve=this.state.open;if(!se)return I.createElement("div",{className:pe,ref:function(Te){K.dom=Te}},I.createElement(a,Object.assign({},te,{open:ve,handler:Q,getContainer:function(){return K.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var q=!!Q||be;return I.createElement(N.a,{visible:ve,forceRender:q,getContainer:se,wrapperClassName:pe},function(X){var Te=X.visible,Ie=X.afterClose,Ge=Object(he.a)(X,["visible","afterClose"]);return I.createElement(a,Object.assign({},te,Ge,{open:Te!==void 0?Te:ve,afterVisibleChange:Ie!==void 0?Ie:te.afterVisibleChange,handler:Q,onClose:K.onClose,onHandleClick:K.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(K,J){var oe=J.prevProps,se={prevProps:K};return typeof oe!="undefined"&&K.open!==oe.open&&(se.open=K.open),se}}]),W}(I.Component);d.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:I.createElement("div",{className:"drawer-handle"},I.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var e=d,A=Fe.a=e},fyJ8:function(Ct,Fe,j){"use strict";var he=j("rePB"),B=j("VTBJ"),w=j("Ff2n"),U=j("U8pU"),_=j("q1tI"),x=j.n(_),N=j("TSYQ"),I=j.n(N),S=j("c+Xe"),P=j("sR1s");function E(b){return b&&Object(U.a)(b)==="object"&&!Array.isArray(b)&&!_.isValidElement(b)}function O(b){return typeof b=="string"?!0:Object(S.c)(b)}function R(b,m){var n,s=b.prefixCls,l=b.className,y=b.record,c=b.index,o=b.dataIndex,v=b.render,f=b.children,i=b.component,r=i===void 0?"td":i,t=b.colSpan,a=b.rowSpan,g=b.fixLeft,h=b.fixRight,d=b.firstFixLeft,e=b.lastFixLeft,A=b.firstFixRight,M=b.lastFixRight,F=b.appendNode,W=b.additionalProps,Z=W===void 0?{}:W,K=b.ellipsis,J=b.align,oe=b.rowType,se=b.isSticky,pe="".concat(s,"-cell"),be,Q;if(f)Q=f;else{var te=Object(P.b)(y,o);if(Q=te,v){var ve=v(te,y,c);E(ve)?(Q=ve.children,be=ve.props):Q=ve}}Object(U.a)(Q)==="object"&&!Array.isArray(Q)&&!_.isValidElement(Q)&&(Q=null),K&&(e||A)&&(Q=_.createElement("span",{className:"".concat(pe,"-content")},Q));var q=be||{},X=q.colSpan,Te=q.rowSpan,Ie=q.style,Ge=q.className,Ae=Object(w.a)(q,["colSpan","rowSpan","style","className"]),Me=X!==void 0?X:t,Se=Te!==void 0?Te:a;if(Me===0||Se===0)return null;var Le={},Ve=typeof g=="number",$e=typeof h=="number";Ve&&(Le.position="sticky",Le.left=g),$e&&(Le.position="sticky",Le.right=h);var Qe={};J&&(Qe.textAlign=J);var Be,ze=K===!0?{showTitle:!0}:K;ze&&(ze.showTitle||oe==="header")&&(typeof Q=="string"||typeof Q=="number"?Be=Q.toString():_.isValidElement(Q)&&typeof Q.props.children=="string"&&(Be=Q.props.children));var ot=Object(B.a)(Object(B.a)(Object(B.a)({title:Be},Ae),Z),{},{colSpan:Me&&Me!==1?Me:null,rowSpan:Se&&Se!==1?Se:null,className:I()(pe,l,(n={},Object(he.a)(n,"".concat(pe,"-fix-left"),Ve),Object(he.a)(n,"".concat(pe,"-fix-left-first"),d),Object(he.a)(n,"".concat(pe,"-fix-left-last"),e),Object(he.a)(n,"".concat(pe,"-fix-right"),$e),Object(he.a)(n,"".concat(pe,"-fix-right-first"),A),Object(he.a)(n,"".concat(pe,"-fix-right-last"),M),Object(he.a)(n,"".concat(pe,"-ellipsis"),K),Object(he.a)(n,"".concat(pe,"-with-append"),F),Object(he.a)(n,"".concat(pe,"-fix-sticky"),(Ve||$e)&&se),n),Z.className,Ge),style:Object(B.a)(Object(B.a)(Object(B.a)(Object(B.a)({},Z.style),Qe),Le),Ie),ref:O(r)?m:null});return _.createElement(r,Object.assign({},ot),F,Q)}var T=_.forwardRef(R);T.displayName="Cell";var C=_.memo(T,function(b,m){return m.shouldCellUpdate?!m.shouldCellUpdate(m.record,b.record):!1});Fe.a=C},hW8S:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return U}),j.d(Fe,"c",function(){return _}),j.d(Fe,"b",function(){return x});var he=j("VTBJ"),B=j("Ff2n"),w=j("Kwbf"),U="RC_TABLE_INTERNAL_COL_DEFINE";function _(N){var I=N.expandable,S=Object(B.a)(N,["expandable"]);return"expandable"in N?Object(he.a)(Object(he.a)({},S),I):S}function x(N){return Object.keys(N).reduce(function(I,S){return(S.substr(0,5)==="data-"||S.substr(0,5)==="aria-")&&(I[S]=N[S]),I},{})}},i8i3:function(Ct,Fe,j){Ct.exports={flex_box_center:"flex_box_center___3Vf6o",flex_space_between:"flex_space_between___3kR1x",flex_box_vertical_center:"flex_box_vertical_center___25a0b",flex_box_center_end:"flex_box_center_end___3k_KQ",flex_box_column:"flex_box_column___38BD-",customModal:"customModal___2JXW3",shareModal:"shareModal___1xuLw",content:"content___1yjOV",group:"group___2tJcj",teachGroup:"teachGroup___VMxNc",footer:"footer___1OQG5"}},iNYN:function(Ct,Fe,j){Ct.exports={modalContent:"modalContent___3NP2x",modalContentLeft:"modalContentLeft___ycFEY",green:"green___2njFR",textArea:"textArea___28pXQ",red:"red___2bPlD",row:"row___tW7CE",html:"html___30ord",line:"line___1f3U7"}},iris:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return R});var he=j("qVdP"),B=j("jsC+"),w=j("lUTK"),U=j("BvKs"),_=j("tJVT"),x=j("q1tI"),N=j.n(x),I=j("Q0Vu"),S=j.n(I),P=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u63A5\u9F99\u9898",value:"COMBINATION"},{name:"\u62CD\u7167\u4E0A\u4F20",value:"PHOTOGRAPH"},{name:"\u6587\u4EF6\u4E0A\u4F20",value:"FILEUPLOAD"}],E=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],O=[{name:"\u968F\u673A\u521B\u5EFA",value:1},{name:"\u4EBA\u5DE5\u521B\u5EFA",value:2}],R=function(C){var b=C.showSelectAll,m=b===void 0?!1:b,n=C.disciplinesData,s=n===void 0?[]:n,l=C.knowledgeData,y=l===void 0?[]:l,c=C.directionValue,o=C.subDisciplineValue,v=C.typeValue,f=C.knowledgeValue,i=C.showKnowledge,r=i===void 0?!1:i,t=C.showRandomType,a=t===void 0?!1:t,g=C.difficultyValue,h=C.randomValue,d=C.selectAll,e=C.className,A=C.showShixun,M=A===void 0?!1:A,F=C.question_type_alias,W=F===void 0?[]:F,Z=C.showItemType,K=Z===void 0?!0:Z,J=C.onShixunChange,oe=J===void 0?function(){}:J,se=C.onDirectionChange,pe=se===void 0?function(){}:se,be=C.onTypeChange,Q=be===void 0?function(){}:be,te=C.onDifficultyChange,ve=te===void 0?function(){}:te,q=C.onKnowledgeChange,X=q===void 0?function(){}:q,Te=C.onRandomChange,Ie=Te===void 0?function(){}:Te,Ge=Object(x.useState)(0),Ae=Object(_.a)(Ge,2),Me=Ae[0],Se=Ae[1],Le=Object(x.useRef)(null),Ve=Object(x.useState)(0),$e=Object(_.a)(Ve,2),Qe=$e[0],Be=$e[1],ze=Object(x.useRef)(null);Object(x.useEffect)(function(){if(s.length!==0){var Re;(Le==null||((Re=Le.current)===null||Re===void 0)?void 0:Re.clientHeight)>90?Se(1):Se(0)}s.length===0&&Se(0)},[s]),Object(x.useEffect)(function(){if(console.log(y.length===0,"\u6570\u91CF"),y.length!==0){var Re,nt;console.log(ze==null||((Re=ze.current)===null||Re===void 0)?void 0:Re.clientHeight,"\u9AD8\u5EA6"),(ze==null||((nt=ze.current)===null||nt===void 0)?void 0:nt.clientHeight)>90?Be(1):Be(0)}y.length===0&&Be(0)},[y]);var ot=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],rt=arguments.length>1?arguments[1]:void 0;return N.a.createElement(U.a,{className:S.a.subMenu},nt.map(function(lt){return N.a.createElement(U.a.Item,{key:lt.id},N.a.createElement("a",{className:"".concat(S.a.subItem," ").concat(o===lt.id?S.a.subActive:""),onClick:function(){return pe(rt,lt.id)}},lt.name))}))};return N.a.createElement("aside",{className:e?"".concat(S.a.main," ").concat(e):S.a.main},N.a.createElement("div",{className:S.a.wrap},N.a.createElement("div",{className:S.a.content},N.a.createElement("span",{className:S.a.name},"\u79D1\u76EE:"),N.a.createElement("span",null,N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(c?"":S.a.active," "),onClick:function(){return pe(null)}},"\u5168\u90E8")),N.a.createElement("div",{className:S.a.directionContentWrap,style:{overflow:"hidden",height:Me===1?88:"auto"}},s.map(function(Re){var nt;return N.a.createElement(N.a.Fragment,{key:Re.id},((nt=Re.sub_disciplines)===null||nt===void 0?void 0:nt.length)>0?N.a.createElement(B.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(lt){return lt.parentNode},overlay:function(){return ot(Re.sub_disciplines,Re.id)}},N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(c===Re.id?S.a.active:""," "),onClick:function(){return pe(Re.id)}},Re.name)):N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(c===Re.id?S.a.active:""," "),onClick:function(){return pe(Re.id)}},Re.name))})),N.a.createElement("div",{className:S.a.directionContentWrap,ref:Le,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},s.map(function(Re){var nt;return N.a.createElement(N.a.Fragment,{key:Re.id},((nt=Re.sub_disciplines)===null||nt===void 0?void 0:nt.length)>0?N.a.createElement(B.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(lt){return lt.parentNode},overlay:function(){return ot(Re.sub_disciplines,Re.id)}},N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(c===Re.id?S.a.active:""," "),onClick:function(){return pe(Re.id)}},Re.name)):N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(c===Re.id?S.a.active:""," "),onClick:function(){return pe(Re.id)}},Re.name))})),!!Me&&N.a.createElement("div",{className:S.a.action},Me===1&&N.a.createElement("span",{onClick:function(){return Se(2)}},"\u5C55\u5F00",N.a.createElement("i",{className:"iconfont icon-xiala"})),Me===2&&N.a.createElement("span",{onClick:function(){return Se(1)}},"\u6536\u8D77",N.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),r&&N.a.createElement("div",{className:S.a.content},N.a.createElement("span",{className:S.a.name},"\u77E5\u8BC6\u70B9:"),N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(f===-1?S.a.active:""," "),onClick:function(){return X(-1)}},"\u6211\u7684"),N.a.createElement("div",{className:S.a.directionContentWrap,style:{overflow:"hidden",height:Qe===1?88:"auto"}},y.map(function(Re){return N.a.createElement("li",{key:Re.id,className:"".concat(S.a.directionItem," ").concat(f===Re.id?S.a.active:""," "),onClick:function(){return X(Re.id)}},Re.name)})),N.a.createElement("div",{ref:ze,className:S.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},y.map(function(Re){return N.a.createElement("li",{key:Re.id,className:"".concat(S.a.directionItem," ").concat(f===Re.id?S.a.active:""," "),onClick:function(){return X(Re.id)}},Re.name)})),!!Qe&&N.a.createElement("div",{className:S.a.action},Qe===1&&N.a.createElement("span",{onClick:function(){return Be(2)}},"\u5C55\u5F00",N.a.createElement("i",{className:"iconfont icon-xiala"})),Qe===2&&N.a.createElement("span",{onClick:function(){return Be(1)}},"\u6536\u8D77",N.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),K&&N.a.createElement("div",{className:S.a.content},N.a.createElement("span",{className:S.a.name},"\u9898\u578B:"),N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(v?"":S.a.active," "),onClick:function(){return Q(null)}},"\u5168\u90E8"),N.a.createElement("div",{className:S.a.directionContentWrap},(W||P).map(function(Re){return N.a.createElement("li",{key:Re.name,className:"".concat(S.a.directionItem," ").concat(v===Re.value?S.a.active:""," "),onClick:function(){return Q(Re.value)}},Re.name)}),M&&N.a.createElement("li",{key:"\u9879\u76EE\u9898",className:S.a.directionItem,onClick:function(){return oe()}},"\u9879\u76EE\u9898"))),N.a.createElement("div",{className:S.a.content},N.a.createElement("span",{className:S.a.name},"\u96BE\u5EA6:"),N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(g?"":S.a.active," "),onClick:function(){return ve(null)}},"\u5168\u90E8"),N.a.createElement("div",{className:S.a.directionContentWrap},E.map(function(Re){return N.a.createElement("li",{key:Re.name,className:"".concat(S.a.directionItem," ").concat(g===Re.value?S.a.active:""," "),onClick:function(){return ve(Re.value)}},Re.name)}))),a&&N.a.createElement("div",{className:S.a.content},N.a.createElement("span",{className:S.a.name},"\u7C7B\u578B:"),N.a.createElement("li",{className:"".concat(S.a.directionItem," ").concat(h?"":S.a.active," "),onClick:function(){return Ie(null)}},"\u5168\u90E8"),N.a.createElement("div",{className:S.a.directionContentWrap},O.map(function(Re){return N.a.createElement("li",{key:Re.name,className:"".concat(S.a.directionItem," ").concat(h===Re.value?S.a.active:""," "),onClick:function(){return Ie(Re.value)}},Re.name)})))))}},k3GJ:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return Ea});var he=j("rePB"),B=j("ODXe"),w=j("Ff2n"),U=j("VTBJ"),_=j("q1tI"),x=j("TSYQ"),N=j.n(x),I=j("Zm9Q"),S=j("6cGi"),P=j("KQm4"),E=j("xEkU"),O=j.n(E),R=j("t23M");function T(ae){var ye=Object(_.useRef)(),xe=Object(_.useRef)(!1);function le(){for(var z=arguments.length,ee=new Array(z),G=0;G<z;G++)ee[G]=arguments[G];xe.current||(O.a.cancel(ye.current),ye.current=O()(function(){ae.apply(void 0,ee)}))}return Object(_.useEffect)(function(){return function(){xe.current=!0,O.a.cancel(ye.current)}},[]),le}function C(ae){var ye=Object(_.useRef)([]),xe=Object(_.useState)({}),le=Object(B.a)(xe,2),z=le[1],ee=Object(_.useRef)(typeof ae=="function"?ae():ae),G=T(function(){var fe=ee.current;ye.current.forEach(function(me){fe=me(fe)}),ye.current=[],ee.current=fe,z({})});function ue(fe){ye.current.push(fe),G()}return[ee.current,ue]}var b=j("4IlW");function m(ae,ye){var xe,le=ae.prefixCls,z=ae.id,ee=ae.active,G=ae.rtl,ue=ae.tab,fe=ue.key,me=ue.tab,Ce=ue.disabled,Pe=ue.closeIcon,Ne=ae.tabBarGutter,at=ae.tabPosition,it=ae.closable,Tt=ae.renderWrapper,an=ae.removeAriaLabel,bn=ae.editable,cn=ae.onClick,un=ae.onRemove,En=ae.onFocus,mn="".concat(le,"-tab");_.useEffect(function(){return un},[]);var vn={};at==="top"||at==="bottom"?vn[G?"marginLeft":"marginRight"]=Ne:vn.marginBottom=Ne;var In=bn&&it!==!1&&!Ce;function Sn(Zt){if(Ce)return;cn(Zt)}function sr(Zt){Zt.preventDefault(),Zt.stopPropagation(),bn.onEdit("remove",{key:fe,event:Zt})}var Hn=_.createElement("div",{key:fe,ref:ye,className:N()(mn,(xe={},Object(he.a)(xe,"".concat(mn,"-with-remove"),In),Object(he.a)(xe,"".concat(mn,"-active"),ee),Object(he.a)(xe,"".concat(mn,"-disabled"),Ce),xe)),style:vn,onClick:Sn},_.createElement("div",{role:"tab","aria-selected":ee,id:z&&"".concat(z,"-tab-").concat(fe),className:"".concat(mn,"-btn"),"aria-controls":z&&"".concat(z,"-panel-").concat(fe),"aria-disabled":Ce,tabIndex:Ce?null:0,onClick:function(Qt){Qt.stopPropagation(),Sn(Qt)},onKeyDown:function(Qt){[b.a.SPACE,b.a.ENTER].includes(Qt.which)&&(Qt.preventDefault(),Sn(Qt))},onFocus:En},me),In&&_.createElement("button",{type:"button","aria-label":an||"remove",tabIndex:0,className:"".concat(mn,"-remove"),onClick:function(Qt){Qt.stopPropagation(),sr(Qt)}},Pe||bn.removeIcon||"\xD7"));return Tt&&(Hn=Tt(Hn)),Hn}var n=_.forwardRef(m),s={width:0,height:0,left:0,top:0};function l(ae,ye,xe){return Object(_.useMemo)(function(){for(var le,z=new Map,ee=ye.get((le=ae[0])===null||le===void 0?void 0:le.key)||s,G=ee.left+ee.width,ue=0;ue<ae.length;ue+=1){var fe=ae[ue].key,me=ye.get(fe);if(!me){var Ce;me=ye.get((Ce=ae[ue-1])===null||Ce===void 0?void 0:Ce.key)||s}var Pe=z.get(fe)||Object(U.a)({},me);Pe.right=G-Pe.left-Pe.width,z.set(fe,Pe)}return z},[ae.map(function(le){return le.key}).join("_"),ye,xe])}var y={width:0,height:0,left:0,top:0,right:0};function c(ae,ye,xe,le,z){var ee=z.tabs,G=z.tabPosition,ue=z.rtl,fe,me,Ce;["top","bottom"].includes(G)?(fe="width",me=ue?"right":"left",Ce=Math.abs(ye.left)):(fe="height",me="top",Ce=-ye.top);var Pe=ye[fe],Ne=xe[fe],at=le[fe],it=Pe;return Ne+at>Pe&&(it=Pe-at),Object(_.useMemo)(function(){if(!ee.length)return[0,0];for(var Tt=ee.length,an=Tt,bn=0;bn<Tt;bn+=1){var cn=ae.get(ee[bn].key)||y;if(cn[me]+cn[fe]>Ce+it){an=bn-1;break}}for(var un=0,En=Tt-1;En>=0;En-=1){var mn=ae.get(ee[En].key)||y;if(mn[me]<Ce){un=En+1;break}}return[un,an]},[ae,Ce,it,G,ee.map(function(Tt){return Tt.key}).join("_"),ue])}var o=j("wx14"),v=j("1OyB"),f=j("vuIU"),i=j("JX7q"),r=j("Ji7U"),t=j("LK+K"),a=j("I8Z2"),g=j("bT9E"),h=j("2GS6"),d=j("Gytx"),e=j.n(d),A=j("U8pU"),M=/iPhone/i,F=/iPod/i,W=/iPad/i,Z=/\bAndroid(?:.+)Mobile\b/i,K=/Android/i,J=/\bAndroid(?:.+)SD4930UR\b/i,oe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,se=/Windows Phone/i,pe=/\bWindows(?:.+)ARM\b/i,be=/BlackBerry/i,Q=/BB10/i,te=/Opera Mini/i,ve=/\b(CriOS|Chrome)(?:.+)Mobile/i,q=/Mobile(?:.+)Firefox\b/i;function X(ae,ye){return ae.test(ye)}function Te(ae){var ye=ae||(typeof navigator!="undefined"?navigator.userAgent:""),xe=(ye||"").split("[FBAN");if(typeof xe[1]!="undefined"){var le=xe,z=Object(B.a)(le,1);ye=z[0]}if(xe=ye.split("Twitter"),typeof xe[1]!="undefined"){var ee=xe,G=Object(B.a)(ee,1);ye=G[0]}var ue={apple:{phone:X(M,ye)&&!X(se,ye),ipod:X(F,ye),tablet:!X(M,ye)&&X(W,ye)&&!X(se,ye),device:(X(M,ye)||X(F,ye)||X(W,ye))&&!X(se,ye)},amazon:{phone:X(J,ye),tablet:!X(J,ye)&&X(oe,ye),device:X(J,ye)||X(oe,ye)},android:{phone:!X(se,ye)&&X(J,ye)||!X(se,ye)&&X(Z,ye),tablet:!X(se,ye)&&!X(J,ye)&&!X(Z,ye)&&(X(oe,ye)||X(K,ye)),device:!X(se,ye)&&(X(J,ye)||X(oe,ye)||X(Z,ye)||X(K,ye))||X(/\bokhttp\b/i,ye)},windows:{phone:X(se,ye),tablet:X(pe,ye),device:X(se,ye)||X(pe,ye)},other:{blackberry:X(be,ye),blackberry10:X(Q,ye),opera:X(te,ye),firefox:X(q,ye),chrome:X(ve,ye),device:X(be,ye)||X(Q,ye)||X(te,ye)||X(q,ye)||X(ve,ye)},any:null,phone:null,tablet:null};return ue.any=ue.apple.device||ue.android.device||ue.windows.device||ue.other.device,ue.phone=ue.apple.phone||ue.android.phone||ue.windows.phone,ue.tablet=ue.apple.tablet||ue.android.tablet||ue.windows.tablet,ue}var Ie=Object(U.a)(Object(U.a)({},Te()),{},{isMobile:Te}),Ge=Ie;function Ae(){}function Me(ae,ye,xe){var le=ye||"";return ae.key||"".concat(le,"item_").concat(xe)}function Se(ae){return"".concat(ae,"-menu-")}function Le(ae,ye){var xe=-1;_.Children.forEach(ae,function(le){xe+=1,le&&le.type&&le.type.isMenuItemGroup?_.Children.forEach(le.props.children,function(z){xe+=1,ye(z,xe)}):ye(le,xe)})}function Ve(ae,ye,xe){if(!ae||xe.find)return;_.Children.forEach(ae,function(le){if(le){var z=le.type;if(!z||!(z.isSubMenu||z.isMenuItem||z.isMenuItemGroup))return;ye.indexOf(le.key)!==-1?xe.find=!0:le.props.children&&Ve(le.props.children,ye,xe)}})}var $e=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Qe=function(ye){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,le=ye&&typeof ye.getBoundingClientRect=="function"&&ye.getBoundingClientRect().width;if(le){if(xe){var z=getComputedStyle(ye),ee=z.marginLeft,G=z.marginRight;le+=+ee.replace("px","")+ +G.replace("px","")}le=+le.toFixed(6)}return le||0},Be=function(ye,xe,le){ye&&Object(A.a)(ye.style)==="object"&&(ye.style[xe]=le)},ze=function(){return Ge.any},ot=j("bdgK"),Re=j("i8i4"),nt=j.n(Re),rt=j("wgJM"),lt=j("l4aY"),bt=j("m+aA"),Ee=j("c+Xe"),Oe=j("zT1h"),je=j("QC+M");function Ye(ae,ye,xe){return xe?ae[0]===ye[0]:ae[0]===ye[0]&&ae[1]===ye[1]}function De(ae,ye,xe){var le=ae[ye]||{};return Object(U.a)(Object(U.a)({},le),xe)}function Ke(ae,ye,xe,le){for(var z=xe.points,ee=Object.keys(ae),G=0;G<ee.length;G+=1){var ue=ee[G];if(Ye(ae[ue].points,z,le))return"".concat(ye,"-placement-").concat(ue)}return""}var ce=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ae=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(ae)||/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(ae==null?void 0:ae.substr(0,4)))},re=j("MNnm");function ie(ae,ye){var xe={};return xe[ae.toLowerCase()]=ye.toLowerCase(),xe["Webkit".concat(ae)]="webkit".concat(ye),xe["Moz".concat(ae)]="moz".concat(ye),xe["ms".concat(ae)]="MS".concat(ye),xe["O".concat(ae)]="o".concat(ye.toLowerCase()),xe}function $(ae,ye){var xe={animationend:ie("Animation","AnimationEnd"),transitionend:ie("Transition","TransitionEnd")};return ae&&("AnimationEvent"in ye||delete xe.animationend.animation,"TransitionEvent"in ye||delete xe.transitionend.transition),xe}var Y=$(Object(re.a)(),typeof window!="undefined"?window:{}),V={};if(Object(re.a)()){var ne=document.createElement("div");V=ne.style}var _e={};function we(ae){if(_e[ae])return _e[ae];var ye=Y[ae];if(ye)for(var xe=Object.keys(ye),le=xe.length,z=0;z<le;z+=1){var ee=xe[z];if(Object.prototype.hasOwnProperty.call(ye,ee)&&ee in V)return _e[ae]=ye[ee],_e[ae]}return""}var Xe=we("animationend"),gt=we("transitionend"),Nt=!!(Xe&&gt),ht=Xe||"animationend",en=gt||"transitionend";function tn(ae,ye){if(!ae)return null;if(Object(A.a)(ae)==="object"){var xe=ye.replace(/-\w/g,function(le){return le[1].toUpperCase()});return ae[xe]}return"".concat(ae,"-").concat(ye)}var Dt="none",_n="appear",fn="enter",sn="leave",Ln="none",Wt="prepare",yn="start",xn="active",pt="end";function zn(ae){var ye=Object(_.useRef)(!1),xe=Object(_.useState)(ae),le=Object(B.a)(xe,2),z=le[0],ee=le[1];function G(ue){ye.current||ee(ue)}return Object(_.useEffect)(function(){return function(){ye.current=!0}},[]),[z,G]}var Cn=Object(re.a)()?_.useLayoutEffect:_.useEffect,Rn=Cn,Rt=function(){var ae=_.useRef(null);function ye(){rt.a.cancel(ae.current)}function xe(le){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;ye();var ee=Object(rt.a)(function(){z<=1?le({isCanceled:function(){return ee!==ae.current}}):xe(le,z-1)});ae.current=ee}return _.useEffect(function(){return function(){ye()}},[]),[xe,ye]},Gn=[Wt,yn,xn,pt],er=!1,ur=!0;function tr(ae){return ae===xn||ae===pt}var fr=function(ae,ye){var xe=_.useState(Ln),le=Object(B.a)(xe,2),z=le[0],ee=le[1],G=Rt(),ue=Object(B.a)(G,2),fe=ue[0],me=ue[1];function Ce(){ee(Wt)}return Rn(function(){if(z!==Ln&&z!==pt){var Pe=Gn.indexOf(z),Ne=Gn[Pe+1],at=ye(z);at===er?ee(Ne):fe(function(it){function Tt(){if(it.isCanceled())return;ee(Ne)}at===!0?Tt():Promise.resolve(at).then(Tt)})}},[ae,z]),_.useEffect(function(){return function(){me()}},[]),[Ce,z]},br=function(ae){var ye=Object(_.useRef)(),xe=Object(_.useRef)(ae);xe.current=ae;var le=_.useCallback(function(G){xe.current(G)},[]);function z(G){G&&(G.removeEventListener(en,le),G.removeEventListener(ht,le))}function ee(G){ye.current&&ye.current!==G&&z(ye.current),G&&G!==ye.current&&(G.addEventListener(en,le),G.addEventListener(ht,le),ye.current=G)}return _.useEffect(function(){return function(){z(ye.current)}},[]),[ee,z]};function Vr(ae,ye,xe,le){var z=le.motionEnter,ee=z===void 0?!0:z,G=le.motionAppear,ue=G===void 0?!0:G,fe=le.motionLeave,me=fe===void 0?!0:fe,Ce=le.motionDeadline,Pe=le.motionLeaveImmediately,Ne=le.onAppearPrepare,at=le.onEnterPrepare,it=le.onLeavePrepare,Tt=le.onAppearStart,an=le.onEnterStart,bn=le.onLeaveStart,cn=le.onAppearActive,un=le.onEnterActive,En=le.onLeaveActive,mn=le.onAppearEnd,vn=le.onEnterEnd,In=le.onLeaveEnd,Sn=le.onVisibleChanged,sr=zn(),Hn=Object(B.a)(sr,2),Zt=Hn[0],Qt=Hn[1],Pn=zn(Dt),On=Object(B.a)(Pn,2),Ft=On[0],Nn=On[1],$n=zn(null),Un=Object(B.a)($n,2),Yn=Un[0],lr=Un[1],Er=Object(_.useRef)(!1),Dr=Object(_.useRef)(null),hr=Object(_.useRef)(!1),jr=Object(_.useRef)(null);function qn(){var Jn=xe();return Jn||jr.current}var yr=Object(_.useRef)(!1);function zr(Jn){var Bn=qn();if(Jn&&!Jn.deadline&&Jn.target!==Bn)return;var _r;Ft===_n&&yr.current?_r=mn==null?void 0:mn(Bn,Jn):Ft===fn&&yr.current?_r=vn==null?void 0:vn(Bn,Jn):Ft===sn&&yr.current&&(_r=In==null?void 0:In(Bn,Jn)),_r!==!1&&!hr.current&&(Nn(Dt),lr(null))}var gr=br(zr),Ir=Object(B.a)(gr,1),wr=Ir[0],xr=_.useMemo(function(){var Jn,Bn,_r;switch(Ft){case"appear":return Jn={},Object(he.a)(Jn,Wt,Ne),Object(he.a)(Jn,yn,Tt),Object(he.a)(Jn,xn,cn),Jn;case"enter":return Bn={},Object(he.a)(Bn,Wt,at),Object(he.a)(Bn,yn,an),Object(he.a)(Bn,xn,un),Bn;case"leave":return _r={},Object(he.a)(_r,Wt,it),Object(he.a)(_r,yn,bn),Object(he.a)(_r,xn,En),_r;default:return{}}},[Ft]),da=fr(Ft,function(Jn){if(Jn===Wt){var Bn=xr[Wt];return Bn?Bn(qn()):er}if(ln in xr){var _r;lr(((_r=xr[ln])===null||_r===void 0?void 0:_r.call(xr,qn(),null))||null)}return ln===xn&&(wr(qn()),Ce>0&&(clearTimeout(Dr.current),Dr.current=setTimeout(function(){zr({deadline:!0})},Ce))),ur}),ca=Object(B.a)(da,2),pa=ca[0],ln=ca[1],Jr=tr(ln);yr.current=Jr,Rn(function(){Qt(ye);var Jn=Er.current;if(Er.current=!0,!ae)return;var Bn;!Jn&&ye&&ue&&(Bn=_n),Jn&&ye&&ee&&(Bn=fn),(Jn&&!ye&&me||!Jn&&Pe&&!ye&&me)&&(Bn=sn),Bn&&(Nn(Bn),pa())},[ye]),Object(_.useEffect)(function(){(Ft===_n&&!ue||Ft===fn&&!ee||Ft===sn&&!me)&&Nn(Dt)},[ue,ee,me]),Object(_.useEffect)(function(){return function(){clearTimeout(Dr.current),hr.current=!0}},[]),Object(_.useEffect)(function(){Zt!==void 0&&Ft===Dt&&(Sn==null||Sn(Zt))},[Zt,Ft]);var ia=Yn;return xr[Wt]&&ln===yn&&(ia=Object(U.a)({transition:"none"},ia)),[Ft,ln,ia,Zt!=null?Zt:ye]}var Fr=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(){return Object(v.a)(this,xe),ye.apply(this,arguments)}return Object(f.a)(xe,[{key:"render",value:function(){return this.props.children}}]),xe}(_.Component),Rr=Fr;function Xr(ae){var ye=ae;Object(A.a)(ae)==="object"&&(ye=ae.transitionSupport);function xe(z){return!!(z.motionName&&ye)}var le=_.forwardRef(function(z,ee){var G=z.visible,ue=G===void 0?!0:G,fe=z.removeOnLeave,me=fe===void 0?!0:fe,Ce=z.forceRender,Pe=z.children,Ne=z.motionName,at=z.leavedClassName,it=z.eventProps,Tt=xe(z),an=Object(_.useRef)(),bn=Object(_.useRef)();function cn(){try{return Object(bt.a)(an.current||bn.current)}catch(Nn){return null}}var un=Vr(Tt,ue,cn,z),En=Object(B.a)(un,4),mn=En[0],vn=En[1],In=En[2],Sn=En[3],sr=_.useRef(Sn);Sn&&(sr.current=!0);var Hn=Object(_.useRef)(ee);Hn.current=ee;var Zt=_.useCallback(function(Nn){an.current=Nn,Object(Ee.b)(Hn.current,Nn)},[]),Qt,Pn=Object(U.a)(Object(U.a)({},it),{},{visible:ue});if(!Pe)Qt=null;else if(mn===Dt||!xe(z))Sn?Qt=Pe(Object(U.a)({},Pn),Zt):!me&&sr.current?Qt=Pe(Object(U.a)(Object(U.a)({},Pn),{},{className:at}),Zt):Ce?Qt=Pe(Object(U.a)(Object(U.a)({},Pn),{},{style:{display:"none"}}),Zt):Qt=null;else{var On,Ft;vn===Wt?Ft="prepare":tr(vn)?Ft="active":vn===yn&&(Ft="start"),Qt=Pe(Object(U.a)(Object(U.a)({},Pn),{},{className:N()(tn(Ne,mn),(On={},Object(he.a)(On,tn(Ne,"".concat(mn,"-").concat(Ft)),Ft),Object(he.a)(On,Ne,typeof Ne=="string"),On)),style:In}),Zt)}return _.createElement(Rr,{ref:bn},Qt)});return le.displayName="CSSMotion",le}var $r=Xr(Nt),ea="add",ta="keep",pr="remove",na="removed";function aa(ae){var ye;return ae&&Object(A.a)(ae)==="object"&&"key"in ae?ye=ae:ye={key:ae},Object(U.a)(Object(U.a)({},ye),{},{key:String(ye.key)})}function sa(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ae.map(aa)}function L(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],xe=[],le=0,z=ye.length,ee=sa(ae),G=sa(ye);ee.forEach(function(me){for(var Ce=!1,Pe=le;Pe<z;Pe+=1){var Ne=G[Pe];if(Ne.key===me.key){le<Pe&&(xe=xe.concat(G.slice(le,Pe).map(function(at){return Object(U.a)(Object(U.a)({},at),{},{status:ea})})),le=Pe),xe.push(Object(U.a)(Object(U.a)({},Ne),{},{status:ta})),le+=1,Ce=!0;break}}Ce||xe.push(Object(U.a)(Object(U.a)({},me),{},{status:pr}))}),le<z&&(xe=xe.concat(G.slice(le).map(function(me){return Object(U.a)(Object(U.a)({},me),{},{status:ea})})));var ue={};xe.forEach(function(me){var Ce=me.key;ue[Ce]=(ue[Ce]||0)+1});var fe=Object.keys(ue).filter(function(me){return ue[me]>1});return fe.forEach(function(me){xe=xe.filter(function(Ce){var Pe=Ce.key,Ne=Ce.status;return Pe!==me||Ne!==pr}),xe.forEach(function(Ce){Ce.key===me&&(Ce.status=ta)})}),xe}var u=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function p(ae){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$r,xe=function(le){Object(r.a)(ee,le);var z=Object(t.a)(ee);function ee(){var G;return Object(v.a)(this,ee),G=z.apply(this,arguments),G.state={keyEntities:[]},G.removeKey=function(ue){G.setState(function(fe){var me=fe.keyEntities;return{keyEntities:me.map(function(Ce){return Ce.key!==ue?Ce:Object(U.a)(Object(U.a)({},Ce),{},{status:na})})}})},G}return Object(f.a)(ee,[{key:"render",value:function(){var ue=this,fe=this.state.keyEntities,me=this.props,Ce=me.component,Pe=me.children,Ne=me.onVisibleChanged,at=Object(w.a)(me,["component","children","onVisibleChanged"]),it=Ce||_.Fragment,Tt={};return u.forEach(function(an){Tt[an]=at[an],delete at[an]}),delete at.keys,_.createElement(it,at,fe.map(function(an){var bn=an.status,cn=Object(w.a)(an,["status"]),un=bn===ea||bn===ta;return _.createElement(ye,Object(o.a)({},Tt,{key:cn.key,visible:un,eventProps:cn,onVisibleChanged:function(mn){Ne==null||Ne(mn,{key:cn.key}),mn||ue.removeKey(cn.key)}}),Pe)}))}}],[{key:"getDerivedStateFromProps",value:function(ue,fe){var me=ue.keys,Ce=fe.keyEntities,Pe=sa(me),Ne=L(Ce,Pe);return{keyEntities:Ne.filter(function(at){var it=Ce.find(function(Tt){var an=Tt.key;return at.key===an});return!(it&&it.status===na&&at.status===pr)})}}}]),ee}(_.Component);return xe.defaultProps={component:"div"},xe}var D=p(Nt),H=$r;function k(ae){var ye=ae.prefixCls,xe=ae.motion,le=ae.animation,z=ae.transitionName;return xe||(le?{motionName:"".concat(ye,"-").concat(le)}:z?{motionName:z}:null)}function ge(ae){var ye=ae.prefixCls,xe=ae.visible,le=ae.zIndex,z=ae.mask,ee=ae.maskMotion,G=ae.maskAnimation,ue=ae.maskTransitionName;if(!z)return null;var fe={};return(ee||ue||G)&&(fe=Object(U.a)({motionAppear:!0},k({motion:ee,prefixCls:ye,transitionName:ue,animation:G}))),_.createElement(H,Object(o.a)({},fe,{visible:xe,removeOnLeave:!0}),function(me){var Ce=me.className;return _.createElement("div",{style:{zIndex:le},className:N()("".concat(ye,"-mask"),Ce)})})}var qe=j("9mu1"),st=j("o0o1"),Kt=j.n(st),tt=j("HaE+"),nn=["measure","align",null,"motion"],Yt=function(ae,ye){var xe=Object(_.useState)(null),le=Object(B.a)(xe,2),z=le[0],ee=le[1],G=Object(_.useRef)(),ue=Object(_.useRef)(!1);function fe(Pe){ue.current||ee(Pe)}function me(){rt.a.cancel(G.current)}function Ce(Pe){me(),G.current=Object(rt.a)(function(){fe(function(Ne){switch(z){case"align":return"motion";case"motion":return"stable";default:}return Ne}),Pe==null||Pe()})}return Object(_.useEffect)(function(){fe("measure")},[ae]),Object(_.useEffect)(function(){switch(z){case"measure":ye();break;default:}z&&(G.current=Object(rt.a)(Object(tt.a)(Kt.a.mark(function Pe(){var Ne,at;return Kt.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:Ne=nn.indexOf(z),at=nn[Ne+1],at&&Ne!==-1&&fe(at);case 3:case"end":return Tt.stop()}},Pe)}))))},[z]),Object(_.useEffect)(function(){return function(){ue.current=!0,me()}},[]),[z,Ce]},kn=function(ae){var ye=_.useState({width:0,height:0}),xe=Object(B.a)(ye,2),le=xe[0],z=xe[1];function ee(ue){z({width:ue.offsetWidth,height:ue.offsetHeight})}var G=_.useMemo(function(){var ue={};if(ae){var fe=le.width,me=le.height;ae.indexOf("height")!==-1&&me?ue.height=me:ae.indexOf("minHeight")!==-1&&me&&(ue.minHeight=me),ae.indexOf("width")!==-1&&fe?ue.width=fe:ae.indexOf("minWidth")!==-1&&fe&&(ue.minWidth=fe)}return ue},[ae,le]);return[G,ee]},Pr=_.forwardRef(function(ae,ye){var xe=ae.visible,le=ae.prefixCls,z=ae.className,ee=ae.style,G=ae.children,ue=ae.zIndex,fe=ae.stretch,me=ae.destroyPopupOnHide,Ce=ae.forceRender,Pe=ae.align,Ne=ae.point,at=ae.getRootDomNode,it=ae.getClassNameFromAlign,Tt=ae.onAlign,an=ae.onMouseEnter,bn=ae.onMouseLeave,cn=ae.onMouseDown,un=ae.onTouchStart,En=Object(_.useRef)(),mn=Object(_.useRef)(),vn=Object(_.useState)(),In=Object(B.a)(vn,2),Sn=In[0],sr=In[1],Hn=kn(fe),Zt=Object(B.a)(Hn,2),Qt=Zt[0],Pn=Zt[1];function On(){fe&&Pn(at())}var Ft=Yt(xe,On),Nn=Object(B.a)(Ft,2),$n=Nn[0],Un=Nn[1],Yn=Object(_.useRef)();function lr(){return Ne||at}function Er(){var gr;(gr=En.current)===null||gr===void 0||gr.forceAlign()}function Dr(gr,Ir){var wr=it(Ir);Sn!==wr&&sr(wr),$n==="align"&&(Sn!==wr?Promise.resolve().then(function(){Er()}):Un(function(){var xr;(xr=Yn.current)===null||xr===void 0||xr.call(Yn)}),Tt==null||Tt(gr,Ir))}var hr=Object(U.a)({},k(ae));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(gr){var Ir=hr[gr];hr[gr]=function(wr,xr){return Un(),Ir==null?void 0:Ir(wr,xr)}});function jr(){return new Promise(function(gr){Yn.current=gr})}_.useEffect(function(){!hr.motionName&&$n==="motion"&&Un()},[hr.motionName,$n]),_.useImperativeHandle(ye,function(){return{forceAlign:Er,getElement:function(){return mn.current}}});var qn=Object(U.a)(Object(U.a)({},Qt),{},{zIndex:ue,opacity:$n==="motion"||$n==="stable"||!xe?void 0:0,pointerEvents:$n==="stable"?void 0:"none"},ee),yr=!0;(Pe==null?void 0:Pe.points)&&($n==="align"||$n==="stable")&&(yr=!1);var zr=G;return _.Children.count(G)>1&&(zr=_.createElement("div",{className:"".concat(le,"-content")},G)),_.createElement(H,Object(o.a)({visible:xe,ref:mn,leavedClassName:"".concat(le,"-hidden")},hr,{onAppearPrepare:jr,onEnterPrepare:jr,removeOnLeave:me,forceRender:Ce}),function(gr,Ir){var wr=gr.className,xr=gr.style,da=N()(le,z,Sn,wr);return _.createElement(qe.a,{target:lr(),key:"popup",ref:En,monitorWindowResize:!0,disabled:yr,align:Pe,onAlign:Dr},_.createElement("div",{ref:Ir,className:da,onMouseEnter:an,onMouseLeave:bn,onMouseDownCapture:cn,onTouchStartCapture:un,style:Object(U.a)(Object(U.a)({},xr),qn)},zr))})});Pr.displayName="PopupInner";var Kr=Pr,nr=_.forwardRef(function(ae,ye){var xe=ae.prefixCls,le=ae.visible,z=ae.zIndex,ee=ae.children,G=ae.mobile;G=G===void 0?{}:G;var ue=G.popupClassName,fe=G.popupStyle,me=G.popupMotion,Ce=me===void 0?{}:me,Pe=G.popupRender,Ne=_.useRef();_.useImperativeHandle(ye,function(){return{forceAlign:function(){},getElement:function(){return Ne.current}}});var at=Object(U.a)({zIndex:z},fe),it=ee;return _.Children.count(ee)>1&&(it=_.createElement("div",{className:"".concat(xe,"-content")},ee)),Pe&&(it=Pe(it)),_.createElement(H,Object(o.a)({visible:le,ref:Ne,removeOnLeave:!0},Ce),function(Tt,an){var bn=Tt.className,cn=Tt.style,un=N()(xe,ue,bn);return _.createElement("div",{ref:an,className:un,style:Object(U.a)(Object(U.a)({},cn),at)},it)})});nr.displayName="MobilePopupInner";var Yr=nr,ga=["visible","mobile"],la=_.forwardRef(function(ae,ye){var xe=ae.visible,le=ae.mobile,z=Object(w.a)(ae,ga),ee=Object(_.useState)(xe),G=Object(B.a)(ee,2),ue=G[0],fe=G[1],me=Object(_.useState)(!1),Ce=Object(B.a)(me,2),Pe=Ce[0],Ne=Ce[1],at=Object(U.a)(Object(U.a)({},z),{},{visible:ue});Object(_.useEffect)(function(){fe(xe),xe&&le&&Ne(ce())},[xe,le]);var it=Pe?_.createElement(Yr,Object(o.a)({},at,{mobile:le,ref:ye})):_.createElement(Kr,Object(o.a)({},at,{ref:ye}));return _.createElement("div",null,_.createElement(ge,at),it)});la.displayName="Popup";var fa=la,Bt=_.createContext(null),ke=Bt;function ut(){}function Je(){return""}function et(ae){return ae?ae.ownerDocument:window.document}var Xt=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Ht(ae){var ye=function(xe){Object(r.a)(z,xe);var le=Object(t.a)(z);function z(ee){var G;Object(v.a)(this,z),G=le.call(this,ee),G.popupRef=_.createRef(),G.triggerRef=_.createRef(),G.attachId=void 0,G.clickOutsideHandler=void 0,G.touchOutsideHandler=void 0,G.contextMenuOutsideHandler1=void 0,G.contextMenuOutsideHandler2=void 0,G.mouseDownTimeout=void 0,G.focusTime=void 0,G.preClickTime=void 0,G.preTouchTime=void 0,G.delayTimer=void 0,G.hasPopupMouseDown=void 0,G.onMouseEnter=function(fe){var me=G.props.mouseEnterDelay;G.fireEvents("onMouseEnter",fe),G.delaySetPopupVisible(!0,me,me?null:fe)},G.onMouseMove=function(fe){G.fireEvents("onMouseMove",fe),G.setPoint(fe)},G.onMouseLeave=function(fe){G.fireEvents("onMouseLeave",fe),G.delaySetPopupVisible(!1,G.props.mouseLeaveDelay)},G.onPopupMouseEnter=function(){G.clearDelayTimer()},G.onPopupMouseLeave=function(fe){var me;if(fe.relatedTarget&&!fe.relatedTarget.setTimeout&&Object(lt.a)((me=G.popupRef.current)===null||me===void 0?void 0:me.getElement(),fe.relatedTarget))return;G.delaySetPopupVisible(!1,G.props.mouseLeaveDelay)},G.onFocus=function(fe){G.fireEvents("onFocus",fe),G.clearDelayTimer(),G.isFocusToShow()&&(G.focusTime=Date.now(),G.delaySetPopupVisible(!0,G.props.focusDelay))},G.onMouseDown=function(fe){G.fireEvents("onMouseDown",fe),G.preClickTime=Date.now()},G.onTouchStart=function(fe){G.fireEvents("onTouchStart",fe),G.preTouchTime=Date.now()},G.onBlur=function(fe){G.fireEvents("onBlur",fe),G.clearDelayTimer(),G.isBlurToHide()&&G.delaySetPopupVisible(!1,G.props.blurDelay)},G.onContextMenu=function(fe){fe.preventDefault(),G.fireEvents("onContextMenu",fe),G.setPopupVisible(!0,fe)},G.onContextMenuClose=function(){G.isContextMenuToShow()&&G.close()},G.onClick=function(fe){if(G.fireEvents("onClick",fe),G.focusTime){var me;if(G.preClickTime&&G.preTouchTime?me=Math.min(G.preClickTime,G.preTouchTime):G.preClickTime?me=G.preClickTime:G.preTouchTime&&(me=G.preTouchTime),Math.abs(me-G.focusTime)<20)return;G.focusTime=0}G.preClickTime=0,G.preTouchTime=0,G.isClickToShow()&&(G.isClickToHide()||G.isBlurToHide())&&fe&&fe.preventDefault&&fe.preventDefault();var Ce=!G.state.popupVisible;(G.isClickToHide()&&!Ce||Ce&&G.isClickToShow())&&G.setPopupVisible(!G.state.popupVisible,fe)},G.onPopupMouseDown=function(){if(G.hasPopupMouseDown=!0,clearTimeout(G.mouseDownTimeout),G.mouseDownTimeout=window.setTimeout(function(){G.hasPopupMouseDown=!1},0),G.context){var fe;(fe=G.context).onPopupMouseDown.apply(fe,arguments)}},G.onDocumentClick=function(fe){if(G.props.mask&&!G.props.maskClosable)return;var me=fe.target,Ce=G.getRootDomNode(),Pe=G.getPopupDomNode();(!Object(lt.a)(Ce,me)||G.isContextMenuOnly())&&!Object(lt.a)(Pe,me)&&!G.hasPopupMouseDown&&G.close()},G.getRootDomNode=function(){var fe=G.props.getTriggerDOMNode;if(fe)return fe(G.triggerRef.current);try{var me=Object(bt.a)(G.triggerRef.current);if(me)return me}catch(Ce){}return nt.a.findDOMNode(Object(i.a)(G))},G.getPopupClassNameFromAlign=function(fe){var me=[],Ce=G.props,Pe=Ce.popupPlacement,Ne=Ce.builtinPlacements,at=Ce.prefixCls,it=Ce.alignPoint,Tt=Ce.getPopupClassNameFromAlign;return Pe&&Ne&&me.push(Ke(Ne,at,fe,it)),Tt&&me.push(Tt(fe)),me.join(" ")},G.getComponent=function(){var fe=G.props,me=fe.prefixCls,Ce=fe.destroyPopupOnHide,Pe=fe.popupClassName,Ne=fe.onPopupAlign,at=fe.popupMotion,it=fe.popupAnimation,Tt=fe.popupTransitionName,an=fe.popupStyle,bn=fe.mask,cn=fe.maskAnimation,un=fe.maskTransitionName,En=fe.maskMotion,mn=fe.zIndex,vn=fe.popup,In=fe.stretch,Sn=fe.alignPoint,sr=fe.mobile,Hn=fe.forceRender,Zt=G.state,Qt=Zt.popupVisible,Pn=Zt.point,On=G.getPopupAlign(),Ft={};return G.isMouseEnterToShow()&&(Ft.onMouseEnter=G.onPopupMouseEnter),G.isMouseLeaveToHide()&&(Ft.onMouseLeave=G.onPopupMouseLeave),Ft.onMouseDown=G.onPopupMouseDown,Ft.onTouchStart=G.onPopupMouseDown,_.createElement(fa,Object(o.a)({prefixCls:me,destroyPopupOnHide:Ce,visible:Qt,point:Sn&&Pn,className:Pe,align:On,onAlign:Ne,animation:it,getClassNameFromAlign:G.getPopupClassNameFromAlign},Ft,{stretch:In,getRootDomNode:G.getRootDomNode,style:an,mask:bn,zIndex:mn,transitionName:Tt,maskAnimation:cn,maskTransitionName:un,maskMotion:En,ref:G.popupRef,motion:at,mobile:sr,forceRender:Hn}),typeof vn=="function"?vn():vn)},G.attachParent=function(fe){rt.a.cancel(G.attachId);var me=G.props,Ce=me.getPopupContainer,Pe=me.getDocument,Ne=G.getRootDomNode(),at;Ce?(Ne||Ce.length===0)&&(at=Ce(Ne)):at=Pe(G.getRootDomNode()).body,at?at.appendChild(fe):G.attachId=Object(rt.a)(function(){G.attachParent(fe)})},G.getContainer=function(){var fe=G.props.getDocument,me=fe(G.getRootDomNode()).createElement("div");return me.style.position="absolute",me.style.top="0",me.style.left="0",me.style.width="100%",G.attachParent(me),me},G.setPoint=function(fe){var me=G.props.alignPoint;if(!me||!fe)return;G.setState({point:{pageX:fe.pageX,pageY:fe.pageY}})},G.handlePortalUpdate=function(){G.state.prevPopupVisible!==G.state.popupVisible&&G.props.afterPopupVisibleChange(G.state.popupVisible)},G.triggerContextValue={onPopupMouseDown:G.onPopupMouseDown};var ue;return"popupVisible"in ee?ue=!!ee.popupVisible:ue=!!ee.defaultPopupVisible,G.state={prevPopupVisible:ue,popupVisible:ue},Xt.forEach(function(fe){G["fire".concat(fe)]=function(me){G.fireEvents(fe,me)}}),G}return Object(f.a)(z,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var G=this.props,ue=this.state;if(ue.popupVisible){var fe;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(fe=G.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Oe.a)(fe,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(fe=fe||G.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Oe.a)(fe,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(fe=fe||G.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Oe.a)(fe,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Oe.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),rt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var G;return((G=this.popupRef.current)===null||G===void 0?void 0:G.getElement())||null}},{key:"getPopupAlign",value:function(){var G=this.props,ue=G.popupPlacement,fe=G.popupAlign,me=G.builtinPlacements;return ue&&me?De(me,ue,fe):fe}},{key:"setPopupVisible",value:function(G,ue){var fe=this.props.alignPoint,me=this.state.popupVisible;this.clearDelayTimer(),me!==G&&("popupVisible"in this.props||this.setState({popupVisible:G,prevPopupVisible:me}),this.props.onPopupVisibleChange(G)),fe&&ue&&G&&this.setPoint(ue)}},{key:"delaySetPopupVisible",value:function(G,ue,fe){var me=this,Ce=ue*1e3;if(this.clearDelayTimer(),Ce){var Pe=fe?{pageX:fe.pageX,pageY:fe.pageY}:null;this.delayTimer=window.setTimeout(function(){me.setPopupVisible(G,Pe),me.clearDelayTimer()},Ce)}else this.setPopupVisible(G,fe)}},{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(G){var ue=this.props.children.props,fe=this.props;return ue[G]&&fe[G]?this["fire".concat(G)]:ue[G]||fe[G]}},{key:"isClickToShow",value:function(){var G=this.props,ue=G.action,fe=G.showAction;return ue.indexOf("click")!==-1||fe.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var G=this.props.action;return G==="contextMenu"||G.length===1&&G[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var G=this.props,ue=G.action,fe=G.showAction;return ue.indexOf("contextMenu")!==-1||fe.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var G=this.props,ue=G.action,fe=G.hideAction;return ue.indexOf("click")!==-1||fe.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var G=this.props,ue=G.action,fe=G.showAction;return ue.indexOf("hover")!==-1||fe.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var G=this.props,ue=G.action,fe=G.hideAction;return ue.indexOf("hover")!==-1||fe.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var G=this.props,ue=G.action,fe=G.showAction;return ue.indexOf("focus")!==-1||fe.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var G=this.props,ue=G.action,fe=G.hideAction;return ue.indexOf("focus")!==-1||fe.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var G;(G=this.popupRef.current)===null||G===void 0||G.forceAlign()}}},{key:"fireEvents",value:function(G,ue){var fe=this.props.children.props[G];fe&&fe(ue);var me=this.props[G];me&&me(ue)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var G=this.state.popupVisible,ue=this.props,fe=ue.children,me=ue.forceRender,Ce=ue.alignPoint,Pe=ue.className,Ne=ue.autoDestroy,at=_.Children.only(fe),it={key:"trigger"};this.isContextMenuToShow()?it.onContextMenu=this.onContextMenu:it.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(it.onClick=this.onClick,it.onMouseDown=this.onMouseDown,it.onTouchStart=this.onTouchStart):(it.onClick=this.createTwoChains("onClick"),it.onMouseDown=this.createTwoChains("onMouseDown"),it.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(it.onMouseEnter=this.onMouseEnter,Ce&&(it.onMouseMove=this.onMouseMove)):it.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?it.onMouseLeave=this.onMouseLeave:it.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(it.onFocus=this.onFocus,it.onBlur=this.onBlur):(it.onFocus=this.createTwoChains("onFocus"),it.onBlur=this.createTwoChains("onBlur"));var Tt=N()(at&&at.props&&at.props.className,Pe);Tt&&(it.className=Tt);var an=Object(U.a)({},it);Object(Ee.c)(at)&&(an.ref=Object(Ee.a)(this.triggerRef,at.ref));var bn=_.cloneElement(at,an),cn;return(G||this.popupRef.current||me)&&(cn=_.createElement(ae,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!G&&Ne&&(cn=null),_.createElement(ke.Provider,{value:this.triggerContextValue},bn,cn)}}],[{key:"getDerivedStateFromProps",value:function(G,ue){var fe=G.popupVisible,me={};return fe!==void 0&&ue.popupVisible!==fe&&(me.popupVisible=fe,me.prevPopupVisible=ue.popupVisible),me}}]),z}(_.Component);return ye.contextType=ke,ye.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Je,getDocument:et,onPopupVisibleChange:ut,afterPopupVisibleChange:ut,onPopupAlign:ut,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},ye}var Ut=Ht(je.a),xt={adjustX:1,adjustY:1},zt={topLeft:{points:["bl","tl"],overflow:xt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:xt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:xt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:xt,offset:[4,0]}},ft={topLeft:{points:["bl","tl"],overflow:xt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:xt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:xt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:xt,offset:[4,0]}},Et=zt,vt=0,Lt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},mt=function(ye,xe,le){var z=Se(xe),ee=ye.getState();ye.setState({defaultActiveFirst:Object(U.a)(Object(U.a)({},ee.defaultActiveFirst),{},Object(he.a)({},z,le))})},dt=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(le){var z;Object(v.a)(this,xe),z=ye.call(this,le),z.onDestroy=function(Ce){z.props.onDestroy(Ce)},z.onKeyDown=function(Ce){var Pe=Ce.keyCode,Ne=z.menuInstance,at=z.props.store,it=z.getVisible();if(Pe===b.a.ENTER)return z.onTitleClick(Ce),mt(at,z.props.eventKey,!0),!0;if(Pe===b.a.RIGHT)return it?Ne.onKeyDown(Ce):(z.triggerOpenChange(!0),mt(at,z.props.eventKey,!0)),!0;if(Pe===b.a.LEFT){var Tt;if(it)Tt=Ne.onKeyDown(Ce);else return;return Tt||(z.triggerOpenChange(!1),Tt=!0),Tt}return it&&(Pe===b.a.UP||Pe===b.a.DOWN)?Ne.onKeyDown(Ce):void 0},z.onOpenChange=function(Ce){z.props.onOpenChange(Ce)},z.onPopupVisibleChange=function(Ce){z.triggerOpenChange(Ce,Ce?"mouseenter":"mouseleave")},z.onMouseEnter=function(Ce){var Pe=z.props,Ne=Pe.eventKey,at=Pe.onMouseEnter,it=Pe.store;mt(it,z.props.eventKey,!1),at({key:Ne,domEvent:Ce})},z.onMouseLeave=function(Ce){var Pe=z.props,Ne=Pe.parentMenu,at=Pe.eventKey,it=Pe.onMouseLeave;Ne.subMenuInstance=Object(i.a)(z),it({key:at,domEvent:Ce})},z.onTitleMouseEnter=function(Ce){var Pe=z.props,Ne=Pe.eventKey,at=Pe.onItemHover,it=Pe.onTitleMouseEnter;at({key:Ne,hover:!0}),it({key:Ne,domEvent:Ce})},z.onTitleMouseLeave=function(Ce){var Pe=z.props,Ne=Pe.parentMenu,at=Pe.eventKey,it=Pe.onItemHover,Tt=Pe.onTitleMouseLeave;Ne.subMenuInstance=Object(i.a)(z),it({key:at,hover:!1}),Tt({key:at,domEvent:Ce})},z.onTitleClick=function(Ce){var Pe=Object(i.a)(z),Ne=Pe.props;if(Ne.onTitleClick({key:Ne.eventKey,domEvent:Ce}),Ne.triggerSubMenuAction==="hover")return;z.triggerOpenChange(!z.getVisible(),"click"),mt(Ne.store,z.props.eventKey,!1)},z.onSubMenuClick=function(Ce){typeof z.props.onClick=="function"&&z.props.onClick(z.addKeyPath(Ce))},z.onSelect=function(Ce){z.props.onSelect(Ce)},z.onDeselect=function(Ce){z.props.onDeselect(Ce)},z.getPrefixCls=function(){return"".concat(z.props.rootPrefixCls,"-submenu")},z.getActiveClassName=function(){return"".concat(z.getPrefixCls(),"-active")},z.getDisabledClassName=function(){return"".concat(z.getPrefixCls(),"-disabled")},z.getSelectedClassName=function(){return"".concat(z.getPrefixCls(),"-selected")},z.getOpenClassName=function(){return"".concat(z.props.rootPrefixCls,"-submenu-open")},z.getVisible=function(){return z.state.isOpen},z.getMode=function(){return z.state.mode},z.saveMenuInstance=function(Ce){z.menuInstance=Ce},z.addKeyPath=function(Ce){return Object(U.a)(Object(U.a)({},Ce),{},{keyPath:(Ce.keyPath||[]).concat(z.props.eventKey)})},z.triggerOpenChange=function(Ce,Pe){var Ne=z.props.eventKey,at=function(){z.onOpenChange({key:Ne,item:Object(i.a)(z),trigger:Pe,open:Ce})};Pe==="mouseenter"?z.mouseenterTimeout=setTimeout(function(){at()},0):at()},z.isChildrenSelected=function(){var Ce={find:!1};return Ve(z.props.children,z.props.selectedKeys,Ce),Ce.find},z.isInlineMode=function(){return z.getMode()==="inline"},z.adjustWidth=function(){if(!z.subMenuTitle||!z.menuInstance)return;var Ce=Re.findDOMNode(z.menuInstance);if(Ce.offsetWidth>=z.subMenuTitle.offsetWidth)return;Ce.style.minWidth="".concat(z.subMenuTitle.offsetWidth,"px")},z.saveSubMenuTitle=function(Ce){z.subMenuTitle=Ce},z.getBaseProps=function(){var Ce=Object(i.a)(z),Pe=Ce.props,Ne=z.getMode();return{mode:Ne==="horizontal"?"vertical":Ne,visible:z.getVisible(),level:Pe.level+1,inlineIndent:Pe.inlineIndent,focusable:!1,onClick:z.onSubMenuClick,onSelect:z.onSelect,onDeselect:z.onDeselect,onDestroy:z.onDestroy,selectedKeys:Pe.selectedKeys,eventKey:"".concat(Pe.eventKey,"-menu-"),openKeys:Pe.openKeys,motion:Pe.motion,onOpenChange:z.onOpenChange,subMenuOpenDelay:Pe.subMenuOpenDelay,parentMenu:Object(i.a)(z),subMenuCloseDelay:Pe.subMenuCloseDelay,forceSubMenuRender:Pe.forceSubMenuRender,triggerSubMenuAction:Pe.triggerSubMenuAction,builtinPlacements:Pe.builtinPlacements,defaultActiveFirst:Pe.store.getState().defaultActiveFirst[Se(Pe.eventKey)],multiple:Pe.multiple,prefixCls:Pe.rootPrefixCls,id:z.internalMenuId,manualRef:z.saveMenuInstance,itemIcon:Pe.itemIcon,expandIcon:Pe.expandIcon,direction:Pe.direction}},z.getMotion=function(Ce,Pe){var Ne=Object(i.a)(z),at=Ne.haveRendered,it=z.props,Tt=it.motion,an=it.rootPrefixCls,bn=Object(U.a)(Object(U.a)({},Tt),{},{leavedClassName:"".concat(an,"-hidden"),removeOnLeave:!1,motionAppear:at||!Pe||Ce!=="inline"});return bn};var ee=le.store,G=le.eventKey,ue=ee.getState(),fe=ue.defaultActiveFirst;z.isRootMenu=!1;var me=!1;return fe&&(me=fe[G]),mt(ee,G,me),z.state={mode:le.mode,isOpen:le.isOpen},z}return Object(f.a)(xe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var z=this,ee=this.props,G=ee.mode,ue=ee.parentMenu,fe=ee.manualRef,me=ee.isOpen,Ce=function(){z.setState({mode:G,isOpen:me})},Pe=me!==this.state.isOpen,Ne=G!==this.state.mode;if((Ne||Pe)&&(rt.a.cancel(this.updateStateRaf),Ne?this.updateStateRaf=Object(rt.a)(Ce):Ce()),fe&&fe(this),G!=="horizontal"||!(ue==null?void 0:ue.isRootMenu)||!me)return;this.minWidthTimeout=setTimeout(function(){return z.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var z=this.props,ee=z.onDestroy,G=z.eventKey;ee&&ee(G),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),rt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(z,ee){var G=this.getBaseProps();return _.createElement(Vt,Object(o.a)({},G,{id:this.internalMenuId,className:z,style:ee}),this.props.children)}},{key:"renderChildren",value:function(){var z=this,ee=this.getBaseProps(),G=ee.mode,ue=ee.visible,fe=ee.forceSubMenuRender,me=ee.direction,Ce=this.getMotion(G,ue);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ue||fe,!this.haveOpened)return _.createElement("div",null);var Pe=N()("".concat(ee.prefixCls,"-sub"),Object(he.a)({},"".concat(ee.prefixCls,"-rtl"),me==="rtl"));return this.isInlineMode()?_.createElement(H,Object(o.a)({visible:ee.visible,forceRender:fe},Ce),function(Ne){var at=Ne.className,it=Ne.style,Tt=N()(Pe,at);return z.renderPopupMenu(Tt,it)}):this.renderPopupMenu(Pe)}},{key:"render",value:function(){var z,ee,G,ue=Object(U.a)({},this.props),fe=this.getVisible(),me=this.getPrefixCls(),Ce=this.isInlineMode(),Pe=this.getMode(),Ne=N()(me,"".concat(me,"-").concat(Pe),(z={},Object(he.a)(z,ue.className,!!ue.className),Object(he.a)(z,this.getOpenClassName(),fe),Object(he.a)(z,this.getActiveClassName(),ue.active||fe&&!Ce),Object(he.a)(z,this.getDisabledClassName(),ue.disabled),Object(he.a)(z,this.getSelectedClassName(),this.isChildrenSelected()),z));this.internalMenuId||(ue.eventKey?this.internalMenuId="".concat(ue.eventKey,"$Menu"):(vt+=1,this.internalMenuId="$__$".concat(vt,"$Menu")));var at={},it={},Tt={};ue.disabled||(at={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},it={onClick:this.onTitleClick},Tt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var an={},bn=ue.direction,cn=bn==="rtl";Ce&&(cn?an.paddingRight=ue.inlineIndent*ue.level:an.paddingLeft=ue.inlineIndent*ue.level);var un={};this.getVisible()&&(un={"aria-owns":this.internalMenuId});var En=null;Pe!=="horizontal"&&(En=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(En=_.createElement(this.props.expandIcon,Object(U.a)({},this.props))));var mn=_.createElement("div",Object(o.a)({ref:this.saveSubMenuTitle,style:an,className:"".concat(me,"-title"),role:"button"},Tt,it,{"aria-expanded":fe},un,{"aria-haspopup":"true",title:typeof ue.title=="string"?ue.title:void 0}),ue.title,En||_.createElement("i",{className:"".concat(me,"-arrow")})),vn=this.renderChildren(),In=((ee=ue.parentMenu)===null||ee===void 0?void 0:ee.isRootMenu)?ue.parentMenu.props.getPopupContainer:function(lr){return lr.parentNode},Sn=Lt[Pe],sr=ue.popupOffset?{offset:ue.popupOffset}:{},Hn=N()((G={},Object(he.a)(G,ue.popupClassName,ue.popupClassName&&!Ce),Object(he.a)(G,"".concat(me,"-rtl"),cn),G)),Zt=ue.disabled,Qt=ue.triggerSubMenuAction,Pn=ue.subMenuOpenDelay,On=ue.forceSubMenuRender,Ft=ue.subMenuCloseDelay,Nn=ue.builtinPlacements;$e.forEach(function(lr){return delete ue[lr]}),delete ue.onClick;var $n=cn?Object(U.a)(Object(U.a)({},ft),Nn):Object(U.a)(Object(U.a)({},zt),Nn);delete ue.direction;var Un=this.getBaseProps(),Yn=Ce?null:this.getMotion(Un.mode,Un.visible);return _.createElement("li",Object(o.a)({},ue,at,{className:Ne,role:"menuitem"}),_.createElement(Ut,{prefixCls:me,popupClassName:N()("".concat(me,"-popup"),Hn),getPopupContainer:In,builtinPlacements:$n,popupPlacement:Sn,popupVisible:Ce?!1:fe,popupAlign:sr,popup:Ce?null:vn,action:Zt||Ce?[]:[Qt],mouseEnterDelay:Pn,mouseLeaveDelay:Ft,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:On,popupMotion:Yn},mn),Ce?vn:null)}}]),xe}(_.Component);dt.defaultProps={onMouseEnter:Ae,onMouseLeave:Ae,onTitleMouseEnter:Ae,onTitleMouseLeave:Ae,onTitleClick:Ae,manualRef:Ae,mode:"vertical",title:""};var Mt=Object(a.b)(function(ae,ye){var xe=ae.openKeys,le=ae.activeKey,z=ae.selectedKeys,ee=ye.eventKey,G=ye.subMenuKey;return{isOpen:xe.indexOf(ee)>-1,active:le[G]===ee,selectedKeys:z}})(dt);Mt.isSubMenu=!0;var $t=Mt,rn="menuitem-overflowed",de=.5,on=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(){var le;return Object(v.a)(this,xe),le=ye.apply(this,arguments),le.resizeObserver=null,le.mutationObserver=null,le.originalTotalWidth=0,le.overflowedItems=[],le.menuItemSizes=[],le.cancelFrameId=null,le.state={lastVisibleIndex:void 0},le.childRef=_.createRef(),le.getMenuItemNodes=function(){var z=le.props.prefixCls,ee=le.childRef.current;return ee?[].slice.call(ee.children).filter(function(G){return G.className.split(" ").indexOf("".concat(z,"-overflowed-submenu"))<0}):[]},le.getOverflowedSubMenuItem=function(z,ee,G){var ue=le.props,fe=ue.overflowedIndicator,me=ue.level,Ce=ue.mode,Pe=ue.prefixCls,Ne=ue.theme;if(me!==1||Ce!=="horizontal")return null;var at=le.props.children[0],it=at.props,Tt=it.children,an=it.title,bn=it.style,cn=Object(w.a)(it,["children","title","style"]),un=Object(U.a)({},bn),En="".concat(z,"-overflowed-indicator"),mn="".concat(z,"-overflowed-indicator");ee.length===0&&G!==!0?un=Object(U.a)(Object(U.a)({},un),{},{display:"none"}):G&&(un=Object(U.a)(Object(U.a)({},un),{},{visibility:"hidden",position:"absolute"}),En="".concat(En,"-placeholder"),mn="".concat(mn,"-placeholder"));var vn=Ne?"".concat(Pe,"-").concat(Ne):"",In={};return $e.forEach(function(Sn){cn[Sn]!==void 0&&(In[Sn]=cn[Sn])}),_.createElement($t,Object(o.a)({title:fe,className:"".concat(Pe,"-overflowed-submenu"),popupClassName:vn},In,{key:En,eventKey:mn,disabled:!1,style:un}),ee)},le.setChildrenWidthAndResize=function(){if(le.props.mode!=="horizontal")return;var z=le.childRef.current;if(!z)return;var ee=z.children;if(!ee||ee.length===0)return;var G=z.children[ee.length-1];Be(G,"display","inline-block");var ue=le.getMenuItemNodes(),fe=ue.filter(function(me){return me.className.split(" ").indexOf(rn)>=0});fe.forEach(function(me){Be(me,"display","inline-block")}),le.menuItemSizes=ue.map(function(me){return Qe(me,!0)}),fe.forEach(function(me){Be(me,"display","none")}),le.overflowedIndicatorWidth=Qe(z.children[z.children.length-1],!0),le.originalTotalWidth=le.menuItemSizes.reduce(function(me,Ce){return me+Ce},0),le.handleResize(),Be(G,"display","none")},le.handleResize=function(){if(le.props.mode!=="horizontal")return;var z=le.childRef.current;if(!z)return;var ee=Qe(z);le.overflowedItems=[];var G=0,ue;le.originalTotalWidth>ee+de&&(ue=-1,le.menuItemSizes.forEach(function(fe){G+=fe,G+le.overflowedIndicatorWidth<=ee&&(ue+=1)})),le.setState({lastVisibleIndex:ue})},le}return Object(f.a)(xe,[{key:"componentDidMount",value:function(){var z=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ee=this.childRef.current;if(!ee)return;this.resizeObserver=new ot.default(function(G){G.forEach(function(){var ue=z.cancelFrameId;cancelAnimationFrame(ue),z.cancelFrameId=requestAnimationFrame(z.setChildrenWidthAndResize)})}),[].slice.call(ee.children).concat(ee).forEach(function(G){z.resizeObserver.observe(G)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){z.resizeObserver.disconnect(),[].slice.call(ee.children).concat(ee).forEach(function(G){z.resizeObserver.observe(G)}),z.setChildrenWidthAndResize()}),this.mutationObserver.observe(ee,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(z){var ee=this,G=this.state.lastVisibleIndex;return(z||[]).reduce(function(ue,fe,me){var Ce=fe;if(ee.props.mode==="horizontal"){var Pe=ee.getOverflowedSubMenuItem(fe.props.eventKey,[]);G!==void 0&&ee.props.className.indexOf("".concat(ee.props.prefixCls,"-root"))!==-1&&(me>G&&(Ce=_.cloneElement(fe,{style:{display:"none"},eventKey:"".concat(fe.props.eventKey,"-hidden"),className:"".concat(rn)})),me===G+1&&(ee.overflowedItems=z.slice(G+1).map(function(at){return _.cloneElement(at,{key:at.props.eventKey,mode:"vertical-left"})}),Pe=ee.getOverflowedSubMenuItem(fe.props.eventKey,ee.overflowedItems)));var Ne=[].concat(Object(P.a)(ue),[Pe,Ce]);return me===z.length-1&&Ne.push(ee.getOverflowedSubMenuItem(fe.props.eventKey,[],!0)),Ne}return[].concat(Object(P.a)(ue),[Ce])},[])}},{key:"render",value:function(){var z=this.props,ee=z.visible,G=z.prefixCls,ue=z.overflowedIndicator,fe=z.mode,me=z.level,Ce=z.tag,Pe=z.children,Ne=z.theme,at=Object(w.a)(z,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),it=Ce;return _.createElement(it,Object(o.a)({ref:this.childRef},at),this.renderChildren(Pe))}}]),xe}(_.Component);on.defaultProps={tag:"div",className:""};var Pt=on;function At(ae){return ae.length?ae.every(function(ye){return!!ye.props.disabled}):!0}function yt(ae,ye,xe){var le=ae.getState();ae.setState({activeKey:Object(U.a)(Object(U.a)({},le.activeKey),{},Object(he.a)({},ye,xe))})}function _t(ae){return ae.eventKey||"0-menu-"}function jt(ae,ye){var xe=ye,le=ae.children,z=ae.eventKey;if(xe){var ee;if(Le(le,function(G,ue){G&&G.props&&!G.props.disabled&&xe===Me(G,z,ue)&&(ee=!0)}),ee)return xe}return xe=null,ae.defaultActiveFirst&&Le(le,function(G,ue){!xe&&G&&!G.props.disabled&&(xe=Me(G,z,ue))}),xe}function Gt(ae){if(!ae)return;var ye=this.instanceArray.indexOf(ae);ye!==-1?this.instanceArray[ye]=ae:this.instanceArray.push(ae)}var kt=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(le){var z;return Object(v.a)(this,xe),z=ye.call(this,le),z.onKeyDown=function(ee,G){var ue=ee.keyCode,fe;if(z.getFlatInstanceArray().forEach(function(Ce){Ce&&Ce.props.active&&Ce.onKeyDown&&(fe=Ce.onKeyDown(ee))}),fe)return 1;var me=null;return(ue===b.a.UP||ue===b.a.DOWN)&&(me=z.step(ue===b.a.UP?-1:1)),me?(ee.preventDefault(),yt(z.props.store,_t(z.props),me.props.eventKey),typeof G=="function"&&G(me),1):void 0},z.onItemHover=function(ee){var G=ee.key,ue=ee.hover;yt(z.props.store,_t(z.props),ue?G:null)},z.onDeselect=function(ee){z.props.onDeselect(ee)},z.onSelect=function(ee){z.props.onSelect(ee)},z.onClick=function(ee){z.props.onClick(ee)},z.onOpenChange=function(ee){z.props.onOpenChange(ee)},z.onDestroy=function(ee){z.props.onDestroy(ee)},z.getFlatInstanceArray=function(){return z.instanceArray},z.step=function(ee){var G=z.getFlatInstanceArray(),ue=z.props.store.getState().activeKey[_t(z.props)],fe=G.length;if(!fe)return null;ee<0&&(G=G.concat().reverse());var me=-1;if(G.every(function(at,it){return at&&at.props.eventKey===ue?(me=it,!1):!0}),!z.props.defaultActiveFirst&&me!==-1&&At(G.slice(me,fe-1)))return;var Ce=(me+1)%fe,Pe=Ce;do{var Ne=G[Pe];if(!Ne||Ne.props.disabled)Pe=(Pe+1)%fe;else return Ne}while(Pe!==Ce);return null},z.renderCommonMenuItem=function(ee,G,ue){var fe=z.props.store.getState(),me=Object(i.a)(z),Ce=me.props,Pe=Me(ee,Ce.eventKey,G),Ne=ee.props;if(!Ne||typeof ee.type=="string")return ee;var at=Pe===fe.activeKey,it=Object(U.a)(Object(U.a)({mode:Ne.mode||Ce.mode,level:Ce.level,inlineIndent:Ce.inlineIndent,renderMenuItem:z.renderMenuItem,rootPrefixCls:Ce.prefixCls,index:G,parentMenu:Ce.parentMenu,manualRef:Ne.disabled?void 0:Object(h.a)(ee.ref,Gt.bind(Object(i.a)(z))),eventKey:Pe,active:!Ne.disabled&&at,multiple:Ce.multiple,onClick:function(an){(Ne.onClick||Ae)(an),z.onClick(an)},onItemHover:z.onItemHover,motion:Ce.motion,subMenuOpenDelay:Ce.subMenuOpenDelay,subMenuCloseDelay:Ce.subMenuCloseDelay,forceSubMenuRender:Ce.forceSubMenuRender,onOpenChange:z.onOpenChange,onDeselect:z.onDeselect,onSelect:z.onSelect,builtinPlacements:Ce.builtinPlacements,itemIcon:Ne.itemIcon||z.props.itemIcon,expandIcon:Ne.expandIcon||z.props.expandIcon},ue),{},{direction:Ce.direction});return(Ce.mode==="inline"||ze())&&(it.triggerSubMenuAction="click"),_.cloneElement(ee,Object(U.a)(Object(U.a)({},it),{},{key:Pe||G}))},z.renderMenuItem=function(ee,G,ue){if(!ee)return null;var fe=z.props.store.getState(),me={openKeys:fe.openKeys,selectedKeys:fe.selectedKeys,triggerSubMenuAction:z.props.triggerSubMenuAction,subMenuKey:ue};return z.renderCommonMenuItem(ee,G,me)},le.store.setState({activeKey:Object(U.a)(Object(U.a)({},le.store.getState().activeKey),{},Object(he.a)({},le.eventKey,jt(le,le.activeKey)))}),z.instanceArray=[],z}return Object(f.a)(xe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(z){return this.props.visible||z.visible||this.props.className!==z.className||!e()(this.props.style,z.style)}},{key:"componentDidUpdate",value:function(z){var ee=this.props,G="activeKey"in ee?ee.activeKey:ee.store.getState().activeKey[_t(ee)],ue=jt(ee,G);if(ue!==G)yt(ee.store,_t(ee),ue);else if("activeKey"in z){var fe=jt(z,z.activeKey);ue!==fe&&yt(ee.store,_t(ee),ue)}}},{key:"render",value:function(){var z=this,ee=Object(o.a)({},this.props);this.instanceArray=[];var G=N()(ee.prefixCls,ee.className,"".concat(ee.prefixCls,"-").concat(ee.mode)),ue={className:G,role:ee.role||"menu"};ee.id&&(ue.id=ee.id),ee.focusable&&(ue.tabIndex=0,ue.onKeyDown=this.onKeyDown);var fe=ee.prefixCls,me=ee.eventKey,Ce=ee.visible,Pe=ee.level,Ne=ee.mode,at=ee.overflowedIndicator,it=ee.theme;return $e.forEach(function(Tt){return delete ee[Tt]}),delete ee.onClick,_.createElement(Pt,Object(o.a)({},ee,{prefixCls:fe,mode:Ne,tag:"ul",level:Pe,theme:it,visible:Ce,overflowedIndicator:at},ue),Object(I.a)(ee.children).map(function(Tt,an){return z.renderMenuItem(Tt,an,me||"0-menu-")}))}}]),xe}(_.Component);kt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ae};var gn=Object(a.b)()(kt),Vt=gn,dn=j("Kwbf");function Kn(ae,ye,xe){var le=ae.prefixCls,z=ae.motion,ee=ae.defaultMotions,G=ee===void 0?{}:ee,ue=ae.openAnimation,fe=ae.openTransitionName,me=ye.switchingModeFromInline;if(z)return z;if(Object(A.a)(ue)==="object"&&ue)Object(dn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ue=="string")return{motionName:"".concat(le,"-open-").concat(ue)};if(fe)return{motionName:fe};var Ce=G[xe];return Ce||(me?null:G.other)}var Cr=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(le){var z;Object(v.a)(this,xe),z=ye.call(this,le),z.onSelect=function(ue){var fe=Object(i.a)(z),me=fe.props;if(me.selectable){var Ce=z.store.getState(),Pe=Ce.selectedKeys,Ne=ue.key;me.multiple?Pe=Pe.concat([Ne]):Pe=[Ne],"selectedKeys"in me||z.store.setState({selectedKeys:Pe}),me.onSelect(Object(U.a)(Object(U.a)({},ue),{},{selectedKeys:Pe}))}},z.onClick=function(ue){var fe=z.getRealMenuMode(),me=Object(i.a)(z),Ce=me.store,Pe=me.props.onOpenChange;fe!=="inline"&&!("openKeys"in z.props)&&(Ce.setState({openKeys:[]}),Pe([])),z.props.onClick(ue)},z.onKeyDown=function(ue,fe){z.innerMenu.getWrappedInstance().onKeyDown(ue,fe)},z.onOpenChange=function(ue){var fe=Object(i.a)(z),me=fe.props,Ce=z.store.getState().openKeys.concat(),Pe=!1,Ne=function(it){var Tt=!1;if(it.open)Tt=Ce.indexOf(it.key)===-1,Tt&&Ce.push(it.key);else{var an=Ce.indexOf(it.key);Tt=an!==-1,Tt&&Ce.splice(an,1)}Pe=Pe||Tt};Array.isArray(ue)?ue.forEach(Ne):Ne(ue),Pe&&("openKeys"in z.props||z.store.setState({openKeys:Ce}),me.onOpenChange(Ce))},z.onDeselect=function(ue){var fe=Object(i.a)(z),me=fe.props;if(me.selectable){var Ce=z.store.getState().selectedKeys.concat(),Pe=ue.key,Ne=Ce.indexOf(Pe);Ne!==-1&&Ce.splice(Ne,1),"selectedKeys"in me||z.store.setState({selectedKeys:Ce}),me.onDeselect(Object(U.a)(Object(U.a)({},ue),{},{selectedKeys:Ce}))}},z.onMouseEnter=function(ue){z.restoreModeVerticalFromInline();var fe=z.props.onMouseEnter;fe&&fe(ue)},z.onTransitionEnd=function(ue){var fe=ue.propertyName==="width"&&ue.target===ue.currentTarget,me=ue.target.className,Ce=Object.prototype.toString.call(me)==="[object SVGAnimatedString]"?me.animVal:me,Pe=ue.propertyName==="font-size"&&Ce.indexOf("anticon")>=0;(fe||Pe)&&z.restoreModeVerticalFromInline()},z.setInnerMenu=function(ue){z.innerMenu=ue},z.isRootMenu=!0;var ee=le.defaultSelectedKeys,G=le.defaultOpenKeys;return"selectedKeys"in le&&(ee=le.selectedKeys||[]),"openKeys"in le&&(G=le.openKeys||[]),z.store=Object(a.c)({selectedKeys:ee,openKeys:G,activeKey:{"0-menu-":jt(le,le.activeKey)}}),z.state={switchingModeFromInline:!1,prevProps:le,inlineOpenKeys:[],store:z.store},z}return Object(f.a)(xe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(z){var ee=this.props,G=ee.siderCollapsed,ue=ee.inlineCollapsed,fe=ee.onOpenChange;(!z.inlineCollapsed&&ue||!z.siderCollapsed&&G)&&fe([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var z=this.props.collapsedWidth,ee=this.store,G=this.prevOpenKeys,ue=this.getInlineCollapsed()&&(z===0||z==="0"||z==="0px");ue?(this.prevOpenKeys=ee.getState().openKeys.concat(),this.store.setState({openKeys:[]})):G&&(this.store.setState({openKeys:G}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var z=this.props.mode,ee=this.state.switchingModeFromInline,G=this.getInlineCollapsed();return ee&&G?"inline":G?"vertical":z}},{key:"getInlineCollapsed",value:function(){var z=this.props,ee=z.inlineCollapsed,G=z.siderCollapsed;return G!==void 0?G:ee}},{key:"restoreModeVerticalFromInline",value:function(){var z=this.state.switchingModeFromInline;z&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var z=Object(U.a)({},Object(g.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ee=this.getRealMenuMode();return z.className+=" ".concat(z.prefixCls,"-root"),z.direction==="rtl"&&(z.className+=" ".concat(z.prefixCls,"-rtl")),z=Object(U.a)(Object(U.a)({},z),{},{mode:ee,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Kn(this.props,this.state,ee)}),delete z.openAnimation,delete z.openTransitionName,_.createElement(a.a,{store:this.store},_.createElement(Vt,Object(o.a)({},z,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(z,ee){var G=ee.prevProps,ue=ee.store,fe=ue.getState(),me={},Ce={prevProps:z};return G.mode==="inline"&&z.mode!=="inline"&&(Ce.switchingModeFromInline=!0),"openKeys"in z?me.openKeys=z.openKeys||[]:((z.inlineCollapsed&&!G.inlineCollapsed||z.siderCollapsed&&!G.siderCollapsed)&&(Ce.switchingModeFromInline=!0,Ce.inlineOpenKeys=fe.openKeys,me.openKeys=[]),(!z.inlineCollapsed&&G.inlineCollapsed||!z.siderCollapsed&&G.siderCollapsed)&&(me.openKeys=ee.inlineOpenKeys,Ce.inlineOpenKeys=[])),Object.keys(me).length&&ue.setState(me),Ce}}]),xe}(_.Component);Cr.defaultProps={selectable:!0,onClick:Ae,onSelect:Ae,onOpenChange:Ae,onDeselect:Ae,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:_.createElement("span",null,"\xB7\xB7\xB7")};var Mr=Cr,St=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(){var le;return Object(v.a)(this,xe),le=ye.apply(this,arguments),le.onKeyDown=function(z){var ee=z.keyCode;return ee===b.a.ENTER?(le.onClick(z),!0):void 0},le.onMouseLeave=function(z){var ee=le.props,G=ee.eventKey,ue=ee.onItemHover,fe=ee.onMouseLeave;ue({key:G,hover:!1}),fe({key:G,domEvent:z})},le.onMouseEnter=function(z){var ee=le.props,G=ee.eventKey,ue=ee.onItemHover,fe=ee.onMouseEnter;ue({key:G,hover:!0}),fe({key:G,domEvent:z})},le.onClick=function(z){var ee=le.props,G=ee.eventKey,ue=ee.multiple,fe=ee.onClick,me=ee.onSelect,Ce=ee.onDeselect,Pe=ee.isSelected,Ne={key:G,keyPath:[G],item:Object(i.a)(le),domEvent:z};fe(Ne),ue?Pe?Ce(Ne):me(Ne):Pe||me(Ne)},le.saveNode=function(z){le.node=z},le}return Object(f.a)(xe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var z=this.props;z.onDestroy&&z.onDestroy(z.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var z,ee=Object(U.a)({},this.props),G=N()(this.getPrefixCls(),ee.className,(z={},Object(he.a)(z,this.getActiveClassName(),!ee.disabled&&ee.active),Object(he.a)(z,this.getSelectedClassName(),ee.isSelected),Object(he.a)(z,this.getDisabledClassName(),ee.disabled),z)),ue=Object(U.a)(Object(U.a)({},ee.attribute),{},{title:typeof ee.title=="string"?ee.title:void 0,className:G,role:ee.role||"menuitem","aria-disabled":ee.disabled});ee.role==="option"?ue=Object(U.a)(Object(U.a)({},ue),{},{role:"option","aria-selected":ee.isSelected}):(ee.role===null||ee.role==="none")&&(ue.role="none");var fe={onClick:ee.disabled?null:this.onClick,onMouseLeave:ee.disabled?null:this.onMouseLeave,onMouseEnter:ee.disabled?null:this.onMouseEnter},me=Object(U.a)({},ee.style);ee.mode==="inline"&&(ee.direction==="rtl"?me.paddingRight=ee.inlineIndent*ee.level:me.paddingLeft=ee.inlineIndent*ee.level),$e.forEach(function(Pe){return delete ee[Pe]}),delete ee.direction;var Ce=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ce=_.createElement(this.props.itemIcon,this.props)),_.createElement("li",Object(o.a)({},Object(g.a)(ee,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ue,fe,{style:me,ref:this.saveNode}),ee.children,Ce)}}]),xe}(_.Component);St.isMenuItem=!0,St.defaultProps={onSelect:Ae,onMouseEnter:Ae,onMouseLeave:Ae,manualRef:Ae};var Xn=Object(a.b)(function(ae,ye){var xe=ae.activeKey,le=ae.selectedKeys,z=ye.eventKey,ee=ye.subMenuKey;return{active:xe[ee]===z,isSelected:Array.isArray(le)?le.indexOf(z)!==-1:le===z}})(St),Tn=Xn,rr=function(ae){Object(r.a)(xe,ae);var ye=Object(t.a)(xe);function xe(){var le;return Object(v.a)(this,xe),le=ye.apply(this,arguments),le.renderInnerMenuItem=function(z){var ee=le.props,G=ee.renderMenuItem,ue=ee.index;return G(z,ue,le.props.subMenuKey)},le}return Object(f.a)(xe,[{key:"render",value:function(){var z=Object(o.a)({},this.props),ee=z.className,G=ee===void 0?"":ee,ue=z.rootPrefixCls,fe="".concat(ue,"-item-group-title"),me="".concat(ue,"-item-group-list"),Ce=z.title,Pe=z.children;return $e.forEach(function(Ne){return delete z[Ne]}),delete z.direction,_.createElement("li",Object(o.a)({},z,{onClick:function(at){return at.stopPropagation()},className:"".concat(G," ").concat(ue,"-item-group")}),_.createElement("div",{className:fe,title:typeof Ce=="string"?Ce:void 0},Ce),_.createElement("ul",{className:me},_.Children.map(Pe,this.renderInnerMenuItem)))}}]),xe}(_.Component);rr.isMenuItemGroup=!0,rr.defaultProps={disabled:!0};var ar=rr,dr=function(ye){var xe=ye.className,le=ye.rootPrefixCls,z=ye.style;return _.createElement("li",{className:"".concat(xe," ").concat(le,"-item-divider"),style:z})};dr.defaultProps={disabled:!0,className:"",style:{}};var Dn=dr,Qn=Mr,Vn=j("eDIo");function Ar(ae,ye){var xe=ae.prefixCls,le=ae.editable,z=ae.locale,ee=ae.style;return!le||le.showAdd===!1?null:_.createElement("button",{ref:ye,type:"button",className:"".concat(xe,"-nav-add"),style:ee,"aria-label":(z==null?void 0:z.addAriaLabel)||"Add tab",onClick:function(ue){le.onEdit("add",{event:ue})}},le.addIcon||"+")}var Wn=_.forwardRef(Ar);function ra(ae,ye){var xe=ae.prefixCls,le=ae.id,z=ae.tabs,ee=ae.locale,G=ae.mobile,ue=ae.moreIcon,fe=ue===void 0?"More":ue,me=ae.moreTransitionName,Ce=ae.style,Pe=ae.className,Ne=ae.editable,at=ae.tabBarGutter,it=ae.rtl,Tt=ae.onTabClick,an=Object(_.useState)(!1),bn=Object(B.a)(an,2),cn=bn[0],un=bn[1],En=Object(_.useState)(null),mn=Object(B.a)(En,2),vn=mn[0],In=mn[1],Sn="".concat(le,"-more-popup"),sr="".concat(xe,"-dropdown"),Hn=vn!==null?"".concat(Sn,"-").concat(vn):null,Zt=ee==null?void 0:ee.dropdownAriaLabel,Qt=_.createElement(Qn,{onClick:function(Yn){var lr=Yn.key,Er=Yn.domEvent;Tt(lr,Er),un(!1)},id:Sn,tabIndex:-1,role:"listbox","aria-activedescendant":Hn,selectedKeys:[vn],"aria-label":Zt!==void 0?Zt:"expanded dropdown"},z.map(function(Un){return _.createElement(Tn,{key:Un.key,id:"".concat(Sn,"-").concat(Un.key),role:"option","aria-controls":le&&"".concat(le,"-panel-").concat(Un.key),disabled:Un.disabled},Un.tab)}));function Pn(Un){for(var Yn=z.filter(function(jr){return!jr.disabled}),lr=Yn.findIndex(function(jr){return jr.key===vn})||0,Er=Yn.length,Dr=0;Dr<Er;Dr+=1){lr=(lr+Un+Er)%Er;var hr=Yn[lr];if(!hr.disabled){In(hr.key);return}}}function On(Un){var Yn=Un.which;if(!cn){[b.a.DOWN,b.a.SPACE,b.a.ENTER].includes(Yn)&&(un(!0),Un.preventDefault());return}switch(Yn){case b.a.UP:Pn(-1),Un.preventDefault();break;case b.a.DOWN:Pn(1),Un.preventDefault();break;case b.a.ESC:un(!1);break;case b.a.SPACE:case b.a.ENTER:vn!==null&&Tt(vn,Un);break}}Object(_.useEffect)(function(){var Un=document.getElementById(Hn);Un&&Un.scrollIntoView&&Un.scrollIntoView(!1)},[vn]),Object(_.useEffect)(function(){cn||In(null)},[cn]);var Ft=Object(he.a)({},it?"marginLeft":"marginRight",at);z.length||(Ft.visibility="hidden",Ft.order=1);var Nn=N()(Object(he.a)({},"".concat(sr,"-rtl"),it)),$n=G?null:_.createElement(Vn.a,{prefixCls:sr,overlay:Qt,trigger:["hover"],visible:cn,transitionName:me,onVisibleChange:un,overlayClassName:Nn,mouseEnterDelay:.1,mouseLeaveDelay:.1},_.createElement("button",{type:"button",className:"".concat(xe,"-nav-more"),style:Ft,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Sn,id:"".concat(le,"-more"),"aria-expanded":cn,onKeyDown:On},fe));return _.createElement("div",{className:N()("".concat(xe,"-nav-operations"),Pe),style:Ce,ref:ye},$n,_.createElement(Wn,{prefixCls:xe,locale:ee,editable:Ne}))}var mr=_.forwardRef(ra),vr=Object(_.createContext)(null),qt=.1,Jt=.01,Mn=20,ir=Math.pow(.995,Mn);function Nr(){var ae=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(ae)||/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(ae.substr(0,4)))}function Or(ae,ye){var xe=Object(_.useState)(),le=Object(B.a)(xe,2),z=le[0],ee=le[1],G=Object(_.useState)(0),ue=Object(B.a)(G,2),fe=ue[0],me=ue[1],Ce=Object(_.useState)(0),Pe=Object(B.a)(Ce,2),Ne=Pe[0],at=Pe[1],it=Object(_.useState)(),Tt=Object(B.a)(it,2),an=Tt[0],bn=Tt[1],cn=Object(_.useRef)();function un(Zt){var Qt=Zt.touches[0],Pn=Qt.screenX,On=Qt.screenY;ee({x:Pn,y:On}),window.clearInterval(cn.current)}function En(Zt){if(!z)return;Zt.preventDefault();var Qt=Zt.touches[0],Pn=Qt.screenX,On=Qt.screenY;ee({x:Pn,y:On});var Ft=Pn-z.x,Nn=On-z.y;ye(Ft,Nn);var $n=Date.now();me($n),at($n-fe),bn({x:Ft,y:Nn})}function mn(){if(!z)return;if(ee(null),bn(null),an){var Zt=an.x/Ne,Qt=an.y/Ne,Pn=Math.abs(Zt),On=Math.abs(Qt);if(Math.max(Pn,On)<qt)return;var Ft=Zt,Nn=Qt;cn.current=window.setInterval(function(){if(Math.abs(Ft)<Jt&&Math.abs(Nn)<Jt){window.clearInterval(cn.current);return}Ft*=ir,Nn*=ir,ye(Ft*Mn,Nn*Mn)},Mn)}}var vn=Object(_.useRef)(0),In=Object(_.useRef)(!1),Sn=Object(_.useRef)();function sr(Zt){var Qt=Zt.deltaX,Pn=Zt.deltaY,On=0,Ft=Math.abs(Qt),Nn=Math.abs(Pn);Ft===Nn?On=Sn.current==="x"?Qt:Pn:Ft>Nn?(On=Qt,Sn.current="x"):(On=Pn,Sn.current="y");var $n=Date.now();$n-vn.current>100&&(In.current=!1),(ye(-On,-On)||In.current)&&(Zt.preventDefault(),In.current=!0),vn.current=$n}var Hn=Object(_.useRef)(null);Hn.current={onTouchStart:un,onTouchMove:En,onTouchEnd:mn,onWheel:sr},_.useEffect(function(){function Zt(Ft){Hn.current.onTouchStart(Ft)}function Qt(Ft){Hn.current.onTouchMove(Ft)}function Pn(Ft){Hn.current.onTouchEnd(Ft)}function On(Ft){Hn.current.onWheel(Ft)}return document.addEventListener("touchmove",Qt,{passive:!1}),document.addEventListener("touchend",Pn,{passive:!1}),ae.current.addEventListener("touchstart",Zt,{passive:!1}),ae.current.addEventListener("wheel",On),function(){document.removeEventListener("touchmove",Qt),document.removeEventListener("touchend",Pn)}},[])}function Ur(){var ae=Object(_.useRef)(new Map);function ye(le){return ae.current.has(le)||ae.current.set(le,_.createRef()),ae.current.get(le)}function xe(le){ae.current.delete(le)}return[ye,xe]}function Lr(ae,ye){var xe=_.useRef(ae),le=_.useState({}),z=Object(B.a)(le,2),ee=z[1];function G(ue){var fe=typeof ue=="function"?ue(xe.current):ue;fe!==xe.current&&ye(fe,xe.current),xe.current=fe,ee({})}return[xe.current,G]}var ua=function(ye){var xe=ye.position,le=ye.prefixCls,z=ye.extra;if(!z)return null;var ee,G=z;return xe==="right"&&(ee=G.right||!G.left&&G||null),xe==="left"&&(ee=G.left||null),ee?_.createElement("div",{className:"".concat(le,"-extra-content")},ee):null};function Wr(ae,ye){var xe,le=_.useContext(vr),z=le.prefixCls,ee=le.tabs,G=ae.className,ue=ae.style,fe=ae.id,me=ae.animated,Ce=ae.activeKey,Pe=ae.rtl,Ne=ae.extra,at=ae.editable,it=ae.locale,Tt=ae.tabPosition,an=ae.tabBarGutter,bn=ae.children,cn=ae.onTabClick,un=ae.onTabScroll,En=Object(_.useRef)(),mn=Object(_.useRef)(),vn=Object(_.useRef)(),In=Object(_.useRef)(),Sn=Ur(),sr=Object(B.a)(Sn,2),Hn=sr[0],Zt=sr[1],Qt=Tt==="top"||Tt==="bottom",Pn=Lr(0,function(hn,pn){Qt&&un&&un({direction:hn>pn?"left":"right"})}),On=Object(B.a)(Pn,2),Ft=On[0],Nn=On[1],$n=Lr(0,function(hn,pn){!Qt&&un&&un({direction:hn>pn?"top":"bottom"})}),Un=Object(B.a)($n,2),Yn=Un[0],lr=Un[1],Er=Object(_.useState)(0),Dr=Object(B.a)(Er,2),hr=Dr[0],jr=Dr[1],qn=Object(_.useState)(0),yr=Object(B.a)(qn,2),zr=yr[0],gr=yr[1],Ir=Object(_.useState)(0),wr=Object(B.a)(Ir,2),xr=wr[0],da=wr[1],ca=Object(_.useState)(0),pa=Object(B.a)(ca,2),ln=pa[0],Jr=pa[1],ia=Object(_.useState)(null),Jn=Object(B.a)(ia,2),Bn=Jn[0],_r=Jn[1],Ia=Object(_.useState)(null),Ta=Object(B.a)(Ia,2),ha=Ta[0],Na=Ta[1],Sa=Object(_.useState)(0),Oa=Object(B.a)(Sa,2),Wa=Oa[0],wa=Oa[1],_a=Object(_.useState)(0),Ra=Object(B.a)(_a,2),Qa=Ra[0],Ja=Ra[1],Za=C(new Map),ma=Object(B.a)(Za,2),qa=ma[0],ei=ma[1],Pa=l(ee,qa,hr),Ha="".concat(z,"-nav-operations-hidden"),va=0,ya=0;Qt?Pe?(va=0,ya=Math.max(0,hr-Bn)):(va=Math.min(0,Bn-hr),ya=0):(va=Math.min(0,ha-zr),ya=0);function Aa(hn){return hn<va?[va,!1]:hn>ya?[ya,!1]:[hn,!0]}var Da=Object(_.useRef)(),Ua=Object(_.useState)(),Ma=Object(B.a)(Ua,2),ja=Ma[0],za=Ma[1];function Ba(){za(Date.now())}function Fa(){window.clearTimeout(Da.current)}Or(En,function(hn,pn){var wn=!1;function or(Tr,qr){Tr(function(Sr){var oa=Aa(Sr+qr),ka=Object(B.a)(oa,2),ni=ka[0],ri=ka[1];return wn=ri,ni})}if(Qt){if(Bn>=hr)return wn;or(Nn,hn)}else{if(ha>=zr)return wn;or(lr,pn)}return Fa(),Ba(),wn}),Object(_.useEffect)(function(){return Fa(),ja&&(Da.current=window.setTimeout(function(){za(0)},100)),Fa},[ja]);function Ga(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ce,pn=Pa.get(hn);if(!pn)return;if(Qt){var wn=Ft;Pe?pn.right<Ft?wn=pn.right:pn.right+pn.width>Ft+Bn&&(wn=pn.right+pn.width-Bn):pn.left<-Ft?wn=-pn.left:pn.left+pn.width>-Ft+Bn&&(wn=-(pn.left+pn.width-Bn)),lr(0),Nn(Aa(wn)[0])}else{var or=Yn;pn.top<-Yn?or=-pn.top:pn.top+pn.height>-Yn+ha&&(or=-(pn.top+pn.height-ha)),Nn(0),lr(Aa(or)[0])}}var ai=c(Pa,{width:Bn,height:ha,left:Ft,top:Yn},{width:xr,height:ln},{width:Wa,height:Qa},Object(U.a)(Object(U.a)({},ae),{},{tabs:ee})),Va=Object(B.a)(ai,2),Xa=Va[0],ti=Va[1],$a=ee.map(function(hn){var pn=hn.key;return _.createElement(n,{id:fe,prefixCls:z,key:pn,rtl:Pe,tab:hn,closable:hn.closable,editable:at,active:pn===Ce,tabPosition:Tt,tabBarGutter:an,renderWrapper:bn,removeAriaLabel:it==null?void 0:it.removeAriaLabel,ref:Hn(pn),onClick:function(or){cn(pn,or)},onRemove:function(){Zt(pn)},onFocus:function(){Ga(pn),Ba(),Pe||(En.current.scrollLeft=0),En.current.scrollTop=0}})}),La=T(function(){var hn,pn,wn,or,Tr,qr,Sr,oa,ka,ni=((hn=En.current)===null||hn===void 0?void 0:hn.offsetWidth)||0,ri=((pn=En.current)===null||pn===void 0?void 0:pn.offsetHeight)||0,oi=((wn=In.current)===null||wn===void 0?void 0:wn.offsetWidth)||0,si=((or=In.current)===null||or===void 0?void 0:or.offsetHeight)||0,fi=((Tr=vn.current)===null||Tr===void 0?void 0:Tr.offsetWidth)||0,pi=((qr=vn.current)===null||qr===void 0?void 0:qr.offsetHeight)||0;_r(ni),Na(ri),wa(oi),Ja(si);var li=(((Sr=mn.current)===null||Sr===void 0?void 0:Sr.offsetWidth)||0)-oi,ui=(((oa=mn.current)===null||oa===void 0?void 0:oa.offsetHeight)||0)-si;jr(li),gr(ui);var di=(ka=vn.current)===null||ka===void 0?void 0:ka.className.includes(Ha);da(li-(di?0:fi)),Jr(ui-(di?0:pi)),ei(function(){var ci=new Map;return ee.forEach(function(mi){var hi=mi.key,Ka=Hn(hi).current;Ka&&ci.set(hi,{width:Ka.offsetWidth,height:Ka.offsetHeight,left:Ka.offsetLeft,top:Ka.offsetTop})}),ci})}),Ya=ee.slice(0,Xa),ii=ee.slice(ti+1),We=[].concat(Object(P.a)(Ya),Object(P.a)(ii)),Ue=Object(_.useState)(),He=Object(B.a)(Ue,2),Ze=He[0],ct=He[1],Ot=Pa.get(Ce),wt=Object(_.useRef)();function It(){O.a.cancel(wt.current)}Object(_.useEffect)(function(){var hn={};return Ot&&(Qt?(Pe?hn.right=Ot.right:hn.left=Ot.left,hn.width=Ot.width):(hn.top=Ot.top,hn.height=Ot.height)),It(),wt.current=O()(function(){ct(hn)}),It},[Ot,Qt,Pe]),Object(_.useEffect)(function(){Ga()},[Ce,Ot,Pa,Qt]),Object(_.useEffect)(function(){La()},[Pe,an,Ce,ee.map(function(hn){return hn.key}).join("_")]);var Fn=!!We.length,jn="".concat(z,"-nav-wrap"),Gr,An,Br,Zr;return Qt?Pe?(An=Ft>0,Gr=Ft+Bn<hr):(Gr=Ft<0,An=-Ft+Bn<hr):(Br=Yn<0,Zr=-Yn+ha<zr),_.createElement("div",{ref:ye,role:"tablist",className:N()("".concat(z,"-nav"),G),style:ue,onKeyDown:function(){Ba()}},_.createElement(ua,{position:"left",extra:Ne,prefixCls:z}),_.createElement(R.a,{onResize:La},_.createElement("div",{className:N()(jn,(xe={},Object(he.a)(xe,"".concat(jn,"-ping-left"),Gr),Object(he.a)(xe,"".concat(jn,"-ping-right"),An),Object(he.a)(xe,"".concat(jn,"-ping-top"),Br),Object(he.a)(xe,"".concat(jn,"-ping-bottom"),Zr),xe)),ref:En},_.createElement(R.a,{onResize:La},_.createElement("div",{ref:mn,className:"".concat(z,"-nav-list"),style:{transform:"translate(".concat(Ft,"px, ").concat(Yn,"px)"),transition:ja?"none":void 0}},$a,_.createElement(Wn,{ref:In,prefixCls:z,locale:it,editable:at,style:{visibility:Fn?"hidden":null}}),_.createElement("div",{className:N()("".concat(z,"-ink-bar"),Object(he.a)({},"".concat(z,"-ink-bar-animated"),me.inkBar)),style:Ze}))))),_.createElement(mr,Object.assign({},ae,{ref:vn,prefixCls:z,tabs:We,className:!Fn&&Ha})),_.createElement(ua,{position:"right",extra:Ne,prefixCls:z}))}var Hr=_.forwardRef(Wr);function ba(ae){var ye=ae.id,xe=ae.activeKey,le=ae.animated,z=ae.tabPosition,ee=ae.rtl,G=ae.destroyInactiveTabPane,ue=_.useContext(vr),fe=ue.prefixCls,me=ue.tabs,Ce=le.tabPane,Pe=me.findIndex(function(Ne){return Ne.key===xe});return _.createElement("div",{className:N()("".concat(fe,"-content-holder"))},_.createElement("div",{className:N()("".concat(fe,"-content"),"".concat(fe,"-content-").concat(z),Object(he.a)({},"".concat(fe,"-content-animated"),Ce)),style:Pe&&Ce?Object(he.a)({},ee?"marginRight":"marginLeft","-".concat(Pe,"00%")):null},me.map(function(Ne){return _.cloneElement(Ne.node,{key:Ne.key,prefixCls:fe,tabKey:Ne.key,id:ye,animated:Ce,active:Ne.key===xe,destroyInactiveTabPane:G})})))}function Ea(ae){var ye=ae.prefixCls,xe=ae.forceRender,le=ae.className,z=ae.style,ee=ae.id,G=ae.active,ue=ae.animated,fe=ae.destroyInactiveTabPane,me=ae.tabKey,Ce=ae.children,Pe=_.useState(xe),Ne=Object(B.a)(Pe,2),at=Ne[0],it=Ne[1];_.useEffect(function(){G?it(!0):fe&&it(!1)},[G,fe]);var Tt={};return G||(ue?(Tt.visibility="hidden",Tt.height=0,Tt.overflowY="hidden"):Tt.display="none"),_.createElement("div",{id:ee&&"".concat(ee,"-panel-").concat(me),role:"tabpanel",tabIndex:G?0:-1,"aria-labelledby":ee&&"".concat(ee,"-tab-").concat(me),"aria-hidden":!G,style:Object(U.a)(Object(U.a)({},Tt),z),className:N()("".concat(ye,"-tabpane"),G&&"".concat(ye,"-tabpane-active"),le)},(G||at||xe)&&Ce)}var Ca=0;function xa(ae){return Object(I.a)(ae).map(function(ye){if(_.isValidElement(ye)){var xe=ye.key!==void 0?String(ye.key):void 0;return Object(U.a)(Object(U.a)({key:xe},ye.props),{},{node:ye})}return null}).filter(function(ye){return ye})}function cr(ae,ye){var xe,le=ae.id,z=ae.prefixCls,ee=z===void 0?"rc-tabs":z,G=ae.className,ue=ae.children,fe=ae.direction,me=ae.activeKey,Ce=ae.defaultActiveKey,Pe=ae.editable,Ne=ae.animated,at=ae.tabPosition,it=at===void 0?"top":at,Tt=ae.tabBarGutter,an=ae.tabBarStyle,bn=ae.tabBarExtraContent,cn=ae.locale,un=ae.moreIcon,En=ae.moreTransitionName,mn=ae.destroyInactiveTabPane,vn=ae.renderTabBar,In=ae.onChange,Sn=ae.onTabClick,sr=ae.onTabScroll,Hn=Object(w.a)(ae,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Zt=xa(ue),Qt=fe==="rtl",Pn;Ne===!1?Pn={inkBar:!1,tabPane:!1}:Pn=Object(U.a)({inkBar:!0,tabPane:!1},Ne!==!0?Ne:null);var On=Object(_.useState)(!1),Ft=Object(B.a)(On,2),Nn=Ft[0],$n=Ft[1];Object(_.useEffect)(function(){$n(Nr())},[]);var Un=Object(S.a)(function(){var ln;return(ln=Zt[0])===null||ln===void 0?void 0:ln.key},{value:me,defaultValue:Ce}),Yn=Object(B.a)(Un,2),lr=Yn[0],Er=Yn[1],Dr=Object(_.useState)(function(){return Zt.findIndex(function(ln){return ln.key===lr})}),hr=Object(B.a)(Dr,2),jr=hr[0],qn=hr[1];Object(_.useEffect)(function(){var ln=Zt.findIndex(function(ia){return ia.key===lr});if(ln===-1){var Jr;ln=Math.max(0,Math.min(jr,Zt.length-1)),Er((Jr=Zt[ln])===null||Jr===void 0?void 0:Jr.key)}qn(ln)},[Zt.map(function(ln){return ln.key}).join("_"),lr,jr]);var yr=Object(S.a)(null,{value:le}),zr=Object(B.a)(yr,2),gr=zr[0],Ir=zr[1],wr=it;Nn&&!["left","right"].includes(it)&&(wr="top"),Object(_.useEffect)(function(){le||(Ir("rc-tabs-".concat(Ca)),Ca+=1)},[]);function xr(ln,Jr){Sn==null||Sn(ln,Jr),Er(ln),In==null||In(ln)}var da={id:gr,activeKey:lr,animated:Pn,tabPosition:wr,rtl:Qt,mobile:Nn},ca,pa=Object(U.a)(Object(U.a)({},da),{},{editable:Pe,locale:cn,moreIcon:un,moreTransitionName:En,tabBarGutter:Tt,onTabClick:xr,onTabScroll:sr,extra:bn,style:an,panes:ue});return vn?ca=vn(pa,Hr):ca=_.createElement(Hr,Object.assign({},pa)),_.createElement(vr.Provider,{value:{tabs:Zt,prefixCls:ee}},_.createElement("div",Object.assign({ref:ye,id:le,className:N()(ee,"".concat(ee,"-").concat(wr),(xe={},Object(he.a)(xe,"".concat(ee,"-mobile"),Nn),Object(he.a)(xe,"".concat(ee,"-editable"),Pe),Object(he.a)(xe,"".concat(ee,"-rtl"),Qt),xe),G)},Hn),ca,_.createElement(ba,Object.assign({destroyInactiveTabPane:mn},da,{animated:Pn}))))}var Zn=_.forwardRef(cr);Zn.TabPane=Ea;var kr=Zn,Qr=Fe.b=kr},mOS8:function(Ct,Fe,j){Ct.exports=j.p+"static/403Qrcode.6c17b6f4.png"},mgmH:function(Ct,Fe,j){"use strict";j.d(Fe,"d",function(){return R}),j.d(Fe,"b",function(){return T}),j.d(Fe,"e",function(){return C}),j.d(Fe,"c",function(){return b}),j.d(Fe,"n",function(){return m}),j.d(Fe,"g",function(){return n}),j.d(Fe,"h",function(){return s}),j.d(Fe,"j",function(){return y}),j.d(Fe,"a",function(){return c}),j.d(Fe,"l",function(){return o}),j.d(Fe,"f",function(){return v}),j.d(Fe,"k",function(){return f}),j.d(Fe,"m",function(){return i}),j.d(Fe,"i",function(){return r}),j.d(Fe,"o",function(){return t}),j.d(Fe,"r",function(){return a}),j.d(Fe,"q",function(){return g}),j.d(Fe,"p",function(){return h});var he=j("miYZ"),B=j("tsqr"),w=j("k1fw"),U=j("9og8"),_=j("WmNS"),x=j.n(_),N=j("oUNq"),I=j("9kvl"),S=j("1vsH"),P=j("m3rI"),E=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},O=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},R=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return E(),W.next=3,Object(N.s)(Object(w.a)({},A));case 3:if(M=W.sent,!(M.status===0)){W.next=7;break}return W.next=7,Object(S.u)("",Object(S.W)({url:P.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/export_couser_info.json"),query:A}));case 7:O();case 8:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),T=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(N.q)(Object(w.a)({},A));case 2:if(M=W.sent,!(M.status===0)){W.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_member_act_score")),W.next=13;break;case 8:if(!(M.status===-2)){W.next=12;break}return W.abrupt("return",M);case 12:M.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),C=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(N.t)(Object(w.a)({},A));case 2:if(M=W.sent,!(M.status===0)){W.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_score")),W.next=13;break;case 8:if(!(M.status===-2)){W.next=12;break}return W.abrupt("return",M);case 12:M.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_score")));case 13:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),b=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(N.r)(Object(w.a)({},A));case 2:if(M=W.sent,!(M.status===0)){W.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")),W.next=13;break;case 8:if(!(M.status===-2)){W.next=12;break}return W.abrupt("return",M);case 12:M.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),m=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(N.y)(Object(w.a)({},A));case 2:if(M=W.sent,!(M.status===0)){W.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")),W.next=13;break;case 8:if(!(M.status===-2)){W.next=12;break}return W.abrupt("return",M);case 12:M.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),n=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(N.u)(Object(w.a)({},A));case 2:if(M=W.sent,!(M.status===0)){W.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_homework")),W.next=13;break;case 8:if(!(M.status===-2)){W.next=12;break}return W.abrupt("return",M);case 12:M.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),s=function(){var d=Object(U.a)(x.a.mark(function e(A,M){var F;return x.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(N.w)(Object(w.a)({},A));case 2:F=Z.sent,F.status===0?(B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/").concat(M))):F.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/").concat(M)));case 4:case"end":return Z.stop()}},e)}));return function(A,M){return d.apply(this,arguments)}}(),l=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return E(),W.next=3,Object(N.v)(Object(w.a)({},A));case 3:if(M=W.sent,!(M.status===0)){W.next=7;break}return W.next=7,Object(S.u)("",Object(S.W)({url:P.a.API_SERVER+"/api/homework_commons/".concat(A.categoryId,"/works_list.zip"),query:A}));case 7:O();case 8:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),y=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return E(),W.next=3,Object(N.z)(Object(w.a)({},A));case 3:if(M=W.sent,!(M.status===0)){W.next=7;break}return W.next=7,Object(S.u)("",Object(S.W)({url:P.a.API_SERVER+"/api/polls/".concat(A.categoryId,"/commit_result.xlsx"),query:A}));case 7:O();case 8:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),c=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/attendances/export_xlsx_data.xlsx"),query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),o=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/video_study_statics.xlsx"),query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),v=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/export_course_students_info.xlsx"),query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),f=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/item_banks/export.xlsx",query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),i=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),r=function(){var d=Object(U.a)(x.a.mark(function e(A){var M;return x.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(N.x)(Object(w.a)({},A));case 2:M=W.sent,M.status===0?(B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/exercise_score"))):M.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(A.coursesId,"/exportlist/exercise_score")));case 4:case"end":return W.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),t=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),F.next=3,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/export_records/".concat(A.id,".xlsx"),query:A}));case 3:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),a=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),g=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/ec_years/".concat(A==null?void 0:A.ec_year_id,"/ec_training_objectives.xlsx"),query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}(),h=function(){var d=Object(U.a)(x.a.mark(function e(A){return x.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(S.t)("",Object(S.W)({url:P.a.API_SERVER+"/api/ec_years/".concat(A==null?void 0:A.ec_year_id,"/ec_graduation_requirements.xlsx"),query:A}));case 2:case"end":return F.stop()}},e)}));return function(A){return d.apply(this,arguments)}}()},n6Qo:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return I});var he=j("q1tI"),B=j("biw7"),w=j("fyJ8");function U(S){var P=S.className,E=S.index,O=S.children,R=S.colSpan,T=S.rowSpan,C=he.useContext(B.a),b=C.prefixCls,m=C.fixedInfoList,n=m[E];return he.createElement(w.a,Object.assign({className:P,index:E,component:"td",prefixCls:b,record:null,dataIndex:null,render:function(){return{children:O,props:{colSpan:R,rowSpan:T}}}},n))}function _(S){return he.createElement("tr",Object.assign({},S))}function x(S){var P=S.children,E=he.useContext(B.a),O=E.prefixCls;return he.createElement("tfoot",{className:"".concat(O,"-summary")},P)}var N=Fe.b=x,I={Cell:U,Row:_}},nSDg:function(Ct,Fe,j){Ct.exports={flex_box_center:"flex_box_center___2lqeg",flex_space_between:"flex_space_between___RuZ2s",flex_box_vertical_center:"flex_box_vertical_center___2AGHP",flex_box_center_end:"flex_box_center_end___FDazu",flex_box_column:"flex_box_column___1Yqjx",wrp:"wrp____lZAZ",drawer:"drawer___2XpEN",menu:"menu___fZQrG",actived:"actived___1Yg9q",actived2:"actived2___2KHN5",subTag:"subTag___3AbgU",directionName:"directionName___2Xp-L",menuDirection:"menuDirection___1ZMmo",listItem:"listItem___g9W0X",info:"info___1FHWU",title:"title___1VzwI",titleLeft:"titleLeft___yvqaz",titleRight:"titleRight___2Dqm5",search:"search___3pcQt",description:"description___3yQGh",menuCourse:"menuCourse___3iBFc",paginationWrap:"paginationWrap___KxpDN"}},p5ED:function(Ct,Fe,j){"use strict";var he=j("+L6B"),B=j("2/Rp"),w=j("5Dmo"),U=j("3S7+"),_=j("k1fw"),x=j("9og8"),N=j("tJVT"),I=j("WmNS"),S=j.n(I),P=j("q1tI"),E=j.n(P),O=j("vHTk"),R=j.n(O),T=j("yEEn"),C=j("ZW9T"),b=j("1vsH"),m=j("V0Rq"),n=j("m3rI"),s=function(y){var c=y.name,o=y.data,v=y.theme,f=y.type,i=y.filename,r=y.monacoEditor,t=y.className,a=y.style,g=y.close,h=y.onClose,d=y.hasMask,e=y.otherData,A=e===void 0?{}:e,M=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),F=Object(N.a)(M,2),W=F[0],Z=F[1],K=Object(P.useState)(""),J=Object(N.a)(K,2),oe=J[0],se=J[1],pe=Object(P.useState)(),be=Object(N.a)(pe,2),Q=be[0],te=be[1],ve,q=1024*1024,X=10*q,Te=Object(P.useRef)();f==="office"&&(ve=Object(b.R)(o).filesize,ve>X&&(f="other")),i&&(r.filename=i),Object(P.useEffect)(function(){var Me,Se,Le=(Me=document.cookie)===null||Me===void 0||((Se=Me.replace(/\s/g,""))===null||Se===void 0)?void 0:Se.split(";");Le==null||Le.map(function(Ve){var $e=Ve.split("=");$e[0]==="_educoder_session"&&se($e[1])})},[]),Object(P.useEffect)(function(){f==="office"&&Ie()},[f]);var Ie=function(){var Me=Object(x.a)(S.a.mark(function Se(){var Le,Ve,$e;return S.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return console.log("data:",o),Le=o,o.startsWith("http")||(Le=location.origin+Le),Ve=new URL(Le).pathname.split("/").pop(),Be.next=6,Object(m.U)({attachment_id:Ve});case 6:$e=Be.sent,te($e);case 8:case"end":return Be.stop()}},Se)}));return function(){return Me.apply(this,arguments)}}(),Ge=function(){if(o.startsWith("http")||o.startsWith("blob:")){Ae();return}Object(b.x)(i||"educoder",o,i)},Ae=function(){Object(b.v)(i||"educoder",decodeURIComponent(o))};return E.a.createElement("div",{style:Object(_.a)({},a||{}),className:"".concat(d&&R.a.bgBlack," ").concat(f?R.a.wrp:"hide")},g&&E.a.createElement("div",{className:R.a.close,ref:Te},E.a.createElement(U.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Te.current}},E.a.createElement("span",{onClick:Ae},E.a.createElement("i",{className:"icon-quxiaozhiding"}))),E.a.createElement(U.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Te.current}},E.a.createElement("span",{className:"",onClick:function(){h(),te(null)}},E.a.createElement("i",{className:"icon-guanbi1"})))),E.a.createElement("div",{className:"".concat(R.a[t]," ").concat(t," ").concat(R.a.monaco," ").concat(f==="txt"?"show":"hide")},f==="txt"&&E.a.createElement(C.b,r)),f==="audio"&&E.a.createElement("audio",{src:"".concat((o==null?void 0:o.indexOf("http://"))>-1||(o==null?void 0:o.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(o),autoPlay:!0}),f==="video"&&E.a.createElement(E.a.Fragment,null,(o==null?void 0:o.indexOf("http"))>-1?E.a.createElement("video",{controls:!0,src:"".concat(o),autoPlay:!0}):E.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(o),autoPlay:!0})),f==="office"&&Q&&E.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Q.key,"&url=").concat(n.a.API_SERVER+Q.url,"&callbackUrl=").concat(n.a.API_SERVER+Q.callbackUrl,"&fileType=").concat(Q.fileType,"&title=").concat(Q.title,"&model=view")}),(f==="xlsx"||f==="doc"||f==="pptx"||f==="docx")&&E.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(A.key,"&url=").concat(n.a.API_SERVER+A.url,"&callbackUrl=").concat(n.a.API_SERVER+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(A.model)}),f==="html"&&E.a.createElement("iframe",{src:o+"&disposition=inline"}),f==="pdf"&&E.a.createElement("embed",{className:R.a.embed,src:o,type:"application/pdf"}),f==="image"&&E.a.createElement("img",{src:"".concat((o==null?void 0:o.indexOf("http://"))>-1||(o==null?void 0:o.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(o)}),f==="other"&&E.a.createElement("div",null,E.a.createElement(B.a,{type:"primary",size:"large",onClick:Ge},E.a.createElement(T.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),f==="download"&&E.a.createElement(B.a,{type:"primary",size:"large",onClick:Ge},E.a.createElement(T.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Fe.a=s},"rAM+":function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return B});var he=j("Qw5x");function B(w,U){var _;if(typeof Symbol=="undefined"||w[Symbol.iterator]==null){if(Array.isArray(w)||(_=Object(he.a)(w))||U&&w&&typeof w.length=="number"){_&&(w=_);var x=0,N=function(){};return{s:N,n:function(){return x>=w.length?{done:!0}:{done:!1,value:w[x++]}},e:function(O){throw O},f:N}}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,S=!1,P;return{s:function(){_=w[Symbol.iterator]()},n:function(){var O=_.next();return I=O.done,O},e:function(O){S=!0,P=O},f:function(){try{!I&&_.return!=null&&_.return()}finally{if(S)throw P}}}}},rCGY:function(Ct,Fe,j){Ct.exports={groupWrap:"groupWrap___3dz2S",directionItem:"directionItem___2Jxzl",active:"active___2GpP3",directionContentWrap:"directionContentWrap___1_SmE",minWidth43:"minWidth43___32DTk",minWidth73:"minWidth73___e9DAK",minWidth60:"minWidth60___cP-g2",delete:"delete___1fhs4"}},rUJ1:function(Ct,Fe){const j=/[&<>"']/,he=/[&<>"']/g,B=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,U={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_=f=>U[f];function x(f,i){if(i){if(j.test(f))return f.replace(he,_)}else if(B.test(f))return f.replace(w,_);return f}const N=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(f){return f.replace(N,(i,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const S=/(^|[^\[])\^/g;function P(f,i){f=f.source||f,i=i||"";const r={replace:(t,a)=>(a=a.source||a,a=a.replace(S,"$1"),f=f.replace(t,a),r),getRegex:()=>new RegExp(f,i)};return r}const E=/[^\w:]/g,O=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(f,i,r){if(f){let t;try{t=decodeURIComponent(I(r)).replace(E,"").toLowerCase()}catch(a){return null}if(t.indexOf("javascript:")===0||t.indexOf("vbscript:")===0||t.indexOf("data:")===0)return null}i&&!O.test(r)&&(r=n(i,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch(t){return null}return r}const T={},C=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(f,i){T[" "+f]||(C.test(f)?T[" "+f]=f+"/":T[" "+f]=c(f,"/",!0)),f=T[" "+f];const r=f.indexOf(":")===-1;return i.substring(0,2)==="//"?r?i:f.replace(b,"$1")+i:i.charAt(0)==="/"?r?i:f.replace(m,"$1")+i:f+i}const s={exec:function(){}};function l(f){let i=1,r,t;for(;i<arguments.length;i++){r=arguments[i];for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&(f[t]=r[t])}return f}function y(f,i){const r=f.replace(/\|/g,(g,h,d)=>{let e=!1,A=h;for(;--A>=0&&d[A]==="\\";)e=!e;return e?"|":" |"}),t=r.split(/ \|/);let a=0;if(t.length>i)t.splice(i);else for(;t.length<i;)t.push("");for(;a<t.length;a++)t[a]=t[a].trim().replace(/\\\|/g,"|");return t}function c(f,i,r){const t=f.length;if(t===0)return"";let a=0;for(;a<t;){const g=f.charAt(t-a-1);if(g===i&&!r)a++;else if(g!==i&&r)a++;else break}return f.substr(0,t-a)}function o(f,i){if(f.indexOf(i[1])===-1)return-1;const r=f.length;let t=0,a=0;for(;a<r;a++)if(f[a]==="\\")a++;else if(f[a]===i[0])t++;else if(f[a]===i[1]&&(t--,t<0))return a;return-1}function v(f){f&&f.sanitize&&!f.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")}Ct.exports={escape:x,unescape:I,edit:P,cleanUrl:R,resolveUrl:n,noopTest:s,merge:l,splitCells:y,rtrim:c,findClosingBracket:o,checkSanitizeDeprecation:v}},sR1s:function(Ct,Fe,j){"use strict";j.d(Fe,"b",function(){return U}),j.d(Fe,"a",function(){return _}),j.d(Fe,"c",function(){return x}),j.d(Fe,"d",function(){return N});var he=j("U8pU"),B="RC_TABLE_KEY";function w(I){return I==null?[]:Array.isArray(I)?I:[I]}function U(I,S){if(!S&&typeof S!="number")return I;for(var P=w(S),E=I,O=0;O<P.length;O+=1){if(!E)return null;var R=P[O];E=E[R]}return E}function _(I){var S=[],P={};return I.forEach(function(E){for(var O=E||{},R=O.key,T=O.dataIndex,C=R||w(T).join("-")||B;P[C];)C="".concat(C,"_next");P[C]=!0,S.push(C)}),S}function x(){var I={};function S(R,T){T&&Object.keys(T).forEach(function(C){var b=T[C];b&&Object(he.a)(b)==="object"?(R[C]=R[C]||{},S(R[C],b)):R[C]=b})}for(var P=arguments.length,E=new Array(P),O=0;O<P;O++)E[O]=arguments[O];return E.forEach(function(R){S(I,R)}),I}function N(I){return I!=null}},sboe:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return w});var he=j("q1tI"),B=j.n(he),w=he.createContext(null)},spXi:function(Ct,Fe,j){Ct.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(Ct,Fe,j){"use strict";var he=j("VTBJ"),B=j("1OyB"),w=j("vuIU"),U=j("Ji7U"),_=j("LK+K"),x=j("q1tI"),N=j.n(x),I=j("m+aA"),S=j("Zm9Q"),P=j("Kwbf"),E=j("c+Xe"),O=j("bdgK"),R="rc-observer-key",T=function(C){Object(U.a)(m,C);var b=Object(_.a)(m);function m(){var n;return Object(B.a)(this,m),n=b.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(s){var l=n.props.onResize,y=s[0].target,c=y.getBoundingClientRect(),o=c.width,v=c.height,f=y.offsetWidth,i=y.offsetHeight,r=Math.floor(o),t=Math.floor(v);if(n.state.width!==r||n.state.height!==t||n.state.offsetWidth!==f||n.state.offsetHeight!==i){var a={width:r,height:t,offsetWidth:f,offsetHeight:i};n.setState(a),l&&Promise.resolve().then(function(){l(Object(he.a)(Object(he.a)({},a),{},{offsetWidth:f,offsetHeight:i}))})}},n.setChildNode=function(s){n.childNode=s},n}return Object(w.a)(m,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var s=this.props.disabled;if(s){this.destroyObserver();return}var l=Object(I.a)(this.childNode||this),y=l!==this.currentElement;y&&(this.destroyObserver(),this.currentElement=l),!this.resizeObserver&&l&&(this.resizeObserver=new O.default(this.onResize),this.resizeObserver.observe(l))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,l=Object(S.a)(s);if(l.length>1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(l.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var y=l[0];if(x.isValidElement(y)&&Object(E.c)(y)){var c=y.ref;l[0]=x.cloneElement(y,{ref:Object(E.a)(c,this.setChildNode)})}return l.length===1?l[0]:l.map(function(o,v){return!x.isValidElement(o)||"key"in o&&o.key!==null?o:x.cloneElement(o,{key:"".concat(R,"-").concat(v)})})}}]),m}(x.Component);T.displayName="ResizeObserver",Fe.a=T},tK3L:function(Ct,Fe,j){Ct.exports={flex_box_center:"flex_box_center___3uV00",flex_space_between:"flex_space_between___253zc",flex_box_vertical_center:"flex_box_vertical_center___3Nn4F",flex_box_center_end:"flex_box_center_end___3N00E",flex_box_column:"flex_box_column___wngbD",wrap:"wrap___1vIxE",title:"title___3EB7K",select:"select___3yoep",contentWrap:"contentWrap___2vBaG",tabsWrap:"tabsWrap___35WZr",searchWrap:"searchWrap___3zxJK",searchContent:"searchContent___1fqwB",search:"search___Qt6zp",batchWrap:"batchWrap___1QFBy",customTable:"customTable___4pmq7",row:"row___mgwpl",contentListWrap:"contentListWrap___sfO91",li:"li___2kFZ7",top:"top___2xOLA",bottom:"bottom___1-hPm",line:"line___2PBOX",actionLeftItem:"actionLeftItem___3mz5t",more:"more___Oo-pR",btnAdd:"btnAdd___3ROdW",btnCancel:"btnCancel___2N_Gt",cancelC:"cancelC___3SmK1",addC:"addC___3VFkF",actonBtn:"actonBtn___3j8EO",batch:"batch___1YJ8c",btns:"btns___33g-Q",btn:"btn___3yAUt",treeWarp:"treeWarp___27_L-",action:"action___2Ys8R"}},ulZh:function(Ct,Fe,j){typeof window!="undefined"&&function(B,w){Ct.exports=w()}(this,function(){return function(he){var B={};function w(U){if(B[U])return B[U].exports;var _=B[U]={i:U,l:!1,exports:{}};return he[U].call(_.exports,_,_.exports,w),_.l=!0,_.exports}return w.m=he,w.c=B,w.d=function(U,_,x){w.o(U,_)||Object.defineProperty(U,_,{enumerable:!0,get:x})},w.r=function(U){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(U,"__esModule",{value:!0})},w.t=function(U,_){if(_&1&&(U=w(U)),_&8)return U;if(_&4&&typeof U=="object"&&U&&U.__esModule)return U;var x=Object.create(null);if(w.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:U}),_&2&&typeof U!="string")for(var N in U)w.d(x,N,function(I){return U[I]}.bind(null,N));return x},w.n=function(U){var _=U&&U.__esModule?function(){return U.default}:function(){return U};return w.d(_,"a",_),_},w.o=function(U,_){return Object.prototype.hasOwnProperty.call(U,_)},w.p="/dist/",w(w.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(he,B,w){"use strict";var U=Object.prototype.hasOwnProperty,_="~";function x(){}Object.create&&(x.prototype=Object.create(null),new x().__proto__||(_=!1));function N(E,O,R){this.fn=E,this.context=O,this.once=R||!1}function I(E,O,R,T,C){if(typeof R!="function")throw new TypeError("The listener must be a function");var b=new N(R,T||E,C),m=_?_+O:O;return E._events[m]?E._events[m].fn?E._events[m]=[E._events[m],b]:E._events[m].push(b):(E._events[m]=b,E._eventsCount++),E}function S(E,O){--E._eventsCount===0?E._events=new x:delete E._events[O]}function P(){this._events=new x,this._eventsCount=0}P.prototype.eventNames=function(){var O=[],R,T;if(this._eventsCount===0)return O;for(T in R=this._events)U.call(R,T)&&O.push(_?T.slice(1):T);return Object.getOwnPropertySymbols?O.concat(Object.getOwnPropertySymbols(R)):O},P.prototype.listeners=function(O){var R=_?_+O:O,T=this._events[R];if(!T)return[];if(T.fn)return[T.fn];for(var C=0,b=T.length,m=new Array(b);C<b;C++)m[C]=T[C].fn;return m},P.prototype.listenerCount=function(O){var R=_?_+O:O,T=this._events[R];return T?T.fn?1:T.length:0},P.prototype.emit=function(O,R,T,C,b,m){var n=_?_+O:O;if(!this._events[n])return!1;var s=this._events[n],l=arguments.length,y,c;if(s.fn){s.once&&this.removeListener(O,s.fn,void 0,!0);switch(l){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,R),!0;case 3:return s.fn.call(s.context,R,T),!0;case 4:return s.fn.call(s.context,R,T,C),!0;case 5:return s.fn.call(s.context,R,T,C,b),!0;case 6:return s.fn.call(s.context,R,T,C,b,m),!0}for(c=1,y=new Array(l-1);c<l;c++)y[c-1]=arguments[c];s.fn.apply(s.context,y)}else{var o=s.length,v;for(c=0;c<o;c++){s[c].once&&this.removeListener(O,s[c].fn,void 0,!0);switch(l){case 1:s[c].fn.call(s[c].context);break;case 2:s[c].fn.call(s[c].context,R);break;case 3:s[c].fn.call(s[c].context,R,T);break;case 4:s[c].fn.call(s[c].context,R,T,C);break;default:if(!y)for(v=1,y=new Array(l-1);v<l;v++)y[v-1]=arguments[v];s[c].fn.apply(s[c].context,y)}}}return!0},P.prototype.on=function(O,R,T){return I(this,O,R,T,!1)},P.prototype.once=function(O,R,T){return I(this,O,R,T,!0)},P.prototype.removeListener=function(O,R,T,C){var b=_?_+O:O;if(!this._events[b])return this;if(!R)return S(this,b),this;var m=this._events[b];if(m.fn)m.fn===R&&(!C||m.once)&&(!T||m.context===T)&&S(this,b);else{for(var n=0,s=[],l=m.length;n<l;n++)(m[n].fn!==R||C&&!m[n].once||T&&m[n].context!==T)&&s.push(m[n]);s.length?this._events[b]=s.length===1?s[0]:s:S(this,b)}return this},P.prototype.removeAllListeners=function(O){var R;return O?(R=_?_+O:O,this._events[R]&&S(this,R)):(this._events=new x,this._eventsCount=0),this},P.prototype.off=P.prototype.removeListener,P.prototype.addListener=P.prototype.on,P.prefixed=_,P.EventEmitter=P,he.exports=P},"./node_modules/url-toolkit/src/url-toolkit.js":function(he,B,w){(function(U){var _=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,x=/^([^\/?#]*)([^]*)$/,N=/(?:\/|^)\.(?=\/)/g,I=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,S={buildAbsoluteURL:function(P,E,O){if(O=O||{},P=P.trim(),E=E.trim(),!E){if(!O.alwaysNormalize)return P;var R=S.parseURL(P);if(!R)throw new Error("Error trying to parse base URL.");return R.path=S.normalizePath(R.path),S.buildURLFromParts(R)}var T=S.parseURL(E);if(!T)throw new Error("Error trying to parse relative URL.");if(T.scheme)return O.alwaysNormalize?(T.path=S.normalizePath(T.path),S.buildURLFromParts(T)):E;var C=S.parseURL(P);if(!C)throw new Error("Error trying to parse base URL.");if(!C.netLoc&&C.path&&C.path[0]!=="/"){var b=x.exec(C.path);C.netLoc=b[1],C.path=b[2]}C.netLoc&&!C.path&&(C.path="/");var m={scheme:C.scheme,netLoc:T.netLoc,path:null,params:T.params,query:T.query,fragment:T.fragment};if(!T.netLoc&&(m.netLoc=C.netLoc,T.path[0]!=="/"))if(!T.path)m.path=C.path,T.params||(m.params=C.params,T.query||(m.query=C.query));else{var n=C.path,s=n.substring(0,n.lastIndexOf("/")+1)+T.path;m.path=S.normalizePath(s)}return m.path===null&&(m.path=O.alwaysNormalize?S.normalizePath(T.path):T.path),S.buildURLFromParts(m)},parseURL:function(P){var E=_.exec(P);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(P){for(P=P.split("").reverse().join("").replace(N,"");P.length!==(P=P.replace(I,"")).length;);return P.split("").reverse().join("")},buildURLFromParts:function(P){return P.scheme+P.netLoc+P.path+P.params+P.query+P.fragment}};he.exports=S})(this)},"./node_modules/webworkify-webpack/index.js":function(he,B,w){function U(O){var R={};function T(b){if(R[b])return R[b].exports;var m=R[b]={i:b,l:!1,exports:{}};return O[b].call(m.exports,m,m.exports,T),m.l=!0,m.exports}T.m=O,T.c=R,T.i=function(b){return b},T.d=function(b,m,n){T.o(b,m)||Object.defineProperty(b,m,{configurable:!1,enumerable:!0,get:n})},T.r=function(b){Object.defineProperty(b,"__esModule",{value:!0})},T.n=function(b){var m=b&&b.__esModule?function(){return b.default}:function(){return b};return T.d(m,"a",m),m},T.o=function(b,m){return Object.prototype.hasOwnProperty.call(b,m)},T.p="/",T.oe=function(b){throw console.error(b),b};var C=T(T.s=ENTRY_MODULE);return C.default||C}var _="[\\.|\\-|\\+|\\w|/|@]+",x="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+_+").*?\\)";function N(O){return(O+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function I(O){return!isNaN(1*O)}function S(O,R,T){var C={};C[T]=[];var b=R.toString(),m=b.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return C;for(var n=m[1],s=new RegExp("(\\\\n|\\W)"+N(n)+x,"g"),l;l=s.exec(b);){if(l[3]==="dll-reference")continue;C[T].push(l[3])}for(s=new RegExp("\\("+N(n)+'\\("(dll-reference\\s('+_+'))"\\)\\)'+x,"g");l=s.exec(b);)O[l[2]]||(C[T].push(l[1]),O[l[2]]=w(l[1]).m),C[l[2]]=C[l[2]]||[],C[l[2]].push(l[4]);for(var y=Object.keys(C),c=0;c<y.length;c++)for(var o=0;o<C[y[c]].length;o++)I(C[y[c]][o])&&(C[y[c]][o]=1*C[y[c]][o]);return C}function P(O){var R=Object.keys(O);return R.reduce(function(T,C){return T||O[C].length>0},!1)}function E(O,R){for(var T={main:[R]},C={main:[]},b={main:{}};P(T);)for(var m=Object.keys(T),n=0;n<m.length;n++){var s=m[n],l=T[s],y=l.pop();if(b[s]=b[s]||{},b[s][y]||!O[s][y])continue;b[s][y]=!0,C[s]=C[s]||[],C[s].push(y);for(var c=S(O,O[s][y],s),o=Object.keys(c),v=0;v<o.length;v++)T[o[v]]=T[o[v]]||[],T[o[v]]=T[o[v]].concat(c[o[v]])}return C}he.exports=function(O,R){R=R||{};var T={main:w.m},C=R.all?{main:Object.keys(T.main)}:E(T,O),b="";Object.keys(C).filter(function(y){return y!=="main"}).forEach(function(y){for(var c=0;C[y][c];)c++;C[y].push(c),T[y][c]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",b=b+"var "+y+" = ("+U.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+C[y].map(function(o){return""+JSON.stringify(o)+": "+T[y][o].toString()}).join(",")+`});
`}),b=b+"new (("+U.toString().replace("ENTRY_MODULE",JSON.stringify(O))+")({"+C.main.map(function(y){return""+JSON.stringify(y)+": "+T.main[y].toString()}).join(",")+"}))(self);";var m=new window.Blob([b],{type:"text/javascript"});if(R.bare)return m;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,s=n.createObjectURL(m),l=new window.Worker(s);return l.objectURL=s,l}},"./src/config.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"hlsDefaultConfig",function(){return v}),w.d(B,"mergeConfig",function(){return i}),w.d(B,"enableStreamingMode",function(){return r});var U=w("./src/controller/abr-controller.ts"),_=w("./src/controller/audio-stream-controller.ts"),x=w("./src/controller/audio-track-controller.ts"),N=w("./src/controller/subtitle-stream-controller.ts"),I=w("./src/controller/subtitle-track-controller.ts"),S=w("./src/controller/buffer-controller.ts"),P=w("./src/controller/timeline-controller.ts"),E=w("./src/controller/cap-level-controller.ts"),O=w("./src/controller/fps-controller.ts"),R=w("./src/controller/eme-controller.ts"),T=w("./src/controller/cmcd-controller.ts"),C=w("./src/utils/xhr-loader.ts"),b=w("./src/utils/fetch-loader.ts"),m=w("./src/utils/cues.ts"),n=w("./src/utils/mediakeys-helper.ts"),s=w("./src/utils/logger.ts");function l(){return l=Object.assign||function(t){for(var a=1;a<arguments.length;a++){var g=arguments[a];for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(t[h]=g[h])}return t},l.apply(this,arguments)}function y(t,a){var g=Object.keys(t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(t);a&&(h=h.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),g.push.apply(g,h)}return g}function c(t){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?y(Object(g),!0).forEach(function(h){o(t,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(g)):y(Object(g)).forEach(function(h){Object.defineProperty(t,h,Object.getOwnPropertyDescriptor(g,h))})}return t}function o(t,a,g){return a in t?Object.defineProperty(t,a,{value:g,enumerable:!0,configurable:!0,writable:!0}):t[a]=g,t}var v=c(c({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:C.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:U.default,bufferController:S.default,capLevelController:E.default,fpsController:O.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:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},f()),{},{subtitleStreamController:N.SubtitleStreamController,subtitleTrackController:I.default,timelineController:P.TimelineController,audioStreamController:_.default,audioTrackController:x.default,emeController:R.default,cmcdController:T.default});function f(){return{cueHandler:m.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 i(t,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return l({},t,a)}function r(t){var a=t.loader;if(a!==b.default&&a!==C.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1;else{var g=Object(b.fetchSupported)();g&&(t.loader=b.default,t.progressive=!0,t.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/polyfills/number.ts"),_=w("./src/utils/ewma-bandwidth-estimator.ts"),x=w("./src/events.ts"),N=w("./src/utils/buffer-helper.ts"),I=w("./src/errors.ts"),S=w("./src/types/loader.ts"),P=w("./src/utils/logger.ts");function E(T,C){for(var b=0;b<C.length;b++){var m=C[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function O(T,C,b){return C&&E(T.prototype,C),b&&E(T,b),T}var R=function(){function T(b){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=b;var m=b.config;this.bwEstimator=new _.default(m.abrEwmaSlowVoD,m.abrEwmaFastVoD,m.abrEwmaDefaultEstimate),this.registerListeners()}var C=T.prototype;return C.registerListeners=function(){var m=this.hls;m.on(x.Events.FRAG_LOADING,this.onFragLoading,this),m.on(x.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(x.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(x.Events.ERROR,this.onError,this)},C.unregisterListeners=function(){var m=this.hls;m.off(x.Events.FRAG_LOADING,this.onFragLoading,this),m.off(x.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(x.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(x.Events.ERROR,this.onError,this)},C.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},C.onFragLoading=function(m,n){var s=n.frag;if(s.type===S.PlaylistLevelType.MAIN&&!this.timer){var l;this.fragCurrent=s,this.partCurrent=(l=n.part)!=null?l:null,this.timer=self.setInterval(this.onCheck,100)}},C.onLevelLoaded=function(m,n){var s=this.hls.config;n.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},C._abandonRulesCheck=function(){var m=this.fragCurrent,n=this.partCurrent,s=this.hls,l=s.autoLevelEnabled,y=s.config,c=s.media;if(!m||!c)return;var o=n?n.stats:m.stats,v=n?n.duration:m.duration;if(o.aborted){P.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!l||c.paused||!c.playbackRate||!c.readyState)return;var f=performance.now()-o.loading.start,i=Math.abs(c.playbackRate);if(f<=500*v/i)return;var r=s.levels,t=s.minAutoLevel,a=r[m.level],g=o.total||Math.max(o.loaded,Math.round(v*a.maxBitrate/8)),h=Math.max(1,o.bwEstimate?o.bwEstimate/8:o.loaded*1e3/f),d=(g-o.loaded)/h,e=c.currentTime,A=(N.BufferHelper.bufferInfo(c,e,y.maxBufferHole).end-e)/i;if(A>=2*v/i||d<=A)return;var M=Number.POSITIVE_INFINITY,F;for(F=m.level-1;F>t;F--){var W=r[F].maxBitrate;if(M=v*W/(8*.8*h),M<A)break}if(M>=d)return;var Z=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+m.sn+(n?" part "+n.index:"")+" of level "+m.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+`
Current BW estimate: `+(Object(U.isFiniteNumber)(Z)?(Z/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+d.toFixed(3)+` s
Estimated load time for the next fragment: `+M.toFixed(3)+` s
Time to underbuffer: `+A.toFixed(3)+" s"),s.nextLoadLevel=F,this.bwEstimator.sample(f,o.loaded),this.clearTimer(),m.loader&&(this.fragCurrent=this.partCurrent=null,m.loader.abort()),s.trigger(x.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:m,part:n,stats:o})},C.onFragLoaded=function(m,n){var s=n.frag,l=n.part;if(s.type===S.PlaylistLevelType.MAIN&&Object(U.isFiniteNumber)(s.sn)){var y=l?l.stats:s.stats,c=l?l.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var o=this.hls.levels[s.level],v=(o.loaded?o.loaded.bytes:0)+y.loaded,f=(o.loaded?o.loaded.duration:0)+c;o.loaded={bytes:v,duration:f},o.realBitrate=Math.round(8*v/f)}if(s.bitrateTest){var i={stats:y,frag:s,part:l,id:s.type};this.onFragBuffered(x.Events.FRAG_BUFFERED,i),s.bitrateTest=!1}}},C.onFragBuffered=function(m,n){var s=n.frag,l=n.part,y=l?l.stats:s.stats;if(y.aborted)return;if(s.type!==S.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var c=y.parsing.end-y.loading.start;this.bwEstimator.sample(c,y.loaded),y.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=c/1e3:this.bitrateTestDelay=0},C.onError=function(m,n){switch(n.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},C.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},C.getNextABRAutoLevel=function(){var m=this.fragCurrent,n=this.partCurrent,s=this.hls,l=s.maxAutoLevel,y=s.config,c=s.minAutoLevel,o=s.media,v=n?n.duration:m?m.duration:0,f=o?o.currentTime:0,i=o&&o.playbackRate!==0?Math.abs(o.playbackRate):1,r=this.bwEstimator?this.bwEstimator.getEstimate():y.abrEwmaDefaultEstimate,t=(N.BufferHelper.bufferInfo(o,f,y.maxBufferHole).end-f)/i,a=this.findBestLevel(r,c,l,t,y.abrBandWidthFactor,y.abrBandWidthUpFactor);if(a>=0)return a;P.logger.trace((t?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=v?Math.min(v,y.maxStarvationDelay):y.maxStarvationDelay,h=y.abrBandWidthFactor,d=y.abrBandWidthUpFactor;if(!t){var e=this.bitrateTestDelay;if(e){var A=v?Math.min(v,y.maxLoadingDelay):y.maxLoadingDelay;g=A-e,P.logger.trace("bitrate test took "+Math.round(1e3*e)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),h=d=1}}return a=this.findBestLevel(r,c,l,t+g,h,d),Math.max(a,0)},C.findBestLevel=function(m,n,s,l,y,c){for(var o,v=this.fragCurrent,f=this.partCurrent,i=this.lastLoadedFragLevel,r=this.hls.levels,t=r[i],a=!!(t!=null&&(o=t.details)!==null&&o!==void 0&&o.live),g=t==null?void 0:t.codecSet,h=f?f.duration:v?v.duration:0,d=s;d>=n;d--){var e=r[d];if(!e||g&&e.codecSet!==g)continue;var A=e.details,M=(f?A==null?void 0:A.partTarget:A==null?void 0:A.averagetargetduration)||h,F=void 0;d<=i?F=y*m:F=c*m;var W=r[d].maxBitrate,Z=W*M/F;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(F)+"/"+W+"/"+M+"/"+l+"/"+Z),F>W&&(!Z||a&&!this.bitrateTestDelay||Z<l))return d}return-1},O(T,[{key:"nextAutoLevel",get:function(){var m=this._nextAutoLevel,n=this.bwEstimator;if(m!==-1&&(!n||!n.canEstimate()))return m;var s=this.getNextABRAutoLevel();return m!==-1&&(s=Math.min(m,s)),s},set:function(m){this._nextAutoLevel=m}}]),T}();B.default=R},"./src/controller/audio-stream-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/polyfills/number.ts"),_=w("./src/controller/base-stream-controller.ts"),x=w("./src/events.ts"),N=w("./src/utils/buffer-helper.ts"),I=w("./src/controller/fragment-tracker.ts"),S=w("./src/types/level.ts"),P=w("./src/types/loader.ts"),E=w("./src/loader/fragment.ts"),O=w("./src/demux/chunk-cache.ts"),R=w("./src/demux/transmuxer-interface.ts"),T=w("./src/types/transmuxer.ts"),C=w("./src/controller/fragment-finders.ts"),b=w("./src/utils/discontinuities.ts"),m=w("./src/errors.ts"),n=w("./src/utils/logger.ts");function s(){return s=Object.assign||function(v){for(var f=1;f<arguments.length;f++){var i=arguments[f];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(v[r]=i[r])}return v},s.apply(this,arguments)}function l(v,f){v.prototype=Object.create(f.prototype),v.prototype.constructor=v,y(v,f)}function y(v,f){return y=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r},y(v,f)}var c=100,o=function(v){l(f,v);function f(r,t){var a;return a=v.call(this,r,t,"[audio-stream-controller]")||this,a.videoBuffer=null,a.videoTrackCC=-1,a.waitingVideoCC=-1,a.audioSwitch=!1,a.trackId=-1,a.waitingData=null,a.mainDetails=null,a.bufferFlushed=!1,a._registerListeners(),a}var i=f.prototype;return i.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},i._registerListeners=function(){var t=this.hls;t.on(x.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(x.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(x.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(x.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(x.Events.ERROR,this.onError,this),t.on(x.Events.BUFFER_RESET,this.onBufferReset,this),t.on(x.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(x.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(x.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(x.Events.FRAG_BUFFERED,this.onFragBuffered,this)},i._unregisterListeners=function(){var t=this.hls;t.off(x.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(x.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(x.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(x.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(x.Events.ERROR,this.onError,this),t.off(x.Events.BUFFER_RESET,this.onBufferReset,this),t.off(x.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(x.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(x.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(x.Events.FRAG_BUFFERED,this.onFragBuffered,this)},i.onInitPtsFound=function(t,a){var g=a.frag,h=a.id,d=a.initPTS;if(h==="main"){var e=g.cc;this.initPTS[g.cc]=d,this.log("InitPTS for cc: "+e+" found from main: "+d),this.videoTrackCC=e,this.state===_.State.WAITING_INIT_PTS&&this.tick()}},i.startLoad=function(t){if(!this.levels){this.startPosition=t,this.state=_.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(c),this.fragLoadError=0,a>0&&t===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=_.State.IDLE):(this.loadedmetadata=!1,this.state=_.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},i.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_TRACK:{var t,a=this.levels,g=this.trackId,h=a==null||((t=a[g])===null||t===void 0)?void 0:t.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=_.State.WAITING_INIT_PTS}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var d,e=performance.now(),A=this.retryDate;(!A||e>=A||(d=this.media)!==null&&d!==void 0&&d.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=_.State.IDLE);break}case _.State.WAITING_INIT_PTS:{var M=this.waitingData;if(M){var F=M.frag,W=M.part,Z=M.cache,K=M.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.FRAG_LOADING;var J=Z.flush(),oe={frag:F,part:W,payload:J,networkDetails:null};this._handleFragmentLoadProgress(oe),K&&v.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+F.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var se=this.getLoadPosition(),pe=N.BufferHelper.bufferInfo(this.mediaBuffer,se,this.config.maxBufferHole),be=Object(C.fragmentWithinToleranceTest)(pe.end,this.config.maxFragLookUpTolerance,F);be<0&&(n.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+pe.end+" is needed"),this.clearWaitingFragment())}}else this.state=_.State.IDLE}}this.onTickEnd()},i.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.IDLE)},i.onTickEnd=function(){var t=this.media;if(!t||!t.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:t,g=a.buffered;!this.loadedmetadata&&g.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime},i.doTickIdle=function(){var t,a,g=this.hls,h=this.levels,d=this.media,e=this.trackId,A=g.config;if(!h||!h[e])return;if(!d&&(this.startFragRequested||!A.startFragPrefetch))return;var M=h[e],F=M.details;if(!F||F.live&&this.levelLastLoaded!==e||this.waitForCdnTuneIn(F)){this.state=_.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(W===null)return;var Z=W.len,K=this.getMaxBufferLength(),J=this.audioSwitch;if(Z>=K&&!J)return;if(!J&&this._streamEnded(W,F)){g.trigger(x.Events.BUFFER_EOS,{type:"audio"}),this.state=_.State.ENDED;return}var oe=F.fragments,se=oe[0].start,pe=W.end;if(J){var be=this.getLoadPosition();pe=be,F.PTSKnown&&be<se&&((W.end>se||W.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),d.currentTime=se+.05))}var Q=this.getNextFragment(pe,F);if(!Q){this.bufferFlushed=!0;return}((t=Q.decryptdata)===null||t===void 0?void 0:t.keyFormat)==="identity"&&!((a=Q.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Q,F):this.loadFragment(Q,F,pe)},i.getMaxBufferLength=function(){var t=v.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return a===null?t:Math.max(t,a.len)},i.onMediaDetaching=function(){this.videoBuffer=null,v.prototype.onMediaDetaching.call(this)},i.onAudioTracksUpdated=function(t,a){var g=a.audioTracks;this.resetTransmuxer(),this.levels=g.map(function(h){return new S.Level(h)})},i.onAudioTrackSwitching=function(t,a){var g=!!a.url;this.trackId=a.id;var h=this.fragCurrent;h!=null&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),g?this.setInterval(c):this.resetTransmuxer(),g?(this.audioSwitch=!0,this.state=_.State.IDLE):this.state=_.State.STOPPED,this.tick()},i.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},i.onLevelLoaded=function(t,a){this.mainDetails=a.details},i.onAudioTrackLoaded=function(t,a){var g,h=this.levels,d=a.details,e=a.id;if(!h){this.warn("Audio tracks were reset while loading level "+e);return}this.log("Track "+e+" loaded ["+d.startSN+","+d.endSN+"],duration:"+d.totalduration);var A=h[e],M=0;if(d.live||(g=A.details)!==null&&g!==void 0&&g.live){var F=this.mainDetails;if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed||!F)return;!A.details&&d.hasProgramDateTime&&F.hasProgramDateTime?(Object(b.alignMediaPlaylistByPDT)(d,F),M=d.fragments[0].start):M=this.alignPlaylists(d,A.details)}A.details=d,this.levelLastLoaded=e,!this.startFragRequested&&(this.mainDetails||!d.live)&&this.setStartPosition(A.details,M),this.state===_.State.WAITING_TRACK&&!this.waitForCdnTuneIn(d)&&(this.state=_.State.IDLE),this.tick()},i._handleFragmentLoadProgress=function(t){var a,g=t.frag,h=t.part,d=t.payload,e=this.config,A=this.trackId,M=this.levels;if(!M){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 F=M[A];console.assert(F,"Audio track is defined on fragment load progress");var W=F.details;console.assert(W,"Audio track details are defined on fragment load progress");var Z=e.defaultAudioCodec||F.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new R.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[g.cc],oe=(a=g.initSegment)===null||a===void 0?void 0:a.data;if(J!==void 0){var se=!1,pe=h?h.index:-1,be=pe!==-1,Q=new T.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,d.byteLength,pe,be);K.push(d,oe,Z,"",g,h,W.totalduration,se,Q,J)}else{n.logger.log("Unknown video PTS for cc "+g.cc+", waiting for video PTS before demuxing audio frag "+g.sn+" of ["+W.startSN+" ,"+W.endSN+"],track "+A);var te=this.waitingData=this.waitingData||{frag:g,part:h,cache:new O.default,complete:!1},ve=te.cache;ve.push(new Uint8Array(d)),this.waitingVideoCC=this.videoTrackCC,this.state=_.State.WAITING_INIT_PTS}},i._handleFragmentLoadComplete=function(t){if(this.waitingData){this.waitingData.complete=!0;return}v.prototype._handleFragmentLoadComplete.call(this,t)},i.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},i.onBufferCreated=function(t,a){var g=a.tracks.audio;g&&(this.mediaBuffer=g.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},i.onFragBuffered=function(t,a){var g=a.frag,h=a.part;if(g.type!==P.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(x.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(g,h)},i.onError=function(t,a){switch(a.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,a);break;case m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==_.State.ERROR&&this.state!==_.State.STOPPED&&(this.state=a.fatal?_.State.ERROR:_.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var g=!0,h=this.getFwdBufferInfo(this.mediaBuffer,P.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,v.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},i.onBufferFlushed=function(t,a){var g=a.type;g===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},i._handleTransmuxComplete=function(t){var a,g="audio",h=this.hls,d=t.remuxResult,e=t.chunkMeta,A=this.getCurrentContext(e);if(!A){this.warn("The loading context changed while buffering fragment "+e.sn+" of level "+e.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(e.level);return}var M=A.frag,F=A.part,W=d.audio,Z=d.text,K=d.id3,J=d.initSegment;if(this.fragContextChanged(M))return;if(this.state=_.State.PARSING,this.audioSwitch&&W&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,M,e),h.trigger(x.Events.FRAG_PARSING_INIT_SEGMENT,{frag:M,id:g,tracks:J.tracks})),W){var oe=W.startPTS,se=W.endPTS,pe=W.startDTS,be=W.endDTS;F&&(F.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:se,startDTS:pe,endDTS:be}),M.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,oe,se,pe,be),this.bufferFragmentData(W,M,F,e)}if(K!=null&&(a=K.samples)!==null&&a!==void 0&&a.length){var Q=s({frag:M,id:g},K);h.trigger(x.Events.FRAG_PARSING_METADATA,Q)}if(Z){var te=s({frag:M,id:g},Z);h.trigger(x.Events.FRAG_PARSING_USERDATA,te)}},i._bufferInitSegment=function(t,a,g){if(this.state!==_.State.PARSING)return;t.video&&delete t.video;var h=t.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(x.Events.BUFFER_CODECS,t);var d=h.initSegment;if(d!=null&&d.byteLength){var e={type:"audio",frag:a,part:null,chunkMeta:g,parent:a.type,data:d};this.hls.trigger(x.Events.BUFFER_APPENDING,e)}this.tick()},i.loadFragment=function(t,a,g){var h=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||h===I.FragmentState.NOT_LOADED||h===I.FragmentState.PARTIAL)&&(t.sn==="initSegment"?this._loadInitSegment(t):a.live&&!Object(U.isFiniteNumber)(this.initPTS[t.cc])?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=_.State.WAITING_INIT_PTS):(this.startFragRequested=!0,v.prototype.loadFragment.call(this,t,a,g)))},i.completeAudioSwitch=function(){var t=this.hls,a=this.media,g=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),v.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(x.Events.AUDIO_TRACK_SWITCHED,{id:g})},f}(_.default);B.default=o},"./src/controller/audio-track-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/events.ts"),_=w("./src/errors.ts"),x=w("./src/controller/base-playlist-controller.ts"),N=w("./src/types/loader.ts");function I(R,T){for(var C=0;C<T.length;C++){var b=T[C];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(R,b.key,b)}}function S(R,T,C){return T&&I(R.prototype,T),C&&I(R,C),R}function P(R,T){R.prototype=Object.create(T.prototype),R.prototype.constructor=R,E(R,T)}function E(R,T){return E=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},E(R,T)}var O=function(R){P(T,R);function T(b){var m;return m=R.call(this,b,"[audio-track-controller]")||this,m.tracks=[],m.groupId=null,m.tracksInGroup=[],m.trackId=-1,m.trackName="",m.selectDefaultTrack=!0,m.registerListeners(),m}var C=T.prototype;return C.registerListeners=function(){var m=this.hls;m.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),m.on(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),m.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(U.Events.ERROR,this.onError,this)},C.unregisterListeners=function(){var m=this.hls;m.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),m.off(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),m.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(U.Events.ERROR,this.onError,this)},C.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,R.prototype.destroy.call(this)},C.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},C.onManifestParsed=function(m,n){this.tracks=n.audioTracks||[]},C.onAudioTrackLoaded=function(m,n){var s=n.id,l=n.details,y=this.tracksInGroup[s];if(!y){this.warn("Invalid audio track id "+s);return}var c=y.details;y.details=n.details,this.log("audioTrack "+s+" loaded ["+l.startSN+"-"+l.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,n,c))},C.onLevelLoading=function(m,n){this.switchLevel(n.level)},C.onLevelSwitching=function(m,n){this.switchLevel(n.level)},C.switchLevel=function(m){var n=this.hls.levels[m];if(!(n!=null&&n.audioGroupIds))return;var s=n.audioGroupIds[n.urlId];if(this.groupId!==s){this.groupId=s;var l=this.tracks.filter(function(c){return!s||c.groupId===s});this.selectDefaultTrack&&!l.some(function(c){return c.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var y={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(U.Events.AUDIO_TRACKS_UPDATED,y),this.selectInitialTrack()}},C.onError=function(m,n){if(R.prototype.onError.call(this,m,n),n.fatal||!n.context)return;n.context.type===N.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},C.setAudioTrack=function(m){var n=this.tracksInGroup;if(m<0||m>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=n[this.trackId];this.log("Now switching to audio-track index "+m);var l=n[m],y=l.id,c=l.groupId,o=c===void 0?"":c,v=l.name,f=l.type,i=l.url;if(this.trackId=m,this.trackName=v,this.selectDefaultTrack=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHING,{id:y,groupId:o,name:v,type:f,url:i}),l.details&&!l.details.live)return;var r=this.switchParams(l.url,s==null?void 0:s.details);this.loadPlaylist(r)},C.selectInitialTrack=function(){var m=this.tracksInGroup;console.assert(m.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,s=this.findTrackId(n)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},C.findTrackId=function(m){for(var n=this.tracksInGroup,s=0;s<n.length;s++){var l=n[s];if((!this.selectDefaultTrack||l.default)&&(!m||m===l.name))return l.id}return-1},C.loadPlaylist=function(m){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var s=n.id,l=n.groupId,y=n.url;if(m)try{y=m.addDirectives(y)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(U.Events.AUDIO_TRACK_LOADING,{url:y,id:s,groupId:l,deliveryDirectives:m||null})}},S(T,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(m){this.selectDefaultTrack=!1,this.setAudioTrack(m)}}]),T}(x.default);B.default=O},"./src/controller/base-playlist-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return S});var U=w("./src/polyfills/number.ts"),_=w("./src/types/level.ts"),x=w("./src/controller/level-helper.ts"),N=w("./src/utils/logger.ts"),I=w("./src/errors.ts"),S=function(){function P(O,R){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=N.logger.log.bind(N.logger,R+":"),this.warn=N.logger.warn.bind(N.logger,R+":"),this.hls=O}var E=P.prototype;return E.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},E.onError=function(R,T){T.fatal&&T.type===I.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},E.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},E.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},E.stopLoad=function(){this.canLoad=!1,this.clearTimer()},E.switchParams=function(R,T){var C=T==null?void 0:T.renditionReports;if(C)for(var b=0;b<C.length;b++){var m=C[b],n=""+m.URI;if(n===R.substr(-n.length)){var s=parseInt(m["LAST-MSN"]),l=parseInt(m["LAST-PART"]);if(T&&this.hls.config.lowLatencyMode){var y=Math.min(T.age-T.partTarget,T.targetduration);l!==void 0&&y>T.partTarget&&(l+=1)}if(Object(U.isFiniteNumber)(s))return new _.HlsUrlParameters(s,Object(U.isFiniteNumber)(l)?l:void 0,_.HlsSkip.No)}}},E.loadPlaylist=function(R){},E.shouldLoadTrack=function(R){return this.canLoad&&R&&!!R.url&&(!R.details||R.details.live)},E.playlistLoaded=function(R,T,C){var b=this,m=T.details,n=T.stats,s=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(m.advancedDateTime=Date.now()-s,m.live||C!=null&&C.live){if(m.reloaded(C),C&&this.log("live playlist "+R+" "+(m.advanced?"REFRESHED "+m.lastPartSn+"-"+m.lastPartIndex:"MISSED")),C&&m.fragments.length>0&&Object(x.mergeDetails)(C,m),!this.canLoad||!m.live)return;var l,y=void 0,c=void 0;if(m.canBlockReload&&m.endSN&&m.advanced){var o=this.hls.config.lowLatencyMode,v=m.lastPartSn,f=m.endSN,i=m.lastPartIndex,r=i!==-1,t=v===f,a=o?0:i;r?(y=t?f+1:v,c=t?a:i+1):y=f+1;var g=m.age,h=g+m.ageHeader,d=Math.min(h-m.partTarget,m.targetduration*1.5);if(d>0){if(C&&d>C.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+C.tuneInGoal+" to: "+d+" with playlist age: "+m.age),d=0;else{var e=Math.floor(d/m.targetduration);if(y+=e,c!==void 0){var A=Math.round(d%m.targetduration/m.partTarget);c+=A}this.log("CDN Tune-in age: "+m.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+d+" skip sn "+e+" to part "+c)}m.tuneInGoal=d}if(l=this.getDeliveryDirectives(m,T.deliveryDirectives,y,c),o||!t){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(m,T.deliveryDirectives,y,c);var M=Object(x.computeReloadInterval)(m,n);y!==void 0&&m.canBlockReload&&(M-=m.partTarget||1),this.log("reload live playlist "+R+" in "+Math.round(M)+" ms"),this.timer=self.setTimeout(function(){return b.loadPlaylist(l)},M)}else this.clearTimer()},E.getDeliveryDirectives=function(R,T,C,b){var m=Object(_.getSkipValue)(R,C);return T!=null&&T.skip&&R.deltaUpdateFailed&&(C=T.msn,b=T.part,m=_.HlsSkip.No),new _.HlsUrlParameters(C,b,m)},E.retryLoadingOrFail=function(R){var T=this,C=this.hls.config,b=this.retryCount<C.levelLoadingMaxRetry;if(b){var m;if(this.retryCount++,R.details.indexOf("LoadTimeOut")>-1&&(m=R.context)!==null&&m!==void 0&&m.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+R.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*C.levelLoadingRetryDelay,C.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return T.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+R.details+'"')}}else this.warn('cannot recover from error "'+R.details+'"'),this.clearTimer(),R.fatal=!0;return b},P}()},"./src/controller/base-stream-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"State",function(){return f}),w.d(B,"default",function(){return i});var U=w("./src/polyfills/number.ts"),_=w("./src/task-loop.ts"),x=w("./src/controller/fragment-tracker.ts"),N=w("./src/utils/buffer-helper.ts"),I=w("./src/utils/logger.ts"),S=w("./src/events.ts"),P=w("./src/errors.ts"),E=w("./src/types/transmuxer.ts"),O=w("./src/utils/mp4-tools.ts"),R=w("./src/utils/discontinuities.ts"),T=w("./src/controller/fragment-finders.ts"),C=w("./src/controller/level-helper.ts"),b=w("./src/loader/fragment-loader.ts"),m=w("./src/crypt/decrypter.ts"),n=w("./src/utils/time-ranges.ts"),s=w("./src/types/loader.ts");function l(r,t){for(var a=0;a<t.length;a++){var g=t[a];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function y(r,t,a){return t&&l(r.prototype,t),a&&l(r,a),r}function c(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function o(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,v(r,t)}function v(r,t){return v=Object.setPrototypeOf||function(g,h){return g.__proto__=h,g},v(r,t)}var f={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"},i=function(r){o(t,r);function t(g,h,d){var e;return e=r.call(this)||this,e.hls=void 0,e.fragPrevious=null,e.fragCurrent=null,e.fragmentTracker=void 0,e.transmuxer=null,e._state=f.STOPPED,e.media=void 0,e.mediaBuffer=void 0,e.config=void 0,e.bitrateTest=!1,e.lastCurrentTime=0,e.nextLoadPosition=0,e.startPosition=0,e.loadedmetadata=!1,e.fragLoadError=0,e.retryDate=0,e.levels=null,e.fragmentLoader=void 0,e.levelLastLoaded=null,e.startFragRequested=!1,e.decrypter=void 0,e.initPTS=[],e.onvseeking=null,e.onvended=null,e.logPrefix="",e.log=void 0,e.warn=void 0,e.logPrefix=d,e.log=I.logger.log.bind(I.logger,d+":"),e.warn=I.logger.warn.bind(I.logger,d+":"),e.hls=g,e.fragmentLoader=new b.default(g.config),e.fragmentTracker=h,e.config=g.config,e.decrypter=new m.default(g,g.config),g.on(S.Events.KEY_LOADED,e.onKeyLoaded,c(e)),e}var a=t.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(h){},a.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=f.STOPPED},a._streamEnded=function(h,d){var e=this.fragCurrent,A=this.fragmentTracker;if(!d.live&&e&&e.sn===d.endSN&&!h.nextStart){var M=A.getState(e);return M===x.FragmentState.PARTIAL||M===x.FragmentState.OK}return!1},a.onMediaAttached=function(h,d){var e=this.media=this.mediaBuffer=d.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var A=this.config;this.levels&&A.autoStartLoad&&this.state===f.STOPPED&&this.startLoad(A.startPosition)},a.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()},a.onMediaSeeking=function(){var h=this.config,d=this.fragCurrent,e=this.media,A=this.mediaBuffer,M=this.state,F=e?e.currentTime:0,W=N.BufferHelper.bufferInfo(A||e,F,h.maxBufferHole);if(this.log("media seeking to "+(Object(U.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+M),M===f.ENDED)this.resetLoadingState();else if(d&&!W.len){var Z=h.maxFragLookUpTolerance,K=d.start-Z,J=d.start+d.duration+Z,oe=F>J;(F<K||oe)&&(oe&&d.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),d.loader.abort()),this.resetLoadingState())}e&&(this.lastCurrentTime=F),!this.loadedmetadata&&!W.len&&(this.nextLoadPosition=this.startPosition=F),this.tickImmediate()},a.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.onKeyLoaded=function(h,d){if(this.state!==f.KEY_LOADING||d.frag!==this.fragCurrent||!this.levels)return;this.state=f.IDLE;var e=this.levels[d.frag.level].details;e&&this.loadFragment(d.frag,e,d.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),r.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=f.STOPPED,this.hls.off(S.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,r.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(h,d){this.log("Loading key for "+h.sn+" of ["+d.startSN+"-"+d.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level),this.state=f.KEY_LOADING,this.fragCurrent=h,this.hls.trigger(S.Events.KEY_LOADING,{frag:h})},a.loadFragment=function(h,d,e){this._loadFragForPlayback(h,d,e)},a._loadFragForPlayback=function(h,d,e){var A=this,M=function(W){if(A.fragContextChanged(h)){A.warn("Fragment "+h.sn+(W.part?" p: "+W.part.index:"")+" of level "+h.level+" was dropped during download."),A.fragmentTracker.removeFragment(h);return}h.stats.chunkCount++,A._handleFragmentLoadProgress(W)};this._doFragLoad(h,d,e,M).then(function(F){if(!F)return;A.fragLoadError=0;var W=A.state;if(A.fragContextChanged(h)){(W===f.FRAG_LOADING||W===f.BACKTRACKING||!A.fragCurrent&&W===f.PARSING)&&(A.fragmentTracker.removeFragment(h),A.state=f.IDLE);return}if("payload"in F&&(A.log("Loaded fragment "+h.sn+" of level "+h.level),A.hls.trigger(S.Events.FRAG_LOADED,F),A.state===f.BACKTRACKING)){A.fragmentTracker.backtrack(h,F),A.resetFragmentLoading(h);return}A._handleFragmentLoadComplete(F)}).catch(function(F){A.warn(F),A.resetFragmentLoading(h)})},a.flushMainBuffer=function(h,d,e){if(e===void 0&&(e=null),!(h-d))return;var A={startOffset:h,endOffset:d,type:e};this.fragLoadError=0,this.hls.trigger(S.Events.BUFFER_FLUSHING,A)},a._loadInitSegment=function(h){var d=this;this._doFragLoad(h).then(function(e){if(!e||d.fragContextChanged(h)||!d.levels)throw new Error("init load aborted");return e}).then(function(e){var A=d.hls,M=e.payload,F=h.decryptdata;if(M&&M.byteLength>0&&F&&F.key&&F.iv&&F.method==="AES-128"){var W=self.performance.now();return d.decrypter.webCryptoDecrypt(new Uint8Array(M),F.key.buffer,F.iv.buffer).then(function(Z){var K=self.performance.now();return A.trigger(S.Events.FRAG_DECRYPTED,{frag:h,payload:Z,stats:{tstart:W,tdecrypt:K}}),e.payload=Z,e})}return e}).then(function(e){var A=d.fragCurrent,M=d.hls,F=d.levels;if(!F)throw new Error("init load aborted, missing levels");var W=F[h.level].details;console.assert(W,"Level details are defined when init segment is loaded");var Z=h.stats;d.state=f.IDLE,d.fragLoadError=0,h.data=new Uint8Array(e.payload),Z.parsing.start=Z.buffering.start=self.performance.now(),Z.parsing.end=Z.buffering.end=self.performance.now(),e.frag===A&&M.trigger(S.Events.FRAG_BUFFERED,{stats:Z,frag:A,part:null,id:h.type}),d.tick()}).catch(function(e){d.warn(e),d.resetFragmentLoading(h)})},a.fragContextChanged=function(h){var d=this.fragCurrent;return!h||!d||h.level!==d.level||h.sn!==d.sn||h.urlId!==d.urlId},a.fragBufferedComplete=function(h,d){var e=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+h.type+" sn: "+h.sn+(d?" part: "+d.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level+" "+n.default.toString(N.BufferHelper.getBuffered(e))),this.state=f.IDLE,this.tick()},a._handleFragmentLoadComplete=function(h){var d=this.transmuxer;if(!d)return;var e=h.frag,A=h.part,M=h.partsLoaded,F=!M||M.length===0||M.some(function(Z){return!Z}),W=new E.ChunkMetadata(e.level,e.sn,e.stats.chunkCount+1,0,A?A.index:-1,!F);d.flush(W)},a._handleFragmentLoadProgress=function(h){},a._doFragLoad=function(h,d,e,A){var M=this;if(e===void 0&&(e=null),!this.levels)throw new Error("frag load aborted, missing levels");if(e=Math.max(h.start,e||0),this.config.lowLatencyMode&&d){var F=d.partList;if(F&&A){e>h.end&&d.fragmentHint&&(h=d.fragmentHint);var W=this.getNextPart(F,h,e);if(W>-1){var Z=F[W];return this.log("Loading part sn: "+h.sn+" p: "+Z.index+" cc: "+h.cc+" of playlist ["+d.startSN+"-"+d.endSN+"] parts [0-"+W+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(e.toFixed(3))),this.nextLoadPosition=Z.start+Z.duration,this.state=f.FRAG_LOADING,this.hls.trigger(S.Events.FRAG_LOADING,{frag:h,part:F[W],targetBufferTime:e}),this.doFragPartsLoad(h,F,W,A).catch(function(K){return M.handleFragLoadError(K)})}else if(!h.url||this.loadedEndOfParts(F,e))return Promise.resolve(null)}}return this.log("Loading fragment "+h.sn+" cc: "+h.cc+" "+(d?"of ["+d.startSN+"-"+d.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(e.toFixed(3))),Object(U.isFiniteNumber)(h.sn)&&!this.bitrateTest&&(this.nextLoadPosition=h.start+h.duration),this.state=f.FRAG_LOADING,this.hls.trigger(S.Events.FRAG_LOADING,{frag:h,targetBufferTime:e}),this.fragmentLoader.load(h,A).catch(function(K){return M.handleFragLoadError(K)})},a.doFragPartsLoad=function(h,d,e,A){var M=this;return new Promise(function(F,W){var Z=[],K=function J(oe){var se=d[oe];M.fragmentLoader.loadPart(h,se,A).then(function(pe){Z[se.index]=pe;var be=pe.part;M.hls.trigger(S.Events.FRAG_LOADED,pe);var Q=d[oe+1];if(Q&&Q.fragment===h)J(oe+1);else return F({frag:h,part:be,partsLoaded:Z})}).catch(W)};K(e)})},a.handleFragLoadError=function(h){var d=h.data;return d&&d.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(d.frag,d.part):this.hls.trigger(S.Events.ERROR,d),null},a._handleTransmuxerFlush=function(h){var d=this.getCurrentContext(h);if(!d||this.state!==f.PARSING){this.fragCurrent||(this.state=f.IDLE);return}var e=d.frag,A=d.part,M=d.level,F=self.performance.now();e.stats.parsing.end=F,A&&(A.stats.parsing.end=F),this.updateLevelTiming(e,A,M,h.partial)},a.getCurrentContext=function(h){var d=this.levels,e=h.level,A=h.sn,M=h.part;if(!d||!d[e])return this.warn("Levels object was unset while buffering fragment "+A+" of level "+e+". The current chunk will not be buffered."),null;var F=d[e],W=M>-1?Object(C.getPartWith)(F,A,M):null,Z=W?W.fragment:Object(C.getFragmentWithSN)(F,A,this.fragCurrent);return Z?{frag:Z,part:W,level:F}:null},a.bufferFragmentData=function(h,d,e,A){if(!h||this.state!==f.PARSING)return;var M=h.data1,F=h.data2,W=M;if(M&&F&&(W=Object(O.appendUint8Array)(M,F)),!W||!W.length)return;var Z={type:h.type,frag:d,part:e,chunkMeta:A,parent:d.type,data:W};this.hls.trigger(S.Events.BUFFER_APPENDING,Z),h.dropped&&h.independent&&!e&&this.flushBufferGap(d)},a.flushBufferGap=function(h){var d=this.media;if(!d)return;if(!N.BufferHelper.isBuffered(d,d.currentTime)){this.flushMainBuffer(0,h.start);return}var e=d.currentTime,A=N.BufferHelper.bufferInfo(d,e,0),M=h.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,M*.25),W=Math.max(Math.min(h.start-F,A.end-F),e+F);h.start-W>F&&this.flushMainBuffer(W,h.start)},a.getFwdBufferInfo=function(h,d){var e=this.config,A=this.getLoadPosition();if(!Object(U.isFiniteNumber)(A))return null;var M=N.BufferHelper.bufferInfo(h,A,e.maxBufferHole);if(M.len===0&&M.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(A,d);if(F&&M.nextStart<F.end)return N.BufferHelper.bufferInfo(h,A,Math.max(M.nextStart,e.maxBufferHole))}return M},a.getMaxBufferLength=function(h){var d=this.config,e;return h?e=Math.max(8*d.maxBufferSize/h,d.maxBufferLength):e=d.maxBufferLength,Math.min(e,d.maxMaxBufferLength)},a.reduceMaxBufferLength=function(h){var d=this.config,e=h||d.maxBufferLength;return d.maxMaxBufferLength>=e?(d.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+d.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(h,d){var e,A,M=d.fragments,F=M.length;if(!F)return null;var W=this.config,Z=M[0].start,K;if(d.live){var J=W.initialLiveManifestSize;if(F<J)return this.warn("Not enough fragments to start playback (have: "+F+", need: "+J+")"),null;!d.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(d,M),this.startPosition=K?this.hls.liveSyncPosition||K.start:h)}else h<=Z&&(K=M[0]);if(!K){var oe=W.lowLatencyMode?d.partEnd:d.fragmentEnd;K=this.getFragmentAtPosition(h,oe,d)}return(e=K)!==null&&e!==void 0&&e.initSegment&&!((A=K)!==null&&A!==void 0&&A.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},a.getNextPart=function(h,d,e){for(var A=-1,M=!1,F=!0,W=0,Z=h.length;W<Z;W++){var K=h[W];if(F=F&&!K.independent,A>-1&&e<K.start)break;var J=K.loaded;!J&&(M||K.independent||F)&&K.fragment===d&&(A=W),M=J}return A},a.loadedEndOfParts=function(h,d){var e=h[h.length-1];return e&&d>e.start&&e.loaded},a.getInitialLiveFragment=function(h,d){var e=this.fragPrevious,A=null;if(e){if(h.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+e.programDateTime),A=Object(T.findFragmentByPDT)(d,e.endProgramDateTime,this.config.maxFragLookUpTolerance)),!A){var M=e.sn+1;if(M>=h.startSN&&M<=h.endSN){var F=d[M-h.startSN];e.cc===F.cc&&(A=F,this.log("Live playlist, switching playlist, load frag with next SN: "+A.sn))}A||(A=Object(T.findFragWithCC)(d,e.cc),A&&this.log("Live playlist, switching playlist, load frag with same CC: "+A.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(A=this.getFragmentAtPosition(W,this.bitrateTest?h.fragmentEnd:h.edge,h))}return A},a.getFragmentAtPosition=function(h,d,e){var A=this.config,M=this.fragPrevious,F=e.fragments,W=e.endSN,Z=e.fragmentHint,K=A.maxFragLookUpTolerance,J=!!(A.lowLatencyMode&&e.partList&&Z);J&&Z&&!this.bitrateTest&&(F=F.concat(Z),W=Z.sn);var oe;if(h<d){var se=h>d-K?0:K;oe=Object(T.findFragmentByPTS)(M,F,h,se)}else oe=F[F.length-1];if(oe){var pe=oe.sn-e.startSN,be=M&&oe.level===M.level,Q=F[pe+1],te=this.fragmentTracker.getState(oe);if(te===x.FragmentState.BACKTRACKED){oe=null;for(var ve=pe;F[ve]&&this.fragmentTracker.getState(F[ve])===x.FragmentState.BACKTRACKED;)M?oe=F[ve--]:oe=F[--ve];oe||(oe=Q)}else M&&oe.sn===M.sn&&!J&&(be&&(oe.sn<W&&this.fragmentTracker.getState(Q)!==x.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Q.sn),oe=Q):oe=null))}return oe},a.synchronizeToLiveEdge=function(h){var d=this.config,e=this.media;if(!e)return;var A=this.hls.liveSyncPosition,M=e.currentTime,F=h.fragments[0].start,W=h.edge,Z=M>=F-d.maxFragLookUpTolerance&&M<=W;if(A!==null&&e.duration>A&&(M<A||!Z)){var K=d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:d.liveMaxLatencyDurationCount*h.targetduration;(!Z&&e.readyState<4||M<W-K)&&(this.loadedmetadata||(this.nextLoadPosition=A),e.readyState&&(this.warn("Playback: "+M.toFixed(3)+" is located too far from the end of live sliding playlist: "+W+", reset currentTime to : "+A.toFixed(3)),e.currentTime=A))}},a.alignPlaylists=function(h,d){var e=this.levels,A=this.levelLastLoaded,M=this.fragPrevious,F=A!==null?e[A]:null,W=h.fragments.length;if(!W)return this.warn("No fragments in live playlist"),0;var Z=h.fragments[0].start,K=!d,J=h.alignedSliding&&Object(U.isFiniteNumber)(Z);if(K||!J&&!Z){Object(R.alignStream)(M,F,h);var oe=h.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(d?d.startSN:"na")+"->"+h.startSN+" prev-sn: "+(M?M.sn:"na")+" fragments: "+W),oe}return Z},a.waitForCdnTuneIn=function(h){var d=3;return h.live&&h.canBlockReload&&h.tuneInGoal>Math.max(h.partHoldBack,h.partTarget*d)},a.setStartPosition=function(h,d){var e=this.startPosition;if(e<d&&(e=-1),e===-1||this.lastCurrentTime===-1){var A=h.startTimeOffset;Object(U.isFiniteNumber)(A)?(e=d+A,A<0&&(e+=h.totalduration),e=Math.min(Math.max(d,e),d+h.totalduration),this.log("Start time offset "+A+" found in playlist, adjust startPosition to "+e),this.startPosition=e):h.live?e=this.hls.liveSyncPosition||d:this.startPosition=e=0,this.lastCurrentTime=e}this.nextLoadPosition=e},a.getLoadPosition=function(){var h=this.media,d=0;return this.loadedmetadata&&h?d=h.currentTime:this.nextLoadPosition&&(d=this.nextLoadPosition),d},a.handleFragLoadAborted=function(h,d){this.transmuxer&&h.sn!=="initSegment"&&h.stats.aborted&&(this.warn("Fragment "+h.sn+(d?" part"+d.index:"")+" of level "+h.level+" was aborted"),this.resetFragmentLoading(h))},a.resetFragmentLoading=function(h){(!this.fragCurrent||!this.fragContextChanged(h))&&(this.state=f.IDLE)},a.onFragmentOrKeyLoadError=function(h,d){if(d.fatal)return;var e=d.frag;if(!e||e.type!==h)return;var A=this.fragCurrent;console.assert(A&&e.sn===A.sn&&e.level===A.level&&e.urlId===A.urlId,"Frag load error must match current frag to retry");var M=this.config;if(this.fragLoadError+1<=M.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(e.level))return;var F=Math.min(Math.pow(2,this.fragLoadError)*M.fragLoadingRetryDelay,M.fragLoadingMaxRetryTimeout);this.warn("Fragment "+e.sn+" of "+h+" "+e.level+" failed to load, retrying in "+F+"ms"),this.retryDate=self.performance.now()+F,this.fragLoadError++,this.state=f.FRAG_LOADING_WAITING_RETRY}else d.levelRetry?(h===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=f.IDLE):(I.logger.error(d.details+" reaches max retry, redispatch as fatal ..."),d.fatal=!0,this.hls.stopLoad(),this.state=f.ERROR)},a.afterBufferFlushed=function(h,d,e){if(!h)return;var A=N.BufferHelper.getBuffered(h);this.fragmentTracker.detectEvictedFragments(d,A,e),this.state===f.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=f.IDLE},a.resetLiveStartWhenNotLoaded=function(h){if(!this.loadedmetadata){this.startFragRequested=!1;var d=this.levels?this.levels[h].details:null;if(d!=null&&d.live)return this.startPosition=-1,this.setStartPosition(d,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(h,d,e,A){var M=this,F=e.details;console.assert(!!F,"level.details must be defined");var W=Object.keys(h.elementaryStreams).reduce(function(Z,K){var J=h.elementaryStreams[K];if(J){var oe=J.endPTS-J.startPTS;if(oe<=0)return M.warn("Could not parse fragment "+h.sn+" "+K+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),M.resetTransmuxer(),Z||!1;var se=A?0:Object(C.updateFragPTSDTS)(F,h,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return M.hls.trigger(S.Events.LEVEL_PTS_UPDATED,{details:F,level:e,drift:se,type:K,frag:h,start:J.startPTS,end:J.endPTS}),!0}return Z},!1);W?(this.state=f.PARSED,this.hls.trigger(S.Events.FRAG_PARSED,{frag:h,part:d})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},y(t,[{key:"state",get:function(){return this._state},set:function(h){var d=this._state;d!==h&&(this._state=h,this.log(d+"->"+h))}}]),t}(_.default)},"./src/controller/buffer-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return T});var U=w("./src/polyfills/number.ts"),_=w("./src/events.ts"),x=w("./src/utils/logger.ts"),N=w("./src/errors.ts"),I=w("./src/utils/buffer-helper.ts"),S=w("./src/utils/mediasource-helper.ts"),P=w("./src/loader/fragment.ts"),E=w("./src/controller/buffer-operation-queue.ts"),O=Object(S.getMediaSource)(),R=/([ha]vc.)(?:\.[^.,]+)+/,T=function(){function C(m){var n=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=n.hls,l=n.media,y=n.mediaSource;x.logger.log("[buffer-controller]: Media source opened"),l&&(n.updateMediaElementDuration(),s.trigger(_.Events.MEDIA_ATTACHED,{media:l})),y&&y.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){x.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){x.logger.log("[buffer-controller]: Media source ended")},this.hls=m,this._initSourceBuffer(),this.registerListeners()}var b=C.prototype;return b.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},b.destroy=function(){this.unregisterListeners(),this.details=null},b.registerListeners=function(){var n=this.hls;n.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(_.Events.BUFFER_RESET,this.onBufferReset,this),n.on(_.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(_.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(_.Events.BUFFER_EOS,this.onBufferEos,this),n.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(_.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(_.Events.FRAG_PARSED,this.onFragParsed,this),n.on(_.Events.FRAG_CHANGED,this.onFragChanged,this)},b.unregisterListeners=function(){var n=this.hls;n.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(_.Events.BUFFER_RESET,this.onBufferReset,this),n.off(_.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(_.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(_.Events.BUFFER_EOS,this.onBufferEos,this),n.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(_.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(_.Events.FRAG_PARSED,this.onFragParsed,this),n.off(_.Events.FRAG_CHANGED,this.onFragChanged,this)},b._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},b.onManifestParsed=function(n,s){var l=2;(s.audio&&!s.video||!s.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,x.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},b.onMediaAttaching=function(n,s){var l=this.media=s.media;if(l&&O){var y=this.mediaSource=new O;y.addEventListener("sourceopen",this._onMediaSourceOpen),y.addEventListener("sourceended",this._onMediaSourceEnded),y.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(y),this._objectUrl=l.src}},b.onMediaDetaching=function(){var n=this.media,s=this.mediaSource,l=this._objectUrl;if(s){if(x.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(y){x.logger.warn("[buffer-controller]: onMediaDetaching: "+y.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(l&&self.URL.revokeObjectURL(l),n.src===l?(n.removeAttribute("src"),n.load()):x.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(_.Events.MEDIA_DETACHED,void 0)},b.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(s){var l=n.sourceBuffer[s];try{l&&(n.removeBufferListeners(s),n.mediaSource&&n.mediaSource.removeSourceBuffer(l),n.sourceBuffer[s]=void 0)}catch(y){x.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",y)}}),this._initSourceBuffer()},b.onBufferCodecs=function(n,s){var l=this,y=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(c){if(y){var o=l.tracks[c];if(o&&typeof o.buffer.changeType=="function"){var v=s[c],f=v.codec,i=v.levelCodec,r=v.container,t=(o.levelCodec||o.codec).replace(R,"$1"),a=(i||f).replace(R,"$1");if(t!==a){var g=r+";codecs="+(i||f);l.appendChangeType(c,g)}}}else l.pendingTracks[c]=s[c]}),y)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},b.appendChangeType=function(n,s){var l=this,y=this.operationQueue,c={execute:function(){var v=l.sourceBuffer[n];v&&(x.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+s),v.changeType(s)),y.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(v){x.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",v)}};y.append(c,n)},b.onBufferAppending=function(n,s){var l=this,y=this.hls,c=this.operationQueue,o=this.tracks,v=s.data,f=s.type,i=s.frag,r=s.part,t=s.chunkMeta,a=t.buffering[f],g=self.performance.now();a.start=g;var h=i.stats.buffering,d=r?r.stats.buffering:null;h.start===0&&(h.start=g),d&&d.start===0&&(d.start=g);var e=o.audio,A=f==="audio"&&t.id===1&&(e==null?void 0:e.container)==="audio/mpeg",M={execute:function(){if(a.executeStart=self.performance.now(),A){var W=l.sourceBuffer[f];if(W){var Z=i.start-W.timestampOffset;Math.abs(Z)>=.1&&(x.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+i.start+" (delta: "+Z+") sn: "+i.sn+")"),W.timestampOffset=i.start)}}l.appendExecutor(v,f)},onStart:function(){},onComplete:function(){var W=self.performance.now();a.executeEnd=a.end=W,h.first===0&&(h.first=W),d&&d.first===0&&(d.first=W);var Z=l.sourceBuffer,K={};for(var J in Z)K[J]=I.BufferHelper.getBuffered(Z[J]);l.appendError=0,l.hls.trigger(_.Events.BUFFER_APPENDED,{type:f,frag:i,part:r,chunkMeta:t,parent:i.type,timeRanges:K})},onError:function(W){x.logger.error("[buffer-controller]: Error encountered while trying to append to the "+f+" SourceBuffer",W);var Z={type:N.ErrorTypes.MEDIA_ERROR,parent:i.type,details:N.ErrorDetails.BUFFER_APPEND_ERROR,err:W,fatal:!1};W.code===DOMException.QUOTA_EXCEEDED_ERR?Z.details=N.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,Z.details=N.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>y.config.appendErrorMaxRetry&&(x.logger.error("[buffer-controller]: Failed "+y.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),Z.fatal=!0)),y.trigger(_.Events.ERROR,Z)}};c.append(M,f)},b.onBufferFlushing=function(n,s){var l=this,y=this.operationQueue,c=function(v){return{execute:l.removeExecutor.bind(l,v,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(_.Events.BUFFER_FLUSHED,{type:v})},onError:function(i){x.logger.warn("[buffer-controller]: Failed to remove from "+v+" SourceBuffer",i)}}};s.type?y.append(c(s.type),s.type):this.getSourceBufferTypes().forEach(function(o){y.append(c(o),o)})},b.onFragParsed=function(n,s){var l=this,y=s.frag,c=s.part,o=[],v=c?c.elementaryStreams:y.elementaryStreams;v[P.ElementaryStreamTypes.AUDIOVIDEO]?o.push("audiovideo"):(v[P.ElementaryStreamTypes.AUDIO]&&o.push("audio"),v[P.ElementaryStreamTypes.VIDEO]&&o.push("video"));var f=function(){var r=self.performance.now();y.stats.buffering.end=r,c&&(c.stats.buffering.end=r);var t=c?c.stats:y.stats;l.hls.trigger(_.Events.FRAG_BUFFERED,{frag:y,part:c,stats:t,id:y.type})};o.length===0&&x.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+y.type+" level: "+y.level+" sn: "+y.sn),this.blockBuffers(f,o)},b.onFragChanged=function(n,s){this.flushBackBuffer()},b.onBufferEos=function(n,s){var l=this,y=this.getSourceBufferTypes().reduce(function(c,o){var v=l.sourceBuffer[o];return(!s.type||s.type===o)&&(v&&!v.ended&&(v.ended=!0,x.logger.log("[buffer-controller]: "+o+" sourceBuffer now EOS"))),c&&!!(!v||v.ended)},!0);y&&this.blockBuffers(function(){var c=l.mediaSource;if(!c||c.readyState!=="open")return;c.endOfStream()})},b.onLevelUpdated=function(n,s){var l=s.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},b.flushBackBuffer=function(){var n=this.hls,s=this.details,l=this.media,y=this.sourceBuffer;if(!l||s===null)return;var c=this.getSourceBufferTypes();if(!c.length)return;var o=s.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(U.isFiniteNumber)(o)||o<0)return;var v=l.currentTime,f=s.levelTargetDuration,i=Math.max(o,f),r=Math.floor(v/f)*f-i;c.forEach(function(t){var a=y[t];if(a){var g=I.BufferHelper.getBuffered(a);g.length>0&&r>g.start(0)&&(n.trigger(_.Events.BACK_BUFFER_REACHED,{bufferEnd:r}),s.live&&n.trigger(_.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r}),n.trigger(_.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:t}))}})},b.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,s=this.hls,l=this.media,y=this.mediaSource,c=n.fragments[0].start+n.totalduration,o=l.duration,v=Object(U.isFiniteNumber)(y.duration)?y.duration:0;n.live&&s.config.liveDurationInfinity?(x.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),y.duration=Infinity,this.updateSeekableRange(n)):(c>v&&c>o||!Object(U.isFiniteNumber)(o))&&(x.logger.log("[buffer-controller]: Updating Media Source duration to "+c.toFixed(3)),y.duration=c)},b.updateSeekableRange=function(n){var s=this.mediaSource,l=n.fragments,y=l.length;if(y&&n.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var c=Math.max(0,l[0].start),o=Math.max(c,c+n.totalduration);s.setLiveSeekableRange(c,o)}},b.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,s=this.operationQueue,l=this.pendingTracks,y=Object.keys(l).length;if(y&&!n||y===2){this.createSourceBuffers(l),this.pendingTracks={};var c=this.getSourceBufferTypes();if(c.length===0){this.hls.trigger(_.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}c.forEach(function(o){s.executeNext(o)})}},b.createSourceBuffers=function(n){var s=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var y=0;for(var c in n)if(!s[c]){var o=n[c];if(!o)throw Error("source buffer exists for track "+c+", however track does not");var v=o.levelCodec||o.codec,f=o.container+";codecs="+v;x.logger.log("[buffer-controller]: creating sourceBuffer("+f+")");try{var i=s[c]=l.addSourceBuffer(f),r=c;this.addBufferListener(r,"updatestart",this._onSBUpdateStart),this.addBufferListener(r,"updateend",this._onSBUpdateEnd),this.addBufferListener(r,"error",this._onSBUpdateError),this.tracks[c]={buffer:i,codec:v,container:o.container,levelCodec:o.levelCodec,id:o.id},y++}catch(t){x.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(_.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:f})}}y&&this.hls.trigger(_.Events.BUFFER_CREATED,{tracks:this.tracks})},b._onSBUpdateStart=function(n){var s=this.operationQueue,l=s.current(n);l.onStart()},b._onSBUpdateEnd=function(n){var s=this.operationQueue,l=s.current(n);l.onComplete(),s.shiftAndExecuteNext(n)},b._onSBUpdateError=function(n,s){x.logger.error("[buffer-controller]: "+n+" SourceBuffer error",s),this.hls.trigger(_.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(n);l&&l.onError(s)},b.removeExecutor=function(n,s,l){var y=this.media,c=this.mediaSource,o=this.operationQueue,v=this.sourceBuffer,f=v[n];if(!y||!c||!f){x.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(n);return}var i=Object(U.isFiniteNumber)(y.duration)?y.duration:Infinity,r=Object(U.isFiniteNumber)(c.duration)?c.duration:Infinity,t=Math.max(0,s),a=Math.min(l,i,r);a>t?(x.logger.log("[buffer-controller]: Removing ["+t+","+a+"] from the "+n+" SourceBuffer"),console.assert(!f.updating,n+" sourceBuffer must not be updating"),f.remove(t,a)):o.shiftAndExecuteNext(n)},b.appendExecutor=function(n,s){var l=this.operationQueue,y=this.sourceBuffer,c=y[s];if(!c){x.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(s);return}c.ended=!1,console.assert(!c.updating,s+" sourceBuffer must not be updating"),c.appendBuffer(n)},b.blockBuffers=function(n,s){var l=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){x.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var y=this.operationQueue,c=s.map(function(o){return y.appendBlocker(o)});Promise.all(c).then(function(){n(),s.forEach(function(o){var v=l.sourceBuffer[o];(!v||!v.updating)&&y.shiftAndExecuteNext(o)})})},b.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},b.addBufferListener=function(n,s,l){var y=this.sourceBuffer[n];if(!y)return;var c=l.bind(this,n);this.listeners[n].push({event:s,listener:c}),y.addEventListener(s,c)},b.removeBufferListeners=function(n){var s=this.sourceBuffer[n];if(!s)return;this.listeners[n].forEach(function(l){s.removeEventListener(l.event,l.listener)})},C}()},"./src/controller/buffer-operation-queue.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return _});var U=w("./src/utils/logger.ts"),_=function(){function x(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var N=x.prototype;return N.append=function(S,P){var E=this.queues[P];E.push(S),E.length===1&&this.buffers[P]&&this.executeNext(P)},N.insertAbort=function(S,P){var E=this.queues[P];E.unshift(S),this.executeNext(P)},N.appendBlocker=function(S){var P,E=new Promise(function(R){P=R}),O={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(O,S),E},N.executeNext=function(S){var P=this.buffers,E=this.queues,O=P[S],R=E[S];if(R.length){var T=R[0];try{T.execute()}catch(C){U.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),T.onError(C),(!O||!O.updating)&&(R.shift(),this.executeNext(S))}}},N.shiftAndExecuteNext=function(S){this.queues[S].shift(),this.executeNext(S)},N.current=function(S){return this.queues[S][0]},x}()},"./src/controller/cap-level-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/events.ts");function _(I,S){for(var P=0;P<S.length;P++){var E=S[P];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(I,E.key,E)}}function x(I,S,P){return S&&_(I.prototype,S),P&&_(I,P),I}var N=function(){function I(P){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=P,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var S=I.prototype;return S.setStreamController=function(E){this.streamController=E},S.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},S.registerListeners=function(){var E=this.hls;E.on(U.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},S.unregisterListener=function(){var E=this.hls;E.off(U.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},S.onFpsDropLevelCapping=function(E,O){I.isLevelAllowed(O.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(O.droppedLevel)},S.onMediaAttaching=function(E,O){this.media=O.media instanceof HTMLVideoElement?O.media:null},S.onManifestParsed=function(E,O){var R=this.hls;this.restrictedLevels=[],this.firstLevel=O.firstLevel,R.config.capLevelToPlayerSize&&O.video&&this.startCapping()},S.onBufferCodecs=function(E,O){var R=this.hls;R.config.capLevelToPlayerSize&&O.video&&this.startCapping()},S.onMediaDetaching=function(){this.stopCapping()},S.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var O=this.hls;O.autoLevelCapping=this.getMaxLevel(E.length-1),O.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=O.autoLevelCapping}}},S.getMaxLevel=function(E){var O=this,R=this.hls.levels;if(!R.length)return-1;var T=R.filter(function(C,b){return I.isLevelAllowed(b,O.restrictedLevels)&&b<=E});return this.clientRect=null,I.getMaxLevelByMediaSize(T,this.mediaWidth,this.mediaHeight)},S.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()},S.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},S.getDimensions=function(){if(this.clientRect)return this.clientRect;var E=this.media,O={width:0,height:0};if(E){var R=E.getBoundingClientRect();O.width=R.width,O.height=R.height,!O.width&&!O.height&&(O.width=R.right-R.left||E.width||0,O.height=R.bottom-R.top||E.height||0)}return this.clientRect=O,O},I.isLevelAllowed=function(E,O){return O===void 0&&(O=[]),O.indexOf(E)===-1},I.getMaxLevelByMediaSize=function(E,O,R){if(!E||!E.length)return-1;for(var T=function(s,l){return l?s.width!==l.width||s.height!==l.height:!0},C=E.length-1,b=0;b<E.length;b+=1){var m=E[b];if((m.width>=O||m.height>=R)&&T(m,E[b+1])){C=b;break}}return C},x(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 E=1;try{E=self.devicePixelRatio}catch(O){}return E}}]),I}();B.default=N},"./src/controller/cmcd-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return T});var U=w("./src/events.ts"),_=w("./src/types/cmcd.ts"),x=w("./src/utils/buffer-helper.ts"),N=w("./src/utils/logger.ts");function I(C,b){for(var m=0;m<b.length;m++){var n=b[m];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(C,n.key,n)}}function S(C,b,m){return b&&I(C.prototype,b),m&&I(C,m),C}function P(C,b){var m=typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(m)return(m=m.call(C)).next.bind(m);if(Array.isArray(C)||(m=E(C))||b&&C&&typeof C.length=="number"){m&&(C=m);var n=0;return function(){return n>=C.length?{done:!0}:{done:!1,value:C[n++]}}}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(C,b){if(!C)return;if(typeof C=="string")return O(C,b);var m=Object.prototype.toString.call(C).slice(8,-1);if(m==="Object"&&C.constructor&&(m=C.constructor.name),m==="Map"||m==="Set")return Array.from(C);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return O(C,b)}function O(C,b){(b==null||b>C.length)&&(b=C.length);for(var m=0,n=new Array(b);m<b;m++)n[m]=C[m];return n}function R(){return R=Object.assign||function(C){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(C[n]=m[n])}return C},R.apply(this,arguments)}var T=function(){function C(m){var n=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(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(y){try{n.apply(y,{ot:_.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(c){N.logger.warn("Could not generate manifest CMCD data.",c)}},this.applyFragmentData=function(y){try{var c=y.frag,o=n.hls.levels[c.level],v=n.getObjectType(c),f={d:c.duration*1e3,ot:v};(v===_.CMCDObjectType.VIDEO||v===_.CMCDObjectType.AUDIO||v==_.CMCDObjectType.MUXED)&&(f.br=o.bitrate/1e3,f.tb=n.getTopBandwidth(v),f.bl=n.getBufferLength(v)),n.apply(y,f)}catch(i){N.logger.warn("Could not generate segment CMCD data.",i)}},this.hls=m;var s=this.config=m.config,l=s.cmcd;l!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=l.sessionId||C.uuid(),this.cid=l.contentId,this.useHeaders=l.useHeaders===!0,this.registerListeners())}var b=C.prototype;return b.registerListeners=function(){var n=this.hls;n.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this)},b.unregisterListeners=function(){var n=this.hls;n.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},b.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},b.onMediaAttached=function(n,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},b.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},b.onBufferCreated=function(n,s){var l,y;this.audioBuffer=(l=s.tracks.audio)===null||l===void 0?void 0:l.buffer,this.videoBuffer=(y=s.tracks.video)===null||y===void 0?void 0:y.buffer},b.createData=function(){var n;return{v:_.CMCDVersion,sf:_.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},b.apply=function(n,s){s===void 0&&(s={}),R(s,this.createData());var l=s.ot===_.CMCDObjectType.INIT||s.ot===_.CMCDObjectType.VIDEO||s.ot===_.CMCDObjectType.MUXED;if(this.starved&&l&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var y=C.toHeaders(s);if(!Object.keys(y).length)return;n.headers||(n.headers={}),R(n.headers,y)}else{var c=C.toQuery(s);if(!c)return;n.url=C.appendQueryToUri(n.url,c)}},b.getObjectType=function(n){var s=n.type;return s==="subtitle"?_.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?_.CMCDObjectType.INIT:s==="audio"?_.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?_.CMCDObjectType.VIDEO:_.CMCDObjectType.MUXED:void 0},b.getTopBandwidth=function(n){for(var s=0,l=n===_.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,y=P(l),c;!(c=y()).done;){var o=c.value;o.bitrate>s&&(s=o.bitrate)}return s>0?s:NaN},b.getBufferLength=function(n){var s=this.hls.media,l=n===_.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!s)return NaN;var y=x.BufferHelper.bufferInfo(l,s.currentTime,this.config.maxBufferHole);return y.len*1e3},b.createPlaylistLoader=function(){var n=this.config.pLoader,s=this.applyPlaylistData,l=n||this.config.loader;return function(){function y(o){this.loader=void 0,this.loader=new l(o)}var c=y.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(v,f,i){s(v),this.loader.load(v,f,i)},S(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},b.createFragmentLoader=function(){var n=this.config.fLoader,s=this.applyFragmentData,l=n||this.config.loader;return function(){function y(o){this.loader=void 0,this.loader=new l(o)}var c=y.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(v,f,i){s(v),this.loader.load(v,f,i)},S(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},C.uuid=function(){var n=URL.createObjectURL(new Blob),s=n.toString();return URL.revokeObjectURL(n),s.substr(s.lastIndexOf("/")+1)},C.serialize=function(n){for(var s=[],l=function(A){return!Number.isNaN(A)&&A!=null&&A!==""&&A!==!1},y=function(A){return Math.round(A)},c=function(A){return y(A/100)*100},o=function(A){return encodeURIComponent(A)},v={br:y,d:y,bl:c,dl:c,mtp:c,nor:o,rtp:c,tb:y},f=Object.keys(n||{}).sort(),i=P(f),r;!(r=i()).done;){var t=r.value,a=n[t];if(!l(a))continue;if(t==="v"&&a===1)continue;if(t=="pr"&&a===1)continue;var g=v[t];g&&(a=g(a));var h=typeof a,d=void 0;t==="ot"||t==="sf"||t==="st"?d=t+"="+a:h==="boolean"?d=t:h==="number"?d=t+"="+a:d=t+"="+JSON.stringify(a),s.push(d)}return s.join(",")},C.toHeaders=function(n){for(var s=Object.keys(n),l={},y=["Object","Request","Session","Status"],c=[{},{},{},{}],o={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},v=0,f=s;v<f.length;v++){var i=f[v],r=o[i]!=null?o[i]:1;c[r][i]=n[i]}for(var t=0;t<c.length;t++){var a=C.serialize(c[t]);a&&(l["CMCD-"+y[t]]=a)}return l},C.toQuery=function(n){return"CMCD="+encodeURIComponent(C.serialize(n))},C.appendQueryToUri=function(n,s){if(!s)return n;var l=n.includes("?")?"&":"?";return""+n+l+s},C}()},"./src/controller/eme-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/events.ts"),_=w("./src/errors.ts"),x=w("./src/utils/logger.ts"),N=w("./src/utils/mediakeys-helper.ts");function I(T,C){for(var b=0;b<C.length;b++){var m=C[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function S(T,C,b){return C&&I(T.prototype,C),b&&I(T,b),T}var P=3,E=function(C,b,m){var n={audioCapabilities:[],videoCapabilities:[]};return C.forEach(function(s){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:m.audioRobustness||""})}),b.forEach(function(s){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:m.videoRobustness||""})}),[n]},O=function(C,b,m,n){switch(C){case N.KeySystems.WIDEVINE:return E(b,m,n);default:throw new Error("Unknown key-system: "+C)}},R=function(){function T(b){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=b,this._config=b.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 C=T.prototype;return C.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},C._registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this)},C._unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this)},C.getLicenseServerUrl=function(m){switch(m){case N.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+m+'"')},C._attemptKeySystemAccess=function(m,n,s){var l=this,y=O(m,n,s,this._drmSystemOptions);x.logger.log("Requesting encrypted media key-system access");var c=this.requestMediaKeySystemAccess(m,y);this.mediaKeysPromise=c.then(function(o){return l._onMediaKeySystemAccessObtained(m,o)}),c.catch(function(o){x.logger.error('Failed to obtain key-system "'+m+'" access:',o)})},C._onMediaKeySystemAccessObtained=function(m,n){var s=this;x.logger.log('Access for key-system "'+m+'" obtained');var l={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:m};this._mediaKeysList.push(l);var y=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(c){return l.mediaKeys=c,x.logger.log('Media-keys created for key-system "'+m+'"'),s._onMediaKeysCreated(),c});return y.catch(function(c){x.logger.error("Failed to create media-keys:",c)}),y},C._onMediaKeysCreated=function(){var m=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),m._onNewMediaKeySession(n.mediaKeysSession))})},C._onNewMediaKeySession=function(m){var n=this;x.logger.log("New key-system session "+m.sessionId),m.addEventListener("message",function(s){n._onKeySessionMessage(m,s.message)},!1)},C._onKeySessionMessage=function(m,n){x.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(s){x.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),m.update(s)})},C.onMediaEncrypted=function(m){var n=this;if(x.logger.log('Media is encrypted using "'+m.initDataType+'" init data type'),!this.mediaKeysPromise){x.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(y){if(!n._media)return;n._attemptSetMediaKeys(y),n._generateRequestWithPreferredKeySession(m.initDataType,m.initData)};this.mediaKeysPromise.then(s).catch(s)},C._attemptSetMediaKeys=function(m){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){x.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}x.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},C._generateRequestWithPreferredKeySession=function(m,n){var s=this,l=this._mediaKeysList[0];if(!l){x.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(l.mediaKeysSessionInitialized){x.logger.warn("Key-Session already initialized but requested again");return}var y=l.mediaKeysSession;if(!y){x.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){x.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}x.logger.log('Generating key-session request for "'+m+'" init data type'),l.mediaKeysSessionInitialized=!0,y.generateRequest(m,n).then(function(){x.logger.debug("Key-session generation succeeded")}).catch(function(c){x.logger.error("Error generating key-session request:",c),s.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},C._createLicenseXhr=function(m,n,s){var l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,l,m,n,s);var y=this._licenseXhrSetup;if(y)try{y.call(this.hls,l,m),y=void 0}catch(c){x.logger.error(c)}try{l.readyState||l.open("POST",m,!0),y&&y.call(this.hls,l,m)}catch(c){throw new Error("issue setting up KeySystem license XHR "+c)}return l},C._onLicenseRequestReadyStageChange=function(m,n,s,l){switch(m.readyState){case 4:if(m.status===200){this._requestLicenseFailureCount=0,x.logger.log("License request succeeded");var y=m.response,c=this._licenseResponseCallback;if(c)try{y=c.call(this.hls,m,n)}catch(v){x.logger.error(v)}l(y)}else{if(x.logger.error("License Request XHR failed ("+n+"). Status: "+m.status+" ("+m.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>P){this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var o=P-this._requestLicenseFailureCount+1;x.logger.warn("Retrying license request, "+o+" attempts left"),this._requestLicense(s,l)}break}},C._generateLicenseRequestChallenge=function(m,n){switch(m.mediaKeySystemDomain){case N.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+m.mediaKeySystemDomain)},C._requestLicense=function(m,n){x.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){x.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(s.mediaKeySystemDomain),y=this._createLicenseXhr(l,m,n);x.logger.log("Sending license request to URL: "+l);var c=this._generateLicenseRequestChallenge(s,m);y.send(c)}catch(o){x.logger.error("Failure requesting DRM license: "+o),this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},C.onMediaAttached=function(m,n){if(!this._emeEnabled)return;var s=n.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},C.onMediaDetached=function(){var m=this._media,n=this._mediaKeysList;if(!m)return;m.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return m.setMediaKeys(null)}).catch(function(){})},C.onManifestParsed=function(m,n){if(!this._emeEnabled)return;var s=n.levels.map(function(y){return y.audioCodec}).filter(function(y){return!!y}),l=n.levels.map(function(y){return y.videoCodec}).filter(function(y){return!!y});this._attemptKeySystemAccess(N.KeySystems.WIDEVINE,s,l)},S(T,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),T}();B.default=R},"./src/controller/fps-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/events.ts"),_=w("./src/utils/logger.ts"),x=function(){function N(S){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=S,this.registerListeners()}var I=N.prototype;return I.setStreamController=function(P){this.streamController=P},I.registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},I.unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching)},I.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},I.onMediaAttaching=function(P,E){var O=this.hls.config;if(O.capLevelOnFPSDrop){var R=E.media instanceof self.HTMLVideoElement?E.media:null;this.media=R,R&&typeof R.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),O.fpsDroppedMonitoringPeriod)}},I.checkFPS=function(P,E,O){var R=performance.now();if(E){if(this.lastTime){var T=R-this.lastTime,C=O-this.lastDroppedFrames,b=E-this.lastDecodedFrames,m=1e3*C/T,n=this.hls;if(n.trigger(U.Events.FPS_DROP,{currentDropped:C,currentDecoded:b,totalDroppedFrames:O}),m>0&&C>n.config.fpsDroppedMonitoringThreshold*b){var s=n.currentLevel;_.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=s)&&(s=s-1,n.trigger(U.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:n.currentLevel}),n.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=R,this.lastDroppedFrames=O,this.lastDecodedFrames=E}},I.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var E=P.getVideoPlaybackQuality();this.checkFPS(P,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},N}();B.default=x},"./src/controller/fragment-finders.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"findFragmentByPDT",function(){return x}),w.d(B,"findFragmentByPTS",function(){return N}),w.d(B,"fragmentWithinToleranceTest",function(){return I}),w.d(B,"pdtWithinToleranceTest",function(){return S}),w.d(B,"findFragWithCC",function(){return P});var U=w("./src/polyfills/number.ts"),_=w("./src/utils/binary-search.ts");function x(E,O,R){if(O===null||!Array.isArray(E)||!E.length||!Object(U.isFiniteNumber)(O))return null;var T=E[0].programDateTime;if(O<(T||0))return null;var C=E[E.length-1].endProgramDateTime;if(O>=(C||0))return null;R=R||0;for(var b=0;b<E.length;++b){var m=E[b];if(S(O,R,m))return m}return null}function N(E,O,R,T){R===void 0&&(R=0),T===void 0&&(T=0);var C=null;if(E?C=O[E.sn-O[0].sn+1]||null:R===0&&O[0].start===0&&(C=O[0]),C&&I(R,T,C)===0)return C;var b=_.default.search(O,I.bind(null,R,T));return b||C}function I(E,O,R){E===void 0&&(E=0),O===void 0&&(O=0);var T=Math.min(O,R.duration+(R.deltaPTS?R.deltaPTS:0));return R.start+R.duration-T<=E?1:R.start-T>E&&R.start?-1:0}function S(E,O,R){var T=Math.min(O,R.duration+(R.deltaPTS?R.deltaPTS:0))*1e3,C=R.endProgramDateTime||0;return C-T>E}function P(E,O){return _.default.search(E,function(R){return R.cc<O?1:R.cc>O?-1:0})}},"./src/controller/fragment-tracker.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"FragmentState",function(){return x}),w.d(B,"FragmentTracker",function(){return N});var U=w("./src/events.ts"),_=w("./src/types/loader.ts"),x;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(x||(x={}));var N=function(){function P(O){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=O,this._registerListeners()}var E=P.prototype;return E._registerListeners=function(){var R=this.hls;R.on(U.Events.BUFFER_APPENDED,this.onBufferAppended,this),R.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),R.on(U.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var R=this.hls;R.off(U.Events.BUFFER_APPENDED,this.onBufferAppended,this),R.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),R.off(U.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(R,T){if(T===_.PlaylistLevelType.MAIN){var C=this.activeFragment,b=this.activeParts;if(!C)return null;if(b)for(var m=b.length;m--;){var n=b[m],s=n?n.end:C.appendedPTS;if(n.start<=R&&s!==void 0&&R<=s)return m>9&&(this.activeParts=b.slice(m-9)),n}else if(C.start<=R&&C.appendedPTS!==void 0&&R<=C.appendedPTS)return C}return this.getBufferedFrag(R,T)},E.getBufferedFrag=function(R,T){for(var C=this.fragments,b=Object.keys(C),m=b.length;m--;){var n=C[b[m]];if((n==null?void 0:n.body.type)===T&&n.buffered){var s=n.body;if(s.start<=R&&R<=s.end)return s}}return null},E.detectEvictedFragments=function(R,T,C){var b=this;Object.keys(this.fragments).forEach(function(m){var n=b.fragments[m];if(!n)return;if(!n.buffered){n.body.type===C&&b.removeFragment(n.body);return}var s=n.range[R];if(!s)return;s.time.some(function(l){var y=!b.isTimeBuffered(l.startPTS,l.endPTS,T);return y&&b.removeFragment(n.body),y})})},E.detectPartialFragments=function(R){var T=this,C=this.timeRanges,b=R.frag,m=R.part;if(!C||b.sn==="initSegment")return;var n=S(b),s=this.fragments[n];if(!s)return;Object.keys(C).forEach(function(l){var y=b.elementaryStreams[l];if(!y)return;var c=C[l],o=m!==null||y.partial===!0;s.range[l]=T.getBufferedTimes(b,m,o,c)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},E.fragBuffered=function(R){var T=S(R),C=this.fragments[T];C&&(C.backtrack=C.loaded=null,C.buffered=!0)},E.getBufferedTimes=function(R,T,C,b){for(var m={time:[],partial:C},n=T?T.start:R.start,s=T?T.end:R.end,l=R.minEndPTS||s,y=R.maxStartPTS||n,c=0;c<b.length;c++){var o=b.start(c)-this.bufferPadding,v=b.end(c)+this.bufferPadding;if(y>=o&&l<=v){m.time.push({startPTS:Math.max(n,b.start(c)),endPTS:Math.min(s,b.end(c))});break}else if(n<v&&s>o)m.partial=!0,m.time.push({startPTS:Math.max(n,b.start(c)),endPTS:Math.min(s,b.end(c))});else if(s<=o)break}return m},E.getPartialFragment=function(R){var T=null,C,b,m,n=0,s=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(y){var c=l[y];if(!c)return;I(c)&&(b=c.body.start-s,m=c.body.end+s,R>=b&&R<=m&&(C=Math.min(R-b,m-R),n<=C&&(T=c.body,n=C)))}),T},E.getState=function(R){var T=S(R),C=this.fragments[T];return C?C.buffered?I(C)?x.PARTIAL:x.OK:C.backtrack?x.BACKTRACKED:x.APPENDING:x.NOT_LOADED},E.backtrack=function(R,T){var C=S(R),b=this.fragments[C];if(!b||b.backtrack)return null;var m=b.backtrack=T||b.loaded;return b.loaded=null,m},E.getBacktrackData=function(R){var T=S(R),C=this.fragments[T];if(C){var b,m=C.backtrack;if(m!=null&&(b=m.payload)!==null&&b!==void 0&&b.byteLength)return m;this.removeFragment(R)}return null},E.isTimeBuffered=function(R,T,C){for(var b,m,n=0;n<C.length;n++){if(b=C.start(n)-this.bufferPadding,m=C.end(n)+this.bufferPadding,R>=b&&T<=m)return!0;if(T<=b)return!1}return!1},E.onFragLoaded=function(R,T){var C=T.frag,b=T.part;if(C.sn==="initSegment"||C.bitrateTest||b)return;var m=S(C);this.fragments[m]={body:C,loaded:T,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(R,T){var C=this,b=T.frag,m=T.part,n=T.timeRanges;if(b.type===_.PlaylistLevelType.MAIN)if(this.activeFragment=b,m){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(m)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(l){var y=n[l];if(C.detectEvictedFragments(l,y),!m)for(var c=0;c<y.length;c++)b.appendedPTS=Math.max(y.end(c),b.appendedPTS||0)})},E.onFragBuffered=function(R,T){this.detectPartialFragments(T)},E.hasFragment=function(R){var T=S(R);return!!this.fragments[T]},E.removeFragmentsInRange=function(R,T,C){var b=this;Object.keys(this.fragments).forEach(function(m){var n=b.fragments[m];if(!n)return;if(n.buffered){var s=n.body;s.type===C&&s.start<T&&s.end>R&&b.removeFragment(s)}})},E.removeFragment=function(R){var T=S(R);R.stats.loaded=0,R.clearElementaryStreamInfo(),delete this.fragments[T]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function I(P){var E,O;return P.buffered&&(((E=P.range.video)===null||E===void 0?void 0:E.partial)||((O=P.range.audio)===null||O===void 0?void 0:O.partial))}function S(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"STALL_MINIMUM_DURATION_MS",function(){return I}),w.d(B,"MAX_START_GAP_JUMP",function(){return S}),w.d(B,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),w.d(B,"SKIP_BUFFER_RANGE_START",function(){return E}),w.d(B,"default",function(){return O});var U=w("./src/utils/buffer-helper.ts"),_=w("./src/errors.ts"),x=w("./src/events.ts"),N=w("./src/utils/logger.ts"),I=250,S=2,P=.1,E=.05,O=function(){function R(C,b,m,n){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=C,this.media=b,this.fragmentTracker=m,this.hls=n}var T=R.prototype;return T.destroy=function(){this.hls=this.fragmentTracker=this.media=null},T.poll=function(b){var m=this.config,n=this.media,s=this.stalled,l=n.currentTime,y=n.seeking,c=this.seeking&&!y,o=!this.seeking&&y;if(this.seeking=y,l!==b){if(this.moved=!0,s!==null){if(this.stallReported){var v=self.performance.now()-s;N.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(v)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((o||c)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!U.BufferHelper.getBuffered(n).length)return;var f=U.BufferHelper.bufferInfo(n,l,0),i=f.len>0,r=f.nextStart||0;if(!i&&!r)return;if(y){var t=f.len>S,a=!r||r-l>S&&!this.fragmentTracker.getPartialFragment(l);if(t||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,h=Math.max(r,f.start||0)-l,d=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,e=d==null||((g=d.details)===null||g===void 0)?void 0:g.live,A=e?d.details.targetduration*2:S;if(h>0&&h<=A){this._trySkipBufferHole(null);return}}var M=self.performance.now();if(s===null){this.stalled=M;return}var F=M-s;!y&&F>=I&&this._reportStall(f.len);var W=U.BufferHelper.bufferInfo(n,l,m.maxBufferHole);this._tryFixBufferStall(W,F)},T._tryFixBufferStall=function(b,m){var n=this.config,s=this.fragmentTracker,l=this.media,y=l.currentTime,c=s.getPartialFragment(y);if(c){var o=this._trySkipBufferHole(c);if(o)return}b.len>n.maxBufferHole&&m>n.highBufferWatchdogPeriod*1e3&&(N.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},T._reportStall=function(b){var m=this.hls,n=this.media,s=this.stallReported;s||(this.stallReported=!0,N.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+b+")"),m.trigger(x.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:b}))},T._trySkipBufferHole=function(b){for(var m=this.config,n=this.hls,s=this.media,l=s.currentTime,y=0,c=U.BufferHelper.getBuffered(s),o=0;o<c.length;o++){var v=c.start(o);if(l+m.maxBufferHole>=y&&l<v){var f=Math.max(v+E,s.currentTime+P);return N.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+f),this.moved=!0,this.stalled=null,s.currentTime=f,b&&n.trigger(x.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+f,frag:b}),f}y=c.end(o)}return 0},T._tryNudgeBuffer=function(){var b=this.config,m=this.hls,n=this.media,s=n.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<b.nudgeMaxRetry){var y=s+l*b.nudgeOffset;N.logger.warn("Nudging 'currentTime' from "+s+" to "+y),n.currentTime=y,m.trigger(x.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else N.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+b.nudgeMaxRetry+" nudges"),m.trigger(x.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},R}()},"./src/controller/id3-track-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/events.ts"),_=w("./src/utils/texttrack-utils.ts"),x=w("./src/demux/id3.ts"),N=.25,I=function(){function S(E){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=E,this._registerListeners()}var P=S.prototype;return P.destroy=function(){this._unregisterListeners()},P._registerListeners=function(){var O=this.hls;O.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(U.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),O.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P._unregisterListeners=function(){var O=this.hls;O.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(U.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),O.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P.onMediaAttached=function(O,R){this.media=R.media},P.onMediaDetaching=function(){if(!this.id3Track)return;Object(_.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},P.getID3Track=function(O){if(!this.media)return;for(var R=0;R<O.length;R++){var T=O[R];if(T.kind==="metadata"&&T.label==="id3")return Object(_.sendAddTrackEvent)(T,this.media),T}return this.media.addTextTrack("metadata","id3")},P.onFragParsingMetadata=function(O,R){if(!this.media)return;var T=R.frag,C=R.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var b=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,m=0;m<C.length;m++){var n=x.getID3Frames(C[m].data);if(n){var s=C[m].pts,l=m<C.length-1?C[m+1].pts:T.end,y=l-s;y<=0&&(l=s+N);for(var c=0;c<n.length;c++){var o=n[c];if(!x.isTimeStampFrame(o)){var v=new b(s,l,"");v.value=o,this.id3Track.addCue(v)}}}}},P.onBufferFlushing=function(O,R){var T=R.startOffset,C=R.endOffset,b=R.type;if(!b||b==="audio"){var m=this.id3Track;m&&Object(_.removeCuesInRange)(m,T,C)}},S}();B.default=I},"./src/controller/latency-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return S});var U=w("./src/errors.ts"),_=w("./src/events.ts"),x=w("./src/utils/logger.ts");function N(P,E){for(var O=0;O<E.length;O++){var R=E[O];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(P,R.key,R)}}function I(P,E,O){return E&&N(P.prototype,E),O&&N(P,O),P}var S=function(){function P(O){var R=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 R.timeupdate()},this.hls=O,this.config=O.config,this.registerListeners()}var E=P.prototype;return E.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},E.registerListeners=function(){this.hls.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(_.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(_.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){this.hls.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(_.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(_.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(_.Events.ERROR,this.onError)},E.onMediaAttached=function(R,T){this.media=T.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},E.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},E.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},E.onLevelUpdated=function(R,T){var C=T.details;this.levelDetails=C,C.advanced&&this.timeupdate(),!C.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},E.onError=function(R,T){if(T.details!==U.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,x.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},E.timeupdate=function(){var R=this.media,T=this.levelDetails;if(!R||!T)return;this.currentTime=R.currentTime;var C=this.computeLatency();if(C===null)return;this._latency=C;var b=this.config,m=b.lowLatencyMode,n=b.maxLiveSyncPlaybackRate;if(!m||n===1)return;var s=this.targetLatency;if(s===null)return;var l=C-s,y=Math.min(this.maxLatency,s+T.targetduration),c=l<y;if(T.live&&c&&l>.05&&this.forwardBufferLength>1){var o=Math.min(2,Math.max(1,n)),v=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;R.playbackRate=Math.min(o,Math.max(1,v))}else R.playbackRate!==1&&R.playbackRate!==0&&(R.playbackRate=1)},E.estimateLiveEdge=function(){var R=this.levelDetails;return R===null?null:R.edge+R.age},E.computeLatency=function(){var R=this.estimateLiveEdge();return R===null?null:R-this.currentTime},I(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var R=this.config,T=this.levelDetails;return R.liveMaxLatencyDuration!==void 0?R.liveMaxLatencyDuration:T?R.liveMaxLatencyDurationCount*T.targetduration:0}},{key:"targetLatency",get:function(){var R=this.levelDetails;if(R===null)return null;var T=R.holdBack,C=R.partHoldBack,b=R.targetduration,m=this.config,n=m.liveSyncDuration,s=m.liveSyncDurationCount,l=m.lowLatencyMode,y=this.hls.userConfig,c=l&&C||T;(y.liveSyncDuration||y.liveSyncDurationCount||c===0)&&(c=n!==void 0?n:s*b);var o=b,v=1;return c+Math.min(this.stallCount*v,o)}},{key:"liveSyncPosition",get:function(){var R=this.estimateLiveEdge(),T=this.targetLatency,C=this.levelDetails;if(R===null||T===null||C===null)return null;var b=C.edge,m=R-T-this.edgeStalled,n=b-C.totalduration,s=b-(this.config.lowLatencyMode&&C.partTarget||C.targetduration);return Math.min(Math.max(n,m),s)}},{key:"drift",get:function(){var R=this.levelDetails;return R===null?1:R.drift}},{key:"edgeStalled",get:function(){var R=this.levelDetails;if(R===null)return 0;var T=(this.config.lowLatencyMode&&R.partTarget||R.targetduration)*3;return Math.max(R.age-T,0)}},{key:"forwardBufferLength",get:function(){var R=this.media,T=this.levelDetails;if(!R||!T)return 0;var C=R.buffered.length;return C?R.buffered.end(C-1):T.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return m});var U=w("./src/types/level.ts"),_=w("./src/events.ts"),x=w("./src/errors.ts"),N=w("./src/utils/codecs.ts"),I=w("./src/controller/level-helper.ts"),S=w("./src/controller/base-playlist-controller.ts"),P=w("./src/types/loader.ts");function E(){return E=Object.assign||function(n){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var y in l)Object.prototype.hasOwnProperty.call(l,y)&&(n[y]=l[y])}return n},E.apply(this,arguments)}function O(n,s){for(var l=0;l<s.length;l++){var y=s[l];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(n,y.key,y)}}function R(n,s,l){return s&&O(n.prototype,s),l&&O(n,l),n}function T(n,s){n.prototype=Object.create(s.prototype),n.prototype.constructor=n,C(n,s)}function C(n,s){return C=Object.setPrototypeOf||function(y,c){return y.__proto__=c,y},C(n,s)}var b=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),m=function(n){T(s,n);function s(y){var c;return c=n.call(this,y,"[level-controller]")||this,c._levels=[],c._firstLevel=-1,c._startLevel=void 0,c.currentLevelIndex=-1,c.manualLevelIndex=-1,c.onParsedComplete=void 0,c._registerListeners(),c}var l=s.prototype;return l._registerListeners=function(){var c=this.hls;c.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(_.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(_.Events.ERROR,this.onError,this)},l._unregisterListeners=function(){var c=this.hls;c.off(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(_.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(_.Events.ERROR,this.onError,this)},l.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},l.startLoad=function(){var c=this._levels;c.forEach(function(o){o.loadError=0}),n.prototype.startLoad.call(this)},l.onManifestLoaded=function(c,o){var v=[],f=[],i=[],r,t={},a,g=!1,h=!1,d=!1;if(o.levels.forEach(function(F){var W=F.attrs;g=g||!!(F.width&&F.height),h=h||!!F.videoCodec,d=d||!!F.audioCodec,b&&F.audioCodec&&F.audioCodec.indexOf("mp4a.40.34")!==-1&&(F.audioCodec=void 0);var Z=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;a=t[Z],a?a.url.push(F.url):(a=new U.Level(F),t[Z]=a,v.push(a)),W&&(W.AUDIO&&Object(I.addGroupId)(a,"audio",W.AUDIO),W.SUBTITLES&&Object(I.addGroupId)(a,"text",W.SUBTITLES))}),(g||h)&&d&&(v=v.filter(function(F){var W=F.videoCodec,Z=F.width,K=F.height;return!!W||!!(Z&&K)})),v=v.filter(function(F){var W=F.audioCodec,Z=F.videoCodec;return(!W||Object(N.isCodecSupportedInMp4)(W,"audio"))&&(!Z||Object(N.isCodecSupportedInMp4)(Z,"video"))}),o.audioTracks&&(f=o.audioTracks.filter(function(F){return!F.audioCodec||Object(N.isCodecSupportedInMp4)(F.audioCodec,"audio")}),Object(I.assignTrackIdsByGroup)(f)),o.subtitles&&(i=o.subtitles,Object(I.assignTrackIdsByGroup)(i)),v.length>0){r=v[0].bitrate,v.sort(function(F,W){return F.bitrate-W.bitrate}),this._levels=v;for(var e=0;e<v.length;e++)if(v[e].bitrate===r){this._firstLevel=e,this.log("manifest loaded, "+v.length+" level(s) found, first bitrate: "+r);break}var A=d&&!h,M={levels:v,audioTracks:f,subtitleTracks:i,firstLevel:this._firstLevel,stats:o.stats,audio:d,video:h,altAudio:!A&&f.some(function(F){return!!F.url})};this.hls.trigger(_.Events.MANIFEST_PARSED,M),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(_.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:o.url,reason:"no level with compatible codecs found in manifest"})},l.onError=function(c,o){if(n.prototype.onError.call(this,c,o),o.fatal)return;var v=o.context,f=this._levels[this.currentLevelIndex];if(v&&(v.type===P.PlaylistContextType.AUDIO_TRACK&&f.audioGroupIds&&v.groupId===f.audioGroupIds[f.urlId]||v.type===P.PlaylistContextType.SUBTITLE_TRACK&&f.textGroupIds&&v.groupId===f.textGroupIds[f.urlId])){this.redundantFailover(this.currentLevelIndex);return}var i=!1,r=!0,t;switch(o.details){case x.ErrorDetails.FRAG_LOAD_ERROR:case x.ErrorDetails.FRAG_LOAD_TIMEOUT:case x.ErrorDetails.KEY_LOAD_ERROR:case x.ErrorDetails.KEY_LOAD_TIMEOUT:if(o.frag){var a=this._levels[o.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(t=o.frag.level)):t=o.frag.level}break;case x.ErrorDetails.LEVEL_LOAD_ERROR:case x.ErrorDetails.LEVEL_LOAD_TIMEOUT:v&&(v.deliveryDirectives&&(r=!1),t=v.level),i=!0;break;case x.ErrorDetails.REMUX_ALLOC_ERROR:t=o.level,i=!0;break}t!==void 0&&this.recoverLevel(o,t,i,r)},l.recoverLevel=function(c,o,v,f){var i=c.details,r=this._levels[o];if(r.loadError++,v){var t=this.retryLoadingOrFail(c);if(t)c.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(f){var a=r.url.length;if(a>1&&r.loadError<a)c.levelRetry=!0,this.redundantFailover(o);else if(this.manualLevelIndex===-1){var g=o===0?this._levels.length-1:o-1;this.currentLevelIndex!==g&&this._levels[g].loadError===0&&(this.warn(i+": switch to "+g),c.levelRetry=!0,this.hls.nextAutoLevel=g)}}},l.redundantFailover=function(c){var o=this._levels[c],v=o.url.length;if(v>1){var f=(o.urlId+1)%v;this.warn("Switching to redundant URL-id "+f),this._levels.forEach(function(i){i.urlId=f}),this.level=c}},l.onFragLoaded=function(c,o){var v=o.frag;if(v!==void 0&&v.type===P.PlaylistLevelType.MAIN){var f=this._levels[v.level];f!==void 0&&(f.fragmentError=0,f.loadError=0)}},l.onLevelLoaded=function(c,o){var v,f=o.level,i=o.details,r=this._levels[f];if(!r){var t;this.warn("Invalid level index "+f),(t=o.deliveryDirectives)!==null&&t!==void 0&&t.skip&&(i.deltaUpdateFailed=!0);return}f===this.currentLevelIndex?(r.fragmentError===0&&(r.loadError=0,this.retryCount=0),this.playlistLoaded(f,o,r.details)):(v=o.deliveryDirectives)!==null&&v!==void 0&&v.skip&&(i.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(c,o){var v=this.hls.levels[this.currentLevelIndex];if(!v)return;if(v.audioGroupIds){for(var f=-1,i=this.hls.audioTracks[o.id].groupId,r=0;r<v.audioGroupIds.length;r++)if(v.audioGroupIds[r]===i){f=r;break}f!==v.urlId&&(v.urlId=f,this.startLoad())}},l.loadPlaylist=function(c){var o=this.currentLevelIndex,v=this._levels[o];if(this.canLoad&&v&&v.url.length>0){var f=v.urlId,i=v.url[f];if(c)try{i=c.addDirectives(i)}catch(r){this.warn("Could not construct new URL with HLS Delivery Directives: "+r)}this.log("Attempt loading level index "+o+(c?" at sn "+c.msn+" part "+c.part:"")+" with URL-id "+f+" "+i),this.clearTimer(),this.hls.trigger(_.Events.LEVEL_LOADING,{url:i,level:o,id:f,deliveryDirectives:c||null})}},l.removeLevel=function(c,o){var v=function(r,t){return t!==o},f=this._levels.filter(function(i,r){return r!==c?!0:i.url.length>1&&o!==void 0?(i.url=i.url.filter(v),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(v)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(v)),i.urlId=0,!0):!1}).map(function(i,r){var t=i.details;return t!=null&&t.fragments&&t.fragments.forEach(function(a){a.level=r}),i});this._levels=f,this.hls.trigger(_.Events.LEVELS_UPDATED,{levels:f})},R(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(c){var o,v=this._levels;if(v.length===0)return;if(this.currentLevelIndex===c&&(o=v[c])!==null&&o!==void 0&&o.details)return;if(c<0||c>=v.length){var f=c<0;if(this.hls.trigger(_.Events.ERROR,{type:x.ErrorTypes.OTHER_ERROR,details:x.ErrorDetails.LEVEL_SWITCH_ERROR,level:c,fatal:f,reason:"invalid level idx"}),f)return;c=Math.min(c,v.length-1)}this.clearTimer();var i=this.currentLevelIndex,r=v[i],t=v[c];this.log("switching to level "+c+" from "+i),this.currentLevelIndex=c;var a=E({},t,{level:c,maxBitrate:t.maxBitrate,uri:t.uri,urlId:t.urlId});delete a._urlId,this.hls.trigger(_.Events.LEVEL_SWITCHING,a);var g=t.details;if(!g||g.live){var h=this.switchParams(t.uri,r==null?void 0:r.details);this.loadPlaylist(h)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(c){this.manualLevelIndex=c,this._startLevel===void 0&&(this._startLevel=c),c!==-1&&(this.level=c)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(c){this._firstLevel=c}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var c=this.hls.config.startLevel;return c!==void 0?c:this._firstLevel}else return this._startLevel},set:function(c){this._startLevel=c}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(c){this.level=c,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=c)}}]),s}(S.default)},"./src/controller/level-helper.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"addGroupId",function(){return x}),w.d(B,"assignTrackIdsByGroup",function(){return N}),w.d(B,"updatePTS",function(){return I}),w.d(B,"updateFragPTSDTS",function(){return P}),w.d(B,"mergeDetails",function(){return E}),w.d(B,"mapPartIntersection",function(){return O}),w.d(B,"mapFragmentIntersection",function(){return R}),w.d(B,"adjustSliding",function(){return T}),w.d(B,"addSliding",function(){return C}),w.d(B,"computeReloadInterval",function(){return b}),w.d(B,"getFragmentWithSN",function(){return m}),w.d(B,"getPartWith",function(){return n});var U=w("./src/polyfills/number.ts"),_=w("./src/utils/logger.ts");function x(s,l,y){switch(l){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(y);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(y);break}}function N(s){var l={};s.forEach(function(y){var c=y.groupId||"";y.id=l[c]=l[c]||0,l[c]++})}function I(s,l,y){var c=s[l],o=s[y];S(c,o)}function S(s,l){var y=l.startPTS;if(Object(U.isFiniteNumber)(y)){var c=0,o;l.sn>s.sn?(c=y-s.start,o=s):(c=s.start-y,o=l),o.duration!==c&&(o.duration=c)}else if(l.sn>s.sn){var v=s.cc===l.cc;v&&s.minEndPTS?l.start=s.start+(s.minEndPTS-s.start):l.start=s.start+s.duration}else l.start=Math.max(s.start-l.duration,0)}function P(s,l,y,c,o,v){var f=c-y;f<=0&&(_.logger.warn("Fragment should have a positive duration",l),c=y+l.duration,v=o+l.duration);var i=y,r=c,t=l.startPTS,a=l.endPTS;if(Object(U.isFiniteNumber)(t)){var g=Math.abs(t-y);Object(U.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(g,l.deltaPTS):l.deltaPTS=g,i=Math.max(y,t),y=Math.min(y,t),o=Math.min(o,l.startDTS),r=Math.min(c,a),c=Math.max(c,a),v=Math.max(v,l.endDTS)}l.duration=c-y;var h=y-l.start;l.appendedPTS=c,l.start=l.startPTS=y,l.maxStartPTS=i,l.startDTS=o,l.endPTS=c,l.minEndPTS=r,l.endDTS=v;var d=l.sn;if(!s||d<s.startSN||d>s.endSN)return 0;var e,A=d-s.startSN,M=s.fragments;for(M[A]=l,e=A;e>0;e--)S(M[e],M[e-1]);for(e=A;e<M.length-1;e++)S(M[e],M[e+1]);return s.fragmentHint&&S(M[M.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,h}function E(s,l){for(var y=null,c=s.fragments,o=c.length-1;o>=0;o--){var v=c[o].initSegment;if(v){y=v;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var f=0,i;if(R(s,l,function(e,A){e.relurl&&(f=e.cc-A.cc),Object(U.isFiniteNumber)(e.startPTS)&&Object(U.isFiniteNumber)(e.endPTS)&&(A.start=A.startPTS=e.startPTS,A.startDTS=e.startDTS,A.appendedPTS=e.appendedPTS,A.maxStartPTS=e.maxStartPTS,A.endPTS=e.endPTS,A.endDTS=e.endDTS,A.minEndPTS=e.minEndPTS,A.duration=e.endPTS-e.startPTS,A.duration&&(i=A),l.PTSKnown=l.alignedSliding=!0),A.elementaryStreams=e.elementaryStreams,A.loader=e.loader,A.stats=e.stats,A.urlId=e.urlId,e.initSegment&&(A.initSegment=e.initSegment,y=e.initSegment)}),y){var r=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;r.forEach(function(e){var A;(!e.initSegment||e.initSegment.relurl===((A=y)===null||A===void 0?void 0:A.relurl))&&(e.initSegment=y)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(e){return!e}),l.deltaUpdateFailed)){_.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var t=l.skippedSegments;t--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var a=l.fragments;if(f){_.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<a.length;g++)a[g].cc+=f}l.skippedSegments&&(l.startCC=l.fragments[0].cc),O(s.partList,l.partList,function(e,A){A.elementaryStreams=e.elementaryStreams,A.stats=e.stats}),i?P(l,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):T(s,l),a.length&&(l.totalduration=l.edge-a[0].start),l.driftStartTime=s.driftStartTime,l.driftStart=s.driftStart;var h=l.advancedDateTime;if(l.advanced&&h){var d=l.edge;l.driftStart||(l.driftStartTime=h,l.driftStart=d),l.driftEndTime=h,l.driftEnd=d}else l.driftEndTime=s.driftEndTime,l.driftEnd=s.driftEnd,l.advancedDateTime=s.advancedDateTime}function O(s,l,y){if(s&&l)for(var c=0,o=0,v=s.length;o<=v;o++){var f=s[o],i=l[o+c];f&&i&&f.index===i.index&&f.fragment.sn===i.fragment.sn?y(f,i):c--}}function R(s,l,y){for(var c=l.skippedSegments,o=Math.max(s.startSN,l.startSN)-l.startSN,v=(s.fragmentHint?1:0)+(c?l.endSN:Math.min(s.endSN,l.endSN))-l.startSN,f=l.startSN-s.startSN,i=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,r=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,t=o;t<=v;t++){var a=r[f+t],g=i[t];c&&!g&&t<c&&(g=l.fragments[t]=a),a&&g&&y(a,g)}}function T(s,l){var y=l.startSN+l.skippedSegments-s.startSN,c=s.fragments;if(y<0||y>=c.length)return;C(l,c[y].start)}function C(s,l){if(l){for(var y=s.fragments,c=s.skippedSegments;c<y.length;c++)y[c].start+=l;s.fragmentHint&&(s.fragmentHint.start+=l)}}function b(s,l){var y=1e3*s.levelTargetDuration,c=y/2,o=s.age,v=o>0&&o<y*3,f=l.loading.end-l.loading.start,i,r=s.availabilityDelay;if(s.updated===!1)if(v){var t=333*s.misses;i=Math.max(Math.min(c,f*2),t),s.availabilityDelay=(s.availabilityDelay||0)+i}else i=c;else v?(r=Math.min(r||y/2,o),s.availabilityDelay=r,i=r+y-o):i=y-f;return Math.round(i)}function m(s,l,y){if(!s||!s.details)return null;var c=s.details,o=c.fragments[l-c.startSN];return o||(o=c.fragmentHint,o&&o.sn===l?o:l<c.startSN&&y&&y.sn===l?y:null)}function n(s,l,y){if(!s||!s.details)return null;var c=s.details.partList;if(c)for(var o=c.length;o--;){var v=c[o];if(v.index===y&&v.fragment.sn===l)return v}return null}},"./src/controller/stream-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return c});var U=w("./src/polyfills/number.ts"),_=w("./src/controller/base-stream-controller.ts"),x=w("./src/is-supported.ts"),N=w("./src/events.ts"),I=w("./src/utils/buffer-helper.ts"),S=w("./src/controller/fragment-tracker.ts"),P=w("./src/types/loader.ts"),E=w("./src/loader/fragment.ts"),O=w("./src/demux/transmuxer-interface.ts"),R=w("./src/types/transmuxer.ts"),T=w("./src/controller/gap-controller.ts"),C=w("./src/errors.ts"),b=w("./src/utils/logger.ts");function m(o,v){for(var f=0;f<v.length;f++){var i=v[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,i.key,i)}}function n(o,v,f){return v&&m(o.prototype,v),f&&m(o,f),o}function s(o,v){o.prototype=Object.create(v.prototype),o.prototype.constructor=o,l(o,v)}function l(o,v){return l=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},l(o,v)}var y=100,c=function(o){s(v,o);function v(i,r){var t;return t=o.call(this,i,r,"[stream-controller]")||this,t.audioCodecSwap=!1,t.gapController=null,t.level=-1,t._forceStartLoad=!1,t.altAudio=!1,t.audioOnly=!1,t.fragPlaying=null,t.onvplaying=null,t.onvseeked=null,t.fragLastKbps=0,t.stalled=!1,t.couldBacktrack=!1,t.audioCodecSwitch=!1,t.videoBuffer=null,t._registerListeners(),t}var f=v.prototype;return f._registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),r.on(N.Events.ERROR,this.onError,this),r.on(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),r.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this),r.on(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),r.on(N.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),r.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),r.off(N.Events.ERROR,this.onError,this),r.off(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),r.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),r.off(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),r.off(N.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),r.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},f.startLoad=function(r){if(this.levels){var t=this.lastCurrentTime,a=this.hls;if(this.stopLoad(),this.setInterval(y),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var g=a.startLevel;g===-1&&(a.config.testBandwidth?(g=0,this.bitrateTest=!0):g=a.nextAutoLevel),this.level=a.nextLoadLevel=g,this.loadedmetadata=!1}t>0&&r===-1&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),r=t),this.state=_.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()}else this._forceStartLoad=!0,this.state=_.State.STOPPED},f.stopLoad=function(){this._forceStartLoad=!1,o.prototype.stopLoad.call(this)},f.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_LEVEL:{var r,t=this.levels,a=this.level,g=t==null||((r=t[a])===null||r===void 0)?void 0:r.details;if(g&&(!g.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(g))break;this.state=_.State.IDLE;break}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var h,d=self.performance.now(),e=this.retryDate;(!e||d>=e||(h=this.media)!==null&&h!==void 0&&h.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=_.State.IDLE)}break;default:break}this.onTickEnd()},f.onTickEnd=function(){o.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},f.doTickIdle=function(){var r,t,a=this.hls,g=this.levelLastLoaded,h=this.levels,d=this.media,e=a.config,A=a.nextLoadLevel;if(g===null||!d&&(this.startFragRequested||!e.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!h||!h[A])return;var M=h[A];this.level=a.nextLoadLevel=A;var F=M.details;if(!F||this.state===_.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==A){this.state=_.State.WAITING_LEVEL;return}var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:d,P.PlaylistLevelType.MAIN);if(W===null)return;var Z=W.len,K=this.getMaxBufferLength(M.maxBitrate);if(Z>=K)return;if(this._streamEnded(W,F)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(N.Events.BUFFER_EOS,J),this.state=_.State.ENDED;return}var oe=W.end,se=this.getNextFragment(oe,F);if(this.couldBacktrack&&!this.fragPrevious&&se&&se.sn!=="initSegment"){var pe=se.sn-F.startSN;pe>1&&(se=F.fragments[pe-1],this.fragmentTracker.removeFragment(se))}if(se&&this.fragmentTracker.getState(se)===S.FragmentState.OK&&this.nextLoadPosition>oe){var be=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(d,be,P.PlaylistLevelType.MAIN),se=this.getNextFragment(this.nextLoadPosition,F)}if(!se)return;se.initSegment&&!se.initSegment.data&&!this.bitrateTest&&(se=se.initSegment),((r=se.decryptdata)===null||r===void 0?void 0:r.keyFormat)==="identity"&&!((t=se.decryptdata)!==null&&t!==void 0&&t.key)?this.loadKey(se,F):this.loadFragment(se,F,oe)},f.loadFragment=function(r,t,a){var g,h=this.fragmentTracker.getState(r);if(this.fragCurrent=r,h===S.FragmentState.BACKTRACKED){var d=this.fragmentTracker.getBacktrackData(r);if(d){this._handleFragmentLoadProgress(d),this._handleFragmentLoadComplete(d);return}else h=S.FragmentState.NOT_LOADED}h===S.FragmentState.NOT_LOADED||h===S.FragmentState.PARTIAL?r.sn==="initSegment"?this._loadInitSegment(r):this.bitrateTest?(r.bitrateTest=!0,this.log("Fragment "+r.sn+" of level "+r.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(r)):(this.startFragRequested=!0,o.prototype.loadFragment.call(this,r,t,a)):h===S.FragmentState.APPENDING?this.reduceMaxBufferLength(r.duration)&&this.fragmentTracker.removeFragment(r):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},f.getAppendedFrag=function(r){var t=this.fragmentTracker.getAppendedFrag(r,P.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},f.getBufferedFrag=function(r){return this.fragmentTracker.getBufferedFrag(r,P.PlaylistLevelType.MAIN)},f.followingBufferedFrag=function(r){return r?this.getBufferedFrag(r.end+.5):null},f.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},f.nextLevelSwitch=function(){var r=this.levels,t=this.media;if(t!=null&&t.readyState){var a,g=this.getAppendedFrag(t.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!t.paused&&r){var h=this.hls.nextLoadLevel,d=r[h],e=this.fragLastKbps;e&&this.fragCurrent?a=this.fragCurrent.duration*d.maxBitrate/(1e3*e)+1:a=0}else a=0;var A=this.getBufferedFrag(t.currentTime+a);if(A){var M=this.followingBufferedFrag(A);if(M){this.abortCurrentFrag();var F=M.maxStartPTS?M.maxStartPTS:M.start,W=M.duration,Z=Math.max(A.end,F+Math.min(Math.max(W-this.config.maxFragLookUpTolerance,W*.5),W*.75));this.flushMainBuffer(Z,Number.POSITIVE_INFINITY)}}}},f.abortCurrentFrag=function(){var r=this.fragCurrent;this.fragCurrent=null,r!=null&&r.loader&&r.loader.abort(),this.state===_.State.KEY_LOADING&&(this.state=_.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},f.flushMainBuffer=function(r,t){o.prototype.flushMainBuffer.call(this,r,t,this.altAudio?"video":null)},f.onMediaAttached=function(r,t){o.prototype.onMediaAttached.call(this,r,t);var a=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new T.default(this.config,a,this.fragmentTracker,this.hls)},f.onMediaDetaching=function(){var r=this.media;r&&(r.removeEventListener("playing",this.onvplaying),r.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),o.prototype.onMediaDetaching.call(this)},f.onMediaPlaying=function(){this.tick()},f.onMediaSeeked=function(){var r=this.media,t=r?r.currentTime:null;Object(U.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},f.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(N.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},f.onManifestParsed=function(r,t){var a=!1,g=!1,h;t.levels.forEach(function(d){h=d.audioCodec,h&&(h.indexOf("mp4a.40.2")!==-1&&(a=!0),h.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=a&&g&&!Object(x.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},f.onLevelLoading=function(r,t){var a=this.levels;if(!a||this.state!==_.State.IDLE)return;var g=a[t.level];(!g.details||g.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(g.details))&&(this.state=_.State.WAITING_LEVEL)},f.onLevelLoaded=function(r,t){var a,g=this.levels,h=t.level,d=t.details,e=d.totalduration;if(!g){this.warn("Levels were reset while loading level "+h);return}this.log("Level "+h+" loaded ["+d.startSN+","+d.endSN+"], cc ["+d.startCC+", "+d.endCC+"] duration:"+e);var A=this.fragCurrent;A&&(this.state===_.State.FRAG_LOADING||this.state===_.State.FRAG_LOADING_WAITING_RETRY)&&(A.level!==t.level&&A.loader&&(this.state=_.State.IDLE,A.loader.abort()));var M=g[h],F=0;if(d.live||(a=M.details)!==null&&a!==void 0&&a.live){if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed)return;F=this.alignPlaylists(d,M.details)}if(M.details=d,this.levelLastLoaded=h,this.hls.trigger(N.Events.LEVEL_UPDATED,{details:d,level:h}),this.state===_.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(d))return;this.state=_.State.IDLE}this.startFragRequested?d.live&&this.synchronizeToLiveEdge(d):this.setStartPosition(d,F),this.tick()},f._handleFragmentLoadProgress=function(r){var t,a=r.frag,g=r.part,h=r.payload,d=this.levels;if(!d){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var e=d[a.level],A=e.details;if(!A){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var M=e.videoCodec,F=A.PTSKnown||!A.live,W=(t=a.initSegment)===null||t===void 0?void 0:t.data,Z=this._getAudioCodec(e),K=this.transmuxer=this.transmuxer||new O.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=g?g.index:-1,oe=J!==-1,se=new R.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,h.byteLength,J,oe),pe=this.initPTS[a.cc];K.push(h,W,Z,M,a,g,A.totalduration,F,se,pe)},f.onAudioTrackSwitching=function(r,t){var a=this.altAudio,g=!!t.url,h=t.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 d=this.fragCurrent;d!=null&&d.loader&&(this.log("Switching to main audio track, cancel main fragment load"),d.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var e=this.hls;a&&e.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),e.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:h})}},f.onAudioTrackSwitched=function(r,t){var a=t.id,g=!!this.hls.audioTracks[a].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()},f.onBufferCreated=function(r,t){var a=t.tracks,g,h,d=!1;for(var e in a){var A=a[e];if(A.id==="main"){if(h=e,g=A,e==="video"){var M=a[e];M&&(this.videoBuffer=M.buffer)}}else d=!0}d&&g?(this.log("Alternate track found, use "+h+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},f.onFragBuffered=function(r,t){var a=t.frag,g=t.part;if(a&&a.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(g?" p: "+g.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===_.State.PARSED&&(this.state=_.State.IDLE);return}var h=g?g.stats:a.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,g)},f.onError=function(r,t){switch(t.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:case C.ErrorDetails.KEY_LOAD_ERROR:case C.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,t);break;case C.ErrorDetails.LEVEL_LOAD_ERROR:case C.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==_.State.ERROR&&(t.fatal?(this.warn(""+t.details),this.state=_.State.ERROR):!t.levelRetry&&this.state===_.State.WAITING_LEVEL&&(this.state=_.State.IDLE));break;case C.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="main"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var a=!0,g=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);g&&g.len>.5&&(a=!this.reduceMaxBufferLength(g.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},f.checkBuffer=function(){var r=this.media,t=this.gapController;if(!r||!t||!r.readyState)return;var a=I.BufferHelper.getBuffered(r);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):t.poll(this.lastCurrentTime),this.lastCurrentTime=r.currentTime},f.onFragLoadEmergencyAborted=function(){this.state=_.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},f.onBufferFlushed=function(r,t){var a=t.type;if(a!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(a===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,a,P.PlaylistLevelType.MAIN)}},f.onLevelsUpdated=function(r,t){this.levels=t.levels},f.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},f.seekToStartPos=function(){var r=this.media,t=r.currentTime,a=this.startPosition;if(a>=0&&t<a){if(r.seeking){b.logger.log("could not seek to "+a+", already seeking at "+t);return}var g=I.BufferHelper.getBuffered(r),h=g.length?g.start(0):0,d=h-a;d>0&&(d<this.config.maxBufferHole||d<this.config.maxFragLookUpTolerance)&&(b.logger.log("adjusting start position by "+d+" to match buffer start"),a+=d,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+t),r.currentTime=a}},f._getAudioCodec=function(r){var t=this.config.defaultAudioCodec||r.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t},f._loadBitrateTestFrag=function(r){var t=this;this._doFragLoad(r).then(function(a){var g=t.hls;if(!a||g.nextLoadLevel||t.fragContextChanged(r))return;t.fragLoadError=0,t.state=_.State.IDLE,t.startFragRequested=!1,t.bitrateTest=!1;var h=r.stats;h.parsing.start=h.parsing.end=h.buffering.start=h.buffering.end=self.performance.now(),g.trigger(N.Events.FRAG_LOADED,a)})},f._handleTransmuxComplete=function(r){var t,a="main",g=this.hls,h=r.remuxResult,d=r.chunkMeta,e=this.getCurrentContext(d);if(!e){this.warn("The loading context changed while buffering fragment "+d.sn+" of level "+d.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(d.level);return}var A=e.frag,M=e.part,F=e.level,W=h.video,Z=h.text,K=h.id3,J=h.initSegment,oe=this.altAudio?void 0:h.audio;if(this.fragContextChanged(A))return;if(this.state=_.State.PARSING,J){J.tracks&&(this._bufferInitSegment(F,J.tracks,A,d),g.trigger(N.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:a,tracks:J.tracks}));var se=J.initPTS,pe=J.timescale;Object(U.isFiniteNumber)(se)&&(this.initPTS[A.cc]=se,g.trigger(N.Events.INIT_PTS_FOUND,{frag:A,id:a,initPTS:se,timescale:pe}))}if(W&&h.independent!==!1){if(F.details){var be=W.startPTS,Q=W.endPTS,te=W.startDTS,ve=W.endDTS;if(M)M.elementaryStreams[W.type]={startPTS:be,endPTS:Q,startDTS:te,endDTS:ve};else if(W.firstKeyFrame&&W.independent&&(this.couldBacktrack=!0),W.dropped&&W.independent){var q=this.getLoadPosition()+this.config.maxBufferHole;if(q<be){this.backtrack(A);return}A.setElementaryStreamInfo(W.type,A.start,Q,A.start,ve,!0)}A.setElementaryStreamInfo(W.type,be,Q,te,ve),this.bufferFragmentData(W,A,M,d)}}else if(h.independent===!1){this.backtrack(A);return}if(oe){var X=oe.startPTS,Te=oe.endPTS,Ie=oe.startDTS,Ge=oe.endDTS;M&&(M.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:Te,startDTS:Ie,endDTS:Ge}),A.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,X,Te,Ie,Ge),this.bufferFragmentData(oe,A,M,d)}if(K!=null&&(t=K.samples)!==null&&t!==void 0&&t.length){var Ae={frag:A,id:a,samples:K.samples};g.trigger(N.Events.FRAG_PARSING_METADATA,Ae)}if(Z){var Me={frag:A,id:a,samples:Z.samples};g.trigger(N.Events.FRAG_PARSING_USERDATA,Me)}},f._bufferInitSegment=function(r,t,a,g){var h=this;if(this.state!==_.State.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var d=t.audio,e=t.video,A=t.audiovideo;if(d){var M=r.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(M&&(M.indexOf("mp4a.40.5")!==-1?M="mp4a.40.2":M="mp4a.40.5"),d.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(M="mp4a.40.5")),F.indexOf("android")!==-1&&d.container!=="audio/mpeg"&&(M="mp4a.40.2",this.log("Android: force audio codec to "+M)),r.audioCodec&&r.audioCodec!==M&&this.log('Swapping manifest audio codec "'+r.audioCodec+'" for "'+M+'"'),d.levelCodec=M,d.id="main",this.log("Init audio buffer, container:"+d.container+", codecs[selected/level/parsed]=["+(M||"")+"/"+(r.audioCodec||"")+"/"+d.codec+"]")}e&&(e.levelCodec=r.videoCodec,e.id="main",this.log("Init video buffer, container:"+e.container+", codecs[level/parsed]=["+(r.videoCodec||"")+"/"+e.codec+"]")),A&&this.log("Init audiovideo buffer, container:"+A.container+", codecs[level/parsed]=["+(r.attrs.CODECS||"")+"/"+A.codec+"]"),this.hls.trigger(N.Events.BUFFER_CODECS,t),Object.keys(t).forEach(function(W){var Z=t[W],K=Z.initSegment;K!=null&&K.byteLength&&h.hls.trigger(N.Events.BUFFER_APPENDING,{type:W,data:K,frag:a,part:null,chunkMeta:g,parent:a.type})}),this.tick()},f.backtrack=function(r){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(r);var t=this.fragmentTracker.backtrack(r);this.fragPrevious=null,this.nextLoadPosition=r.start,t?this.resetFragmentLoading(r):this.state=_.State.BACKTRACKING},f.checkFragmentChanged=function(){var r=this.media,t=null;if(r&&r.readyState>1&&r.seeking===!1){var a=r.currentTime;if(I.BufferHelper.isBuffered(r,a)?t=this.getAppendedFrag(a):I.BufferHelper.isBuffered(r,a+.1)&&(t=this.getAppendedFrag(a+.1)),t){var g=this.fragPlaying,h=t.level;(!g||t.sn!==g.sn||g.level!==h||t.urlId!==g.urlId)&&(this.hls.trigger(N.Events.FRAG_CHANGED,{frag:t}),(!g||g.level!==h)&&this.hls.trigger(N.Events.LEVEL_SWITCHED,{level:h}),this.fragPlaying=t)}}},n(v,[{key:"nextLevel",get:function(){var r=this.nextBufferedFrag;return r?r.level:-1}},{key:"currentLevel",get:function(){var r=this.media;if(r){var t=this.getAppendedFrag(r.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var r=this.media;if(r){var t=this.getAppendedFrag(r.currentTime);return this.followingBufferedFrag(t)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),v}(_.default)},"./src/controller/subtitle-stream-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"SubtitleStreamController",function(){return s});var U=w("./src/events.ts"),_=w("./src/utils/logger.ts"),x=w("./src/utils/buffer-helper.ts"),N=w("./src/controller/fragment-finders.ts"),I=w("./src/utils/discontinuities.ts"),S=w("./src/controller/level-helper.ts"),P=w("./src/controller/fragment-tracker.ts"),E=w("./src/controller/base-stream-controller.ts"),O=w("./src/types/loader.ts"),R=w("./src/types/level.ts");function T(l,y){for(var c=0;c<y.length;c++){var o=y[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function C(l,y,c){return y&&T(l.prototype,y),c&&T(l,c),l}function b(l,y){l.prototype=Object.create(y.prototype),l.prototype.constructor=l,m(l,y)}function m(l,y){return m=Object.setPrototypeOf||function(o,v){return o.__proto__=v,o},m(l,y)}var n=500,s=function(l){b(y,l);function y(o,v){var f;return f=l.call(this,o,v,"[subtitle-stream-controller]")||this,f.levels=[],f.currentTrackId=-1,f.tracksBuffered=[],f.mainDetails=null,f._registerListeners(),f}var c=y.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var v=this.hls;v.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(U.Events.ERROR,this.onError,this),v.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),v.on(U.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),v.on(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),v.on(U.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),v.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var v=this.hls;v.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(U.Events.ERROR,this.onError,this),v.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),v.off(U.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),v.off(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),v.off(U.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),v.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.startLoad=function(){this.stopLoad(),this.state=E.State.IDLE,this.setInterval(n),this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},c.onLevelLoaded=function(v,f){this.mainDetails=f.details},c.onSubtitleFragProcessed=function(v,f){var i=f.frag,r=f.success;if(this.fragPrevious=i,this.state=E.State.IDLE,!r)return;var t=this.tracksBuffered[this.currentTrackId];if(!t)return;for(var a,g=i.start,h=0;h<t.length;h++)if(g>=t[h].start&&g<=t[h].end){a=t[h];break}var d=i.start+i.duration;a?a.end=d:(a={start:g,end:d},t.push(a)),this.fragmentTracker.fragBuffered(i)},c.onBufferFlushing=function(v,f){var i=f.startOffset,r=f.endOffset;if(i===0&&r!==Number.POSITIVE_INFINITY){var t=this.currentTrackId,a=this.levels;if(!a.length||!a[t]||!a[t].details)return;var g=a[t].details,h=g.targetduration,d=r-h;if(d<=0)return;f.endOffsetSubtitles=Math.max(0,d),this.tracksBuffered.forEach(function(e){for(var A=0;A<e.length;){if(e[A].end<=d){e.shift();continue}else if(e[A].start<d)e[A].start=d;else break;A++}}),this.fragmentTracker.removeFragmentsInRange(i,d,O.PlaylistLevelType.SUBTITLE)}},c.onError=function(v,f){var i,r=f.frag;if(!r||r.type!==O.PlaylistLevelType.SUBTITLE)return;(i=this.fragCurrent)!==null&&i!==void 0&&i.loader&&this.fragCurrent.loader.abort(),this.state=E.State.IDLE},c.onSubtitleTracksUpdated=function(v,f){var i=this,r=f.subtitleTracks;this.tracksBuffered=[],this.levels=r.map(function(t){return new R.Level(t)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(t){i.tracksBuffered[t.id]=[]}),this.mediaBuffer=null},c.onSubtitleTrackSwitch=function(v,f){if(this.currentTrackId=f.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(n)},c.onSubtitleTrackLoaded=function(v,f){var i,r=f.details,t=f.id,a=this.currentTrackId,g=this.levels;if(!g.length)return;var h=g[a];if(t>=g.length||t!==a||!h)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,r.live||(i=h.details)!==null&&i!==void 0&&i.live){var d=this.mainDetails;if(r.deltaUpdateFailed||!d)return;var e=d.fragments[0];if(!h.details)r.hasProgramDateTime&&d.hasProgramDateTime?Object(I.alignMediaPlaylistByPDT)(r,d):e&&Object(S.addSliding)(r,e.start);else{var A=this.alignPlaylists(r,h.details);A===0&&e&&Object(S.addSliding)(r,e.start)}}if(h.details=r,this.levelLastLoaded=t,this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var M=Object(N.findFragmentByPTS)(null,r.fragments,this.media.currentTime,0);M||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)}},c._handleFragmentLoadComplete=function(v){var f=v.frag,i=v.payload,r=f.decryptdata,t=this.hls;if(this.fragContextChanged(f))return;if(i&&i.byteLength>0&&r&&r.key&&r.iv&&r.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).then(function(g){var h=performance.now();t.trigger(U.Events.FRAG_DECRYPTED,{frag:f,payload:g,stats:{tstart:a,tdecrypt:h}})})}},c.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var v,f=this.currentTrackId,i=this.levels;if(!i.length||!i[f]||!i[f].details)return;var r=i[f].details,t=r.targetduration,a=this.config,g=this.media,h=x.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,g.currentTime-t,a.maxBufferHole),d=h.end,e=h.len,A=this.getMaxBufferLength()+t;if(e>A)return;console.assert(r,"Subtitle track details are defined on idle subtitle stream controller tick");var M=r.fragments,F=M.length,W=r.edge,Z,K=this.fragPrevious;if(d<W){var J=a.maxFragLookUpTolerance;K&&r.hasProgramDateTime&&(Z=Object(N.findFragmentByPDT)(M,K.endProgramDateTime,J)),Z||(Z=Object(N.findFragmentByPTS)(K,M,d,J),!Z&&K&&K.start<M[0].start&&(Z=M[0]))}else Z=M[F-1];(v=Z)!==null&&v!==void 0&&v.encrypted?(_.logger.log("Loading key for "+Z.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(U.Events.KEY_LOADING,{frag:Z})):Z&&this.fragmentTracker.getState(Z)===P.FragmentState.NOT_LOADED&&this.loadFragment(Z,r,d)}},c.loadFragment=function(v,f,i){this.fragCurrent=v,l.prototype.loadFragment.call(this,v,f,i)},C(y,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),y}(E.default)},"./src/controller/subtitle-track-controller.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/events.ts"),_=w("./src/utils/texttrack-utils.ts"),x=w("./src/controller/base-playlist-controller.ts"),N=w("./src/types/loader.ts");function I(T,C){for(var b=0;b<C.length;b++){var m=C[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function S(T,C,b){return C&&I(T.prototype,C),b&&I(T,b),T}function P(T,C){T.prototype=Object.create(C.prototype),T.prototype.constructor=T,E(T,C)}function E(T,C){return E=Object.setPrototypeOf||function(m,n){return m.__proto__=n,m},E(T,C)}var O=function(T){P(C,T);function C(m){var n;return n=T.call(this,m,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var b=C.prototype;return b.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,T.prototype.destroy.call(this)},b.registerListeners=function(){var n=this.hls;n.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(U.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){var n=this.hls;n.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(U.Events.ERROR,this.onError,this)},b.onMediaAttached=function(n,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},b.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},b.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 n=R(this.media.textTracks);n.forEach(function(s){Object(_.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},b.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},b.onManifestParsed=function(n,s){this.tracks=s.subtitleTracks},b.onSubtitleTrackLoaded=function(n,s){var l=s.id,y=s.details,c=this.trackId,o=this.tracksInGroup[c];if(!o){this.warn("Invalid subtitle track id "+l);return}var v=o.details;o.details=s.details,this.log("subtitle track "+l+" loaded ["+y.startSN+"-"+y.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,s,v))},b.onLevelLoading=function(n,s){this.switchLevel(s.level)},b.onLevelSwitching=function(n,s){this.switchLevel(s.level)},b.switchLevel=function(n){var s=this.hls.levels[n];if(!(s!=null&&s.textGroupIds))return;var l=s.textGroupIds[s.urlId];if(this.groupId!==l){var y=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,c=this.tracks.filter(function(f){return!l||f.groupId===l});this.tracksInGroup=c;var o=this.findTrackId(y==null?void 0:y.name)||this.findTrackId();this.groupId=l;var v={subtitleTracks:c};this.log("Updating subtitle tracks, "+c.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(U.Events.SUBTITLE_TRACKS_UPDATED,v),o!==-1&&this.setSubtitleTrack(o,y)}},b.findTrackId=function(n){for(var s=this.tracksInGroup,l=0;l<s.length;l++){var y=s[l];if((!this.selectDefaultTrack||y.default)&&(!n||n===y.name))return y.id}return-1},b.onError=function(n,s){if(T.prototype.onError.call(this,n,s),s.fatal||!s.context)return;s.context.type===N.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},b.loadPlaylist=function(n){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var l=s.id,y=s.groupId,c=s.url;if(n)try{c=n.addDirectives(c)}catch(o){this.warn("Could not construct new URL with HLS Delivery Directives: "+o)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADING,{url:c,id:l,groupId:y,deliveryDirectives:n||null})}},b.toggleTrackModes=function(n){var s=this,l=this.media,y=this.subtitleDisplay,c=this.trackId;if(!l)return;var o=R(l.textTracks),v=o.filter(function(r){return r.groupId===s.groupId});if(n===-1)[].slice.call(o).forEach(function(r){r.mode="disabled"});else{var f=v[c];f&&(f.mode="disabled")}var i=v[n];i&&(i.mode=y?"showing":"hidden")},b.setSubtitleTrack=function(n,s){var l,y=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(l=y[n])!==null&&l!==void 0&&l.details)||n<-1||n>=y.length)return;this.clearTimer();var c=y[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,c){var o=c.id,v=c.groupId,f=v===void 0?"":v,i=c.name,r=c.type,t=c.url;this.hls.trigger(U.Events.SUBTITLE_TRACK_SWITCH,{id:o,groupId:f,name:i,type:r,url:t});var a=this.switchParams(c.url,s==null?void 0:s.details);this.loadPlaylist(a)}else this.hls.trigger(U.Events.SUBTITLE_TRACK_SWITCH,{id:n})},b.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,s=R(this.media.textTracks),l=0;l<s.length;l++)if(s[l].mode==="hidden")n=l;else if(s[l].mode==="showing"){n=l;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},S(C,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,s)}}]),C}(x.default);function R(T){for(var C=[],b=0;b<T.length;b++){var m=T[b];m.kind==="subtitles"&&m.label&&C.push(T[b])}return C}B.default=O},"./src/controller/timeline-controller.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"TimelineController",function(){return R});var U=w("./src/polyfills/number.ts"),_=w("./src/events.ts"),x=w("./src/utils/cea-608-parser.ts"),N=w("./src/utils/output-filter.ts"),I=w("./src/utils/webvtt-parser.ts"),S=w("./src/utils/texttrack-utils.ts"),P=w("./src/utils/imsc1-ttml-parser.ts"),E=w("./src/types/loader.ts"),O=w("./src/utils/logger.ts"),R=function(){function m(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=b(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var l=new N.default(this,"textTrack1"),y=new N.default(this,"textTrack2"),c=new N.default(this,"textTrack3"),o=new N.default(this,"textTrack4");this.cea608Parser1=new x.default(1,l,y),this.cea608Parser2=new x.default(3,c,o)}s.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(_.Events.FRAG_LOADING,this.onFragLoading,this),s.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=m.prototype;return n.destroy=function(){var l=this.hls;l.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.off(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.off(_.Events.FRAG_LOADING,this.onFragLoading,this),l.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.off(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.off(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(l,y,c,o,v){for(var f=!1,i=v.length;i--;){var r=v[i],t=C(r[0],r[1],y,c);if(t>=0&&(r[0]=Math.min(r[0],y),r[1]=Math.max(r[1],c),f=!0,t/(c-y)>.5))return}if(f||v.push([y,c]),this.config.renderTextTracksNatively){var a=this.captionsTracks[l];this.Cues.newCue(a,y,c,o)}else{var g=this.Cues.newCue(null,y,c,o);this.hls.trigger(_.Events.CUES_PARSED,{type:"captions",cues:g,track:l})}},n.onInitPtsFound=function(l,y){var c=this,o=y.frag,v=y.id,f=y.initPTS,i=y.timescale,r=this.unparsedVttFrags;v==="main"&&(this.initPTS[o.cc]=f,this.timescale[o.cc]=i),r.length&&(this.unparsedVttFrags=[],r.forEach(function(t){c.onFragLoaded(_.Events.FRAG_LOADED,t)}))},n.getExistingTrack=function(l){var y=this.media;if(y)for(var c=0;c<y.textTracks.length;c++){var o=y.textTracks[c];if(o[l])return o}return null},n.createCaptionsTrack=function(l){this.config.renderTextTracksNatively?this.createNativeTrack(l):this.createNonNativeTrack(l)},n.createNativeTrack=function(l){if(this.captionsTracks[l])return;var y=this.captionsProperties,c=this.captionsTracks,o=this.media,v=y[l],f=v.label,i=v.languageCode,r=this.getExistingTrack(l);if(r)c[l]=r,Object(S.clearCurrentCues)(c[l]),Object(S.sendAddTrackEvent)(c[l],o);else{var t=this.createTextTrack("captions",f,i);t&&(t[l]=!0,c[l]=t)}},n.createNonNativeTrack=function(l){if(this.nonNativeCaptionsTracks[l])return;var y=this.captionsProperties[l];if(!y)return;var c=y.label,o={_id:l,label:c,kind:"captions",default:y.media?!!y.media.default:!1,closedCaptions:y.media};this.nonNativeCaptionsTracks[l]=o,this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[o]})},n.createTextTrack=function(l,y,c){var o=this.media;return o?o.addTextTrack(l,y,c):void 0},n.onMediaAttaching=function(l,y){this.media=y.media,this._cleanTracks()},n.onMediaDetaching=function(){var l=this.captionsTracks;Object.keys(l).forEach(function(y){Object(S.clearCurrentCues)(l[y]),delete l[y]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=b(),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())},n._cleanTracks=function(){var l=this.media;if(!l)return;var y=l.textTracks;if(y)for(var c=0;c<y.length;c++)Object(S.clearCurrentCues)(y[c])},n.onSubtitleTracksUpdated=function(l,y){var c=this;this.textTracks=[];var o=y.subtitleTracks||[],v=o.some(function(t){return t.textCodec===P.IMSC1_CODEC});if(this.config.enableWebVTT||v&&this.config.enableIMSC1){var f=this.tracks&&o&&this.tracks.length===o.length;if(this.tracks=o||[],this.config.renderTextTracksNatively){var i=this.media?this.media.textTracks:[];this.tracks.forEach(function(t,a){var g;if(a<i.length){for(var h=null,d=0;d<i.length;d++)if(T(i[d],t)){h=i[d];break}h&&(g=h)}g?Object(S.clearCurrentCues)(g):(g=c.createTextTrack("subtitles",t.name,t.lang),g&&(g.mode="disabled")),g&&(g.groupId=t.groupId,c.textTracks.push(g))})}else if(!f&&this.tracks&&this.tracks.length){var r=this.tracks.map(function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}});this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:r})}}},n.onManifestLoaded=function(l,y){var c=this;this.config.enableCEA708Captions&&y.captions&&y.captions.forEach(function(o){var v=/(?:CC|SERVICE)([1-4])/.exec(o.instreamId);if(!v)return;var f="textTrack"+v[1],i=c.captionsProperties[f];if(!i)return;i.label=o.name,o.lang&&(i.languageCode=o.lang),i.media=o})},n.onFragLoading=function(l,y){var c=this.cea608Parser1,o=this.cea608Parser2,v=this.lastSn,f=this.lastPartIndex;if(!this.enabled||!(c&&o))return;if(y.frag.type===E.PlaylistLevelType.MAIN){var i,r,t=y.frag.sn,a=(i=y==null||((r=y.part)===null||r===void 0)?void 0:r.index)!=null?i:-1;t===v+1||t===v&&a===f+1||(c.reset(),o.reset()),this.lastSn=t,this.lastPartIndex=a}},n.onFragLoaded=function(l,y){var c=y.frag,o=y.payload,v=this.initPTS,f=this.unparsedVttFrags;if(c.type===E.PlaylistLevelType.SUBTITLE)if(o.byteLength){if(!Object(U.isFiniteNumber)(v[c.cc])){f.push(y),v.length&&this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Missing initial subtitle PTS")});return}var i=c.decryptdata;if(i==null||i.key==null||i.method!=="AES-128"){var r=this.tracks[c.level],t=this.vttCCs;t[c.cc]||(t[c.cc]={start:c.start,prevCC:this.prevCC,new:!0},this.prevCC=c.cc),r&&r.textCodec===P.IMSC1_CODEC?this._parseIMSC1(c,o):this._parseVTTs(c,o,t)}}else this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(l,y){var c=this,o=this.hls;Object(P.parseIMSC1)(y,this.initPTS[l.cc],this.timescale[l.cc],function(v){c._appendCues(v,l.level),o.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(v){O.logger.log("Failed to parse IMSC1: "+v),o.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:v})})},n._parseVTTs=function(l,y,c){var o=this,v=this.hls;Object(I.parseWebVTT)(y,this.initPTS[l.cc],this.timescale[l.cc],c,l.cc,l.start,function(f){o._appendCues(f,l.level),v.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(f){o._fallbackToIMSC1(l,y),O.logger.log("Failed to parse VTT cue: "+f),v.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:f})})},n._fallbackToIMSC1=function(l,y){var c=this,o=this.tracks[l.level];o.textCodec||Object(P.parseIMSC1)(y,this.initPTS[l.cc],this.timescale[l.cc],function(){o.textCodec=P.IMSC1_CODEC,c._parseIMSC1(l,y)},function(){o.textCodec="wvtt"})},n._appendCues=function(l,y){var c=this.hls;if(this.config.renderTextTracksNatively){var o=this.textTracks[y];if(o.mode==="disabled")return;l.forEach(function(i){return Object(S.addCueToTrack)(o,i)})}else{var v=this.tracks[y],f=v.default?"default":"subtitles"+y;c.trigger(_.Events.CUES_PARSED,{type:"subtitles",cues:l,track:f})}},n.onFragDecrypted=function(l,y){var c=y.frag;if(c.type===E.PlaylistLevelType.SUBTITLE){if(!Object(U.isFiniteNumber)(this.initPTS[c.cc])){this.unparsedVttFrags.push(y);return}this.onFragLoaded(_.Events.FRAG_LOADED,y)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(l,y){var c=this.cea608Parser1,o=this.cea608Parser2;if(!this.enabled||!(c&&o))return;for(var v=0;v<y.samples.length;v++){var f=y.samples[v].bytes;if(f){var i=this.extractCea608Data(f);c.addData(y.samples[v].pts,i[0]),o.addData(y.samples[v].pts,i[1])}}},n.onBufferFlushing=function(l,y){var c=y.startOffset,o=y.endOffset,v=y.endOffsetSubtitles,f=y.type,i=this.media;if(!i||i.currentTime<o)return;if(!f||f==="video"){var r=this.captionsTracks;Object.keys(r).forEach(function(a){return Object(S.removeCuesInRange)(r[a],c,o)})}if(this.config.renderTextTracksNatively&&(c===0&&v!==void 0)){var t=this.textTracks;Object.keys(t).forEach(function(a){return Object(S.removeCuesInRange)(t[a],c,v)})}},n.extractCea608Data=function(l){for(var y=l[0]&31,c=2,o=[[],[]],v=0;v<y;v++){var f=l[c++],i=127&l[c++],r=127&l[c++],t=(4&f)!==0,a=3&f;if(i===0&&r===0)continue;t&&((a===0||a===1)&&(o[a].push(i),o[a].push(r)))}return o},m}();function T(m,n){return m&&m.label===n.name&&!(m.textTrack1||m.textTrack2)}function C(m,n,s,l){return Math.min(n,l)-Math.max(m,s)}function b(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return U});var U=function(){function _(N,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=N,this.aesIV=I}var x=_.prototype;return x.decrypt=function(I,S){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},S,I)},_}()},"./src/crypt/aes-decryptor.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"removePadding",function(){return _}),w.d(B,"default",function(){return x});var U=w("./src/utils/typed-array.ts");function _(N){var I=N.byteLength,S=I&&new DataView(N.buffer).getUint8(I-1);return S?Object(U.sliceUint8)(N,0,I-S):N}var x=function(){function N(){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=N.prototype;return I.uint8ArrayToUint32Array_=function(P){for(var E=new DataView(P),O=new Uint32Array(4),R=0;R<4;R++)O[R]=E.getUint32(R*4);return O},I.initTable=function(){var P=this.sBox,E=this.invSBox,O=this.subMix,R=O[0],T=O[1],C=O[2],b=O[3],m=this.invSubMix,n=m[0],s=m[1],l=m[2],y=m[3],c=new Uint32Array(256),o=0,v=0,f=0;for(f=0;f<256;f++)f<128?c[f]=f<<1:c[f]=f<<1^283;for(f=0;f<256;f++){var i=v^v<<1^v<<2^v<<3^v<<4;i=i>>>8^i&255^99,P[o]=i,E[i]=o;var r=c[o],t=c[r],a=c[t],g=c[i]*257^i*16843008;R[o]=g<<24|g>>>8,T[o]=g<<16|g>>>16,C[o]=g<<8|g>>>24,b[o]=g,g=a*16843009^t*65537^r*257^o*16843008,n[i]=g<<24|g>>>8,s[i]=g<<16|g>>>16,l[i]=g<<8|g>>>24,y[i]=g,o?(o=r^c[c[c[a^r]]],v^=c[c[v]]):o=v=1}},I.expandKey=function(P){for(var E=this.uint8ArrayToUint32Array_(P),O=!0,R=0;R<E.length&&O;)O=E[R]===this.key[R],R++;if(O)return;this.key=E;var T=this.keySize=E.length;if(T!==4&&T!==6&&T!==8)throw new Error("Invalid aes key size="+T);var C=this.ksRows=(T+6+1)*4,b,m,n=this.keySchedule=new Uint32Array(C),s=this.invKeySchedule=new Uint32Array(C),l=this.sBox,y=this.rcon,c=this.invSubMix,o=c[0],v=c[1],f=c[2],i=c[3],r,t;for(b=0;b<C;b++){if(b<T){r=n[b]=E[b];continue}t=r,b%T===0?(t=t<<8|t>>>24,t=l[t>>>24]<<24|l[t>>>16&255]<<16|l[t>>>8&255]<<8|l[t&255],t^=y[b/T|0]<<24):T>6&&b%T===4&&(t=l[t>>>24]<<24|l[t>>>16&255]<<16|l[t>>>8&255]<<8|l[t&255]),n[b]=r=(n[b-T]^t)>>>0}for(m=0;m<C;m++)b=C-m,m&3?t=n[b]:t=n[b-4],m<4||b<=4?s[m]=t:s[m]=o[l[t>>>24]]^v[l[t>>>16&255]]^f[l[t>>>8&255]]^i[l[t&255]],s[m]=s[m]>>>0},I.networkToHostOrderSwap=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},I.decrypt=function(P,E,O){for(var R=this.keySize+6,T=this.invKeySchedule,C=this.invSBox,b=this.invSubMix,m=b[0],n=b[1],s=b[2],l=b[3],y=this.uint8ArrayToUint32Array_(O),c=y[0],o=y[1],v=y[2],f=y[3],i=new Int32Array(P),r=new Int32Array(i.length),t,a,g,h,d,e,A,M,F,W,Z,K,J,oe,se=this.networkToHostOrderSwap;E<i.length;){for(F=se(i[E]),W=se(i[E+1]),Z=se(i[E+2]),K=se(i[E+3]),d=F^T[0],e=K^T[1],A=Z^T[2],M=W^T[3],J=4,oe=1;oe<R;oe++)t=m[d>>>24]^n[e>>16&255]^s[A>>8&255]^l[M&255]^T[J],a=m[e>>>24]^n[A>>16&255]^s[M>>8&255]^l[d&255]^T[J+1],g=m[A>>>24]^n[M>>16&255]^s[d>>8&255]^l[e&255]^T[J+2],h=m[M>>>24]^n[d>>16&255]^s[e>>8&255]^l[A&255]^T[J+3],d=t,e=a,A=g,M=h,J=J+4;t=C[d>>>24]<<24^C[e>>16&255]<<16^C[A>>8&255]<<8^C[M&255]^T[J],a=C[e>>>24]<<24^C[A>>16&255]<<16^C[M>>8&255]<<8^C[d&255]^T[J+1],g=C[A>>>24]<<24^C[M>>16&255]<<16^C[d>>8&255]<<8^C[e&255]^T[J+2],h=C[M>>>24]<<24^C[d>>16&255]<<16^C[e>>8&255]<<8^C[A&255]^T[J+3],r[E]=se(t^c),r[E+1]=se(h^o),r[E+2]=se(g^v),r[E+3]=se(a^f),c=F,o=W,v=Z,f=K,E=E+4}return r.buffer},N}()},"./src/crypt/decrypter.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return E});var U=w("./src/crypt/aes-crypto.ts"),_=w("./src/crypt/fast-aes-key.ts"),x=w("./src/crypt/aes-decryptor.ts"),N=w("./src/utils/logger.ts"),I=w("./src/utils/mp4-tools.ts"),S=w("./src/utils/typed-array.ts"),P=16,E=function(){function O(T,C,b){var m=b===void 0?{}:b,n=m.removePKCS7Padding,s=n===void 0?!0:n;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=T,this.config=C,this.removePKCS7Padding=s,s)try{var l=self.crypto;l&&(this.subtle=l.subtle||l.webkitSubtle)}catch(y){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var R=O.prototype;return R.destroy=function(){this.observer=null},R.isSync=function(){return this.config.enableSoftwareAES},R.flush=function(){var C=this.currentResult;if(!C){this.reset();return}var b=new Uint8Array(C);return this.reset(),this.removePKCS7Padding?Object(x.removePadding)(b):b},R.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},R.decrypt=function(C,b,m,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(C),b,m);var s=this.flush();s&&n(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(C),b,m).then(n)},R.softwareDecrypt=function(C,b,m){var n=this.currentIV,s=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(C=Object(I.appendUint8Array)(l,C),this.remainderData=null);var y=this.getValidChunk(C);if(!y.length)return null;n&&(m=n);var c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new x.default),c.expandKey(b);var o=s;return this.currentResult=c.decrypt(y.buffer,0,m),this.currentIV=Object(S.sliceUint8)(y,-16).buffer,o||null},R.webCryptoDecrypt=function(C,b,m){var n=this,s=this.subtle;return(this.key!==b||!this.fastAesKey)&&(this.key=b,this.fastAesKey=new _.default(s,b)),this.fastAesKey.expandKey().then(function(l){if(!s)return Promise.reject(new Error("web crypto not initialized"));var y=new U.default(s,m);return y.decrypt(C.buffer,l)}).catch(function(l){return n.onWebCryptoError(l,C,b,m)})},R.onWebCryptoError=function(C,b,m,n){return N.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",C),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(b,m,n)},R.getValidChunk=function(C){var b=C,m=C.length-C.length%P;return m!==C.length&&(b=Object(S.sliceUint8)(C,0,m),this.remainderData=Object(S.sliceUint8)(C,m)),b},R.logOnce=function(C){if(!this.logEnabled)return;N.logger.log("[decrypter.ts]: "+C),this.logEnabled=!1},O}()},"./src/crypt/fast-aes-key.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return U});var U=function(){function _(N,I){this.subtle=void 0,this.key=void 0,this.subtle=N,this.key=I}var x=_.prototype;return x.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},_}()},"./src/demux/aacdemuxer.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/demux/base-audio-demuxer.ts"),_=w("./src/demux/adts.ts"),x=w("./src/utils/logger.ts"),N=w("./src/demux/id3.ts");function I(E,O){E.prototype=Object.create(O.prototype),E.prototype.constructor=E,S(E,O)}function S(E,O){return S=Object.setPrototypeOf||function(T,C){return T.__proto__=C,T},S(E,O)}var P=function(E){I(O,E);function O(T,C){var b;return b=E.call(this)||this,b.observer=void 0,b.config=void 0,b.observer=T,b.config=C,b}var R=O.prototype;return R.resetInitSegment=function(C,b,m){E.prototype.resetInitSegment.call(this,C,b,m),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:C,duration:m,inputTimeScale:9e4,dropped:0}},O.probe=function(C){if(!C)return!1;for(var b=N.getID3Data(C,0)||[],m=b.length,n=C.length;m<n;m++)if(_.probe(C,m))return x.logger.log("ADTS sync word found !"),!0;return!1},R.canParse=function(C,b){return _.canParse(C,b)},R.appendFrame=function(C,b,m){_.initTrackConfig(C,this.observer,b,m,C.manifestCodec);var n=_.appendFrame(C,b,m,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},O}(U.default);P.minProbeByteLength=9,B.default=P},"./src/demux/adts.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"getAudioConfig",function(){return N}),w.d(B,"isHeaderPattern",function(){return I}),w.d(B,"getHeaderLength",function(){return S}),w.d(B,"getFullFrameLength",function(){return P}),w.d(B,"canGetFrameLength",function(){return E}),w.d(B,"isHeader",function(){return O}),w.d(B,"canParse",function(){return R}),w.d(B,"probe",function(){return T}),w.d(B,"initTrackConfig",function(){return C}),w.d(B,"getFrameDuration",function(){return b}),w.d(B,"parseFrameHeader",function(){return m}),w.d(B,"appendFrame",function(){return n});var U=w("./src/utils/logger.ts"),_=w("./src/errors.ts"),x=w("./src/events.ts");function N(s,l,y,c){var o,v,f,i,r=navigator.userAgent.toLowerCase(),t=c,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];o=((l[y+2]&192)>>>6)+1;var g=(l[y+2]&60)>>>2;if(g>a.length-1){s.trigger(x.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g});return}return f=(l[y+2]&1)<<2,f|=(l[y+3]&192)>>>6,U.logger.log("manifest codec:"+c+", ADTS type:"+o+", samplingIndex:"+g),/firefox/i.test(r)?g>=6?(o=5,i=new Array(4),v=g-3):(o=2,i=new Array(2),v=g):r.indexOf("android")!==-1?(o=2,i=new Array(2),v=g):(o=5,i=new Array(4),c&&(c.indexOf("mp4a.40.29")!==-1||c.indexOf("mp4a.40.5")!==-1)||!c&&g>=6?v=g-3:((c&&c.indexOf("mp4a.40.2")!==-1&&(g>=6&&f===1||/vivaldi/i.test(r))||!c&&f===1)&&(o=2,i=new Array(2)),v=g)),i[0]=o<<3,i[0]|=(g&14)>>1,i[1]|=(g&1)<<7,i[1]|=f<<3,o===5&&(i[1]|=(v&14)>>1,i[2]=(v&1)<<7,i[2]|=2<<2,i[3]=0),{config:i,samplerate:a[g],channelCount:f,codec:"mp4a.40."+o,manifestCodec:t}}function I(s,l){return s[l]===255&&(s[l+1]&246)===240}function S(s,l){return s[l+1]&1?7:9}function P(s,l){return(s[l+3]&3)<<11|s[l+4]<<3|(s[l+5]&224)>>>5}function E(s,l){return l+5<s.length}function O(s,l){return l+1<s.length&&I(s,l)}function R(s,l){return E(s,l)&&I(s,l)&&P(s,l)<=s.length-l}function T(s,l){if(O(s,l)){var y=S(s,l);if(l+y>=s.length)return!1;var c=P(s,l);if(c<=y)return!1;var o=l+c;return o===s.length||O(s,o)}return!1}function C(s,l,y,c,o){if(!s.samplerate){var v=N(l,y,c,o);if(!v)return;s.config=v.config,s.samplerate=v.samplerate,s.channelCount=v.channelCount,s.codec=v.codec,s.manifestCodec=v.manifestCodec,U.logger.log("parsed codec:"+s.codec+", rate:"+v.samplerate+", channels:"+v.channelCount)}}function b(s){return 1024*9e4/s}function m(s,l,y,c,o){var v=S(s,l),f=P(s,l);if(f-=v,f>0){var i=y+c*o;return{headerLength:v,frameLength:f,stamp:i}}}function n(s,l,y,c,o){var v=b(s.samplerate),f=m(l,y,c,o,v);if(f){var i=f.frameLength,r=f.headerLength,t=f.stamp,a=r+i,g=Math.max(0,y+a-l.length),h;g?(h=new Uint8Array(a-r),h.set(l.subarray(y+r,l.length),0)):h=l.subarray(y+r,y+a);var d={unit:h,pts:t};return g||s.samples.push(d),{sample:d,length:a,missing:g}}}},"./src/demux/base-audio-demuxer.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"initPTSFn",function(){return P});var U=w("./src/polyfills/number.ts"),_=w("./src/demux/id3.ts"),x=w("./src/demux/dummy-demuxed-track.ts"),N=w("./src/utils/mp4-tools.ts"),I=w("./src/utils/typed-array.ts"),S=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var O=E.prototype;return O.resetInitSegment=function(T,C,b){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},O.resetTimeStamp=function(){},O.resetContiguity=function(){},O.canParse=function(T,C){return!1},O.appendFrame=function(T,C,b){},O.demux=function(T,C){this.cachedData&&(T=Object(N.appendUint8Array)(this.cachedData,T),this.cachedData=null);var b=_.getID3Data(T,0),m=b?b.length:0,n,s,l=this._audioTrack,y=this._id3Track,c=b?_.getTimeStamp(b):void 0,o=T.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(c,C)),b&&b.length>0&&y.samples.push({pts:this.initPTS,dts:this.initPTS,data:b}),s=this.initPTS;m<o;){if(this.canParse(T,m)){var v=this.appendFrame(l,T,m);v?(this.frameIndex++,s=v.sample.pts,m+=v.length,n=m):m=o}else _.canParse(T,m)?(b=_.getID3Data(T,m),y.samples.push({pts:s,dts:s,data:b}),m+=b.length,n=m):m++;if(m===o&&n!==o){var f=Object(I.sliceUint8)(T,n);this.cachedData?this.cachedData=Object(N.appendUint8Array)(this.cachedData,f):this.cachedData=f}}return{audioTrack:l,avcTrack:Object(x.dummyTrack)(),id3Track:y,textTrack:Object(x.dummyTrack)()}},O.demuxSampleAes=function(T,C,b){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},O.flush=function(T){var C=this.cachedData;return C&&(this.cachedData=null,this.demux(C,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(x.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(x.dummyTrack)()}},O.destroy=function(){},E}(),P=function(O,R){return Object(U.isFiniteNumber)(O)?O*90:R*9e4};B.default=S},"./src/demux/chunk-cache.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return U});var U=function(){function x(){this.chunks=[],this.dataLength=0}var N=x.prototype;return N.push=function(S){this.chunks.push(S),this.dataLength+=S.length},N.flush=function(){var S=this.chunks,P=this.dataLength,E;if(S.length)S.length===1?E=S[0]:E=_(S,P);else return new Uint8Array(0);return this.reset(),E},N.reset=function(){this.chunks.length=0,this.dataLength=0},x}();function _(x,N){for(var I=new Uint8Array(N),S=0,P=0;P<x.length;P++){var E=x[P];I.set(E,S),S+=E.length}return I}},"./src/demux/dummy-demuxed-track.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"dummyTrack",function(){return U});function U(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/utils/logger.ts"),_=function(){function x(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 N=x.prototype;return N.loadWord=function(){var S=this.data,P=this.bytesAvailable,E=S.byteLength-P,O=new Uint8Array(4),R=Math.min(4,P);if(R===0)throw new Error("no bytes available");O.set(S.subarray(E,E+R)),this.word=new DataView(O.buffer).getUint32(0),this.bitsAvailable=R*8,this.bytesAvailable-=R},N.skipBits=function(S){var P;this.bitsAvailable>S?(this.word<<=S,this.bitsAvailable-=S):(S-=this.bitsAvailable,P=S>>3,S-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=S,this.bitsAvailable-=S)},N.readBits=function(S){var P=Math.min(this.bitsAvailable,S),E=this.word>>>32-P;return S>32&&U.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=S-P,P>0&&this.bitsAvailable?E<<P|this.readBits(P):E},N.skipLZ=function(){var S;for(S=0;S<this.bitsAvailable;++S)if((this.word&2147483648>>>S)!==0)return this.word<<=S,this.bitsAvailable-=S,S;return this.loadWord(),S+this.skipLZ()},N.skipUEG=function(){this.skipBits(1+this.skipLZ())},N.skipEG=function(){this.skipBits(1+this.skipLZ())},N.readUEG=function(){var S=this.skipLZ();return this.readBits(S+1)-1},N.readEG=function(){var S=this.readUEG();return 1&S?1+S>>>1:-1*(S>>>1)},N.readBoolean=function(){return this.readBits(1)===1},N.readUByte=function(){return this.readBits(8)},N.readUShort=function(){return this.readBits(16)},N.readUInt=function(){return this.readBits(32)},N.skipScalingList=function(S){for(var P=8,E=8,O,R=0;R<S;R++)E!==0&&(O=this.readEG(),E=(P+O+256)%256),P=E===0?P:E},N.readSPS=function(){var S=0,P=0,E=0,O=0,R,T,C,b=this.readUByte.bind(this),m=this.readBits.bind(this),n=this.readUEG.bind(this),s=this.readBoolean.bind(this),l=this.skipBits.bind(this),y=this.skipEG.bind(this),c=this.skipUEG.bind(this),o=this.skipScalingList.bind(this);b();var v=b();if(m(5),l(3),b(),c(),v===100||v===110||v===122||v===244||v===44||v===83||v===86||v===118||v===128){var f=n();if(f===3&&l(1),c(),c(),l(1),s())for(T=f!==3?8:12,C=0;C<T;C++)s()&&(C<6?o(16):o(64))}c();var i=n();if(i===0)n();else if(i===1)for(l(1),y(),y(),R=n(),C=0;C<R;C++)y();c(),l(1);var r=n(),t=n(),a=m(1);a===0&&l(1),l(1),s()&&(S=n(),P=n(),E=n(),O=n());var g=[1,1];if(s()&&s()){var h=b();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=[b()<<8|b(),b()<<8|b()];break}}}return{width:Math.ceil((r+1)*16-S*2-P*2),height:(2-a)*(t+1)*16-(a?2:4)*(E+O),pixelRatio:g}},N.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},x}();B.default=_},"./src/demux/id3.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"isHeader",function(){return U}),w.d(B,"isFooter",function(){return _}),w.d(B,"getID3Data",function(){return x}),w.d(B,"canParse",function(){return I}),w.d(B,"getTimeStamp",function(){return S}),w.d(B,"isTimeStampFrame",function(){return P}),w.d(B,"getID3Frames",function(){return O}),w.d(B,"decodeFrame",function(){return R}),w.d(B,"utf8ArrayToStr",function(){return n}),w.d(B,"testables",function(){return s});var U=function(o,v){return v+10<=o.length&&(o[v]===73&&o[v+1]===68&&o[v+2]===51&&(o[v+3]<255&&o[v+4]<255&&(o[v+6]<128&&o[v+7]<128&&o[v+8]<128&&o[v+9]<128)))},_=function(o,v){return v+10<=o.length&&(o[v]===51&&o[v+1]===68&&o[v+2]===73&&(o[v+3]<255&&o[v+4]<255&&(o[v+6]<128&&o[v+7]<128&&o[v+8]<128&&o[v+9]<128)))},x=function(o,v){for(var f=v,i=0;U(o,v);){i+=10;var r=N(o,v+6);i+=r,_(o,v+10)&&(i+=10),v+=i}return i>0?o.subarray(f,f+i):void 0},N=function(o,v){var f=0;return f=(o[v]&127)<<21,f|=(o[v+1]&127)<<14,f|=(o[v+2]&127)<<7,f|=o[v+3]&127,f},I=function(o,v){return U(o,v)&&N(o,v+6)+10<=o.length-v},S=function(o){for(var v=O(o),f=0;f<v.length;f++){var i=v[f];if(P(i))return m(i)}return},P=function(o){return o&&o.key==="PRIV"&&o.info==="com.apple.streaming.transportStreamTimestamp"},E=function(o){var v=String.fromCharCode(o[0],o[1],o[2],o[3]),f=N(o,4),i=10;return{type:v,size:f,data:o.subarray(i,i+f)}},O=function(o){for(var v=0,f=[];U(o,v);){var i=N(o,v+6);v+=10;for(var r=v+i;v+8<r;){var t=E(o.subarray(v)),a=R(t);a&&f.push(a),v+=t.size+10}_(o,v)&&(v+=10)}return f},R=function(o){return o.type==="PRIV"?T(o):o.type[0]==="W"?b(o):C(o)},T=function(o){if(o.size<2)return;var v=n(o.data,!0),f=new Uint8Array(o.data.subarray(v.length+1));return{key:o.type,info:v,data:f.buffer}},C=function(o){if(o.size<2)return;if(o.type==="TXXX"){var v=1,f=n(o.data.subarray(v),!0);v+=f.length+1;var i=n(o.data.subarray(v));return{key:o.type,info:f,data:i}}var r=n(o.data.subarray(1));return{key:o.type,data:r}},b=function(o){if(o.type==="WXXX"){if(o.size<2)return;var v=1,f=n(o.data.subarray(v),!0);v+=f.length+1;var i=n(o.data.subarray(v));return{key:o.type,info:f,data:i}}var r=n(o.data);return{key:o.type,data:r}},m=function(o){if(o.data.byteLength===8){var v=new Uint8Array(o.data),f=v[3]&1,i=(v[4]<<23)+(v[5]<<15)+(v[6]<<7)+v[7];return i/=45,f&&(i+=4772185884e-2),Math.round(i)}return},n=function(o,v){v===void 0&&(v=!1);var f=y();if(f){var i=f.decode(o);if(v){var r=i.indexOf("\0");return r!==-1?i.substring(0,r):i}return i.replace(/\0/g,"")}for(var t=o.length,a,g,h,d="",e=0;e<t;){if(a=o[e++],a===0&&v)return d;if(a===0||a===3)continue;switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:d+=String.fromCharCode(a);break;case 12:case 13:g=o[e++],d+=String.fromCharCode((a&31)<<6|g&63);break;case 14:g=o[e++],h=o[e++],d+=String.fromCharCode((a&15)<<12|(g&63)<<6|(h&63)<<0);break;default:}}return d},s={decodeTextFrame:C},l;function y(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/demux/base-audio-demuxer.ts"),_=w("./src/demux/id3.ts"),x=w("./src/utils/logger.ts"),N=w("./src/demux/mpegaudio.ts");function I(E,O){E.prototype=Object.create(O.prototype),E.prototype.constructor=E,S(E,O)}function S(E,O){return S=Object.setPrototypeOf||function(T,C){return T.__proto__=C,T},S(E,O)}var P=function(E){I(O,E);function O(){return E.apply(this,arguments)||this}var R=O.prototype;return R.resetInitSegment=function(C,b,m){E.prototype.resetInitSegment.call(this,C,b,m),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:C,duration:m,inputTimeScale:9e4,dropped:0}},O.probe=function(C){if(!C)return!1;for(var b=_.getID3Data(C,0)||[],m=b.length,n=C.length;m<n;m++)if(N.probe(C,m))return x.logger.log("MPEG Audio sync word found !"),!0;return!1},R.canParse=function(C,b){return N.canParse(C,b)},R.appendFrame=function(C,b,m){return this.initPTS===null?void 0:N.appendFrame(C,b,m,this.initPTS,this.frameIndex)},O}(U.default);P.minProbeByteLength=4,B.default=P},"./src/demux/mp4demuxer.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/utils/mp4-tools.ts"),_=w("./src/demux/dummy-demuxed-track.ts"),x=function(){function N(S,P){this.remainderData=null,this.config=void 0,this.config=P}var I=N.prototype;return I.resetTimeStamp=function(){},I.resetInitSegment=function(){},I.resetContiguity=function(){},N.probe=function(P){return Object(U.findBox)({data:P,start:0,end:Math.min(P.length,16384)},["moof"]).length>0},I.demux=function(P){var E=P,O=Object(_.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(U.appendUint8Array)(this.remainderData,P));var R=Object(U.segmentValidRange)(E);this.remainderData=R.remainder,O.samples=R.valid||new Uint8Array}else O.samples=E;return{audioTrack:Object(_.dummyTrack)(),avcTrack:O,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},I.flush=function(){var P=Object(_.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(_.dummyTrack)(),avcTrack:P,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},I.demuxSampleAes=function(P,E,O){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},I.destroy=function(){},N}();x.minProbeByteLength=1024,B.default=x},"./src/demux/mpegaudio.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"appendFrame",function(){return S}),w.d(B,"parseHeader",function(){return P}),w.d(B,"isHeaderPattern",function(){return E}),w.d(B,"isHeader",function(){return O}),w.d(B,"canParse",function(){return R}),w.d(B,"probe",function(){return T});var U=null,_=[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],x=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],N=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function S(C,b,m,n,s){if(m+24>b.length)return;var l=P(b,m);if(l&&m+l.frameLength<=b.length){var y=l.samplesPerFrame*9e4/l.sampleRate,c=n+s*y,o={unit:b.subarray(m,m+l.frameLength),pts:c,dts:c};return C.config=[],C.channelCount=l.channelCount,C.samplerate=l.sampleRate,C.samples.push(o),{sample:o,length:l.frameLength,missing:0}}}function P(C,b){var m=C[b+1]>>3&3,n=C[b+1]>>1&3,s=C[b+2]>>4&15,l=C[b+2]>>2&3;if(m!==1&&s!==0&&s!==15&&l!==3){var y=C[b+2]>>1&1,c=C[b+3]>>6,o=m===3?3-n:n===3?3:4,v=_[o*14+s-1]*1e3,f=m===3?0:m===2?1:2,i=x[f*3+l],r=c===3?1:2,t=N[m][n],a=I[n],g=t*8*a,h=Math.floor(t*v/i+y)*a;if(U===null){var d=navigator.userAgent||"",e=d.match(/Chrome\/(\d+)/i);U=e?parseInt(e[1]):0}var A=!!U&&U<=87;return A&&n===2&&v>=224e3&&c===0&&(C[b+3]=C[b+3]|128),{sampleRate:i,channelCount:r,frameLength:h,samplesPerFrame:g}}}function E(C,b){return C[b]===255&&(C[b+1]&224)===224&&(C[b+1]&6)!==0}function O(C,b){return b+1<C.length&&E(C,b)}function R(C,b){var m=4;return E(C,b)&&m<=C.length-b}function T(C,b){if(b+1<C.length&&E(C,b)){var m=4,n=P(C,b),s=m;n!=null&&n.frameLength&&(s=n.frameLength);var l=b+s;return l===C.length||O(C,l)}return!1}},"./src/demux/sample-aes.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/crypt/decrypter.ts"),_=w("./src/demux/tsdemuxer.ts"),x=function(){function N(S,P,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new U.default(S,P,{removePKCS7Padding:!1})}var I=N.prototype;return I.decryptBuffer=function(P,E){this.decrypter.decrypt(P,this.keyData.key.buffer,this.keyData.iv.buffer,E)},I.decryptAacSample=function(P,E,O,R){var T=P[E].unit,C=T.subarray(16,T.length-T.length%16),b=C.buffer.slice(C.byteOffset,C.byteOffset+C.length),m=this;this.decryptBuffer(b,function(n){var s=new Uint8Array(n);T.set(s,16),R||m.decryptAacSamples(P,E+1,O)})},I.decryptAacSamples=function(P,E,O){for(;;E++){if(E>=P.length){O();return}if(P[E].unit.length<32)continue;var R=this.decrypter.isSync();if(this.decryptAacSample(P,E,O,R),!R)return}},I.getAvcEncryptedData=function(P){for(var E=Math.floor((P.length-48)/160)*16+16,O=new Int8Array(E),R=0,T=32;T<=P.length-16;T+=160,R+=16)O.set(P.subarray(T,T+16),R);return O},I.getAvcDecryptedUnit=function(P,E){for(var O=new Uint8Array(E),R=0,T=32;T<=P.length-16;T+=160,R+=16)P.set(O.subarray(R,R+16),T);return P},I.decryptAvcSample=function(P,E,O,R,T,C){var b=Object(_.discardEPB)(T.data),m=this.getAvcEncryptedData(b),n=this;this.decryptBuffer(m.buffer,function(s){T.data=n.getAvcDecryptedUnit(b,s),C||n.decryptAvcSamples(P,E,O+1,R)})},I.decryptAvcSamples=function(P,E,O,R){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,O=0){if(E>=P.length){R();return}for(var T=P[E].units;!(O>=T.length);O++){var C=T[O];if(C.data.length<=48||C.type!==1&&C.type!==5)continue;var b=this.decrypter.isSync();if(this.decryptAvcSample(P,E,O,R,C,b),!b)return}}},N}();B.default=x},"./src/demux/transmuxer-interface.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return T});var U=w("./node_modules/webworkify-webpack/index.js"),_=w.n(U),x=w("./src/events.ts"),N=w("./src/demux/transmuxer.ts"),I=w("./src/utils/logger.ts"),S=w("./src/errors.ts"),P=w("./src/utils/mediasource-helper.ts"),E=w("./node_modules/eventemitter3/index.js"),O=w.n(E),R=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},T=function(){function C(m,n,s,l){var y=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=m,this.id=n,this.onTransmuxComplete=s,this.onFlush=l;var c=m.config,o=function(t,a){a=a||{},a.frag=y.frag,a.id=y.id,m.trigger(t,a)};this.observer=new E.EventEmitter,this.observer.on(x.Events.FRAG_DECRYPTED,o),this.observer.on(x.Events.ERROR,o);var v={mp4:R.isTypeSupported("video/mp4"),mpeg:R.isTypeSupported("audio/mpeg"),mp3:R.isTypeSupported('audio/mp4; codecs="mp3"')},f=navigator.vendor;if(c.enableWorker&&typeof Worker!="undefined"){I.logger.log("demuxing in webworker");var i;try{i=this.worker=U("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),i.addEventListener("message",this.onwmsg),i.onerror=function(r){m.trigger(x.Events.ERROR,{type:S.ErrorTypes.OTHER_ERROR,details:S.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(r.message+" ("+r.filename+":"+r.lineno+")")})},i.postMessage({cmd:"init",typeSupported:v,vendor:f,id:n,config:JSON.stringify(c)})}catch(r){I.logger.warn("Error in worker:",r),I.logger.error("Error while initializing DemuxerWorker, fallback to inline"),i&&self.URL.revokeObjectURL(i.objectURL),this.transmuxer=new N.default(this.observer,v,c,f,n),this.worker=null}}else this.transmuxer=new N.default(this.observer,v,c,f,n)}var b=C.prototype;return b.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},b.push=function(n,s,l,y,c,o,v,f,i,r){var t=this;i.transmuxing.start=self.performance.now();var a=this.transmuxer,g=this.worker,h=o?o.start:c.start,d=c.decryptdata,e=this.frag,A=!(e&&c.cc===e.cc),M=!(e&&i.level===e.level),F=e?i.sn-e.sn:-1,W=this.part?i.part-this.part.index:1,Z=!M&&(F===1||F===0&&W===1),K=self.performance.now();(M||F||c.stats.parsing.start===0)&&(c.stats.parsing.start=K),o&&(W||!Z)&&(o.stats.parsing.start=K);var J=new N.TransmuxState(A,Z,f,M,h);if(!Z||A){I.logger.log("[transmuxer-interface, "+c.type+"]: Starting new transmux session for sn: "+i.sn+" p: "+i.part+" level: "+i.level+" id: "+i.id+`
discontinuity: `+A+`
trackSwitch: `+M+`
contiguous: `+Z+`
accurateTimeOffset: `+f+`
timeOffset: `+h);var oe=new N.TransmuxConfig(l,y,s,v,r);this.configureTransmuxer(oe)}if(this.frag=c,this.part=o,g)g.postMessage({cmd:"demux",data:n,decryptdata:d,chunkMeta:i,state:J},n instanceof ArrayBuffer?[n]:[]);else if(a){var se=a.push(n,d,i,J);Object(N.isPromise)(se)?se.then(function(pe){t.handleTransmuxComplete(pe)}):this.handleTransmuxComplete(se)}},b.flush=function(n){var s=this;n.transmuxing.start=self.performance.now();var l=this.transmuxer,y=this.worker;if(y)y.postMessage({cmd:"flush",chunkMeta:n});else if(l){var c=l.flush(n);Object(N.isPromise)(c)?c.then(function(o){s.handleFlushResult(o,n)}):this.handleFlushResult(c,n)}},b.handleFlushResult=function(n,s){var l=this;n.forEach(function(y){l.handleTransmuxComplete(y)}),this.onFlush(s)},b.onWorkerMessage=function(n){var s=n.data,l=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,l.trigger(s.event,s.data);break}}},b.configureTransmuxer=function(n){var s=this.worker,l=this.transmuxer;s?s.postMessage({cmd:"configure",config:n}):l&&l.configure(n)},b.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},C}()},"./src/demux/transmuxer-worker.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return S});var U=w("./src/demux/transmuxer.ts"),_=w("./src/events.ts"),x=w("./src/utils/logger.ts"),N=w("./node_modules/eventemitter3/index.js"),I=w.n(N);function S(T){var C=new N.EventEmitter,b=function(n,s){T.postMessage({event:n,data:s})};C.on(_.Events.FRAG_DECRYPTED,b),C.on(_.Events.ERROR,b),T.addEventListener("message",function(m){var n=m.data;switch(n.cmd){case"init":{var s=JSON.parse(n.config);T.transmuxer=new U.default(C,n.typeSupported,s,n.vendor,n.id),Object(x.enableLogs)(s.debug),b("init",null);break}case"configure":{T.transmuxer.configure(n.config);break}case"demux":{var l=T.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(U.isPromise)(l)?l.then(function(o){P(T,o)}):P(T,l);break}case"flush":{var y=n.chunkMeta,c=T.transmuxer.flush(y);Object(U.isPromise)(c)?c.then(function(o){O(T,o,y)}):O(T,c,y);break}default:break}})}function P(T,C){if(R(C.remuxResult))return;var b=[],m=C.remuxResult,n=m.audio,s=m.video;n&&E(b,n),s&&E(b,s),T.postMessage({event:"transmuxComplete",data:C},b)}function E(T,C){C.data1&&T.push(C.data1.buffer),C.data2&&T.push(C.data2.buffer)}function O(T,C,b){C.forEach(function(m){P(T,m)}),T.postMessage({event:"flush",data:b})}function R(T){return!T.audio&&!T.video&&!T.text&&!T.id3&&!T.initSegment}},"./src/demux/transmuxer.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return s}),w.d(B,"isPromise",function(){return c}),w.d(B,"TransmuxConfig",function(){return o}),w.d(B,"TransmuxState",function(){return v});var U=w("./src/events.ts"),_=w("./src/errors.ts"),x=w("./src/crypt/decrypter.ts"),N=w("./src/demux/aacdemuxer.ts"),I=w("./src/demux/mp4demuxer.ts"),S=w("./src/demux/tsdemuxer.ts"),P=w("./src/demux/mp3demuxer.ts"),E=w("./src/remux/mp4-remuxer.ts"),O=w("./src/remux/passthrough-remuxer.ts"),R=w("./src/demux/chunk-cache.ts"),T=w("./src/utils/mp4-tools.ts"),C=w("./src/utils/logger.ts"),b;try{b=self.performance.now.bind(self.performance)}catch(f){C.logger.debug("Unable to use Performance API on this environment"),b=self.Date.now}var m=[{demux:S.default,remux:E.default},{demux:I.default,remux:O.default},{demux:N.default,remux:E.default},{demux:P.default,remux:E.default}],n=1024;m.forEach(function(f){var i=f.demux;n=Math.max(n,i.minProbeByteLength)});var s=function(){function f(r,t,a,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 R.default,this.observer=r,this.typeSupported=t,this.config=a,this.vendor=g,this.id=h}var i=f.prototype;return i.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},i.push=function(t,a,g,h){var d=this,e=g.transmuxing;e.executeStart=b();var A=new Uint8Array(t),M=this.cache,F=this.config,W=this.currentTransmuxState,Z=this.transmuxConfig;h&&(this.currentTransmuxState=h);var K=l(A,a);if(K&&K.method==="AES-128"){var J=this.getDecrypter();if(F.enableSoftwareAES){var oe=J.softwareDecrypt(A,K.key.buffer,K.iv.buffer);if(!oe)return e.executeEnd=b(),y(g);A=new Uint8Array(oe)}else return this.decryptionPromise=J.webCryptoDecrypt(A,K.key.buffer,K.iv.buffer).then(function(Le){var Ve=d.push(Le,null,g);return d.decryptionPromise=null,Ve}),this.decryptionPromise}var se=h||W,pe=se.contiguous,be=se.discontinuity,Q=se.trackSwitch,te=se.accurateTimeOffset,ve=se.timeOffset,q=Z.audioCodec,X=Z.videoCodec,Te=Z.defaultInitPts,Ie=Z.duration,Ge=Z.initSegmentData;if((be||Q)&&this.resetInitSegment(Ge,q,X,Ie),be&&this.resetInitialTimestamp(Te),pe||this.resetContiguity(),this.needsProbing(A,be,Q)){if(M.dataLength){var Ae=M.flush();A=Object(T.appendUint8Array)(Ae,A)}this.configureTransmuxer(A,Z)}var Me=this.transmux(A,K,ve,te,g),Se=this.currentTransmuxState;return Se.contiguous=!0,Se.discontinuity=!1,Se.trackSwitch=!1,e.executeEnd=b(),Me},i.flush=function(t){var a=this,g=t.transmuxing;g.executeStart=b();var h=this.decrypter,d=this.cache,e=this.currentTransmuxState,A=this.decryptionPromise;if(A)return A.then(function(){return a.flush(t)});var M=[],F=e.timeOffset;if(h){var W=h.flush();W&&M.push(this.push(W,null,t))}var Z=d.dataLength;d.reset();var K=this.demuxer,J=this.remuxer;if(!K||!J)return Z>=n&&this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),g.executeEnd=b(),[y(t)];var oe=K.flush(F);return c(oe)?oe.then(function(se){return a.flushRemux(M,se,t),M}):(this.flushRemux(M,oe,t),M)},i.flushRemux=function(t,a,g){var h=a.audioTrack,d=a.avcTrack,e=a.id3Track,A=a.textTrack,M=this.currentTransmuxState,F=M.accurateTimeOffset,W=M.timeOffset;C.logger.log("[transmuxer.ts]: Flushed fragment "+g.sn+(g.part>-1?" p: "+g.part:"")+" of level "+g.level);var Z=this.remuxer.remux(h,d,e,A,W,F,!0,this.id);t.push({remuxResult:Z,chunkMeta:g}),g.transmuxing.executeEnd=b()},i.resetInitialTimestamp=function(t){var a=this.demuxer,g=this.remuxer;if(!a||!g)return;a.resetTimeStamp(t),g.resetTimeStamp(t)},i.resetContiguity=function(){var t=this.demuxer,a=this.remuxer;if(!t||!a)return;t.resetContiguity(),a.resetNextTimestamp()},i.resetInitSegment=function(t,a,g,h){var d=this.demuxer,e=this.remuxer;if(!d||!e)return;d.resetInitSegment(a,g,h),e.resetInitSegment(t,a,g)},i.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},i.transmux=function(t,a,g,h,d){var e;return a&&a.method==="SAMPLE-AES"?e=this.transmuxSampleAes(t,a,g,h,d):e=this.transmuxUnencrypted(t,g,h,d),e},i.transmuxUnencrypted=function(t,a,g,h){var d=this.demuxer.demux(t,a,!1,!this.config.progressive),e=d.audioTrack,A=d.avcTrack,M=d.id3Track,F=d.textTrack,W=this.remuxer.remux(e,A,M,F,a,g,!1,this.id);return{remuxResult:W,chunkMeta:h}},i.transmuxSampleAes=function(t,a,g,h,d){var e=this;return this.demuxer.demuxSampleAes(t,a,g).then(function(A){var M=e.remuxer.remux(A.audioTrack,A.avcTrack,A.id3Track,A.textTrack,g,h,!1,e.id);return{remuxResult:M,chunkMeta:d}})},i.configureTransmuxer=function(t,a){for(var g=this.config,h=this.observer,d=this.typeSupported,e=this.vendor,A=a.audioCodec,M=a.defaultInitPts,F=a.duration,W=a.initSegmentData,Z=a.videoCodec,K,J=0,oe=m.length;J<oe;J++)if(m[J].demux.probe(t)){K=m[J];break}K||(C.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:I.default,remux:O.default});var se=this.demuxer,pe=this.remuxer,be=K.remux,Q=K.demux;(!pe||!(pe instanceof be))&&(this.remuxer=new be(h,g,d,e)),(!se||!(se instanceof Q))&&(this.demuxer=new Q(h,g,d),this.probe=Q.probe),this.resetInitSegment(W,A,Z,F),this.resetInitialTimestamp(M)},i.needsProbing=function(t,a,g){return!this.demuxer||!this.remuxer||a||g},i.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new x.default(this.observer,this.config)),t},f}();function l(f,i){var r=null;return f.byteLength>0&&i!=null&&i.key!=null&&i.iv!==null&&i.method!=null&&(r=i),r}var y=function(i){return{remuxResult:{},chunkMeta:i}};function c(f){return"then"in f&&f.then instanceof Function}var o=function(i,r,t,a,g){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=i,this.videoCodec=r,this.initSegmentData=t,this.duration=a,this.defaultInitPts=g},v=function(i,r,t,a,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=i,this.contiguous=r,this.accurateTimeOffset=t,this.trackSwitch=a,this.timeOffset=g}},"./src/demux/tsdemuxer.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"discardEPB",function(){return y});var U=w("./src/demux/adts.ts"),_=w("./src/demux/mpegaudio.ts"),x=w("./src/demux/exp-golomb.ts"),N=w("./src/demux/id3.ts"),I=w("./src/demux/sample-aes.ts"),S=w("./src/events.ts"),P=w("./src/utils/mp4-tools.ts"),E=w("./src/utils/logger.ts"),O=w("./src/errors.ts"),R={video:1,audio:2,id3:3,text:4},T=function(){function c(v,f,i){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=v,this.config=f,this.typeSupported=i}c.probe=function(f){var i=c.syncOffset(f);return i<0?!1:(i&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+i+", junk ahead ?"),!0)},c.syncOffset=function(f){for(var i=Math.min(1e3,f.length-3*188),r=0;r<i;){if(f[r]===71&&f[r+188]===71&&f[r+2*188]===71)return r;r++}return-1},c.createTrack=function(f,i){return{container:f==="video"||f==="audio"?"video/mp2t":void 0,type:f,id:R[f],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:f==="audio"?i:void 0}};var o=c.prototype;return o.resetInitSegment=function(f,i,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=c.createTrack("video",r),this._audioTrack=c.createTrack("audio",r),this._id3Track=c.createTrack("id3",r),this._txtTrack=c.createTrack("text",r),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=f,this.videoCodec=i,this._duration=r},o.resetTimeStamp=function(){},o.resetContiguity=function(){var f=this._audioTrack,i=this._avcTrack,r=this._id3Track;f&&(f.pesData=null),i&&(i.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},o.demux=function(f,i,r,t){r===void 0&&(r=!1),t===void 0&&(t=!1),r||(this.sampleAes=null);var a,g=this._avcTrack,h=this._audioTrack,d=this._id3Track,e=g.pid,A=g.pesData,M=h.pid,F=d.pid,W=h.pesData,Z=d.pesData,K=!1,J=this.pmtParsed,oe=this._pmtId,se=f.length;if(this.remainderData&&(f=Object(P.appendUint8Array)(this.remainderData,f),se=f.length,this.remainderData=null),se<188&&!t)return this.remainderData=f,{audioTrack:h,avcTrack:g,id3Track:d,textTrack:this._txtTrack};var pe=Math.max(0,c.syncOffset(f));se-=(se+pe)%188,se<f.byteLength&&!t&&(this.remainderData=new Uint8Array(f.buffer,se,f.buffer.byteLength-se));for(var be=pe;be<se;be+=188)if(f[be]===71){var Q=!!(f[be+1]&64),te=((f[be+1]&31)<<8)+f[be+2],ve=(f[be+3]&48)>>4,q=void 0;if(ve>1){if(q=be+5+f[be+4],q===be+188)continue}else q=be+4;switch(te){case e:Q&&(A&&(a=n(A))&&this.parseAVCPES(a,!1),A={data:[],size:0}),A&&(A.data.push(f.subarray(q,be+188)),A.size+=be+188-q);break;case M:Q&&(W&&(a=n(W))&&(h.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),W={data:[],size:0}),W&&(W.data.push(f.subarray(q,be+188)),W.size+=be+188-q);break;case F:Q&&(Z&&(a=n(Z))&&this.parseID3PES(a),Z={data:[],size:0}),Z&&(Z.data.push(f.subarray(q,be+188)),Z.size+=be+188-q);break;case 0:Q&&(q+=f[q]+1),oe=this._pmtId=b(f,q);break;case oe:{Q&&(q+=f[q]+1);var X=m(f,q,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,r);e=X.avc,e>0&&(g.pid=e),M=X.audio,M>0&&(h.pid=M,h.isAAC=X.isAAC),F=X.id3,F>0&&(d.pid=F),K&&!J&&(E.logger.log("reparse from beginning"),K=!1,be=pe-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});g.pesData=A,h.pesData=W,d.pesData=Z;var Te={audioTrack:h,avcTrack:g,id3Track:d,textTrack:this._txtTrack};return t&&this.extractRemainingSamples(Te),Te},o.flush=function(){var f=this.remainderData;this.remainderData=null;var i;return f?i=this.demux(f,-1,!1,!0):i={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(i),this.sampleAes?this.decrypt(i,this.sampleAes):i},o.extractRemainingSamples=function(f){var i=f.audioTrack,r=f.avcTrack,t=f.id3Track,a=r.pesData,g=i.pesData,h=t.pesData,d;a&&(d=n(a))?(this.parseAVCPES(d,!0),r.pesData=null):r.pesData=a,g&&(d=n(g))?(i.isAAC?this.parseAACPES(d):this.parseMPEGPES(d),i.pesData=null):(g!=null&&g.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=g),h&&(d=n(h))?(this.parseID3PES(d),t.pesData=null):t.pesData=h},o.demuxSampleAes=function(f,i,r){var t=this.demux(f,r,!0,!this.config.progressive),a=this.sampleAes=new I.default(this.observer,this.config,i);return this.decrypt(t,a)},o.decrypt=function(f,i){return new Promise(function(r){var t=f.audioTrack,a=f.avcTrack;t.samples&&t.isAAC?i.decryptAacSamples(t.samples,0,function(){a.samples?i.decryptAvcSamples(a.samples,0,0,function(){r(f)}):r(f)}):a.samples&&i.decryptAvcSamples(a.samples,0,0,function(){r(f)})})},o.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},o.parseAVCPES=function(f,i){var r=this,t=this._avcTrack,a=this.parseAVCNALu(f.data),g=!1,h=this.avcSample,d,e=!1;f.data=null,h&&a.length&&!t.audFound&&(s(h,t),h=this.avcSample=C(!1,f.pts,f.dts,"")),a.forEach(function(A){switch(A.type){case 1:{d=!0,h||(h=r.avcSample=C(!0,f.pts,f.dts,"")),g&&(h.debug+="NDR "),h.frame=!0;var M=A.data;if(e&&M.length>4){var F=new x.default(M).readSliceType();(F===2||F===4||F===7||F===9)&&(h.key=!0)}break}case 5:d=!0,h||(h=r.avcSample=C(!0,f.pts,f.dts,"")),g&&(h.debug+="IDR "),h.key=!0,h.frame=!0;break;case 6:{d=!0,g&&h&&(h.debug+="SEI ");var W=new x.default(y(A.data));W.readUByte();for(var Z=0,K=0,J=!1,oe=0;!J&&W.bytesAvailable>1;){Z=0;do oe=W.readUByte(),Z+=oe;while(oe===255);K=0;do oe=W.readUByte(),K+=oe;while(oe===255);if(Z===4&&W.bytesAvailable!==0){J=!0;var se=W.readUByte();if(se===181){var pe=W.readUShort();if(pe===49){var be=W.readUInt();if(be===1195456820){var Q=W.readUByte();if(Q===3){for(var te=W.readUByte(),ve=W.readUByte(),q=31&te,X=[te,ve],Te=0;Te<q;Te++)X.push(W.readUByte()),X.push(W.readUByte()),X.push(W.readUByte());l(r._txtTrack.samples,{type:3,pts:f.pts,bytes:X})}}}}}else if(Z===5&&W.bytesAvailable!==0){if(J=!0,K>16){for(var Ie=[],Ge=0;Ge<16;Ge++)Ie.push(W.readUByte().toString(16)),(Ge===3||Ge===5||Ge===7||Ge===9)&&Ie.push("-");for(var Ae=K-16,Me=new Uint8Array(Ae),Se=0;Se<Ae;Se++)Me[Se]=W.readUByte();l(r._txtTrack.samples,{pts:f.pts,payloadType:Z,uuid:Ie.join(""),userData:Object(N.utf8ArrayToStr)(Me),userDataBytes:Me})}}else if(K<W.bytesAvailable)for(var Le=0;Le<K;Le++)W.readUByte()}break}case 7:if(d=!0,e=!0,g&&h&&(h.debug+="SPS "),!t.sps){var Ve=new x.default(A.data),$e=Ve.readSPS();t.width=$e.width,t.height=$e.height,t.pixelRatio=$e.pixelRatio,t.sps=[A.data],t.duration=r._duration;for(var Qe=A.data.subarray(1,4),Be="avc1.",ze=0;ze<3;ze++){var ot=Qe[ze].toString(16);ot.length<2&&(ot="0"+ot),Be+=ot}t.codec=Be}break;case 8:d=!0,g&&h&&(h.debug+="PPS "),t.pps||(t.pps=[A.data]);break;case 9:d=!1,t.audFound=!0,h&&s(h,t),h=r.avcSample=C(!1,f.pts,f.dts,g?"AUD ":"");break;case 12:d=!1;break;default:d=!1,h&&(h.debug+="unknown NAL "+A.type+" ");break}if(h&&d){var Re=h.units;Re.push(A)}}),i&&h&&(s(h,t),this.avcSample=null)},o.getLastNalUnit=function(){var f,i=this.avcSample,r;if(!i||i.units.length===0){var t=this._avcTrack.samples;i=t[t.length-1]}if((f=i)!==null&&f!==void 0&&f.units){var a=i.units;r=a[a.length-1]}return r},o.parseAVCNALu=function(f){var i=f.byteLength,r=this._avcTrack,t=r.naluState||0,a=t,g=[],h=0,d,e,A,M=-1,F=0;for(t===-1&&(M=0,F=f[0]&31,t=0,h=1);h<i;){if(d=f[h++],!t){t=d?0:1;continue}if(t===1){t=d?0:2;continue}if(!d)t=3;else if(d===1){if(M>=0){var W={data:f.subarray(M,h-t-1),type:F};g.push(W)}else{var Z=this.getLastNalUnit();if(Z&&(a&&h<=4-a&&(Z.state&&(Z.data=Z.data.subarray(0,Z.data.byteLength-a))),e=h-t-1,e>0)){var K=new Uint8Array(Z.data.byteLength+e);K.set(Z.data,0),K.set(f.subarray(0,e),Z.data.byteLength),Z.data=K,Z.state=0}}h<i?(A=f[h]&31,M=h,F=A,t=0):t=-1}else t=0}if(M>=0&&t>=0){var J={data:f.subarray(M,i),type:F,state:t};g.push(J)}if(g.length===0){var oe=this.getLastNalUnit();if(oe){var se=new Uint8Array(oe.data.byteLength+f.byteLength);se.set(oe.data,0),se.set(f,oe.data.byteLength),oe.data=se}}return r.naluState=t,g},o.parseAACPES=function(f){var i=0,r=this._audioTrack,t=this.aacOverFlow,a=f.data;if(t){this.aacOverFlow=null;var g=t.sample.unit.byteLength,h=Math.min(t.missing,g),d=g-h;t.sample.unit.set(a.subarray(0,h),d),r.samples.push(t.sample),i=t.missing}var e,A;for(e=i,A=a.length;e<A-1&&!U.isHeader(a,e);e++);if(e!==i){var M,F;if(e<A-1?(M="AAC PES did not start with ADTS header,offset:"+e,F=!1):(M="no ADTS header found in AAC PES",F=!0),E.logger.warn("parsing error:"+M),this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:M}),F)return}U.initTrackConfig(r,this.observer,a,e,this.audioCodec);var W;if(f.pts!==void 0)W=f.pts;else if(t){var Z=U.getFrameDuration(r.samplerate);W=t.sample.pts+Z}else{E.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;e<A;)if(U.isHeader(a,e)){if(e+5<A){var J=U.appendFrame(r,a,e,W,K);if(J)if(J.missing)this.aacOverFlow=J;else{e+=J.length,K++;continue}}break}else e++},o.parseMPEGPES=function(f){var i=f.data,r=i.length,t=0,a=0,g=f.pts;if(g===void 0){E.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<r;)if(_.isHeader(i,a)){var h=_.appendFrame(this._audioTrack,i,a,g,t);if(h)a+=h.length,t++;else break}else a++},o.parseID3PES=function(f){if(f.pts===void 0){E.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(f)},c}();T.minProbeByteLength=188;function C(c,o,v,f){return{key:c,frame:!1,pts:o,dts:v,units:[],debug:f,length:0}}function b(c,o){return(c[o+10]&31)<<8|c[o+11]}function m(c,o,v,f){var i={audio:-1,avc:-1,id3:-1,isAAC:!0},r=(c[o+1]&15)<<8|c[o+2],t=o+3+r-4,a=(c[o+10]&15)<<8|c[o+11];for(o+=12+a;o<t;){var g=(c[o+1]&31)<<8|c[o+2];switch(c[o]){case 207:if(!f){E.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:i.audio===-1&&(i.audio=g);break;case 21:i.id3===-1&&(i.id3=g);break;case 219:if(!f){E.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:i.avc===-1&&(i.avc=g);break;case 3:case 4:v?i.audio===-1&&(i.audio=g,i.isAAC=!1):E.logger.log("MPEG audio found, not supported in this browser");break;case 36:E.logger.warn("Unsupported HEVC stream type found");break;default:break}o+=((c[o+3]&15)<<8|c[o+4])+5}return i}function n(c){var o=0,v,f,i,r,t,a=c.data;if(!c||c.size===0)return null;for(;a[0].length<19&&a.length>1;){var g=new Uint8Array(a[0].length+a[1].length);g.set(a[0]),g.set(a[1],a[0].length),a[0]=g,a.splice(1,1)}v=a[0];var h=(v[0]<<16)+(v[1]<<8)+v[2];if(h===1){if(f=(v[4]<<8)+v[5],f&&f>c.size-6)return null;var d=v[7];d&192&&(r=(v[9]&14)*536870912+(v[10]&255)*4194304+(v[11]&254)*16384+(v[12]&255)*128+(v[13]&254)/2,d&64?(t=(v[14]&14)*536870912+(v[15]&255)*4194304+(v[16]&254)*16384+(v[17]&255)*128+(v[18]&254)/2,r-t>60*9e4&&(E.logger.warn(Math.round((r-t)/9e4)+"s delta between PTS and DTS, align them"),r=t)):t=r),i=v[8];var e=i+9;if(c.size<=e)return null;c.size-=e;for(var A=new Uint8Array(c.size),M=0,F=a.length;M<F;M++){v=a[M];var W=v.byteLength;if(e)if(e>W){e-=W;continue}else v=v.subarray(e),W-=e,e=0;A.set(v,o),o+=W}return f&&(f-=i+3),{data:A,pts:r,dts:t,len:f}}return null}function s(c,o){if(c.units.length&&c.frame){if(c.pts===void 0){var v=o.samples,f=v.length;if(f){var i=v[f-1];c.pts=i.pts,c.dts=i.dts}else{o.dropped++;return}}o.samples.push(c)}c.debug.length&&E.logger.log(c.pts+"/"+c.dts+":"+c.debug)}function l(c,o){var v=c.length;if(v>0){if(o.pts>=c[v-1].pts)c.push(o);else for(var f=v-1;f>=0;f--)if(o.pts<c[f].pts){c.splice(f,0,o);break}}else c.push(o)}function y(c){for(var o=c.byteLength,v=[],f=1;f<o-2;)c[f]===0&&c[f+1]===0&&c[f+2]===3?(v.push(f+2),f+=2):f++;if(v.length===0)return c;var i=o-v.length,r=new Uint8Array(i),t=0;for(f=0;f<i;t++,f++)t===v[0]&&(t++,v.shift()),r[f]=c[t];return r}B.default=T},"./src/errors.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"ErrorTypes",function(){return U}),w.d(B,"ErrorDetails",function(){return _});var U;(function(x){x.NETWORK_ERROR="networkError",x.MEDIA_ERROR="mediaError",x.KEY_SYSTEM_ERROR="keySystemError",x.MUX_ERROR="muxError",x.OTHER_ERROR="otherError"})(U||(U={}));var _;(function(x){x.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",x.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",x.KEY_SYSTEM_NO_SESSION="keySystemNoSession",x.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",x.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",x.MANIFEST_LOAD_ERROR="manifestLoadError",x.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",x.MANIFEST_PARSING_ERROR="manifestParsingError",x.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",x.LEVEL_EMPTY_ERROR="levelEmptyError",x.LEVEL_LOAD_ERROR="levelLoadError",x.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",x.LEVEL_SWITCH_ERROR="levelSwitchError",x.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",x.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",x.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",x.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",x.FRAG_LOAD_ERROR="fragLoadError",x.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",x.FRAG_DECRYPT_ERROR="fragDecryptError",x.FRAG_PARSING_ERROR="fragParsingError",x.REMUX_ALLOC_ERROR="remuxAllocError",x.KEY_LOAD_ERROR="keyLoadError",x.KEY_LOAD_TIMEOUT="keyLoadTimeOut",x.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",x.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",x.BUFFER_APPEND_ERROR="bufferAppendError",x.BUFFER_APPENDING_ERROR="bufferAppendingError",x.BUFFER_STALLED_ERROR="bufferStalledError",x.BUFFER_FULL_ERROR="bufferFullError",x.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",x.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",x.INTERNAL_EXCEPTION="internalException",x.INTERNAL_ABORTED="aborted",x.UNKNOWN="unknown"})(_||(_={}))},"./src/events.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"Events",function(){return U});var U;(function(_){_.MEDIA_ATTACHING="hlsMediaAttaching",_.MEDIA_ATTACHED="hlsMediaAttached",_.MEDIA_DETACHING="hlsMediaDetaching",_.MEDIA_DETACHED="hlsMediaDetached",_.BUFFER_RESET="hlsBufferReset",_.BUFFER_CODECS="hlsBufferCodecs",_.BUFFER_CREATED="hlsBufferCreated",_.BUFFER_APPENDING="hlsBufferAppending",_.BUFFER_APPENDED="hlsBufferAppended",_.BUFFER_EOS="hlsBufferEos",_.BUFFER_FLUSHING="hlsBufferFlushing",_.BUFFER_FLUSHED="hlsBufferFlushed",_.MANIFEST_LOADING="hlsManifestLoading",_.MANIFEST_LOADED="hlsManifestLoaded",_.MANIFEST_PARSED="hlsManifestParsed",_.LEVEL_SWITCHING="hlsLevelSwitching",_.LEVEL_SWITCHED="hlsLevelSwitched",_.LEVEL_LOADING="hlsLevelLoading",_.LEVEL_LOADED="hlsLevelLoaded",_.LEVEL_UPDATED="hlsLevelUpdated",_.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",_.LEVELS_UPDATED="hlsLevelsUpdated",_.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",_.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",_.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",_.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",_.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",_.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",_.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",_.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",_.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",_.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",_.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",_.CUES_PARSED="hlsCuesParsed",_.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",_.INIT_PTS_FOUND="hlsInitPtsFound",_.FRAG_LOADING="hlsFragLoading",_.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",_.FRAG_LOADED="hlsFragLoaded",_.FRAG_DECRYPTED="hlsFragDecrypted",_.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",_.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",_.FRAG_PARSING_METADATA="hlsFragParsingMetadata",_.FRAG_PARSED="hlsFragParsed",_.FRAG_BUFFERED="hlsFragBuffered",_.FRAG_CHANGED="hlsFragChanged",_.FPS_DROP="hlsFpsDrop",_.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",_.ERROR="hlsError",_.DESTROYING="hlsDestroying",_.KEY_LOADING="hlsKeyLoading",_.KEY_LOADED="hlsKeyLoaded",_.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",_.BACK_BUFFER_REACHED="hlsBackBufferReached"})(U||(U={}))},"./src/hls.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return c});var U=w("./node_modules/url-toolkit/src/url-toolkit.js"),_=w.n(U),x=w("./src/loader/playlist-loader.ts"),N=w("./src/loader/key-loader.ts"),I=w("./src/controller/id3-track-controller.ts"),S=w("./src/controller/latency-controller.ts"),P=w("./src/controller/level-controller.ts"),E=w("./src/controller/fragment-tracker.ts"),O=w("./src/controller/stream-controller.ts"),R=w("./src/is-supported.ts"),T=w("./src/utils/logger.ts"),C=w("./src/config.ts"),b=w("./node_modules/eventemitter3/index.js"),m=w.n(b),n=w("./src/events.ts"),s=w("./src/errors.ts");function l(o,v){for(var f=0;f<v.length;f++){var i=v[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,i.key,i)}}function y(o,v,f){return v&&l(o.prototype,v),f&&l(o,f),o}var c=function(){o.isSupported=function(){return Object(R.isSupported)()};function o(f){f===void 0&&(f={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new b.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 i=this.config=Object(C.mergeConfig)(o.DefaultConfig,f);this.userConfig=f,Object(T.enableLogs)(i.debug),this._autoLevelCapping=-1,i.progressive&&Object(C.enableStreamingMode)(i);var r=i.abrController,t=i.bufferController,a=i.capLevelController,g=i.fpsController,h=this.abrController=new r(this),d=this.bufferController=new t(this),e=this.capLevelController=new a(this),A=new g(this),M=new x.default(this),F=new N.default(this),W=new I.default(this),Z=this.levelController=new P.default(this),K=new E.FragmentTracker(this),J=this.streamController=new O.default(this,K);e.setStreamController(J),A.setStreamController(J);var oe=[Z,J];this.networkControllers=oe;var se=[M,F,h,d,e,A,W,K];this.audioTrackController=this.createController(i.audioTrackController,null,oe),this.createController(i.audioStreamController,K,oe),this.subtitleTrackController=this.createController(i.subtitleTrackController,null,oe),this.createController(i.subtitleStreamController,K,oe),this.createController(i.timelineController,null,se),this.emeController=this.createController(i.emeController,null,se),this.cmcdController=this.createController(i.cmcdController,null,se),this.latencyController=this.createController(S.default,null,se),this.coreComponents=se}var v=o.prototype;return v.createController=function(i,r,t){if(i){var a=r?new i(this,r):new i(this);return t&&t.push(a),a}return null},v.on=function(i,r,t){t===void 0&&(t=this),this._emitter.on(i,r,t)},v.once=function(i,r,t){t===void 0&&(t=this),this._emitter.once(i,r,t)},v.removeAllListeners=function(i){this._emitter.removeAllListeners(i)},v.off=function(i,r,t,a){t===void 0&&(t=this),this._emitter.off(i,r,t,a)},v.listeners=function(i){return this._emitter.listeners(i)},v.emit=function(i,r,t){return this._emitter.emit(i,r,t)},v.trigger=function(i,r){if(this.config.debug)return this.emit(i,i,r);try{return this.emit(i,i,r)}catch(t){T.logger.error("An internal error happened while handling event "+i+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(n.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:i,error:t})}return!1},v.listenerCount=function(i){return this._emitter.listenerCount(i)},v.destroy=function(){T.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(i){return i.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(i){return i.destroy()}),this.coreComponents.length=0},v.attachMedia=function(i){T.logger.log("attachMedia"),this._media=i,this.trigger(n.Events.MEDIA_ATTACHING,{media:i})},v.detachMedia=function(){T.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},v.loadSource=function(i){this.stopLoad();var r=this.media,t=this.url,a=this.url=U.buildAbsoluteURL(self.location.href,i,{alwaysNormalize:!0});T.logger.log("loadSource:"+a),r&&t&&t!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(r)),this.trigger(n.Events.MANIFEST_LOADING,{url:i})},v.startLoad=function(i){i===void 0&&(i=-1),T.logger.log("startLoad("+i+")"),this.networkControllers.forEach(function(r){r.startLoad(i)})},v.stopLoad=function(){T.logger.log("stopLoad"),this.networkControllers.forEach(function(i){i.stopLoad()})},v.swapAudioCodec=function(){T.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},v.recoverMediaError=function(){T.logger.log("recoverMediaError");var i=this._media;this.detachMedia(),i&&this.attachMedia(i)},v.removeLevel=function(i,r){r===void 0&&(r=0),this.levelController.removeLevel(i,r)},y(o,[{key:"levels",get:function(){var i=this.levelController.levels;return i||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(i){T.logger.log("set currentLevel:"+i),this.loadLevel=i,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(i){T.logger.log("set nextLevel:"+i),this.levelController.manualLevel=i,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(i){T.logger.log("set loadLevel:"+i),this.levelController.manualLevel=i}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(i){this.levelController.nextLoadLevel=i}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(i){T.logger.log("set firstLevel:"+i),this.levelController.firstLevel=i}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(i){T.logger.log("set startLevel:"+i),i!==-1&&(i=Math.max(i,this.minAutoLevel)),this.levelController.startLevel=i}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(i){var r=!!i;r!==this.config.capLevelToPlayerSize&&(r?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=r)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(i){this._autoLevelCapping!==i&&(T.logger.log("set autoLevelCapping:"+i),this._autoLevelCapping=i)}},{key:"bandwidthEstimate",get:function(){var i=this.abrController.bwEstimator;return i?i.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var i=this.levels,r=this.config.minAutoBitrate;if(!i)return 0;for(var t=i.length,a=0;a<t;a++)if(i[a].maxBitrate>r)return a;return 0}},{key:"maxAutoLevel",get:function(){var i=this.levels,r=this.autoLevelCapping,t;return r===-1&&i&&i.length?t=i.length-1:t=r,t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(i){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,i)}},{key:"audioTracks",get:function(){var i=this.audioTrackController;return i?i.audioTracks:[]}},{key:"audioTrack",get:function(){var i=this.audioTrackController;return i?i.audioTrack:-1},set:function(i){var r=this.audioTrackController;r&&(r.audioTrack=i)}},{key:"subtitleTracks",get:function(){var i=this.subtitleTrackController;return i?i.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var i=this.subtitleTrackController;return i?i.subtitleTrack:-1},set:function(i){var r=this.subtitleTrackController;r&&(r.subtitleTrack=i)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var i=this.subtitleTrackController;return i?i.subtitleDisplay:!1},set:function(i){var r=this.subtitleTrackController;r&&(r.subtitleDisplay=i)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(i){this.config.lowLatencyMode=i}},{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 n.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return o.defaultConfig?o.defaultConfig:C.hlsDefaultConfig},set:function(i){o.defaultConfig=i}}]),o}();c.defaultConfig=void 0},"./src/is-supported.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"isSupported",function(){return x}),w.d(B,"changeTypeSupported",function(){return N});var U=w("./src/utils/mediasource-helper.ts");function _(){return self.SourceBuffer||self.WebKitSourceBuffer}function x(){var I=Object(U.getMediaSource)();if(!I)return!1;var S=_(),P=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!S||S.prototype&&typeof S.prototype.appendBuffer=="function"&&typeof S.prototype.remove=="function";return!!P&&!!E}function N(){var I,S=_();return typeof(S==null||((I=S.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return T}),w.d(B,"LoadError",function(){return b});var U=w("./src/polyfills/number.ts"),_=w("./src/errors.ts");function x(m,n){m.prototype=Object.create(n.prototype),m.prototype.constructor=m,E(m,n)}function N(m){var n=typeof Map=="function"?new Map:void 0;return N=function(l){if(l===null||!P(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(l))return n.get(l);n.set(l,y)}function y(){return I(l,arguments,O(this).constructor)}return y.prototype=Object.create(l.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),E(y,l)},N(m)}function I(m,n,s){return S()?I=Reflect.construct:I=function(y,c,o){var v=[null];v.push.apply(v,c);var f=Function.bind.apply(y,v),i=new f;return o&&E(i,o.prototype),i},I.apply(null,arguments)}function S(){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(m){return!1}}function P(m){return Function.toString.call(m).indexOf("[native code]")!==-1}function E(m,n){return E=Object.setPrototypeOf||function(l,y){return l.__proto__=y,l},E(m,n)}function O(m){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},O(m)}var R=Math.pow(2,17),T=function(){function m(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var n=m.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(l,y){var c=this,o=l.url;if(!o)return Promise.reject(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(o?"part list":"url")));this.abort();var v=this.config,f=v.fLoader,i=v.loader;return new Promise(function(r,t){c.loader&&c.loader.destroy();var a=c.loader=l.loader=f?new f(v):new i(v),g=C(l),h={timeout:v.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:v.fragLoadingMaxRetryTimeout,highWaterMark:R};l.stats=a.stats,a.load(g,h,{onSuccess:function(e,A,M,F){c.resetLoader(l,a),r({frag:l,part:null,payload:e.data,networkDetails:F})},onError:function(e,A,M){c.resetLoader(l,a),t(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:e,networkDetails:M}))},onAbort:function(e,A,M){c.resetLoader(l,a),t(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:M}))},onTimeout:function(e,A,M){c.resetLoader(l,a),t(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:M}))},onProgress:function(e,A,M,F){y&&y({frag:l,part:null,payload:M,networkDetails:F})}})})},n.loadPart=function(l,y,c){var o=this;this.abort();var v=this.config,f=v.fLoader,i=v.loader;return new Promise(function(r,t){o.loader&&o.loader.destroy();var a=o.loader=l.loader=f?new f(v):new i(v),g=C(l,y),h={timeout:v.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:v.fragLoadingMaxRetryTimeout,highWaterMark:R};y.stats=a.stats,a.load(g,h,{onSuccess:function(e,A,M,F){o.resetLoader(l,a),o.updateStatsFromPart(l,y);var W={frag:l,part:y,payload:e.data,networkDetails:F};c(W),r(W)},onError:function(e,A,M){o.resetLoader(l,a),t(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:y,response:e,networkDetails:M}))},onAbort:function(e,A,M){l.stats.aborted=y.stats.aborted,o.resetLoader(l,a),t(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:y,networkDetails:M}))},onTimeout:function(e,A,M){o.resetLoader(l,a),t(new b({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:y,networkDetails:M}))}})})},n.updateStatsFromPart=function(l,y){var c=l.stats,o=y.stats,v=o.total;if(c.loaded+=o.loaded,v){var f=Math.round(l.duration/y.duration),i=Math.min(Math.round(c.loaded/v),f),r=f-i,t=r*Math.round(c.loaded/i);c.total=c.loaded+t}else c.total=Math.max(c.loaded,c.total);var a=c.loading,g=o.loading;a.start?a.first+=g.first-g.start:(a.start=g.start,a.first=g.first),a.end=g.end},n.resetLoader=function(l,y){l.loader=null,this.loader===y&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),y.destroy()},m}();function C(m,n){n===void 0&&(n=null);var s=n||m,l={frag:m,part:n,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},y=s.byteRangeStartOffset,c=s.byteRangeEndOffset;return Object(U.isFiniteNumber)(y)&&Object(U.isFiniteNumber)(c)&&(l.rangeStart=y,l.rangeEnd=c),l}var b=function(m){x(n,m);function n(s){for(var l,y=arguments.length,c=new Array(y>1?y-1:0),o=1;o<y;o++)c[o-1]=arguments[o];return l=m.call.apply(m,[this].concat(c))||this,l.data=void 0,l.data=s,l}return n}(N(Error))},"./src/loader/fragment.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"ElementaryStreamTypes",function(){return T}),w.d(B,"BaseSegment",function(){return C}),w.d(B,"Fragment",function(){return b}),w.d(B,"Part",function(){return m});var U=w("./src/polyfills/number.ts"),_=w("./node_modules/url-toolkit/src/url-toolkit.js"),x=w.n(_),N=w("./src/utils/logger.ts"),I=w("./src/loader/level-key.ts"),S=w("./src/loader/load-stats.ts");function P(n,s){n.prototype=Object.create(s.prototype),n.prototype.constructor=n,E(n,s)}function E(n,s){return E=Object.setPrototypeOf||function(y,c){return y.__proto__=c,y},E(n,s)}function O(n,s){for(var l=0;l<s.length;l++){var y=s[l];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(n,y.key,y)}}function R(n,s,l){return s&&O(n.prototype,s),l&&O(n,l),n}var T;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(T||(T={}));var C=function(){function n(l){var y;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(y={},y[T.AUDIO]=null,y[T.VIDEO]=null,y[T.AUDIOVIDEO]=null,y),this.baseurl=l}var s=n.prototype;return s.setByteRange=function(y,c){var o=y.split("@",2),v=[];o.length===1?v[0]=c?c.byteRangeEndOffset:0:v[0]=parseInt(o[1]),v[1]=parseInt(o[0])+v[0],this._byteRange=v},R(n,[{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(_.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(y){this._url=y}}]),n}(),b=function(n){P(s,n);function s(y,c){var o;return o=n.call(this,c)||this,o._decryptdata=null,o.rawProgramDateTime=null,o.programDateTime=null,o.tagList=[],o.duration=0,o.sn=0,o.levelkey=void 0,o.type=void 0,o.loader=null,o.level=-1,o.cc=0,o.startPTS=void 0,o.endPTS=void 0,o.appendedPTS=void 0,o.startDTS=void 0,o.endDTS=void 0,o.start=0,o.deltaPTS=void 0,o.maxStartPTS=void 0,o.minEndPTS=void 0,o.stats=new S.LoadStats,o.urlId=0,o.data=void 0,o.bitrateTest=!1,o.title=null,o.initSegment=null,o.type=y,o}var l=s.prototype;return l.createInitializationVector=function(c){for(var o=new Uint8Array(16),v=12;v<16;v++)o[v]=c>>8*(15-v)&255;return o},l.setDecryptDataFromLevelKey=function(c,o){var v=c;return(c==null?void 0:c.method)==="AES-128"&&c.uri&&!c.iv&&(v=I.LevelKey.fromURI(c.uri),v.method=c.method,v.iv=this.createInitializationVector(o),v.keyFormat="identity"),v},l.setElementaryStreamInfo=function(c,o,v,f,i,r){r===void 0&&(r=!1);var t=this.elementaryStreams,a=t[c];if(!a){t[c]={startPTS:o,endPTS:v,startDTS:f,endDTS:i,partial:r};return}a.startPTS=Math.min(a.startPTS,o),a.endPTS=Math.max(a.endPTS,v),a.startDTS=Math.min(a.startDTS,f),a.endDTS=Math.max(a.endDTS,i)},l.clearElementaryStreamInfo=function(){var c=this.elementaryStreams;c[T.AUDIO]=null,c[T.VIDEO]=null,c[T.AUDIOVIDEO]=null},R(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var c=this.sn;typeof c!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&N.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),c=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,c)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(U.isFiniteNumber)(this.programDateTime))return null;var c=Object(U.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+c*1e3}},{key:"encrypted",get:function(){var c;return!!((c=this.decryptdata)!==null&&c!==void 0&&c.keyFormat&&this.decryptdata.uri)}}]),s}(C),m=function(n){P(s,n);function s(l,y,c,o,v){var f;f=n.call(this,c)||this,f.fragOffset=0,f.duration=0,f.gap=!1,f.independent=!1,f.relurl=void 0,f.fragment=void 0,f.index=void 0,f.stats=new S.LoadStats,f.duration=l.decimalFloatingPoint("DURATION"),f.gap=l.bool("GAP"),f.independent=l.bool("INDEPENDENT"),f.relurl=l.enumeratedString("URI"),f.fragment=y,f.index=o;var i=l.enumeratedString("BYTERANGE");return i&&f.setByteRange(i,v),v&&(f.fragOffset=v.fragOffset+v.duration),f}return R(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var y=this.elementaryStreams;return!!(y.audio||y.video||y.audiovideo)}}]),s}(C)},"./src/loader/key-loader.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return N});var U=w("./src/events.ts"),_=w("./src/errors.ts"),x=w("./src/utils/logger.ts"),N=function(){function I(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var S=I.prototype;return S._registerListeners=function(){this.hls.on(U.Events.KEY_LOADING,this.onKeyLoading,this)},S._unregisterListeners=function(){this.hls.off(U.Events.KEY_LOADING,this.onKeyLoading)},S.destroy=function(){this._unregisterListeners();for(var E in this.loaders){var O=this.loaders[E];O&&O.destroy()}this.loaders={}},S.onKeyLoading=function(E,O){var R=O.frag,T=R.type,C=this.loaders[T];if(!R.decryptdata){x.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var b=R.decryptdata.uri;if(b!==this.decrypturl||this.decryptkey===null){var m=this.hls.config;if(C&&(x.logger.warn("abort previous key loader for type:"+T),C.abort()),!b){x.logger.warn("key uri is falsy");return}var n=m.loader,s=R.loader=this.loaders[T]=new n(m);this.decrypturl=b,this.decryptkey=null;var l={url:b,frag:R,responseType:"arraybuffer"},y={timeout:m.fragLoadingTimeOut,maxRetry:0,retryDelay:m.fragLoadingRetryDelay,maxRetryDelay:m.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(l,y,c)}else this.decryptkey&&(R.decryptdata.key=this.decryptkey,this.hls.trigger(U.Events.KEY_LOADED,{frag:R}))},S.loadsuccess=function(E,O,R){var T=R.frag;if(!T.decryptdata){x.logger.error("after key load, decryptdata unset");return}this.decryptkey=T.decryptdata.key=new Uint8Array(E.data),T.loader=null,delete this.loaders[T.type],this.hls.trigger(U.Events.KEY_LOADED,{frag:T})},S.loaderror=function(E,O){var R=O.frag,T=R.loader;T&&T.abort(),delete this.loaders[R.type],this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:R,response:E})},S.loadtimeout=function(E,O){var R=O.frag,T=R.loader;T&&T.abort(),delete this.loaders[R.type],this.hls.trigger(U.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:R})},I}()},"./src/loader/level-details.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"LevelDetails",function(){return I});var U=w("./src/polyfills/number.ts");function _(S,P){for(var E=0;E<P.length;E++){var O=P[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}function x(S,P,E){return P&&_(S.prototype,P),E&&_(S,E),S}var N=10,I=function(){function S(E){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=E}var P=S.prototype;return P.reloaded=function(O){if(!O){this.advanced=!0,this.updated=!0;return}var R=this.lastPartSn-O.lastPartSn,T=this.lastPartIndex-O.lastPartIndex;this.updated=this.endSN!==O.endSN||!!T||!!R,this.advanced=this.endSN>O.endSN||R>0||R===0&&T>0,this.updated||this.advanced?this.misses=Math.floor(O.misses*.6):this.misses=O.misses+1,this.availabilityDelay=O.availabilityDelay},x(S,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(U.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||N}},{key:"drift",get:function(){var O=this.driftEndTime-this.driftStartTime;if(O>0){var R=this.driftEnd-this.driftStart;return R*1e3/O}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var O;return(O=this.partList)!==null&&O!==void 0&&O.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var O;return(O=this.fragments)!==null&&O!==void 0&&O.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 O;return(O=this.partList)!==null&&O!==void 0&&O.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var O;return(O=this.partList)!==null&&O!==void 0&&O.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),S}()},"./src/loader/level-key.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"LevelKey",function(){return I});var U=w("./node_modules/url-toolkit/src/url-toolkit.js"),_=w.n(U);function x(S,P){for(var E=0;E<P.length;E++){var O=P[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}function N(S,P,E){return P&&x(S.prototype,P),E&&x(S,E),S}var I=function(){S.fromURL=function(E,O){return new S(E,O)},S.fromURI=function(E){return new S(E)};function S(P,E){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,E?this._uri=Object(U.buildAbsoluteURL)(P,E,{alwaysNormalize:!0}):this._uri=P}return N(S,[{key:"uri",get:function(){return this._uri}}]),S}()},"./src/loader/load-stats.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"LoadStats",function(){return U});var U=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(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return s});var U=w("./src/polyfills/number.ts"),_=w("./node_modules/url-toolkit/src/url-toolkit.js"),x=w.n(_),N=w("./src/loader/fragment.ts"),I=w("./src/loader/level-details.ts"),S=w("./src/loader/level-key.ts"),P=w("./src/utils/attr-list.ts"),E=w("./src/utils/logger.ts"),O=w("./src/utils/codecs.ts"),R=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,T=/#EXT-X-MEDIA:(.*)/g,C=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),b=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("|")),m=/\.(mp4|m4s|m4v|m4a)$/i;function n(v){var f,i;return m.test((f=(i=_.parseURL(v))===null||i===void 0?void 0:i.path)!=null?f:"")}var s=function(){function v(){}return v.findGroup=function(i,r){for(var t=0;t<i.length;t++){var a=i[t];if(a.id===r)return a}},v.convertAVC1ToAVCOTI=function(i){var r=i.split(".");if(r.length>2){var t=r.shift()+".";return t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4),t}return i},v.resolve=function(i,r){return _.buildAbsoluteURL(r,i,{alwaysNormalize:!0})},v.parseMasterPlaylist=function(i,r){var t=[],a={},g=!1;R.lastIndex=0;for(var h;(h=R.exec(i))!=null;)if(h[1]){var d=new P.AttrList(h[1]),e={attrs:d,bitrate:d.decimalInteger("AVERAGE-BANDWIDTH")||d.decimalInteger("BANDWIDTH"),name:d.NAME,url:v.resolve(h[2],r)},A=d.decimalResolution("RESOLUTION");A&&(e.width=A.width,e.height=A.height),l((d.CODECS||"").split(/[ ,]+/).filter(function(F){return F}),e),e.videoCodec&&e.videoCodec.indexOf("avc1")!==-1&&(e.videoCodec=v.convertAVC1ToAVCOTI(e.videoCodec)),t.push(e)}else if(h[3]){var M=new P.AttrList(h[3]);M["DATA-ID"]&&(g=!0,a[M["DATA-ID"]]=M)}return{levels:t,sessionData:g?a:null}},v.parseMasterPlaylistMedia=function(i,r,t,a){a===void 0&&(a=[]);var g,h=[],d=0;for(T.lastIndex=0;(g=T.exec(i))!==null;){var e=new P.AttrList(g[1]);if(e.TYPE===t){var A={attrs:e,bitrate:0,id:d++,groupId:e["GROUP-ID"],instreamId:e["INSTREAM-ID"],name:e.NAME||e.LANGUAGE||"",type:t,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:e.LANGUAGE,url:e.URI?v.resolve(e.URI,r):""};if(a.length){var M=v.findGroup(a,A.groupId)||a[0];y(A,M,"audioCodec"),y(A,M,"textCodec")}h.push(A)}}return h},v.parseLevelPlaylist=function(i,r,t,a,g){var h=new I.LevelDetails(r),d=h.fragments,e=null,A=0,M=0,F=0,W=0,Z=null,K=new N.Fragment(a,r),J,oe,se,pe=-1,be=!1;for(C.lastIndex=0,h.m3u8=i;(J=C.exec(i))!==null;){be&&(be=!1,K=new N.Fragment(a,r),K.start=F,K.sn=A,K.cc=W,K.level=t,e&&(K.initSegment=e,K.rawProgramDateTime=e.rawProgramDateTime));var Q=J[1];if(Q){K.duration=parseFloat(Q);var te=(" "+J[2]).slice(1);K.title=te||null,K.tagList.push(te?["INF",Q,te]:["INF",Q])}else if(J[3])Object(U.isFiniteNumber)(K.duration)&&(K.start=F,se&&(K.levelkey=se),K.sn=A,K.level=t,K.cc=W,K.urlId=g,d.push(K),K.relurl=(" "+J[3]).slice(1),o(K,Z),Z=K,F+=K.duration,A++,M=0,be=!0);else if(J[4]){var ve=(" "+J[4]).slice(1);Z?K.setByteRange(ve,Z):K.setByteRange(ve)}else if(J[5])K.rawProgramDateTime=(" "+J[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),pe===-1&&(pe=d.length);else{if(J=J[0].match(b),!J){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<J.length&&!(typeof J[oe]!="undefined");oe++);var q=(" "+J[oe]).slice(1),X=(" "+J[oe+1]).slice(1),Te=J[oe+2]?(" "+J[oe+2]).slice(1):"";switch(q){case"PLAYLIST-TYPE":h.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":A=h.startSN=parseInt(X);break;case"SKIP":{var Ie=new P.AttrList(X),Ge=Ie.decimalInteger("SKIPPED-SEGMENTS");if(Object(U.isFiniteNumber)(Ge)){h.skippedSegments=Ge;for(var Ae=Ge;Ae--;)d.unshift(null);A+=Ge}var Me=Ie.enumeratedString("RECENTLY-REMOVED-DATERANGES");Me&&(h.recentlyRemovedDateranges=Me.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||Te)&&K.tagList.push(Te?[X,Te]:[X]);break;case"DIS":W++;case"GAP":K.tagList.push([q]);break;case"BITRATE":K.tagList.push([q,X]);break;case"DISCONTINUITY-SEQ":W=parseInt(X);break;case"KEY":{var Se,Le=new P.AttrList(X),Ve=Le.enumeratedString("METHOD"),$e=Le.URI,Qe=Le.hexadecimalInteger("IV"),Be=Le.enumeratedString("KEYFORMATVERSIONS"),ze=Le.enumeratedString("KEYID"),ot=(Se=Le.enumeratedString("KEYFORMAT"))!=null?Se:"identity",Re=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Re.indexOf(ot)>-1){E.logger.warn("Keyformat "+ot+" is not supported from the manifest");continue}else if(ot!=="identity")continue;Ve&&(se=S.LevelKey.fromURL(r,$e),$e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ve)>=0&&(se.method=Ve,se.keyFormat=ot,ze&&(se.keyID=ze),Be&&(se.keyFormatVersions=Be),se.iv=Qe));break}case"START":{var nt=new P.AttrList(X),rt=nt.decimalFloatingPoint("TIME-OFFSET");Object(U.isFiniteNumber)(rt)&&(h.startTimeOffset=rt);break}case"MAP":{var lt=new P.AttrList(X);K.relurl=lt.URI,lt.BYTERANGE&&K.setByteRange(lt.BYTERANGE),K.level=t,K.sn="initSegment",se&&(K.levelkey=se),K.initSegment=null,e=K,be=!0;break}case"SERVER-CONTROL":{var bt=new P.AttrList(X);h.canBlockReload=bt.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=bt.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&bt.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=bt.optionalFloat("PART-HOLD-BACK",0),h.holdBack=bt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ee=new P.AttrList(X);h.partTarget=Ee.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Oe=h.partList;Oe||(Oe=h.partList=[]);var je=M>0?Oe[Oe.length-1]:void 0,Ye=M++,De=new N.Part(new P.AttrList(X),K,r,Ye,je);Oe.push(De),K.duration+=De.duration;break}case"PRELOAD-HINT":{var Ke=new P.AttrList(X);h.preloadHint=Ke;break}case"RENDITION-REPORT":{var ce=new P.AttrList(X);h.renditionReports=h.renditionReports||[],h.renditionReports.push(ce);break}default:E.logger.warn("line parsed but not handled: "+J);break}}}Z&&!Z.relurl?(d.pop(),F-=Z.duration,h.partList&&(h.fragmentHint=Z)):h.partList&&(o(K,Z),K.cc=W,h.fragmentHint=K);var re=d.length,ie=d[0],$=d[re-1];if(F+=h.skippedSegments*h.targetduration,F>0&&re&&$){h.averagetargetduration=F/re;var Y=$.sn;h.endSN=Y!=="initSegment"?Y:0,ie&&(h.startCC=ie.cc,ie.initSegment||h.fragments.every(function(V){return V.relurl&&n(V.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new N.Fragment(a,r),K.relurl=$.relurl,K.level=t,K.sn="initSegment",ie.initSegment=K,h.needSidxRanges=!0))}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(F+=h.fragmentHint.duration),h.totalduration=F,h.endCC=W,pe>0&&c(d,pe),h},v}();function l(v,f){["video","audio","text"].forEach(function(i){var r=v.filter(function(a){return Object(O.isCodecType)(a,i)});if(r.length){var t=r.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});f[i+"Codec"]=t.length>0?t[0]:r[0],v=v.filter(function(a){return r.indexOf(a)===-1})}}),f.unknownCodecs=v}function y(v,f,i){var r=f[i];r&&(v[i]=r)}function c(v,f){for(var i=v[f],r=f;r--;){var t=v[r];if(!t)return;t.programDateTime=i.programDateTime-t.duration*1e3,i=t}}function o(v,f){v.rawProgramDateTime?v.programDateTime=Date.parse(v.rawProgramDateTime):f!=null&&f.programDateTime&&(v.programDateTime=f.endProgramDateTime),Object(U.isFiniteNumber)(v.programDateTime)||(v.programDateTime=null,v.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/polyfills/number.ts"),_=w("./src/events.ts"),x=w("./src/errors.ts"),N=w("./src/utils/logger.ts"),I=w("./src/utils/mp4-tools.ts"),S=w("./src/loader/m3u8-parser.ts"),P=w("./src/types/loader.ts"),E=w("./src/utils/attr-list.ts");function O(C){var b=C.type;switch(b){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function R(C,b){var m=C.url;return(m===void 0||m.indexOf("data:")===0)&&(m=b.url),m}var T=function(){function C(m){this.hls=void 0,this.loaders=Object.create(null),this.hls=m,this.registerListeners()}var b=C.prototype;return b.registerListeners=function(){var n=this.hls;n.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(_.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(_.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(_.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},b.unregisterListeners=function(){var n=this.hls;n.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(_.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(_.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(_.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},b.createInternalLoader=function(n){var s=this.hls.config,l=s.pLoader,y=s.loader,c=l||y,o=new c(s);return n.loader=o,this.loaders[n.type]=o,o},b.getInternalLoader=function(n){return this.loaders[n.type]},b.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},b.destroyInternalLoaders=function(){for(var n in this.loaders){var s=this.loaders[n];s&&s.destroy(),this.resetInternalLoader(n)}},b.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},b.onManifestLoading=function(n,s){var l=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},b.onLevelLoading=function(n,s){var l=s.id,y=s.level,c=s.url,o=s.deliveryDirectives;this.load({id:l,groupId:null,level:y,responseType:"text",type:P.PlaylistContextType.LEVEL,url:c,deliveryDirectives:o})},b.onAudioTrackLoading=function(n,s){var l=s.id,y=s.groupId,c=s.url,o=s.deliveryDirectives;this.load({id:l,groupId:y,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:c,deliveryDirectives:o})},b.onSubtitleTrackLoading=function(n,s){var l=s.id,y=s.groupId,c=s.url,o=s.deliveryDirectives;this.load({id:l,groupId:y,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:c,deliveryDirectives:o})},b.load=function(n){var s,l=this.hls.config,y=this.getInternalLoader(n);if(y){var c=y.context;if(c&&c.url===n.url){N.logger.trace("[playlist-loader]: playlist request ongoing");return}N.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),y.abort()}var o,v,f,i;switch(n.type){case P.PlaylistContextType.MANIFEST:o=l.manifestLoadingMaxRetry,v=l.manifestLoadingTimeOut,f=l.manifestLoadingRetryDelay,i=l.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:o=0,v=l.levelLoadingTimeOut;break;default:o=l.levelLoadingMaxRetry,v=l.levelLoadingTimeOut,f=l.levelLoadingRetryDelay,i=l.levelLoadingMaxRetryTimeout;break}if(y=this.createInternalLoader(n),(s=n.deliveryDirectives)!==null&&s!==void 0&&s.part){var r;if(n.type===P.PlaylistContextType.LEVEL&&n.level!==null?r=this.hls.levels[n.level].details:n.type===P.PlaylistContextType.AUDIO_TRACK&&n.id!==null?r=this.hls.audioTracks[n.id].details:n.type===P.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(r=this.hls.subtitleTracks[n.id].details),r){var t=r.partTarget,a=r.targetduration;t&&a&&(v=Math.min(Math.max(t*3,a*.8)*1e3,v))}}var g={timeout:v,maxRetry:o,retryDelay:f,maxRetryDelay:i,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};y.load(n,g,h)},b.loadsuccess=function(n,s,l,y){if(y===void 0&&(y=null),l.isSidxRequest){this.handleSidxRequest(n,l),this.handlePlaylistLoaded(n,s,l,y);return}this.resetInternalLoader(l.type);var c=n.data;if(c.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,l,"no EXTM3U delimiter",y);return}s.parsing.start=performance.now(),c.indexOf("#EXTINF:")>0||c.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,s,l,y):this.handleMasterPlaylist(n,s,l,y)},b.loaderror=function(n,s,l){l===void 0&&(l=null),this.handleNetworkError(s,l,!1,n)},b.loadtimeout=function(n,s,l){l===void 0&&(l=null),this.handleNetworkError(s,l,!0)},b.handleMasterPlaylist=function(n,s,l,y){var c=this.hls,o=n.data,v=R(n,l),f=S.default.parseMasterPlaylist(o,v),i=f.levels,r=f.sessionData;if(!i.length){this.handleManifestParsingError(n,l,"no level found in manifest",y);return}var t=i.map(function(A){return{id:A.attrs.AUDIO,audioCodec:A.audioCodec}}),a=i.map(function(A){return{id:A.attrs.SUBTITLES,textCodec:A.textCodec}}),g=S.default.parseMasterPlaylistMedia(o,v,"AUDIO",t),h=S.default.parseMasterPlaylistMedia(o,v,"SUBTITLES",a),d=S.default.parseMasterPlaylistMedia(o,v,"CLOSED-CAPTIONS");if(g.length){var e=g.some(function(A){return!A.url});!e&&i[0].audioCodec&&!i[0].attrs.AUDIO&&(N.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 E.AttrList({}),bitrate:0,url:""}))}c.trigger(_.Events.MANIFEST_LOADED,{levels:i,audioTracks:g,subtitles:h,captions:d,url:v,stats:s,networkDetails:y,sessionData:r})},b.handleTrackOrLevelPlaylist=function(n,s,l,y){var c=this.hls,o=l.id,v=l.level,f=l.type,i=R(n,l),r=Object(U.isFiniteNumber)(o)?o:0,t=Object(U.isFiniteNumber)(v)?v:r,a=O(l),g=S.default.parseLevelPlaylist(n.data,i,t,a,r);if(!g.fragments.length){c.trigger(_.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:i,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(f===P.PlaylistContextType.MANIFEST){var h={attrs:new E.AttrList({}),bitrate:0,details:g,name:"",url:i};c.trigger(_.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:i,stats:s,networkDetails:y,sessionData:null})}if(s.parsing.end=performance.now(),g.needSidxRanges){var d,e=(d=g.fragments[0].initSegment)===null||d===void 0?void 0:d.url;this.load({url:e,isSidxRequest:!0,type:f,level:v,levelDetails:g,id:o,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=g,this.handlePlaylistLoaded(n,s,l,y)},b.handleSidxRequest=function(n,s){var l=Object(I.parseSegmentIndex)(new Uint8Array(n.data));if(!l)return;var y=l.references,c=s.levelDetails;y.forEach(function(o,v){var f=o.info,i=c.fragments[v];i.byteRange.length===0&&i.setByteRange(String(1+f.end-f.start)+"@"+String(f.start)),i.initSegment&&i.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},b.handleManifestParsingError=function(n,s,l,y){this.hls.trigger(_.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===P.PlaylistContextType.MANIFEST,url:n.url,reason:l,response:n,context:s,networkDetails:y})},b.handleNetworkError=function(n,s,l,y){l===void 0&&(l=!1),N.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var c=x.ErrorDetails.UNKNOWN,o=!1,v=this.getInternalLoader(n);switch(n.type){case P.PlaylistContextType.MANIFEST:c=l?x.ErrorDetails.MANIFEST_LOAD_TIMEOUT:x.ErrorDetails.MANIFEST_LOAD_ERROR,o=!0;break;case P.PlaylistContextType.LEVEL:c=l?x.ErrorDetails.LEVEL_LOAD_TIMEOUT:x.ErrorDetails.LEVEL_LOAD_ERROR,o=!1;break;case P.PlaylistContextType.AUDIO_TRACK:c=l?x.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:x.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,o=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:c=l?x.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:x.ErrorDetails.SUBTITLE_LOAD_ERROR,o=!1;break}v&&this.resetInternalLoader(n.type);var f={type:x.ErrorTypes.NETWORK_ERROR,details:c,fatal:o,url:n.url,loader:v,context:n,networkDetails:s};y&&(f.response=y),this.hls.trigger(_.Events.ERROR,f)},b.handlePlaylistLoaded=function(n,s,l,y){var c=l.type,o=l.level,v=l.id,f=l.groupId,i=l.loader,r=l.levelDetails,t=l.deliveryDirectives;if(!(r!=null&&r.targetduration)){this.handleManifestParsingError(n,l,"invalid target duration",y);return}if(!i)return;r.live&&(i.getCacheAge&&(r.ageHeader=i.getCacheAge()||0),(!i.getCacheAge||isNaN(r.ageHeader))&&(r.ageHeader=0));switch(c){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(_.Events.LEVEL_LOADED,{details:r,level:o||0,id:v||0,stats:s,networkDetails:y,deliveryDirectives:t});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(_.Events.AUDIO_TRACK_LOADED,{details:r,id:v||0,groupId:f||"",stats:s,networkDetails:y,deliveryDirectives:t});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(_.Events.SUBTITLE_TRACK_LOADED,{details:r,id:v||0,groupId:f||"",stats:s,networkDetails:y,deliveryDirectives:t});break}},C}();B.default=T},"./src/polyfills/number.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"isFiniteNumber",function(){return U}),w.d(B,"MAX_SAFE_INTEGER",function(){return _});var U=Number.isFinite||function(x){return typeof x=="number"&&isFinite(x)},_=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(he,B,w){"use strict";w.r(B);var U=function(){function _(){}return _.getSilentFrame=function(N,I){switch(N){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},_}();B.default=U},"./src/remux/mp4-generator.ts":function(he,B,w){"use strict";w.r(B);var U=Math.pow(2,32)-1,_=function(){function x(){}return x.init=function(){x.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 x.types)x.types.hasOwnProperty(I)&&(x.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var S=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),P=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);x.HDLR_TYPES={video:S,audio:P};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]);x.STTS=x.STSC=x.STCO=O,x.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),x.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),x.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),x.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var R=new Uint8Array([105,115,111,109]),T=new Uint8Array([97,118,99,49]),C=new Uint8Array([0,0,0,1]);x.FTYP=x.box(x.types.ftyp,R,C,R,T),x.DINF=x.box(x.types.dinf,x.box(x.types.dref,E))},x.box=function(I){for(var S=8,P=arguments.length,E=new Array(P>1?P-1:0),O=1;O<P;O++)E[O-1]=arguments[O];for(var R=E.length,T=R;R--;)S+=E[R].byteLength;var C=new Uint8Array(S);for(C[0]=S>>24&255,C[1]=S>>16&255,C[2]=S>>8&255,C[3]=S&255,C.set(I,4),R=0,S=8;R<T;R++)C.set(E[R],S),S+=E[R].byteLength;return C},x.hdlr=function(I){return x.box(x.types.hdlr,x.HDLR_TYPES[I])},x.mdat=function(I){return x.box(x.types.mdat,I)},x.mdhd=function(I,S){S*=I;var P=Math.floor(S/(U+1)),E=Math.floor(S%(U+1));return x.box(x.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,P>>24,P>>16&255,P>>8&255,P&255,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},x.mdia=function(I){return x.box(x.types.mdia,x.mdhd(I.timescale,I.duration),x.hdlr(I.type),x.minf(I))},x.mfhd=function(I){return x.box(x.types.mfhd,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255]))},x.minf=function(I){return I.type==="audio"?x.box(x.types.minf,x.box(x.types.smhd,x.SMHD),x.DINF,x.stbl(I)):x.box(x.types.minf,x.box(x.types.vmhd,x.VMHD),x.DINF,x.stbl(I))},x.moof=function(I,S,P){return x.box(x.types.moof,x.mfhd(I),x.traf(P,S))},x.moov=function(I){for(var S=I.length,P=[];S--;)P[S]=x.trak(I[S]);return x.box.apply(null,[x.types.moov,x.mvhd(I[0].timescale,I[0].duration)].concat(P).concat(x.mvex(I)))},x.mvex=function(I){for(var S=I.length,P=[];S--;)P[S]=x.trex(I[S]);return x.box.apply(null,[x.types.mvex].concat(P))},x.mvhd=function(I,S){S*=I;var P=Math.floor(S/(U+1)),E=Math.floor(S%(U+1)),O=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,P>>24,P>>16&255,P>>8&255,P&255,E>>24,E>>16&255,E>>8&255,E&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 x.box(x.types.mvhd,O)},x.sdtp=function(I){var S=I.samples||[],P=new Uint8Array(4+S.length),E,O;for(E=0;E<S.length;E++)O=S[E].flags,P[E+4]=O.dependsOn<<4|O.isDependedOn<<2|O.hasRedundancy;return x.box(x.types.sdtp,P)},x.stbl=function(I){return x.box(x.types.stbl,x.stsd(I),x.box(x.types.stts,x.STTS),x.box(x.types.stsc,x.STSC),x.box(x.types.stsz,x.STSZ),x.box(x.types.stco,x.STCO))},x.avc1=function(I){var S=[],P=[],E,O,R;for(E=0;E<I.sps.length;E++)O=I.sps[E],R=O.byteLength,S.push(R>>>8&255),S.push(R&255),S=S.concat(Array.prototype.slice.call(O));for(E=0;E<I.pps.length;E++)O=I.pps[E],R=O.byteLength,P.push(R>>>8&255),P.push(R&255),P=P.concat(Array.prototype.slice.call(O));var T=x.box(x.types.avcC,new Uint8Array([1,S[3],S[4],S[5],252|3,224|I.sps.length].concat(S).concat([I.pps.length]).concat(P))),C=I.width,b=I.height,m=I.pixelRatio[0],n=I.pixelRatio[1];return x.box(x.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,C>>8&255,C&255,b>>8&255,b&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]),T,x.box(x.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),x.box(x.types.pasp,new Uint8Array([m>>24,m>>16&255,m>>8&255,m&255,n>>24,n>>16&255,n>>8&255,n&255])))},x.esds=function(I){var S=I.config.length;return new Uint8Array([0,0,0,0,3,23+S,0,1,0,4,15+S,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([S]).concat(I.config).concat([6,1,2]))},x.mp4a=function(I){var S=I.samplerate;return x.box(x.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,S>>8&255,S&255,0,0]),x.box(x.types.esds,x.esds(I)))},x.mp3=function(I){var S=I.samplerate;return x.box(x.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,S>>8&255,S&255,0,0]))},x.stsd=function(I){return I.type==="audio"?!I.isAAC&&I.codec==="mp3"?x.box(x.types.stsd,x.STSD,x.mp3(I)):x.box(x.types.stsd,x.STSD,x.mp4a(I)):x.box(x.types.stsd,x.STSD,x.avc1(I))},x.tkhd=function(I){var S=I.id,P=I.duration*I.timescale,E=I.width,O=I.height,R=Math.floor(P/(U+1)),T=Math.floor(P%(U+1));return x.box(x.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,S>>24&255,S>>16&255,S>>8&255,S&255,0,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,T>>24,T>>16&255,T>>8&255,T&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,E>>8&255,E&255,0,0,O>>8&255,O&255,0,0]))},x.traf=function(I,S){var P=x.sdtp(I),E=I.id,O=Math.floor(S/(U+1)),R=Math.floor(S%(U+1));return x.box(x.types.traf,x.box(x.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),x.box(x.types.tfdt,new Uint8Array([1,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,R>>24,R>>16&255,R>>8&255,R&255])),x.trun(I,P.length+16+20+8+16+8+8),P)},x.trak=function(I){return I.duration=I.duration||4294967295,x.box(x.types.trak,x.tkhd(I),x.mdia(I))},x.trex=function(I){var S=I.id;return x.box(x.types.trex,new Uint8Array([0,0,0,0,S>>24,S>>16&255,S>>8&255,S&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},x.trun=function(I,S){var P=I.samples||[],E=P.length,O=12+16*E,R=new Uint8Array(O),T,C,b,m,n,s;for(S+=8+O,R.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255],0),T=0;T<E;T++)C=P[T],b=C.duration,m=C.size,n=C.flags,s=C.cts,R.set([b>>>24&255,b>>>16&255,b>>>8&255,b&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*T);return x.box(x.types.trun,R)},x.initSegment=function(I){x.types||x.init();var S=x.moov(I),P=new Uint8Array(x.FTYP.byteLength+S.byteLength);return P.set(x.FTYP),P.set(S,x.FTYP.byteLength),P},x}();_.types=void 0,_.HDLR_TYPES=void 0,_.STTS=void 0,_.STSC=void 0,_.STCO=void 0,_.STSZ=void 0,_.VMHD=void 0,_.SMHD=void 0,_.STSD=void 0,_.FTYP=void 0,_.DINF=void 0,B.default=_},"./src/remux/mp4-remuxer.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return s}),w.d(B,"normalizePts",function(){return l});var U=w("./src/polyfills/number.ts"),_=w("./src/remux/aac-helper.ts"),x=w("./src/remux/mp4-generator.ts"),N=w("./src/events.ts"),I=w("./src/errors.ts"),S=w("./src/utils/logger.ts"),P=w("./src/types/loader.ts"),E=w("./src/utils/timescale-conversion.ts");function O(){return O=Object.assign||function(v){for(var f=1;f<arguments.length;f++){var i=arguments[f];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(v[r]=i[r])}return v},O.apply(this,arguments)}var R=10*1e3,T=1024,C=1152,b=null,m=null,n=!1,s=function(){function v(i,r,t,a){if(a===void 0&&(a=""),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=i,this.config=r,this.typeSupported=t,this.ISGenerated=!1,b===null){var g=navigator.userAgent||"",h=g.match(/Chrome\/(\d+)/i);b=h?parseInt(h[1]):0}if(m===null){var d=navigator.userAgent.match(/Safari\/(\d+)/i);m=d?parseInt(d[1]):0}n=!!b&&b<75||!!m&&m<600}var f=v.prototype;return f.destroy=function(){},f.resetTimeStamp=function(r){S.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=r},f.resetNextTimestamp=function(){S.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},f.resetInitSegment=function(){S.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},f.getVideoStartPts=function(r){var t=!1,a=r.reduce(function(g,h){var d=h.pts-g;return d<-4294967296?(t=!0,l(g,h.pts)):d>0?g:h.pts},r[0].pts);return t&&S.logger.debug("PTS rollover detected"),a},f.remux=function(r,t,a,g,h,d,e,A){var M,F,W,Z,K,J,oe=h,se=h,pe=r.pid>-1,be=t.pid>-1,Q=t.samples.length,te=r.samples.length>0,ve=Q>1,q=(!pe||te)&&(!be||ve)||this.ISGenerated||e;if(q){this.ISGenerated||(W=this.generateIS(r,t,h));var X=this.isVideoContiguous,Te=-1;if(ve&&(Te=y(t.samples),!X&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,Te>0){S.logger.warn("[mp4-remuxer]: Dropped "+Te+" out of "+Q+" video samples due to a missing keyframe");var Ie=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Te),t.dropped+=Te,se+=(t.samples[0].pts-Ie)/(t.timescale||9e4)}else Te===-1&&(S.logger.warn("[mp4-remuxer]: No keyframe found out of "+Q+" video samples"),J=!1);if(this.ISGenerated){if(te&&ve){var Ge=this.getVideoStartPts(t.samples),Ae=l(r.samples[0].pts,Ge)-Ge,Me=Ae/t.inputTimeScale;oe+=Math.max(0,Me),se+=Math.max(0,-Me)}if(te){if(r.samplerate||(S.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),W=this.generateIS(r,t,h)),F=this.remuxAudio(r,oe,this.isAudioContiguous,d,be||ve||A===P.PlaylistLevelType.AUDIO?se:void 0),ve){var Se=F?F.endPTS-F.startPTS:0;t.inputTimeScale||(S.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),W=this.generateIS(r,t,h)),M=this.remuxVideo(t,se,X,Se)}}else ve&&(M=this.remuxVideo(t,se,X,0));M&&(M.firstKeyFrame=Te,M.independent=Te!==-1)}}return this.ISGenerated&&(a.samples.length&&(K=this.remuxID3(a,h)),g.samples.length&&(Z=this.remuxText(g,h))),{audio:F,video:M,initSegment:W,independent:J,text:Z,id3:K}},f.generateIS=function(r,t,a){var g=r.samples,h=t.samples,d=this.typeSupported,e={},A=!Object(U.isFiniteNumber)(this._initPTS),M="audio/mp4",F,W,Z;if(A&&(F=W=Infinity),r.config&&g.length&&(r.timescale=r.samplerate,r.isAAC||(d.mpeg?(M="audio/mpeg",r.codec=""):d.mp3&&(r.codec="mp3")),e.audio={id:"audio",container:M,codec:r.codec,initSegment:!r.isAAC&&d.mpeg?new Uint8Array(0):x.default.initSegment([r]),metadata:{channelCount:r.channelCount}},A&&(Z=r.inputTimeScale,F=W=g[0].pts-Math.round(Z*a))),t.sps&&t.pps&&h.length&&(t.timescale=t.inputTimeScale,e.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:x.default.initSegment([t]),metadata:{width:t.width,height:t.height}},A)){Z=t.inputTimeScale;var K=this.getVideoStartPts(h),J=Math.round(Z*a);W=Math.min(W,l(h[0].dts,K)-J),F=Math.min(F,K-J)}if(Object.keys(e).length)return this.ISGenerated=!0,A&&(this._initPTS=F,this._initDTS=W),{tracks:e,initPTS:F,timescale:Z}},f.remuxVideo=function(r,t,a,g){var h=r.inputTimeScale,d=r.samples,e=[],A=d.length,M=this._initPTS,F=this.nextAvcDts,W=8,Z,K,J,oe=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,pe=0,be=!1;if(!a||F===null){var Q=t*h,te=d[0].pts-l(d[0].dts,d[0].pts);F=Q-te}for(var ve=0;ve<A;ve++){var q=d[ve];if(q.pts=l(q.pts-M,F),q.dts=l(q.dts-M,F),q.dts>q.pts){var X=9e4*.2;pe=Math.max(Math.min(pe,q.pts-q.dts),-1*X)}q.dts<d[ve>0?ve-1:ve].dts&&(be=!0)}be&&d.sort(function(en,tn){var Dt=en.dts-tn.dts,_n=en.pts-tn.pts;return Dt||_n}),K=d[0].dts,J=d[d.length-1].dts;var Te=Math.round((J-K)/(A-1));if(pe<0){if(pe<Te*-2){S.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(E.toMsFromMpegTsClock)(-Te,!0)+" ms");for(var Ie=pe,Ge=0;Ge<A;Ge++)d[Ge].dts=Ie=Math.max(Ie,d[Ge].pts-Te),d[Ge].pts=Math.max(Ie,d[Ge].pts)}else{S.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(E.toMsFromMpegTsClock)(pe,!0)+" ms to overcome this issue");for(var Ae=0;Ae<A;Ae++)d[Ae].dts=d[Ae].dts+pe}K=d[0].dts}if(a){var Me=K-F,Se=Me>Te,Le=Me<-1;if(Se||Le){Se?S.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(Me,!0)+" ms ("+Me+"dts) hole between fragments detected, filling it"):S.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-Me,!0)+" ms ("+Me+"dts) overlapping between fragments detected"),K=F;var Ve=d[0].pts-Me;d[0].dts=K,d[0].pts=Ve,S.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(Ve,!0)+"/"+Object(E.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(Me,!0)+" ms")}}n&&(K=Math.max(0,K));for(var $e=0,Qe=0,Be=0;Be<A;Be++){for(var ze=d[Be],ot=ze.units,Re=ot.length,nt=0,rt=0;rt<Re;rt++)nt+=ot[rt].data.length;Qe+=nt,$e+=Re,ze.length=nt,ze.dts=Math.max(ze.dts,K),ze.pts=Math.max(ze.pts,ze.dts,0),oe=Math.min(ze.pts,oe),se=Math.max(ze.pts,se)}J=d[A-1].dts;var lt=Qe+4*$e+8,bt;try{bt=new Uint8Array(lt)}catch(en){this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:lt,reason:"fail allocating video mdat "+lt});return}var Ee=new DataView(bt.buffer);Ee.setUint32(0,lt),bt.set(x.default.types.mdat,4);for(var Oe=0;Oe<A;Oe++){for(var je=d[Oe],Ye=je.units,De=0,Ke=0,ce=Ye.length;Ke<ce;Ke++){var re=Ye[Ke],ie=re.data,$=re.data.byteLength;Ee.setUint32(W,$),W+=4,bt.set(ie,W),W+=$,De+=4+$}if(Oe<A-1)Z=d[Oe+1].dts-je.dts;else{var Y=this.config,V=je.dts-d[Oe>0?Oe-1:Oe].dts;if(Y.stretchShortVideoTrack&&this.nextAudioPts!==null){var ne=Math.floor(Y.maxBufferHole*h),_e=(g?oe+g*h:this.nextAudioPts)-je.pts;_e>ne?(Z=_e-V,Z<0&&(Z=V),S.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+Z/90+" ms for the last video frame.")):Z=V}else Z=V}var we=Math.round(je.pts-je.dts);e.push(new c(je.key,Z,De,we))}if(e.length&&b&&b<70){var Xe=e[0].flags;Xe.dependsOn=2,Xe.isNonSync=0}console.assert(Z!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=J+Z,this.isVideoContiguous=!0;var gt=x.default.moof(r.sequenceNumber++,K,O({},r,{samples:e})),Nt="video",ht={data1:gt,data2:bt,startPTS:oe/h,endPTS:(se+Z)/h,startDTS:K/h,endDTS:F/h,type:Nt,hasAudio:!1,hasVideo:!0,nb:e.length,dropped:r.dropped};return r.samples=[],r.dropped=0,console.assert(bt.length,"MDAT length must not be zero"),ht},f.remuxAudio=function(r,t,a,g,h){var d=r.inputTimeScale,e=r.samplerate?r.samplerate:d,A=d/e,M=r.isAAC?T:C,F=M*A,W=this._initPTS,Z=!r.isAAC&&this.typeSupported.mpeg,K=[],J=r.samples,oe=Z?0:8,se=this.nextAudioPts||-1,pe=t*d;if(this.isAudioContiguous=a=a||J.length&&se>0&&(g&&Math.abs(pe-se)<9e3||Math.abs(l(J[0].pts-W,pe)-se)<20*F),J.forEach(function(ie){ie.pts=l(ie.pts-W,pe)}),!a||se<0){if(J=J.filter(function(ie){return ie.pts>=0}),!J.length)return;h===0?se=0:g?se=Math.max(0,pe):se=J[0].pts}if(r.isAAC)for(var be=h!==void 0,Q=this.config.maxAudioFramesDrift,te=0,ve=se;te<J.length;te++){var q=J[te],X=q.pts,Te=X-ve,Ie=Math.abs(1e3*Te/d);if(Te<=-Q*F&&be)te===0&&(S.logger.warn("Audio frame @ "+(X/d).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Te/d)+" ms."),this.nextAudioPts=se=ve=X);else if(Te>=Q*F&&Ie<R&&be){var Ge=Math.round(Te/F);ve=X-Ge*F,ve<0&&(Ge--,ve+=F),te===0&&(this.nextAudioPts=se=ve),S.logger.warn("[mp4-remuxer]: Injecting "+Ge+" audio frame @ "+(ve/d).toFixed(3)+"s due to "+Math.round(1e3*Te/d)+" ms gap.");for(var Ae=0;Ae<Ge;Ae++){var Me=Math.max(ve,0),Se=_.default.getSilentFrame(r.manifestCodec||r.codec,r.channelCount);Se||(S.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Se=q.unit.subarray()),J.splice(te,0,{unit:Se,pts:Me}),ve+=F,te++}}q.pts=ve,ve+=F}for(var Le=null,Ve=null,$e,Qe=0,Be=J.length;Be--;)Qe+=J[Be].unit.byteLength;for(var ze=0,ot=J.length;ze<ot;ze++){var Re=J[ze],nt=Re.unit,rt=Re.pts;if(Ve!==null){var lt=K[ze-1];lt.duration=Math.round((rt-Ve)/A)}else if(a&&r.isAAC&&(rt=se),Le=rt,Qe>0){Qe+=oe;try{$e=new Uint8Array(Qe)}catch(ie){this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating audio mdat "+Qe});return}if(!Z){var bt=new DataView($e.buffer);bt.setUint32(0,Qe),$e.set(x.default.types.mdat,4)}}else return;$e.set(nt,oe);var Ee=nt.byteLength;oe+=Ee,K.push(new c(!0,M,Ee,0)),Ve=rt}var Oe=K.length;if(!Oe)return;var je=K[K.length-1];this.nextAudioPts=se=Ve+A*je.duration;var Ye=Z?new Uint8Array(0):x.default.moof(r.sequenceNumber++,Le/A,O({},r,{samples:K}));r.samples=[];var De=Le/d,Ke=se/d,ce="audio",re={data1:Ye,data2:$e,startPTS:De,endPTS:Ke,startDTS:De,endDTS:Ke,type:ce,hasAudio:!0,hasVideo:!1,nb:Oe};return this.isAudioContiguous=!0,console.assert($e.length,"MDAT length must not be zero"),re},f.remuxEmptyAudio=function(r,t,a,g){var h=r.inputTimeScale,d=r.samplerate?r.samplerate:h,e=h/d,A=this.nextAudioPts,M=(A!==null?A:g.startDTS*h)+this._initDTS,F=g.endDTS*h+this._initDTS,W=e*T,Z=Math.ceil((F-M)/W),K=_.default.getSilentFrame(r.manifestCodec||r.codec,r.channelCount);if(S.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){S.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],oe=0;oe<Z;oe++){var se=M+oe*W;J.push({unit:K,pts:se,dts:se})}return r.samples=J,this.remuxAudio(r,t,a,!1)},f.remuxID3=function(r,t){var a=r.samples.length;if(!a)return;for(var g=r.inputTimeScale,h=this._initPTS,d=this._initDTS,e=0;e<a;e++){var A=r.samples[e];A.pts=l(A.pts-h,t*g)/g,A.dts=l(A.dts-d,t*g)/g}var M=r.samples;return r.samples=[],{samples:M}},f.remuxText=function(r,t){var a=r.samples.length;if(!a)return;for(var g=r.inputTimeScale,h=this._initPTS,d=0;d<a;d++){var e=r.samples[d];e.pts=l(e.pts-h,t*g)/g}r.samples.sort(function(M,F){return M.pts-F.pts});var A=r.samples;return r.samples=[],{samples:A}},v}();function l(v,f){var i;if(f===null)return v;for(f<v?i=-8589934592:i=8589934592;Math.abs(v-f)>4294967296;)v+=i;return v}function y(v){for(var f=0;f<v.length;f++)if(v[f].key)return f;return-1}var c=function(f,i,r,t){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=i,this.size=r,this.cts=t,this.flags=new o(f)},o=function(f){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=f?2:1,this.isNonSync=f?0:1}},"./src/remux/passthrough-remuxer.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/polyfills/number.ts"),_=w("./src/utils/mp4-tools.ts"),x=w("./src/loader/fragment.ts"),N=w("./src/utils/logger.ts"),I=function(){function E(){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 O=E.prototype;return O.destroy=function(){},O.resetTimeStamp=function(T){this.initPTS=T,this.lastEndDTS=null},O.resetNextTimestamp=function(){this.lastEndDTS=null},O.resetInitSegment=function(T,C,b){this.audioCodec=C,this.videoCodec=b,this.generateInitSegment(T),this.emitInitSegment=!0},O.generateInitSegment=function(T){var C=this.audioCodec,b=this.videoCodec;if(!T||!T.byteLength){this.initTracks=void 0,this.initData=void 0;return}var m=this.initData=Object(_.parseInitSegment)(T);C||(C=P(m.audio,x.ElementaryStreamTypes.AUDIO)),b||(b=P(m.video,x.ElementaryStreamTypes.VIDEO));var n={};m.audio&&m.video?n.audiovideo={container:"video/mp4",codec:C+","+b,initSegment:T,id:"main"}:m.audio?n.audio={container:"audio/mp4",codec:C,initSegment:T,id:"audio"}:m.video?n.video={container:"video/mp4",codec:b,initSegment:T,id:"main"}:N.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},O.remux=function(T,C,b,m,n){var s=this.initPTS,l=this.lastEndDTS,y={audio:void 0,video:void 0,text:m,id3:b,initSegment:void 0};Object(U.isFiniteNumber)(l)||(l=this.lastEndDTS=n||0);var c=C.samples;if(!c||!c.length)return y;var o={initPTS:void 0,timescale:1},v=this.initData;if((!v||!v.length)&&(this.generateInitSegment(c),v=this.initData),!v||!v.length)return N.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),y;this.emitInitSegment&&(o.tracks=this.initTracks,this.emitInitSegment=!1),Object(U.isFiniteNumber)(s)||(this.initPTS=o.initPTS=s=S(v,c,l));var f=Object(_.getDuration)(c,v),i=l,r=f+i;Object(_.offsetStartDTS)(v,c,s),f>0?this.lastEndDTS=r:(N.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var t=!!v.audio,a=!!v.video,g="";t&&(g+="audio"),a&&(g+="video");var h={data1:c,startPTS:i,startDTS:i,endPTS:r,endDTS:r,type:g,hasAudio:t,hasVideo:a,nb:1,dropped:0};return y.audio=h.type==="audio"?h:void 0,y.video=h.type!=="audio"?h:void 0,y.text=m,y.id3=b,y.initSegment=o,y},E}(),S=function(O,R,T){return Object(_.getStartDTS)(O,R)-T};function P(E,O){var R=E==null?void 0:E.codec;return R&&R.length>4?R:R==="hvc1"?"hvc1.1.c.L120.90":R==="av01"?"av01.0.04M.08":R==="avc1"||O===x.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}B.default=I},"./src/task-loop.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return U});var U=function(){function _(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var x=_.prototype;return x.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},x.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},x.onHandlerDestroyed=function(){},x.hasInterval=function(){return!!this._tickInterval},x.hasNextTick=function(){return!!this._tickTimer},x.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},x.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},x.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},x.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},x.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},x.doTick=function(){},_}()},"./src/types/cmcd.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"CMCDVersion",function(){return U}),w.d(B,"CMCDObjectType",function(){return _}),w.d(B,"CMCDStreamingFormat",function(){return x}),w.d(B,"CMCDStreamType",function(){return N});var U=1,_;(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"})(_||(_={}));var x;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(x||(x={}));var N;(function(I){I.VOD="v",I.LIVE="l"})(N||(N={}))},"./src/types/level.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"HlsSkip",function(){return x}),w.d(B,"getSkipValue",function(){return N}),w.d(B,"HlsUrlParameters",function(){return I}),w.d(B,"Level",function(){return S});function U(P,E){for(var O=0;O<E.length;O++){var R=E[O];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(P,R.key,R)}}function _(P,E,O){return E&&U(P.prototype,E),O&&U(P,O),P}var x;(function(P){P.No="",P.Yes="YES",P.v2="v2"})(x||(x={}));function N(P,E){var O=P.canSkipUntil,R=P.canSkipDateRanges,T=P.endSN,C=E!==void 0?E-T:0;return O&&C<O?R?x.v2:x.Yes:x.No}var I=function(){function P(O,R,T){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=O,this.part=R,this.skip=T}var E=P.prototype;return E.addDirectives=function(R){var T=new self.URL(R);return this.msn!==void 0&&T.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&T.searchParams.set("_HLS_part",this.part.toString()),this.skip&&T.searchParams.set("_HLS_skip",this.skip),T.toString()},P}(),S=function(){function P(E){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=[E.url],this.attrs=E.attrs,this.bitrate=E.bitrate,E.details&&(this.details=E.details),this.id=E.id||0,this.name=E.name,this.width=E.width||0,this.height=E.height||0,this.audioCodec=E.audioCodec,this.videoCodec=E.videoCodec,this.unknownCodecs=E.unknownCodecs,this.codecSet=[E.videoCodec,E.audioCodec].filter(function(O){return O}).join(",").replace(/\.[^.,]+/g,"")}return _(P,[{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(O){var R=O%this.url.length;this._urlId!==R&&(this.details=void 0,this._urlId=R)}}]),P}()},"./src/types/loader.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"PlaylistContextType",function(){return U}),w.d(B,"PlaylistLevelType",function(){return _});var U;(function(x){x.MANIFEST="manifest",x.LEVEL="level",x.AUDIO_TRACK="audioTrack",x.SUBTITLE_TRACK="subtitleTrack"})(U||(U={}));var _;(function(x){x.MAIN="main",x.AUDIO="audio",x.SUBTITLE="subtitle"})(_||(_={}))},"./src/types/transmuxer.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"ChunkMetadata",function(){return U});var U=function(N,I,S,P,E,O){P===void 0&&(P=0),E===void 0&&(E=-1),O===void 0&&(O=!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=_(),this.buffering={audio:_(),video:_(),audiovideo:_()},this.level=N,this.sn=I,this.id=S,this.size=P,this.part=E,this.partial=O};function _(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"AttrList",function(){return x});var U=/^(\d+)x(\d+)$/,_=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,x=function(){function N(S){typeof S=="string"&&(S=N.parseAttrList(S));for(var P in S)S.hasOwnProperty(P)&&(this[P]=S[P])}var I=N.prototype;return I.decimalInteger=function(P){var E=parseInt(this[P],10);return E>Number.MAX_SAFE_INTEGER?Infinity:E},I.hexadecimalInteger=function(P){if(this[P]){var E=(this[P]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var O=new Uint8Array(E.length/2),R=0;R<E.length/2;R++)O[R]=parseInt(E.slice(R*2,R*2+2),16);return O}else return null},I.hexadecimalIntegerAsNumber=function(P){var E=parseInt(this[P],16);return E>Number.MAX_SAFE_INTEGER?Infinity:E},I.decimalFloatingPoint=function(P){return parseFloat(this[P])},I.optionalFloat=function(P,E){var O=this[P];return O?parseFloat(O):E},I.enumeratedString=function(P){return this[P]},I.bool=function(P){return this[P]==="YES"},I.decimalResolution=function(P){var E=U.exec(this[P]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},N.parseAttrList=function(P){var E,O={},R='"';for(_.lastIndex=0;(E=_.exec(P))!==null;){var T=E[2];T.indexOf(R)===0&&T.lastIndexOf(R)===T.length-1&&(T=T.slice(1,-1)),O[E[1]]=T}return O},N}()},"./src/utils/binary-search.ts":function(he,B,w){"use strict";w.r(B);var U={search:function(x,N){for(var I=0,S=x.length-1,P=null,E=null;I<=S;){P=(I+S)/2|0,E=x[P];var O=N(E);if(O>0)I=P+1;else if(O<0)S=P-1;else return E}return null}};B.default=U},"./src/utils/buffer-helper.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"BufferHelper",function(){return x});var U=w("./src/utils/logger.ts"),_={length:0,start:function(){return 0},end:function(){return 0}},x=function(){function N(){}return N.isBuffered=function(S,P){try{if(S){for(var E=N.getBuffered(S),O=0;O<E.length;O++)if(P>=E.start(O)&&P<=E.end(O))return!0}}catch(R){}return!1},N.bufferInfo=function(S,P,E){try{if(S){var O=N.getBuffered(S),R=[],T;for(T=0;T<O.length;T++)R.push({start:O.start(T),end:O.end(T)});return this.bufferedInfo(R,P,E)}}catch(C){}return{len:0,start:P,end:P,nextStart:void 0}},N.bufferedInfo=function(S,P,E){P=Math.max(0,P),S.sort(function(o,v){var f=o.start-v.start;return f||v.end-o.end});var O=[];if(E)for(var R=0;R<S.length;R++){var T=O.length;if(T){var C=O[T-1].end;S[R].start-C<E?S[R].end>C&&(O[T-1].end=S[R].end):O.push(S[R])}else O.push(S[R])}else O=S;for(var b=0,m,n=P,s=P,l=0;l<O.length;l++){var y=O[l].start,c=O[l].end;if(P+E>=y&&P<c)n=y,s=c,b=s-P;else if(P+E<y){m=y;break}}return{len:b,start:n||0,end:s||0,nextStart:m}},N.getBuffered=function(S){try{return S.buffered}catch(P){return U.logger.log("failed to get media.buffered",P),_}},N}()},"./src/utils/cea-608-parser.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"Row",function(){return s}),w.d(B,"CaptionScreen",function(){return l});var U=w("./src/utils/logger.ts"),_={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},x=function(r){var t=r;return _.hasOwnProperty(r)&&(t=_[r]),String.fromCharCode(t)},N=15,I=100,S={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},P={17:2,18:4,21:6,22:8,23:10,19:13,20:15},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},O={25:2,26:4,29:6,30:8,31:10,27:13,28:15},R=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],T;(function(i){i[i.ERROR=0]="ERROR",i[i.TEXT=1]="TEXT",i[i.WARNING=2]="WARNING",i[i.INFO=2]="INFO",i[i.DEBUG=3]="DEBUG",i[i.DATA=3]="DATA"})(T||(T={}));var C=function(){function i(){this.time=null,this.verboseLevel=T.ERROR}var r=i.prototype;return r.log=function(a,g){this.verboseLevel>=a&&U.logger.log(this.time+" ["+a+"] "+g)},i}(),b=function(r){for(var t=[],a=0;a<r.length;a++)t.push(r[a].toString(16));return t},m=function(){function i(t,a,g,h,d){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=a||!1,this.italics=g||!1,this.background=h||"black",this.flash=d||!1}var r=i.prototype;return r.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},r.setStyles=function(a){for(var g=["foreground","underline","italics","background","flash"],h=0;h<g.length;h++){var d=g[h];a.hasOwnProperty(d)&&(this[d]=a[d])}},r.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},r.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},r.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},r.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},i}(),n=function(){function i(t,a,g,h,d,e){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new m(a,g,h,d,e)}var r=i.prototype;return r.reset=function(){this.uchar=" ",this.penState.reset()},r.setChar=function(a,g){this.uchar=a,this.penState.copy(g)},r.setPenState=function(a){this.penState.copy(a)},r.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},r.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},r.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},i}(),s=function(){function i(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var a=0;a<I;a++)this.chars.push(new n);this.logger=t,this.pos=0,this.currPenState=new m}var r=i.prototype;return r.equals=function(a){for(var g=!0,h=0;h<I;h++)if(!this.chars[h].equals(a.chars[h])){g=!1;break}return g},r.copy=function(a){for(var g=0;g<I;g++)this.chars[g].copy(a.chars[g])},r.isEmpty=function(){for(var a=!0,g=0;g<I;g++)if(!this.chars[g].isEmpty()){a=!1;break}return a},r.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(this.logger.log(T.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(T.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},r.moveCursor=function(a){var g=this.pos+a;if(a>1)for(var h=this.pos+1;h<g+1;h++)this.chars[h].setPenState(this.currPenState);this.setCursor(g)},r.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},r.insertChar=function(a){a>=144&&this.backSpace();var g=x(a);if(this.pos>=I){this.logger.log(T.ERROR,"Cannot insert "+a.toString(16)+" ("+g+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(g,this.currPenState),this.moveCursor(1)},r.clearFromPos=function(a){var g;for(g=a;g<I;g++)this.chars[g].reset()},r.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},r.clearToEndOfRow=function(){this.clearFromPos(this.pos)},r.getTextString=function(){for(var a=[],g=!0,h=0;h<I;h++){var d=this.chars[h].uchar;d!==" "&&(g=!1),a.push(d)}return g?"":a.join("")},r.setPenStyles=function(a){this.currPenState.setStyles(a);var g=this.chars[this.pos];g.setPenState(this.currPenState)},i}(),l=function(){function i(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var a=0;a<N;a++)this.rows.push(new s(t));this.logger=t,this.currRow=N-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var r=i.prototype;return r.reset=function(){for(var a=0;a<N;a++)this.rows[a].clear();this.currRow=N-1},r.equals=function(a){for(var g=!0,h=0;h<N;h++)if(!this.rows[h].equals(a.rows[h])){g=!1;break}return g},r.copy=function(a){for(var g=0;g<N;g++)this.rows[g].copy(a.rows[g])},r.isEmpty=function(){for(var a=!0,g=0;g<N;g++)if(!this.rows[g].isEmpty()){a=!1;break}return a},r.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},r.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},r.insertChar=function(a){var g=this.rows[this.currRow];g.insertChar(a)},r.setPen=function(a){var g=this.rows[this.currRow];g.setPenStyles(a)},r.moveCursor=function(a){var g=this.rows[this.currRow];g.moveCursor(a)},r.setCursor=function(a){this.logger.log(T.INFO,"setCursor: "+a);var g=this.rows[this.currRow];g.setCursor(a)},r.setPAC=function(a){this.logger.log(T.INFO,"pacData = "+JSON.stringify(a));var g=a.row-1;if(this.nrRollUpRows&&g<this.nrRollUpRows-1&&(g=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==g){for(var h=0;h<N;h++)this.rows[h].clear();var d=this.currRow+1-this.nrRollUpRows,e=this.lastOutputScreen;if(e){var A=e.rows[d].cueStartTime,M=this.logger.time;if(A&&M!==null&&A<M)for(var F=0;F<this.nrRollUpRows;F++)this.rows[g-this.nrRollUpRows+F+1].copy(e.rows[d+F])}}this.currRow=g;var W=this.rows[this.currRow];if(a.indent!==null){var Z=a.indent,K=Math.max(Z-1,0);W.setCursor(a.indent),a.color=W.chars[K].penState.foreground}var J={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(J)},r.setBkgData=function(a){this.logger.log(T.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},r.setRollUpRows=function(a){this.nrRollUpRows=a},r.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(T.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(T.TEXT,this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,g=this.rows.splice(a,1)[0];g.clear(),this.rows.splice(this.currRow,0,g),this.logger.log(T.INFO,"Rolling up")},r.getDisplayText=function(a){a=a||!1;for(var g=[],h="",d=-1,e=0;e<N;e++){var A=this.rows[e].getTextString();A&&(d=e+1,a?g.push("Row "+d+": '"+A+"'"):g.push(A.trim()))}return g.length>0&&(a?h="["+g.join(" | ")+"]":h=g.join(`
`)),h},r.getTextAndFormat=function(){return this.rows},i}(),y=function(){function i(t,a,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=t,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new l(g),this.nonDisplayedMemory=new l(g),this.lastOutputScreen=new l(g),this.currRollUpRow=this.displayedMemory.rows[N-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var r=i.prototype;return r.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[N-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},r.getHandler=function(){return this.outputFilter},r.setHandler=function(a){this.outputFilter=a},r.setPAC=function(a){this.writeScreen.setPAC(a)},r.setBkgData=function(a){this.writeScreen.setBkgData(a)},r.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(T.INFO,"MODE="+a),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=a},r.insertChars=function(a){for(var g=0;g<a.length;g++)this.writeScreen.insertChar(a[g]);var h=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(T.INFO,h+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(T.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},r.ccRCL=function(){this.logger.log(T.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},r.ccBS=function(){if(this.logger.log(T.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},r.ccAOF=function(){},r.ccAON=function(){},r.ccDER=function(){this.logger.log(T.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},r.ccRU=function(a){this.logger.log(T.INFO,"RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},r.ccFON=function(){this.logger.log(T.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},r.ccRDC=function(){this.logger.log(T.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},r.ccTR=function(){this.logger.log(T.INFO,"TR"),this.setMode("MODE_TEXT")},r.ccRTD=function(){this.logger.log(T.INFO,"RTD"),this.setMode("MODE_TEXT")},r.ccEDM=function(){this.logger.log(T.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},r.ccCR=function(){this.logger.log(T.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},r.ccENM=function(){this.logger.log(T.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},r.ccEOC=function(){if(this.logger.log(T.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,this.logger.log(T.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},r.ccTO=function(a){this.logger.log(T.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},r.ccMIDROW=function(a){var g={flash:!1};if(g.underline=a%2===1,g.italics=a>=46,g.italics)g.foreground="white";else{var h=Math.floor(a/2)-16,d=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=d[h]}this.logger.log(T.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},r.outputDataUpdate=function(a){a===void 0&&(a=!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),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:g),this.lastOutputScreen.copy(this.displayedMemory))},r.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},i}(),c=function(){function i(t,a,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var h=new C;this.channels=[null,new y(t,a,h),new y(t+1,g,h)],this.cmdHistory=f(),this.logger=h}var r=i.prototype;return r.getHandler=function(a){return this.channels[a].getHandler()},r.setHandler=function(a,g){this.channels[a].setHandler(g)},r.addData=function(a,g){var h,d,e,A=!1;this.logger.time=a;for(var M=0;M<g.length;M+=2){if(d=g[M]&127,e=g[M+1]&127,d===0&&e===0)continue;if(this.logger.log(T.DATA,"["+b([g[M],g[M+1]])+"] -> ("+b([d,e])+")"),h=this.parseCmd(d,e),h||(h=this.parseMidrow(d,e)),h||(h=this.parsePAC(d,e)),h||(h=this.parseBackgroundAttributes(d,e)),!h&&(A=this.parseChars(d,e),A)){var F=this.currentChannel;if(F&&F>0){var W=this.channels[F];W.insertChars(A)}else this.logger.log(T.WARNING,"No channel found yet. TEXT-MODE?")}!h&&!A&&this.logger.log(T.WARNING,"Couldn't parse cleaned data "+b([d,e])+" orig: "+b([g[M],g[M+1]]))}},r.parseCmd=function(a,g){var h=this.cmdHistory,d=(a===20||a===28||a===21||a===29)&&g>=32&&g<=47,e=(a===23||a===31)&&g>=33&&g<=35;if(!(d||e))return!1;if(v(a,g,h))return o(null,null,h),this.logger.log(T.DEBUG,"Repeated command ("+b([a,g])+") is dropped"),!0;var A=a===20||a===21||a===23?1:2,M=this.channels[A];return a===20||a===21||a===28||a===29?g===32?M.ccRCL():g===33?M.ccBS():g===34?M.ccAOF():g===35?M.ccAON():g===36?M.ccDER():g===37?M.ccRU(2):g===38?M.ccRU(3):g===39?M.ccRU(4):g===40?M.ccFON():g===41?M.ccRDC():g===42?M.ccTR():g===43?M.ccRTD():g===44?M.ccEDM():g===45?M.ccCR():g===46?M.ccENM():g===47&&M.ccEOC():M.ccTO(g-32),o(a,g,h),this.currentChannel=A,!0},r.parseMidrow=function(a,g){var h=0;if((a===17||a===25)&&g>=32&&g<=47){if(a===17?h=1:h=2,h!==this.currentChannel)return this.logger.log(T.ERROR,"Mismatch channel in midrow parsing"),!1;var d=this.channels[h];return d?(d.ccMIDROW(g),this.logger.log(T.DEBUG,"MIDROW ("+b([a,g])+")"),!0):!1}return!1},r.parsePAC=function(a,g){var h,d=this.cmdHistory,e=(a>=17&&a<=23||a>=25&&a<=31)&&g>=64&&g<=127,A=(a===16||a===24)&&g>=64&&g<=95;if(!(e||A))return!1;if(v(a,g,d))return o(null,null,d),!0;var M=a<=23?1:2;g>=64&&g<=95?h=M===1?S[a]:E[a]:h=M===1?P[a]:O[a];var F=this.channels[M];return F?(F.setPAC(this.interpretPAC(h,g)),o(a,g,d),this.currentChannel=M,!0):!1},r.interpretPAC=function(a,g){var h,d={color:null,italics:!1,indent:null,underline:!1,row:a};return g>95?h=g-96:h=g-64,d.underline=(h&1)===1,h<=13?d.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(h/2)]:h<=15?(d.italics=!0,d.color="white"):d.indent=Math.floor((h-16)/2)*4,d},r.parseChars=function(a,g){var h,d=null,e=null;if(a>=25?(h=2,e=a-8):(h=1,e=a),e>=17&&e<=19){var A;e===17?A=g+80:e===18?A=g+112:A=g+144,this.logger.log(T.INFO,"Special char '"+x(A)+"' in channel "+h),d=[A]}else a>=32&&a<=127&&(d=g===0?[a]:[a,g]);if(d){var M=b(d);this.logger.log(T.DEBUG,"Char codes = "+M.join(",")),o(a,g,this.cmdHistory)}return d},r.parseBackgroundAttributes=function(a,g){var h=(a===16||a===24)&&g>=32&&g<=47,d=(a===23||a===31)&&g>=45&&g<=47;if(!(h||d))return!1;var e,A={};a===16||a===24?(e=Math.floor((g-32)/2),A.background=R[e],g%2===1&&(A.background=A.background+"_semi")):g===45?A.background="transparent":(A.foreground="black",g===47&&(A.underline=!0));var M=a<=23?1:2,F=this.channels[M];return F.setBkgData(A),o(a,g,this.cmdHistory),!0},r.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var g=this.channels[a];g&&g.reset()}this.cmdHistory=f()},r.cueSplitAtTime=function(a){for(var g=0;g<this.channels.length;g++){var h=this.channels[g];h&&h.cueSplitAtTime(a)}},i}();function o(i,r,t){t.a=i,t.b=r}function v(i,r,t){return t.a===i&&t.b===r}function f(){return{a:null,b:null}}B.default=c},"./src/utils/codecs.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"isCodecType",function(){return _}),w.d(B,"isCodecSupportedInMp4",function(){return x});var U={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 _(N,I){var S=U[I];return!!S&&S[N.slice(0,4)]===!0}function x(N,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+N+'"')}},"./src/utils/cues.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/utils/vttparser.ts"),_=w("./src/utils/webvtt-parser.ts"),x=w("./src/utils/texttrack-utils.ts"),N=/\s/,I={newCue:function(P,E,O,R){for(var T=[],C,b,m,n,s,l=self.VTTCue||self.TextTrackCue,y=0;y<R.rows.length;y++)if(C=R.rows[y],m=!0,n=0,s="",!C.isEmpty()){for(var c=0;c<C.chars.length;c++)N.test(C.chars[c].uchar)&&m?n++:(s+=C.chars[c].uchar,m=!1);C.cueStartTime=E,E===O&&(O+=1e-4),n>=16?n--:n++;var o=Object(U.fixLineBreaks)(s.trim()),v=Object(_.generateCueId)(E,O,o);(!P||!P.cues||!P.cues.getCueById(v))&&(b=new l(E,O,o),b.id=v,b.line=y+1,b.align="left",b.position=10+Math.min(80,Math.floor(n*8/32)*10),T.push(b))}return P&&T.length&&(T.sort(function(f,i){return f.line==="auto"||i.line==="auto"?0:f.line>8&&i.line>8?i.line-f.line:f.line-i.line}),T.forEach(function(f){return Object(x.addCueToTrack)(P,f)})),T}};B.default=I},"./src/utils/discontinuities.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"findFirstFragWithCC",function(){return N}),w.d(B,"shouldAlignOnDiscontinuities",function(){return I}),w.d(B,"findDiscontinuousReferenceFrag",function(){return S}),w.d(B,"adjustSlidingStart",function(){return E}),w.d(B,"alignStream",function(){return O}),w.d(B,"alignPDT",function(){return T}),w.d(B,"alignFragmentByPDTDelta",function(){return C}),w.d(B,"alignMediaPlaylistByPDT",function(){return b});var U=w("./src/polyfills/number.ts"),_=w("./src/utils/logger.ts"),x=w("./src/controller/level-helper.ts");function N(m,n){for(var s=null,l=0,y=m.length;l<y;l++){var c=m[l];if(c&&c.cc===n){s=c;break}}return s}function I(m,n,s){return!!(n.details&&(s.endCC>s.startCC||m&&m.cc<s.startCC))}function S(m,n){var s=m.fragments,l=n.fragments;if(!l.length||!s.length){_.logger.log("No fragments to align");return}var y=N(s,l[0].cc);if(!y||y&&!y.startPTS){_.logger.log("No frag in previous level to align on");return}return y}function P(m,n){if(m){var s=m.start+n;m.start=m.startPTS=s,m.endPTS=s+m.duration}}function E(m,n){for(var s=n.fragments,l=0,y=s.length;l<y;l++)P(s[l],m);n.fragmentHint&&P(n.fragmentHint,m),n.alignedSliding=!0}function O(m,n,s){if(!n)return;R(m,s,n),!s.alignedSliding&&n.details&&T(s,n.details),!s.alignedSliding&&n.details&&!s.skippedSegments&&Object(x.adjustSliding)(n.details,s)}function R(m,n,s){if(I(m,s,n)){var l=S(s.details,n);l&&Object(U.isFiniteNumber)(l.start)&&(_.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),E(l.start,n))}}function T(m,n){if(!n.fragments.length||!m.hasProgramDateTime||!n.hasProgramDateTime)return;var s=n.fragments[0].programDateTime,l=m.fragments[0].programDateTime,y=(l-s)/1e3+n.fragments[0].start;y&&Object(U.isFiniteNumber)(y)&&(_.logger.log("Adjusting PTS using programDateTime delta "+(l-s)+"ms, sliding:"+y.toFixed(3)+" "+m.url+" "),E(y,m))}function C(m,n){var s=m.programDateTime;if(!s)return;var l=(s-n)/1e3;m.start=m.startPTS=l,m.endPTS=l+m.duration}function b(m,n){if(!n.fragments.length||!m.hasProgramDateTime||!n.hasProgramDateTime)return;var s=n.fragments[0].programDateTime,l=n.fragments[0].start,y=s-l*1e3;m.fragments.forEach(function(c){C(c,y)}),m.fragmentHint&&C(m.fragmentHint,y),m.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/utils/ewma.ts"),_=function(){function x(I,S,P){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=P,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new U.default(I),this.fast_=new U.default(S)}var N=x.prototype;return N.update=function(S,P){var E=this.slow_,O=this.fast_;this.slow_.halfLife!==S&&(this.slow_=new U.default(S,E.getEstimate(),E.getTotalWeight())),this.fast_.halfLife!==P&&(this.fast_=new U.default(P,O.getEstimate(),O.getTotalWeight()))},N.sample=function(S,P){S=Math.max(S,this.minDelayMs_);var E=8*P,O=S/1e3,R=E/O;this.fast_.sample(O,R),this.slow_.sample(O,R)},N.canEstimate=function(){var S=this.fast_;return S&&S.getTotalWeight()>=this.minWeight_},N.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},N.destroy=function(){},x}();B.default=_},"./src/utils/ewma.ts":function(he,B,w){"use strict";w.r(B);var U=function(){function _(N,I,S){I===void 0&&(I=0),S===void 0&&(S=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=N,this.alpha_=N?Math.exp(Math.log(.5)/N):0,this.estimate_=I,this.totalWeight_=S}var x=_.prototype;return x.sample=function(I,S){var P=Math.pow(this.alpha_,I);this.estimate_=S*(1-P)+P*this.estimate_,this.totalWeight_+=I},x.getTotalWeight=function(){return this.totalWeight_},x.getEstimate=function(){if(this.alpha_){var I=1-Math.pow(this.alpha_,this.totalWeight_);if(I)return this.estimate_/I}return this.estimate_},_}();B.default=U},"./src/utils/fetch-loader.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"fetchSupported",function(){return C});var U=w("./src/polyfills/number.ts"),_=w("./src/loader/load-stats.ts"),x=w("./src/demux/chunk-cache.ts");function N(l,y){l.prototype=Object.create(y.prototype),l.prototype.constructor=l,O(l,y)}function I(l){var y=typeof Map=="function"?new Map:void 0;return I=function(o){if(o===null||!E(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof y!="undefined"){if(y.has(o))return y.get(o);y.set(o,v)}function v(){return S(o,arguments,R(this).constructor)}return v.prototype=Object.create(o.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),O(v,o)},I(l)}function S(l,y,c){return P()?S=Reflect.construct:S=function(v,f,i){var r=[null];r.push.apply(r,f);var t=Function.bind.apply(v,r),a=new t;return i&&O(a,i.prototype),a},S.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function E(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function O(l,y){return O=Object.setPrototypeOf||function(o,v){return o.__proto__=v,o},O(l,y)}function R(l){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},R(l)}function T(){return T=Object.assign||function(l){for(var y=1;y<arguments.length;y++){var c=arguments[y];for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(l[o]=c[o])}return l},T.apply(this,arguments)}function C(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(l){}return!1}var b=function(){function l(c){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=c.fetchSetup||n,this.controller=new self.AbortController,this.stats=new _.LoadStats}var y=l.prototype;return y.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},y.abortInternal=function(){var o=this.response;(!o||!o.ok)&&(this.stats.aborted=!0,this.controller.abort())},y.abort=function(){var o;this.abortInternal(),(o=this.callbacks)!==null&&o!==void 0&&o.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},y.load=function(o,v,f){var i=this,r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();var t=m(o,this.controller.signal),a=f.onProgress,g=o.responseType==="arraybuffer",h=g?"byteLength":"length";this.context=o,this.config=v,this.callbacks=f,this.request=this.fetchSetup(o,t),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){i.abortInternal(),f.onTimeout(r,o,i.response)},v.timeout),self.fetch(this.request).then(function(d){if(i.response=i.loader=d,!d.ok){var e=d.status,A=d.statusText;throw new s(A||"fetch, bad network response",e,d)}return r.loading.first=Math.max(self.performance.now(),r.loading.start),r.total=parseInt(d.headers.get("Content-Length")||"0"),a&&Object(U.isFiniteNumber)(v.highWaterMark)?i.loadProgressively(d,r,o,v.highWaterMark,a):g?d.arrayBuffer():d.text()}).then(function(d){var e=i.response;self.clearTimeout(i.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first),r.loaded=r.total=d[h];var A={url:e.url,data:d};a&&!Object(U.isFiniteNumber)(v.highWaterMark)&&a(r,o,d,e),f.onSuccess(A,r,o,e)}).catch(function(d){if(self.clearTimeout(i.requestTimeout),r.aborted)return;var e=d.code||0;f.onError({code:e,text:d.message},o,d.details)})},y.getCacheAge=function(){var o=null;if(this.response){var v=this.response.headers.get("age");o=v?parseFloat(v):null}return o},y.loadProgressively=function(o,v,f,i,r){i===void 0&&(i=0);var t=new x.default,a=o.body.getReader(),g=function h(){return a.read().then(function(d){if(d.done)return t.dataLength&&r(v,f,t.flush(),o),Promise.resolve(new ArrayBuffer(0));var e=d.value,A=e.length;return v.loaded+=A,A<i||t.dataLength?(t.push(e),t.dataLength>=i&&r(v,f,t.flush(),o)):r(v,f,e,o),h()}).catch(function(){return Promise.reject()})};return g()},l}();function m(l,y){var c={method:"GET",mode:"cors",credentials:"same-origin",signal:y,headers:new self.Headers(T({},l.headers))};return l.rangeEnd&&c.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),c}function n(l,y){return new self.Request(l.url,y)}var s=function(l){N(y,l);function y(c,o,v){var f;return f=l.call(this,c)||this,f.code=void 0,f.details=void 0,f.code=o,f.details=v,f}return y}(I(Error));B.default=b},"./src/utils/imsc1-ttml-parser.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"IMSC1_CODEC",function(){return E}),w.d(B,"parseIMSC1",function(){return C});var U=w("./src/utils/mp4-tools.ts"),_=w("./src/utils/vttparser.ts"),x=w("./src/utils/vttcue.ts"),N=w("./src/demux/id3.ts"),I=w("./src/utils/timescale-conversion.ts"),S=w("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(i){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},P.apply(this,arguments)}var E="stpp.ttml.im1t",O=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,R=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,T={left:"start",center:"center",right:"end",start:"start",end:"end"};function C(i,r,t,a,g){var h=Object(U.findBox)(new Uint8Array(i),["mdat"]);if(h.length===0){g(new Error("Could not parse IMSC1 mdat"));return}var d=h[0],e=Object(N.utf8ArrayToStr)(new Uint8Array(i,d.start,d.end-d.start)),A=Object(I.toTimescaleFromScale)(r,1,t);try{a(b(e,A))}catch(M){g(M)}}function b(i,r){var t=new DOMParser,a=t.parseFromString(i,"text/xml"),g=a.getElementsByTagName("tt")[0];if(!g)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},d=Object.keys(h).reduce(function(W,Z){return W[Z]=g.getAttribute("ttp:"+Z)||h[Z],W},{}),e=g.getAttribute("xml:space")!=="preserve",A=n(m(g,"styling","style")),M=n(m(g,"layout","region")),F=m(g,"body","[begin]");return[].map.call(F,function(W){var Z=s(W,e);if(!Z||!W.hasAttribute("begin"))return null;var K=o(W.getAttribute("begin"),d),J=o(W.getAttribute("dur"),d),oe=o(W.getAttribute("end"),d);if(K===null)throw c(W);if(oe===null){if(J===null)throw c(W);oe=K+J}var se=new x.default(K-r,oe-r,Z);se.id=Object(S.generateCueId)(se.startTime,se.endTime,se.text);var pe=M[W.getAttribute("region")],be=A[W.getAttribute("style")];se.position=10,se.size=80;var Q=l(pe,be),te=Q.textAlign;if(te){var ve=T[te];ve&&(se.lineAlign=ve),se.align=te}return P(se,Q),se}).filter(function(W){return W!==null})}function m(i,r,t){var a=i.getElementsByTagName(r)[0];return a?[].slice.call(a.querySelectorAll(t)):[]}function n(i){return i.reduce(function(r,t){var a=t.getAttribute("xml:id");return a&&(r[a]=t),r},{})}function s(i,r){return[].slice.call(i.childNodes).reduce(function(t,a,g){var h;return a.nodeName==="br"&&g?t+`
`:(h=a.childNodes)!==null&&h!==void 0&&h.length?s(a,r):r?t+a.textContent.trim().replace(/\s+/g," "):t+a.textContent},"")}function l(i,r){var t="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(g,h){var d=y(r,t,h)||y(i,t,h);return d&&(g[h]=d),g},{})}function y(i,r,t){return i.hasAttributeNS(r,t)?i.getAttributeNS(r,t):null}function c(i){return new Error("Could not parse ttml timestamp "+i)}function o(i,r){if(!i)return null;var t=Object(_.parseTimeStamp)(i);return t===null&&(O.test(i)?t=v(i,r):R.test(i)&&(t=f(i,r))),t}function v(i,r){var t=O.exec(i),a=(t[4]|0)+(t[5]|0)/r.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+a/r.frameRate}function f(i,r){var t=R.exec(i),a=Number(t[1]),g=t[2];switch(g){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/r.frameRate;case"t":return a/r.tickRate}return a}},"./src/utils/logger.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"enableLogs",function(){return S}),w.d(B,"logger",function(){return P});var U=function(){},_={trace:U,debug:U,log:U,warn:U,info:U,error:U},x=_;function N(E){var O=self.console[E];return O?O.bind(self.console,"["+E+"] >"):U}function I(E){for(var O=arguments.length,R=new Array(O>1?O-1:0),T=1;T<O;T++)R[T-1]=arguments[T];R.forEach(function(C){x[C]=E[C]?E[C].bind(E):N(C)})}function S(E){if(self.console&&E===!0||typeof E=="object"){I(E,"debug","log","info","warn","error");try{x.log()}catch(O){x=_}}else x=_}var P=x},"./src/utils/mediakeys-helper.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"KeySystems",function(){return U}),w.d(B,"requestMediaKeySystemAccess",function(){return _});var U;(function(x){x.WIDEVINE="com.widevine.alpha",x.PLAYREADY="com.microsoft.playready"})(U||(U={}));var _=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"getMediaSource",function(){return U});function U(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"bin2str",function(){return I}),w.d(B,"readUint16",function(){return S}),w.d(B,"readUint32",function(){return P}),w.d(B,"writeUint32",function(){return E}),w.d(B,"findBox",function(){return O}),w.d(B,"parseSegmentIndex",function(){return R}),w.d(B,"parseInitSegment",function(){return T}),w.d(B,"getStartDTS",function(){return C}),w.d(B,"getDuration",function(){return b}),w.d(B,"computeRawDurationFromSamples",function(){return m}),w.d(B,"offsetStartDTS",function(){return n}),w.d(B,"segmentValidRange",function(){return s}),w.d(B,"appendUint8Array",function(){return l});var U=w("./src/utils/typed-array.ts"),_=w("./src/loader/fragment.ts"),x=Math.pow(2,32)-1,N=[].push;function I(y){return String.fromCharCode.apply(null,y)}function S(y,c){"data"in y&&(c+=y.start,y=y.data);var o=y[c]<<8|y[c+1];return o<0?65536+o:o}function P(y,c){"data"in y&&(c+=y.start,y=y.data);var o=y[c]<<24|y[c+1]<<16|y[c+2]<<8|y[c+3];return o<0?4294967296+o:o}function E(y,c,o){"data"in y&&(c+=y.start,y=y.data),y[c]=o>>24,y[c+1]=o>>16&255,y[c+2]=o>>8&255,y[c+3]=o&255}function O(y,c){var o=[];if(!c.length)return o;var v,f,i;"data"in y?(v=y.data,f=y.start,i=y.end):(v=y,f=0,i=v.byteLength);for(var r=f;r<i;){var t=P(v,r),a=I(v.subarray(r+4,r+8)),g=t>1?r+t:i;if(a===c[0])if(c.length===1)o.push({data:v,start:r+8,end:g});else{var h=O({data:v,start:r+8,end:g},c.slice(1));h.length&&N.apply(o,h)}r=g}return o}function R(y){var c=O(y,["moov"]),o=c[0],v=o?o.end:null,f=O(y,["sidx"]);if(!f||!f[0])return null;var i=[],r=f[0],t=r.data[0],a=t===0?8:16,g=P(r,a);a+=4;var h=0,d=0;t===0?a+=8:a+=16,a+=2;var e=r.end+d,A=S(r,a);a+=2;for(var M=0;M<A;M++){var F=a,W=P(r,F);F+=4;var Z=W&2147483647,K=(W&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=P(r,F);F+=4,i.push({referenceSize:Z,subsegmentDuration:J,info:{duration:J/g,start:e,end:e+Z-1}}),e+=Z,F+=4,a=F}return{earliestPresentationTime:h,timescale:g,version:t,referencesCount:A,references:i,moovEndOffset:v}}function T(y){for(var c=[],o=O(y,["moov","trak"]),v=0;v<o.length;v++){var f=o[v],i=O(f,["tkhd"])[0];if(i){var r=i.data[i.start],t=r===0?12:20,a=P(i,t),g=O(f,["mdia","mdhd"])[0];if(g){r=g.data[g.start],t=r===0?12:20;var h=P(g,t),d=O(f,["mdia","hdlr"])[0];if(d){var e=I(d.data.subarray(d.start+8,d.start+12)),A={soun:_.ElementaryStreamTypes.AUDIO,vide:_.ElementaryStreamTypes.VIDEO}[e];if(A){var M=O(f,["mdia","minf","stbl","stsd"])[0],F=void 0;M&&(F=I(M.data.subarray(M.start+12,M.start+16))),c[a]={timescale:h,type:A},c[A]={timescale:h,id:a,codec:F}}}}}}var W=O(y,["moov","mvex","trex"]);return W.forEach(function(Z){var K=P(Z,4),J=c[K];J&&(J.default={duration:P(Z,12),flags:P(Z,20)})}),c}function C(y,c){return O(c,["moof","traf"]).reduce(function(o,v){var f=O(v,["tfdt"])[0],i=f.data[f.start],r=O(v,["tfhd"]).reduce(function(t,a){var g=P(a,4),h=y[g];if(h){var d=P(f,4);i===1&&(d*=Math.pow(2,32),d+=P(f,8));var e=h.timescale||9e4,A=d/e;if(isFinite(A)&&(t===null||A<t))return A}return t},null);return r!==null&&isFinite(r)&&(o===null||r<o)?r:o},null)||0}function b(y,c){for(var o=0,v=0,f=0,i=O(y,["moof","traf"]),r=0;r<i.length;r++){var t=i[r],a=O(t,["tfhd"])[0],g=P(a,4),h=c[g];if(!h)continue;var d=h.default,e=P(a,0)|(d==null?void 0:d.flags),A=d==null?void 0:d.duration;e&8&&(e&2?A=P(a,12):A=P(a,8));for(var M=h.timescale||9e4,F=O(t,["trun"]),W=0;W<F.length;W++){if(A){var Z=P(F[W],4);o=A*Z}else o=m(F[W]);h.type===_.ElementaryStreamTypes.VIDEO?v+=o/M:h.type===_.ElementaryStreamTypes.AUDIO&&(f+=o/M)}}if(v===0&&f===0){var K=R(y);if(K!=null&&K.references)return K.references.reduce(function(J,oe){return J+oe.info.duration||0},0)}return v||f}function m(y){var c=P(y,0),o=8;c&1&&(o+=4),c&4&&(o+=4);for(var v=0,f=P(y,4),i=0;i<f;i++){if(c&256){var r=P(y,o);v+=r,o+=4}c&512&&(o+=4),c&1024&&(o+=4),c&2048&&(o+=4)}return v}function n(y,c,o){O(c,["moof","traf"]).forEach(function(v){O(v,["tfhd"]).forEach(function(f){var i=P(f,4),r=y[i];if(!r)return;var t=r.timescale||9e4;O(v,["tfdt"]).forEach(function(a){var g=a.data[a.start],h=P(a,4);if(g===0)E(a,4,h-o*t);else{h*=Math.pow(2,32),h+=P(a,8),h-=o*t,h=Math.max(h,0);var d=Math.floor(h/(x+1)),e=Math.floor(h%(x+1));E(a,4,d),E(a,8,e)}})})})}function s(y){var c={valid:null,remainder:null},o=O(y,["moof"]);if(o){if(o.length<2)return c.remainder=y,c}else return c;var v=o[o.length-1];return c.valid=Object(U.sliceUint8)(y,0,v.start-8),c.remainder=Object(U.sliceUint8)(y,v.start-8),c}function l(y,c){var o=new Uint8Array(y.length+c.length);return o.set(y),o.set(c,y.length),o}},"./src/utils/output-filter.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"default",function(){return U});var U=function(){function _(N,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=N,this.trackName=I}var x=_.prototype;return x.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},x.newCue=function(I,S,P){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=S,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},x.reset=function(){this.cueRanges=[]},_}()},"./src/utils/texttrack-utils.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"sendAddTrackEvent",function(){return _}),w.d(B,"addCueToTrack",function(){return x}),w.d(B,"clearCurrentCues",function(){return N}),w.d(B,"removeCuesInRange",function(){return I}),w.d(B,"getCuesInRange",function(){return P});var U=w("./src/utils/logger.ts");function _(E,O){var R;try{R=new Event("addtrack")}catch(T){R=document.createEvent("Event"),R.initEvent("addtrack",!1,!1)}R.track=E,O.dispatchEvent(R)}function x(E,O){var R=E.mode;if(R==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(O.id))try{if(E.addCue(O),!E.cues.getCueById(O.id))throw new Error("addCue is failed for: "+O)}catch(C){U.logger.debug("[texttrack-utils]: "+C);var T=new self.TextTrackCue(O.startTime,O.endTime,O.text);T.id=O.id,E.addCue(T)}R==="disabled"&&(E.mode=R)}function N(E){var O=E.mode;if(O==="disabled"&&(E.mode="hidden"),E.cues)for(var R=E.cues.length;R--;)E.removeCue(E.cues[R]);O==="disabled"&&(E.mode=O)}function I(E,O,R){var T=E.mode;if(T==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var C=P(E.cues,O,R),b=0;b<C.length;b++)E.removeCue(C[b]);T==="disabled"&&(E.mode=T)}function S(E,O){if(O<E[0].startTime)return 0;var R=E.length-1;if(O>E[R].endTime)return-1;for(var T=0,C=R;T<=C;){var b=Math.floor((C+T)/2);if(O<E[b].startTime)C=b-1;else if(O>E[b].startTime&&T<R)T=b+1;else return b}return E[T].startTime-O<O-E[C].startTime?T:C}function P(E,O,R){var T=[],C=S(E,O);if(C>-1)for(var b=C,m=E.length;b<m;b++){var n=E[b];if(n.startTime>=O&&n.endTime<=R)T.push(n);else if(n.startTime>R)return T}return T}},"./src/utils/time-ranges.ts":function(he,B,w){"use strict";w.r(B);var U={toString:function(x){for(var N="",I=x.length,S=0;S<I;S++)N+="["+x.start(S).toFixed(3)+","+x.end(S).toFixed(3)+"]";return N}};B.default=U},"./src/utils/timescale-conversion.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"toTimescaleFromBase",function(){return _}),w.d(B,"toTimescaleFromScale",function(){return x}),w.d(B,"toMsFromMpegTsClock",function(){return N}),w.d(B,"toMpegTsClockFromTimescale",function(){return I});var U=9e4;function _(S,P,E,O){E===void 0&&(E=1),O===void 0&&(O=!1);var R=S*P*E;return O?Math.round(R):R}function x(S,P,E,O){return E===void 0&&(E=1),O===void 0&&(O=!1),_(S,P,1/E,O)}function N(S,P){return P===void 0&&(P=!1),_(S,1e3,1/U,P)}function I(S,P){return P===void 0&&(P=1),_(S,U,1/P)}},"./src/utils/typed-array.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"sliceUint8",function(){return U});function U(_,x,N){return Uint8Array.prototype.slice?_.slice(x,N):new Uint8Array(Array.prototype.slice.call(_,x,N))}},"./src/utils/vttcue.ts":function(he,B,w){"use strict";w.r(B),B.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var U=["","lr","rl"],_=["start","middle","end","left","right"];function x(E,O){if(typeof O!="string")return!1;if(!Array.isArray(E))return!1;var R=O.toLowerCase();return~E.indexOf(R)?R:!1}function N(E){return x(U,E)}function I(E){return x(_,E)}function S(E){for(var O=arguments.length,R=new Array(O>1?O-1:0),T=1;T<O;T++)R[T-1]=arguments[T];for(var C=1;C<arguments.length;C++){var b=arguments[C];for(var m in b)E[m]=b[m]}return E}function P(E,O,R){var T=this,C={enumerable:!0};T.hasBeenReset=!1;var b="",m=!1,n=E,s=O,l=R,y=null,c="",o=!0,v="auto",f="start",i=50,r="middle",t=50,a="middle";Object.defineProperty(T,"id",S({},C,{get:function(){return b},set:function(h){b=""+h}})),Object.defineProperty(T,"pauseOnExit",S({},C,{get:function(){return m},set:function(h){m=!!h}})),Object.defineProperty(T,"startTime",S({},C,{get:function(){return n},set:function(h){if(typeof h!="number")throw new TypeError("Start time must be set to a number.");n=h,this.hasBeenReset=!0}})),Object.defineProperty(T,"endTime",S({},C,{get:function(){return s},set:function(h){if(typeof h!="number")throw new TypeError("End time must be set to a number.");s=h,this.hasBeenReset=!0}})),Object.defineProperty(T,"text",S({},C,{get:function(){return l},set:function(h){l=""+h,this.hasBeenReset=!0}})),Object.defineProperty(T,"region",S({},C,{get:function(){return y},set:function(h){y=h,this.hasBeenReset=!0}})),Object.defineProperty(T,"vertical",S({},C,{get:function(){return c},set:function(h){var d=N(h);if(d===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=d,this.hasBeenReset=!0}})),Object.defineProperty(T,"snapToLines",S({},C,{get:function(){return o},set:function(h){o=!!h,this.hasBeenReset=!0}})),Object.defineProperty(T,"line",S({},C,{get:function(){return v},set:function(h){if(typeof h!="number"&&h!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");v=h,this.hasBeenReset=!0}})),Object.defineProperty(T,"lineAlign",S({},C,{get:function(){return f},set:function(h){var d=I(h);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");f=d,this.hasBeenReset=!0}})),Object.defineProperty(T,"position",S({},C,{get:function(){return i},set:function(h){if(h<0||h>100)throw new Error("Position must be between 0 and 100.");i=h,this.hasBeenReset=!0}})),Object.defineProperty(T,"positionAlign",S({},C,{get:function(){return r},set:function(h){var d=I(h);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");r=d,this.hasBeenReset=!0}})),Object.defineProperty(T,"size",S({},C,{get:function(){return t},set:function(h){if(h<0||h>100)throw new Error("Size must be between 0 and 100.");t=h,this.hasBeenReset=!0}})),Object.defineProperty(T,"align",S({},C,{get:function(){return a},set:function(h){var d=I(h);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");a=d,this.hasBeenReset=!0}})),T.displayState=void 0}return P.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"parseTimeStamp",function(){return x}),w.d(B,"fixLineBreaks",function(){return O}),w.d(B,"VTTParser",function(){return R});var U=w("./src/utils/vttcue.ts"),_=function(){function T(){}var C=T.prototype;return C.decode=function(m,n){if(!m)return"";if(typeof m!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(m))},T}();function x(T){function C(m,n,s,l){return(m|0)*3600+(n|0)*60+(s|0)+parseFloat(l||0)}var b=T.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return b?parseFloat(b[2])>59?C(b[2],b[3],0,b[4]):C(b[1],b[2],b[3],b[4]):null}var N=function(){function T(){this.values=Object.create(null)}var C=T.prototype;return C.set=function(m,n){!this.get(m)&&n!==""&&(this.values[m]=n)},C.get=function(m,n,s){return s?this.has(m)?this.values[m]:n[s]:this.has(m)?this.values[m]:n},C.has=function(m){return m in this.values},C.alt=function(m,n,s){for(var l=0;l<s.length;++l)if(n===s[l]){this.set(m,n);break}},C.integer=function(m,n){/^-?\d+$/.test(n)&&this.set(m,parseInt(n,10))},C.percent=function(m,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var s=parseFloat(n);if(s>=0&&s<=100)return this.set(m,s),!0}return!1},T}();function I(T,C,b,m){var n=m?T.split(m):[T];for(var s in n){if(typeof n[s]!="string")continue;var l=n[s].split(b);if(l.length!==2)continue;var y=l[0],c=l[1];C(y,c)}}var S=new U.default(0,0,""),P=S.align==="middle"?"middle":"center";function E(T,C,b){var m=T;function n(){var y=x(T);if(y===null)throw new Error("Malformed timestamp: "+m);return T=T.replace(/^[^\sa-zA-Z-]+/,""),y}function s(y,c){var o=new N;I(y,function(i,r){var t;switch(i){case"region":for(var a=b.length-1;a>=0;a--)if(b[a].id===r){o.set(i,b[a].region);break}break;case"vertical":o.alt(i,r,["rl","lr"]);break;case"line":t=r.split(","),o.integer(i,t[0]),o.percent(i,t[0])&&o.set("snapToLines",!1),o.alt(i,t[0],["auto"]),t.length===2&&o.alt("lineAlign",t[1],["start",P,"end"]);break;case"position":t=r.split(","),o.percent(i,t[0]),t.length===2&&o.alt("positionAlign",t[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":o.percent(i,r);break;case"align":o.alt(i,r,["start",P,"end","left","right"]);break}},/:/,/\s/),c.region=o.get("region",null),c.vertical=o.get("vertical","");var v=o.get("line","auto");v==="auto"&&S.line===-1&&(v=-1),c.line=v,c.lineAlign=o.get("lineAlign","start"),c.snapToLines=o.get("snapToLines",!0),c.size=o.get("size",100),c.align=o.get("align",P);var f=o.get("position","auto");f==="auto"&&S.position===50&&(f=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=f}function l(){T=T.replace(/^\s+/,"")}if(l(),C.startTime=n(),l(),T.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+m);T=T.substr(3),l(),C.endTime=n(),l(),s(T,C)}function O(T){return T.replace(/<br(?: \/)?>/gi,`
`)}var R=function(){function T(){this.state="INITIAL",this.buffer="",this.decoder=new _,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var C=T.prototype;return C.parse=function(m){var n=this;m&&(n.buffer+=n.decoder.decode(m,{stream:!0}));function s(){var f=n.buffer,i=0;for(f=O(f);i<f.length&&f[i]!=="\r"&&f[i]!==`
`;)++i;var r=f.substr(0,i);return f[i]==="\r"&&++i,f[i]===`
`&&++i,n.buffer=f.substr(i),r}function l(f){I(f,function(i,r){},/:/)}try{var y="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;y=s();var c=y.match(/^()?WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var o=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;o?o=!1:y=s();switch(n.state){case"HEADER":/:/.test(y)?l(y):y||(n.state="ID");continue;case"NOTE":y||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(y)){n.state="NOTE";break}if(!y)continue;if(n.cue=new U.default(0,0,""),n.state="CUE",y.indexOf("-->")===-1){n.cue.id=y;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{E(y,n.cue,n.regionList)}catch(f){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var v=y.indexOf("-->")!==-1;if(!y||v&&(o=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
`),n.cue.text+=y}continue;case"BADCUE":y||(n.state="ID")}}}catch(f){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},C.flush=function(){var m=this;try{if((m.cue||m.state==="HEADER")&&(m.buffer+=`
`,m.parse()),m.state==="INITIAL"||m.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){m.onparsingerror&&m.onparsingerror(n)}return m.onflush&&m.onflush(),this},T}()},"./src/utils/webvtt-parser.ts":function(he,B,w){"use strict";w.r(B),w.d(B,"generateCueId",function(){return R}),w.d(B,"parseWebVTT",function(){return C});var U=w("./src/polyfills/number.ts"),_=w("./src/utils/vttparser.ts"),x=w("./src/demux/id3.ts"),N=w("./src/utils/timescale-conversion.ts"),I=w("./src/remux/mp4-remuxer.ts"),S=/\r\n|\n\r|\n|\r/g,P=function(m,n,s){return s===void 0&&(s=0),m.substr(s,n.length)===n},E=function(m){var n=parseInt(m.substr(-3)),s=parseInt(m.substr(-6,2)),l=parseInt(m.substr(-9,2)),y=m.length>9?parseInt(m.substr(0,m.indexOf(":"))):0;if(!Object(U.isFiniteNumber)(n)||!Object(U.isFiniteNumber)(s)||!Object(U.isFiniteNumber)(l)||!Object(U.isFiniteNumber)(y))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+m);return n+=1e3*s,n+=60*1e3*l,n+=60*60*1e3*y,n},O=function(m){for(var n=5381,s=m.length;s;)n=n*33^m.charCodeAt(--s);return(n>>>0).toString()};function R(b,m,n){return O(b.toString())+O(m.toString())+O(n)}var T=function(m,n,s){var l=m[n],y=m[l.prevCC];if(!y||!y.new&&l.new){m.ccOffset=m.presentationOffset=l.start,l.new=!1;return}for(;(c=y)!==null&&c!==void 0&&c.new;){var c;m.ccOffset+=l.start-y.start,l.new=!1,l=y,y=m[l.prevCC]}m.presentationOffset=s};function C(b,m,n,s,l,y,c,o){var v=new _.VTTParser,f=Object(x.utf8ArrayToStr)(new Uint8Array(b)).trim().replace(S,`
`).split(`
`),i=[],r=Object(N.toMpegTsClockFromTimescale)(m,n),t="00:00.000",a=0,g=0,h,d=!0,e=!1;v.oncue=function(A){var M=s[l],F=s.ccOffset,W=(a-r)/9e4;if(M!=null&&M.new&&(g!==void 0?F=s.ccOffset=M.start:T(s,l,W)),W&&(F=W-s.presentationOffset),e){var Z=A.endTime-A.startTime,K=Object(I.normalizePts)((A.startTime+F-g)*9e4,y*9e4)/9e4;A.startTime=K,A.endTime=K+Z}var J=A.text.trim();A.text=decodeURIComponent(encodeURIComponent(J)),A.id||(A.id=R(A.startTime,A.endTime,J)),A.endTime>0&&i.push(A)},v.onparsingerror=function(A){h=A},v.onflush=function(){if(h){o(h);return}c(i)},f.forEach(function(A){if(d)if(P(A,"X-TIMESTAMP-MAP=")){d=!1,e=!0,A.substr(16).split(",").forEach(function(M){P(M,"LOCAL:")?t=M.substr(6):P(M,"MPEGTS:")&&(a=parseInt(M.substr(7)))});try{g=E(t)/1e3}catch(M){e=!1,h=M}return}else A===""&&(d=!1);v.parse(A+`
`)}),v.flush()}},"./src/utils/xhr-loader.ts":function(he,B,w){"use strict";w.r(B);var U=w("./src/utils/logger.ts"),_=w("./src/loader/load-stats.ts"),x=/^age:\s*[\d.]+\s*$/m,N=function(){function I(P){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=P?P.xhrSetup:null,this.stats=new _.LoadStats,this.retryDelay=0}var S=I.prototype;return S.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},S.abortInternal=function(){var E=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),E&&(E.onreadystatechange=null,E.onprogress=null,E.readyState!==4&&(this.stats.aborted=!0,E.abort()))},S.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},S.load=function(E,O,R){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=E,this.config=O,this.callbacks=R,this.retryDelay=O.retryDelay,this.loadInternal()},S.loadInternal=function(){var E=this.config,O=this.context;if(!E)return;var R=this.loader=new self.XMLHttpRequest,T=this.stats;T.loading.first=0,T.loaded=0;var C=this.xhrSetup;try{if(C)try{C(R,O.url)}catch(n){R.open("GET",O.url,!0),C(R,O.url)}R.readyState||R.open("GET",O.url,!0);var b=this.context.headers;if(b)for(var m in b)R.setRequestHeader(m,b[m])}catch(n){this.callbacks.onError({code:R.status,text:n.message},O,R);return}O.rangeEnd&&R.setRequestHeader("Range","bytes="+O.rangeStart+"-"+(O.rangeEnd-1)),R.onreadystatechange=this.readystatechange.bind(this),R.onprogress=this.loadprogress.bind(this),R.responseType=O.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),R.send()},S.readystatechange=function(){var E=this.context,O=this.loader,R=this.stats;if(!E||!O)return;var T=O.readyState,C=this.config;if(R.aborted)return;if(T>=2)if(self.clearTimeout(this.requestTimeout),R.loading.first===0&&(R.loading.first=Math.max(self.performance.now(),R.loading.start)),T===4){O.onreadystatechange=null,O.onprogress=null;var b=O.status;if(b>=200&&b<300){R.loading.end=Math.max(self.performance.now(),R.loading.first);var m,n;if(E.responseType==="arraybuffer"?(m=O.response,n=m.byteLength):(m=O.responseText,n=m.length),R.loaded=R.total=n,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(R,E,m,O),!this.callbacks)return;var l={url:O.responseURL,data:m};this.callbacks.onSuccess(l,R,E,O)}else R.retry>=C.maxRetry||b>=400&&b<499?(U.logger.error(b+" while loading "+E.url),this.callbacks.onError({code:b,text:O.statusText},E,O)):(U.logger.warn(b+" while loading "+E.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,C.maxRetryDelay),R.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),C.timeout)},S.loadtimeout=function(){U.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},S.loadprogress=function(E){var O=this.stats;O.loaded=E.loaded,E.lengthComputable&&(O.total=E.total)},S.getCacheAge=function(){var E=null;if(this.loader&&x.test(this.loader.getAllResponseHeaders())){var O=this.loader.getResponseHeader("age");E=O?parseFloat(O):null}return E},I}();B.default=N}}).default})},vHTk:function(Ct,Fe,j){Ct.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return nt});var he=j("rePB"),B=j("VTBJ"),w=j("KQm4"),U=j("U8pU"),_=j("ODXe"),x=j("q1tI"),N=j("TSYQ"),I=j.n(N),S=j("Gytx"),P=j.n(S),E=j("Kwbf"),O=j("t23M"),R=j("qx4F"),T=j("6eGT"),C=j("IBYe"),b=j("Ff2n"),m=j("c+Xe"),n=j("fyJ8"),s=j("biw7");function l(Ee,Oe,je,Ye,De){var Ke=je[Ee]||{},ce=je[Oe]||{},re,ie;Ke.fixed==="left"?re=Ye.left[Ee]:ce.fixed==="right"&&(ie=Ye.right[Oe]);var $=!1,Y=!1,V=!1,ne=!1,_e=je[Oe+1],we=je[Ee-1];if(De==="rtl"){if(re!==void 0){var Xe=we&&we.fixed==="left";ne=!Xe}else if(ie!==void 0){var gt=_e&&_e.fixed==="right";V=!gt}}else if(re!==void 0){var Nt=_e&&_e.fixed==="left";$=!Nt}else if(ie!==void 0){var ht=we&&we.fixed==="right";Y=!ht}return{fixLeft:re,fixRight:ie,lastFixLeft:$,firstFixRight:Y,lastFixRight:V,firstFixLeft:ne,isSticky:Ye.isSticky}}var y=j("sR1s");function c(Ee){var Oe=Ee.cells,je=Ee.stickyOffsets,Ye=Ee.flattenColumns,De=Ee.rowComponent,Ke=Ee.cellComponent,ce=Ee.onHeaderRow,re=Ee.index,ie=x.useContext(s.a),$=ie.prefixCls,Y=ie.direction,V;ce&&(V=ce(Oe.map(function(_e){return _e.column}),re));var ne=Object(y.a)(Oe.map(function(_e){return _e.column}));return x.createElement(De,Object.assign({},V),Oe.map(function(_e,we){var Xe=_e.column,gt=l(_e.colStart,_e.colEnd,Ye,je,Y),Nt;return Xe&&Xe.onHeaderCell&&(Nt=_e.column.onHeaderCell(Xe)),x.createElement(n.a,Object.assign({},_e,{ellipsis:Xe.ellipsis,align:Xe.align,component:Ke,prefixCls:$,key:ne[we]},gt,{additionalProps:Nt,rowType:"header"}))}))}c.displayName="HeaderRow";var o=c;function v(Ee){var Oe=[];function je(ce,re){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Oe[ie]=Oe[ie]||[];var $=re,Y=ce.filter(Boolean).map(function(V){var ne={key:V.key,className:V.className||"",children:V.title,column:V,colStart:$},_e=1,we=V.children;return we&&we.length>0&&(_e=je(we,$,ie+1).reduce(function(Xe,gt){return Xe+gt},0),ne.hasSubColumns=!0),"colSpan"in V&&(_e=V.colSpan),"rowSpan"in V&&(ne.rowSpan=V.rowSpan),ne.colSpan=_e,ne.colEnd=ne.colStart+_e-1,Oe[ie].push(ne),$+=_e,_e});return Y}je(Ee,0);for(var Ye=Oe.length,De=function(re){Oe[re].forEach(function(ie){!("rowSpan"in ie)&&!ie.hasSubColumns&&(ie.rowSpan=Ye-re)})},Ke=0;Ke<Ye;Ke+=1)De(Ke);return Oe}function f(Ee){var Oe=Ee.stickyOffsets,je=Ee.columns,Ye=Ee.flattenColumns,De=Ee.onHeaderRow,Ke=x.useContext(s.a),ce=Ke.prefixCls,re=Ke.getComponent,ie=x.useMemo(function(){return v(je)},[je]),$=re(["header","wrapper"],"thead"),Y=re(["header","row"],"tr"),V=re(["header","cell"],"th");return x.createElement($,{className:"".concat(ce,"-thead")},ie.map(function(ne,_e){var we=x.createElement(o,{key:_e,flattenColumns:Ye,cells:ne,stickyOffsets:Oe,rowComponent:Y,cellComponent:V,onHeaderRow:De,index:_e});return we}))}var i=f,r=j("hW8S");function t(Ee){for(var Oe=Ee.colWidths,je=Ee.columns,Ye=Ee.columCount,De=[],Ke=Ye||je.length,ce=!1,re=Ke-1;re>=0;re-=1){var ie=Oe[re],$=je&&je[re],Y=$&&$[r.a];(ie||Y||ce)&&(De.unshift(x.createElement("col",Object.assign({key:re,style:{width:ie,minWidth:ie}},Y))),ce=!0)}return x.createElement("colgroup",null,De)}var a=t;function g(Ee,Oe){return Object(x.useMemo)(function(){for(var je=[],Ye=0;Ye<Oe;Ye+=1){var De=Ee[Ye];if(De!==void 0)je[Ye]=De;else return null}return je},[Ee.join("_"),Oe])}var h=x.forwardRef(function(Ee,Oe){var je=Ee.noData,Ye=Ee.columns,De=Ee.flattenColumns,Ke=Ee.colWidths,ce=Ee.columCount,re=Ee.stickyOffsets,ie=Ee.direction,$=Ee.fixHeader,Y=Ee.offsetHeader,V=Ee.stickyClassName,ne=Ee.onScroll,_e=Object(b.a)(Ee,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),we=x.useContext(s.a),Xe=we.prefixCls,gt=we.scrollbarSize,Nt=we.isSticky,ht=Nt&&!$?0:gt,en=x.useRef(null),tn=x.useCallback(function(yn){Object(m.b)(Oe,yn),Object(m.b)(en,yn)},[]);x.useEffect(function(){var yn;function xn(pt){var zn=pt.currentTarget,Cn=pt.deltaX;Cn&&(ne({currentTarget:zn,scrollLeft:zn.scrollLeft+Cn}),pt.preventDefault())}return(yn=en.current)===null||yn===void 0||yn.addEventListener("wheel",xn),function(){var pt;(pt=en.current)===null||pt===void 0||pt.removeEventListener("wheel",xn)}},[]);var Dt=De[De.length-1],_n={fixed:Dt?Dt.fixed:null,onHeaderCell:function(){return{className:"".concat(Xe,"-cell-scrollbar")}}},fn=Object(x.useMemo)(function(){return ht?[].concat(Object(w.a)(Ye),[_n]):Ye},[ht,Ye]),sn=Object(x.useMemo)(function(){return ht?[].concat(Object(w.a)(De),[_n]):De},[ht,De]),Ln=Object(x.useMemo)(function(){var yn=re.right,xn=re.left;return Object(B.a)(Object(B.a)({},re),{},{left:ie==="rtl"?[].concat(Object(w.a)(xn.map(function(pt){return pt+ht})),[0]):xn,right:ie==="rtl"?yn:[].concat(Object(w.a)(yn.map(function(pt){return pt+ht})),[0]),isSticky:Nt})},[ht,re,Nt]),Wt=g(Ke,ce);return x.createElement("div",{style:Object(B.a)({overflow:"hidden"},Nt?{top:Y}:{}),ref:tn,className:I()("".concat(Xe,"-header"),Object(he.a)({},V,!!V))},x.createElement("table",{style:{tableLayout:"fixed",visibility:je||Wt?null:"hidden"}},x.createElement(a,{colWidths:Wt?[].concat(Object(w.a)(Wt),[ht]):[],columCount:ce+1,columns:sn}),x.createElement(i,Object.assign({},_e,{stickyOffsets:Ln,columns:fn,flattenColumns:sn}))))});h.displayName="FixedHeader";var d=h,e=x.createContext(null),A=e;function M(Ee){var Oe=Ee.prefixCls,je=Ee.children,Ye=Ee.component,De=Ee.cellComponent,Ke=Ee.fixHeader,ce=Ee.fixColumn,re=Ee.horizonScroll,ie=Ee.className,$=Ee.expanded,Y=Ee.componentWidth,V=Ee.colSpan,ne=x.useContext(s.a),_e=ne.scrollbarSize;return x.useMemo(function(){var we=je;return ce&&(we=x.createElement("div",{style:{width:Y-(Ke?_e:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Oe,"-expanded-row-fixed")},we)),x.createElement(Ye,{className:ie,style:{display:$?null:"none"}},x.createElement(n.a,{component:De,prefixCls:Oe,colSpan:V},we))},[je,Ye,Ke,re,ie,$,Y,V,_e])}var F=M;function W(Ee){var Oe=Ee.className,je=Ee.style,Ye=Ee.record,De=Ee.index,Ke=Ee.rowKey,ce=Ee.getRowKey,re=Ee.rowExpandable,ie=Ee.expandedKeys,$=Ee.onRow,Y=Ee.indent,V=Y===void 0?0:Y,ne=Ee.rowComponent,_e=Ee.cellComponent,we=Ee.childrenColumnName,Xe=x.useContext(s.a),gt=Xe.prefixCls,Nt=Xe.fixedInfoList,ht=x.useContext(A),en=ht.fixHeader,tn=ht.fixColumn,Dt=ht.horizonScroll,_n=ht.componentWidth,fn=ht.flattenColumns,sn=ht.expandableType,Ln=ht.expandRowByClick,Wt=ht.onTriggerExpand,yn=ht.rowClassName,xn=ht.expandedRowClassName,pt=ht.indentSize,zn=ht.expandIcon,Cn=ht.expandedRowRender,Rn=ht.expandIconColumnIndex,Rt=x.useState(!1),Gn=Object(_.a)(Rt,2),er=Gn[0],ur=Gn[1],tr=ie&&ie.has(Ee.recordKey);x.useEffect(function(){tr&&ur(!0)},[tr]);var fr=sn==="row"&&(!re||re(Ye)),br=sn==="nest",Vr=we&&Ye&&Ye[we],Fr=fr||br,Rr;$&&(Rr=$(Ye,De));var Xr=function(u){if(Ln&&Fr&&Wt(Ye,u),Rr&&Rr.onClick){for(var p,D=arguments.length,H=new Array(D>1?D-1:0),k=1;k<D;k++)H[k-1]=arguments[k];(p=Rr).onClick.apply(p,[u].concat(H))}},$r;typeof yn=="string"?$r=yn:typeof yn=="function"&&($r=yn(Ye,De,V));var ea=Object(y.a)(fn),ta=x.createElement(ne,Object.assign({},Rr,{"data-row-key":Ke,className:I()(Oe,"".concat(gt,"-row"),"".concat(gt,"-row-level-").concat(V),$r,Rr&&Rr.className),style:Object(B.a)(Object(B.a)({},je),Rr?Rr.style:null),onClick:Xr}),fn.map(function(L,u){var p=L.render,D=L.dataIndex,H=L.className,k=ea[u],ge=Nt[u],qe;u===(Rn||0)&&br&&(qe=x.createElement(x.Fragment,null,x.createElement("span",{style:{paddingLeft:"".concat(pt*V,"px")},className:"".concat(gt,"-row-indent indent-level-").concat(V)}),zn({prefixCls:gt,expanded:tr,expandable:Vr,record:Ye,onExpand:Wt})));var st;return L.onCell&&(st=L.onCell(Ye,De)),x.createElement(n.a,Object.assign({className:H,ellipsis:L.ellipsis,align:L.align,component:_e,prefixCls:gt,key:k,record:Ye,index:De,dataIndex:D,render:p,shouldCellUpdate:L.shouldCellUpdate},ge,{appendNode:qe,additionalProps:st}))})),pr;if(fr&&(er||tr)){var na=Cn(Ye,De,V+1,tr),aa=xn&&xn(Ye,De,V);pr=x.createElement(F,{expanded:tr,className:I()("".concat(gt,"-expanded-row"),"".concat(gt,"-expanded-row-level-").concat(V+1),aa),prefixCls:gt,fixHeader:en,fixColumn:tn,horizonScroll:Dt,component:ne,componentWidth:_n,cellComponent:_e,colSpan:fn.length},na)}var sa;return Vr&&tr&&(sa=(Ye[we]||[]).map(function(L,u){var p=ce(L,u);return x.createElement(W,Object.assign({},Ee,{key:p,rowKey:p,record:L,recordKey:p,index:u,indent:V+1}))})),x.createElement(x.Fragment,null,ta,pr,sa)}W.displayName="BodyRow";var Z=W,K=x.createContext(null),J=K;function oe(Ee){var Oe=Ee.columnKey,je=Ee.onColumnResize,Ye=x.useRef();return x.useEffect(function(){Ye.current&&je(Oe,Ye.current.offsetWidth)},[]),x.createElement(O.a,{onResize:function(Ke){var ce=Ke.offsetWidth;je(Oe,ce)}},x.createElement("td",{ref:Ye,style:{padding:0,border:0,height:0}},x.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function se(Ee){var Oe=Ee.data,je=Ee.getRowKey,Ye=Ee.measureColumnWidth,De=Ee.expandedKeys,Ke=Ee.onRow,ce=Ee.rowExpandable,re=Ee.emptyNode,ie=Ee.childrenColumnName,$=x.useContext(J),Y=$.onColumnResize,V=x.useContext(s.a),ne=V.prefixCls,_e=V.getComponent,we=x.useContext(A),Xe=we.fixHeader,gt=we.horizonScroll,Nt=we.flattenColumns,ht=we.componentWidth;return x.useMemo(function(){var en=_e(["body","wrapper"],"tbody"),tn=_e(["body","row"],"tr"),Dt=_e(["body","cell"],"td"),_n;Oe.length?_n=Oe.map(function(sn,Ln){var Wt=je(sn,Ln);return x.createElement(Z,{key:Wt,rowKey:Wt,record:sn,recordKey:Wt,index:Ln,rowComponent:tn,cellComponent:Dt,expandedKeys:De,onRow:Ke,getRowKey:je,rowExpandable:ce,childrenColumnName:ie})}):_n=x.createElement(F,{expanded:!0,className:"".concat(ne,"-placeholder"),prefixCls:ne,fixHeader:Xe,fixColumn:gt,horizonScroll:gt,component:tn,componentWidth:ht,cellComponent:Dt,colSpan:Nt.length},re);var fn=Object(y.a)(Nt);return x.createElement(en,{className:"".concat(ne,"-tbody")},Ye&&x.createElement("tr",{"aria-hidden":"true",className:"".concat(ne,"-measure-row"),style:{height:0}},fn.map(function(sn){return x.createElement(oe,{key:sn,columnKey:sn,onColumnResize:Y})})),_n)},[Oe,ne,Ke,Ye,De,je,_e,ht,re,Nt])}var pe=x.memo(se);pe.displayName="Body";var be=pe,Q=j("wRmb"),te=j("xEkU"),ve=j.n(te);function q(Ee){var Oe=Object(x.useRef)(Ee),je=Object(x.useState)({}),Ye=Object(_.a)(je,2),De=Ye[1],Ke=Object(x.useRef)(null),ce=Object(x.useRef)([]);function re(ie){Ke.current===null&&(ce.current=[],Ke.current=ve()(function(){ce.current.forEach(function($){Oe.current=$(Oe.current)}),Ke.current=null,De({})})),ce.current.push(ie)}return Object(x.useEffect)(function(){return function(){ve.a.cancel(Ke.current)}},[]),[Oe.current,re]}function X(Ee){var Oe=Object(x.useRef)(Ee),je=Object(x.useRef)(null);function Ye(){window.clearTimeout(je.current)}function De(ce){Oe.current=ce,Ye(),je.current=window.setTimeout(function(){Oe.current=null,je.current=null},100)}function Ke(){return Oe.current}return Object(x.useEffect)(function(){return Ye},[]),[De,Ke]}function Te(Ee,Oe,je){var Ye=Object(x.useMemo)(function(){for(var De=[],Ke=[],ce=0,re=0,ie=0;ie<Oe;ie+=1)if(je==="rtl"){Ke[ie]=re,re+=Ee[ie]||0;var $=Oe-ie-1;De[$]=ce,ce+=Ee[$]||0}else{De[ie]=ce,ce+=Ee[ie]||0;var Y=Oe-ie-1;Ke[Y]=re,re+=Ee[Y]||0}return{left:De,right:Ke}},[Ee,Oe,je]);return Ye}var Ie=Te;function Ge(Ee){var Oe=Ee.className,je=Ee.children;return x.createElement("div",{className:Oe},je)}var Ae=Ge,Me=j("n6Qo");function Se(Ee){var Oe,je=Ee.prefixCls,Ye=Ee.record,De=Ee.onExpand,Ke=Ee.expanded,ce=Ee.expandable,re="".concat(je,"-row-expand-icon");if(!ce)return x.createElement("span",{className:I()(re,"".concat(je,"-row-spaced"))});var ie=function(Y){De(Ye,Y),Y.stopPropagation()};return x.createElement("span",{className:I()(re,(Oe={},Object(he.a)(Oe,"".concat(je,"-row-expanded"),Ke),Object(he.a)(Oe,"".concat(je,"-row-collapsed"),!Ke),Oe)),onClick:ie})}function Le(Ee,Oe,je){var Ye=[];function De(Ke){(Ke||[]).forEach(function(ce,re){Ye.push(Oe(ce,re)),De(ce[je])})}return De(Ee),Ye}var Ve=j("zT1h"),$e=j("y0+3"),Qe=function(Oe,je){var Ye,De,Ke=Oe.scrollBodyRef,ce=Oe.onScroll,re=Oe.offsetScroll,ie=x.useContext(s.a),$=ie.prefixCls,Y=((Ye=Ke.current)===null||Ye===void 0?void 0:Ye.scrollWidth)||0,V=((De=Ke.current)===null||De===void 0?void 0:De.clientWidth)||0,ne=Y&&V*(V/Y),_e=x.useRef(),we=q({scrollLeft:0,isHiddenScrollBar:!1}),Xe=Object(_.a)(we,2),gt=Xe[0],Nt=Xe[1],ht=x.useRef({delta:0,x:0}),en=x.useState(!1),tn=Object(_.a)(en,2),Dt=tn[0],_n=tn[1],fn=function(){_n(!1)},sn=function(pt){pt.persist(),ht.current.delta=pt.pageX-gt.scrollLeft,ht.current.x=0,_n(!0),pt.preventDefault()},Ln=function(pt){var zn,Cn=pt||((zn=window)===null||zn===void 0?void 0:zn.event),Rn=Cn.buttons;if(!Dt||Rn===0){Dt&&_n(!1);return}var Rt=ht.current.x+pt.pageX-ht.current.x-ht.current.delta;Rt<=0&&(Rt=0),Rt+ne>=V&&(Rt=V-ne),ce({scrollLeft:Rt/V*(Y+2)}),ht.current.x=pt.pageX},Wt=function(){var pt=Object($e.b)(Ke.current).top,zn=pt+Ke.current.offsetHeight,Cn=document.documentElement.scrollTop+window.innerHeight;zn-Object(R.a)()<=Cn||pt>=Cn-re?Nt(function(Rn){return Object(B.a)(Object(B.a)({},Rn),{},{isHiddenScrollBar:!0})}):Nt(function(Rn){return Object(B.a)(Object(B.a)({},Rn),{},{isHiddenScrollBar:!1})})},yn=function(pt){Nt(function(zn){return Object(B.a)(Object(B.a)({},zn),{},{scrollLeft:pt/Y*V||0})})};return x.useImperativeHandle(je,function(){return{setScrollLeft:yn}}),x.useEffect(function(){var xn=Object(Ve.a)(document.body,"mouseup",fn,!1),pt=Object(Ve.a)(document.body,"mousemove",Ln,!1);return Wt(),function(){xn.remove(),pt.remove()}},[ne,Dt]),x.useEffect(function(){var xn=Object(Ve.a)(window,"scroll",Wt,!1),pt=Object(Ve.a)(window,"resize",Wt,!1);return function(){xn.remove(),pt.remove()}},[]),x.useEffect(function(){gt.isHiddenScrollBar||Nt(function(xn){var pt,zn;return Object(B.a)(Object(B.a)({},xn),{},{scrollLeft:Ke.current.scrollLeft/((pt=Ke.current)===null||pt===void 0?void 0:pt.scrollWidth)*((zn=Ke.current)===null||zn===void 0?void 0:zn.clientWidth)})})},[gt.isHiddenScrollBar]),Y<=V||!ne||gt.isHiddenScrollBar?null:x.createElement("div",{style:{height:Object(R.a)(),width:V,bottom:re},className:"".concat($,"-sticky-scroll")},x.createElement("div",{onMouseDown:sn,ref:_e,className:I()("".concat($,"-sticky-scroll-bar"),Object(he.a)({},"".concat($,"-sticky-scroll-bar-active"),Dt)),style:{width:"".concat(ne,"px"),transform:"translate3d(".concat(gt.scrollLeft,"px, 0, 0)")}}))},Be=x.forwardRef(Qe);function ze(Ee,Oe){return x.useMemo(function(){var je=!!Ee;return{isSticky:je,stickyClassName:je?"".concat(Oe,"-sticky-header"):"",offsetHeader:Object(U.a)(Ee)==="object"&&Ee.offsetHeader||0,offsetScroll:Object(U.a)(Ee)==="object"&&Ee.offsetScroll||0}},[Ee,Oe])}var ot=[],Re={},nt="rc-table-internal-hook",rt=x.memo(function(Ee){var Oe=Ee.children;return Oe},function(Ee,Oe){return P()(Ee.props,Oe.props)?Ee.pingLeft!==Oe.pingLeft||Ee.pingRight!==Oe.pingRight:!1});function lt(Ee){var Oe,je=Ee.prefixCls,Ye=Ee.className,De=Ee.rowClassName,Ke=Ee.style,ce=Ee.data,re=Ee.rowKey,ie=Ee.scroll,$=Ee.tableLayout,Y=Ee.direction,V=Ee.title,ne=Ee.footer,_e=Ee.summary,we=Ee.id,Xe=Ee.showHeader,gt=Ee.components,Nt=Ee.emptyText,ht=Ee.onRow,en=Ee.onHeaderRow,tn=Ee.internalHooks,Dt=Ee.transformColumns,_n=Ee.internalRefs,fn=Ee.sticky,sn=ce||ot,Ln=!!sn.length,Wt=x.useState(0),yn=Object(_.a)(Wt,2),xn=yn[0],pt=yn[1];x.useEffect(function(){pt(Object(R.a)())});var zn=x.useMemo(function(){return Object(y.c)(gt,{})},[gt]),Cn=x.useCallback(function(qt,Jt){return Object(y.b)(zn,qt)||Jt},[zn]),Rn=x.useMemo(function(){return typeof re=="function"?re:function(qt){var Jt=qt&&qt[re];return Jt}},[re]),Rt=Object(r.c)(Ee),Gn=Rt.expandIcon,er=Rt.expandedRowKeys,ur=Rt.defaultExpandedRowKeys,tr=Rt.defaultExpandAllRows,fr=Rt.expandedRowRender,br=Rt.onExpand,Vr=Rt.onExpandedRowsChange,Fr=Rt.expandRowByClick,Rr=Rt.rowExpandable,Xr=Rt.expandIconColumnIndex,$r=Rt.expandedRowClassName,ea=Rt.childrenColumnName,ta=Rt.indentSize,pr=Gn||Se,na=ea||"children",aa=x.useMemo(function(){return fr?"row":Ee.expandable&&tn===nt&&Ee.expandable.__PARENT_RENDER_ICON__||sn.some(function(qt){return qt&&Object(U.a)(qt)==="object"&&qt[na]})?"nest":!1},[!!fr,sn]),sa=x.useState(function(){return ur||(tr?Le(sn,Rn,na):[])}),L=Object(_.a)(sa,2),u=L[0],p=L[1],D=x.useMemo(function(){return new Set(er||u||[])},[er,u]),H=x.useCallback(function(qt){var Jt=Rn(qt,sn.indexOf(qt)),Mn,ir=D.has(Jt);ir?(D.delete(Jt),Mn=Object(w.a)(D)):Mn=[].concat(Object(w.a)(D),[Jt]),p(Mn),br&&br(!ir,qt),Vr&&Vr(Mn)},[Rn,D,sn,br,Vr]),k=x.useState(0),ge=Object(_.a)(k,2),qe=ge[0],st=ge[1],Kt=Object(Q.b)(Object(B.a)(Object(B.a)(Object(B.a)({},Ee),Rt),{},{expandable:!!fr,expandedKeys:D,getRowKey:Rn,onTriggerExpand:H,expandIcon:pr,expandIconColumnIndex:Xr,direction:Y}),tn===nt?Dt:null),tt=Object(_.a)(Kt,2),nn=tt[0],Yt=tt[1],kn=x.useMemo(function(){return{columns:nn,flattenColumns:Yt}},[nn,Yt]),Pr=x.useRef(),Kr=x.useRef(),nr=x.useRef(),Yr=x.useState(!1),ga=Object(_.a)(Yr,2),la=ga[0],fa=ga[1],Bt=x.useState(!1),ke=Object(_.a)(Bt,2),ut=ke[0],Je=ke[1],et=q(new Map),Xt=Object(_.a)(et,2),Ht=Xt[0],Ut=Xt[1],xt=Object(y.a)(Yt),zt=xt.map(function(qt){return Ht.get(qt)}),ft=x.useMemo(function(){return zt},[zt.join("_")]),Et=Ie(ft,Yt.length,Y),vt=ie&&Object(y.d)(ie.y),Lt=ie&&Object(y.d)(ie.x),mt=Lt&&Yt.some(function(qt){var Jt=qt.fixed;return Jt}),dt=x.useRef(),Mt=ze(fn,je),$t=Mt.isSticky,rn=Mt.offsetHeader,de=Mt.offsetScroll,on=Mt.stickyClassName,Pt,At,yt;vt&&(At={overflowY:"scroll",maxHeight:ie.y}),Lt&&(Pt={overflowX:"auto"},vt||(At={overflowY:"hidden"}),yt={width:ie.x===!0?"auto":ie.x,minWidth:"100%"});var _t=x.useCallback(function(qt,Jt){Ut(function(Mn){var ir=new Map(Mn);return ir.set(qt,Jt),ir})},[]),jt=X(null),Gt=Object(_.a)(jt,2),kt=Gt[0],gn=Gt[1];function Vt(qt,Jt){if(!Jt)return;typeof Jt=="function"?Jt(qt):Jt.scrollLeft!==qt&&(Jt.scrollLeft=qt)}var dn=function(Jt){var Mn=Jt.currentTarget,ir=Jt.scrollLeft,Nr=typeof ir=="number"?ir:Mn.scrollLeft,Or=Mn||Re;if(!gn()||gn()===Or){var Ur;kt(Or),Vt(Nr,Kr.current),Vt(Nr,nr.current),Vt(Nr,(Ur=dt.current)===null||Ur===void 0?void 0:Ur.setScrollLeft)}if(Mn){var Lr=Mn.scrollWidth,ua=Mn.clientWidth;fa(Nr>0),Je(Nr<Lr-ua)}},Kn=function(){nr.current&&dn({currentTarget:nr.current})},Cr=function(Jt){var Mn=Jt.width;Kn(),st(Pr.current?Pr.current.offsetWidth:Mn)};x.useEffect(function(){return Kn},[]),x.useEffect(function(){Lt&&Kn()},[Lt]),x.useEffect(function(){tn===nt&&_n&&(_n.body.current=nr.current)});var Mr=Cn(["table"],"table"),St=x.useMemo(function(){return $||(mt?ie.x==="max-content"?"auto":"fixed":vt||Yt.some(function(qt){var Jt=qt.ellipsis;return Jt})?"fixed":"auto")},[vt,mt,Yt,$]),Xn,Tn={colWidths:ft,columCount:Yt.length,stickyOffsets:Et,onHeaderRow:en,fixHeader:vt},rr=x.useMemo(function(){return Ln?null:typeof Nt=="function"?Nt():Nt},[Ln,Nt]),ar=x.createElement(be,{data:sn,measureColumnWidth:vt||Lt||$t,expandedKeys:D,rowExpandable:Rr,getRowKey:Rn,onRow:ht,emptyNode:rr,childrenColumnName:na}),dr=x.createElement(a,{colWidths:Yt.map(function(qt){var Jt=qt.width;return Jt}),columns:Yt}),Dn=_e&&x.createElement(Me.b,null,_e(sn)),Qn=Cn(["body"]);if(vt||$t){var Vn;typeof Qn=="function"?(Vn=Qn(sn,{scrollbarSize:xn,ref:nr,onScroll:dn}),Tn.colWidths=Yt.map(function(qt,Jt){var Mn=qt.width,ir=Jt===nn.length-1?Mn-xn:Mn;return typeof ir=="number"&&!Number.isNaN(ir)?ir:(Object(E.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Vn=x.createElement("div",{style:Object(B.a)(Object(B.a)({},Pt),At),onScroll:dn,ref:nr,className:I()("".concat(je,"-body"))},x.createElement(Mr,{style:Object(B.a)(Object(B.a)({},yt),{},{tableLayout:St})},dr,ar,Dn),$t&&x.createElement(Be,{ref:dt,offsetScroll:de,scrollBodyRef:nr,onScroll:dn})),Xn=x.createElement(x.Fragment,null,Xe!==!1&&x.createElement(d,Object.assign({noData:!sn.length},Tn,kn,{direction:Y,offsetHeader:rn,stickyClassName:on,ref:Kr,onScroll:dn})),Vn)}else Xn=x.createElement("div",{style:Object(B.a)(Object(B.a)({},Pt),At),className:I()("".concat(je,"-content")),onScroll:dn,ref:nr},x.createElement(Mr,{style:Object(B.a)(Object(B.a)({},yt),{},{tableLayout:St})},dr,Xe!==!1&&x.createElement(i,Object.assign({},Tn,kn)),ar,Dn));var Ar=Object(r.b)(Ee),Wn=x.createElement("div",Object.assign({className:I()(je,Ye,(Oe={},Object(he.a)(Oe,"".concat(je,"-rtl"),Y==="rtl"),Object(he.a)(Oe,"".concat(je,"-ping-left"),la),Object(he.a)(Oe,"".concat(je,"-ping-right"),ut),Object(he.a)(Oe,"".concat(je,"-layout-fixed"),$==="fixed"),Object(he.a)(Oe,"".concat(je,"-fixed-header"),vt),Object(he.a)(Oe,"".concat(je,"-fixed-column"),mt),Object(he.a)(Oe,"".concat(je,"-scroll-horizontal"),Lt),Object(he.a)(Oe,"".concat(je,"-has-fix-left"),Yt[0]&&Yt[0].fixed),Object(he.a)(Oe,"".concat(je,"-has-fix-right"),Yt[Yt.length-1]&&Yt[Yt.length-1].fixed==="right"),Oe)),style:Ke,id:we,ref:Pr},Ar),x.createElement(rt,{pingLeft:la,pingRight:ut,props:Object(B.a)(Object(B.a)({},Ee),{},{stickyOffsets:Et,mergedExpandedKeys:D})},V&&x.createElement(Ae,{className:"".concat(je,"-title")},V(sn)),x.createElement("div",{className:"".concat(je,"-container")},Xn),ne&&x.createElement(Ae,{className:"".concat(je,"-footer")},ne(sn))));Lt&&(Wn=x.createElement(O.a,{onResize:Cr},Wn));var ra=x.useMemo(function(){return{prefixCls:je,getComponent:Cn,scrollbarSize:xn,direction:Y,fixedInfoList:Yt.map(function(qt,Jt){return l(Jt,Jt,Yt,Et,Y)}),isSticky:$t}},[je,Cn,xn,Y,Yt,Et,Y,$t]),mr=x.useMemo(function(){return Object(B.a)(Object(B.a)({},kn),{},{tableLayout:St,rowClassName:De,expandedRowClassName:$r,componentWidth:qe,fixHeader:vt,fixColumn:mt,horizonScroll:Lt,expandIcon:pr,expandableType:aa,expandRowByClick:Fr,expandedRowRender:fr,onTriggerExpand:H,expandIconColumnIndex:Xr,indentSize:ta})},[kn,St,De,$r,qe,vt,mt,Lt,pr,aa,Fr,fr,H,Xr,ta]),vr=x.useMemo(function(){return{onColumnResize:_t}},[_t]);return x.createElement(s.a.Provider,{value:ra},x.createElement(A.Provider,{value:mr},x.createElement(J.Provider,{value:vr},Wn)))}lt.Column=C.a,lt.ColumnGroup=T.a,lt.Summary=Me.a,lt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var bt=Fe.b=lt},wRmb:function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return P});var he=j("rePB"),B=j("KQm4"),w=j("VTBJ"),U=j("Ff2n"),_=j("q1tI"),x=j.n(_),N=j("Kwbf"),I=j("Zm9Q"),S=j("hW8S");function P(C){return Object(I.a)(C).filter(function(b){return _.isValidElement(b)}).map(function(b){var m=b.key,n=b.props,s=n.children,l=Object(U.a)(n,["children"]),y=Object(w.a)({key:m},l);return s&&(y.children=P(s)),y})}function E(C){return C.reduce(function(b,m){var n=m.fixed,s=n===!0?"left":n,l=m.children;return l&&l.length>0?[].concat(Object(B.a)(b),Object(B.a)(E(l).map(function(y){return Object(w.a)({fixed:s},y)}))):[].concat(Object(B.a)(b),[Object(w.a)(Object(w.a)({},m),{},{fixed:s})])},[])}function O(C){for(var b=!0,m=0;m<C.length;m+=1){var n=C[m];if(b&&n.fixed!=="left")b=!1;else if(!b&&n.fixed==="left"){Object(N.a)(!1,"Index ".concat(m-1," of `columns` missing `fixed='left'` prop."));break}}for(var s=!0,l=C.length-1;l>=0;l-=1){var y=C[l];if(s&&y.fixed!=="right")s=!1;else if(!s&&y.fixed==="right"){Object(N.a)(!1,"Index ".concat(l+1," of `columns` missing `fixed='right'` prop."));break}}}function R(C){return C.map(function(b){var m=b.fixed,n=Object(U.a)(b,["fixed"]),s=m;return m==="left"?s="right":m==="right"&&(s="left"),Object(w.a)({fixed:s},n)})}function T(C,b){var m=C.prefixCls,n=C.columns,s=C.children,l=C.expandable,y=C.expandedKeys,c=C.getRowKey,o=C.onTriggerExpand,v=C.expandIcon,f=C.rowExpandable,i=C.expandIconColumnIndex,r=C.direction,t=C.expandRowByClick,a=_.useMemo(function(){return n||P(s)},[n,s]),g=_.useMemo(function(){if(l){var e,A=i||0,M=a[A],F=(e={},Object(he.a)(e,S.a,{className:"".concat(m,"-expand-icon-col")}),Object(he.a)(e,"title",""),Object(he.a)(e,"fixed",M?M.fixed:null),Object(he.a)(e,"className","".concat(m,"-row-expand-icon-cell")),Object(he.a)(e,"render",function(K,J,oe){var se=c(J,oe),pe=y.has(se),be=f?f(J):!0,Q=v({prefixCls:m,expanded:pe,expandable:be,record:J,onExpand:o});return t?_.createElement("span",{onClick:function(ve){return ve.stopPropagation()}},Q):Q}),e),W=a.slice();return A>=0&&W.splice(A,0,F),W}return a},[l,a,c,y,v,r]),h=_.useMemo(function(){var e=g;return b&&(e=b(e)),e.length||(e=[{render:function(){return null}}]),e},[b,g,r]),d=_.useMemo(function(){return r==="rtl"?R(E(h)):E(h)},[h,r]);return[h,d]}Fe.b=T},xlxt:function(Ct,Fe,j){Ct.exports={flex_box_center:"flex_box_center___1qaRn",flex_space_between:"flex_space_between___3tOTR",flex_box_vertical_center:"flex_box_vertical_center___2XsRs",flex_box_center_end:"flex_box_center_end___3O9De",flex_box_column:"flex_box_column___3bx6a",exportModal:"exportModal___29rdj"}},"y0+3":function(Ct,Fe,j){"use strict";j.d(Fe,"a",function(){return E}),j.d(Fe,"b",function(){return R});var he=/margin|padding|width|height|max|min|offset/,B={left:!0,top:!0},w={cssFloat:1,styleFloat:1,float:1};function U(T){return T.nodeType===1?T.ownerDocument.defaultView.getComputedStyle(T,null):{}}function _(T,C,b){if(C=C.toLowerCase(),b==="auto"){if(C==="height")return T.offsetHeight;if(C==="width")return T.offsetWidth}return C in B||(B[C]=he.test(C)),B[C]?parseFloat(b)||0:b}function x(T,C){var b=arguments.length,m=U(T);return C=w[C]?"cssFloat"in T.style?"cssFloat":"styleFloat":C,b===1?m:_(T,C,m[C]||T.style[C])}function N(T,C,b){var m=arguments.length;if(C=w[C]?"cssFloat"in T.style?"cssFloat":"styleFloat":C,m===3)return typeof b=="number"&&he.test(C)&&(b="".concat(b,"px")),T.style[C]=b,b;for(var n in C)C.hasOwnProperty(n)&&N(T,n,C[n]);return U(T)}function I(T){return T===document.body?document.documentElement.clientWidth:T.offsetWidth}function S(T){return T===document.body?window.innerHeight||document.documentElement.clientHeight:T.offsetHeight}function P(){var T=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),C=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:T,height:C}}function E(){var T=document.documentElement.clientWidth,C=window.innerHeight||document.documentElement.clientHeight;return{width:T,height:C}}function O(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function R(T){var C=T.getBoundingClientRect(),b=document.documentElement;return{left:C.left+(window.pageXOffset||b.scrollLeft)-(b.clientLeft||document.body.clientLeft||0),top:C.top+(window.pageYOffset||b.scrollTop)-(b.clientTop||document.body.clientTop||0)}}}}]);