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.
399 lines
1.1 MiB
399 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[94,3,5,6,7,8,13],{"+ua5":function(zt,Qe,G){},"1j5w":function(zt,Qe,G){"use strict";G.d(Qe,"d",function(){return Bt}),G.d(Qe,"b",function(){return Pe}),G.d(Qe,"c",function(){return bt}),G.d(Qe,"a",function(){return Xt});var te=G("VTBJ"),H=G("1OyB"),L=G("vuIU"),W=G("JX7q"),x=G("Ji7U"),O=G("LK+K"),j=G("q1tI"),h=G("I8Z2"),D=G("BGR+"),w=G("wx14"),g=G("rePB"),m=G("4IlW"),u=G("2GS6"),r=G("Gytx"),t=G.n(r),n=G("TSYQ"),s=G.n(n),e=G("U8pU"),i=G("ODXe"),o=/iPhone/i,S=/iPod/i,E=/iPad/i,y=/\bAndroid(?:.+)Mobile\b/i,T=/Android/i,_=/\bAndroid(?:.+)SD4930UR\b/i,l=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,d=/Windows Phone/i,a=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,v=/BB10/i,f=/Opera Mini/i,b=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function R(St,Ze){return St.test(Ze)}function P(St){var Ze=St||(typeof navigator!="undefined"?navigator.userAgent:""),qe=Ze.split("[FBAN");if(typeof qe[1]!="undefined"){var Me=qe,ne=Object(i.a)(Me,1);Ze=ne[0]}if(qe=Ze.split("Twitter"),typeof qe[1]!="undefined"){var me=qe,rt=Object(i.a)(me,1);Ze=rt[0]}var Ke={apple:{phone:R(o,Ze)&&!R(d,Ze),ipod:R(S,Ze),tablet:!R(o,Ze)&&R(E,Ze)&&!R(d,Ze),device:(R(o,Ze)||R(S,Ze)||R(E,Ze))&&!R(d,Ze)},amazon:{phone:R(_,Ze),tablet:!R(_,Ze)&&R(l,Ze),device:R(_,Ze)||R(l,Ze)},android:{phone:!R(d,Ze)&&R(_,Ze)||!R(d,Ze)&&R(y,Ze),tablet:!R(d,Ze)&&!R(_,Ze)&&!R(y,Ze)&&(R(l,Ze)||R(T,Ze)),device:!R(d,Ze)&&(R(_,Ze)||R(l,Ze)||R(y,Ze)||R(T,Ze))||R(/\bokhttp\b/i,Ze)},windows:{phone:R(d,Ze),tablet:R(a,Ze),device:R(d,Ze)||R(a,Ze)},other:{blackberry:R(c,Ze),blackberry10:R(v,Ze),opera:R(f,Ze),firefox:R(I,Ze),chrome:R(b,Ze),device:R(c,Ze)||R(v,Ze)||R(f,Ze)||R(I,Ze)||R(b,Ze)},any:null,phone:null,tablet:null};return Ke.any=Ke.apple.device||Ke.android.device||Ke.windows.device||Ke.other.device,Ke.phone=Ke.apple.phone||Ke.android.phone||Ke.windows.phone,Ke.tablet=Ke.apple.tablet||Ke.android.tablet||Ke.windows.tablet,Ke}var M=Object(te.a)(Object(te.a)({},P()),{},{isMobile:P}),F=M;function A(){}function B(St,Ze,qe){var Me=Ze||"";return St.key||"".concat(Me,"item_").concat(qe)}function z(St){return"".concat(St,"-menu-")}function Z(St,Ze){var qe=-1;j.Children.forEach(St,function(Me){qe+=1,Me&&Me.type&&Me.type.isMenuItemGroup?j.Children.forEach(Me.props.children,function(ne){qe+=1,Ze(ne,qe)}):Ze(Me,qe)})}function ae(St,Ze,qe){if(!St||qe.find)return;j.Children.forEach(St,function(Me){if(Me){var ne=Me.type;if(!ne||!(ne.isSubMenu||ne.isMenuItem||ne.isMenuItemGroup))return;Ze.indexOf(Me.key)!==-1?qe.find=!0:Me.props.children&&ae(Me.props.children,Ze,qe)}})}var De=["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"],_e=function(Ze){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Ze&&typeof Ze.getBoundingClientRect=="function"&&Ze.getBoundingClientRect().width;if(Me){if(qe){var ne=getComputedStyle(Ze),me=ne.marginLeft,rt=ne.marginRight;Me+=+me.replace("px","")+ +rt.replace("px","")}Me=+Me.toFixed(6)}return Me||0},Oe=function(Ze,qe,Me){Ze&&Object(e.a)(Ze.style)==="object"&&(Ze.style[qe]=Me)},Ne=function(){return F.any},Ue=G("KQm4"),Ee=G("Ff2n"),q=G("i8i4"),J=G("bdgK"),pe=G("uciX"),ee=G("8XRh"),Ae={adjustX:1,adjustY:1},Ve={topLeft:{points:["bl","tl"],overflow:Ae,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ae,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Ae,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Ae,offset:[4,0]}},Le={topLeft:{points:["bl","tl"],overflow:Ae,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ae,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Ae,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Ae,offset:[4,0]}},Ye=Ve,it=0,vt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ut=function(Ze,qe,Me){var ne=z(qe),me=Ze.getState();Ze.setState({defaultActiveFirst:Object(te.a)(Object(te.a)({},me.defaultActiveFirst),{},Object(g.a)({},ne,Me))})},mt=function(St){Object(x.a)(qe,St);var Ze=Object(O.a)(qe);function qe(Me){var ne;Object(H.a)(this,qe),ne=Ze.call(this,Me),ne.onDestroy=function(xe){ne.props.onDestroy(xe)},ne.onKeyDown=function(xe){var Je=xe.keyCode,wt=ne.menuInstance,jt=ne.props,Qt=jt.isOpen,Gn=jt.store;if(Je===m.a.ENTER)return ne.onTitleClick(xe),ut(Gn,ne.props.eventKey,!0),!0;if(Je===m.a.RIGHT)return Qt?wt.onKeyDown(xe):(ne.triggerOpenChange(!0),ut(Gn,ne.props.eventKey,!0)),!0;if(Je===m.a.LEFT){var Vn;if(Qt)Vn=wt.onKeyDown(xe);else return;return Vn||(ne.triggerOpenChange(!1),Vn=!0),Vn}return Qt&&(Je===m.a.UP||Je===m.a.DOWN)?wt.onKeyDown(xe):void 0},ne.onOpenChange=function(xe){ne.props.onOpenChange(xe)},ne.onPopupVisibleChange=function(xe){ne.triggerOpenChange(xe,xe?"mouseenter":"mouseleave")},ne.onMouseEnter=function(xe){var Je=ne.props,wt=Je.eventKey,jt=Je.onMouseEnter,Qt=Je.store;ut(Qt,ne.props.eventKey,!1),jt({key:wt,domEvent:xe})},ne.onMouseLeave=function(xe){var Je=ne.props,wt=Je.parentMenu,jt=Je.eventKey,Qt=Je.onMouseLeave;wt.subMenuInstance=Object(W.a)(ne),Qt({key:jt,domEvent:xe})},ne.onTitleMouseEnter=function(xe){var Je=ne.props,wt=Je.eventKey,jt=Je.onItemHover,Qt=Je.onTitleMouseEnter;jt({key:wt,hover:!0}),Qt({key:wt,domEvent:xe})},ne.onTitleMouseLeave=function(xe){var Je=ne.props,wt=Je.parentMenu,jt=Je.eventKey,Qt=Je.onItemHover,Gn=Je.onTitleMouseLeave;wt.subMenuInstance=Object(W.a)(ne),Qt({key:jt,hover:!1}),Gn({key:jt,domEvent:xe})},ne.onTitleClick=function(xe){var Je=Object(W.a)(ne),wt=Je.props;if(wt.onTitleClick({key:wt.eventKey,domEvent:xe}),wt.triggerSubMenuAction==="hover")return;ne.triggerOpenChange(!wt.isOpen,"click"),ut(wt.store,ne.props.eventKey,!1)},ne.onSubMenuClick=function(xe){typeof ne.props.onClick=="function"&&ne.props.onClick(ne.addKeyPath(xe))},ne.onSelect=function(xe){ne.props.onSelect(xe)},ne.onDeselect=function(xe){ne.props.onDeselect(xe)},ne.getPrefixCls=function(){return"".concat(ne.props.rootPrefixCls,"-submenu")},ne.getActiveClassName=function(){return"".concat(ne.getPrefixCls(),"-active")},ne.getDisabledClassName=function(){return"".concat(ne.getPrefixCls(),"-disabled")},ne.getSelectedClassName=function(){return"".concat(ne.getPrefixCls(),"-selected")},ne.getOpenClassName=function(){return"".concat(ne.props.rootPrefixCls,"-submenu-open")},ne.saveMenuInstance=function(xe){ne.menuInstance=xe},ne.addKeyPath=function(xe){return Object(te.a)(Object(te.a)({},xe),{},{keyPath:(xe.keyPath||[]).concat(ne.props.eventKey)})},ne.triggerOpenChange=function(xe,Je){var wt=ne.props.eventKey,jt=function(){ne.onOpenChange({key:wt,item:Object(W.a)(ne),trigger:Je,open:xe})};Je==="mouseenter"?ne.mouseenterTimeout=setTimeout(function(){jt()},0):jt()},ne.isChildrenSelected=function(){var xe={find:!1};return ae(ne.props.children,ne.props.selectedKeys,xe),xe.find},ne.isOpen=function(){return ne.props.openKeys.indexOf(ne.props.eventKey)!==-1},ne.adjustWidth=function(){if(!ne.subMenuTitle||!ne.menuInstance)return;var xe=q.findDOMNode(ne.menuInstance);if(xe.offsetWidth>=ne.subMenuTitle.offsetWidth)return;xe.style.minWidth="".concat(ne.subMenuTitle.offsetWidth,"px")},ne.saveSubMenuTitle=function(xe){ne.subMenuTitle=xe},ne.getBaseProps=function(){var xe=Object(W.a)(ne),Je=xe.props;return{mode:Je.mode==="horizontal"?"vertical":Je.mode,visible:ne.props.isOpen,level:Je.level+1,inlineIndent:Je.inlineIndent,focusable:!1,onClick:ne.onSubMenuClick,onSelect:ne.onSelect,onDeselect:ne.onDeselect,onDestroy:ne.onDestroy,selectedKeys:Je.selectedKeys,eventKey:"".concat(Je.eventKey,"-menu-"),openKeys:Je.openKeys,motion:Je.motion,onOpenChange:ne.onOpenChange,subMenuOpenDelay:Je.subMenuOpenDelay,parentMenu:Object(W.a)(ne),subMenuCloseDelay:Je.subMenuCloseDelay,forceSubMenuRender:Je.forceSubMenuRender,triggerSubMenuAction:Je.triggerSubMenuAction,builtinPlacements:Je.builtinPlacements,defaultActiveFirst:Je.store.getState().defaultActiveFirst[z(Je.eventKey)],multiple:Je.multiple,prefixCls:Je.rootPrefixCls,id:ne.internalMenuId,manualRef:ne.saveMenuInstance,itemIcon:Je.itemIcon,expandIcon:Je.expandIcon,direction:Je.direction}},ne.getMotion=function(xe,Je){var wt=Object(W.a)(ne),jt=wt.haveRendered,Qt=ne.props,Gn=Qt.motion,Vn=Qt.rootPrefixCls,ei=Object(te.a)(Object(te.a)({},Gn),{},{leavedClassName:"".concat(Vn,"-hidden"),removeOnLeave:!1,motionAppear:jt||!Je||xe!=="inline"});return ei};var me=Me.store,rt=Me.eventKey,Ke=me.getState(),xt=Ke.defaultActiveFirst;ne.isRootMenu=!1;var Ot=!1;return xt&&(Ot=xt[rt]),ut(me,rt,Ot),ne}return Object(L.a)(qe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ne=this,me=this.props,rt=me.mode,Ke=me.parentMenu,xt=me.manualRef;if(xt&&xt(this),rt!=="horizontal"||!Ke.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ne.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ne=this.props,me=ne.onDestroy,rt=ne.eventKey;me&&me(rt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ne){var me=this,rt=this.getBaseProps(),Ke=this.getMotion(rt.mode,rt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||rt.visible||rt.forceSubMenuRender,!this.haveOpened)return j.createElement("div",null);var xt=rt.direction;return j.createElement(ee.default,Object.assign({visible:rt.visible},Ke),function(Ot){var xe=Ot.className,Je=Ot.style,wt=s()("".concat(rt.prefixCls,"-sub"),xe,Object(g.a)({},"".concat(rt.prefixCls,"-rtl"),xt==="rtl"));return j.createElement(ve,Object.assign({},rt,{id:me.internalMenuId,className:wt,style:Je}),ne)})}},{key:"render",value:function(){var ne,me=Object(te.a)({},this.props),rt=me.isOpen,Ke=this.getPrefixCls(),xt=me.mode==="inline",Ot=s()(Ke,"".concat(Ke,"-").concat(me.mode),(ne={},Object(g.a)(ne,me.className,!!me.className),Object(g.a)(ne,this.getOpenClassName(),rt),Object(g.a)(ne,this.getActiveClassName(),me.active||rt&&!xt),Object(g.a)(ne,this.getDisabledClassName(),me.disabled),Object(g.a)(ne,this.getSelectedClassName(),this.isChildrenSelected()),ne));this.internalMenuId||(me.eventKey?this.internalMenuId="".concat(me.eventKey,"$Menu"):(it+=1,this.internalMenuId="$__$".concat(it,"$Menu")));var xe={},Je={},wt={};me.disabled||(xe={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Je={onClick:this.onTitleClick},wt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var jt={},Qt=me.direction;xt&&(Qt==="rtl"?jt.paddingRight=me.inlineIndent*me.level:jt.paddingLeft=me.inlineIndent*me.level);var Gn={};this.props.isOpen&&(Gn={"aria-owns":this.internalMenuId});var Vn=null;me.mode!=="horizontal"&&(Vn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Vn=j.createElement(this.props.expandIcon,Object(te.a)({},this.props))));var ei=j.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:jt,className:"".concat(Ke,"-title"),role:"button"},wt,Je,{"aria-expanded":rt},Gn,{"aria-haspopup":"true",title:typeof me.title=="string"?me.title:void 0}),me.title,Vn||j.createElement("i",{className:"".concat(Ke,"-arrow")})),ci=this.renderChildren(me.children),ni=me.parentMenu.isRootMenu?me.parentMenu.props.getPopupContainer:function(sn){return sn.parentNode},_i=vt[me.mode],di=me.popupOffset?{offset:me.popupOffset}:{},rn=me.mode==="inline"?"":me.popupClassName;rn+=Qt==="rtl"?" ".concat(Ke,"-rtl"):"";var Dt=me.disabled,$t=me.triggerSubMenuAction,cn=me.subMenuOpenDelay,Sn=me.forceSubMenuRender,Dn=me.subMenuCloseDelay,gn=me.builtinPlacements;De.forEach(function(sn){return delete me[sn]}),delete me.onClick;var En=Qt==="rtl"?Object.assign({},Le,gn):Object.assign({},Ve,gn);return delete me.direction,j.createElement("li",Object.assign({},me,xe,{className:Ot,role:"menuitem"}),xt&&ei,xt&&ci,!xt&&j.createElement(pe.a,{prefixCls:Ke,popupClassName:s()("".concat(Ke,"-popup"),rn),getPopupContainer:ni,builtinPlacements:En,popupPlacement:_i,popupVisible:rt,popupAlign:di,popup:ci,action:Dt?[]:[$t],mouseEnterDelay:cn,mouseLeaveDelay:Dn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Sn},ei))}}]),qe}(j.Component);mt.defaultProps={onMouseEnter:A,onMouseLeave:A,onTitleMouseEnter:A,onTitleMouseLeave:A,onTitleClick:A,manualRef:A,mode:"vertical",title:""};var lt=Object(h.b)(function(St,Ze){var qe=St.openKeys,Me=St.activeKey,ne=St.selectedKeys,me=Ze.eventKey,rt=Ze.subMenuKey;return{isOpen:qe.indexOf(me)>-1,active:Me[rt]===me,selectedKeys:ne}})(mt);lt.isSubMenu=!0;var Bt=lt,Nt="menuitem-overflowed",Wt=.5,Lt=function(St){Object(x.a)(qe,St);var Ze=Object(O.a)(qe);function qe(){var Me;return Object(H.a)(this,qe),Me=Ze.apply(this,arguments),Me.resizeObserver=null,Me.mutationObserver=null,Me.originalTotalWidth=0,Me.overflowedItems=[],Me.menuItemSizes=[],Me.cancelFrameId=null,Me.state={lastVisibleIndex:void 0},Me.getMenuItemNodes=function(){var ne=Me.props.prefixCls,me=q.findDOMNode(Object(W.a)(Me));return me?[].slice.call(me.children).filter(function(rt){return rt.className.split(" ").indexOf("".concat(ne,"-overflowed-submenu"))<0}):[]},Me.getOverflowedSubMenuItem=function(ne,me,rt){var Ke=Me.props,xt=Ke.overflowedIndicator,Ot=Ke.level,xe=Ke.mode,Je=Ke.prefixCls,wt=Ke.theme;if(Ot!==1||xe!=="horizontal")return null;var jt=Me.props.children[0],Qt=jt.props,Gn=Qt.children,Vn=Qt.title,ei=Qt.style,ci=Object(Ee.a)(Qt,["children","title","style"]),ni=Object(te.a)({},ei),_i="".concat(ne,"-overflowed-indicator"),di="".concat(ne,"-overflowed-indicator");me.length===0&&rt!==!0?ni=Object(te.a)(Object(te.a)({},ni),{},{display:"none"}):rt&&(ni=Object(te.a)(Object(te.a)({},ni),{},{visibility:"hidden",position:"absolute"}),_i="".concat(_i,"-placeholder"),di="".concat(di,"-placeholder"));var rn=wt?"".concat(Je,"-").concat(wt):"",Dt={};return De.forEach(function($t){ci[$t]!==void 0&&(Dt[$t]=ci[$t])}),j.createElement(Bt,Object.assign({title:xt,className:"".concat(Je,"-overflowed-submenu"),popupClassName:rn},Dt,{key:_i,eventKey:di,disabled:!1,style:ni}),me)},Me.setChildrenWidthAndResize=function(){if(Me.props.mode!=="horizontal")return;var ne=q.findDOMNode(Object(W.a)(Me));if(!ne)return;var me=ne.children;if(!me||me.length===0)return;var rt=ne.children[me.length-1];Oe(rt,"display","inline-block");var Ke=Me.getMenuItemNodes(),xt=Ke.filter(function(Ot){return Ot.className.split(" ").indexOf(Nt)>=0});xt.forEach(function(Ot){Oe(Ot,"display","inline-block")}),Me.menuItemSizes=Ke.map(function(Ot){return _e(Ot,!0)}),xt.forEach(function(Ot){Oe(Ot,"display","none")}),Me.overflowedIndicatorWidth=_e(ne.children[ne.children.length-1],!0),Me.originalTotalWidth=Me.menuItemSizes.reduce(function(Ot,xe){return Ot+xe},0),Me.handleResize(),Oe(rt,"display","none")},Me.handleResize=function(){if(Me.props.mode!=="horizontal")return;var ne=q.findDOMNode(Object(W.a)(Me));if(!ne)return;var me=_e(ne);Me.overflowedItems=[];var rt=0,Ke;Me.originalTotalWidth>me+Wt&&(Ke=-1,Me.menuItemSizes.forEach(function(xt){rt+=xt,rt+Me.overflowedIndicatorWidth<=me&&(Ke+=1)})),Me.setState({lastVisibleIndex:Ke})},Me}return Object(L.a)(qe,[{key:"componentDidMount",value:function(){var ne=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var me=q.findDOMNode(this);if(!me)return;this.resizeObserver=new J.default(function(rt){rt.forEach(function(){var Ke=ne.cancelFrameId;cancelAnimationFrame(Ke),ne.cancelFrameId=requestAnimationFrame(ne.setChildrenWidthAndResize)})}),[].slice.call(me.children).concat(me).forEach(function(rt){ne.resizeObserver.observe(rt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ne.resizeObserver.disconnect(),[].slice.call(me.children).concat(me).forEach(function(rt){ne.resizeObserver.observe(rt)}),ne.setChildrenWidthAndResize()}),this.mutationObserver.observe(me,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ne){var me=this,rt=this.state.lastVisibleIndex;return(ne||[]).reduce(function(Ke,xt,Ot){var xe=xt;if(me.props.mode==="horizontal"){var Je=me.getOverflowedSubMenuItem(xt.props.eventKey,[]);rt!==void 0&&me.props.className.indexOf("".concat(me.props.prefixCls,"-root"))!==-1&&(Ot>rt&&(xe=j.cloneElement(xt,{style:{display:"none"},eventKey:"".concat(xt.props.eventKey,"-hidden"),className:"".concat(Nt)})),Ot===rt+1&&(me.overflowedItems=ne.slice(rt+1).map(function(jt){return j.cloneElement(jt,{key:jt.props.eventKey,mode:"vertical-left"})}),Je=me.getOverflowedSubMenuItem(xt.props.eventKey,me.overflowedItems)));var wt=[].concat(Object(Ue.a)(Ke),[Je,xe]);return Ot===ne.length-1&&wt.push(me.getOverflowedSubMenuItem(xt.props.eventKey,[],!0)),wt}return[].concat(Object(Ue.a)(Ke),[xe])},[])}},{key:"render",value:function(){var ne=this.props,me=ne.visible,rt=ne.prefixCls,Ke=ne.overflowedIndicator,xt=ne.mode,Ot=ne.level,xe=ne.tag,Je=ne.children,wt=ne.theme,jt=Object(Ee.a)(ne,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Qt=xe;return j.createElement(Qt,Object.assign({},jt),this.renderChildren(Je))}}]),qe}(j.Component);Lt.defaultProps={tag:"div",className:""};var Gt=Lt;function Ut(St){return St.length?St.every(function(Ze){return!!Ze.props.disabled}):!0}function Re(St,Ze,qe){var Me=St.getState();St.setState({activeKey:Object(te.a)(Object(te.a)({},Me.activeKey),{},Object(g.a)({},Ze,qe))})}function je(St){return St.eventKey||"0-menu-"}function tt(St,Ze){var qe=Ze,Me=St.children,ne=St.eventKey;if(qe){var me;if(Z(Me,function(rt,Ke){rt&&rt.props&&!rt.props.disabled&&qe===B(rt,ne,Ke)&&(me=!0)}),me)return qe}return qe=null,St.defaultActiveFirst&&Z(Me,function(rt,Ke){!qe&&rt&&!rt.props.disabled&&(qe=B(rt,ne,Ke))}),qe}function dt(St){if(St){var Ze=this.instanceArray.indexOf(St);Ze!==-1?this.instanceArray[Ze]=St:this.instanceArray.push(St)}}var ke=function(St){Object(x.a)(qe,St);var Ze=Object(O.a)(qe);function qe(Me){var ne;return Object(H.a)(this,qe),ne=Ze.call(this,Me),ne.onKeyDown=function(me,rt){var Ke=me.keyCode,xt;if(ne.getFlatInstanceArray().forEach(function(xe){xe&&xe.props.active&&xe.onKeyDown&&(xt=xe.onKeyDown(me))}),xt)return 1;var Ot=null;return(Ke===m.a.UP||Ke===m.a.DOWN)&&(Ot=ne.step(Ke===m.a.UP?-1:1)),Ot?(me.preventDefault(),Re(ne.props.store,je(ne.props),Ot.props.eventKey),typeof rt=="function"&&rt(Ot),1):void 0},ne.onItemHover=function(me){var rt=me.key,Ke=me.hover;Re(ne.props.store,je(ne.props),Ke?rt:null)},ne.onDeselect=function(me){ne.props.onDeselect(me)},ne.onSelect=function(me){ne.props.onSelect(me)},ne.onClick=function(me){ne.props.onClick(me)},ne.onOpenChange=function(me){ne.props.onOpenChange(me)},ne.onDestroy=function(me){ne.props.onDestroy(me)},ne.getFlatInstanceArray=function(){return ne.instanceArray},ne.step=function(me){var rt=ne.getFlatInstanceArray(),Ke=ne.props.store.getState().activeKey[je(ne.props)],xt=rt.length;if(!xt)return null;me<0&&(rt=rt.concat().reverse());var Ot=-1;if(rt.every(function(jt,Qt){return jt&&jt.props.eventKey===Ke?(Ot=Qt,!1):!0}),!ne.props.defaultActiveFirst&&Ot!==-1&&Ut(rt.slice(Ot,xt-1)))return;var xe=(Ot+1)%xt,Je=xe;do{var wt=rt[Je];if(!wt||wt.props.disabled)Je=(Je+1)%xt;else return wt}while(Je!==xe);return null},ne.renderCommonMenuItem=function(me,rt,Ke){var xt=ne.props.store.getState(),Ot=Object(W.a)(ne),xe=Ot.props,Je=B(me,xe.eventKey,rt),wt=me.props;if(!wt||typeof me.type=="string")return me;var jt=Je===xt.activeKey,Qt=Object(te.a)(Object(te.a)({mode:wt.mode||xe.mode,level:xe.level,inlineIndent:xe.inlineIndent,renderMenuItem:ne.renderMenuItem,rootPrefixCls:xe.prefixCls,index:rt,parentMenu:xe.parentMenu,manualRef:wt.disabled?void 0:Object(u.a)(me.ref,dt.bind(Object(W.a)(ne))),eventKey:Je,active:!wt.disabled&&jt,multiple:xe.multiple,onClick:function(Vn){(wt.onClick||A)(Vn),ne.onClick(Vn)},onItemHover:ne.onItemHover,motion:xe.motion,subMenuOpenDelay:xe.subMenuOpenDelay,subMenuCloseDelay:xe.subMenuCloseDelay,forceSubMenuRender:xe.forceSubMenuRender,onOpenChange:ne.onOpenChange,onDeselect:ne.onDeselect,onSelect:ne.onSelect,builtinPlacements:xe.builtinPlacements,itemIcon:wt.itemIcon||ne.props.itemIcon,expandIcon:wt.expandIcon||ne.props.expandIcon},Ke),{},{direction:xe.direction});return(xe.mode==="inline"||Ne())&&(Qt.triggerSubMenuAction="click"),j.cloneElement(me,Qt)},ne.renderMenuItem=function(me,rt,Ke){if(!me)return null;var xt=ne.props.store.getState(),Ot={openKeys:xt.openKeys,selectedKeys:xt.selectedKeys,triggerSubMenuAction:ne.props.triggerSubMenuAction,subMenuKey:Ke};return ne.renderCommonMenuItem(me,rt,Ot)},Me.store.setState({activeKey:Object(te.a)(Object(te.a)({},Me.store.getState().activeKey),{},Object(g.a)({},Me.eventKey,tt(Me,Me.activeKey)))}),ne.instanceArray=[],ne}return Object(L.a)(qe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ne){return this.props.visible||ne.visible||this.props.className!==ne.className||!t()(this.props.style,ne.style)}},{key:"componentDidUpdate",value:function(ne){var me=this.props,rt="activeKey"in me?me.activeKey:me.store.getState().activeKey[je(me)],Ke=tt(me,rt);if(Ke!==rt)Re(me.store,je(me),Ke);else if("activeKey"in ne){var xt=tt(ne,ne.activeKey);Ke!==xt&&Re(me.store,je(me),Ke)}}},{key:"render",value:function(){var ne=this,me=Object(w.a)({},this.props);this.instanceArray=[];var rt=s()(me.prefixCls,me.className,"".concat(me.prefixCls,"-").concat(me.mode)),Ke={className:rt,role:me.role||"menu"};me.id&&(Ke.id=me.id),me.focusable&&(Ke.tabIndex=0,Ke.onKeyDown=this.onKeyDown);var xt=me.prefixCls,Ot=me.eventKey,xe=me.visible,Je=me.level,wt=me.mode,jt=me.overflowedIndicator,Qt=me.theme;return De.forEach(function(Gn){return delete me[Gn]}),delete me.onClick,j.createElement(Gt,Object.assign({},me,{prefixCls:xt,mode:wt,tag:"ul",level:Je,theme:Qt,visible:xe,overflowedIndicator:jt},Ke),j.Children.map(me.children,function(Gn,Vn){return ne.renderMenuItem(Gn,Vn,Ot||"0-menu-")}))}}]),qe}(j.Component);ke.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:A};var ot=Object(h.b)()(ke),ve=ot,le=G("Kwbf");function ue(St,Ze,qe){var Me=St.prefixCls,ne=St.motion,me=St.defaultMotions,rt=me===void 0?{}:me,Ke=St.openAnimation,xt=St.openTransitionName,Ot=Ze.switchingModeFromInline;if(ne)return ne;if(Object(e.a)(Ke)==="object"&&Ke)Object(le.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ke=="string")return{motionName:"".concat(Me,"-open-").concat(Ke)};if(xt)return{motionName:xt};var xe=rt[qe];return xe||(Ot?null:rt.other)}var $=function(St){Object(x.a)(qe,St);var Ze=Object(O.a)(qe);function qe(Me){var ne;Object(H.a)(this,qe),ne=Ze.call(this,Me),ne.inlineOpenKeys=[],ne.onSelect=function(Ke){var xt=Object(W.a)(ne),Ot=xt.props;if(Ot.selectable){var xe=ne.store.getState(),Je=xe.selectedKeys,wt=Ke.key;Ot.multiple?Je=Je.concat([wt]):Je=[wt],"selectedKeys"in Ot||ne.store.setState({selectedKeys:Je}),Ot.onSelect(Object(te.a)(Object(te.a)({},Ke),{},{selectedKeys:Je}))}},ne.onClick=function(Ke){var xt=ne.getRealMenuMode(),Ot=Object(W.a)(ne),xe=Ot.store,Je=Ot.props.onOpenChange;xt!=="inline"&&!("openKeys"in ne.props)&&(xe.setState({openKeys:[]}),Je([])),ne.props.onClick(Ke)},ne.onKeyDown=function(Ke,xt){ne.innerMenu.getWrappedInstance().onKeyDown(Ke,xt)},ne.onOpenChange=function(Ke){var xt=Object(W.a)(ne),Ot=xt.props,xe=ne.store.getState().openKeys.concat(),Je=!1,wt=function(Qt){var Gn=!1;if(Qt.open)Gn=xe.indexOf(Qt.key)===-1,Gn&&xe.push(Qt.key);else{var Vn=xe.indexOf(Qt.key);Gn=Vn!==-1,Gn&&xe.splice(Vn,1)}Je=Je||Gn};Array.isArray(Ke)?Ke.forEach(wt):wt(Ke),Je&&("openKeys"in ne.props||ne.store.setState({openKeys:xe}),Ot.onOpenChange(xe))},ne.onDeselect=function(Ke){var xt=Object(W.a)(ne),Ot=xt.props;if(Ot.selectable){var xe=ne.store.getState().selectedKeys.concat(),Je=Ke.key,wt=xe.indexOf(Je);wt!==-1&&xe.splice(wt,1),"selectedKeys"in Ot||ne.store.setState({selectedKeys:xe}),Ot.onDeselect(Object(te.a)(Object(te.a)({},Ke),{},{selectedKeys:xe}))}},ne.onMouseEnter=function(Ke){ne.restoreModeVerticalFromInline();var xt=ne.props.onMouseEnter;xt&&xt(Ke)},ne.onTransitionEnd=function(Ke){var xt=Ke.propertyName==="width"&&Ke.target===Ke.currentTarget,Ot=Ke.target.className,xe=Object.prototype.toString.call(Ot)==="[object SVGAnimatedString]"?Ot.animVal:Ot,Je=Ke.propertyName==="font-size"&&xe.indexOf("anticon")>=0;(xt||Je)&&ne.restoreModeVerticalFromInline()},ne.setInnerMenu=function(Ke){ne.innerMenu=Ke},ne.isRootMenu=!0;var me=Me.defaultSelectedKeys,rt=Me.defaultOpenKeys;return"selectedKeys"in Me&&(me=Me.selectedKeys||[]),"openKeys"in Me&&(rt=Me.openKeys||[]),ne.store=Object(h.c)({selectedKeys:me,openKeys:rt,activeKey:{"0-menu-":tt(Me,Me.activeKey)}}),ne.state={switchingModeFromInline:!1},ne}return Object(L.a)(qe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ne){this.updateOpentKeysWhenSwitchMode(ne),this.updateMiniStore();var me=this.props,rt=me.siderCollapsed,Ke=me.inlineCollapsed,xt=me.onOpenChange;(!ne.inlineCollapsed&&Ke||!ne.siderCollapsed&&rt)&&xt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ne){var me=this.props,rt=this.store,Ke=this.inlineOpenKeys,xt=rt.getState(),Ot={};ne.mode==="inline"&&me.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in me||((me.inlineCollapsed&&!ne.inlineCollapsed||me.siderCollapsed&&!ne.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=xt.openKeys.concat(),Ot.openKeys=[]),(!me.inlineCollapsed&&ne.inlineCollapsed||!me.siderCollapsed&&ne.siderCollapsed)&&(Ot.openKeys=Ke,this.inlineOpenKeys=[])),Object.keys(Ot).length&&rt.setState(Ot)}},{key:"updateMenuDisplay",value:function(){var ne=this.props.collapsedWidth,me=this.store,rt=this.prevOpenKeys,Ke=this.getInlineCollapsed()&&(ne===0||ne==="0"||ne==="0px");Ke?(this.prevOpenKeys=me.getState().openKeys.concat(),this.store.setState({openKeys:[]})):rt&&(this.store.setState({openKeys:rt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ne=this.props.mode,me=this.state.switchingModeFromInline,rt=this.getInlineCollapsed();return me&&rt?"inline":rt?"vertical":ne}},{key:"getInlineCollapsed",value:function(){var ne=this.props,me=ne.inlineCollapsed,rt=ne.siderCollapsed;return rt!==void 0?rt:me}},{key:"restoreModeVerticalFromInline",value:function(){var ne=this.state.switchingModeFromInline;ne&&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 ne=Object(te.a)({},Object(D.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),me=this.getRealMenuMode();return ne.className+=" ".concat(ne.prefixCls,"-root"),ne.direction==="rtl"&&(ne.className+=" ".concat(ne.prefixCls,"-rtl")),ne=Object(te.a)(Object(te.a)({},ne),{},{mode:me,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ue(this.props,this.state,me)}),delete ne.openAnimation,delete ne.openTransitionName,j.createElement(h.a,{store:this.store},j.createElement(ve,Object.assign({},ne,{ref:this.setInnerMenu}),this.props.children))}}]),qe}(j.Component);$.defaultProps={selectable:!0,onClick:A,onSelect:A,onOpenChange:A,onDeselect:A,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:j.createElement("span",null,"\xB7\xB7\xB7")};var Q=$,re=function(St){Object(x.a)(qe,St);var Ze=Object(O.a)(qe);function qe(){var Me;return Object(H.a)(this,qe),Me=Ze.apply(this,arguments),Me.onKeyDown=function(ne){var me=ne.keyCode;return me===m.a.ENTER?(Me.onClick(ne),!0):void 0},Me.onMouseLeave=function(ne){var me=Me.props,rt=me.eventKey,Ke=me.onItemHover,xt=me.onMouseLeave;Ke({key:rt,hover:!1}),xt({key:rt,domEvent:ne})},Me.onMouseEnter=function(ne){var me=Me.props,rt=me.eventKey,Ke=me.onItemHover,xt=me.onMouseEnter;Ke({key:rt,hover:!0}),xt({key:rt,domEvent:ne})},Me.onClick=function(ne){var me=Me.props,rt=me.eventKey,Ke=me.multiple,xt=me.onClick,Ot=me.onSelect,xe=me.onDeselect,Je=me.isSelected,wt={key:rt,keyPath:[rt],item:Object(W.a)(Me),domEvent:ne};xt(wt),Ke?Je?xe(wt):Ot(wt):Je||Ot(wt)},Me.saveNode=function(ne){Me.node=ne},Me}return Object(L.a)(qe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ne=this.props;ne.onDestroy&&ne.onDestroy(ne.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 ne,me=Object(te.a)({},this.props),rt=s()(this.getPrefixCls(),me.className,(ne={},Object(g.a)(ne,this.getActiveClassName(),!me.disabled&&me.active),Object(g.a)(ne,this.getSelectedClassName(),me.isSelected),Object(g.a)(ne,this.getDisabledClassName(),me.disabled),ne)),Ke=Object(te.a)(Object(te.a)({},me.attribute),{},{title:typeof me.title=="string"?me.title:void 0,className:rt,role:me.role||"menuitem","aria-disabled":me.disabled});me.role==="option"?Ke=Object(te.a)(Object(te.a)({},Ke),{},{role:"option","aria-selected":me.isSelected}):(me.role===null||me.role==="none")&&(Ke.role="none");var xt={onClick:me.disabled?null:this.onClick,onMouseLeave:me.disabled?null:this.onMouseLeave,onMouseEnter:me.disabled?null:this.onMouseEnter},Ot=Object(te.a)({},me.style);me.mode==="inline"&&(me.direction==="rtl"?Ot.paddingRight=me.inlineIndent*me.level:Ot.paddingLeft=me.inlineIndent*me.level),De.forEach(function(Je){return delete me[Je]}),delete me.direction;var xe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(xe=j.createElement(this.props.itemIcon,this.props)),j.createElement("li",Object.assign({},Object(D.default)(me,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ke,xt,{style:Ot,ref:this.saveNode}),me.children,xe)}}]),qe}(j.Component);re.isMenuItem=!0,re.defaultProps={onSelect:A,onMouseEnter:A,onMouseLeave:A,manualRef:A};var fe=Object(h.b)(function(St,Ze){var qe=St.activeKey,Me=St.selectedKeys,ne=Ze.eventKey,me=Ze.subMenuKey;return{active:qe[me]===ne,isSelected:Me.indexOf(ne)!==-1}})(re),Pe=fe,Ge=function(St){Object(x.a)(qe,St);var Ze=Object(O.a)(qe);function qe(){var Me;return Object(H.a)(this,qe),Me=Ze.apply(this,arguments),Me.renderInnerMenuItem=function(ne){var me=Me.props,rt=me.renderMenuItem,Ke=me.index;return rt(ne,Ke,Me.props.subMenuKey)},Me}return Object(L.a)(qe,[{key:"render",value:function(){var ne=Object(w.a)({},this.props),me=ne.className,rt=me===void 0?"":me,Ke=ne.rootPrefixCls,xt="".concat(Ke,"-item-group-title"),Ot="".concat(Ke,"-item-group-list"),xe=ne.title,Je=ne.children;return De.forEach(function(wt){return delete ne[wt]}),delete ne.onClick,delete ne.direction,j.createElement("li",Object.assign({},ne,{className:"".concat(rt," ").concat(Ke,"-item-group")}),j.createElement("div",{className:xt,title:typeof xe=="string"?xe:void 0},xe),j.createElement("ul",{className:Ot},j.Children.map(Je,this.renderInnerMenuItem)))}}]),qe}(j.Component);Ge.isMenuItemGroup=!0,Ge.defaultProps={disabled:!0};var bt=Ge,Ft=function(Ze){var qe=Ze.className,Me=Ze.rootPrefixCls,ne=Ze.style;return j.createElement("li",{className:"".concat(qe," ").concat(Me,"-item-divider"),style:ne})};Ft.defaultProps={disabled:!0,className:"",style:{}};var Xt=Ft,Pt=Qe.e=Q},"55Ip":function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return i});var te=G("Ty5D"),H=G("dI71"),L=G("q1tI"),W=G.n(L),x=G("YS25"),O=G("17x9"),j=G.n(O),h=G("wx14"),D=G("zLVn"),w=G("9R94"),g=function(d){Object(H.a)(a,d);function a(){for(var v,f=arguments.length,b=new Array(f),I=0;I<f;I++)b[I]=arguments[I];return v=d.call.apply(d,[this].concat(b))||this,v.history=Object(x.a)(v.props),v}var c=a.prototype;return c.render=function(){return W.a.createElement(te.c,{history:this.history,children:this.props.children})},a}(W.a.Component),m=function(d){Object(H.a)(a,d);function a(){for(var v,f=arguments.length,b=new Array(f),I=0;I<f;I++)b[I]=arguments[I];return v=d.call.apply(d,[this].concat(b))||this,v.history=Object(x.b)(v.props),v}var c=a.prototype;return c.render=function(){return W.a.createElement(te.c,{history:this.history,children:this.props.children})},a}(W.a.Component),u=function(a,c){return typeof a=="function"?a(c):a},r=function(a,c){return typeof a=="string"?Object(x.c)(a,null,null,c):a},t=function(a){return a},n=W.a.forwardRef;typeof n=="undefined"&&(n=t);function s(d){return!!(d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)}var e=n(function(d,a){var c=d.innerRef,v=d.navigate,f=d.onClick,b=Object(D.a)(d,["innerRef","navigate","onClick"]),I=b.target,R=Object(h.a)({},b,{onClick:function(M){try{f&&f(M)}catch(F){throw M.preventDefault(),F}!M.defaultPrevented&&M.button===0&&(!I||I==="_self")&&!s(M)&&(M.preventDefault(),v())}});return t!==n?R.ref=a||c:R.ref=c,W.a.createElement("a",R)}),i=n(function(d,a){var c=d.component,v=c===void 0?e:c,f=d.replace,b=d.to,I=d.innerRef,R=Object(D.a)(d,["component","replace","to","innerRef"]);return W.a.createElement(te.e.Consumer,null,function(P){P||Object(w.a)(!1);var M=P.history,F=r(u(b,P.location),P.location),A=F?M.createHref(F):"",B=Object(h.a)({},R,{href:A,navigate:function(){var Z=u(b,P.location),ae=f?M.replace:M.push;ae(Z)}});return t!==n?B.ref=a||I:B.innerRef=I,W.a.createElement(v,B)})});if(!1)var o,S;var E=function(a){return a},y=W.a.forwardRef;typeof y=="undefined"&&(y=E);function T(){for(var d=arguments.length,a=new Array(d),c=0;c<d;c++)a[c]=arguments[c];return a.filter(function(v){return v}).join(" ")}var _=y(function(d,a){var c=d["aria-current"],v=c===void 0?"page":c,f=d.activeClassName,b=f===void 0?"active":f,I=d.activeStyle,R=d.className,P=d.exact,M=d.isActive,F=d.location,A=d.sensitive,B=d.strict,z=d.style,Z=d.to,ae=d.innerRef,De=Object(D.a)(d,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return W.a.createElement(te.e.Consumer,null,function(_e){_e||Object(w.a)(!1);var Oe=F||_e.location,Ne=r(u(Z,Oe),Oe),Ue=Ne.pathname,Ee=Ue&&Ue.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),q=Ee?Object(te.f)(Oe.pathname,{path:Ee,exact:P,sensitive:A,strict:B}):null,J=!!(M?M(q,Oe):q),pe=J?T(R,b):R,ee=J?Object(h.a)({},z,{},I):z,Ae=Object(h.a)({"aria-current":J&&v||null,className:pe,style:ee,to:Ne},De);return E!==y?Ae.ref=a||ae:Ae.innerRef=ae,W.a.createElement(i,Ae)})});if(!1)var l},"5VLF":function(zt,Qe,G){"use strict";var te,H;function L(W,x,O){var j=function(h,D){return W.js_beautify(h,D)};return j.js=W.js_beautify,j.css=x.css_beautify,j.html=O.html_beautify,j.js_beautify=W.js_beautify,j.css_beautify=x.css_beautify,j.html_beautify=O.html_beautify,j}!(te=[G("6UM0"),G("TXwP"),G("psGv")],H=function(W,x,O){return L(W,x,O)}.apply(Qe,te),H!==void 0&&(zt.exports=H))},"6+eU":function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return y});var te=G("wx14"),H=G("rePB"),L=G("VTBJ"),W=G("1OyB"),x=G("vuIU"),O=G("Ji7U"),j=G("LK+K"),h=G("q1tI"),D=G.n(h),w=G("TSYQ"),g=G.n(w),m=function(_){var l,d="".concat(_.rootPrefixCls,"-item"),a=g()(d,"".concat(d,"-").concat(_.page),(l={},Object(H.a)(l,"".concat(d,"-active"),_.active),Object(H.a)(l,_.className,!!_.className),Object(H.a)(l,"".concat(d,"-disabled"),!_.page),l)),c=function(){_.onClick(_.page)},v=function(b){_.onKeyPress(b,_.onClick,_.page)};return D.a.createElement("li",{title:_.showTitle?_.page:null,className:a,onClick:c,onKeyPress:v,tabIndex:"0"},_.itemRender(_.page,"page",D.a.createElement("a",{rel:"nofollow"},_.page)))},u=m,r={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},t=function(T){Object(O.a)(l,T);var _=Object(j.a)(l);function l(){var d;Object(W.a)(this,l);for(var a=arguments.length,c=new Array(a),v=0;v<a;v++)c[v]=arguments[v];return d=_.call.apply(_,[this].concat(c)),d.state={goInputText:""},d.buildOptionText=function(f){return"".concat(f," ").concat(d.props.locale.items_per_page)},d.changeSize=function(f){d.props.changeSize(Number(f))},d.handleChange=function(f){d.setState({goInputText:f.target.value})},d.handleBlur=function(f){var b=d.props,I=b.goButton,R=b.quickGo,P=b.rootPrefixCls,M=d.state.goInputText;if(I||M==="")return;if(f.relatedTarget&&(f.relatedTarget.className.indexOf("".concat(P,"-prev"))>=0||f.relatedTarget.className.indexOf("".concat(P,"-next"))>=0))return;d.setState({goInputText:""}),R(d.getValidValue())},d.go=function(f){var b=d.state.goInputText;if(b==="")return;(f.keyCode===r.ENTER||f.type==="click")&&(d.setState({goInputText:""}),d.props.quickGo(d.getValidValue()))},d}return Object(x.a)(l,[{key:"getValidValue",value:function(){var a=this.state,c=a.goInputText,v=a.current;return!c||isNaN(c)?v:Number(c)}},{key:"getPageSizeOptions",value:function(){var a=this.props,c=a.pageSize,v=a.pageSizeOptions;return v.some(function(f){return f.toString()===c.toString()})?v:v.concat([c.toString()]).sort(function(f,b){var I=isNaN(Number(f))?0:Number(f),R=isNaN(Number(b))?0:Number(b);return I-R})}},{key:"render",value:function(){var a=this,c=this.props,v=c.pageSize,f=c.locale,b=c.rootPrefixCls,I=c.changeSize,R=c.quickGo,P=c.goButton,M=c.selectComponentClass,F=c.buildOptionText,A=c.selectPrefixCls,B=c.disabled,z=this.state.goInputText,Z="".concat(b,"-options"),ae=M,De=null,_e=null,Oe=null;if(!I&&!R)return null;var Ne=this.getPageSizeOptions();if(I&&ae){var Ue=Ne.map(function(Ee,q){return D.a.createElement(ae.Option,{key:q,value:Ee.toString()},(F||a.buildOptionText)(Ee))});De=D.a.createElement(ae,{disabled:B,prefixCls:A,showSearch:!1,className:"".concat(Z,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Ne[0]).toString(),onChange:this.changeSize,getPopupContainer:function(q){return q.parentNode}},Ue)}return R&&(P&&(Oe=typeof P=="boolean"?D.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:B,className:"".concat(Z,"-quick-jumper-button")},f.jump_to_confirm):D.a.createElement("span",{onClick:this.go,onKeyUp:this.go},P)),_e=D.a.createElement("div",{className:"".concat(Z,"-quick-jumper")},f.jump_to,D.a.createElement("input",{disabled:B,type:"text",value:z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),f.page,Oe)),D.a.createElement("li",{className:"".concat(Z)},De,_e)}}]),l}(D.a.Component);t.defaultProps={pageSizeOptions:["10","20","50","100"]};var n=t,s=G("N2Kk");function e(){}function i(T){return typeof T=="number"&&isFinite(T)&&Math.floor(T)===T}function o(T,_,l){return l}function S(T,_,l){var d=typeof T=="undefined"?_.pageSize:T;return Math.floor((l.total-1)/d)+1}var E=function(T){Object(O.a)(l,T);var _=Object(j.a)(l);function l(d){var a;Object(W.a)(this,l),a=_.call(this,d),a.getJumpPrevPage=function(){return Math.max(1,a.state.current-(a.props.showLessItems?3:5))},a.getJumpNextPage=function(){return Math.min(S(void 0,a.state,a.props),a.state.current+(a.props.showLessItems?3:5))},a.getItemIcon=function(I,R){var P=a.props.prefixCls,M=I||D.a.createElement("button",{type:"button","aria-label":R,className:"".concat(P,"-item-link")});return typeof I=="function"&&(M=D.a.createElement(I,Object(L.a)({},a.props))),M},a.savePaginationNode=function(I){a.paginationNode=I},a.isValid=function(I){return i(I)&&I!==a.state.current},a.shouldDisplayQuickJumper=function(){var I=a.props,R=I.showQuickJumper,P=I.pageSize,M=I.total;return M<=P?!1:R},a.handleKeyDown=function(I){(I.keyCode===r.ARROW_UP||I.keyCode===r.ARROW_DOWN)&&I.preventDefault()},a.handleKeyUp=function(I){var R=a.getValidValue(I),P=a.state.currentInputValue;R!==P&&a.setState({currentInputValue:R}),I.keyCode===r.ENTER?a.handleChange(R):I.keyCode===r.ARROW_UP?a.handleChange(R-1):I.keyCode===r.ARROW_DOWN&&a.handleChange(R+1)},a.changePageSize=function(I){var R=a.state.current,P=S(I,a.state,a.props);R=R>P?P:R,P===0&&(R=a.state.current),typeof I=="number"&&("pageSize"in a.props||a.setState({pageSize:I}),"current"in a.props||a.setState({current:R,currentInputValue:R})),a.props.onShowSizeChange(R,I),"onChange"in a.props&&a.props.onChange&&a.props.onChange(R,I)},a.handleChange=function(I){var R=a.props.disabled,P=I;if(a.isValid(P)&&!R){var M=S(void 0,a.state,a.props);P>M?P=M:P<1&&(P=1),"current"in a.props||a.setState({current:P,currentInputValue:P});var F=a.state.pageSize;return a.props.onChange(P,F),P}return a.state.current},a.prev=function(){a.hasPrev()&&a.handleChange(a.state.current-1)},a.next=function(){a.hasNext()&&a.handleChange(a.state.current+1)},a.jumpPrev=function(){a.handleChange(a.getJumpPrevPage())},a.jumpNext=function(){a.handleChange(a.getJumpNextPage())},a.hasPrev=function(){return a.state.current>1},a.hasNext=function(){return a.state.current<S(void 0,a.state,a.props)},a.runIfEnter=function(I,R){if(I.key==="Enter"||I.charCode===13){for(var P=arguments.length,M=new Array(P>2?P-2:0),F=2;F<P;F++)M[F-2]=arguments[F];R.apply(void 0,M)}},a.runIfEnterPrev=function(I){a.runIfEnter(I,a.prev)},a.runIfEnterNext=function(I){a.runIfEnter(I,a.next)},a.runIfEnterJumpPrev=function(I){a.runIfEnter(I,a.jumpPrev)},a.runIfEnterJumpNext=function(I){a.runIfEnter(I,a.jumpNext)},a.handleGoTO=function(I){(I.keyCode===r.ENTER||I.type==="click")&&a.handleChange(a.state.currentInputValue)};var c=d.onChange!==e,v="current"in d;v&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var f=d.defaultCurrent;"current"in d&&(f=d.current);var b=d.defaultPageSize;return"pageSize"in d&&(b=d.pageSize),f=Math.min(f,S(b,void 0,d)),a.state={current:f,currentInputValue:f,pageSize:b},a}return Object(x.a)(l,[{key:"componentDidUpdate",value:function(a,c){var v=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var f=this.paginationNode.querySelector(".".concat(v,"-item-").concat(c.current));f&&document.activeElement===f&&f.blur()}}},{key:"getValidValue",value:function(a){var c=a.target.value,v=S(void 0,this.state,this.props),f=this.state.currentInputValue,b;return c===""?b=c:isNaN(Number(c))?b=f:c>=v?b=v:b=Number(c),b}},{key:"getShowSizeChanger",value:function(){var a=this.props,c=a.showSizeChanger,v=a.total,f=a.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:v>f}},{key:"renderPrev",value:function(a){var c=this.props,v=c.prevIcon,f=c.itemRender,b=f(a,"prev",this.getItemIcon(v,"prev page")),I=!this.hasPrev();return Object(h.isValidElement)(b)?Object(h.cloneElement)(b,{disabled:I}):b}},{key:"renderNext",value:function(a){var c=this.props,v=c.nextIcon,f=c.itemRender,b=f(a,"next",this.getItemIcon(v,"next page")),I=!this.hasNext();return Object(h.isValidElement)(b)?Object(h.cloneElement)(b,{disabled:I}):b}},{key:"render",value:function(){var a=this,c=this.props,v=c.prefixCls,f=c.className,b=c.style,I=c.disabled,R=c.hideOnSinglePage,P=c.total,M=c.locale,F=c.showQuickJumper,A=c.showLessItems,B=c.showTitle,z=c.showTotal,Z=c.simple,ae=c.itemRender,De=c.showPrevNextJumpers,_e=c.jumpPrevIcon,Oe=c.jumpNextIcon,Ne=c.selectComponentClass,Ue=c.selectPrefixCls,Ee=c.pageSizeOptions,q=this.state,J=q.current,pe=q.pageSize,ee=q.currentInputValue;if(R===!0&&P<=pe)return null;var Ae=S(void 0,this.state,this.props),Ve=[],Le=null,Ye=null,it=null,vt=null,ut=null,mt=F&&F.goButton,lt=A?1:2,Bt=J-1>0?J-1:0,Nt=J+1<Ae?J+1:Ae,Wt=Object.keys(this.props).reduce(function($,Q){return(Q.substr(0,5)==="data-"||Q.substr(0,5)==="aria-"||Q==="role")&&($[Q]=a.props[Q]),$},{});if(Z)return mt&&(typeof mt=="boolean"?ut=D.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},M.jump_to_confirm):ut=D.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},mt),ut=D.a.createElement("li",{title:B?"".concat(M.jump_to).concat(J,"/").concat(Ae):null,className:"".concat(v,"-simple-pager")},ut)),D.a.createElement("ul",Object(te.a)({className:g()(v,"".concat(v,"-simple"),Object(H.a)({},"".concat(v,"-disabled"),I),f),style:b,ref:this.savePaginationNode},Wt),D.a.createElement("li",{title:B?M.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(v,"-prev"),Object(H.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Bt)),D.a.createElement("li",{title:B?"".concat(J,"/").concat(Ae):null,className:"".concat(v,"-simple-pager")},D.a.createElement("input",{type:"text",value:ee,disabled:I,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),D.a.createElement("span",{className:"".concat(v,"-slash")},"/"),Ae),D.a.createElement("li",{title:B?M.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(v,"-next"),Object(H.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Nt)),ut);if(Ae<=3+lt*2){var Lt={locale:M,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:B,itemRender:ae};Ae||Ve.push(D.a.createElement(u,Object(te.a)({},Lt,{key:"noPager",page:Ae,className:"".concat(v,"-disabled")})));for(var Gt=1;Gt<=Ae;Gt+=1){var Ut=J===Gt;Ve.push(D.a.createElement(u,Object(te.a)({},Lt,{key:Gt,page:Gt,active:Ut})))}}else{var Re=A?M.prev_3:M.prev_5,je=A?M.next_3:M.next_5;De&&(Le=D.a.createElement("li",{title:B?Re:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(v,"-jump-prev"),Object(H.a)({},"".concat(v,"-jump-prev-custom-icon"),!!_e))},ae(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(_e,"prev page"))),Ye=D.a.createElement("li",{title:B?je:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(v,"-jump-next"),Object(H.a)({},"".concat(v,"-jump-next-custom-icon"),!!Oe))},ae(this.getJumpNextPage(),"jump-next",this.getItemIcon(Oe,"next page")))),vt=D.a.createElement(u,{locale:M,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ae,page:Ae,active:!1,showTitle:B,itemRender:ae}),it=D.a.createElement(u,{locale:M,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:B,itemRender:ae});var tt=Math.max(1,J-lt),dt=Math.min(J+lt,Ae);J-1<=lt&&(dt=1+lt*2),Ae-J<=lt&&(tt=Ae-lt*2);for(var ke=tt;ke<=dt;ke+=1){var ot=J===ke;Ve.push(D.a.createElement(u,{locale:M,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:ot,showTitle:B,itemRender:ae}))}J-1>=lt*2&&J!==1+2&&(Ve[0]=Object(h.cloneElement)(Ve[0],{className:"".concat(v,"-item-after-jump-prev")}),Ve.unshift(Le)),Ae-J>=lt*2&&J!==Ae-2&&(Ve[Ve.length-1]=Object(h.cloneElement)(Ve[Ve.length-1],{className:"".concat(v,"-item-before-jump-next")}),Ve.push(Ye)),tt!==1&&Ve.unshift(it),dt!==Ae&&Ve.push(vt)}var ve=null;z&&(ve=D.a.createElement("li",{className:"".concat(v,"-total-text")},z(P,[P===0?0:(J-1)*pe+1,J*pe>P?P:J*pe])));var le=!this.hasPrev()||!Ae,ue=!this.hasNext()||!Ae;return D.a.createElement("ul",Object(te.a)({className:g()(v,f,Object(H.a)({},"".concat(v,"-disabled"),I)),style:b,unselectable:"unselectable",ref:this.savePaginationNode},Wt),ve,D.a.createElement("li",{title:B?M.prev_page:null,onClick:this.prev,tabIndex:le?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(v,"-prev"),Object(H.a)({},"".concat(v,"-disabled"),le)),"aria-disabled":le},this.renderPrev(Bt)),Ve,D.a.createElement("li",{title:B?M.next_page:null,onClick:this.next,tabIndex:ue?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(v,"-next"),Object(H.a)({},"".concat(v,"-disabled"),ue)),"aria-disabled":ue},this.renderNext(Nt)),D.a.createElement(n,{disabled:I,locale:M,rootPrefixCls:v,selectComponentClass:Ne,selectPrefixCls:Ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:J,pageSize:pe,pageSizeOptions:Ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:mt}))}}],[{key:"getDerivedStateFromProps",value:function(a,c){var v={};if("current"in a&&(v.current=a.current,a.current!==c.current&&(v.currentInputValue=v.current)),"pageSize"in a&&a.pageSize!==c.pageSize){var f=c.current,b=S(a.pageSize,c,a);f=f>b?b:f,"current"in a||(v.current=f,v.currentInputValue=f),v.pageSize=a.pageSize}return v}}]),l}(D.a.Component);E.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:e,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:e,locale:s.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var y=E},"6RRn":function(zt,Qe,G){"use strict";var te=G("wCXF"),H=G("n6Qo");G.d(Qe,"b",function(){return H.a});var L=G("IBYe"),W=G("6eGT"),x=G("hW8S");G.d(Qe,"a",function(){return x.a}),Qe.c=te.b},"6UM0":function(zt,Qe,G){var te,H;(function(){var L;(function(){"use strict";var x=[function(D,w,g){var m=g(1).Beautifier,u=g(5).Options;function r(t,n){var s=new m(t,n);return s.beautify()}D.exports=r,D.exports.defaultOptions=function(){return new u}},function(D,w,g){var m=g(2).Output,u=g(3).Token,r=g(4),t=g(5).Options,n=g(7).Tokenizer,s=g(7).line_starters,e=g(7).positionable_operators,i=g(7).TOKEN;function o(A,B){return B.indexOf(A)!==-1}function S(A){return A.replace(/^\s+/g,"")}function E(A){for(var B={},z=0;z<A.length;z++)B[A[z].replace(/-/g,"_")]=A[z];return B}function y(A,B){return A&&A.type===i.RESERVED&&A.text===B}function T(A,B){return A&&A.type===i.RESERVED&&o(A.text,B)}var _=["case","return","do","if","throw","else","await","break","continue","async"],l=["before-newline","after-newline","preserve-newline"],d=E(l),a=[d.before_newline,d.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function v(A,B){if(B.multiline_frame||B.mode===c.ForInitializer||B.mode===c.Conditional)return;A.remove_indent(B.start_line_index)}function f(A){A=A.replace(r.allLineBreaks,`
|
|
`);for(var B=[],z=A.indexOf(`
|
|
`);z!==-1;)B.push(A.substring(0,z)),A=A.substring(z+1),z=A.indexOf(`
|
|
`);return A.length&&B.push(A),B}function b(A){return A===c.ArrayLiteral}function I(A){return o(A,[c.Expression,c.ForInitializer,c.Conditional])}function R(A,B){for(var z=0;z<A.length;z++){var Z=A[z].trim();if(Z.charAt(0)!==B)return!1}return!0}function P(A,B){for(var z=0,Z=A.length,ae;z<Z;z++)if(ae=A[z],ae&&ae.indexOf(B)!==0)return!1;return!0}function M(A,B){B=B||{},this._source_text=A||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new t(B)}M.prototype.create_flags=function(A,B){var z=0;A&&(z=A.indentation_level,!this._output.just_added_newline()&&A.line_indent_level>z&&(z=A.line_indent_level));var Z={mode:B,parent:A,last_token:A?A.last_token:new u(i.START_BLOCK,""),last_word:A?A.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:z,alignment:0,line_indent_level:A?A.line_indent_level:z,start_line_index:this._output.get_line_number(),ternary_depth:0};return Z},M.prototype._reset=function(A){var B=A.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,B),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var z=new n(A,this._options);return this._tokens=z.tokenize(),A},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A,B=this._reset(this._source_text),z=this._options.eol;this._options.eol==="auto"&&(z=`
|
|
`,B&&r.lineBreak.test(B||"")&&(z=B.match(r.lineBreak)[0]));for(var Z=this._tokens.next();Z;)this.handle_token(Z),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Z,Z=this._tokens.next();return A=this._output.get_code(z),A},M.prototype.handle_token=function(A,B){A.type===i.START_EXPR?this.handle_start_expr(A):A.type===i.END_EXPR?this.handle_end_expr(A):A.type===i.START_BLOCK?this.handle_start_block(A):A.type===i.END_BLOCK?this.handle_end_block(A):A.type===i.WORD?this.handle_word(A):A.type===i.RESERVED?this.handle_word(A):A.type===i.SEMICOLON?this.handle_semicolon(A):A.type===i.STRING?this.handle_string(A):A.type===i.EQUALS?this.handle_equals(A):A.type===i.OPERATOR?this.handle_operator(A):A.type===i.COMMA?this.handle_comma(A):A.type===i.BLOCK_COMMENT?this.handle_block_comment(A,B):A.type===i.COMMENT?this.handle_comment(A,B):A.type===i.DOT?this.handle_dot(A):A.type===i.EOF?this.handle_eof(A):A.type===i.UNKNOWN?this.handle_unknown(A,B):this.handle_unknown(A,B)},M.prototype.handle_whitespace_and_comments=function(A,B){var z=A.newlines,Z=this._options.keep_array_indentation&&b(this._flags.mode);if(A.comments_before)for(var ae=A.comments_before.next();ae;)this.handle_whitespace_and_comments(ae,B),this.handle_token(ae,B),ae=A.comments_before.next();if(Z)for(var De=0;De<z;De+=1)this.print_newline(De>0,B);else if(this._options.max_preserve_newlines&&z>this._options.max_preserve_newlines&&(z=this._options.max_preserve_newlines),this._options.preserve_newlines&&z>1){this.print_newline(!1,B);for(var _e=1;_e<z;_e+=1)this.print_newline(!0,B)}};var F=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(A,B){if(B=B===void 0?!1:B,this._output.just_added_newline())return;var z=this._options.preserve_newlines&&A.newlines||B,Z=o(this._flags.last_token.text,e)||o(A.text,e);if(Z){var ae=o(this._flags.last_token.text,e)&&o(this._options.operator_position,a)||o(A.text,e);z=z&&ae}if(z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(T(this._flags.last_token,F))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(A,B){if(!B&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var z=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&y(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(A)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(A){this._output.just_added_newline()&&(this._options.keep_array_indentation&&A.newlines&&(A.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(A.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},M.prototype.print_token=function(A){if(this._output.raw){this._output.add_raw_token(A);return}if(this._options.comma_first&&A.previous&&A.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var B=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(B),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(A),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(A),this._output.non_breaking_space=!0,this._output.add_token(A.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.set_mode=function(A){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,A),this._flags=this.create_flags(this._previous_flags,A),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&v(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(A){var B=!1;return B=B||T(this._flags.last_token,["var","let","const"])&&A.type===i.WORD,B=B||y(this._flags.last_token,"do"),B=B||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&T(this._flags.last_token,F)&&!A.newlines,B=B||y(this._flags.last_token,"else")&&!(y(A,"if")&&!A.comments_before),B=B||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),B=B||this._flags.last_token.type===i.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(A.text==="--"||A.text==="++")&&this._last_last_text!=="function"&&A.type!==i.WORD&&A.type!==i.RESERVED,B=B||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"])),B?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(A,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A,T(A,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A);var B=c.Expression;if(A.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){T(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(A),this.set_mode(B),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}B=c.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),o(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,B=c.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,B=c.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&A.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var z=this._tokens.peek(-3);if(this._options.space_after_named_function&&z){var Z=this._tokens.peek(-4);T(z,["async","function"])||z.text==="*"&&T(Z,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(z.text==="{"||z.text===","||z.text==="*"&&(Z.text==="{"||Z.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(A);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&o(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(A,A.newlines),this.print_token(A),this.set_mode(B),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(A){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(A,A.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(A),this.restore_mode(),v(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(A){this.handle_whitespace_and_comments(A);var B=this._tokens.peek(),z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):z&&(o(z.text,[":",","])&&o(B.type,[i.STRING,i.WORD,i.RESERVED])||o(B.text,["get","set","..."])&&o(z.type,[i.WORD,i.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(z.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):o(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||T(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(T(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var Z=!B.comments_before&&B.text==="}",ae=Z&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var De=0,_e=null;this._flags.inline_frame=!0;do if(De+=1,_e=this._tokens.peek(De-1),_e.newlines){this._flags.inline_frame=!1;break}while(_e.type!==i.EOF&&!(_e.type===i.END_BLOCK&&_e.opened===A))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(ae||this._flags.last_token.type===i.EQUALS||T(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(A),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(A),this.indent(),!Z&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(A){for(this.handle_whitespace_and_comments(A);this._flags.mode===c.Statement;)this.restore_mode();var B=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!B?this._output.space_before_token=!0:this._options.brace_style==="expand"?B||this.print_newline():B||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(A)},M.prototype.handle_word=function(A){if(A.type===i.RESERVED){if(o(A.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)A.type=i.WORD;else if(A.text==="import"&&o(this._tokens.peek().text,["(","."]))A.type=i.WORD;else if(o(A.text,["as","from"])&&!this._flags.import_block)A.type=i.WORD;else if(this._flags.mode===c.ObjectLiteral){var B=this._tokens.peek();B.text===":"&&(A.type=i.WORD)}}if(this.start_of_statement(A)?T(this._flags.last_token,["var","let","const"])&&A.type===i.WORD&&(this._flags.declaration_statement=!0):A.newlines&&!I(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!T(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(A),this.print_newline()):this.handle_whitespace_and_comments(A),this._flags.do_block&&!this._flags.do_while)if(y(A,"while")){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&y(A,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&T(A,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(A),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A)),y(A,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!A.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?T(this._flags.last_token,["get","set","new","export"])||T(this._flags.last_token,F)?this._output.space_before_token=!0:y(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(I(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(A),this._flags.last_word=A.text;return}var z="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?z="SPACE":T(A,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines?z="NEWLINE":(z="SPACE",this._output.space_before_token=!0):z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===c.BlockStatement?z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&I(this._flags.mode)?z="SPACE":this._flags.last_token.type===i.STRING?z="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&o(this._last_last_text,["{",","]))?z="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?z="SPACE":z="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,z="NEWLINE"),T(A,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?z="SPACE":z="NEWLINE"),T(A,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Z=this._output.current_line;Z.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else z==="NEWLINE"?T(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&T(A,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!T(A,["var","let","const"]))&&this._flags.last_token.text!==":"&&(y(A,"if")&&y(A.previous,"else")?this._output.space_before_token=!0:this.print_newline()):T(A,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():z==="SPACE"&&(this._output.space_before_token=!0);A.previous&&(A.previous.type===i.WORD||A.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(A),this._flags.last_word=A.text,A.type===i.RESERVED&&(A.text==="do"?this._flags.do_block=!0:A.text==="if"?this._flags.if_block=!0:A.text==="import"?this._flags.import_block=!0:this._flags.import_block&&y(A,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(A){this.start_of_statement(A)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(A);for(var B=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&y(B,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(A)},M.prototype.handle_string=function(A){A.text.startsWith("`")&&A.newlines===0&&A.whitespace_before===""&&(A.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(A)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(A),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A):A.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(A.previous.text==="]"||A.previous.text===")")&&A.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(A)},M.prototype.handle_equals=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0},M.prototype.handle_comma=function(A){this.handle_whitespace_and_comments(A,!0),this.print_token(A),this._output.space_before_token=!0,this._flags.declaration_statement?(I(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)},M.prototype.handle_operator=function(A){var B=A.text==="*"&&(T(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),z=o(A.text,["-","+"])&&(o(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||o(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(A)){var Z=!B;this.handle_whitespace_and_comments(A,Z)}if(A.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(A);return}if(A.text==="::"){this.print_token(A);return}if(this._flags.last_token.type===i.OPERATOR&&o(this._options.operator_position,a)&&this.allow_wrap_or_preserved_newline(A),A.text===":"&&this._flags.in_case){this.print_token(A),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ae=!0,De=!0,_e=!1;if(A.text===":"?this._flags.ternary_depth===0?ae=!1:(this._flags.ternary_depth-=1,_e=!0):A.text==="?"&&(this._flags.ternary_depth+=1),!z&&!B&&this._options.preserve_newlines&&o(A.text,e)){var Oe=A.text===":",Ne=Oe&&_e,Ue=Oe&&!_e;switch(this._options.operator_position){case d.before_newline:this._output.space_before_token=!Ue,this.print_token(A),(!Oe||Ne)&&this.allow_wrap_or_preserved_newline(A),this._output.space_before_token=!0;return;case d.after_newline:this._output.space_before_token=!0,!Oe||Ne?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(A):this._output.space_before_token=!1,this.print_token(A),this._output.space_before_token=!0;return;case d.preserve_newline:Ue||this.allow_wrap_or_preserved_newline(A),ae=!(this._output.just_added_newline()||Ue),this._output.space_before_token=ae,this.print_token(A),this._output.space_before_token=!0;return}}if(B){this.allow_wrap_or_preserved_newline(A),ae=!1;var Ee=this._tokens.peek();De=Ee&&o(Ee.type,[i.WORD,i.RESERVED])}else if(A.text==="...")this.allow_wrap_or_preserved_newline(A),ae=this._flags.last_token.type===i.START_BLOCK,De=!1;else if(o(A.text,["--","++","!","~"])||z){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(A),ae=!1,De=!1,A.newlines&&(A.text==="--"||A.text==="++"||A.text==="~")){var q=T(this._flags.last_token,_)&&A.newlines;q&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(q,!0)}this._flags.last_token.text===";"&&I(this._flags.mode)&&(ae=!0),this._flags.last_token.type===i.RESERVED?ae=!0:this._flags.last_token.type===i.END_EXPR?ae=!(this._flags.last_token.text==="]"&&(A.text==="--"||A.text==="++")):this._flags.last_token.type===i.OPERATOR&&(ae=o(A.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(A.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(De=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ae,this.print_token(A),this._output.space_before_token=De},M.prototype.handle_block_comment=function(A,B){if(this._output.raw){this._output.add_raw_token(A),A.directives&&A.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(A.directives){this.print_newline(!1,B),this.print_token(A),A.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!r.newline.test(A.text)&&!A.newlines){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0;return}else this.print_block_commment(A,B)},M.prototype.print_block_commment=function(A,B){var z=f(A.text),Z,ae=!1,De=!1,_e=A.whitespace_before,Oe=_e.length;if(this.print_newline(!1,B),this.print_token_line_indentation(A),this._output.add_token(z[0]),this.print_newline(!1,B),z.length>1){for(z=z.slice(1),ae=R(z,"*"),De=P(z,_e),ae&&(this._flags.alignment=1),Z=0;Z<z.length;Z++)ae?(this.print_token_line_indentation(A),this._output.add_token(S(z[Z]))):De&&z[Z]?(this.print_token_line_indentation(A),this._output.add_token(z[Z].substring(Oe))):(this._output.current_line.set_indent(-1),this._output.add_token(z[Z])),this.print_newline(!1,B);this._flags.alignment=0}},M.prototype.handle_comment=function(A,B){A.newlines?this.print_newline(!1,B):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(A),this.print_newline(!1,B)},M.prototype.handle_dot=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),T(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(A,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(A)},M.prototype.handle_unknown=function(A,B){this.print_token(A),A.text[A.text.length-1]===`
|
|
`&&this.print_newline(!1,B)},M.prototype.handle_eof=function(A){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A)},D.exports.Beautifier=M},function(D){function w(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}w.prototype.clone_empty=function(){var u=new w(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},w.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},w.prototype.has_match=function(u){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(u))return!0;return!1},w.prototype.set_indent=function(u,r){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},w.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},w.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(u){this.__items.push(u);var r=u.lastIndexOf(`
|
|
`);r!==-1?this.__character_count=u.length-r:this.__character_count+=u.length},w.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,r){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),r=r||"",u.indent_level>0&&(r=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}g.prototype.get_indent_size=function(u,r){var t=this.__base_string_length;return r=r||0,u<0&&(t=0),t+=u*this.__indent_size,t+=r,t},g.prototype.get_indent_string=function(u,r){var t=this.__base_string;return r=r||0,u<0&&(u=0,t=""),r+=u*this.__indent_size,this.__ensure_cache(r),t+=this.__cache[r],t},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,r=0,t="";this.__indent_size&&u>=this.__indent_size&&(r=Math.floor(u/this.__indent_size),u-=r*this.__indent_size,t=new Array(r+1).join(this.__indent_string)),u&&(t+=new Array(u+1).join(" ")),this.__cache.push(t)};function m(u,r){this.__indent_cache=new g(u,r),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(u,r){return this.__indent_cache.get_indent_string(u,r)},m.prototype.get_indent_size=function(u,r){return this.__indent_cache.get_indent_size(u,r)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(u){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
|
|
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(t=t.replace(/[\n]/g,u)),t},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(u,r){return u=u||0,r=r||0,this.next_line.set_indent(u,r),this.__lines.length>1?(this.current_line.set_indent(u,r),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(u){for(var r=0;r<u.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(u){for(var r=this.__lines.length;u<r;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(u,r){for(var t=this.__lines.length-2;t>=0;){var n=this.__lines[t];if(n.is_empty())break;if(n.item(0).indexOf(u)!==0&&n.item(-1)!==r){this.__lines.splice(t+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},D.exports.Output=m},function(D){function w(g,m,u,r){this.type=g,this.text=m,this.comments_before=null,this.newlines=u||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=w},function(D,w){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",t="(?:\\\\u[0-9a-fA-F]{4}|["+g+u+"])",n="(?:\\\\u[0-9a-fA-F]{4}|["+m+u+r+"])*";w.identifier=new RegExp(t+n,"g"),w.identifierStart=new RegExp(t),w.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+u+r+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;w.newline=/[\n\r\u2028\u2029]/,w.lineBreak=new RegExp(`\r
|
|
|`+w.newline.source),w.allLineBreaks=new RegExp(w.lineBreak.source,"g")},function(D,w,g){var m=g(6).Options,u=["before-newline","after-newline","preserve-newline"];function r(t){m.call(this,t,"js");var n=this.raw_options.brace_style||null;n==="expand-strict"?this.raw_options.brace_style="expand":n==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var e=0;e<s.length;e++)s[e]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[e];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}r.prototype=new m,D.exports.Options=r},function(D){function w(u,r){this.raw_options=g(u,r),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}w.prototype._get_array=function(u,r){var t=this.raw_options[u],n=r||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(n=t.concat()):typeof t=="string"&&(n=t.split(/[^a-zA-Z0-9_\/\-]+/)),n},w.prototype._get_boolean=function(u,r){var t=this.raw_options[u],n=t===void 0?!!r:!!t;return n},w.prototype._get_characters=function(u,r){var t=this.raw_options[u],n=r||"";return typeof t=="string"&&(n=t.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),n},w.prototype._get_number=function(u,r){var t=this.raw_options[u];r=parseInt(r,10),isNaN(r)&&(r=0);var n=parseInt(t,10);return isNaN(n)&&(n=r),n},w.prototype._get_selection=function(u,r,t){var n=this._get_selection_list(u,r,t);if(n.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[u]+"'");return n[0]},w.prototype._get_selection_list=function(u,r,t){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[r[0]],!this._is_valid_selection(t,r))throw new Error("Invalid Default Value!");var n=this._get_array(u,t);if(!this._is_valid_selection(n,r))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[u]+"'");return n},w.prototype._is_valid_selection=function(u,r){return u.length&&r.length&&!u.some(function(t){return r.indexOf(t)===-1})};function g(u,r){var t={};u=m(u);var n;for(n in u)n!==r&&(t[n]=u[n]);if(r&&u[r])for(n in u[r])t[n]=u[r][n];return t}function m(u){var r={},t;for(t in u){var n=t.replace(/-/g,"_");r[n]=u[t]}return r}D.exports.Options=w,D.exports.normalizeOpts=m,D.exports.mergeOpts=g},function(D,w,g){var m=g(8).InputScanner,u=g(9).Tokenizer,r=g(9).TOKEN,t=g(13).Directives,n=g(4),s=g(12).Pattern,e=g(14).TemplatablePattern;function i(R,P){return P.indexOf(R)!==-1}var o={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},S=new t(/\/\*/,/\*\//),E=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,y=/[0-9]/,T=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),l=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";l=l.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),l="\\?\\.(?!\\d) "+l,l=l.replace(/ /g,"|");var d=new RegExp(l),a="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=a.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+c.join("|")+")$"),f,b=function(R,P){u.call(this,R,P),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new s(this._input),F=new e(this._input).read_options(this._options);this.__patterns={template:F,identifier:F.starting_with(n.identifier).matching(n.identifierMatch),number:M.matching(E),punct:M.matching(d),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(n.lineBreak),shebang:M.starting_with(/#!/).until_after(n.lineBreak),xml:M.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:F.until(/['\\\n\r\u2028\u2029]/),double_quote:F.until(/["\\\n\r\u2028\u2029]/),template_text:F.until(/[`\\$]/),template_expression:F.until(/[`}\\]/)}};b.prototype=new u,b.prototype._is_comment=function(R){return R.type===o.COMMENT||R.type===o.BLOCK_COMMENT||R.type===o.UNKNOWN},b.prototype._is_opening=function(R){return R.type===o.START_BLOCK||R.type===o.START_EXPR},b.prototype._is_closing=function(R,P){return(R.type===o.END_BLOCK||R.type===o.END_EXPR)&&P&&(R.text==="]"&&P.text==="["||R.text===")"&&P.text==="("||R.text==="}"&&P.text==="{")},b.prototype._reset=function(){f=!1},b.prototype._get_next_token=function(R,P){var M=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(o.EOF,""):(M=M||this._read_non_javascript(F),M=M||this._read_string(F),M=M||this._read_word(R),M=M||this._read_singles(F),M=M||this._read_comment(F),M=M||this._read_regexp(F,R),M=M||this._read_xml(F,R),M=M||this._read_punctuation(),M=M||this._create_token(o.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(R){var P;if(P=this.__patterns.identifier.read(),P!=="")return P=P.replace(n.allLineBreaks,`
|
|
`),!(R.type===o.DOT||R.type===o.RESERVED&&(R.text==="set"||R.text==="get"))&&v.test(P)?(P==="in"||P==="of")&&(R.type===o.WORD||R.type===o.STRING)?this._create_token(o.OPERATOR,P):this._create_token(o.RESERVED,P):this._create_token(o.WORD,P);if(P=this.__patterns.number.read(),P!=="")return this._create_token(o.WORD,P)},b.prototype._read_singles=function(R){var P=null;return R==="("||R==="["?P=this._create_token(o.START_EXPR,R):R===")"||R==="]"?P=this._create_token(o.END_EXPR,R):R==="{"?P=this._create_token(o.START_BLOCK,R):R==="}"?P=this._create_token(o.END_BLOCK,R):R===";"?P=this._create_token(o.SEMICOLON,R):R==="."&&T.test(this._input.peek(1))?P=this._create_token(o.DOT,R):R===","&&(P=this._create_token(o.COMMA,R)),P&&this._input.next(),P},b.prototype._read_punctuation=function(){var R=this.__patterns.punct.read();if(R!=="")return R==="="?this._create_token(o.EQUALS,R):R==="?."?this._create_token(o.DOT,R):this._create_token(o.OPERATOR,R)},b.prototype._read_non_javascript=function(R){var P="";if(R==="#"){if(this._is_first_token()&&(P=this.__patterns.shebang.read(),P))return this._create_token(o.UNKNOWN,P.trim()+`
|
|
`);if(P=this.__patterns.include.read(),P)return this._create_token(o.UNKNOWN,P.trim()+`
|
|
`);R=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(y)){do R=this._input.next(),M+=R;while(this._input.hasNext()&&R!=="#"&&R!=="=");return R==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,M)}this._input.back()}else if(R==="<"&&this._is_first_token()){if(P=this.__patterns.html_comment_start.read(),P){for(;this._input.hasNext()&&!this._input.testChar(n.newline);)P+=this._input.next();return f=!0,this._create_token(o.COMMENT,P)}}else if(f&&R==="-"&&(P=this.__patterns.html_comment_end.read(),P))return f=!1,this._create_token(o.COMMENT,P);return null},b.prototype._read_comment=function(R){var P=null;if(R==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var F=S.get_directives(M);F&&F.ignore==="start"&&(M+=S.readIgnored(this._input)),M=M.replace(n.allLineBreaks,`
|
|
`),P=this._create_token(o.BLOCK_COMMENT,M),P.directives=F}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),P=this._create_token(o.COMMENT,M))}return P},b.prototype._read_string=function(R){if(R==="`"||R==="'"||R==='"'){var P=this._input.next();return this.has_char_escapes=!1,R==="`"?P+=this._read_string_recursive("`",!0,"${"):P+=this._read_string_recursive(R),this.has_char_escapes&&this._options.unescape_strings&&(P=I(P)),this._input.peek()===R&&(P+=this._input.next()),P=P.replace(n.allLineBreaks,`
|
|
`),this._create_token(o.STRING,P)}return null},b.prototype._allow_regexp_or_xml=function(R){return R.type===o.RESERVED&&i(R.text,["return","case","throw","else","do","typeof","yield"])||R.type===o.END_EXPR&&R.text===")"&&R.opened.previous.type===o.RESERVED&&i(R.opened.previous.text,["if","while","for"])||i(R.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},b.prototype._read_regexp=function(R,P){if(R==="/"&&this._allow_regexp_or_xml(P)){for(var M=this._input.next(),F=!1,A=!1;this._input.hasNext()&&(F||A||this._input.peek()!==R)&&!this._input.testChar(n.newline);)M+=this._input.peek(),F?F=!1:(F=this._input.peek()==="\\",this._input.peek()==="["?A=!0:this._input.peek()==="]"&&(A=!1)),this._input.next();return this._input.peek()===R&&(M+=this._input.next(),M+=this._input.read(n.identifier)),this._create_token(o.STRING,M)}return null},b.prototype._read_xml=function(R,P){if(this._options.e4x&&R==="<"&&this._allow_regexp_or_xml(P)){var M="",F=this.__patterns.xml.read_match();if(F){for(var A=F[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),B=A.indexOf("{")===0,z=0;F;){var Z=!!F[1],ae=F[2],De=!!F[F.length-1]||ae.slice(0,8)==="![CDATA[";if(!De&&(ae===A||B&&ae.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Z?--z:++z),M+=F[0],z<=0)break;F=this.__patterns.xml.read_match()}return F||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(n.allLineBreaks,`
|
|
`),this._create_token(o.STRING,M)}}return null};function I(R){for(var P="",M=0,F=new m(R),A=null;F.hasNext();)if(A=F.match(/([\s]|[^\\]|\\\\)+/g),A&&(P+=A[0]),F.peek()==="\\"){if(F.next(),F.peek()==="x")A=F.match(/x([0-9A-Fa-f]{2})/g);else if(F.peek()==="u")A=F.match(/u([0-9A-Fa-f]{4})/g);else{P+="\\",F.hasNext()&&(P+=F.next());continue}if(!A)return R;if(M=parseInt(A[1],16),M>126&&M<=255&&A[0].indexOf("x")===0)return R;if(M>=0&&M<32){P+="\\"+A[0];continue}else M===34||M===39||M===92?P+="\\"+String.fromCharCode(M):P+=String.fromCharCode(M)}return P}b.prototype._read_string_recursive=function(R,P,M){var F,A;R==="'"?A=this.__patterns.single_quote:R==='"'?A=this.__patterns.double_quote:R==="`"?A=this.__patterns.template_text:R==="}"&&(A=this.__patterns.template_expression);for(var B=A.read(),z="";this._input.hasNext();){if(z=this._input.next(),z===R||!P&&n.newline.test(z)){this._input.back();break}else z==="\\"&&this._input.hasNext()?(F=this._input.peek(),F==="x"||F==="u"?this.has_char_escapes=!0:F==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),z+=this._input.next()):M&&(M==="${"&&z==="$"&&this._input.peek()==="{"&&(z+=this._input.next()),M===z&&(R==="`"?z+=this._read_string_recursive("}",P,"`"):z+=this._read_string_recursive("`",P,"${"),this._input.hasNext()&&(z+=this._input.next())));z+=A.read(),B+=z}return B},D.exports.Tokenizer=b,D.exports.TOKEN=o,D.exports.positionable_operators=_.slice(),D.exports.line_starters=a.slice()},function(D){var w=RegExp.prototype.hasOwnProperty("sticky");function g(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},g.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(u=this.__input.charAt(m)),u},g.prototype.__match=function(m,u){m.lastIndex=u;var r=m.exec(this.__input);return r&&!(w&&m.sticky)&&(r.index!==u&&(r=null)),r},g.prototype.test=function(m,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(m,u):!1},g.prototype.testChar=function(m,u){var r=this.peek(u);return m.lastIndex=0,r!==null&&m.test(r)},g.prototype.match=function(m){var u=this.__match(m,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(m,u,r){var t="",n;return m&&(n=this.match(m),n&&(t+=n[0])),u&&(n||!m)&&(t+=this.readUntil(u,r)),t},g.prototype.readUntil=function(m,u){var r="",t=this.__position;m.lastIndex=this.__position;var n=m.exec(this.__input);return n?(t=n.index,u&&(t+=n[0].length)):t=this.__input_length,r=this.__input.substring(this.__position,t),this.__position=t,r},g.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},g.prototype.get_regexp=function(m,u){var r=null,t="g";return u&&w&&(t="y"),typeof m=="string"&&m!==""?r=new RegExp(m,t):m&&(r=new RegExp(m.source,t)),r},g.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(m){var u=this.__position,r=this.readUntilAfter(m);return this.__position=u,r},g.prototype.lookBack=function(m){var u=this.__position-1;return u>=m.length&&this.__input.substring(u-m.length,u).toLowerCase()===m},D.exports.InputScanner=g},function(D,w,g){var m=g(8).InputScanner,u=g(3).Token,r=g(10).TokenStream,t=g(11).WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(e,i){this._input=new m(e),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var e,i=new u(n.START,""),o=null,S=[],E=new r;i.type!==n.EOF;){for(e=this._get_next_token(i,o);this._is_comment(e);)E.add(e),e=this._get_next_token(i,o);E.isEmpty()||(e.comments_before=E,E=new r),e.parent=o,this._is_opening(e)?(S.push(o),o=e):o&&this._is_closing(e,o)&&(e.opened=o,o.closed=e,o=S.pop(),e.parent=o),e.previous=i,i.next=e,this.__tokens.add(e),i=e}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(e,i){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(n.RAW,o):this._create_token(n.EOF,"")},s.prototype._is_comment=function(e){return!1},s.prototype._is_opening=function(e){return!1},s.prototype._is_closing=function(e,i){return!1},s.prototype._create_token=function(e,i){var o=new u(e,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=s,D.exports.TOKEN=n},function(D){function w(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}w.prototype.restart=function(){this.__position=0},w.prototype.isEmpty=function(){return this.__tokens_length===0},w.prototype.hasNext=function(){return this.__position<this.__tokens_length},w.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},w.prototype.peek=function(g){var m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(m=this.__tokens[g]),m},w.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},D.exports.TokenStream=w},function(D,w,g){var m=g(12).Pattern;function u(r,t){m.call(this,r,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new m,u.prototype.__set_whitespace_patterns=function(r,t){r+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var r=this._input.read(this._match_pattern);if(r===" ")this.whitespace_before_token=" ";else if(r){var t=this.__split(this._newline_regexp,r);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return r},u.prototype.matching=function(r,t){var n=this._create();return n.__set_whitespace_patterns(r,t),n._update(),n},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(r,t){r.lastIndex=0;for(var n=0,s=[],e=r.exec(t);e;)s.push(t.substring(n,e.index)),n=e.index+e[0].length,e=r.exec(t);return n<t.length?s.push(t.substring(n,t.length)):s.push(""),s},D.exports.WhitespacePattern=u},function(D){function w(g,m){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}w.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},w.prototype.read_match=function(){return this._input.match(this._match_pattern)},w.prototype.until_after=function(g){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(g),m._update(),m},w.prototype.until=function(g){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(g),m._update(),m},w.prototype.starting_with=function(g){var m=this._create();return m._starting_pattern=this._input.get_regexp(g,!0),m._update(),m},w.prototype.matching=function(g){var m=this._create();return m._match_pattern=this._input.get_regexp(g,!0),m._update(),m},w.prototype._create=function(){return new w(this._input,this)},w.prototype._update=function(){},D.exports.Pattern=w},function(D){function w(g,m){g=typeof g=="string"?g:g.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+m,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)m[u[1]]=u[2],u=this.__directive_pattern.exec(g);return m},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=w},function(D,w,g){var m=g(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(t,n){m.call(this,t,n),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),n&&(this.__template_pattern=this._input.get_regexp(n.__template_pattern),this._excluded=Object.assign(this._excluded,n._excluded),this._disabled=Object.assign(this._disabled,n._disabled));var s=new m(t);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new m,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(t){var n=this._create();return n._disabled[t]=!0,n._update(),n},r.prototype.read_options=function(t){var n=this._create();for(var s in u)n._disabled[s]=t.templating.indexOf(s)===-1;return n._update(),n},r.prototype.exclude=function(t){var n=this._create();return n._excluded[t]=!0,n._update(),n},r.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),t+=n,n=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},r.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},r.prototype._read_template=function(){var t="",n=this._input.peek();if(n==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(t=t||this.__patterns.erb.read())}else n==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},D.exports.TemplatablePattern=r}],O={};function j(D){var w=O[D];if(w!==void 0)return w.exports;var g=O[D]={exports:{}};return x[D](g,g.exports,j),g.exports}var h=j(0);L=h})();var W=L;!(te=[],H=function(){return{js_beautify:W}}.apply(Qe,te),H!==void 0&&(zt.exports=H))})()},"6eGT":function(zt,Qe,G){"use strict";function te(H){return null}Qe.a=te},"7ixt":function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return L});var te={adjustX:1,adjustY:1},H=[0,0],L={left:{points:["cr","cl"],overflow:te,offset:[-4,0],targetOffset:H},right:{points:["cl","cr"],overflow:te,offset:[4,0],targetOffset:H},top:{points:["bc","tc"],overflow:te,offset:[0,-4],targetOffset:H},bottom:{points:["tc","bc"],overflow:te,offset:[0,4],targetOffset:H},topLeft:{points:["bl","tl"],overflow:te,offset:[0,-4],targetOffset:H},leftTop:{points:["tr","tl"],overflow:te,offset:[-4,0],targetOffset:H},topRight:{points:["br","tr"],overflow:te,offset:[0,-4],targetOffset:H},rightTop:{points:["tl","tr"],overflow:te,offset:[4,0],targetOffset:H},bottomRight:{points:["tr","br"],overflow:te,offset:[0,4],targetOffset:H},rightBottom:{points:["bl","br"],overflow:te,offset:[4,0],targetOffset:H},bottomLeft:{points:["tl","bl"],overflow:te,offset:[0,4],targetOffset:H},leftBottom:{points:["br","bl"],overflow:te,offset:[-4,0],targetOffset:H}},W=L},"815F":function(zt,Qe,G){"use strict";G.d(Qe,"e",function(){return j}),G.d(Qe,"c",function(){return D}),G.d(Qe,"d",function(){return w}),G.d(Qe,"a",function(){return m}),G.d(Qe,"f",function(){return u}),G.d(Qe,"b",function(){return r});var te=G("KQm4"),H=G("VTBJ"),L=G("Ff2n"),W=G("Zm9Q"),x=G("Kwbf"),O=G("OZM5");function j(t,n){return t!=null?t:n}function h(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=new Map;function s(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(e||[]).forEach(function(o){var S=o.key,E=o.children;Object(x.a)(S!=null,"Tree node must have a certain key: [".concat(i).concat(S,"]"));var y=String(S);Object(x.a)(!n.has(y)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(y)),n.set(y,!0),s(E,"".concat(i).concat(y," > "))})}s(t)}function D(t){function n(s){var e=Object(W.a)(s);return e.map(function(i){if(!Object(O.i)(i))return Object(x.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var o=i.key,S=i.props,E=S.children,y=Object(L.a)(S,["children"]),T=Object(H.a)({key:o},y),_=n(E);return _.length&&(T.children=_),T}).filter(function(i){return i})}return n(t)}function w(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(n===!0?[]:n),e=[];function i(o){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(E,y){var T=Object(O.h)(S?S.pos:"0",y),_=j(E.key,T),l=Object(H.a)(Object(H.a)({},E),{},{parent:S,pos:T,children:null,data:E,isStart:[].concat(Object(te.a)(S?S.isStart:[]),[y===0]),isEnd:[].concat(Object(te.a)(S?S.isEnd:[]),[y===o.length-1])});return e.push(l),n===!0||s.has(_)?l.children=i(E.children||[],l):l.children=[],l})}return i(t),e}function g(t,n,s){var e;s?typeof s=="string"?e=function(S){return S[s]}:typeof s=="function"&&(e=function(S){return s(S)}):e=function(S,E){return j(S.key,E)};function i(o,S,E){var y=o?o.children:t,T=o?Object(O.h)(E.pos,S):"0";if(o){var _=e(o,T),l={node:o,index:S,pos:T,key:_,parentPos:E.node?E.pos:null,level:E.level+1};n(l)}y&&y.forEach(function(d,a){i(d,a,{node:o,pos:T,level:E?E.level+1:-1})})}i(null)}function m(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.initWrapper,e=n.processEntity,i=n.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,S={},E={},y={posEntities:S,keyEntities:E};return s&&(y=s(y)||y),g(t,function(T){var _=T.node,l=T.index,d=T.pos,a=T.key,c=T.parentPos,v=T.level,f={node:_,index:l,key:a,pos:d,level:v},b=j(a,d);S[d]=f,E[b]=f,f.parent=S[c],f.parent&&(f.parent.children=f.parent.children||[],f.parent.children.push(f)),e&&e(f,y)},o),i&&i(y),y}function u(t,n){var s=n.expandedKeys,e=n.selectedKeys,i=n.loadedKeys,o=n.loadingKeys,S=n.checkedKeys,E=n.halfCheckedKeys,y=n.dragOverNodeKey,T=n.dropPosition,_=n.keyEntities,l=_[t],d={eventKey:t,expanded:s.indexOf(t)!==-1,selected:e.indexOf(t)!==-1,loaded:i.indexOf(t)!==-1,loading:o.indexOf(t)!==-1,checked:S.indexOf(t)!==-1,halfChecked:E.indexOf(t)!==-1,pos:String(l?l.pos:""),dragOver:y===t&&T===0,dragOverGapTop:y===t&&T===-1,dragOverGapBottom:y===t&&T===1};return d}function r(t){var n=t.data,s=t.expanded,e=t.selected,i=t.checked,o=t.loaded,S=t.loading,E=t.halfChecked,y=t.dragOver,T=t.dragOverGapTop,_=t.dragOverGapBottom,l=t.pos,d=t.active,a=Object(H.a)(Object(H.a)({},n),{},{expanded:s,selected:e,checked:i,loaded:o,loading:S,halfChecked:E,dragOver:y,dragOverGapTop:T,dragOverGapBottom:_,pos:l,active:d});return"props"in a||Object.defineProperty(a,"props",{get:function(){return Object(x.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),t}}),a}},"8hTe":function(zt,Qe,G){zt.exports={button:"button___1wy9m"}},"9Bee":function(zt,Qe,G){"use strict";var te=G("DYRE"),H=G("zeV3"),L=G("+L6B"),W=G("2/Rp"),x=G("k1fw"),O=G("9og8"),j=G("tJVT"),h=G("WmNS"),D=G.n(h),w=G("q1tI"),g=G.n(w),m=G("vg9a"),u=G("DlQD"),r=G.n(u),t=G("rUJ1");function n(k,p){var C=k.match(/^(\s+)(?:```)/);if(C===null)return p;var N=C[1];return p.split(`
|
|
`).map(function(V){var U=V.match(/^\s+/);if(U===null)return V;var de=Object(j.a)(U,1),ze=de[0];return ze.length>=N.length?V.slice(N.length):V}).join(`
|
|
`)}var s=[],e=["<ul>"],i=new r.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){s.length=0,e=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(k,p,C,N){if(p>=k.length||k[p].level<=C)return p;var V=k[p];N.push("<li><a href='#"+V.anchor+"'>"+V.text+"</a>"),p++;var U=[];return p=y(k,p,V.level,U),U.length>0&&(N.push("<ul>"),U.forEach(function(de){N.push(de)}),N.push("</ul>")),N.push("</li>"),p=y(k,p,C,N),p}function T(){return y(s,0,0,e),e.push("</ul>"),e.join("")}var _={heading:function(p){var C=o.exec(p);if(C)return{type:"heading",raw:C[0],depth:C[1].length,text:C[2]}},fences:function(p){var C=this.rules.block.fences.exec(p);if(C){var N=C[0],V=n(N,C[3]||""),U=C[2]?C[2].trim():C[2];if(["latex","katex","math"].indexOf(U)>=0){var de=a(),ze=V;V=de,c[de]={type:"block",expression:ze}}return{type:"code",raw:N,lang:U,text:V}}}},l=/(?:\${2})([^\n`]+?)(?:\${2})/gi,d=0,a=function(){return"__special_katext_id_".concat(d++,"__")},c={};function v(){return c}function f(){d=0,c={}}function b(k){return k=k.replace(l,function(p,C){var N=a();return c[N]={type:"inline",expression:C},N}),k}var I=i.listitem;i.listitem=function(k){return I(b(k))};var R=i.paragraph;i.paragraph=function(k){return R(b(k))};var P=i.tablecell;i.tablecell=function(k,p){return P(b(k),p)},i.code=function(k,p,C){var N=(p||"").match(/\S*/)[0];return N?["latex","katex","math"].indexOf(N)>=0?"<p class='editormd-tex'>".concat(k,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(p,'">').concat(C?k:Object(t.escape)(k,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(C?k:Object(t.escape)(k,!0))+"</code></pre>"},i.heading=function(k,p,C){var N=this.options.headerPrefix+C.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:N,level:p,text:k}),"<h"+p+' id="'+N+'">'+k+"</h"+p+">"},r.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),r.a.use({tokenizer:_,renderer:i});var M=r.a,F=G("SJMd"),A=G("ulZh"),B=G.n(A),z=G("m3rI"),Z=G("Oy/b"),ae=G("p5ED"),De=G("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var _e=function(k,p){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,N){C.__proto__=N}||function(C,N){for(var V in N)Object.prototype.hasOwnProperty.call(N,V)&&(C[V]=N[V])})(k,p)};function Oe(k,p){function C(){this.constructor=k}_e(k,p),k.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}function Ne(k,p,C,N){return new(C||(C=Promise))(function(V,U){function de(Mt){try{_t(N.next(Mt))}catch(ct){U(ct)}}function ze(Mt){try{_t(N.throw(Mt))}catch(ct){U(ct)}}function _t(Mt){var ct;Mt.done?V(Mt.value):(ct=Mt.value,ct instanceof C?ct:new C(function(Vt){Vt(ct)})).then(de,ze)}_t((N=N.apply(k,p||[])).next())})}function Ue(k,p){var C,N,V,U,de={label:0,sent:function(){if(1&V[0])throw V[1];return V[1]},trys:[],ops:[]};return U={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function ze(_t){return function(Mt){return function(ct){if(C)throw new TypeError("Generator is already executing.");for(;de;)try{if(C=1,N&&(V=2&ct[0]?N.return:ct[0]?N.throw||((V=N.return)&&V.call(N),0):N.next)&&!(V=V.call(N,ct[1])).done)return V;switch(N=0,V&&(ct=[2&ct[0],V.value]),ct[0]){case 0:case 1:V=ct;break;case 4:return de.label++,{value:ct[1],done:!1};case 5:de.label++,N=ct[1],ct=[0];continue;case 7:ct=de.ops.pop(),de.trys.pop();continue;default:if(!(V=de.trys,(V=V.length>0&&V[V.length-1])||ct[0]!==6&&ct[0]!==2)){de=0;continue}if(ct[0]===3&&(!V||ct[1]>V[0]&&ct[1]<V[3])){de.label=ct[1];break}if(ct[0]===6&&de.label<V[1]){de.label=V[1],V=ct;break}if(V&&de.label<V[2]){de.label=V[2],de.ops.push(ct);break}V[2]&&de.ops.pop(),de.trys.pop();continue}ct=p.call(k,de)}catch(Vt){ct=[6,Vt],N=0}finally{C=V=0}if(5&ct[0])throw ct[1];return{value:ct[0]?ct[1]:void 0,done:!0}}([_t,Mt])}}}function Ee(){for(var k=0,p=0,C=arguments.length;p<C;p++)k+=arguments[p].length;var N=Array(k),V=0;for(p=0;p<C;p++)for(var U=arguments[p],de=0,ze=U.length;de<ze;de++,V++)N[V]=U[de];return N}var q=function(){function k(){}return k.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},k.setAttributes=function(p,C){for(var N=0,V=C;N<V.length;N++){var U=V[N],de=U[0],ze=U[1];p.setAttribute(de,ze)}},k.createRect=function(p,C,N){var V=document.createElementNS("http://www.w3.org/2000/svg","rect");return V.setAttribute("width",p.toString()),V.setAttribute("height",C.toString()),N&&k.setAttributes(V,N),V},k.createLine=function(p,C,N,V,U){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",p.toString()),de.setAttribute("y1",C.toString()),de.setAttribute("x2",N.toString()),de.setAttribute("y2",V.toString()),U&&k.setAttributes(de,U),de},k.createPolygon=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","polygon");return N.setAttribute("points",p),C&&k.setAttributes(N,C),N},k.createCircle=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","circle");return N.setAttribute("cx",(p/2).toString()),N.setAttribute("cy",(p/2).toString()),N.setAttribute("r",p.toString()),C&&k.setAttributes(N,C),N},k.createEllipse=function(p,C,N){var V=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return V.setAttribute("cx",(p/2).toString()),V.setAttribute("cy",(C/2).toString()),V.setAttribute("rx",(p/2).toString()),V.setAttribute("ry",(C/2).toString()),N&&k.setAttributes(V,N),V},k.createGroup=function(p){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return p&&k.setAttributes(C,p),C},k.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},k.createMarker=function(p,C,N,V,U,de,ze){var _t=document.createElementNS("http://www.w3.org/2000/svg","marker");return k.setAttributes(_t,[["id",p],["orient",C],["markerWidth",N.toString()],["markerHeight",V.toString()],["refX",U.toString()],["refY",de.toString()]]),_t.appendChild(ze),_t},k.createText=function(p){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),p&&k.setAttributes(C,p),C},k.createTSpan=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","tspan");return N.textContent=p,C&&k.setAttributes(N,C),N},k.createImage=function(p){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return p&&k.setAttributes(C,p),C},k.createPoint=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return N.x=p,N.y=C,N},k.createPath=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","path");return N.setAttribute("d",p),C&&k.setAttributes(N,C),N},k}(),J=function(){function k(){}return k.addKey=function(p){k.key=p},Object.defineProperty(k,"isLicensed",{get:function(){return!!k.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(k.key)},enumerable:!1,configurable:!0}),k}(),pe=function(){function k(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return k.prototype.rasterize=function(p,C,N){var V=this;return new Promise(function(U){var de=N!==void 0?N:document.createElement("canvas");p===null&&(V.markersOnly=!0,V.naturalSize=!1);var ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("width",C.width.baseVal.valueAsString),ze.setAttribute("height",C.height.baseVal.valueAsString),ze.setAttribute("viewBox","0 0 "+C.viewBox.baseVal.width.toString()+" "+C.viewBox.baseVal.height.toString()),ze.innerHTML=C.innerHTML,V.naturalSize===!0?(ze.width.baseVal.value=p.naturalWidth,ze.height.baseVal.value=p.naturalHeight):V.width!==void 0&&V.height!==void 0&&(ze.width.baseVal.value=V.width,ze.height.baseVal.value=V.height),de.width=ze.width.baseVal.value,de.height=ze.height.baseVal.value;var _t=ze.outerHTML,Mt=de.getContext("2d");V.markersOnly!==!0&&Mt.drawImage(p,0,0,de.width,de.height);var ct=window.URL,Vt=new Image(de.width,de.height);Vt.setAttribute("crossOrigin","anonymous");var Et=new Blob([_t],{type:"image/svg+xml"}),Yt=ct.createObjectURL(Et);Vt.onload=function(){Mt.drawImage(Vt,0,0),ct.revokeObjectURL(Yt);var dn=de.toDataURL(V.imageType,V.imageQuality);U(dn)},Vt.src=Yt})},k}(),ee=function(){},Ae=function(){function k(p){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+p+"_"}return Object.defineProperty(k.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(k.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(k.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),k.prototype.addClass=function(p){return this.styleSheet===void 0&&this.addStyleSheet(),p.name=""+this.classNamePrefix+p.localName,this.classes.push(p),this.styleSheet.sheet.insertRule("."+p.name+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length),p},k.prototype.addRule=function(p){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(p),this.styleSheet.sheet.insertRule(p.selector+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length)},k.prototype.addStyleSheet=function(){var p;this.styleSheet=document.createElement("style"),((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).appendChild(this.styleSheet),this.addRule(new Ve("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Le("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Le("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},k.prototype.removeStyleSheet=function(){var p;this.styleSheet&&(((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},k}(),Ve=function(k,p){this.selector=k,this.style=p},Le=function(k,p){this.localName=k,this.style=p},Ye=function(){function k(p,C,N,V,U){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=p,this.displayMode=C,this.markerItems=N,this.uiStyleSettings=V,this.styles=U,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return k.prototype.show=function(p){var C=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var N=document.createElement("div");N.className=this.toolbarBlockStyleClass.name,N.style.whiteSpace="nowrap",this.uiContainer.appendChild(N),this.addActionButton(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(U){var de=document.createElement("div");de.className=""+C.toolbarButtonStyleClass.name,de.setAttribute("data-type-name",U.typeName),de.innerHTML=U.icon,de.addEventListener("click",function(){C.markerToolbarButtonClicked(de,U)}),C.buttons.push(de),C.markerButtons.push(de)}),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 V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",V.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(V),this.addActionButton(V,'<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(V,'<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()},k.prototype.addButtonClickListener=function(p){this.buttonClickListeners.push(p)},k.prototype.removeButtonClickListener=function(p){this.buttonClickListeners.indexOf(p)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(p),1)},k.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},k.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var p=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var C=0;C<this.markerButtons.length;C++)C<p||C===p&&this.markerButtons.length-1===p?this.markerButtonBlock.appendChild(this.markerButtons[C]):(C===p&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[C]))}},k.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")},k.prototype.resetButtonStyles=function(){var p=this;this.buttons.forEach(function(C){C.className=C.className.replace(p.uiStyleSettings.toolbarButtonStyleColorsClassName?p.uiStyleSettings.toolbarButtonStyleColorsClassName:p.toolbarButtonStyleColorsClass.name,"").trim(),C.className=C.className.replace(p.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?p.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:p.toolbarActiveButtonStyleColorsClass.name,"").trim(),C.className+=" "+(p.uiStyleSettings.toolbarButtonStyleColorsClassName?p.uiStyleSettings.toolbarButtonStyleColorsClassName:p.toolbarButtonStyleColorsClass.name)})},k.prototype.addActionButton=function(p,C,N){var V=this,U=document.createElement("div");switch(U.className=""+this.toolbarButtonStyleClass.name,U.innerHTML=C,U.setAttribute("data-action",N),U.addEventListener("click",function(){V.actionToolbarButtonClicked(U,N)}),N){case"select":U.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":U.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":U.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":U.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":U.style.fill=this.uiStyleSettings.closeButtonColor}p.appendChild(U),this.buttons.push(U)},k.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Le("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 Le("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Le("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Le("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 Le("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Le("toolbar_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.toolbarButtonStyleColorsClass=this.styles.addClass(new Le("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},k.prototype.markerToolbarButtonClicked=function(p,C){this.setActiveButton(p),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(N){return N("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},k.prototype.actionToolbarButtonClicked=function(p,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(N){return N("action",C)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},k.prototype.setActiveButton=function(p){this.resetButtonStyles(),p.className=p.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),p.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},k.prototype.setActiveMarkerButton=function(p){var C=this.markerButtons.find(function(N){return N.getAttribute("data-type-name")===p});C&&this.setActiveButton(C)},k.prototype.setCurrentMarker=function(p){var C=this;this.currentMarker=p,this.buttons.filter(function(N){return/delete|notes/.test(N.getAttribute("data-action"))}).forEach(function(N){C.currentMarker===void 0?(N.style.fillOpacity="0.4",N.style.pointerEvents="none"):(N.style.fillOpacity="1",N.style.pointerEvents="all")})},k}(),it=function(){function k(p,C,N,V){this.panels=[],this.panelButtons=[],this.markerjsContainer=p,this.displayMode=C,this.uiStyleSettings=N,this.styles=V,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return k.prototype.addStyles=function(){var p;this.toolboxStyleClass=this.styles.addClass(new Le("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 Le("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Le("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Le("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Le("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 Le("toolbox-panel-row_colors",`
|
|
background-color: `+((p=this.uiStyleSettings.toolboxBackgroundColor)!==null&&p!==void 0?p:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Le("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
|
|
padding: `+C+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},k.prototype.show=function(p){var C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},k.prototype.setPanelButtons=function(p){var C,N,V=this;this.panels=p,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var de;U.uiStyleSettings=V.uiStyleSettings;var ze=document.createElement("div");ze.className=V.toolboxButtonStyleClass.name+" "+((de=V.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&de!==void 0?de:V.toolboxButtonStyleColorsClass.name),ze.innerHTML=U.icon,ze.title=U.title,ze.addEventListener("click",function(){V.panelButtonClick(U)}),V.panelButtons.push(ze),V.buttonRow.appendChild(ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},k.prototype.panelButtonClick=function(p){var C=this,N=-1;if(p!==this.activePanel){N=this.panels.indexOf(p),this.panelRow.innerHTML="";var V=p.getUi();V.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(V),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=p}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,de){var ze,_t;U.className=C.toolboxButtonStyleClass.name+" "+(de===N?""+((ze=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ze!==void 0?ze:C.toolboxActiveButtonStyleColorsClass.name):""+((_t=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_t!==void 0?_t:C.toolboxButtonStyleColorsClass.name))})},k}(),vt=function(k,p){this.title=k,this.icon=p},ut=function(k){function p(C,N,V,U){var de=k.call(this,C,U||'<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 de.colors=[],de.addTransparent=!1,de.colorBoxes=[],de.colors=N,de.currentColor=V,de.setCurrentColor=de.setCurrentColor.bind(de),de.getColorBox=de.getColorBox.bind(de),de}return Oe(p,k),p.prototype.getUi=function(){var C=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.whiteSpace="nowrap",this.colors.forEach(function(V){var U=C.getColorBox(V);N.appendChild(U),C.colorBoxes.push(U)}),N},p.prototype.getColorBox=function(C){var N=this,V=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-V,de=document.createElement("div");de.style.display="inline-block",de.style.boxSizing="content-box",de.style.width=U-2+"px",de.style.height=U-2+"px",de.style.padding="1px",de.style.marginRight="2px",de.style.marginBottom="2px",de.style.borderWidth="2px",de.style.borderStyle="solid",de.style.borderRadius=(U+2)/2+"px",de.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",de.addEventListener("click",function(){N.setCurrentColor(C,de)});var ze=document.createElement("div");return ze.style.display="inline-block",ze.style.width=U-2+"px",ze.style.height=U-2+"px",ze.style.backgroundColor=C,ze.style.borderRadius=U/2+"px",C==="transparent"&&(ze.style.fill=this.uiStyleSettings.toolboxAccentColor,ze.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>`),de.appendChild(ze),de},p.prototype.setCurrentColor=function(C,N){var V=this;this.currentColor=C,this.colorBoxes.forEach(function(U){U.style.borderColor=U===N?V.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},p}(vt),mt=function(){function k(p,C,N){this._state="new",this._isSelected=!1,this._container=p,this._overlayContainer=C,this.globalSettings=N,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(k.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(p){return!1},Object.defineProperty(k.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),k.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},k.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},k.prototype.pointerDown=function(p,C){},k.prototype.dblClick=function(p,C){},k.prototype.manipulate=function(p){},k.prototype.pointerUp=function(p){this.stateChanged()},k.prototype.dispose=function(){},k.prototype.addMarkerVisualToContainer=function(p){this.container.childNodes.length>0?this.container.insertBefore(p,this.container.childNodes[0]):this.container.appendChild(p)},k.prototype.getState=function(){return{typeName:k.typeName,state:this.state,notes:this.notes}},k.prototype.restoreState=function(p){this._state=p.state,this.notes=p.notes},k.prototype.scale=function(p,C){},k.prototype.colorChanged=function(p){this.onColorChanged&&this.onColorChanged(p),this.stateChanged()},k.prototype.fillColorChanged=function(p){this.onFillColorChanged&&this.onFillColorChanged(p),this.stateChanged()},k.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var p=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),p.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(p)&&this.onStateChanged(this)}},k.typeName="MarkerBase",k}(),lt=function(){function k(){this.findGripByVisual=this.findGripByVisual.bind(this)}return k.prototype.findGripByVisual=function(p){return this.topLeft.ownsTarget(p)?this.topLeft:this.topCenter.ownsTarget(p)?this.topCenter:this.topRight.ownsTarget(p)?this.topRight:this.centerLeft.ownsTarget(p)?this.centerLeft:this.centerRight.ownsTarget(p)?this.centerRight:this.bottomLeft.ownsTarget(p)?this.bottomLeft:this.bottomCenter.ownsTarget(p)?this.bottomCenter:this.bottomRight.ownsTarget(p)?this.bottomRight:void 0},k}(),Bt=function(){function k(){this.GRIP_SIZE=10,this.visual=q.createGroup(),this.visual.appendChild(q.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(q.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return k.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},k}(),Nt=function(){function k(){}return k.toITransformMatrix=function(p){return{a:p.a,b:p.b,c:p.c,d:p.d,e:p.e,f:p.f}},k.toSVGMatrix=function(p,C){return p.a=C.a,p.b=C.b,p.c=C.c,p.d=C.d,p.e=C.e,p.f=C.f,p},k}(),Wt=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.left=0,U.top=0,U.width=0,U.height=0,U.defaultSize={x:50,y:20},U.offsetX=0,U.offsetY=0,U.rotationAngle=0,U.CB_DISTANCE=10,U._suppressMarkerCreateEvent=!1,U.container.transform.baseVal.appendItem(q.createTransform()),U.setupControlBox(),U}return Oe(p,k),Object.defineProperty(p.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"visual",{get:function(){return this._visual},set:function(C){this._visual=C;var N=q.createTransform();this._visual.transform.baseVal.appendItem(N)},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(C){return!!k.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var V=this.unrotatePoint(C);if(this.manipulationStartX=V.x,this.manipulationStartY=V.y,this.offsetX=V.x-this.left,this.offsetY=V.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(N),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N)){this.activeGrip=this.rotatorGrip;var U=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=U.x-this.width/2,this.top=U.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var de=this.container.transform.baseVal.getItem(0);de.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(de,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},p.prototype.pointerUp=function(C){var N=this.state;k.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",N==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},p.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},p.prototype.manipulate=function(C){var N=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(N.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(N.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(N):this.state==="rotate"&&this.rotate(C)},p.prototype.resize=function(C){var N=this.manipulationStartLeft,V=this.manipulationStartWidth,U=this.manipulationStartTop,de=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:N=this.manipulationStartLeft+C.x-this.manipulationStartX,V=this.manipulationStartWidth+this.manipulationStartLeft-N;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:V=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+C.y-this.manipulationStartY,de=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:de=this.manipulationStartHeight+C.y-this.manipulationStartY}V>=0?(this.left=N,this.width=V):(this.left=N+V,this.width=-V),de>=0?(this.top=U,this.height=de):(this.top=U+de,this.height=-de),this.setSize()},p.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},p.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var N=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*N,this.applyRotation()}},p.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},p.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var N=this.container.getCTM(),V=q.createPoint(C.x,C.y);return{x:(V=V.matrixTransform(N)).x,y:V.y}},p.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var N=this.container.getCTM();N=N.inverse();var V=q.createPoint(C.x,C.y);return{x:(V=V.matrixTransform(N)).x,y:V.y}},p.prototype.select=function(){k.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){k.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=q.createGroup();var C=q.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=q.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=q.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 lt,this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},p.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},p.prototype.createGrip=function(){var C=new Bt;return C.visual.transform.baseVal.appendItem(q.createTransform()),this.controlBox.appendChild(C.visual),C},p.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,N=-C/2,V=N,U=(this.width+this.CB_DISTANCE)/2-C/2,de=(this.height+this.CB_DISTANCE)/2-C/2,ze=this.height+this.CB_DISTANCE-C/2,_t=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,N,V),this.positionGrip(this.controlGrips.topCenter.visual,U,V),this.positionGrip(this.controlGrips.topRight.visual,_t,V),this.positionGrip(this.controlGrips.centerLeft.visual,N,de),this.positionGrip(this.controlGrips.centerRight.visual,_t,de),this.positionGrip(this.controlGrips.bottomLeft.visual,N,ze),this.positionGrip(this.controlGrips.bottomCenter.visual,U,ze),this.positionGrip(this.controlGrips.bottomRight.visual,_t,ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,V-3*this.CB_DISTANCE)},p.prototype.positionGrip=function(C,N,V){var U=C.transform.baseVal.getItem(0);U.setTranslate(N,V),C.transform.baseVal.replaceItem(U,0)},p.prototype.hideControlBox=function(){this.controlBox.style.display="none"},p.prototype.showControlBox=function(){this.controlBox.style.display=""},p.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Nt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Nt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},k.prototype.getState.call(this))},p.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var N=C;this.left=N.left,this.top=N.top,this.width=N.width,this.height=N.height,this.rotationAngle=N.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Nt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,N.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Nt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,N.containerTransformMatrix))},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N);var V=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:V.x*C,y:V.y*N});this.left=U.x,this.top=U.y,this.width=this.width*C,this.height=this.height*N,this.adjustControlBox()},p}(mt),Lt=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.createVisual=U.createVisual.bind(U),U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual)},p.prototype.createVisual=function(){this.visual=q.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},p.prototype.manipulate=function(C){k.prototype.manipulate.call(this,C)},p.prototype.resize=function(C){k.prototype.resize.call(this,C),this.setSize()},p.prototype.setSize=function(){k.prototype.setSize.call(this),q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(C){k.prototype.pointerUp.call(this,C),this.setSize()},p.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},p.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&q.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},p.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},k.prototype.getState.call(this))},p.prototype.restoreState=function(C){var N=C;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),k.prototype.restoreState.call(this,C),this.setSize()},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N),this.setSize()},p.title="Rectangle marker",p}(Wt),Gt=function(k){function p(C,N,V,U){var de=k.call(this,C,U||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return de.widths=[],de.widthBoxes=[],de.widths=N,de.currentWidth=V,de.setCurrentWidth=de.setCurrentWidth.bind(de),de}return Oe(p,k),p.prototype.getUi=function(){var C=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.widths.forEach(function(V){var U=document.createElement("div");U.style.display="flex",U.style.flexGrow="2",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=V===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){C.setCurrentWidth(V,U)}),N.appendChild(U);var de=document.createElement("div");de.innerText=V.toString(),de.style.marginRight="5px",U.appendChild(de);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.display="flex",ze.style.alignItems="center";var _t=document.createElement("hr");_t.style.minWidth="20px",_t.style.border="0px",_t.style.borderTop=V+"px solid "+C.uiStyleSettings.toolboxColor,_t.style.flexGrow="2",ze.appendChild(_t),U.appendChild(ze),C.widthBoxes.push(U)}),N},p.prototype.setCurrentWidth=function(C,N){var V=this;this.currentWidth=C,this.widthBoxes.forEach(function(U){U.style.borderColor=U===N?V.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},p}(vt),Ut=function(k){function p(C,N,V,U){var de=k.call(this,C,U||'<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 de.styles=[],de.styleBoxes=[],de.styles=N,de.currentStyle=V,de.setCurrentStyle=de.setCurrentStyle.bind(de),de}return Oe(p,k),p.prototype.getUi=function(){var C=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.styles.forEach(function(V){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/C.styles.length-5+"%",U.style.borderColor=V===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){C.setCurrentStyle(V,U)}),N.appendChild(U);var de=document.createElement("div");de.style.minHeight="20px",de.style.flexGrow="2",de.style.overflow="hidden";var ze=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+C.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(V!==""?'stroke-dasharray="'+V+'"':"")+` />
|
|
</svg>`;de.innerHTML=ze,U.appendChild(de),C.styleBoxes.push(U)}),N},p.prototype.setCurrentStyle=function(C,N){var V=this;this.currentStyle=C,this.styleBoxes.forEach(function(U){U.style.borderColor=U===N?V.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},p}(vt),Re=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.strokeColor=V.defaultColor,U.strokeWidth=V.defaultStrokeWidth,U.strokeDasharray=V.defaultStrokeDasharray,U.strokePanel=new ut("Line color",V.defaultColorSet,V.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new Gt("Line width",V.defaultStrokeWidths,V.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Ut("Line style",V.defaultStrokeDasharrays,V.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Oe(p,k),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=p.typeName,C},p.typeName="FrameMarker",p.title="Frame marker",p.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',p}(Lt),je=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},tt=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.x1=0,U.y1=0,U.x2=0,U.y2=0,U.defaultLength=50,U.manipulationStartX=0,U.manipulationStartY=0,U.manipulationStartX1=0,U.manipulationStartY1=0,U.manipulationStartX2=0,U.manipulationStartY2=0,U.setupControlBox(),U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!!k.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.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(N)?this.activeGrip=this.grip1:this.grip2.ownsTarget(N)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},p.prototype.pointerUp=function(C){var N=this.state;k.prototype.pointerUp.call(this,C),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(C),this._state="select",N==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},p.prototype.adjustVisual=function(){},p.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},p.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.y}this.adjustVisual(),this.adjustControlBox()},p.prototype.select=function(){k.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){k.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=q.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){this.positionGrips()},p.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},p.prototype.createGrip=function(){var C=new Bt;return C.visual.transform.baseVal.appendItem(q.createTransform()),this.controlBox.appendChild(C.visual),C},p.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},p.prototype.positionGrip=function(C,N,V){var U=C.transform.baseVal.getItem(0);U.setTranslate(N,V),C.transform.baseVal.replaceItem(U,0)},p.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},k.prototype.getState.call(this))},p.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var N=C;this.x1=N.x1,this.y1=N.y1,this.x2=N.x2,this.y2=N.y2},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N),this.x1=this.x1*C,this.y1=this.y1*N,this.x2=this.x2*C,this.y2=this.y2*N,this.adjustVisual(),this.adjustControlBox()},p}(mt),dt=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.strokeColor=V.defaultColor,U.strokeWidth=V.defaultStrokeWidth,U.strokeDasharray=V.defaultStrokeDasharray,U.strokePanel=new ut("Line color",V.defaultColorSet,V.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new Gt("Line width",V.defaultStrokeWidths,V.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Ut("Line style",V.defaultStrokeDasharrays,V.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.selectorLine=q.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=q.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},p.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),q.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),q.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),q.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},p.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},p.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var N=C;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.createVisual(),this.adjustVisual()},p.typeName="LineMarker",p.title="Line marker",p.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',p}(tt),ke=function(k){function p(C,N,V,U){var de=k.call(this,C,U||'<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 de.fonts=[],de.fontBoxes=[],de.fonts=N,de.currentFont=V,de.setCurrentFont=de.setCurrentFont.bind(de),de}return Oe(p,k),p.prototype.getUi=function(){var C=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.flexGrow="2",this.fonts.forEach(function(V){var U=document.createElement("div");U.style.display="inline-block",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/C.fonts.length-5+"%",U.style.borderColor=V===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){C.setCurrentFont(V,U)}),N.appendChild(U);var de=document.createElement("div");de.style.display="flex",de.style.minHeight="20px",de.style.flexGrow="2",de.style.fontFamily=V,de.style.overflow="hidden";var ze=document.createElement("div");ze.style.whiteSpace="nowrap",ze.style.overflow="hidden",ze.style.textOverflow="ellipsis",ze.innerHTML="The quick brown fox jumps over the lazy dog",de.appendChild(ze),U.appendChild(de),C.fontBoxes.push(U)}),N},p.prototype.setCurrentFont=function(C,N){var V=this;this.currentFont=C,this.fontBoxes.forEach(function(U){U.style.borderColor=U===N?V.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},p}(vt),ot=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.color="transparent",U.padding=5,U.DEFAULT_TEXT="your text here",U.text=U.DEFAULT_TEXT,U.isMoved=!1,U.color=V.defaultColor,U.fontFamily=V.defaultFontFamily,U.defaultSize={x:100,y:30},U.setColor=U.setColor.bind(U),U.setFont=U.setFont.bind(U),U.renderText=U.renderText.bind(U),U.sizeText=U.sizeText.bind(U),U.textEditDivClicked=U.textEditDivClicked.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.setSize=U.setSize.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.colorPanel=new ut("Color",V.defaultColorSet,V.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.fontFamilyPanel=new ke("Font",V.defaultFontFamilies,V.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U}return Oe(p,k),p.prototype.ownsTarget=function(C){if(k.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var N=!1;return this.textElement.childNodes.forEach(function(V){V===C&&(N=!0)}),N},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.bgRectangle=q.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=q.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(q.createTransform()),this.textElement.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},p.prototype.renderText=function(){var C=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(N){C.textElement.appendChild(q.createTSpan(N.trim()===""?" ":N.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},p.prototype.getTextScale=function(){var C=this.textElement.getBBox(),N=1;if(C.width>0&&C.height>0){var V=(1*this.width-this.width*this.padding*2/100)/C.width,U=(1*this.height-this.height*this.padding*2/100)/C.height;N=Math.min(V,U)}return N},p.prototype.getTextPosition=function(C){var N=this.textElement.getBBox(),V=0,U=0;return N.width>0&&N.height>0&&(V=(this.width-N.width*C)/2,U=this.height/2-N.height*C/2),{x:V,y:U}},p.prototype.sizeText=function(){var C=this.textElement.getBBox(),N=this.getTextScale(),V=this.getTextPosition(N);V.y-=C.y*N,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+V.x+"px, "+V.y+"px) scale("+N+", "+N+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(V.x,V.y),this.textElement.transform.baseVal.getItem(1).setScale(N,N))},p.prototype.manipulate=function(C){k.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},p.prototype.resize=function(C){k.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},p.prototype.setSize=function(){k.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},p.prototype.pointerUp=function(C){var N=this.state;N==="creating"&&(this._suppressMarkerCreateEvent=!0),k.prototype.pointerUp.call(this,C),this.setSize(),(N==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},p.prototype.showTextEditor=function(){var C=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(N){N.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var N=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&N>.9;)N-=.1,C.textEditor.style.fontSize=Math.max(N,.9)+"em"}),this.textEditor.addEventListener("keyup",function(N){N.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(N){if(N.clipboardData){var V=N.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(V)),N.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},p.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var C=this.getTextScale(),N=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),V=this.textElement.getBBox(),U={x:V.width*C,y:V.height*C};N.x-=U.x/2,N.y-=U.y/2,this.textEditor.style.top=N.y+"px",this.textEditor.style.left=N.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-N.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},p.prototype.textEditDivClicked=function(C){this.text=C.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},p.prototype.select=function(){k.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},p.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),k.prototype.deselect.call(this)},p.prototype.dblClick=function(C,N){k.prototype.dblClick.call(this,C,N),this.showTextEditor()},p.prototype.setColor=function(C){this.textElement&&q.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},p.prototype.setFont=function(C){this.textElement&&q.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},p.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},p.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){var N=C;this.color=N.color,this.fontFamily=N.fontFamily,this.padding=N.padding,this.text=N.text,this.createVisual(),k.prototype.restoreState.call(this,C),this.setSize()},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N),this.setSize(),this.sizeText(),this.positionTextEditor()},p.typeName="TextMarker",p.title="Text marker",p.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>',p}(Wt),ve=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=V.defaultColor,U.lineWidth=V.defaultStrokeWidth,U.pixelRatio=V.freehandPixelRatio,U.setColor=U.setColor.bind(U),U.addCanvas=U.addCanvas.bind(U),U.finishCreation=U.finishCreation.bind(U),U.setLineWidth=U.setLineWidth.bind(U),U.colorPanel=new ut("Color",V.defaultColorSet,V.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new Gt("Line width",V.defaultStrokeWidths,V.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.drawingImage=q.createImage(),this.visual.appendChild(this.drawingImage);var C=q.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(C,N){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(C.x,C.y),this.drawing=!0):k.prototype.pointerDown.call(this,C,N)},p.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):k.prototype.manipulate.call(this,C)},p.prototype.resize=function(C){k.prototype.resize.call(this,C),q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):k.prototype.pointerUp.call(this,C)},p.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},p.prototype.select=function(){this.state==="creating"&&this.finishCreation(),k.prototype.select.call(this)},p.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),k.prototype.deselect.call(this)},p.prototype.finishCreation=function(){for(var C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),N=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],V=N[0],U=N[1],de=N[2],ze=N[3],_t=!1,Mt=0;Mt<this.canvasElement.height;Mt++)for(var ct=0;ct<this.canvasElement.width;ct++)C.data[Mt*this.canvasElement.width*4+4*ct+3]>0&&(_t=!0,Mt<U&&(U=Mt),ct<V&&(V=ct),Mt>ze&&(ze=Mt),ct>de&&(de=ct));if(_t){this.left=V/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(de-V)/this.pixelRatio,this.height=(ze-U)/this.pixelRatio;var Vt=document.createElement("canvas");Vt.width=de-V,Vt.height=ze-U,Vt.getContext("2d").putImageData(this.canvasContext.getImageData(V,U,de-V,ze-U),0,0),this.drawingImgUrl=Vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},p.prototype.setDrawingImage=function(){q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},p.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},p.prototype.setLineWidth=function(C){this.lineWidth=C},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=Object.assign({drawingImgUrl:this.drawingImgUrl},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){this.createVisual(),k.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N),this.setDrawingImage()},p.typeName="FreehandMarker",p.title="Freehand marker",p.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>',p}(Wt),le=function(k){function p(C,N,V){var U=k.call(this,C,V||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return U.typeBoxes=[],U.currentType=N,U.setCurrentType=U.setCurrentType.bind(U),U}return Oe(p,k),p.prototype.getUi=function(){var C=this,N=document.createElement("div");N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2";for(var V=function(ze){var _t="both";switch(ze){case 0:_t="both";break;case 1:_t="start";break;case 2:_t="end";break;case 3:_t="none"}var Mt=document.createElement("div");if(Mt.style.display="flex",Mt.style.flexGrow="2",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=_t===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){C.setCurrentType(_t,Mt)}),N.appendChild(Mt),_t==="both"||_t==="start"){var ct=document.createElement("div");ct.style.display="flex",ct.style.alignItems="center",ct.style.minHeight="20px",ct.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="`+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ct.style.marginLeft="5px",Mt.appendChild(ct)}var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.style.flexGrow="2";var Et=document.createElement("hr");if(Et.style.minWidth="20px",Et.style.border="0px",Et.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Et.style.flexGrow="2",Vt.appendChild(Et),Mt.appendChild(Vt),_t==="both"||_t==="end"){var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.alignItems="center",Yt.style.minHeight="20px",Yt.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="`+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Yt.style.marginRight="5px",Mt.appendChild(Yt)}U.typeBoxes.push(Mt)},U=this,de=0;de<4;de++)V(de);return N},p.prototype.setCurrentType=function(C,N){var V=this;this.currentType=C,this.typeBoxes.forEach(function(U){U.style.borderColor=U===N?V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},p}(vt),ue=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.arrowType="end",U.arrowBaseHeight=10,U.arrowBaseWidth=10,U.getArrowPoints=U.getArrowPoints.bind(U),U.setArrowType=U.setArrowType.bind(U),U.arrowTypePanel=new le("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},p.prototype.getArrowPoints=function(C,N){var V=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return C-V/2+","+(N+U/2)+" "+C+","+(N-U/2)+" "+(C+V/2)+","+(N+U/2)},p.prototype.createTips=function(){this.arrow1=q.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=q.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.arrow2)},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(k.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",q.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),q.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.arrow1.transform.baseVal.getItem(0);N.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(N,0);var V=this.arrow2.transform.baseVal.getItem(0);V.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(V,0)}},p.prototype.setArrowType=function(C){this.arrowType=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=Object.assign({arrowType:this.arrowType},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var N=C;this.arrowType=N.arrowType,this.createTips(),this.adjustVisual()},p.typeName="ArrowMarker",p.title="Arrow marker",p.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',p}(dt),$=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.fillColor=V.defaultFillColor,U.strokeWidth=0,U.fillPanel=new ut("Color",V.defaultColorSet,V.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Oe(p,k),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=p.typeName,C},p.typeName="CoverMarker",p.title="Cover marker",p.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',p}(Lt),Q=function(k){function p(C,N,V,U){var de=k.call(this,C,U||'<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 de.opacities=[],de.opacityBoxes=[],de.opacities=N,de.currentOpacity=V,de.setCurrentOpacity=de.setCurrentOpacity.bind(de),de}return Oe(p,k),p.prototype.getUi=function(){var C=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",N.style.justifyContent="space-between",this.opacities.forEach(function(V){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=V===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){C.setCurrentOpacity(V,U)}),N.appendChild(U);var de=document.createElement("div");de.innerText=100*V+"%",U.appendChild(de),C.opacityBoxes.push(U)}),N},p.prototype.setCurrentOpacity=function(C,N){var V=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===N?V.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},p}(vt),re=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=V.defaultHighlightColor,U.strokeWidth=0,U.opacity=V.defaultHighlightOpacity,U.fillPanel=new ut("Color",V.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new Q("Opacity",V.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Oe(p,k),p.prototype.setOpacity=function(C){this.opacity=C,this.visual&&q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=p.typeName,C},p.typeName="HighlightMarker",p.title="Highlight marker",p.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>',p}($),fe='<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>',Pe=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.bgColor="transparent",U.tipPosition={x:0,y:0},U.tipBase1Position={x:0,y:0},U.tipBase2Position={x:0,y:0},U.tipMoving=!1,U.color=V.defaultStrokeColor,U.bgColor=V.defaultFillColor,U.fontFamily=V.defaultFontFamily,U.defaultSize={x:100,y:30},U.setBgColor=U.setBgColor.bind(U),U.getTipPoints=U.getTipPoints.bind(U),U.positionTip=U.positionTip.bind(U),U.setTipPoints=U.setTipPoints.bind(U),U.colorPanel=new ut("Text color",V.defaultColorSet,U.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>'),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new ut("Fill color",V.defaultColorSet,U.bgColor,fe),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new ke("Font",V.defaultFontFamilies,V.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new Bt,U.tipGrip.visual.transform.baseVal.appendItem(q.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Oe(p,k),p.prototype.ownsTarget=function(C){return k.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},p.prototype.createTip=function(){q.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=q.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},p.prototype.pointerDown=function(C,N){this.state==="new"&&k.prototype.pointerDown.call(this,C,N),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(N)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):k.prototype.pointerDown.call(this,C,N)},p.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,k.prototype.pointerUp.call(this,C);else{var N=this.state==="creating";k.prototype.pointerUp.call(this,C),this.setTipPoints(N),this.positionTip()}},p.prototype.manipulate=function(C){if(this.tipMoving){var N=this.unrotatePoint(C);this.tipPosition={x:N.x-this.manipulationStartLeft,y:N.y-this.manipulationStartTop},this.positionTip()}else k.prototype.manipulate.call(this,C)},p.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(q.setAttributes(this.bgRectangle,[["fill",C]]),q.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},p.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},p.prototype.setTipPoints=function(C){C===void 0&&(C=!1);var N=Math.min(this.height/2,15),V=this.height/5;C&&(this.tipPosition={x:N+V/2,y:this.height+20});var U=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?U<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(V=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:N,y:0},this.tipBase2Position={x:N+V,y:0}):(this.tipBase1Position={x:0,y:N},this.tipBase2Position={x:0,y:N+V}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?U<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(V=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-N-V,y:0},this.tipBase2Position={x:this.width-N,y:0}):(this.tipBase1Position={x:this.width,y:N},this.tipBase2Position={x:this.width,y:N+V}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?U<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(V=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-N-V,y:this.height},this.tipBase2Position={x:this.width-N,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-N-V},this.tipBase2Position={x:this.width,y:this.height-N}):U<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(V=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:N,y:this.height},this.tipBase2Position={x:N+V,y:this.height}):(this.tipBase1Position={x:0,y:this.height-N},this.tipBase2Position={x:0,y:this.height-N-V})},p.prototype.resize=function(C){k.prototype.resize.call(this,C),this.positionTip()},p.prototype.positionTip=function(){q.setAttributes(this.tip,[["points",this.getTipPoints()]]);var C=this.tipGrip.visual.transform.baseVal.getItem(0);C.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(C,0)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.select=function(){this.positionTip(),k.prototype.select.call(this)},p.prototype.getState=function(){var C=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){var N=C;this.bgColor=N.bgColor,this.tipPosition=N.tipPosition,k.prototype.restoreState.call(this,C),this.createTip(),this.setTipPoints()},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N),this.tipPosition={x:this.tipPosition.x*C,y:this.tipPosition.y*N},this.positionTip()},p.typeName="CalloutMarker",p.title="Callout marker",p.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>',p}(ot),Ge=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=V.defaultColor,U.strokeWidth=V.defaultStrokeWidth,U.strokeDasharray=V.defaultStrokeDasharray,U.fillColor=V.defaultFillColor,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.setOpacity=U.setOpacity.bind(U),U.createVisual=U.createVisual.bind(U),U.strokePanel=new ut("Line color",Ee(V.defaultColorSet,["transparent"]),V.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new ut("Fill color",Ee(V.defaultColorSet,["transparent"]),U.fillColor,fe),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new Gt("Line width",V.defaultStrokeWidths,V.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Ut("Line style",V.defaultStrokeDasharrays,V.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new Q("Opacity",V.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual)},p.prototype.createVisual=function(){this.visual=q.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)},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},p.prototype.manipulate=function(C){k.prototype.manipulate.call(this,C)},p.prototype.resize=function(C){k.prototype.resize.call(this,C),this.setSize()},p.prototype.setSize=function(){k.prototype.setSize.call(this),q.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},p.prototype.pointerUp=function(C){k.prototype.pointerUp.call(this,C),this.setSize()},p.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},p.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&q.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},p.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.setOpacity=function(C){this.opacity=C,this.visual&&q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){var N=C;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),k.prototype.restoreState.call(this,C),this.setSize()},p.prototype.scale=function(C,N){k.prototype.scale.call(this,C,N),this.setSize()},p.typeName="EllipseMarker",p.title="Ellipse marker",p.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>',p}(Wt),bt=function(k){function p(C,N,V){return k.call(this,C,N,V)||this}return Oe(p,k),Object.defineProperty(p.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},p.prototype.createTips=function(){this.tip1=q.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(q.createTransform()),this.visual.appendChild(this.tip1),this.tip2=q.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(q.createTransform()),this.visual.appendChild(this.tip2)},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(k.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(q.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()]]),q.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 C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.tip1.transform.baseVal.getItem(0);N.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(N,0);var V=this.tip2.transform.baseVal.getItem(0);V.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(V,0)}},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},p.typeName="MeasurementMarker",p.title="Measurement marker",p.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>',p}(dt),Ft=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.strokePanel.colors=V.defaultColorSet,U.fillColor="transparent",U}return Oe(p,k),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=p.typeName,C},p.typeName="EllipseFrameMarker",p.title="Ellipse frame marker",p.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>',p}(Ge),Xt=function(){function k(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(k.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),k.prototype.addUndoStep=function(p){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(p)||(this.undoStack.push(p),JSON.stringify(this.lastRedoStep)!==JSON.stringify(p)&&this.redoStack.splice(0,this.redoStack.length))},k.prototype.replaceLastUndoStep=function(p){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=p)},k.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},k.prototype.undo=function(){if(this.undoStack.length>1){var p=this.undoStack.pop();return p!==void 0&&this.redoStack.push(p),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},k.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},k}(),Pt=function(k){function p(C,N,V){var U=k.call(this,C,N,V)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.curveX=0,U.curveY=0,U.manipulationStartCurveX=0,U.manipulationStartCurveY=0,U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.positionGrips=U.positionGrips.bind(U),U.addControlGrips=U.addControlGrips.bind(U),U.adjustVisual=U.adjustVisual.bind(U),U.setupControlBox=U.setupControlBox.bind(U),U.resize=U.resize.bind(U),U.strokeColor=V.defaultColor,U.strokeWidth=V.defaultStrokeWidth,U.strokeDasharray=V.defaultStrokeDasharray,U.strokePanel=new ut("Line color",V.defaultColorSet,V.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new Gt("Line width",V.defaultStrokeWidths,V.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Ut("Line style",V.defaultStrokeDasharrays,V.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Oe(p,k),p.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},p.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.selectorCurve=q.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=q.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(C,N){k.prototype.pointerDown.call(this,C,N),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(N)&&(this.activeGrip=this.curveGrip,this._state="resize")},p.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),q.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),q.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),q.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setupControlBox=function(){k.prototype.setupControlBox.call(this),this.curveControlLine1=q.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=q.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},p.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,k.prototype.addControlGrips.call(this)},p.prototype.positionGrips=function(){k.prototype.positionGrips.call(this);var C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},p.prototype.manipulate=function(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),k.prototype.manipulate.call(this,C)},p.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),k.prototype.resize.call(this,C),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},p.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},p.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},p.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},p.prototype.scale=function(C,N){this.curveX=this.curveX*C,this.curveY=this.curveY*N,k.prototype.scale.call(this,C,N)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},k.prototype.getState.call(this));return C.typeName=p.typeName,C},p.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var N=C;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.curveX=N.curveX,this.curveY=N.curveY,this.createVisual(),this.adjustVisual()},p.typeName="CurveMarker",p.title="Curve marker",p.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>',p}(tt),St=function(){function k(p,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=p,this.cancelable=C}return Object.defineProperty(k.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),k.prototype.preventDefault=function(){this._defaultPrevented=!0},k}(),Ze=function(k){function p(C,N,V){var U=k.call(this,C,!1)||this;return U.dataUrl=N,U.state=V,U}return Oe(p,k),p}(St),qe=function(k){function p(C,N,V){V===void 0&&(V=!1);var U=k.call(this,C,V)||this;return U.marker=N,U}return Oe(p,k),p}(St),Me=function(){function k(){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 k.prototype.addEventListener=function(p,C){this[p].push(C)},k.prototype.removeEventListener=function(p,C){var N=this[p].indexOf(C);N>-1&&this[p].splice(N,1)},k}(),ne=function(){function k(p){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new je,this._isOpen=!1,this.undoRedoManager=new Xt,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 Me,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=k.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=p,this.targetRoot=document.body,this.width=p.clientWidth,this.height=p.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(k.prototype,"ALL_MARKER_TYPES",{get:function(){return[Re,ve,ue,ot,Ft,Ge,re,Pe,bt,$,dt,Pt]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Re,ve,ue,ot,Ge,re,Pe]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Re,ve,ue,ot,re]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(p){var C=this;this._availableMarkerTypes.splice(0),p.forEach(function(N){if(typeof N=="string"){var V=C.ALL_MARKER_TYPES.find(function(U){return U.typeName===N});V!==void 0&&C._availableMarkerTypes.push(V)}else C._availableMarkerTypes.push(N)})},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(p){this._zoomLevel=p,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),k.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),J.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},k.prototype.show=function(){var p=this;this.styles.styleSheetRoot===void 0&&ee.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ee.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(C){return C(new St(p))})},k.prototype.render=function(){return Ne(this,void 0,void 0,function(){var p;return Ue(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(p=new pe).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.markersOnly=this.renderMarkersOnly,p.width=this.renderWidth,p.height=this.renderHeight,[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return C.sent(),[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},k.prototype.close=function(p){var C=this;if(p===void 0&&(p=!1),this.isOpen){var N=!1;p||this.eventListeners.beforeclose.forEach(function(V){var U=new St(C,!0);V(U),U.defaultPrevented&&(N=!0)}),N||(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(V){return V(new St(C))}),this.detachEvents(),this._isOpen=!1)}},k.prototype.addMarkersToToolbar=function(){for(var p,C=[],N=0;N<arguments.length;N++)C[N]=arguments[N];(p=this._availableMarkerTypes).push.apply(p,C)},k.prototype.addRenderEventListener=function(p){this.addEventListener("render",function(C){p(C.dataUrl,C.state)})},k.prototype.removeRenderEventListener=function(p){},k.prototype.addCloseEventListener=function(p){this.addEventListener("close",function(){p()})},k.prototype.removeCloseEventListener=function(p){},k.prototype.setupResizeObserver=function(){var p=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return p.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},k.prototype.onPopupTargetResize=function(){var p=1*this.target.clientWidth/this.target.clientHeight,C=this.editorCanvas.clientWidth/p>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*p:this.editorCanvas.clientWidth,N=C<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/p;this.resize(C,N)},k.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},k.prototype.resize=function(p,C){this._isResizing=!0;var N=p/this.imageWidth,V=C/this.imageHeight;this.imageWidth=Math.round(p),this.imageHeight=Math.round(C),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(N,V),this._isResizing=!1},k.prototype.scaleMarkers=function(p,C){var N,V=this;this._currentMarker&&this._currentMarker instanceof ot?this._currentMarker.scale(p,C):(N=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(U){U!==V._currentMarker&&U.scale(p,C)}),N!==void 0&&this.setCurrentMarker(N)},k.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"},k.prototype.setTopLeft=function(){var p=this.editingTarget.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=p.left-C.left,this.top=p.top-C.top},k.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)},k.prototype.addDefs=function(){for(var p,C=[],N=0;N<arguments.length;N++)C[N]=arguments[N];this.defs=q.createDefs(),this.addDefsToImage(),(p=this.defs).append.apply(p,C)},k.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},k.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)},k.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},k.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},k.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)},k.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},k.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)},k.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 p=document.createElement("a");p.href="https://markerjs.com/",p.target="_blank",p.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>',p.title="Powered by marker.js",p.style.display="grid",p.style.alignItems="center",p.style.justifyItems="center",p.style.padding="3px",p.style.width="20px",p.style.height="20px",this.logoUI.appendChild(p),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},k.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")},k.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"},k.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},k.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ye(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 it(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},k.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},k.prototype.removeMarker=function(p){this.markerImage.removeChild(p.container),this.markers.indexOf(p)>-1&&this.markers.splice(this.markers.indexOf(p),1),p.dispose()},k.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())},k.prototype.toolbarButtonClicked=function(p,C){if(p==="marker"&&C!==void 0)this.createNewMarker(C);else if(p==="action")switch(C){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()}},k.prototype.deleteSelectedMarker=function(){var p=this;if(this._currentMarker!==void 0){var C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(V){var U=new qe(p,p._currentMarker,!0);V(U),U.defaultPrevented&&(C=!0)}),!C){var N=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(V){return V(new qe(p,N))})}}},k.prototype.clear=function(){var p=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(de){var ze=new qe(p,void 0,!0);de(ze),ze.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var N=function(de){var ze=V.markers[de];V.setCurrentMarker(V.markers[de]),V._currentMarker.dispose(),V.markerImage.removeChild(V._currentMarker.container),V.markers.splice(V.markers.indexOf(V._currentMarker),1),V.eventListeners.markerdelete.forEach(function(_t){return _t(new qe(p,ze))})},V=this,U=this.markers.length-1;U>=0;U--)N(U);this.addUndoStep()}},Object.defineProperty(k.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),k.prototype.showNotesEditor=function(){var p;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(p=this._currentMarker.notes)!==null&&p!==void 0?p:"",this.overlayContainer.appendChild(this.notesArea))},k.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)},k.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},k.prototype.addUndoStep=function(){var p=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var C=this.getState(),N=this.undoRedoManager.getLastUndoStep();if(!N||N.width===C.width&&N.height===C.height){var V=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),V<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(U){return U(new St(p))})}else this.undoRedoManager.replaceLastUndoStep(C),this.eventListeners.statechange.forEach(function(U){return U(new St(p))})}},k.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},k.prototype.undoStep=function(){var p=this,C=this.undoRedoManager.undo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(N){return N(new St(p))}))},k.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},k.prototype.redoStep=function(){var p=this,C=this.undoRedoManager.redo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(N){return N(new St(p))}))},k.prototype.stepZoom=function(){var p=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=p<this.zoomSteps.length-1?this.zoomSteps[p+1]:this.zoomSteps[0]},k.prototype.panTo=function(p){this.contentDiv.scrollBy({left:this.prevPanPoint.x-p.x,top:this.prevPanPoint.y-p.y}),this.prevPanPoint=p},k.prototype.startRenderAndClose=function(){return Ne(this,void 0,void 0,function(){var p,C,N=this;return Ue(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return p=V.sent(),C=this.getState(),this.eventListeners.render.forEach(function(U){return U(new Ze(N,p,C))}),this.close(!0),[2]}})})},k.prototype.getState=function(p){p===!0&&this.setCurrentMarker();var C={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(N){return C.markers.push(N.getState())}),C},k.prototype.restoreState=function(p){var C=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);p.markers.forEach(function(N){var V=C._availableMarkerTypes.find(function(de){return de.typeName===N.typeName});if(V!==void 0){var U=C.addNewMarker(V);U.restoreState(N),C.markers.push(U)}}),p.width&&p.height&&(p.width!==this.imageWidth||p.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/p.width,this.imageHeight/p.height),this.eventListeners.restorestate.forEach(function(N){return N(new St(C))})},k.prototype.addNewMarker=function(p){var C=q.createGroup();return this.markerImage.appendChild(C),new p(C,this.overlayContainer,this.settings)},k.prototype.createNewMarker=function(p){var C,N=this;(C=typeof p=="string"?this._availableMarkerTypes.find(function(V){return V.typeName===p}):p)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(C),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(C.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(V){return V(new qe(N,N._currentMarker))}))},k.prototype.markerCreated=function(p){var C=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(p),this.setCurrentMarker(p),p instanceof ve&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ve):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(N){return N(new qe(C,C._currentMarker))})},k.prototype.colorChanged=function(p){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=p,this.settings.defaultStrokeColor=p)},k.prototype.fillColorChanged=function(p){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=p)},k.prototype.markerStateChanged=function(p){var C=this;this.eventListeners.markerchange.forEach(function(N){return N(new qe(C,p))})},k.prototype.setCurrentMarker=function(p){var C=this;this._currentMarker!==p&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(N){return N(new qe(C,C._currentMarker))})),this._currentMarker=p,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(N){return N(new qe(C,C._currentMarker))}))},k.prototype.onPointerDown=function(p){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||p.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var C=this.markers.find(function(N){return N.ownsTarget(p.target)});C!==void 0?(this.setCurrentMarker(C),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(p.clientX,p.clientY),p.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:p.clientX,y:p.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(p.clientX,p.clientY))},k.prototype.onDblClick=function(p){if(this._isFocused||this.focus(),this.mode==="select"){var C=this.markers.find(function(N){return N.ownsTarget(p.target)});C!==void 0&&C!==this._currentMarker&&this.setCurrentMarker(C),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(p.clientX,p.clientY),p.target):this.setCurrentMarker()}},k.prototype.onPointerMove=function(p){this.touchPoints!==1&&p.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||p.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(p.clientX,p.clientY)):this.zoomLevel>1&&this.panTo({x:p.clientX,y:p.clientY}))},k.prototype.onPointerUp=function(p){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(p.clientX,p.clientY)),this.isDragging=!1,this.addUndoStep()},k.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},k.prototype.onKeyUp=function(p){this._currentMarker===void 0||this.notesArea!==void 0||p.key!=="Delete"&&p.key!=="Backspace"||this.deleteSelectedMarker()},k.prototype.clientToLocalCoordinates=function(p,C){var N=this.markerImage.getBoundingClientRect();return{x:(p-N.left)/this.zoomLevel,y:(C-N.top)/this.zoomLevel}},k.prototype.onWindowResize=function(){this.positionUI()},k.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},k.prototype.addLicenseKey=function(p){J.addKey(p)},k.prototype.addEventListener=function(p,C){this.eventListeners.addEventListener(p,C)},k.prototype.removeEventListener=function(p,C){this.eventListeners.removeEventListener(p,C)},k.prototype.renderState=function(p){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(p),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(k.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),k.prototype.focus=function(){var p=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(C){return C(new St(p))}))},k.prototype.blur=function(){var p=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(C){return C(new St(p))}))},k.instanceCounter=0,k}();/* **********************************
|
|
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 me=function(k,p){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,N){C.__proto__=N}||function(C,N){for(var V in N)Object.prototype.hasOwnProperty.call(N,V)&&(C[V]=N[V])})(k,p)};function rt(k,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function C(){this.constructor=k}me(k,p),k.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}function Ke(k,p,C,N){return new(C||(C=Promise))(function(V,U){function de(Mt){try{_t(N.next(Mt))}catch(ct){U(ct)}}function ze(Mt){try{_t(N.throw(Mt))}catch(ct){U(ct)}}function _t(Mt){var ct;Mt.done?V(Mt.value):(ct=Mt.value,ct instanceof C?ct:new C(function(Vt){Vt(ct)})).then(de,ze)}_t((N=N.apply(k,p||[])).next())})}function xt(k,p){var C,N,V,U,de={label:0,sent:function(){if(1&V[0])throw V[1];return V[1]},trys:[],ops:[]};return U={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function ze(_t){return function(Mt){return function(ct){if(C)throw new TypeError("Generator is already executing.");for(;de;)try{if(C=1,N&&(V=2&ct[0]?N.return:ct[0]?N.throw||((V=N.return)&&V.call(N),0):N.next)&&!(V=V.call(N,ct[1])).done)return V;switch(N=0,V&&(ct=[2&ct[0],V.value]),ct[0]){case 0:case 1:V=ct;break;case 4:return de.label++,{value:ct[1],done:!1};case 5:de.label++,N=ct[1],ct=[0];continue;case 7:ct=de.ops.pop(),de.trys.pop();continue;default:if(!(V=de.trys,(V=V.length>0&&V[V.length-1])||ct[0]!==6&&ct[0]!==2)){de=0;continue}if(ct[0]===3&&(!V||ct[1]>V[0]&&ct[1]<V[3])){de.label=ct[1];break}if(ct[0]===6&&de.label<V[1]){de.label=V[1],V=ct;break}if(V&&de.label<V[2]){de.label=V[2],de.ops.push(ct);break}V[2]&&de.ops.pop(),de.trys.pop();continue}ct=p.call(k,de)}catch(Vt){ct=[6,Vt],N=0}finally{C=V=0}if(5&ct[0])throw ct[1];return{value:ct[0]?ct[1]:void 0,done:!0}}([_t,Mt])}}}var Ot=function(){function k(){}return k.addKey=function(p){k.key=p},Object.defineProperty(k,"isLicensed",{get:function(){return!!k.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(k.key)},enumerable:!1,configurable:!0}),k}(),xe=function(){function k(){}return k.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},k.setAttributes=function(p,C){for(var N=0,V=C;N<V.length;N++){var U=V[N],de=U[0],ze=U[1];p.setAttribute(de,ze)}},k.createRect=function(p,C,N){var V=document.createElementNS("http://www.w3.org/2000/svg","rect");return V.setAttribute("width",p.toString()),V.setAttribute("height",C.toString()),N&&k.setAttributes(V,N),V},k.createLine=function(p,C,N,V,U){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",p.toString()),de.setAttribute("y1",C.toString()),de.setAttribute("x2",N.toString()),de.setAttribute("y2",V.toString()),U&&k.setAttributes(de,U),de},k.createPolygon=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","polygon");return N.setAttribute("points",p),C&&k.setAttributes(N,C),N},k.createCircle=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","circle");return N.setAttribute("cx",(p/2).toString()),N.setAttribute("cy",(p/2).toString()),N.setAttribute("r",p.toString()),C&&k.setAttributes(N,C),N},k.createEllipse=function(p,C,N){var V=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return V.setAttribute("cx",(p/2).toString()),V.setAttribute("cy",(C/2).toString()),V.setAttribute("rx",(p/2).toString()),V.setAttribute("ry",(C/2).toString()),N&&k.setAttributes(V,N),V},k.createGroup=function(p){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return p&&k.setAttributes(C,p),C},k.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},k.createMarker=function(p,C,N,V,U,de,ze){var _t=document.createElementNS("http://www.w3.org/2000/svg","marker");return k.setAttributes(_t,[["id",p],["orient",C],["markerWidth",N.toString()],["markerHeight",V.toString()],["refX",U.toString()],["refY",de.toString()]]),_t.appendChild(ze),_t},k.createText=function(p){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),p&&k.setAttributes(C,p),C},k.createTSpan=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","tspan");return N.textContent=p,C&&k.setAttributes(N,C),N},k.createImage=function(p){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return p&&k.setAttributes(C,p),C},k.createPoint=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return N.x=p,N.y=C,N},k.createPath=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg","path");return N.setAttribute("d",p),C&&k.setAttributes(N,C),N},k.createElement=function(p,C){var N=document.createElementNS("http://www.w3.org/2000/svg",p);return C&&k.setAttributes(N,C),N},k.getHollowRectanglePath=function(p,C,N,V,U,de,ze,_t){return"M"+p+","+C+"V"+(C+V)+"H"+(p+N)+"V"+C+"H"+U+"V"+de+"H"+(U+ze)+"V"+(de+_t)+"H"+U+"V"+C+"Z"},k}(),Je=function(){function k(p){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+p+"_"}return Object.defineProperty(k.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(k.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(k.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),k.prototype.addClass=function(p){return this.styleSheet===void 0&&this.addStyleSheet(),p.name=""+this.classNamePrefix+p.localName,this.classes.push(p),this.styleSheet.sheet.insertRule("."+p.name+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length),p},k.prototype.addRule=function(p){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(p),this.styleSheet.sheet.insertRule(p.selector+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length)},k.prototype.addStyleSheet=function(){var p;this.styleSheet=document.createElement("style"),((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).appendChild(this.styleSheet),this.addRule(new wt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new wt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new wt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new jt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new jt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},k.prototype.removeStyleSheet=function(){var p;this.styleSheet&&(((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},k}(),wt=function(k,p){this.selector=k,this.style=p},jt=function(k,p){this.localName=k,this.style=p},Qt=function(){function k(){this.blocks=[],this.display=""}return k.prototype.addButtonBlock=function(p){p.className=this.blockClassName,p.buttonClassName=this.buttonClassName,p.buttonColorsClassName=this.buttonColorsClassName,p.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(p)},k.prototype.addElementBlock=function(p){p.className===void 0&&(p.className=this.blockClassName),this.blocks.push(p)},k.prototype.getUI=function(){var p=document.createElement("div");return p.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,p.style.display=this.display,this.blocks.forEach(function(C){return p.appendChild(C.getUI())}),p},k}(),Gn=function(){function k(){}return k.prototype.getUI=function(){var p=document.createElement("div");if(p.className=this.className,this.minWidth!==void 0&&(p.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":p.style.justifyContent="flex-start";break;case"center":p.style.justifyContent="center";break;case"end":p.style.justifyContent="flex-end"}return p.style.whiteSpace="nowrap",p},k}(),Vn=function(k){function p(){var C=k!==null&&k.apply(this,arguments)||this;return C.buttons=[],C}return rt(p,k),p.prototype.addButton=function(C){C.className=this.buttonClassName,C.colorsClassName=this.buttonColorsClassName,C.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(C)},p.prototype.getUI=function(){var C=k.prototype.getUI.call(this);return this.buttons.forEach(function(N){return C.appendChild(N.getUI())}),C},p}(Gn),ei=function(){function k(p,C){this._isActive=!1,this._isHidden=!1,this._icon=p,this.title=C,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(k.prototype,"icon",{get:function(){return this._icon},set:function(p){this._icon=p,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isActive",{get:function(){return this._isActive},set:function(p){this._isActive=p,this.adjustClassName()},enumerable:!1,configurable:!0}),k.prototype.getUI=function(){var p=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 p.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},k.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,"")))},k.prototype.hide=function(){this._isHidden=!0},k}(),ci=function(k){function p(){var C=k!==null&&k.apply(this,arguments)||this;return C.elements=[],C}return rt(p,k),p.prototype.addElement=function(C){this.elements.push(C)},p.prototype.getUI=function(){var C=k.prototype.getUI.call(this);return this.elements.forEach(function(N){return C.appendChild(N)}),C},p}(Gn),ni=function(){function k(p,C){this.horizontal=p,this.vertical=C}return Object.defineProperty(k.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),k.prototype.getVerticalLength=function(p){return p/this.ratio},k.prototype.getHorizontalLength=function(p){return p*this.ratio},k}(),_i=function(){function k(){}return k.getIcon=function(p,C){if(p>0&&C>0){var N=new ni(p,C),V=N.ratio>=1?20:N.getHorizontalLength(20),U=N.ratio<1?20:N.getVerticalLength(20),de=document.createElementNS("http://www.w3.org/2000/svg","svg");de.setAttribute("xmlns","http://www.w3.org/2000/svg"),de.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(de);var ze=xe.createDefs();de.appendChild(ze);var _t=xe.createElement("clipPath",[["id","text-bg-clip"]]);ze.appendChild(_t);var Mt=xe.createPath(xe.getHollowRectanglePath((24-V)/2,(24-U)/2,V,U,(24-V)/2+2,(24-U)/2+2,V-4,U-4));de.appendChild(Mt);var ct=xe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ct.appendChild(xe.createTSpan(p+":"+C)),de.appendChild(ct);var Vt=ct.getBBox();xe.setAttributes(ct,[["x",((24-Vt.width)/2).toString()],["y",((24-Vt.height)/2-Vt.y).toString()]]);var Et=xe.createPath(xe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Vt.width))/2,(24-Math.ceil(Vt.height))/2,Math.ceil(Vt.width),Math.ceil(Vt.height)));return _t.appendChild(Et),xe.setAttributes(Mt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(de),de.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>'},k}(),di=function(k){function p(C,N,V){var U=k.call(this,C,N)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=V,U}return rt(p,k),p.prototype.setupDropdown=function(){var C=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(N){N.className=C.className,N.colorsClassName=C.colorsClassName,C.dropdownBlock.appendChild(N.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},p.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},p.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},p.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},p.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},p.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},p}(ei),rn=function(){function k(p,C){this.GRIP_SIZE=10,this.color=p,this.fillColor=C,this.visual=xe.createGroup(),this.visual.appendChild(xe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(xe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return k.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},k.prototype.setCenter=function(p,C){this.visual.childNodes.forEach(function(N){return xe.setAttributes(N,[["cx",p.toString()],["cy",C.toString()]])})},k}(),Dt=function(){function k(p,C,N,V){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=p,this.canvasHeight=C,this.margin=N,this.container=V,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(k.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(p){this._aspectRatio=p,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.gridContainer&&xe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(p){this._zoomFactor=p,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),k.prototype.open=function(){var p=this;this.cropShadeElement=xe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=xe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var C=0;C<this.numberOfGridLines;C++)this.horizontalGridLines.push(xe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(xe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(N){return p.gridContainer.appendChild(N)}),this.verticalGridLines.forEach(function(N){return p.gridContainer.appendChild(N)}),this.cropRectElement=xe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new rn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new rn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new rn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new rn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},k.prototype.setCropRectangle=function(p){this.cropRect=p;var C=Object.assign({},this.cropRect);this.zoomFactor!==1&&(C.width=this.cropRect.width*this.zoomFactor,C.height=this.cropRect.height*this.zoomFactor,C.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-C.width/2,C.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-C.height/2),xe.setAttributes(this.cropRectElement,[["x",C.x.toString()],["y",C.y.toString()],["width",C.width.toString()],["height",C.height.toString()]]);var N=C.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,de){var ze=C.y+N*(de+1);xe.setAttributes(U,[["x1",""+C.x],["y1",""+ze],["x2",""+(C.x+C.width)],["y2",""+ze]])});var V=C.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,de){var ze=C.x+V*(de+1);xe.setAttributes(U,[["x1",""+ze],["y1",""+C.y],["x2",""+ze],["y2",""+(C.y+C.height)]])}),xe.setAttributes(this.cropShadeElement,[["d",xe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,C.x,C.y,C.width,C.height)]]),this.topLeftGrip.setCenter(C.x,C.y),this.topRightGrip.setCenter(C.x+C.width,C.y),this.bottomLeftGrip.setCenter(C.x,C.y+C.height),this.bottomRightGrip.setCenter(C.x+C.width,C.y+C.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},k.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)},k.prototype.clientToLocalCoordinates=function(p,C){var N=this.container.getBoundingClientRect();return{x:p-N.left+this.margin,y:C-N.top+this.margin}},k.prototype.onPointerDown=function(p){this.container.setPointerCapture(p.pointerId),this.previousPoint=this.clientToLocalCoordinates(p.clientX,p.clientY),this.cropRectElement===p.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(p.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(p.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(p.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(p.target)&&(this.activeGrip=this.bottomRightGrip)},k.prototype.onPointerMove=function(p){if(this.isMoving)this.move(this.clientToLocalCoordinates(p.clientX,p.clientY));else if(this.activeGrip){var C=this.clientToLocalCoordinates(p.clientX,p.clientY);this.resize(C)}p.preventDefault()},k.prototype.onPointerUp=function(p){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(p.pointerId)},k.prototype.move=function(p){var C=p.x-this.previousPoint.x,N=p.y-this.previousPoint.y;this.zoomFactor!==1&&(C=-C/this.zoomFactor,N=-N/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+C),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+N),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=p},k.prototype.resize=function(p){var C=Object.assign({},this.cropRect),N=p.x-this.previousPoint.x,V=p.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:C.x+N<this.margin&&(N=this.margin-C.x),C.x+=N,C.width=this.cropRect.x+this.cropRect.width-C.x;break;case this.bottomRightGrip:case this.topRightGrip:C.width+N>this.canvasWidth*this.zoomFactor&&(N=this.canvasWidth*this.zoomFactor-C.width),C.width+=N}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(C.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(N),C.height=this.aspectRatio.getVerticalLength(C.width)):(C.y+=V,C.height=this.cropRect.y+this.cropRect.height-C.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?C.height=this.aspectRatio.getVerticalLength(C.width):C.height+=V}C.width<10&&(C.x=this.cropRect.x,C.width=10),C.height<10&&(C.y=this.cropRect.y,C.height=10),this.previousPoint=p,C.x>=this.margin&&C.y>=this.margin&&C.x-this.margin+C.width<=this.canvasWidth&&C.y-this.margin+C.height<=this.canvasHeight&&(this.cropRect=C,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},k.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var p=this.cropRect.x+this.cropRect.width/2,C=this.cropRect.y+this.cropRect.height/2,N=this.aspectRatio.getHorizontalLength(this.cropRect.height),V=this.aspectRatio.getVerticalLength(this.cropRect.width);N/this.canvasWidth<V/this.canvasHeight?this.cropRect.width=N:this.cropRect.height=V,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=p-this.cropRect.width/2,this.cropRect.y=C-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)}},k.prototype.getRescaledRect=function(p,C,N,V,U,de){var ze=N/p,_t=V/C;return{x:(U.x-de)*ze+de,y:(U.y-de)*_t+de,width:U.width*ze,height:U.height*_t}},k.prototype.scaleCanvas=function(p,C){var N=this.getRescaledRect(this.canvasWidth,this.canvasHeight,p,C,this.cropRect,this.margin);this.canvasWidth=p,this.canvasHeight=C,this.onCropChange&&this.onCropChange(N),this.setCropRectangle(N)},k}(),$t=function(){function k(p){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=p,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(k.prototype,"angle",{get:function(){return this._angle},set:function(p){this._angle=p,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),k.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},k.prototype.onPointerDown=function(p){this.controlContainer.setPointerCapture(p.pointerId),this.isDragging=!0,this.previousPoint={x:p.clientX,y:p.clientY}},k.prototype.onPointerMove=function(p){this.isDragging&&(this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.previousPoint.x=p.clientX)},k.prototype.onPointerUp=function(p){this.isDragging&&this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(p.pointerId)},k.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var p=this.angleLabelText.getBBox();xe.setAttributes(this.angleLabelElement,[["x",((this.width-p.width)/2).toString()],["y",(this.height/2).toString()]])}},k.prototype.positionScaleShape=function(){if(this.scaleShape){var p=this.scaleShape.transform.baseVal.getItem(0);p.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(p,0)}},k.prototype.getVisual=function(){var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("width",this.width+"px"),p.setAttribute("height",this.height+"px"),p.setAttribute("viewBox","0 0 "+this.width+" "+this.height),p.style.flexShrink="0",document.body.appendChild(p);for(var C="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,N=1;N<=this.width/5+10;N++){var V=N%5==0?this.height/3:this.height/6;C+="h4v"+-V+"h1v"+V}C+="v1H0Z",this.scaleShape=xe.createPath(C);var U=xe.createTransform();this.scaleShape.transform.baseVal.appendItem(U),p.appendChild(this.scaleShape),this.angleLabelElement=xe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=xe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var de=xe.createTSpan("");return de.innerHTML="°",this.angleLabelElement.appendChild(de),p.appendChild(this.angleLabelElement),document.body.removeChild(p),p},k}(),cn=function(){function k(){this.naturalSize=!1,this.imageType="image/png"}return k.prototype.rasterize=function(p,C,N,V,U,de,ze){var _t=this;return new Promise(function(Mt){var ct=document.createElement("canvas");ct.width=p.width.baseVal.value-2*V,ct.height=p.height.baseVal.value-2*V;var Vt=1,Et=1;_t.naturalSize===!0?(Vt=C.naturalWidth/(p.width.baseVal.value-2*V)/de,Et=C.naturalHeight/(p.height.baseVal.value-2*V)/ze,ct.width=C.naturalWidth/de,ct.height=C.naturalHeight/ze):_t.width!==void 0&&_t.height!==void 0&&(Vt=_t.width/N.width,Et=_t.height/N.height,ct.width*=Vt,ct.height*=Et);var Yt=ct.getContext("2d");Yt.translate(ct.width/2,ct.height/2),Yt.rotate(U*Math.PI/180),Yt.scale(de,ze),Yt.translate(-ct.width/2,-ct.height/2),Yt.drawImage(C,0,0,ct.width,ct.height);var dn=document.createElement("canvas");dn.width=N.width*Vt,dn.height=N.height*Et,dn.getContext("2d").putImageData(Yt.getImageData((N.x-V)*Vt,(N.y-V)*Et,N.width*Vt,N.height*Et),0,0),Mt(dn.toDataURL(_t.imageType,_t.imageQuality))})},k}(),Sn=function(){function k(p){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=k.instanceCounter++,this.styles=new Je(this.instanceNo),this.target=p,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(k.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(p){this._zoomToCropEnabled=p,p?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"gridLines",{get:function(){return this._gridLines},set:function(p){this._gridLines=p,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(p){this._rotationAngle=p,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"aspectRatio",{get:function(){var p;return(p=this._aspectRatio)!==null&&p!==void 0?p:this.aspectRatios[0]},set:function(p){this._aspectRatio=p},enumerable:!1,configurable:!0}),k.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},k.prototype.show=function(){this.showUI(),this.open()},k.prototype.close=function(p){p===void 0&&(p=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),p||this.closeEventListeners.forEach(function(C){return C()}),this._isOpen=!1)},k.prototype.addRenderEventListener=function(p){this.renderEventListeners.push(p)},k.prototype.removeRenderEventListener=function(p){this.renderEventListeners.indexOf(p)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(p),1)},k.prototype.addCloseEventListener=function(p){this.closeEventListeners.push(p)},k.prototype.removeCloseEventListener=function(p){this.closeEventListeners.indexOf(p)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(p),1)},k.prototype.setupResizeObserver=function(){var p=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.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))},k.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var p=1*this.target.clientWidth/this.target.clientHeight,C=this.contentDiv.clientWidth/p>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*p:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,N=C+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/p;this.resize(C,N)}},k.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},k.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",xe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},k.prototype.resize=function(p,C){this.imageWidth=Math.round(p),this.imageHeight=Math.round(C),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()},k.prototype.setEditingTarget=function(){var p=document.createElement("canvas");p.width=this.target.naturalWidth,p.height=this.target.naturalHeight,p.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var C=p.toDataURL();xe.setAttributes(this.editingTarget,[["href",C]]),this.setEditingTargetSize()},k.prototype.setTopLeft=function(){var p=this.target.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=p.left-C.left-this.CANVAS_MARGIN,this.top=p.top-C.top-this.CANVAS_MARGIN},k.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=xe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=xe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=xe.createGroup(),this.editingTargetRotationScaleContainer=xe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var p=xe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(p);var C=xe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(C),this.editingTargetContainer=xe.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)},k.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},k.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=xe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Dt(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()},k.prototype.zoomToCrop=function(){if(this.cropRect){var p=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,C=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=p+"px "+C+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-p+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-C+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},k.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)},k.prototype.cropRectChanged=function(p){this.cropRect=p,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},k.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},k.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"},k.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},k.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 p=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,C=this.target.offsetTop>p+this.CANVAS_MARGIN?this.target.offsetTop-(p+this.CANVAS_MARGIN):0;this.coverDiv.style.top=C+"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},k.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},k.prototype.addTopToolbar=function(){var p=this;this.topToolbar=new Qt,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 C=new Vn;C.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(C);var N=[];this.aspectRatios.forEach(function(Et){var Yt=new ei(_i.getIcon(Et.horizontal,Et.vertical),Et.horizontal===0&&Et.vertical===0?"FREE":Et.horizontal+":"+Et.vertical);Yt.onClick=function(){return p.ratioButtonClicked(Et)},N.push(Yt)}),this.aspectRatioButton=new di(_i.getIcon(0,0),"Aspect ratio",N),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,C.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var V=new ei('<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");V.isActive=this.isGridVisible,V.onClick=function(){p.isGridVisible=!p.isGridVisible,V.isActive=p.isGridVisible},C.addButton(V);var U=new ei('<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(U.isActive=this.zoomToCropEnabled,U.onClick=function(){p.zoomToCropEnabled=!p.zoomToCropEnabled,U.isActive=p.zoomToCropEnabled},C.addButton(U),!Ot.isLicensed){var de=new ci;this.topToolbar.addElementBlock(de);var ze=document.createElement("div");ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var _t=document.createElement("a");_t.style.color="currentColor",_t.href="https://markerjs.com/products/cropro",_t.target="_blank",_t.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>',ze.appendChild(_t),de.addElement(ze)}var Mt=new Vn;Mt.minWidth=3*this.toolbarHeight+"px",Mt.contentAlign="end",this.topToolbar.addButtonBlock(Mt);var ct=new ei('<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");ct.onClick=this.startRenderAndClose,Mt.addButton(ct),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ct.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Vt=new ei('<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");Vt.onClick=this.close,Mt.addButton(Vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},k.prototype.addBottomToolbar=function(){var p=this;this.bottomToolbar=new Qt,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 C=new Vn;C.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(C);var N=new ei('<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");N.onClick=this.rotateLeftButtonClicked,C.addButton(N);var V=new ei('<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");V.onClick=this.rotateRightButtonClicked,C.addButton(V);var U=new ci;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new $t("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(Mt){p.rotateBy(Mt),p.straightener.angle=p.rotationAngle},U.addElement(this.straightener.getUI());var de=new Vn;de.minWidth=2*this.toolbarHeight+"px",de.contentAlign="end",this.bottomToolbar.addButtonBlock(de);var ze=new ei('<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");ze.onClick=this.flipHorizontallyButtonClicked,de.addButton(ze);var _t=new ei('<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");_t.onClick=this.flipVerticallyButtonClicked,de.addButton(_t)},k.prototype.ratioButtonClicked=function(p){this.aspectRatio=p,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},k.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=_i.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},k.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ni(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},k.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},k.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},k.prototype.restoreState=function(p){if(p){var C=this.cropLayer.getRescaledRect(p.width,p.height,this.imageWidth,this.imageHeight,p.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(C),this.cropRectChanged(C),this.flippedHorizontally=p.flippedHorizontally,this.flippedVertically=p.flippedVertically,this.applyFlip(),this.rotationAngle=p.rotationAngle,this.applyRotation()}},k.prototype.clientToLocalCoordinates=function(p,C){var N=this.cropImage.getBoundingClientRect();return{x:p-N.left,y:C-N.top}},k.prototype.onWindowResize=function(){this.positionUI()},k.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var p=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},k.prototype.rotateLeftButtonClicked=function(){var p=this.rotationAngle-90;this.rotationAngle%90!=0&&(p+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(p)},k.prototype.rotateRightButtonClicked=function(){var p=this.rotationAngle+90;this.rotationAngle%90!=0&&(p-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(p)},k.prototype.rotateTo=function(p){p=(p=p>180?p-360:p)<=-180?p+360:p,this.rotationAngle=p,this.applyRotation()},k.prototype.rotateBy=function(p){this.rotateTo((this.rotationAngle+p)%360)},k.prototype.applyRotation=function(){var p=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var C=this.editingTargetRotationContainer.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(C,0);var N=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/N.width,this.imageHeight/N.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=p},k.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},k.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},k.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},k.prototype.startRenderAndClose=function(){return Ke(this,void 0,void 0,function(){var p,C;return xt(this,function(N){switch(N.label){case 0:return[4,this.render()];case 1:return p=N.sent(),C=this.getState(),this.renderEventListeners.forEach(function(V){return V(p,C)}),this.close(!0),[2]}})})},k.prototype.render=function(){return Ke(this,void 0,void 0,function(){var p;return xt(this,function(C){switch(C.label){case 0:return(p=new cn).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.width=this.renderWidth,p.height=this.renderHeight,this.unzoomFromCrop(),xe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,p.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 C.sent(),[4,p.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,C.sent()]}})})},k.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new jt("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 jt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new jt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var p=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new jt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*p)+`px;
|
|
height: `+(this.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new jt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new jt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new wt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new wt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new jt("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 jt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new jt("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 jt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new jt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},k.instanceCounter=0,k}(),Dn=G("8hTe"),gn=G.n(Dn),En=/<pre[^>]*>/g;function sn(k){var p=document.createElement("div");return p.innerHTML=k,p.childNodes.length===0?"":p.childNodes[0].nodeValue}var et=Qe.a=function(k){var p=k.value,C=p===void 0?"":p,N=k.edit,V=N===void 0?!1:N,U=k.className,de=k.showTextOnly,ze=k.showLines,_t=k.replaces,Mt=k.zoomImg,ct=k.hasMask,Vt=k.style,Et=Vt===void 0?{}:Vt,Yt=k.stylesPrev,dn=Yt===void 0?{}:Yt,Un=String(C),On=Object(w.useRef)(),bn=Object(w.useRef)(),ln=Object(w.useState)(""),Jt=Object(j.a)(ln,2),In=Jt[0],Wn=Jt[1],ii=Object(w.useState)("office"),Pn=Object(j.a)(ii,2),Nn=Pn[0],Qn=Pn[1],ri=function(){var Se=new Sn(bn.current);Se.displayMode="popup",Se.addRenderEventListener(function(){var He=Object(O.a)(D.a.mark(function We(st){var Xe;return D.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return On.current.style.display="none",pt.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:st}});case 3:Xe=pt.sent,Xe!=null&&Xe.id&&_t(bn.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(Xe==null?void 0:Xe.id,"?type=").concat(Xe.content_type));case 5:case"end":return pt.stop()}},We)}));return function(We){return He.apply(this,arguments)}}()),Se.show()},Oi=function(){var Se=new ne(bn.current);Se.settings.displayMode="popup",Se.addEventListener("render",function(){var He=Object(O.a)(D.a.mark(function We(st){var Xe;return D.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(On.current.style.display="none",!bn.current){pt.next=6;break}return pt.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:st.dataUrl}});case 4:Xe=pt.sent,Xe!=null&&Xe.id&&_t(bn.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(Xe==null?void 0:Xe.id,"?type=").concat(Xe.content_type));case 6:case"end":return pt.stop()}},We)}));return function(We){return He.apply(this,arguments)}}()),Se.show(),window.markerArea=Se},hi=Object(w.useMemo)(function(){On.current&&(On.current.style.zIndex=-1);try{var Fe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Se=/\"\/api\/attachments\/|\"\/attachments\/download\//g,He=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Un=Un.replace(Fe,"("+z.a.API_SERVER+"/api/attachments/").replace(Se,'"'+z.a.API_SERVER+"/api/attachments/").replace(He,'"'+z.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(ft){}var We=M(Un),st=v();if(Un.match(/\[TOC\]/)&&(We=We.replace("<p>[TOC]</p>",T()),S()),We=We.replace(/(__special_katext_id_\d+__)/g,function(ft,pt){var $e=st[pt],gt=$e.type,at=$e.expression;return Object(Z.renderToString)(sn(at)||"",{displayMode:gt==="block",throwOnError:!1,output:"html"})}),We=We.replace(/▁/g,"\u2581\u2581\u2581"),f(),de){var Xe=document.createElement("div");return Xe.innerHTML=We,Xe.innerText}return setTimeout(function(){return ye()},500),We},[Un]),K=Object(w.useRef)();E.WebkitLineClamp=ze,ze&&(Et=Object(x.a)(Object(x.a)({},Et),E));function oe(Fe){var Se=Fe.target;if(Se.tagName.toUpperCase()==="IMG"){if(Mt){var He=Se.getAttribute("src");Wn(He),Qn("image")}}else if(Se.tagName.toUpperCase()==="A"){var We=Se.getAttribute("href");if(We.indexOf("office")>-1)Fe.preventDefault(),Wn(We),Qn("office");else if(We.indexOf("application/pdf")>-1)Fe.preventDefault(),Wn(We),Qn("pdf");else if(We.indexOf("text/html")>-1)Fe.preventDefault(),Wn(We),Qn("html");else if(We.startsWith("#")){Fe.preventDefault();var st=document.getElementById(We.replace("#",""));st&&st.scrollIntoView(!0)}}}var ye=function(){var Se,He=(Se=K.current)===null||Se===void 0?void 0:Se.querySelectorAll("video");He==null||He.forEach(function(We){if(We.oncontextmenu=function(){return!1},We.src.indexOf(".m3u8")>-1&&!We.canPlayType("application/vnd.apple.mpegurl")){if(B.a.isSupported()){var st=new B.a;st.loadSource(We.src),st.attachMedia(We)}}})};Object(w.useEffect)(function(){if(K.current&&hi&&(hi.match(En)&&window.PR.prettyPrint()),K.current)return K.current.addEventListener("click",oe),function(){K.current.removeEventListener("click",oe),f(),S()}},[hi,K.current,oe]);var Te=function(Se){if(!V)return;Se.target.nodeName==="IMG"?(On.current.style.zIndex=1,On.current.style.display="flex",On.current.style.width=Se.target.clientWidth+"px",On.current.style.height=Se.target.clientHeight+"px",On.current.style.top=Se.target.offsetTop+"px",On.current.style.left=Se.target.offsetLeft+"px",bn.current.src=Se.target.getAttribute("src")):On.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:K,style:Object(x.a)({},Et),className:"".concat(U||""," markdown-body ").concat(gn.a.mdBody),onMouseOver:Te,dangerouslySetInnerHTML:{__html:hi}}),g.a.createElement("div",{ref:On,className:gn.a.button},g.a.createElement(H.a,null,g.a.createElement(W.a,{onClick:function(){return ri()}},"\u88C1\u526A"),g.a.createElement(W.a,{onClick:function(){return Oi()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:bn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ae.a,{close:!0,data:In,type:In!=null&&In.length?Nn:"",style:Object(x.a)({},dn),onClose:function(){return Wn("")}}))}},BU3w:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return O});var te=G("MNnm"),H="rc-util-key";function L(j){if(j.attachTo)return j.attachTo;var h=document.querySelector("head");return h||document.body}function W(j){var h,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var w=document.createElement("style");if((h=D.csp)===null||h===void 0?void 0:h.nonce){var g;w.nonce=(g=D.csp)===null||g===void 0?void 0:g.nonce}w.innerHTML=j;var m=L(D),u=m.firstChild;return D.prepend&&m.prepend?m.prepend(w):D.prepend&&u?m.insertBefore(w,u):m.appendChild(w),w}var x=new Map;function O(j,h){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=L(D);if(!x.has(w)){var g=W("",D),m=g.parentNode;x.set(w,m),m.removeChild(g)}var u=Array.from(x.get(w).children).find(function(e){return e.tagName==="STYLE"&&e[H]===h});if(u){var r,t;if(((r=D.csp)===null||r===void 0?void 0:r.nonce)&&u.nonce!==((t=D.csp)===null||t===void 0?void 0:t.nonce)){var n;u.nonce=(n=D.csp)===null||n===void 0?void 0:n.nonce}return u.innerHTML!==j&&(u.innerHTML=j),u}var s=W(j,D);return s[H]=h,s}},BdwD:function(zt,Qe,G){"use strict";var te=G("+L6B"),H=G("2/Rp"),L=G("0Owb"),W=G("k1fw"),x=G("q1tI"),O=G.n(x),j=G("FOrL"),h=G.n(j),D=function(g){var m=g.buttonProps,u=m===void 0?{}:m,r=g.styles,t=r===void 0?{}:r,n=g.customText,s=g.ButtonText,e=g.ButtonClick,i=g.Buttonclass,o=g.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(W.a)(Object(W.a)({},{color:"#999",margin:"200px auto"}),t)},O.a.createElement("img",{src:h.a}),O.a.createElement("p",{className:"mt20 font14"},n||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&O.a.createElement(H.a,Object(L.a)({className:i,onClick:e},u),s),o&&o)};Qe.a=D},BilE:function(zt,Qe,G){zt.exports={flex_box_center:"flex_box_center___2aCrn",flex_space_between:"flex_space_between___2rdO9",flex_box_vertical_center:"flex_box_vertical_center___1cZfW",flex_box_center_end:"flex_box_center_end___RZ1g_",flex_box_column:"flex_box_column___3wYBF",form:"form___-3bHR",efficiency:"efficiency___2d1uO"}},D62m:function(zt,Qe,G){zt.exports={flex_box_center:"flex_box_center___1zDGO",flex_space_between:"flex_space_between___2IUWk",flex_box_vertical_center:"flex_box_vertical_center___1_AA_",flex_box_center_end:"flex_box_center_end___1Bb7O",flex_box_column:"flex_box_column___1d9q-",wrap:"wrap___1SVlh",modal:"modal___2INYO",titleWrap:"titleWrap___3GSHQ",required:"required___2odd3",title:"title___3dWr1",colorGray:"colorGray___2Zc8P",choiceWrap:"choiceWrap___1Jf_Q",answer:"answer___2RdAH",activeAnswer:"activeAnswer___2pp8F",deleteIcon:"deleteIcon___1Nc1w",addIcon:"addIcon___s1huN",editorWrap:"editorWrap___2xyxg",htmlWrap:"htmlWrap___2_jIl",radio:"radio___AXmd6",color333:"color333___2HJuj",color999:"color999___1nV0m",questionType:"questionType___gMFML",questionChoices:"questionChoices___21aEC"}},DlQD:function(zt,Qe,G){(function(te,H){zt.exports=H()})(this,function(){"use strict";function te(ve,le){for(var ue=0;ue<le.length;ue++){var $=le[ue];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(ve,$.key,$)}}function H(ve,le,ue){return le&&te(ve.prototype,le),ue&&te(ve,ue),ve}function L(ve,le){if(!ve)return;if(typeof ve=="string")return W(ve,le);var ue=Object.prototype.toString.call(ve).slice(8,-1);if(ue==="Object"&&ve.constructor&&(ue=ve.constructor.name),ue==="Map"||ue==="Set")return Array.from(ve);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return W(ve,le)}function W(ve,le){(le==null||le>ve.length)&&(le=ve.length);for(var ue=0,$=new Array(le);ue<le;ue++)$[ue]=ve[ue];return $}function x(ve,le){var ue;if(typeof Symbol=="undefined"||ve[Symbol.iterator]==null){if(Array.isArray(ve)||(ue=L(ve))||le&&ve&&typeof ve.length=="number"){ue&&(ve=ue);var $=0;return function(){return $>=ve.length?{done:!0}:{done:!1,value:ve[$++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ue=ve[Symbol.iterator](),ue.next.bind(ue)}function O(ve,le){return le={exports:{}},ve(le,le.exports),le.exports}var j=O(function(ve){function le(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ue($){ve.exports.defaults=$}ve.exports={defaults:le(),getDefaults:le,changeDefaults:ue}}),h=j.defaults,D=j.getDefaults,w=j.changeDefaults,g=/[&<>"']/,m=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,t={"&":"&","<":"<",">":">",'"':""","'":"'"},n=function(le){return t[le]};function s(ve,le){if(le){if(g.test(ve))return ve.replace(m,n)}else if(u.test(ve))return ve.replace(r,n);return ve}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(ve){return ve.replace(e,function(le,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var o=/(^|[^\[])\^/g;function S(ve,le){ve=ve.source||ve,le=le||"";var ue={replace:function(Q,re){return re=re.source||re,re=re.replace(o,"$1"),ve=ve.replace(Q,re),ue},getRegex:function(){return new RegExp(ve,le)}};return ue}var E=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(ve,le,ue){if(ve){var $;try{$=decodeURIComponent(i(ue)).replace(E,"").toLowerCase()}catch(Q){return null}if($.indexOf("javascript:")===0||$.indexOf("vbscript:")===0||$.indexOf("data:")===0)return null}le&&!y.test(ue)&&(ue=c(le,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(Q){return null}return ue}var _={},l=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(ve,le){_[" "+ve]||(l.test(ve)?_[" "+ve]=ve+"/":_[" "+ve]=I(ve,"/",!0)),ve=_[" "+ve];var ue=ve.indexOf(":")===-1;return le.substring(0,2)==="//"?ue?le:ve.replace(d,"$1")+le:le.charAt(0)==="/"?ue?le:ve.replace(a,"$1")+le:ve+le}var v={exec:function(){}};function f(ve){for(var le=1,ue,$;le<arguments.length;le++){ue=arguments[le];for($ in ue)Object.prototype.hasOwnProperty.call(ue,$)&&(ve[$]=ue[$])}return ve}function b(ve,le){var ue=ve.replace(/\|/g,function(re,fe,Pe){for(var Ge=!1,bt=fe;--bt>=0&&Pe[bt]==="\\";)Ge=!Ge;return Ge?"|":" |"}),$=ue.split(/ \|/),Q=0;if($.length>le)$.splice(le);else for(;$.length<le;)$.push("");for(;Q<$.length;Q++)$[Q]=$[Q].trim().replace(/\\\|/g,"|");return $}function I(ve,le,ue){var $=ve.length;if($===0)return"";for(var Q=0;Q<$;){var re=ve.charAt($-Q-1);if(re===le&&!ue)Q++;else if(re!==le&&ue)Q++;else break}return ve.substr(0,$-Q)}function R(ve,le){if(ve.indexOf(le[1])===-1)return-1;for(var ue=ve.length,$=0,Q=0;Q<ue;Q++)if(ve[Q]==="\\")Q++;else if(ve[Q]===le[0])$++;else if(ve[Q]===le[1]&&($--,$<0))return Q;return-1}function P(ve){ve&&ve.sanitize&&!ve.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var M={escape:s,unescape:i,edit:S,cleanUrl:T,resolveUrl:c,noopTest:v,merge:f,splitCells:b,rtrim:I,findClosingBracket:R,checkSanitizeDeprecation:P},F=j.defaults,A=M.rtrim,B=M.splitCells,z=M.escape,Z=M.findClosingBracket;function ae(ve,le,ue){var $=le.href,Q=le.title?z(le.title):null,re=ve[1].replace(/\\([\[\]])/g,"$1");return ve[0].charAt(0)!=="!"?{type:"link",raw:ue,href:$,title:Q,text:re}:{type:"image",raw:ue,href:$,title:Q,text:z(re)}}function De(ve,le){var ue=ve.match(/^(\s+)(?:```)/);if(ue===null)return le;var $=ue[1];return le.split(`
|
|
`).map(function(Q){var re=Q.match(/^\s+/);if(re===null)return Q;var fe=re[0];return fe.length>=$.length?Q.slice($.length):Q}).join(`
|
|
`)}var _e=function(){function ve(ue){this.options=ue||F}var le=ve.prototype;return le.space=function($){var Q=this.rules.block.newline.exec($);if(Q)return Q[0].length>1?{type:"space",raw:Q[0]}:{raw:`
|
|
`}},le.code=function($,Q){var re=this.rules.block.code.exec($);if(re){var fe=Q[Q.length-1];if(fe&&fe.type==="paragraph")return{raw:re[0],text:re[0].trimRight()};var Pe=re[0].replace(/^ {4}/gm,"");return{type:"code",raw:re[0],codeBlockStyle:"indented",text:this.options.pedantic?Pe:A(Pe,`
|
|
`)}}},le.fences=function($){var Q=this.rules.block.fences.exec($);if(Q){var re=Q[0],fe=De(re,Q[3]||"");return{type:"code",raw:re,lang:Q[2]?Q[2].trim():Q[2],text:fe}}},le.heading=function($){var Q=this.rules.block.heading.exec($);if(Q)return{type:"heading",raw:Q[0],depth:Q[1].length,text:Q[2]}},le.nptable=function($){var Q=this.rules.block.nptable.exec($);if(Q){var re={type:"table",header:B(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Q[0]};if(re.header.length===re.align.length){var fe=re.align.length,Pe;for(Pe=0;Pe<fe;Pe++)/^ *-+: *$/.test(re.align[Pe])?re.align[Pe]="right":/^ *:-+: *$/.test(re.align[Pe])?re.align[Pe]="center":/^ *:-+ *$/.test(re.align[Pe])?re.align[Pe]="left":re.align[Pe]=null;for(fe=re.cells.length,Pe=0;Pe<fe;Pe++)re.cells[Pe]=B(re.cells[Pe],re.header.length);return re}}},le.hr=function($){var Q=this.rules.block.hr.exec($);if(Q)return{type:"hr",raw:Q[0]}},le.blockquote=function($){var Q=this.rules.block.blockquote.exec($);if(Q){var re=Q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Q[0],text:re}}},le.list=function($){var Q=this.rules.block.list.exec($);if(Q){for(var re=Q[0],fe=Q[2],Pe=fe.length>1,Ge=fe[fe.length-1]===")",bt={type:"list",raw:re,ordered:Pe,start:Pe?+fe.slice(0,-1):"",loose:!1,items:[]},Ft=Q[0].match(this.rules.block.item),Xt=!1,Pt,St,Ze,qe,Me,ne,me,rt=Ft.length,Ke=0;Ke<rt;Ke++)Pt=Ft[Ke],re=Pt,St=Pt.length,Pt=Pt.replace(/^ *([*+-]|\d+[.)]) */,""),~Pt.indexOf(`
|
|
`)&&(St-=Pt.length,Pt=this.options.pedantic?Pt.replace(/^ {1,4}/gm,""):Pt.replace(new RegExp("^ {1,"+St+"}","gm"),"")),Ke!==rt-1&&(Ze=this.rules.block.bullet.exec(Ft[Ke+1])[0],(Pe?Ze.length===1||!Ge&&Ze[Ze.length-1]===")":Ze.length>1||this.options.smartLists&&Ze!==fe)&&(qe=Ft.slice(Ke+1).join(`
|
|
`),bt.raw=bt.raw.substring(0,bt.raw.length-qe.length),Ke=rt-1)),Me=Xt||/\n\n(?!\s*$)/.test(Pt),Ke!==rt-1&&(Xt=Pt.charAt(Pt.length-1)===`
|
|
`,Me||(Me=Xt)),Me&&(bt.loose=!0),ne=/^\[[ xX]\] /.test(Pt),me=void 0,ne&&(me=Pt[1]!==" ",Pt=Pt.replace(/^\[[ xX]\] +/,"")),bt.items.push({type:"list_item",raw:re,task:ne,checked:me,loose:Me,text:Pt});return bt}},le.html=function($){var Q=this.rules.block.html.exec($);if(Q)return{type:this.options.sanitize?"paragraph":"html",raw:Q[0],pre:!this.options.sanitizer&&(Q[1]==="pre"||Q[1]==="script"||Q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):z(Q[0]):Q[0]}},le.def=function($){var Q=this.rules.block.def.exec($);if(Q){Q[3]&&(Q[3]=Q[3].substring(1,Q[3].length-1));var re=Q[1].toLowerCase().replace(/\s+/g," ");return{tag:re,raw:Q[0],href:Q[2],title:Q[3]}}},le.table=function($){var Q=this.rules.block.table.exec($);if(Q){var re={type:"table",header:B(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
|
|
`):[]};if(re.header.length===re.align.length){re.raw=Q[0];var fe=re.align.length,Pe;for(Pe=0;Pe<fe;Pe++)/^ *-+: *$/.test(re.align[Pe])?re.align[Pe]="right":/^ *:-+: *$/.test(re.align[Pe])?re.align[Pe]="center":/^ *:-+ *$/.test(re.align[Pe])?re.align[Pe]="left":re.align[Pe]=null;for(fe=re.cells.length,Pe=0;Pe<fe;Pe++)re.cells[Pe]=B(re.cells[Pe].replace(/^ *\| *| *\| *$/g,""),re.header.length);return re}}},le.lheading=function($){var Q=this.rules.block.lheading.exec($);if(Q)return{type:"heading",raw:Q[0],depth:Q[2].charAt(0)==="="?1:2,text:Q[1]}},le.paragraph=function($){var Q=this.rules.block.paragraph.exec($);if(Q)return{type:"paragraph",raw:Q[0],text:Q[1].charAt(Q[1].length-1)===`
|
|
`?Q[1].slice(0,-1):Q[1]}},le.text=function($,Q){var re=this.rules.block.text.exec($);if(re){var fe=Q[Q.length-1];return fe&&fe.type==="text"?{raw:re[0],text:re[0]}:{type:"text",raw:re[0],text:re[0]}}},le.escape=function($){var Q=this.rules.inline.escape.exec($);if(Q)return{type:"escape",raw:Q[0],text:z(Q[1])}},le.tag=function($,Q,re){var fe=this.rules.inline.tag.exec($);if(fe)return!Q&&/^<a /i.test(fe[0])?Q=!0:Q&&/^<\/a>/i.test(fe[0])&&(Q=!1),!re&&/^<(pre|code|kbd|script)(\s|>)/i.test(fe[0])?re=!0:re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(fe[0])&&(re=!1),{type:this.options.sanitize?"text":"html",raw:fe[0],inLink:Q,inRawBlock:re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):z(fe[0]):fe[0]}},le.link=function($){var Q=this.rules.inline.link.exec($);if(Q){var re=Z(Q[2],"()");if(re>-1){var fe=Q[0].indexOf("!")===0?5:4,Pe=fe+Q[1].length+re;Q[2]=Q[2].substring(0,re),Q[0]=Q[0].substring(0,Pe).trim(),Q[3]=""}var Ge=Q[2],bt="";if(this.options.pedantic){var Ft=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ge);Ft?(Ge=Ft[1],bt=Ft[3]):bt=""}else bt=Q[3]?Q[3].slice(1,-1):"";Ge=Ge.trim().replace(/^<([\s\S]*)>$/,"$1");var Xt=ae(Q,{href:Ge&&Ge.replace(this.rules.inline._escapes,"$1"),title:bt&&bt.replace(this.rules.inline._escapes,"$1")},Q[0]);return Xt}},le.reflink=function($,Q){var re;if((re=this.rules.inline.reflink.exec($))||(re=this.rules.inline.nolink.exec($))){var fe=(re[2]||re[1]).replace(/\s+/g," ");if(fe=Q[fe.toLowerCase()],!fe||!fe.href){var Pe=re[0].charAt(0);return{type:"text",raw:Pe,text:Pe}}var Ge=ae(re,fe,re[0]);return Ge}},le.strong=function($,Q,re){re===void 0&&(re="");var fe=this.rules.inline.strong.start.exec($);if(fe&&(!fe[1]||fe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){Q=Q.slice(-1*$.length);var Pe=fe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Pe.lastIndex=0;for(var Ge;(fe=Pe.exec(Q))!=null;)if(Ge=this.rules.inline.strong.middle.exec(Q.slice(0,fe.index+3)),Ge)return{type:"strong",raw:$.slice(0,Ge[0].length),text:$.slice(2,Ge[0].length-2)}}},le.em=function($,Q,re){re===void 0&&(re="");var fe=this.rules.inline.em.start.exec($);if(fe&&(!fe[1]||fe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){Q=Q.slice(-1*$.length);var Pe=fe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Pe.lastIndex=0;for(var Ge;(fe=Pe.exec(Q))!=null;)if(Ge=this.rules.inline.em.middle.exec(Q.slice(0,fe.index+2)),Ge)return{type:"em",raw:$.slice(0,Ge[0].length),text:$.slice(1,Ge[0].length-1)}}},le.codespan=function($){var Q=this.rules.inline.code.exec($);if(Q){var re=Q[2].replace(/\n/g," "),fe=/[^ ]/.test(re),Pe=re.startsWith(" ")&&re.endsWith(" ");return fe&&Pe&&(re=re.substring(1,re.length-1)),re=z(re,!0),{type:"codespan",raw:Q[0],text:re}}},le.br=function($){var Q=this.rules.inline.br.exec($);if(Q)return{type:"br",raw:Q[0]}},le.del=function($){var Q=this.rules.inline.del.exec($);if(Q)return{type:"del",raw:Q[0],text:Q[1]}},le.autolink=function($,Q){var re=this.rules.inline.autolink.exec($);if(re){var fe,Pe;return re[2]==="@"?(fe=z(this.options.mangle?Q(re[1]):re[1]),Pe="mailto:"+fe):(fe=z(re[1]),Pe=fe),{type:"link",raw:re[0],text:fe,href:Pe,tokens:[{type:"text",raw:fe,text:fe}]}}},le.url=function($,Q){var re;if(re=this.rules.inline.url.exec($)){var fe,Pe;if(re[2]==="@")fe=z(this.options.mangle?Q(re[0]):re[0]),Pe="mailto:"+fe;else{var Ge;do Ge=re[0],re[0]=this.rules.inline._backpedal.exec(re[0])[0];while(Ge!==re[0]);fe=z(re[0]),re[1]==="www."?Pe="http://"+fe:Pe=fe}return{type:"link",raw:re[0],text:fe,href:Pe,tokens:[{type:"text",raw:fe,text:fe}]}}},le.inlineText=function($,Q,re){var fe=this.rules.inline.text.exec($);if(fe){var Pe;return Q?Pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):z(fe[0]):fe[0]:Pe=z(this.options.smartypants?re(fe[0]):fe[0]),{type:"text",raw:fe[0],text:Pe}}},ve}(),Oe=M.noopTest,Ne=M.edit,Ue=M.merge,Ee={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ee.def=Ne(Ee.def).replace("label",Ee._label).replace("title",Ee._title).getRegex(),Ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ee.item=Ne(Ee.item,"gm").replace(/bull/g,Ee.bullet).getRegex(),Ee.list=Ne(Ee.list).replace(/bull/g,Ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ee.def.source+")").getRegex(),Ee._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ee._comment=/<!--(?!-?>)[\s\S]*?-->/,Ee.html=Ne(Ee.html,"i").replace("comment",Ee._comment).replace("tag",Ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee.paragraph=Ne(Ee._paragraph).replace("hr",Ee.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.blockquote=Ne(Ee.blockquote).replace("paragraph",Ee.paragraph).getRegex(),Ee.normal=Ue({},Ee),Ee.gfm=Ue({},Ee.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ee.gfm.nptable=Ne(Ee.gfm.nptable).replace("hr",Ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.gfm.table=Ne(Ee.gfm.table).replace("hr",Ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.pedantic=Ue({},Ee.normal,{html:Ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ee._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Ne(Ee.normal._paragraph).replace("hr",Ee.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,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:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",q.punctuation=Ne(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",q.em.start=Ne(q.em.start).replace(/punctuation/g,q._punctuation).getRegex(),q.em.middle=Ne(q.em.middle).replace(/punctuation/g,q._punctuation).replace(/overlapSkip/g,q._overlapSkip).getRegex(),q.em.endAst=Ne(q.em.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.em.endUnd=Ne(q.em.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.start=Ne(q.strong.start).replace(/punctuation/g,q._punctuation).getRegex(),q.strong.middle=Ne(q.strong.middle).replace(/punctuation/g,q._punctuation).replace(/blockSkip/g,q._blockSkip).getRegex(),q.strong.endAst=Ne(q.strong.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.endUnd=Ne(q.strong.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=Ne(q._blockSkip,"g").getRegex(),q.overlapSkip=Ne(q._overlapSkip,"g").getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=Ne(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=Ne(q.tag).replace("comment",Ee._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=Ne(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=Ne(q.reflink).replace("label",q._label).getRegex(),q.reflinkSearch=Ne(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=Ue({},q),q.pedantic=Ue({},q.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:Ne(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:Ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=Ue({},q.normal,{escape:Ne(q.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),q.gfm.url=Ne(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=Ue({},q.gfm,{br:Ne(q.br).replace("{2,}","*").getRegex(),text:Ne(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var J={block:Ee,inline:q},pe=j.defaults,ee=J.block,Ae=J.inline;function Ve(ve){return ve.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 Le(ve){var le="",ue,$,Q=ve.length;for(ue=0;ue<Q;ue++)$=ve.charCodeAt(ue),Math.random()>.5&&($="x"+$.toString(16)),le+="&#"+$+";";return le}var Ye=function(){function ve(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||pe,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var $={block:ee.normal,inline:Ae.normal};this.options.pedantic?($.block=ee.pedantic,$.inline=Ae.pedantic):this.options.gfm&&($.block=ee.gfm,this.options.breaks?$.inline=Ae.breaks:$.inline=Ae.gfm),this.tokenizer.rules=$}ve.lex=function($,Q){var re=new ve(Q);return re.lex($)};var le=ve.prototype;return le.lex=function($){return $=$.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens($,this.tokens,!0),this.inline(this.tokens),this.tokens},le.blockTokens=function($,Q,re){Q===void 0&&(Q=[]),re===void 0&&(re=!0),$=$.replace(/^ +$/gm,"");for(var fe,Pe,Ge,bt;$;){if(fe=this.tokenizer.space($)){$=$.substring(fe.raw.length),fe.type&&Q.push(fe);continue}if(fe=this.tokenizer.code($,Q)){$=$.substring(fe.raw.length),fe.type?Q.push(fe):(bt=Q[Q.length-1],bt.raw+=`
|
|
`+fe.raw,bt.text+=`
|
|
`+fe.text);continue}if(fe=this.tokenizer.fences($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(fe=this.tokenizer.heading($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(fe=this.tokenizer.nptable($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(fe=this.tokenizer.hr($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(fe=this.tokenizer.blockquote($)){$=$.substring(fe.raw.length),fe.tokens=this.blockTokens(fe.text,[],re),Q.push(fe);continue}if(fe=this.tokenizer.list($)){for($=$.substring(fe.raw.length),Ge=fe.items.length,Pe=0;Pe<Ge;Pe++)fe.items[Pe].tokens=this.blockTokens(fe.items[Pe].text,[],!1);Q.push(fe);continue}if(fe=this.tokenizer.html($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(re&&(fe=this.tokenizer.def($))){$=$.substring(fe.raw.length),this.tokens.links[fe.tag]||(this.tokens.links[fe.tag]={href:fe.href,title:fe.title});continue}if(fe=this.tokenizer.table($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(fe=this.tokenizer.lheading($)){$=$.substring(fe.raw.length),Q.push(fe);continue}if(re&&(fe=this.tokenizer.paragraph($))){$=$.substring(fe.raw.length),Q.push(fe);continue}if(fe=this.tokenizer.text($,Q)){$=$.substring(fe.raw.length),fe.type?Q.push(fe):(bt=Q[Q.length-1],bt.raw+=`
|
|
`+fe.raw,bt.text+=`
|
|
`+fe.text);continue}if($){var Ft="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(Ft);break}else throw new Error(Ft)}}return Q},le.inline=function($){var Q,re,fe,Pe,Ge,bt,Ft=$.length;for(Q=0;Q<Ft;Q++){bt=$[Q];switch(bt.type){case"paragraph":case"text":case"heading":{bt.tokens=[],this.inlineTokens(bt.text,bt.tokens);break}case"table":{for(bt.tokens={header:[],cells:[]},Pe=bt.header.length,re=0;re<Pe;re++)bt.tokens.header[re]=[],this.inlineTokens(bt.header[re],bt.tokens.header[re]);for(Pe=bt.cells.length,re=0;re<Pe;re++)for(Ge=bt.cells[re],bt.tokens.cells[re]=[],fe=0;fe<Ge.length;fe++)bt.tokens.cells[re][fe]=[],this.inlineTokens(Ge[fe],bt.tokens.cells[re][fe]);break}case"blockquote":{this.inline(bt.tokens);break}case"list":{for(Pe=bt.items.length,re=0;re<Pe;re++)this.inline(bt.items[re].tokens);break}}}return $},le.inlineTokens=function($,Q,re,fe,Pe){Q===void 0&&(Q=[]),re===void 0&&(re=!1),fe===void 0&&(fe=!1),Pe===void 0&&(Pe="");var Ge,bt=$,Ft;if(this.tokens.links){var Xt=Object.keys(this.tokens.links);if(Xt.length>0)for(;(Ft=this.tokenizer.rules.inline.reflinkSearch.exec(bt))!=null;)Xt.includes(Ft[0].slice(Ft[0].lastIndexOf("[")+1,-1))&&(bt=bt.slice(0,Ft.index)+"["+"a".repeat(Ft[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ft=this.tokenizer.rules.inline.blockSkip.exec(bt))!=null;)bt=bt.slice(0,Ft.index)+"["+"a".repeat(Ft[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;$;){if(Ge=this.tokenizer.escape($)){$=$.substring(Ge.raw.length),Q.push(Ge);continue}if(Ge=this.tokenizer.tag($,re,fe)){$=$.substring(Ge.raw.length),re=Ge.inLink,fe=Ge.inRawBlock,Q.push(Ge);continue}if(Ge=this.tokenizer.link($)){$=$.substring(Ge.raw.length),Ge.type==="link"&&(Ge.tokens=this.inlineTokens(Ge.text,[],!0,fe)),Q.push(Ge);continue}if(Ge=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(Ge.raw.length),Ge.type==="link"&&(Ge.tokens=this.inlineTokens(Ge.text,[],!0,fe)),Q.push(Ge);continue}if(Ge=this.tokenizer.strong($,bt,Pe)){$=$.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],re,fe),Q.push(Ge);continue}if(Ge=this.tokenizer.em($,bt,Pe)){$=$.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],re,fe),Q.push(Ge);continue}if(Ge=this.tokenizer.codespan($)){$=$.substring(Ge.raw.length),Q.push(Ge);continue}if(Ge=this.tokenizer.br($)){$=$.substring(Ge.raw.length),Q.push(Ge);continue}if(Ge=this.tokenizer.del($)){$=$.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],re,fe),Q.push(Ge);continue}if(Ge=this.tokenizer.autolink($,Le)){$=$.substring(Ge.raw.length),Q.push(Ge);continue}if(!re&&(Ge=this.tokenizer.url($,Le))){$=$.substring(Ge.raw.length),Q.push(Ge);continue}if(Ge=this.tokenizer.inlineText($,fe,Ve)){$=$.substring(Ge.raw.length),Pe=Ge.raw.slice(-1),Q.push(Ge);continue}if($){var Pt="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(Pt);break}else throw new Error(Pt)}}return Q},H(ve,null,[{key:"rules",get:function(){return{block:ee,inline:Ae}}}]),ve}(),it=j.defaults,vt=M.cleanUrl,ut=M.escape,mt=function(){function ve(ue){this.options=ue||it}var le=ve.prototype;return le.code=function($,Q,re){var fe=(Q||"").match(/\S*/)[0];if(this.options.highlight){var Pe=this.options.highlight($,fe);Pe!=null&&Pe!==$&&(re=!0,$=Pe)}return fe?'<pre><code class="'+this.options.langPrefix+ut(fe,!0)+'">'+(re?$:ut($,!0))+`</code></pre>
|
|
`:"<pre><code>"+(re?$:ut($,!0))+`</code></pre>
|
|
`},le.blockquote=function($){return`<blockquote>
|
|
`+$+`</blockquote>
|
|
`},le.html=function($){return $},le.heading=function($,Q,re,fe){return this.options.headerIds?"<h"+Q+' id="'+this.options.headerPrefix+fe.slug(re)+'">'+$+"</h"+Q+`>
|
|
`:"<h"+Q+">"+$+"</h"+Q+`>
|
|
`},le.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},le.list=function($,Q,re){var fe=Q?"ol":"ul",Pe=Q&&re!==1?' start="'+re+'"':"";return"<"+fe+Pe+`>
|
|
`+$+"</"+fe+`>
|
|
`},le.listitem=function($){return"<li>"+$+`</li>
|
|
`},le.checkbox=function($){return"<input "+($?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},le.paragraph=function($){return"<p>"+$+`</p>
|
|
`},le.table=function($,Q){return Q&&(Q="<tbody>"+Q+"</tbody>"),`<table>
|
|
<thead>
|
|
`+$+`</thead>
|
|
`+Q+`</table>
|
|
`},le.tablerow=function($){return`<tr>
|
|
`+$+`</tr>
|
|
`},le.tablecell=function($,Q){var re=Q.header?"th":"td",fe=Q.align?"<"+re+' align="'+Q.align+'">':"<"+re+">";return fe+$+"</"+re+`>
|
|
`},le.strong=function($){return"<strong>"+$+"</strong>"},le.em=function($){return"<em>"+$+"</em>"},le.codespan=function($){return"<code>"+$+"</code>"},le.br=function(){return this.options.xhtml?"<br/>":"<br>"},le.del=function($){return"<del>"+$+"</del>"},le.link=function($,Q,re){if($=vt(this.options.sanitize,this.options.baseUrl,$),$===null)return re;var fe='<a href="'+ut($)+'"';return Q&&(fe+=' title="'+Q+'"'),fe+=">"+re+"</a>",fe},le.image=function($,Q,re){if($=vt(this.options.sanitize,this.options.baseUrl,$),$===null)return re;var fe='<img src="'+$+'" alt="'+re+'"';return Q&&(fe+=' title="'+Q+'"'),fe+=this.options.xhtml?"/>":">",fe},le.text=function($){return $},ve}(),lt=function(){function ve(){}var le=ve.prototype;return le.strong=function($){return $},le.em=function($){return $},le.codespan=function($){return $},le.del=function($){return $},le.html=function($){return $},le.text=function($){return $},le.link=function($,Q,re){return""+re},le.image=function($,Q,re){return""+re},le.br=function(){return""},ve}(),Bt=function(){function ve(){this.seen={}}var le=ve.prototype;return le.slug=function($){var Q=$.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Q)){var re=Q;do this.seen[re]++,Q=re+"-"+this.seen[re];while(this.seen.hasOwnProperty(Q))}return this.seen[Q]=0,Q},ve}(),Nt=j.defaults,Wt=M.unescape,Lt=function(){function ve(ue){this.options=ue||Nt,this.options.renderer=this.options.renderer||new mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new lt,this.slugger=new Bt}ve.parse=function($,Q){var re=new ve(Q);return re.parse($)};var le=ve.prototype;return le.parse=function($,Q){Q===void 0&&(Q=!0);var re="",fe,Pe,Ge,bt,Ft,Xt,Pt,St,Ze,qe,Me,ne,me,rt,Ke,xt,Ot,xe,Je=$.length;for(fe=0;fe<Je;fe++){qe=$[fe];switch(qe.type){case"space":continue;case"hr":{re+=this.renderer.hr();continue}case"heading":{re+=this.renderer.heading(this.parseInline(qe.tokens),qe.depth,Wt(this.parseInline(qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{re+=this.renderer.code(qe.text,qe.lang,qe.escaped);continue}case"table":{for(St="",Pt="",bt=qe.header.length,Pe=0;Pe<bt;Pe++)Pt+=this.renderer.tablecell(this.parseInline(qe.tokens.header[Pe]),{header:!0,align:qe.align[Pe]});for(St+=this.renderer.tablerow(Pt),Ze="",bt=qe.cells.length,Pe=0;Pe<bt;Pe++){for(Xt=qe.tokens.cells[Pe],Pt="",Ft=Xt.length,Ge=0;Ge<Ft;Ge++)Pt+=this.renderer.tablecell(this.parseInline(Xt[Ge]),{header:!1,align:qe.align[Ge]});Ze+=this.renderer.tablerow(Pt)}re+=this.renderer.table(St,Ze);continue}case"blockquote":{Ze=this.parse(qe.tokens),re+=this.renderer.blockquote(Ze);continue}case"list":{for(Me=qe.ordered,ne=qe.start,me=qe.loose,bt=qe.items.length,Ze="",Pe=0;Pe<bt;Pe++)Ke=qe.items[Pe],xt=Ke.checked,Ot=Ke.task,rt="",Ke.task&&(xe=this.renderer.checkbox(xt),me?Ke.tokens.length>0&&Ke.tokens[0].type==="text"?(Ke.tokens[0].text=xe+" "+Ke.tokens[0].text,Ke.tokens[0].tokens&&Ke.tokens[0].tokens.length>0&&Ke.tokens[0].tokens[0].type==="text"&&(Ke.tokens[0].tokens[0].text=xe+" "+Ke.tokens[0].tokens[0].text)):Ke.tokens.unshift({type:"text",text:xe}):rt+=xe),rt+=this.parse(Ke.tokens,me),Ze+=this.renderer.listitem(rt,Ot,xt);re+=this.renderer.list(Ze,Me,ne);continue}case"html":{re+=this.renderer.html(qe.text);continue}case"paragraph":{re+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(Ze=qe.tokens?this.parseInline(qe.tokens):qe.text;fe+1<Je&&$[fe+1].type==="text";)qe=$[++fe],Ze+=`
|
|
`+(qe.tokens?this.parseInline(qe.tokens):qe.text);re+=Q?this.renderer.paragraph(Ze):Ze;continue}default:{var wt='Token with "'+qe.type+'" type was not found.';if(this.options.silent){console.error(wt);return}else throw new Error(wt)}}}return re},le.parseInline=function($,Q){Q=Q||this.renderer;var re="",fe,Pe,Ge=$.length;for(fe=0;fe<Ge;fe++){Pe=$[fe];switch(Pe.type){case"escape":{re+=Q.text(Pe.text);break}case"html":{re+=Q.html(Pe.text);break}case"link":{re+=Q.link(Pe.href,Pe.title,this.parseInline(Pe.tokens,Q));break}case"image":{re+=Q.image(Pe.href,Pe.title,Pe.text);break}case"strong":{re+=Q.strong(this.parseInline(Pe.tokens,Q));break}case"em":{re+=Q.em(this.parseInline(Pe.tokens,Q));break}case"codespan":{re+=Q.codespan(Pe.text);break}case"br":{re+=Q.br();break}case"del":{re+=Q.del(this.parseInline(Pe.tokens,Q));break}case"text":{re+=Q.text(Pe.text);break}default:{var bt='Token with "'+Pe.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return re},ve}(),Gt=M.merge,Ut=M.checkSanitizeDeprecation,Re=M.escape,je=j.getDefaults,tt=j.changeDefaults,dt=j.defaults;function ke(ve,le,ue){if(typeof ve=="undefined"||ve===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ve!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ve)+", string expected");if(typeof le=="function"&&(ue=le,le=null),le=Gt({},ke.defaults,le||{}),Ut(le),ue){var $=le.highlight,Q;try{Q=Ye.lex(ve,le)}catch(Ge){return ue(Ge)}var re=function(bt){var Ft;if(!bt)try{Ft=Lt.parse(Q,le)}catch(Xt){bt=Xt}return le.highlight=$,bt?ue(bt):ue(null,Ft)};if(!$||$.length<3)return re();if(delete le.highlight,!Q.length)return re();var fe=0;ke.walkTokens(Q,function(Ge){Ge.type==="code"&&(fe++,setTimeout(function(){$(Ge.text,Ge.lang,function(bt,Ft){if(bt)return re(bt);Ft!=null&&Ft!==Ge.text&&(Ge.text=Ft,Ge.escaped=!0),fe--,fe===0&&re()})},0))}),fe===0&&re();return}try{var Pe=Ye.lex(ve,le);return le.walkTokens&&ke.walkTokens(Pe,le.walkTokens),Lt.parse(Pe,le)}catch(Ge){if(Ge.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,le.silent)return"<p>An error occurred:</p><pre>"+Re(Ge.message+"",!0)+"</pre>";throw Ge}}ke.options=ke.setOptions=function(ve){return Gt(ke.defaults,ve),tt(ke.defaults),ke},ke.getDefaults=je,ke.defaults=dt,ke.use=function(ve){var le=Gt({},ve);if(ve.renderer&&function(){var $=ke.defaults.renderer||new mt,Q=function(Pe){var Ge=$[Pe];$[Pe]=function(){for(var bt=arguments.length,Ft=new Array(bt),Xt=0;Xt<bt;Xt++)Ft[Xt]=arguments[Xt];var Pt=ve.renderer[Pe].apply($,Ft);return Pt===!1&&(Pt=Ge.apply($,Ft)),Pt}};for(var re in ve.renderer)Q(re);le.renderer=$}(),ve.tokenizer&&function(){var $=ke.defaults.tokenizer||new _e,Q=function(Pe){var Ge=$[Pe];$[Pe]=function(){for(var bt=arguments.length,Ft=new Array(bt),Xt=0;Xt<bt;Xt++)Ft[Xt]=arguments[Xt];var Pt=ve.tokenizer[Pe].apply($,Ft);return Pt===!1&&(Pt=Ge.apply($,Ft)),Pt}};for(var re in ve.tokenizer)Q(re);le.tokenizer=$}(),ve.walkTokens){var ue=ke.defaults.walkTokens;le.walkTokens=function($){ve.walkTokens($),ue&&ue($)}}ke.setOptions(le)},ke.walkTokens=function(ve,le){for(var ue=x(ve),$;!($=ue()).done;){var Q=$.value;le(Q);switch(Q.type){case"table":{for(var re=x(Q.tokens.header),fe;!(fe=re()).done;){var Pe=fe.value;ke.walkTokens(Pe,le)}for(var Ge=x(Q.tokens.cells),bt;!(bt=Ge()).done;)for(var Ft=bt.value,Xt=x(Ft),Pt;!(Pt=Xt()).done;){var St=Pt.value;ke.walkTokens(St,le)}break}case"list":{ke.walkTokens(Q.items,le);break}default:Q.tokens&&ke.walkTokens(Q.tokens,le)}}},ke.Parser=Lt,ke.parser=Lt.parse,ke.Renderer=mt,ke.TextRenderer=lt,ke.Lexer=Ye,ke.lexer=Ye.lex,ke.Tokenizer=_e,ke.Slugger=Bt,ke.parse=ke;var ot=ke;return ot})},FOrL:function(zt,Qe,G){zt.exports=G.p+"static/nodata.a6b3f948.png"},Gytx:function(zt,Qe){zt.exports=function(te,H,L,W){var x=L?L.call(W,te,H):void 0;if(x!==void 0)return!!x;if(te===H)return!0;if(typeof te!="object"||!te||typeof H!="object"||!H)return!1;var O=Object.keys(te),j=Object.keys(H);if(O.length!==j.length)return!1;for(var h=Object.prototype.hasOwnProperty.bind(H),D=0;D<O.length;D++){var w=O[D];if(!h(w))return!1;var g=te[w],m=H[w];if(x=L?L.call(W,g,m,w):void 0,x===!1||x===void 0&&g!==m)return!1}return!0}},I8Z2:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return W}),G.d(Qe,"b",function(){return u}),G.d(Qe,"c",function(){return t});var te=G("q1tI"),H=function(){var n=function(s,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var S in o)o.hasOwnProperty(S)&&(i[S]=o[S])},n(s,e)};return function(s,e){n(s,e);function i(){this.constructor=s}s.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}(),L=te.createContext(null),W=function(n){H(s,n);function s(){return n!==null&&n.apply(this,arguments)||this}return s.prototype.render=function(){return te.createElement(L.Provider,{value:this.props.store},this.props.children)},s}(te.Component),x=G("Gytx"),O=G.n(x),j=G("2mql"),h=G.n(j),D=function(){var n=function(s,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var S in o)o.hasOwnProperty(S)&&(i[S]=o[S])},n(s,e)};return function(s,e){n(s,e);function i(){this.constructor=s}s.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}(),w=function(){return w=Object.assign||function(n){for(var s,e=1,i=arguments.length;e<i;e++){s=arguments[e];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(n[o]=s[o])}return n},w.apply(this,arguments)};function g(n){return n.displayName||n.name||"Component"}var m=function(){return{}};function u(n,s){s===void 0&&(s={});var e=!!n,i=n||m;return function(S){var E=function(T){D(_,T);function _(l,d){var a=T.call(this,l,d)||this;return a.unsubscribe=null,a.handleChange=function(){if(!a.unsubscribe)return;var c=i(a.store.getState(),a.props);a.setState({subscribed:c})},a.store=a.context,a.state={subscribed:i(a.store.getState(),l),store:a.store,props:l},a}return _.getDerivedStateFromProps=function(l,d){return n&&n.length===2&&l!==d.props?{subscribed:i(d.store.getState(),l),props:l}:{props:l}},_.prototype.componentDidMount=function(){this.trySubscribe()},_.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},_.prototype.shouldComponentUpdate=function(l,d){return!O()(this.props,l)||!O()(this.state.subscribed,d.subscribed)},_.prototype.trySubscribe=function(){e&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},_.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},_.prototype.render=function(){var l=w(w(w({},this.props),this.state.subscribed),{store:this.store});return te.createElement(S,w({},l,{ref:this.props.miniStoreForwardedRef}))},_.displayName="Connect("+g(S)+")",_.contextType=L,_}(te.Component);if(s.forwardRef){var y=te.forwardRef(function(T,_){return te.createElement(E,w({},T,{miniStoreForwardedRef:_}))});return h()(y,S)}return h()(E,S)}}var r=function(){return r=Object.assign||function(n){for(var s,e=1,i=arguments.length;e<i;e++){s=arguments[e];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(n[o]=s[o])}return n},r.apply(this,arguments)};function t(n){var s=n,e=[];function i(E){s=r(r({},s),E);for(var y=0;y<e.length;y++)e[y]()}function o(){return s}function S(E){return e.push(E),function(){var T=e.indexOf(E);e.splice(T,1)}}return{setState:i,getState:o,subscribe:S}}},IBYe:function(zt,Qe,G){"use strict";function te(H){return null}Qe.a=te},JHUA:function(zt,Qe,G){"use strict";G.r(Qe);var te=G("Znn+"),H=G("ZTPi"),L=G("sPJy"),W=G("bE4q"),x=G("k1fw"),O=G("tJVT"),j=G("q1tI"),h=G.n(j),D=G("Ty5D"),w=G("55Ip"),g=G("9kvl"),m=G("1vsH"),u=G("mgmH"),r=G("xKgJ"),t=G("DjyN"),n=G("NUBc"),s=G("g9YV"),e=G("wCAj"),i=G("5NDa"),o=G("5rEg"),S=G("14J3"),E=G("BMrR"),y=G("sRBo"),T=G("kaz8"),_=G("jCWc"),l=G("kPKH"),d=G("jrin"),a=G("y8nQ"),c=G("Vl3Y"),v=G("wd/R"),f=G.n(v),b=G("BdwD"),I=G("2qtc"),R=G("kLXV"),P=G("miYZ"),M=G("tsqr"),F=G("9og8"),A=G("WmNS"),B=G.n(A),z=G("ErOA"),Z=function(Dt){var $t=Dt.shixunHomeworks,cn=Dt.dispatch,Sn=Object(D.i)();return h.a.createElement(R.a,{centered:!0,title:"\u63D0\u793A",visible:$t.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(F.a)(B.a.mark(function Dn(){var gn;return B.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(z.a)("/api/myshixuns/".concat($t.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"post",body:{course_id:Sn.coursesId}});case 2:gn=sn.sent,gn.status===0&&(M.b.success("\u5220\u9664\u6210\u529F"),cn({type:"shixunHomeworks/setActionTabs",payload:{}}),cn({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},$t.actionTabs.params)}));case 4:case"end":return sn.stop()}},Dn)})),onCancel:function(){cn({type:"shixunHomeworks/setActionTabs",payload:{}})}},h.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),h.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))},ae=Object(g.a)(function(rn){var Dt=rn.shixunHomeworks;return{shixunHomeworks:Dt}})(Z),De=G("giR+"),_e=G("fyUT"),Oe=function(Dt){var $t=Dt.shixunHomeworks,cn=Dt.dispatch,Sn=Object(D.i)(),Dn=Object(j.useState)(!0),gn=Object(O.a)(Dn,2),En=gn[0],sn=gn[1],et=c.a.useForm(),k=Object(O.a)(et,1),p=k[0];return h.a.createElement(h.a.Fragment,null,h.a.createElement(R.a,{centered:!0,title:"\u8C03\u5206",visible:$t.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(F.a)(B.a.mark(function C(){var N,V;return B.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return de.next=2,p.validateFields();case 2:return N=p.getFieldValue(),de.next=5,Object(z.a)("/api/student_works/".concat($t.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(x.a)({},N)});case 5:V=de.sent,V.status===0&&(M.b.success("\u8BC4\u9605\u6210\u529F"),p.resetFields(),cn({type:"shixunHomeworks/setActionTabs",payload:{}}),cn({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},$t.actionTabs.params)}));case 7:case"end":return de.stop()}},C)})),onCancel:function(){cn({type:"shixunHomeworks/setActionTabs",payload:{}})}},h.a.createElement(c.a,{form:p},h.a.createElement("p",null,"\u6210\u7EE9"),h.a.createElement(c.a.Item,{name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},h.a.createElement(_e.a,null)),h.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),h.a.createElement(c.a.Item,{name:"comment"},h.a.createElement(o.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8})))))},Ne=Object(g.a)(function(rn){var Dt=rn.shixunHomeworks;return{shixunHomeworks:Dt}})(Oe),Ue=[{name:"\u672A\u63D0\u4EA4",id:0,type:"unanswer_users"},{name:"\u6309\u65F6\u63D0\u4EA4",id:1,type:"answer_users"}],Ee=function(Dt){var $t,cn,Sn,Dn,gn,En,sn,et=Dt.polls,k=Dt.loading,p=Dt.dispatch,C=Object(j.useState)(Object(x.a)(Object(x.a)({},Object(D.i)()),{page:1,limit:20})),N=Object(O.a)(C,2),V=N[0],U=N[1],de=Object(D.h)(),ze=et.pollsList,_t=et.commonHeader,Mt=Object(j.useState)({}),ct=Object(O.a)(Mt,2),Vt=ct[0],Et=ct[1],Yt=Object(j.useState)(""),dn=Object(O.a)(Yt,2),Un=dn[0],On=dn[1],bn=Object(j.useState)({}),ln=Object(O.a)(bn,2),Jt=ln[0],In=ln[1];V.order_type="desc",V.order="end_at";var Wn=c.a.useForm(),ii=Object(O.a)(Wn,1),Pn=ii[0],Nn=Object(r.r)();Object(j.useEffect)(function(){p({type:"polls/getPollsList",payload:V})},[]);var Qn=function(){V.page=1;var oe=Object.assign({},Pn.getFieldValue());Object.keys(oe).map(function(ye){oe[ye].includes("all")?(delete V[ye],Pn.setFieldsValue(Object(d.a)({},ye,"all"))):(V[ye]=oe[ye],Pn.setFieldsValue(Object(d.a)({},ye,V[ye])))}),p({type:"polls/getPollsList",payload:V})},ri=function(oe,ye){V.page=oe,V.limit=20,p({type:"polls/getPollsList",payload:Object(x.a)({},V)})},Oi=[{title:"\u5E8F\u53F7",align:"center",dataIndex:"name",render:function(oe,ye,Te){return V.limit*(V.page-1)+Te+1}},{title:"\u59D3\u540D",align:"center",dataIndex:"user_name"},{title:"\u5B66\u53F7",align:"center",dataIndex:"student_id",sortOrder:Jt.student_id,sortDirections:["descend","ascend"],sorter:function(oe,ye){return oe.id-ye.id}},{title:"\u5206\u73ED",align:"center",dataIndex:"user_group_name",ellipsis:!0,width:"35%"},{title:"\u63D0\u4EA4\u72B6\u6001",align:"center",dataIndex:"commit_status",render:function(oe,ye){return ye.commit_status==1?h.a.createElement("span",{className:"c-green"},"\u6309\u65F6\u63D0\u4EA4"):h.a.createElement("span",null,"\u672A\u63D0\u4EA4")}},{title:"\u63D0\u4EA4\u65F6\u95F4",width:"16%",align:"center",dataIndex:"end_at",sortOrder:Jt.end_at,sortDirections:["descend","ascend"],sorter:function(oe,ye){return oe.id-ye.id},render:function(oe){return oe&&f()(oe).format("YYYY-MM-DD HH:mm")}},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",className:"edu-txt-center",align:"center",width:120,render:function(oe,ye){if(Object(r.s)())return ye.commit_status?h.a.createElement(w.a,{target:"_blank",to:"/classrooms/".concat(V.coursesId,"/poll/").concat(V.categoryId,"/users/").concat(ye.login)},"\u67E5\u770B"):"--";if(Object(r.c)())return!!ye.commit_status&&!!_t.show_result?h.a.createElement(w.a,{target:"_blank",to:"/classrooms/".concat(V.coursesId,"/poll/").concat(V.categoryId,"/users/").concat(ye.login)},"\u67E5\u770B"):"--"}}],hi=Object(j.useMemo)(function(){var K=[].concat(Oi);return Nn&&K.splice(2,1),ze.poll_types&&(Nn||ze.poll_types.un_anonymous===!1)&&K.splice(K.length-1,1),K},[Nn,ze.poll_types]);return h.a.createElement("section",{className:"minH500 bg-white pl30 pr30 inline-block w100"},ze.poll_users==""&&h.a.createElement(b.a,null),ze.poll_users!=""&&h.a.createElement("aside",null,Object(r.s)()&&h.a.createElement("div",{className:"mt20"},h.a.createElement("span",{className:"c-red"},ze==null||(($t=ze.poll_types)===null||$t===void 0)?void 0:$t.answer_users)," \u5DF2\u4EA4 ",h.a.createElement("span",{className:"ml20 mr20"},ze==null||((cn=ze.poll_types)===null||cn===void 0)?void 0:cn.unanswer_users,"\u672A\u4EA4"),_t.polls_status===2&&h.a.createElement("span",null,"\u5269\u4F59\u63D0\u4EA4\u65F6\u95F4\uFF1A",h.a.createElement("span",{className:"c-orange"},Object(m.bb)((new Date(ze==null||((Sn=ze.poll_types)===null||Sn===void 0)?void 0:Sn.poll_end_time).getTime()-new Date().getTime())/1e3)))),Object(r.c)()&&h.a.createElement("aside",{className:"mt20"},h.a.createElement(c.a,{form:Pn,onChange:Qn,initialValues:(Dn={},Object(d.a)(Dn,"commit_status","all"),Object(d.a)(Dn,"poll_group_id","all"),Dn)},h.a.createElement(c.a.Item,{name:"commit_status"},h.a.createElement(T.a.Group,{value:[],style:{width:"100%"}},h.a.createElement(E.a,null,h.a.createElement(l.a,{flex:"80px"},"\u7B54\u9898\u72B6\u6001:"),h.a.createElement(l.a,{flex:"80px"},h.a.createElement(T.a,{value:"all",checked:!Vt.commit_status},"\u5168\u90E8")),h.a.createElement(l.a,{flex:"1"},Ue.map(function(K,oe){var ye;return h.a.createElement(T.a,{name:"commit_status",value:K.id},K.name,"(",ze==null||((ye=ze.poll_types)===null||ye===void 0)?void 0:ye[K.type],")")}))))),h.a.createElement(c.a.Item,{name:"poll_group_id"},h.a.createElement(T.a.Group,{style:{width:"100%"}},h.a.createElement(E.a,null,h.a.createElement(l.a,{flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),h.a.createElement(l.a,{flex:"80px"},h.a.createElement(T.a,{value:"all",checked:!Vt.course_group},"\u5168\u90E8")),h.a.createElement(l.a,{flex:"1"},ze.course_groups&&ze.course_groups.map(function(K,oe){return h.a.createElement(T.a,{value:K.course_group_id},K.group_group_name,"(",K.count,")")})))))),h.a.createElement(E.a,null,h.a.createElement(l.a,{flex:"1"},h.a.createElement(E.a,null,h.a.createElement(l.a,null,h.a.createElement(o.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(oe){V.search=oe,V.page=1,p({type:"polls/getPollsList",payload:V})},style:{width:200}})),h.a.createElement(l.a,null,h.a.createElement("span",{className:"ml5 c-red"},(gn=ze.poll_types)===null||gn===void 0?void 0:gn.total_users),h.a.createElement("span",null,"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",(En=ze.poll_types)===null||En===void 0?void 0:En.poll_users_count,"\u4E2A\u5B66\u751F\uFF09")))),h.a.createElement(l.a,null))),h.a.createElement(e.a,{className:"mt30",loading:k["polls/getPollsList"],hideOnSinglePage:!0,pagination:!1,dataSource:ze.poll_users,columns:hi,onChange:function(oe,ye,Te){if(Jt={},Te.order===void 0){Jt[Te.field]="descend";switch(Te.field){case"student_id":On("descend"),V.b_order="desc";break}}else V.b_order=Te.order.replace("end",""),Jt[Te.field]=Te.order;In(Object(x.a)({},Jt)),V.order=Te.field,p({type:"polls/getPollsList",payload:Object(x.a)({},V)})}}),h.a.createElement("aside",{className:"tc mb50 mt30"},h.a.createElement(n.a,{showSizeChanger:!1,hideOnSinglePage:!0,onChange:ri,defaultCurrent:V.page||1,current:V.page||1,defaultPageSize:20,total:(sn=ze.poll_types)===null||sn===void 0?void 0:sn.total_users})),h.a.createElement(Ne,null),h.a.createElement(ae,null)))},q=Object(g.a)(function(rn){var Dt=rn.polls,$t=rn.loading;return{polls:Dt,loading:$t.effects}})(Ee),J=G("T2oS"),pe=G("W9HT"),ee=G("oBTY"),Ae=function(Dt){var $t,cn,Sn,Dn,gn,En,sn=Dt.polls,et=Dt.loading,k=Dt.dispatch,p=Object(D.i)(),C=Object(D.h)(),N=Object(j.useState)([]),V=Object(O.a)(N,2),U=V[0],de=V[1];Object(j.useEffect)(function(){if(sn.actionTabs.key==="\u7ACB\u5373\u622A\u6B62")var Et=k({type:"polls/getEndGroups",payload:Object(x.a)(Object(x.a)({},p),{},{check_ids:[p.categoryId]})}).then(function(Yt){if(!Yt.status){var dn=[];Yt.course_info.map(function(Un){dn.push({id:Un.course_group_id,checked:!0,time:f()().add(7,"days")})}),de([].concat(dn))}})},[sn.actionTabs.key]);var ze=c.a.useForm(),_t=Object(O.a)(ze,1),Mt=_t[0],ct=function(Yt){return Yt&&Yt<f()().startOf("day")},Vt=[{title:"\u5206\u73ED\u540D\u79F0",dataIndex:"course_group_name",render:function(Yt,dn,Un){return console.log("text:",Yt),h.a.createElement(c.a.Item,{name:"group_ids",style:{marginBottom:0}},h.a.createElement(T.a,{value:String(dn.id),checked:U[Un]?U[Un].checked:!1,defaultChecked:!0,onChange:function(bn){U[Un].checked?U[Un].checked=!1:U[Un].checked=!0,de(Object(ee.a)(U))}},Yt))}}];return h.a.createElement(R.a,{centered:!0,title:"\u7ACB\u5373\u622A\u6B62",visible:sn.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u7ACB\u5373\u622A\u6B62",cancelText:"\u6682\u4E0D\u53D1\u5E03",bodyStyle:{minHeight:80},onOk:Object(F.a)(B.a.mark(function Et(){var Yt,dn;return B.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(z.a)("/api/courses/".concat(p.coursesId,"/polls/end_poll.json"),{method:"post",body:{check_ids:[p.categoryId],group_ids:U==null||((Yt=U.filter(function(bn){return bn.checked}))===null||Yt===void 0)?void 0:Yt.map(function(bn){return bn.id})}});case 2:dn=On.sent,dn.status===0&&(M.b.success("\u64CD\u4F5C\u6210\u529F"),k({type:"polls/setActionTabs",payload:{}}),k({type:"polls/getCommonHeader",payload:Object(x.a)({},sn.actionTabs.params)}));case 4:case"end":return On.stop()}},Et)})),onCancel:function(){k({type:"polls/setActionTabs",payload:{}})}},h.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u8BD5\u5377"),et.effects["polls/getEndGroups"]&&h.a.createElement("div",{className:"tc mt40"},h.a.createElement(pe.a,null)),(sn==null||(($t=sn.endGroups)===null||$t===void 0)?void 0:$t.course_info)&&h.a.createElement(c.a,{form:Mt,name:"dynamic_form_item"},!!(sn!=null&&(cn=sn.endGroups)!==null&&cn!==void 0&&(Sn=cn.course_info)!==null&&Sn!==void 0&&Sn.length)&&h.a.createElement(e.a,{style:{background:"#F4FAFF"},columns:Vt,dataSource:(Dn=sn.endGroups)===null||Dn===void 0?void 0:Dn.course_info,scroll:{y:240},pagination:!1})),!!(sn!=null&&(gn=sn.endGroups)!==null&&gn!==void 0&&(En=gn.course_info)!==null&&En!==void 0&&En.length)&&h.a.createElement(T.a,{defaultChecked:!0,onClick:function(Yt){Yt.target.checked?U.map(function(dn){return dn.checked=!0}):U.map(function(dn){return dn.checked=!1}),de(Object(ee.a)(U))}},"\u5168\u9009"))},Ve=Object(g.a)(function(rn){var Dt=rn.polls,$t=rn.loading;return{polls:Dt,loading:$t}})(Ae),Le=G("iQDF"),Ye=G("+eQT"),it=G("tgas"),vt=G("RotF"),ut=G.n(vt),mt=function(Dt){var $t=Dt.polls,cn=Dt.dispatch,Sn=Object(D.i)(),Dn=c.a.useForm(),gn=Object(O.a)(Dn,1),En=gn[0],sn=Object(j.useState)([]),et=Object(O.a)(sn,2),k=et[0],p=et[1],C=Object(j.useState)(1),N=Object(O.a)(C,2),V=N[0],U=N[1],de=Object(j.useState)(0),ze=Object(O.a)(de,2),_t=ze[0],Mt=ze[1],ct=Object(j.useState)(20),Vt=Object(O.a)(ct,2),Et=Vt[0],Yt=Vt[1],dn=Object(j.useState)({}),Un=Object(O.a)(dn,2),On=Un[0],bn=Un[1],ln=Object(j.useState)(!0),Jt=Object(O.a)(ln,2),In=Jt[0],Wn=Jt[1],ii=Object(j.useState)(!0),Pn=Object(O.a)(ii,2),Nn=Pn[0],Qn=Pn[1];Object(j.useEffect)(function(){$t.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"&&ri()},[$t.actionTabs.key]);var ri=function(){var Fe=Object(F.a)(B.a.mark(function Se(He){var We,st;return B.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return Wn(!0),ft.next=3,Object(it.s)(Object(x.a)(Object(x.a)({},Sn),{},{page:He||V,limit:Et}));case 3:We=ft.sent,We&&(st=[],We.course_groups.map(function(pt){st.push(Object(x.a)(Object(x.a)({},pt),{},{checked:!He,time:f()(f()(new Date(Object(m.b)())).add(7,"days").format("YYYY-MM-DD HH:mm"))}))}),bn(We),Mt(We==null?void 0:We.count),Wn(!1),p([].concat(Object(ee.a)(k),st)));case 5:case"end":return ft.stop()}},Se)}));return function(He){return Fe.apply(this,arguments)}}(),Oi=function(Se){return Se&&Se<f()().startOf("day")},hi=[{title:"\u5206\u73ED\u540D\u79F0",dataIndex:"name",render:function(Se,He,We){return h.a.createElement(c.a.Item,{name:"group_ids",noStyle:!0},h.a.createElement(T.a,{value:String(He.id),checked:k[We]?k[We].checked:!1,defaultChecked:!0,onChange:function(Xe){k[We].checked?k[We].checked=!1:k[We].checked=!0,p(Object(ee.a)(k))}},Se))}},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",width:200,render:function(Se,He,We){return h.a.createElement(Ye.a,{disabledDate:Oi,format:"YYYY-MM-DD HH:mm",allowClear:!1,defaultValue:f()().add(7,"days"),showTime:{format:"HH:mm",defaultValue:f()(Object(m.d)(),"HH:mm")},onChange:function(Xe,ft){k[We].time=ft}})}}],K=function(){var Fe=Object(F.a)(B.a.mark(function Se(){var He,We,st,Xe,ft;return B.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return $e.next=2,En.validateFields();case 2:if(He=!1,k.filter(function(gt){return gt.checked}).map(function(gt){return gt.time}).map(function(gt){gt||(He=!0)}),!He){$e.next=7;break}return M.b.info("\u622A\u6B62\u65E5\u671F\u4E0D\u80FD\u4E3A\u7A7A"),$e.abrupt("return");case 7:return We={detail:!0,check_ids:[Sn.categoryId],group_ids:k.filter(function(gt){return gt.checked}).map(function(gt){return gt.id}),group_end_times:k.filter(function(gt){return gt.checked}).map(function(gt){return f()(gt.time).format("YYYY-MM-DD HH:mm")})},(k==null?void 0:k.length)===0&&(delete We.group_end_times,delete We.group_ids,delete We.detail,We.end_time=En.getFieldValue("end_time"),We.category_id=$t==null||((st=$t.workList)===null||st===void 0||((Xe=st.category)===null||Xe===void 0))?void 0:Xe.category_id),$e.next=11,Object(z.a)("/api/courses/".concat(Sn.coursesId,"/polls/publish.json"),{method:"post",body:We});case 11:ft=$e.sent,ft.status===0&&(ye(),M.b.success("\u53D1\u5E03\u6210\u529F"),cn({type:"polls/setActionTabs",payload:{}}),cn({type:"polls/getCommonHeader",payload:Object(x.a)({},$t.actionTabs.params)}),cn({type:"polls/getPollsList",payload:Object(x.a)({},Sn)}));case 13:case"end":return $e.stop()}},Se)}));return function(){return Fe.apply(this,arguments)}}(),oe=function(Se){U(Se),ri(Se),Qn(!1)},ye=function(){U(1),p([])},Te=_t>V*Et;return h.a.createElement(R.a,{centered:!0,title:"\u7ACB\u5373\u53D1\u5E03",visible:$t.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u7ACB\u5373\u53D1\u5E03",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:K,onCancel:function(){ye(),cn({type:"polls/setActionTabs",payload:{}})}},h.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A"),k&&h.a.createElement(c.a,{form:En},(k==null?void 0:k.length)===0&&h.a.createElement(E.a,{justify:"center",className:"mt30"},h.a.createElement(l.a,null,h.a.createElement(c.a.Item,{rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"}],name:"end_time",label:"\u622A\u6B62\u65F6\u95F4\uFF1A"},h.a.createElement(Ye.a,{getPopupContainer:function(Se){return Se.parentNode},allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:f()(Object(m.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm"})))),(k==null?void 0:k.length)>0&&h.a.createElement("div",{style:{maxHeight:260,overflow:"auto"}},h.a.createElement(ut.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:oe,hasMore:Te,useWindow:!1},h.a.createElement(e.a,{columns:hi,dataSource:k,pagination:!1}),In&&h.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},h.a.createElement(pe.a,null))))),(k==null?void 0:k.length)>0&&h.a.createElement(T.a,{checked:Nn,onClick:function(Se){Qn(Se.target.checked),Se.target.checked?k.map(function(He){return He.checked=!0}):k.map(function(He){return He.checked=!1}),p(Object(ee.a)(k))}},"\u5168\u9009"))},lt=Object(g.a)(function(rn){var Dt=rn.polls;return{polls:Dt}})(mt),Bt=G("/zsF"),Nt=G("PArb"),Wt=G("5Dmo"),Lt=G("3S7+"),Gt=G("+L6B"),Ut=G("2/Rp"),Re=G("OaEy"),je=G("2fM7"),tt=G("/MfK"),dt=G("w5pM"),ke=G("BilE"),ot=G.n(ke),ve=Ye.a.RangePicker,le=je.a.Option,ue=function(Dt){var $t,cn,Sn,Dn=Dt.polls,gn=Dt.loading,En=Dt.dispatch,sn=Object(D.i)(),et=Object(D.h)(),k=Dn.pollSetting,p=Dn.commonHeader,C=Object(j.useState)(!0),N=Object(O.a)(C,2),V=N[0],U=N[1],de=Object(j.useState)([]),ze=Object(O.a)(de,2),_t=ze[0],Mt=ze[1],ct=Object(j.useState)({end_time:"",publish_time:"",show_result:!1,un_anonymous:!1,unified_setting:!1}),Vt=Object(O.a)(ct,2),Et=Vt[0],Yt=Vt[1];Object(j.useEffect)(function(){dn()},[]);var dn=function(){En({type:"polls/getPollsSetting",payload:Object(x.a)({},sn)})};Object(j.useEffect)(function(){var ln;if(!(k!=null&&k.poll))return;Object.keys(Et).map(function(Jt){Et[Jt]=k.poll[Jt]}),_t=k==null||((ln=k.published_course_groups)===null||ln===void 0)?void 0:ln.filter(function(Jt){return Jt.course_publish_time!==null}).map(function(Jt){return Jt.publish_time=Jt.course_publish_time,Jt.end_time=Jt.course_end_time,Jt}),Yt(Et),Mt(_t)},[k]);var Un=function(){var ln=Object(F.a)(B.a.mark(function Jt(){var In,Wn,ii;return B.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Wn=JSON.parse(JSON.stringify(Et)),(In=_t)===null||In===void 0||In.map(function(Qn){var ri,Oi;if(!Qn.course_group_name||!((ri=Qn.course_group_name)!==null&&ri!==void 0&&ri.length))throw M.b.error("\u5206\u73ED\u4E0D\u80FD\u4E3A\u7A7A"),new String("\u5206\u73ED\u4E0D\u80FD\u4E3A\u7A7A");if(!Qn.publish_time||!Qn.end_time)throw M.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");Qn.course_group_id=Qn==null||((Oi=Qn.course_group_name)===null||Oi===void 0)?void 0:Oi.map(function(hi){var K,oe,ye;return(K=k.course_groups)===null||K===void 0||((oe=K.filter(function(Te){return Te.course_group_name===hi}))===null||oe===void 0||((ye=oe[0])===null||ye===void 0))?void 0:ye.course_group_id})}),Wn.categoryId=sn.categoryId,Wn.publish_time_groups=_t,Wn.show_result=!!Wn.show_result,Nn.next=7,Object(it.z)(Object(x.a)({},Wn));case 7:ii=Nn.sent,ii.status===0&&(M.b.success("\u66F4\u65B0\u6210\u529F"),U(!0));case 9:case"end":return Nn.stop()}},Jt)}));return function(){return ln.apply(this,arguments)}}(),On=function(Jt){return Jt&&Jt<f()().startOf("minute")},bn=function(Jt){return Et.end_time?Jt&&Jt<f()(Et.publish_time).startOf("minute"):Jt&&Jt<f()().startOf("minute")};return h.a.createElement("section",{className:ot.a.form},h.a.createElement("aside",{className:"bg-white pl30 pr30 inline-block w100"},h.a.createElement(E.a,null,h.a.createElement(l.a,{span:24},h.a.createElement(E.a,{align:"middle"},h.a.createElement(l.a,{flex:"1"},h.a.createElement("h1",{className:"mt15"},"\u53D1\u5E03\u8BBE\u7F6E")),h.a.createElement(l.a,null,Object(r.c)()&&V&&h.a.createElement(Ut.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return U(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),(k==null||(($t=k.course_groups)===null||$t===void 0)?void 0:$t.length)>0&&h.a.createElement(l.a,{span:24,className:"mt10"},h.a.createElement(T.a,{checked:Et.unified_setting,disabled:V||p.polls_status>1,onChange:function(){if(f()(Et.publish_time,"YYYY-MM-DD HH:mm")<=f()()){M.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}_t==""&&Mt([{}]),Et.unified_setting=!Et.unified_setting,Yt(Object.assign({},Et))}},h.a.createElement("strong",null,"\u7EDF\u4E00\u8BBE\u7F6E")),h.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u6240\u6709\u5206\u73ED\u4F7F\u7528\u76F8\u540C\u7684\u53D1\u5E03\u8BBE\u7F6E\uFF0C\u4EC5\u8BFE\u5802\u7BA1\u7406\u5458\u53EF\u4FEE\u6539\uFF1B\u5426\u5219\u5404\u4E2A\u5206\u73ED\u5141\u8BB8\u5355\u72EC\u8BBE\u7F6E)"))),Et.unified_setting&&h.a.createElement("div",null,h.a.createElement(E.a,{align:"middle",className:"mt25 pl30"},h.a.createElement(l.a,null,"\u53D1\u5E03\u65F6\u95F4:"),h.a.createElement(l.a,{className:"ml5"},h.a.createElement(Lt.a,{title:(k==null||((cn=k.poll)===null||cn===void 0)?void 0:cn.polls_status)>1&&"\u53D1\u5E03\u65F6\u95F4\u5DF2\u8FC7\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539"},h.a.createElement(Ye.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:f()(Object(m.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabledDate:On,disabled:V||(k==null||((Sn=k.poll)===null||Sn===void 0)?void 0:Sn.polls_status)>1,value:Et.publish_time?f()(Et.publish_time):"",allowClear:!1,onChange:function(Jt,In){Et.publish_time=In,Et.end_time||(Et.end_time=f()(Jt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Yt(Object.assign({},Et))}}))),h.a.createElement(l.a,null,h.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"))),h.a.createElement(E.a,{align:"middle",className:"mt25 pl30"},h.a.createElement(l.a,null,"\u622A\u6B62\u65F6\u95F4:"),h.a.createElement(l.a,{className:"ml5"},h.a.createElement(Ye.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:f()(Object(m.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:V,disabledDate:bn,allowClear:!1,value:Et.end_time?f()(Et.end_time):"",onChange:function(Jt,In){Et.end_time=In,Yt(Object.assign({},Et))}})),h.a.createElement(l.a,null,h.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!Et.unified_setting&&h.a.createElement(E.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},h.a.createElement(l.a,{span:24},h.a.createElement(E.a,null,h.a.createElement(l.a,{span:10}),h.a.createElement(l.a,{span:1}),h.a.createElement(l.a,{span:9},h.a.createElement(E.a,{className:"c-grey-c"},h.a.createElement(l.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u95EE\u5377\u7684\u65F6\u95F4)"),h.a.createElement(l.a,{flex:"1"},"(\u5B66\u751F\u53EF\u4EE5\u7B54\u9898\u7684\u65F6\u95F4\u622A\u70B9)"))),h.a.createElement(l.a,{span:4}))),_t&&_t.map(function(ln,Jt){return h.a.createElement(l.a,{span:24,key:Jt},h.a.createElement(E.a,{gutter:[8,16]},h.a.createElement(l.a,{span:10},h.a.createElement(E.a,null,h.a.createElement(l.a,null,"\u53D1\u5E03\u89C4\u5219 ",Jt+1),h.a.createElement(l.a,{flex:"1",style:{maxWidth:350}},h.a.createElement(je.a,{disabled:V,className:"ml20",mode:"multiple",style:{width:"100%"},value:ln.course_group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Wn){_t[Jt].course_group_name=Wn,Mt(_t.slice())}},k.course_groups&&k.course_groups.map(function(In){if(!_t.map(function(Wn){return Wn.course_group_name}).toString().split(",").includes(String(In.course_group_name)))return h.a.createElement(le,{value:In.course_group_name,key:In.course_group_id},In.course_group_name)}))))),h.a.createElement(l.a,{span:1}),h.a.createElement(l.a,{span:9},h.a.createElement(ve,{disabled:V||(p.polls_status===1?!1:[!0,!1]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],allowClear:!1,showTime:{format:"HH:mm",defaultValue:[f()(Object(m.d)(),"HH:mm"),f()(Object(m.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",defaultValue:ln.course_publish_time&&[f()(ln.course_publish_time),f()(ln.course_end_time)],onChange:function(Wn,ii){_t[Jt].publish_time=ii[0],_t[Jt].end_time=ii[1]}})),!V&&h.a.createElement(l.a,{span:4},Jt>0&&h.a.createElement(tt.a,{onClick:function(){_t=_t.filter(function(Wn,ii){return Jt!==ii}),Mt(_t.slice()),setTimeout(function(){return Mt(_t.slice())},10)}}),h.a.createElement(dt.a,{className:"c-green ml20",onClick:function(){Mt(_t.concat({}))}}))))})),h.a.createElement(Nt.a,null),h.a.createElement(E.a,{gutter:[20,20]},h.a.createElement(l.a,null,h.a.createElement("strong",null,"\u516C\u5F00\u8BBE\u7F6E")),h.a.createElement(l.a,{span:24,className:" pl30"},h.a.createElement(T.a,{checked:Et.show_result,disabled:V,onChange:function(Jt){Et.show_result=Jt.target.checked,Yt(Object.assign({},Et))}},h.a.createElement("strong",null,"\u516C\u5F00\u7EDF\u8BA1")),h.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u95EE\u5377\u622A\u6B62\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u95EE\u5377\u9898\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u7EDF\u8BA1\u7ED3\u679C\uFF0C\u5426\u5219\u4E0D\u80FD\u67E5\u770B)")),h.a.createElement(l.a,{span:24,className:" pl30"},h.a.createElement(T.a,{checked:Et.un_anonymous,disabled:V,onChange:function(Jt){Et.un_anonymous=Jt.target.checked,Yt(Object.assign({},Et))}},h.a.createElement("strong",null,"\u5B9E\u540D\u95EE\u5377")),h.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u6309\u7167\u5B66\u751F\u7684\u771F\u5B9E\u59D3\u540D\u63D0\u4EA4\uFF0C\u5426\u5219\u968F\u673A\u7F51\u540D\u540D\u79F0\u63D0\u4EA4)")))),h.a.createElement(E.a,null,h.a.createElement(l.a,null,!V&&h.a.createElement(l.a,{className:"mb50 mt20 btn-w120"},h.a.createElement(Ut.a,{type:"primary",size:"large",onClick:function(){return Un()}},"\u63D0\u4EA4"),h.a.createElement(Ut.a,{type:"primary",size:"large",onClick:function(){U(!0),dn()},ghost:!0,className:"ml20"},"\u53D6\u6D88")))))},$=Object(g.a)(function(rn){var Dt=rn.polls,$t=rn.loading;return{polls:Dt,loading:$t.effects}})(ue),Q=G("cWXX"),re=G("/ezw"),fe=G("MXD1"),Pe=G("CFYs"),Ge=G("pn8s"),bt=G.n(Ge),Ft={1:"\u5355\u9009\u9898",2:"\u591A\u9009\u9898",3:"\u4E3B\u89C2\u9898"},Xt=function(Dt){var $t,cn=Dt.polls,Sn=Dt.loading,Dn=Dt.dispatch,gn=Object(D.i)(),En=Object(j.useState)({page:1,pre_size:10}),sn=Object(O.a)(En,1),et=sn[0],k=cn.statisticsList,p=k.questions;Object(j.useEffect)(function(){et.page=1,C()},[gn.coursesId]);var C=function(){Dn({type:"polls/getPollsStatistics",payload:Object(x.a)(Object(x.a)({},gn),et)})};return h.a.createElement(re.a,{loading:Sn["polls/getPollsStatistics"]},h.a.createElement("section",{className:"minH500 mb50 bg-white pl30 pr30 inline-block w100"},h.a.createElement(re.a,{loading:Sn["polls/getPollsStatistics"]},p==""&&h.a.createElement(b.a,null),p==null?void 0:p.map(function(N,V){var U,de,ze,_t,Mt,ct,Vt,Et;return h.a.createElement("aside",{key:V},h.a.createElement("div",{className:"mt20"},h.a.createElement("span",{className:"c-blue font16"},N==null||((U=N.question)===null||U===void 0)?void 0:U.question_number,"\u3001",Ft[N.question.question_type]),h.a.createElement("span",{className:"tag-grey-eae ml10"},(N==null||((de=N.question)===null||de===void 0)?void 0:de.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54"),N.question.question_type===2&&h.a.createElement("span",{className:"ml10 c-grey-999"},"\u53EF\u9009",N==null||((ze=N.question)===null||ze===void 0)?void 0:ze.min_choices,"-",N==null||((_t=N.question)===null||_t===void 0)?void 0:_t.max_choices,"\u9879")),h.a.createElement("div",{className:"mt10"},h.a.createElement("span",{className:"font16"},N.question.question_title)),N.question.question_type!==3&&h.a.createElement("aside",null,h.a.createElement("div",{className:[bt.a.bg,"mt15"].join(" ")},h.a.createElement(E.a,{gutter:[20,20]},h.a.createElement(l.a,{flex:"1"},h.a.createElement("span",{className:"pl10"},"\u9009\u9879")),h.a.createElement(l.a,{flex:"100px"},"\u5C0F\u8BA1"),h.a.createElement(l.a,{flex:"440px"},"\u767E\u5206\u6BD4"))),(Mt=N.question)===null||Mt===void 0||((ct=Mt.answers)===null||ct===void 0)?void 0:ct.map(function(Yt,dn){return h.a.createElement("div",{key:dn},h.a.createElement(E.a,{gutter:[20,20],style:{marginBottom:0},key:dn},h.a.createElement(l.a,{flex:"1"},h.a.createElement("span",{className:"pl10"},Yt.answer_text)),h.a.createElement(l.a,{flex:"100px"},h.a.createElement("span",{className:"c-green"},Yt.answer_users_count)),h.a.createElement(l.a,{flex:"440px"},h.a.createElement(Pe.a,{status:"active",strokeColor:"#2abd8b",percent:(Yt.answer_percent*100).toFixed(1)}))),h.a.createElement(Nt.a,{style:{margin:0}}))})),N.question.question_type===3&&h.a.createElement("aside",null,h.a.createElement("div",{className:[bt.a.bg,"mt15"].join(" ")},h.a.createElement(E.a,{gutter:[20,20]},h.a.createElement(l.a,{flex:"100px"},h.a.createElement("span",{className:"pl10"},"\u7F16\u53F7")),h.a.createElement(l.a,{flex:"1"},"\u6587\u672C\u7B54\u6848"))),(Vt=N.question)===null||Vt===void 0||((Et=Vt.vote_text)===null||Et===void 0)?void 0:Et.map(function(Yt,dn){return h.a.createElement("div",{key:dn},h.a.createElement(E.a,{gutter:[20,20],style:{marginBottom:0},key:dn},h.a.createElement(l.a,{flex:"100px"},h.a.createElement("span",{className:"pl10"},dn+1)),h.a.createElement(l.a,{flex:"1"},h.a.createElement("span",{className:""},Yt))),h.a.createElement(Nt.a,{style:{margin:0}}))})),h.a.createElement(E.a,{gutter:[20,20],className:"mt10"},h.a.createElement(l.a,{flex:"1"},"\u6709\u6548\u586B\u5199\u6570\u91CF"),h.a.createElement(l.a,{flex:"540px"},N.question.commit_users_count)))}))),h.a.createElement("div",{className:" tc"},h.a.createElement(n.a,{hideOnSinglePage:!0,total:k==null||(($t=k.question_types)===null||$t===void 0)?void 0:$t.q_counts,current:et.page||1,onChange:function(V){et.page=V,C()}})))},Pt=Object(g.a)(function(rn){var Dt=rn.polls,$t=rn.loading;return{polls:Dt,loading:$t.effects}})(Xt),St=G("9Bee"),Ze=G("PpiC"),qe=G("D62m"),Me=G.n(qe),ne=["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"],me=function(Dt,$t){var cn=Dt.problemset,Sn=Dt.globalSetting,Dn=Dt.loading,gn=Dt.dispatch,En=Dt.onRef,sn=En===void 0?function(){}:En,et=Dt.editData,k=Dt.editKey,p=Dt.callback,C=Object(Ze.a)(Dt,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]),N=Object(j.useState)([]),V=Object(O.a)(N,2),U=V[0],de=V[1],ze=Object(j.useState)(),_t=Object(O.a)(ze,2),Mt=_t[0],ct=_t[1],Vt=Object(j.useState)([]),Et=Object(O.a)(Vt,2),Yt=Et[0],dn=Et[1],Un=Object(j.useState)(""),On=Object(O.a)(Un,2),bn=On[0],ln=On[1],Jt=Object(j.useState)(0),In=Object(O.a)(Jt,2),Wn=In[0],ii=In[1],Pn=Object(j.useState)(!0),Nn=Object(O.a)(Pn,2),Qn=Nn[0],ri=Nn[1],Oi=Object(j.useState)(!1),hi=Object(O.a)(Oi,2),K=hi[0],oe=hi[1],ye=Object(D.i)(),Te=Object(j.useState)(""),Fe=Object(O.a)(Te,2),Se=Fe[0],He=Fe[1],We=Object(j.useState)(""),st=Object(O.a)(We,2),Xe=st[0],ft=st[1];Object(j.useEffect)(function(){var ht,Tt,Rt,Zt,pn,qt;if(!(et!=null&&(ht=et.question)!==null&&ht!==void 0&&ht.question_title)){de([{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""}]),ri(!0),ln(""),oe(!1);return}He(et==null||((Tt=et.question)===null||Tt===void 0)?void 0:Tt.max_choices),ft(et==null||((Rt=et.question)===null||Rt===void 0)?void 0:Rt.min_choices),ln(et==null||((Zt=et.question)===null||Zt===void 0)?void 0:Zt.question_title),ri(!!(et!=null&&(pn=et.question)!==null&&pn!==void 0&&pn.is_necessary)),de(et==null||((qt=et.question)===null||qt===void 0)?void 0:qt.answers.map(function(Kt){return{value:Kt.answer_text,disabled:Kt.answer_text==="\u5176\u4ED6"}}))},[et]),Object(j.useImperativeHandle)($t,function(){return{onSave:pt}});var pt=function(){var ht=Object(F.a)(B.a.mark(function Tt(Rt){var Zt,pn,qt,Kt;return B.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(bn){an.next=3;break}return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),an.abrupt("return",!1);case 3:if(pn=U.findIndex(function(Yn){return!Yn.value}),!(pn>-1)){an.next=7;break}return M.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ne[pn]," \u9009\u9879\u7684\u5185\u5BB9")),an.abrupt("return",!1);case 7:if(Kt={question_title:bn,question_type:2,insert_id:et.insert_id,is_necessary:Math.ceil(Qn),max_choices:Se,min_choices:Xe,question_answers:U.map(function(Yn){return Yn.value})},!((Zt=et.question)!==null&&Zt!==void 0&&Zt.id)){an.next=14;break}return an.next=11,Object(it.h)(Object(x.a)({pollsId:et.question.id},Kt));case 11:qt=an.sent,an.next=17;break;case 14:return an.next=16,Object(it.b)(Object(x.a)({pollsId:ye.categoryId},Kt));case 16:qt=an.sent;case 17:if(!(qt.status===0)){an.next=23;break}return M.b.success("\u4FDD\u5B58\u6210\u529F"),p("edit",-1),an.next=22,gn({type:"polls/editPolls",payload:Object(x.a)({},ye)});case 22:Rt&&(Kt.answers=Kt.question_answers.map(function(Yn){return{answer_text:Yn}}),p("addContinue",Object(x.a)({type:2,insert_id:et.question.id,key:et.key,question_type:2},Kt)));case 23:case"end":return an.stop()}},Tt)}));return function(Rt){return ht.apply(this,arguments)}}(),$e=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],gt=function(){var ht=Object(F.a)(B.a.mark(function Tt(Rt){var Zt,pn;return B.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:Kt.t0=Rt.id,Kt.next=Kt.t0==="del"?3:Kt.t0==="up"||Kt.t0==="down"?5:Kt.t0==="edit"?9:Kt.t0==="add"?11:13;break;case 3:return R.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(F.a)(B.a.mark(function an(){var Yn;return B.a.wrap(function(pi){for(;;)switch(pi.prev=pi.next){case 0:return pi.next=2,Object(it.f)({pollsId:et==null||((Yn=et.question)===null||Yn===void 0)?void 0:Yn.id});case 2:gn({type:"polls/editPolls",payload:Object(x.a)({},ye)});case 3:case"end":return pi.stop()}},an)}))()}}),Kt.abrupt("break",13);case 5:return Kt.next=7,Object(it.t)({pollsId:et==null||((Zt=et.question)===null||Zt===void 0)?void 0:Zt.id,opr:Rt.id});case 7:return gn({type:"polls/editPolls",payload:Object(x.a)({},ye)}),Kt.abrupt("break",13);case 9:return p("edit",et.key),Kt.abrupt("break",13);case 11:return p("add",{type:2,key:et.key,insert_id:et==null||((pn=et.question)===null||pn===void 0)?void 0:pn.id,question_type:2}),Kt.abrupt("break",13);case 13:case"end":return Kt.stop()}},Tt)}));return function(Rt){return ht.apply(this,arguments)}}(),at=function(){var Tt,Rt,Zt;return h.a.createElement("aside",null,h.a.createElement("div",{className:Me.a.questionType},h.a.createElement("div",null,h.a.createElement("span",{className:"font16"},"\u7B2C",et.key,"\u9898"),h.a.createElement("span",{className:"font16 c-light-black ml10 mr20"},"\u591A\u9009\u9898")," \u53EF\u9009",et==null||((Tt=et.question)===null||Tt===void 0)?void 0:Tt.min_choices,"-",et==null||((Rt=et.question)===null||Rt===void 0)?void 0:Rt.max_choices,"\u9879")),h.a.createElement("div",{className:"mt5"},h.a.createElement(St.a,{value:et.question.question_title})),h.a.createElement("div",{className:Me.a.questionChoices},et==null||((Zt=et.question.answers)===null||Zt===void 0)?void 0:Zt.map(function(pn,qt){return h.a.createElement(E.a,null,h.a.createElement(l.a,null,h.a.createElement(T.a,{key:qt,disabled:!0},h.a.createElement("span",{className:"c-black font14"},pn.answer_text))))})))},It=function(){return h.a.createElement("aside",null,h.a.createElement("div",{className:Me.a.questionType},h.a.createElement("div",null,h.a.createElement("span",{className:"font16 c-blue"},"\u591A\u9009\u9898")," ",h.a.createElement(T.a,{checked:!!Qn,className:"ml10",onChange:function(Rt){return ri(Rt.target.checked)}},"\u5FC5\u7B54"))),h.a.createElement("p",{className:Me.a.titleWrap},h.a.createElement(o.a.TextArea,{rows:1,value:bn,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:function(Rt){return ln(Rt.target.value)}})),h.a.createElement("p",{className:Me.a.titleWrap},h.a.createElement("span",{className:Me.a.required},"*"),h.a.createElement("span",{className:Me.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:Me.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),U.map(function(Tt,Rt){return h.a.createElement(E.a,{className:Me.a.choiceWrap,key:Rt,gutter:[12,12]},h.a.createElement(l.a,null,h.a.createElement("span",{className:"font16"},"\u9009\u9879")),h.a.createElement(l.a,{className:Me.a.editorWrap,flex:"1"},h.a.createElement(o.a.TextArea,{value:U[Rt].value,rows:1,disabled:!!Tt.disabled,onChange:function(pn){U[Rt].value=pn.target.value,de(Object(ee.a)(U))}})),h.a.createElement(l.a,null,Rt>1&&h.a.createElement(Lt.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(Me.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){de(U.filter(function(pn,qt){return qt!==Rt})),Tt.disabled&&oe(!1)}}))))}),h.a.createElement(E.a,{gutter:[12,12]},h.a.createElement(l.a,null,"\u53EF\u9009"),h.a.createElement(l.a,null,h.a.createElement(je.a,{value:Xe,style:{width:120},onChange:function(Rt){return ft(Rt)}},h.a.createElement(je.a.Option,{value:""},"--"),U.map(function(Tt,Rt){return h.a.createElement(je.a.Option,{value:String(Rt+2)},Rt+2)})),h.a.createElement("span",{className:"ml10 mr10"},"~"),h.a.createElement(je.a,{style:{width:120},value:Se,onChange:function(Rt){return He(Rt)}},h.a.createElement(je.a.Option,{value:""},"--"),U.map(function(Tt,Rt){return h.a.createElement(je.a.Option,{value:String(Rt+2)},Rt+2)})))),h.a.createElement(E.a,{gutter:[12,12]},h.a.createElement(l.a,{flex:"1"},h.a.createElement(Ut.a,{type:"default",onClick:function(){return de([].concat(Object(ee.a)(U),[{value:""}]))}},"\u65B0\u589E\u9009\u9879"),!K&&h.a.createElement(Ut.a,{type:"default",className:"ml20",onClick:function(){de([].concat(Object(ee.a)(U),[{disabled:!0,value:"\u5176\u5B83"}])),oe(!0)}},"\u65B0\u589E\u5176\u4ED6\u9009\u9879")),h.a.createElement(l.a,{className:"tl"},h.a.createElement(Ut.a,{type:"default",onClick:function(){var Rt;(Rt=et.question)!==null&&Rt!==void 0&&Rt.id?p("edit",-1):p("del",et.key)}},"\u53D6\u6D88"),h.a.createElement(Ut.a,{className:"ml20",type:"primary",onClick:function(){return pt()}},"\u4FDD\u5B58"),h.a.createElement(Ut.a,{className:"ml20",type:"primary",onClick:function(){return pt(!0)}},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))))};return h.a.createElement("section",{className:Me.a.wrap},k!==et.key&&at(),k===et.key&&It())},rt=Object(g.a)(function(rn){var Dt=rn.problemset,$t=rn.loading,cn=rn.globalSetting;return{problemset:Dt,globalSetting:cn,loading:$t.effects}},null,null,{forwardRef:!0})(Object(j.forwardRef)(me)),Ke=G("7Kak"),xt=G("9yH6"),Ot=["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"],xe=function(Dt,$t){var cn=Dt.problemset,Sn=Dt.globalSetting,Dn=Dt.loading,gn=Dt.dispatch,En=Dt.onRef,sn=En===void 0?function(){}:En,et=Dt.editData,k=Dt.editKey,p=Dt.callback,C=Object(Ze.a)(Dt,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]),N=Object(j.useState)([]),V=Object(O.a)(N,2),U=V[0],de=V[1],ze=Object(j.useState)(),_t=Object(O.a)(ze,2),Mt=_t[0],ct=_t[1],Vt=Object(j.useState)([]),Et=Object(O.a)(Vt,2),Yt=Et[0],dn=Et[1],Un=Object(j.useState)(""),On=Object(O.a)(Un,2),bn=On[0],ln=On[1],Jt=Object(j.useState)(0),In=Object(O.a)(Jt,2),Wn=In[0],ii=In[1],Pn=Object(j.useState)(!1),Nn=Object(O.a)(Pn,2),Qn=Nn[0],ri=Nn[1],Oi=Object(j.useState)(!1),hi=Object(O.a)(Oi,2),K=hi[0],oe=hi[1],ye=Object(D.i)();Object(j.useEffect)(function(){var st,Xe,ft,pt;if(!(et!=null&&(st=et.question)!==null&&st!==void 0&&st.question_title)){de([{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""}]),ri(!1),ln(""),oe(!1);return}ln(et==null||((Xe=et.question)===null||Xe===void 0)?void 0:Xe.question_title),ri(!!(et!=null&&(ft=et.question)!==null&&ft!==void 0&&ft.is_necessary)),de(et==null||((pt=et.question)===null||pt===void 0)?void 0:pt.answers.map(function($e){return{value:$e.answer_text,disabled:$e.answer_text==="\u5176\u4ED6"}}))},[et]),Object(j.useImperativeHandle)($t,function(){return{onSave:Te}});var Te=function(){var st=Object(F.a)(B.a.mark(function Xe(ft){var pt,$e,gt,at;return B.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(bn){ht.next=3;break}return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),ht.abrupt("return",!1);case 3:if($e=U.findIndex(function(Tt){return!Tt.value}),!($e>-1)){ht.next=7;break}return M.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ot[$e]," \u9009\u9879\u7684\u5185\u5BB9")),ht.abrupt("return",!1);case 7:if(at={question_title:bn,question_type:1,insert_id:et.insert_id,is_necessary:Math.ceil(Qn),question_answers:U.map(function(Tt){return Tt.value})},!((pt=et.question)!==null&&pt!==void 0&&pt.id)){ht.next=15;break}return p("edit",-1),ht.next=12,Object(it.h)(Object(x.a)({pollsId:et.question.id},at));case 12:gt=ht.sent,ht.next=18;break;case 15:return ht.next=17,Object(it.b)(Object(x.a)({pollsId:ye.categoryId},at));case 17:gt=ht.sent;case 18:if(!(gt.status===0)){ht.next=23;break}return M.b.success("\u4FDD\u5B58\u6210\u529F"),ht.next=22,gn({type:"polls/editPolls",payload:Object(x.a)({},ye)});case 22:ft&&(at.answers=at.question_answers.map(function(Tt){return{answer_text:Tt}}),p("addContinue",Object(x.a)({type:1,insert_id:et.question.id,key:et.key,question_type:1},at)));case 23:case"end":return ht.stop()}},Xe)}));return function(ft){return st.apply(this,arguments)}}(),Fe=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],Se=function(){var st=Object(F.a)(B.a.mark(function Xe(ft){var pt,$e;return B.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:at.t0=ft.id,at.next=at.t0==="del"?3:at.t0==="up"||at.t0==="down"?5:at.t0==="edit"?9:at.t0==="add"?11:13;break;case 3:return R.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(F.a)(B.a.mark(function ht(){var Tt;return B.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(it.f)({pollsId:et==null||((Tt=et.question)===null||Tt===void 0)?void 0:Tt.id});case 2:gn({type:"polls/editPolls",payload:Object(x.a)({},ye)});case 3:case"end":return Zt.stop()}},ht)}))()}}),at.abrupt("break",13);case 5:return at.next=7,Object(it.t)({pollsId:et==null||((pt=et.question)===null||pt===void 0)?void 0:pt.id,opr:ft.id});case 7:return gn({type:"polls/editPolls",payload:Object(x.a)({},ye)}),at.abrupt("break",13);case 9:return p("edit",et.key),at.abrupt("break",13);case 11:return p("add",{type:1,key:et.key,insert_id:et==null||(($e=et.question)===null||$e===void 0)?void 0:$e.id,question_type:1}),at.abrupt("break",13);case 13:case"end":return at.stop()}},Xe)}));return function(ft){return st.apply(this,arguments)}}(),He=function(){var Xe;return h.a.createElement("aside",null,h.a.createElement("div",{className:Me.a.questionType},h.a.createElement("div",null,h.a.createElement("span",{className:"font16"},"\u7B2C",et.key,"\u9898"),h.a.createElement("span",{className:"font16 c-light-black ml10"},"\u5355\u9009\u9898"))),h.a.createElement("div",{className:"mt5"},h.a.createElement(St.a,{value:et.question.question_title})),h.a.createElement("div",{className:Me.a.questionChoices},et==null||((Xe=et.question.answers)===null||Xe===void 0)?void 0:Xe.map(function(ft,pt){return h.a.createElement(E.a,null,h.a.createElement(l.a,null,h.a.createElement(xt.a,{key:pt,disabled:!0})),h.a.createElement(l.a,{flex:"1"},h.a.createElement("span",{className:"c-black font14"},ft.answer_text)))})))},We=function(){return h.a.createElement("aside",null,h.a.createElement("div",{className:Me.a.questionType},h.a.createElement("div",null,h.a.createElement("span",{className:"font16 c-blue"},"\u5355\u9009\u9898")," ",h.a.createElement(T.a,{checked:!!Qn,className:"ml10",onChange:function(ft){return ri(ft.target.checked)}},"\u5FC5\u7B54"))),h.a.createElement("p",{className:Me.a.titleWrap},h.a.createElement(o.a.TextArea,{rows:1,value:bn,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:function(ft){return ln(ft.target.value)}})),h.a.createElement("p",{className:Me.a.titleWrap},h.a.createElement("span",{className:Me.a.required},"*"),h.a.createElement("span",{className:Me.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:Me.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),U.map(function(Xe,ft){return h.a.createElement(E.a,{className:Me.a.choiceWrap,key:ft,gutter:[12,12]},h.a.createElement(l.a,null,h.a.createElement("span",{className:"font16"},"\u9009\u9879")),h.a.createElement(l.a,{className:Me.a.editorWrap,flex:"1"},h.a.createElement(o.a.TextArea,{value:U[ft].value,rows:1,disabled:!!Xe.disabled,onChange:function($e){U[ft].value=$e.target.value,de(Object(ee.a)(U))}})),h.a.createElement(l.a,null,ft>1&&h.a.createElement(Lt.a,{title:"\u5220\u9664"},h.a.createElement("i",{className:"".concat(Me.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){de(U.filter(function($e,gt){return gt!==ft})),Xe.disabled&&oe(!1)}}))))}),h.a.createElement(E.a,{gutter:[12,12]},h.a.createElement(l.a,{flex:"1"},h.a.createElement(Ut.a,{type:"default",onClick:function(){return de([].concat(Object(ee.a)(U),[{value:""}]))}},"\u65B0\u589E\u9009\u9879"),!K&&h.a.createElement(Ut.a,{type:"default",className:"ml20",onClick:function(){de([].concat(Object(ee.a)(U),[{disabled:!0,value:"\u5176\u5B83"}])),oe(!0)}},"\u65B0\u589E\u5176\u4ED6\u9009\u9879")),h.a.createElement(l.a,{className:"tl"},h.a.createElement(Ut.a,{type:"default",onClick:function(){var ft;(ft=et.question)!==null&&ft!==void 0&&ft.id?p("edit",-1):p("del",et.key)}},"\u53D6\u6D88"),h.a.createElement(Ut.a,{className:"ml20",type:"primary",onClick:function(){return Te()}},"\u4FDD\u5B58"),h.a.createElement(Ut.a,{className:"ml20",type:"primary",onClick:function(){return Te(!0)}},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))))};return h.a.createElement("section",{className:Me.a.wrap},k!==et.key&&He(),k===et.key&&We())},Je=Object(g.a)(function(rn){var Dt=rn.problemset,$t=rn.loading,cn=rn.globalSetting;return{problemset:Dt,globalSetting:cn,loading:$t.effects}},null,null,{forwardRef:!0})(Object(j.forwardRef)(xe)),wt=["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"],jt=function(Dt,$t){var cn=Dt.problemset,Sn=Dt.globalSetting,Dn=Dt.loading,gn=Dt.dispatch,En=Dt.onRef,sn=En===void 0?function(){}:En,et=Dt.editData,k=Dt.editKey,p=Dt.callback,C=Object(Ze.a)(Dt,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]),N=Object(j.useState)(""),V=Object(O.a)(N,2),U=V[0],de=V[1],ze=Object(j.useState)(!0),_t=Object(O.a)(ze,2),Mt=_t[0],ct=_t[1],Vt=Object(D.i)();Object(j.useEffect)(function(){var bn,ln,Jt;if(!(et!=null&&(bn=et.question)!==null&&bn!==void 0&&bn.question_title)){ct(!0),de("");return}de(et==null||((ln=et.question)===null||ln===void 0)?void 0:ln.question_title),ct(!!(et!=null&&(Jt=et.question)!==null&&Jt!==void 0&&Jt.is_necessary))},[et]),Object(j.useImperativeHandle)($t,function(){return{onSave:Et}});var Et=function(){var bn=Object(F.a)(B.a.mark(function ln(Jt){var In,Wn,ii;return B.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(U){Nn.next=3;break}return M.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Nn.abrupt("return",!1);case 3:if(ii={question_title:U,question_type:3,insert_id:et.insert_id,is_necessary:Math.ceil(Mt)},!((In=et.question)!==null&&In!==void 0&&In.id)){Nn.next=10;break}return Nn.next=7,Object(it.h)(Object(x.a)({pollsId:et.question.id},ii));case 7:Wn=Nn.sent,Nn.next=13;break;case 10:return Nn.next=12,Object(it.b)(Object(x.a)({pollsId:Vt.categoryId},ii));case 12:Wn=Nn.sent;case 13:if(!(Wn.status===0)){Nn.next=19;break}return M.b.success("\u4FDD\u5B58\u6210\u529F"),p("edit",-1),Nn.next=18,gn({type:"polls/editPolls",payload:Object(x.a)({},Vt)});case 18:Jt&&p("addContinue",Object(x.a)({type:3,insert_id:et.question.id,key:et.key,question_type:3},ii));case 19:case"end":return Nn.stop()}},ln)}));return function(Jt){return bn.apply(this,arguments)}}(),Yt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],dn=function(){var bn=Object(F.a)(B.a.mark(function ln(Jt){var In,Wn;return B.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:Pn.t0=Jt.id,Pn.next=Pn.t0==="del"?3:Pn.t0==="up"||Pn.t0==="down"?5:Pn.t0==="edit"?9:Pn.t0==="add"?11:13;break;case 3:return R.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(F.a)(B.a.mark(function Qn(){var ri;return B.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:return hi.next=2,Object(it.f)({pollsId:et==null||((ri=et.question)===null||ri===void 0)?void 0:ri.id});case 2:gn({type:"polls/editPolls",payload:Object(x.a)({},Vt)});case 3:case"end":return hi.stop()}},Qn)}))()}}),Pn.abrupt("break",13);case 5:return Pn.next=7,Object(it.t)({pollsId:et==null||((In=et.question)===null||In===void 0)?void 0:In.id,opr:Jt.id});case 7:return gn({type:"polls/editPolls",payload:Object(x.a)({},Vt)}),Pn.abrupt("break",13);case 9:return p("edit",et.key),Pn.abrupt("break",13);case 11:return p("add",{type:3,key:et.key,insert_id:et==null||((Wn=et.question)===null||Wn===void 0)?void 0:Wn.id,question_type:3}),Pn.abrupt("break",13);case 13:case"end":return Pn.stop()}},ln)}));return function(Jt){return bn.apply(this,arguments)}}(),Un=function(){return h.a.createElement("aside",null,h.a.createElement("div",{className:Me.a.questionType},h.a.createElement("div",null,h.a.createElement("span",{className:"font16"},"\u7B2C",et.key,"\u9898"),h.a.createElement("span",{className:"font16 c-light-black ml10 mr20"},"\u4E3B\u89C2\u9898"),Mt&&h.a.createElement("span",{className:"tag-grey-eae"},"\u5FC5\u7B54"))),h.a.createElement("div",{className:"mt5"},h.a.createElement(St.a,{value:et.question.question_title})),h.a.createElement("div",{className:Me.a.questionChoices},h.a.createElement(o.a.TextArea,{rows:5,disabled:!0})))},On=function(){return h.a.createElement("aside",null,h.a.createElement("div",{className:Me.a.questionType},h.a.createElement("div",null,h.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898")," ",h.a.createElement(T.a,{checked:!!Mt,className:"ml10",onChange:function(Jt){return ct(Jt.target.checked)}},"\u5FC5\u7B54"))),h.a.createElement("p",{className:Me.a.titleWrap},h.a.createElement(o.a.TextArea,{rows:1,value:U,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:function(Jt){return de(Jt.target.value)}})),h.a.createElement("p",{className:Me.a.titleWrap},h.a.createElement("span",{className:Me.a.required},"*"),h.a.createElement("span",{className:Me.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",h.a.createElement("span",{className:Me.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),h.a.createElement(E.a,{gutter:[12,12]},h.a.createElement(l.a,{flex:"1"}),h.a.createElement(l.a,{className:"tl"},h.a.createElement(Ut.a,{type:"default",onClick:function(){var Jt;(Jt=et.question)!==null&&Jt!==void 0&&Jt.id?p("edit",-1):p("del",et.key)}},"\u53D6\u6D88"),h.a.createElement(Ut.a,{className:"ml20",type:"primary",onClick:function(){return Et()}},"\u4FDD\u5B58"),h.a.createElement(Ut.a,{className:"ml20",type:"primary",onClick:function(){return Et(!0)}},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))))};return h.a.createElement("section",{className:Me.a.wrap},k!==et.key&&Un(),k===et.key&&On())},Qt=Object(g.a)(function(rn){var Dt=rn.problemset,$t=rn.loading,cn=rn.globalSetting;return{problemset:Dt,globalSetting:cn,loading:$t.effects}},null,null,{forwardRef:!0})(Object(j.forwardRef)(jt)),Gn={1:"\u5355\u9009\u9898",2:"\u591A\u9009\u9898",3:"\u4E3B\u89C2\u9898"},Vn=function(Dt){var $t,cn=Dt.polls,Sn=Dt.loading,Dn=Dt.dispatch,gn=Object(D.i)(),En=cn.statisticsList,sn=cn.commonHeader,et=Object(j.useState)({page:1,pre_size:10}),k=Object(O.a)(et,1),p=k[0],C=En.questions,N=En.questionsInfo,V=En.question_types,U=En.course,de=c.a.useForm(),ze=Object(O.a)(de,1),_t=ze[0],Mt=function(){return C==null?void 0:C.map(function(Et,Yt){var dn,Un;if(Et.key=Et==null||((dn=Et.question)===null||dn===void 0)?void 0:dn.question_number,Et.len=C.length,Et.question.question_type===1)return h.a.createElement("aside",null,h.a.createElement(Je,{editData:Et}),h.a.createElement(Nt.a,null));if(Et.question.question_type===2)return h.a.createElement("aside",null,h.a.createElement(rt,{editData:Et}),h.a.createElement(Nt.a,null));if(((Un=Et.question)===null||Un===void 0?void 0:Un.question_type)===3)return h.a.createElement("aside",null,h.a.createElement(Qt,{editData:Et}),h.a.createElement(Nt.a,null))})};Object(j.useEffect)(function(){ct()},[gn.coursesId]);var ct=function(){Dn({type:"polls/getPollsStatistics",payload:Object(x.a)(Object(x.a)({},gn),p)})};return h.a.createElement(re.a,{loading:Sn["polls/getPollsStatistics"]},h.a.createElement("section",{className:"minH500 mb50"},(V==null?void 0:V.q_counts)===0&&h.a.createElement(b.a,null),(sn==null?void 0:sn.polls_description)&&h.a.createElement("aside",{className:"bg-white pl30 pr30 pt20 pb20"},h.a.createElement(St.a,{value:sn==null?void 0:sn.polls_description})),(V==null?void 0:V.q_counts)>0&&h.a.createElement("div",{style:{padding:"20px",background:"#Fafafa",fontSize:14}},h.a.createElement("span",null," \u5408\u8BA1\uFF1A",V==null?void 0:V.q_counts," \u9898"),(V==null?void 0:V.q_mains)>0&&h.a.createElement("span",{className:"ml10"},"\u4E3B\u89C2\u9898\uFF1A",V.q_mains),(V==null?void 0:V.q_singles)>0&&h.a.createElement("span",{className:"ml10"},"\u5355\u9009\u9898\uFF1A",V.q_singles),(V==null?void 0:V.q_doubles)>0&&h.a.createElement("span",{className:"ml10"},"\u591A\u9009\u9898\uFF1A",V.q_doubles)),h.a.createElement("aside",{className:"bg-white pl30 pr30 inline-block w100"},Mt()),h.a.createElement("div",{className:"mt30 tc"},h.a.createElement(n.a,{hideOnSinglePage:!0,total:En==null||(($t=En.question_types)===null||$t===void 0)?void 0:$t.q_counts,current:p.page||1,onChange:function(Et){p.page=Et,ct()}}))))},ei=Object(g.a)(function(rn){var Dt=rn.polls,$t=rn.loading;return{polls:Dt,loading:$t.effects}})(Vn),ci=G("scVo"),ni=G.n(ci),_i=function(Dt){var $t,cn,Sn,Dn,gn,En=Dt.polls,sn=Dt.globalSetting,et=Dt.loading,k=Dt.dispatch,p=Dt.user,C=Object(D.i)(),N=Object(D.h)(),V=Object(j.useState)([]),U=Object(O.a)(V,2),de=U[0],ze=U[1],_t=Object(j.useState)(N.query.tabs||0),Mt=Object(O.a)(_t,2),ct=Mt[0],Vt=Mt[1],Et=En.pollsList,Yt=En.commonHeader,dn=p.userInfo,Un;C.category=N.query.category_id,Object(j.useEffect)(function(){k({type:"polls/getPollsList",payload:Object(x.a)({},C)}),k({type:"polls/getCommonHeader",payload:Object(x.a)({},C)})},[C.coursesId]);var On=[{name:"\u7B54\u9898\u5217\u8868",id:0,compontent:h.a.createElement(q,null)},{name:"\u7EDF\u8BA1\u7ED3\u679C",id:1,compontent:h.a.createElement(Pt,null)},{name:"\u95EE\u5377\u9884\u89C8",id:2,compontent:h.a.createElement(ei,null)},{name:"\u8BBE\u7F6E",id:3,compontent:h.a.createElement($,null)}].filter(function(bn){return Object(r.s)()?bn.name!=="\u7EDF\u8BA1\u7ED3\u679C"&&bn.name!=="\u95EE\u5377\u9884\u89C8":!0});return h.a.createElement("section",{className:ni.a.bg},h.a.createElement("div",{className:"edu-container"},dn.username&&h.a.createElement("section",{className:"animated fadeIn"},h.a.createElement("aside",{className:"mt10"},h.a.createElement(W.a,{separator:">"},h.a.createElement(W.a.Item,null,h.a.createElement(w.a,{to:"/classrooms/".concat(C.coursesId,"/poll")},dn==null||(($t=dn.course)===null||$t===void 0)?void 0:$t.course_name)),h.a.createElement(W.a.Item,null,h.a.createElement(w.a,{to:"/classrooms/".concat(C.coursesId,"/poll")},Yt==null||((cn=Yt.user_permission)===null||cn===void 0)?void 0:cn.left_banner_name)),h.a.createElement(W.a.Item,null,"\u95EE\u5377\u8BE6\u60C5"))),h.a.createElement("aside",{className:[ni.a.title,"mt20"].join(" ")},h.a.createElement(w.a,{to:"/classrooms/".concat(C.coursesId,"/poll")}),h.a.createElement("strong",{className:"font20 ml5"},Yt.polls_name),h.a.createElement(m.m,{status:[m.k[Yt.polls_status]]}))),h.a.createElement("aside",{className:"mt30 mb30 relative "},Object(r.s)()&&h.a.createElement("div",{className:ni.a.export},h.a.createElement(w.a,{target:"_blank",to:"/classrooms/".concat(C.coursesId,"/poll/").concat(C.categoryId,"/users/").concat(dn.login)},(Yt==null||((Sn=Yt.user_permission)===null||Sn===void 0)?void 0:Sn.current_status)===0&&"\u7EE7\u7EED\u7B54\u9898",(Yt==null||((Dn=Yt.user_permission)===null||Dn===void 0)?void 0:Dn.current_status)===1&&"\u67E5\u770B\u7B54\u9898",(Yt==null||((gn=Yt.user_permission)===null||gn===void 0)?void 0:gn.current_status)===2&&"\u5F00\u59CB\u7B54\u9898")),Object(r.c)()&&h.a.createElement("div",{className:ni.a.export},h.a.createElement(w.a,{to:"/classrooms/".concat(C.coursesId,"/poll/").concat(C.categoryId,"/edit")},"\u7F16\u8F91\u95EE\u5377"),Yt.polls_status===1&&h.a.createElement("a",{onClick:function(ln){ln.preventDefault(),k({type:"polls/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",params:C,selectArrs:[C.categoryId]}})}},"\u7ACB\u5373\u53D1\u5E03"),Yt.polls_status===2&&h.a.createElement("a",{onClick:function(ln){ln.preventDefault(),k({type:"polls/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:C,selectArrs:[C.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"),h.a.createElement("span",{className:"c-blue ml30 current",onClick:function(){return Object(u.j)(Object(x.a)({},C))}},"\u5BFC\u51FA\u7EDF\u8BA1")),h.a.createElement(H.a,{defaultActiveKey:ct,className:ni.a.tabs,onChange:function(ln){Vt(ln)}},On.map(function(bn,ln){return h.a.createElement(H.a.TabPane,{tab:bn.name,key:bn.id})})),On.map(function(bn){if(bn.id==ct)return bn.compontent}))),h.a.createElement(lt,null),h.a.createElement(Ve,null))},di=Qe.default=Object(g.a)(function(rn){var Dt=rn.polls,$t=rn.loading,cn=rn.user,Sn=rn.globalSetting;return{polls:Dt,globalSetting:Sn,user:cn,loading:$t.effects}})(_i)},LSTS:function(zt,Qe,G){"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});var te=function(){function m(u,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(u,n.key,n)}}return function(u,r,t){return r&&m(u.prototype,r),t&&m(u,t),u}}(),H=G("q1tI"),L=O(H),W=G("17x9"),x=O(W);function O(m){return m&&m.__esModule?m:{default:m}}function j(m,u){var r={};for(var t in m){if(u.indexOf(t)>=0)continue;if(!Object.prototype.hasOwnProperty.call(m,t))continue;r[t]=m[t]}return r}function h(m,u){if(!(m instanceof u))throw new TypeError("Cannot call a class as a function")}function D(m,u){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:m}function w(m,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);m.prototype=Object.create(u&&u.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(m,u):m.__proto__=u)}var g=function(m){w(u,m);function u(r){h(this,u);var t=D(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,r));return t.scrollListener=t.scrollListener.bind(t),t.eventListenerOptions=t.eventListenerOptions.bind(t),t.mousewheelListener=t.mousewheelListener.bind(t),t}return te(u,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var t=!1,n={get passive(){t=!0}};try{document.addEventListener("test",null,n),document.removeEventListener("test",null,n)}catch(s){}return t}},{key:"eventListenerOptions",value:function(){var t=this.props.useCapture;return this.isPassiveSupported()&&(t={useCapture:this.props.useCapture,passive:!0}),t}},{key:"setDefaultLoader",value:function(t){this.defaultLoader=t}},{key:"detachMousewheelListener",value:function(){var t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(t){var n=this.props.getScrollParent&&this.props.getScrollParent();return n!=null?n:t&&t.parentNode}},{key:"filterProps",value:function(t){return t}},{key:"attachScrollListener",value:function(){var t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;var n=window;this.props.useWindow===!1&&(n=t),n.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),n.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}},{key:"scrollListener",value:function(){var t=this.scrollComponent,n=window,s=this.getParentElement(t),e=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,o=n.pageYOffset!==void 0?n.pageYOffset:i.scrollTop;this.props.isReverse?e=o:e=this.calculateOffset(t,o)}else this.props.isReverse?e=s.scrollTop:e=t.scrollHeight-s.scrollTop-s.clientHeight;e<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=s.scrollHeight,this.beforeScrollTop=s.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(t,n){return t?this.calculateTopPosition(t)+(t.offsetHeight-n-window.innerHeight):0}},{key:"calculateTopPosition",value:function(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}},{key:"render",value:function(){var t=this,n=this.filterProps(this.props),s=n.children,e=n.element,i=n.hasMore,o=n.initialLoad,S=n.isReverse,E=n.loader,y=n.loadMore,T=n.pageStart,_=n.ref,l=n.threshold,d=n.useCapture,a=n.useWindow,c=n.getScrollParent,v=j(n,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);v.ref=function(b){t.scrollComponent=b,_&&_(b)};var f=[s];return i&&(E?S?f.unshift(E):f.push(E):this.defaultLoader&&(S?f.unshift(this.defaultLoader):f.push(this.defaultLoader))),L.default.createElement(e,v,f)}}]),u}(H.Component);g.propTypes={children:x.default.node.isRequired,element:x.default.node,hasMore:x.default.bool,initialLoad:x.default.bool,isReverse:x.default.bool,loader:x.default.node,loadMore:x.default.func.isRequired,pageStart:x.default.number,ref:x.default.func,getScrollParent:x.default.func,threshold:x.default.number,useCapture:x.default.bool,useWindow:x.default.bool},g.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},Qe.default=g,zt.exports=Qe.default},LdHM:function(zt,Qe,G){"use strict";G.d(Qe,"b",function(){return o}),G.d(Qe,"a",function(){return E});var te=G("1OyB"),H=G("vuIU"),L=G("Ji7U"),W=G("LK+K"),x=G("q1tI"),O=G("rePB"),j=G("Ff2n"),h=G("ODXe"),D=G("4IlW"),w=G("bX4T"),g=G("YrtM"),m=G("TSYQ"),u=G.n(m),r=G("+nKL"),t=G("8OUc"),n=function(B,z){var Z=B.prefixCls,ae=B.id,De=B.flattenOptions,_e=B.childrenAsData,Oe=B.values,Ne=B.searchValue,Ue=B.multiple,Ee=B.defaultActiveFirstOption,q=B.height,J=B.itemHeight,pe=B.notFoundContent,ee=B.open,Ae=B.menuItemSelectedIcon,Ve=B.virtual,Le=B.onSelect,Ye=B.onToggleOpen,it=B.onActiveValue,vt=B.onScroll,ut=B.onMouseEnter,mt="".concat(Z,"-item"),lt=Object(g.a)(function(){return De},[ee,De],function(ot,ve){return ve[0]&&ot[1]!==ve[1]}),Bt=x.useRef(null),Nt=function(ve){ve.preventDefault()},Wt=function(ve){Bt.current&&Bt.current.scrollTo({index:ve})},Lt=function(ve){for(var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ue=lt.length,$=0;$<ue;$+=1){var Q=(ve+$*le+ue)%ue,re=lt[Q],fe=re.group,Pe=re.data;if(!fe&&!Pe.disabled)return Q}return-1},Gt=x.useState(function(){return Lt(0)}),Ut=Object(h.a)(Gt,2),Re=Ut[0],je=Ut[1],tt=function(ve){je(ve);var le=lt[ve];if(!le){it(null,-1);return}it(le.data.value,ve)};x.useEffect(function(){tt(Ee!==!1?Lt(0):-1)},[lt.length,Ne]),x.useEffect(function(){var ot=setTimeout(function(){if(!Ue&&ee&&Oe.size===1){var ve=Array.from(Oe)[0],le=lt.findIndex(function(ue){var $=ue.data;return $.value===ve});tt(le),Wt(le)}});return function(){return clearTimeout(ot)}},[ee]);var dt=function(ve){ve!==void 0&&Le(ve,{selected:!Oe.has(ve)}),Ue||Ye(!1)};if(x.useImperativeHandle(z,function(){return{onKeyDown:function(ve){var le=ve.which;switch(le){case D.a.UP:case D.a.DOWN:{var ue=0;if(le===D.a.UP?ue=-1:le===D.a.DOWN&&(ue=1),ue!==0){var $=Lt(Re+ue,ue);Wt($),tt($)}break}case D.a.ENTER:{var Q=lt[Re];Q&&!Q.data.disabled?dt(Q.data.value):dt(void 0),ee&&ve.preventDefault();break}case D.a.ESC:Ye(!1)}},onKeyUp:function(){},scrollTo:function(ve){Wt(ve)}}}),lt.length===0)return x.createElement("div",{role:"listbox",id:"".concat(ae,"_list"),className:"".concat(mt,"-empty"),onMouseDown:Nt},pe);function ke(ot){var ve=lt[ot];if(!ve)return null;var le=ve.data||{},ue=le.value,$=le.label,Q=le.children,re=Object(w.a)(le,!0),fe=_e?Q:$;return ve?x.createElement("div",Object.assign({"aria-label":typeof fe=="string"?fe:null},re,{key:ot,role:"option",id:"".concat(ae,"_list_").concat(ot),"aria-selected":Oe.has(ue)}),ue):null}return x.createElement(x.Fragment,null,x.createElement("div",{role:"listbox",id:"".concat(ae,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(Re-1),ke(Re),ke(Re+1)),x.createElement(r.a,{itemKey:"key",ref:Bt,data:lt,height:q,itemHeight:J,fullHeight:!1,onMouseDown:Nt,onScroll:vt,virtual:Ve,onMouseEnter:ut},function(ot,ve){var le,ue=ot.group,$=ot.groupOption,Q=ot.data,re=Q.label,fe=Q.key;if(ue)return x.createElement("div",{className:u()(mt,"".concat(mt,"-group"))},re!==void 0?re:fe);var Pe=Q.disabled,Ge=Q.value,bt=Q.title,Ft=Q.children,Xt=Q.style,Pt=Q.className,St=Object(j.a)(Q,["disabled","value","title","children","style","className"]),Ze=Oe.has(Ge),qe="".concat(mt,"-option"),Me=u()(mt,qe,Pt,(le={},Object(O.a)(le,"".concat(qe,"-grouped"),$),Object(O.a)(le,"".concat(qe,"-active"),Re===ve&&!Pe),Object(O.a)(le,"".concat(qe,"-disabled"),Pe),Object(O.a)(le,"".concat(qe,"-selected"),Ze),le)),ne=_e?Ft:re,me=!Ae||typeof Ae=="function"||Ze;return x.createElement("div",Object.assign({},St,{"aria-selected":Ze,className:Me,title:bt,onMouseMove:function(){if(Re===ve||Pe)return;tt(ve)},onClick:function(){Pe||dt(Ge)},style:Xt}),x.createElement("div",{className:"".concat(qe,"-content")},ne||Ge),x.isValidElement(Ae)||Ze,me&&x.createElement(t.a,{className:"".concat(mt,"-option-state"),customizeIcon:Ae,customizeIconProps:{isSelected:Ze}},Ze?"\u2713":null))}))},s=x.forwardRef(n);s.displayName="OptionList";var e=s,i=function(){return null};i.isSelectOption=!0;var o=i,S=function(){return null};S.isSelectOptGroup=!0;var E=S,y=G("VTBJ"),T=G("Zm9Q");function _(A){var B=A.key,z=A.props,Z=z.children,ae=z.value,De=Object(j.a)(z,["children","value"]);return Object(y.a)({key:B,value:ae!==void 0?ae:B,children:Z},De)}function l(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(T.a)(A).map(function(z,Z){if(!x.isValidElement(z)||!z.type)return null;var ae=z.type.isSelectOptGroup,De=z.key,_e=z.props,Oe=_e.children,Ne=Object(j.a)(_e,["children"]);return B||!ae?_(z):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(De===null?Z:De,"__"),label:De},Ne),{},{options:l(Oe)})}).filter(function(z){return z})}var d=G("2Qr1"),a=G("qNPg"),c=G("U8pU"),v=G("Kwbf"),f=G("WKfj");function b(A){var B=A.mode,z=A.options,Z=A.children,ae=A.backfill,De=A.allowClear,_e=A.placeholder,Oe=A.getInputElement,Ne=A.showSearch,Ue=A.onSearch,Ee=A.defaultOpen,q=A.autoFocus,J=A.labelInValue,pe=A.value,ee=A.inputValue,Ae=A.optionLabelProp,Ve=B==="multiple"||B==="tags",Le=Ne!==void 0?Ne:Ve||B==="combobox",Ye=z||l(Z);if(Object(v.a)(B!=="tags"||Ye.every(function(mt){return!mt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),B==="tags"||B==="combobox"){var it=Ye.some(function(mt){return mt.options?mt.options.some(function(lt){return typeof("value"in lt?lt.value:lt.key)=="number"}):typeof("value"in mt?mt.value:mt.key)=="number"});Object(v.a)(!it,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(B!=="combobox"||!Ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(B==="combobox"||!ae,"`backfill` only works with `combobox` mode."),Object(v.a)(B==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(v.b)(B!=="combobox"||!Oe||!De||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ue&&!Le&&B!=="combobox"&&B!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!Ee||q,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),pe!=null){var vt=Object(f.d)(pe);Object(v.a)(!J||vt.every(function(mt){return Object(c.a)(mt)==="object"&&("key"in mt||"value"in mt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!Ve||Array.isArray(pe),"`value` should be array when `mode` is `multiple` or `tags`")}if(Z){var ut=null;Object(T.a)(Z).some(function(mt){if(!x.isValidElement(mt)||!mt.type)return!1;var lt=mt.type;if(lt.isSelectOption)return!1;if(lt.isSelectOptGroup){var Bt=Object(T.a)(mt.props.children).every(function(Nt){return!x.isValidElement(Nt)||!mt.type||Nt.type.isSelectOption?!0:(ut=Nt.type,!1)});return!Bt}return ut=lt,!0}),ut&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ut.displayName||ut.name||ut,"`.")),Object(v.a)(ee===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=b,R=Object(a.a)({prefixCls:"rc-select",components:{optionList:e},convertChildrenToData:l,flattenOptions:d.d,getLabeledValue:d.e,filterOptions:d.b,isValueDisabled:d.g,findValueOption:d.c,warningProps:I,fillOptionsWithMissingValue:d.a}),P=function(A){Object(L.a)(z,A);var B=Object(W.a)(z);function z(){var Z;return Object(te.a)(this,z),Z=B.apply(this,arguments),Z.selectRef=x.createRef(),Z.focus=function(){Z.selectRef.current.focus()},Z.blur=function(){Z.selectRef.current.blur()},Z}return Object(H.a)(z,[{key:"render",value:function(){return x.createElement(R,Object.assign({ref:this.selectRef},this.props))}}]),z}(x.Component);P.Option=o,P.OptGroup=E;var M=P,F=Qe.c=M},NvD2:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return O});var te=G("Kwbf");function H(j,h){var D=new Set;return j.forEach(function(w){h.has(w)||D.add(w)}),D}function L(j){var h=j||{},D=h.disabled,w=h.disableCheckbox,g=h.checkable;return!!(D||w)||g===!1}function W(j,h,D,w){for(var g=new Set(j),m=new Set,u=0;u<=D;u+=1){var r=h.get(u)||new Set;r.forEach(function(e){var i=e.key,o=e.node,S=e.children,E=S===void 0?[]:S;g.has(i)&&!w(o)&&E.filter(function(y){return!w(y.node)}).forEach(function(y){g.add(y.key)})})}for(var t=new Set,n=D;n>=0;n-=1){var s=h.get(n)||new Set;s.forEach(function(e){var i=e.parent,o=e.node;if(w(o)||!e.parent||t.has(e.parent.key))return;if(w(e.parent.node)){t.add(i.key);return}var S=!0,E=!1;(i.children||[]).filter(function(y){return!w(y.node)}).forEach(function(y){var T=y.key,_=g.has(T);S&&!_&&(S=!1),!E&&(_||m.has(T))&&(E=!0)}),S&&g.add(i.key),E&&m.add(i.key),t.add(i.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(H(m,g))}}function x(j,h,D,w,g){for(var m=new Set(j),u=new Set(h),r=0;r<=w;r+=1){var t=D.get(r)||new Set;t.forEach(function(i){var o=i.key,S=i.node,E=i.children,y=E===void 0?[]:E;!m.has(o)&&!u.has(o)&&!g(S)&&y.filter(function(T){return!g(T.node)}).forEach(function(T){m.delete(T.key)})})}u=new Set;for(var n=new Set,s=w;s>=0;s-=1){var e=D.get(s)||new Set;e.forEach(function(i){var o=i.parent,S=i.node;if(g(S)||!i.parent||n.has(i.parent.key))return;if(g(i.parent.node)){n.add(o.key);return}var E=!0,y=!1;(o.children||[]).filter(function(T){return!g(T.node)}).forEach(function(T){var _=T.key,l=m.has(_);E&&!l&&(E=!1),!y&&(l||u.has(_))&&(y=!0)}),E||m.delete(o.key),y&&u.add(o.key),n.add(o.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(H(u,m))}}function O(j,h,D,w){var g=[],m;w?m=w:m=L;var u=new Set(j.filter(function(s){var e=!!D[s];return e||g.push(s),e})),r=new Map,t=0;Object.keys(D).forEach(function(s){var e=D[s],i=e.level,o=r.get(i);o||(o=new Set,r.set(i,o)),o.add(e),t=Math.max(t,i)}),Object(te.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var n;return h===!0?n=W(u,r,t,m):n=x(u,h.halfCheckedKeys,r,t,m),n}},OLES:function(zt,Qe,G){"use strict";var te=G("U8pU"),H=G("VTBJ"),L=G("Ff2n"),W=G("q1tI"),x=G("uciX"),O=G("7ixt"),j=function(u){var r=u.overlay,t=u.prefixCls,n=u.id,s=u.overlayInnerStyle;return W.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:s},typeof r=="function"?r():r)},h=j,D=function(u,r){var t=u.overlayClassName,n=u.trigger,s=n===void 0?["hover"]:n,e=u.mouseEnterDelay,i=e===void 0?0:e,o=u.mouseLeaveDelay,S=o===void 0?.1:o,E=u.overlayStyle,y=u.prefixCls,T=y===void 0?"rc-tooltip":y,_=u.children,l=u.onVisibleChange,d=u.afterVisibleChange,a=u.transitionName,c=u.animation,v=u.placement,f=v===void 0?"right":v,b=u.align,I=b===void 0?{}:b,R=u.destroyTooltipOnHide,P=R===void 0?!1:R,M=u.defaultVisible,F=u.getTooltipContainer,A=u.overlayInnerStyle,B=Object(L.a)(u,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),z=Object(W.useRef)(null);Object(W.useImperativeHandle)(r,function(){return z.current});var Z=Object(H.a)({},B);"visible"in u&&(Z.popupVisible=u.visible);var ae=function(){var Ue=u.arrowContent,Ee=Ue===void 0?null:Ue,q=u.overlay,J=u.id;return[W.createElement("div",{className:"".concat(T,"-arrow"),key:"arrow"},Ee),W.createElement(h,{key:"content",prefixCls:T,id:J,overlay:q,overlayInnerStyle:A})]},De=!1,_e=!1;if(typeof P=="boolean")De=P;else if(P&&Object(te.a)(P)==="object"){var Oe=P.keepParent;De=Oe===!0,_e=Oe===!1}return W.createElement(x.a,Object.assign({popupClassName:t,prefixCls:T,popup:ae,action:s,builtinPlacements:O.a,popupPlacement:f,ref:z,popupAlign:I,getPopupContainer:F,onPopupVisibleChange:l,afterPopupVisibleChange:d,popupTransitionName:a,popupAnimation:c,defaultPopupVisible:M,destroyPopupOnHide:De,autoDestroy:_e,mouseLeaveDelay:S,popupStyle:E,mouseEnterDelay:i},Z),_)},w=Object(W.forwardRef)(D),g=Qe.a=w},OZM5:function(zt,Qe,G){"use strict";G.d(Qe,"b",function(){return w}),G.d(Qe,"a",function(){return g}),G.d(Qe,"k",function(){return m}),G.d(Qe,"h",function(){return u}),G.d(Qe,"i",function(){return r}),G.d(Qe,"g",function(){return t}),G.d(Qe,"c",function(){return n}),G.d(Qe,"d",function(){return s}),G.d(Qe,"j",function(){return o}),G.d(Qe,"e",function(){return S}),G.d(Qe,"f",function(){return E});var te=G("KQm4"),H=G("U8pU"),L=G("Ff2n"),W=G("q1tI"),x=G.n(W),O=G("Kwbf"),j=G("WaYH"),h=.25,D=2;function w(y,T){var _=y.slice(),l=_.indexOf(T);return l>=0&&_.splice(l,1),_}function g(y,T){var _=y.slice();return _.indexOf(T)===-1&&_.push(T),_}function m(y){return y.split("-")}function u(y,T){return"".concat(y,"-").concat(T)}function r(y){return y&&y.type&&y.type.isTreeNode}function t(y,T){var _=[y],l=T[y];function d(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(c){var v=c.key,f=c.children;_.push(v),d(f)})}return d(l.children),_}function n(y,T){var _=y.clientY,l=T.selectHandle.getBoundingClientRect(),d=l.top,a=l.bottom,c=l.height,v=Math.max(c*h,D);return _<=d+v?-1:_>=a-v?1:0}function s(y,T){if(!y)return;var _=T.multiple;return _?y.slice():y.length?[y[0]]:y}var e=function(T){return T};function i(y,T){if(!y)return[];var _=T||{},l=_.processProps,d=l===void 0?e:l,a=Array.isArray(y)?y:[y];return a.map(function(c){var v=c.children,f=Object(L.a)(c,["children"]),b=i(v,T);return x.a.createElement(j.a,Object.assign({},d(f)),b)})}function o(y){if(!y)return null;var T;if(Array.isArray(y))T={checkedKeys:y,halfCheckedKeys:void 0};else if(Object(H.a)(y)==="object")T={checkedKeys:y.checked||void 0,halfCheckedKeys:y.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return T}function S(y,T){var _=new Set;function l(d){if(_.has(d))return;var a=T[d];if(!a)return;_.add(d);var c=a.parent,v=a.node;if(v.disabled)return;c&&l(c.key)}return(y||[]).forEach(function(d){l(d)}),Object(te.a)(_)}function E(y){var T={};return Object.keys(y).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(T[_]=y[_])}),T}},RotF:function(zt,Qe,G){zt.exports=G("LSTS")},"SA+Z":function(zt,Qe,G){var te=G("wTVA"),H=G("EbDI"),L=G("ZhPi"),W=G("wkBT");function x(O){return te(O)||H(O)||L(O)||W()}zt.exports=x,zt.exports.__esModule=!0,zt.exports.default=zt.exports},SJMd:function(zt,Qe){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var G,te,H,L=!1,W,x;window.PR_SHOULD_USE_CONTINUATION=!0;var O,j;(function(){var h=window,D=["break,continue,do,else,for,if,return,while"],w=[D,"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"],g=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[g,"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"],u=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],r=[g,"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"],t="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",n=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",e=[D,"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"],i=[D,"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"],o=[D,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[m,r,u,n,s,e,i,o],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y="str",T="kwd",_="com",l="typ",d="lit",a="pun",c="pln",v="tag",f="dec",b="src",I="atn",R="atv",P="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(Le){for(var Ye=0,it=!1,vt=!1,ut=0,mt=Le.length;ut<mt;++ut){var lt=Le[ut];if(lt.ignoreCase)vt=!0;else if(/[a-z]/i.test(lt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){it=!0,vt=!1;break}}var Bt={b:8,t:9,n:10,v:11,f:12,r:13};function Nt(Re){var je=Re.charCodeAt(0);if(je!==92)return je;var tt=Re.charAt(1);return je=Bt[tt],je||("0"<=tt&&tt<="7"?parseInt(Re.substring(1),8):tt==="u"||tt==="x"?parseInt(Re.substring(2),16):Re.charCodeAt(1))}function Wt(Re){if(Re<32)return(Re<16?"\\x0":"\\x")+Re.toString(16);var je=String.fromCharCode(Re);return je==="\\"||je==="-"||je==="]"||je==="^"?"\\"+je:je}function Lt(Re){var je=Re.substring(1,Re.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")),tt=[],dt=je[0]==="^",ke=["["];dt&&ke.push("^");for(var ot=dt?1:0,ve=je.length;ot<ve;++ot){var le=je[ot];if(/\\[bdsw]/i.test(le))ke.push(le);else{var ue=Nt(le),$;ot+2<ve&&je[ot+1]==="-"?($=Nt(je[ot+2]),ot+=2):$=ue,tt.push([ue,$]),$<65||ue>122||($<65||ue>90||tt.push([Math.max(65,ue)|32,Math.min($,90)|32]),$<97||ue>122||tt.push([Math.max(97,ue)&~32,Math.min($,122)&~32]))}}tt.sort(function(Pe,Ge){return Pe[0]-Ge[0]||Ge[1]-Pe[1]});for(var Q=[],re=[],ot=0;ot<tt.length;++ot){var fe=tt[ot];fe[0]<=re[1]+1?re[1]=Math.max(re[1],fe[1]):Q.push(re=fe)}for(var ot=0;ot<Q.length;++ot){var fe=Q[ot];ke.push(Wt(fe[0])),fe[1]>fe[0]&&(fe[1]+1>fe[0]&&ke.push("-"),ke.push(Wt(fe[1])))}return ke.push("]"),ke.join("")}function Gt(Re){for(var je=Re.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),tt=je.length,dt=[],ke=0,ot=0;ke<tt;++ke){var ve=je[ke];if(ve==="(")++ot;else if(ve.charAt(0)==="\\"){var le=+ve.substring(1);le&&(le<=ot?dt[le]=-1:je[ke]=Wt(le))}}for(var ke=1;ke<dt.length;++ke)dt[ke]===-1&&(dt[ke]=++Ye);for(var ke=0,ot=0;ke<tt;++ke){var ve=je[ke];if(ve==="(")++ot,dt[ot]||(je[ke]="(?:");else if(ve.charAt(0)==="\\"){var le=+ve.substring(1);le&&le<=ot&&(je[ke]="\\"+dt[le])}}for(var ke=0;ke<tt;++ke)je[ke]==="^"&&je[ke+1]!=="^"&&(je[ke]="");if(Re.ignoreCase&&it)for(var ke=0;ke<tt;++ke){var ve=je[ke],ue=ve.charAt(0);ve.length>=2&&ue==="["?je[ke]=Lt(ve):ue!=="\\"&&(je[ke]=ve.replace(/[a-zA-Z]/g,function(re){var fe=re.charCodeAt(0);return"["+String.fromCharCode(fe&~32,fe|32)+"]"}))}return je.join("")}for(var Ut=[],ut=0,mt=Le.length;ut<mt;++ut){var lt=Le[ut];if(lt.global||lt.multiline)throw new Error(""+lt);Ut.push("(?:"+Gt(lt)+")")}return new RegExp(Ut.join("|"),vt?"gi":"g")}function A(Le,Ye){var it=/(?:^|\s)nocode(?:\s|$)/,vt=[],ut=0,mt=[],lt=0;function Bt(Nt){var Wt=Nt.nodeType;if(Wt==1){if(it.test(Nt.className))return;for(var Lt=Nt.firstChild;Lt;Lt=Lt.nextSibling)Bt(Lt);var Gt=Nt.nodeName.toLowerCase();(Gt==="br"||Gt==="li")&&(vt[lt]=`
|
|
`,mt[lt<<1]=ut++,mt[lt++<<1|1]=Nt)}else if(Wt==3||Wt==4){var Ut=Nt.nodeValue;Ut.length&&(Ye?Ut=Ut.replace(/\r\n?/g,`
|
|
`):Ut=Ut.replace(/[ \t\r\n]+/g," "),vt[lt]=Ut,mt[lt<<1]=ut,ut+=Ut.length,mt[lt++<<1|1]=Nt)}}return Bt(Le),{sourceCode:vt.join("").replace(/\n$/,""),spans:mt}}function B(Le,Ye,it,vt,ut){if(!it)return;var mt={sourceNode:Le,pre:1,langExtension:null,numberLines:null,sourceCode:it,spans:null,basePos:Ye,decorations:null};vt(mt),ut.push.apply(ut,mt.decorations)}var z=/\S/;function Z(Le){for(var Ye=void 0,it=Le.firstChild;it;it=it.nextSibling){var vt=it.nodeType;Ye=vt===1?Ye?Le:it:vt===3&&z.test(it.nodeValue)?Le:Ye}return Ye===Le?void 0:Ye}function ae(Le,Ye){var it={},vt;(function(){for(var lt=Le.concat(Ye),Bt=[],Nt={},Wt=0,Lt=lt.length;Wt<Lt;++Wt){var Gt=lt[Wt],Ut=Gt[3];if(Ut)for(var Re=Ut.length;--Re>=0;)it[Ut.charAt(Re)]=Gt;var je=Gt[1],tt=""+je;Nt.hasOwnProperty(tt)||(Bt.push(je),Nt[tt]=null)}Bt.push(/[\0-\uffff]/),vt=F(Bt)})();var ut=Ye.length,mt=function(lt){for(var Bt=lt.sourceCode,Nt=lt.basePos,Wt=lt.sourceNode,Lt=[Nt,c],Gt=0,Ut=Bt.match(vt)||[],Re={},je=0,tt=Ut.length;je<tt;++je){var dt=Ut[je],ke=Re[dt],ot=void 0,ve;if(typeof ke=="string")ve=!1;else{var le=it[dt.charAt(0)];if(le)ot=dt.match(le[1]),ke=le[0];else{for(var ue=0;ue<ut;++ue)if(le=Ye[ue],ot=dt.match(le[1]),ot){ke=le[0];break}ot||(ke=c)}ve=ke.length>=5&&ke.substring(0,5)==="lang-",ve&&!(ot&&typeof ot[1]=="string")&&(ve=!1,ke=b),ve||(Re[dt]=ke)}var $=Gt;if(Gt+=dt.length,!ve)Lt.push(Nt+$,ke);else{var Q=ot[1],re=dt.indexOf(Q),fe=re+Q.length;ot[2]&&(fe=dt.length-ot[2].length,re=fe-Q.length);var Pe=ke.substring(5);B(Wt,Nt+$,dt.substring(0,re),mt,Lt),B(Wt,Nt+$+re,Q,q(Pe,Q),Lt),B(Wt,Nt+$+fe,dt.substring(fe),mt,Lt)}}lt.decorations=Lt};return mt}function De(Le){var Ye=[],it=[];Le.tripleQuotedStrings?Ye.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Le.multiLineStrings?Ye.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ye.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Le.verbatimStrings&&it.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var vt=Le.hashComments;vt&&(Le.cStyleComments?(vt>1?Ye.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ye.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),it.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ye.push([_,/^#[^\r\n]*/,null,"#"])),Le.cStyleComments&&(it.push([_,/^\/\/[^\r\n]*/,null]),it.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ut=Le.regexLiterals;if(ut){var mt=ut>1?"":`
|
|
\r`,lt=mt?".":"[\\S\\s]",Bt="/(?=[^/*"+mt+"])(?:[^/\\x5B\\x5C"+mt+"]|\\x5C"+lt+"|\\x5B(?:[^\\x5C\\x5D"+mt+"]|\\x5C"+lt+")*(?:\\x5D|$))+/";it.push(["lang-regex",RegExp("^"+M+"("+Bt+")")])}var Nt=Le.types;Nt&&it.push([l,Nt]);var Wt=(""+Le.keywords).replace(/^ | $/g,"");Wt.length&&it.push([T,new RegExp("^(?:"+Wt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ye.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var Lt="^.[^\\s\\w.$@'\"`/\\\\]*";return Le.regexLiterals&&(Lt+="(?!s*/)"),it.push([d,/^@[a-z_$][a-z_$@0-9]*/i,null],[l,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[d,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[a,new RegExp(Lt),null]),ae(Ye,it)}var _e=De({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(Le,Ye,it){for(var vt=/(?:^|\s)nocode(?:\s|$)/,ut=/\r\n?|\n/,mt=Le.ownerDocument,lt=mt.createElement("li");Le.firstChild;)lt.appendChild(Le.firstChild);var Bt=[lt];function Nt(je){var tt=je.nodeType;if(tt==1&&!vt.test(je.className))if(je.nodeName==="br")Wt(je),je.parentNode&&je.parentNode.removeChild(je);else for(var dt=je.firstChild;dt;dt=dt.nextSibling)Nt(dt);else if((tt==3||tt==4)&&it){var ke=je.nodeValue,ot=ke.match(ut);if(ot){var ve=ke.substring(0,ot.index);je.nodeValue=ve;var le=ke.substring(ot.index+ot[0].length);if(le){var ue=je.parentNode;ue.insertBefore(mt.createTextNode(le),je.nextSibling)}Wt(je),ve||je.parentNode.removeChild(je)}}}function Wt(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function tt(ot,ve){var le=ve?ot.cloneNode(!1):ot,ue=ot.parentNode;if(ue){var $=tt(ue,1),Q=ot.nextSibling;$.appendChild(le);for(var re=Q;re;re=Q)Q=re.nextSibling,$.appendChild(re)}return le}for(var dt=tt(je.nextSibling,0),ke;(ke=dt.parentNode)&&ke.nodeType===1;)dt=ke;Bt.push(dt)}for(var Lt=0;Lt<Bt.length;++Lt)Nt(Bt[Lt]);Ye===(Ye|0)&&Bt[0].setAttribute("value",Ye);var Gt=mt.createElement("ol");Gt.className="linenums";for(var Ut=Math.max(0,Ye-1|0)||0,Lt=0,Re=Bt.length;Lt<Re;++Lt)lt=Bt[Lt],lt.className="L"+(Lt+Ut)%10,lt.firstChild||lt.appendChild(mt.createTextNode("\xA0")),Gt.appendChild(lt);Le.appendChild(Gt)}function Ne(Le){var Ye=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ye=Ye&&+Ye[1]<=8;var it=/\n/g,vt=Le.sourceCode,ut=vt.length,mt=0,lt=Le.spans,Bt=lt.length,Nt=0,Wt=Le.decorations,Lt=Wt.length,Gt=0;Wt[Lt]=ut;var Ut,Re;for(Re=Ut=0;Re<Lt;)Wt[Re]!==Wt[Re+2]?(Wt[Ut++]=Wt[Re++],Wt[Ut++]=Wt[Re++]):Re+=2;for(Lt=Ut,Re=Ut=0;Re<Lt;){for(var je=Wt[Re],tt=Wt[Re+1],dt=Re+2;dt+2<=Lt&&Wt[dt+1]===tt;)dt+=2;Wt[Ut++]=je,Wt[Ut++]=tt,Re=dt}Lt=Wt.length=Ut;var ke=Le.sourceNode,ot="";ke&&(ot=ke.style.display,ke.style.display="none");try{for(var ve=null;Nt<Bt;){var le=lt[Nt],ue=lt[Nt+2]||ut,$=Wt[Gt+2]||ut,dt=Math.min(ue,$),Q=lt[Nt+1],re;if(Q.nodeType!==1&&(re=vt.substring(mt,dt))){Ye&&(re=re.replace(it,"\r")),Q.nodeValue=re;var fe=Q.ownerDocument,Pe=fe.createElement("span");Pe.className=Wt[Gt+1];var Ge=Q.parentNode;Ge.replaceChild(Pe,Q),Pe.appendChild(Q),mt<ue&&(lt[Nt+1]=Q=fe.createTextNode(vt.substring(dt,ue)),Ge.insertBefore(Q,Pe.nextSibling))}mt=dt,mt>=ue&&(Nt+=2),mt>=$&&(Gt+=2)}}finally{ke&&(ke.style.display=ot)}}var Ue={};function Ee(Le,Ye){for(var it=Ye.length;--it>=0;){var vt=Ye[it];Ue.hasOwnProperty(vt)?h.console&&console.warn("cannot override language handler %s",vt):Ue[vt]=Le}}function q(Le,Ye){return Le&&Ue.hasOwnProperty(Le)||(Le=/^\s*</.test(Ye)?"default-markup":"default-code"),Ue[Le]}Ee(_e,["default-code"]),Ee(ae([],[[c,/^[^<?]+/],[f,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[a,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ee(ae([[c,/^[\s]+/,null,` \r
|
|
`],[R,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[a,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Ee(ae([],[[R,/^[\s\S]+/]]),["uq.val"]),Ee(De({keywords:m,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),Ee(De({keywords:"null,true,false"}),["json"]),Ee(De({keywords:r,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),Ee(De({keywords:u,cStyleComments:!0}),["java"]),Ee(De({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ee(De({keywords:e,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ee(De({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ee(De({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ee(De({keywords:n,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ee(De({keywords:t,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ee(ae([],[[y,/^[\s\S]+/]]),["regex"]);function J(Le){var Ye=Le.langExtension;try{var it=A(Le.sourceNode,Le.pre),vt=it.sourceCode;Le.sourceCode=vt,Le.spans=it.spans,Le.basePos=0,q(Ye,vt)(Le),Ne(Le)}catch(ut){h.console&&console.log(ut&&ut.stack||ut)}}function pe(Le,Ye,it){var vt=it||!1,ut=Ye||null,mt=document.createElement("div");mt.innerHTML="<pre>"+Le+"</pre>",mt=mt.firstChild,vt&&Oe(mt,vt,!0);var lt={langExtension:ut,numberLines:vt,sourceNode:mt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return J(lt),mt.innerHTML}function ee(Le,Ye){var it=Ye||document.body,vt=it.ownerDocument||document;function ut(le){return it.getElementsByTagName(le)}for(var mt=[ut("pre"),ut("code"),ut("xmp")],lt=[],Bt=0;Bt<mt.length;++Bt)for(var Nt=0,Wt=mt[Bt].length;Nt<Wt;++Nt)lt.push(mt[Bt][Nt]);mt=null;var Lt=Date;Lt.now||(Lt={now:function(){return+new Date}});var Gt=0,Ut=/\blang(?:uage)?-([\w.]+)(?!\S)/,Re=/\bprettyprint\b/,je=/\bprettyprinted\b/,tt=/pre|xmp/i,dt=/^code$/i,ke=/^(?:pre|code|xmp)$/i,ot={};function ve(){for(var le=h.PR_SHOULD_USE_CONTINUATION?Lt.now()+250:Infinity;Gt<lt.length&&Lt.now()<le;Gt++){for(var ue=lt[Gt],$=ot,Q=ue;Q=Q.previousSibling;){var re=Q.nodeType,fe=(re===7||re===8)&&Q.nodeValue;if(fe?!/^\??prettify\b/.test(fe):re!==3||/\S/.test(Q.nodeValue))break;if(fe){$={},fe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(rt,Ke,xt){$[Ke]=xt});break}}var Pe=ue.className;if(($!==ot||Re.test(Pe))&&!je.test(Pe)){for(var Ge=!1,bt=ue.parentNode;bt;bt=bt.parentNode){var Ft=bt.tagName;if(ke.test(Ft)&&bt.className&&Re.test(bt.className)){Ge=!0;break}}if(!Ge){ue.className+=" prettyprinted";var Xt=$.lang;if(!Xt){Xt=Pe.match(Ut);var Pt;!Xt&&(Pt=Z(ue))&&dt.test(Pt.tagName)&&(Xt=Pt.className.match(Ut)),Xt&&(Xt=Xt[1])}var St;if(tt.test(ue.tagName))St=1;else{var Ze=ue.currentStyle,qe=vt.defaultView,Me=Ze?Ze.whiteSpace:qe&&qe.getComputedStyle?qe.getComputedStyle(ue,null).getPropertyValue("white-space"):0;St=Me&&Me.substring(0,3)==="pre"}var ne=$.linenums;(ne=ne==="true"||+ne)||(ne=Pe.match(/\blinenums\b(?::(\d+))?/),ne=ne?ne[1]&&ne[1].length?+ne[1]:!0:!1),ne&&Oe(ue,ne,St);var me={langExtension:Xt,sourceNode:ue,numberLines:ne,pre:St,sourceCode:null,basePos:null,spans:null,decorations:null};J(me)}}}Gt<lt.length?h.setTimeout(ve,250):typeof Le=="function"&&Le()}ve()}var Ae=h.PR={createSimpleLexer:ae,registerLangHandler:Ee,sourceDecorator:De,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:R,PR_COMMENT:_,PR_DECLARATION:f,PR_KEYWORD:T,PR_LITERAL:d,PR_NOCODE:P,PR_PLAIN:c,PR_PUNCTUATION:a,PR_SOURCE:b,PR_STRING:y,PR_TAG:v,PR_TYPE:l,prettyPrintOne:L?h.prettyPrintOne=pe:O=pe,prettyPrint:j=L?h.prettyPrint=ee:j=ee},Ve=h.define;typeof Ve=="function"&&Ve.amd&&Ve("google-code-prettify",[],function(){return Ae})})()},TXwP:function(zt,Qe,G){var te,H;(function(){var L;(function(){"use strict";var x=[,,function(D){function w(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}w.prototype.clone_empty=function(){var u=new w(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},w.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},w.prototype.has_match=function(u){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(u))return!0;return!1},w.prototype.set_indent=function(u,r){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},w.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},w.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(u){this.__items.push(u);var r=u.lastIndexOf(`
|
|
`);r!==-1?this.__character_count=u.length-r:this.__character_count+=u.length},w.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,r){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),r=r||"",u.indent_level>0&&(r=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}g.prototype.get_indent_size=function(u,r){var t=this.__base_string_length;return r=r||0,u<0&&(t=0),t+=u*this.__indent_size,t+=r,t},g.prototype.get_indent_string=function(u,r){var t=this.__base_string;return r=r||0,u<0&&(u=0,t=""),r+=u*this.__indent_size,this.__ensure_cache(r),t+=this.__cache[r],t},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,r=0,t="";this.__indent_size&&u>=this.__indent_size&&(r=Math.floor(u/this.__indent_size),u-=r*this.__indent_size,t=new Array(r+1).join(this.__indent_string)),u&&(t+=new Array(u+1).join(" ")),this.__cache.push(t)};function m(u,r){this.__indent_cache=new g(u,r),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(u,r){return this.__indent_cache.get_indent_string(u,r)},m.prototype.get_indent_size=function(u,r){return this.__indent_cache.get_indent_size(u,r)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(u){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
|
|
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(t=t.replace(/[\n]/g,u)),t},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(u,r){return u=u||0,r=r||0,this.next_line.set_indent(u,r),this.__lines.length>1?(this.current_line.set_indent(u,r),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(u){for(var r=0;r<u.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(u){for(var r=this.__lines.length;u<r;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(u,r){for(var t=this.__lines.length-2;t>=0;){var n=this.__lines[t];if(n.is_empty())break;if(n.item(0).indexOf(u)!==0&&n.item(-1)!==r){this.__lines.splice(t+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},D.exports.Output=m},,,,function(D){function w(u,r){this.raw_options=g(u,r),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}w.prototype._get_array=function(u,r){var t=this.raw_options[u],n=r||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(n=t.concat()):typeof t=="string"&&(n=t.split(/[^a-zA-Z0-9_\/\-]+/)),n},w.prototype._get_boolean=function(u,r){var t=this.raw_options[u],n=t===void 0?!!r:!!t;return n},w.prototype._get_characters=function(u,r){var t=this.raw_options[u],n=r||"";return typeof t=="string"&&(n=t.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),n},w.prototype._get_number=function(u,r){var t=this.raw_options[u];r=parseInt(r,10),isNaN(r)&&(r=0);var n=parseInt(t,10);return isNaN(n)&&(n=r),n},w.prototype._get_selection=function(u,r,t){var n=this._get_selection_list(u,r,t);if(n.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[u]+"'");return n[0]},w.prototype._get_selection_list=function(u,r,t){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[r[0]],!this._is_valid_selection(t,r))throw new Error("Invalid Default Value!");var n=this._get_array(u,t);if(!this._is_valid_selection(n,r))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[u]+"'");return n},w.prototype._is_valid_selection=function(u,r){return u.length&&r.length&&!u.some(function(t){return r.indexOf(t)===-1})};function g(u,r){var t={};u=m(u);var n;for(n in u)n!==r&&(t[n]=u[n]);if(r&&u[r])for(n in u[r])t[n]=u[r][n];return t}function m(u){var r={},t;for(t in u){var n=t.replace(/-/g,"_");r[n]=u[t]}return r}D.exports.Options=w,D.exports.normalizeOpts=m,D.exports.mergeOpts=g},,function(D){var w=RegExp.prototype.hasOwnProperty("sticky");function g(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},g.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(u=this.__input.charAt(m)),u},g.prototype.__match=function(m,u){m.lastIndex=u;var r=m.exec(this.__input);return r&&!(w&&m.sticky)&&(r.index!==u&&(r=null)),r},g.prototype.test=function(m,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(m,u):!1},g.prototype.testChar=function(m,u){var r=this.peek(u);return m.lastIndex=0,r!==null&&m.test(r)},g.prototype.match=function(m){var u=this.__match(m,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(m,u,r){var t="",n;return m&&(n=this.match(m),n&&(t+=n[0])),u&&(n||!m)&&(t+=this.readUntil(u,r)),t},g.prototype.readUntil=function(m,u){var r="",t=this.__position;m.lastIndex=this.__position;var n=m.exec(this.__input);return n?(t=n.index,u&&(t+=n[0].length)):t=this.__input_length,r=this.__input.substring(this.__position,t),this.__position=t,r},g.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},g.prototype.get_regexp=function(m,u){var r=null,t="g";return u&&w&&(t="y"),typeof m=="string"&&m!==""?r=new RegExp(m,t):m&&(r=new RegExp(m.source,t)),r},g.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(m){var u=this.__position,r=this.readUntilAfter(m);return this.__position=u,r},g.prototype.lookBack=function(m){var u=this.__position-1;return u>=m.length&&this.__input.substring(u-m.length,u).toLowerCase()===m},D.exports.InputScanner=g},,,,,function(D){function w(g,m){g=typeof g=="string"?g:g.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+m,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)m[u[1]]=u[2],u=this.__directive_pattern.exec(g);return m},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=w},,function(D,w,g){var m=g(16).Beautifier,u=g(17).Options;function r(t,n){var s=new m(t,n);return s.beautify()}D.exports=r,D.exports.defaultOptions=function(){return new u}},function(D,w,g){var m=g(17).Options,u=g(2).Output,r=g(8).InputScanner,t=g(13).Directives,n=new t(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,e=/\r\n|[\r\n]/g,i=/\s/,o=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function y(T,_){this._source_text=T||"",this._options=new m(_),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}y.prototype.eatString=function(T){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(T.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return _},y.prototype.eatWhitespace=function(T){for(var _=i.test(this._input.peek()),l=0;i.test(this._input.peek());)this._ch=this._input.next(),T&&this._ch===`
|
|
`&&((l===0||l<this._options.max_preserve_newlines)&&(l++,this._output.add_new_line(!0)));return _},y.prototype.foundNestedPseudoClass=function(){for(var T=0,_=1,l=this._input.peek(_);l;){if(l==="{")return!0;if(l==="(")T+=1;else if(l===")"){if(T===0)return!1;T-=1}else if(l===";"||l==="}")return!1;_++,l=this._input.peek(_)}return!1},y.prototype.print_string=function(T){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(T)},y.prototype.preserveSingleSpace=function(T){T&&(this._output.space_before_token=!0)},y.prototype.indent=function(){this._indentLevel++},y.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,_=this._options.eol;_==="auto"&&(_=`
|
|
`,T&&s.test(T||"")&&(_=T.match(s)[0])),T=T.replace(e,`
|
|
`);var l=T.match(/^[\t ]*/)[0];this._output=new u(this._options,l),this._input=new r(T),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var d=0,a=!1,c=!1,v=!1,f=!1,b=!1,I=!1,R=this._ch,P=!1,M,F,A;M=this._input.read(o),F=M!=="",A=R,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),R=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var B=this._input.read(S),z=n.get_directives(B);z&&z.ignore==="start"&&(B+=n.readIgnored(this._input)),this.print_string(B),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(F),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Z=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Z.match(/[ :]$/)&&(Z=this.eatString(": ").replace(/\s$/,""),this.print_string(Z),this._output.space_before_token=!0),Z=Z.replace(/\s$/,""),Z==="extend"?f=!0:Z==="import"&&(b=!0),Z in this.NESTED_AT_RULE?(this._nestedLevel+=1,Z in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!a&&d===0&&Z.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(F),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),v?(v=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(A==="("?this._output.space_before_token=!1:A!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),A==="{"&&this._output.trim(!0),b=!1,f=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ae=0;ae<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ae++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ae])){P=!0;break}(a||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!f&&d===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var De=A==='"'||A==="'";this.preserveSingleSpace(De||F),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")P=!1,d===0?(c&&(this.outdent(),c=!1),f=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),d++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),d&&(d--,this.outdent()));else{var _e=!1;this._input.lookBack("with")&&(_e=!0),this.preserveSingleSpace(F||_e),this.print_string(this._ch),c&&A==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),I=!0):(this.eatWhitespace(),d++,this.indent())}else if(this._ch===")")d&&(d--,this.outdent()),I&&this._input.peek()===";"&&this._options.selector_separator_newline&&(I=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!c||I)&&d===0&&!b&&!f?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&d===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(F),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Oe=A==='"'||A==="'";this.preserveSingleSpace(Oe||F),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&P&&this._output.add_new_line()}var Ne=this._output.get_code(_);return Ne},D.exports.Beautifier=y},function(D,w,g){var m=g(6).Options;function u(r){m.call(this,r,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<n.length;s++)n[s]!=="expand"?this.brace_style="collapse":this.brace_style=n[s]}u.prototype=new m,D.exports.Options=u}],O={};function j(D){var w=O[D];if(w!==void 0)return w.exports;var g=O[D]={exports:{}};return x[D](g,g.exports,j),g.exports}var h=j(15);L=h})();var W=L;!(te=[],H=function(){return{css_beautify:W}}.apply(Qe,te),H!==void 0&&(zt.exports=H))})()},WaYH:function(zt,Qe,G){"use strict";var te=G("rePB"),H=G("Ff2n"),L=G("VTBJ"),W=G("1OyB"),x=G("vuIU"),O=G("JX7q"),j=G("Ji7U"),h=G("LK+K"),D=G("q1tI"),w=G("TSYQ"),g=G.n(w),m=G("sboe"),u=G("OZM5"),r=function(T){var _=T.prefixCls,l=T.level,d=T.isStart,a=T.isEnd;if(!l)return null;for(var c="".concat(_,"-indent-unit"),v=[],f=0;f<l;f+=1){var b;v.push(D.createElement("span",{key:f,className:g()(c,(b={},Object(te.a)(b,"".concat(c,"-start"),d[f+1]),Object(te.a)(b,"".concat(c,"-end"),a[f+1]),Object(te.a)(b,"".concat(c,"-end-first-level"),!f&&a[0]),b))}))}return D.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},v)},t=r,n=G("815F"),s="open",e="close",i="---",o=function(y){Object(j.a)(_,y);var T=Object(h.a)(_);function _(){var l;return Object(W.a)(this,_),l=T.apply(this,arguments),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(d){var a=l.props.context.onNodeClick;a(d,Object(n.b)(l.props)),l.isSelectable()?l.onSelect(d):l.onCheck(d)},l.onSelectorDoubleClick=function(d){var a=l.props.context.onNodeDoubleClick;a(d,Object(n.b)(l.props))},l.onSelect=function(d){if(l.isDisabled())return;var a=l.props.context.onNodeSelect;d.preventDefault(),a(d,Object(n.b)(l.props))},l.onCheck=function(d){if(l.isDisabled())return;var a=l.props,c=a.disableCheckbox,v=a.checked,f=l.props.context.onNodeCheck;if(!l.isCheckable()||c)return;d.preventDefault();var b=!v;f(d,Object(n.b)(l.props),b)},l.onMouseEnter=function(d){var a=l.props.context.onNodeMouseEnter;a(d,Object(n.b)(l.props))},l.onMouseLeave=function(d){var a=l.props.context.onNodeMouseLeave;a(d,Object(n.b)(l.props))},l.onContextMenu=function(d){var a=l.props.context.onNodeContextMenu;a(d,Object(n.b)(l.props))},l.onDragStart=function(d){var a=l.props.context.onNodeDragStart;d.stopPropagation(),l.setState({dragNodeHighlight:!0}),a(d,Object(O.a)(l));try{d.dataTransfer.setData("text/plain","")}catch(c){}},l.onDragEnter=function(d){var a=l.props.context.onNodeDragEnter;d.preventDefault(),d.stopPropagation(),a(d,Object(O.a)(l))},l.onDragOver=function(d){var a=l.props.context.onNodeDragOver;d.preventDefault(),d.stopPropagation(),a(d,Object(O.a)(l))},l.onDragLeave=function(d){var a=l.props.context.onNodeDragLeave;d.stopPropagation(),a(d,Object(O.a)(l))},l.onDragEnd=function(d){var a=l.props.context.onNodeDragEnd;d.stopPropagation(),l.setState({dragNodeHighlight:!1}),a(d,Object(O.a)(l))},l.onDrop=function(d){var a=l.props.context.onNodeDrop;d.preventDefault(),d.stopPropagation(),l.setState({dragNodeHighlight:!1}),a(d,Object(O.a)(l))},l.onExpand=function(d){var a=l.props.context.onNodeExpand;a(d,Object(n.b)(l.props))},l.setSelectHandle=function(d){l.selectHandle=d},l.getNodeState=function(){var d=l.props.expanded;return l.isLeaf()?null:d?s:e},l.hasChildren=function(){var d=l.props.eventKey,a=l.props.context.keyEntities,c=a[d]||{},v=c.children;return!!(v||[]).length},l.isLeaf=function(){var d=l.props,a=d.isLeaf,c=d.loaded,v=l.props.context.loadData,f=l.hasChildren();return a===!1?!1:a||!v&&!f||v&&c&&!f},l.isDisabled=function(){var d=l.props.disabled,a=l.props.context.disabled;return!!(a||d)},l.isCheckable=function(){var d=l.props.checkable,a=l.props.context.checkable;return!a||d===!1?!1:a},l.syncLoadData=function(d){var a=d.expanded,c=d.loading,v=d.loaded,f=l.props.context,b=f.loadData,I=f.onNodeLoad;if(c)return;b&&a&&!l.isLeaf()&&(!l.hasChildren()&&!v&&I(Object(n.b)(l.props)))},l.renderSwitcher=function(){var d=l.props,a=d.expanded,c=d.switcherIcon,v=l.props.context,f=v.prefixCls,b=v.switcherIcon,I=c||b;if(l.isLeaf())return D.createElement("span",{className:g()("".concat(f,"-switcher"),"".concat(f,"-switcher-noop"))},typeof I=="function"?I(Object(L.a)(Object(L.a)({},l.props),{},{isLeaf:!0})):I);var R=g()("".concat(f,"-switcher"),"".concat(f,"-switcher_").concat(a?s:e));return D.createElement("span",{onClick:l.onExpand,className:R},typeof I=="function"?I(Object(L.a)(Object(L.a)({},l.props),{},{isLeaf:!1})):I)},l.renderCheckbox=function(){var d=l.props,a=d.checked,c=d.halfChecked,v=d.disableCheckbox,f=l.props.context.prefixCls,b=l.isDisabled(),I=l.isCheckable();if(!I)return null;var R=typeof I!="boolean"?I:null;return D.createElement("span",{className:g()("".concat(f,"-checkbox"),a&&"".concat(f,"-checkbox-checked"),!a&&c&&"".concat(f,"-checkbox-indeterminate"),(b||v)&&"".concat(f,"-checkbox-disabled")),onClick:l.onCheck},R)},l.renderIcon=function(){var d=l.props.loading,a=l.props.context.prefixCls;return D.createElement("span",{className:g()("".concat(a,"-iconEle"),"".concat(a,"-icon__").concat(l.getNodeState()||"docu"),d&&"".concat(a,"-icon_loading"))})},l.renderSelector=function(){var d=l.state.dragNodeHighlight,a=l.props,c=a.title,v=a.selected,f=a.icon,b=a.loading,I=a.data,R=l.props.context,P=R.prefixCls,M=R.showIcon,F=R.icon,A=R.draggable,B=R.loadData,z=R.titleRender,Z=l.isDisabled(),ae="".concat(P,"-node-content-wrapper"),De;if(M){var _e=f||F;De=_e?D.createElement("span",{className:g()("".concat(P,"-iconEle"),"".concat(P,"-icon__customize"))},typeof _e=="function"?_e(l.props):_e):l.renderIcon()}else B&&b&&(De=l.renderIcon());var Oe;typeof c=="function"?Oe=c(I):z?Oe=z(I):Oe=c;var Ne=D.createElement("span",{className:"".concat(P,"-title")},Oe);return D.createElement("span",{ref:l.setSelectHandle,title:typeof c=="string"?c:"",className:g()("".concat(ae),"".concat(ae,"-").concat(l.getNodeState()||"normal"),!Z&&(v||d)&&"".concat(P,"-node-selected"),!Z&&A&&"draggable"),draggable:!Z&&A||void 0,"aria-grabbed":!Z&&A||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:A?l.onDragStart:void 0},De,Ne)},l}return Object(x.a)(_,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var d=this.props.selectable,a=this.props.context.selectable;return typeof d=="boolean"?d:a}},{key:"render",value:function(){var d,a=this.props,c=a.eventKey,v=a.className,f=a.style,b=a.dragOver,I=a.dragOverGapTop,R=a.dragOverGapBottom,P=a.isLeaf,M=a.isStart,F=a.isEnd,A=a.expanded,B=a.selected,z=a.checked,Z=a.halfChecked,ae=a.loading,De=a.domRef,_e=a.active,Oe=a.onMouseMove,Ne=Object(H.a)(a,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ue=this.props.context,Ee=Ue.prefixCls,q=Ue.filterTreeNode,J=Ue.draggable,pe=Ue.keyEntities,ee=this.isDisabled(),Ae=Object(u.f)(Ne),Ve=pe[c]||{},Le=Ve.level,Ye=F[F.length-1];return D.createElement("div",Object.assign({ref:De,className:g()(v,"".concat(Ee,"-treenode"),(d={},Object(te.a)(d,"".concat(Ee,"-treenode-disabled"),ee),Object(te.a)(d,"".concat(Ee,"-treenode-switcher-").concat(A?"open":"close"),!P),Object(te.a)(d,"".concat(Ee,"-treenode-checkbox-checked"),z),Object(te.a)(d,"".concat(Ee,"-treenode-checkbox-indeterminate"),Z),Object(te.a)(d,"".concat(Ee,"-treenode-selected"),B),Object(te.a)(d,"".concat(Ee,"-treenode-loading"),ae),Object(te.a)(d,"".concat(Ee,"-treenode-active"),_e),Object(te.a)(d,"".concat(Ee,"-treenode-leaf-last"),Ye),Object(te.a)(d,"drag-over",!ee&&b),Object(te.a)(d,"drag-over-gap-top",!ee&&I),Object(te.a)(d,"drag-over-gap-bottom",!ee&&R),Object(te.a)(d,"filter-node",q&&q(Object(n.b)(this.props))),d)),style:f,onDragEnter:J?this.onDragEnter:void 0,onDragOver:J?this.onDragOver:void 0,onDragLeave:J?this.onDragLeave:void 0,onDrop:J?this.onDrop:void 0,onDragEnd:J?this.onDragEnd:void 0,onMouseMove:Oe},Ae),D.createElement(t,{prefixCls:Ee,level:Le,isStart:M,isEnd:F}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(D.Component),S=function(T){return D.createElement(m.a.Consumer,null,function(_){return D.createElement(o,Object.assign({},T,{context:_}))})};S.displayName="TreeNode",S.defaultProps={title:i},S.isTreeNode=1;var E=Qe.a=S},Y1PL:function(zt,Qe,G){"use strict";G.r(Qe),G.d(Qe,"ResizableTextArea",function(){return Z});var te=G("wx14"),H=G("1OyB"),L=G("vuIU"),W=G("Ji7U"),x=G("LK+K"),O=G("q1tI"),j=G("VTBJ"),h=G("rePB"),D=G("Zm9Q"),w=G("Kwbf"),g=G("c+Xe"),m=G("m+aA"),u=G("bdgK"),r=new Map;function t(_e){_e.forEach(function(Oe){var Ne,Ue=Oe.target;(Ne=r.get(Ue))===null||Ne===void 0||Ne.forEach(function(Ee){return Ee(Ue)})})}var n=new u.default(t),s=null,e=null;function i(_e,Oe){r.has(_e)||(r.set(_e,new Set),n.observe(_e)),r.get(_e).add(Oe)}function o(_e,Oe){r.has(_e)&&(r.get(_e).delete(Oe),r.get(_e).size||(n.unobserve(_e),r.delete(_e)))}var S=function(_e){Object(W.a)(Ne,_e);var Oe=Object(x.a)(Ne);function Ne(){return Object(H.a)(this,Ne),Oe.apply(this,arguments)}return Object(L.a)(Ne,[{key:"render",value:function(){return this.props.children}}]),Ne}(O.Component),E=O.createContext(null);function y(_e){var Oe=_e.children,Ne=_e.onBatchResize,Ue=O.useRef(0),Ee=O.useRef([]),q=O.useContext(E),J=O.useCallback(function(pe,ee,Ae){Ue.current+=1;var Ve=Ue.current;Ee.current.push({size:pe,element:ee,data:Ae}),Promise.resolve().then(function(){Ve===Ue.current&&(Ne==null||Ne(Ee.current),Ee.current=[])}),q==null||q(pe,ee,Ae)},[Ne,q]);return O.createElement(E.Provider,{value:J},Oe)}function T(_e){var Oe=_e.children,Ne=_e.disabled,Ue=O.useRef(null),Ee=O.useRef(null),q=O.useContext(E),J=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),pe=O.isValidElement(Oe)&&Object(g.c)(Oe),ee=pe?Oe.ref:null,Ae=O.useMemo(function(){return Object(g.a)(ee,Ue)},[ee,Ue]),Ve=O.useRef(_e);Ve.current=_e;var Le=O.useCallback(function(Ye){var it=Ve.current,vt=it.onResize,ut=it.data,mt=Ye.getBoundingClientRect(),lt=mt.width,Bt=mt.height,Nt=Ye.offsetWidth,Wt=Ye.offsetHeight,Lt=Math.floor(lt),Gt=Math.floor(Bt);if(J.current.width!==Lt||J.current.height!==Gt||J.current.offsetWidth!==Nt||J.current.offsetHeight!==Wt){var Ut={width:Lt,height:Gt,offsetWidth:Nt,offsetHeight:Wt};J.current=Ut;var Re=Nt===Math.round(lt)?lt:Nt,je=Wt===Math.round(Bt)?Bt:Wt,tt=Object(j.a)(Object(j.a)({},Ut),{},{offsetWidth:Re,offsetHeight:je});q==null||q(tt,Ye,ut),vt&&Promise.resolve().then(function(){vt(tt,Ye)})}},[]);return O.useEffect(function(){var Ye=Object(m.a)(Ue.current)||Object(m.a)(Ee.current);return Ye&&!Ne&&i(Ye,Le),function(){return o(Ye,Le)}},[Ue.current,Ne]),O.createElement(S,{ref:Ee},pe?O.cloneElement(Oe,{ref:Ae}):Oe)}var _="rc-observer-key";function l(_e){var Oe=_e.children,Ne=Object(D.a)(Oe);return Ne.map(function(Ue,Ee){var q=(Ue==null?void 0:Ue.key)||"".concat(_,"-").concat(Ee);return O.createElement(T,Object(te.a)({},_e,{key:q}),Ue)})}l.Collection=y;var d=l,a=G("bT9E"),c=G("TSYQ"),v=G.n(c),f=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],I={},R;function P(_e){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(Oe&&I[Ne])return I[Ne];var Ue=window.getComputedStyle(_e),Ee=Ue.getPropertyValue("box-sizing")||Ue.getPropertyValue("-moz-box-sizing")||Ue.getPropertyValue("-webkit-box-sizing"),q=parseFloat(Ue.getPropertyValue("padding-bottom"))+parseFloat(Ue.getPropertyValue("padding-top")),J=parseFloat(Ue.getPropertyValue("border-bottom-width"))+parseFloat(Ue.getPropertyValue("border-top-width")),pe=b.map(function(Ae){return"".concat(Ae,":").concat(Ue.getPropertyValue(Ae))}).join(";"),ee={sizingStyle:pe,paddingSize:q,borderSize:J,boxSizing:Ee};return Oe&&Ne&&(I[Ne]=ee),ee}function M(_e){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),document.body.appendChild(R)),_e.getAttribute("wrap")?R.setAttribute("wrap",_e.getAttribute("wrap")):R.removeAttribute("wrap");var Ee=P(_e,Oe),q=Ee.paddingSize,J=Ee.borderSize,pe=Ee.boxSizing,ee=Ee.sizingStyle;R.setAttribute("style","".concat(ee,";").concat(f)),R.value=_e.value||_e.placeholder||"";var Ae=Number.MIN_SAFE_INTEGER,Ve=Number.MAX_SAFE_INTEGER,Le=R.scrollHeight,Ye;if(pe==="border-box"?Le+=J:pe==="content-box"&&(Le-=q),Ne!==null||Ue!==null){R.value=" ";var it=R.scrollHeight-q;Ne!==null&&(Ae=it*Ne,pe==="border-box"&&(Ae=Ae+q+J),Le=Math.max(Ae,Le)),Ue!==null&&(Ve=it*Ue,pe==="border-box"&&(Ve=Ve+q+J),Ye=Le>Ve?"":"hidden",Le=Math.min(Ve,Le))}return{height:Le,minHeight:Ae,maxHeight:Ve,overflowY:Ye,resize:"none"}}var F=G("Gytx"),A=G.n(F),B;(function(_e){_e[_e.NONE=0]="NONE",_e[_e.RESIZING=1]="RESIZING",_e[_e.RESIZED=2]="RESIZED"})(B||(B={}));var z=function(_e){Object(W.a)(Ne,_e);var Oe=Object(x.a)(Ne);function Ne(Ue){var Ee;return Object(H.a)(this,Ne),Ee=Oe.call(this,Ue),Ee.nextFrameActionId=void 0,Ee.resizeFrameId=void 0,Ee.textArea=void 0,Ee.saveTextArea=function(q){Ee.textArea=q},Ee.handleResize=function(q){var J=Ee.state.resizeStatus,pe=Ee.props,ee=pe.autoSize,Ae=pe.onResize;if(J!==B.NONE)return;typeof Ae=="function"&&Ae(q),ee&&Ee.resizeOnNextFrame()},Ee.resizeOnNextFrame=function(){cancelAnimationFrame(Ee.nextFrameActionId),Ee.nextFrameActionId=requestAnimationFrame(Ee.resizeTextarea)},Ee.resizeTextarea=function(){var q=Ee.props.autoSize;if(!q||!Ee.textArea)return;var J=q.minRows,pe=q.maxRows,ee=M(Ee.textArea,!1,J,pe);Ee.setState({textareaStyles:ee,resizeStatus:B.RESIZING},function(){cancelAnimationFrame(Ee.resizeFrameId),Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:B.RESIZED},function(){Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:B.NONE}),Ee.fixFirefoxAutoScroll()})})})})},Ee.renderTextArea=function(){var q=Ee.props,J=q.prefixCls,pe=J===void 0?"rc-textarea":J,ee=q.autoSize,Ae=q.onResize,Ve=q.className,Le=q.disabled,Ye=Ee.state,it=Ye.textareaStyles,vt=Ye.resizeStatus,ut=Object(a.a)(Ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),mt=v()(pe,Ve,Object(h.a)({},"".concat(pe,"-disabled"),Le));"value"in ut&&(ut.value=ut.value||"");var lt=Object(j.a)(Object(j.a)(Object(j.a)({},Ee.props.style),it),vt===B.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(d,{onResize:Ee.handleResize,disabled:!(ee||Ae)},O.createElement("textarea",Object(te.a)({},ut,{className:mt,style:lt,ref:Ee.saveTextArea})))},Ee.state={textareaStyles:{},resizeStatus:B.NONE},Ee}return Object(L.a)(Ne,[{key:"componentDidUpdate",value:function(Ee){(Ee.value!==this.props.value||!A()(Ee.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var Ee=this.textArea.selectionStart,q=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ee,q)}}catch(J){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ne}(O.Component),Z=z,ae=function(_e){Object(W.a)(Ne,_e);var Oe=Object(x.a)(Ne);function Ne(Ue){var Ee;Object(H.a)(this,Ne),Ee=Oe.call(this,Ue),Ee.resizableTextArea=void 0,Ee.focus=function(){Ee.resizableTextArea.textArea.focus()},Ee.saveTextArea=function(J){Ee.resizableTextArea=J},Ee.handleChange=function(J){var pe=Ee.props.onChange;Ee.setValue(J.target.value,function(){Ee.resizableTextArea.resizeTextarea()}),pe&&pe(J)},Ee.handleKeyDown=function(J){var pe=Ee.props,ee=pe.onPressEnter,Ae=pe.onKeyDown;J.keyCode===13&&ee&&ee(J),Ae&&Ae(J)};var q=typeof Ue.value=="undefined"||Ue.value===null?Ue.defaultValue:Ue.value;return Ee.state={value:q},Ee}return Object(L.a)(Ne,[{key:"setValue",value:function(Ee,q){"value"in this.props||this.setState({value:Ee},q)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(Z,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ee){return"value"in Ee?{value:Ee.value}:null}}]),Ne}(O.Component),De=Qe.default=ae},ZW9T:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return M});var te=G("k1fw"),H=G("miYZ"),L=G("tsqr"),W=G("rAM+"),x=G("tJVT"),O=G("PpiC"),j=G("q1tI"),h=G.n(j),D=G("bdgK"),w=G("oBTY"),g=G("9og8"),m=G("WmNS"),u=G.n(m),r={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},t={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},n={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},e=G("5VLF"),i=G.n(e),o={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},S=function(A,B){return B.map(function(z){return{label:z,kind:A.languages.CompletionItemKind.Keyword,insertText:z}})},E=function(A){return Object.keys(o.tables).map(function(B){return{label:B,kind:A.languages.CompletionItemKind.Variable,insertText:B}})},y=function(A,B){var z=o.tables[A];return z?z.map(function(Z){return{label:Z,kind:B.languages.CompletionItemKind.Field,insertText:Z}}):[]};function T(F,A,B,z,Z){var ae=A.getWordUntilPosition(B),De={startLineNumber:B.lineNumber,endLineNumber:B.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},_e=z.map(function(Oe){return{label:Oe,kind:F.languages.CompletionItemKind.Keyword,insertText:Oe,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:De}});return Z.map(function(Oe){_e.push(Object(te.a)(Object(te.a)({},Oe),{},{range:De}))}),_e}var _=function(F){o.languages.map(function(Z){return F.languages.registerDocumentFormattingEditProvider(Z,{provideDocumentFormattingEdits:function(De,_e,Oe){return Object(g.a)(u.a.mark(function Ne(){var Ue;return u.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return Ue=i()(De.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),q.abrupt("return",[{range:De.getFullModelRange(),text:Ue}]);case 2:case"end":return q.stop()}},Ne)}))()}}),Z});var A=n.quickKey.map(function(Z){return{label:Z.label,kind:F.languages.CompletionItemKind.Method,insertText:Z.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),B=s.quickKey.map(function(Z){return{label:Z.label,kind:F.languages.CompletionItemKind.Method,insertText:Z.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=t.quickKey.map(function(Z){return{label:Z.label,kind:F.languages.CompletionItemKind.Method,insertText:Z.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet}});F.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(w.a)(n.keywords),Object(w.a)(n.quickKey.map(function(Z){return Z.label}))),provideCompletionItems:function(ae,De){var _e=ae.getValueInRange({startLineNumber:De.lineNumber,startColumn:1,endLineNumber:De.lineNumber,endColumn:De.column}),Oe=_e.match(/cu/gim);console.log("match:",Oe,De,_e,ae);var Ne=[],Ue=De.lineNumber,Ee=De.column,q=ae.getValueInRange({startLineNumber:Ue,startColumn:0,endLineNumber:Ue,endColumn:Ee}),J=q.trim().split(/\s+/),pe=J[J.length-1];if(pe.endsWith(".")){var ee=pe.slice(0,pe.length-1);Object.keys(o.tables).includes(ee)&&(Ne=Object(w.a)(y(ee,F)))}else pe==="."?Ne=[]:Ne=[].concat(Object(w.a)(E(F)),Object(w.a)(S(F,n.keywords)),Object(w.a)(A));return{suggestions:Ne}}}),F.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(w.a)(r.keywords)),provideCompletionItems:function(ae,De){var _e=ae.getValueInRange({startLineNumber:De.lineNumber,startColumn:1,endLineNumber:De.lineNumber,endColumn:De.column}),Oe=_e.match(/cu/gim);console.log("match:",Oe,De,_e,ae);var Ne=[],Ue=De.lineNumber,Ee=De.column,q=ae.getValueInRange({startLineNumber:Ue,startColumn:0,endLineNumber:Ue,endColumn:Ee}),J=q.trim().split(/\s+/),pe=J[J.length-1];if(pe.endsWith(".")){var ee=pe.slice(0,pe.length-1);Object.keys(o.tables).includes(ee)&&(Ne=Object(w.a)(y(ee,F)))}else pe==="."?Ne=[]:Ne=[].concat(Object(w.a)(E(F)),Object(w.a)(S(F,r.keywords)));return{suggestions:Ne}}}),F.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(w.a)(t.keywords)),provideCompletionItems:function(ae,De){var _e=[],Oe=De.lineNumber,Ne=De.column,Ue=ae.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:Ne}),Ee=Ue.trim().split(/\s+/),q=Ee[Ee.length-1];if(q.endsWith(".")){var J=q.slice(0,q.length-1);Object.keys(o.tables).includes(J)&&(_e=Object(w.a)(y(J,F)))}else q==="."?_e=[]:_e=[].concat(Object(w.a)(E(F)),Object(w.a)(S(F,t.keywords)),Object(w.a)(z));return{suggestions:_e}}}),F.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(w.a)(s.keywords)),provideCompletionItems:function(ae,De){var _e=[],Oe=De.lineNumber,Ne=De.column,Ue=ae.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:Ne}),Ee=Ue.trim().split(/\s+/),q=Ee[Ee.length-1];if(q.endsWith(".")){var J=q.slice(0,q.length-1);Object.keys(o.tables).includes(J)&&(_e=Object(w.a)(y(J,F)))}else q==="."?_e=[]:_e=[].concat(Object(w.a)(E(F)),Object(w.a)(S(F,s.keywords)),Object(w.a)(B));return{suggestions:_e}}})},l="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",d=G("LvDl"),a=G("+ua5");function c(F){return/^\d+$/.test(F)?"".concat(F,"px"):F}function v(){}var f=!1,b={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function I(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=F;if(Array.isArray(F)){for(var B=0;B<F.length;B++){var z=b[F[B]];if(z)return z}return A[0]}return b[A]||A}var R=null,P=Qe.b=function(F){var A=F.width,B=A===void 0?"100%":A,z=F.height,Z=z===void 0?"100%":z,ae=F.value,De=F.language,_e=De===void 0?"javascript":De,Oe=F.style,Ne=Oe===void 0?{}:Oe,Ue=F.options,Ee=Ue===void 0?{}:Ue,q=F.overrideServices,J=q===void 0?{}:q,pe=F.theme,ee=pe===void 0?"vs-dark":pe,Ae=F.onEditBlur,Ve=F.onSave,Le=F.autoHeight,Ye=Le===void 0?!1:Le,it=F.forbidCopy,vt=it===void 0?!1:it,ut=F.onChange,mt=ut===void 0?v:ut,lt=F.editorDidMount,Bt=lt===void 0?v:lt,Nt=F.onFocus,Wt=Nt===void 0?v:Nt,Lt=F.filename,Gt=Lt===void 0?"educoder.txt":Lt,Ut=F.errorLine,Re=F.errorContent,je=Re===void 0?"":Re,tt=Object(O.a)(F,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),dt=Object(j.useRef)(),ke=Object(j.useRef)({}),ot=Object(j.useRef)(),ve=Object(j.useRef)(!1),le=Object(j.useRef)(),ue=Object(j.useState)(!1),$=Object(x.a)(ue,2),Q=$[0],re=$[1];function fe(){var xe;return dt.current&&(xe=new D.default(function(Je){var wt=Object(W.a)(Je),jt;try{for(wt.s();!(jt=wt.n()).done;){var Qt=jt.value;(Qt.target.offsetHeight>0||Qt.target.offsetWidth>0)&&ke.current.instance.layout()}}catch(Gn){wt.e(Gn)}finally{wt.f()}}),xe.observe(dt.current)),xe}function Pe(){L.b.warn(decodeURIComponent(l))}var Ge=function(){var Je=ke.current.instance;if(ae!=null&&Je&&Q){var wt=Je.getModel();wt&&ae!==wt.getValue()&&(f=!0,wt.setValue(ae),Je.layout(),f=!1)}};Object(j.useEffect)(function(){ot.current&&clearTimeout(ot.current),ot.current=setTimeout(function(){Ge()},500)},[ae,Q,ke.current]),Object(j.useEffect)(function(){if(Ut&&ke.current&&ke.current.instance){var xe=ke.current.instance;xe.changeViewZones(function(wt){var jt=document.createElement("div");jt.style.padding="10px 20px",jt.style.width="calc(100% - 20px)",jt.className="my-error-line-wrp",jt.innerHTML=je,wt.addZone({afterLineNumber:Ut||11,heightInLines:3,domNode:jt})});var Je={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};xe.addOverlayWidget(Je),xe.revealPositionInCenter({lineNumber:20,column:1})}},[Ut,ke.current,Q]);function bt(){var xe=ke.current.instance;if(xe){var Je=xe.getSelection(),wt=ke.current.pastePos||{},jt=new R.Range(wt.startLineNumber||Je.endLineNumber,wt.startColumn||Je.endColumn,wt.endLineNumber||Je.endLineNumber,wt.endColumn||Je.endColumn);setTimeout(function(){xe.executeEdits("",[{range:jt,text:""}])},300)}}function Ft(xe){(window.navigator.platform.match("Mac")?xe.metaKey:xe.ctrlKey)&&xe.keyCode==83&&(xe.preventDefault(),Ve())}var Xt=function(){if(Ye&&ke.current.instance){var Je=ke.current.instance.getContentHeight();xt(Je<Z?Z:Je)}else xt(Z)};function Pt(xe){var Je=document.createEvent("MouseEvents");Je.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),xe.dispatchEvent(Je)}function St(xe,Je){var wt=window.URL||window.webkitURL||window,jt=new Blob([Je]),Qt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Qt.href=wt.createObjectURL(jt),Qt.download=xe,Pt(Qt)}Object(j.useEffect)(function(){Xt()},[Xt]),Object(j.useEffect)(function(){dt.current&&!Q&&G.e(27).then(G.t.bind(null,"M/lh",7)).then(function(xe){try{R=xe,ke.current.instance=R.editor.create(dt.current,{value:ae,language:I(_e),theme:ee,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},J);var Je=ke.current.instance;if(Bt(Je,R),setTimeout(function(){Xt(),ke.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){St(Gt||"educoder.txt",Je.getValue())}})},500),ke.current.subscription=Je.onDidChangeModelContent(function(jt){ve.current?clearTimeout(le.current):(Xt(),mt(Je.getValue(),jt)),le.current=setTimeout(function(){ve.current=!1},500)}),window.Monaco||_(R),vt&&(Je.addCommand(R.KeyMod.CtrlCmd|R.KeyMod.Shift|R.KeyCode.KEY_V,function(){return Pe(),null}),Je.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_C,function(){return Pe(),null})),window.Monaco=R,Ae&&Je.onDidBlurEditorWidget(function(){Ae(Je.getValue())}),Wt&&Je.onDidFocusEditorText(function(){Wt(Je.getValue())}),vt){Je.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Pe(),null}),Je.onDidPaste(function(jt){ke.current.pastePos=jt});try{window.addEventListener("paste",bt)}catch(jt){}}var wt=fe();return re(!0),function(){var jt=ke.current.instance;jt.dispose();var Qt=jt.getModel();Qt&&Qt.dispose(),ke.current.subscription&&ke.current.subscription.dispose(),vt&&window.removeEventListener("paste",bt),wt.unobserve(dt.current)}}catch(jt){}})},[]),Object(j.useEffect)(function(){var xe=ke.current.instance;if(xe&&Q)return document.addEventListener("keydown",Ft,!1),function(){document.removeEventListener("keydown",Ft)}},[Ve,Q]),Object(j.useEffect)(function(){var xe=ke.current.instance;if(xe&&Q){var Je=I(_e);R.editor.setModelLanguage(xe.getModel(),Je),console.log("language:",_e,xe.getModel(),Je)}},[_e,Q]),Object(j.useEffect)(function(){var xe=ke.current.instance;xe&&Q&&R.editor.setTheme(ee)},[ee,Q]),Object(j.useEffect)(function(){var xe=ke.current.instance;xe&&Q&&(xe.updateOptions(Object(te.a)({},Ee)),setTimeout(function(){xe.getModel().updateOptions(Object(te.a)({},Ee))},200))},[JSON.stringify(Ee),Q]),Object(j.useEffect)(function(){var xe=ke.current.instance;xe&&Q&&xe.layout()},[B,Z,Q]);var Ze=Object(j.useState)(c(B)),qe=Object(x.a)(Ze,2),Me=qe[0],ne=qe[1],me=Object(j.useState)(c(Z)),rt=Object(x.a)(me,2),Ke=rt[0],xt=rt[1],Ot=Object(te.a)(Object(te.a)({},Ne),{},{width:Me,height:Ke});return h.a.createElement("div",{className:"my-monaco-editor",ref:dt,style:Ot})};function M(F){var A=F.width,B=A===void 0?"100%":A,z=F.height,Z=z===void 0?"100%":z,ae=F.original,De=F.modified,_e=F.language,Oe=F.options,Ne=Oe===void 0?{}:Oe,Ue=Object(j.useRef)(),Ee=Object(j.useState)(null),q=Object(x.a)(Ee,2),J=q[0],pe=q[1];function ee(Ye){var it;return Ue.current&&(it=new D.default(function(vt){var ut=Object(W.a)(vt),mt;try{for(ut.s();!(mt=ut.n()).done;){var lt=mt.value;(lt.target.offsetHeight>0||lt.target.offsetWidth>0)&&Ye.layout()}}catch(Bt){ut.e(Bt)}finally{ut.f()}}),it.observe(Ue.current)),it}Object(j.useEffect)(function(){Ue.current&&G.e(27).then(G.t.bind(null,"M/lh",7)).then(function(Ye){R=Ye;var it=R.editor.createDiffEditor(Ue.current,Object(te.a)(Object(te.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},Ne),{},{wordWrap:!0}));pe(it);var vt=ee(it);return function(){it.dispose();var ut=it.getModel();ut&&ut.dispose(),vt.unobserve(Ue.current)}})},[]),Object(j.useEffect)(function(){J&&J.setModel({original:R.editor.createModel(ae,_e),modified:R.editor.createModel(De,_e)})},[ae,De,_e,J]);var Ae=c(B),Ve=c(Z),Le={width:Ae,height:Ve};return h.a.createElement("div",{className:"my-diff-editor",ref:Ue,style:Le})}},ZpRC:function(zt,Qe,G){"use strict";function te(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function H(g,m){return(!m||g!=="hidden")&&g!=="visible"&&g!=="clip"}function L(g,m){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var u=getComputedStyle(g,null);return H(u.overflowY,m)||H(u.overflowX,m)||function(r){var t=function(n){if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch(s){return null}}(r);return!!t&&(t.clientHeight<r.scrollHeight||t.clientWidth<r.scrollWidth)}(g)}return!1}function W(g,m,u,r,t,n,s,e){return n<g&&s>m||n>g&&s<m?0:n<=g&&e<=u||s>=m&&e>=u?n-g-r:s>m&&e<u||n<g&&e>u?s-m+t:0}var x=function(g,m){var u=window,r=m.scrollMode,t=m.block,n=m.inline,s=m.boundary,e=m.skipOverflowHiddenElements,i=typeof s=="function"?s:function(it){return it!==s};if(!te(g))throw new TypeError("Invalid target");for(var o=document.scrollingElement||document.documentElement,S=[],E=g;te(E)&&i(E);){if((E=E.parentElement)===o){S.push(E);break}E!=null&&E===document.body&&L(E)&&!L(document.documentElement)||E!=null&&L(E,e)&&S.push(E)}for(var y=u.visualViewport?u.visualViewport.width:innerWidth,T=u.visualViewport?u.visualViewport.height:innerHeight,_=window.scrollX||pageXOffset,l=window.scrollY||pageYOffset,d=g.getBoundingClientRect(),a=d.height,c=d.width,v=d.top,f=d.right,b=d.bottom,I=d.left,R=t==="start"||t==="nearest"?v:t==="end"?b:v+a/2,P=n==="center"?I+c/2:n==="end"?f:I,M=[],F=0;F<S.length;F++){var A=S[F],B=A.getBoundingClientRect(),z=B.height,Z=B.width,ae=B.top,De=B.right,_e=B.bottom,Oe=B.left;if(r==="if-needed"&&v>=0&&I>=0&&b<=T&&f<=y&&v>=ae&&b<=_e&&I>=Oe&&f<=De)return M;var Ne=getComputedStyle(A),Ue=parseInt(Ne.borderLeftWidth,10),Ee=parseInt(Ne.borderTopWidth,10),q=parseInt(Ne.borderRightWidth,10),J=parseInt(Ne.borderBottomWidth,10),pe=0,ee=0,Ae="offsetWidth"in A?A.offsetWidth-A.clientWidth-Ue-q:0,Ve="offsetHeight"in A?A.offsetHeight-A.clientHeight-Ee-J:0;if(o===A)pe=t==="start"?R:t==="end"?R-T:t==="nearest"?W(l,l+T,T,Ee,J,l+R,l+R+a,a):R-T/2,ee=n==="start"?P:n==="center"?P-y/2:n==="end"?P-y:W(_,_+y,y,Ue,q,_+P,_+P+c,c),pe=Math.max(0,pe+l),ee=Math.max(0,ee+_);else{pe=t==="start"?R-ae-Ee:t==="end"?R-_e+J+Ve:t==="nearest"?W(ae,_e,z,Ee,J+Ve,R,R+a,a):R-(ae+z/2)+Ve/2,ee=n==="start"?P-Oe-Ue:n==="center"?P-(Oe+Z/2)+Ae/2:n==="end"?P-De+q+Ae:W(Oe,De,Z,Ue,q+Ae,P,P+c,c);var Le=A.scrollLeft,Ye=A.scrollTop;R+=Ye-(pe=Math.max(0,Math.min(Ye+pe,A.scrollHeight-z+Ve))),P+=Le-(ee=Math.max(0,Math.min(Le+ee,A.scrollWidth-Z+Ae)))}M.push({el:A,top:pe,left:ee})}return M};function O(g){return g===Object(g)&&Object.keys(g).length!==0}function j(g,m){m===void 0&&(m="auto");var u="scrollBehavior"in document.body.style;g.forEach(function(r){var t=r.el,n=r.top,s=r.left;t.scroll&&u?t.scroll({top:n,left:s,behavior:m}):(t.scrollTop=n,t.scrollLeft=s)})}function h(g){return g===!1?{block:"end",inline:"nearest"}:O(g)?g:{block:"start",inline:"nearest"}}function D(g,m){var u=!g.ownerDocument.documentElement.contains(g);if(O(m)&&typeof m.behavior=="function")return m.behavior(u?[]:x(g,m));if(u)return;var r=h(m);return j(x(g,r),r.behavior)}var w=Qe.a=D},Zss7:function(zt,Qe,G){var te;(function(H){var L=/^\s+/,W=/\s+$/,x=0,O=H.round,j=H.min,h=H.max,D=H.random;function w(J,pe){if(J=J||"",pe=pe||{},J instanceof w)return J;if(!(this instanceof w))return new w(J,pe);var ee=g(J);this._originalInput=J,this._r=ee.r,this._g=ee.g,this._b=ee.b,this._a=ee.a,this._roundA=O(100*this._a)/100,this._format=pe.format||ee.format,this._gradientType=pe.gradientType,this._r<1&&(this._r=O(this._r)),this._g<1&&(this._g=O(this._g)),this._b<1&&(this._b=O(this._b)),this._ok=ee.ok,this._tc_id=x++}w.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var J=this.toRgb();return(J.r*299+J.g*587+J.b*114)/1e3},getLuminance:function(){var J=this.toRgb(),pe,ee,Ae,Ve,Le,Ye;return pe=J.r/255,ee=J.g/255,Ae=J.b/255,pe<=.03928?Ve=pe/12.92:Ve=H.pow((pe+.055)/1.055,2.4),ee<=.03928?Le=ee/12.92:Le=H.pow((ee+.055)/1.055,2.4),Ae<=.03928?Ye=Ae/12.92:Ye=H.pow((Ae+.055)/1.055,2.4),.2126*Ve+.7152*Le+.0722*Ye},setAlpha:function(J){return this._a=M(J),this._roundA=O(100*this._a)/100,this},toHsv:function(){var J=t(this._r,this._g,this._b);return{h:J.h*360,s:J.s,v:J.v,a:this._a}},toHsvString:function(){var J=t(this._r,this._g,this._b),pe=O(J.h*360),ee=O(J.s*100),Ae=O(J.v*100);return this._a==1?"hsv("+pe+", "+ee+"%, "+Ae+"%)":"hsva("+pe+", "+ee+"%, "+Ae+"%, "+this._roundA+")"},toHsl:function(){var J=u(this._r,this._g,this._b);return{h:J.h*360,s:J.s,l:J.l,a:this._a}},toHslString:function(){var J=u(this._r,this._g,this._b),pe=O(J.h*360),ee=O(J.s*100),Ae=O(J.l*100);return this._a==1?"hsl("+pe+", "+ee+"%, "+Ae+"%)":"hsla("+pe+", "+ee+"%, "+Ae+"%, "+this._roundA+")"},toHex:function(J){return s(this._r,this._g,this._b,J)},toHexString:function(J){return"#"+this.toHex(J)},toHex8:function(J){return e(this._r,this._g,this._b,this._a,J)},toHex8String:function(J){return"#"+this.toHex8(J)},toRgb:function(){return{r:O(this._r),g:O(this._g),b:O(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+O(this._r)+", "+O(this._g)+", "+O(this._b)+")":"rgba("+O(this._r)+", "+O(this._g)+", "+O(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:O(F(this._r,255)*100)+"%",g:O(F(this._g,255)*100)+"%",b:O(F(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+O(F(this._r,255)*100)+"%, "+O(F(this._g,255)*100)+"%, "+O(F(this._b,255)*100)+"%)":"rgba("+O(F(this._r,255)*100)+"%, "+O(F(this._g,255)*100)+"%, "+O(F(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:R[s(this._r,this._g,this._b,!0)]||!1},toFilter:function(J){var pe="#"+i(this._r,this._g,this._b,this._a),ee=pe,Ae=this._gradientType?"GradientType = 1, ":"";if(J){var Ve=w(J);ee="#"+i(Ve._r,Ve._g,Ve._b,Ve._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ae+"startColorstr="+pe+",endColorstr="+ee+")"},toString:function(J){var pe=!!J;J=J||this._format;var ee=!1,Ae=this._a<1&&this._a>=0,Ve=!pe&&Ae&&(J==="hex"||J==="hex6"||J==="hex3"||J==="hex4"||J==="hex8"||J==="name");return Ve?J==="name"&&this._a===0?this.toName():this.toRgbString():(J==="rgb"&&(ee=this.toRgbString()),J==="prgb"&&(ee=this.toPercentageRgbString()),(J==="hex"||J==="hex6")&&(ee=this.toHexString()),J==="hex3"&&(ee=this.toHexString(!0)),J==="hex4"&&(ee=this.toHex8String(!0)),J==="hex8"&&(ee=this.toHex8String()),J==="name"&&(ee=this.toName()),J==="hsl"&&(ee=this.toHslString()),J==="hsv"&&(ee=this.toHsvString()),ee||this.toHexString())},clone:function(){return w(this.toString())},_applyModification:function(J,pe){var ee=J.apply(null,[this].concat([].slice.call(pe)));return this._r=ee._r,this._g=ee._g,this._b=ee._b,this.setAlpha(ee._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(T,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(o,arguments)},saturate:function(){return this._applyModification(S,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(l,arguments)},_applyCombination:function(J,pe){return J.apply(null,[this].concat([].slice.call(pe)))},analogous:function(){return this._applyCombination(f,arguments)},complement:function(){return this._applyCombination(d,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(a,arguments)},tetrad:function(){return this._applyCombination(c,arguments)}},w.fromRatio=function(J,pe){if(typeof J=="object"){var ee={};for(var Ae in J)J.hasOwnProperty(Ae)&&(Ae==="a"?ee[Ae]=J[Ae]:ee[Ae]=De(J[Ae]));J=ee}return w(J,pe)};function g(J){var pe={r:0,g:0,b:0},ee=1,Ae=null,Ve=null,Le=null,Ye=!1,it=!1;return typeof J=="string"&&(J=Ee(J)),typeof J=="object"&&(Ue(J.r)&&Ue(J.g)&&Ue(J.b)?(pe=m(J.r,J.g,J.b),Ye=!0,it=String(J.r).substr(-1)==="%"?"prgb":"rgb"):Ue(J.h)&&Ue(J.s)&&Ue(J.v)?(Ae=De(J.s),Ve=De(J.v),pe=n(J.h,Ae,Ve),Ye=!0,it="hsv"):Ue(J.h)&&Ue(J.s)&&Ue(J.l)&&(Ae=De(J.s),Le=De(J.l),pe=r(J.h,Ae,Le),Ye=!0,it="hsl"),J.hasOwnProperty("a")&&(ee=J.a)),ee=M(ee),{ok:Ye,format:J.format||it,r:j(255,h(pe.r,0)),g:j(255,h(pe.g,0)),b:j(255,h(pe.b,0)),a:ee}}function m(J,pe,ee){return{r:F(J,255)*255,g:F(pe,255)*255,b:F(ee,255)*255}}function u(J,pe,ee){J=F(J,255),pe=F(pe,255),ee=F(ee,255);var Ae=h(J,pe,ee),Ve=j(J,pe,ee),Le,Ye,it=(Ae+Ve)/2;if(Ae==Ve)Le=Ye=0;else{var vt=Ae-Ve;Ye=it>.5?vt/(2-Ae-Ve):vt/(Ae+Ve);switch(Ae){case J:Le=(pe-ee)/vt+(pe<ee?6:0);break;case pe:Le=(ee-J)/vt+2;break;case ee:Le=(J-pe)/vt+4;break}Le/=6}return{h:Le,s:Ye,l:it}}function r(J,pe,ee){var Ae,Ve,Le;J=F(J,360),pe=F(pe,100),ee=F(ee,100);function Ye(ut,mt,lt){return lt<0&&(lt+=1),lt>1&&(lt-=1),lt<1/6?ut+(mt-ut)*6*lt:lt<1/2?mt:lt<2/3?ut+(mt-ut)*(2/3-lt)*6:ut}if(pe===0)Ae=Ve=Le=ee;else{var it=ee<.5?ee*(1+pe):ee+pe-ee*pe,vt=2*ee-it;Ae=Ye(vt,it,J+1/3),Ve=Ye(vt,it,J),Le=Ye(vt,it,J-1/3)}return{r:Ae*255,g:Ve*255,b:Le*255}}function t(J,pe,ee){J=F(J,255),pe=F(pe,255),ee=F(ee,255);var Ae=h(J,pe,ee),Ve=j(J,pe,ee),Le,Ye,it=Ae,vt=Ae-Ve;if(Ye=Ae===0?0:vt/Ae,Ae==Ve)Le=0;else{switch(Ae){case J:Le=(pe-ee)/vt+(pe<ee?6:0);break;case pe:Le=(ee-J)/vt+2;break;case ee:Le=(J-pe)/vt+4;break}Le/=6}return{h:Le,s:Ye,v:it}}function n(J,pe,ee){J=F(J,360)*6,pe=F(pe,100),ee=F(ee,100);var Ae=H.floor(J),Ve=J-Ae,Le=ee*(1-pe),Ye=ee*(1-Ve*pe),it=ee*(1-(1-Ve)*pe),vt=Ae%6,ut=[ee,Ye,Le,Le,it,ee][vt],mt=[it,ee,ee,Ye,Le,Le][vt],lt=[Le,Le,it,ee,ee,Ye][vt];return{r:ut*255,g:mt*255,b:lt*255}}function s(J,pe,ee,Ae){var Ve=[ae(O(J).toString(16)),ae(O(pe).toString(16)),ae(O(ee).toString(16))];return Ae&&Ve[0].charAt(0)==Ve[0].charAt(1)&&Ve[1].charAt(0)==Ve[1].charAt(1)&&Ve[2].charAt(0)==Ve[2].charAt(1)?Ve[0].charAt(0)+Ve[1].charAt(0)+Ve[2].charAt(0):Ve.join("")}function e(J,pe,ee,Ae,Ve){var Le=[ae(O(J).toString(16)),ae(O(pe).toString(16)),ae(O(ee).toString(16)),ae(_e(Ae))];return Ve&&Le[0].charAt(0)==Le[0].charAt(1)&&Le[1].charAt(0)==Le[1].charAt(1)&&Le[2].charAt(0)==Le[2].charAt(1)&&Le[3].charAt(0)==Le[3].charAt(1)?Le[0].charAt(0)+Le[1].charAt(0)+Le[2].charAt(0)+Le[3].charAt(0):Le.join("")}function i(J,pe,ee,Ae){var Ve=[ae(_e(Ae)),ae(O(J).toString(16)),ae(O(pe).toString(16)),ae(O(ee).toString(16))];return Ve.join("")}w.equals=function(J,pe){return!J||!pe?!1:w(J).toRgbString()==w(pe).toRgbString()},w.random=function(){return w.fromRatio({r:D(),g:D(),b:D()})};function o(J,pe){pe=pe===0?0:pe||10;var ee=w(J).toHsl();return ee.s-=pe/100,ee.s=A(ee.s),w(ee)}function S(J,pe){pe=pe===0?0:pe||10;var ee=w(J).toHsl();return ee.s+=pe/100,ee.s=A(ee.s),w(ee)}function E(J){return w(J).desaturate(100)}function y(J,pe){pe=pe===0?0:pe||10;var ee=w(J).toHsl();return ee.l+=pe/100,ee.l=A(ee.l),w(ee)}function T(J,pe){pe=pe===0?0:pe||10;var ee=w(J).toRgb();return ee.r=h(0,j(255,ee.r-O(255*-(pe/100)))),ee.g=h(0,j(255,ee.g-O(255*-(pe/100)))),ee.b=h(0,j(255,ee.b-O(255*-(pe/100)))),w(ee)}function _(J,pe){pe=pe===0?0:pe||10;var ee=w(J).toHsl();return ee.l-=pe/100,ee.l=A(ee.l),w(ee)}function l(J,pe){var ee=w(J).toHsl(),Ae=(ee.h+pe)%360;return ee.h=Ae<0?360+Ae:Ae,w(ee)}function d(J){var pe=w(J).toHsl();return pe.h=(pe.h+180)%360,w(pe)}function a(J){var pe=w(J).toHsl(),ee=pe.h;return[w(J),w({h:(ee+120)%360,s:pe.s,l:pe.l}),w({h:(ee+240)%360,s:pe.s,l:pe.l})]}function c(J){var pe=w(J).toHsl(),ee=pe.h;return[w(J),w({h:(ee+90)%360,s:pe.s,l:pe.l}),w({h:(ee+180)%360,s:pe.s,l:pe.l}),w({h:(ee+270)%360,s:pe.s,l:pe.l})]}function v(J){var pe=w(J).toHsl(),ee=pe.h;return[w(J),w({h:(ee+72)%360,s:pe.s,l:pe.l}),w({h:(ee+216)%360,s:pe.s,l:pe.l})]}function f(J,pe,ee){pe=pe||6,ee=ee||30;var Ae=w(J).toHsl(),Ve=360/ee,Le=[w(J)];for(Ae.h=(Ae.h-(Ve*pe>>1)+720)%360;--pe;)Ae.h=(Ae.h+Ve)%360,Le.push(w(Ae));return Le}function b(J,pe){pe=pe||6;for(var ee=w(J).toHsv(),Ae=ee.h,Ve=ee.s,Le=ee.v,Ye=[],it=1/pe;pe--;)Ye.push(w({h:Ae,s:Ve,v:Le})),Le=(Le+it)%1;return Ye}w.mix=function(J,pe,ee){ee=ee===0?0:ee||50;var Ae=w(J).toRgb(),Ve=w(pe).toRgb(),Le=ee/100,Ye={r:(Ve.r-Ae.r)*Le+Ae.r,g:(Ve.g-Ae.g)*Le+Ae.g,b:(Ve.b-Ae.b)*Le+Ae.b,a:(Ve.a-Ae.a)*Le+Ae.a};return w(Ye)},w.readability=function(J,pe){var ee=w(J),Ae=w(pe);return(H.max(ee.getLuminance(),Ae.getLuminance())+.05)/(H.min(ee.getLuminance(),Ae.getLuminance())+.05)},w.isReadable=function(J,pe,ee){var Ae=w.readability(J,pe),Ve,Le;Le=!1,Ve=q(ee);switch(Ve.level+Ve.size){case"AAsmall":case"AAAlarge":Le=Ae>=4.5;break;case"AAlarge":Le=Ae>=3;break;case"AAAsmall":Le=Ae>=7;break}return Le},w.mostReadable=function(J,pe,ee){var Ae=null,Ve=0,Le,Ye,it,vt;ee=ee||{},Ye=ee.includeFallbackColors,it=ee.level,vt=ee.size;for(var ut=0;ut<pe.length;ut++)Le=w.readability(J,pe[ut]),Le>Ve&&(Ve=Le,Ae=w(pe[ut]));return w.isReadable(J,Ae,{level:it,size:vt})||!Ye?Ae:(ee.includeFallbackColors=!1,w.mostReadable(J,["#fff","#000"],ee))};var I=w.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=w.hexNames=P(I);function P(J){var pe={};for(var ee in J)J.hasOwnProperty(ee)&&(pe[J[ee]]=ee);return pe}function M(J){return J=parseFloat(J),(isNaN(J)||J<0||J>1)&&(J=1),J}function F(J,pe){z(J)&&(J="100%");var ee=Z(J);return J=j(pe,h(0,parseFloat(J))),ee&&(J=parseInt(J*pe,10)/100),H.abs(J-pe)<1e-6?1:J%pe/parseFloat(pe)}function A(J){return j(1,h(0,J))}function B(J){return parseInt(J,16)}function z(J){return typeof J=="string"&&J.indexOf(".")!=-1&&parseFloat(J)===1}function Z(J){return typeof J=="string"&&J.indexOf("%")!=-1}function ae(J){return J.length==1?"0"+J:""+J}function De(J){return J<=1&&(J=J*100+"%"),J}function _e(J){return H.round(parseFloat(J)*255).toString(16)}function Oe(J){return B(J)/255}var Ne=function(){var J="[-\\+]?\\d+%?",pe="[-\\+]?\\d*\\.\\d+%?",ee="(?:"+pe+")|(?:"+J+")",Ae="[\\s|\\(]+("+ee+")[,|\\s]+("+ee+")[,|\\s]+("+ee+")\\s*\\)?",Ve="[\\s|\\(]+("+ee+")[,|\\s]+("+ee+")[,|\\s]+("+ee+")[,|\\s]+("+ee+")\\s*\\)?";return{CSS_UNIT:new RegExp(ee),rgb:new RegExp("rgb"+Ae),rgba:new RegExp("rgba"+Ve),hsl:new RegExp("hsl"+Ae),hsla:new RegExp("hsla"+Ve),hsv:new RegExp("hsv"+Ae),hsva:new RegExp("hsva"+Ve),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ue(J){return!!Ne.CSS_UNIT.exec(J)}function Ee(J){J=J.replace(L,"").replace(W,"").toLowerCase();var pe=!1;if(I[J])J=I[J],pe=!0;else if(J=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ee;return(ee=Ne.rgb.exec(J))?{r:ee[1],g:ee[2],b:ee[3]}:(ee=Ne.rgba.exec(J))?{r:ee[1],g:ee[2],b:ee[3],a:ee[4]}:(ee=Ne.hsl.exec(J))?{h:ee[1],s:ee[2],l:ee[3]}:(ee=Ne.hsla.exec(J))?{h:ee[1],s:ee[2],l:ee[3],a:ee[4]}:(ee=Ne.hsv.exec(J))?{h:ee[1],s:ee[2],v:ee[3]}:(ee=Ne.hsva.exec(J))?{h:ee[1],s:ee[2],v:ee[3],a:ee[4]}:(ee=Ne.hex8.exec(J))?{r:B(ee[1]),g:B(ee[2]),b:B(ee[3]),a:Oe(ee[4]),format:pe?"name":"hex8"}:(ee=Ne.hex6.exec(J))?{r:B(ee[1]),g:B(ee[2]),b:B(ee[3]),format:pe?"name":"hex"}:(ee=Ne.hex4.exec(J))?{r:B(ee[1]+""+ee[1]),g:B(ee[2]+""+ee[2]),b:B(ee[3]+""+ee[3]),a:Oe(ee[4]+""+ee[4]),format:pe?"name":"hex8"}:(ee=Ne.hex3.exec(J))?{r:B(ee[1]+""+ee[1]),g:B(ee[2]+""+ee[2]),b:B(ee[3]+""+ee[3]),format:pe?"name":"hex"}:!1}function q(J){var pe,ee;return J=J||{level:"AA",size:"small"},pe=(J.level||"AA").toUpperCase(),ee=(J.size||"small").toLowerCase(),pe!=="AA"&&pe!=="AAA"&&(pe="AA"),ee!=="small"&&ee!=="large"&&(ee="small"),{level:pe,size:ee}}zt.exports?zt.exports=w:!(te=function(){return w}.call(Qe,G,Qe,zt),te!==void 0&&(zt.exports=te))})(Math)},bT9E:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return H});var te=G("VTBJ");function H(L,W){var x=Object(te.a)({},L);return Array.isArray(W)&&W.forEach(function(O){delete x[O]}),x}},biw7:function(zt,Qe,G){"use strict";var te=G("q1tI"),H=G.n(te),L=te.createContext(null);Qe.a=L},dmUQ:function(zt,Qe,G){"use strict";var te=G("Ff2n"),H=G("rePB"),L=G("1OyB"),W=G("vuIU"),x=G("Ji7U"),O=G("md7G"),j=G("foSv"),h=G("q1tI"),D=G.n(h),w=G("TSYQ"),g=G.n(w),m=G("4IlW");function u(a,c){var v=Object.keys(a);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);c&&(f=f.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),v.push.apply(v,f)}return v}function r(a){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?u(Object(v),!0).forEach(function(f){Object(H.a)(a,f,v[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(v)):u(Object(v)).forEach(function(f){Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(v,f))})}return a}function t(a){var c=n();return function(){var f=Object(j.a)(a),b;if(c){var I=Object(j.a)(this).constructor;b=Reflect.construct(f,arguments,I)}else b=f.apply(this,arguments);return Object(O.a)(this,b)}}function n(){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(a){return!1}}function s(){}function e(a){a.preventDefault()}var i=function(c){return c.replace(/[^\w.-]+/g,"")},o=200,S=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,y=function(c){return c!=null},T=function(c,v){return v===c||typeof v=="number"&&typeof c=="number"&&isNaN(v)&&isNaN(c)},_=function(a){Object(x.a)(v,a);var c=t(v);function v(f){var b;Object(L.a)(this,v),b=c.call(this,f),b.onKeyDown=function(P){var M=b.props,F=M.onKeyDown,A=M.onPressEnter;if(P.keyCode===m.a.UP){var B=b.getRatio(P);b.up(P,B,null),b.stop()}else if(P.keyCode===m.a.DOWN){var z=b.getRatio(P);b.down(P,z,null),b.stop()}else P.keyCode===m.a.ENTER&&A&&A(P);if(b.recordCursorPosition(),b.lastKeyCode=P.keyCode,F){for(var Z=arguments.length,ae=new Array(Z>1?Z-1:0),De=1;De<Z;De++)ae[De-1]=arguments[De];F.apply(void 0,[P].concat(ae))}},b.onKeyUp=function(P){var M=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),M){for(var F=arguments.length,A=new Array(F>1?F-1:0),B=1;B<F;B++)A[B-1]=arguments[B];M.apply(void 0,[P].concat(A))}},b.onChange=function(P){var M=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(P)),b.setState({inputValue:b.rawInput}),M(b.toNumber(b.rawInput))},b.onMouseUp=function(){var P=b.props.onMouseUp;b.recordCursorPosition(),P&&P.apply(void 0,arguments)},b.onFocus=function(){var P;b.setState({focused:!0}),(P=b.props).onFocus.apply(P,arguments)},b.onBlur=function(){var P=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var M=b.getCurrentValidValue(b.state.inputValue),F=b.setValue(M,s);if(P){var A=b.input.value,B=b.getInputDisplayValue({focus:!1,value:F});b.input.value=B&&Number(B),P.apply(void 0,arguments),b.input.value=A}},b.getRatio=function(P){var M=1;return P.metaKey||P.ctrlKey?M=.1:P.shiftKey&&(M=10),M},b.getFullNum=function(P){return isNaN(P)?P:/e/i.test(String(P))?Number(P).toFixed(18).replace(/\.?0+$/,""):P},b.getPrecision=function(P){if(y(b.props.precision))return b.props.precision;var M=String(P);if(M.indexOf("e-")>=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var F=0;return M.indexOf(".")>=0&&(F=M.length-M.indexOf(".")-1),F},b.getInputDisplayValue=function(P){var M=P||b.state,F=M.focused,A=M.inputValue,B=M.value,z;F?z=A:z=b.toPrecisionAsStep(B),z==null&&(z="");var Z=b.formatWrapper(z);return y(b.props.decimalSeparator)&&(Z=Z.toString().replace(".",b.props.decimalSeparator)),Z},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(P){}},b.restoreByAfter=function(P){if(P===void 0)return!1;var M=b.input.value,F=M.lastIndexOf(P);if(F===-1)return!1;var A=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(A-1)===P[0]?(b.fixCaret(A,A),!0):F+P.length===M.length?(b.fixCaret(F,F),!0):!1},b.partRestoreByAfter=function(P){return P===void 0?!1:Array.prototype.some.call(P,function(M,F){var A=P.substring(F);return b.restoreByAfter(A)})},b.isNotCompleteNumber=function(P){return isNaN(P)||P===""||P===null||P&&P.toString().indexOf(".")===P.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(P,M,F){b.pressingUpOrDown=!0,b.step("down",P,M,F)},b.up=function(P,M,F){b.pressingUpOrDown=!0,b.step("up",P,M,F)},b.saveInput=function(P){b.input=P};var I=f.value;I===void 0&&(I=f.defaultValue),b.state={focused:f.autoFocus};var R=b.getValidValue(b.toNumber(I));return b.state=r(r({},b.state),{},{inputValue:b.toPrecisionAsStep(R),value:R}),b}return Object(W.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var I=this.props,R=I.value,P=I.onChange,M=I.max,F=I.min,A=this.state.focused;if(b){if(!T(b.value,R)||!T(b.max,M)||!T(b.min,F)){var B=A?R:this.getValidValue(R),z;this.pressingUpOrDown?z=B:this.inputting?z=this.rawInput:z=this.toPrecisionAsStep(B),this.setState({value:B,inputValue:z})}var Z="value"in this.props?R:this.state.value;"max"in this.props&&b.max!==M&&typeof Z=="number"&&Z>M&&P&&P(M),"min"in this.props&&b.min!==F&&typeof Z=="number"&&Z<F&&P&&P(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ae=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ae=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ae=this.cursorStart):ae=this.input.value.length,this.fixCaret(ae,ae)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(De){}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(b){var I=b;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(b){var I=b.target.value.trim().replace(/。/g,".");return y(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(b){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,P=parseFloat(b);return isNaN(P)?b:(P<I&&(P=I),P>R&&(P=R),P)}},{key:"setValue",value:function(b,I){var R=this.props.precision,P=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),M=this.state.value,F=M===void 0?null:M,A=this.state.inputValue,B=A===void 0?null:A,z=typeof P=="number"?P.toFixed(R):"".concat(P),Z=P!==F||z!=="".concat(B);return"value"in this.props?(B=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:B},I)):this.setState({value:P,inputValue:this.toPrecisionAsStep(b)},I),Z&&this.props.onChange(P),P}},{key:"getMaxPrecision",value:function(b){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,R=this.props,P=R.precision,M=R.step;if(y(P))return P;var F=this.getPrecision(I),A=this.getPrecision(M),B=this.getPrecision(b);return b?Math.max(B,F+A):F+A}},{key:"getPrecisionFactor",value:function(b){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,R=this.getMaxPrecision(b,I);return Math.pow(10,R)}},{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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var I=Math.abs(this.getMaxPrecision(b));return isNaN(I)?b.toString():Number(b).toFixed(I)}},{key:"toNumber",value:function(b){var I=this.props.precision,R=this.state.focused,P=b&&b.length>16&&R;return this.isNotCompleteNumber(b)||P?b:y(I)?Math.round(b*Math.pow(10,I))/Math.pow(10,I):Number(b)}},{key:"upStep",value:function(b,I){var R=this.props.step,P=this.getPrecisionFactor(b,I),M=Math.abs(this.getMaxPrecision(b,I)),F=((P*b+P*R*I)/P).toFixed(M);return this.toNumber(F)}},{key:"downStep",value:function(b,I){var R=this.props.step,P=this.getPrecisionFactor(b,I),M=Math.abs(this.getMaxPrecision(b,I)),F=((P*b-P*R*I)/P).toFixed(M);return this.toNumber(F)}},{key:"step",value:function(b,I){var R=this,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var F=this.props;if(F.disabled)return;var A=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(A))return;var B=this["".concat(b,"Step")](A,P),z=B>F.max||B<F.min;if(B>F.max?B=F.max:B<F.min&&(B=F.min),this.setValue(B,null),this.setState({focused:!0},function(){R.pressingUpOrDown=!1}),z)return;this.autoStepTimer=setTimeout(function(){R[b](I,P,!0)},M?o:S)}},{key:"fixCaret",value:function(b,I){if(b===void 0||I===void 0||!this.input||!this.input.value)return;try{var R=this.input.selectionStart,P=this.input.selectionEnd;(b!==R||I!==P)&&this.input.setSelectionRange(b,I)}catch(M){}}},{key:"render",value:function(){var b,I=this.props,R=I.prefixCls,P=I.disabled,M=I.readOnly,F=I.useTouch,A=I.autoComplete,B=I.upHandler,z=I.downHandler,Z=I.className,ae=I.max,De=I.min,_e=I.style,Oe=I.title,Ne=I.onMouseEnter,Ue=I.onMouseLeave,Ee=I.onMouseOver,q=I.onMouseOut,J=I.required,pe=I.onClick,ee=I.tabIndex,Ae=I.type,Ve=I.placeholder,Le=I.id,Ye=I.inputMode,it=I.pattern,vt=I.step,ut=I.maxLength,mt=I.autoFocus,lt=I.name,Bt=I.onPaste,Nt=I.onInput,Wt=Object(te.a)(I,["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"]),Lt=this.state,Gt=Lt.value,Ut=Lt.focused,Re=g()(R,(b={},Object(H.a)(b,Z,!!Z),Object(H.a)(b,"".concat(R,"-disabled"),P),Object(H.a)(b,"".concat(R,"-focused"),Ut),b)),je={};Object.keys(Wt).forEach(function(fe){(fe.substr(0,5)==="data-"||fe.substr(0,5)==="aria-"||fe==="role")&&(je[fe]=Wt[fe])});var tt=!M&&!P,dt=this.getInputDisplayValue(null),ke=(Gt||Gt===0)&&(isNaN(Gt)||Number(Gt)>=ae),ot=(Gt||Gt===0)&&(isNaN(Gt)||Number(Gt)<=De),ve=ke||P||M,le=ot||P||M,ue=g()("".concat(R,"-handler"),"".concat(R,"-handler-up"),Object(H.a)({},"".concat(R,"-handler-up-disabled"),ve)),$=g()("".concat(R,"-handler"),"".concat(R,"-handler-down"),Object(H.a)({},"".concat(R,"-handler-down-disabled"),le)),Q=F?{onTouchStart:ve?s:this.up,onTouchEnd:this.stop}:{onMouseDown:ve?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},re=F?{onTouchStart:le?s:this.down,onTouchEnd:this.stop}:{onMouseDown:le?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return D.a.createElement("div",{className:Re,style:_e,title:Oe,onMouseEnter:Ne,onMouseLeave:Ue,onMouseOver:Ee,onMouseOut:q,onFocus:function(){return null},onBlur:function(){return null}},D.a.createElement("div",{className:"".concat(R,"-handler-wrap")},D.a.createElement("span",Object.assign({unselectable:"on"},Q,{role:"button","aria-label":"Increase Value","aria-disabled":ve,className:ue}),B||D.a.createElement("span",{unselectable:"on",className:"".concat(R,"-handler-up-inner"),onClick:e})),D.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Decrease Value","aria-disabled":le,className:$}),z||D.a.createElement("span",{unselectable:"on",className:"".concat(R,"-handler-down-inner"),onClick:e}))),D.a.createElement("div",{className:"".concat(R,"-input-wrap")},D.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":De,"aria-valuemax":ae,"aria-valuenow":Gt,required:J,type:Ae,placeholder:Ve,onPaste:Bt,onClick:pe,onMouseUp:this.onMouseUp,className:"".concat(R,"-input"),tabIndex:ee,autoComplete:A,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:s,onKeyUp:tt?this.onKeyUp:s,autoFocus:mt,maxLength:ut,readOnly:M,disabled:P,max:ae,min:De,step:vt,name:lt,title:Oe,id:Le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(dt),pattern:it,inputMode:Ye,onInput:Nt},je))))}}]),v}(D.a.Component);_.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:i,required:!1,autoComplete:"off"};var l=_,d=Qe.a=l},fyJ8:function(zt,Qe,G){"use strict";var te=G("rePB"),H=G("VTBJ"),L=G("Ff2n"),W=G("U8pU"),x=G("q1tI"),O=G.n(x),j=G("TSYQ"),h=G.n(j),D=G("c+Xe"),w=G("sR1s");function g(n){return n&&Object(W.a)(n)==="object"&&!Array.isArray(n)&&!x.isValidElement(n)}function m(n){return typeof n=="string"?!0:Object(D.c)(n)}function u(n,s){var e,i=n.prefixCls,o=n.className,S=n.record,E=n.index,y=n.dataIndex,T=n.render,_=n.children,l=n.component,d=l===void 0?"td":l,a=n.colSpan,c=n.rowSpan,v=n.fixLeft,f=n.fixRight,b=n.firstFixLeft,I=n.lastFixLeft,R=n.firstFixRight,P=n.lastFixRight,M=n.appendNode,F=n.additionalProps,A=F===void 0?{}:F,B=n.ellipsis,z=n.align,Z=n.rowType,ae=n.isSticky,De="".concat(i,"-cell"),_e,Oe;if(_)Oe=_;else{var Ne=Object(w.b)(S,y);if(Oe=Ne,T){var Ue=T(Ne,S,E);g(Ue)?(Oe=Ue.children,_e=Ue.props):Oe=Ue}}Object(W.a)(Oe)==="object"&&!Array.isArray(Oe)&&!x.isValidElement(Oe)&&(Oe=null),B&&(I||R)&&(Oe=x.createElement("span",{className:"".concat(De,"-content")},Oe));var Ee=_e||{},q=Ee.colSpan,J=Ee.rowSpan,pe=Ee.style,ee=Ee.className,Ae=Object(L.a)(Ee,["colSpan","rowSpan","style","className"]),Ve=q!==void 0?q:a,Le=J!==void 0?J:c;if(Ve===0||Le===0)return null;var Ye={},it=typeof v=="number",vt=typeof f=="number";it&&(Ye.position="sticky",Ye.left=v),vt&&(Ye.position="sticky",Ye.right=f);var ut={};z&&(ut.textAlign=z);var mt,lt=B===!0?{showTitle:!0}:B;lt&&(lt.showTitle||Z==="header")&&(typeof Oe=="string"||typeof Oe=="number"?mt=Oe.toString():x.isValidElement(Oe)&&typeof Oe.props.children=="string"&&(mt=Oe.props.children));var Bt=Object(H.a)(Object(H.a)(Object(H.a)({title:mt},Ae),A),{},{colSpan:Ve&&Ve!==1?Ve:null,rowSpan:Le&&Le!==1?Le:null,className:h()(De,o,(e={},Object(te.a)(e,"".concat(De,"-fix-left"),it),Object(te.a)(e,"".concat(De,"-fix-left-first"),b),Object(te.a)(e,"".concat(De,"-fix-left-last"),I),Object(te.a)(e,"".concat(De,"-fix-right"),vt),Object(te.a)(e,"".concat(De,"-fix-right-first"),R),Object(te.a)(e,"".concat(De,"-fix-right-last"),P),Object(te.a)(e,"".concat(De,"-ellipsis"),B),Object(te.a)(e,"".concat(De,"-with-append"),M),Object(te.a)(e,"".concat(De,"-fix-sticky"),(it||vt)&&ae),e),A.className,ee),style:Object(H.a)(Object(H.a)(Object(H.a)(Object(H.a)({},A.style),ut),Ye),pe),ref:m(d)?s:null});return x.createElement(d,Object.assign({},Bt),M,Oe)}var r=x.forwardRef(u);r.displayName="Cell";var t=x.memo(r,function(n,s){return s.shouldCellUpdate?!s.shouldCellUpdate(s.record,n.record):!1});Qe.a=t},h78n:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return b});var te=G("q1tI"),H=G.n(te),L=G("TSYQ"),W=G.n(L),x={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},O=function(P){var M=P.map(function(){return Object(te.useRef)()}),F=Object(te.useRef)();return Object(te.useEffect)(function(){var A=Date.now(),B=!1;Object.keys(M).forEach(function(z){var Z=M[z].current;if(!Z)return;B=!0;var ae=Z.style;ae.transitionDuration=".3s, .3s, .3s, .06s",F.current&&A-F.current<100&&(ae.transitionDuration="0s, 0s")}),B&&(F.current=Date.now())}),[M]};function j(){return j=Object.assign||function(R){for(var P=1;P<arguments.length;P++){var M=arguments[P];for(var F in M)Object.prototype.hasOwnProperty.call(M,F)&&(R[F]=M[F])}return R},j.apply(this,arguments)}function h(R,P){return u(R)||m(R,P)||w(R,P)||D()}function D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(R,P){if(!R)return;if(typeof R=="string")return g(R,P);var M=Object.prototype.toString.call(R).slice(8,-1);if(M==="Object"&&R.constructor&&(M=R.constructor.name),M==="Map"||M==="Set")return Array.from(R);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return g(R,P)}function g(R,P){(P==null||P>R.length)&&(P=R.length);for(var M=0,F=new Array(P);M<P;M++)F[M]=R[M];return F}function m(R,P){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(R)))return;var M=[],F=!0,A=!1,B=void 0;try{for(var z=R[Symbol.iterator](),Z;!(F=(Z=z.next()).done)&&!(M.push(Z.value),P&&M.length===P);F=!0);}catch(ae){A=!0,B=ae}finally{try{!F&&z.return!=null&&z.return()}finally{if(A)throw B}}return M}function u(R){if(Array.isArray(R))return R}function r(R,P){if(R==null)return{};var M=t(R,P),F,A;if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(R);for(A=0;A<B.length;A++){if(F=B[A],P.indexOf(F)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(R,F))continue;M[F]=R[F]}}return M}function t(R,P){if(R==null)return{};var M={},F=Object.keys(R),A,B;for(B=0;B<F.length;B++){if(A=F[B],P.indexOf(A)>=0)continue;M[A]=R[A]}return M}var n=function(P){var M=P.className,F=P.percent,A=P.prefixCls,B=P.strokeColor,z=P.strokeLinecap,Z=P.strokeWidth,ae=P.style,De=P.trailColor,_e=P.trailWidth,Oe=P.transition,Ne=r(P,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ne.gapPosition;var Ue=Array.isArray(F)?F:[F],Ee=Array.isArray(B)?B:[B],q=O(Ue),J=h(q,1),pe=J[0],ee=Z/2,Ae=100-Z/2,Ve="M ".concat(z==="round"?ee:0,",").concat(ee,`
|
|
L `).concat(z==="round"?Ae:100,",").concat(ee),Le="0 0 100 ".concat(Z),Ye=0;return H.a.createElement("svg",j({className:W()("".concat(A,"-line"),M),viewBox:Le,preserveAspectRatio:"none",style:ae},Ne),H.a.createElement("path",{className:"".concat(A,"-line-trail"),d:Ve,strokeLinecap:z,stroke:De,strokeWidth:_e||Z,fillOpacity:"0"}),Ue.map(function(it,vt){var ut={strokeDasharray:"".concat(it,"px, 100px"),strokeDashoffset:"-".concat(Ye,"px"),transition:Oe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},mt=Ee[vt]||Ee[Ee.length-1];return Ye+=it,H.a.createElement("path",{key:vt,className:"".concat(A,"-line-path"),d:Ve,strokeLinecap:z,stroke:mt,strokeWidth:Z,fillOpacity:"0",ref:pe[vt],style:ut})}))};n.defaultProps=x;var s=n;function e(){return e=Object.assign||function(R){for(var P=1;P<arguments.length;P++){var M=arguments[P];for(var F in M)Object.prototype.hasOwnProperty.call(M,F)&&(R[F]=M[F])}return R},e.apply(this,arguments)}function i(R,P){return T(R)||y(R,P)||S(R,P)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(R,P){if(!R)return;if(typeof R=="string")return E(R,P);var M=Object.prototype.toString.call(R).slice(8,-1);if(M==="Object"&&R.constructor&&(M=R.constructor.name),M==="Map"||M==="Set")return Array.from(R);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return E(R,P)}function E(R,P){(P==null||P>R.length)&&(P=R.length);for(var M=0,F=new Array(P);M<P;M++)F[M]=R[M];return F}function y(R,P){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(R)))return;var M=[],F=!0,A=!1,B=void 0;try{for(var z=R[Symbol.iterator](),Z;!(F=(Z=z.next()).done)&&!(M.push(Z.value),P&&M.length===P);F=!0);}catch(ae){A=!0,B=ae}finally{try{!F&&z.return!=null&&z.return()}finally{if(A)throw B}}return M}function T(R){if(Array.isArray(R))return R}function _(R,P){if(R==null)return{};var M=l(R,P),F,A;if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(R);for(A=0;A<B.length;A++){if(F=B[A],P.indexOf(F)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(R,F))continue;M[F]=R[F]}}return M}function l(R,P){if(R==null)return{};var M={},F=Object.keys(R),A,B;for(B=0;B<F.length;B++){if(A=F[B],P.indexOf(A)>=0)continue;M[A]=R[A]}return M}var d=0;function a(R){return+R.replace("%","")}function c(R){return Array.isArray(R)?R:[R]}function v(R,P,M,F){var A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,B=arguments.length>5?arguments[5]:void 0,z=50-F/2,Z=0,ae=-z,De=0,_e=-2*z;switch(B){case"left":Z=-z,ae=0,De=2*z,_e=0;break;case"right":Z=z,ae=0,De=-2*z,_e=0;break;case"bottom":ae=z,_e=2*z;break;default:}var Oe="M 50,50 m ".concat(Z,",").concat(ae,`
|
|
a `).concat(z,",").concat(z," 0 1 1 ").concat(De,",").concat(-_e,`
|
|
a `).concat(z,",").concat(z," 0 1 1 ").concat(-De,",").concat(_e),Ne=Math.PI*2*z,Ue={stroke:M,strokeDasharray:"".concat(P/100*(Ne-A),"px ").concat(Ne,"px"),strokeDashoffset:"-".concat(A/2+R/100*(Ne-A),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Oe,pathStyle:Ue}}var f=function(P){var M=P.prefixCls,F=P.strokeWidth,A=P.trailWidth,B=P.gapDegree,z=P.gapPosition,Z=P.trailColor,ae=P.strokeLinecap,De=P.style,_e=P.className,Oe=P.strokeColor,Ne=P.percent,Ue=_(P,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Ee=Object(te.useMemo)(function(){return d+=1,d},[]),q=v(0,100,Z,F,B,z),J=q.pathString,pe=q.pathStyle,ee=c(Ne),Ae=c(Oe),Ve=Ae.find(function(ut){return Object.prototype.toString.call(ut)==="[object Object]"}),Le=O(ee),Ye=i(Le,1),it=Ye[0],vt=function(){var mt=0;return ee.map(function(lt,Bt){var Nt=Ae[Bt]||Ae[Ae.length-1],Wt=Object.prototype.toString.call(Nt)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(Ee,")"):"",Lt=v(mt,lt,Nt,F,B,z);return mt+=lt,H.a.createElement("path",{key:Bt,className:"".concat(M,"-circle-path"),d:Lt.pathString,stroke:Wt,strokeLinecap:ae,strokeWidth:F,opacity:lt===0?0:1,fillOpacity:"0",style:Lt.pathStyle,ref:it[Bt]})})};return H.a.createElement("svg",e({className:W()("".concat(M,"-circle"),_e),viewBox:"0 0 100 100",style:De},Ue),Ve&&H.a.createElement("defs",null,H.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(Ee),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ve).sort(function(ut,mt){return a(ut)-a(mt)}).map(function(ut,mt){return H.a.createElement("stop",{key:mt,offset:ut,stopColor:Ve[ut]})}))),H.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:J,stroke:Z,strokeLinecap:ae,strokeWidth:A||F,fillOpacity:"0",style:pe}),vt().reverse())};f.defaultProps=x;var b=f,I={Line:s,Circle:b}},hW8S:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return W}),G.d(Qe,"c",function(){return x}),G.d(Qe,"b",function(){return O});var te=G("VTBJ"),H=G("Ff2n"),L=G("Kwbf"),W="RC_TABLE_INTERNAL_COL_DEFINE";function x(j){var h=j.expandable,D=Object(H.a)(j,["expandable"]);return"expandable"in j?Object(te.a)(Object(te.a)({},D),h):D}function O(j){return Object.keys(j).reduce(function(h,D){return(D.substr(0,5)==="data-"||D.substr(0,5)==="aria-")&&(h[D]=j[D]),h},{})}},k3GJ:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return Ai});var te=G("rePB"),H=G("ODXe"),L=G("Ff2n"),W=G("VTBJ"),x=G("q1tI"),O=G("TSYQ"),j=G.n(O),h=G("Zm9Q"),D=G("6cGi"),w=G("KQm4"),g=G("xEkU"),m=G.n(g),u=G("t23M");function r(se){var Ce=Object(x.useRef)(),we=Object(x.useRef)(!1);function he(){for(var Y=arguments.length,ie=new Array(Y),X=0;X<Y;X++)ie[X]=arguments[X];we.current||(m.a.cancel(Ce.current),Ce.current=m()(function(){se.apply(void 0,ie)}))}return Object(x.useEffect)(function(){return function(){we.current=!0,m.a.cancel(Ce.current)}},[]),he}function t(se){var Ce=Object(x.useRef)([]),we=Object(x.useState)({}),he=Object(H.a)(we,2),Y=he[1],ie=Object(x.useRef)(typeof se=="function"?se():se),X=r(function(){var ge=ie.current;Ce.current.forEach(function(Ie){ge=Ie(ge)}),Ce.current=[],ie.current=ge,Y({})});function ce(ge){Ce.current.push(ge),X()}return[ie.current,ce]}var n=G("4IlW");function s(se,Ce){var we,he=se.prefixCls,Y=se.id,ie=se.active,X=se.rtl,ce=se.tab,ge=ce.key,Ie=ce.tab,be=ce.disabled,Be=ce.closeIcon,nt=se.tabBarGutter,yt=se.tabPosition,Ct=se.closable,kt=se.renderWrapper,en=se.removeAriaLabel,mn=se.editable,hn=se.onClick,Rn=se.onRemove,An=se.onFocus,Cn="".concat(he,"-tab");x.useEffect(function(){return Rn},[]);var wn={};yt==="top"||yt==="bottom"?wn[X?"marginLeft":"marginRight"]=nt:wn.marginBottom=nt;var Mn=mn&&Ct!==!1&&!be;function fn(At){if(be)return;hn(At)}function zn(At){At.preventDefault(),At.stopPropagation(),mn.onEdit("remove",{key:ge,event:At})}var _n=x.createElement("div",{key:ge,ref:Ce,className:j()(Cn,(we={},Object(te.a)(we,"".concat(Cn,"-with-remove"),Mn),Object(te.a)(we,"".concat(Cn,"-active"),ie),Object(te.a)(we,"".concat(Cn,"-disabled"),be),we)),style:wn,onClick:fn},x.createElement("div",{role:"tab","aria-selected":ie,id:Y&&"".concat(Y,"-tab-").concat(ge),className:"".concat(Cn,"-btn"),"aria-controls":Y&&"".concat(Y,"-panel-").concat(ge),"aria-disabled":be,tabIndex:be?null:0,onClick:function(Ht){Ht.stopPropagation(),fn(Ht)},onKeyDown:function(Ht){[n.a.SPACE,n.a.ENTER].includes(Ht.which)&&(Ht.preventDefault(),fn(Ht))},onFocus:An},Ie),Mn&&x.createElement("button",{type:"button","aria-label":en||"remove",tabIndex:0,className:"".concat(Cn,"-remove"),onClick:function(Ht){Ht.stopPropagation(),zn(Ht)}},Be||mn.removeIcon||"\xD7"));return kt&&(_n=kt(_n)),_n}var e=x.forwardRef(s),i={width:0,height:0,left:0,top:0};function o(se,Ce,we){return Object(x.useMemo)(function(){for(var he,Y=new Map,ie=Ce.get((he=se[0])===null||he===void 0?void 0:he.key)||i,X=ie.left+ie.width,ce=0;ce<se.length;ce+=1){var ge=se[ce].key,Ie=Ce.get(ge);if(!Ie){var be;Ie=Ce.get((be=se[ce-1])===null||be===void 0?void 0:be.key)||i}var Be=Y.get(ge)||Object(W.a)({},Ie);Be.right=X-Be.left-Be.width,Y.set(ge,Be)}return Y},[se.map(function(he){return he.key}).join("_"),Ce,we])}var S={width:0,height:0,left:0,top:0,right:0};function E(se,Ce,we,he,Y){var ie=Y.tabs,X=Y.tabPosition,ce=Y.rtl,ge,Ie,be;["top","bottom"].includes(X)?(ge="width",Ie=ce?"right":"left",be=Math.abs(Ce.left)):(ge="height",Ie="top",be=-Ce.top);var Be=Ce[ge],nt=we[ge],yt=he[ge],Ct=Be;return nt+yt>Be&&(Ct=Be-yt),Object(x.useMemo)(function(){if(!ie.length)return[0,0];for(var kt=ie.length,en=kt,mn=0;mn<kt;mn+=1){var hn=se.get(ie[mn].key)||S;if(hn[Ie]+hn[ge]>be+Ct){en=mn-1;break}}for(var Rn=0,An=kt-1;An>=0;An-=1){var Cn=se.get(ie[An].key)||S;if(Cn[Ie]<be){Rn=An+1;break}}return[Rn,en]},[se,be,Ct,X,ie.map(function(kt){return kt.key}).join("_"),ce])}var y=G("wx14"),T=G("1OyB"),_=G("vuIU"),l=G("JX7q"),d=G("Ji7U"),a=G("LK+K"),c=G("I8Z2"),v=G("bT9E"),f=G("2GS6"),b=G("Gytx"),I=G.n(b),R=G("U8pU"),P=/iPhone/i,M=/iPod/i,F=/iPad/i,A=/\bAndroid(?:.+)Mobile\b/i,B=/Android/i,z=/\bAndroid(?:.+)SD4930UR\b/i,Z=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ae=/Windows Phone/i,De=/\bWindows(?:.+)ARM\b/i,_e=/BlackBerry/i,Oe=/BB10/i,Ne=/Opera Mini/i,Ue=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ee=/Mobile(?:.+)Firefox\b/i;function q(se,Ce){return se.test(Ce)}function J(se){var Ce=se||(typeof navigator!="undefined"?navigator.userAgent:""),we=(Ce||"").split("[FBAN");if(typeof we[1]!="undefined"){var he=we,Y=Object(H.a)(he,1);Ce=Y[0]}if(we=Ce.split("Twitter"),typeof we[1]!="undefined"){var ie=we,X=Object(H.a)(ie,1);Ce=X[0]}var ce={apple:{phone:q(P,Ce)&&!q(ae,Ce),ipod:q(M,Ce),tablet:!q(P,Ce)&&q(F,Ce)&&!q(ae,Ce),device:(q(P,Ce)||q(M,Ce)||q(F,Ce))&&!q(ae,Ce)},amazon:{phone:q(z,Ce),tablet:!q(z,Ce)&&q(Z,Ce),device:q(z,Ce)||q(Z,Ce)},android:{phone:!q(ae,Ce)&&q(z,Ce)||!q(ae,Ce)&&q(A,Ce),tablet:!q(ae,Ce)&&!q(z,Ce)&&!q(A,Ce)&&(q(Z,Ce)||q(B,Ce)),device:!q(ae,Ce)&&(q(z,Ce)||q(Z,Ce)||q(A,Ce)||q(B,Ce))||q(/\bokhttp\b/i,Ce)},windows:{phone:q(ae,Ce),tablet:q(De,Ce),device:q(ae,Ce)||q(De,Ce)},other:{blackberry:q(_e,Ce),blackberry10:q(Oe,Ce),opera:q(Ne,Ce),firefox:q(Ee,Ce),chrome:q(Ue,Ce),device:q(_e,Ce)||q(Oe,Ce)||q(Ne,Ce)||q(Ee,Ce)||q(Ue,Ce)},any:null,phone:null,tablet:null};return ce.any=ce.apple.device||ce.android.device||ce.windows.device||ce.other.device,ce.phone=ce.apple.phone||ce.android.phone||ce.windows.phone,ce.tablet=ce.apple.tablet||ce.android.tablet||ce.windows.tablet,ce}var pe=Object(W.a)(Object(W.a)({},J()),{},{isMobile:J}),ee=pe;function Ae(){}function Ve(se,Ce,we){var he=Ce||"";return se.key||"".concat(he,"item_").concat(we)}function Le(se){return"".concat(se,"-menu-")}function Ye(se,Ce){var we=-1;x.Children.forEach(se,function(he){we+=1,he&&he.type&&he.type.isMenuItemGroup?x.Children.forEach(he.props.children,function(Y){we+=1,Ce(Y,we)}):Ce(he,we)})}function it(se,Ce,we){if(!se||we.find)return;x.Children.forEach(se,function(he){if(he){var Y=he.type;if(!Y||!(Y.isSubMenu||Y.isMenuItem||Y.isMenuItemGroup))return;Ce.indexOf(he.key)!==-1?we.find=!0:he.props.children&&it(he.props.children,Ce,we)}})}var vt=["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"],ut=function(Ce){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=Ce&&typeof Ce.getBoundingClientRect=="function"&&Ce.getBoundingClientRect().width;if(he){if(we){var Y=getComputedStyle(Ce),ie=Y.marginLeft,X=Y.marginRight;he+=+ie.replace("px","")+ +X.replace("px","")}he=+he.toFixed(6)}return he||0},mt=function(Ce,we,he){Ce&&Object(R.a)(Ce.style)==="object"&&(Ce.style[we]=he)},lt=function(){return ee.any},Bt=G("bdgK"),Nt=G("i8i4"),Wt=G.n(Nt),Lt=G("wgJM"),Gt=G("l4aY"),Ut=G("m+aA"),Re=G("c+Xe"),je=G("zT1h"),tt=G("QC+M");function dt(se,Ce,we){return we?se[0]===Ce[0]:se[0]===Ce[0]&&se[1]===Ce[1]}function ke(se,Ce,we){var he=se[Ce]||{};return Object(W.a)(Object(W.a)({},he),we)}function ot(se,Ce,we,he){for(var Y=we.points,ie=Object.keys(se),X=0;X<ie.length;X+=1){var ce=ie[X];if(dt(se[ce].points,Y,he))return"".concat(Ce,"-placement-").concat(ce)}return""}var ve=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var se=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(se)||/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(se==null?void 0:se.substr(0,4)))},le=G("MNnm");function ue(se,Ce){var we={};return we[se.toLowerCase()]=Ce.toLowerCase(),we["Webkit".concat(se)]="webkit".concat(Ce),we["Moz".concat(se)]="moz".concat(Ce),we["ms".concat(se)]="MS".concat(Ce),we["O".concat(se)]="o".concat(Ce.toLowerCase()),we}function $(se,Ce){var we={animationend:ue("Animation","AnimationEnd"),transitionend:ue("Transition","TransitionEnd")};return se&&("AnimationEvent"in Ce||delete we.animationend.animation,"TransitionEvent"in Ce||delete we.transitionend.transition),we}var Q=$(Object(le.a)(),typeof window!="undefined"?window:{}),re={};if(Object(le.a)()){var fe=document.createElement("div");re=fe.style}var Pe={};function Ge(se){if(Pe[se])return Pe[se];var Ce=Q[se];if(Ce)for(var we=Object.keys(Ce),he=we.length,Y=0;Y<he;Y+=1){var ie=we[Y];if(Object.prototype.hasOwnProperty.call(Ce,ie)&&ie in re)return Pe[se]=Ce[ie],Pe[se]}return""}var bt=Ge("animationend"),Ft=Ge("transitionend"),Xt=!!(bt&&Ft),Pt=bt||"animationend",St=Ft||"transitionend";function Ze(se,Ce){if(!se)return null;if(Object(R.a)(se)==="object"){var we=Ce.replace(/-\w/g,function(he){return he[1].toUpperCase()});return se[we]}return"".concat(se,"-").concat(Ce)}var qe="none",Me="appear",ne="enter",me="leave",rt="none",Ke="prepare",xt="start",Ot="active",xe="end";function Je(se){var Ce=Object(x.useRef)(!1),we=Object(x.useState)(se),he=Object(H.a)(we,2),Y=he[0],ie=he[1];function X(ce){Ce.current||ie(ce)}return Object(x.useEffect)(function(){return function(){Ce.current=!0}},[]),[Y,X]}var wt=Object(le.a)()?x.useLayoutEffect:x.useEffect,jt=wt,Qt=function(){var se=x.useRef(null);function Ce(){Lt.a.cancel(se.current)}function we(he){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ce();var ie=Object(Lt.a)(function(){Y<=1?he({isCanceled:function(){return ie!==se.current}}):we(he,Y-1)});se.current=ie}return x.useEffect(function(){return function(){Ce()}},[]),[we,Ce]},Gn=[Ke,xt,Ot,xe],Vn=!1,ei=!0;function ci(se){return se===Ot||se===xe}var ni=function(se,Ce){var we=x.useState(rt),he=Object(H.a)(we,2),Y=he[0],ie=he[1],X=Qt(),ce=Object(H.a)(X,2),ge=ce[0],Ie=ce[1];function be(){ie(Ke)}return jt(function(){if(Y!==rt&&Y!==xe){var Be=Gn.indexOf(Y),nt=Gn[Be+1],yt=Ce(Y);yt===Vn?ie(nt):ge(function(Ct){function kt(){if(Ct.isCanceled())return;ie(nt)}yt===!0?kt():Promise.resolve(yt).then(kt)})}},[se,Y]),x.useEffect(function(){return function(){Ie()}},[]),[be,Y]},_i=function(se){var Ce=Object(x.useRef)(),we=Object(x.useRef)(se);we.current=se;var he=x.useCallback(function(X){we.current(X)},[]);function Y(X){X&&(X.removeEventListener(St,he),X.removeEventListener(Pt,he))}function ie(X){Ce.current&&Ce.current!==X&&Y(Ce.current),X&&X!==Ce.current&&(X.addEventListener(St,he),X.addEventListener(Pt,he),Ce.current=X)}return x.useEffect(function(){return function(){Y(Ce.current)}},[]),[ie,Y]};function di(se,Ce,we,he){var Y=he.motionEnter,ie=Y===void 0?!0:Y,X=he.motionAppear,ce=X===void 0?!0:X,ge=he.motionLeave,Ie=ge===void 0?!0:ge,be=he.motionDeadline,Be=he.motionLeaveImmediately,nt=he.onAppearPrepare,yt=he.onEnterPrepare,Ct=he.onLeavePrepare,kt=he.onAppearStart,en=he.onEnterStart,mn=he.onLeaveStart,hn=he.onAppearActive,Rn=he.onEnterActive,An=he.onLeaveActive,Cn=he.onAppearEnd,wn=he.onEnterEnd,Mn=he.onLeaveEnd,fn=he.onVisibleChanged,zn=Je(),_n=Object(H.a)(zn,2),At=_n[0],Ht=_n[1],xn=Je(qe),Fn=Object(H.a)(xn,2),nn=Fn[0],Kn=Fn[1],oi=Je(null),Bn=Object(H.a)(oi,2),Xn=Bn[0],si=Bn[1],Jn=Object(x.useRef)(!1),$n=Object(x.useRef)(null),yn=Object(x.useRef)(!1),Ti=Object(x.useRef)(null);function qi(){var fi=we();return fi||Ti.current}var Wi=Object(x.useRef)(!1);function $i(fi){var Zn=qi();if(fi&&!fi.deadline&&fi.target!==Zn)return;var Di;nn===Me&&Wi.current?Di=Cn==null?void 0:Cn(Zn,fi):nn===ne&&Wi.current?Di=wn==null?void 0:wn(Zn,fi):nn===me&&Wi.current&&(Di=Mn==null?void 0:Mn(Zn,fi)),Di!==!1&&!yn.current&&(Kn(qe),si(null))}var Ci=_i($i),Pi=Object(H.a)(Ci,1),bi=Pi[0],Si=x.useMemo(function(){var fi,Zn,Di;switch(nn){case"appear":return fi={},Object(te.a)(fi,Ke,nt),Object(te.a)(fi,xt,kt),Object(te.a)(fi,Ot,hn),fi;case"enter":return Zn={},Object(te.a)(Zn,Ke,yt),Object(te.a)(Zn,xt,en),Object(te.a)(Zn,Ot,Rn),Zn;case"leave":return Di={},Object(te.a)(Di,Ke,Ct),Object(te.a)(Di,xt,mn),Object(te.a)(Di,Ot,An),Di;default:return{}}},[nn]),Qi=ni(nn,function(fi){if(fi===Ke){var Zn=Si[Ke];return Zn?Zn(qi()):Vn}if(ui in Si){var Di;si(((Di=Si[ui])===null||Di===void 0?void 0:Di.call(Si,qi(),null))||null)}return ui===Ot&&(bi(qi()),be>0&&(clearTimeout($n.current),$n.current=setTimeout(function(){$i({deadline:!0})},be))),ei}),or=Object(H.a)(Qi,2),sr=or[0],ui=or[1],er=ci(ui);Wi.current=er,jt(function(){Ht(Ce);var fi=Jn.current;if(Jn.current=!0,!se)return;var Zn;!fi&&Ce&&ce&&(Zn=Me),fi&&Ce&&ie&&(Zn=ne),(fi&&!Ce&&Ie||!fi&&Be&&!Ce&&Ie)&&(Zn=me),Zn&&(Kn(Zn),sr())},[Ce]),Object(x.useEffect)(function(){(nn===Me&&!ce||nn===ne&&!ie||nn===me&&!Ie)&&Kn(qe)},[ce,ie,Ie]),Object(x.useEffect)(function(){return function(){clearTimeout($n.current),yn.current=!0}},[]),Object(x.useEffect)(function(){At!==void 0&&nn===qe&&(fn==null||fn(At))},[At,nn]);var tr=Xn;return Si[Ke]&&ui===xt&&(tr=Object(W.a)({transition:"none"},tr)),[nn,ui,tr,At!=null?At:Ce]}var rn=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(){return Object(T.a)(this,we),Ce.apply(this,arguments)}return Object(_.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(x.Component),Dt=rn;function $t(se){var Ce=se;Object(R.a)(se)==="object"&&(Ce=se.transitionSupport);function we(Y){return!!(Y.motionName&&Ce)}var he=x.forwardRef(function(Y,ie){var X=Y.visible,ce=X===void 0?!0:X,ge=Y.removeOnLeave,Ie=ge===void 0?!0:ge,be=Y.forceRender,Be=Y.children,nt=Y.motionName,yt=Y.leavedClassName,Ct=Y.eventProps,kt=we(Y),en=Object(x.useRef)(),mn=Object(x.useRef)();function hn(){try{return Object(Ut.a)(en.current||mn.current)}catch(Kn){return null}}var Rn=di(kt,ce,hn,Y),An=Object(H.a)(Rn,4),Cn=An[0],wn=An[1],Mn=An[2],fn=An[3],zn=x.useRef(fn);fn&&(zn.current=!0);var _n=Object(x.useRef)(ie);_n.current=ie;var At=x.useCallback(function(Kn){en.current=Kn,Object(Re.b)(_n.current,Kn)},[]),Ht,xn=Object(W.a)(Object(W.a)({},Ct),{},{visible:ce});if(!Be)Ht=null;else if(Cn===qe||!we(Y))fn?Ht=Be(Object(W.a)({},xn),At):!Ie&&zn.current?Ht=Be(Object(W.a)(Object(W.a)({},xn),{},{className:yt}),At):be?Ht=Be(Object(W.a)(Object(W.a)({},xn),{},{style:{display:"none"}}),At):Ht=null;else{var Fn,nn;wn===Ke?nn="prepare":ci(wn)?nn="active":wn===xt&&(nn="start"),Ht=Be(Object(W.a)(Object(W.a)({},xn),{},{className:j()(Ze(nt,Cn),(Fn={},Object(te.a)(Fn,Ze(nt,"".concat(Cn,"-").concat(nn)),nn),Object(te.a)(Fn,nt,typeof nt=="string"),Fn)),style:Mn}),At)}return x.createElement(Dt,{ref:mn},Ht)});return he.displayName="CSSMotion",he}var cn=$t(Xt),Sn="add",Dn="keep",gn="remove",En="removed";function sn(se){var Ce;return se&&Object(R.a)(se)==="object"&&"key"in se?Ce=se:Ce={key:se},Object(W.a)(Object(W.a)({},Ce),{},{key:String(Ce.key)})}function et(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return se.map(sn)}function k(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=[],he=0,Y=Ce.length,ie=et(se),X=et(Ce);ie.forEach(function(Ie){for(var be=!1,Be=he;Be<Y;Be+=1){var nt=X[Be];if(nt.key===Ie.key){he<Be&&(we=we.concat(X.slice(he,Be).map(function(yt){return Object(W.a)(Object(W.a)({},yt),{},{status:Sn})})),he=Be),we.push(Object(W.a)(Object(W.a)({},nt),{},{status:Dn})),he+=1,be=!0;break}}be||we.push(Object(W.a)(Object(W.a)({},Ie),{},{status:gn}))}),he<Y&&(we=we.concat(X.slice(he).map(function(Ie){return Object(W.a)(Object(W.a)({},Ie),{},{status:Sn})})));var ce={};we.forEach(function(Ie){var be=Ie.key;ce[be]=(ce[be]||0)+1});var ge=Object.keys(ce).filter(function(Ie){return ce[Ie]>1});return ge.forEach(function(Ie){we=we.filter(function(be){var Be=be.key,nt=be.status;return Be!==Ie||nt!==gn}),we.forEach(function(be){be.key===Ie&&(be.status=Dn)})}),we}var p=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function C(se){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cn,we=function(he){Object(d.a)(ie,he);var Y=Object(a.a)(ie);function ie(){var X;return Object(T.a)(this,ie),X=Y.apply(this,arguments),X.state={keyEntities:[]},X.removeKey=function(ce){X.setState(function(ge){var Ie=ge.keyEntities;return{keyEntities:Ie.map(function(be){return be.key!==ce?be:Object(W.a)(Object(W.a)({},be),{},{status:En})})}})},X}return Object(_.a)(ie,[{key:"render",value:function(){var ce=this,ge=this.state.keyEntities,Ie=this.props,be=Ie.component,Be=Ie.children,nt=Ie.onVisibleChanged,yt=Object(L.a)(Ie,["component","children","onVisibleChanged"]),Ct=be||x.Fragment,kt={};return p.forEach(function(en){kt[en]=yt[en],delete yt[en]}),delete yt.keys,x.createElement(Ct,yt,ge.map(function(en){var mn=en.status,hn=Object(L.a)(en,["status"]),Rn=mn===Sn||mn===Dn;return x.createElement(Ce,Object(y.a)({},kt,{key:hn.key,visible:Rn,eventProps:hn,onVisibleChanged:function(Cn){nt==null||nt(Cn,{key:hn.key}),Cn||ce.removeKey(hn.key)}}),Be)}))}}],[{key:"getDerivedStateFromProps",value:function(ce,ge){var Ie=ce.keys,be=ge.keyEntities,Be=et(Ie),nt=k(be,Be);return{keyEntities:nt.filter(function(yt){var Ct=be.find(function(kt){var en=kt.key;return yt.key===en});return!(Ct&&Ct.status===En&&yt.status===gn)})}}}]),ie}(x.Component);return we.defaultProps={component:"div"},we}var N=C(Xt),V=cn;function U(se){var Ce=se.prefixCls,we=se.motion,he=se.animation,Y=se.transitionName;return we||(he?{motionName:"".concat(Ce,"-").concat(he)}:Y?{motionName:Y}:null)}function de(se){var Ce=se.prefixCls,we=se.visible,he=se.zIndex,Y=se.mask,ie=se.maskMotion,X=se.maskAnimation,ce=se.maskTransitionName;if(!Y)return null;var ge={};return(ie||ce||X)&&(ge=Object(W.a)({motionAppear:!0},U({motion:ie,prefixCls:Ce,transitionName:ce,animation:X}))),x.createElement(V,Object(y.a)({},ge,{visible:we,removeOnLeave:!0}),function(Ie){var be=Ie.className;return x.createElement("div",{style:{zIndex:he},className:j()("".concat(Ce,"-mask"),be)})})}var ze=G("9mu1"),_t=G("o0o1"),Mt=G.n(_t),ct=G("HaE+"),Vt=["measure","align",null,"motion"],Et=function(se,Ce){var we=Object(x.useState)(null),he=Object(H.a)(we,2),Y=he[0],ie=he[1],X=Object(x.useRef)(),ce=Object(x.useRef)(!1);function ge(Be){ce.current||ie(Be)}function Ie(){Lt.a.cancel(X.current)}function be(Be){Ie(),X.current=Object(Lt.a)(function(){ge(function(nt){switch(Y){case"align":return"motion";case"motion":return"stable";default:}return nt}),Be==null||Be()})}return Object(x.useEffect)(function(){ge("measure")},[se]),Object(x.useEffect)(function(){switch(Y){case"measure":Ce();break;default:}Y&&(X.current=Object(Lt.a)(Object(ct.a)(Mt.a.mark(function Be(){var nt,yt;return Mt.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:nt=Vt.indexOf(Y),yt=Vt[nt+1],yt&&nt!==-1&&ge(yt);case 3:case"end":return kt.stop()}},Be)}))))},[Y]),Object(x.useEffect)(function(){return function(){ce.current=!0,Ie()}},[]),[Y,be]},Yt=function(se){var Ce=x.useState({width:0,height:0}),we=Object(H.a)(Ce,2),he=we[0],Y=we[1];function ie(ce){Y({width:ce.offsetWidth,height:ce.offsetHeight})}var X=x.useMemo(function(){var ce={};if(se){var ge=he.width,Ie=he.height;se.indexOf("height")!==-1&&Ie?ce.height=Ie:se.indexOf("minHeight")!==-1&&Ie&&(ce.minHeight=Ie),se.indexOf("width")!==-1&&ge?ce.width=ge:se.indexOf("minWidth")!==-1&&ge&&(ce.minWidth=ge)}return ce},[se,he]);return[X,ie]},dn=x.forwardRef(function(se,Ce){var we=se.visible,he=se.prefixCls,Y=se.className,ie=se.style,X=se.children,ce=se.zIndex,ge=se.stretch,Ie=se.destroyPopupOnHide,be=se.forceRender,Be=se.align,nt=se.point,yt=se.getRootDomNode,Ct=se.getClassNameFromAlign,kt=se.onAlign,en=se.onMouseEnter,mn=se.onMouseLeave,hn=se.onMouseDown,Rn=se.onTouchStart,An=Object(x.useRef)(),Cn=Object(x.useRef)(),wn=Object(x.useState)(),Mn=Object(H.a)(wn,2),fn=Mn[0],zn=Mn[1],_n=Yt(ge),At=Object(H.a)(_n,2),Ht=At[0],xn=At[1];function Fn(){ge&&xn(yt())}var nn=Et(we,Fn),Kn=Object(H.a)(nn,2),oi=Kn[0],Bn=Kn[1],Xn=Object(x.useRef)();function si(){return nt||yt}function Jn(){var Ci;(Ci=An.current)===null||Ci===void 0||Ci.forceAlign()}function $n(Ci,Pi){var bi=Ct(Pi);fn!==bi&&zn(bi),oi==="align"&&(fn!==bi?Promise.resolve().then(function(){Jn()}):Bn(function(){var Si;(Si=Xn.current)===null||Si===void 0||Si.call(Xn)}),kt==null||kt(Ci,Pi))}var yn=Object(W.a)({},U(se));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Ci){var Pi=yn[Ci];yn[Ci]=function(bi,Si){return Bn(),Pi==null?void 0:Pi(bi,Si)}});function Ti(){return new Promise(function(Ci){Xn.current=Ci})}x.useEffect(function(){!yn.motionName&&oi==="motion"&&Bn()},[yn.motionName,oi]),x.useImperativeHandle(Ce,function(){return{forceAlign:Jn,getElement:function(){return Cn.current}}});var qi=Object(W.a)(Object(W.a)({},Ht),{},{zIndex:ce,opacity:oi==="motion"||oi==="stable"||!we?void 0:0,pointerEvents:oi==="stable"?void 0:"none"},ie),Wi=!0;(Be==null?void 0:Be.points)&&(oi==="align"||oi==="stable")&&(Wi=!1);var $i=X;return x.Children.count(X)>1&&($i=x.createElement("div",{className:"".concat(he,"-content")},X)),x.createElement(V,Object(y.a)({visible:we,ref:Cn,leavedClassName:"".concat(he,"-hidden")},yn,{onAppearPrepare:Ti,onEnterPrepare:Ti,removeOnLeave:Ie,forceRender:be}),function(Ci,Pi){var bi=Ci.className,Si=Ci.style,Qi=j()(he,Y,fn,bi);return x.createElement(ze.a,{target:si(),key:"popup",ref:An,monitorWindowResize:!0,disabled:Wi,align:Be,onAlign:$n},x.createElement("div",{ref:Pi,className:Qi,onMouseEnter:en,onMouseLeave:mn,onMouseDownCapture:hn,onTouchStartCapture:Rn,style:Object(W.a)(Object(W.a)({},Si),qi)},$i))})});dn.displayName="PopupInner";var Un=dn,On=x.forwardRef(function(se,Ce){var we=se.prefixCls,he=se.visible,Y=se.zIndex,ie=se.children,X=se.mobile;X=X===void 0?{}:X;var ce=X.popupClassName,ge=X.popupStyle,Ie=X.popupMotion,be=Ie===void 0?{}:Ie,Be=X.popupRender,nt=x.useRef();x.useImperativeHandle(Ce,function(){return{forceAlign:function(){},getElement:function(){return nt.current}}});var yt=Object(W.a)({zIndex:Y},ge),Ct=ie;return x.Children.count(ie)>1&&(Ct=x.createElement("div",{className:"".concat(we,"-content")},ie)),Be&&(Ct=Be(Ct)),x.createElement(V,Object(y.a)({visible:he,ref:nt,removeOnLeave:!0},be),function(kt,en){var mn=kt.className,hn=kt.style,Rn=j()(we,ce,mn);return x.createElement("div",{ref:en,className:Rn,style:Object(W.a)(Object(W.a)({},hn),yt)},Ct)})});On.displayName="MobilePopupInner";var bn=On,ln=["visible","mobile"],Jt=x.forwardRef(function(se,Ce){var we=se.visible,he=se.mobile,Y=Object(L.a)(se,ln),ie=Object(x.useState)(we),X=Object(H.a)(ie,2),ce=X[0],ge=X[1],Ie=Object(x.useState)(!1),be=Object(H.a)(Ie,2),Be=be[0],nt=be[1],yt=Object(W.a)(Object(W.a)({},Y),{},{visible:ce});Object(x.useEffect)(function(){ge(we),we&&he&&nt(ve())},[we,he]);var Ct=Be?x.createElement(bn,Object(y.a)({},yt,{mobile:he,ref:Ce})):x.createElement(Un,Object(y.a)({},yt,{ref:Ce}));return x.createElement("div",null,x.createElement(de,yt),Ct)});Jt.displayName="Popup";var In=Jt,Wn=x.createContext(null),ii=Wn;function Pn(){}function Nn(){return""}function Qn(se){return se?se.ownerDocument:window.document}var ri=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Oi(se){var Ce=function(we){Object(d.a)(Y,we);var he=Object(a.a)(Y);function Y(ie){var X;Object(T.a)(this,Y),X=he.call(this,ie),X.popupRef=x.createRef(),X.triggerRef=x.createRef(),X.attachId=void 0,X.clickOutsideHandler=void 0,X.touchOutsideHandler=void 0,X.contextMenuOutsideHandler1=void 0,X.contextMenuOutsideHandler2=void 0,X.mouseDownTimeout=void 0,X.focusTime=void 0,X.preClickTime=void 0,X.preTouchTime=void 0,X.delayTimer=void 0,X.hasPopupMouseDown=void 0,X.onMouseEnter=function(ge){var Ie=X.props.mouseEnterDelay;X.fireEvents("onMouseEnter",ge),X.delaySetPopupVisible(!0,Ie,Ie?null:ge)},X.onMouseMove=function(ge){X.fireEvents("onMouseMove",ge),X.setPoint(ge)},X.onMouseLeave=function(ge){X.fireEvents("onMouseLeave",ge),X.delaySetPopupVisible(!1,X.props.mouseLeaveDelay)},X.onPopupMouseEnter=function(){X.clearDelayTimer()},X.onPopupMouseLeave=function(ge){var Ie;if(ge.relatedTarget&&!ge.relatedTarget.setTimeout&&Object(Gt.a)((Ie=X.popupRef.current)===null||Ie===void 0?void 0:Ie.getElement(),ge.relatedTarget))return;X.delaySetPopupVisible(!1,X.props.mouseLeaveDelay)},X.onFocus=function(ge){X.fireEvents("onFocus",ge),X.clearDelayTimer(),X.isFocusToShow()&&(X.focusTime=Date.now(),X.delaySetPopupVisible(!0,X.props.focusDelay))},X.onMouseDown=function(ge){X.fireEvents("onMouseDown",ge),X.preClickTime=Date.now()},X.onTouchStart=function(ge){X.fireEvents("onTouchStart",ge),X.preTouchTime=Date.now()},X.onBlur=function(ge){X.fireEvents("onBlur",ge),X.clearDelayTimer(),X.isBlurToHide()&&X.delaySetPopupVisible(!1,X.props.blurDelay)},X.onContextMenu=function(ge){ge.preventDefault(),X.fireEvents("onContextMenu",ge),X.setPopupVisible(!0,ge)},X.onContextMenuClose=function(){X.isContextMenuToShow()&&X.close()},X.onClick=function(ge){if(X.fireEvents("onClick",ge),X.focusTime){var Ie;if(X.preClickTime&&X.preTouchTime?Ie=Math.min(X.preClickTime,X.preTouchTime):X.preClickTime?Ie=X.preClickTime:X.preTouchTime&&(Ie=X.preTouchTime),Math.abs(Ie-X.focusTime)<20)return;X.focusTime=0}X.preClickTime=0,X.preTouchTime=0,X.isClickToShow()&&(X.isClickToHide()||X.isBlurToHide())&&ge&&ge.preventDefault&&ge.preventDefault();var be=!X.state.popupVisible;(X.isClickToHide()&&!be||be&&X.isClickToShow())&&X.setPopupVisible(!X.state.popupVisible,ge)},X.onPopupMouseDown=function(){if(X.hasPopupMouseDown=!0,clearTimeout(X.mouseDownTimeout),X.mouseDownTimeout=window.setTimeout(function(){X.hasPopupMouseDown=!1},0),X.context){var ge;(ge=X.context).onPopupMouseDown.apply(ge,arguments)}},X.onDocumentClick=function(ge){if(X.props.mask&&!X.props.maskClosable)return;var Ie=ge.target,be=X.getRootDomNode(),Be=X.getPopupDomNode();(!Object(Gt.a)(be,Ie)||X.isContextMenuOnly())&&!Object(Gt.a)(Be,Ie)&&!X.hasPopupMouseDown&&X.close()},X.getRootDomNode=function(){var ge=X.props.getTriggerDOMNode;if(ge)return ge(X.triggerRef.current);try{var Ie=Object(Ut.a)(X.triggerRef.current);if(Ie)return Ie}catch(be){}return Wt.a.findDOMNode(Object(l.a)(X))},X.getPopupClassNameFromAlign=function(ge){var Ie=[],be=X.props,Be=be.popupPlacement,nt=be.builtinPlacements,yt=be.prefixCls,Ct=be.alignPoint,kt=be.getPopupClassNameFromAlign;return Be&&nt&&Ie.push(ot(nt,yt,ge,Ct)),kt&&Ie.push(kt(ge)),Ie.join(" ")},X.getComponent=function(){var ge=X.props,Ie=ge.prefixCls,be=ge.destroyPopupOnHide,Be=ge.popupClassName,nt=ge.onPopupAlign,yt=ge.popupMotion,Ct=ge.popupAnimation,kt=ge.popupTransitionName,en=ge.popupStyle,mn=ge.mask,hn=ge.maskAnimation,Rn=ge.maskTransitionName,An=ge.maskMotion,Cn=ge.zIndex,wn=ge.popup,Mn=ge.stretch,fn=ge.alignPoint,zn=ge.mobile,_n=ge.forceRender,At=X.state,Ht=At.popupVisible,xn=At.point,Fn=X.getPopupAlign(),nn={};return X.isMouseEnterToShow()&&(nn.onMouseEnter=X.onPopupMouseEnter),X.isMouseLeaveToHide()&&(nn.onMouseLeave=X.onPopupMouseLeave),nn.onMouseDown=X.onPopupMouseDown,nn.onTouchStart=X.onPopupMouseDown,x.createElement(In,Object(y.a)({prefixCls:Ie,destroyPopupOnHide:be,visible:Ht,point:fn&&xn,className:Be,align:Fn,onAlign:nt,animation:Ct,getClassNameFromAlign:X.getPopupClassNameFromAlign},nn,{stretch:Mn,getRootDomNode:X.getRootDomNode,style:en,mask:mn,zIndex:Cn,transitionName:kt,maskAnimation:hn,maskTransitionName:Rn,maskMotion:An,ref:X.popupRef,motion:yt,mobile:zn,forceRender:_n}),typeof wn=="function"?wn():wn)},X.attachParent=function(ge){Lt.a.cancel(X.attachId);var Ie=X.props,be=Ie.getPopupContainer,Be=Ie.getDocument,nt=X.getRootDomNode(),yt;be?(nt||be.length===0)&&(yt=be(nt)):yt=Be(X.getRootDomNode()).body,yt?yt.appendChild(ge):X.attachId=Object(Lt.a)(function(){X.attachParent(ge)})},X.getContainer=function(){var ge=X.props.getDocument,Ie=ge(X.getRootDomNode()).createElement("div");return Ie.style.position="absolute",Ie.style.top="0",Ie.style.left="0",Ie.style.width="100%",X.attachParent(Ie),Ie},X.setPoint=function(ge){var Ie=X.props.alignPoint;if(!Ie||!ge)return;X.setState({point:{pageX:ge.pageX,pageY:ge.pageY}})},X.handlePortalUpdate=function(){X.state.prevPopupVisible!==X.state.popupVisible&&X.props.afterPopupVisibleChange(X.state.popupVisible)},X.triggerContextValue={onPopupMouseDown:X.onPopupMouseDown};var ce;return"popupVisible"in ie?ce=!!ie.popupVisible:ce=!!ie.defaultPopupVisible,X.state={prevPopupVisible:ce,popupVisible:ce},ri.forEach(function(ge){X["fire".concat(ge)]=function(Ie){X.fireEvents(ge,Ie)}}),X}return Object(_.a)(Y,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var X=this.props,ce=this.state;if(ce.popupVisible){var ge;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ge=X.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(je.a)(ge,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ge=ge||X.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(je.a)(ge,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ge=ge||X.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(je.a)(ge,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(je.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Lt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var X;return((X=this.popupRef.current)===null||X===void 0?void 0:X.getElement())||null}},{key:"getPopupAlign",value:function(){var X=this.props,ce=X.popupPlacement,ge=X.popupAlign,Ie=X.builtinPlacements;return ce&&Ie?ke(Ie,ce,ge):ge}},{key:"setPopupVisible",value:function(X,ce){var ge=this.props.alignPoint,Ie=this.state.popupVisible;this.clearDelayTimer(),Ie!==X&&("popupVisible"in this.props||this.setState({popupVisible:X,prevPopupVisible:Ie}),this.props.onPopupVisibleChange(X)),ge&&ce&&X&&this.setPoint(ce)}},{key:"delaySetPopupVisible",value:function(X,ce,ge){var Ie=this,be=ce*1e3;if(this.clearDelayTimer(),be){var Be=ge?{pageX:ge.pageX,pageY:ge.pageY}:null;this.delayTimer=window.setTimeout(function(){Ie.setPopupVisible(X,Be),Ie.clearDelayTimer()},be)}else this.setPopupVisible(X,ge)}},{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(X){var ce=this.props.children.props,ge=this.props;return ce[X]&&ge[X]?this["fire".concat(X)]:ce[X]||ge[X]}},{key:"isClickToShow",value:function(){var X=this.props,ce=X.action,ge=X.showAction;return ce.indexOf("click")!==-1||ge.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var X=this.props.action;return X==="contextMenu"||X.length===1&&X[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var X=this.props,ce=X.action,ge=X.showAction;return ce.indexOf("contextMenu")!==-1||ge.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var X=this.props,ce=X.action,ge=X.hideAction;return ce.indexOf("click")!==-1||ge.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var X=this.props,ce=X.action,ge=X.showAction;return ce.indexOf("hover")!==-1||ge.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var X=this.props,ce=X.action,ge=X.hideAction;return ce.indexOf("hover")!==-1||ge.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var X=this.props,ce=X.action,ge=X.showAction;return ce.indexOf("focus")!==-1||ge.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var X=this.props,ce=X.action,ge=X.hideAction;return ce.indexOf("focus")!==-1||ge.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var X;(X=this.popupRef.current)===null||X===void 0||X.forceAlign()}}},{key:"fireEvents",value:function(X,ce){var ge=this.props.children.props[X];ge&&ge(ce);var Ie=this.props[X];Ie&&Ie(ce)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var X=this.state.popupVisible,ce=this.props,ge=ce.children,Ie=ce.forceRender,be=ce.alignPoint,Be=ce.className,nt=ce.autoDestroy,yt=x.Children.only(ge),Ct={key:"trigger"};this.isContextMenuToShow()?Ct.onContextMenu=this.onContextMenu:Ct.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Ct.onClick=this.onClick,Ct.onMouseDown=this.onMouseDown,Ct.onTouchStart=this.onTouchStart):(Ct.onClick=this.createTwoChains("onClick"),Ct.onMouseDown=this.createTwoChains("onMouseDown"),Ct.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Ct.onMouseEnter=this.onMouseEnter,be&&(Ct.onMouseMove=this.onMouseMove)):Ct.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Ct.onMouseLeave=this.onMouseLeave:Ct.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Ct.onFocus=this.onFocus,Ct.onBlur=this.onBlur):(Ct.onFocus=this.createTwoChains("onFocus"),Ct.onBlur=this.createTwoChains("onBlur"));var kt=j()(yt&&yt.props&&yt.props.className,Be);kt&&(Ct.className=kt);var en=Object(W.a)({},Ct);Object(Re.c)(yt)&&(en.ref=Object(Re.a)(this.triggerRef,yt.ref));var mn=x.cloneElement(yt,en),hn;return(X||this.popupRef.current||Ie)&&(hn=x.createElement(se,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!X&&nt&&(hn=null),x.createElement(ii.Provider,{value:this.triggerContextValue},mn,hn)}}],[{key:"getDerivedStateFromProps",value:function(X,ce){var ge=X.popupVisible,Ie={};return ge!==void 0&&ce.popupVisible!==ge&&(Ie.popupVisible=ge,Ie.prevPopupVisible=ce.popupVisible),Ie}}]),Y}(x.Component);return Ce.contextType=ii,Ce.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Nn,getDocument:Qn,onPopupVisibleChange:Pn,afterPopupVisibleChange:Pn,onPopupAlign:Pn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ce}var hi=Oi(tt.a),K={adjustX:1,adjustY:1},oe={topLeft:{points:["bl","tl"],overflow:K,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:K,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:K,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:K,offset:[4,0]}},ye={topLeft:{points:["bl","tl"],overflow:K,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:K,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:K,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:K,offset:[4,0]}},Te=oe,Fe=0,Se={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},He=function(Ce,we,he){var Y=Le(we),ie=Ce.getState();Ce.setState({defaultActiveFirst:Object(W.a)(Object(W.a)({},ie.defaultActiveFirst),{},Object(te.a)({},Y,he))})},We=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(he){var Y;Object(T.a)(this,we),Y=Ce.call(this,he),Y.onDestroy=function(be){Y.props.onDestroy(be)},Y.onKeyDown=function(be){var Be=be.keyCode,nt=Y.menuInstance,yt=Y.props.store,Ct=Y.getVisible();if(Be===n.a.ENTER)return Y.onTitleClick(be),He(yt,Y.props.eventKey,!0),!0;if(Be===n.a.RIGHT)return Ct?nt.onKeyDown(be):(Y.triggerOpenChange(!0),He(yt,Y.props.eventKey,!0)),!0;if(Be===n.a.LEFT){var kt;if(Ct)kt=nt.onKeyDown(be);else return;return kt||(Y.triggerOpenChange(!1),kt=!0),kt}return Ct&&(Be===n.a.UP||Be===n.a.DOWN)?nt.onKeyDown(be):void 0},Y.onOpenChange=function(be){Y.props.onOpenChange(be)},Y.onPopupVisibleChange=function(be){Y.triggerOpenChange(be,be?"mouseenter":"mouseleave")},Y.onMouseEnter=function(be){var Be=Y.props,nt=Be.eventKey,yt=Be.onMouseEnter,Ct=Be.store;He(Ct,Y.props.eventKey,!1),yt({key:nt,domEvent:be})},Y.onMouseLeave=function(be){var Be=Y.props,nt=Be.parentMenu,yt=Be.eventKey,Ct=Be.onMouseLeave;nt.subMenuInstance=Object(l.a)(Y),Ct({key:yt,domEvent:be})},Y.onTitleMouseEnter=function(be){var Be=Y.props,nt=Be.eventKey,yt=Be.onItemHover,Ct=Be.onTitleMouseEnter;yt({key:nt,hover:!0}),Ct({key:nt,domEvent:be})},Y.onTitleMouseLeave=function(be){var Be=Y.props,nt=Be.parentMenu,yt=Be.eventKey,Ct=Be.onItemHover,kt=Be.onTitleMouseLeave;nt.subMenuInstance=Object(l.a)(Y),Ct({key:yt,hover:!1}),kt({key:yt,domEvent:be})},Y.onTitleClick=function(be){var Be=Object(l.a)(Y),nt=Be.props;if(nt.onTitleClick({key:nt.eventKey,domEvent:be}),nt.triggerSubMenuAction==="hover")return;Y.triggerOpenChange(!Y.getVisible(),"click"),He(nt.store,Y.props.eventKey,!1)},Y.onSubMenuClick=function(be){typeof Y.props.onClick=="function"&&Y.props.onClick(Y.addKeyPath(be))},Y.onSelect=function(be){Y.props.onSelect(be)},Y.onDeselect=function(be){Y.props.onDeselect(be)},Y.getPrefixCls=function(){return"".concat(Y.props.rootPrefixCls,"-submenu")},Y.getActiveClassName=function(){return"".concat(Y.getPrefixCls(),"-active")},Y.getDisabledClassName=function(){return"".concat(Y.getPrefixCls(),"-disabled")},Y.getSelectedClassName=function(){return"".concat(Y.getPrefixCls(),"-selected")},Y.getOpenClassName=function(){return"".concat(Y.props.rootPrefixCls,"-submenu-open")},Y.getVisible=function(){return Y.state.isOpen},Y.getMode=function(){return Y.state.mode},Y.saveMenuInstance=function(be){Y.menuInstance=be},Y.addKeyPath=function(be){return Object(W.a)(Object(W.a)({},be),{},{keyPath:(be.keyPath||[]).concat(Y.props.eventKey)})},Y.triggerOpenChange=function(be,Be){var nt=Y.props.eventKey,yt=function(){Y.onOpenChange({key:nt,item:Object(l.a)(Y),trigger:Be,open:be})};Be==="mouseenter"?Y.mouseenterTimeout=setTimeout(function(){yt()},0):yt()},Y.isChildrenSelected=function(){var be={find:!1};return it(Y.props.children,Y.props.selectedKeys,be),be.find},Y.isInlineMode=function(){return Y.getMode()==="inline"},Y.adjustWidth=function(){if(!Y.subMenuTitle||!Y.menuInstance)return;var be=Nt.findDOMNode(Y.menuInstance);if(be.offsetWidth>=Y.subMenuTitle.offsetWidth)return;be.style.minWidth="".concat(Y.subMenuTitle.offsetWidth,"px")},Y.saveSubMenuTitle=function(be){Y.subMenuTitle=be},Y.getBaseProps=function(){var be=Object(l.a)(Y),Be=be.props,nt=Y.getMode();return{mode:nt==="horizontal"?"vertical":nt,visible:Y.getVisible(),level:Be.level+1,inlineIndent:Be.inlineIndent,focusable:!1,onClick:Y.onSubMenuClick,onSelect:Y.onSelect,onDeselect:Y.onDeselect,onDestroy:Y.onDestroy,selectedKeys:Be.selectedKeys,eventKey:"".concat(Be.eventKey,"-menu-"),openKeys:Be.openKeys,motion:Be.motion,onOpenChange:Y.onOpenChange,subMenuOpenDelay:Be.subMenuOpenDelay,parentMenu:Object(l.a)(Y),subMenuCloseDelay:Be.subMenuCloseDelay,forceSubMenuRender:Be.forceSubMenuRender,triggerSubMenuAction:Be.triggerSubMenuAction,builtinPlacements:Be.builtinPlacements,defaultActiveFirst:Be.store.getState().defaultActiveFirst[Le(Be.eventKey)],multiple:Be.multiple,prefixCls:Be.rootPrefixCls,id:Y.internalMenuId,manualRef:Y.saveMenuInstance,itemIcon:Be.itemIcon,expandIcon:Be.expandIcon,direction:Be.direction}},Y.getMotion=function(be,Be){var nt=Object(l.a)(Y),yt=nt.haveRendered,Ct=Y.props,kt=Ct.motion,en=Ct.rootPrefixCls,mn=Object(W.a)(Object(W.a)({},kt),{},{leavedClassName:"".concat(en,"-hidden"),removeOnLeave:!1,motionAppear:yt||!Be||be!=="inline"});return mn};var ie=he.store,X=he.eventKey,ce=ie.getState(),ge=ce.defaultActiveFirst;Y.isRootMenu=!1;var Ie=!1;return ge&&(Ie=ge[X]),He(ie,X,Ie),Y.state={mode:he.mode,isOpen:he.isOpen},Y}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Y=this,ie=this.props,X=ie.mode,ce=ie.parentMenu,ge=ie.manualRef,Ie=ie.isOpen,be=function(){Y.setState({mode:X,isOpen:Ie})},Be=Ie!==this.state.isOpen,nt=X!==this.state.mode;if((nt||Be)&&(Lt.a.cancel(this.updateStateRaf),nt?this.updateStateRaf=Object(Lt.a)(be):be()),ge&&ge(this),X!=="horizontal"||!(ce==null?void 0:ce.isRootMenu)||!Ie)return;this.minWidthTimeout=setTimeout(function(){return Y.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Y=this.props,ie=Y.onDestroy,X=Y.eventKey;ie&&ie(X),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Lt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(Y,ie){var X=this.getBaseProps();return x.createElement(qt,Object(y.a)({},X,{id:this.internalMenuId,className:Y,style:ie}),this.props.children)}},{key:"renderChildren",value:function(){var Y=this,ie=this.getBaseProps(),X=ie.mode,ce=ie.visible,ge=ie.forceSubMenuRender,Ie=ie.direction,be=this.getMotion(X,ce);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ce||ge,!this.haveOpened)return x.createElement("div",null);var Be=j()("".concat(ie.prefixCls,"-sub"),Object(te.a)({},"".concat(ie.prefixCls,"-rtl"),Ie==="rtl"));return this.isInlineMode()?x.createElement(V,Object(y.a)({visible:ie.visible,forceRender:ge},be),function(nt){var yt=nt.className,Ct=nt.style,kt=j()(Be,yt);return Y.renderPopupMenu(kt,Ct)}):this.renderPopupMenu(Be)}},{key:"render",value:function(){var Y,ie,X,ce=Object(W.a)({},this.props),ge=this.getVisible(),Ie=this.getPrefixCls(),be=this.isInlineMode(),Be=this.getMode(),nt=j()(Ie,"".concat(Ie,"-").concat(Be),(Y={},Object(te.a)(Y,ce.className,!!ce.className),Object(te.a)(Y,this.getOpenClassName(),ge),Object(te.a)(Y,this.getActiveClassName(),ce.active||ge&&!be),Object(te.a)(Y,this.getDisabledClassName(),ce.disabled),Object(te.a)(Y,this.getSelectedClassName(),this.isChildrenSelected()),Y));this.internalMenuId||(ce.eventKey?this.internalMenuId="".concat(ce.eventKey,"$Menu"):(Fe+=1,this.internalMenuId="$__$".concat(Fe,"$Menu")));var yt={},Ct={},kt={};ce.disabled||(yt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ct={onClick:this.onTitleClick},kt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var en={},mn=ce.direction,hn=mn==="rtl";be&&(hn?en.paddingRight=ce.inlineIndent*ce.level:en.paddingLeft=ce.inlineIndent*ce.level);var Rn={};this.getVisible()&&(Rn={"aria-owns":this.internalMenuId});var An=null;Be!=="horizontal"&&(An=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(An=x.createElement(this.props.expandIcon,Object(W.a)({},this.props))));var Cn=x.createElement("div",Object(y.a)({ref:this.saveSubMenuTitle,style:en,className:"".concat(Ie,"-title"),role:"button"},kt,Ct,{"aria-expanded":ge},Rn,{"aria-haspopup":"true",title:typeof ce.title=="string"?ce.title:void 0}),ce.title,An||x.createElement("i",{className:"".concat(Ie,"-arrow")})),wn=this.renderChildren(),Mn=((ie=ce.parentMenu)===null||ie===void 0?void 0:ie.isRootMenu)?ce.parentMenu.props.getPopupContainer:function(si){return si.parentNode},fn=Se[Be],zn=ce.popupOffset?{offset:ce.popupOffset}:{},_n=j()((X={},Object(te.a)(X,ce.popupClassName,ce.popupClassName&&!be),Object(te.a)(X,"".concat(Ie,"-rtl"),hn),X)),At=ce.disabled,Ht=ce.triggerSubMenuAction,xn=ce.subMenuOpenDelay,Fn=ce.forceSubMenuRender,nn=ce.subMenuCloseDelay,Kn=ce.builtinPlacements;vt.forEach(function(si){return delete ce[si]}),delete ce.onClick;var oi=hn?Object(W.a)(Object(W.a)({},ye),Kn):Object(W.a)(Object(W.a)({},oe),Kn);delete ce.direction;var Bn=this.getBaseProps(),Xn=be?null:this.getMotion(Bn.mode,Bn.visible);return x.createElement("li",Object(y.a)({},ce,yt,{className:nt,role:"menuitem"}),x.createElement(hi,{prefixCls:Ie,popupClassName:j()("".concat(Ie,"-popup"),_n),getPopupContainer:Mn,builtinPlacements:oi,popupPlacement:fn,popupVisible:be?!1:ge,popupAlign:zn,popup:be?null:wn,action:At||be?[]:[Ht],mouseEnterDelay:xn,mouseLeaveDelay:nn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Fn,popupMotion:Xn},Cn),be?wn:null)}}]),we}(x.Component);We.defaultProps={onMouseEnter:Ae,onMouseLeave:Ae,onTitleMouseEnter:Ae,onTitleMouseLeave:Ae,onTitleClick:Ae,manualRef:Ae,mode:"vertical",title:""};var st=Object(c.b)(function(se,Ce){var we=se.openKeys,he=se.activeKey,Y=se.selectedKeys,ie=Ce.eventKey,X=Ce.subMenuKey;return{isOpen:we.indexOf(ie)>-1,active:he[X]===ie,selectedKeys:Y}})(We);st.isSubMenu=!0;var Xe=st,ft="menuitem-overflowed",pt=.5,$e=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(){var he;return Object(T.a)(this,we),he=Ce.apply(this,arguments),he.resizeObserver=null,he.mutationObserver=null,he.originalTotalWidth=0,he.overflowedItems=[],he.menuItemSizes=[],he.cancelFrameId=null,he.state={lastVisibleIndex:void 0},he.childRef=x.createRef(),he.getMenuItemNodes=function(){var Y=he.props.prefixCls,ie=he.childRef.current;return ie?[].slice.call(ie.children).filter(function(X){return X.className.split(" ").indexOf("".concat(Y,"-overflowed-submenu"))<0}):[]},he.getOverflowedSubMenuItem=function(Y,ie,X){var ce=he.props,ge=ce.overflowedIndicator,Ie=ce.level,be=ce.mode,Be=ce.prefixCls,nt=ce.theme;if(Ie!==1||be!=="horizontal")return null;var yt=he.props.children[0],Ct=yt.props,kt=Ct.children,en=Ct.title,mn=Ct.style,hn=Object(L.a)(Ct,["children","title","style"]),Rn=Object(W.a)({},mn),An="".concat(Y,"-overflowed-indicator"),Cn="".concat(Y,"-overflowed-indicator");ie.length===0&&X!==!0?Rn=Object(W.a)(Object(W.a)({},Rn),{},{display:"none"}):X&&(Rn=Object(W.a)(Object(W.a)({},Rn),{},{visibility:"hidden",position:"absolute"}),An="".concat(An,"-placeholder"),Cn="".concat(Cn,"-placeholder"));var wn=nt?"".concat(Be,"-").concat(nt):"",Mn={};return vt.forEach(function(fn){hn[fn]!==void 0&&(Mn[fn]=hn[fn])}),x.createElement(Xe,Object(y.a)({title:ge,className:"".concat(Be,"-overflowed-submenu"),popupClassName:wn},Mn,{key:An,eventKey:Cn,disabled:!1,style:Rn}),ie)},he.setChildrenWidthAndResize=function(){if(he.props.mode!=="horizontal")return;var Y=he.childRef.current;if(!Y)return;var ie=Y.children;if(!ie||ie.length===0)return;var X=Y.children[ie.length-1];mt(X,"display","inline-block");var ce=he.getMenuItemNodes(),ge=ce.filter(function(Ie){return Ie.className.split(" ").indexOf(ft)>=0});ge.forEach(function(Ie){mt(Ie,"display","inline-block")}),he.menuItemSizes=ce.map(function(Ie){return ut(Ie,!0)}),ge.forEach(function(Ie){mt(Ie,"display","none")}),he.overflowedIndicatorWidth=ut(Y.children[Y.children.length-1],!0),he.originalTotalWidth=he.menuItemSizes.reduce(function(Ie,be){return Ie+be},0),he.handleResize(),mt(X,"display","none")},he.handleResize=function(){if(he.props.mode!=="horizontal")return;var Y=he.childRef.current;if(!Y)return;var ie=ut(Y);he.overflowedItems=[];var X=0,ce;he.originalTotalWidth>ie+pt&&(ce=-1,he.menuItemSizes.forEach(function(ge){X+=ge,X+he.overflowedIndicatorWidth<=ie&&(ce+=1)})),he.setState({lastVisibleIndex:ce})},he}return Object(_.a)(we,[{key:"componentDidMount",value:function(){var Y=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ie=this.childRef.current;if(!ie)return;this.resizeObserver=new Bt.default(function(X){X.forEach(function(){var ce=Y.cancelFrameId;cancelAnimationFrame(ce),Y.cancelFrameId=requestAnimationFrame(Y.setChildrenWidthAndResize)})}),[].slice.call(ie.children).concat(ie).forEach(function(X){Y.resizeObserver.observe(X)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Y.resizeObserver.disconnect(),[].slice.call(ie.children).concat(ie).forEach(function(X){Y.resizeObserver.observe(X)}),Y.setChildrenWidthAndResize()}),this.mutationObserver.observe(ie,{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(Y){var ie=this,X=this.state.lastVisibleIndex;return(Y||[]).reduce(function(ce,ge,Ie){var be=ge;if(ie.props.mode==="horizontal"){var Be=ie.getOverflowedSubMenuItem(ge.props.eventKey,[]);X!==void 0&&ie.props.className.indexOf("".concat(ie.props.prefixCls,"-root"))!==-1&&(Ie>X&&(be=x.cloneElement(ge,{style:{display:"none"},eventKey:"".concat(ge.props.eventKey,"-hidden"),className:"".concat(ft)})),Ie===X+1&&(ie.overflowedItems=Y.slice(X+1).map(function(yt){return x.cloneElement(yt,{key:yt.props.eventKey,mode:"vertical-left"})}),Be=ie.getOverflowedSubMenuItem(ge.props.eventKey,ie.overflowedItems)));var nt=[].concat(Object(w.a)(ce),[Be,be]);return Ie===Y.length-1&&nt.push(ie.getOverflowedSubMenuItem(ge.props.eventKey,[],!0)),nt}return[].concat(Object(w.a)(ce),[be])},[])}},{key:"render",value:function(){var Y=this.props,ie=Y.visible,X=Y.prefixCls,ce=Y.overflowedIndicator,ge=Y.mode,Ie=Y.level,be=Y.tag,Be=Y.children,nt=Y.theme,yt=Object(L.a)(Y,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ct=be;return x.createElement(Ct,Object(y.a)({ref:this.childRef},yt),this.renderChildren(Be))}}]),we}(x.Component);$e.defaultProps={tag:"div",className:""};var gt=$e;function at(se){return se.length?se.every(function(Ce){return!!Ce.props.disabled}):!0}function It(se,Ce,we){var he=se.getState();se.setState({activeKey:Object(W.a)(Object(W.a)({},he.activeKey),{},Object(te.a)({},Ce,we))})}function ht(se){return se.eventKey||"0-menu-"}function Tt(se,Ce){var we=Ce,he=se.children,Y=se.eventKey;if(we){var ie;if(Ye(he,function(X,ce){X&&X.props&&!X.props.disabled&&we===Ve(X,Y,ce)&&(ie=!0)}),ie)return we}return we=null,se.defaultActiveFirst&&Ye(he,function(X,ce){!we&&X&&!X.props.disabled&&(we=Ve(X,Y,ce))}),we}function Rt(se){if(!se)return;var Ce=this.instanceArray.indexOf(se);Ce!==-1?this.instanceArray[Ce]=se:this.instanceArray.push(se)}var Zt=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(he){var Y;return Object(T.a)(this,we),Y=Ce.call(this,he),Y.onKeyDown=function(ie,X){var ce=ie.keyCode,ge;if(Y.getFlatInstanceArray().forEach(function(be){be&&be.props.active&&be.onKeyDown&&(ge=be.onKeyDown(ie))}),ge)return 1;var Ie=null;return(ce===n.a.UP||ce===n.a.DOWN)&&(Ie=Y.step(ce===n.a.UP?-1:1)),Ie?(ie.preventDefault(),It(Y.props.store,ht(Y.props),Ie.props.eventKey),typeof X=="function"&&X(Ie),1):void 0},Y.onItemHover=function(ie){var X=ie.key,ce=ie.hover;It(Y.props.store,ht(Y.props),ce?X:null)},Y.onDeselect=function(ie){Y.props.onDeselect(ie)},Y.onSelect=function(ie){Y.props.onSelect(ie)},Y.onClick=function(ie){Y.props.onClick(ie)},Y.onOpenChange=function(ie){Y.props.onOpenChange(ie)},Y.onDestroy=function(ie){Y.props.onDestroy(ie)},Y.getFlatInstanceArray=function(){return Y.instanceArray},Y.step=function(ie){var X=Y.getFlatInstanceArray(),ce=Y.props.store.getState().activeKey[ht(Y.props)],ge=X.length;if(!ge)return null;ie<0&&(X=X.concat().reverse());var Ie=-1;if(X.every(function(yt,Ct){return yt&&yt.props.eventKey===ce?(Ie=Ct,!1):!0}),!Y.props.defaultActiveFirst&&Ie!==-1&&at(X.slice(Ie,ge-1)))return;var be=(Ie+1)%ge,Be=be;do{var nt=X[Be];if(!nt||nt.props.disabled)Be=(Be+1)%ge;else return nt}while(Be!==be);return null},Y.renderCommonMenuItem=function(ie,X,ce){var ge=Y.props.store.getState(),Ie=Object(l.a)(Y),be=Ie.props,Be=Ve(ie,be.eventKey,X),nt=ie.props;if(!nt||typeof ie.type=="string")return ie;var yt=Be===ge.activeKey,Ct=Object(W.a)(Object(W.a)({mode:nt.mode||be.mode,level:be.level,inlineIndent:be.inlineIndent,renderMenuItem:Y.renderMenuItem,rootPrefixCls:be.prefixCls,index:X,parentMenu:be.parentMenu,manualRef:nt.disabled?void 0:Object(f.a)(ie.ref,Rt.bind(Object(l.a)(Y))),eventKey:Be,active:!nt.disabled&&yt,multiple:be.multiple,onClick:function(en){(nt.onClick||Ae)(en),Y.onClick(en)},onItemHover:Y.onItemHover,motion:be.motion,subMenuOpenDelay:be.subMenuOpenDelay,subMenuCloseDelay:be.subMenuCloseDelay,forceSubMenuRender:be.forceSubMenuRender,onOpenChange:Y.onOpenChange,onDeselect:Y.onDeselect,onSelect:Y.onSelect,builtinPlacements:be.builtinPlacements,itemIcon:nt.itemIcon||Y.props.itemIcon,expandIcon:nt.expandIcon||Y.props.expandIcon},ce),{},{direction:be.direction});return(be.mode==="inline"||lt())&&(Ct.triggerSubMenuAction="click"),x.cloneElement(ie,Object(W.a)(Object(W.a)({},Ct),{},{key:Be||X}))},Y.renderMenuItem=function(ie,X,ce){if(!ie)return null;var ge=Y.props.store.getState(),Ie={openKeys:ge.openKeys,selectedKeys:ge.selectedKeys,triggerSubMenuAction:Y.props.triggerSubMenuAction,subMenuKey:ce};return Y.renderCommonMenuItem(ie,X,Ie)},he.store.setState({activeKey:Object(W.a)(Object(W.a)({},he.store.getState().activeKey),{},Object(te.a)({},he.eventKey,Tt(he,he.activeKey)))}),Y.instanceArray=[],Y}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Y){return this.props.visible||Y.visible||this.props.className!==Y.className||!I()(this.props.style,Y.style)}},{key:"componentDidUpdate",value:function(Y){var ie=this.props,X="activeKey"in ie?ie.activeKey:ie.store.getState().activeKey[ht(ie)],ce=Tt(ie,X);if(ce!==X)It(ie.store,ht(ie),ce);else if("activeKey"in Y){var ge=Tt(Y,Y.activeKey);ce!==ge&&It(ie.store,ht(ie),ce)}}},{key:"render",value:function(){var Y=this,ie=Object(y.a)({},this.props);this.instanceArray=[];var X=j()(ie.prefixCls,ie.className,"".concat(ie.prefixCls,"-").concat(ie.mode)),ce={className:X,role:ie.role||"menu"};ie.id&&(ce.id=ie.id),ie.focusable&&(ce.tabIndex=0,ce.onKeyDown=this.onKeyDown);var ge=ie.prefixCls,Ie=ie.eventKey,be=ie.visible,Be=ie.level,nt=ie.mode,yt=ie.overflowedIndicator,Ct=ie.theme;return vt.forEach(function(kt){return delete ie[kt]}),delete ie.onClick,x.createElement(gt,Object(y.a)({},ie,{prefixCls:ge,mode:nt,tag:"ul",level:Be,theme:Ct,visible:be,overflowedIndicator:yt},ce),Object(h.a)(ie.children).map(function(kt,en){return Y.renderMenuItem(kt,en,Ie||"0-menu-")}))}}]),we}(x.Component);Zt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ae};var pn=Object(c.b)()(Zt),qt=pn,Kt=G("Kwbf");function Tn(se,Ce,we){var he=se.prefixCls,Y=se.motion,ie=se.defaultMotions,X=ie===void 0?{}:ie,ce=se.openAnimation,ge=se.openTransitionName,Ie=Ce.switchingModeFromInline;if(Y)return Y;if(Object(R.a)(ce)==="object"&&ce)Object(Kt.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ce=="string")return{motionName:"".concat(he,"-open-").concat(ce)};if(ge)return{motionName:ge};var be=X[we];return be||(Ie?null:X.other)}var an=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(he){var Y;Object(T.a)(this,we),Y=Ce.call(this,he),Y.onSelect=function(ce){var ge=Object(l.a)(Y),Ie=ge.props;if(Ie.selectable){var be=Y.store.getState(),Be=be.selectedKeys,nt=ce.key;Ie.multiple?Be=Be.concat([nt]):Be=[nt],"selectedKeys"in Ie||Y.store.setState({selectedKeys:Be}),Ie.onSelect(Object(W.a)(Object(W.a)({},ce),{},{selectedKeys:Be}))}},Y.onClick=function(ce){var ge=Y.getRealMenuMode(),Ie=Object(l.a)(Y),be=Ie.store,Be=Ie.props.onOpenChange;ge!=="inline"&&!("openKeys"in Y.props)&&(be.setState({openKeys:[]}),Be([])),Y.props.onClick(ce)},Y.onKeyDown=function(ce,ge){Y.innerMenu.getWrappedInstance().onKeyDown(ce,ge)},Y.onOpenChange=function(ce){var ge=Object(l.a)(Y),Ie=ge.props,be=Y.store.getState().openKeys.concat(),Be=!1,nt=function(Ct){var kt=!1;if(Ct.open)kt=be.indexOf(Ct.key)===-1,kt&&be.push(Ct.key);else{var en=be.indexOf(Ct.key);kt=en!==-1,kt&&be.splice(en,1)}Be=Be||kt};Array.isArray(ce)?ce.forEach(nt):nt(ce),Be&&("openKeys"in Y.props||Y.store.setState({openKeys:be}),Ie.onOpenChange(be))},Y.onDeselect=function(ce){var ge=Object(l.a)(Y),Ie=ge.props;if(Ie.selectable){var be=Y.store.getState().selectedKeys.concat(),Be=ce.key,nt=be.indexOf(Be);nt!==-1&&be.splice(nt,1),"selectedKeys"in Ie||Y.store.setState({selectedKeys:be}),Ie.onDeselect(Object(W.a)(Object(W.a)({},ce),{},{selectedKeys:be}))}},Y.onMouseEnter=function(ce){Y.restoreModeVerticalFromInline();var ge=Y.props.onMouseEnter;ge&&ge(ce)},Y.onTransitionEnd=function(ce){var ge=ce.propertyName==="width"&&ce.target===ce.currentTarget,Ie=ce.target.className,be=Object.prototype.toString.call(Ie)==="[object SVGAnimatedString]"?Ie.animVal:Ie,Be=ce.propertyName==="font-size"&&be.indexOf("anticon")>=0;(ge||Be)&&Y.restoreModeVerticalFromInline()},Y.setInnerMenu=function(ce){Y.innerMenu=ce},Y.isRootMenu=!0;var ie=he.defaultSelectedKeys,X=he.defaultOpenKeys;return"selectedKeys"in he&&(ie=he.selectedKeys||[]),"openKeys"in he&&(X=he.openKeys||[]),Y.store=Object(c.c)({selectedKeys:ie,openKeys:X,activeKey:{"0-menu-":Tt(he,he.activeKey)}}),Y.state={switchingModeFromInline:!1,prevProps:he,inlineOpenKeys:[],store:Y.store},Y}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Y){var ie=this.props,X=ie.siderCollapsed,ce=ie.inlineCollapsed,ge=ie.onOpenChange;(!Y.inlineCollapsed&&ce||!Y.siderCollapsed&&X)&&ge([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var Y=this.props.collapsedWidth,ie=this.store,X=this.prevOpenKeys,ce=this.getInlineCollapsed()&&(Y===0||Y==="0"||Y==="0px");ce?(this.prevOpenKeys=ie.getState().openKeys.concat(),this.store.setState({openKeys:[]})):X&&(this.store.setState({openKeys:X}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Y=this.props.mode,ie=this.state.switchingModeFromInline,X=this.getInlineCollapsed();return ie&&X?"inline":X?"vertical":Y}},{key:"getInlineCollapsed",value:function(){var Y=this.props,ie=Y.inlineCollapsed,X=Y.siderCollapsed;return X!==void 0?X:ie}},{key:"restoreModeVerticalFromInline",value:function(){var Y=this.state.switchingModeFromInline;Y&&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 Y=Object(W.a)({},Object(v.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ie=this.getRealMenuMode();return Y.className+=" ".concat(Y.prefixCls,"-root"),Y.direction==="rtl"&&(Y.className+=" ".concat(Y.prefixCls,"-rtl")),Y=Object(W.a)(Object(W.a)({},Y),{},{mode:ie,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Tn(this.props,this.state,ie)}),delete Y.openAnimation,delete Y.openTransitionName,x.createElement(c.a,{store:this.store},x.createElement(qt,Object(y.a)({},Y,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(Y,ie){var X=ie.prevProps,ce=ie.store,ge=ce.getState(),Ie={},be={prevProps:Y};return X.mode==="inline"&&Y.mode!=="inline"&&(be.switchingModeFromInline=!0),"openKeys"in Y?Ie.openKeys=Y.openKeys||[]:((Y.inlineCollapsed&&!X.inlineCollapsed||Y.siderCollapsed&&!X.siderCollapsed)&&(be.switchingModeFromInline=!0,be.inlineOpenKeys=ge.openKeys,Ie.openKeys=[]),(!Y.inlineCollapsed&&X.inlineCollapsed||!Y.siderCollapsed&&X.siderCollapsed)&&(Ie.openKeys=ie.inlineOpenKeys,be.inlineOpenKeys=[])),Object.keys(Ie).length&&ce.setState(Ie),be}}]),we}(x.Component);an.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:x.createElement("span",null,"\xB7\xB7\xB7")};var Yn=an,ai=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(){var he;return Object(T.a)(this,we),he=Ce.apply(this,arguments),he.onKeyDown=function(Y){var ie=Y.keyCode;return ie===n.a.ENTER?(he.onClick(Y),!0):void 0},he.onMouseLeave=function(Y){var ie=he.props,X=ie.eventKey,ce=ie.onItemHover,ge=ie.onMouseLeave;ce({key:X,hover:!1}),ge({key:X,domEvent:Y})},he.onMouseEnter=function(Y){var ie=he.props,X=ie.eventKey,ce=ie.onItemHover,ge=ie.onMouseEnter;ce({key:X,hover:!0}),ge({key:X,domEvent:Y})},he.onClick=function(Y){var ie=he.props,X=ie.eventKey,ce=ie.multiple,ge=ie.onClick,Ie=ie.onSelect,be=ie.onDeselect,Be=ie.isSelected,nt={key:X,keyPath:[X],item:Object(l.a)(he),domEvent:Y};ge(nt),ce?Be?be(nt):Ie(nt):Be||Ie(nt)},he.saveNode=function(Y){he.node=Y},he}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Y=this.props;Y.onDestroy&&Y.onDestroy(Y.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 Y,ie=Object(W.a)({},this.props),X=j()(this.getPrefixCls(),ie.className,(Y={},Object(te.a)(Y,this.getActiveClassName(),!ie.disabled&&ie.active),Object(te.a)(Y,this.getSelectedClassName(),ie.isSelected),Object(te.a)(Y,this.getDisabledClassName(),ie.disabled),Y)),ce=Object(W.a)(Object(W.a)({},ie.attribute),{},{title:typeof ie.title=="string"?ie.title:void 0,className:X,role:ie.role||"menuitem","aria-disabled":ie.disabled});ie.role==="option"?ce=Object(W.a)(Object(W.a)({},ce),{},{role:"option","aria-selected":ie.isSelected}):(ie.role===null||ie.role==="none")&&(ce.role="none");var ge={onClick:ie.disabled?null:this.onClick,onMouseLeave:ie.disabled?null:this.onMouseLeave,onMouseEnter:ie.disabled?null:this.onMouseEnter},Ie=Object(W.a)({},ie.style);ie.mode==="inline"&&(ie.direction==="rtl"?Ie.paddingRight=ie.inlineIndent*ie.level:Ie.paddingLeft=ie.inlineIndent*ie.level),vt.forEach(function(Be){return delete ie[Be]}),delete ie.direction;var be=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(be=x.createElement(this.props.itemIcon,this.props)),x.createElement("li",Object(y.a)({},Object(v.a)(ie,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ce,ge,{style:Ie,ref:this.saveNode}),ie.children,be)}}]),we}(x.Component);ai.isMenuItem=!0,ai.defaultProps={onSelect:Ae,onMouseEnter:Ae,onMouseLeave:Ae,manualRef:Ae};var pi=Object(c.b)(function(se,Ce){var we=se.activeKey,he=se.selectedKeys,Y=Ce.eventKey,ie=Ce.subMenuKey;return{active:we[ie]===Y,isSelected:Array.isArray(he)?he.indexOf(Y)!==-1:he===Y}})(ai),li=pi,yi=function(se){Object(d.a)(we,se);var Ce=Object(a.a)(we);function we(){var he;return Object(T.a)(this,we),he=Ce.apply(this,arguments),he.renderInnerMenuItem=function(Y){var ie=he.props,X=ie.renderMenuItem,ce=ie.index;return X(Y,ce,he.props.subMenuKey)},he}return Object(_.a)(we,[{key:"render",value:function(){var Y=Object(y.a)({},this.props),ie=Y.className,X=ie===void 0?"":ie,ce=Y.rootPrefixCls,ge="".concat(ce,"-item-group-title"),Ie="".concat(ce,"-item-group-list"),be=Y.title,Be=Y.children;return vt.forEach(function(nt){return delete Y[nt]}),delete Y.direction,x.createElement("li",Object(y.a)({},Y,{onClick:function(yt){return yt.stopPropagation()},className:"".concat(X," ").concat(ce,"-item-group")}),x.createElement("div",{className:ge,title:typeof be=="string"?be:void 0},be),x.createElement("ul",{className:Ie},x.Children.map(Be,this.renderInnerMenuItem)))}}]),we}(x.Component);yi.isMenuItemGroup=!0,yi.defaultProps={disabled:!0};var xi=yi,ki=function(Ce){var we=Ce.className,he=Ce.rootPrefixCls,Y=Ce.style;return x.createElement("li",{className:"".concat(we," ").concat(he,"-item-divider"),style:Y})};ki.defaultProps={disabled:!0,className:"",style:{}};var Gi=ki,Ui=Yn,Ni=G("eDIo");function Vi(se,Ce){var we=se.prefixCls,he=se.editable,Y=se.locale,ie=se.style;return!he||he.showAdd===!1?null:x.createElement("button",{ref:Ce,type:"button",className:"".concat(we,"-nav-add"),style:ie,"aria-label":(Y==null?void 0:Y.addAriaLabel)||"Add tab",onClick:function(ce){he.onEdit("add",{event:ce})}},he.addIcon||"+")}var Ii=x.forwardRef(Vi);function Zi(se,Ce){var we=se.prefixCls,he=se.id,Y=se.tabs,ie=se.locale,X=se.mobile,ce=se.moreIcon,ge=ce===void 0?"More":ce,Ie=se.moreTransitionName,be=se.style,Be=se.className,nt=se.editable,yt=se.tabBarGutter,Ct=se.rtl,kt=se.onTabClick,en=Object(x.useState)(!1),mn=Object(H.a)(en,2),hn=mn[0],Rn=mn[1],An=Object(x.useState)(null),Cn=Object(H.a)(An,2),wn=Cn[0],Mn=Cn[1],fn="".concat(he,"-more-popup"),zn="".concat(we,"-dropdown"),_n=wn!==null?"".concat(fn,"-").concat(wn):null,At=ie==null?void 0:ie.dropdownAriaLabel,Ht=x.createElement(Ui,{onClick:function(Xn){var si=Xn.key,Jn=Xn.domEvent;kt(si,Jn),Rn(!1)},id:fn,tabIndex:-1,role:"listbox","aria-activedescendant":_n,selectedKeys:[wn],"aria-label":At!==void 0?At:"expanded dropdown"},Y.map(function(Bn){return x.createElement(li,{key:Bn.key,id:"".concat(fn,"-").concat(Bn.key),role:"option","aria-controls":he&&"".concat(he,"-panel-").concat(Bn.key),disabled:Bn.disabled},Bn.tab)}));function xn(Bn){for(var Xn=Y.filter(function(Ti){return!Ti.disabled}),si=Xn.findIndex(function(Ti){return Ti.key===wn})||0,Jn=Xn.length,$n=0;$n<Jn;$n+=1){si=(si+Bn+Jn)%Jn;var yn=Xn[si];if(!yn.disabled){Mn(yn.key);return}}}function Fn(Bn){var Xn=Bn.which;if(!hn){[n.a.DOWN,n.a.SPACE,n.a.ENTER].includes(Xn)&&(Rn(!0),Bn.preventDefault());return}switch(Xn){case n.a.UP:xn(-1),Bn.preventDefault();break;case n.a.DOWN:xn(1),Bn.preventDefault();break;case n.a.ESC:Rn(!1);break;case n.a.SPACE:case n.a.ENTER:wn!==null&&kt(wn,Bn);break}}Object(x.useEffect)(function(){var Bn=document.getElementById(_n);Bn&&Bn.scrollIntoView&&Bn.scrollIntoView(!1)},[wn]),Object(x.useEffect)(function(){hn||Mn(null)},[hn]);var nn=Object(te.a)({},Ct?"marginLeft":"marginRight",yt);Y.length||(nn.visibility="hidden",nn.order=1);var Kn=j()(Object(te.a)({},"".concat(zn,"-rtl"),Ct)),oi=X?null:x.createElement(Ni.a,{prefixCls:zn,overlay:Ht,trigger:["hover"],visible:hn,transitionName:Ie,onVisibleChange:Rn,overlayClassName:Kn,mouseEnterDelay:.1,mouseLeaveDelay:.1},x.createElement("button",{type:"button",className:"".concat(we,"-nav-more"),style:nn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":fn,id:"".concat(he,"-more"),"aria-expanded":hn,onKeyDown:Fn},ge));return x.createElement("div",{className:j()("".concat(we,"-nav-operations"),Be),style:be,ref:Ce},oi,x.createElement(Ii,{prefixCls:we,locale:ie,editable:nt}))}var Fi=x.forwardRef(Zi),zi=Object(x.createContext)(null),on=.1,un=.01,Ln=20,ti=Math.pow(.995,Ln);function mi(){var se=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(se)||/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(se.substr(0,4)))}function Ei(se,Ce){var we=Object(x.useState)(),he=Object(H.a)(we,2),Y=he[0],ie=he[1],X=Object(x.useState)(0),ce=Object(H.a)(X,2),ge=ce[0],Ie=ce[1],be=Object(x.useState)(0),Be=Object(H.a)(be,2),nt=Be[0],yt=Be[1],Ct=Object(x.useState)(),kt=Object(H.a)(Ct,2),en=kt[0],mn=kt[1],hn=Object(x.useRef)();function Rn(At){var Ht=At.touches[0],xn=Ht.screenX,Fn=Ht.screenY;ie({x:xn,y:Fn}),window.clearInterval(hn.current)}function An(At){if(!Y)return;At.preventDefault();var Ht=At.touches[0],xn=Ht.screenX,Fn=Ht.screenY;ie({x:xn,y:Fn});var nn=xn-Y.x,Kn=Fn-Y.y;Ce(nn,Kn);var oi=Date.now();Ie(oi),yt(oi-ge),mn({x:nn,y:Kn})}function Cn(){if(!Y)return;if(ie(null),mn(null),en){var At=en.x/nt,Ht=en.y/nt,xn=Math.abs(At),Fn=Math.abs(Ht);if(Math.max(xn,Fn)<on)return;var nn=At,Kn=Ht;hn.current=window.setInterval(function(){if(Math.abs(nn)<un&&Math.abs(Kn)<un){window.clearInterval(hn.current);return}nn*=ti,Kn*=ti,Ce(nn*Ln,Kn*Ln)},Ln)}}var wn=Object(x.useRef)(0),Mn=Object(x.useRef)(!1),fn=Object(x.useRef)();function zn(At){var Ht=At.deltaX,xn=At.deltaY,Fn=0,nn=Math.abs(Ht),Kn=Math.abs(xn);nn===Kn?Fn=fn.current==="x"?Ht:xn:nn>Kn?(Fn=Ht,fn.current="x"):(Fn=xn,fn.current="y");var oi=Date.now();oi-wn.current>100&&(Mn.current=!1),(Ce(-Fn,-Fn)||Mn.current)&&(At.preventDefault(),Mn.current=!0),wn.current=oi}var _n=Object(x.useRef)(null);_n.current={onTouchStart:Rn,onTouchMove:An,onTouchEnd:Cn,onWheel:zn},x.useEffect(function(){function At(nn){_n.current.onTouchStart(nn)}function Ht(nn){_n.current.onTouchMove(nn)}function xn(nn){_n.current.onTouchEnd(nn)}function Fn(nn){_n.current.onWheel(nn)}return document.addEventListener("touchmove",Ht,{passive:!1}),document.addEventListener("touchend",xn,{passive:!1}),se.current.addEventListener("touchstart",At,{passive:!1}),se.current.addEventListener("wheel",Fn),function(){document.removeEventListener("touchmove",Ht),document.removeEventListener("touchend",xn)}},[])}function wi(){var se=Object(x.useRef)(new Map);function Ce(he){return se.current.has(he)||se.current.set(he,x.createRef()),se.current.get(he)}function we(he){se.current.delete(he)}return[Ce,we]}function Li(se,Ce){var we=x.useRef(se),he=x.useState({}),Y=Object(H.a)(he,2),ie=Y[1];function X(ce){var ge=typeof ce=="function"?ce(we.current):ce;ge!==we.current&&Ce(ge,we.current),we.current=ge,ie({})}return[we.current,X]}var Ri=function(Ce){var we=Ce.position,he=Ce.prefixCls,Y=Ce.extra;if(!Y)return null;var ie,X=Y;return we==="right"&&(ie=X.right||!X.left&&X||null),we==="left"&&(ie=X.left||null),ie?x.createElement("div",{className:"".concat(he,"-extra-content")},ie):null};function rr(se,Ce){var we,he=x.useContext(zi),Y=he.prefixCls,ie=he.tabs,X=se.className,ce=se.style,ge=se.id,Ie=se.animated,be=se.activeKey,Be=se.rtl,nt=se.extra,yt=se.editable,Ct=se.locale,kt=se.tabPosition,en=se.tabBarGutter,mn=se.children,hn=se.onTabClick,Rn=se.onTabScroll,An=Object(x.useRef)(),Cn=Object(x.useRef)(),wn=Object(x.useRef)(),Mn=Object(x.useRef)(),fn=wi(),zn=Object(H.a)(fn,2),_n=zn[0],At=zn[1],Ht=kt==="top"||kt==="bottom",xn=Li(0,function(qn,Hn){Ht&&Rn&&Rn({direction:qn>Hn?"left":"right"})}),Fn=Object(H.a)(xn,2),nn=Fn[0],Kn=Fn[1],oi=Li(0,function(qn,Hn){!Ht&&Rn&&Rn({direction:qn>Hn?"top":"bottom"})}),Bn=Object(H.a)(oi,2),Xn=Bn[0],si=Bn[1],Jn=Object(x.useState)(0),$n=Object(H.a)(Jn,2),yn=$n[0],Ti=$n[1],qi=Object(x.useState)(0),Wi=Object(H.a)(qi,2),$i=Wi[0],Ci=Wi[1],Pi=Object(x.useState)(0),bi=Object(H.a)(Pi,2),Si=bi[0],Qi=bi[1],or=Object(x.useState)(0),sr=Object(H.a)(or,2),ui=sr[0],er=sr[1],tr=Object(x.useState)(null),fi=Object(H.a)(tr,2),Zn=fi[0],Di=fi[1],Or=Object(x.useState)(null),$r=Object(H.a)(Or,2),dr=$r[0],da=$r[1],Lr=Object(x.useState)(0),yr=Object(H.a)(Lr,2),Qr=yr[0],Jr=yr[1],ha=Object(x.useState)(0),wr=Object(H.a)(ha,2),Rr=wr[0],Zr=wr[1],qr=t(new Map),ea=Object(H.a)(qr,2),ta=ea[0],fa=ea[1],br=o(ie,ta,yn),na="".concat(Y,"-nav-operations-hidden"),gr=0,nr=0;Ht?Be?(gr=0,nr=Math.max(0,yn-Zn)):(gr=Math.min(0,Zn-yn),nr=0):(gr=Math.min(0,dr-$i),nr=0);function Ar(qn){return qn<gr?[gr,!1]:qn>nr?[nr,!1]:[qn,!0]}var ia=Object(x.useRef)(),Pr=Object(x.useState)(),Mr=Object(H.a)(Pr,2),kr=Mr[0],Nr=Mr[1];function jr(){Nr(Date.now())}function _r(){window.clearTimeout(ia.current)}Ei(An,function(qn,Hn){var gi=!1;function Ki(Tr,Cr){Tr(function(xr){var vr=Ar(xr+Cr),hr=Object(H.a)(vr,2),Dr=hr[0],Sr=hr[1];return gi=Sr,Dr})}if(Ht){if(Zn>=yn)return gi;Ki(Kn,qn)}else{if(dr>=$i)return gi;Ki(si,Hn)}return _r(),jr(),gi}),Object(x.useEffect)(function(){return _r(),kr&&(ia.current=window.setTimeout(function(){Nr(0)},100)),_r},[kr]);function Ur(){var qn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:be,Hn=br.get(qn);if(!Hn)return;if(Ht){var gi=nn;Be?Hn.right<nn?gi=Hn.right:Hn.right+Hn.width>nn+Zn&&(gi=Hn.right+Hn.width-Zn):Hn.left<-nn?gi=-Hn.left:Hn.left+Hn.width>-nn+Zn&&(gi=-(Hn.left+Hn.width-Zn)),si(0),Kn(Ar(gi)[0])}else{var Ki=Xn;Hn.top<-Xn?Ki=-Hn.top:Hn.top+Hn.height>-Xn+dr&&(Ki=-(Hn.top+Hn.height-dr)),Kn(0),si(Ar(Ki)[0])}}var pa=E(br,{width:Zn,height:dr,left:nn,top:Xn},{width:Si,height:ui},{width:Qr,height:Rr},Object(W.a)(Object(W.a)({},se),{},{tabs:ie})),Fr=Object(H.a)(pa,2),ma=Fr[0],ga=Fr[1],ra=ie.map(function(qn){var Hn=qn.key;return x.createElement(e,{id:ge,prefixCls:Y,key:Hn,rtl:Be,tab:qn,closable:qn.closable,editable:yt,active:Hn===be,tabPosition:kt,tabBarGutter:en,renderWrapper:mn,removeAriaLabel:Ct==null?void 0:Ct.removeAriaLabel,ref:_n(Hn),onClick:function(Ki){hn(Hn,Ki)},onRemove:function(){At(Hn)},onFocus:function(){Ur(Hn),jr(),Be||(An.current.scrollLeft=0),An.current.scrollTop=0}})}),Br=r(function(){var qn,Hn,gi,Ki,Tr,Cr,xr,vr,hr,Dr=((qn=An.current)===null||qn===void 0?void 0:qn.offsetWidth)||0,Sr=((Hn=An.current)===null||Hn===void 0?void 0:Hn.offsetHeight)||0,Ir=((gi=Mn.current)===null||gi===void 0?void 0:gi.offsetWidth)||0,ca=((Ki=Mn.current)===null||Ki===void 0?void 0:Ki.offsetHeight)||0,ba=((Tr=wn.current)===null||Tr===void 0?void 0:Tr.offsetWidth)||0,kn=((Cr=wn.current)===null||Cr===void 0?void 0:Cr.offsetHeight)||0;Di(Dr),da(Sr),Jr(Ir),Zr(ca);var tn=(((xr=Cn.current)===null||xr===void 0?void 0:xr.offsetWidth)||0)-Ir,vn=(((vr=Cn.current)===null||vr===void 0?void 0:vr.offsetHeight)||0)-ca;Ti(tn),Ci(vn);var jn=(hr=wn.current)===null||hr===void 0?void 0:hr.className.includes(na);Qi(tn-(jn?0:ba)),er(vn-(jn?0:kn)),fa(function(){var vi=new Map;return ie.forEach(function(fr){var ir=fr.key,Mi=_n(ir).current;Mi&&vi.set(ir,{width:Mi.offsetWidth,height:Mi.offsetHeight,left:Mi.offsetLeft,top:Mi.offsetTop})}),vi})}),aa=ie.slice(0,ma),va=ie.slice(ga+1),Hr=[].concat(Object(w.a)(aa),Object(w.a)(va)),oa=Object(x.useState)(),Wr=Object(H.a)(oa,2),ya=Wr[0],sa=Wr[1],lr=br.get(be),Kr=Object(x.useRef)();function Gr(){m.a.cancel(Kr.current)}Object(x.useEffect)(function(){var qn={};return lr&&(Ht?(Be?qn.right=lr.right:qn.left=lr.left,qn.width=lr.width):(qn.top=lr.top,qn.height=lr.height)),Gr(),Kr.current=m()(function(){sa(qn)}),Gr},[lr,Ht,Be]),Object(x.useEffect)(function(){Ur()},[be,lr,br,Ht]),Object(x.useEffect)(function(){Br()},[Be,en,be,ie.map(function(qn){return qn.key}).join("_")]);var Vr=!!Hr.length,Er="".concat(Y,"-nav-wrap"),zr,Yr,la,ua;return Ht?Be?(Yr=nn>0,zr=nn+Zn<yn):(zr=nn<0,Yr=-nn+Zn<yn):(la=Xn<0,ua=-Xn+dr<$i),x.createElement("div",{ref:Ce,role:"tablist",className:j()("".concat(Y,"-nav"),X),style:ce,onKeyDown:function(){jr()}},x.createElement(Ri,{position:"left",extra:nt,prefixCls:Y}),x.createElement(u.a,{onResize:Br},x.createElement("div",{className:j()(Er,(we={},Object(te.a)(we,"".concat(Er,"-ping-left"),zr),Object(te.a)(we,"".concat(Er,"-ping-right"),Yr),Object(te.a)(we,"".concat(Er,"-ping-top"),la),Object(te.a)(we,"".concat(Er,"-ping-bottom"),ua),we)),ref:An},x.createElement(u.a,{onResize:Br},x.createElement("div",{ref:Cn,className:"".concat(Y,"-nav-list"),style:{transform:"translate(".concat(nn,"px, ").concat(Xn,"px)"),transition:kr?"none":void 0}},ra,x.createElement(Ii,{ref:Mn,prefixCls:Y,locale:Ct,editable:yt,style:{visibility:Vr?"hidden":null}}),x.createElement("div",{className:j()("".concat(Y,"-ink-bar"),Object(te.a)({},"".concat(Y,"-ink-bar-animated"),Ie.inkBar)),style:ya}))))),x.createElement(Fi,Object.assign({},se,{ref:wn,prefixCls:Y,tabs:Hr,className:!Vr&&na})),x.createElement(Ri,{position:"right",extra:nt,prefixCls:Y}))}var Bi=x.forwardRef(rr);function ar(se){var Ce=se.id,we=se.activeKey,he=se.animated,Y=se.tabPosition,ie=se.rtl,X=se.destroyInactiveTabPane,ce=x.useContext(zi),ge=ce.prefixCls,Ie=ce.tabs,be=he.tabPane,Be=Ie.findIndex(function(nt){return nt.key===we});return x.createElement("div",{className:j()("".concat(ge,"-content-holder"))},x.createElement("div",{className:j()("".concat(ge,"-content"),"".concat(ge,"-content-").concat(Y),Object(te.a)({},"".concat(ge,"-content-animated"),be)),style:Be&&be?Object(te.a)({},ie?"marginRight":"marginLeft","-".concat(Be,"00%")):null},Ie.map(function(nt){return x.cloneElement(nt.node,{key:nt.key,prefixCls:ge,tabKey:nt.key,id:Ce,animated:be,active:nt.key===we,destroyInactiveTabPane:X})})))}function Ai(se){var Ce=se.prefixCls,we=se.forceRender,he=se.className,Y=se.style,ie=se.id,X=se.active,ce=se.animated,ge=se.destroyInactiveTabPane,Ie=se.tabKey,be=se.children,Be=x.useState(we),nt=Object(H.a)(Be,2),yt=nt[0],Ct=nt[1];x.useEffect(function(){X?Ct(!0):ge&&Ct(!1)},[X,ge]);var kt={};return X||(ce?(kt.visibility="hidden",kt.height=0,kt.overflowY="hidden"):kt.display="none"),x.createElement("div",{id:ie&&"".concat(ie,"-panel-").concat(Ie),role:"tabpanel",tabIndex:X?0:-1,"aria-labelledby":ie&&"".concat(ie,"-tab-").concat(Ie),"aria-hidden":!X,style:Object(W.a)(Object(W.a)({},kt),Y),className:j()("".concat(Ce,"-tabpane"),X&&"".concat(Ce,"-tabpane-active"),he)},(X||yt||we)&&be)}var Yi=0;function mr(se){return Object(h.a)(se).map(function(Ce){if(x.isValidElement(Ce)){var we=Ce.key!==void 0?String(Ce.key):void 0;return Object(W.a)(Object(W.a)({key:we},Ce.props),{},{node:Ce})}return null}).filter(function(Ce){return Ce})}function Hi(se,Ce){var we,he=se.id,Y=se.prefixCls,ie=Y===void 0?"rc-tabs":Y,X=se.className,ce=se.children,ge=se.direction,Ie=se.activeKey,be=se.defaultActiveKey,Be=se.editable,nt=se.animated,yt=se.tabPosition,Ct=yt===void 0?"top":yt,kt=se.tabBarGutter,en=se.tabBarStyle,mn=se.tabBarExtraContent,hn=se.locale,Rn=se.moreIcon,An=se.moreTransitionName,Cn=se.destroyInactiveTabPane,wn=se.renderTabBar,Mn=se.onChange,fn=se.onTabClick,zn=se.onTabScroll,_n=Object(L.a)(se,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),At=mr(ce),Ht=ge==="rtl",xn;nt===!1?xn={inkBar:!1,tabPane:!1}:xn=Object(W.a)({inkBar:!0,tabPane:!1},nt!==!0?nt:null);var Fn=Object(x.useState)(!1),nn=Object(H.a)(Fn,2),Kn=nn[0],oi=nn[1];Object(x.useEffect)(function(){oi(mi())},[]);var Bn=Object(D.a)(function(){var ui;return(ui=At[0])===null||ui===void 0?void 0:ui.key},{value:Ie,defaultValue:be}),Xn=Object(H.a)(Bn,2),si=Xn[0],Jn=Xn[1],$n=Object(x.useState)(function(){return At.findIndex(function(ui){return ui.key===si})}),yn=Object(H.a)($n,2),Ti=yn[0],qi=yn[1];Object(x.useEffect)(function(){var ui=At.findIndex(function(tr){return tr.key===si});if(ui===-1){var er;ui=Math.max(0,Math.min(Ti,At.length-1)),Jn((er=At[ui])===null||er===void 0?void 0:er.key)}qi(ui)},[At.map(function(ui){return ui.key}).join("_"),si,Ti]);var Wi=Object(D.a)(null,{value:he}),$i=Object(H.a)(Wi,2),Ci=$i[0],Pi=$i[1],bi=Ct;Kn&&!["left","right"].includes(Ct)&&(bi="top"),Object(x.useEffect)(function(){he||(Pi("rc-tabs-".concat(Yi)),Yi+=1)},[]);function Si(ui,er){fn==null||fn(ui,er),Jn(ui),Mn==null||Mn(ui)}var Qi={id:Ci,activeKey:si,animated:xn,tabPosition:bi,rtl:Ht,mobile:Kn},or,sr=Object(W.a)(Object(W.a)({},Qi),{},{editable:Be,locale:hn,moreIcon:Rn,moreTransitionName:An,tabBarGutter:kt,onTabClick:Si,onTabScroll:zn,extra:mn,style:en,panes:ce});return wn?or=wn(sr,Bi):or=x.createElement(Bi,Object.assign({},sr)),x.createElement(zi.Provider,{value:{tabs:At,prefixCls:ie}},x.createElement("div",Object.assign({ref:Ce,id:he,className:j()(ie,"".concat(ie,"-").concat(bi),(we={},Object(te.a)(we,"".concat(ie,"-mobile"),Kn),Object(te.a)(we,"".concat(ie,"-editable"),Be),Object(te.a)(we,"".concat(ie,"-rtl"),Ht),we),X)},_n),or,x.createElement(ar,Object.assign({destroyInactiveTabPane:Cn},Qi,{animated:xn}))))}var ji=x.forwardRef(Hi);ji.TabPane=Ai;var cr=ji,Xi=Qe.b=cr},mgmH:function(zt,Qe,G){"use strict";G.d(Qe,"d",function(){return u}),G.d(Qe,"b",function(){return r}),G.d(Qe,"e",function(){return t}),G.d(Qe,"c",function(){return n}),G.d(Qe,"n",function(){return s}),G.d(Qe,"g",function(){return e}),G.d(Qe,"h",function(){return i}),G.d(Qe,"j",function(){return S}),G.d(Qe,"a",function(){return E}),G.d(Qe,"l",function(){return y}),G.d(Qe,"f",function(){return T}),G.d(Qe,"k",function(){return _}),G.d(Qe,"m",function(){return l}),G.d(Qe,"i",function(){return d}),G.d(Qe,"o",function(){return a}),G.d(Qe,"t",function(){return c}),G.d(Qe,"s",function(){return v}),G.d(Qe,"p",function(){return f}),G.d(Qe,"q",function(){return b}),G.d(Qe,"r",function(){return I}),G.d(Qe,"v",function(){return R}),G.d(Qe,"u",function(){return P});var te=G("miYZ"),H=G("tsqr"),L=G("k1fw"),W=G("9og8"),x=G("WmNS"),O=G.n(x),j=G("oUNq"),h=G("9kvl"),D=G("1vsH"),w=G("m3rI"),g=function(){Object(h.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},m=function(){Object(h.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},u=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return g(),Z.next=3,Object(j.t)(Object(L.a)({},A));case 3:if(B=Z.sent,!(B.status===0)){Z.next=7;break}return Z.next=7,Object(D.w)("",Object(D.Y)({url:w.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/export_couser_info.json"),query:A}));case 7:m();case 8:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),r=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(j.r)(Object(L.a)({},A));case 2:if(B=Z.sent,!(B.status===0)){Z.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_member_act_score")),Z.next=13;break;case 8:if(!(B.status===-2)){Z.next=12;break}return Z.abrupt("return",B);case 12:B.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),t=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(j.u)(Object(L.a)({},A));case 2:if(B=Z.sent,!(B.status===0)){Z.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_score")),Z.next=13;break;case 8:if(!(B.status===-2)){Z.next=12;break}return Z.abrupt("return",B);case 12:B.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_score")));case 13:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),n=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(j.s)(Object(L.a)({},A));case 2:if(B=Z.sent,!(B.status===0)){Z.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")),Z.next=13;break;case 8:if(!(B.status===-2)){Z.next=12;break}return Z.abrupt("return",B);case 12:B.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),s=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(j.z)(Object(L.a)({},A));case 2:if(B=Z.sent,!(B.status===0)){Z.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")),Z.next=13;break;case 8:if(!(B.status===-2)){Z.next=12;break}return Z.abrupt("return",B);case 12:B.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),e=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(j.v)(Object(L.a)({},A));case 2:if(B=Z.sent,!(B.status===0)){Z.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_homework")),Z.next=13;break;case 8:if(!(B.status===-2)){Z.next=12;break}return Z.abrupt("return",B);case 12:B.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),i=function(){var M=Object(W.a)(O.a.mark(function F(A,B){var z;return O.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Object(j.x)(Object(L.a)({},A));case 2:z=ae.sent,z.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/").concat(B))):z.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/").concat(B)));case 4:case"end":return ae.stop()}},F)}));return function(A,B){return M.apply(this,arguments)}}(),o=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return g(),Z.next=3,Object(j.w)(Object(L.a)({},A));case 3:if(B=Z.sent,!(B.status===0)){Z.next=7;break}return Z.next=7,Object(D.w)("",Object(D.Y)({url:w.a.API_SERVER+"/api/homework_commons/".concat(A.categoryId,"/works_list.zip"),query:A}));case 7:m();case 8:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),S=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return g(),Z.next=3,Object(j.A)(Object(L.a)({},A));case 3:if(B=Z.sent,!(B.status===0)){Z.next=7;break}return Z.next=7,Object(D.w)("",Object(D.Y)({url:w.a.API_SERVER+"/api/polls/".concat(A.categoryId,"/commit_result.xlsx"),query:A}));case 7:m();case 8:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),E=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/attendances/export_xlsx_data.xlsx"),query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),y=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/video_study_statics.xlsx"),query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),T=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/courses/".concat(A.coursesId,"/export_course_students_info.xlsx"),query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),_=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/item_banks/export.xlsx",query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),l=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),d=function(){var M=Object(W.a)(O.a.mark(function F(A){var B;return O.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(j.y)(Object(L.a)({},A));case 2:B=Z.sent,B.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/exercise_score"))):B.status===-3&&(Object(h.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),h.d.push("/classrooms/".concat(A.coursesId,"/exportlist/exercise_score")));case 4:case"end":return Z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),a=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),z.next=3,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/export_records/".concat(A.id,".xlsx"),query:A}));case 3:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),c=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),v=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.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 z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),f=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)(A==null?void 0:A.name,Object(D.Y)({url:w.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),b=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/ec_years/".concat(A==null?void 0:A.ec_year_id,"/ec_courses.xlsx"),query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),I=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.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 z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),R=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/courses/rank_list.xlsx",query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}(),P=function(){var M=Object(W.a)(O.a.mark(function F(A){return O.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(D.v)("",Object(D.Y)({url:w.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:A}));case 2:case"end":return z.stop()}},F)}));return function(A){return M.apply(this,arguments)}}()},n6Qo:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return h});var te=G("q1tI"),H=G("biw7"),L=G("fyJ8");function W(D){var w=D.className,g=D.index,m=D.children,u=D.colSpan,r=D.rowSpan,t=te.useContext(H.a),n=t.prefixCls,s=t.fixedInfoList,e=s[g];return te.createElement(L.a,Object.assign({className:w,index:g,component:"td",prefixCls:n,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:u,rowSpan:r}}}},e))}function x(D){return te.createElement("tr",Object.assign({},D))}function O(D){var w=D.children,g=te.useContext(H.a),m=g.prefixCls;return te.createElement("tfoot",{className:"".concat(m,"-summary")},w)}var j=Qe.b=O,h={Cell:W,Row:x}},ogmK:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return Oi});var te=G("1OyB"),H=G("vuIU"),L=G("Ji7U"),W=G("LK+K"),x=G("rePB"),O=G("VTBJ"),j=G("ODXe"),h=G("q1tI"),D=G("TSYQ"),w=G.n(D),g=G("Kwbf"),m=G("6cGi"),u=G("U8pU"),r=G("4IlW"),t=h.createContext({}),n=t,s={visibility:"hidden"};function e(K){var oe=K.prefixCls,ye=K.prevIcon,Te=ye===void 0?"\u2039":ye,Fe=K.nextIcon,Se=Fe===void 0?"\u203A":Fe,He=K.superPrevIcon,We=He===void 0?"\xAB":He,st=K.superNextIcon,Xe=st===void 0?"\xBB":st,ft=K.onSuperPrev,pt=K.onSuperNext,$e=K.onPrev,gt=K.onNext,at=K.children,It=h.useContext(n),ht=It.hideNextBtn,Tt=It.hidePrevBtn;return h.createElement("div",{className:oe},ft&&h.createElement("button",{type:"button",onClick:ft,tabIndex:-1,className:"".concat(oe,"-super-prev-btn"),style:Tt?s:{}},We),$e&&h.createElement("button",{type:"button",onClick:$e,tabIndex:-1,className:"".concat(oe,"-prev-btn"),style:Tt?s:{}},Te),h.createElement("div",{className:"".concat(oe,"-view")},at),gt&&h.createElement("button",{type:"button",onClick:gt,tabIndex:-1,className:"".concat(oe,"-next-btn"),style:ht?s:{}},Se),pt&&h.createElement("button",{type:"button",onClick:pt,tabIndex:-1,className:"".concat(oe,"-super-next-btn"),style:ht?s:{}},Xe))}var i=e;function o(K){var oe=h.useContext(n),ye=oe.hideHeader;if(ye)return null;var Te=K.prefixCls,Fe=K.generateConfig,Se=K.locale,He=K.value,We=K.format,st="".concat(Te,"-header");return h.createElement(i,{prefixCls:st},He?Fe.locale.format(Se.locale,He,We):"\xA0")}var S=o,E=G("YrtM"),y=G("KQm4"),T=new Map;function _(K,oe,ye){if(T.get(K)&&cancelAnimationFrame(T.get(K)),ye<=0){T.set(K,requestAnimationFrame(function(){K.scrollTop=oe}));return}var Te=oe-K.scrollTop,Fe=Te/ye*10;T.set(K,requestAnimationFrame(function(){K.scrollTop+=Fe,K.scrollTop!==oe&&_(K,oe,ye-10)}))}function l(K,oe){var ye=oe.onLeftRight,Te=oe.onCtrlLeftRight,Fe=oe.onUpDown,Se=oe.onPageUpDown,He=oe.onEnter,We=K.which,st=K.ctrlKey,Xe=K.metaKey;switch(We){case r.a.LEFT:if(st||Xe){if(Te)return Te(-1),!0}else if(ye)return ye(-1),!0;break;case r.a.RIGHT:if(st||Xe){if(Te)return Te(1),!0}else if(ye)return ye(1),!0;break;case r.a.UP:if(Fe)return Fe(-1),!0;break;case r.a.DOWN:if(Fe)return Fe(1),!0;break;case r.a.PAGE_UP:if(Se)return Se(-1),!0;break;case r.a.PAGE_DOWN:if(Se)return Se(1),!0;break;case r.a.ENTER:if(He)return He(),!0;break}return!1}function d(K,oe,ye,Te){var Fe=K;if(!Fe)switch(oe){case"time":Fe=Te?"hh:mm:ss a":"HH:mm:ss";break;case"week":Fe="gggg-wo";break;case"month":Fe="YYYY-MM";break;case"quarter":Fe="YYYY-[Q]Q";break;case"year":Fe="YYYY";break;default:Fe=ye?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return Fe}function a(K,oe){var ye=K==="time"?8:10;return Math.max(ye,oe.length)+2}var c=null,v=new Set;function f(K){return!c&&typeof window!="undefined"&&window.addEventListener&&(c=function(ye){Object(y.a)(v).forEach(function(Te){Te(ye)})},window.addEventListener("mousedown",c)),v.add(K),function(){v.delete(K),v.size===0&&(window.removeEventListener("mousedown",c),c=null)}}var b=function(oe){return oe==="month"||oe==="date"?"year":oe},I=function(oe){return oe==="date"?"month":oe},R=function(oe){return oe==="month"||oe==="date"?"quarter":oe},P=function(oe){return oe==="date"?"week":oe},M={year:b,month:I,quarter:R,week:P,time:null,date:null};function F(K,oe){return K.some(function(ye){return ye&&ye.contains(oe)})}function A(K){var oe=K.prefixCls,ye=K.units,Te=K.onSelect,Fe=K.value,Se=K.active,He=K.hideDisabledOptions,We="".concat(oe,"-cell"),st=h.useContext(n),Xe=st.open,ft=h.useRef(null),pt=h.useRef(new Map);return h.useLayoutEffect(function(){var $e=pt.current.get(Fe);$e&&Xe!==!1&&_(ft.current,$e.offsetTop,120)},[Fe]),h.useLayoutEffect(function(){if(Xe){var $e=pt.current.get(Fe);$e&&_(ft.current,$e.offsetTop,0)}},[Xe]),h.createElement("ul",{className:w()("".concat(oe,"-column"),Object(x.a)({},"".concat(oe,"-column-active"),Se)),ref:ft,style:{position:"relative"}},ye.map(function($e){var gt;return He&&$e.disabled?null:h.createElement("li",{key:$e.value,ref:function(It){pt.current.set($e.value,It)},className:w()(We,(gt={},Object(x.a)(gt,"".concat(We,"-disabled"),$e.disabled),Object(x.a)(gt,"".concat(We,"-selected"),Fe===$e.value),gt)),onClick:function(){if($e.disabled)return;Te($e.value)}},h.createElement("div",{className:"".concat(We,"-inner")},$e.label))}))}var B=A;function z(K,oe){for(var ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Te=String(K);Te.length<oe;)Te="".concat(ye).concat(K);return Te}var Z=function(){for(var oe=arguments.length,ye=new Array(oe),Te=0;Te<oe;Te++)ye[Te]=arguments[Te];return ye};function ae(K){return K==null?[]:Array.isArray(K)?K:[K]}function De(K){var oe={};return Object.keys(K).forEach(function(ye){(ye.substr(0,5)==="data-"||ye.substr(0,5)==="aria-"||ye==="role"||ye==="name")&&ye.substr(0,7)!=="data-__"&&(oe[ye]=K[ye])}),oe}function _e(K,oe){return K?K[oe]:null}function Oe(K,oe,ye){var Te=[_e(K,0),_e(K,1)];return Te[ye]=typeof oe=="function"?oe(Te[ye]):oe,!Te[0]&&!Te[1]?null:Te}function Ne(K,oe,ye,Te,Fe){var Se=K.setHour(oe,ye);return Se=K.setMinute(Se,Te),Se=K.setSecond(Se,Fe),Se}function Ue(K,oe,ye,Te,Fe,Se){var He=Math.floor(K/Te)*Te;if(He<K)return[He,60-Fe,60-Se];var We=Math.floor(oe/Fe)*Fe;if(We<oe)return[He,We,60-Se];var st=Math.floor(ye/Se)*Se;return[He,We,st]}function Ee(K,oe){if(K.length!==oe.length)return!0;for(var ye=0;ye<K.length;ye+=1)if(K[ye].disabled!==oe[ye].disabled)return!0;return!1}function q(K,oe,ye,Te){for(var Fe=[],Se=K;Se<=oe;Se+=ye)Fe.push({label:z(Se,2),value:Se,disabled:(Te||[]).includes(Se)});return Fe}function J(K){var oe=K.generateConfig,ye=K.prefixCls,Te=K.operationRef,Fe=K.activeColumnIndex,Se=K.value,He=K.showHour,We=K.showMinute,st=K.showSecond,Xe=K.use12Hours,ft=K.hourStep,pt=ft===void 0?1:ft,$e=K.minuteStep,gt=$e===void 0?1:$e,at=K.secondStep,It=at===void 0?1:at,ht=K.disabledHours,Tt=K.disabledMinutes,Rt=K.disabledSeconds,Zt=K.hideDisabledOptions,pn=K.onSelect,qt=[],Kt="".concat(ye,"-content"),Tn="".concat(ye,"-time-panel"),an,Yn=Se?oe.getHour(Se):-1,ai=Se?oe.getMinute(Se):-1,pi=Se?oe.getSecond(Se):-1,li=function(un,Ln,ti,mi){var Ei=Se||oe.getNow(),wi=Math.max(0,Ln),Li=Math.max(0,ti),Ri=Math.max(0,mi);return Ei=Ne(oe,Ei,!Xe||!un?wi:wi+12,Li,Ri),Ei},yi=q(0,23,pt,ht&&ht()),xi=Object(E.a)(function(){return yi},yi,Ee);Xe&&(an=Yn>=12,Yn%=12);var ki=h.useMemo(function(){if(!Xe)return[!1,!1];var on=[!0,!0];return xi.forEach(function(un){var Ln=un.disabled,ti=un.value;if(Ln)return;ti>=12?on[1]=!1:on[0]=!1}),on},[Xe,xi]),Gi=Object(j.a)(ki,2),Ui=Gi[0],Ni=Gi[1],Vi=h.useMemo(function(){return Xe?xi.filter(an?function(on){return on.value>=12}:function(on){return on.value<12}).map(function(on){var un=on.value%12,Ln=un===0?"12":z(un,2);return Object(O.a)(Object(O.a)({},on),{},{label:Ln,value:un})}):xi},[Xe,xi]),Ii=q(0,59,gt,Tt&&Tt(Yn)),Zi=q(0,59,It,Rt&&Rt(Yn,ai));Te.current={onUpDown:function(un){var Ln=qt[Fe];if(Ln)for(var ti=Ln.units.findIndex(function(Li){return Li.value===Ln.value}),mi=Ln.units.length,Ei=1;Ei<mi;Ei+=1){var wi=Ln.units[(ti+un*Ei+mi)%mi];if(wi.disabled!==!0){Ln.onSelect(wi.value);break}}}};function Fi(on,un,Ln,ti,mi){on!==!1&&qt.push({node:h.cloneElement(un,{prefixCls:Tn,value:Ln,active:Fe===qt.length,onSelect:mi,units:ti,hideDisabledOptions:Zt}),onSelect:mi,value:Ln,units:ti})}Fi(He,h.createElement(B,{key:"hour"}),Yn,Vi,function(on){pn(li(an,on,ai,pi),"mouse")}),Fi(We,h.createElement(B,{key:"minute"}),ai,Ii,function(on){pn(li(an,Yn,on,pi),"mouse")}),Fi(st,h.createElement(B,{key:"second"}),pi,Zi,function(on){pn(li(an,Yn,ai,on),"mouse")});var zi=-1;return typeof an=="boolean"&&(zi=an?1:0),Fi(Xe===!0,h.createElement(B,{key:"12hours"}),zi,[{label:"AM",value:0,disabled:Ui},{label:"PM",value:1,disabled:Ni}],function(on){pn(li(!!on,Yn,ai,pi),"mouse")}),h.createElement("div",{className:Kt},qt.map(function(on){var un=on.node;return un}))}var pe=J,ee=function(oe){return oe.filter(function(ye){return ye!==!1}).length};function Ae(K){var oe=K.generateConfig,ye=K.format,Te=ye===void 0?"HH:mm:ss":ye,Fe=K.prefixCls,Se=K.active,He=K.operationRef,We=K.showHour,st=K.showMinute,Xe=K.showSecond,ft=K.use12Hours,pt=ft===void 0?!1:ft,$e=K.onSelect,gt=K.value,at="".concat(Fe,"-time-panel"),It=h.useRef(),ht=h.useState(-1),Tt=Object(j.a)(ht,2),Rt=Tt[0],Zt=Tt[1],pn=ee([We,st,Xe,pt]);return He.current={onKeyDown:function(Kt){return l(Kt,{onLeftRight:function(an){Zt((Rt+an+pn)%pn)},onUpDown:function(an){Rt===-1?Zt(0):It.current&&It.current.onUpDown(an)},onEnter:function(){$e(gt||oe.getNow(),"key"),Zt(-1)}})},onBlur:function(){Zt(-1)}},h.createElement("div",{className:w()(at,Object(x.a)({},"".concat(at,"-active"),Se))},h.createElement(S,Object.assign({},K,{format:Te,prefixCls:Fe})),h.createElement(pe,Object.assign({},K,{prefixCls:Fe,activeColumnIndex:Rt,operationRef:It})))}var Ve=Ae,Le=7;function Ye(K,oe){return!K&&!oe?!0:!K||!oe?!1:void 0}function it(K,oe,ye){var Te=Ye(oe,ye);if(typeof Te=="boolean")return Te;var Fe=Math.floor(K.getYear(oe)/10),Se=Math.floor(K.getYear(ye)/10);return Fe===Se}function vt(K,oe,ye){var Te=Ye(oe,ye);return typeof Te=="boolean"?Te:K.getYear(oe)===K.getYear(ye)}function ut(K,oe){var ye=Math.floor(K.getMonth(oe)/3);return ye+1}function mt(K,oe,ye){var Te=Ye(oe,ye);return typeof Te=="boolean"?Te:vt(K,oe,ye)&&ut(K,oe)===ut(K,ye)}function lt(K,oe,ye){var Te=Ye(oe,ye);return typeof Te=="boolean"?Te:vt(K,oe,ye)&&K.getMonth(oe)===K.getMonth(ye)}function Bt(K,oe,ye){var Te=Ye(oe,ye);return typeof Te=="boolean"?Te:K.getYear(oe)===K.getYear(ye)&&K.getMonth(oe)===K.getMonth(ye)&&K.getDate(oe)===K.getDate(ye)}function Nt(K,oe,ye){var Te=Ye(oe,ye);return typeof Te=="boolean"?Te:K.getHour(oe)===K.getHour(ye)&&K.getMinute(oe)===K.getMinute(ye)&&K.getSecond(oe)===K.getSecond(ye)}function Wt(K,oe,ye,Te){var Fe=Ye(ye,Te);return typeof Fe=="boolean"?Fe:K.locale.getWeek(oe,ye)===K.locale.getWeek(oe,Te)}function Lt(K,oe,ye){return Bt(K,oe,ye)&&Nt(K,oe,ye)}function Gt(K,oe,ye,Te){return!oe||!ye||!Te?!1:!Bt(K,oe,Te)&&!Bt(K,ye,Te)&&K.isAfter(Te,oe)&&K.isAfter(ye,Te)}function Ut(K,oe,ye){var Te=oe.locale.getWeekFirstDay(K),Fe=oe.setDate(ye,1),Se=oe.getWeekDay(Fe),He=oe.addDate(Fe,Te-Se);return oe.getMonth(He)===oe.getMonth(ye)&&oe.getDate(He)>1&&(He=oe.addDate(He,-7)),He}function Re(K,oe,ye){var Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(oe){case"year":return ye.addYear(K,Te*10);case"quarter":case"month":return ye.addYear(K,Te);default:return ye.addMonth(K,Te)}}var je=h.createContext({}),tt=je;function dt(K){var oe=K.cellPrefixCls,ye=K.generateConfig,Te=K.rangedValue,Fe=K.hoverRangedValue,Se=K.isInView,He=K.isSameCell,We=K.offsetCell,st=K.today,Xe=K.value;function ft(pt){var $e,gt=We(pt,-1),at=We(pt,1),It=_e(Te,0),ht=_e(Te,1),Tt=_e(Fe,0),Rt=_e(Fe,1),Zt=Gt(ye,Tt,Rt,pt);function pn(ai){return He(It,ai)}function qt(ai){return He(ht,ai)}var Kt=He(Tt,pt),Tn=He(Rt,pt),an=(Zt||Tn)&&(!Se(gt)||qt(gt)),Yn=(Zt||Kt)&&(!Se(at)||pn(at));return $e={},Object(x.a)($e,"".concat(oe,"-in-view"),Se(pt)),Object(x.a)($e,"".concat(oe,"-in-range"),Gt(ye,It,ht,pt)),Object(x.a)($e,"".concat(oe,"-range-start"),pn(pt)),Object(x.a)($e,"".concat(oe,"-range-end"),qt(pt)),Object(x.a)($e,"".concat(oe,"-range-start-single"),pn(pt)&&!ht),Object(x.a)($e,"".concat(oe,"-range-end-single"),qt(pt)&&!It),Object(x.a)($e,"".concat(oe,"-range-start-near-hover"),pn(pt)&&(He(gt,Tt)||Gt(ye,Tt,Rt,gt))),Object(x.a)($e,"".concat(oe,"-range-end-near-hover"),qt(pt)&&(He(at,Rt)||Gt(ye,Tt,Rt,at))),Object(x.a)($e,"".concat(oe,"-range-hover"),Zt),Object(x.a)($e,"".concat(oe,"-range-hover-start"),Kt),Object(x.a)($e,"".concat(oe,"-range-hover-end"),Tn),Object(x.a)($e,"".concat(oe,"-range-hover-edge-start"),an),Object(x.a)($e,"".concat(oe,"-range-hover-edge-end"),Yn),Object(x.a)($e,"".concat(oe,"-range-hover-edge-start-near-range"),an&&He(gt,ht)),Object(x.a)($e,"".concat(oe,"-range-hover-edge-end-near-range"),Yn&&He(at,It)),Object(x.a)($e,"".concat(oe,"-today"),He(st,pt)),Object(x.a)($e,"".concat(oe,"-selected"),He(Xe,pt)),$e}return ft}function ke(K){for(var oe=K.prefixCls,ye=K.disabledDate,Te=K.onSelect,Fe=K.rowNum,Se=K.colNum,He=K.prefixColumn,We=K.rowClassName,st=K.baseDate,Xe=K.getCellClassName,ft=K.getCellText,pt=K.getCellNode,$e=K.getCellDate,gt=K.titleCell,at=K.headerCells,It=h.useContext(n),ht=It.onDateMouseEnter,Tt=It.onDateMouseLeave,Rt="".concat(oe,"-cell"),Zt=[],pn=0;pn<Fe;pn+=1){for(var qt=[],Kt=void 0,Tn=function(ai){var pi=pn*Se+ai,li=$e(st,pi),yi=ye&&ye(li);ai===0&&(Kt=li,He&&qt.push(He(Kt))),qt.push(h.createElement("td",{key:ai,title:gt&>(li),className:w()(Rt,Object(O.a)(Object(x.a)({},"".concat(Rt,"-disabled"),yi),Xe(li))),onClick:function(){yi||Te(li)},onMouseEnter:function(){!yi&&ht&&ht(li)},onMouseLeave:function(){!yi&&Tt&&Tt(li)}},pt?pt(li):h.createElement("div",{className:"".concat(Rt,"-inner")},ft(li))))},an=0;an<Se;an+=1)Tn(an);Zt.push(h.createElement("tr",{key:pn,className:We&&We(Kt)},qt))}return h.createElement("div",{className:"".concat(oe,"-body")},h.createElement("table",{className:"".concat(oe,"-content")},at&&h.createElement("thead",null,h.createElement("tr",null,at)),h.createElement("tbody",null,Zt)))}function ot(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.prefixColumn,Fe=K.locale,Se=K.rowCount,He=K.viewDate,We=K.value,st=K.dateRender,Xe=h.useContext(tt),ft=Xe.rangedValue,pt=Xe.hoverRangedValue,$e=Ut(Fe.locale,ye,He),gt="".concat(oe,"-cell"),at=ye.locale.getWeekFirstDay(Fe.locale),It=ye.getNow(),ht=[],Tt=Fe.shortWeekDays||(ye.locale.getShortWeekDays?ye.locale.getShortWeekDays(Fe.locale):[]);Te&&ht.push(h.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var Rt=0;Rt<Le;Rt+=1)ht.push(h.createElement("th",{key:Rt},Tt[(Rt+at)%Le]));var Zt=dt({cellPrefixCls:gt,today:It,value:We,generateConfig:ye,rangedValue:Te?null:ft,hoverRangedValue:Te?null:pt,isSameCell:function(Kt,Tn){return Bt(ye,Kt,Tn)},isInView:function(Kt){return lt(ye,Kt,He)},offsetCell:function(Kt,Tn){return ye.addDate(Kt,Tn)}}),pn=st?function(qt){return st(qt,It)}:void 0;return h.createElement(ke,Object.assign({},K,{rowNum:Se,colNum:Le,baseDate:$e,getCellNode:pn,getCellText:ye.getDate,getCellClassName:Zt,getCellDate:ye.addDate,titleCell:function(Kt){return ye.locale.format(Fe.locale,Kt,"YYYY-MM-DD")},headerCells:ht}))}var ve=ot;function le(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.locale,Fe=K.viewDate,Se=K.onNextMonth,He=K.onPrevMonth,We=K.onNextYear,st=K.onPrevYear,Xe=K.onYearClick,ft=K.onMonthClick,pt=h.useContext(n),$e=pt.hideHeader;if($e)return null;var gt="".concat(oe,"-header"),at=Te.shortMonths||(ye.locale.getShortMonths?ye.locale.getShortMonths(Te.locale):[]),It=ye.getMonth(Fe),ht=h.createElement("button",{type:"button",key:"year",onClick:Xe,tabIndex:-1,className:"".concat(oe,"-year-btn")},ye.locale.format(Te.locale,Fe,Te.yearFormat)),Tt=h.createElement("button",{type:"button",key:"month",onClick:ft,tabIndex:-1,className:"".concat(oe,"-month-btn")},Te.monthFormat?ye.locale.format(Te.locale,Fe,Te.monthFormat):at[It]),Rt=Te.monthBeforeYear?[Tt,ht]:[ht,Tt];return h.createElement(i,Object.assign({},K,{prefixCls:gt,onSuperPrev:st,onPrev:He,onNext:Se,onSuperNext:We}),Rt)}var ue=le,$=6;function Q(K){var oe=K.prefixCls,ye=K.panelName,Te=ye===void 0?"date":ye,Fe=K.keyboardConfig,Se=K.active,He=K.operationRef,We=K.generateConfig,st=K.value,Xe=K.viewDate,ft=K.onViewDateChange,pt=K.onPanelChange,$e=K.onSelect,gt="".concat(oe,"-").concat(Te,"-panel");He.current={onKeyDown:function(Tt){return l(Tt,Object(O.a)({onLeftRight:function(Zt){$e(We.addDate(st||Xe,Zt),"key")},onCtrlLeftRight:function(Zt){$e(We.addYear(st||Xe,Zt),"key")},onUpDown:function(Zt){$e(We.addDate(st||Xe,Zt*Le),"key")},onPageUpDown:function(Zt){$e(We.addMonth(st||Xe,Zt),"key")}},Fe))}};var at=function(Tt){var Rt=We.addYear(Xe,Tt);ft(Rt),pt(null,Rt)},It=function(Tt){var Rt=We.addMonth(Xe,Tt);ft(Rt),pt(null,Rt)};return h.createElement("div",{className:w()(gt,Object(x.a)({},"".concat(gt,"-active"),Se))},h.createElement(ue,Object.assign({},K,{prefixCls:oe,value:st,viewDate:Xe,onPrevYear:function(){at(-1)},onNextYear:function(){at(1)},onPrevMonth:function(){It(-1)},onNextMonth:function(){It(1)},onMonthClick:function(){pt("month",Xe)},onYearClick:function(){pt("year",Xe)}})),h.createElement(ve,Object.assign({},K,{onSelect:function(Tt){return $e(Tt,"mouse")},prefixCls:oe,value:st,viewDate:Xe,rowCount:$})))}var re=Q;function fe(K,oe,ye){if(!ye)return oe;var Te=oe;return Te=K.setHour(Te,K.getHour(ye)),Te=K.setMinute(Te,K.getMinute(ye)),Te=K.setSecond(Te,K.getSecond(ye)),Te}var Pe=Z("date","time");function Ge(K){var oe=K.prefixCls,ye=K.operationRef,Te=K.generateConfig,Fe=K.value,Se=K.defaultValue,He=K.disabledTime,We=K.showTime,st=K.onSelect,Xe="".concat(oe,"-datetime-panel"),ft=h.useState(null),pt=Object(j.a)(ft,2),$e=pt[0],gt=pt[1],at=h.useRef({}),It=h.useRef({}),ht=Object(u.a)(We)==="object"?Object(O.a)({},We):{};function Tt(qt){var Kt=Pe.indexOf($e)+qt,Tn=Pe[Kt]||null;return Tn}var Rt=function(Kt){It.current.onBlur&&It.current.onBlur(Kt),gt(null)};ye.current={onKeyDown:function(Kt){if(Kt.which===r.a.TAB){var Tn=Tt(Kt.shiftKey?-1:1);return gt(Tn),Tn&&Kt.preventDefault(),!0}if($e){var an=$e==="date"?at:It;return an.current&&an.current.onKeyDown&&an.current.onKeyDown(Kt),!0}return[r.a.LEFT,r.a.RIGHT,r.a.UP,r.a.DOWN].includes(Kt.which)?(gt("date"),!0):!1},onBlur:Rt,onClose:Rt};var Zt=function(Kt,Tn){var an=Kt;Tn==="date"&&!Fe&&ht.defaultValue?(an=Te.setHour(an,Te.getHour(ht.defaultValue)),an=Te.setMinute(an,Te.getMinute(ht.defaultValue)),an=Te.setSecond(an,Te.getSecond(ht.defaultValue))):Tn==="time"&&!Fe&&Se&&(an=Te.setYear(an,Te.getYear(Se)),an=Te.setMonth(an,Te.getMonth(Se)),an=Te.setDate(an,Te.getDate(Se))),st&&st(an,"mouse")},pn=He?He(Fe||null):{};return h.createElement("div",{className:w()(Xe,Object(x.a)({},"".concat(Xe,"-active"),$e))},h.createElement(re,Object.assign({},K,{operationRef:at,active:$e==="date",onSelect:function(Kt){Zt(fe(Te,Kt,We&&Object(u.a)(We)==="object"?We.defaultValue:null),"date")}})),h.createElement(Ve,Object.assign({},K,{format:void 0},ht,pn,{defaultValue:void 0,operationRef:It,active:$e==="time",onSelect:function(Kt){Zt(Kt,"time")}})))}var bt=Ge;function Ft(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.locale,Fe=K.value,Se="".concat(oe,"-cell"),He=function(ft){return h.createElement("td",{key:"week",className:w()(Se,"".concat(Se,"-week"))},ye.locale.getWeek(Te.locale,ft))},We="".concat(oe,"-week-panel-row"),st=function(ft){return w()(We,Object(x.a)({},"".concat(We,"-selected"),Wt(ye,Te.locale,Fe,ft)))};return h.createElement(re,Object.assign({},K,{panelName:"week",prefixColumn:He,rowClassName:st,keyboardConfig:{onLeftRight:null}}))}var Xt=Ft;function Pt(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.locale,Fe=K.viewDate,Se=K.onNextYear,He=K.onPrevYear,We=K.onYearClick,st=h.useContext(n),Xe=st.hideHeader;if(Xe)return null;var ft="".concat(oe,"-header");return h.createElement(i,Object.assign({},K,{prefixCls:ft,onSuperPrev:He,onSuperNext:Se}),h.createElement("button",{type:"button",onClick:We,className:"".concat(oe,"-year-btn")},ye.locale.format(Te.locale,Fe,Te.yearFormat)))}var St=Pt,Ze=3,qe=4;function Me(K){var oe=K.prefixCls,ye=K.locale,Te=K.value,Fe=K.viewDate,Se=K.generateConfig,He=K.monthCellRender,We=h.useContext(tt),st=We.rangedValue,Xe=We.hoverRangedValue,ft="".concat(oe,"-cell"),pt=dt({cellPrefixCls:ft,value:Te,generateConfig:Se,rangedValue:st,hoverRangedValue:Xe,isSameCell:function(ht,Tt){return lt(Se,ht,Tt)},isInView:function(){return!0},offsetCell:function(ht,Tt){return Se.addMonth(ht,Tt)}}),$e=ye.shortMonths||(Se.locale.getShortMonths?Se.locale.getShortMonths(ye.locale):[]),gt=Se.setMonth(Fe,0),at=He?function(It){return He(It,ye)}:void 0;return h.createElement(ke,Object.assign({},K,{rowNum:qe,colNum:Ze,baseDate:gt,getCellNode:at,getCellText:function(ht){return ye.monthFormat?Se.locale.format(ye.locale,ht,ye.monthFormat):$e[Se.getMonth(ht)]},getCellClassName:pt,getCellDate:Se.addMonth,titleCell:function(ht){return Se.locale.format(ye.locale,ht,"YYYY-MM")}}))}var ne=Me;function me(K){var oe=K.prefixCls,ye=K.operationRef,Te=K.onViewDateChange,Fe=K.generateConfig,Se=K.value,He=K.viewDate,We=K.onPanelChange,st=K.onSelect,Xe="".concat(oe,"-month-panel");ye.current={onKeyDown:function($e){return l($e,{onLeftRight:function(at){st(Fe.addMonth(Se||He,at),"key")},onCtrlLeftRight:function(at){st(Fe.addYear(Se||He,at),"key")},onUpDown:function(at){st(Fe.addMonth(Se||He,at*Ze),"key")},onEnter:function(){We("date",Se||He)}})}};var ft=function($e){var gt=Fe.addYear(He,$e);Te(gt),We(null,gt)};return h.createElement("div",{className:Xe},h.createElement(St,Object.assign({},K,{prefixCls:oe,onPrevYear:function(){ft(-1)},onNextYear:function(){ft(1)},onYearClick:function(){We("year",He)}})),h.createElement(ne,Object.assign({},K,{prefixCls:oe,onSelect:function($e){st($e,"mouse"),We("date",$e)}})))}var rt=me;function Ke(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.locale,Fe=K.viewDate,Se=K.onNextYear,He=K.onPrevYear,We=K.onYearClick,st=h.useContext(n),Xe=st.hideHeader;if(Xe)return null;var ft="".concat(oe,"-header");return h.createElement(i,Object.assign({},K,{prefixCls:ft,onSuperPrev:He,onSuperNext:Se}),h.createElement("button",{type:"button",onClick:We,className:"".concat(oe,"-year-btn")},ye.locale.format(Te.locale,Fe,Te.yearFormat)))}var xt=Ke,Ot=4,xe=1;function Je(K){var oe=K.prefixCls,ye=K.locale,Te=K.value,Fe=K.viewDate,Se=K.generateConfig,He=h.useContext(tt),We=He.rangedValue,st=He.hoverRangedValue,Xe="".concat(oe,"-cell"),ft=dt({cellPrefixCls:Xe,value:Te,generateConfig:Se,rangedValue:We,hoverRangedValue:st,isSameCell:function(gt,at){return mt(Se,gt,at)},isInView:function(){return!0},offsetCell:function(gt,at){return Se.addMonth(gt,at*3)}}),pt=Se.setDate(Se.setMonth(Fe,0),1);return h.createElement(ke,Object.assign({},K,{rowNum:xe,colNum:Ot,baseDate:pt,getCellText:function(gt){return Se.locale.format(ye.locale,gt,ye.quarterFormat||"[Q]Q")},getCellClassName:ft,getCellDate:function(gt,at){return Se.addMonth(gt,at*3)},titleCell:function(gt){return Se.locale.format(ye.locale,gt,"YYYY-[Q]Q")}}))}var wt=Je;function jt(K){var oe=K.prefixCls,ye=K.operationRef,Te=K.onViewDateChange,Fe=K.generateConfig,Se=K.value,He=K.viewDate,We=K.onPanelChange,st=K.onSelect,Xe="".concat(oe,"-quarter-panel");ye.current={onKeyDown:function($e){return l($e,{onLeftRight:function(at){st(Fe.addMonth(Se||He,at*3),"key")},onCtrlLeftRight:function(at){st(Fe.addYear(Se||He,at),"key")},onUpDown:function(at){st(Fe.addYear(Se||He,at),"key")}})}};var ft=function($e){var gt=Fe.addYear(He,$e);Te(gt),We(null,gt)};return h.createElement("div",{className:Xe},h.createElement(xt,Object.assign({},K,{prefixCls:oe,onPrevYear:function(){ft(-1)},onNextYear:function(){ft(1)},onYearClick:function(){We("year",He)}})),h.createElement(wt,Object.assign({},K,{prefixCls:oe,onSelect:function($e){st($e,"mouse")}})))}var Qt=jt;function Gn(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.viewDate,Fe=K.onPrevDecade,Se=K.onNextDecade,He=K.onDecadeClick,We=h.useContext(n),st=We.hideHeader;if(st)return null;var Xe="".concat(oe,"-header"),ft=ye.getYear(Te),pt=Math.floor(ft/di)*di,$e=pt+di-1;return h.createElement(i,Object.assign({},K,{prefixCls:Xe,onSuperPrev:Fe,onSuperNext:Se}),h.createElement("button",{type:"button",onClick:He,className:"".concat(oe,"-decade-btn")},pt,"-",$e))}var Vn=Gn,ei=3,ci=4;function ni(K){var oe=K.prefixCls,ye=K.value,Te=K.viewDate,Fe=K.locale,Se=K.generateConfig,He=h.useContext(tt),We=He.rangedValue,st=He.hoverRangedValue,Xe="".concat(oe,"-cell"),ft=Se.getYear(Te),pt=Math.floor(ft/di)*di,$e=pt+di-1,gt=Se.setYear(Te,pt-Math.ceil((ei*ci-di)/2)),at=function(Tt){var Rt=Se.getYear(Tt);return pt<=Rt&&Rt<=$e},It=dt({cellPrefixCls:Xe,value:ye,generateConfig:Se,rangedValue:We,hoverRangedValue:st,isSameCell:function(Tt,Rt){return vt(Se,Tt,Rt)},isInView:at,offsetCell:function(Tt,Rt){return Se.addYear(Tt,Rt)}});return h.createElement(ke,Object.assign({},K,{rowNum:ci,colNum:ei,baseDate:gt,getCellText:Se.getYear,getCellClassName:It,getCellDate:Se.addYear,titleCell:function(Tt){return Se.locale.format(Fe.locale,Tt,"YYYY")}}))}var _i=ni,di=10;function rn(K){var oe=K.prefixCls,ye=K.operationRef,Te=K.onViewDateChange,Fe=K.generateConfig,Se=K.value,He=K.viewDate,We=K.sourceMode,st=K.onSelect,Xe=K.onPanelChange,ft="".concat(oe,"-year-panel");ye.current={onKeyDown:function(gt){return l(gt,{onLeftRight:function(It){st(Fe.addYear(Se||He,It),"key")},onCtrlLeftRight:function(It){st(Fe.addYear(Se||He,It*di),"key")},onUpDown:function(It){st(Fe.addYear(Se||He,It*ei),"key")},onEnter:function(){Xe(We==="date"?"date":"month",Se||He)}})}};var pt=function(gt){var at=Fe.addYear(He,gt*10);Te(at),Xe(null,at)};return h.createElement("div",{className:ft},h.createElement(Vn,Object.assign({},K,{prefixCls:oe,onPrevDecade:function(){pt(-1)},onNextDecade:function(){pt(1)},onDecadeClick:function(){Xe("decade",He)}})),h.createElement(_i,Object.assign({},K,{prefixCls:oe,onSelect:function(gt){Xe(We==="date"?"date":"month",gt),st(gt,"mouse")}})))}var Dt=rn;function $t(K){var oe=K.prefixCls,ye=K.generateConfig,Te=K.viewDate,Fe=K.onPrevDecades,Se=K.onNextDecades,He=h.useContext(n),We=He.hideHeader;if(We)return null;var st="".concat(oe,"-header"),Xe=ye.getYear(Te),ft=Math.floor(Xe/et)*et,pt=ft+et-1;return h.createElement(i,Object.assign({},K,{prefixCls:st,onSuperPrev:Fe,onSuperNext:Se}),ft,"-",pt)}var cn=$t,Sn=3,Dn=4;function gn(K){var oe=sn-1,ye=K.prefixCls,Te=K.viewDate,Fe=K.generateConfig,Se=K.disabledDate,He="".concat(ye,"-cell"),We=Fe.getYear(Te),st=Math.floor(We/sn)*sn,Xe=Math.floor(We/et)*et,ft=Xe+et-1,pt=Fe.setYear(Te,Xe-Math.ceil((Sn*Dn*sn-et)/2)),$e=function(at){var It,ht=Se&&Se(at),Tt=Fe.getYear(at),Rt=Tt+oe;return It={},Object(x.a)(It,"".concat(He,"-disabled"),ht),Object(x.a)(It,"".concat(He,"-in-view"),Xe<=Tt&&Rt<=ft),Object(x.a)(It,"".concat(He,"-selected"),Tt===st),It};return h.createElement(ke,Object.assign({},K,{rowNum:Dn,colNum:Sn,baseDate:pt,getCellText:function(at){var It=Fe.getYear(at);return"".concat(It,"-").concat(It+oe)},getCellClassName:$e,getCellDate:function(at,It){return Fe.addYear(at,It*sn)}}))}var En=gn,sn=10,et=sn*10;function k(K){var oe=K.prefixCls,ye=K.onViewDateChange,Te=K.generateConfig,Fe=K.viewDate,Se=K.operationRef,He=K.onSelect,We=K.onPanelChange,st="".concat(oe,"-decade-panel");Se.current={onKeyDown:function($e){return l($e,{onLeftRight:function(at){He(Te.addYear(Fe,at*sn),"key")},onCtrlLeftRight:function(at){He(Te.addYear(Fe,at*et),"key")},onUpDown:function(at){He(Te.addYear(Fe,at*sn*Sn),"key")},onEnter:function(){We("year",Fe)}})}};var Xe=function($e){var gt=Te.addYear(Fe,$e*et);ye(gt),We(null,gt)},ft=function($e){He($e,"mouse"),We("year",$e)};return h.createElement("div",{className:st},h.createElement(cn,Object.assign({},K,{prefixCls:oe,onPrevDecades:function(){Xe(-1)},onNextDecades:function(){Xe(1)}})),h.createElement(En,Object.assign({},K,{prefixCls:oe,onSelect:ft})))}var p=k;function C(K,oe,ye){return ye?h.createElement("div",{className:"".concat(K,"-footer-extra")},ye(oe)):null}function N(K){var oe=K.prefixCls,ye=K.rangeList,Te=ye===void 0?[]:ye,Fe=K.components,Se=Fe===void 0?{}:Fe,He=K.needConfirmButton,We=K.onNow,st=K.onOk,Xe=K.okDisabled,ft=K.showNow,pt=K.locale,$e,gt;if(Te.length){var at=Se.rangeItem||"span";$e=h.createElement(h.Fragment,null,Te.map(function(ht){var Tt=ht.label,Rt=ht.onClick,Zt=ht.onMouseEnter,pn=ht.onMouseLeave;return h.createElement("li",{key:Tt,className:"".concat(oe,"-preset")},h.createElement(at,{onClick:Rt,onMouseEnter:Zt,onMouseLeave:pn},Tt))}))}if(He){var It=Se.button||"button";We&&!$e&&ft!==!1&&($e=h.createElement("li",{className:"".concat(oe,"-now")},h.createElement("a",{className:"".concat(oe,"-now-btn"),onClick:We},pt.now))),gt=He&&h.createElement("li",{className:"".concat(oe,"-ok")},h.createElement(It,{disabled:Xe,onClick:st},pt.ok))}return!$e&&!gt?null:h.createElement("ul",{className:"".concat(oe,"-ranges")},$e,gt)}function V(K){var oe,ye=K.prefixCls,Te=ye===void 0?"rc-picker":ye,Fe=K.className,Se=K.style,He=K.locale,We=K.generateConfig,st=K.value,Xe=K.defaultValue,ft=K.pickerValue,pt=K.defaultPickerValue,$e=K.disabledDate,gt=K.mode,at=K.picker,It=at===void 0?"date":at,ht=K.tabIndex,Tt=ht===void 0?0:ht,Rt=K.showNow,Zt=K.showTime,pn=K.showToday,qt=K.renderExtraFooter,Kt=K.hideHeader,Tn=K.onSelect,an=K.onChange,Yn=K.onPanelChange,ai=K.onMouseDown,pi=K.onPickerValueChange,li=K.onOk,yi=K.components,xi=K.direction,ki=K.hourStep,Gi=ki===void 0?1:ki,Ui=K.minuteStep,Ni=Ui===void 0?1:Ui,Vi=K.secondStep,Ii=Vi===void 0?1:Vi,Zi=It==="date"&&!!Zt||It==="time",Fi=24%Gi===0,zi=60%Ni===0,on=60%Ii===0,un=h.useContext(n),Ln=un.operationRef,ti=un.panelRef,mi=un.onSelect,Ei=un.hideRanges,wi=un.defaultOpenValue,Li=h.useContext(tt),Ri=Li.inRange,rr=Li.panelPosition,Bi=Li.rangedValue,ar=Li.hoverRangedValue,Ai=h.useRef({}),Yi=h.useRef(!0),mr=Object(m.a)(null,{value:st,defaultValue:Xe,postState:function(At){return!At&&wi&&It==="time"?wi:At}}),Hi=Object(j.a)(mr,2),ji=Hi[0],cr=Hi[1],Xi=Object(m.a)(null,{value:ft,defaultValue:pt||ji,postState:function(At){return At||We.getNow()}}),se=Object(j.a)(Xi,2),Ce=se[0],we=se[1],he=function(At){we(At),pi&&pi(At)},Y=function(At){var Ht=M[It];return Ht?Ht(At):At},ie=Object(m.a)(function(){return It==="time"?"time":Y("date")},{value:gt}),X=Object(j.a)(ie,2),ce=X[0],ge=X[1];h.useEffect(function(){ge(It)},[It]);var Ie=h.useState(function(){return ce}),be=Object(j.a)(Ie,2),Be=be[0],nt=be[1],yt=function(At,Ht){var xn=Y(At||ce);nt(ce),ge(xn),Yn&&(ce!==xn||Lt(We,Ce,Ce))&&Yn(Ht,xn)},Ct=function(At,Ht){var xn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(ce===It||xn)&&(cr(At),Tn&&Tn(At),mi&&mi(At,Ht),an&&!Lt(We,At,ji)&&an(At))},kt=function(At){return Ai.current&&Ai.current.onKeyDown?([r.a.LEFT,r.a.RIGHT,r.a.UP,r.a.DOWN,r.a.PAGE_UP,r.a.PAGE_DOWN,r.a.ENTER].includes(At.which)&&At.preventDefault(),Ai.current.onKeyDown(At)):(Object(g.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},en=function(At){Ai.current&&Ai.current.onBlur&&Ai.current.onBlur(At)};Ln&&rr!=="right"&&(Ln.current={onKeyDown:kt,onClose:function(){Ai.current&&Ai.current.onClose&&Ai.current.onClose()}}),h.useEffect(function(){st&&!Yi.current&&we(st)},[st]),h.useEffect(function(){Yi.current=!1},[]);var mn,hn=Object(O.a)(Object(O.a)({},K),{},{operationRef:Ai,prefixCls:Te,viewDate:Ce,value:ji,onViewDateChange:he,sourceMode:Be,onPanelChange:yt,disabledDate:ce!=="decade"?$e:void 0});delete hn.onChange,delete hn.onSelect;switch(ce){case"decade":mn=h.createElement(p,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}));break;case"year":mn=h.createElement(Dt,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}));break;case"month":mn=h.createElement(rt,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}));break;case"quarter":mn=h.createElement(Qt,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}));break;case"week":mn=h.createElement(Xt,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}));break;case"time":delete hn.showTime,mn=h.createElement(Ve,Object.assign({},hn,Object(u.a)(Zt)==="object"?Zt:null,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}));break;default:Zt?mn=h.createElement(bt,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}})):mn=h.createElement(re,Object.assign({},hn,{onSelect:function(At,Ht){he(At),Ct(At,Ht)}}))}var Rn,An,Cn=function(){var At=We.getNow(),Ht=Ue(We.getHour(At),We.getMinute(At),We.getSecond(At),Fi?Gi:1,zi?Ni:1,on?Ii:1),xn=Ne(We,At,Ht[0],Ht[1],Ht[2]);Ct(xn,"submit")};Ei||(Rn=C(Te,ce,qt),An=N({prefixCls:Te,components:yi,needConfirmButton:Zi,okDisabled:!ji||$e&&$e(ji),locale:He,showNow:Rt,onNow:Zi&&Cn,onOk:function(){ji&&(Ct(ji,"submit",!0),li&&li(ji))}}));var wn;if(pn&&ce==="date"&&It==="date"&&!Zt){var Mn=We.getNow(),fn="".concat(Te,"-today-btn"),zn=$e&&$e(Mn);wn=h.createElement("a",{className:w()(fn,zn&&"".concat(fn,"-disabled")),"aria-disabled":zn,onClick:function(){zn||Ct(Mn,"mouse",!0)}},He.today)}return h.createElement(n.Provider,{value:Object(O.a)(Object(O.a)({},un),{},{hideHeader:"hideHeader"in K?Kt:un.hideHeader,hidePrevBtn:Ri&&rr==="right",hideNextBtn:Ri&&rr==="left"})},h.createElement("div",{tabIndex:Tt,className:w()("".concat(Te,"-panel"),Fe,(oe={},Object(x.a)(oe,"".concat(Te,"-panel-has-range"),Bi&&Bi[0]&&Bi[1]),Object(x.a)(oe,"".concat(Te,"-panel-has-range-hover"),ar&&ar[0]&&ar[1]),Object(x.a)(oe,"".concat(Te,"-panel-rtl"),xi==="rtl"),oe)),style:Se,onKeyDown:kt,onBlur:en,onMouseDown:ai,ref:ti},mn,Rn||An||wn?h.createElement("div",{className:"".concat(Te,"-footer")},Rn,An,wn):null))}var U=V,de=G("uciX"),ze={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function _t(K){var oe,ye=K.prefixCls,Te=K.popupElement,Fe=K.popupStyle,Se=K.visible,He=K.dropdownClassName,We=K.dropdownAlign,st=K.transitionName,Xe=K.getPopupContainer,ft=K.children,pt=K.range,$e=K.popupPlacement,gt=K.direction,at="".concat(ye,"-dropdown"),It=function(){return $e!==void 0?$e:gt==="rtl"?"bottomRight":"bottomLeft"};return h.createElement(de.a,{showAction:[],hideAction:[],popupPlacement:It(),builtinPlacements:ze,prefixCls:at,popupTransitionName:st,popup:Te,popupAlign:We,popupVisible:Se,popupClassName:w()(He,(oe={},Object(x.a)(oe,"".concat(at,"-range"),pt),Object(x.a)(oe,"".concat(at,"-rtl"),gt==="rtl"),oe)),popupStyle:Fe,getPopupContainer:Xe},ft)}var Mt=_t;function ct(K){var oe=K.open,ye=K.value,Te=K.isClickOutside,Fe=K.triggerOpen,Se=K.forwardKeyDown,He=K.blurToCancel,We=K.onSubmit,st=K.onCancel,Xe=K.onFocus,ft=K.onBlur,pt=Object(h.useState)(!1),$e=Object(j.a)(pt,2),gt=$e[0],at=$e[1],It=Object(h.useState)(!1),ht=Object(j.a)(It,2),Tt=ht[0],Rt=ht[1],Zt=Object(h.useRef)(!1),pn=Object(h.useRef)(!1),qt={onMouseDown:function(){at(!0),Fe(!0)},onKeyDown:function(Tn){switch(Tn.which){case r.a.ENTER:{oe?We()!==!1&&at(!0):Fe(!0),Tn.preventDefault();return}case r.a.TAB:{gt&&oe&&!Tn.shiftKey?(at(!1),Tn.preventDefault()):!gt&&oe&&(!Se(Tn)&&Tn.shiftKey&&(at(!0),Tn.preventDefault()));return}case r.a.ESC:{at(!0),st();return}}!oe&&![r.a.SHIFT].includes(Tn.which)?Fe(!0):gt||Se(Tn)},onFocus:function(Tn){at(!0),Rt(!0),Xe&&Xe(Tn)},onBlur:function(Tn){if(Zt.current||!Te(document.activeElement)){Zt.current=!1;return}He?setTimeout(function(){Te(document.activeElement)&&st()},0):oe&&(Fe(!1),pn.current&&We()),Rt(!1),ft&&ft(Tn)}};return Object(h.useEffect)(function(){pn.current=!1},[oe]),Object(h.useEffect)(function(){pn.current=!0},[ye]),Object(h.useEffect)(function(){return f(function(Kt){var Tn=Kt.target;oe&&(Te(Tn)?Tt||Fe(!1):(Zt.current=!0,requestAnimationFrame(function(){Zt.current=!1})))})}),[qt,{focused:Tt,typing:gt}]}function Vt(K){var oe=K.valueTexts,ye=K.onTextChange,Te=h.useState(""),Fe=Object(j.a)(Te,2),Se=Fe[0],He=Fe[1],We=h.useRef([]);We.current=oe;function st(ft){He(ft),ye(ft)}function Xe(){He(We.current[0])}return h.useEffect(function(){oe.every(function(ft){return ft!==Se})&&Xe()},[oe.join("||")]),[Se,st,Xe]}var Et=G("Gytx"),Yt=G.n(Et);function dn(K,oe){var ye=oe.formatList,Te=oe.generateConfig,Fe=oe.locale;return Object(E.a)(function(){if(!K)return[[""],""];for(var Se="",He=[],We=0;We<ye.length;We+=1){var st=ye[We],Xe=Te.locale.format(Fe.locale,K,st);He.push(Xe),We===0&&(Se=Xe)}return[He,Se]},[K,ye],function(Se,He){return Se[0]!==He[0]||!Yt()(Se[1],He[1])})}function Un(K,oe){var ye=oe.formatList,Te=oe.generateConfig,Fe=oe.locale,Se=Object(h.useState)(null),He=Object(j.a)(Se,2),We=He[0],st=He[1],Xe=Object(h.useRef)(null);function ft(ht){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Xe.current),Tt){st(ht);return}Xe.current=requestAnimationFrame(function(){st(ht)})}var pt=dn(We,{formatList:ye,generateConfig:Te,locale:Fe}),$e=Object(j.a)(pt,2),gt=$e[1];function at(ht){ft(ht)}function It(){var ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ft(null,ht)}return Object(h.useEffect)(function(){It(!0)},[K]),Object(h.useEffect)(function(){return function(){return cancelAnimationFrame(Xe.current)}},[]),[gt,at,It]}function On(K){var oe,ye=K.prefixCls,Te=ye===void 0?"rc-picker":ye,Fe=K.id,Se=K.tabIndex,He=K.style,We=K.className,st=K.dropdownClassName,Xe=K.dropdownAlign,ft=K.popupStyle,pt=K.transitionName,$e=K.generateConfig,gt=K.locale,at=K.inputReadOnly,It=K.allowClear,ht=K.autoFocus,Tt=K.showTime,Rt=K.picker,Zt=Rt===void 0?"date":Rt,pn=K.format,qt=K.use12Hours,Kt=K.value,Tn=K.defaultValue,an=K.open,Yn=K.defaultOpen,ai=K.defaultOpenValue,pi=K.suffixIcon,li=K.clearIcon,yi=K.disabled,xi=K.disabledDate,ki=K.placeholder,Gi=K.getPopupContainer,Ui=K.pickerRef,Ni=K.panelRender,Vi=K.onChange,Ii=K.onOpenChange,Zi=K.onFocus,Fi=K.onBlur,zi=K.onMouseDown,on=K.onMouseUp,un=K.onMouseEnter,Ln=K.onMouseLeave,ti=K.onContextMenu,mi=K.onClick,Ei=K.direction,wi=K.autoComplete,Li=wi===void 0?"off":wi,Ri=h.useRef(null),rr=Zt==="date"&&!!Tt||Zt==="time",Bi=ae(d(pn,Zt,Tt,qt)),ar=h.useRef(null),Ai=h.useRef(null),Yi=Object(m.a)(null,{value:Kt,defaultValue:Tn}),mr=Object(j.a)(Yi,2),Hi=mr[0],ji=mr[1],cr=h.useState(Hi),Xi=Object(j.a)(cr,2),se=Xi[0],Ce=Xi[1],we=h.useRef(null),he=Object(m.a)(!1,{value:an,defaultValue:Yn,postState:function(yn){return yi?!1:yn},onChange:function(yn){Ii&&Ii(yn),!yn&&we.current&&we.current.onClose&&we.current.onClose()}}),Y=Object(j.a)(he,2),ie=Y[0],X=Y[1],ce=dn(se,{formatList:Bi,generateConfig:$e,locale:gt}),ge=Object(j.a)(ce,2),Ie=ge[0],be=ge[1],Be=Vt({valueTexts:Ie,onTextChange:function(yn){var Ti=$e.locale.parse(gt.locale,yn,Bi);Ti&&(!xi||!xi(Ti))&&Ce(Ti)}}),nt=Object(j.a)(Be,3),yt=nt[0],Ct=nt[1],kt=nt[2],en=function(yn){Ce(yn),ji(yn),Vi&&!Lt($e,Hi,yn)&&Vi(yn,yn?$e.locale.format(gt.locale,yn,Bi[0]):"")},mn=function(yn){if(yi&&yn)return;X(yn)},hn=function(yn){return ie&&we.current&&we.current.onKeyDown?we.current.onKeyDown(yn):(Object(g.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},Rn=function(){on&&on.apply(void 0,arguments),Ri.current&&(Ri.current.focus(),mn(!0))},An=ct({blurToCancel:rr,open:ie,value:yt,triggerOpen:mn,forwardKeyDown:hn,isClickOutside:function(yn){return!F([ar.current,Ai.current],yn)},onSubmit:function(){return xi&&xi(se)?!1:(en(se),mn(!1),kt(),!0)},onCancel:function(){mn(!1),Ce(Hi),kt()},onFocus:Zi,onBlur:Fi}),Cn=Object(j.a)(An,2),wn=Cn[0],Mn=Cn[1],fn=Mn.focused,zn=Mn.typing;h.useEffect(function(){ie||(Ce(Hi),!Ie.length||Ie[0]===""?Ct(""):be!==yt&&kt())},[ie,Ie]),h.useEffect(function(){ie||kt()},[Zt]),h.useEffect(function(){Ce(Hi)},[Hi]),Ui&&(Ui.current={focus:function(){Ri.current&&Ri.current.focus()},blur:function(){Ri.current&&Ri.current.blur()}});var _n=Object(O.a)(Object(O.a)({},K),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),At=h.createElement(U,Object.assign({},_n,{generateConfig:$e,className:w()(Object(x.a)({},"".concat(Te,"-panel-focused"),!zn)),value:se,locale:gt,tabIndex:-1,onChange:Ce,direction:Ei}));Ni&&(At=Ni(At));var Ht=h.createElement("div",{className:"".concat(Te,"-panel-container"),onMouseDown:function(yn){yn.preventDefault()}},At),xn;pi&&(xn=h.createElement("span",{className:"".concat(Te,"-suffix")},pi));var Fn;It&&Hi&&!yi&&(Fn=h.createElement("span",{onMouseDown:function(yn){yn.preventDefault(),yn.stopPropagation()},onMouseUp:function(yn){yn.preventDefault(),yn.stopPropagation(),en(null),mn(!1)},className:"".concat(Te,"-clear")},li||h.createElement("span",{className:"".concat(Te,"-clear-btn")})));var nn=function(yn,Ti){(Ti==="submit"||Ti!=="key"&&!rr)&&(en(yn),mn(!1))},Kn=Ei==="rtl"?"bottomRight":"bottomLeft",oi=Un(yt,{formatList:Bi,generateConfig:$e,locale:gt}),Bn=Object(j.a)(oi,3),Xn=Bn[0],si=Bn[1],Jn=Bn[2];return h.createElement(n.Provider,{value:{operationRef:we,hideHeader:Zt==="time",panelRef:ar,onSelect:nn,open:ie,defaultOpenValue:ai,onDateMouseEnter:si,onDateMouseLeave:Jn}},h.createElement(Mt,{visible:ie,popupElement:Ht,popupStyle:ft,prefixCls:Te,dropdownClassName:st,dropdownAlign:Xe,getPopupContainer:Gi,transitionName:pt,popupPlacement:Kn,direction:Ei},h.createElement("div",{className:w()(Te,We,(oe={},Object(x.a)(oe,"".concat(Te,"-disabled"),yi),Object(x.a)(oe,"".concat(Te,"-focused"),fn),Object(x.a)(oe,"".concat(Te,"-rtl"),Ei==="rtl"),oe)),style:He,onMouseDown:zi,onMouseUp:Rn,onMouseEnter:un,onMouseLeave:Ln,onContextMenu:ti,onClick:mi},h.createElement("div",{className:w()("".concat(Te,"-input"),Object(x.a)({},"".concat(Te,"-input-placeholder"),!!Xn)),ref:Ai},h.createElement("input",Object.assign({id:Fe,tabIndex:Se,disabled:yi,readOnly:at||!zn,value:Xn||yt,onChange:function(yn){Ct(yn.target.value)},autoFocus:ht,placeholder:ki,ref:Ri,title:yt},wn,{size:a(Zt,Bi[0])},De(K),{autoComplete:Li})),xn,Fn))))}var bn=function(K){Object(L.a)(ye,K);var oe=Object(W.a)(ye);function ye(){var Te;return Object(te.a)(this,ye),Te=oe.apply(this,arguments),Te.pickerRef=h.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(H.a)(ye,[{key:"render",value:function(){return h.createElement(On,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),ye}(h.Component),ln=bn;function Jt(K,oe,ye){var Te=K.picker,Fe=K.locale,Se=K.selectedValue,He=K.disabledDate,We=K.disabled,st=K.generateConfig,Xe=_e(Se,0),ft=_e(Se,1);function pt(ht){var Tt=st.getYear(ht),Rt=st.locale.getWeek(Fe.locale,ht);return Tt*100+Rt}function $e(ht){var Tt=st.getYear(ht),Rt=st.getMonth(ht);return Tt*100+Rt}function gt(ht){var Tt=st.getYear(ht),Rt=ut(st,ht);return Tt*10+Rt}var at=h.useCallback(function(ht){if(He&&He(ht))return!0;if(We[1]&&ft)return!Bt(st,ht,ft)&&st.isAfter(ht,ft);if(oe&&ft)switch(Te){case"quarter":return gt(ht)>gt(ft);case"month":return $e(ht)>$e(ft);case"week":return pt(ht)>pt(ft);default:return!Bt(st,ht,ft)&&st.isAfter(ht,ft)}return!1},[He,We[1],ft,oe]),It=h.useCallback(function(ht){if(He&&He(ht))return!0;if(We[0]&&Xe)return!Bt(st,ht,ft)&&st.isAfter(Xe,ht);if(ye&&Xe)switch(Te){case"quarter":return gt(ht)<gt(Xe);case"month":return $e(ht)<$e(Xe);case"week":return pt(ht)<pt(Xe);default:return!Bt(st,ht,Xe)&&st.isAfter(Xe,ht)}return!1},[He,We[0],Xe,ye]);return[at,It]}function In(K,oe,ye,Te){var Fe=Re(K,ye,Te,1);function Se(He){return He(K,oe)?"same":He(Fe,oe)?"closing":"far"}switch(ye){case"year":return Se(function(He,We){return it(Te,He,We)});case"quarter":case"month":return Se(function(He,We){return vt(Te,He,We)});default:return Se(function(He,We){return lt(Te,He,We)})}}function Wn(K,oe,ye,Te){var Fe=_e(K,0),Se=_e(K,1);if(oe===0)return Fe;if(Fe&&Se){var He=In(Fe,Se,ye,Te);switch(He){case"same":return Fe;case"closing":return Fe;default:return Re(Se,ye,Te,-1)}}return Fe}function ii(K){var oe=K.values,ye=K.picker,Te=K.defaultDates,Fe=K.generateConfig,Se=h.useState(function(){return[_e(Te,0),_e(Te,1)]}),He=Object(j.a)(Se,2),We=He[0],st=He[1],Xe=h.useState(null),ft=Object(j.a)(Xe,2),pt=ft[0],$e=ft[1],gt=_e(oe,0),at=_e(oe,1);function It(Tt){return We[Tt]?We[Tt]:_e(pt,Tt)||Wn(oe,Tt,ye,Fe)||gt||at||Fe.getNow()}function ht(Tt,Rt){if(Tt){var Zt=Oe(pt,Tt,Rt);st(Oe(We,null,Rt)||[null,null]);var pn=(Rt+1)%2;_e(oe,pn)||(Zt=Oe(Zt,Tt,pn)),$e(Zt)}else(gt||at)&&$e(null)}return[It,ht]}function Pn(K,oe){return K&&K[0]&&K[1]&&oe.isAfter(K[0],K[1])?[K[1],K[0]]:K}function Nn(K,oe,ye,Te){return K||Te&&Te[oe]?!0:!!ye[(oe+1)%2]}function Qn(K){var oe,ye,Te,Fe=K.prefixCls,Se=Fe===void 0?"rc-picker":Fe,He=K.id,We=K.style,st=K.className,Xe=K.popupStyle,ft=K.dropdownClassName,pt=K.transitionName,$e=K.dropdownAlign,gt=K.getPopupContainer,at=K.generateConfig,It=K.locale,ht=K.placeholder,Tt=K.autoFocus,Rt=K.disabled,Zt=K.format,pn=K.picker,qt=pn===void 0?"date":pn,Kt=K.showTime,Tn=K.use12Hours,an=K.separator,Yn=an===void 0?"~":an,ai=K.value,pi=K.defaultValue,li=K.defaultPickerValue,yi=K.open,xi=K.defaultOpen,ki=K.disabledDate,Gi=K.disabledTime,Ui=K.dateRender,Ni=K.panelRender,Vi=K.ranges,Ii=K.allowEmpty,Zi=K.allowClear,Fi=K.suffixIcon,zi=K.clearIcon,on=K.pickerRef,un=K.inputReadOnly,Ln=K.mode,ti=K.renderExtraFooter,mi=K.onChange,Ei=K.onOpenChange,wi=K.onPanelChange,Li=K.onCalendarChange,Ri=K.onFocus,rr=K.onBlur,Bi=K.onOk,ar=K.components,Ai=K.order,Yi=K.direction,mr=K.activePickerIndex,Hi=K.autoComplete,ji=Hi===void 0?"off":Hi,cr=qt==="date"&&!!Kt||qt==="time",Xi=Object(h.useRef)({}),se=Object(h.useRef)(null),Ce=Object(h.useRef)(null),we=Object(h.useRef)(null),he=Object(h.useRef)(null),Y=Object(h.useRef)(null),ie=Object(h.useRef)(null),X=Object(h.useRef)(null),ce=ae(d(Zt,qt,Kt,Tn)),ge=Object(m.a)(0,{value:mr}),Ie=Object(j.a)(ge,2),be=Ie[0],Be=Ie[1],nt=Object(h.useRef)(null),yt=h.useMemo(function(){return Array.isArray(Rt)?Rt:[Rt||!1,Rt||!1]},[Rt]),Ct=Object(m.a)(null,{value:ai,defaultValue:pi,postState:function(tn){return qt==="time"&&!Ai?tn:Pn(tn,at)}}),kt=Object(j.a)(Ct,2),en=kt[0],mn=kt[1],hn=ii({values:en,picker:qt,defaultDates:li,generateConfig:at}),Rn=Object(j.a)(hn,2),An=Rn[0],Cn=Rn[1],wn=Object(m.a)(en,{postState:function(tn){var vn=tn;if(yt[0]&&yt[1])return vn;for(var jn=0;jn<2;jn+=1)yt[jn]&&!_e(vn,jn)&&!_e(Ii,jn)&&(vn=Oe(vn,at.getNow(),jn));return vn}}),Mn=Object(j.a)(wn,2),fn=Mn[0],zn=Mn[1],_n=Object(m.a)([qt,qt],{value:Ln}),At=Object(j.a)(_n,2),Ht=At[0],xn=At[1];Object(h.useEffect)(function(){xn([qt,qt])},[qt]);var Fn=function(tn,vn){xn(tn),wi&&wi(vn,tn)},nn=Jt({picker:qt,selectedValue:fn,locale:It,disabled:yt,disabledDate:ki,generateConfig:at},Xi.current[1],Xi.current[0]),Kn=Object(j.a)(nn,2),oi=Kn[0],Bn=Kn[1],Xn=Object(m.a)(!1,{value:yi,defaultValue:xi,postState:function(tn){return yt[be]?!1:tn},onChange:function(tn){Ei&&Ei(tn),!tn&&nt.current&&nt.current.onClose&&nt.current.onClose()}}),si=Object(j.a)(Xn,2),Jn=si[0],$n=si[1],yn=Jn&&be===0,Ti=Jn&&be===1,qi=Object(h.useState)(0),Wi=Object(j.a)(qi,2),$i=Wi[0],Ci=Wi[1];Object(h.useEffect)(function(){!Jn&&se.current&&Ci(se.current.offsetWidth)},[Jn]);var Pi=h.useRef();function bi(kn,tn){if(kn)clearTimeout(Pi.current),Xi.current[tn]=!0,Be(tn),$n(kn),Jn||Cn(null,tn);else if(be===tn){$n(kn);var vn=Xi.current;Pi.current=setTimeout(function(){vn===Xi.current&&(Xi.current={})})}}function Si(kn){bi(!0,kn),setTimeout(function(){var tn=[ie,X][kn];tn.current&&tn.current.focus()},0)}function Qi(kn,tn){var vn=kn,jn=_e(vn,0),vi=_e(vn,1);jn&&vi&&at.isAfter(jn,vi)&&(qt==="week"&&!Wt(at,It.locale,jn,vi)||qt==="quarter"&&!mt(at,jn,vi)||qt!=="week"&&qt!=="quarter"&&qt!=="time"&&!Bt(at,jn,vi)?(tn===0?(vn=[jn,null],vi=null):(jn=null,vn=[null,vi]),Xi.current=Object(x.a)({},tn,!0)):(qt!=="time"||Ai!==!1)&&(vn=Pn(vn,at))),zn(vn);var fr=vn&&vn[0]?at.locale.format(It.locale,vn[0],ce[0]):"",ir=vn&&vn[1]?at.locale.format(It.locale,vn[1],ce[0]):"";if(Li){var Mi={range:tn===0?"start":"end"};Li(vn,[fr,ir],Mi)}var ur=Nn(jn,0,yt,Ii),pr=Nn(vi,1,yt,Ii),Xr=vn===null||ur&≺Xr&&(mn(vn),mi&&(!Lt(at,_e(en,0),jn)||!Lt(at,_e(en,1),vi))&&mi(vn,[fr,ir]));var Ji=null;tn===0&&!yt[1]?Ji=1:tn===1&&!yt[0]&&(Ji=0),Ji!==null&&Ji!==be&&(!Xi.current[Ji]||!_e(vn,Ji))&&_e(vn,tn)?Si(Ji):bi(!1,tn)}var or=function(tn){return Jn&&nt.current&&nt.current.onKeyDown?nt.current.onKeyDown(tn):(Object(g.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sr={formatList:ce,generateConfig:at,locale:It},ui=dn(_e(fn,0),sr),er=Object(j.a)(ui,2),tr=er[0],fi=er[1],Zn=dn(_e(fn,1),sr),Di=Object(j.a)(Zn,2),Or=Di[0],$r=Di[1],dr=function(tn,vn){var jn=at.locale.parse(It.locale,tn,ce),vi=vn===0?oi:Bn;jn&&!vi(jn)&&(zn(Oe(fn,jn,vn)),Cn(jn,vn))},da=Vt({valueTexts:tr,onTextChange:function(tn){return dr(tn,0)}}),Lr=Object(j.a)(da,3),yr=Lr[0],Qr=Lr[1],Jr=Lr[2],ha=Vt({valueTexts:Or,onTextChange:function(tn){return dr(tn,1)}}),wr=Object(j.a)(ha,3),Rr=wr[0],Zr=wr[1],qr=wr[2],ea=Object(h.useState)(null),ta=Object(j.a)(ea,2),fa=ta[0],br=ta[1],na=Object(h.useState)(null),gr=Object(j.a)(na,2),nr=gr[0],Ar=gr[1],ia=Un(yr,{formatList:ce,generateConfig:at,locale:It}),Pr=Object(j.a)(ia,3),Mr=Pr[0],kr=Pr[1],Nr=Pr[2],jr=Un(Rr,{formatList:ce,generateConfig:at,locale:It}),_r=Object(j.a)(jr,3),Ur=_r[0],pa=_r[1],Fr=_r[2],ma=function(tn){Ar(Oe(fn,tn,be)),be===0?kr(tn):pa(tn)},ga=function(){Ar(Oe(fn,null,be)),be===0?Nr():Fr()},ra=function(tn,vn){return{blurToCancel:cr,forwardKeyDown:or,onBlur:rr,isClickOutside:function(vi){return!F([Ce.current,we.current,he.current],vi)},onFocus:function(vi){Be(tn),Ri&&Ri(vi)},triggerOpen:function(vi){bi(vi,tn)},onSubmit:function(){Qi(fn,tn),vn()},onCancel:function(){bi(!1,tn),zn(en),vn()}}},Br=ct(Object(O.a)(Object(O.a)({},ra(0,Jr)),{},{open:yn,value:yr})),aa=Object(j.a)(Br,2),va=aa[0],Hr=aa[1],oa=Hr.focused,Wr=Hr.typing,ya=ct(Object(O.a)(Object(O.a)({},ra(1,qr)),{},{open:Ti,value:Rr})),sa=Object(j.a)(ya,2),lr=sa[0],Kr=sa[1],Gr=Kr.focused,Vr=Kr.typing,Er=function(tn){!Jn&&!ie.current.contains(tn.target)&&!X.current.contains(tn.target)&&(yt[0]?yt[1]||Si(1):Si(0))},zr=function(tn){Jn&&(oa||Gr)&&!ie.current.contains(tn.target)&&!X.current.contains(tn.target)&&tn.preventDefault()},Yr=en&&en[0]?at.locale.format(It.locale,en[0],"YYYYMMDDHHmmss"):"",la=en&&en[1]?at.locale.format(It.locale,en[1],"YYYYMMDDHHmmss"):"";Object(h.useEffect)(function(){Jn||(zn(en),!tr.length||tr[0]===""?Qr(""):fi!==yr&&Jr(),!Or.length||Or[0]===""?Zr(""):$r!==Rr&&qr())},[Jn,tr,Or]),Object(h.useEffect)(function(){zn(en)},[Yr,la]),on&&(on.current={focus:function(){ie.current&&ie.current.focus()},blur:function(){ie.current&&ie.current.blur(),X.current&&X.current.blur()}});var ua=Object.keys(Vi||{}),qn=ua.map(function(kn){var tn=Vi[kn],vn=typeof tn=="function"?tn():tn;return{label:kn,onClick:function(){Qi(vn,null),bi(!1,be)},onMouseEnter:function(){br(vn)},onMouseLeave:function(){br(null)}}});function Hn(){var kn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,tn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},vn=null;Jn&&nr&&nr[0]&&nr[1]&&at.isAfter(nr[1],nr[0])&&(vn=nr);var jn=Kt;if(Kt&&Object(u.a)(Kt)==="object"&&Kt.defaultValue){var vi=Kt.defaultValue;jn=Object(O.a)(Object(O.a)({},Kt),{},{defaultValue:_e(vi,be)||void 0})}var fr=null;return Ui&&(fr=function(Mi,ur){return Ui(Mi,ur,{range:be?"end":"start"})}),h.createElement(tt.Provider,{value:{inRange:!0,panelPosition:kn,rangedValue:fa||fn,hoverRangedValue:vn}},h.createElement(U,Object.assign({},K,tn,{dateRender:fr,showTime:jn,mode:Ht[be],generateConfig:at,style:void 0,direction:Yi,disabledDate:be===0?oi:Bn,disabledTime:function(Mi){return Gi?Gi(Mi,be===0?"start":"end"):!1},className:w()(Object(x.a)({},"".concat(Se,"-panel-focused"),be===0?!Wr:!Vr)),value:_e(fn,be),locale:It,tabIndex:-1,onPanelChange:function(Mi,ur){Fn(Oe(Ht,ur,be),Oe(fn,Mi,be));var pr=Mi;kn==="right"&&Ht[be]===ur&&(pr=Re(pr,ur,at,-1)),Cn(pr,be)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var gi=0,Ki=0;be&&we.current&&Y.current&&Ce.current&&(gi=we.current.offsetWidth+Y.current.offsetWidth,Ce.current.offsetWidth&&gi>Ce.current.offsetWidth&&(Ki=gi));var Tr=Yi==="rtl"?{right:gi}:{left:gi};function Cr(){var kn,tn=C(Se,Ht[be],ti),vn=N({prefixCls:Se,components:ar,needConfirmButton:cr,okDisabled:!_e(fn,be)||ki&&ki(fn[be]),locale:It,rangeList:qn,onOk:function(){_e(fn,be)&&(Qi(fn,be),Bi&&Bi(fn))}});if(qt!=="time"&&!Kt){var jn=An(be),vi=Re(jn,qt,at),fr=Ht[be],ir=fr===qt,Mi=Hn(ir?"left":!1,{pickerValue:jn,onPickerValueChange:function(Ji){Cn(Ji,be)}}),ur=Hn("right",{pickerValue:vi,onPickerValueChange:function(Ji){Cn(Re(Ji,qt,at,-1),be)}});Yi==="rtl"?kn=h.createElement(h.Fragment,null,ur,ir&&Mi):kn=h.createElement(h.Fragment,null,Mi,ir&&ur)}else kn=Hn();var pr=h.createElement(h.Fragment,null,h.createElement("div",{className:"".concat(Se,"-panels")},kn),(tn||vn)&&h.createElement("div",{className:"".concat(Se,"-footer")},tn,vn));return Ni&&(pr=Ni(pr)),h.createElement("div",{className:"".concat(Se,"-panel-container"),style:{marginLeft:Ki},ref:Ce,onMouseDown:function(Ji){Ji.preventDefault()}},pr)}var xr=h.createElement("div",{className:w()("".concat(Se,"-range-wrapper"),"".concat(Se,"-").concat(qt,"-range-wrapper")),style:{minWidth:$i}},h.createElement("div",{className:"".concat(Se,"-range-arrow"),style:Tr}),Cr()),vr;Fi&&(vr=h.createElement("span",{className:"".concat(Se,"-suffix")},Fi));var hr;Zi&&(_e(en,0)&&!yt[0]||_e(en,1)&&!yt[1])&&(hr=h.createElement("span",{onMouseDown:function(tn){tn.preventDefault(),tn.stopPropagation()},onMouseUp:function(tn){tn.preventDefault(),tn.stopPropagation();var vn=en;yt[0]||(vn=Oe(vn,null,0)),yt[1]||(vn=Oe(vn,null,1)),Qi(vn,null),bi(!1,be)},className:"".concat(Se,"-clear")},zi||h.createElement("span",{className:"".concat(Se,"-clear-btn")})));var Dr={size:a(qt,ce[0])},Sr=0,Ir=0;we.current&&he.current&&Y.current&&(be===0?Ir=we.current.offsetWidth:(Sr=gi,Ir=he.current.offsetWidth));var ca=Yi==="rtl"?{right:Sr}:{left:Sr},ba=function(tn,vn){var jn=Oe(fn,tn,be);vn==="submit"||vn!=="key"&&!cr?(Qi(jn,be),be===0?Nr():Fr()):zn(jn)};return h.createElement(n.Provider,{value:{operationRef:nt,hideHeader:qt==="time",onDateMouseEnter:ma,onDateMouseLeave:ga,hideRanges:!0,onSelect:ba,open:Jn}},h.createElement(Mt,{visible:Jn,popupElement:xr,popupStyle:Xe,prefixCls:Se,dropdownClassName:ft,dropdownAlign:$e,getPopupContainer:gt,transitionName:pt,range:!0,direction:Yi},h.createElement("div",Object.assign({ref:se,className:w()(Se,"".concat(Se,"-range"),st,(oe={},Object(x.a)(oe,"".concat(Se,"-disabled"),yt[0]&&yt[1]),Object(x.a)(oe,"".concat(Se,"-focused"),be===0?oa:Gr),Object(x.a)(oe,"".concat(Se,"-rtl"),Yi==="rtl"),oe)),style:We,onClick:Er,onMouseDown:zr},De(K)),h.createElement("div",{className:w()("".concat(Se,"-input"),(ye={},Object(x.a)(ye,"".concat(Se,"-input-active"),be===0),Object(x.a)(ye,"".concat(Se,"-input-placeholder"),!!Mr),ye)),ref:we},h.createElement("input",Object.assign({id:He,disabled:yt[0],readOnly:un||!Wr,value:Mr||yr,onChange:function(tn){Qr(tn.target.value)},autoFocus:Tt,placeholder:_e(ht,0)||"",ref:ie},va,Dr,{autoComplete:ji}))),h.createElement("div",{className:"".concat(Se,"-range-separator"),ref:Y},Yn),h.createElement("div",{className:w()("".concat(Se,"-input"),(Te={},Object(x.a)(Te,"".concat(Se,"-input-active"),be===1),Object(x.a)(Te,"".concat(Se,"-input-placeholder"),!!Ur),Te)),ref:he},h.createElement("input",Object.assign({disabled:yt[1],readOnly:un||!Vr,value:Ur||Rr,onChange:function(tn){Zr(tn.target.value)},placeholder:_e(ht,1)||"",ref:X},lr,Dr,{autoComplete:ji}))),h.createElement("div",{className:"".concat(Se,"-active-bar"),style:Object(O.a)(Object(O.a)({},ca),{},{width:Ir,position:"absolute"})}),vr,hr)))}var ri=function(K){Object(L.a)(ye,K);var oe=Object(W.a)(ye);function ye(){var Te;return Object(te.a)(this,ye),Te=oe.apply(this,arguments),Te.pickerRef=h.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(H.a)(ye,[{key:"render",value:function(){return h.createElement(Qn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),ye}(h.Component),Oi=ri,hi=Qe.b=ln},p5ED:function(zt,Qe,G){"use strict";var te=G("+L6B"),H=G("2/Rp"),L=G("5Dmo"),W=G("3S7+"),x=G("k1fw"),O=G("tJVT"),j=G("q1tI"),h=G.n(j),D=G("vHTk"),w=G.n(D),g=G("yEEn"),m=G("ZW9T"),u=G("1vsH");Qe.a=function(r){var t=r.name,n=r.data,s=r.theme,e=r.type,i=r.filename,o=r.monacoEditor,S=r.className,E=r.style,y=r.close,T=r.onClose,_=r.hasMask,l=Object(j.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),d=Object(O.a)(l,2),a=d[0],c=d[1],v=Object(j.useState)(""),f=Object(O.a)(v,2),b=f[0],I=f[1],R,P=1024*1024,M=10*P,F=Object(j.useRef)();e==="office"&&(R=Object(u.T)(n).filesize,R>M&&(e="other")),i&&(o.filename=i),Object(j.useEffect)(function(){var z,Z,ae=(z=document.cookie)===null||z===void 0||((Z=z.replace(/\s/g,""))===null||Z===void 0)?void 0:Z.split(";");ae==null||ae.map(function(De){var _e=De.split("=");_e[0]==="_educoder_session"&&I(_e[1])})},[]);var A=function(){if(n.startsWith("http")||n.startsWith("/")){B();return}Object(u.z)(i||"educoder",n,i)},B=function(){Object(u.x)(i||t,n)};return console.log("data:",n,"fileanme:",i," name:",t),h.a.createElement("div",{style:Object(x.a)({},E||{}),className:"".concat(_&&w.a.bgBlack," ").concat(e?w.a.wrp:"hide")},y&&h.a.createElement("div",{className:w.a.close,ref:F},h.a.createElement(W.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return F.current}},h.a.createElement("span",{onClick:B},h.a.createElement("i",{className:"icon-quxiaozhiding"}))),h.a.createElement(W.a,{title:"\u5173\u95ED",getPopupContainer:function(){return F.current}},h.a.createElement("span",{className:"",onClick:T},h.a.createElement("i",{className:"icon-guanbi1"})))),h.a.createElement("div",{className:"".concat(w.a[S]," ").concat(S," ").concat(w.a.monaco," ").concat(e==="txt"?"show":"hide")},e==="txt"&&h.a.createElement(m.b,o)),e==="audio"&&h.a.createElement("audio",{src:"".concat(n!=null&&n.startsWith("/")||(n==null?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),e==="video"&&h.a.createElement(h.a.Fragment,null,n!=null&&n.startsWith("/")?h.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):h.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),e==="html"&&h.a.createElement("iframe",{src:n+"&disposition=inline"}),e==="pdf"&&h.a.createElement("embed",{className:w.a.embed,src:n}),e==="image"&&h.a.createElement(h.a.Fragment,null,h.a.createElement("img",{src:"".concat(n!=null&&n.startsWith("/")||(n==null?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),e==="other"&&h.a.createElement("div",null,h.a.createElement(H.a,{type:"primary",size:"large",onClick:A},h.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(e==="download"||e==="office")&&h.a.createElement(H.a,{type:"primary",size:"large",onClick:A},h.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pn8s:function(zt,Qe,G){zt.exports={bg:"bg___1vMR-"}},psGv:function(zt,Qe,G){var te,H;(function(){var L;(function(){"use strict";var j=[,,function(g){function m(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var t=new m(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},m.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},m.prototype.has_match=function(t){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(t))return!0;return!1},m.prototype.set_indent=function(t,n){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(t){this.__items.push(t);var n=t.lastIndexOf(`
|
|
`);n!==-1?this.__character_count=t.length-n:this.__character_count+=t.length},m.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function u(t,n){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),n=n||"",t.indent_level>0&&(n=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}u.prototype.get_indent_size=function(t,n){var s=this.__base_string_length;return n=n||0,t<0&&(s=0),s+=t*this.__indent_size,s+=n,s},u.prototype.get_indent_string=function(t,n){var s=this.__base_string;return n=n||0,t<0&&(t=0,s=""),n+=t*this.__indent_size,this.__ensure_cache(n),s+=this.__cache[n],s},u.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var t=this.__cache.length,n=0,s="";this.__indent_size&&t>=this.__indent_size&&(n=Math.floor(t/this.__indent_size),t-=n*this.__indent_size,s=new Array(n+1).join(this.__indent_string)),t&&(s+=new Array(t+1).join(" ")),this.__cache.push(s)};function r(t,n){this.__indent_cache=new u(t,n),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(t,n){return this.__indent_cache.get_indent_string(t,n)},r.prototype.get_indent_size=function(t,n){return this.__indent_cache.get_indent_size(t,n)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(t){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
|
|
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return t!==`
|
|
`&&(s=s.replace(/[\n]/g,t)),s},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(t,n){return t=t||0,n=n||0,this.next_line.set_indent(t,n),this.__lines.length>1?(this.current_line.set_indent(t,n),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(t){for(var n=0;n<t.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},r.prototype.remove_indent=function(t){for(var n=this.__lines.length;t<n;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(t){for(t=t===void 0?!1:t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(t,n){for(var s=this.__lines.length-2;s>=0;){var e=this.__lines[s];if(e.is_empty())break;if(e.item(0).indexOf(t)!==0&&e.item(-1)!==n){this.__lines.splice(s+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},g.exports.Output=r},function(g){function m(u,r,t,n){this.type=u,this.text=r,this.comments_before=null,this.newlines=t||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=m},,,function(g){function m(t,n){this.raw_options=u(t,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(t,n){var s=this.raw_options[t],e=n||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(e=s.concat()):typeof s=="string"&&(e=s.split(/[^a-zA-Z0-9_\/\-]+/)),e},m.prototype._get_boolean=function(t,n){var s=this.raw_options[t],e=s===void 0?!!n:!!s;return e},m.prototype._get_characters=function(t,n){var s=this.raw_options[t],e=n||"";return typeof s=="string"&&(e=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),e},m.prototype._get_number=function(t,n){var s=this.raw_options[t];n=parseInt(n,10),isNaN(n)&&(n=0);var e=parseInt(s,10);return isNaN(e)&&(e=n),e},m.prototype._get_selection=function(t,n,s){var e=this._get_selection_list(t,n,s);if(e.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values:
|
|
`+n+`
|
|
You passed in: '`+this.raw_options[t]+"'");return e[0]},m.prototype._get_selection_list=function(t,n,s){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[n[0]],!this._is_valid_selection(s,n))throw new Error("Invalid Default Value!");var e=this._get_array(t,s);if(!this._is_valid_selection(e,n))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values:
|
|
`+n+`
|
|
You passed in: '`+this.raw_options[t]+"'");return e},m.prototype._is_valid_selection=function(t,n){return t.length&&n.length&&!t.some(function(s){return n.indexOf(s)===-1})};function u(t,n){var s={};t=r(t);var e;for(e in t)e!==n&&(s[e]=t[e]);if(n&&t[n])for(e in t[n])s[e]=t[n][e];return s}function r(t){var n={},s;for(s in t){var e=s.replace(/-/g,"_");n[e]=t[s]}return n}g.exports.Options=m,g.exports.normalizeOpts=r,g.exports.mergeOpts=u},,function(g){var m=RegExp.prototype.hasOwnProperty("sticky");function u(r){this.__input=r||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__input.charAt(this.__position),this.__position+=1),r},u.prototype.peek=function(r){var t=null;return r=r||0,r+=this.__position,r>=0&&r<this.__input_length&&(t=this.__input.charAt(r)),t},u.prototype.__match=function(r,t){r.lastIndex=t;var n=r.exec(this.__input);return n&&!(m&&r.sticky)&&(n.index!==t&&(n=null)),n},u.prototype.test=function(r,t){return t=t||0,t+=this.__position,t>=0&&t<this.__input_length?!!this.__match(r,t):!1},u.prototype.testChar=function(r,t){var n=this.peek(t);return r.lastIndex=0,n!==null&&r.test(n)},u.prototype.match=function(r){var t=this.__match(r,this.__position);return t?this.__position+=t[0].length:t=null,t},u.prototype.read=function(r,t,n){var s="",e;return r&&(e=this.match(r),e&&(s+=e[0])),t&&(e||!r)&&(s+=this.readUntil(t,n)),s},u.prototype.readUntil=function(r,t){var n="",s=this.__position;r.lastIndex=this.__position;var e=r.exec(this.__input);return e?(s=e.index,t&&(s+=e[0].length)):s=this.__input_length,n=this.__input.substring(this.__position,s),this.__position=s,n},u.prototype.readUntilAfter=function(r){return this.readUntil(r,!0)},u.prototype.get_regexp=function(r,t){var n=null,s="g";return t&&m&&(s="y"),typeof r=="string"&&r!==""?n=new RegExp(r,s):r&&(n=new RegExp(r.source,s)),n},u.prototype.get_literal_regexp=function(r){return RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(r){var t=this.__position,n=this.readUntilAfter(r);return this.__position=t,n},u.prototype.lookBack=function(r){var t=this.__position-1;return t>=r.length&&this.__input.substring(t-r.length,t).toLowerCase()===r},g.exports.InputScanner=u},function(g,m,u){var r=u(8).InputScanner,t=u(3).Token,n=u(10).TokenStream,s=u(11).WhitespacePattern,e={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(o,S){this._input=new r(o),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var o,S=new t(e.START,""),E=null,y=[],T=new n;S.type!==e.EOF;){for(o=this._get_next_token(S,E);this._is_comment(o);)T.add(o),o=this._get_next_token(S,E);T.isEmpty()||(o.comments_before=T,T=new n),o.parent=E,this._is_opening(o)?(y.push(E),E=o):E&&this._is_closing(o,E)&&(o.opened=E,E.closed=o,E=y.pop(),o.parent=E),o.previous=S,S.next=o,this.__tokens.add(o),S=o}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(o,S){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(e.RAW,E):this._create_token(e.EOF,"")},i.prototype._is_comment=function(o){return!1},i.prototype._is_opening=function(o){return!1},i.prototype._is_closing=function(o,S){return!1},i.prototype._create_token=function(o,S){var E=new t(o,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=i,g.exports.TOKEN=e},function(g){function m(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},m.prototype.peek=function(u){var r=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(r=this.__tokens[u]),r},m.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},g.exports.TokenStream=m},function(g,m,u){var r=u(12).Pattern;function t(n,s){r.call(this,n,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}t.prototype=new r,t.prototype.__set_whitespace_patterns=function(n,s){n+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+n+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var n=this._input.read(this._match_pattern);if(n===" ")this.whitespace_before_token=" ";else if(n){var s=this.__split(this._newline_regexp,n);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return n},t.prototype.matching=function(n,s){var e=this._create();return e.__set_whitespace_patterns(n,s),e._update(),e},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(n,s){n.lastIndex=0;for(var e=0,i=[],o=n.exec(s);o;)i.push(s.substring(e,o.index)),e=o.index+o[0].length,o=n.exec(s);return e<s.length?i.push(s.substring(e,s.length)):i.push(""),i},g.exports.WhitespacePattern=t},function(g){function m(u,r){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,r&&(this._starting_pattern=this._input.get_regexp(r._starting_pattern,!0),this._match_pattern=this._input.get_regexp(r._match_pattern,!0),this._until_pattern=this._input.get_regexp(r._until_pattern),this._until_after=r._until_after)}m.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(u){var r=this._create();return r._until_after=!0,r._until_pattern=this._input.get_regexp(u),r._update(),r},m.prototype.until=function(u){var r=this._create();return r._until_after=!1,r._until_pattern=this._input.get_regexp(u),r._update(),r},m.prototype.starting_with=function(u){var r=this._create();return r._starting_pattern=this._input.get_regexp(u,!0),r._update(),r},m.prototype.matching=function(u){var r=this._create();return r._match_pattern=this._input.get_regexp(u,!0),r._update(),r},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},g.exports.Pattern=m},function(g){function m(u,r){u=typeof u=="string"?u:u.source,r=typeof r=="string"?r:r.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+r,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+r,"g")}m.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var r={};this.__directive_pattern.lastIndex=0;for(var t=this.__directive_pattern.exec(u);t;)r[t[1]]=t[2],t=this.__directive_pattern.exec(u);return r},m.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=m},function(g,m,u){var r=u(12).Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function n(s,e){r.call(this,s,e),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new r(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}n.prototype=new r,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(s){var e=this._create();return e._disabled[s]=!0,e._update(),e},n.prototype.read_options=function(s){var e=this._create();for(var i in t)e._disabled[i]=s.templating.indexOf(i)===-1;return e._update(),e},n.prototype.exclude=function(s){var e=this._create();return e._excluded[s]=!0,e._update(),e},n.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),s+=e,e=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},n.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},n.prototype._read_template=function(){var s="",e=this._input.peek();if(e==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},g.exports.TemplatablePattern=n},,,,function(g,m,u){var r=u(19).Beautifier,t=u(20).Options;function n(s,e,i,o){var S=new r(s,e,i,o);return S.beautify()}g.exports=n,g.exports.defaultOptions=function(){return new t}},function(g,m,u){var r=u(20).Options,t=u(2).Output,n=u(21).Tokenizer,s=u(21).TOKEN,e=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=function(v,f){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=v.max_preserve_newlines,this.preserve_newlines=v.preserve_newlines,this._output=new t(v,f)};o.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},o.prototype.set_space_before_token=function(v,f){this._output.space_before_token=v,this._output.non_breaking_space=f},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(v){this._output.add_raw_token(v)},o.prototype.print_preserved_newlines=function(v){var f=0;v.type!==s.TEXT&&v.previous.type!==s.TEXT&&(f=v.newlines?1:0),this.preserve_newlines&&(f=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var b=0;b<f;b++)this.print_newline(b>0);return f!==0},o.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(v){this._output.add_new_line(v)},o.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(v){return v=this.indent_level+(v||0),v<1?"":this._output.get_indent_string(v)};var S=function(v){for(var f=null,b=v.next;b.type!==s.EOF&&v.closed!==b;){if(b.type===s.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===s.EQUALS&&b.next.next&&b.next.next.type===s.VALUE&&(f=b.next.next.text);break}b=b.next}return f},E=function(v,f){var b=null,I=null;return f.closed?(v==="script"?b="text/javascript":v==="style"&&(b="text/css"),b=S(f)||b,b.search("text/css")>-1?I="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?I="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?I="html":b.search(/test\/null/)>-1&&(I="null"),I):null};function y(v,f){return f.indexOf(v)!==-1}function T(v,f,b){this.parent=v||null,this.tag=f?f.tag_name:"",this.indent_level=b||0,this.parser_token=f||null}function _(v){this._printer=v,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(v){var f=new T(this._current_frame,v,this._printer.indent_level);this._current_frame=f},_.prototype._try_pop_frame=function(v){var f=null;return v&&(f=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),f},_.prototype._get_frame=function(v,f){for(var b=this._current_frame;b&&!(v.indexOf(b.tag)!==-1);){if(f&&f.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},_.prototype.try_pop=function(v,f){var b=this._get_frame([v],f);return this._try_pop_frame(b)},_.prototype.indent_to_tag=function(v){var f=this._get_frame(v);f&&(this._printer.indent_level=f.indent_level)};function l(v,f,b,I){this._source_text=v||"",f=f||{},this._js_beautify=b,this._css_beautify=I,this._tag_stack=null;var R=new r(f,"html");this._options=R,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}l.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,f=this._options.eol;this._options.eol==="auto"&&(f=`
|
|
`,v&&e.test(v)&&(f=v.match(e)[0])),v=v.replace(i,`
|
|
`);var b=v.match(/^[\t ]*/)[0],I={text:"",type:""},R=new d,P=new o(this._options,b),M=new n(v,this._options).tokenize();this._tag_stack=new _(P);for(var F=null,A=M.next();A.type!==s.EOF;)A.type===s.TAG_OPEN||A.type===s.COMMENT?(F=this._handle_tag_open(P,A,R,I),R=F):A.type===s.ATTRIBUTE||A.type===s.EQUALS||A.type===s.VALUE||A.type===s.TEXT&&!R.tag_complete?F=this._handle_inside_tag(P,A,R,M):A.type===s.TAG_CLOSE?F=this._handle_tag_close(P,A,R):A.type===s.TEXT?F=this._handle_text(P,A,R):P.add_raw_token(A),I=F,A=M.next();var B=P._output.get_code(f);return B},l.prototype._handle_tag_close=function(v,f,b){var I={text:f.text,type:f.type};return v.alignment_size=0,b.tag_complete=!0,v.set_space_before_token(f.newlines||f.whitespace_before!=="",!0),b.is_unformatted?v.add_raw_token(f):(b.tag_start_char==="<"&&(v.set_space_before_token(f.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(f)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(v.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&v.set_wrap_point(),I},l.prototype._handle_inside_tag=function(v,f,b,I){var R=b.has_wrapped_attrs,P={text:f.text,type:f.type};if(v.set_space_before_token(f.newlines||f.whitespace_before!=="",!0),b.is_unformatted)v.add_raw_token(f);else if(b.tag_start_char==="{"&&f.type===s.TEXT)v.print_preserved_newlines(f)?(f.newlines=0,v.add_raw_token(f)):v.print_token(f);else{if(f.type===s.ATTRIBUTE?(v.set_space_before_token(!0),b.attr_count+=1):(f.type===s.EQUALS||f.type===s.VALUE&&f.previous.type===s.EQUALS)&&v.set_space_before_token(!1),f.type===s.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(f),R=R||f.newlines!==0),this._is_wrap_attributes_force)){var M=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var F=!0,A=0,B;do{if(B=I.peek(A),B.type===s.ATTRIBUTE){F=!1;break}A+=1}while(A<4&&B.type!==s.EOF&&B.type!==s.TAG_CLOSE);M=!F}M&&(v.print_newline(!1),R=!0)}v.print_token(f),R=R||v.previous_token_wrapped(),b.has_wrapped_attrs=R}return P},l.prototype._handle_text=function(v,f,b){var I={text:f.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(v,f,b):b.is_unformatted||b.is_content_unformatted?v.add_raw_token(f):(v.traverse_whitespace(f),v.print_token(f)),I},l.prototype._print_custom_beatifier_text=function(v,f,b){var I=this;if(f.text!==""){var R=f.text,P,M=1,F="",A="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?P=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?P=this._css_beautify:b.custom_beautifier_name==="html"&&(P=function(_e,Oe){var Ne=new l(_e,Oe,I._js_beautify,I._css_beautify);return Ne.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-v.indent_level);var B=v.get_full_indent(M);if(R=R.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&R[0]==="<"&&R.match(/^(<!--|<!\[CDATA\[)/)){var z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(R);if(!z){v.add_raw_token(f);return}F=B+z[1]+`
|
|
`,R=z[4],z[5]&&(A=B+z[5]),R=R.replace(/\n[ \t]*$/,""),(z[2]||z[3].indexOf(`
|
|
`)!==-1)&&(z=z[3].match(/[ \t]+$/),z&&(f.whitespace_before=z[0]))}if(R)if(P){var Z=function(){this.eol=`
|
|
`};Z.prototype=this._options.raw_options;var ae=new Z;R=P(B+R,ae)}else{var De=f.whitespace_before;De&&(R=R.replace(new RegExp(`
|
|
(`+De+")?","g"),`
|
|
`)),R=B+R.replace(/\n/g,`
|
|
`+B)}F&&(R?R=F+R+`
|
|
`+A:R=F+A),v.print_newline(!1),R&&(f.text=R,f.whitespace_before="",f.newlines=0,v.add_raw_token(f),v.print_newline(!0))}},l.prototype._handle_tag_open=function(v,f,b,I){var R=this._get_tag_open_token(f);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&f.type===s.TAG_OPEN&&f.text.indexOf("</")===0?(v.add_raw_token(f),R.start_tag_token=this._tag_stack.try_pop(R.tag_name)):(v.traverse_whitespace(f),this._set_tag_position(v,f,R,b,I),R.is_inline_element||v.set_wrap_point(),v.print_token(f)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(R.alignment_size=f.text.length+1),!R.tag_complete&&!R.is_unformatted&&(v.alignment_size=R.alignment_size),R};var d=function(v,f){if(this.parent=v||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!f)this.tag_complete=!0;else{var b;this.tag_start_char=f.text[0],this.text=f.text,this.tag_start_char==="<"?(b=f.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=f.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(f.text.startsWith("{{#>")||f.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&f.next!==null?this.tag_check=f.next.text.split(" ")[0]:this.tag_check=f.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),f.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||f.closed&&f.closed.text==="/>";var I=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(I=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(I)))}};l.prototype._get_tag_open_token=function(v){var f=new d(this._tag_stack.get_parser_token(),v);return f.alignment_size=this._options.wrap_attributes_indent_size,f.is_end_tag=f.is_end_tag||y(f.tag_check,this._options.void_elements),f.is_empty_element=f.tag_complete||f.is_start_tag&&f.is_end_tag,f.is_unformatted=!f.tag_complete&&y(f.tag_check,this._options.unformatted),f.is_content_unformatted=!f.is_empty_element&&y(f.tag_check,this._options.content_unformatted),f.is_inline_element=y(f.tag_name,this._options.inline)||f.tag_name.includes("-")||f.tag_start_char==="{",f},l.prototype._set_tag_position=function(v,f,b,I,R){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=E(b.tag_check,f)))),y(b.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var P=v.current_line_has_match(/{{#if/);P||v.print_newline(!1)}b.tag_name==="!--"&&R.type===s.TAG_CLOSE&&I.is_end_tag&&b.text.indexOf(`
|
|
`)===-1||(b.is_inline_element||b.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,b))}else if(b.is_end_tag){var M=!1;M=b.start_tag_token&&b.start_tag_token.multiline_content,M=M||!b.is_inline_element&&!(I.is_inline_element||I.is_unformatted)&&!(R.type===s.TAG_CLOSE&&b.start_tag_token===I)&&R.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(M=!1),M&&v.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(R.type!=="TK_CONTENT"||b.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,b)},l.prototype._calcluate_parent_multiline=function(v,f){f.parent&&v._output.just_added_newline()&&!((f.is_inline_element||f.is_unformatted)&&f.parent.is_inline_element)&&(f.parent.multiline_content=!0)};var a=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];l.prototype._do_optional_end_element=function(v){var f=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")f=f||this._tag_stack.try_pop("head");else if(v.tag_name==="li")f=f||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")f=f||this._tag_stack.try_pop("dt",["dl"]),f=f||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&a.indexOf(v.tag_name)!==-1){var b=v.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(f=f||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(f=f||this._tag_stack.try_pop("rt",["ruby","rtc"]),f=f||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?f=f||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?f=f||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?f=f||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(f=f||this._tag_stack.try_pop("caption",["table"]),f=f||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.tag_name==="tfoot"?(f=f||this._tag_stack.try_pop("caption",["table"]),f=f||this._tag_stack.try_pop("colgroup",["table"]),f=f||this._tag_stack.try_pop("thead",["table"]),f=f||this._tag_stack.try_pop("tbody",["table"])):v.tag_name==="tr"?(f=f||this._tag_stack.try_pop("caption",["table"]),f=f||this._tag_stack.try_pop("colgroup",["table"]),f=f||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(v.tag_name==="th"||v.tag_name==="td")&&(f=f||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),f=f||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return v.parent=this._tag_stack.get_parser_token(),f},g.exports.Beautifier=l},function(g,m,u){var r=u(6).Options;function t(n){r.call(this,n,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}t.prototype=new r,g.exports.Options=t},function(g,m,u){var r=u(9).Tokenizer,t=u(9).TOKEN,n=u(13).Directives,s=u(14).TemplatablePattern,e=u(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},o=new n(/<\!--/,/-->/),S=function(E,y){r.call(this,E,y),this._current_tag_name="";var T=new s(this._input).read_options(this._options),_=new e(this._input);if(this.__patterns={word:T.until(/[\n\r\t <]/),single_quote:T.until_after(/'/),double_quote:T.until_after(/"/),attribute:T.until(/[\n\r\t =>]|\/>/),element_name:T.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(l).until_after(l)}};S.prototype=new r,S.prototype._is_comment=function(E){return!1},S.prototype._is_opening=function(E){return E.type===i.TAG_OPEN},S.prototype._is_closing=function(E,y){return E.type===i.TAG_CLOSE&&y&&((E.text===">"||E.text==="/>")&&y.text[0]==="<"||E.text==="}}"&&y.text[0]==="{"&&y.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(E,y){var T=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(i.EOF,""):(T=T||this._read_open_handlebars(_,y),T=T||this._read_attribute(_,E,y),T=T||this._read_close(_,y),T=T||this._read_raw_content(_,E,y),T=T||this._read_content_word(_),T=T||this._read_comment_or_cdata(_),T=T||this._read_processing(_),T=T||this._read_open(_,y),T=T||this._create_token(i.UNKNOWN,this._input.next()),T)},S.prototype._read_comment_or_cdata=function(E){var y=null,T=null,_=null;if(E==="<"){var l=this._input.peek(1);l==="!"&&(T=this.__patterns.comment.read(),T?(_=o.get_directives(T),_&&_.ignore==="start"&&(T+=o.readIgnored(this._input))):T=this.__patterns.cdata.read()),T&&(y=this._create_token(i.COMMENT,T),y.directives=_)}return y},S.prototype._read_processing=function(E){var y=null,T=null,_=null;if(E==="<"){var l=this._input.peek(1);(l==="!"||l==="?")&&(T=this.__patterns.conditional_comment.read(),T=T||this.__patterns.processing.read()),T&&(y=this._create_token(i.COMMENT,T),y.directives=_)}return y},S.prototype._read_open=function(E,y){var T=null,_=null;return y||E==="<"&&(T=this._input.next(),this._input.peek()==="/"&&(T+=this._input.next()),T+=this.__patterns.element_name.read(),_=this._create_token(i.TAG_OPEN,T)),_},S.prototype._read_open_handlebars=function(E,y){var T=null,_=null;return y||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(T=this.__patterns.handlebars_comment.read(),T=T||this.__patterns.handlebars.read(),_=this._create_token(i.COMMENT,T)):(T=this.__patterns.handlebars_open.read(),_=this._create_token(i.TAG_OPEN,T))),_},S.prototype._read_close=function(E,y){var T=null,_=null;return y&&(y.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(T=this._input.next(),E==="/"&&(T+=this._input.next()),_=this._create_token(i.TAG_CLOSE,T)):y.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(i.TAG_CLOSE,"}}"))),_},S.prototype._read_attribute=function(E,y,T){var _=null,l="";if(T&&T.text[0]==="<")if(E==="=")_=this._create_token(i.EQUALS,this._input.next());else if(E==='"'||E==="'"){var d=this._input.next();E==='"'?d+=this.__patterns.double_quote.read():d+=this.__patterns.single_quote.read(),_=this._create_token(i.VALUE,d)}else l=this.__patterns.attribute.read(),l&&(y.type===i.EQUALS?_=this._create_token(i.VALUE,l):_=this._create_token(i.ATTRIBUTE,l));return _},S.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},S.prototype._read_raw_content=function(E,y,T){var _="";if(T&&T.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(y.type===i.TAG_CLOSE&&y.opened.text[0]==="<"&&y.text[0]!=="/"){var l=y.opened.text.substr(1).toLowerCase();if(l==="script"||l==="style"){var d=this._read_comment_or_cdata(E);if(d)return d.type=i.TEXT,d;_=this._input.readUntil(new RegExp("</"+l+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(l)&&(_=this._input.readUntil(new RegExp("</"+l+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(i.TEXT,_):null},S.prototype._read_content_word=function(E){var y="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(y=this.__patterns.unformatted_content_delimiter.read())),y||(y=this.__patterns.word.read()),y)return this._create_token(i.TEXT,y)},g.exports.Tokenizer=S,g.exports.TOKEN=i}],h={};function D(g){var m=h[g];if(m!==void 0)return m.exports;var u=h[g]={exports:{}};return j[g](u,u.exports,D),u.exports}var w=D(18);L=w})();var W=L;if(!0)!(te=[G,G("6UM0"),G("TXwP")],H=function(j){var h=G("6UM0"),D=G("TXwP");return{html_beautify:function(w,g){return W(w,g,h.js_beautify,D.css_beautify)}}}.apply(Qe,te),H!==void 0&&(zt.exports=H));else var x,O})()},"rAM+":function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return H});var te=G("Qw5x");function H(L,W){var x;if(typeof Symbol=="undefined"||L[Symbol.iterator]==null){if(Array.isArray(L)||(x=Object(te.a)(L))||W&&L&&typeof L.length=="number"){x&&(L=x);var O=0,j=function(){};return{s:j,n:function(){return O>=L.length?{done:!0}:{done:!1,value:L[O++]}},e:function(m){throw m},f:j}}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 h=!0,D=!1,w;return{s:function(){x=L[Symbol.iterator]()},n:function(){var m=x.next();return h=m.done,m},e:function(m){D=!0,w=m},f:function(){try{!h&&x.return!=null&&x.return()}finally{if(D)throw w}}}}},rUJ1:function(zt,Qe){const G=/[&<>"']/,te=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,W={"&":"&","<":"<",">":">",'"':""","'":"'"},x=_=>W[_];function O(_,l){if(l){if(G.test(_))return _.replace(te,x)}else if(H.test(_))return _.replace(L,x);return _}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function h(_){return _.replace(j,(l,d)=>(d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""))}const D=/(^|[^\[])\^/g;function w(_,l){_=_.source||_,l=l||"";const d={replace:(a,c)=>(c=c.source||c,c=c.replace(D,"$1"),_=_.replace(a,c),d),getRegex:()=>new RegExp(_,l)};return d}const g=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(_,l,d){if(_){let a;try{a=decodeURIComponent(h(d)).replace(g,"").toLowerCase()}catch(c){return null}if(a.indexOf("javascript:")===0||a.indexOf("vbscript:")===0||a.indexOf("data:")===0)return null}l&&!m.test(d)&&(d=e(l,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch(a){return null}return d}const r={},t=/^[^:]+:\/*[^/]*$/,n=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(_,l){r[" "+_]||(t.test(_)?r[" "+_]=_+"/":r[" "+_]=E(_,"/",!0)),_=r[" "+_];const d=_.indexOf(":")===-1;return l.substring(0,2)==="//"?d?l:_.replace(n,"$1")+l:l.charAt(0)==="/"?d?l:_.replace(s,"$1")+l:_+l}const i={exec:function(){}};function o(_){let l=1,d,a;for(;l<arguments.length;l++){d=arguments[l];for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&(_[a]=d[a])}return _}function S(_,l){const d=_.replace(/\|/g,(v,f,b)=>{let I=!1,R=f;for(;--R>=0&&b[R]==="\\";)I=!I;return I?"|":" |"}),a=d.split(/ \|/);let c=0;if(a.length>l)a.splice(l);else for(;a.length<l;)a.push("");for(;c<a.length;c++)a[c]=a[c].trim().replace(/\\\|/g,"|");return a}function E(_,l,d){const a=_.length;if(a===0)return"";let c=0;for(;c<a;){const v=_.charAt(a-c-1);if(v===l&&!d)c++;else if(v!==l&&d)c++;else break}return _.substr(0,a-c)}function y(_,l){if(_.indexOf(l[1])===-1)return-1;const d=_.length;let a=0,c=0;for(;c<d;c++)if(_[c]==="\\")c++;else if(_[c]===l[0])a++;else if(_[c]===l[1]&&(a--,a<0))return c;return-1}function T(_){_&&_.sanitize&&!_.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")}zt.exports={escape:O,unescape:h,edit:w,cleanUrl:u,resolveUrl:e,noopTest:i,merge:o,splitCells:S,rtrim:E,findClosingBracket:y,checkSanitizeDeprecation:T}},sR1s:function(zt,Qe,G){"use strict";G.d(Qe,"b",function(){return W}),G.d(Qe,"a",function(){return x}),G.d(Qe,"c",function(){return O}),G.d(Qe,"d",function(){return j});var te=G("U8pU"),H="RC_TABLE_KEY";function L(h){return h==null?[]:Array.isArray(h)?h:[h]}function W(h,D){if(!D&&typeof D!="number")return h;for(var w=L(D),g=h,m=0;m<w.length;m+=1){if(!g)return null;var u=w[m];g=g[u]}return g}function x(h){var D=[],w={};return h.forEach(function(g){for(var m=g||{},u=m.key,r=m.dataIndex,t=u||L(r).join("-")||H;w[t];)t="".concat(t,"_next");w[t]=!0,D.push(t)}),D}function O(){var h={};function D(u,r){r&&Object.keys(r).forEach(function(t){var n=r[t];n&&Object(te.a)(n)==="object"?(u[t]=u[t]||{},D(u[t],n)):u[t]=n})}for(var w=arguments.length,g=new Array(w),m=0;m<w;m++)g[m]=arguments[m];return g.forEach(function(u){D(h,u)}),h}function j(h){return h!=null}},sboe:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return L});var te=G("q1tI"),H=G.n(te),L=te.createContext(null)},scVo:function(zt,Qe,G){zt.exports={flex_box_center:"flex_box_center___1RD4e",flex_space_between:"flex_space_between___2iitv",flex_box_vertical_center:"flex_box_vertical_center___30qk9",flex_box_center_end:"flex_box_center_end___3pQI1",flex_box_column:"flex_box_column___3gjp3",title:"title___1MTNS",export:"export___2n8xQ",bg:"bg___1eqGf",tabs:"tabs___1o1hM"}},t23M:function(zt,Qe,G){"use strict";var te=G("VTBJ"),H=G("1OyB"),L=G("vuIU"),W=G("Ji7U"),x=G("LK+K"),O=G("q1tI"),j=G.n(O),h=G("m+aA"),D=G("Zm9Q"),w=G("Kwbf"),g=G("c+Xe"),m=G("bdgK"),u="rc-observer-key",r=function(t){Object(W.a)(s,t);var n=Object(x.a)(s);function s(){var e;return Object(H.a)(this,s),e=n.apply(this,arguments),e.resizeObserver=null,e.childNode=null,e.currentElement=null,e.state={width:0,height:0,offsetHeight:0,offsetWidth:0},e.onResize=function(i){var o=e.props.onResize,S=i[0].target,E=S.getBoundingClientRect(),y=E.width,T=E.height,_=S.offsetWidth,l=S.offsetHeight,d=Math.floor(y),a=Math.floor(T);if(e.state.width!==d||e.state.height!==a||e.state.offsetWidth!==_||e.state.offsetHeight!==l){var c={width:d,height:a,offsetWidth:_,offsetHeight:l};e.setState(c),o&&Promise.resolve().then(function(){o(Object(te.a)(Object(te.a)({},c),{},{offsetWidth:_,offsetHeight:l}))})}},e.setChildNode=function(i){e.childNode=i},e}return Object(L.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var o=Object(h.a)(this.childNode||this),S=o!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,o=Object(D.a)(i);if(o.length>1)Object(w.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(w.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=o[0];if(O.isValidElement(S)&&Object(g.c)(S)){var E=S.ref;o[0]=O.cloneElement(S,{ref:Object(g.a)(E,this.setChildNode)})}return o.length===1?o[0]:o.map(function(y,T){return!O.isValidElement(y)||"key"in y&&y.key!==null?y:O.cloneElement(y,{key:"".concat(u,"-").concat(T)})})}}]),s}(O.Component);r.displayName="ResizeObserver",Qe.a=r},ulZh:function(zt,Qe,G){typeof window!="undefined"&&function(H,L){zt.exports=L()}(this,function(){return function(te){var H={};function L(W){if(H[W])return H[W].exports;var x=H[W]={i:W,l:!1,exports:{}};return te[W].call(x.exports,x,x.exports,L),x.l=!0,x.exports}return L.m=te,L.c=H,L.d=function(W,x,O){L.o(W,x)||Object.defineProperty(W,x,{enumerable:!0,get:O})},L.r=function(W){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(W,"__esModule",{value:!0})},L.t=function(W,x){if(x&1&&(W=L(W)),x&8)return W;if(x&4&&typeof W=="object"&&W&&W.__esModule)return W;var O=Object.create(null);if(L.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:W}),x&2&&typeof W!="string")for(var j in W)L.d(O,j,function(h){return W[h]}.bind(null,j));return O},L.n=function(W){var x=W&&W.__esModule?function(){return W.default}:function(){return W};return L.d(x,"a",x),x},L.o=function(W,x){return Object.prototype.hasOwnProperty.call(W,x)},L.p="/dist/",L(L.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,H,L){"use strict";var W=Object.prototype.hasOwnProperty,x="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(x=!1));function j(g,m,u){this.fn=g,this.context=m,this.once=u||!1}function h(g,m,u,r,t){if(typeof u!="function")throw new TypeError("The listener must be a function");var n=new j(u,r||g,t),s=x?x+m:m;return g._events[s]?g._events[s].fn?g._events[s]=[g._events[s],n]:g._events[s].push(n):(g._events[s]=n,g._eventsCount++),g}function D(g,m){--g._eventsCount===0?g._events=new O:delete g._events[m]}function w(){this._events=new O,this._eventsCount=0}w.prototype.eventNames=function(){var m=[],u,r;if(this._eventsCount===0)return m;for(r in u=this._events)W.call(u,r)&&m.push(x?r.slice(1):r);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(u)):m},w.prototype.listeners=function(m){var u=x?x+m:m,r=this._events[u];if(!r)return[];if(r.fn)return[r.fn];for(var t=0,n=r.length,s=new Array(n);t<n;t++)s[t]=r[t].fn;return s},w.prototype.listenerCount=function(m){var u=x?x+m:m,r=this._events[u];return r?r.fn?1:r.length:0},w.prototype.emit=function(m,u,r,t,n,s){var e=x?x+m:m;if(!this._events[e])return!1;var i=this._events[e],o=arguments.length,S,E;if(i.fn){i.once&&this.removeListener(m,i.fn,void 0,!0);switch(o){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,u),!0;case 3:return i.fn.call(i.context,u,r),!0;case 4:return i.fn.call(i.context,u,r,t),!0;case 5:return i.fn.call(i.context,u,r,t,n),!0;case 6:return i.fn.call(i.context,u,r,t,n,s),!0}for(E=1,S=new Array(o-1);E<o;E++)S[E-1]=arguments[E];i.fn.apply(i.context,S)}else{var y=i.length,T;for(E=0;E<y;E++){i[E].once&&this.removeListener(m,i[E].fn,void 0,!0);switch(o){case 1:i[E].fn.call(i[E].context);break;case 2:i[E].fn.call(i[E].context,u);break;case 3:i[E].fn.call(i[E].context,u,r);break;case 4:i[E].fn.call(i[E].context,u,r,t);break;default:if(!S)for(T=1,S=new Array(o-1);T<o;T++)S[T-1]=arguments[T];i[E].fn.apply(i[E].context,S)}}}return!0},w.prototype.on=function(m,u,r){return h(this,m,u,r,!1)},w.prototype.once=function(m,u,r){return h(this,m,u,r,!0)},w.prototype.removeListener=function(m,u,r,t){var n=x?x+m:m;if(!this._events[n])return this;if(!u)return D(this,n),this;var s=this._events[n];if(s.fn)s.fn===u&&(!t||s.once)&&(!r||s.context===r)&&D(this,n);else{for(var e=0,i=[],o=s.length;e<o;e++)(s[e].fn!==u||t&&!s[e].once||r&&s[e].context!==r)&&i.push(s[e]);i.length?this._events[n]=i.length===1?i[0]:i:D(this,n)}return this},w.prototype.removeAllListeners=function(m){var u;return m?(u=x?x+m:m,this._events[u]&&D(this,u)):(this._events=new O,this._eventsCount=0),this},w.prototype.off=w.prototype.removeListener,w.prototype.addListener=w.prototype.on,w.prefixed=x,w.EventEmitter=w,te.exports=w},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,H,L){(function(W){var x=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,h=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,D={buildAbsoluteURL:function(w,g,m){if(m=m||{},w=w.trim(),g=g.trim(),!g){if(!m.alwaysNormalize)return w;var u=D.parseURL(w);if(!u)throw new Error("Error trying to parse base URL.");return u.path=D.normalizePath(u.path),D.buildURLFromParts(u)}var r=D.parseURL(g);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return m.alwaysNormalize?(r.path=D.normalizePath(r.path),D.buildURLFromParts(r)):g;var t=D.parseURL(w);if(!t)throw new Error("Error trying to parse base URL.");if(!t.netLoc&&t.path&&t.path[0]!=="/"){var n=O.exec(t.path);t.netLoc=n[1],t.path=n[2]}t.netLoc&&!t.path&&(t.path="/");var s={scheme:t.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(s.netLoc=t.netLoc,r.path[0]!=="/"))if(!r.path)s.path=t.path,r.params||(s.params=t.params,r.query||(s.query=t.query));else{var e=t.path,i=e.substring(0,e.lastIndexOf("/")+1)+r.path;s.path=D.normalizePath(i)}return s.path===null&&(s.path=m.alwaysNormalize?D.normalizePath(r.path):r.path),D.buildURLFromParts(s)},parseURL:function(w){var g=x.exec(w);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(w){for(w=w.split("").reverse().join("").replace(j,"");w.length!==(w=w.replace(h,"")).length;);return w.split("").reverse().join("")},buildURLFromParts:function(w){return w.scheme+w.netLoc+w.path+w.params+w.query+w.fragment}};te.exports=D})(this)},"./node_modules/webworkify-webpack/index.js":function(te,H,L){function W(m){var u={};function r(n){if(u[n])return u[n].exports;var s=u[n]={i:n,l:!1,exports:{}};return m[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=m,r.c=u,r.i=function(n){return n},r.d=function(n,s,e){r.o(n,s)||Object.defineProperty(n,s,{configurable:!1,enumerable:!0,get:e})},r.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},r.n=function(n){var s=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(s,"a",s),s},r.o=function(n,s){return Object.prototype.hasOwnProperty.call(n,s)},r.p="/",r.oe=function(n){throw console.error(n),n};var t=r(r.s=ENTRY_MODULE);return t.default||t}var x="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+x+").*?\\)";function j(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function h(m){return!isNaN(1*m)}function D(m,u,r){var t={};t[r]=[];var n=u.toString(),s=n.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return t;for(var e=s[1],i=new RegExp("(\\\\n|\\W)"+j(e)+O,"g"),o;o=i.exec(n);){if(o[3]==="dll-reference")continue;t[r].push(o[3])}for(i=new RegExp("\\("+j(e)+'\\("(dll-reference\\s('+x+'))"\\)\\)'+O,"g");o=i.exec(n);)m[o[2]]||(t[r].push(o[1]),m[o[2]]=L(o[1]).m),t[o[2]]=t[o[2]]||[],t[o[2]].push(o[4]);for(var S=Object.keys(t),E=0;E<S.length;E++)for(var y=0;y<t[S[E]].length;y++)h(t[S[E]][y])&&(t[S[E]][y]=1*t[S[E]][y]);return t}function w(m){var u=Object.keys(m);return u.reduce(function(r,t){return r||m[t].length>0},!1)}function g(m,u){for(var r={main:[u]},t={main:[]},n={main:{}};w(r);)for(var s=Object.keys(r),e=0;e<s.length;e++){var i=s[e],o=r[i],S=o.pop();if(n[i]=n[i]||{},n[i][S]||!m[i][S])continue;n[i][S]=!0,t[i]=t[i]||[],t[i].push(S);for(var E=D(m,m[i][S],i),y=Object.keys(E),T=0;T<y.length;T++)r[y[T]]=r[y[T]]||[],r[y[T]]=r[y[T]].concat(E[y[T]])}return t}te.exports=function(m,u){u=u||{};var r={main:L.m},t=u.all?{main:Object.keys(r.main)}:g(r,m),n="";Object.keys(t).filter(function(S){return S!=="main"}).forEach(function(S){for(var E=0;t[S][E];)E++;t[S].push(E),r[S][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",n=n+"var "+S+" = ("+W.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+t[S].map(function(y){return""+JSON.stringify(y)+": "+r[S][y].toString()}).join(",")+`});
|
|
`}),n=n+"new (("+W.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+t.main.map(function(S){return""+JSON.stringify(S)+": "+r.main[S].toString()}).join(",")+"}))(self);";var s=new window.Blob([n],{type:"text/javascript"});if(u.bare)return s;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,i=e.createObjectURL(s),o=new window.Worker(i);return o.objectURL=i,o}},"./src/config.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"hlsDefaultConfig",function(){return T}),L.d(H,"mergeConfig",function(){return l}),L.d(H,"enableStreamingMode",function(){return d});var W=L("./src/controller/abr-controller.ts"),x=L("./src/controller/audio-stream-controller.ts"),O=L("./src/controller/audio-track-controller.ts"),j=L("./src/controller/subtitle-stream-controller.ts"),h=L("./src/controller/subtitle-track-controller.ts"),D=L("./src/controller/buffer-controller.ts"),w=L("./src/controller/timeline-controller.ts"),g=L("./src/controller/cap-level-controller.ts"),m=L("./src/controller/fps-controller.ts"),u=L("./src/controller/eme-controller.ts"),r=L("./src/controller/cmcd-controller.ts"),t=L("./src/utils/xhr-loader.ts"),n=L("./src/utils/fetch-loader.ts"),s=L("./src/utils/cues.ts"),e=L("./src/utils/mediakeys-helper.ts"),i=L("./src/utils/logger.ts");function o(){return o=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var v=arguments[c];for(var f in v)Object.prototype.hasOwnProperty.call(v,f)&&(a[f]=v[f])}return a},o.apply(this,arguments)}function S(a,c){var v=Object.keys(a);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);c&&(f=f.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),v.push.apply(v,f)}return v}function E(a){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?S(Object(v),!0).forEach(function(f){y(a,f,v[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(v)):S(Object(v)).forEach(function(f){Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(v,f))})}return a}function y(a,c,v){return c in a?Object.defineProperty(a,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):a[c]=v,a}var T=E(E({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:t.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:W.default,bufferController:D.default,capLevelController:g.default,fpsController:m.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:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:j.SubtitleStreamController,subtitleTrackController:h.default,timelineController:w.TimelineController,audioStreamController:x.default,audioTrackController:O.default,emeController:u.default,cmcdController:r.default});function _(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function l(a,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},a,c)}function d(a){var c=a.loader;if(c!==n.default&&c!==t.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1;else{var v=Object(n.fetchSupported)();v&&(a.loader=n.default,a.progressive=!0,a.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/polyfills/number.ts"),x=L("./src/utils/ewma-bandwidth-estimator.ts"),O=L("./src/events.ts"),j=L("./src/utils/buffer-helper.ts"),h=L("./src/errors.ts"),D=L("./src/types/loader.ts"),w=L("./src/utils/logger.ts");function g(r,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,s.key,s)}}function m(r,t,n){return t&&g(r.prototype,t),n&&g(r,n),r}var u=function(){function r(n){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=n;var s=n.config;this.bwEstimator=new x.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var t=r.prototype;return t.registerListeners=function(){var s=this.hls;s.on(O.Events.FRAG_LOADING,this.onFragLoading,this),s.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(O.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(O.Events.FRAG_LOADING,this.onFragLoading,this),s.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(O.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},t.onFragLoading=function(s,e){var i=e.frag;if(i.type===D.PlaylistLevelType.MAIN&&!this.timer){var o;this.fragCurrent=i,this.partCurrent=(o=e.part)!=null?o:null,this.timer=self.setInterval(this.onCheck,100)}},t.onLevelLoaded=function(s,e){var i=this.hls.config;e.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},t._abandonRulesCheck=function(){var s=this.fragCurrent,e=this.partCurrent,i=this.hls,o=i.autoLevelEnabled,S=i.config,E=i.media;if(!s||!E)return;var y=e?e.stats:s.stats,T=e?e.duration:s.duration;if(y.aborted){w.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||E.paused||!E.playbackRate||!E.readyState)return;var _=performance.now()-y.loading.start,l=Math.abs(E.playbackRate);if(_<=500*T/l)return;var d=i.levels,a=i.minAutoLevel,c=d[s.level],v=y.total||Math.max(y.loaded,Math.round(T*c.maxBitrate/8)),f=Math.max(1,y.bwEstimate?y.bwEstimate/8:y.loaded*1e3/_),b=(v-y.loaded)/f,I=E.currentTime,R=(j.BufferHelper.bufferInfo(E,I,S.maxBufferHole).end-I)/l;if(R>=2*T/l||b<=R)return;var P=Number.POSITIVE_INFINITY,M;for(M=s.level-1;M>a;M--){var F=d[M].maxBitrate;if(P=T*F/(8*.8*f),P<R)break}if(P>=b)return;var A=this.bwEstimator.getEstimate();w.logger.warn("Fragment "+s.sn+(e?" part "+e.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
|
|
Current BW estimate: `+(Object(W.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+P.toFixed(3)+` s
|
|
Time to underbuffer: `+R.toFixed(3)+" s"),i.nextLoadLevel=M,this.bwEstimator.sample(_,y.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),i.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:e,stats:y})},t.onFragLoaded=function(s,e){var i=e.frag,o=e.part;if(i.type===D.PlaylistLevelType.MAIN&&Object(W.isFiniteNumber)(i.sn)){var S=o?o.stats:i.stats,E=o?o.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var y=this.hls.levels[i.level],T=(y.loaded?y.loaded.bytes:0)+S.loaded,_=(y.loaded?y.loaded.duration:0)+E;y.loaded={bytes:T,duration:_},y.realBitrate=Math.round(8*T/_)}if(i.bitrateTest){var l={stats:S,frag:i,part:o,id:i.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,l),i.bitrateTest=!1}}},t.onFragBuffered=function(s,e){var i=e.frag,o=e.part,S=o?o.stats:i.stats;if(S.aborted)return;if(i.type!==D.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var E=S.parsing.end-S.loading.start;this.bwEstimator.sample(E,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},t.onError=function(s,e){switch(e.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},t.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},t.getNextABRAutoLevel=function(){var s=this.fragCurrent,e=this.partCurrent,i=this.hls,o=i.maxAutoLevel,S=i.config,E=i.minAutoLevel,y=i.media,T=e?e.duration:s?s.duration:0,_=y?y.currentTime:0,l=y&&y.playbackRate!==0?Math.abs(y.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,a=(j.BufferHelper.bufferInfo(y,_,S.maxBufferHole).end-_)/l,c=this.findBestLevel(d,E,o,a,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(c>=0)return c;w.logger.trace((a?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=T?Math.min(T,S.maxStarvationDelay):S.maxStarvationDelay,f=S.abrBandWidthFactor,b=S.abrBandWidthUpFactor;if(!a){var I=this.bitrateTestDelay;if(I){var R=T?Math.min(T,S.maxLoadingDelay):S.maxLoadingDelay;v=R-I,w.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),f=b=1}}return c=this.findBestLevel(d,E,o,a+v,f,b),Math.max(c,0)},t.findBestLevel=function(s,e,i,o,S,E){for(var y,T=this.fragCurrent,_=this.partCurrent,l=this.lastLoadedFragLevel,d=this.hls.levels,a=d[l],c=!!(a!=null&&(y=a.details)!==null&&y!==void 0&&y.live),v=a==null?void 0:a.codecSet,f=_?_.duration:T?T.duration:0,b=i;b>=e;b--){var I=d[b];if(!I||v&&I.codecSet!==v)continue;var R=I.details,P=(_?R==null?void 0:R.partTarget:R==null?void 0:R.averagetargetduration)||f,M=void 0;b<=l?M=S*s:M=E*s;var F=d[b].maxBitrate,A=F*P/M;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(M)+"/"+F+"/"+P+"/"+o+"/"+A),M>F&&(!A||c&&!this.bitrateTestDelay||A<o))return b}return-1},m(r,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,e=this.bwEstimator;if(s!==-1&&(!e||!e.canEstimate()))return s;var i=this.getNextABRAutoLevel();return s!==-1&&(i=Math.min(s,i)),i},set:function(s){this._nextAutoLevel=s}}]),r}();H.default=u},"./src/controller/audio-stream-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/polyfills/number.ts"),x=L("./src/controller/base-stream-controller.ts"),O=L("./src/events.ts"),j=L("./src/utils/buffer-helper.ts"),h=L("./src/controller/fragment-tracker.ts"),D=L("./src/types/level.ts"),w=L("./src/types/loader.ts"),g=L("./src/loader/fragment.ts"),m=L("./src/demux/chunk-cache.ts"),u=L("./src/demux/transmuxer-interface.ts"),r=L("./src/types/transmuxer.ts"),t=L("./src/controller/fragment-finders.ts"),n=L("./src/utils/discontinuities.ts"),s=L("./src/errors.ts"),e=L("./src/utils/logger.ts");function i(){return i=Object.assign||function(T){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(T[d]=l[d])}return T},i.apply(this,arguments)}function o(T,_){T.prototype=Object.create(_.prototype),T.prototype.constructor=T,S(T,_)}function S(T,_){return S=Object.setPrototypeOf||function(d,a){return d.__proto__=a,d},S(T,_)}var E=100,y=function(T){o(_,T);function _(d,a){var c;return c=T.call(this,d,a,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var l=_.prototype;return l.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},l._registerListeners=function(){var a=this.hls;a.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(O.Events.ERROR,this.onError,this),a.on(O.Events.BUFFER_RESET,this.onBufferReset,this),a.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},l._unregisterListeners=function(){var a=this.hls;a.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(O.Events.ERROR,this.onError,this),a.off(O.Events.BUFFER_RESET,this.onBufferReset,this),a.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},l.onInitPtsFound=function(a,c){var v=c.frag,f=c.id,b=c.initPTS;if(f==="main"){var I=v.cc;this.initPTS[v.cc]=b,this.log("InitPTS for cc: "+I+" found from main: "+b),this.videoTrackCC=I,this.state===x.State.WAITING_INIT_PTS&&this.tick()}},l.startLoad=function(a){if(!this.levels){this.startPosition=a,this.state=x.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,c>0&&a===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=x.State.IDLE):(this.loadedmetadata=!1,this.state=x.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()},l.doTick=function(){switch(this.state){case x.State.IDLE:this.doTickIdle();break;case x.State.WAITING_TRACK:{var a,c=this.levels,v=this.trackId,f=c==null||((a=c[v])===null||a===void 0)?void 0:a.details;if(f){if(this.waitForCdnTuneIn(f))break;this.state=x.State.WAITING_INIT_PTS}break}case x.State.FRAG_LOADING_WAITING_RETRY:{var b,I=performance.now(),R=this.retryDate;(!R||I>=R||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=x.State.IDLE);break}case x.State.WAITING_INIT_PTS:{var P=this.waitingData;if(P){var M=P.frag,F=P.part,A=P.cache,B=P.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=x.State.FRAG_LOADING;var z=A.flush(),Z={frag:M,part:F,payload:z,networkDetails:null};this._handleFragmentLoadProgress(Z),B&&T.prototype._handleFragmentLoadComplete.call(this,Z)}else if(this.videoTrackCC!==this.waitingVideoCC)e.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ae=this.getLoadPosition(),De=j.BufferHelper.bufferInfo(this.mediaBuffer,ae,this.config.maxBufferHole),_e=Object(t.fragmentWithinToleranceTest)(De.end,this.config.maxFragLookUpTolerance,M);_e<0&&(e.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+De.end+" is needed"),this.clearWaitingFragment())}}else this.state=x.State.IDLE}}this.onTickEnd()},l.clearWaitingFragment=function(){var a=this.waitingData;a&&(this.fragmentTracker.removeFragment(a.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=x.State.IDLE)},l.onTickEnd=function(){var a=this.media;if(!a||!a.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:a,v=c.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=a.currentTime},l.doTickIdle=function(){var a,c,v=this.hls,f=this.levels,b=this.media,I=this.trackId,R=v.config;if(!f||!f[I])return;if(!b&&(this.startFragRequested||!R.startFragPrefetch))return;var P=f[I],M=P.details;if(!M||M.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(M)){this.state=x.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,w.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.PlaylistLevelType.AUDIO);if(F===null)return;var A=F.len,B=this.getMaxBufferLength(),z=this.audioSwitch;if(A>=B&&!z)return;if(!z&&this._streamEnded(F,M)){v.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=x.State.ENDED;return}var Z=M.fragments,ae=Z[0].start,De=F.end;if(z){var _e=this.getLoadPosition();De=_e,M.PTSKnown&&_e<ae&&((F.end>ae||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ae+.05))}var Oe=this.getNextFragment(De,M);if(!Oe){this.bufferFlushed=!0;return}((a=Oe.decryptdata)===null||a===void 0?void 0:a.keyFormat)==="identity"&&!((c=Oe.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Oe,M):this.loadFragment(Oe,M,De)},l.getMaxBufferLength=function(){var a=T.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.PlaylistLevelType.MAIN);return c===null?a:Math.max(a,c.len)},l.onMediaDetaching=function(){this.videoBuffer=null,T.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(a,c){var v=c.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(f){return new D.Level(f)})},l.onAudioTrackSwitching=function(a,c){var v=!!c.url;this.trackId=c.id;var f=this.fragCurrent;f!=null&&f.loader&&f.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(E):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=x.State.IDLE):this.state=x.State.STOPPED,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(a,c){this.mainDetails=c.details},l.onAudioTrackLoaded=function(a,c){var v,f=this.levels,b=c.details,I=c.id;if(!f){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var R=f[I],P=0;if(b.live||(v=R.details)!==null&&v!==void 0&&v.live){var M=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!M)return;!R.details&&b.hasProgramDateTime&&M.hasProgramDateTime?(Object(n.alignMediaPlaylistByPDT)(b,M),P=b.fragments[0].start):P=this.alignPlaylists(b,R.details)}R.details=b,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(R.details,P),this.state===x.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=x.State.IDLE),this.tick()},l._handleFragmentLoadProgress=function(a){var c,v=a.frag,f=a.part,b=a.payload,I=this.config,R=this.trackId,P=this.levels;if(!P){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var M=P[R];console.assert(M,"Audio track is defined on fragment load progress");var F=M.details;console.assert(F,"Audio track details are defined on fragment load progress");var A=I.defaultAudioCodec||M.audioCodec||"mp4a.40.2",B=this.transmuxer;B||(B=this.transmuxer=new u.default(this.hls,w.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[v.cc],Z=(c=v.initSegment)===null||c===void 0?void 0:c.data;if(z!==void 0){var ae=!1,De=f?f.index:-1,_e=De!==-1,Oe=new r.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,b.byteLength,De,_e);B.push(b,Z,A,"",v,f,F.totalduration,ae,Oe,z)}else{e.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+R);var Ne=this.waitingData=this.waitingData||{frag:v,part:f,cache:new m.default,complete:!1},Ue=Ne.cache;Ue.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=x.State.WAITING_INIT_PTS}},l._handleFragmentLoadComplete=function(a){if(this.waitingData){this.waitingData.complete=!0;return}T.prototype._handleFragmentLoadComplete.call(this,a)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(a,c){var v=c.tracks.audio;v&&(this.mediaBuffer=v.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},l.onFragBuffered=function(a,c){var v=c.frag,f=c.part;if(v.type!==w.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(f?" p: "+f.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,f)},l.onError=function(a,c){switch(c.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.AUDIO,c);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==x.State.ERROR&&this.state!==x.State.STOPPED&&(this.state=c.fatal?x.State.ERROR:x.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===x.State.PARSING||this.state===x.State.PARSED)){var v=!0,f=this.getFwdBufferInfo(this.mediaBuffer,w.PlaylistLevelType.AUDIO);f&&f.len>.5&&(v=!this.reduceMaxBufferLength(f.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},l.onBufferFlushed=function(a,c){var v=c.type;v===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(a){var c,v="audio",f=this.hls,b=a.remuxResult,I=a.chunkMeta,R=this.getCurrentContext(I);if(!R){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var P=R.frag,M=R.part,F=b.audio,A=b.text,B=b.id3,z=b.initSegment;if(this.fragContextChanged(P))return;if(this.state=x.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,P,I),f.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:v,tracks:z.tracks})),F){var Z=F.startPTS,ae=F.endPTS,De=F.startDTS,_e=F.endDTS;M&&(M.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:ae,startDTS:De,endDTS:_e}),P.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,Z,ae,De,_e),this.bufferFragmentData(F,P,M,I)}if(B!=null&&(c=B.samples)!==null&&c!==void 0&&c.length){var Oe=i({frag:P,id:v},B);f.trigger(O.Events.FRAG_PARSING_METADATA,Oe)}if(A){var Ne=i({frag:P,id:v},A);f.trigger(O.Events.FRAG_PARSING_USERDATA,Ne)}},l._bufferInitSegment=function(a,c,v){if(this.state!==x.State.PARSING)return;a.video&&delete a.video;var f=a.audio;if(!f)return;f.levelCodec=f.codec,f.id="audio",this.log("Init audio buffer, container:"+f.container+", codecs[parsed]=["+f.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,a);var b=f.initSegment;if(b!=null&&b.byteLength){var I={type:"audio",frag:c,part:null,chunkMeta:v,parent:c.type,data:b};this.hls.trigger(O.Events.BUFFER_APPENDING,I)}this.tick()},l.loadFragment=function(a,c,v){var f=this.fragmentTracker.getState(a);this.fragCurrent=a,(this.audioSwitch||f===h.FragmentState.NOT_LOADED||f===h.FragmentState.PARTIAL)&&(a.sn==="initSegment"?this._loadInitSegment(a):c.live&&!Object(W.isFiniteNumber)(this.initPTS[a.cc])?(this.log("Waiting for video PTS in continuity counter "+a.cc+" of live stream before loading audio fragment "+a.sn+" of level "+this.trackId),this.state=x.State.WAITING_INIT_PTS):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,a,c,v)))},l.completeAudioSwitch=function(){var a=this.hls,c=this.media,v=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,a.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:v})},_}(x.default);H.default=y},"./src/controller/audio-track-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/events.ts"),x=L("./src/errors.ts"),O=L("./src/controller/base-playlist-controller.ts"),j=L("./src/types/loader.ts");function h(u,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(u,n.key,n)}}function D(u,r,t){return r&&h(u.prototype,r),t&&h(u,t),u}function w(u,r){u.prototype=Object.create(r.prototype),u.prototype.constructor=u,g(u,r)}function g(u,r){return g=Object.setPrototypeOf||function(n,s){return n.__proto__=s,n},g(u,r)}var m=function(u){w(r,u);function r(n){var s;return s=u.call(this,n,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var t=r.prototype;return t.registerListeners=function(){var s=this.hls;s.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(W.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(W.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,u.prototype.destroy.call(this)},t.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},t.onManifestParsed=function(s,e){this.tracks=e.audioTracks||[]},t.onAudioTrackLoaded=function(s,e){var i=e.id,o=e.details,S=this.tracksInGroup[i];if(!S){this.warn("Invalid audio track id "+i);return}var E=S.details;S.details=e.details,this.log("audioTrack "+i+" loaded ["+o.startSN+"-"+o.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,e,E))},t.onLevelLoading=function(s,e){this.switchLevel(e.level)},t.onLevelSwitching=function(s,e){this.switchLevel(e.level)},t.switchLevel=function(s){var e=this.hls.levels[s];if(!(e!=null&&e.audioGroupIds))return;var i=e.audioGroupIds[e.urlId];if(this.groupId!==i){this.groupId=i;var o=this.tracks.filter(function(E){return!i||E.groupId===i});this.selectDefaultTrack&&!o.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var S={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(W.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},t.onError=function(s,e){if(u.prototype.onError.call(this,s,e),e.fatal||!e.context)return;e.context.type===j.PlaylistContextType.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&this.retryLoadingOrFail(e)},t.setAudioTrack=function(s){var e=this.tracksInGroup;if(s<0||s>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=e[this.trackId];this.log("Now switching to audio-track index "+s);var o=e[s],S=o.id,E=o.groupId,y=E===void 0?"":E,T=o.name,_=o.type,l=o.url;if(this.trackId=s,this.trackName=T,this.selectDefaultTrack=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:y,name:T,type:_,url:l}),o.details&&!o.details.live)return;var d=this.switchParams(o.url,i==null?void 0:i.details);this.loadPlaylist(d)},t.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,i=this.findTrackId(e)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},t.findTrackId=function(s){for(var e=this.tracksInGroup,i=0;i<e.length;i++){var o=e[i];if((!this.selectDefaultTrack||o.default)&&(!s||s===o.name))return o.id}return-1},t.loadPlaylist=function(s){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var i=e.id,o=e.groupId,S=e.url;if(s)try{S=s.addDirectives(S)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(W.Events.AUDIO_TRACK_LOADING,{url:S,id:i,groupId:o,deliveryDirectives:s||null})}},D(r,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),r}(O.default);H.default=m},"./src/controller/base-playlist-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return D});var W=L("./src/polyfills/number.ts"),x=L("./src/types/level.ts"),O=L("./src/controller/level-helper.ts"),j=L("./src/utils/logger.ts"),h=L("./src/errors.ts"),D=function(){function w(m,u){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,u+":"),this.warn=j.logger.warn.bind(j.logger,u+":"),this.hls=m}var g=w.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(u,r){r.fatal&&r.type===h.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(u,r){var t=r==null?void 0:r.renditionReports;if(t)for(var n=0;n<t.length;n++){var s=t[n],e=""+s.URI;if(e===u.substr(-e.length)){var i=parseInt(s["LAST-MSN"]),o=parseInt(s["LAST-PART"]);if(r&&this.hls.config.lowLatencyMode){var S=Math.min(r.age-r.partTarget,r.targetduration);o!==void 0&&S>r.partTarget&&(o+=1)}if(Object(W.isFiniteNumber)(i))return new x.HlsUrlParameters(i,Object(W.isFiniteNumber)(o)?o:void 0,x.HlsSkip.No)}}},g.loadPlaylist=function(u){},g.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},g.playlistLoaded=function(u,r,t){var n=this,s=r.details,e=r.stats,i=e.loading.end?Math.max(0,self.performance.now()-e.loading.end):0;if(s.advancedDateTime=Date.now()-i,s.live||t!=null&&t.live){if(s.reloaded(t),t&&this.log("live playlist "+u+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),t&&s.fragments.length>0&&Object(O.mergeDetails)(t,s),!this.canLoad||!s.live)return;var o,S=void 0,E=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var y=this.hls.config.lowLatencyMode,T=s.lastPartSn,_=s.endSN,l=s.lastPartIndex,d=l!==-1,a=T===_,c=y?0:l;d?(S=a?_+1:T,E=a?c:l+1):S=_+1;var v=s.age,f=v+s.ageHeader,b=Math.min(f-s.partTarget,s.targetduration*1.5);if(b>0){if(t&&b>t.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+t.tuneInGoal+" to: "+b+" with playlist age: "+s.age),b=0;else{var I=Math.floor(b/s.targetduration);if(S+=I,E!==void 0){var R=Math.round(b%s.targetduration/s.partTarget);E+=R}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+b+" skip sn "+I+" to part "+E)}s.tuneInGoal=b}if(o=this.getDeliveryDirectives(s,r.deliveryDirectives,S,E),y||!a){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(s,r.deliveryDirectives,S,E);var P=Object(O.computeReloadInterval)(s,e);S!==void 0&&s.canBlockReload&&(P-=s.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(P)+" ms"),this.timer=self.setTimeout(function(){return n.loadPlaylist(o)},P)}else this.clearTimer()},g.getDeliveryDirectives=function(u,r,t,n){var s=Object(x.getSkipValue)(u,t);return r!=null&&r.skip&&u.deltaUpdateFailed&&(t=r.msn,n=r.part,s=x.HlsSkip.No),new x.HlsUrlParameters(t,n,s)},g.retryLoadingOrFail=function(u){var r=this,t=this.hls.config,n=this.retryCount<t.levelLoadingMaxRetry;if(n){var s;if(this.retryCount++,u.details.indexOf("LoadTimeOut")>-1&&(s=u.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.details+'"'),this.loadPlaylist();else{var e=Math.min(Math.pow(2,this.retryCount)*t.levelLoadingRetryDelay,t.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return r.loadPlaylist()},e),this.warn("retry playlist loading #"+this.retryCount+" in "+e+' ms after "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return n},w}()},"./src/controller/base-stream-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"State",function(){return _}),L.d(H,"default",function(){return l});var W=L("./src/polyfills/number.ts"),x=L("./src/task-loop.ts"),O=L("./src/controller/fragment-tracker.ts"),j=L("./src/utils/buffer-helper.ts"),h=L("./src/utils/logger.ts"),D=L("./src/events.ts"),w=L("./src/errors.ts"),g=L("./src/types/transmuxer.ts"),m=L("./src/utils/mp4-tools.ts"),u=L("./src/utils/discontinuities.ts"),r=L("./src/controller/fragment-finders.ts"),t=L("./src/controller/level-helper.ts"),n=L("./src/loader/fragment-loader.ts"),s=L("./src/crypt/decrypter.ts"),e=L("./src/utils/time-ranges.ts"),i=L("./src/types/loader.ts");function o(d,a){for(var c=0;c<a.length;c++){var v=a[c];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(d,v.key,v)}}function S(d,a,c){return a&&o(d.prototype,a),c&&o(d,c),d}function E(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function y(d,a){d.prototype=Object.create(a.prototype),d.prototype.constructor=d,T(d,a)}function T(d,a){return T=Object.setPrototypeOf||function(v,f){return v.__proto__=f,v},T(d,a)}var _={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"},l=function(d){y(a,d);function a(v,f,b){var I;return I=d.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=_.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=b,I.log=h.logger.log.bind(h.logger,b+":"),I.warn=h.logger.warn.bind(h.logger,b+":"),I.hls=v,I.fragmentLoader=new n.default(v.config),I.fragmentTracker=f,I.config=v.config,I.decrypter=new s.default(v,v.config),v.on(D.Events.KEY_LOADED,I.onKeyLoaded,E(I)),I}var c=a.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(f){},c.stopLoad=function(){this.fragmentLoader.abort();var f=this.fragCurrent;f&&this.fragmentTracker.removeFragment(f),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},c._streamEnded=function(f,b){var I=this.fragCurrent,R=this.fragmentTracker;if(!b.live&&I&&I.sn===b.endSN&&!f.nextStart){var P=R.getState(I);return P===O.FragmentState.PARTIAL||P===O.FragmentState.OK}return!1},c.onMediaAttached=function(f,b){var I=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var R=this.config;this.levels&&R.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(R.startPosition)},c.onMediaDetaching=function(){var f=this.media;f!=null&&f.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),f&&(f.removeEventListener("seeking",this.onvseeking),f.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var f=this.config,b=this.fragCurrent,I=this.media,R=this.mediaBuffer,P=this.state,M=I?I.currentTime:0,F=j.BufferHelper.bufferInfo(R||I,M,f.maxBufferHole);if(this.log("media seeking to "+(Object(W.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+P),P===_.ENDED)this.resetLoadingState();else if(b&&!F.len){var A=f.maxFragLookUpTolerance,B=b.start-A,z=b.start+b.duration+A,Z=M>z;(M<B||Z)&&(Z&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=M),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(f,b){if(this.state!==_.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var I=this.levels[b.frag.level].details;I&&this.loadFragment(b.frag,I,b.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),d.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(D.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,d.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(f,b){this.log("Loading key for "+f.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+f.level),this.state=_.KEY_LOADING,this.fragCurrent=f,this.hls.trigger(D.Events.KEY_LOADING,{frag:f})},c.loadFragment=function(f,b,I){this._loadFragForPlayback(f,b,I)},c._loadFragForPlayback=function(f,b,I){var R=this,P=function(F){if(R.fragContextChanged(f)){R.warn("Fragment "+f.sn+(F.part?" p: "+F.part.index:"")+" of level "+f.level+" was dropped during download."),R.fragmentTracker.removeFragment(f);return}f.stats.chunkCount++,R._handleFragmentLoadProgress(F)};this._doFragLoad(f,b,I,P).then(function(M){if(!M)return;R.fragLoadError=0;var F=R.state;if(R.fragContextChanged(f)){(F===_.FRAG_LOADING||F===_.BACKTRACKING||!R.fragCurrent&&F===_.PARSING)&&(R.fragmentTracker.removeFragment(f),R.state=_.IDLE);return}if("payload"in M&&(R.log("Loaded fragment "+f.sn+" of level "+f.level),R.hls.trigger(D.Events.FRAG_LOADED,M),R.state===_.BACKTRACKING)){R.fragmentTracker.backtrack(f,M),R.resetFragmentLoading(f);return}R._handleFragmentLoadComplete(M)}).catch(function(M){R.warn(M),R.resetFragmentLoading(f)})},c.flushMainBuffer=function(f,b,I){if(I===void 0&&(I=null),!(f-b))return;var R={startOffset:f,endOffset:b,type:I};this.fragLoadError=0,this.hls.trigger(D.Events.BUFFER_FLUSHING,R)},c._loadInitSegment=function(f){var b=this;this._doFragLoad(f).then(function(I){if(!I||b.fragContextChanged(f)||!b.levels)throw new Error("init load aborted");return I}).then(function(I){var R=b.hls,P=I.payload,M=f.decryptdata;if(P&&P.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var F=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(P),M.key.buffer,M.iv.buffer).then(function(A){var B=self.performance.now();return R.trigger(D.Events.FRAG_DECRYPTED,{frag:f,payload:A,stats:{tstart:F,tdecrypt:B}}),I.payload=A,I})}return I}).then(function(I){var R=b.fragCurrent,P=b.hls,M=b.levels;if(!M)throw new Error("init load aborted, missing levels");var F=M[f.level].details;console.assert(F,"Level details are defined when init segment is loaded");var A=f.stats;b.state=_.IDLE,b.fragLoadError=0,f.data=new Uint8Array(I.payload),A.parsing.start=A.buffering.start=self.performance.now(),A.parsing.end=A.buffering.end=self.performance.now(),I.frag===R&&P.trigger(D.Events.FRAG_BUFFERED,{stats:A,frag:R,part:null,id:f.type}),b.tick()}).catch(function(I){b.warn(I),b.resetFragmentLoading(f)})},c.fragContextChanged=function(f){var b=this.fragCurrent;return!f||!b||f.level!==b.level||f.sn!==b.sn||f.urlId!==b.urlId},c.fragBufferedComplete=function(f,b){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+f.type+" sn: "+f.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+f.level+" "+e.default.toString(j.BufferHelper.getBuffered(I))),this.state=_.IDLE,this.tick()},c._handleFragmentLoadComplete=function(f){var b=this.transmuxer;if(!b)return;var I=f.frag,R=f.part,P=f.partsLoaded,M=!P||P.length===0||P.some(function(A){return!A}),F=new g.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,R?R.index:-1,!M);b.flush(F)},c._handleFragmentLoadProgress=function(f){},c._doFragLoad=function(f,b,I,R){var P=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(f.start,I||0),this.config.lowLatencyMode&&b){var M=b.partList;if(M&&R){I>f.end&&b.fragmentHint&&(f=b.fragmentHint);var F=this.getNextPart(M,f,I);if(F>-1){var A=M[F];return this.log("Loading part sn: "+f.sn+" p: "+A.index+" cc: "+f.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+F+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+f.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=A.start+A.duration,this.state=_.FRAG_LOADING,this.hls.trigger(D.Events.FRAG_LOADING,{frag:f,part:M[F],targetBufferTime:I}),this.doFragPartsLoad(f,M,F,R).catch(function(B){return P.handleFragLoadError(B)})}else if(!f.url||this.loadedEndOfParts(M,I))return Promise.resolve(null)}}return this.log("Loading fragment "+f.sn+" cc: "+f.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+f.level+", target: "+parseFloat(I.toFixed(3))),Object(W.isFiniteNumber)(f.sn)&&!this.bitrateTest&&(this.nextLoadPosition=f.start+f.duration),this.state=_.FRAG_LOADING,this.hls.trigger(D.Events.FRAG_LOADING,{frag:f,targetBufferTime:I}),this.fragmentLoader.load(f,R).catch(function(B){return P.handleFragLoadError(B)})},c.doFragPartsLoad=function(f,b,I,R){var P=this;return new Promise(function(M,F){var A=[],B=function z(Z){var ae=b[Z];P.fragmentLoader.loadPart(f,ae,R).then(function(De){A[ae.index]=De;var _e=De.part;P.hls.trigger(D.Events.FRAG_LOADED,De);var Oe=b[Z+1];if(Oe&&Oe.fragment===f)z(Z+1);else return M({frag:f,part:_e,partsLoaded:A})}).catch(F)};B(I)})},c.handleFragLoadError=function(f){var b=f.data;return b&&b.details===w.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(D.Events.ERROR,b),null},c._handleTransmuxerFlush=function(f){var b=this.getCurrentContext(f);if(!b||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var I=b.frag,R=b.part,P=b.level,M=self.performance.now();I.stats.parsing.end=M,R&&(R.stats.parsing.end=M),this.updateLevelTiming(I,R,P,f.partial)},c.getCurrentContext=function(f){var b=this.levels,I=f.level,R=f.sn,P=f.part;if(!b||!b[I])return this.warn("Levels object was unset while buffering fragment "+R+" of level "+I+". The current chunk will not be buffered."),null;var M=b[I],F=P>-1?Object(t.getPartWith)(M,R,P):null,A=F?F.fragment:Object(t.getFragmentWithSN)(M,R,this.fragCurrent);return A?{frag:A,part:F,level:M}:null},c.bufferFragmentData=function(f,b,I,R){if(!f||this.state!==_.PARSING)return;var P=f.data1,M=f.data2,F=P;if(P&&M&&(F=Object(m.appendUint8Array)(P,M)),!F||!F.length)return;var A={type:f.type,frag:b,part:I,chunkMeta:R,parent:b.type,data:F};this.hls.trigger(D.Events.BUFFER_APPENDING,A),f.dropped&&f.independent&&!I&&this.flushBufferGap(b)},c.flushBufferGap=function(f){var b=this.media;if(!b)return;if(!j.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,f.start);return}var I=b.currentTime,R=j.BufferHelper.bufferInfo(b,I,0),P=f.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,P*.25),F=Math.max(Math.min(f.start-M,R.end-M),I+M);f.start-F>M&&this.flushMainBuffer(F,f.start)},c.getFwdBufferInfo=function(f,b){var I=this.config,R=this.getLoadPosition();if(!Object(W.isFiniteNumber)(R))return null;var P=j.BufferHelper.bufferInfo(f,R,I.maxBufferHole);if(P.len===0&&P.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(R,b);if(M&&P.nextStart<M.end)return j.BufferHelper.bufferInfo(f,R,Math.max(P.nextStart,I.maxBufferHole))}return P},c.getMaxBufferLength=function(f){var b=this.config,I;return f?I=Math.max(8*b.maxBufferSize/f,b.maxBufferLength):I=b.maxBufferLength,Math.min(I,b.maxMaxBufferLength)},c.reduceMaxBufferLength=function(f){var b=this.config,I=f||b.maxBufferLength;return b.maxMaxBufferLength>=I?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(f,b){var I,R,P=b.fragments,M=P.length;if(!M)return null;var F=this.config,A=P[0].start,B;if(b.live){var z=F.initialLiveManifestSize;if(M<z)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+z+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(B=this.getInitialLiveFragment(b,P),this.startPosition=B?this.hls.liveSyncPosition||B.start:f)}else f<=A&&(B=P[0]);if(!B){var Z=F.lowLatencyMode?b.partEnd:b.fragmentEnd;B=this.getFragmentAtPosition(f,Z,b)}return(I=B)!==null&&I!==void 0&&I.initSegment&&!((R=B)!==null&&R!==void 0&&R.initSegment.data)&&!this.bitrateTest&&(B=B.initSegment),B},c.getNextPart=function(f,b,I){for(var R=-1,P=!1,M=!0,F=0,A=f.length;F<A;F++){var B=f[F];if(M=M&&!B.independent,R>-1&&I<B.start)break;var z=B.loaded;!z&&(P||B.independent||M)&&B.fragment===b&&(R=F),P=z}return R},c.loadedEndOfParts=function(f,b){var I=f[f.length-1];return I&&b>I.start&&I.loaded},c.getInitialLiveFragment=function(f,b){var I=this.fragPrevious,R=null;if(I){if(f.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),R=Object(r.findFragmentByPDT)(b,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!R){var P=I.sn+1;if(P>=f.startSN&&P<=f.endSN){var M=b[P-f.startSN];I.cc===M.cc&&(R=M,this.log("Live playlist, switching playlist, load frag with next SN: "+R.sn))}R||(R=Object(r.findFragWithCC)(b,I.cc),R&&this.log("Live playlist, switching playlist, load frag with same CC: "+R.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(R=this.getFragmentAtPosition(F,this.bitrateTest?f.fragmentEnd:f.edge,f))}return R},c.getFragmentAtPosition=function(f,b,I){var R=this.config,P=this.fragPrevious,M=I.fragments,F=I.endSN,A=I.fragmentHint,B=R.maxFragLookUpTolerance,z=!!(R.lowLatencyMode&&I.partList&&A);z&&A&&!this.bitrateTest&&(M=M.concat(A),F=A.sn);var Z;if(f<b){var ae=f>b-B?0:B;Z=Object(r.findFragmentByPTS)(P,M,f,ae)}else Z=M[M.length-1];if(Z){var De=Z.sn-I.startSN,_e=P&&Z.level===P.level,Oe=M[De+1],Ne=this.fragmentTracker.getState(Z);if(Ne===O.FragmentState.BACKTRACKED){Z=null;for(var Ue=De;M[Ue]&&this.fragmentTracker.getState(M[Ue])===O.FragmentState.BACKTRACKED;)P?Z=M[Ue--]:Z=M[--Ue];Z||(Z=Oe)}else P&&Z.sn===P.sn&&!z&&(_e&&(Z.sn<F&&this.fragmentTracker.getState(Oe)!==O.FragmentState.OK?(this.log("SN "+Z.sn+" just loaded, load next one: "+Oe.sn),Z=Oe):Z=null))}return Z},c.synchronizeToLiveEdge=function(f){var b=this.config,I=this.media;if(!I)return;var R=this.hls.liveSyncPosition,P=I.currentTime,M=f.fragments[0].start,F=f.edge,A=P>=M-b.maxFragLookUpTolerance&&P<=F;if(R!==null&&I.duration>R&&(P<R||!A)){var B=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*f.targetduration;(!A&&I.readyState<4||P<F-B)&&(this.loadedmetadata||(this.nextLoadPosition=R),I.readyState&&(this.warn("Playback: "+P.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+R.toFixed(3)),I.currentTime=R))}},c.alignPlaylists=function(f,b){var I=this.levels,R=this.levelLastLoaded,P=this.fragPrevious,M=R!==null?I[R]:null,F=f.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var A=f.fragments[0].start,B=!b,z=f.alignedSliding&&Object(W.isFiniteNumber)(A);if(B||!z&&!A){Object(u.alignStream)(P,M,f);var Z=f.fragments[0].start;return this.log("Live playlist sliding: "+Z.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+f.startSN+" prev-sn: "+(P?P.sn:"na")+" fragments: "+F),Z}return A},c.waitForCdnTuneIn=function(f){var b=3;return f.live&&f.canBlockReload&&f.tuneInGoal>Math.max(f.partHoldBack,f.partTarget*b)},c.setStartPosition=function(f,b){var I=this.startPosition;if(I<b&&(I=-1),I===-1||this.lastCurrentTime===-1){var R=f.startTimeOffset;Object(W.isFiniteNumber)(R)?(I=b+R,R<0&&(I+=f.totalduration),I=Math.min(Math.max(b,I),b+f.totalduration),this.log("Start time offset "+R+" found in playlist, adjust startPosition to "+I),this.startPosition=I):f.live?I=this.hls.liveSyncPosition||b:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},c.getLoadPosition=function(){var f=this.media,b=0;return this.loadedmetadata&&f?b=f.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},c.handleFragLoadAborted=function(f,b){this.transmuxer&&f.sn!=="initSegment"&&f.stats.aborted&&(this.warn("Fragment "+f.sn+(b?" part"+b.index:"")+" of level "+f.level+" was aborted"),this.resetFragmentLoading(f))},c.resetFragmentLoading=function(f){(!this.fragCurrent||!this.fragContextChanged(f))&&(this.state=_.IDLE)},c.onFragmentOrKeyLoadError=function(f,b){if(b.fatal)return;var I=b.frag;if(!I||I.type!==f)return;var R=this.fragCurrent;console.assert(R&&I.sn===R.sn&&I.level===R.level&&I.urlId===R.urlId,"Frag load error must match current frag to retry");var P=this.config;if(this.fragLoadError+1<=P.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*P.fragLoadingRetryDelay,P.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+f+" "+I.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(f===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(h.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},c.afterBufferFlushed=function(f,b,I){if(!f)return;var R=j.BufferHelper.getBuffered(f);this.fragmentTracker.detectEvictedFragments(b,R,I),this.state===_.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},c.resetLiveStartWhenNotLoaded=function(f){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[f].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(f,b,I,R){var P=this,M=I.details;console.assert(!!M,"level.details must be defined");var F=Object.keys(f.elementaryStreams).reduce(function(A,B){var z=f.elementaryStreams[B];if(z){var Z=z.endPTS-z.startPTS;if(Z<=0)return P.warn("Could not parse fragment "+f.sn+" "+B+" duration reliably ("+Z+") resetting transmuxer to fallback to playlist timing"),P.resetTransmuxer(),A||!1;var ae=R?0:Object(t.updateFragPTSDTS)(M,f,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return P.hls.trigger(D.Events.LEVEL_PTS_UPDATED,{details:M,level:I,drift:ae,type:B,frag:f,start:z.startPTS,end:z.endPTS}),!0}return A},!1);F?(this.state=_.PARSED,this.hls.trigger(D.Events.FRAG_PARSED,{frag:f,part:b})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(a,[{key:"state",get:function(){return this._state},set:function(f){var b=this._state;b!==f&&(this._state=f,this.log(b+"->"+f))}}]),a}(x.default)},"./src/controller/buffer-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return r});var W=L("./src/polyfills/number.ts"),x=L("./src/events.ts"),O=L("./src/utils/logger.ts"),j=L("./src/errors.ts"),h=L("./src/utils/buffer-helper.ts"),D=L("./src/utils/mediasource-helper.ts"),w=L("./src/loader/fragment.ts"),g=L("./src/controller/buffer-operation-queue.ts"),m=Object(D.getMediaSource)(),u=/([ha]vc.)(?:\.[^.,]+)+/,r=function(){function t(s){var e=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 i=e.hls,o=e.media,S=e.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),o&&(e.updateMediaElementDuration(),i.trigger(x.Events.MEDIA_ATTACHED,{media:o})),S&&S.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var n=t.prototype;return n.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},n.destroy=function(){this.unregisterListeners(),this.details=null},n.registerListeners=function(){var e=this.hls;e.on(x.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(x.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(x.Events.BUFFER_RESET,this.onBufferReset,this),e.on(x.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(x.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(x.Events.BUFFER_EOS,this.onBufferEos,this),e.on(x.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(x.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(x.Events.FRAG_PARSED,this.onFragParsed,this),e.on(x.Events.FRAG_CHANGED,this.onFragChanged,this)},n.unregisterListeners=function(){var e=this.hls;e.off(x.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(x.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(x.Events.BUFFER_RESET,this.onBufferReset,this),e.off(x.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(x.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(x.Events.BUFFER_EOS,this.onBufferEos,this),e.off(x.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(x.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(x.Events.FRAG_PARSED,this.onFragParsed,this),e.off(x.Events.FRAG_CHANGED,this.onFragChanged,this)},n._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},n.onManifestParsed=function(e,i){var o=2;(i.audio&&!i.video||!i.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},n.onMediaAttaching=function(e,i){var o=this.media=i.media;if(o&&m){var S=this.mediaSource=new m;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(S),this._objectUrl=o.src}},n.onMediaDetaching=function(){var e=this.media,i=this.mediaSource,o=this._objectUrl;if(i){if(O.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(S){O.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(o&&self.URL.revokeObjectURL(o),e.src===o?(e.removeAttribute("src"),e.load()):O.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(x.Events.MEDIA_DETACHED,void 0)},n.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach(function(i){var o=e.sourceBuffer[i];try{o&&(e.removeBufferListeners(i),e.mediaSource&&e.mediaSource.removeSourceBuffer(o),e.sourceBuffer[i]=void 0)}catch(S){O.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",S)}}),this._initSourceBuffer()},n.onBufferCodecs=function(e,i){var o=this,S=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(E){if(S){var y=o.tracks[E];if(y&&typeof y.buffer.changeType=="function"){var T=i[E],_=T.codec,l=T.levelCodec,d=T.container,a=(y.levelCodec||y.codec).replace(u,"$1"),c=(l||_).replace(u,"$1");if(a!==c){var v=d+";codecs="+(l||_);o.appendChangeType(E,v)}}}else o.pendingTracks[E]=i[E]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},n.appendChangeType=function(e,i){var o=this,S=this.operationQueue,E={execute:function(){var T=o.sourceBuffer[e];T&&(O.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+i),T.changeType(i)),S.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(T){O.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",T)}};S.append(E,e)},n.onBufferAppending=function(e,i){var o=this,S=this.hls,E=this.operationQueue,y=this.tracks,T=i.data,_=i.type,l=i.frag,d=i.part,a=i.chunkMeta,c=a.buffering[_],v=self.performance.now();c.start=v;var f=l.stats.buffering,b=d?d.stats.buffering:null;f.start===0&&(f.start=v),b&&b.start===0&&(b.start=v);var I=y.audio,R=_==="audio"&&a.id===1&&(I==null?void 0:I.container)==="audio/mpeg",P={execute:function(){if(c.executeStart=self.performance.now(),R){var F=o.sourceBuffer[_];if(F){var A=l.start-F.timestampOffset;Math.abs(A)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+l.start+" (delta: "+A+") sn: "+l.sn+")"),F.timestampOffset=l.start)}}o.appendExecutor(T,_)},onStart:function(){},onComplete:function(){var F=self.performance.now();c.executeEnd=c.end=F,f.first===0&&(f.first=F),b&&b.first===0&&(b.first=F);var A=o.sourceBuffer,B={};for(var z in A)B[z]=h.BufferHelper.getBuffered(A[z]);o.appendError=0,o.hls.trigger(x.Events.BUFFER_APPENDED,{type:_,frag:l,part:d,chunkMeta:a,parent:l.type,timeRanges:B})},onError:function(F){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",F);var A={type:j.ErrorTypes.MEDIA_ERROR,parent:l.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?A.details=j.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,A.details=j.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>S.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),A.fatal=!0)),S.trigger(x.Events.ERROR,A)}};E.append(P,_)},n.onBufferFlushing=function(e,i){var o=this,S=this.operationQueue,E=function(T){return{execute:o.removeExecutor.bind(o,T,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(x.Events.BUFFER_FLUSHED,{type:T})},onError:function(l){O.logger.warn("[buffer-controller]: Failed to remove from "+T+" SourceBuffer",l)}}};i.type?S.append(E(i.type),i.type):this.getSourceBufferTypes().forEach(function(y){S.append(E(y),y)})},n.onFragParsed=function(e,i){var o=this,S=i.frag,E=i.part,y=[],T=E?E.elementaryStreams:S.elementaryStreams;T[w.ElementaryStreamTypes.AUDIOVIDEO]?y.push("audiovideo"):(T[w.ElementaryStreamTypes.AUDIO]&&y.push("audio"),T[w.ElementaryStreamTypes.VIDEO]&&y.push("video"));var _=function(){var d=self.performance.now();S.stats.buffering.end=d,E&&(E.stats.buffering.end=d);var a=E?E.stats:S.stats;o.hls.trigger(x.Events.FRAG_BUFFERED,{frag:S,part:E,stats:a,id:S.type})};y.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(_,y)},n.onFragChanged=function(e,i){this.flushBackBuffer()},n.onBufferEos=function(e,i){var o=this,S=this.getSourceBufferTypes().reduce(function(E,y){var T=o.sourceBuffer[y];return(!i.type||i.type===y)&&(T&&!T.ended&&(T.ended=!0,O.logger.log("[buffer-controller]: "+y+" sourceBuffer now EOS"))),E&&!!(!T||T.ended)},!0);S&&this.blockBuffers(function(){var E=o.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},n.onLevelUpdated=function(e,i){var o=i.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},n.flushBackBuffer=function(){var e=this.hls,i=this.details,o=this.media,S=this.sourceBuffer;if(!o||i===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var y=i.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!Object(W.isFiniteNumber)(y)||y<0)return;var T=o.currentTime,_=i.levelTargetDuration,l=Math.max(y,_),d=Math.floor(T/_)*_-l;E.forEach(function(a){var c=S[a];if(c){var v=h.BufferHelper.getBuffered(c);v.length>0&&d>v.start(0)&&(e.trigger(x.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),i.live&&e.trigger(x.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),e.trigger(x.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:a}))}})},n.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var e=this.details,i=this.hls,o=this.media,S=this.mediaSource,E=e.fragments[0].start+e.totalduration,y=o.duration,T=Object(W.isFiniteNumber)(S.duration)?S.duration:0;e.live&&i.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(e)):(E>T&&E>y||!Object(W.isFiniteNumber)(y))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),S.duration=E)},n.updateSeekableRange=function(e){var i=this.mediaSource,o=e.fragments,S=o.length;if(S&&e.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var E=Math.max(0,o[0].start),y=Math.max(E,E+e.totalduration);i.setLiveSeekableRange(E,y)}},n.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,i=this.operationQueue,o=this.pendingTracks,S=Object.keys(o).length;if(S&&!e||S===2){this.createSourceBuffers(o),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(x.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(y){i.executeNext(y)})}},n.createSourceBuffers=function(e){var i=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var E in e)if(!i[E]){var y=e[E];if(!y)throw Error("source buffer exists for track "+E+", however track does not");var T=y.levelCodec||y.codec,_=y.container+";codecs="+T;O.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var l=i[E]=o.addSourceBuffer(_),d=E;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[E]={buffer:l,codec:T,container:y.container,levelCodec:y.levelCodec,id:y.id},S++}catch(a){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+a.message),this.hls.trigger(x.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:a,mimeType:_})}}S&&this.hls.trigger(x.Events.BUFFER_CREATED,{tracks:this.tracks})},n._onSBUpdateStart=function(e){var i=this.operationQueue,o=i.current(e);o.onStart()},n._onSBUpdateEnd=function(e){var i=this.operationQueue,o=i.current(e);o.onComplete(),i.shiftAndExecuteNext(e)},n._onSBUpdateError=function(e,i){O.logger.error("[buffer-controller]: "+e+" SourceBuffer error",i),this.hls.trigger(x.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(e);o&&o.onError(i)},n.removeExecutor=function(e,i,o){var S=this.media,E=this.mediaSource,y=this.operationQueue,T=this.sourceBuffer,_=T[e];if(!S||!E||!_){O.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),y.shiftAndExecuteNext(e);return}var l=Object(W.isFiniteNumber)(S.duration)?S.duration:Infinity,d=Object(W.isFiniteNumber)(E.duration)?E.duration:Infinity,a=Math.max(0,i),c=Math.min(o,l,d);c>a?(O.logger.log("[buffer-controller]: Removing ["+a+","+c+"] from the "+e+" SourceBuffer"),console.assert(!_.updating,e+" sourceBuffer must not be updating"),_.remove(a,c)):y.shiftAndExecuteNext(e)},n.appendExecutor=function(e,i){var o=this.operationQueue,S=this.sourceBuffer,E=S[i];if(!E){O.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(i);return}E.ended=!1,console.assert(!E.updating,i+" sourceBuffer must not be updating"),E.appendBuffer(e)},n.blockBuffers=function(e,i){var o=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(e);return}var S=this.operationQueue,E=i.map(function(y){return S.appendBlocker(y)});Promise.all(E).then(function(){e(),i.forEach(function(y){var T=o.sourceBuffer[y];(!T||!T.updating)&&S.shiftAndExecuteNext(y)})})},n.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},n.addBufferListener=function(e,i,o){var S=this.sourceBuffer[e];if(!S)return;var E=o.bind(this,e);this.listeners[e].push({event:i,listener:E}),S.addEventListener(i,E)},n.removeBufferListeners=function(e){var i=this.sourceBuffer[e];if(!i)return;this.listeners[e].forEach(function(o){i.removeEventListener(o.event,o.listener)})},t}()},"./src/controller/buffer-operation-queue.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return x});var W=L("./src/utils/logger.ts"),x=function(){function O(h){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=h}var j=O.prototype;return j.append=function(D,w){var g=this.queues[w];g.push(D),g.length===1&&this.buffers[w]&&this.executeNext(w)},j.insertAbort=function(D,w){var g=this.queues[w];g.unshift(D),this.executeNext(w)},j.appendBlocker=function(D){var w,g=new Promise(function(u){w=u}),m={execute:w,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,D),g},j.executeNext=function(D){var w=this.buffers,g=this.queues,m=w[D],u=g[D];if(u.length){var r=u[0];try{r.execute()}catch(t){W.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),r.onError(t),(!m||!m.updating)&&(u.shift(),this.executeNext(D))}}},j.shiftAndExecuteNext=function(D){this.queues[D].shift(),this.executeNext(D)},j.current=function(D){return this.queues[D][0]},O}()},"./src/controller/cap-level-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/events.ts");function x(h,D){for(var w=0;w<D.length;w++){var g=D[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function O(h,D,w){return D&&x(h.prototype,D),w&&x(h,w),h}var j=function(){function h(w){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=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var D=h.prototype;return D.setStreamController=function(g){this.streamController=g},D.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},D.registerListeners=function(){var g=this.hls;g.on(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},D.unregisterListener=function(){var g=this.hls;g.off(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},D.onFpsDropLevelCapping=function(g,m){h.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},D.onMediaAttaching=function(g,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},D.onManifestParsed=function(g,m){var u=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,u.config.capLevelToPlayerSize&&m.video&&this.startCapping()},D.onBufferCodecs=function(g,m){var u=this.hls;u.config.capLevelToPlayerSize&&m.video&&this.startCapping()},D.onMediaDetaching=function(){this.stopCapping()},D.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(g.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},D.getMaxLevel=function(g){var m=this,u=this.hls.levels;if(!u.length)return-1;var r=u.filter(function(t,n){return h.isLevelAllowed(n,m.restrictedLevels)&&n<=g});return this.clientRect=null,h.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)},D.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()},D.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},D.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,m={width:0,height:0};if(g){var u=g.getBoundingClientRect();m.width=u.width,m.height=u.height,!m.width&&!m.height&&(m.width=u.right-u.left||g.width||0,m.height=u.bottom-u.top||g.height||0)}return this.clientRect=m,m},h.isLevelAllowed=function(g,m){return m===void 0&&(m=[]),m.indexOf(g)===-1},h.getMaxLevelByMediaSize=function(g,m,u){if(!g||!g.length)return-1;for(var r=function(i,o){return o?i.width!==o.width||i.height!==o.height:!0},t=g.length-1,n=0;n<g.length;n+=1){var s=g[n];if((s.width>=m||s.height>=u)&&r(s,g[n+1])){t=n;break}}return t},O(h,[{key:"mediaWidth",get:function(){return this.getDimensions().width*h.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*h.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(m){}return g}}]),h}();H.default=j},"./src/controller/cmcd-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return r});var W=L("./src/events.ts"),x=L("./src/types/cmcd.ts"),O=L("./src/utils/buffer-helper.ts"),j=L("./src/utils/logger.ts");function h(t,n){for(var s=0;s<n.length;s++){var e=n[s];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function D(t,n,s){return n&&h(t.prototype,n),s&&h(t,s),t}function w(t,n){var s=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=g(t))||n&&t&&typeof t.length=="number"){s&&(t=s);var e=0;return function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}}}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 g(t,n){if(!t)return;if(typeof t=="string")return m(t,n);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return m(t,n)}function m(t,n){(n==null||n>t.length)&&(n=t.length);for(var s=0,e=new Array(n);s<n;s++)e[s]=t[s];return e}function u(){return u=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&(t[e]=s[e])}return t},u.apply(this,arguments)}var r=function(){function t(s){var e=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(){e.initialized&&(e.starved=!0),e.buffering=!0},this.onPlaying=function(){e.initialized||(e.initialized=!0),e.buffering=!1},this.applyPlaylistData=function(S){try{e.apply(S,{ot:x.CMCDObjectType.MANIFEST,su:!e.initialized})}catch(E){j.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(S){try{var E=S.frag,y=e.hls.levels[E.level],T=e.getObjectType(E),_={d:E.duration*1e3,ot:T};(T===x.CMCDObjectType.VIDEO||T===x.CMCDObjectType.AUDIO||T==x.CMCDObjectType.MUXED)&&(_.br=y.bitrate/1e3,_.tb=e.getTopBandwidth(T),_.bl=e.getBufferLength(T)),e.apply(S,_)}catch(l){j.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=s;var i=this.config=s.config,o=i.cmcd;o!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||t.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this)},n.unregisterListeners=function(){var e=this.hls;e.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},n.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},n.onMediaAttached=function(e,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},n.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},n.onBufferCreated=function(e,i){var o,S;this.audioBuffer=(o=i.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(S=i.tracks.video)===null||S===void 0?void 0:S.buffer},n.createData=function(){var e;return{v:x.CMCDVersion,sf:x.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)===null||e===void 0?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},n.apply=function(e,i){i===void 0&&(i={}),u(i,this.createData());var o=i.ot===x.CMCDObjectType.INIT||i.ot===x.CMCDObjectType.VIDEO||i.ot===x.CMCDObjectType.MUXED;if(this.starved&&o&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var S=t.toHeaders(i);if(!Object.keys(S).length)return;e.headers||(e.headers={}),u(e.headers,S)}else{var E=t.toQuery(i);if(!E)return;e.url=t.appendQueryToUri(e.url,E)}},n.getObjectType=function(e){var i=e.type;return i==="subtitle"?x.CMCDObjectType.TIMED_TEXT:e.sn==="initSegment"?x.CMCDObjectType.INIT:i==="audio"?x.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?x.CMCDObjectType.VIDEO:x.CMCDObjectType.MUXED:void 0},n.getTopBandwidth=function(e){for(var i=0,o=e===x.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=w(o),E;!(E=S()).done;){var y=E.value;y.bitrate>i&&(i=y.bitrate)}return i>0?i:NaN},n.getBufferLength=function(e){var i=this.hls.media,o=e===x.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!i)return NaN;var S=O.BufferHelper.bufferInfo(o,i.currentTime,this.config.maxBufferHole);return S.len*1e3},n.createPlaylistLoader=function(){var e=this.config.pLoader,i=this.applyPlaylistData,o=e||this.config.loader;return function(){function S(y){this.loader=void 0,this.loader=new o(y)}var E=S.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(T,_,l){i(T),this.loader.load(T,_,l)},D(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},n.createFragmentLoader=function(){var e=this.config.fLoader,i=this.applyFragmentData,o=e||this.config.loader;return function(){function S(y){this.loader=void 0,this.loader=new o(y)}var E=S.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(T,_,l){i(T),this.loader.load(T,_,l)},D(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},t.uuid=function(){var e=URL.createObjectURL(new Blob),i=e.toString();return URL.revokeObjectURL(e),i.substr(i.lastIndexOf("/")+1)},t.serialize=function(e){for(var i=[],o=function(R){return!Number.isNaN(R)&&R!=null&&R!==""&&R!==!1},S=function(R){return Math.round(R)},E=function(R){return S(R/100)*100},y=function(R){return encodeURIComponent(R)},T={br:S,d:S,bl:E,dl:E,mtp:E,nor:y,rtp:E,tb:S},_=Object.keys(e||{}).sort(),l=w(_),d;!(d=l()).done;){var a=d.value,c=e[a];if(!o(c))continue;if(a==="v"&&c===1)continue;if(a=="pr"&&c===1)continue;var v=T[a];v&&(c=v(c));var f=typeof c,b=void 0;a==="ot"||a==="sf"||a==="st"?b=a+"="+c:f==="boolean"?b=a:f==="number"?b=a+"="+c:b=a+"="+JSON.stringify(c),i.push(b)}return i.join(",")},t.toHeaders=function(e){for(var i=Object.keys(e),o={},S=["Object","Request","Session","Status"],E=[{},{},{},{}],y={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},T=0,_=i;T<_.length;T++){var l=_[T],d=y[l]!=null?y[l]:1;E[d][l]=e[l]}for(var a=0;a<E.length;a++){var c=t.serialize(E[a]);c&&(o["CMCD-"+S[a]]=c)}return o},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(e,i){if(!i)return e;var o=e.includes("?")?"&":"?";return""+e+o+i},t}()},"./src/controller/eme-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/events.ts"),x=L("./src/errors.ts"),O=L("./src/utils/logger.ts"),j=L("./src/utils/mediakeys-helper.ts");function h(r,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,s.key,s)}}function D(r,t,n){return t&&h(r.prototype,t),n&&h(r,n),r}var w=3,g=function(t,n,s){var e={audioCapabilities:[],videoCapabilities:[]};return t.forEach(function(i){e.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:s.audioRobustness||""})}),n.forEach(function(i){e.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:s.videoRobustness||""})}),[e]},m=function(t,n,s,e){switch(t){case j.KeySystems.WIDEVINE:return g(n,s,e);default:throw new Error("Unknown key-system: "+t)}},u=function(){function r(n){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=n,this._config=n.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 t=r.prototype;return t.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},t._registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t._unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t.getLicenseServerUrl=function(s){switch(s){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},t._attemptKeySystemAccess=function(s,e,i){var o=this,S=m(s,e,i,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(s,S);this.mediaKeysPromise=E.then(function(y){return o._onMediaKeySystemAccessObtained(s,y)}),E.catch(function(y){O.logger.error('Failed to obtain key-system "'+s+'" access:',y)})},t._onMediaKeySystemAccessObtained=function(s,e){var i=this;O.logger.log('Access for key-system "'+s+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:s};this._mediaKeysList.push(o);var S=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(E){return o.mediaKeys=E,O.logger.log('Media-keys created for key-system "'+s+'"'),i._onMediaKeysCreated(),E});return S.catch(function(E){O.logger.error("Failed to create media-keys:",E)}),S},t._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),s._onNewMediaKeySession(e.mediaKeysSession))})},t._onNewMediaKeySession=function(s){var e=this;O.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(i){e._onKeySessionMessage(s,i.message)},!1)},t._onKeySessionMessage=function(s,e){O.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(i){O.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),s.update(i)})},t.onMediaEncrypted=function(s){var e=this;if(O.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(S){if(!e._media)return;e._attemptSetMediaKeys(S),e._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(i).catch(i)},t._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},t._generateRequestWithPreferredKeySession=function(s,e){var i=this,o=this._mediaKeysList[0];if(!o){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var S=o.mediaKeysSession;if(!S){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!e){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+s+'" init data type'),o.mediaKeysSessionInitialized=!0,S.generateRequest(s,e).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(E){O.logger.error("Error generating key-session request:",E),i.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},t._createLicenseXhr=function(s,e,i){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,s,e,i);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,o,s),S=void 0}catch(E){O.logger.error(E)}try{o.readyState||o.open("POST",s,!0),S&&S.call(this.hls,o,s)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return o},t._onLicenseRequestReadyStageChange=function(s,e,i,o){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var S=s.response,E=this._licenseResponseCallback;if(E)try{S=E.call(this.hls,s,e)}catch(T){O.logger.error(T)}o(S)}else{if(O.logger.error("License Request XHR failed ("+e+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w){this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var y=w-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+y+" attempts left"),this._requestLicense(i,o)}break}},t._generateLicenseRequestChallenge=function(s,e){switch(s.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},t._requestLicense=function(s,e){O.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(i.mediaKeySystemDomain),S=this._createLicenseXhr(o,s,e);O.logger.log("Sending license request to URL: "+o);var E=this._generateLicenseRequestChallenge(i,s);S.send(E)}catch(y){O.logger.error("Failure requesting DRM license: "+y),this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.KEY_SYSTEM_ERROR,details:x.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},t.onMediaAttached=function(s,e){if(!this._emeEnabled)return;var i=e.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},t.onMediaDetached=function(){var s=this._media,e=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},t.onManifestParsed=function(s,e){if(!this._emeEnabled)return;var i=e.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),o=e.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,i,o)},D(r,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),r}();H.default=u},"./src/controller/fps-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/events.ts"),x=L("./src/utils/logger.ts"),O=function(){function j(D){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=D,this.registerListeners()}var h=j.prototype;return h.setStreamController=function(w){this.streamController=w},h.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},h.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching)},h.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},h.onMediaAttaching=function(w,g){var m=this.hls.config;if(m.capLevelOnFPSDrop){var u=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},h.checkFPS=function(w,g,m){var u=performance.now();if(g){if(this.lastTime){var r=u-this.lastTime,t=m-this.lastDroppedFrames,n=g-this.lastDecodedFrames,s=1e3*t/r,e=this.hls;if(e.trigger(W.Events.FPS_DROP,{currentDropped:t,currentDecoded:n,totalDroppedFrames:m}),s>0&&t>e.config.fpsDroppedMonitoringThreshold*n){var i=e.currentLevel;x.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(e.autoLevelCapping===-1||e.autoLevelCapping>=i)&&(i=i-1,e.trigger(W.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:e.currentLevel}),e.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=m,this.lastDecodedFrames=g}},h.checkFPSInterval=function(){var w=this.media;if(w)if(this.isVideoPlaybackQualityAvailable){var g=w.getVideoPlaybackQuality();this.checkFPS(w,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(w,w.webkitDecodedFrameCount,w.webkitDroppedFrameCount)},j}();H.default=O},"./src/controller/fragment-finders.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"findFragmentByPDT",function(){return O}),L.d(H,"findFragmentByPTS",function(){return j}),L.d(H,"fragmentWithinToleranceTest",function(){return h}),L.d(H,"pdtWithinToleranceTest",function(){return D}),L.d(H,"findFragWithCC",function(){return w});var W=L("./src/polyfills/number.ts"),x=L("./src/utils/binary-search.ts");function O(g,m,u){if(m===null||!Array.isArray(g)||!g.length||!Object(W.isFiniteNumber)(m))return null;var r=g[0].programDateTime;if(m<(r||0))return null;var t=g[g.length-1].endProgramDateTime;if(m>=(t||0))return null;u=u||0;for(var n=0;n<g.length;++n){var s=g[n];if(D(m,u,s))return s}return null}function j(g,m,u,r){u===void 0&&(u=0),r===void 0&&(r=0);var t=null;if(g?t=m[g.sn-m[0].sn+1]||null:u===0&&m[0].start===0&&(t=m[0]),t&&h(u,r,t)===0)return t;var n=x.default.search(m,h.bind(null,u,r));return n||t}function h(g,m,u){g===void 0&&(g=0),m===void 0&&(m=0);var r=Math.min(m,u.duration+(u.deltaPTS?u.deltaPTS:0));return u.start+u.duration-r<=g?1:u.start-r>g&&u.start?-1:0}function D(g,m,u){var r=Math.min(m,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,t=u.endProgramDateTime||0;return t-r>g}function w(g,m){return x.default.search(g,function(u){return u.cc<m?1:u.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"FragmentState",function(){return O}),L.d(H,"FragmentTracker",function(){return j});var W=L("./src/events.ts"),x=L("./src/types/loader.ts"),O;(function(w){w.NOT_LOADED="NOT_LOADED",w.BACKTRACKED="BACKTRACKED",w.APPENDING="APPENDING",w.PARTIAL="PARTIAL",w.OK="OK"})(O||(O={}));var j=function(){function w(m){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=m,this._registerListeners()}var g=w.prototype;return g._registerListeners=function(){var u=this.hls;u.on(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(W.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var u=this.hls;u.off(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(W.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(u,r){if(r===x.PlaylistLevelType.MAIN){var t=this.activeFragment,n=this.activeParts;if(!t)return null;if(n)for(var s=n.length;s--;){var e=n[s],i=e?e.end:t.appendedPTS;if(e.start<=u&&i!==void 0&&u<=i)return s>9&&(this.activeParts=n.slice(s-9)),e}else if(t.start<=u&&t.appendedPTS!==void 0&&u<=t.appendedPTS)return t}return this.getBufferedFrag(u,r)},g.getBufferedFrag=function(u,r){for(var t=this.fragments,n=Object.keys(t),s=n.length;s--;){var e=t[n[s]];if((e==null?void 0:e.body.type)===r&&e.buffered){var i=e.body;if(i.start<=u&&u<=i.end)return i}}return null},g.detectEvictedFragments=function(u,r,t){var n=this;Object.keys(this.fragments).forEach(function(s){var e=n.fragments[s];if(!e)return;if(!e.buffered){e.body.type===t&&n.removeFragment(e.body);return}var i=e.range[u];if(!i)return;i.time.some(function(o){var S=!n.isTimeBuffered(o.startPTS,o.endPTS,r);return S&&n.removeFragment(e.body),S})})},g.detectPartialFragments=function(u){var r=this,t=this.timeRanges,n=u.frag,s=u.part;if(!t||n.sn==="initSegment")return;var e=D(n),i=this.fragments[e];if(!i)return;Object.keys(t).forEach(function(o){var S=n.elementaryStreams[o];if(!S)return;var E=t[o],y=s!==null||S.partial===!0;i.range[o]=r.getBufferedTimes(n,s,y,E)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},g.fragBuffered=function(u){var r=D(u),t=this.fragments[r];t&&(t.backtrack=t.loaded=null,t.buffered=!0)},g.getBufferedTimes=function(u,r,t,n){for(var s={time:[],partial:t},e=r?r.start:u.start,i=r?r.end:u.end,o=u.minEndPTS||i,S=u.maxStartPTS||e,E=0;E<n.length;E++){var y=n.start(E)-this.bufferPadding,T=n.end(E)+this.bufferPadding;if(S>=y&&o<=T){s.time.push({startPTS:Math.max(e,n.start(E)),endPTS:Math.min(i,n.end(E))});break}else if(e<T&&i>y)s.partial=!0,s.time.push({startPTS:Math.max(e,n.start(E)),endPTS:Math.min(i,n.end(E))});else if(i<=y)break}return s},g.getPartialFragment=function(u){var r=null,t,n,s,e=0,i=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(S){var E=o[S];if(!E)return;h(E)&&(n=E.body.start-i,s=E.body.end+i,u>=n&&u<=s&&(t=Math.min(u-n,s-u),e<=t&&(r=E.body,e=t)))}),r},g.getState=function(u){var r=D(u),t=this.fragments[r];return t?t.buffered?h(t)?O.PARTIAL:O.OK:t.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},g.backtrack=function(u,r){var t=D(u),n=this.fragments[t];if(!n||n.backtrack)return null;var s=n.backtrack=r||n.loaded;return n.loaded=null,s},g.getBacktrackData=function(u){var r=D(u),t=this.fragments[r];if(t){var n,s=t.backtrack;if(s!=null&&(n=s.payload)!==null&&n!==void 0&&n.byteLength)return s;this.removeFragment(u)}return null},g.isTimeBuffered=function(u,r,t){for(var n,s,e=0;e<t.length;e++){if(n=t.start(e)-this.bufferPadding,s=t.end(e)+this.bufferPadding,u>=n&&r<=s)return!0;if(r<=n)return!1}return!1},g.onFragLoaded=function(u,r){var t=r.frag,n=r.part;if(t.sn==="initSegment"||t.bitrateTest||n)return;var s=D(t);this.fragments[s]={body:t,loaded:r,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(u,r){var t=this,n=r.frag,s=r.part,e=r.timeRanges;if(n.type===x.PlaylistLevelType.MAIN)if(this.activeFragment=n,s){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(s)}else this.activeParts=null;this.timeRanges=e,Object.keys(e).forEach(function(o){var S=e[o];if(t.detectEvictedFragments(o,S),!s)for(var E=0;E<S.length;E++)n.appendedPTS=Math.max(S.end(E),n.appendedPTS||0)})},g.onFragBuffered=function(u,r){this.detectPartialFragments(r)},g.hasFragment=function(u){var r=D(u);return!!this.fragments[r]},g.removeFragmentsInRange=function(u,r,t){var n=this;Object.keys(this.fragments).forEach(function(s){var e=n.fragments[s];if(!e)return;if(e.buffered){var i=e.body;i.type===t&&i.start<r&&i.end>u&&n.removeFragment(i)}})},g.removeFragment=function(u){var r=D(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[r]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},w}();function h(w){var g,m;return w.buffered&&(((g=w.range.video)===null||g===void 0?void 0:g.partial)||((m=w.range.audio)===null||m===void 0?void 0:m.partial))}function D(w){return w.type+"_"+w.level+"_"+w.urlId+"_"+w.sn}},"./src/controller/gap-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"STALL_MINIMUM_DURATION_MS",function(){return h}),L.d(H,"MAX_START_GAP_JUMP",function(){return D}),L.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return w}),L.d(H,"SKIP_BUFFER_RANGE_START",function(){return g}),L.d(H,"default",function(){return m});var W=L("./src/utils/buffer-helper.ts"),x=L("./src/errors.ts"),O=L("./src/events.ts"),j=L("./src/utils/logger.ts"),h=250,D=2,w=.1,g=.05,m=function(){function u(t,n,s,e){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=t,this.media=n,this.fragmentTracker=s,this.hls=e}var r=u.prototype;return r.destroy=function(){this.hls=this.fragmentTracker=this.media=null},r.poll=function(n){var s=this.config,e=this.media,i=this.stalled,o=e.currentTime,S=e.seeking,E=this.seeking&&!S,y=!this.seeking&&S;if(this.seeking=S,o!==n){if(this.moved=!0,i!==null){if(this.stallReported){var T=self.performance.now()-i;j.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(T)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((y||E)&&(this.stalled=null),e.paused||e.ended||e.playbackRate===0||!W.BufferHelper.getBuffered(e).length)return;var _=W.BufferHelper.bufferInfo(e,o,0),l=_.len>0,d=_.nextStart||0;if(!l&&!d)return;if(S){var a=_.len>D,c=!d||d-o>D&&!this.fragmentTracker.getPartialFragment(o);if(a||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,f=Math.max(d,_.start||0)-o,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=b==null||((v=b.details)===null||v===void 0)?void 0:v.live,R=I?b.details.targetduration*2:D;if(f>0&&f<=R){this._trySkipBufferHole(null);return}}var P=self.performance.now();if(i===null){this.stalled=P;return}var M=P-i;!S&&M>=h&&this._reportStall(_.len);var F=W.BufferHelper.bufferInfo(e,o,s.maxBufferHole);this._tryFixBufferStall(F,M)},r._tryFixBufferStall=function(n,s){var e=this.config,i=this.fragmentTracker,o=this.media,S=o.currentTime,E=i.getPartialFragment(S);if(E){var y=this._trySkipBufferHole(E);if(y)return}n.len>e.maxBufferHole&&s>e.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},r._reportStall=function(n){var s=this.hls,e=this.media,i=this.stallReported;i||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+e.currentTime+" due to low buffer (buffer="+n+")"),s.trigger(O.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:n}))},r._trySkipBufferHole=function(n){for(var s=this.config,e=this.hls,i=this.media,o=i.currentTime,S=0,E=W.BufferHelper.getBuffered(i),y=0;y<E.length;y++){var T=E.start(y);if(o+s.maxBufferHole>=S&&o<T){var _=Math.max(T+g,i.currentTime+w);return j.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+_),this.moved=!0,this.stalled=null,i.currentTime=_,n&&e.trigger(O.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+_,frag:n}),_}S=E.end(y)}return 0},r._tryNudgeBuffer=function(){var n=this.config,s=this.hls,e=this.media,i=e.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<n.nudgeMaxRetry){var S=i+o*n.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+i+" to "+S),e.currentTime=S,s.trigger(O.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+n.nudgeMaxRetry+" nudges"),s.trigger(O.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},u}()},"./src/controller/id3-track-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/events.ts"),x=L("./src/utils/texttrack-utils.ts"),O=L("./src/demux/id3.ts"),j=.25,h=function(){function D(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var w=D.prototype;return w.destroy=function(){this._unregisterListeners()},w._registerListeners=function(){var m=this.hls;m.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var m=this.hls;m.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.onMediaAttached=function(m,u){this.media=u.media},w.onMediaDetaching=function(){if(!this.id3Track)return;Object(x.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},w.getID3Track=function(m){if(!this.media)return;for(var u=0;u<m.length;u++){var r=m[u];if(r.kind==="metadata"&&r.label==="id3")return Object(x.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(m,u){if(!this.media)return;var r=u.frag,t=u.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<t.length;s++){var e=O.getID3Frames(t[s].data);if(e){var i=t[s].pts,o=s<t.length-1?t[s+1].pts:r.end,S=o-i;S<=0&&(o=i+j);for(var E=0;E<e.length;E++){var y=e[E];if(!O.isTimeStampFrame(y)){var T=new n(i,o,"");T.value=y,this.id3Track.addCue(T)}}}}},w.onBufferFlushing=function(m,u){var r=u.startOffset,t=u.endOffset,n=u.type;if(!n||n==="audio"){var s=this.id3Track;s&&Object(x.removeCuesInRange)(s,r,t)}},D}();H.default=h},"./src/controller/latency-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return D});var W=L("./src/errors.ts"),x=L("./src/events.ts"),O=L("./src/utils/logger.ts");function j(w,g){for(var m=0;m<g.length;m++){var u=g[m];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function h(w,g,m){return g&&j(w.prototype,g),m&&j(w,m),w}var D=function(){function w(m){var u=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 u.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var g=w.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(x.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(x.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(x.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(x.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(x.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(x.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(x.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(x.Events.ERROR,this.onError)},g.onMediaAttached=function(u,r){this.media=r.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(u,r){var t=r.details;this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(u,r){if(r.details!==W.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var u=this.media,r=this.levelDetails;if(!u||!r)return;this.currentTime=u.currentTime;var t=this.computeLatency();if(t===null)return;this._latency=t;var n=this.config,s=n.lowLatencyMode,e=n.maxLiveSyncPlaybackRate;if(!s||e===1)return;var i=this.targetLatency;if(i===null)return;var o=t-i,S=Math.min(this.maxLatency,i+r.targetduration),E=o<S;if(r.live&&E&&o>.05&&this.forwardBufferLength>1){var y=Math.min(2,Math.max(1,e)),T=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;u.playbackRate=Math.min(y,Math.max(1,T))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},g.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},g.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},h(w,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,r=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:r?u.liveMaxLatencyDurationCount*r.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var r=u.holdBack,t=u.partHoldBack,n=u.targetduration,s=this.config,e=s.liveSyncDuration,i=s.liveSyncDurationCount,o=s.lowLatencyMode,S=this.hls.userConfig,E=o&&t||r;(S.liveSyncDuration||S.liveSyncDurationCount||E===0)&&(E=e!==void 0?e:i*n);var y=n,T=1;return E+Math.min(this.stallCount*T,y)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),r=this.targetLatency,t=this.levelDetails;if(u===null||r===null||t===null)return null;var n=t.edge,s=u-r-this.edgeStalled,e=n-t.totalduration,i=n-(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.min(Math.max(e,s),i)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var r=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-r,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,r=this.levelDetails;if(!u||!r)return 0;var t=u.buffered.length;return t?u.buffered.end(t-1):r.edge-this.currentTime}}]),w}()},"./src/controller/level-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return s});var W=L("./src/types/level.ts"),x=L("./src/events.ts"),O=L("./src/errors.ts"),j=L("./src/utils/codecs.ts"),h=L("./src/controller/level-helper.ts"),D=L("./src/controller/base-playlist-controller.ts"),w=L("./src/types/loader.ts");function g(){return g=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var S in o)Object.prototype.hasOwnProperty.call(o,S)&&(e[S]=o[S])}return e},g.apply(this,arguments)}function m(e,i){for(var o=0;o<i.length;o++){var S=i[o];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(e,S.key,S)}}function u(e,i,o){return i&&m(e.prototype,i),o&&m(e,o),e}function r(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,t(e,i)}function t(e,i){return t=Object.setPrototypeOf||function(S,E){return S.__proto__=E,S},t(e,i)}var n=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(e){r(i,e);function i(S){var E;return E=e.call(this,S,"[level-controller]")||this,E._levels=[],E._firstLevel=-1,E._startLevel=void 0,E.currentLevelIndex=-1,E.manualLevelIndex=-1,E.onParsedComplete=void 0,E._registerListeners(),E}var o=i.prototype;return o._registerListeners=function(){var E=this.hls;E.on(x.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(x.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(x.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(x.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var E=this.hls;E.off(x.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(x.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(x.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(x.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},o.startLoad=function(){var E=this._levels;E.forEach(function(y){y.loadError=0}),e.prototype.startLoad.call(this)},o.onManifestLoaded=function(E,y){var T=[],_=[],l=[],d,a={},c,v=!1,f=!1,b=!1;if(y.levels.forEach(function(M){var F=M.attrs;v=v||!!(M.width&&M.height),f=f||!!M.videoCodec,b=b||!!M.audioCodec,n&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var A=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;c=a[A],c?c.url.push(M.url):(c=new W.Level(M),a[A]=c,T.push(c)),F&&(F.AUDIO&&Object(h.addGroupId)(c,"audio",F.AUDIO),F.SUBTITLES&&Object(h.addGroupId)(c,"text",F.SUBTITLES))}),(v||f)&&b&&(T=T.filter(function(M){var F=M.videoCodec,A=M.width,B=M.height;return!!F||!!(A&&B)})),T=T.filter(function(M){var F=M.audioCodec,A=M.videoCodec;return(!F||Object(j.isCodecSupportedInMp4)(F,"audio"))&&(!A||Object(j.isCodecSupportedInMp4)(A,"video"))}),y.audioTracks&&(_=y.audioTracks.filter(function(M){return!M.audioCodec||Object(j.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(h.assignTrackIdsByGroup)(_)),y.subtitles&&(l=y.subtitles,Object(h.assignTrackIdsByGroup)(l)),T.length>0){d=T[0].bitrate,T.sort(function(M,F){return M.bitrate-F.bitrate}),this._levels=T;for(var I=0;I<T.length;I++)if(T[I].bitrate===d){this._firstLevel=I,this.log("manifest loaded, "+T.length+" level(s) found, first bitrate: "+d);break}var R=b&&!f,P={levels:T,audioTracks:_,subtitleTracks:l,firstLevel:this._firstLevel,stats:y.stats,audio:b,video:f,altAudio:!R&&_.some(function(M){return!!M.url})};this.hls.trigger(x.Events.MANIFEST_PARSED,P),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(x.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:y.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(E,y){if(e.prototype.onError.call(this,E,y),y.fatal)return;var T=y.context,_=this._levels[this.currentLevelIndex];if(T&&(T.type===w.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&T.groupId===_.audioGroupIds[_.urlId]||T.type===w.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&T.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var l=!1,d=!0,a;switch(y.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:case O.ErrorDetails.KEY_LOAD_ERROR:case O.ErrorDetails.KEY_LOAD_TIMEOUT:if(y.frag){var c=this._levels[y.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(a=y.frag.level)):a=y.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:T&&(T.deliveryDirectives&&(d=!1),a=T.level),l=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:a=y.level,l=!0;break}a!==void 0&&this.recoverLevel(y,a,l,d)},o.recoverLevel=function(E,y,T,_){var l=E.details,d=this._levels[y];if(d.loadError++,T){var a=this.retryLoadingOrFail(E);if(a)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var c=d.url.length;if(c>1&&d.loadError<c)E.levelRetry=!0,this.redundantFailover(y);else if(this.manualLevelIndex===-1){var v=y===0?this._levels.length-1:y-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(l+": switch to "+v),E.levelRetry=!0,this.hls.nextAutoLevel=v)}}},o.redundantFailover=function(E){var y=this._levels[E],T=y.url.length;if(T>1){var _=(y.urlId+1)%T;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(l){l.urlId=_}),this.level=E}},o.onFragLoaded=function(E,y){var T=y.frag;if(T!==void 0&&T.type===w.PlaylistLevelType.MAIN){var _=this._levels[T.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},o.onLevelLoaded=function(E,y){var T,_=y.level,l=y.details,d=this._levels[_];if(!d){var a;this.warn("Invalid level index "+_),(a=y.deliveryDirectives)!==null&&a!==void 0&&a.skip&&(l.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(d.fragmentError===0&&(d.loadError=0,this.retryCount=0),this.playlistLoaded(_,y,d.details)):(T=y.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(l.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(E,y){var T=this.hls.levels[this.currentLevelIndex];if(!T)return;if(T.audioGroupIds){for(var _=-1,l=this.hls.audioTracks[y.id].groupId,d=0;d<T.audioGroupIds.length;d++)if(T.audioGroupIds[d]===l){_=d;break}_!==T.urlId&&(T.urlId=_,this.startLoad())}},o.loadPlaylist=function(E){var y=this.currentLevelIndex,T=this._levels[y];if(this.canLoad&&T&&T.url.length>0){var _=T.urlId,l=T.url[_];if(E)try{l=E.addDirectives(l)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("Attempt loading level index "+y+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+_+" "+l),this.clearTimer(),this.hls.trigger(x.Events.LEVEL_LOADING,{url:l,level:y,id:_,deliveryDirectives:E||null})}},o.removeLevel=function(E,y){var T=function(d,a){return a!==y},_=this._levels.filter(function(l,d){return d!==E?!0:l.url.length>1&&y!==void 0?(l.url=l.url.filter(T),l.audioGroupIds&&(l.audioGroupIds=l.audioGroupIds.filter(T)),l.textGroupIds&&(l.textGroupIds=l.textGroupIds.filter(T)),l.urlId=0,!0):!1}).map(function(l,d){var a=l.details;return a!=null&&a.fragments&&a.fragments.forEach(function(c){c.level=d}),l});this._levels=_,this.hls.trigger(x.Events.LEVELS_UPDATED,{levels:_})},u(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var y,T=this._levels;if(T.length===0)return;if(this.currentLevelIndex===E&&(y=T[E])!==null&&y!==void 0&&y.details)return;if(E<0||E>=T.length){var _=E<0;if(this.hls.trigger(x.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:_,reason:"invalid level idx"}),_)return;E=Math.min(E,T.length-1)}this.clearTimer();var l=this.currentLevelIndex,d=T[l],a=T[E];this.log("switching to level "+E+" from "+l),this.currentLevelIndex=E;var c=g({},a,{level:E,maxBitrate:a.maxBitrate,uri:a.uri,urlId:a.urlId});delete c._urlId,this.hls.trigger(x.Events.LEVEL_SWITCHING,c);var v=a.details;if(!v||v.live){var f=this.switchParams(a.uri,d==null?void 0:d.details);this.loadPlaylist(f)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),i}(D.default)},"./src/controller/level-helper.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"addGroupId",function(){return O}),L.d(H,"assignTrackIdsByGroup",function(){return j}),L.d(H,"updatePTS",function(){return h}),L.d(H,"updateFragPTSDTS",function(){return w}),L.d(H,"mergeDetails",function(){return g}),L.d(H,"mapPartIntersection",function(){return m}),L.d(H,"mapFragmentIntersection",function(){return u}),L.d(H,"adjustSliding",function(){return r}),L.d(H,"addSliding",function(){return t}),L.d(H,"computeReloadInterval",function(){return n}),L.d(H,"getFragmentWithSN",function(){return s}),L.d(H,"getPartWith",function(){return e});var W=L("./src/polyfills/number.ts"),x=L("./src/utils/logger.ts");function O(i,o,S){switch(o){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(S);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(S);break}}function j(i){var o={};i.forEach(function(S){var E=S.groupId||"";S.id=o[E]=o[E]||0,o[E]++})}function h(i,o,S){var E=i[o],y=i[S];D(E,y)}function D(i,o){var S=o.startPTS;if(Object(W.isFiniteNumber)(S)){var E=0,y;o.sn>i.sn?(E=S-i.start,y=i):(E=i.start-S,y=o),y.duration!==E&&(y.duration=E)}else if(o.sn>i.sn){var T=i.cc===o.cc;T&&i.minEndPTS?o.start=i.start+(i.minEndPTS-i.start):o.start=i.start+i.duration}else o.start=Math.max(i.start-o.duration,0)}function w(i,o,S,E,y,T){var _=E-S;_<=0&&(x.logger.warn("Fragment should have a positive duration",o),E=S+o.duration,T=y+o.duration);var l=S,d=E,a=o.startPTS,c=o.endPTS;if(Object(W.isFiniteNumber)(a)){var v=Math.abs(a-S);Object(W.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(v,o.deltaPTS):o.deltaPTS=v,l=Math.max(S,a),S=Math.min(S,a),y=Math.min(y,o.startDTS),d=Math.min(E,c),E=Math.max(E,c),T=Math.max(T,o.endDTS)}o.duration=E-S;var f=S-o.start;o.appendedPTS=E,o.start=o.startPTS=S,o.maxStartPTS=l,o.startDTS=y,o.endPTS=E,o.minEndPTS=d,o.endDTS=T;var b=o.sn;if(!i||b<i.startSN||b>i.endSN)return 0;var I,R=b-i.startSN,P=i.fragments;for(P[R]=o,I=R;I>0;I--)D(P[I],P[I-1]);for(I=R;I<P.length-1;I++)D(P[I],P[I+1]);return i.fragmentHint&&D(P[P.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,f}function g(i,o){for(var S=null,E=i.fragments,y=E.length-1;y>=0;y--){var T=E[y].initSegment;if(T){S=T;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var _=0,l;if(u(i,o,function(I,R){I.relurl&&(_=I.cc-R.cc),Object(W.isFiniteNumber)(I.startPTS)&&Object(W.isFiniteNumber)(I.endPTS)&&(R.start=R.startPTS=I.startPTS,R.startDTS=I.startDTS,R.appendedPTS=I.appendedPTS,R.maxStartPTS=I.maxStartPTS,R.endPTS=I.endPTS,R.endDTS=I.endDTS,R.minEndPTS=I.minEndPTS,R.duration=I.endPTS-I.startPTS,R.duration&&(l=R),o.PTSKnown=o.alignedSliding=!0),R.elementaryStreams=I.elementaryStreams,R.loader=I.loader,R.stats=I.stats,R.urlId=I.urlId,I.initSegment&&(R.initSegment=I.initSegment,S=I.initSegment)}),S){var d=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;d.forEach(function(I){var R;(!I.initSegment||I.initSegment.relurl===((R=S)===null||R===void 0?void 0:R.relurl))&&(I.initSegment=S)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(I){return!I}),o.deltaUpdateFailed)){x.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var a=o.skippedSegments;a--;)o.fragments.shift();o.startSN=o.fragments[0].sn,o.startCC=o.fragments[0].cc}var c=o.fragments;if(_){x.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<c.length;v++)c[v].cc+=_}o.skippedSegments&&(o.startCC=o.fragments[0].cc),m(i.partList,o.partList,function(I,R){R.elementaryStreams=I.elementaryStreams,R.stats=I.stats}),l?w(o,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):r(i,o),c.length&&(o.totalduration=o.edge-c[0].start),o.driftStartTime=i.driftStartTime,o.driftStart=i.driftStart;var f=o.advancedDateTime;if(o.advanced&&f){var b=o.edge;o.driftStart||(o.driftStartTime=f,o.driftStart=b),o.driftEndTime=f,o.driftEnd=b}else o.driftEndTime=i.driftEndTime,o.driftEnd=i.driftEnd,o.advancedDateTime=i.advancedDateTime}function m(i,o,S){if(i&&o)for(var E=0,y=0,T=i.length;y<=T;y++){var _=i[y],l=o[y+E];_&&l&&_.index===l.index&&_.fragment.sn===l.fragment.sn?S(_,l):E--}}function u(i,o,S){for(var E=o.skippedSegments,y=Math.max(i.startSN,o.startSN)-o.startSN,T=(i.fragmentHint?1:0)+(E?o.endSN:Math.min(i.endSN,o.endSN))-o.startSN,_=o.startSN-i.startSN,l=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,d=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,a=y;a<=T;a++){var c=d[_+a],v=l[a];E&&!v&&a<E&&(v=o.fragments[a]=c),c&&v&&S(c,v)}}function r(i,o){var S=o.startSN+o.skippedSegments-i.startSN,E=i.fragments;if(S<0||S>=E.length)return;t(o,E[S].start)}function t(i,o){if(o){for(var S=i.fragments,E=i.skippedSegments;E<S.length;E++)S[E].start+=o;i.fragmentHint&&(i.fragmentHint.start+=o)}}function n(i,o){var S=1e3*i.levelTargetDuration,E=S/2,y=i.age,T=y>0&&y<S*3,_=o.loading.end-o.loading.start,l,d=i.availabilityDelay;if(i.updated===!1)if(T){var a=333*i.misses;l=Math.max(Math.min(E,_*2),a),i.availabilityDelay=(i.availabilityDelay||0)+l}else l=E;else T?(d=Math.min(d||S/2,y),i.availabilityDelay=d,l=d+S-y):l=S-_;return Math.round(l)}function s(i,o,S){if(!i||!i.details)return null;var E=i.details,y=E.fragments[o-E.startSN];return y||(y=E.fragmentHint,y&&y.sn===o?y:o<E.startSN&&S&&S.sn===o?S:null)}function e(i,o,S){if(!i||!i.details)return null;var E=i.details.partList;if(E)for(var y=E.length;y--;){var T=E[y];if(T.index===S&&T.fragment.sn===o)return T}return null}},"./src/controller/stream-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return E});var W=L("./src/polyfills/number.ts"),x=L("./src/controller/base-stream-controller.ts"),O=L("./src/is-supported.ts"),j=L("./src/events.ts"),h=L("./src/utils/buffer-helper.ts"),D=L("./src/controller/fragment-tracker.ts"),w=L("./src/types/loader.ts"),g=L("./src/loader/fragment.ts"),m=L("./src/demux/transmuxer-interface.ts"),u=L("./src/types/transmuxer.ts"),r=L("./src/controller/gap-controller.ts"),t=L("./src/errors.ts"),n=L("./src/utils/logger.ts");function s(y,T){for(var _=0;_<T.length;_++){var l=T[_];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(y,l.key,l)}}function e(y,T,_){return T&&s(y.prototype,T),_&&s(y,_),y}function i(y,T){y.prototype=Object.create(T.prototype),y.prototype.constructor=y,o(y,T)}function o(y,T){return o=Object.setPrototypeOf||function(l,d){return l.__proto__=d,l},o(y,T)}var S=100,E=function(y){i(T,y);function T(l,d){var a;return a=y.call(this,l,d,"[stream-controller]")||this,a.audioCodecSwap=!1,a.gapController=null,a.level=-1,a._forceStartLoad=!1,a.altAudio=!1,a.audioOnly=!1,a.fragPlaying=null,a.onvplaying=null,a.onvseeked=null,a.fragLastKbps=0,a.stalled=!1,a.couldBacktrack=!1,a.audioCodecSwitch=!1,a.videoBuffer=null,a._registerListeners(),a}var _=T.prototype;return _._registerListeners=function(){var d=this.hls;d.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.on(j.Events.ERROR,this.onError,this),d.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var d=this.hls;d.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.off(j.Events.ERROR,this.onError,this),d.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(d){if(this.levels){var a=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=c.startLevel;v===-1&&(c.config.testBandwidth?(v=0,this.bitrateTest=!0):v=c.nextAutoLevel),this.level=c.nextLoadLevel=v,this.loadedmetadata=!1}a>0&&d===-1&&(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),d=a),this.state=x.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()}else this._forceStartLoad=!0,this.state=x.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,y.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case x.State.IDLE:this.doTickIdle();break;case x.State.WAITING_LEVEL:{var d,a=this.levels,c=this.level,v=a==null||((d=a[c])===null||d===void 0)?void 0:d.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=x.State.IDLE;break}break}case x.State.FRAG_LOADING_WAITING_RETRY:{var f,b=self.performance.now(),I=this.retryDate;(!I||b>=I||(f=this.media)!==null&&f!==void 0&&f.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=x.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){y.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var d,a,c=this.hls,v=this.levelLastLoaded,f=this.levels,b=this.media,I=c.config,R=c.nextLoadLevel;if(v===null||!b&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!f||!f[R])return;var P=f[R];this.level=c.nextLoadLevel=R;var M=P.details;if(!M||this.state===x.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==R){this.state=x.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,w.PlaylistLevelType.MAIN);if(F===null)return;var A=F.len,B=this.getMaxBufferLength(P.maxBitrate);if(A>=B)return;if(this._streamEnded(F,M)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,z),this.state=x.State.ENDED;return}var Z=F.end,ae=this.getNextFragment(Z,M);if(this.couldBacktrack&&!this.fragPrevious&&ae&&ae.sn!=="initSegment"){var De=ae.sn-M.startSN;De>1&&(ae=M.fragments[De-1],this.fragmentTracker.removeFragment(ae))}if(ae&&this.fragmentTracker.getState(ae)===D.FragmentState.OK&&this.nextLoadPosition>Z){var _e=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,_e,w.PlaylistLevelType.MAIN),ae=this.getNextFragment(this.nextLoadPosition,M)}if(!ae)return;ae.initSegment&&!ae.initSegment.data&&!this.bitrateTest&&(ae=ae.initSegment),((d=ae.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((a=ae.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(ae,M):this.loadFragment(ae,M,Z)},_.loadFragment=function(d,a,c){var v,f=this.fragmentTracker.getState(d);if(this.fragCurrent=d,f===D.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(d);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else f=D.FragmentState.NOT_LOADED}f===D.FragmentState.NOT_LOADED||f===D.FragmentState.PARTIAL?d.sn==="initSegment"?this._loadInitSegment(d):this.bitrateTest?(d.bitrateTest=!0,this.log("Fragment "+d.sn+" of level "+d.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(d)):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,d,a,c)):f===D.FragmentState.APPENDING?this.reduceMaxBufferLength(d.duration)&&this.fragmentTracker.removeFragment(d):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(d){var a=this.fragmentTracker.getAppendedFrag(d,w.PlaylistLevelType.MAIN);return a&&"fragment"in a?a.fragment:a},_.getBufferedFrag=function(d){return this.fragmentTracker.getBufferedFrag(d,w.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(d){return d?this.getBufferedFrag(d.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var d=this.levels,a=this.media;if(a!=null&&a.readyState){var c,v=this.getAppendedFrag(a.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!a.paused&&d){var f=this.hls.nextLoadLevel,b=d[f],I=this.fragLastKbps;I&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*I)+1:c=0}else c=0;var R=this.getBufferedFrag(a.currentTime+c);if(R){var P=this.followingBufferedFrag(R);if(P){this.abortCurrentFrag();var M=P.maxStartPTS?P.maxStartPTS:P.start,F=P.duration,A=Math.max(R.end,M+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(A,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var d=this.fragCurrent;this.fragCurrent=null,d!=null&&d.loader&&d.loader.abort(),this.state===x.State.KEY_LOADING&&(this.state=x.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(d,a){y.prototype.flushMainBuffer.call(this,d,a,this.altAudio?"video":null)},_.onMediaAttached=function(d,a){y.prototype.onMediaAttached.call(this,d,a);var c=a.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new r.default(this.config,c,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var d=this.media;d&&(d.removeEventListener("playing",this.onvplaying),d.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),y.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var d=this.media,a=d?d.currentTime:null;Object(W.isFiniteNumber)(a)&&this.log("Media seeked to "+a.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(d,a){var c=!1,v=!1,f;a.levels.forEach(function(b){f=b.audioCodec,f&&(f.indexOf("mp4a.40.2")!==-1&&(c=!0),f.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=c&&v&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=a.levels,this.startFragRequested=!1},_.onLevelLoading=function(d,a){var c=this.levels;if(!c||this.state!==x.State.IDLE)return;var v=c[a.level];(!v.details||v.details.live&&this.levelLastLoaded!==a.level||this.waitForCdnTuneIn(v.details))&&(this.state=x.State.WAITING_LEVEL)},_.onLevelLoaded=function(d,a){var c,v=this.levels,f=a.level,b=a.details,I=b.totalduration;if(!v){this.warn("Levels were reset while loading level "+f);return}this.log("Level "+f+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+I);var R=this.fragCurrent;R&&(this.state===x.State.FRAG_LOADING||this.state===x.State.FRAG_LOADING_WAITING_RETRY)&&(R.level!==a.level&&R.loader&&(this.state=x.State.IDLE,R.loader.abort()));var P=v[f],M=0;if(b.live||(c=P.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;M=this.alignPlaylists(b,P.details)}if(P.details=b,this.levelLastLoaded=f,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:b,level:f}),this.state===x.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=x.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,M),this.tick()},_._handleFragmentLoadProgress=function(d){var a,c=d.frag,v=d.part,f=d.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var I=b[c.level],R=I.details;if(!R){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var P=I.videoCodec,M=R.PTSKnown||!R.live,F=(a=c.initSegment)===null||a===void 0?void 0:a.data,A=this._getAudioCodec(I),B=this.transmuxer=this.transmuxer||new m.default(this.hls,w.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=v?v.index:-1,Z=z!==-1,ae=new u.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,f.byteLength,z,Z),De=this.initPTS[c.cc];B.push(f,F,A,P,c,v,R.totalduration,M,ae,De)},_.onAudioTrackSwitching=function(d,a){var c=this.altAudio,v=!!a.url,f=a.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;c&&I.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:f})}},_.onAudioTrackSwitched=function(d,a){var c=a.id,v=!!this.hls.audioTracks[c].url;if(v){var f=this.videoBuffer;f&&this.mediaBuffer!==f&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=f)}this.altAudio=v,this.tick()},_.onBufferCreated=function(d,a){var c=a.tracks,v,f,b=!1;for(var I in c){var R=c[I];if(R.id==="main"){if(f=I,v=R,I==="video"){var P=c[I];P&&(this.videoBuffer=P.buffer)}}else b=!0}b&&v?(this.log("Alternate track found, use "+f+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(d,a){var c=a.frag,v=a.part;if(c&&c.type!==w.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(v?" p: "+v.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===x.State.PARSED&&(this.state=x.State.IDLE);return}var f=v?v.stats:c.stats;this.fragLastKbps=Math.round(8*f.total/(f.buffering.end-f.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,v)},_.onError=function(d,a){switch(a.details){case t.ErrorDetails.FRAG_LOAD_ERROR:case t.ErrorDetails.FRAG_LOAD_TIMEOUT:case t.ErrorDetails.KEY_LOAD_ERROR:case t.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.MAIN,a);break;case t.ErrorDetails.LEVEL_LOAD_ERROR:case t.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==x.State.ERROR&&(a.fatal?(this.warn(""+a.details),this.state=x.State.ERROR):!a.levelRetry&&this.state===x.State.WAITING_LEVEL&&(this.state=x.State.IDLE));break;case t.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="main"&&(this.state===x.State.PARSING||this.state===x.State.PARSED)){var c=!0,v=this.getFwdBufferInfo(this.media,w.PlaylistLevelType.MAIN);v&&v.len>.5&&(c=!this.reduceMaxBufferLength(v.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var d=this.media,a=this.gapController;if(!d||!a||!d.readyState)return;var c=h.BufferHelper.getBuffered(d);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):a.poll(this.lastCurrentTime),this.lastCurrentTime=d.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=x.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(d,a){var c=a.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,c,w.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(d,a){this.levels=a.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var d=this.media,a=d.currentTime,c=this.startPosition;if(c>=0&&a<c){if(d.seeking){n.logger.log("could not seek to "+c+", already seeking at "+a);return}var v=h.BufferHelper.getBuffered(d),f=v.length?v.start(0):0,b=f-c;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(n.logger.log("adjusting start position by "+b+" to match buffer start"),c+=b,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+a),d.currentTime=c}},_._getAudioCodec=function(d){var a=this.config.defaultAudioCodec||d.audioCodec;return this.audioCodecSwap&&a&&(this.log("Swapping audio codec"),a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5"),a},_._loadBitrateTestFrag=function(d){var a=this;this._doFragLoad(d).then(function(c){var v=a.hls;if(!c||v.nextLoadLevel||a.fragContextChanged(d))return;a.fragLoadError=0,a.state=x.State.IDLE,a.startFragRequested=!1,a.bitrateTest=!1;var f=d.stats;f.parsing.start=f.parsing.end=f.buffering.start=f.buffering.end=self.performance.now(),v.trigger(j.Events.FRAG_LOADED,c)})},_._handleTransmuxComplete=function(d){var a,c="main",v=this.hls,f=d.remuxResult,b=d.chunkMeta,I=this.getCurrentContext(b);if(!I){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var R=I.frag,P=I.part,M=I.level,F=f.video,A=f.text,B=f.id3,z=f.initSegment,Z=this.altAudio?void 0:f.audio;if(this.fragContextChanged(R))return;if(this.state=x.State.PARSING,z){z.tracks&&(this._bufferInitSegment(M,z.tracks,R,b),v.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:c,tracks:z.tracks}));var ae=z.initPTS,De=z.timescale;Object(W.isFiniteNumber)(ae)&&(this.initPTS[R.cc]=ae,v.trigger(j.Events.INIT_PTS_FOUND,{frag:R,id:c,initPTS:ae,timescale:De}))}if(F&&f.independent!==!1){if(M.details){var _e=F.startPTS,Oe=F.endPTS,Ne=F.startDTS,Ue=F.endDTS;if(P)P.elementaryStreams[F.type]={startPTS:_e,endPTS:Oe,startDTS:Ne,endDTS:Ue};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var Ee=this.getLoadPosition()+this.config.maxBufferHole;if(Ee<_e){this.backtrack(R);return}R.setElementaryStreamInfo(F.type,R.start,Oe,R.start,Ue,!0)}R.setElementaryStreamInfo(F.type,_e,Oe,Ne,Ue),this.bufferFragmentData(F,R,P,b)}}else if(f.independent===!1){this.backtrack(R);return}if(Z){var q=Z.startPTS,J=Z.endPTS,pe=Z.startDTS,ee=Z.endDTS;P&&(P.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:J,startDTS:pe,endDTS:ee}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,q,J,pe,ee),this.bufferFragmentData(Z,R,P,b)}if(B!=null&&(a=B.samples)!==null&&a!==void 0&&a.length){var Ae={frag:R,id:c,samples:B.samples};v.trigger(j.Events.FRAG_PARSING_METADATA,Ae)}if(A){var Ve={frag:R,id:c,samples:A.samples};v.trigger(j.Events.FRAG_PARSING_USERDATA,Ve)}},_._bufferInitSegment=function(d,a,c,v){var f=this;if(this.state!==x.State.PARSING)return;this.audioOnly=!!a.audio&&!a.video,this.altAudio&&!this.audioOnly&&delete a.audio;var b=a.audio,I=a.video,R=a.audiovideo;if(b){var P=d.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(P&&(P.indexOf("mp4a.40.5")!==-1?P="mp4a.40.2":P="mp4a.40.5"),b.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(P="mp4a.40.5")),M.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(P="mp4a.40.2",this.log("Android: force audio codec to "+P)),d.audioCodec&&d.audioCodec!==P&&this.log('Swapping manifest audio codec "'+d.audioCodec+'" for "'+P+'"'),b.levelCodec=P,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(P||"")+"/"+(d.audioCodec||"")+"/"+b.codec+"]")}I&&(I.levelCodec=d.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(d.videoCodec||"")+"/"+I.codec+"]")),R&&this.log("Init audiovideo buffer, container:"+R.container+", codecs[level/parsed]=["+(d.attrs.CODECS||"")+"/"+R.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,a),Object.keys(a).forEach(function(F){var A=a[F],B=A.initSegment;B!=null&&B.byteLength&&f.hls.trigger(j.Events.BUFFER_APPENDING,{type:F,data:B,frag:c,part:null,chunkMeta:v,parent:c.type})}),this.tick()},_.backtrack=function(d){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(d);var a=this.fragmentTracker.backtrack(d);this.fragPrevious=null,this.nextLoadPosition=d.start,a?this.resetFragmentLoading(d):this.state=x.State.BACKTRACKING},_.checkFragmentChanged=function(){var d=this.media,a=null;if(d&&d.readyState>1&&d.seeking===!1){var c=d.currentTime;if(h.BufferHelper.isBuffered(d,c)?a=this.getAppendedFrag(c):h.BufferHelper.isBuffered(d,c+.1)&&(a=this.getAppendedFrag(c+.1)),a){var v=this.fragPlaying,f=a.level;(!v||a.sn!==v.sn||v.level!==f||a.urlId!==v.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:a}),(!v||v.level!==f)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:f}),this.fragPlaying=a)}}},e(T,[{key:"nextLevel",get:function(){var d=this.nextBufferedFrag;return d?d.level:-1}},{key:"currentLevel",get:function(){var d=this.media;if(d){var a=this.getAppendedFrag(d.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var d=this.media;if(d){var a=this.getAppendedFrag(d.currentTime);return this.followingBufferedFrag(a)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),T}(x.default)},"./src/controller/subtitle-stream-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"SubtitleStreamController",function(){return i});var W=L("./src/events.ts"),x=L("./src/utils/logger.ts"),O=L("./src/utils/buffer-helper.ts"),j=L("./src/controller/fragment-finders.ts"),h=L("./src/utils/discontinuities.ts"),D=L("./src/controller/level-helper.ts"),w=L("./src/controller/fragment-tracker.ts"),g=L("./src/controller/base-stream-controller.ts"),m=L("./src/types/loader.ts"),u=L("./src/types/level.ts");function r(o,S){for(var E=0;E<S.length;E++){var y=S[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}function t(o,S,E){return S&&r(o.prototype,S),E&&r(o,E),o}function n(o,S){o.prototype=Object.create(S.prototype),o.prototype.constructor=o,s(o,S)}function s(o,S){return s=Object.setPrototypeOf||function(y,T){return y.__proto__=T,y},s(o,S)}var e=500,i=function(o){n(S,o);function S(y,T){var _;return _=o.call(this,y,T,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var E=S.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var T=this.hls;T.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(W.Events.ERROR,this.onError,this),T.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.on(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.on(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var T=this.hls;T.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(W.Events.ERROR,this.onError,this),T.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.off(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.off(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(e),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(T,_){this.mainDetails=_.details},E.onSubtitleFragProcessed=function(T,_){var l=_.frag,d=_.success;if(this.fragPrevious=l,this.state=g.State.IDLE,!d)return;var a=this.tracksBuffered[this.currentTrackId];if(!a)return;for(var c,v=l.start,f=0;f<a.length;f++)if(v>=a[f].start&&v<=a[f].end){c=a[f];break}var b=l.start+l.duration;c?c.end=b:(c={start:v,end:b},a.push(c)),this.fragmentTracker.fragBuffered(l)},E.onBufferFlushing=function(T,_){var l=_.startOffset,d=_.endOffset;if(l===0&&d!==Number.POSITIVE_INFINITY){var a=this.currentTrackId,c=this.levels;if(!c.length||!c[a]||!c[a].details)return;var v=c[a].details,f=v.targetduration,b=d-f;if(b<=0)return;_.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(I){for(var R=0;R<I.length;){if(I[R].end<=b){I.shift();continue}else if(I[R].start<b)I[R].start=b;else break;R++}}),this.fragmentTracker.removeFragmentsInRange(l,b,m.PlaylistLevelType.SUBTITLE)}},E.onError=function(T,_){var l,d=_.frag;if(!d||d.type!==m.PlaylistLevelType.SUBTITLE)return;(l=this.fragCurrent)!==null&&l!==void 0&&l.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},E.onSubtitleTracksUpdated=function(T,_){var l=this,d=_.subtitleTracks;this.tracksBuffered=[],this.levels=d.map(function(a){return new u.Level(a)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(a){l.tracksBuffered[a.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(T,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var l=this.levels[this.currentTrackId];l!=null&&l.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,l&&this.setInterval(e)},E.onSubtitleTrackLoaded=function(T,_){var l,d=_.details,a=_.id,c=this.currentTrackId,v=this.levels;if(!v.length)return;var f=v[c];if(a>=v.length||a!==c||!f)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,d.live||(l=f.details)!==null&&l!==void 0&&l.live){var b=this.mainDetails;if(d.deltaUpdateFailed||!b)return;var I=b.fragments[0];if(!f.details)d.hasProgramDateTime&&b.hasProgramDateTime?Object(h.alignMediaPlaylistByPDT)(d,b):I&&Object(D.addSliding)(d,I.start);else{var R=this.alignPlaylists(d,f.details);R===0&&I&&Object(D.addSliding)(d,I.start)}}if(f.details=d,this.levelLastLoaded=a,this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var P=Object(j.findFragmentByPTS)(null,d.fragments,this.media.currentTime,0);P||(this.warn("Subtitle playlist not aligned with playback"),f.details=void 0)}},E._handleFragmentLoadComplete=function(T){var _=T.frag,l=T.payload,d=_.decryptdata,a=this.hls;if(this.fragContextChanged(_))return;if(l&&l.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(l),d.key.buffer,d.iv.buffer).then(function(v){var f=performance.now();a.trigger(W.Events.FRAG_DECRYPTED,{frag:_,payload:v,stats:{tstart:c,tdecrypt:f}})})}},E.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var T,_=this.currentTrackId,l=this.levels;if(!l.length||!l[_]||!l[_].details)return;var d=l[_].details,a=d.targetduration,c=this.config,v=this.media,f=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-a,c.maxBufferHole),b=f.end,I=f.len,R=this.getMaxBufferLength()+a;if(I>R)return;console.assert(d,"Subtitle track details are defined on idle subtitle stream controller tick");var P=d.fragments,M=P.length,F=d.edge,A,B=this.fragPrevious;if(b<F){var z=c.maxFragLookUpTolerance;B&&d.hasProgramDateTime&&(A=Object(j.findFragmentByPDT)(P,B.endProgramDateTime,z)),A||(A=Object(j.findFragmentByPTS)(B,P,b,z),!A&&B&&B.start<P[0].start&&(A=P[0]))}else A=P[M-1];(T=A)!==null&&T!==void 0&&T.encrypted?(x.logger.log("Loading key for "+A.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(W.Events.KEY_LOADING,{frag:A})):A&&this.fragmentTracker.getState(A)===w.FragmentState.NOT_LOADED&&this.loadFragment(A,d,b)}},E.loadFragment=function(T,_,l){this.fragCurrent=T,o.prototype.loadFragment.call(this,T,_,l)},t(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(g.default)},"./src/controller/subtitle-track-controller.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/events.ts"),x=L("./src/utils/texttrack-utils.ts"),O=L("./src/controller/base-playlist-controller.ts"),j=L("./src/types/loader.ts");function h(r,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,s.key,s)}}function D(r,t,n){return t&&h(r.prototype,t),n&&h(r,n),r}function w(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,g(r,t)}function g(r,t){return g=Object.setPrototypeOf||function(s,e){return s.__proto__=e,s},g(r,t)}var m=function(r){w(t,r);function t(s){var e;return e=r.call(this,s,"[subtitle-track-controller]")||this,e.media=null,e.tracks=[],e.groupId=null,e.tracksInGroup=[],e.trackId=-1,e.selectDefaultTrack=!0,e.queuedDefaultTrack=-1,e.trackChangeListener=function(){return e.onTextTracksChanged()},e.asyncPollTrackChange=function(){return e.pollTrackChange(0)},e.useTextTrackPolling=!1,e.subtitlePollingInterval=-1,e.subtitleDisplay=!0,e.registerListeners(),e}var n=t.prototype;return n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,r.prototype.destroy.call(this)},n.registerListeners=function(){var e=this.hls;e.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(W.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var e=this.hls;e.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(W.Events.ERROR,this.onError,this)},n.onMediaAttached=function(e,i){if(this.media=i.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)},n.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},n.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 e=u(this.media.textTracks);e.forEach(function(i){Object(x.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},n.onManifestParsed=function(e,i){this.tracks=i.subtitleTracks},n.onSubtitleTrackLoaded=function(e,i){var o=i.id,S=i.details,E=this.trackId,y=this.tracksInGroup[E];if(!y){this.warn("Invalid subtitle track id "+o);return}var T=y.details;y.details=i.details,this.log("subtitle track "+o+" loaded ["+S.startSN+"-"+S.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,i,T))},n.onLevelLoading=function(e,i){this.switchLevel(i.level)},n.onLevelSwitching=function(e,i){this.switchLevel(i.level)},n.switchLevel=function(e){var i=this.hls.levels[e];if(!(i!=null&&i.textGroupIds))return;var o=i.textGroupIds[i.urlId];if(this.groupId!==o){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(_){return!o||_.groupId===o});this.tracksInGroup=E;var y=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=o;var T={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(W.Events.SUBTITLE_TRACKS_UPDATED,T),y!==-1&&this.setSubtitleTrack(y,S)}},n.findTrackId=function(e){for(var i=this.tracksInGroup,o=0;o<i.length;o++){var S=i[o];if((!this.selectDefaultTrack||S.default)&&(!e||e===S.name))return S.id}return-1},n.onError=function(e,i){if(r.prototype.onError.call(this,e,i),i.fatal||!i.context)return;i.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},n.loadPlaylist=function(e){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var o=i.id,S=i.groupId,E=i.url;if(e)try{E=e.addDirectives(E)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADING,{url:E,id:o,groupId:S,deliveryDirectives:e||null})}},n.toggleTrackModes=function(e){var i=this,o=this.media,S=this.subtitleDisplay,E=this.trackId;if(!o)return;var y=u(o.textTracks),T=y.filter(function(d){return d.groupId===i.groupId});if(e===-1)[].slice.call(y).forEach(function(d){d.mode="disabled"});else{var _=T[E];_&&(_.mode="disabled")}var l=T[e];l&&(l.mode=S?"showing":"hidden")},n.setSubtitleTrack=function(e,i){var o,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(o=S[e])!==null&&o!==void 0&&o.details)||e<-1||e>=S.length)return;this.clearTimer();var E=S[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,E){var y=E.id,T=E.groupId,_=T===void 0?"":T,l=E.name,d=E.type,a=E.url;this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:y,groupId:_,name:l,type:d,url:a});var c=this.switchParams(E.url,i==null?void 0:i.details);this.loadPlaylist(c)}else this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:e})},n.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var e=-1,i=u(this.media.textTracks),o=0;o<i.length;o++)if(i[o].mode==="hidden")e=o;else if(i[o].mode==="showing"){e=o;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)},D(t,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,i)}}]),t}(O.default);function u(r){for(var t=[],n=0;n<r.length;n++){var s=r[n];s.kind==="subtitles"&&s.label&&t.push(r[n])}return t}H.default=m},"./src/controller/timeline-controller.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"TimelineController",function(){return u});var W=L("./src/polyfills/number.ts"),x=L("./src/events.ts"),O=L("./src/utils/cea-608-parser.ts"),j=L("./src/utils/output-filter.ts"),h=L("./src/utils/webvtt-parser.ts"),D=L("./src/utils/texttrack-utils.ts"),w=L("./src/utils/imsc1-ttml-parser.ts"),g=L("./src/types/loader.ts"),m=L("./src/utils/logger.ts"),u=function(){function s(i){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=n(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.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 o=new j.default(this,"textTrack1"),S=new j.default(this,"textTrack2"),E=new j.default(this,"textTrack3"),y=new j.default(this,"textTrack4");this.cea608Parser1=new O.default(1,o,S),this.cea608Parser2=new O.default(3,E,y)}i.on(x.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(x.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(x.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(x.Events.FRAG_LOADING,this.onFragLoading,this),i.on(x.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(x.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(x.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(x.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(x.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(x.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=s.prototype;return e.destroy=function(){var o=this.hls;o.off(x.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(x.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(x.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(x.Events.FRAG_LOADING,this.onFragLoading,this),o.off(x.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(x.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(x.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(x.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(x.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(x.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(o,S,E,y,T){for(var _=!1,l=T.length;l--;){var d=T[l],a=t(d[0],d[1],S,E);if(a>=0&&(d[0]=Math.min(d[0],S),d[1]=Math.max(d[1],E),_=!0,a/(E-S)>.5))return}if(_||T.push([S,E]),this.config.renderTextTracksNatively){var c=this.captionsTracks[o];this.Cues.newCue(c,S,E,y)}else{var v=this.Cues.newCue(null,S,E,y);this.hls.trigger(x.Events.CUES_PARSED,{type:"captions",cues:v,track:o})}},e.onInitPtsFound=function(o,S){var E=this,y=S.frag,T=S.id,_=S.initPTS,l=S.timescale,d=this.unparsedVttFrags;T==="main"&&(this.initPTS[y.cc]=_,this.timescale[y.cc]=l),d.length&&(this.unparsedVttFrags=[],d.forEach(function(a){E.onFragLoaded(x.Events.FRAG_LOADED,a)}))},e.getExistingTrack=function(o){var S=this.media;if(S)for(var E=0;E<S.textTracks.length;E++){var y=S.textTracks[E];if(y[o])return y}return null},e.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},e.createNativeTrack=function(o){if(this.captionsTracks[o])return;var S=this.captionsProperties,E=this.captionsTracks,y=this.media,T=S[o],_=T.label,l=T.languageCode,d=this.getExistingTrack(o);if(d)E[o]=d,Object(D.clearCurrentCues)(E[o]),Object(D.sendAddTrackEvent)(E[o],y);else{var a=this.createTextTrack("captions",_,l);a&&(a[o]=!0,E[o]=a)}},e.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var S=this.captionsProperties[o];if(!S)return;var E=S.label,y={_id:o,label:E,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[o]=y,this.hls.trigger(x.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[y]})},e.createTextTrack=function(o,S,E){var y=this.media;return y?y.addTextTrack(o,S,E):void 0},e.onMediaAttaching=function(o,S){this.media=S.media,this._cleanTracks()},e.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(S){Object(D.clearCurrentCues)(o[S]),delete o[S]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=n(),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())},e._cleanTracks=function(){var o=this.media;if(!o)return;var S=o.textTracks;if(S)for(var E=0;E<S.length;E++)Object(D.clearCurrentCues)(S[E])},e.onSubtitleTracksUpdated=function(o,S){var E=this;this.textTracks=[];var y=S.subtitleTracks||[],T=y.some(function(a){return a.textCodec===w.IMSC1_CODEC});if(this.config.enableWebVTT||T&&this.config.enableIMSC1){var _=this.tracks&&y&&this.tracks.length===y.length;if(this.tracks=y||[],this.config.renderTextTracksNatively){var l=this.media?this.media.textTracks:[];this.tracks.forEach(function(a,c){var v;if(c<l.length){for(var f=null,b=0;b<l.length;b++)if(r(l[b],a)){f=l[b];break}f&&(v=f)}v?Object(D.clearCurrentCues)(v):(v=E.createTextTrack("subtitles",a.name,a.lang),v&&(v.mode="disabled")),v&&(v.groupId=a.groupId,E.textTracks.push(v))})}else if(!_&&this.tracks&&this.tracks.length){var d=this.tracks.map(function(a){return{label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}});this.hls.trigger(x.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:d})}}},e.onManifestLoaded=function(o,S){var E=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(y){var T=/(?:CC|SERVICE)([1-4])/.exec(y.instreamId);if(!T)return;var _="textTrack"+T[1],l=E.captionsProperties[_];if(!l)return;l.label=y.name,y.lang&&(l.languageCode=y.lang),l.media=y})},e.onFragLoading=function(o,S){var E=this.cea608Parser1,y=this.cea608Parser2,T=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(E&&y))return;if(S.frag.type===g.PlaylistLevelType.MAIN){var l,d,a=S.frag.sn,c=(l=S==null||((d=S.part)===null||d===void 0)?void 0:d.index)!=null?l:-1;a===T+1||a===T&&c===_+1||(E.reset(),y.reset()),this.lastSn=a,this.lastPartIndex=c}},e.onFragLoaded=function(o,S){var E=S.frag,y=S.payload,T=this.initPTS,_=this.unparsedVttFrags;if(E.type===g.PlaylistLevelType.SUBTITLE)if(y.byteLength){if(!Object(W.isFiniteNumber)(T[E.cc])){_.push(S),T.length&&this.hls.trigger(x.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var l=E.decryptdata;if(l==null||l.key==null||l.method!=="AES-128"){var d=this.tracks[E.level],a=this.vttCCs;a[E.cc]||(a[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),d&&d.textCodec===w.IMSC1_CODEC?this._parseIMSC1(E,y):this._parseVTTs(E,y,a)}}else this.hls.trigger(x.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(o,S){var E=this,y=this.hls;Object(w.parseIMSC1)(S,this.initPTS[o.cc],this.timescale[o.cc],function(T){E._appendCues(T,o.level),y.trigger(x.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(T){m.logger.log("Failed to parse IMSC1: "+T),y.trigger(x.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:T})})},e._parseVTTs=function(o,S,E){var y=this,T=this.hls;Object(h.parseWebVTT)(S,this.initPTS[o.cc],this.timescale[o.cc],E,o.cc,o.start,function(_){y._appendCues(_,o.level),T.trigger(x.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(_){y._fallbackToIMSC1(o,S),m.logger.log("Failed to parse VTT cue: "+_),T.trigger(x.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:_})})},e._fallbackToIMSC1=function(o,S){var E=this,y=this.tracks[o.level];y.textCodec||Object(w.parseIMSC1)(S,this.initPTS[o.cc],this.timescale[o.cc],function(){y.textCodec=w.IMSC1_CODEC,E._parseIMSC1(o,S)},function(){y.textCodec="wvtt"})},e._appendCues=function(o,S){var E=this.hls;if(this.config.renderTextTracksNatively){var y=this.textTracks[S];if(y.mode==="disabled")return;o.forEach(function(l){return Object(D.addCueToTrack)(y,l)})}else{var T=this.tracks[S],_=T.default?"default":"subtitles"+S;E.trigger(x.Events.CUES_PARSED,{type:"subtitles",cues:o,track:_})}},e.onFragDecrypted=function(o,S){var E=S.frag;if(E.type===g.PlaylistLevelType.SUBTITLE){if(!Object(W.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(x.Events.FRAG_LOADED,S)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(o,S){var E=this.cea608Parser1,y=this.cea608Parser2;if(!this.enabled||!(E&&y))return;for(var T=0;T<S.samples.length;T++){var _=S.samples[T].bytes;if(_){var l=this.extractCea608Data(_);E.addData(S.samples[T].pts,l[0]),y.addData(S.samples[T].pts,l[1])}}},e.onBufferFlushing=function(o,S){var E=S.startOffset,y=S.endOffset,T=S.endOffsetSubtitles,_=S.type,l=this.media;if(!l||l.currentTime<y)return;if(!_||_==="video"){var d=this.captionsTracks;Object.keys(d).forEach(function(c){return Object(D.removeCuesInRange)(d[c],E,y)})}if(this.config.renderTextTracksNatively&&(E===0&&T!==void 0)){var a=this.textTracks;Object.keys(a).forEach(function(c){return Object(D.removeCuesInRange)(a[c],E,T)})}},e.extractCea608Data=function(o){for(var S=o[0]&31,E=2,y=[[],[]],T=0;T<S;T++){var _=o[E++],l=127&o[E++],d=127&o[E++],a=(4&_)!==0,c=3&_;if(l===0&&d===0)continue;a&&((c===0||c===1)&&(y[c].push(l),y[c].push(d)))}return y},s}();function r(s,e){return s&&s.label===e.name&&!(s.textTrack1||s.textTrack2)}function t(s,e,i,o){return Math.min(e,o)-Math.max(s,i)}function n(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return W});var W=function(){function x(j,h){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=h}var O=x.prototype;return O.decrypt=function(h,D){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},D,h)},x}()},"./src/crypt/aes-decryptor.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"removePadding",function(){return x}),L.d(H,"default",function(){return O});var W=L("./src/utils/typed-array.ts");function x(j){var h=j.byteLength,D=h&&new DataView(j.buffer).getUint8(h-1);return D?Object(W.sliceUint8)(j,0,h-D):j}var O=function(){function j(){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 h=j.prototype;return h.uint8ArrayToUint32Array_=function(w){for(var g=new DataView(w),m=new Uint32Array(4),u=0;u<4;u++)m[u]=g.getUint32(u*4);return m},h.initTable=function(){var w=this.sBox,g=this.invSBox,m=this.subMix,u=m[0],r=m[1],t=m[2],n=m[3],s=this.invSubMix,e=s[0],i=s[1],o=s[2],S=s[3],E=new Uint32Array(256),y=0,T=0,_=0;for(_=0;_<256;_++)_<128?E[_]=_<<1:E[_]=_<<1^283;for(_=0;_<256;_++){var l=T^T<<1^T<<2^T<<3^T<<4;l=l>>>8^l&255^99,w[y]=l,g[l]=y;var d=E[y],a=E[d],c=E[a],v=E[l]*257^l*16843008;u[y]=v<<24|v>>>8,r[y]=v<<16|v>>>16,t[y]=v<<8|v>>>24,n[y]=v,v=c*16843009^a*65537^d*257^y*16843008,e[l]=v<<24|v>>>8,i[l]=v<<16|v>>>16,o[l]=v<<8|v>>>24,S[l]=v,y?(y=d^E[E[E[c^d]]],T^=E[E[T]]):y=T=1}},h.expandKey=function(w){for(var g=this.uint8ArrayToUint32Array_(w),m=!0,u=0;u<g.length&&m;)m=g[u]===this.key[u],u++;if(m)return;this.key=g;var r=this.keySize=g.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);var t=this.ksRows=(r+6+1)*4,n,s,e=this.keySchedule=new Uint32Array(t),i=this.invKeySchedule=new Uint32Array(t),o=this.sBox,S=this.rcon,E=this.invSubMix,y=E[0],T=E[1],_=E[2],l=E[3],d,a;for(n=0;n<t;n++){if(n<r){d=e[n]=g[n];continue}a=d,n%r===0?(a=a<<8|a>>>24,a=o[a>>>24]<<24|o[a>>>16&255]<<16|o[a>>>8&255]<<8|o[a&255],a^=S[n/r|0]<<24):r>6&&n%r===4&&(a=o[a>>>24]<<24|o[a>>>16&255]<<16|o[a>>>8&255]<<8|o[a&255]),e[n]=d=(e[n-r]^a)>>>0}for(s=0;s<t;s++)n=t-s,s&3?a=e[n]:a=e[n-4],s<4||n<=4?i[s]=a:i[s]=y[o[a>>>24]]^T[o[a>>>16&255]]^_[o[a>>>8&255]]^l[o[a&255]],i[s]=i[s]>>>0},h.networkToHostOrderSwap=function(w){return w<<24|(w&65280)<<8|(w&16711680)>>8|w>>>24},h.decrypt=function(w,g,m){for(var u=this.keySize+6,r=this.invKeySchedule,t=this.invSBox,n=this.invSubMix,s=n[0],e=n[1],i=n[2],o=n[3],S=this.uint8ArrayToUint32Array_(m),E=S[0],y=S[1],T=S[2],_=S[3],l=new Int32Array(w),d=new Int32Array(l.length),a,c,v,f,b,I,R,P,M,F,A,B,z,Z,ae=this.networkToHostOrderSwap;g<l.length;){for(M=ae(l[g]),F=ae(l[g+1]),A=ae(l[g+2]),B=ae(l[g+3]),b=M^r[0],I=B^r[1],R=A^r[2],P=F^r[3],z=4,Z=1;Z<u;Z++)a=s[b>>>24]^e[I>>16&255]^i[R>>8&255]^o[P&255]^r[z],c=s[I>>>24]^e[R>>16&255]^i[P>>8&255]^o[b&255]^r[z+1],v=s[R>>>24]^e[P>>16&255]^i[b>>8&255]^o[I&255]^r[z+2],f=s[P>>>24]^e[b>>16&255]^i[I>>8&255]^o[R&255]^r[z+3],b=a,I=c,R=v,P=f,z=z+4;a=t[b>>>24]<<24^t[I>>16&255]<<16^t[R>>8&255]<<8^t[P&255]^r[z],c=t[I>>>24]<<24^t[R>>16&255]<<16^t[P>>8&255]<<8^t[b&255]^r[z+1],v=t[R>>>24]<<24^t[P>>16&255]<<16^t[b>>8&255]<<8^t[I&255]^r[z+2],f=t[P>>>24]<<24^t[b>>16&255]<<16^t[I>>8&255]<<8^t[R&255]^r[z+3],d[g]=ae(a^E),d[g+1]=ae(f^y),d[g+2]=ae(v^T),d[g+3]=ae(c^_),E=M,y=F,T=A,_=B,g=g+4}return d.buffer},j}()},"./src/crypt/decrypter.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return g});var W=L("./src/crypt/aes-crypto.ts"),x=L("./src/crypt/fast-aes-key.ts"),O=L("./src/crypt/aes-decryptor.ts"),j=L("./src/utils/logger.ts"),h=L("./src/utils/mp4-tools.ts"),D=L("./src/utils/typed-array.ts"),w=16,g=function(){function m(r,t,n){var s=n===void 0?{}:n,e=s.removePKCS7Padding,i=e===void 0?!0:e;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=r,this.config=t,this.removePKCS7Padding=i,i)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var u=m.prototype;return u.destroy=function(){this.observer=null},u.isSync=function(){return this.config.enableSoftwareAES},u.flush=function(){var t=this.currentResult;if(!t){this.reset();return}var n=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(n):n},u.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},u.decrypt=function(t,n,s,e){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),n,s);var i=this.flush();i&&e(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),n,s).then(e)},u.softwareDecrypt=function(t,n,s){var e=this.currentIV,i=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(t=Object(h.appendUint8Array)(o,t),this.remainderData=null);var S=this.getValidChunk(t);if(!S.length)return null;e&&(s=e);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new O.default),E.expandKey(n);var y=i;return this.currentResult=E.decrypt(S.buffer,0,s),this.currentIV=Object(D.sliceUint8)(S,-16).buffer,y||null},u.webCryptoDecrypt=function(t,n,s){var e=this,i=this.subtle;return(this.key!==n||!this.fastAesKey)&&(this.key=n,this.fastAesKey=new x.default(i,n)),this.fastAesKey.expandKey().then(function(o){if(!i)return Promise.reject(new Error("web crypto not initialized"));var S=new W.default(i,s);return S.decrypt(t.buffer,o)}).catch(function(o){return e.onWebCryptoError(o,t,n,s)})},u.onWebCryptoError=function(t,n,s,e){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(n,s,e)},u.getValidChunk=function(t){var n=t,s=t.length-t.length%w;return s!==t.length&&(n=Object(D.sliceUint8)(t,0,s),this.remainderData=Object(D.sliceUint8)(t,s)),n},u.logOnce=function(t){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+t),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return W});var W=function(){function x(j,h){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=h}var O=x.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},x}()},"./src/demux/aacdemuxer.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/demux/base-audio-demuxer.ts"),x=L("./src/demux/adts.ts"),O=L("./src/utils/logger.ts"),j=L("./src/demux/id3.ts");function h(g,m){g.prototype=Object.create(m.prototype),g.prototype.constructor=g,D(g,m)}function D(g,m){return D=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r},D(g,m)}var w=function(g){h(m,g);function m(r,t){var n;return n=g.call(this)||this,n.observer=void 0,n.config=void 0,n.observer=r,n.config=t,n}var u=m.prototype;return u.resetInitSegment=function(t,n,s){g.prototype.resetInitSegment.call(this,t,n,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},m.probe=function(t){if(!t)return!1;for(var n=j.getID3Data(t,0)||[],s=n.length,e=t.length;s<e;s++)if(x.probe(t,s))return O.logger.log("ADTS sync word found !"),!0;return!1},u.canParse=function(t,n){return x.canParse(t,n)},u.appendFrame=function(t,n,s){x.initTrackConfig(t,this.observer,n,s,t.manifestCodec);var e=x.appendFrame(t,n,s,this.initPTS,this.frameIndex);if(e&&e.missing===0)return e},m}(W.default);w.minProbeByteLength=9,H.default=w},"./src/demux/adts.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"getAudioConfig",function(){return j}),L.d(H,"isHeaderPattern",function(){return h}),L.d(H,"getHeaderLength",function(){return D}),L.d(H,"getFullFrameLength",function(){return w}),L.d(H,"canGetFrameLength",function(){return g}),L.d(H,"isHeader",function(){return m}),L.d(H,"canParse",function(){return u}),L.d(H,"probe",function(){return r}),L.d(H,"initTrackConfig",function(){return t}),L.d(H,"getFrameDuration",function(){return n}),L.d(H,"parseFrameHeader",function(){return s}),L.d(H,"appendFrame",function(){return e});var W=L("./src/utils/logger.ts"),x=L("./src/errors.ts"),O=L("./src/events.ts");function j(i,o,S,E){var y,T,_,l,d=navigator.userAgent.toLowerCase(),a=E,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];y=((o[S+2]&192)>>>6)+1;var v=(o[S+2]&60)>>>2;if(v>c.length-1){i.trigger(O.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return _=(o[S+2]&1)<<2,_|=(o[S+3]&192)>>>6,W.logger.log("manifest codec:"+E+", ADTS type:"+y+", samplingIndex:"+v),/firefox/i.test(d)?v>=6?(y=5,l=new Array(4),T=v-3):(y=2,l=new Array(2),T=v):d.indexOf("android")!==-1?(y=2,l=new Array(2),T=v):(y=5,l=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&v>=6?T=v-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(v>=6&&_===1||/vivaldi/i.test(d))||!E&&_===1)&&(y=2,l=new Array(2)),T=v)),l[0]=y<<3,l[0]|=(v&14)>>1,l[1]|=(v&1)<<7,l[1]|=_<<3,y===5&&(l[1]|=(T&14)>>1,l[2]=(T&1)<<7,l[2]|=2<<2,l[3]=0),{config:l,samplerate:c[v],channelCount:_,codec:"mp4a.40."+y,manifestCodec:a}}function h(i,o){return i[o]===255&&(i[o+1]&246)===240}function D(i,o){return i[o+1]&1?7:9}function w(i,o){return(i[o+3]&3)<<11|i[o+4]<<3|(i[o+5]&224)>>>5}function g(i,o){return o+5<i.length}function m(i,o){return o+1<i.length&&h(i,o)}function u(i,o){return g(i,o)&&h(i,o)&&w(i,o)<=i.length-o}function r(i,o){if(m(i,o)){var S=D(i,o);if(o+S>=i.length)return!1;var E=w(i,o);if(E<=S)return!1;var y=o+E;return y===i.length||m(i,y)}return!1}function t(i,o,S,E,y){if(!i.samplerate){var T=j(o,S,E,y);if(!T)return;i.config=T.config,i.samplerate=T.samplerate,i.channelCount=T.channelCount,i.codec=T.codec,i.manifestCodec=T.manifestCodec,W.logger.log("parsed codec:"+i.codec+", rate:"+T.samplerate+", channels:"+T.channelCount)}}function n(i){return 1024*9e4/i}function s(i,o,S,E,y){var T=D(i,o),_=w(i,o);if(_-=T,_>0){var l=S+E*y;return{headerLength:T,frameLength:_,stamp:l}}}function e(i,o,S,E,y){var T=n(i.samplerate),_=s(o,S,E,y,T);if(_){var l=_.frameLength,d=_.headerLength,a=_.stamp,c=d+l,v=Math.max(0,S+c-o.length),f;v?(f=new Uint8Array(c-d),f.set(o.subarray(S+d,o.length),0)):f=o.subarray(S+d,S+c);var b={unit:f,pts:a};return v||i.samples.push(b),{sample:b,length:c,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"initPTSFn",function(){return w});var W=L("./src/polyfills/number.ts"),x=L("./src/demux/id3.ts"),O=L("./src/demux/dummy-demuxed-track.ts"),j=L("./src/utils/mp4-tools.ts"),h=L("./src/utils/typed-array.ts"),D=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=g.prototype;return m.resetInitSegment=function(r,t,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(r,t){return!1},m.appendFrame=function(r,t,n){},m.demux=function(r,t){this.cachedData&&(r=Object(j.appendUint8Array)(this.cachedData,r),this.cachedData=null);var n=x.getID3Data(r,0),s=n?n.length:0,e,i,o=this._audioTrack,S=this._id3Track,E=n?x.getTimeStamp(n):void 0,y=r.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=w(E,t)),n&&n.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:n}),i=this.initPTS;s<y;){if(this.canParse(r,s)){var T=this.appendFrame(o,r,s);T?(this.frameIndex++,i=T.sample.pts,s+=T.length,e=s):s=y}else x.canParse(r,s)?(n=x.getID3Data(r,s),S.samples.push({pts:i,dts:i,data:n}),s+=n.length,e=s):s++;if(s===y&&e!==y){var _=Object(h.sliceUint8)(r,e);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:o,avcTrack:Object(O.dummyTrack)(),id3Track:S,textTrack:Object(O.dummyTrack)()}},m.demuxSampleAes=function(r,t,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(r){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},m.destroy=function(){},g}(),w=function(m,u){return Object(W.isFiniteNumber)(m)?m*90:u*9e4};H.default=D},"./src/demux/chunk-cache.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return W});var W=function(){function O(){this.chunks=[],this.dataLength=0}var j=O.prototype;return j.push=function(D){this.chunks.push(D),this.dataLength+=D.length},j.flush=function(){var D=this.chunks,w=this.dataLength,g;if(D.length)D.length===1?g=D[0]:g=x(D,w);else return new Uint8Array(0);return this.reset(),g},j.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function x(O,j){for(var h=new Uint8Array(j),D=0,w=0;w<O.length;w++){var g=O[w];h.set(g,D),D+=g.length}return h}},"./src/demux/dummy-demuxed-track.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"dummyTrack",function(){return W});function W(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/utils/logger.ts"),x=function(){function O(h){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=h,this.bytesAvailable=h.byteLength,this.word=0,this.bitsAvailable=0}var j=O.prototype;return j.loadWord=function(){var D=this.data,w=this.bytesAvailable,g=D.byteLength-w,m=new Uint8Array(4),u=Math.min(4,w);if(u===0)throw new Error("no bytes available");m.set(D.subarray(g,g+u)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u},j.skipBits=function(D){var w;this.bitsAvailable>D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,w=D>>3,D-=w>>3,this.bytesAvailable-=w,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},j.readBits=function(D){var w=Math.min(this.bitsAvailable,D),g=this.word>>>32-w;return D>32&&W.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=w,this.bitsAvailable>0?this.word<<=w:this.bytesAvailable>0&&this.loadWord(),w=D-w,w>0&&this.bitsAvailable?g<<w|this.readBits(w):g},j.skipLZ=function(){var D;for(D=0;D<this.bitsAvailable;++D)if((this.word&2147483648>>>D)!==0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},j.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(D){for(var w=8,g=8,m,u=0;u<D;u++)g!==0&&(m=this.readEG(),g=(w+m+256)%256),w=g===0?w:g},j.readSPS=function(){var D=0,w=0,g=0,m=0,u,r,t,n=this.readUByte.bind(this),s=this.readBits.bind(this),e=this.readUEG.bind(this),i=this.readBoolean.bind(this),o=this.skipBits.bind(this),S=this.skipEG.bind(this),E=this.skipUEG.bind(this),y=this.skipScalingList.bind(this);n();var T=n();if(s(5),o(3),n(),E(),T===100||T===110||T===122||T===244||T===44||T===83||T===86||T===118||T===128){var _=e();if(_===3&&o(1),E(),E(),o(1),i())for(r=_!==3?8:12,t=0;t<r;t++)i()&&(t<6?y(16):y(64))}E();var l=e();if(l===0)e();else if(l===1)for(o(1),S(),S(),u=e(),t=0;t<u;t++)S();E(),o(1);var d=e(),a=e(),c=s(1);c===0&&o(1),o(1),i()&&(D=e(),w=e(),g=e(),m=e());var v=[1,1];if(i()&&i()){var f=n();switch(f){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[n()<<8|n(),n()<<8|n()];break}}}return{width:Math.ceil((d+1)*16-D*2-w*2),height:(2-c)*(a+1)*16-(c?2:4)*(g+m),pixelRatio:v}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();H.default=x},"./src/demux/id3.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"isHeader",function(){return W}),L.d(H,"isFooter",function(){return x}),L.d(H,"getID3Data",function(){return O}),L.d(H,"canParse",function(){return h}),L.d(H,"getTimeStamp",function(){return D}),L.d(H,"isTimeStampFrame",function(){return w}),L.d(H,"getID3Frames",function(){return m}),L.d(H,"decodeFrame",function(){return u}),L.d(H,"utf8ArrayToStr",function(){return e}),L.d(H,"testables",function(){return i});var W=function(y,T){return T+10<=y.length&&(y[T]===73&&y[T+1]===68&&y[T+2]===51&&(y[T+3]<255&&y[T+4]<255&&(y[T+6]<128&&y[T+7]<128&&y[T+8]<128&&y[T+9]<128)))},x=function(y,T){return T+10<=y.length&&(y[T]===51&&y[T+1]===68&&y[T+2]===73&&(y[T+3]<255&&y[T+4]<255&&(y[T+6]<128&&y[T+7]<128&&y[T+8]<128&&y[T+9]<128)))},O=function(y,T){for(var _=T,l=0;W(y,T);){l+=10;var d=j(y,T+6);l+=d,x(y,T+10)&&(l+=10),T+=l}return l>0?y.subarray(_,_+l):void 0},j=function(y,T){var _=0;return _=(y[T]&127)<<21,_|=(y[T+1]&127)<<14,_|=(y[T+2]&127)<<7,_|=y[T+3]&127,_},h=function(y,T){return W(y,T)&&j(y,T+6)+10<=y.length-T},D=function(y){for(var T=m(y),_=0;_<T.length;_++){var l=T[_];if(w(l))return s(l)}return},w=function(y){return y&&y.key==="PRIV"&&y.info==="com.apple.streaming.transportStreamTimestamp"},g=function(y){var T=String.fromCharCode(y[0],y[1],y[2],y[3]),_=j(y,4),l=10;return{type:T,size:_,data:y.subarray(l,l+_)}},m=function(y){for(var T=0,_=[];W(y,T);){var l=j(y,T+6);T+=10;for(var d=T+l;T+8<d;){var a=g(y.subarray(T)),c=u(a);c&&_.push(c),T+=a.size+10}x(y,T)&&(T+=10)}return _},u=function(y){return y.type==="PRIV"?r(y):y.type[0]==="W"?n(y):t(y)},r=function(y){if(y.size<2)return;var T=e(y.data,!0),_=new Uint8Array(y.data.subarray(T.length+1));return{key:y.type,info:T,data:_.buffer}},t=function(y){if(y.size<2)return;if(y.type==="TXXX"){var T=1,_=e(y.data.subarray(T),!0);T+=_.length+1;var l=e(y.data.subarray(T));return{key:y.type,info:_,data:l}}var d=e(y.data.subarray(1));return{key:y.type,data:d}},n=function(y){if(y.type==="WXXX"){if(y.size<2)return;var T=1,_=e(y.data.subarray(T),!0);T+=_.length+1;var l=e(y.data.subarray(T));return{key:y.type,info:_,data:l}}var d=e(y.data);return{key:y.type,data:d}},s=function(y){if(y.data.byteLength===8){var T=new Uint8Array(y.data),_=T[3]&1,l=(T[4]<<23)+(T[5]<<15)+(T[6]<<7)+T[7];return l/=45,_&&(l+=4772185884e-2),Math.round(l)}return},e=function(y,T){T===void 0&&(T=!1);var _=S();if(_){var l=_.decode(y);if(T){var d=l.indexOf("\0");return d!==-1?l.substring(0,d):l}return l.replace(/\0/g,"")}for(var a=y.length,c,v,f,b="",I=0;I<a;){if(c=y[I++],c===0&&T)return b;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(c);break;case 12:case 13:v=y[I++],b+=String.fromCharCode((c&31)<<6|v&63);break;case 14:v=y[I++],f=y[I++],b+=String.fromCharCode((c&15)<<12|(v&63)<<6|(f&63)<<0);break;default:}}return b},i={decodeTextFrame:t},o;function S(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/demux/base-audio-demuxer.ts"),x=L("./src/demux/id3.ts"),O=L("./src/utils/logger.ts"),j=L("./src/demux/mpegaudio.ts");function h(g,m){g.prototype=Object.create(m.prototype),g.prototype.constructor=g,D(g,m)}function D(g,m){return D=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r},D(g,m)}var w=function(g){h(m,g);function m(){return g.apply(this,arguments)||this}var u=m.prototype;return u.resetInitSegment=function(t,n,s){g.prototype.resetInitSegment.call(this,t,n,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},m.probe=function(t){if(!t)return!1;for(var n=x.getID3Data(t,0)||[],s=n.length,e=t.length;s<e;s++)if(j.probe(t,s))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},u.canParse=function(t,n){return j.canParse(t,n)},u.appendFrame=function(t,n,s){return this.initPTS===null?void 0:j.appendFrame(t,n,s,this.initPTS,this.frameIndex)},m}(W.default);w.minProbeByteLength=4,H.default=w},"./src/demux/mp4demuxer.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/utils/mp4-tools.ts"),x=L("./src/demux/dummy-demuxed-track.ts"),O=function(){function j(D,w){this.remainderData=null,this.config=void 0,this.config=w}var h=j.prototype;return h.resetTimeStamp=function(){},h.resetInitSegment=function(){},h.resetContiguity=function(){},j.probe=function(w){return Object(W.findBox)({data:w,start:0,end:Math.min(w.length,16384)},["moof"]).length>0},h.demux=function(w){var g=w,m=Object(x.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(W.appendUint8Array)(this.remainderData,w));var u=Object(W.segmentValidRange)(g);this.remainderData=u.remainder,m.samples=u.valid||new Uint8Array}else m.samples=g;return{audioTrack:Object(x.dummyTrack)(),avcTrack:m,id3Track:Object(x.dummyTrack)(),textTrack:Object(x.dummyTrack)()}},h.flush=function(){var w=Object(x.dummyTrack)();return w.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(x.dummyTrack)(),avcTrack:w,id3Track:Object(x.dummyTrack)(),textTrack:Object(x.dummyTrack)()}},h.demuxSampleAes=function(w,g,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},h.destroy=function(){},j}();O.minProbeByteLength=1024,H.default=O},"./src/demux/mpegaudio.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"appendFrame",function(){return D}),L.d(H,"parseHeader",function(){return w}),L.d(H,"isHeaderPattern",function(){return g}),L.d(H,"isHeader",function(){return m}),L.d(H,"canParse",function(){return u}),L.d(H,"probe",function(){return r});var W=null,x=[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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],h=[0,1,1,4];function D(t,n,s,e,i){if(s+24>n.length)return;var o=w(n,s);if(o&&s+o.frameLength<=n.length){var S=o.samplesPerFrame*9e4/o.sampleRate,E=e+i*S,y={unit:n.subarray(s,s+o.frameLength),pts:E,dts:E};return t.config=[],t.channelCount=o.channelCount,t.samplerate=o.sampleRate,t.samples.push(y),{sample:y,length:o.frameLength,missing:0}}}function w(t,n){var s=t[n+1]>>3&3,e=t[n+1]>>1&3,i=t[n+2]>>4&15,o=t[n+2]>>2&3;if(s!==1&&i!==0&&i!==15&&o!==3){var S=t[n+2]>>1&1,E=t[n+3]>>6,y=s===3?3-e:e===3?3:4,T=x[y*14+i-1]*1e3,_=s===3?0:s===2?1:2,l=O[_*3+o],d=E===3?1:2,a=j[s][e],c=h[e],v=a*8*c,f=Math.floor(a*T/l+S)*c;if(W===null){var b=navigator.userAgent||"",I=b.match(/Chrome\/(\d+)/i);W=I?parseInt(I[1]):0}var R=!!W&&W<=87;return R&&e===2&&T>=224e3&&E===0&&(t[n+3]=t[n+3]|128),{sampleRate:l,channelCount:d,frameLength:f,samplesPerFrame:v}}}function g(t,n){return t[n]===255&&(t[n+1]&224)===224&&(t[n+1]&6)!==0}function m(t,n){return n+1<t.length&&g(t,n)}function u(t,n){var s=4;return g(t,n)&&s<=t.length-n}function r(t,n){if(n+1<t.length&&g(t,n)){var s=4,e=w(t,n),i=s;e!=null&&e.frameLength&&(i=e.frameLength);var o=n+i;return o===t.length||m(t,o)}return!1}},"./src/demux/sample-aes.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/crypt/decrypter.ts"),x=L("./src/demux/tsdemuxer.ts"),O=function(){function j(D,w,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new W.default(D,w,{removePKCS7Padding:!1})}var h=j.prototype;return h.decryptBuffer=function(w,g){this.decrypter.decrypt(w,this.keyData.key.buffer,this.keyData.iv.buffer,g)},h.decryptAacSample=function(w,g,m,u){var r=w[g].unit,t=r.subarray(16,r.length-r.length%16),n=t.buffer.slice(t.byteOffset,t.byteOffset+t.length),s=this;this.decryptBuffer(n,function(e){var i=new Uint8Array(e);r.set(i,16),u||s.decryptAacSamples(w,g+1,m)})},h.decryptAacSamples=function(w,g,m){for(;;g++){if(g>=w.length){m();return}if(w[g].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(w,g,m,u),!u)return}},h.getAvcEncryptedData=function(w){for(var g=Math.floor((w.length-48)/160)*16+16,m=new Int8Array(g),u=0,r=32;r<=w.length-16;r+=160,u+=16)m.set(w.subarray(r,r+16),u);return m},h.getAvcDecryptedUnit=function(w,g){for(var m=new Uint8Array(g),u=0,r=32;r<=w.length-16;r+=160,u+=16)w.set(m.subarray(u,u+16),r);return w},h.decryptAvcSample=function(w,g,m,u,r,t){var n=Object(x.discardEPB)(r.data),s=this.getAvcEncryptedData(n),e=this;this.decryptBuffer(s.buffer,function(i){r.data=e.getAvcDecryptedUnit(n,i),t||e.decryptAvcSamples(w,g,m+1,u)})},h.decryptAvcSamples=function(w,g,m,u){if(w instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,m=0){if(g>=w.length){u();return}for(var r=w[g].units;!(m>=r.length);m++){var t=r[m];if(t.data.length<=48||t.type!==1&&t.type!==5)continue;var n=this.decrypter.isSync();if(this.decryptAvcSample(w,g,m,u,t,n),!n)return}}},j}();H.default=O},"./src/demux/transmuxer-interface.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return r});var W=L("./node_modules/webworkify-webpack/index.js"),x=L.n(W),O=L("./src/events.ts"),j=L("./src/demux/transmuxer.ts"),h=L("./src/utils/logger.ts"),D=L("./src/errors.ts"),w=L("./src/utils/mediasource-helper.ts"),g=L("./node_modules/eventemitter3/index.js"),m=L.n(g),u=Object(w.getMediaSource)()||{isTypeSupported:function(){return!1}},r=function(){function t(s,e,i,o){var S=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=s,this.id=e,this.onTransmuxComplete=i,this.onFlush=o;var E=s.config,y=function(a,c){c=c||{},c.frag=S.frag,c.id=S.id,s.trigger(a,c)};this.observer=new g.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,y),this.observer.on(O.Events.ERROR,y);var T={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){h.logger.log("demuxing in webworker");var l;try{l=this.worker=W("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(d){s.trigger(O.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(d.message+" ("+d.filename+":"+d.lineno+")")})},l.postMessage({cmd:"init",typeSupported:T,vendor:_,id:e,config:JSON.stringify(E)})}catch(d){h.logger.warn("Error in worker:",d),h.logger.error("Error while initializing DemuxerWorker, fallback to inline"),l&&self.URL.revokeObjectURL(l.objectURL),this.transmuxer=new j.default(this.observer,T,E,_,e),this.worker=null}}else this.transmuxer=new j.default(this.observer,T,E,_,e)}var n=t.prototype;return n.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},n.push=function(e,i,o,S,E,y,T,_,l,d){var a=this;l.transmuxing.start=self.performance.now();var c=this.transmuxer,v=this.worker,f=y?y.start:E.start,b=E.decryptdata,I=this.frag,R=!(I&&E.cc===I.cc),P=!(I&&l.level===I.level),M=I?l.sn-I.sn:-1,F=this.part?l.part-this.part.index:1,A=!P&&(M===1||M===0&&F===1),B=self.performance.now();(P||M||E.stats.parsing.start===0)&&(E.stats.parsing.start=B),y&&(F||!A)&&(y.stats.parsing.start=B);var z=new j.TransmuxState(R,A,_,P,f);if(!A||R){h.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+l.sn+" p: "+l.part+" level: "+l.level+" id: "+l.id+`
|
|
discontinuity: `+R+`
|
|
trackSwitch: `+P+`
|
|
contiguous: `+A+`
|
|
accurateTimeOffset: `+_+`
|
|
timeOffset: `+f);var Z=new j.TransmuxConfig(o,S,i,T,d);this.configureTransmuxer(Z)}if(this.frag=E,this.part=y,v)v.postMessage({cmd:"demux",data:e,decryptdata:b,chunkMeta:l,state:z},e instanceof ArrayBuffer?[e]:[]);else if(c){var ae=c.push(e,b,l,z);Object(j.isPromise)(ae)?ae.then(function(De){a.handleTransmuxComplete(De)}):this.handleTransmuxComplete(ae)}},n.flush=function(e){var i=this;e.transmuxing.start=self.performance.now();var o=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:e});else if(o){var E=o.flush(e);Object(j.isPromise)(E)?E.then(function(y){i.handleFlushResult(y,e)}):this.handleFlushResult(E,e)}},n.handleFlushResult=function(e,i){var o=this;e.forEach(function(S){o.handleTransmuxComplete(S)}),this.onFlush(i)},n.onWorkerMessage=function(e){var i=e.data,o=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,o.trigger(i.event,i.data);break}}},n.configureTransmuxer=function(e){var i=this.worker,o=this.transmuxer;i?i.postMessage({cmd:"configure",config:e}):o&&o.configure(e)},n.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},t}()},"./src/demux/transmuxer-worker.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return D});var W=L("./src/demux/transmuxer.ts"),x=L("./src/events.ts"),O=L("./src/utils/logger.ts"),j=L("./node_modules/eventemitter3/index.js"),h=L.n(j);function D(r){var t=new j.EventEmitter,n=function(e,i){r.postMessage({event:e,data:i})};t.on(x.Events.FRAG_DECRYPTED,n),t.on(x.Events.ERROR,n),r.addEventListener("message",function(s){var e=s.data;switch(e.cmd){case"init":{var i=JSON.parse(e.config);r.transmuxer=new W.default(t,e.typeSupported,i,e.vendor,e.id),Object(O.enableLogs)(i.debug),n("init",null);break}case"configure":{r.transmuxer.configure(e.config);break}case"demux":{var o=r.transmuxer.push(e.data,e.decryptdata,e.chunkMeta,e.state);Object(W.isPromise)(o)?o.then(function(y){w(r,y)}):w(r,o);break}case"flush":{var S=e.chunkMeta,E=r.transmuxer.flush(S);Object(W.isPromise)(E)?E.then(function(y){m(r,y,S)}):m(r,E,S);break}default:break}})}function w(r,t){if(u(t.remuxResult))return;var n=[],s=t.remuxResult,e=s.audio,i=s.video;e&&g(n,e),i&&g(n,i),r.postMessage({event:"transmuxComplete",data:t},n)}function g(r,t){t.data1&&r.push(t.data1.buffer),t.data2&&r.push(t.data2.buffer)}function m(r,t,n){t.forEach(function(s){w(r,s)}),r.postMessage({event:"flush",data:n})}function u(r){return!r.audio&&!r.video&&!r.text&&!r.id3&&!r.initSegment}},"./src/demux/transmuxer.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return i}),L.d(H,"isPromise",function(){return E}),L.d(H,"TransmuxConfig",function(){return y}),L.d(H,"TransmuxState",function(){return T});var W=L("./src/events.ts"),x=L("./src/errors.ts"),O=L("./src/crypt/decrypter.ts"),j=L("./src/demux/aacdemuxer.ts"),h=L("./src/demux/mp4demuxer.ts"),D=L("./src/demux/tsdemuxer.ts"),w=L("./src/demux/mp3demuxer.ts"),g=L("./src/remux/mp4-remuxer.ts"),m=L("./src/remux/passthrough-remuxer.ts"),u=L("./src/demux/chunk-cache.ts"),r=L("./src/utils/mp4-tools.ts"),t=L("./src/utils/logger.ts"),n;try{n=self.performance.now.bind(self.performance)}catch(_){t.logger.debug("Unable to use Performance API on this environment"),n=self.Date.now}var s=[{demux:D.default,remux:g.default},{demux:h.default,remux:m.default},{demux:j.default,remux:g.default},{demux:w.default,remux:g.default}],e=1024;s.forEach(function(_){var l=_.demux;e=Math.max(e,l.minProbeByteLength)});var i=function(){function _(d,a,c,v,f){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 u.default,this.observer=d,this.typeSupported=a,this.config=c,this.vendor=v,this.id=f}var l=_.prototype;return l.configure=function(a){this.transmuxConfig=a,this.decrypter&&this.decrypter.reset()},l.push=function(a,c,v,f){var b=this,I=v.transmuxing;I.executeStart=n();var R=new Uint8Array(a),P=this.cache,M=this.config,F=this.currentTransmuxState,A=this.transmuxConfig;f&&(this.currentTransmuxState=f);var B=o(R,c);if(B&&B.method==="AES-128"){var z=this.getDecrypter();if(M.enableSoftwareAES){var Z=z.softwareDecrypt(R,B.key.buffer,B.iv.buffer);if(!Z)return I.executeEnd=n(),S(v);R=new Uint8Array(Z)}else return this.decryptionPromise=z.webCryptoDecrypt(R,B.key.buffer,B.iv.buffer).then(function(Ye){var it=b.push(Ye,null,v);return b.decryptionPromise=null,it}),this.decryptionPromise}var ae=f||F,De=ae.contiguous,_e=ae.discontinuity,Oe=ae.trackSwitch,Ne=ae.accurateTimeOffset,Ue=ae.timeOffset,Ee=A.audioCodec,q=A.videoCodec,J=A.defaultInitPts,pe=A.duration,ee=A.initSegmentData;if((_e||Oe)&&this.resetInitSegment(ee,Ee,q,pe),_e&&this.resetInitialTimestamp(J),De||this.resetContiguity(),this.needsProbing(R,_e,Oe)){if(P.dataLength){var Ae=P.flush();R=Object(r.appendUint8Array)(Ae,R)}this.configureTransmuxer(R,A)}var Ve=this.transmux(R,B,Ue,Ne,v),Le=this.currentTransmuxState;return Le.contiguous=!0,Le.discontinuity=!1,Le.trackSwitch=!1,I.executeEnd=n(),Ve},l.flush=function(a){var c=this,v=a.transmuxing;v.executeStart=n();var f=this.decrypter,b=this.cache,I=this.currentTransmuxState,R=this.decryptionPromise;if(R)return R.then(function(){return c.flush(a)});var P=[],M=I.timeOffset;if(f){var F=f.flush();F&&P.push(this.push(F,null,a))}var A=b.dataLength;b.reset();var B=this.demuxer,z=this.remuxer;if(!B||!z)return A>=e&&this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=n(),[S(a)];var Z=B.flush(M);return E(Z)?Z.then(function(ae){return c.flushRemux(P,ae,a),P}):(this.flushRemux(P,Z,a),P)},l.flushRemux=function(a,c,v){var f=c.audioTrack,b=c.avcTrack,I=c.id3Track,R=c.textTrack,P=this.currentTransmuxState,M=P.accurateTimeOffset,F=P.timeOffset;t.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var A=this.remuxer.remux(f,b,I,R,F,M,!0,this.id);a.push({remuxResult:A,chunkMeta:v}),v.transmuxing.executeEnd=n()},l.resetInitialTimestamp=function(a){var c=this.demuxer,v=this.remuxer;if(!c||!v)return;c.resetTimeStamp(a),v.resetTimeStamp(a)},l.resetContiguity=function(){var a=this.demuxer,c=this.remuxer;if(!a||!c)return;a.resetContiguity(),c.resetNextTimestamp()},l.resetInitSegment=function(a,c,v,f){var b=this.demuxer,I=this.remuxer;if(!b||!I)return;b.resetInitSegment(c,v,f),I.resetInitSegment(a,c,v)},l.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},l.transmux=function(a,c,v,f,b){var I;return c&&c.method==="SAMPLE-AES"?I=this.transmuxSampleAes(a,c,v,f,b):I=this.transmuxUnencrypted(a,v,f,b),I},l.transmuxUnencrypted=function(a,c,v,f){var b=this.demuxer.demux(a,c,!1,!this.config.progressive),I=b.audioTrack,R=b.avcTrack,P=b.id3Track,M=b.textTrack,F=this.remuxer.remux(I,R,P,M,c,v,!1,this.id);return{remuxResult:F,chunkMeta:f}},l.transmuxSampleAes=function(a,c,v,f,b){var I=this;return this.demuxer.demuxSampleAes(a,c,v).then(function(R){var P=I.remuxer.remux(R.audioTrack,R.avcTrack,R.id3Track,R.textTrack,v,f,!1,I.id);return{remuxResult:P,chunkMeta:b}})},l.configureTransmuxer=function(a,c){for(var v=this.config,f=this.observer,b=this.typeSupported,I=this.vendor,R=c.audioCodec,P=c.defaultInitPts,M=c.duration,F=c.initSegmentData,A=c.videoCodec,B,z=0,Z=s.length;z<Z;z++)if(s[z].demux.probe(a)){B=s[z];break}B||(t.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),B={demux:h.default,remux:m.default});var ae=this.demuxer,De=this.remuxer,_e=B.remux,Oe=B.demux;(!De||!(De instanceof _e))&&(this.remuxer=new _e(f,v,b,I)),(!ae||!(ae instanceof Oe))&&(this.demuxer=new Oe(f,v,b),this.probe=Oe.probe),this.resetInitSegment(F,R,A,M),this.resetInitialTimestamp(P)},l.needsProbing=function(a,c,v){return!this.demuxer||!this.remuxer||c||v},l.getDecrypter=function(){var a=this.decrypter;return a||(a=this.decrypter=new O.default(this.observer,this.config)),a},_}();function o(_,l){var d=null;return _.byteLength>0&&l!=null&&l.key!=null&&l.iv!==null&&l.method!=null&&(d=l),d}var S=function(l){return{remuxResult:{},chunkMeta:l}};function E(_){return"then"in _&&_.then instanceof Function}var y=function(l,d,a,c,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=l,this.videoCodec=d,this.initSegmentData=a,this.duration=c,this.defaultInitPts=v},T=function(l,d,a,c,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=l,this.contiguous=d,this.accurateTimeOffset=a,this.trackSwitch=c,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"discardEPB",function(){return S});var W=L("./src/demux/adts.ts"),x=L("./src/demux/mpegaudio.ts"),O=L("./src/demux/exp-golomb.ts"),j=L("./src/demux/id3.ts"),h=L("./src/demux/sample-aes.ts"),D=L("./src/events.ts"),w=L("./src/utils/mp4-tools.ts"),g=L("./src/utils/logger.ts"),m=L("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},r=function(){function E(T,_,l){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=T,this.config=_,this.typeSupported=l}E.probe=function(_){var l=E.syncOffset(_);return l<0?!1:(l&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+l+", junk ahead ?"),!0)},E.syncOffset=function(_){for(var l=Math.min(1e3,_.length-3*188),d=0;d<l;){if(_[d]===71&&_[d+188]===71&&_[d+2*188]===71)return d;d++}return-1},E.createTrack=function(_,l){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:u[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?l:void 0}};var y=E.prototype;return y.resetInitSegment=function(_,l,d){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",d),this._audioTrack=E.createTrack("audio",d),this._id3Track=E.createTrack("id3",d),this._txtTrack=E.createTrack("text",d),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=l,this._duration=d},y.resetTimeStamp=function(){},y.resetContiguity=function(){var _=this._audioTrack,l=this._avcTrack,d=this._id3Track;_&&(_.pesData=null),l&&(l.pesData=null),d&&(d.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},y.demux=function(_,l,d,a){d===void 0&&(d=!1),a===void 0&&(a=!1),d||(this.sampleAes=null);var c,v=this._avcTrack,f=this._audioTrack,b=this._id3Track,I=v.pid,R=v.pesData,P=f.pid,M=b.pid,F=f.pesData,A=b.pesData,B=!1,z=this.pmtParsed,Z=this._pmtId,ae=_.length;if(this.remainderData&&(_=Object(w.appendUint8Array)(this.remainderData,_),ae=_.length,this.remainderData=null),ae<188&&!a)return this.remainderData=_,{audioTrack:f,avcTrack:v,id3Track:b,textTrack:this._txtTrack};var De=Math.max(0,E.syncOffset(_));ae-=(ae+De)%188,ae<_.byteLength&&!a&&(this.remainderData=new Uint8Array(_.buffer,ae,_.buffer.byteLength-ae));for(var _e=De;_e<ae;_e+=188)if(_[_e]===71){var Oe=!!(_[_e+1]&64),Ne=((_[_e+1]&31)<<8)+_[_e+2],Ue=(_[_e+3]&48)>>4,Ee=void 0;if(Ue>1){if(Ee=_e+5+_[_e+4],Ee===_e+188)continue}else Ee=_e+4;switch(Ne){case I:Oe&&(R&&(c=e(R))&&this.parseAVCPES(c,!1),R={data:[],size:0}),R&&(R.data.push(_.subarray(Ee,_e+188)),R.size+=_e+188-Ee);break;case P:Oe&&(F&&(c=e(F))&&(f.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),F={data:[],size:0}),F&&(F.data.push(_.subarray(Ee,_e+188)),F.size+=_e+188-Ee);break;case M:Oe&&(A&&(c=e(A))&&this.parseID3PES(c),A={data:[],size:0}),A&&(A.data.push(_.subarray(Ee,_e+188)),A.size+=_e+188-Ee);break;case 0:Oe&&(Ee+=_[Ee]+1),Z=this._pmtId=n(_,Ee);break;case Z:{Oe&&(Ee+=_[Ee]+1);var q=s(_,Ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,d);I=q.avc,I>0&&(v.pid=I),P=q.audio,P>0&&(f.pid=P,f.isAAC=q.isAAC),M=q.id3,M>0&&(b.pid=M),B&&!z&&(g.logger.log("reparse from beginning"),B=!1,_e=De-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:B=!0;break}}else this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=R,f.pesData=F,b.pesData=A;var J={audioTrack:f,avcTrack:v,id3Track:b,textTrack:this._txtTrack};return a&&this.extractRemainingSamples(J),J},y.flush=function(){var _=this.remainderData;this.remainderData=null;var l;return _?l=this.demux(_,-1,!1,!0):l={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(l),this.sampleAes?this.decrypt(l,this.sampleAes):l},y.extractRemainingSamples=function(_){var l=_.audioTrack,d=_.avcTrack,a=_.id3Track,c=d.pesData,v=l.pesData,f=a.pesData,b;c&&(b=e(c))?(this.parseAVCPES(b,!0),d.pesData=null):d.pesData=c,v&&(b=e(v))?(l.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),l.pesData=null):(v!=null&&v.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),l.pesData=v),f&&(b=e(f))?(this.parseID3PES(b),a.pesData=null):a.pesData=f},y.demuxSampleAes=function(_,l,d){var a=this.demux(_,d,!0,!this.config.progressive),c=this.sampleAes=new h.default(this.observer,this.config,l);return this.decrypt(a,c)},y.decrypt=function(_,l){return new Promise(function(d){var a=_.audioTrack,c=_.avcTrack;a.samples&&a.isAAC?l.decryptAacSamples(a.samples,0,function(){c.samples?l.decryptAvcSamples(c.samples,0,0,function(){d(_)}):d(_)}):c.samples&&l.decryptAvcSamples(c.samples,0,0,function(){d(_)})})},y.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},y.parseAVCPES=function(_,l){var d=this,a=this._avcTrack,c=this.parseAVCNALu(_.data),v=!1,f=this.avcSample,b,I=!1;_.data=null,f&&c.length&&!a.audFound&&(i(f,a),f=this.avcSample=t(!1,_.pts,_.dts,"")),c.forEach(function(R){switch(R.type){case 1:{b=!0,f||(f=d.avcSample=t(!0,_.pts,_.dts,"")),v&&(f.debug+="NDR "),f.frame=!0;var P=R.data;if(I&&P.length>4){var M=new O.default(P).readSliceType();(M===2||M===4||M===7||M===9)&&(f.key=!0)}break}case 5:b=!0,f||(f=d.avcSample=t(!0,_.pts,_.dts,"")),v&&(f.debug+="IDR "),f.key=!0,f.frame=!0;break;case 6:{b=!0,v&&f&&(f.debug+="SEI ");var F=new O.default(S(R.data));F.readUByte();for(var A=0,B=0,z=!1,Z=0;!z&&F.bytesAvailable>1;){A=0;do Z=F.readUByte(),A+=Z;while(Z===255);B=0;do Z=F.readUByte(),B+=Z;while(Z===255);if(A===4&&F.bytesAvailable!==0){z=!0;var ae=F.readUByte();if(ae===181){var De=F.readUShort();if(De===49){var _e=F.readUInt();if(_e===1195456820){var Oe=F.readUByte();if(Oe===3){for(var Ne=F.readUByte(),Ue=F.readUByte(),Ee=31&Ne,q=[Ne,Ue],J=0;J<Ee;J++)q.push(F.readUByte()),q.push(F.readUByte()),q.push(F.readUByte());o(d._txtTrack.samples,{type:3,pts:_.pts,bytes:q})}}}}}else if(A===5&&F.bytesAvailable!==0){if(z=!0,B>16){for(var pe=[],ee=0;ee<16;ee++)pe.push(F.readUByte().toString(16)),(ee===3||ee===5||ee===7||ee===9)&&pe.push("-");for(var Ae=B-16,Ve=new Uint8Array(Ae),Le=0;Le<Ae;Le++)Ve[Le]=F.readUByte();o(d._txtTrack.samples,{pts:_.pts,payloadType:A,uuid:pe.join(""),userData:Object(j.utf8ArrayToStr)(Ve),userDataBytes:Ve})}}else if(B<F.bytesAvailable)for(var Ye=0;Ye<B;Ye++)F.readUByte()}break}case 7:if(b=!0,I=!0,v&&f&&(f.debug+="SPS "),!a.sps){var it=new O.default(R.data),vt=it.readSPS();a.width=vt.width,a.height=vt.height,a.pixelRatio=vt.pixelRatio,a.sps=[R.data],a.duration=d._duration;for(var ut=R.data.subarray(1,4),mt="avc1.",lt=0;lt<3;lt++){var Bt=ut[lt].toString(16);Bt.length<2&&(Bt="0"+Bt),mt+=Bt}a.codec=mt}break;case 8:b=!0,v&&f&&(f.debug+="PPS "),a.pps||(a.pps=[R.data]);break;case 9:b=!1,a.audFound=!0,f&&i(f,a),f=d.avcSample=t(!1,_.pts,_.dts,v?"AUD ":"");break;case 12:b=!1;break;default:b=!1,f&&(f.debug+="unknown NAL "+R.type+" ");break}if(f&&b){var Nt=f.units;Nt.push(R)}}),l&&f&&(i(f,a),this.avcSample=null)},y.getLastNalUnit=function(){var _,l=this.avcSample,d;if(!l||l.units.length===0){var a=this._avcTrack.samples;l=a[a.length-1]}if((_=l)!==null&&_!==void 0&&_.units){var c=l.units;d=c[c.length-1]}return d},y.parseAVCNALu=function(_){var l=_.byteLength,d=this._avcTrack,a=d.naluState||0,c=a,v=[],f=0,b,I,R,P=-1,M=0;for(a===-1&&(P=0,M=_[0]&31,a=0,f=1);f<l;){if(b=_[f++],!a){a=b?0:1;continue}if(a===1){a=b?0:2;continue}if(!b)a=3;else if(b===1){if(P>=0){var F={data:_.subarray(P,f-a-1),type:M};v.push(F)}else{var A=this.getLastNalUnit();if(A&&(c&&f<=4-c&&(A.state&&(A.data=A.data.subarray(0,A.data.byteLength-c))),I=f-a-1,I>0)){var B=new Uint8Array(A.data.byteLength+I);B.set(A.data,0),B.set(_.subarray(0,I),A.data.byteLength),A.data=B,A.state=0}}f<l?(R=_[f]&31,P=f,M=R,a=0):a=-1}else a=0}if(P>=0&&a>=0){var z={data:_.subarray(P,l),type:M,state:a};v.push(z)}if(v.length===0){var Z=this.getLastNalUnit();if(Z){var ae=new Uint8Array(Z.data.byteLength+_.byteLength);ae.set(Z.data,0),ae.set(_,Z.data.byteLength),Z.data=ae}}return d.naluState=a,v},y.parseAACPES=function(_){var l=0,d=this._audioTrack,a=this.aacOverFlow,c=_.data;if(a){this.aacOverFlow=null;var v=a.sample.unit.byteLength,f=Math.min(a.missing,v),b=v-f;a.sample.unit.set(c.subarray(0,f),b),d.samples.push(a.sample),l=a.missing}var I,R;for(I=l,R=c.length;I<R-1&&!W.isHeader(c,I);I++);if(I!==l){var P,M;if(I<R-1?(P="AAC PES did not start with ADTS header,offset:"+I,M=!1):(P="no ADTS header found in AAC PES",M=!0),g.logger.warn("parsing error:"+P),this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:P}),M)return}W.initTrackConfig(d,this.observer,c,I,this.audioCodec);var F;if(_.pts!==void 0)F=_.pts;else if(a){var A=W.getFrameDuration(d.samplerate);F=a.sample.pts+A}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var B=0;I<R;)if(W.isHeader(c,I)){if(I+5<R){var z=W.appendFrame(d,c,I,F,B);if(z)if(z.missing)this.aacOverFlow=z;else{I+=z.length,B++;continue}}break}else I++},y.parseMPEGPES=function(_){var l=_.data,d=l.length,a=0,c=0,v=_.pts;if(v===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<d;)if(x.isHeader(l,c)){var f=x.appendFrame(this._audioTrack,l,c,v,a);if(f)c+=f.length,a++;else break}else c++},y.parseID3PES=function(_){if(_.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},E}();r.minProbeByteLength=188;function t(E,y,T,_){return{key:E,frame:!1,pts:y,dts:T,units:[],debug:_,length:0}}function n(E,y){return(E[y+10]&31)<<8|E[y+11]}function s(E,y,T,_){var l={audio:-1,avc:-1,id3:-1,isAAC:!0},d=(E[y+1]&15)<<8|E[y+2],a=y+3+d-4,c=(E[y+10]&15)<<8|E[y+11];for(y+=12+c;y<a;){var v=(E[y+1]&31)<<8|E[y+2];switch(E[y]){case 207:if(!_){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:l.audio===-1&&(l.audio=v);break;case 21:l.id3===-1&&(l.id3=v);break;case 219:if(!_){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:l.avc===-1&&(l.avc=v);break;case 3:case 4:T?l.audio===-1&&(l.audio=v,l.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}y+=((E[y+3]&15)<<8|E[y+4])+5}return l}function e(E){var y=0,T,_,l,d,a,c=E.data;if(!E||E.size===0)return null;for(;c[0].length<19&&c.length>1;){var v=new Uint8Array(c[0].length+c[1].length);v.set(c[0]),v.set(c[1],c[0].length),c[0]=v,c.splice(1,1)}T=c[0];var f=(T[0]<<16)+(T[1]<<8)+T[2];if(f===1){if(_=(T[4]<<8)+T[5],_&&_>E.size-6)return null;var b=T[7];b&192&&(d=(T[9]&14)*536870912+(T[10]&255)*4194304+(T[11]&254)*16384+(T[12]&255)*128+(T[13]&254)/2,b&64?(a=(T[14]&14)*536870912+(T[15]&255)*4194304+(T[16]&254)*16384+(T[17]&255)*128+(T[18]&254)/2,d-a>60*9e4&&(g.logger.warn(Math.round((d-a)/9e4)+"s delta between PTS and DTS, align them"),d=a)):a=d),l=T[8];var I=l+9;if(E.size<=I)return null;E.size-=I;for(var R=new Uint8Array(E.size),P=0,M=c.length;P<M;P++){T=c[P];var F=T.byteLength;if(I)if(I>F){I-=F;continue}else T=T.subarray(I),F-=I,I=0;R.set(T,y),y+=F}return _&&(_-=l+3),{data:R,pts:d,dts:a,len:_}}return null}function i(E,y){if(E.units.length&&E.frame){if(E.pts===void 0){var T=y.samples,_=T.length;if(_){var l=T[_-1];E.pts=l.pts,E.dts=l.dts}else{y.dropped++;return}}y.samples.push(E)}E.debug.length&&g.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function o(E,y){var T=E.length;if(T>0){if(y.pts>=E[T-1].pts)E.push(y);else for(var _=T-1;_>=0;_--)if(y.pts<E[_].pts){E.splice(_,0,y);break}}else E.push(y)}function S(E){for(var y=E.byteLength,T=[],_=1;_<y-2;)E[_]===0&&E[_+1]===0&&E[_+2]===3?(T.push(_+2),_+=2):_++;if(T.length===0)return E;var l=y-T.length,d=new Uint8Array(l),a=0;for(_=0;_<l;a++,_++)a===T[0]&&(a++,T.shift()),d[_]=E[a];return d}H.default=r},"./src/errors.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"ErrorTypes",function(){return W}),L.d(H,"ErrorDetails",function(){return x});var W;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(W||(W={}));var x;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(x||(x={}))},"./src/events.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"Events",function(){return W});var W;(function(x){x.MEDIA_ATTACHING="hlsMediaAttaching",x.MEDIA_ATTACHED="hlsMediaAttached",x.MEDIA_DETACHING="hlsMediaDetaching",x.MEDIA_DETACHED="hlsMediaDetached",x.BUFFER_RESET="hlsBufferReset",x.BUFFER_CODECS="hlsBufferCodecs",x.BUFFER_CREATED="hlsBufferCreated",x.BUFFER_APPENDING="hlsBufferAppending",x.BUFFER_APPENDED="hlsBufferAppended",x.BUFFER_EOS="hlsBufferEos",x.BUFFER_FLUSHING="hlsBufferFlushing",x.BUFFER_FLUSHED="hlsBufferFlushed",x.MANIFEST_LOADING="hlsManifestLoading",x.MANIFEST_LOADED="hlsManifestLoaded",x.MANIFEST_PARSED="hlsManifestParsed",x.LEVEL_SWITCHING="hlsLevelSwitching",x.LEVEL_SWITCHED="hlsLevelSwitched",x.LEVEL_LOADING="hlsLevelLoading",x.LEVEL_LOADED="hlsLevelLoaded",x.LEVEL_UPDATED="hlsLevelUpdated",x.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",x.LEVELS_UPDATED="hlsLevelsUpdated",x.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",x.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",x.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",x.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",x.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",x.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",x.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",x.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",x.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",x.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",x.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",x.CUES_PARSED="hlsCuesParsed",x.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",x.INIT_PTS_FOUND="hlsInitPtsFound",x.FRAG_LOADING="hlsFragLoading",x.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",x.FRAG_LOADED="hlsFragLoaded",x.FRAG_DECRYPTED="hlsFragDecrypted",x.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",x.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",x.FRAG_PARSING_METADATA="hlsFragParsingMetadata",x.FRAG_PARSED="hlsFragParsed",x.FRAG_BUFFERED="hlsFragBuffered",x.FRAG_CHANGED="hlsFragChanged",x.FPS_DROP="hlsFpsDrop",x.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",x.ERROR="hlsError",x.DESTROYING="hlsDestroying",x.KEY_LOADING="hlsKeyLoading",x.KEY_LOADED="hlsKeyLoaded",x.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",x.BACK_BUFFER_REACHED="hlsBackBufferReached"})(W||(W={}))},"./src/hls.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return E});var W=L("./node_modules/url-toolkit/src/url-toolkit.js"),x=L.n(W),O=L("./src/loader/playlist-loader.ts"),j=L("./src/loader/key-loader.ts"),h=L("./src/controller/id3-track-controller.ts"),D=L("./src/controller/latency-controller.ts"),w=L("./src/controller/level-controller.ts"),g=L("./src/controller/fragment-tracker.ts"),m=L("./src/controller/stream-controller.ts"),u=L("./src/is-supported.ts"),r=L("./src/utils/logger.ts"),t=L("./src/config.ts"),n=L("./node_modules/eventemitter3/index.js"),s=L.n(n),e=L("./src/events.ts"),i=L("./src/errors.ts");function o(y,T){for(var _=0;_<T.length;_++){var l=T[_];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(y,l.key,l)}}function S(y,T,_){return T&&o(y.prototype,T),_&&o(y,_),y}var E=function(){y.isSupported=function(){return Object(u.isSupported)()};function y(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new n.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 l=this.config=Object(t.mergeConfig)(y.DefaultConfig,_);this.userConfig=_,Object(r.enableLogs)(l.debug),this._autoLevelCapping=-1,l.progressive&&Object(t.enableStreamingMode)(l);var d=l.abrController,a=l.bufferController,c=l.capLevelController,v=l.fpsController,f=this.abrController=new d(this),b=this.bufferController=new a(this),I=this.capLevelController=new c(this),R=new v(this),P=new O.default(this),M=new j.default(this),F=new h.default(this),A=this.levelController=new w.default(this),B=new g.FragmentTracker(this),z=this.streamController=new m.default(this,B);I.setStreamController(z),R.setStreamController(z);var Z=[A,z];this.networkControllers=Z;var ae=[P,M,f,b,I,R,F,B];this.audioTrackController=this.createController(l.audioTrackController,null,Z),this.createController(l.audioStreamController,B,Z),this.subtitleTrackController=this.createController(l.subtitleTrackController,null,Z),this.createController(l.subtitleStreamController,B,Z),this.createController(l.timelineController,null,ae),this.emeController=this.createController(l.emeController,null,ae),this.cmcdController=this.createController(l.cmcdController,null,ae),this.latencyController=this.createController(D.default,null,ae),this.coreComponents=ae}var T=y.prototype;return T.createController=function(l,d,a){if(l){var c=d?new l(this,d):new l(this);return a&&a.push(c),c}return null},T.on=function(l,d,a){a===void 0&&(a=this),this._emitter.on(l,d,a)},T.once=function(l,d,a){a===void 0&&(a=this),this._emitter.once(l,d,a)},T.removeAllListeners=function(l){this._emitter.removeAllListeners(l)},T.off=function(l,d,a,c){a===void 0&&(a=this),this._emitter.off(l,d,a,c)},T.listeners=function(l){return this._emitter.listeners(l)},T.emit=function(l,d,a){return this._emitter.emit(l,d,a)},T.trigger=function(l,d){if(this.config.debug)return this.emit(l,l,d);try{return this.emit(l,l,d)}catch(a){r.logger.error("An internal error happened while handling event "+l+'. Error message: "'+a.message+'". Here is a stacktrace:',a),this.trigger(e.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:l,error:a})}return!1},T.listenerCount=function(l){return this._emitter.listenerCount(l)},T.destroy=function(){r.logger.log("destroy"),this.trigger(e.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(l){return l.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(l){return l.destroy()}),this.coreComponents.length=0},T.attachMedia=function(l){r.logger.log("attachMedia"),this._media=l,this.trigger(e.Events.MEDIA_ATTACHING,{media:l})},T.detachMedia=function(){r.logger.log("detachMedia"),this.trigger(e.Events.MEDIA_DETACHING,void 0),this._media=null},T.loadSource=function(l){this.stopLoad();var d=this.media,a=this.url,c=this.url=W.buildAbsoluteURL(self.location.href,l,{alwaysNormalize:!0});r.logger.log("loadSource:"+c),d&&a&&a!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(d)),this.trigger(e.Events.MANIFEST_LOADING,{url:l})},T.startLoad=function(l){l===void 0&&(l=-1),r.logger.log("startLoad("+l+")"),this.networkControllers.forEach(function(d){d.startLoad(l)})},T.stopLoad=function(){r.logger.log("stopLoad"),this.networkControllers.forEach(function(l){l.stopLoad()})},T.swapAudioCodec=function(){r.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},T.recoverMediaError=function(){r.logger.log("recoverMediaError");var l=this._media;this.detachMedia(),l&&this.attachMedia(l)},T.removeLevel=function(l,d){d===void 0&&(d=0),this.levelController.removeLevel(l,d)},S(y,[{key:"levels",get:function(){var l=this.levelController.levels;return l||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(l){r.logger.log("set currentLevel:"+l),this.loadLevel=l,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(l){r.logger.log("set nextLevel:"+l),this.levelController.manualLevel=l,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(l){r.logger.log("set loadLevel:"+l),this.levelController.manualLevel=l}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(l){this.levelController.nextLoadLevel=l}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(l){r.logger.log("set firstLevel:"+l),this.levelController.firstLevel=l}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(l){r.logger.log("set startLevel:"+l),l!==-1&&(l=Math.max(l,this.minAutoLevel)),this.levelController.startLevel=l}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(l){var d=!!l;d!==this.config.capLevelToPlayerSize&&(d?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=d)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(l){this._autoLevelCapping!==l&&(r.logger.log("set autoLevelCapping:"+l),this._autoLevelCapping=l)}},{key:"bandwidthEstimate",get:function(){var l=this.abrController.bwEstimator;return l?l.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var l=this.levels,d=this.config.minAutoBitrate;if(!l)return 0;for(var a=l.length,c=0;c<a;c++)if(l[c].maxBitrate>d)return c;return 0}},{key:"maxAutoLevel",get:function(){var l=this.levels,d=this.autoLevelCapping,a;return d===-1&&l&&l.length?a=l.length-1:a=d,a}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(l){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,l)}},{key:"audioTracks",get:function(){var l=this.audioTrackController;return l?l.audioTracks:[]}},{key:"audioTrack",get:function(){var l=this.audioTrackController;return l?l.audioTrack:-1},set:function(l){var d=this.audioTrackController;d&&(d.audioTrack=l)}},{key:"subtitleTracks",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTrack:-1},set:function(l){var d=this.subtitleTrackController;d&&(d.subtitleTrack=l)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var l=this.subtitleTrackController;return l?l.subtitleDisplay:!1},set:function(l){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=l)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(l){this.config.lowLatencyMode=l}},{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 e.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return y.defaultConfig?y.defaultConfig:t.hlsDefaultConfig},set:function(l){y.defaultConfig=l}}]),y}();E.defaultConfig=void 0},"./src/is-supported.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"isSupported",function(){return O}),L.d(H,"changeTypeSupported",function(){return j});var W=L("./src/utils/mediasource-helper.ts");function x(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var h=Object(W.getMediaSource)();if(!h)return!1;var D=x(),w=h&&typeof h.isTypeSupported=="function"&&h.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!D||D.prototype&&typeof D.prototype.appendBuffer=="function"&&typeof D.prototype.remove=="function";return!!w&&!!g}function j(){var h,D=x();return typeof(D==null||((h=D.prototype)===null||h===void 0)?void 0:h.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return r}),L.d(H,"LoadError",function(){return n});var W=L("./src/polyfills/number.ts"),x=L("./src/errors.ts");function O(s,e){s.prototype=Object.create(e.prototype),s.prototype.constructor=s,g(s,e)}function j(s){var e=typeof Map=="function"?new Map:void 0;return j=function(o){if(o===null||!w(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(o))return e.get(o);e.set(o,S)}function S(){return h(o,arguments,m(this).constructor)}return S.prototype=Object.create(o.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),g(S,o)},j(s)}function h(s,e,i){return D()?h=Reflect.construct:h=function(S,E,y){var T=[null];T.push.apply(T,E);var _=Function.bind.apply(S,T),l=new _;return y&&g(l,y.prototype),l},h.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function w(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,e){return g=Object.setPrototypeOf||function(o,S){return o.__proto__=S,o},g(s,e)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},m(s)}var u=Math.pow(2,17),r=function(){function s(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var e=s.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(o,S){var E=this,y=o.url;if(!y)return Promise.reject(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(y?"part list":"url")));this.abort();var T=this.config,_=T.fLoader,l=T.loader;return new Promise(function(d,a){E.loader&&E.loader.destroy();var c=E.loader=o.loader=_?new _(T):new l(T),v=t(o),f={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:u};o.stats=c.stats,c.load(v,f,{onSuccess:function(I,R,P,M){E.resetLoader(o,c),d({frag:o,part:null,payload:I.data,networkDetails:M})},onError:function(I,R,P){E.resetLoader(o,c),a(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:I,networkDetails:P}))},onAbort:function(I,R,P){E.resetLoader(o,c),a(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:P}))},onTimeout:function(I,R,P){E.resetLoader(o,c),a(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:P}))},onProgress:function(I,R,P,M){S&&S({frag:o,part:null,payload:P,networkDetails:M})}})})},e.loadPart=function(o,S,E){var y=this;this.abort();var T=this.config,_=T.fLoader,l=T.loader;return new Promise(function(d,a){y.loader&&y.loader.destroy();var c=y.loader=o.loader=_?new _(T):new l(T),v=t(o,S),f={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:u};S.stats=c.stats,c.load(v,f,{onSuccess:function(I,R,P,M){y.resetLoader(o,c),y.updateStatsFromPart(o,S);var F={frag:o,part:S,payload:I.data,networkDetails:M};E(F),d(F)},onError:function(I,R,P){y.resetLoader(o,c),a(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:S,response:I,networkDetails:P}))},onAbort:function(I,R,P){o.stats.aborted=S.stats.aborted,y.resetLoader(o,c),a(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:S,networkDetails:P}))},onTimeout:function(I,R,P){y.resetLoader(o,c),a(new n({type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:S,networkDetails:P}))}})})},e.updateStatsFromPart=function(o,S){var E=o.stats,y=S.stats,T=y.total;if(E.loaded+=y.loaded,T){var _=Math.round(o.duration/S.duration),l=Math.min(Math.round(E.loaded/T),_),d=_-l,a=d*Math.round(E.loaded/l);E.total=E.loaded+a}else E.total=Math.max(E.loaded,E.total);var c=E.loading,v=y.loading;c.start?c.first+=v.first-v.start:(c.start=v.start,c.first=v.first),c.end=v.end},e.resetLoader=function(o,S){o.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},s}();function t(s,e){e===void 0&&(e=null);var i=e||s,o={frag:s,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},S=i.byteRangeStartOffset,E=i.byteRangeEndOffset;return Object(W.isFiniteNumber)(S)&&Object(W.isFiniteNumber)(E)&&(o.rangeStart=S,o.rangeEnd=E),o}var n=function(s){O(e,s);function e(i){for(var o,S=arguments.length,E=new Array(S>1?S-1:0),y=1;y<S;y++)E[y-1]=arguments[y];return o=s.call.apply(s,[this].concat(E))||this,o.data=void 0,o.data=i,o}return e}(j(Error))},"./src/loader/fragment.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"ElementaryStreamTypes",function(){return r}),L.d(H,"BaseSegment",function(){return t}),L.d(H,"Fragment",function(){return n}),L.d(H,"Part",function(){return s});var W=L("./src/polyfills/number.ts"),x=L("./node_modules/url-toolkit/src/url-toolkit.js"),O=L.n(x),j=L("./src/utils/logger.ts"),h=L("./src/loader/level-key.ts"),D=L("./src/loader/load-stats.ts");function w(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,g(e,i)}function g(e,i){return g=Object.setPrototypeOf||function(S,E){return S.__proto__=E,S},g(e,i)}function m(e,i){for(var o=0;o<i.length;o++){var S=i[o];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(e,S.key,S)}}function u(e,i,o){return i&&m(e.prototype,i),o&&m(e,o),e}var r;(function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"})(r||(r={}));var t=function(){function e(o){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[r.AUDIO]=null,S[r.VIDEO]=null,S[r.AUDIOVIDEO]=null,S),this.baseurl=o}var i=e.prototype;return i.setByteRange=function(S,E){var y=S.split("@",2),T=[];y.length===1?T[0]=E?E.byteRangeEndOffset:0:T[0]=parseInt(y[1]),T[1]=parseInt(y[0])+T[0],this._byteRange=T},u(e,[{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(x.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),e}(),n=function(e){w(i,e);function i(S,E){var y;return y=e.call(this,E)||this,y._decryptdata=null,y.rawProgramDateTime=null,y.programDateTime=null,y.tagList=[],y.duration=0,y.sn=0,y.levelkey=void 0,y.type=void 0,y.loader=null,y.level=-1,y.cc=0,y.startPTS=void 0,y.endPTS=void 0,y.appendedPTS=void 0,y.startDTS=void 0,y.endDTS=void 0,y.start=0,y.deltaPTS=void 0,y.maxStartPTS=void 0,y.minEndPTS=void 0,y.stats=new D.LoadStats,y.urlId=0,y.data=void 0,y.bitrateTest=!1,y.title=null,y.initSegment=null,y.type=S,y}var o=i.prototype;return o.createInitializationVector=function(E){for(var y=new Uint8Array(16),T=12;T<16;T++)y[T]=E>>8*(15-T)&255;return y},o.setDecryptDataFromLevelKey=function(E,y){var T=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(T=h.LevelKey.fromURI(E.uri),T.method=E.method,T.iv=this.createInitializationVector(y),T.keyFormat="identity"),T},o.setElementaryStreamInfo=function(E,y,T,_,l,d){d===void 0&&(d=!1);var a=this.elementaryStreams,c=a[E];if(!c){a[E]={startPTS:y,endPTS:T,startDTS:_,endDTS:l,partial:d};return}c.startPTS=Math.min(c.startPTS,y),c.endPTS=Math.max(c.endPTS,T),c.startDTS=Math.min(c.startDTS,_),c.endDTS=Math.max(c.endDTS,l)},o.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[r.AUDIO]=null,E[r.VIDEO]=null,E[r.AUDIOVIDEO]=null},u(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&j.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(W.isFiniteNumber)(this.programDateTime))return null;var E=Object(W.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),i}(t),s=function(e){w(i,e);function i(o,S,E,y,T){var _;_=e.call(this,E)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new D.LoadStats,_.duration=o.decimalFloatingPoint("DURATION"),_.gap=o.bool("GAP"),_.independent=o.bool("INDEPENDENT"),_.relurl=o.enumeratedString("URI"),_.fragment=S,_.index=y;var l=o.enumeratedString("BYTERANGE");return l&&_.setByteRange(l,T),T&&(_.fragOffset=T.fragOffset+T.duration),_}return u(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),i}(t)},"./src/loader/key-loader.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return j});var W=L("./src/events.ts"),x=L("./src/errors.ts"),O=L("./src/utils/logger.ts"),j=function(){function h(w){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=w,this._registerListeners()}var D=h.prototype;return D._registerListeners=function(){this.hls.on(W.Events.KEY_LOADING,this.onKeyLoading,this)},D._unregisterListeners=function(){this.hls.off(W.Events.KEY_LOADING,this.onKeyLoading)},D.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var m=this.loaders[g];m&&m.destroy()}this.loaders={}},D.onKeyLoading=function(g,m){var u=m.frag,r=u.type,t=this.loaders[r];if(!u.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var n=u.decryptdata.uri;if(n!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(t&&(O.logger.warn("abort previous key loader for type:"+r),t.abort()),!n){O.logger.warn("key uri is falsy");return}var e=s.loader,i=u.loader=this.loaders[r]=new e(s);this.decrypturl=n,this.decryptkey=null;var o={url:n,frag:u,responseType:"arraybuffer"},S={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(o,S,E)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(W.Events.KEY_LOADED,{frag:u}))},D.loadsuccess=function(g,m,u){var r=u.frag;if(!r.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=r.decryptdata.key=new Uint8Array(g.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(W.Events.KEY_LOADED,{frag:r})},D.loaderror=function(g,m){var u=m.frag,r=u.loader;r&&r.abort(),delete this.loaders[u.type],this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:g})},D.loadtimeout=function(g,m){var u=m.frag,r=u.loader;r&&r.abort(),delete this.loaders[u.type],this.hls.trigger(W.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},h}()},"./src/loader/level-details.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"LevelDetails",function(){return h});var W=L("./src/polyfills/number.ts");function x(D,w){for(var g=0;g<w.length;g++){var m=w[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function O(D,w,g){return w&&x(D.prototype,w),g&&x(D,g),D}var j=10,h=function(){function D(g){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=g}var w=D.prototype;return w.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var u=this.lastPartSn-m.lastPartSn,r=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!r||!!u,this.advanced=this.endSN>m.endSN||u>0||u===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},O(D,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(W.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var u=this.driftEnd-this.driftStart;return u*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),D}()},"./src/loader/level-key.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"LevelKey",function(){return h});var W=L("./node_modules/url-toolkit/src/url-toolkit.js"),x=L.n(W);function O(D,w){for(var g=0;g<w.length;g++){var m=w[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function j(D,w,g){return w&&O(D.prototype,w),g&&O(D,g),D}var h=function(){D.fromURL=function(g,m){return new D(g,m)},D.fromURI=function(g){return new D(g)};function D(w,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(W.buildAbsoluteURL)(w,g,{alwaysNormalize:!0}):this._uri=w}return j(D,[{key:"uri",get:function(){return this._uri}}]),D}()},"./src/loader/load-stats.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"LoadStats",function(){return W});var W=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(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return i});var W=L("./src/polyfills/number.ts"),x=L("./node_modules/url-toolkit/src/url-toolkit.js"),O=L.n(x),j=L("./src/loader/fragment.ts"),h=L("./src/loader/level-details.ts"),D=L("./src/loader/level-key.ts"),w=L("./src/utils/attr-list.ts"),g=L("./src/utils/logger.ts"),m=L("./src/utils/codecs.ts"),u=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,r=/#EXT-X-MEDIA:(.*)/g,t=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),n=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function e(T){var _,l;return s.test((_=(l=x.parseURL(T))===null||l===void 0?void 0:l.path)!=null?_:"")}var i=function(){function T(){}return T.findGroup=function(l,d){for(var a=0;a<l.length;a++){var c=l[a];if(c.id===d)return c}},T.convertAVC1ToAVCOTI=function(l){var d=l.split(".");if(d.length>2){var a=d.shift()+".";return a+=parseInt(d.shift()).toString(16),a+=("000"+parseInt(d.shift()).toString(16)).substr(-4),a}return l},T.resolve=function(l,d){return x.buildAbsoluteURL(d,l,{alwaysNormalize:!0})},T.parseMasterPlaylist=function(l,d){var a=[],c={},v=!1;u.lastIndex=0;for(var f;(f=u.exec(l))!=null;)if(f[1]){var b=new w.AttrList(f[1]),I={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:T.resolve(f[2],d)},R=b.decimalResolution("RESOLUTION");R&&(I.width=R.width,I.height=R.height),o((b.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=T.convertAVC1ToAVCOTI(I.videoCodec)),a.push(I)}else if(f[3]){var P=new w.AttrList(f[3]);P["DATA-ID"]&&(v=!0,c[P["DATA-ID"]]=P)}return{levels:a,sessionData:v?c:null}},T.parseMasterPlaylistMedia=function(l,d,a,c){c===void 0&&(c=[]);var v,f=[],b=0;for(r.lastIndex=0;(v=r.exec(l))!==null;){var I=new w.AttrList(v[1]);if(I.TYPE===a){var R={attrs:I,bitrate:0,id:b++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:a,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?T.resolve(I.URI,d):""};if(c.length){var P=T.findGroup(c,R.groupId)||c[0];S(R,P,"audioCodec"),S(R,P,"textCodec")}f.push(R)}}return f},T.parseLevelPlaylist=function(l,d,a,c,v){var f=new h.LevelDetails(d),b=f.fragments,I=null,R=0,P=0,M=0,F=0,A=null,B=new j.Fragment(c,d),z,Z,ae,De=-1,_e=!1;for(t.lastIndex=0,f.m3u8=l;(z=t.exec(l))!==null;){_e&&(_e=!1,B=new j.Fragment(c,d),B.start=M,B.sn=R,B.cc=F,B.level=a,I&&(B.initSegment=I,B.rawProgramDateTime=I.rawProgramDateTime));var Oe=z[1];if(Oe){B.duration=parseFloat(Oe);var Ne=(" "+z[2]).slice(1);B.title=Ne||null,B.tagList.push(Ne?["INF",Oe,Ne]:["INF",Oe])}else if(z[3])Object(W.isFiniteNumber)(B.duration)&&(B.start=M,ae&&(B.levelkey=ae),B.sn=R,B.level=a,B.cc=F,B.urlId=v,b.push(B),B.relurl=(" "+z[3]).slice(1),y(B,A),A=B,M+=B.duration,R++,P=0,_e=!0);else if(z[4]){var Ue=(" "+z[4]).slice(1);A?B.setByteRange(Ue,A):B.setByteRange(Ue)}else if(z[5])B.rawProgramDateTime=(" "+z[5]).slice(1),B.tagList.push(["PROGRAM-DATE-TIME",B.rawProgramDateTime]),De===-1&&(De=b.length);else{if(z=z[0].match(n),!z){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(Z=1;Z<z.length&&!(typeof z[Z]!="undefined");Z++);var Ee=(" "+z[Z]).slice(1),q=(" "+z[Z+1]).slice(1),J=z[Z+2]?(" "+z[Z+2]).slice(1):"";switch(Ee){case"PLAYLIST-TYPE":f.type=q.toUpperCase();break;case"MEDIA-SEQUENCE":R=f.startSN=parseInt(q);break;case"SKIP":{var pe=new w.AttrList(q),ee=pe.decimalInteger("SKIPPED-SEGMENTS");if(Object(W.isFiniteNumber)(ee)){f.skippedSegments=ee;for(var Ae=ee;Ae--;)b.unshift(null);R+=ee}var Ve=pe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ve&&(f.recentlyRemovedDateranges=Ve.split(" "));break}case"TARGETDURATION":f.targetduration=parseFloat(q);break;case"VERSION":f.version=parseInt(q);break;case"EXTM3U":break;case"ENDLIST":f.live=!1;break;case"#":(q||J)&&B.tagList.push(J?[q,J]:[q]);break;case"DIS":F++;case"GAP":B.tagList.push([Ee]);break;case"BITRATE":B.tagList.push([Ee,q]);break;case"DISCONTINUITY-SEQ":F=parseInt(q);break;case"KEY":{var Le,Ye=new w.AttrList(q),it=Ye.enumeratedString("METHOD"),vt=Ye.URI,ut=Ye.hexadecimalInteger("IV"),mt=Ye.enumeratedString("KEYFORMATVERSIONS"),lt=Ye.enumeratedString("KEYID"),Bt=(Le=Ye.enumeratedString("KEYFORMAT"))!=null?Le:"identity",Nt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Nt.indexOf(Bt)>-1){g.logger.warn("Keyformat "+Bt+" is not supported from the manifest");continue}else if(Bt!=="identity")continue;it&&(ae=D.LevelKey.fromURL(d,vt),vt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(it)>=0&&(ae.method=it,ae.keyFormat=Bt,lt&&(ae.keyID=lt),mt&&(ae.keyFormatVersions=mt),ae.iv=ut));break}case"START":{var Wt=new w.AttrList(q),Lt=Wt.decimalFloatingPoint("TIME-OFFSET");Object(W.isFiniteNumber)(Lt)&&(f.startTimeOffset=Lt);break}case"MAP":{var Gt=new w.AttrList(q);B.relurl=Gt.URI,Gt.BYTERANGE&&B.setByteRange(Gt.BYTERANGE),B.level=a,B.sn="initSegment",ae&&(B.levelkey=ae),B.initSegment=null,I=B,_e=!0;break}case"SERVER-CONTROL":{var Ut=new w.AttrList(q);f.canBlockReload=Ut.bool("CAN-BLOCK-RELOAD"),f.canSkipUntil=Ut.optionalFloat("CAN-SKIP-UNTIL",0),f.canSkipDateRanges=f.canSkipUntil>0&&Ut.bool("CAN-SKIP-DATERANGES"),f.partHoldBack=Ut.optionalFloat("PART-HOLD-BACK",0),f.holdBack=Ut.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Re=new w.AttrList(q);f.partTarget=Re.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=f.partList;je||(je=f.partList=[]);var tt=P>0?je[je.length-1]:void 0,dt=P++,ke=new j.Part(new w.AttrList(q),B,d,dt,tt);je.push(ke),B.duration+=ke.duration;break}case"PRELOAD-HINT":{var ot=new w.AttrList(q);f.preloadHint=ot;break}case"RENDITION-REPORT":{var ve=new w.AttrList(q);f.renditionReports=f.renditionReports||[],f.renditionReports.push(ve);break}default:g.logger.warn("line parsed but not handled: "+z);break}}}A&&!A.relurl?(b.pop(),M-=A.duration,f.partList&&(f.fragmentHint=A)):f.partList&&(y(B,A),B.cc=F,f.fragmentHint=B);var le=b.length,ue=b[0],$=b[le-1];if(M+=f.skippedSegments*f.targetduration,M>0&&le&&$){f.averagetargetduration=M/le;var Q=$.sn;f.endSN=Q!=="initSegment"?Q:0,ue&&(f.startCC=ue.cc,ue.initSegment||f.fragments.every(function(re){return re.relurl&&e(re.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),B=new j.Fragment(c,d),B.relurl=$.relurl,B.level=a,B.sn="initSegment",ue.initSegment=B,f.needSidxRanges=!0))}else f.endSN=0,f.startCC=0;return f.fragmentHint&&(M+=f.fragmentHint.duration),f.totalduration=M,f.endCC=F,De>0&&E(b,De),f},T}();function o(T,_){["video","audio","text"].forEach(function(l){var d=T.filter(function(c){return Object(m.isCodecType)(c,l)});if(d.length){var a=d.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});_[l+"Codec"]=a.length>0?a[0]:d[0],T=T.filter(function(c){return d.indexOf(c)===-1})}}),_.unknownCodecs=T}function S(T,_,l){var d=_[l];d&&(T[l]=d)}function E(T,_){for(var l=T[_],d=_;d--;){var a=T[d];if(!a)return;a.programDateTime=l.programDateTime-a.duration*1e3,l=a}}function y(T,_){T.rawProgramDateTime?T.programDateTime=Date.parse(T.rawProgramDateTime):_!=null&&_.programDateTime&&(T.programDateTime=_.endProgramDateTime),Object(W.isFiniteNumber)(T.programDateTime)||(T.programDateTime=null,T.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/polyfills/number.ts"),x=L("./src/events.ts"),O=L("./src/errors.ts"),j=L("./src/utils/logger.ts"),h=L("./src/utils/mp4-tools.ts"),D=L("./src/loader/m3u8-parser.ts"),w=L("./src/types/loader.ts"),g=L("./src/utils/attr-list.ts");function m(t){var n=t.type;switch(n){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function u(t,n){var s=t.url;return(s===void 0||s.indexOf("data:")===0)&&(s=n.url),s}var r=function(){function t(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var n=t.prototype;return n.registerListeners=function(){var e=this.hls;e.on(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(x.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(x.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(x.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.unregisterListeners=function(){var e=this.hls;e.off(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(x.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(x.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(x.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.createInternalLoader=function(e){var i=this.hls.config,o=i.pLoader,S=i.loader,E=o||S,y=new E(i);return e.loader=y,this.loaders[e.type]=y,y},n.getInternalLoader=function(e){return this.loaders[e.type]},n.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},n.destroyInternalLoaders=function(){for(var e in this.loaders){var i=this.loaders[e];i&&i.destroy(),this.resetInternalLoader(e)}},n.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},n.onManifestLoading=function(e,i){var o=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},n.onLevelLoading=function(e,i){var o=i.id,S=i.level,E=i.url,y=i.deliveryDirectives;this.load({id:o,groupId:null,level:S,responseType:"text",type:w.PlaylistContextType.LEVEL,url:E,deliveryDirectives:y})},n.onAudioTrackLoading=function(e,i){var o=i.id,S=i.groupId,E=i.url,y=i.deliveryDirectives;this.load({id:o,groupId:S,level:null,responseType:"text",type:w.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:y})},n.onSubtitleTrackLoading=function(e,i){var o=i.id,S=i.groupId,E=i.url,y=i.deliveryDirectives;this.load({id:o,groupId:S,level:null,responseType:"text",type:w.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:y})},n.load=function(e){var i,o=this.hls.config,S=this.getInternalLoader(e);if(S){var E=S.context;if(E&&E.url===e.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),S.abort()}var y,T,_,l;switch(e.type){case w.PlaylistContextType.MANIFEST:y=o.manifestLoadingMaxRetry,T=o.manifestLoadingTimeOut,_=o.manifestLoadingRetryDelay,l=o.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.PlaylistContextType.SUBTITLE_TRACK:y=0,T=o.levelLoadingTimeOut;break;default:y=o.levelLoadingMaxRetry,T=o.levelLoadingTimeOut,_=o.levelLoadingRetryDelay,l=o.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(e),(i=e.deliveryDirectives)!==null&&i!==void 0&&i.part){var d;if(e.type===w.PlaylistContextType.LEVEL&&e.level!==null?d=this.hls.levels[e.level].details:e.type===w.PlaylistContextType.AUDIO_TRACK&&e.id!==null?d=this.hls.audioTracks[e.id].details:e.type===w.PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(d=this.hls.subtitleTracks[e.id].details),d){var a=d.partTarget,c=d.targetduration;a&&c&&(T=Math.min(Math.max(a*3,c*.8)*1e3,T))}}var v={timeout:T,maxRetry:y,retryDelay:_,maxRetryDelay:l,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(e,v,f)},n.loadsuccess=function(e,i,o,S){if(S===void 0&&(S=null),o.isSidxRequest){this.handleSidxRequest(e,o),this.handlePlaylistLoaded(e,i,o,S);return}this.resetInternalLoader(o.type);var E=e.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(e,o,"no EXTM3U delimiter",S);return}i.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,i,o,S):this.handleMasterPlaylist(e,i,o,S)},n.loaderror=function(e,i,o){o===void 0&&(o=null),this.handleNetworkError(i,o,!1,e)},n.loadtimeout=function(e,i,o){o===void 0&&(o=null),this.handleNetworkError(i,o,!0)},n.handleMasterPlaylist=function(e,i,o,S){var E=this.hls,y=e.data,T=u(e,o),_=D.default.parseMasterPlaylist(y,T),l=_.levels,d=_.sessionData;if(!l.length){this.handleManifestParsingError(e,o,"no level found in manifest",S);return}var a=l.map(function(R){return{id:R.attrs.AUDIO,audioCodec:R.audioCodec}}),c=l.map(function(R){return{id:R.attrs.SUBTITLES,textCodec:R.textCodec}}),v=D.default.parseMasterPlaylistMedia(y,T,"AUDIO",a),f=D.default.parseMasterPlaylistMedia(y,T,"SUBTITLES",c),b=D.default.parseMasterPlaylistMedia(y,T,"CLOSED-CAPTIONS");if(v.length){var I=v.some(function(R){return!R.url});!I&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(j.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}E.trigger(x.Events.MANIFEST_LOADED,{levels:l,audioTracks:v,subtitles:f,captions:b,url:T,stats:i,networkDetails:S,sessionData:d})},n.handleTrackOrLevelPlaylist=function(e,i,o,S){var E=this.hls,y=o.id,T=o.level,_=o.type,l=u(e,o),d=Object(W.isFiniteNumber)(y)?y:0,a=Object(W.isFiniteNumber)(T)?T:d,c=m(o),v=D.default.parseLevelPlaylist(e.data,l,a,c,d);if(!v.fragments.length){E.trigger(x.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:l,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(_===w.PlaylistContextType.MANIFEST){var f={attrs:new g.AttrList({}),bitrate:0,details:v,name:"",url:l};E.trigger(x.Events.MANIFEST_LOADED,{levels:[f],audioTracks:[],url:l,stats:i,networkDetails:S,sessionData:null})}if(i.parsing.end=performance.now(),v.needSidxRanges){var b,I=(b=v.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:I,isSidxRequest:!0,type:_,level:T,levelDetails:v,id:y,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=v,this.handlePlaylistLoaded(e,i,o,S)},n.handleSidxRequest=function(e,i){var o=Object(h.parseSegmentIndex)(new Uint8Array(e.data));if(!o)return;var S=o.references,E=i.levelDetails;S.forEach(function(y,T){var _=y.info,l=E.fragments[T];l.byteRange.length===0&&l.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),l.initSegment&&l.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},n.handleManifestParsingError=function(e,i,o,S){this.hls.trigger(x.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===w.PlaylistContextType.MANIFEST,url:e.url,reason:o,response:e,context:i,networkDetails:S})},n.handleNetworkError=function(e,i,o,S){o===void 0&&(o=!1),j.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var E=O.ErrorDetails.UNKNOWN,y=!1,T=this.getInternalLoader(e);switch(e.type){case w.PlaylistContextType.MANIFEST:E=o?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,y=!0;break;case w.PlaylistContextType.LEVEL:E=o?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,y=!1;break;case w.PlaylistContextType.AUDIO_TRACK:E=o?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,y=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:E=o?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,y=!1;break}T&&this.resetInternalLoader(e.type);var _={type:O.ErrorTypes.NETWORK_ERROR,details:E,fatal:y,url:e.url,loader:T,context:e,networkDetails:i};S&&(_.response=S),this.hls.trigger(x.Events.ERROR,_)},n.handlePlaylistLoaded=function(e,i,o,S){var E=o.type,y=o.level,T=o.id,_=o.groupId,l=o.loader,d=o.levelDetails,a=o.deliveryDirectives;if(!(d!=null&&d.targetduration)){this.handleManifestParsingError(e,o,"invalid target duration",S);return}if(!l)return;d.live&&(l.getCacheAge&&(d.ageHeader=l.getCacheAge()||0),(!l.getCacheAge||isNaN(d.ageHeader))&&(d.ageHeader=0));switch(E){case w.PlaylistContextType.MANIFEST:case w.PlaylistContextType.LEVEL:this.hls.trigger(x.Events.LEVEL_LOADED,{details:d,level:y||0,id:T||0,stats:i,networkDetails:S,deliveryDirectives:a});break;case w.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(x.Events.AUDIO_TRACK_LOADED,{details:d,id:T||0,groupId:_||"",stats:i,networkDetails:S,deliveryDirectives:a});break;case w.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(x.Events.SUBTITLE_TRACK_LOADED,{details:d,id:T||0,groupId:_||"",stats:i,networkDetails:S,deliveryDirectives:a});break}},t}();H.default=r},"./src/polyfills/number.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"isFiniteNumber",function(){return W}),L.d(H,"MAX_SAFE_INTEGER",function(){return x});var W=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},x=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,H,L){"use strict";L.r(H);var W=function(){function x(){}return x.getSilentFrame=function(j,h){switch(j){case"mp4a.40.2":if(h===1)return new Uint8Array([0,200,0,128,35,128]);if(h===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(h===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(h===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(h===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(h===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(h===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(h===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(h===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},x}();H.default=W},"./src/remux/mp4-generator.ts":function(te,H,L){"use strict";L.r(H);var W=Math.pow(2,32)-1,x=function(){function O(){}return O.init=function(){O.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 h;for(h in O.types)O.types.hasOwnProperty(h)&&(O.types[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);var D=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]),w=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]);O.HDLR_TYPES={video:D,audio:w};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=m,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),r=new Uint8Array([97,118,99,49]),t=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,u,t,u,r),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,g))},O.box=function(h){for(var D=8,w=arguments.length,g=new Array(w>1?w-1:0),m=1;m<w;m++)g[m-1]=arguments[m];for(var u=g.length,r=u;u--;)D+=g[u].byteLength;var t=new Uint8Array(D);for(t[0]=D>>24&255,t[1]=D>>16&255,t[2]=D>>8&255,t[3]=D&255,t.set(h,4),u=0,D=8;u<r;u++)t.set(g[u],D),D+=g[u].byteLength;return t},O.hdlr=function(h){return O.box(O.types.hdlr,O.HDLR_TYPES[h])},O.mdat=function(h){return O.box(O.types.mdat,h)},O.mdhd=function(h,D){D*=h;var w=Math.floor(D/(W+1)),g=Math.floor(D%(W+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,h>>24&255,h>>16&255,h>>8&255,h&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},O.mdia=function(h){return O.box(O.types.mdia,O.mdhd(h.timescale,h.duration),O.hdlr(h.type),O.minf(h))},O.mfhd=function(h){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255]))},O.minf=function(h){return h.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(h)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(h))},O.moof=function(h,D,w){return O.box(O.types.moof,O.mfhd(h),O.traf(w,D))},O.moov=function(h){for(var D=h.length,w=[];D--;)w[D]=O.trak(h[D]);return O.box.apply(null,[O.types.moov,O.mvhd(h[0].timescale,h[0].duration)].concat(w).concat(O.mvex(h)))},O.mvex=function(h){for(var D=h.length,w=[];D--;)w[D]=O.trex(h[D]);return O.box.apply(null,[O.types.mvex].concat(w))},O.mvhd=function(h,D){D*=h;var w=Math.floor(D/(W+1)),g=Math.floor(D%(W+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,h>>24&255,h>>16&255,h>>8&255,h&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&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 O.box(O.types.mvhd,m)},O.sdtp=function(h){var D=h.samples||[],w=new Uint8Array(4+D.length),g,m;for(g=0;g<D.length;g++)m=D[g].flags,w[g+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return O.box(O.types.sdtp,w)},O.stbl=function(h){return O.box(O.types.stbl,O.stsd(h),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(h){var D=[],w=[],g,m,u;for(g=0;g<h.sps.length;g++)m=h.sps[g],u=m.byteLength,D.push(u>>>8&255),D.push(u&255),D=D.concat(Array.prototype.slice.call(m));for(g=0;g<h.pps.length;g++)m=h.pps[g],u=m.byteLength,w.push(u>>>8&255),w.push(u&255),w=w.concat(Array.prototype.slice.call(m));var r=O.box(O.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|h.sps.length].concat(D).concat([h.pps.length]).concat(w))),t=h.width,n=h.height,s=h.pixelRatio[0],e=h.pixelRatio[1];return O.box(O.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,t>>8&255,t&255,n>>8&255,n&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]),r,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,e>>24,e>>16&255,e>>8&255,e&255])))},O.esds=function(h){var D=h.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(h.config).concat([6,1,2]))},O.mp4a=function(h){var D=h.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),O.box(O.types.esds,O.esds(h)))},O.mp3=function(h){var D=h.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},O.stsd=function(h){return h.type==="audio"?!h.isAAC&&h.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(h)):O.box(O.types.stsd,O.STSD,O.mp4a(h)):O.box(O.types.stsd,O.STSD,O.avc1(h))},O.tkhd=function(h){var D=h.id,w=h.duration*h.timescale,g=h.width,m=h.height,u=Math.floor(w/(W+1)),r=Math.floor(w%(W+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,r>>24,r>>16&255,r>>8&255,r&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,g>>8&255,g&255,0,0,m>>8&255,m&255,0,0]))},O.traf=function(h,D){var w=O.sdtp(h),g=h.id,m=Math.floor(D/(W+1)),u=Math.floor(D%(W+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&255])),O.trun(h,w.length+16+20+8+16+8+8),w)},O.trak=function(h){return h.duration=h.duration||4294967295,O.box(O.types.trak,O.tkhd(h),O.mdia(h))},O.trex=function(h){var D=h.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(h,D){var w=h.samples||[],g=w.length,m=12+16*g,u=new Uint8Array(m),r,t,n,s,e,i;for(D+=8+m,u.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),r=0;r<g;r++)t=w[r],n=t.duration,s=t.size,e=t.flags,i=t.cts,u.set([n>>>24&255,n>>>16&255,n>>>8&255,n&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,e.isLeading<<2|e.dependsOn,e.isDependedOn<<6|e.hasRedundancy<<4|e.paddingValue<<1|e.isNonSync,e.degradPrio&240<<8,e.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*r);return O.box(O.types.trun,u)},O.initSegment=function(h){O.types||O.init();var D=O.moov(h),w=new Uint8Array(O.FTYP.byteLength+D.byteLength);return w.set(O.FTYP),w.set(D,O.FTYP.byteLength),w},O}();x.types=void 0,x.HDLR_TYPES=void 0,x.STTS=void 0,x.STSC=void 0,x.STCO=void 0,x.STSZ=void 0,x.VMHD=void 0,x.SMHD=void 0,x.STSD=void 0,x.FTYP=void 0,x.DINF=void 0,H.default=x},"./src/remux/mp4-remuxer.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return i}),L.d(H,"normalizePts",function(){return o});var W=L("./src/polyfills/number.ts"),x=L("./src/remux/aac-helper.ts"),O=L("./src/remux/mp4-generator.ts"),j=L("./src/events.ts"),h=L("./src/errors.ts"),D=L("./src/utils/logger.ts"),w=L("./src/types/loader.ts"),g=L("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(T){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(T[d]=l[d])}return T},m.apply(this,arguments)}var u=10*1e3,r=1024,t=1152,n=null,s=null,e=!1,i=function(){function T(l,d,a,c){if(c===void 0&&(c=""),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=l,this.config=d,this.typeSupported=a,this.ISGenerated=!1,n===null){var v=navigator.userAgent||"",f=v.match(/Chrome\/(\d+)/i);n=f?parseInt(f[1]):0}if(s===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);s=b?parseInt(b[1]):0}e=!!n&&n<75||!!s&&s<600}var _=T.prototype;return _.destroy=function(){},_.resetTimeStamp=function(d){D.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=d},_.resetNextTimestamp=function(){D.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){D.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(d){var a=!1,c=d.reduce(function(v,f){var b=f.pts-v;return b<-4294967296?(a=!0,o(v,f.pts)):b>0?v:f.pts},d[0].pts);return a&&D.logger.debug("PTS rollover detected"),c},_.remux=function(d,a,c,v,f,b,I,R){var P,M,F,A,B,z,Z=f,ae=f,De=d.pid>-1,_e=a.pid>-1,Oe=a.samples.length,Ne=d.samples.length>0,Ue=Oe>1,Ee=(!De||Ne)&&(!_e||Ue)||this.ISGenerated||I;if(Ee){this.ISGenerated||(F=this.generateIS(d,a,f));var q=this.isVideoContiguous,J=-1;if(Ue&&(J=S(a.samples),!q&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,J>0){D.logger.warn("[mp4-remuxer]: Dropped "+J+" out of "+Oe+" video samples due to a missing keyframe");var pe=this.getVideoStartPts(a.samples);a.samples=a.samples.slice(J),a.dropped+=J,ae+=(a.samples[0].pts-pe)/(a.timescale||9e4)}else J===-1&&(D.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),z=!1);if(this.ISGenerated){if(Ne&&Ue){var ee=this.getVideoStartPts(a.samples),Ae=o(d.samples[0].pts,ee)-ee,Ve=Ae/a.inputTimeScale;Z+=Math.max(0,Ve),ae+=Math.max(0,-Ve)}if(Ne){if(d.samplerate||(D.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(d,a,f)),M=this.remuxAudio(d,Z,this.isAudioContiguous,b,_e||Ue||R===w.PlaylistLevelType.AUDIO?ae:void 0),Ue){var Le=M?M.endPTS-M.startPTS:0;a.inputTimeScale||(D.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(d,a,f)),P=this.remuxVideo(a,ae,q,Le)}}else Ue&&(P=this.remuxVideo(a,ae,q,0));P&&(P.firstKeyFrame=J,P.independent=J!==-1)}}return this.ISGenerated&&(c.samples.length&&(B=this.remuxID3(c,f)),v.samples.length&&(A=this.remuxText(v,f))),{audio:M,video:P,initSegment:F,independent:z,text:A,id3:B}},_.generateIS=function(d,a,c){var v=d.samples,f=a.samples,b=this.typeSupported,I={},R=!Object(W.isFiniteNumber)(this._initPTS),P="audio/mp4",M,F,A;if(R&&(M=F=Infinity),d.config&&v.length&&(d.timescale=d.samplerate,d.isAAC||(b.mpeg?(P="audio/mpeg",d.codec=""):b.mp3&&(d.codec="mp3")),I.audio={id:"audio",container:P,codec:d.codec,initSegment:!d.isAAC&&b.mpeg?new Uint8Array(0):O.default.initSegment([d]),metadata:{channelCount:d.channelCount}},R&&(A=d.inputTimeScale,M=F=v[0].pts-Math.round(A*c))),a.sps&&a.pps&&f.length&&(a.timescale=a.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:a.codec,initSegment:O.default.initSegment([a]),metadata:{width:a.width,height:a.height}},R)){A=a.inputTimeScale;var B=this.getVideoStartPts(f),z=Math.round(A*c);F=Math.min(F,o(f[0].dts,B)-z),M=Math.min(M,B-z)}if(Object.keys(I).length)return this.ISGenerated=!0,R&&(this._initPTS=M,this._initDTS=F),{tracks:I,initPTS:M,timescale:A}},_.remuxVideo=function(d,a,c,v){var f=d.inputTimeScale,b=d.samples,I=[],R=b.length,P=this._initPTS,M=this.nextAvcDts,F=8,A,B,z,Z=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,De=0,_e=!1;if(!c||M===null){var Oe=a*f,Ne=b[0].pts-o(b[0].dts,b[0].pts);M=Oe-Ne}for(var Ue=0;Ue<R;Ue++){var Ee=b[Ue];if(Ee.pts=o(Ee.pts-P,M),Ee.dts=o(Ee.dts-P,M),Ee.dts>Ee.pts){var q=9e4*.2;De=Math.max(Math.min(De,Ee.pts-Ee.dts),-1*q)}Ee.dts<b[Ue>0?Ue-1:Ue].dts&&(_e=!0)}_e&&b.sort(function(St,Ze){var qe=St.dts-Ze.dts,Me=St.pts-Ze.pts;return qe||Me}),B=b[0].dts,z=b[b.length-1].dts;var J=Math.round((z-B)/(R-1));if(De<0){if(De<J*-2){D.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-J,!0)+" ms");for(var pe=De,ee=0;ee<R;ee++)b[ee].dts=pe=Math.max(pe,b[ee].pts-J),b[ee].pts=Math.max(pe,b[ee].pts)}else{D.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(De,!0)+" ms to overcome this issue");for(var Ae=0;Ae<R;Ae++)b[Ae].dts=b[Ae].dts+De}B=b[0].dts}if(c){var Ve=B-M,Le=Ve>J,Ye=Ve<-1;if(Le||Ye){Le?D.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Ve,!0)+" ms ("+Ve+"dts) hole between fragments detected, filling it"):D.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Ve,!0)+" ms ("+Ve+"dts) overlapping between fragments detected"),B=M;var it=b[0].pts-Ve;b[0].dts=B,b[0].pts=it,D.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(it,!0)+"/"+Object(g.toMsFromMpegTsClock)(B,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Ve,!0)+" ms")}}e&&(B=Math.max(0,B));for(var vt=0,ut=0,mt=0;mt<R;mt++){for(var lt=b[mt],Bt=lt.units,Nt=Bt.length,Wt=0,Lt=0;Lt<Nt;Lt++)Wt+=Bt[Lt].data.length;ut+=Wt,vt+=Nt,lt.length=Wt,lt.dts=Math.max(lt.dts,B),lt.pts=Math.max(lt.pts,lt.dts,0),Z=Math.min(lt.pts,Z),ae=Math.max(lt.pts,ae)}z=b[R-1].dts;var Gt=ut+4*vt+8,Ut;try{Ut=new Uint8Array(Gt)}catch(St){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Gt,reason:"fail allocating video mdat "+Gt});return}var Re=new DataView(Ut.buffer);Re.setUint32(0,Gt),Ut.set(O.default.types.mdat,4);for(var je=0;je<R;je++){for(var tt=b[je],dt=tt.units,ke=0,ot=0,ve=dt.length;ot<ve;ot++){var le=dt[ot],ue=le.data,$=le.data.byteLength;Re.setUint32(F,$),F+=4,Ut.set(ue,F),F+=$,ke+=4+$}if(je<R-1)A=b[je+1].dts-tt.dts;else{var Q=this.config,re=tt.dts-b[je>0?je-1:je].dts;if(Q.stretchShortVideoTrack&&this.nextAudioPts!==null){var fe=Math.floor(Q.maxBufferHole*f),Pe=(v?Z+v*f:this.nextAudioPts)-tt.pts;Pe>fe?(A=Pe-re,A<0&&(A=re),D.logger.log("[mp4-remuxer]: It is approximately "+Pe/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=re}else A=re}var Ge=Math.round(tt.pts-tt.dts);I.push(new E(tt.key,A,ke,Ge))}if(I.length&&n&&n<70){var bt=I[0].flags;bt.dependsOn=2,bt.isNonSync=0}console.assert(A!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=z+A,this.isVideoContiguous=!0;var Ft=O.default.moof(d.sequenceNumber++,B,m({},d,{samples:I})),Xt="video",Pt={data1:Ft,data2:Ut,startPTS:Z/f,endPTS:(ae+A)/f,startDTS:B/f,endDTS:M/f,type:Xt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:d.dropped};return d.samples=[],d.dropped=0,console.assert(Ut.length,"MDAT length must not be zero"),Pt},_.remuxAudio=function(d,a,c,v,f){var b=d.inputTimeScale,I=d.samplerate?d.samplerate:b,R=b/I,P=d.isAAC?r:t,M=P*R,F=this._initPTS,A=!d.isAAC&&this.typeSupported.mpeg,B=[],z=d.samples,Z=A?0:8,ae=this.nextAudioPts||-1,De=a*b;if(this.isAudioContiguous=c=c||z.length&&ae>0&&(v&&Math.abs(De-ae)<9e3||Math.abs(o(z[0].pts-F,De)-ae)<20*M),z.forEach(function(ue){ue.pts=o(ue.pts-F,De)}),!c||ae<0){if(z=z.filter(function(ue){return ue.pts>=0}),!z.length)return;f===0?ae=0:v?ae=Math.max(0,De):ae=z[0].pts}if(d.isAAC)for(var _e=f!==void 0,Oe=this.config.maxAudioFramesDrift,Ne=0,Ue=ae;Ne<z.length;Ne++){var Ee=z[Ne],q=Ee.pts,J=q-Ue,pe=Math.abs(1e3*J/b);if(J<=-Oe*M&&_e)Ne===0&&(D.logger.warn("Audio frame @ "+(q/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*J/b)+" ms."),this.nextAudioPts=ae=Ue=q);else if(J>=Oe*M&&pe<u&&_e){var ee=Math.round(J/M);Ue=q-ee*M,Ue<0&&(ee--,Ue+=M),Ne===0&&(this.nextAudioPts=ae=Ue),D.logger.warn("[mp4-remuxer]: Injecting "+ee+" audio frame @ "+(Ue/b).toFixed(3)+"s due to "+Math.round(1e3*J/b)+" ms gap.");for(var Ae=0;Ae<ee;Ae++){var Ve=Math.max(Ue,0),Le=x.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);Le||(D.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Le=Ee.unit.subarray()),z.splice(Ne,0,{unit:Le,pts:Ve}),Ue+=M,Ne++}}Ee.pts=Ue,Ue+=M}for(var Ye=null,it=null,vt,ut=0,mt=z.length;mt--;)ut+=z[mt].unit.byteLength;for(var lt=0,Bt=z.length;lt<Bt;lt++){var Nt=z[lt],Wt=Nt.unit,Lt=Nt.pts;if(it!==null){var Gt=B[lt-1];Gt.duration=Math.round((Lt-it)/R)}else if(c&&d.isAAC&&(Lt=ae),Ye=Lt,ut>0){ut+=Z;try{vt=new Uint8Array(ut)}catch(ue){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ut,reason:"fail allocating audio mdat "+ut});return}if(!A){var Ut=new DataView(vt.buffer);Ut.setUint32(0,ut),vt.set(O.default.types.mdat,4)}}else return;vt.set(Wt,Z);var Re=Wt.byteLength;Z+=Re,B.push(new E(!0,P,Re,0)),it=Lt}var je=B.length;if(!je)return;var tt=B[B.length-1];this.nextAudioPts=ae=it+R*tt.duration;var dt=A?new Uint8Array(0):O.default.moof(d.sequenceNumber++,Ye/R,m({},d,{samples:B}));d.samples=[];var ke=Ye/b,ot=ae/b,ve="audio",le={data1:dt,data2:vt,startPTS:ke,endPTS:ot,startDTS:ke,endDTS:ot,type:ve,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert(vt.length,"MDAT length must not be zero"),le},_.remuxEmptyAudio=function(d,a,c,v){var f=d.inputTimeScale,b=d.samplerate?d.samplerate:f,I=f/b,R=this.nextAudioPts,P=(R!==null?R:v.startDTS*f)+this._initDTS,M=v.endDTS*f+this._initDTS,F=I*r,A=Math.ceil((M-P)/F),B=x.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);if(D.logger.warn("[mp4-remuxer]: remux empty Audio"),!B){D.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var z=[],Z=0;Z<A;Z++){var ae=P+Z*F;z.push({unit:B,pts:ae,dts:ae})}return d.samples=z,this.remuxAudio(d,a,c,!1)},_.remuxID3=function(d,a){var c=d.samples.length;if(!c)return;for(var v=d.inputTimeScale,f=this._initPTS,b=this._initDTS,I=0;I<c;I++){var R=d.samples[I];R.pts=o(R.pts-f,a*v)/v,R.dts=o(R.dts-b,a*v)/v}var P=d.samples;return d.samples=[],{samples:P}},_.remuxText=function(d,a){var c=d.samples.length;if(!c)return;for(var v=d.inputTimeScale,f=this._initPTS,b=0;b<c;b++){var I=d.samples[b];I.pts=o(I.pts-f,a*v)/v}d.samples.sort(function(P,M){return P.pts-M.pts});var R=d.samples;return d.samples=[],{samples:R}},T}();function o(T,_){var l;if(_===null)return T;for(_<T?l=-8589934592:l=8589934592;Math.abs(T-_)>4294967296;)T+=l;return T}function S(T){for(var _=0;_<T.length;_++)if(T[_].key)return _;return-1}var E=function(_,l,d,a){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=l,this.size=d,this.cts=a,this.flags=new y(_)},y=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/polyfills/number.ts"),x=L("./src/utils/mp4-tools.ts"),O=L("./src/loader/fragment.ts"),j=L("./src/utils/logger.ts"),h=function(){function g(){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 m=g.prototype;return m.destroy=function(){},m.resetTimeStamp=function(r){this.initPTS=r,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(r,t,n){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(r),this.emitInitSegment=!0},m.generateInitSegment=function(r){var t=this.audioCodec,n=this.videoCodec;if(!r||!r.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(x.parseInitSegment)(r);t||(t=w(s.audio,O.ElementaryStreamTypes.AUDIO)),n||(n=w(s.video,O.ElementaryStreamTypes.VIDEO));var e={};s.audio&&s.video?e.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:r,id:"main"}:s.audio?e.audio={container:"audio/mp4",codec:t,initSegment:r,id:"audio"}:s.video?e.video={container:"video/mp4",codec:n,initSegment:r,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=e},m.remux=function(r,t,n,s,e){var i=this.initPTS,o=this.lastEndDTS,S={audio:void 0,video:void 0,text:s,id3:n,initSegment:void 0};Object(W.isFiniteNumber)(o)||(o=this.lastEndDTS=e||0);var E=t.samples;if(!E||!E.length)return S;var y={initPTS:void 0,timescale:1},T=this.initData;if((!T||!T.length)&&(this.generateInitSegment(E),T=this.initData),!T||!T.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(y.tracks=this.initTracks,this.emitInitSegment=!1),Object(W.isFiniteNumber)(i)||(this.initPTS=y.initPTS=i=D(T,E,o));var _=Object(x.getDuration)(E,T),l=o,d=_+l;Object(x.offsetStartDTS)(T,E,i),_>0?this.lastEndDTS=d:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var a=!!T.audio,c=!!T.video,v="";a&&(v+="audio"),c&&(v+="video");var f={data1:E,startPTS:l,startDTS:l,endPTS:d,endDTS:d,type:v,hasAudio:a,hasVideo:c,nb:1,dropped:0};return S.audio=f.type==="audio"?f:void 0,S.video=f.type!=="audio"?f:void 0,S.text=s,S.id3=n,S.initSegment=y,S},g}(),D=function(m,u,r){return Object(x.getStartDTS)(m,u)-r};function w(g,m){var u=g==null?void 0:g.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||m===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=h},"./src/task-loop.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return W});var W=function(){function x(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=x.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(h){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,h),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},x}()},"./src/types/cmcd.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"CMCDVersion",function(){return W}),L.d(H,"CMCDObjectType",function(){return x}),L.d(H,"CMCDStreamingFormat",function(){return O}),L.d(H,"CMCDStreamType",function(){return j});var W=1,x;(function(h){h.MANIFEST="m",h.AUDIO="a",h.VIDEO="v",h.MUXED="av",h.INIT="i",h.CAPTION="c",h.TIMED_TEXT="tt",h.KEY="k",h.OTHER="o"})(x||(x={}));var O;(function(h){h.DASH="d",h.HLS="h",h.SMOOTH="s",h.OTHER="o"})(O||(O={}));var j;(function(h){h.VOD="v",h.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"HlsSkip",function(){return O}),L.d(H,"getSkipValue",function(){return j}),L.d(H,"HlsUrlParameters",function(){return h}),L.d(H,"Level",function(){return D});function W(w,g){for(var m=0;m<g.length;m++){var u=g[m];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function x(w,g,m){return g&&W(w.prototype,g),m&&W(w,m),w}var O;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(O||(O={}));function j(w,g){var m=w.canSkipUntil,u=w.canSkipDateRanges,r=w.endSN,t=g!==void 0?g-r:0;return m&&t<m?u?O.v2:O.Yes:O.No}var h=function(){function w(m,u,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=u,this.skip=r}var g=w.prototype;return g.addDirectives=function(u){var r=new self.URL(u);return this.msn!==void 0&&r.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&r.searchParams.set("_HLS_part",this.part.toString()),this.skip&&r.searchParams.set("_HLS_skip",this.skip),r.toString()},w}(),D=function(){function w(g){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=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return x(w,[{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(m){var u=m%this.url.length;this._urlId!==u&&(this.details=void 0,this._urlId=u)}}]),w}()},"./src/types/loader.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"PlaylistContextType",function(){return W}),L.d(H,"PlaylistLevelType",function(){return x});var W;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(W||(W={}));var x;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(x||(x={}))},"./src/types/transmuxer.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"ChunkMetadata",function(){return W});var W=function(j,h,D,w,g,m){w===void 0&&(w=0),g===void 0&&(g=-1),m===void 0&&(m=!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=x(),this.buffering={audio:x(),video:x(),audiovideo:x()},this.level=j,this.sn=h,this.id=D,this.size=w,this.part=g,this.partial=m};function x(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"AttrList",function(){return O});var W=/^(\d+)x(\d+)$/,x=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function j(D){typeof D=="string"&&(D=j.parseAttrList(D));for(var w in D)D.hasOwnProperty(w)&&(this[w]=D[w])}var h=j.prototype;return h.decimalInteger=function(w){var g=parseInt(this[w],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},h.hexadecimalInteger=function(w){if(this[w]){var g=(this[w]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var m=new Uint8Array(g.length/2),u=0;u<g.length/2;u++)m[u]=parseInt(g.slice(u*2,u*2+2),16);return m}else return null},h.hexadecimalIntegerAsNumber=function(w){var g=parseInt(this[w],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},h.decimalFloatingPoint=function(w){return parseFloat(this[w])},h.optionalFloat=function(w,g){var m=this[w];return m?parseFloat(m):g},h.enumeratedString=function(w){return this[w]},h.bool=function(w){return this[w]==="YES"},h.decimalResolution=function(w){var g=W.exec(this[w]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},j.parseAttrList=function(w){var g,m={},u='"';for(x.lastIndex=0;(g=x.exec(w))!==null;){var r=g[2];r.indexOf(u)===0&&r.lastIndexOf(u)===r.length-1&&(r=r.slice(1,-1)),m[g[1]]=r}return m},j}()},"./src/utils/binary-search.ts":function(te,H,L){"use strict";L.r(H);var W={search:function(O,j){for(var h=0,D=O.length-1,w=null,g=null;h<=D;){w=(h+D)/2|0,g=O[w];var m=j(g);if(m>0)h=w+1;else if(m<0)D=w-1;else return g}return null}};H.default=W},"./src/utils/buffer-helper.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"BufferHelper",function(){return O});var W=L("./src/utils/logger.ts"),x={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function j(){}return j.isBuffered=function(D,w){try{if(D){for(var g=j.getBuffered(D),m=0;m<g.length;m++)if(w>=g.start(m)&&w<=g.end(m))return!0}}catch(u){}return!1},j.bufferInfo=function(D,w,g){try{if(D){var m=j.getBuffered(D),u=[],r;for(r=0;r<m.length;r++)u.push({start:m.start(r),end:m.end(r)});return this.bufferedInfo(u,w,g)}}catch(t){}return{len:0,start:w,end:w,nextStart:void 0}},j.bufferedInfo=function(D,w,g){w=Math.max(0,w),D.sort(function(y,T){var _=y.start-T.start;return _||T.end-y.end});var m=[];if(g)for(var u=0;u<D.length;u++){var r=m.length;if(r){var t=m[r-1].end;D[u].start-t<g?D[u].end>t&&(m[r-1].end=D[u].end):m.push(D[u])}else m.push(D[u])}else m=D;for(var n=0,s,e=w,i=w,o=0;o<m.length;o++){var S=m[o].start,E=m[o].end;if(w+g>=S&&w<E)e=S,i=E,n=i-w;else if(w+g<S){s=S;break}}return{len:n,start:e||0,end:i||0,nextStart:s}},j.getBuffered=function(D){try{return D.buffered}catch(w){return W.logger.log("failed to get media.buffered",w),x}},j}()},"./src/utils/cea-608-parser.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"Row",function(){return i}),L.d(H,"CaptionScreen",function(){return o});var W=L("./src/utils/logger.ts"),x={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},O=function(d){var a=d;return x.hasOwnProperty(d)&&(a=x[d]),String.fromCharCode(a)},j=15,h=100,D={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],r;(function(l){l[l.ERROR=0]="ERROR",l[l.TEXT=1]="TEXT",l[l.WARNING=2]="WARNING",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l[l.DATA=3]="DATA"})(r||(r={}));var t=function(){function l(){this.time=null,this.verboseLevel=r.ERROR}var d=l.prototype;return d.log=function(c,v){this.verboseLevel>=c&&W.logger.log(this.time+" ["+c+"] "+v)},l}(),n=function(d){for(var a=[],c=0;c<d.length;c++)a.push(d[c].toString(16));return a},s=function(){function l(a,c,v,f,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=a||"white",this.underline=c||!1,this.italics=v||!1,this.background=f||"black",this.flash=b||!1}var d=l.prototype;return d.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},d.setStyles=function(c){for(var v=["foreground","underline","italics","background","flash"],f=0;f<v.length;f++){var b=v[f];c.hasOwnProperty(b)&&(this[b]=c[b])}},d.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},d.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},d.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},d.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},l}(),e=function(){function l(a,c,v,f,b,I){this.uchar=void 0,this.penState=void 0,this.uchar=a||" ",this.penState=new s(c,v,f,b,I)}var d=l.prototype;return d.reset=function(){this.uchar=" ",this.penState.reset()},d.setChar=function(c,v){this.uchar=c,this.penState.copy(v)},d.setPenState=function(c){this.penState.copy(c)},d.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},d.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},d.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},l}(),i=function(){function l(a){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<h;c++)this.chars.push(new e);this.logger=a,this.pos=0,this.currPenState=new s}var d=l.prototype;return d.equals=function(c){for(var v=!0,f=0;f<h;f++)if(!this.chars[f].equals(c.chars[f])){v=!1;break}return v},d.copy=function(c){for(var v=0;v<h;v++)this.chars[v].copy(c.chars[v])},d.isEmpty=function(){for(var c=!0,v=0;v<h;v++)if(!this.chars[v].isEmpty()){c=!1;break}return c},d.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(r.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>h&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=h)},d.moveCursor=function(c){var v=this.pos+c;if(c>1)for(var f=this.pos+1;f<v+1;f++)this.chars[f].setPenState(this.currPenState);this.setCursor(v)},d.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},d.insertChar=function(c){c>=144&&this.backSpace();var v=O(c);if(this.pos>=h){this.logger.log(r.ERROR,"Cannot insert "+c.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},d.clearFromPos=function(c){var v;for(v=c;v<h;v++)this.chars[v].reset()},d.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},d.clearToEndOfRow=function(){this.clearFromPos(this.pos)},d.getTextString=function(){for(var c=[],v=!0,f=0;f<h;f++){var b=this.chars[f].uchar;b!==" "&&(v=!1),c.push(b)}return v?"":c.join("")},d.setPenStyles=function(c){this.currPenState.setStyles(c);var v=this.chars[this.pos];v.setPenState(this.currPenState)},l}(),o=function(){function l(a){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<j;c++)this.rows.push(new i(a));this.logger=a,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var d=l.prototype;return d.reset=function(){for(var c=0;c<j;c++)this.rows[c].clear();this.currRow=j-1},d.equals=function(c){for(var v=!0,f=0;f<j;f++)if(!this.rows[f].equals(c.rows[f])){v=!1;break}return v},d.copy=function(c){for(var v=0;v<j;v++)this.rows[v].copy(c.rows[v])},d.isEmpty=function(){for(var c=!0,v=0;v<j;v++)if(!this.rows[v].isEmpty()){c=!1;break}return c},d.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},d.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},d.insertChar=function(c){var v=this.rows[this.currRow];v.insertChar(c)},d.setPen=function(c){var v=this.rows[this.currRow];v.setPenStyles(c)},d.moveCursor=function(c){var v=this.rows[this.currRow];v.moveCursor(c)},d.setCursor=function(c){this.logger.log(r.INFO,"setCursor: "+c);var v=this.rows[this.currRow];v.setCursor(c)},d.setPAC=function(c){this.logger.log(r.INFO,"pacData = "+JSON.stringify(c));var v=c.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var f=0;f<j;f++)this.rows[f].clear();var b=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var R=I.rows[b].cueStartTime,P=this.logger.time;if(R&&P!==null&&R<P)for(var M=0;M<this.nrRollUpRows;M++)this.rows[v-this.nrRollUpRows+M+1].copy(I.rows[b+M])}}this.currRow=v;var F=this.rows[this.currRow];if(c.indent!==null){var A=c.indent,B=Math.max(A-1,0);F.setCursor(c.indent),c.color=F.chars[B].penState.foreground}var z={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(z)},d.setBkgData=function(c){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},d.setRollUpRows=function(c){this.nrRollUpRows=c},d.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(r.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(c,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(r.INFO,"Rolling up")},d.getDisplayText=function(c){c=c||!1;for(var v=[],f="",b=-1,I=0;I<j;I++){var R=this.rows[I].getTextString();R&&(b=I+1,c?v.push("Row "+b+": '"+R+"'"):v.push(R.trim()))}return v.length>0&&(c?f="["+v.join(" | ")+"]":f=v.join(`
|
|
`)),f},d.getTextAndFormat=function(){return this.rows},l}(),S=function(){function l(a,c,v){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=a,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new o(v),this.nonDisplayedMemory=new o(v),this.lastOutputScreen=new o(v),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var d=l.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(c){this.outputFilter=c},d.setPAC=function(c){this.writeScreen.setPAC(c)},d.setBkgData=function(c){this.writeScreen.setBkgData(c)},d.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(r.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},d.insertChars=function(c){for(var v=0;v<c.length;v++)this.writeScreen.insertChar(c[v]);var f=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(r.INFO,f+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(r.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},d.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},d.ccBS=function(){if(this.logger.log(r.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},d.ccAOF=function(){},d.ccAON=function(){},d.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},d.ccRU=function(c){this.logger.log(r.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},d.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},d.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},d.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},d.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},d.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},d.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},d.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},d.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},d.ccTO=function(c){this.logger.log(r.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},d.ccMIDROW=function(c){var v={flash:!1};if(v.underline=c%2===1,v.italics=c>=46,v.italics)v.foreground="white";else{var f=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=b[f]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},d.outputDataUpdate=function(c){c===void 0&&(c=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},d.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},l}(),E=function(){function l(a,c,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var f=new t;this.channels=[null,new S(a,c,f),new S(a+1,v,f)],this.cmdHistory=_(),this.logger=f}var d=l.prototype;return d.getHandler=function(c){return this.channels[c].getHandler()},d.setHandler=function(c,v){this.channels[c].setHandler(v)},d.addData=function(c,v){var f,b,I,R=!1;this.logger.time=c;for(var P=0;P<v.length;P+=2){if(b=v[P]&127,I=v[P+1]&127,b===0&&I===0)continue;if(this.logger.log(r.DATA,"["+n([v[P],v[P+1]])+"] -> ("+n([b,I])+")"),f=this.parseCmd(b,I),f||(f=this.parseMidrow(b,I)),f||(f=this.parsePAC(b,I)),f||(f=this.parseBackgroundAttributes(b,I)),!f&&(R=this.parseChars(b,I),R)){var M=this.currentChannel;if(M&&M>0){var F=this.channels[M];F.insertChars(R)}else this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}!f&&!R&&this.logger.log(r.WARNING,"Couldn't parse cleaned data "+n([b,I])+" orig: "+n([v[P],v[P+1]]))}},d.parseCmd=function(c,v){var f=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&v>=32&&v<=47,I=(c===23||c===31)&&v>=33&&v<=35;if(!(b||I))return!1;if(T(c,v,f))return y(null,null,f),this.logger.log(r.DEBUG,"Repeated command ("+n([c,v])+") is dropped"),!0;var R=c===20||c===21||c===23?1:2,P=this.channels[R];return c===20||c===21||c===28||c===29?v===32?P.ccRCL():v===33?P.ccBS():v===34?P.ccAOF():v===35?P.ccAON():v===36?P.ccDER():v===37?P.ccRU(2):v===38?P.ccRU(3):v===39?P.ccRU(4):v===40?P.ccFON():v===41?P.ccRDC():v===42?P.ccTR():v===43?P.ccRTD():v===44?P.ccEDM():v===45?P.ccCR():v===46?P.ccENM():v===47&&P.ccEOC():P.ccTO(v-32),y(c,v,f),this.currentChannel=R,!0},d.parseMidrow=function(c,v){var f=0;if((c===17||c===25)&&v>=32&&v<=47){if(c===17?f=1:f=2,f!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[f];return b?(b.ccMIDROW(v),this.logger.log(r.DEBUG,"MIDROW ("+n([c,v])+")"),!0):!1}return!1},d.parsePAC=function(c,v){var f,b=this.cmdHistory,I=(c>=17&&c<=23||c>=25&&c<=31)&&v>=64&&v<=127,R=(c===16||c===24)&&v>=64&&v<=95;if(!(I||R))return!1;if(T(c,v,b))return y(null,null,b),!0;var P=c<=23?1:2;v>=64&&v<=95?f=P===1?D[c]:g[c]:f=P===1?w[c]:m[c];var M=this.channels[P];return M?(M.setPAC(this.interpretPAC(f,v)),y(c,v,b),this.currentChannel=P,!0):!1},d.interpretPAC=function(c,v){var f,b={color:null,italics:!1,indent:null,underline:!1,row:c};return v>95?f=v-96:f=v-64,b.underline=(f&1)===1,f<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(f/2)]:f<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((f-16)/2)*4,b},d.parseChars=function(c,v){var f,b=null,I=null;if(c>=25?(f=2,I=c-8):(f=1,I=c),I>=17&&I<=19){var R;I===17?R=v+80:I===18?R=v+112:R=v+144,this.logger.log(r.INFO,"Special char '"+O(R)+"' in channel "+f),b=[R]}else c>=32&&c<=127&&(b=v===0?[c]:[c,v]);if(b){var P=n(b);this.logger.log(r.DEBUG,"Char codes = "+P.join(",")),y(c,v,this.cmdHistory)}return b},d.parseBackgroundAttributes=function(c,v){var f=(c===16||c===24)&&v>=32&&v<=47,b=(c===23||c===31)&&v>=45&&v<=47;if(!(f||b))return!1;var I,R={};c===16||c===24?(I=Math.floor((v-32)/2),R.background=u[I],v%2===1&&(R.background=R.background+"_semi")):v===45?R.background="transparent":(R.foreground="black",v===47&&(R.underline=!0));var P=c<=23?1:2,M=this.channels[P];return M.setBkgData(R),y(c,v,this.cmdHistory),!0},d.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var v=this.channels[c];v&&v.reset()}this.cmdHistory=_()},d.cueSplitAtTime=function(c){for(var v=0;v<this.channels.length;v++){var f=this.channels[v];f&&f.cueSplitAtTime(c)}},l}();function y(l,d,a){a.a=l,a.b=d}function T(l,d,a){return a.a===l&&a.b===d}function _(){return{a:null,b:null}}H.default=E},"./src/utils/codecs.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"isCodecType",function(){return x}),L.d(H,"isCodecSupportedInMp4",function(){return O});var W={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 x(j,h){var D=W[h];return!!D&&D[j.slice(0,4)]===!0}function O(j,h){return MediaSource.isTypeSupported((h||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/utils/vttparser.ts"),x=L("./src/utils/webvtt-parser.ts"),O=L("./src/utils/texttrack-utils.ts"),j=/\s/,h={newCue:function(w,g,m,u){for(var r=[],t,n,s,e,i,o=self.VTTCue||self.TextTrackCue,S=0;S<u.rows.length;S++)if(t=u.rows[S],s=!0,e=0,i="",!t.isEmpty()){for(var E=0;E<t.chars.length;E++)j.test(t.chars[E].uchar)&&s?e++:(i+=t.chars[E].uchar,s=!1);t.cueStartTime=g,g===m&&(m+=1e-4),e>=16?e--:e++;var y=Object(W.fixLineBreaks)(i.trim()),T=Object(x.generateCueId)(g,m,y);(!w||!w.cues||!w.cues.getCueById(T))&&(n=new o(g,m,y),n.id=T,n.line=S+1,n.align="left",n.position=10+Math.min(80,Math.floor(e*8/32)*10),r.push(n))}return w&&r.length&&(r.sort(function(_,l){return _.line==="auto"||l.line==="auto"?0:_.line>8&&l.line>8?l.line-_.line:_.line-l.line}),r.forEach(function(_){return Object(O.addCueToTrack)(w,_)})),r}};H.default=h},"./src/utils/discontinuities.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"findFirstFragWithCC",function(){return j}),L.d(H,"shouldAlignOnDiscontinuities",function(){return h}),L.d(H,"findDiscontinuousReferenceFrag",function(){return D}),L.d(H,"adjustSlidingStart",function(){return g}),L.d(H,"alignStream",function(){return m}),L.d(H,"alignPDT",function(){return r}),L.d(H,"alignFragmentByPDTDelta",function(){return t}),L.d(H,"alignMediaPlaylistByPDT",function(){return n});var W=L("./src/polyfills/number.ts"),x=L("./src/utils/logger.ts"),O=L("./src/controller/level-helper.ts");function j(s,e){for(var i=null,o=0,S=s.length;o<S;o++){var E=s[o];if(E&&E.cc===e){i=E;break}}return i}function h(s,e,i){return!!(e.details&&(i.endCC>i.startCC||s&&s.cc<i.startCC))}function D(s,e){var i=s.fragments,o=e.fragments;if(!o.length||!i.length){x.logger.log("No fragments to align");return}var S=j(i,o[0].cc);if(!S||S&&!S.startPTS){x.logger.log("No frag in previous level to align on");return}return S}function w(s,e){if(s){var i=s.start+e;s.start=s.startPTS=i,s.endPTS=i+s.duration}}function g(s,e){for(var i=e.fragments,o=0,S=i.length;o<S;o++)w(i[o],s);e.fragmentHint&&w(e.fragmentHint,s),e.alignedSliding=!0}function m(s,e,i){if(!e)return;u(s,i,e),!i.alignedSliding&&e.details&&r(i,e.details),!i.alignedSliding&&e.details&&!i.skippedSegments&&Object(O.adjustSliding)(e.details,i)}function u(s,e,i){if(h(s,i,e)){var o=D(i.details,e);o&&Object(W.isFiniteNumber)(o.start)&&(x.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),g(o.start,e))}}function r(s,e){if(!e.fragments.length||!s.hasProgramDateTime||!e.hasProgramDateTime)return;var i=e.fragments[0].programDateTime,o=s.fragments[0].programDateTime,S=(o-i)/1e3+e.fragments[0].start;S&&Object(W.isFiniteNumber)(S)&&(x.logger.log("Adjusting PTS using programDateTime delta "+(o-i)+"ms, sliding:"+S.toFixed(3)+" "+s.url+" "),g(S,s))}function t(s,e){var i=s.programDateTime;if(!i)return;var o=(i-e)/1e3;s.start=s.startPTS=o,s.endPTS=o+s.duration}function n(s,e){if(!e.fragments.length||!s.hasProgramDateTime||!e.hasProgramDateTime)return;var i=e.fragments[0].programDateTime,o=e.fragments[0].start,S=i-o*1e3;s.fragments.forEach(function(E){t(E,S)}),s.fragmentHint&&t(s.fragmentHint,S),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/utils/ewma.ts"),x=function(){function O(h,D,w){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=w,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new W.default(h),this.fast_=new W.default(D)}var j=O.prototype;return j.update=function(D,w){var g=this.slow_,m=this.fast_;this.slow_.halfLife!==D&&(this.slow_=new W.default(D,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==w&&(this.fast_=new W.default(w,m.getEstimate(),m.getTotalWeight()))},j.sample=function(D,w){D=Math.max(D,this.minDelayMs_);var g=8*w,m=D/1e3,u=g/m;this.fast_.sample(m,u),this.slow_.sample(m,u)},j.canEstimate=function(){var D=this.fast_;return D&&D.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},O}();H.default=x},"./src/utils/ewma.ts":function(te,H,L){"use strict";L.r(H);var W=function(){function x(j,h,D){h===void 0&&(h=0),D===void 0&&(D=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=h,this.totalWeight_=D}var O=x.prototype;return O.sample=function(h,D){var w=Math.pow(this.alpha_,h);this.estimate_=D*(1-w)+w*this.estimate_,this.totalWeight_+=h},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var h=1-Math.pow(this.alpha_,this.totalWeight_);if(h)return this.estimate_/h}return this.estimate_},x}();H.default=W},"./src/utils/fetch-loader.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"fetchSupported",function(){return t});var W=L("./src/polyfills/number.ts"),x=L("./src/loader/load-stats.ts"),O=L("./src/demux/chunk-cache.ts");function j(o,S){o.prototype=Object.create(S.prototype),o.prototype.constructor=o,m(o,S)}function h(o){var S=typeof Map=="function"?new Map:void 0;return h=function(y){if(y===null||!g(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(y))return S.get(y);S.set(y,T)}function T(){return D(y,arguments,u(this).constructor)}return T.prototype=Object.create(y.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),m(T,y)},h(o)}function D(o,S,E){return w()?D=Reflect.construct:D=function(T,_,l){var d=[null];d.push.apply(d,_);var a=Function.bind.apply(T,d),c=new a;return l&&m(c,l.prototype),c},D.apply(null,arguments)}function w(){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(o){return!1}}function g(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function m(o,S){return m=Object.setPrototypeOf||function(y,T){return y.__proto__=T,y},m(o,S)}function u(o){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},u(o)}function r(){return r=Object.assign||function(o){for(var S=1;S<arguments.length;S++){var E=arguments[S];for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&(o[y]=E[y])}return o},r.apply(this,arguments)}function t(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var n=function(){function o(E){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=E.fetchSetup||e,this.controller=new self.AbortController,this.stats=new x.LoadStats}var S=o.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var y=this.response;(!y||!y.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(y,T,_){var l=this,d=this.stats;if(d.loading.start)throw new Error("Loader can only be used once.");d.loading.start=self.performance.now();var a=s(y,this.controller.signal),c=_.onProgress,v=y.responseType==="arraybuffer",f=v?"byteLength":"length";this.context=y,this.config=T,this.callbacks=_,this.request=this.fetchSetup(y,a),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){l.abortInternal(),_.onTimeout(d,y,l.response)},T.timeout),self.fetch(this.request).then(function(b){if(l.response=l.loader=b,!b.ok){var I=b.status,R=b.statusText;throw new i(R||"fetch, bad network response",I,b)}return d.loading.first=Math.max(self.performance.now(),d.loading.start),d.total=parseInt(b.headers.get("Content-Length")||"0"),c&&Object(W.isFiniteNumber)(T.highWaterMark)?l.loadProgressively(b,d,y,T.highWaterMark,c):v?b.arrayBuffer():b.text()}).then(function(b){var I=l.response;self.clearTimeout(l.requestTimeout),d.loading.end=Math.max(self.performance.now(),d.loading.first),d.loaded=d.total=b[f];var R={url:I.url,data:b};c&&!Object(W.isFiniteNumber)(T.highWaterMark)&&c(d,y,b,I),_.onSuccess(R,d,y,I)}).catch(function(b){if(self.clearTimeout(l.requestTimeout),d.aborted)return;var I=b.code||0;_.onError({code:I,text:b.message},y,b.details)})},S.getCacheAge=function(){var y=null;if(this.response){var T=this.response.headers.get("age");y=T?parseFloat(T):null}return y},S.loadProgressively=function(y,T,_,l,d){l===void 0&&(l=0);var a=new O.default,c=y.body.getReader(),v=function f(){return c.read().then(function(b){if(b.done)return a.dataLength&&d(T,_,a.flush(),y),Promise.resolve(new ArrayBuffer(0));var I=b.value,R=I.length;return T.loaded+=R,R<l||a.dataLength?(a.push(I),a.dataLength>=l&&d(T,_,a.flush(),y)):d(T,_,I,y),f()}).catch(function(){return Promise.reject()})};return v()},o}();function s(o,S){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(r({},o.headers))};return o.rangeEnd&&E.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),E}function e(o,S){return new self.Request(o.url,S)}var i=function(o){j(S,o);function S(E,y,T){var _;return _=o.call(this,E)||this,_.code=void 0,_.details=void 0,_.code=y,_.details=T,_}return S}(h(Error));H.default=n},"./src/utils/imsc1-ttml-parser.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"IMSC1_CODEC",function(){return g}),L.d(H,"parseIMSC1",function(){return t});var W=L("./src/utils/mp4-tools.ts"),x=L("./src/utils/vttparser.ts"),O=L("./src/utils/vttcue.ts"),j=L("./src/demux/id3.ts"),h=L("./src/utils/timescale-conversion.ts"),D=L("./src/utils/webvtt-parser.ts");function w(){return w=Object.assign||function(l){for(var d=1;d<arguments.length;d++){var a=arguments[d];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(l[c]=a[c])}return l},w.apply(this,arguments)}var g="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,u=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,r={left:"start",center:"center",right:"end",start:"start",end:"end"};function t(l,d,a,c,v){var f=Object(W.findBox)(new Uint8Array(l),["mdat"]);if(f.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var b=f[0],I=Object(j.utf8ArrayToStr)(new Uint8Array(l,b.start,b.end-b.start)),R=Object(h.toTimescaleFromScale)(d,1,a);try{c(n(I,R))}catch(P){v(P)}}function n(l,d){var a=new DOMParser,c=a.parseFromString(l,"text/xml"),v=c.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var f={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(f).reduce(function(F,A){return F[A]=v.getAttribute("ttp:"+A)||f[A],F},{}),I=v.getAttribute("xml:space")!=="preserve",R=e(s(v,"styling","style")),P=e(s(v,"layout","region")),M=s(v,"body","[begin]");return[].map.call(M,function(F){var A=i(F,I);if(!A||!F.hasAttribute("begin"))return null;var B=y(F.getAttribute("begin"),b),z=y(F.getAttribute("dur"),b),Z=y(F.getAttribute("end"),b);if(B===null)throw E(F);if(Z===null){if(z===null)throw E(F);Z=B+z}var ae=new O.default(B-d,Z-d,A);ae.id=Object(D.generateCueId)(ae.startTime,ae.endTime,ae.text);var De=P[F.getAttribute("region")],_e=R[F.getAttribute("style")];ae.position=10,ae.size=80;var Oe=o(De,_e),Ne=Oe.textAlign;if(Ne){var Ue=r[Ne];Ue&&(ae.lineAlign=Ue),ae.align=Ne}return w(ae,Oe),ae}).filter(function(F){return F!==null})}function s(l,d,a){var c=l.getElementsByTagName(d)[0];return c?[].slice.call(c.querySelectorAll(a)):[]}function e(l){return l.reduce(function(d,a){var c=a.getAttribute("xml:id");return c&&(d[c]=a),d},{})}function i(l,d){return[].slice.call(l.childNodes).reduce(function(a,c,v){var f;return c.nodeName==="br"&&v?a+`
|
|
`:(f=c.childNodes)!==null&&f!==void 0&&f.length?i(c,d):d?a+c.textContent.trim().replace(/\s+/g," "):a+c.textContent},"")}function o(l,d){var a="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(v,f){var b=S(d,a,f)||S(l,a,f);return b&&(v[f]=b),v},{})}function S(l,d,a){return l.hasAttributeNS(d,a)?l.getAttributeNS(d,a):null}function E(l){return new Error("Could not parse ttml timestamp "+l)}function y(l,d){if(!l)return null;var a=Object(x.parseTimeStamp)(l);return a===null&&(m.test(l)?a=T(l,d):u.test(l)&&(a=_(l,d))),a}function T(l,d){var a=m.exec(l),c=(a[4]|0)+(a[5]|0)/d.subFrameRate;return(a[1]|0)*3600+(a[2]|0)*60+(a[3]|0)+c/d.frameRate}function _(l,d){var a=u.exec(l),c=Number(a[1]),v=a[2];switch(v){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/d.frameRate;case"t":return c/d.tickRate}return c}},"./src/utils/logger.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"enableLogs",function(){return D}),L.d(H,"logger",function(){return w});var W=function(){},x={trace:W,debug:W,log:W,warn:W,info:W,error:W},O=x;function j(g){var m=self.console[g];return m?m.bind(self.console,"["+g+"] >"):W}function h(g){for(var m=arguments.length,u=new Array(m>1?m-1:0),r=1;r<m;r++)u[r-1]=arguments[r];u.forEach(function(t){O[t]=g[t]?g[t].bind(g):j(t)})}function D(g){if(self.console&&g===!0||typeof g=="object"){h(g,"debug","log","info","warn","error");try{O.log()}catch(m){O=x}}else O=x}var w=O},"./src/utils/mediakeys-helper.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"KeySystems",function(){return W}),L.d(H,"requestMediaKeySystemAccess",function(){return x});var W;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(W||(W={}));var x=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"getMediaSource",function(){return W});function W(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"bin2str",function(){return h}),L.d(H,"readUint16",function(){return D}),L.d(H,"readUint32",function(){return w}),L.d(H,"writeUint32",function(){return g}),L.d(H,"findBox",function(){return m}),L.d(H,"parseSegmentIndex",function(){return u}),L.d(H,"parseInitSegment",function(){return r}),L.d(H,"getStartDTS",function(){return t}),L.d(H,"getDuration",function(){return n}),L.d(H,"computeRawDurationFromSamples",function(){return s}),L.d(H,"offsetStartDTS",function(){return e}),L.d(H,"segmentValidRange",function(){return i}),L.d(H,"appendUint8Array",function(){return o});var W=L("./src/utils/typed-array.ts"),x=L("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,j=[].push;function h(S){return String.fromCharCode.apply(null,S)}function D(S,E){"data"in S&&(E+=S.start,S=S.data);var y=S[E]<<8|S[E+1];return y<0?65536+y:y}function w(S,E){"data"in S&&(E+=S.start,S=S.data);var y=S[E]<<24|S[E+1]<<16|S[E+2]<<8|S[E+3];return y<0?4294967296+y:y}function g(S,E,y){"data"in S&&(E+=S.start,S=S.data),S[E]=y>>24,S[E+1]=y>>16&255,S[E+2]=y>>8&255,S[E+3]=y&255}function m(S,E){var y=[];if(!E.length)return y;var T,_,l;"data"in S?(T=S.data,_=S.start,l=S.end):(T=S,_=0,l=T.byteLength);for(var d=_;d<l;){var a=w(T,d),c=h(T.subarray(d+4,d+8)),v=a>1?d+a:l;if(c===E[0])if(E.length===1)y.push({data:T,start:d+8,end:v});else{var f=m({data:T,start:d+8,end:v},E.slice(1));f.length&&j.apply(y,f)}d=v}return y}function u(S){var E=m(S,["moov"]),y=E[0],T=y?y.end:null,_=m(S,["sidx"]);if(!_||!_[0])return null;var l=[],d=_[0],a=d.data[0],c=a===0?8:16,v=w(d,c);c+=4;var f=0,b=0;a===0?c+=8:c+=16,c+=2;var I=d.end+b,R=D(d,c);c+=2;for(var P=0;P<R;P++){var M=c,F=w(d,M);M+=4;var A=F&2147483647,B=(F&2147483648)>>>31;if(B===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=w(d,M);M+=4,l.push({referenceSize:A,subsegmentDuration:z,info:{duration:z/v,start:I,end:I+A-1}}),I+=A,M+=4,c=M}return{earliestPresentationTime:f,timescale:v,version:a,referencesCount:R,references:l,moovEndOffset:T}}function r(S){for(var E=[],y=m(S,["moov","trak"]),T=0;T<y.length;T++){var _=y[T],l=m(_,["tkhd"])[0];if(l){var d=l.data[l.start],a=d===0?12:20,c=w(l,a),v=m(_,["mdia","mdhd"])[0];if(v){d=v.data[v.start],a=d===0?12:20;var f=w(v,a),b=m(_,["mdia","hdlr"])[0];if(b){var I=h(b.data.subarray(b.start+8,b.start+12)),R={soun:x.ElementaryStreamTypes.AUDIO,vide:x.ElementaryStreamTypes.VIDEO}[I];if(R){var P=m(_,["mdia","minf","stbl","stsd"])[0],M=void 0;P&&(M=h(P.data.subarray(P.start+12,P.start+16))),E[c]={timescale:f,type:R},E[R]={timescale:f,id:c,codec:M}}}}}}var F=m(S,["moov","mvex","trex"]);return F.forEach(function(A){var B=w(A,4),z=E[B];z&&(z.default={duration:w(A,12),flags:w(A,20)})}),E}function t(S,E){return m(E,["moof","traf"]).reduce(function(y,T){var _=m(T,["tfdt"])[0],l=_.data[_.start],d=m(T,["tfhd"]).reduce(function(a,c){var v=w(c,4),f=S[v];if(f){var b=w(_,4);l===1&&(b*=Math.pow(2,32),b+=w(_,8));var I=f.timescale||9e4,R=b/I;if(isFinite(R)&&(a===null||R<a))return R}return a},null);return d!==null&&isFinite(d)&&(y===null||d<y)?d:y},null)||0}function n(S,E){for(var y=0,T=0,_=0,l=m(S,["moof","traf"]),d=0;d<l.length;d++){var a=l[d],c=m(a,["tfhd"])[0],v=w(c,4),f=E[v];if(!f)continue;var b=f.default,I=w(c,0)|(b==null?void 0:b.flags),R=b==null?void 0:b.duration;I&8&&(I&2?R=w(c,12):R=w(c,8));for(var P=f.timescale||9e4,M=m(a,["trun"]),F=0;F<M.length;F++){if(R){var A=w(M[F],4);y=R*A}else y=s(M[F]);f.type===x.ElementaryStreamTypes.VIDEO?T+=y/P:f.type===x.ElementaryStreamTypes.AUDIO&&(_+=y/P)}}if(T===0&&_===0){var B=u(S);if(B!=null&&B.references)return B.references.reduce(function(z,Z){return z+Z.info.duration||0},0)}return T||_}function s(S){var E=w(S,0),y=8;E&1&&(y+=4),E&4&&(y+=4);for(var T=0,_=w(S,4),l=0;l<_;l++){if(E&256){var d=w(S,y);T+=d,y+=4}E&512&&(y+=4),E&1024&&(y+=4),E&2048&&(y+=4)}return T}function e(S,E,y){m(E,["moof","traf"]).forEach(function(T){m(T,["tfhd"]).forEach(function(_){var l=w(_,4),d=S[l];if(!d)return;var a=d.timescale||9e4;m(T,["tfdt"]).forEach(function(c){var v=c.data[c.start],f=w(c,4);if(v===0)g(c,4,f-y*a);else{f*=Math.pow(2,32),f+=w(c,8),f-=y*a,f=Math.max(f,0);var b=Math.floor(f/(O+1)),I=Math.floor(f%(O+1));g(c,4,b),g(c,8,I)}})})})}function i(S){var E={valid:null,remainder:null},y=m(S,["moof"]);if(y){if(y.length<2)return E.remainder=S,E}else return E;var T=y[y.length-1];return E.valid=Object(W.sliceUint8)(S,0,T.start-8),E.remainder=Object(W.sliceUint8)(S,T.start-8),E}function o(S,E){var y=new Uint8Array(S.length+E.length);return y.set(S),y.set(E,S.length),y}},"./src/utils/output-filter.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"default",function(){return W});var W=function(){function x(j,h){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=h}var O=x.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(h,D,w){(this.startTime===null||this.startTime>h)&&(this.startTime=h),this.endTime=D,this.screen=w,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},x}()},"./src/utils/texttrack-utils.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"sendAddTrackEvent",function(){return x}),L.d(H,"addCueToTrack",function(){return O}),L.d(H,"clearCurrentCues",function(){return j}),L.d(H,"removeCuesInRange",function(){return h}),L.d(H,"getCuesInRange",function(){return w});var W=L("./src/utils/logger.ts");function x(g,m){var u;try{u=new Event("addtrack")}catch(r){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,m.dispatchEvent(u)}function O(g,m){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(m.id))try{if(g.addCue(m),!g.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(t){W.logger.debug("[texttrack-utils]: "+t);var r=new self.TextTrackCue(m.startTime,m.endTime,m.text);r.id=m.id,g.addCue(r)}u==="disabled"&&(g.mode=u)}function j(g){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues)for(var u=g.cues.length;u--;)g.removeCue(g.cues[u]);m==="disabled"&&(g.mode=m)}function h(g,m,u){var r=g.mode;if(r==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var t=w(g.cues,m,u),n=0;n<t.length;n++)g.removeCue(t[n]);r==="disabled"&&(g.mode=r)}function D(g,m){if(m<g[0].startTime)return 0;var u=g.length-1;if(m>g[u].endTime)return-1;for(var r=0,t=u;r<=t;){var n=Math.floor((t+r)/2);if(m<g[n].startTime)t=n-1;else if(m>g[n].startTime&&r<u)r=n+1;else return n}return g[r].startTime-m<m-g[t].startTime?r:t}function w(g,m,u){var r=[],t=D(g,m);if(t>-1)for(var n=t,s=g.length;n<s;n++){var e=g[n];if(e.startTime>=m&&e.endTime<=u)r.push(e);else if(e.startTime>u)return r}return r}},"./src/utils/time-ranges.ts":function(te,H,L){"use strict";L.r(H);var W={toString:function(O){for(var j="",h=O.length,D=0;D<h;D++)j+="["+O.start(D).toFixed(3)+","+O.end(D).toFixed(3)+"]";return j}};H.default=W},"./src/utils/timescale-conversion.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"toTimescaleFromBase",function(){return x}),L.d(H,"toTimescaleFromScale",function(){return O}),L.d(H,"toMsFromMpegTsClock",function(){return j}),L.d(H,"toMpegTsClockFromTimescale",function(){return h});var W=9e4;function x(D,w,g,m){g===void 0&&(g=1),m===void 0&&(m=!1);var u=D*w*g;return m?Math.round(u):u}function O(D,w,g,m){return g===void 0&&(g=1),m===void 0&&(m=!1),x(D,w,1/g,m)}function j(D,w){return w===void 0&&(w=!1),x(D,1e3,1/W,w)}function h(D,w){return w===void 0&&(w=1),x(D,W,1/w)}},"./src/utils/typed-array.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"sliceUint8",function(){return W});function W(x,O,j){return Uint8Array.prototype.slice?x.slice(O,j):new Uint8Array(Array.prototype.slice.call(x,O,j))}},"./src/utils/vttcue.ts":function(te,H,L){"use strict";L.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var W=["","lr","rl"],x=["start","middle","end","left","right"];function O(g,m){if(typeof m!="string")return!1;if(!Array.isArray(g))return!1;var u=m.toLowerCase();return~g.indexOf(u)?u:!1}function j(g){return O(W,g)}function h(g){return O(x,g)}function D(g){for(var m=arguments.length,u=new Array(m>1?m-1:0),r=1;r<m;r++)u[r-1]=arguments[r];for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)g[s]=n[s]}return g}function w(g,m,u){var r=this,t={enumerable:!0};r.hasBeenReset=!1;var n="",s=!1,e=g,i=m,o=u,S=null,E="",y=!0,T="auto",_="start",l=50,d="middle",a=50,c="middle";Object.defineProperty(r,"id",D({},t,{get:function(){return n},set:function(f){n=""+f}})),Object.defineProperty(r,"pauseOnExit",D({},t,{get:function(){return s},set:function(f){s=!!f}})),Object.defineProperty(r,"startTime",D({},t,{get:function(){return e},set:function(f){if(typeof f!="number")throw new TypeError("Start time must be set to a number.");e=f,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",D({},t,{get:function(){return i},set:function(f){if(typeof f!="number")throw new TypeError("End time must be set to a number.");i=f,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",D({},t,{get:function(){return o},set:function(f){o=""+f,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",D({},t,{get:function(){return S},set:function(f){S=f,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",D({},t,{get:function(){return E},set:function(f){var b=j(f);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",D({},t,{get:function(){return y},set:function(f){y=!!f,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",D({},t,{get:function(){return T},set:function(f){if(typeof f!="number"&&f!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");T=f,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",D({},t,{get:function(){return _},set:function(f){var b=h(f);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",D({},t,{get:function(){return l},set:function(f){if(f<0||f>100)throw new Error("Position must be between 0 and 100.");l=f,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",D({},t,{get:function(){return d},set:function(f){var b=h(f);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");d=b,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",D({},t,{get:function(){return a},set:function(f){if(f<0||f>100)throw new Error("Size must be between 0 and 100.");a=f,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",D({},t,{get:function(){return c},set:function(f){var b=h(f);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),r.displayState=void 0}return w.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},w}()},"./src/utils/vttparser.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"parseTimeStamp",function(){return O}),L.d(H,"fixLineBreaks",function(){return m}),L.d(H,"VTTParser",function(){return u});var W=L("./src/utils/vttcue.ts"),x=function(){function r(){}var t=r.prototype;return t.decode=function(s,e){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},r}();function O(r){function t(s,e,i,o){return(s|0)*3600+(e|0)*60+(i|0)+parseFloat(o||0)}var n=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}var j=function(){function r(){this.values=Object.create(null)}var t=r.prototype;return t.set=function(s,e){!this.get(s)&&e!==""&&(this.values[s]=e)},t.get=function(s,e,i){return i?this.has(s)?this.values[s]:e[i]:this.has(s)?this.values[s]:e},t.has=function(s){return s in this.values},t.alt=function(s,e,i){for(var o=0;o<i.length;++o)if(e===i[o]){this.set(s,e);break}},t.integer=function(s,e){/^-?\d+$/.test(e)&&this.set(s,parseInt(e,10))},t.percent=function(s,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var i=parseFloat(e);if(i>=0&&i<=100)return this.set(s,i),!0}return!1},r}();function h(r,t,n,s){var e=s?r.split(s):[r];for(var i in e){if(typeof e[i]!="string")continue;var o=e[i].split(n);if(o.length!==2)continue;var S=o[0],E=o[1];t(S,E)}}var D=new W.default(0,0,""),w=D.align==="middle"?"middle":"center";function g(r,t,n){var s=r;function e(){var S=O(r);if(S===null)throw new Error("Malformed timestamp: "+s);return r=r.replace(/^[^\sa-zA-Z-]+/,""),S}function i(S,E){var y=new j;h(S,function(l,d){var a;switch(l){case"region":for(var c=n.length-1;c>=0;c--)if(n[c].id===d){y.set(l,n[c].region);break}break;case"vertical":y.alt(l,d,["rl","lr"]);break;case"line":a=d.split(","),y.integer(l,a[0]),y.percent(l,a[0])&&y.set("snapToLines",!1),y.alt(l,a[0],["auto"]),a.length===2&&y.alt("lineAlign",a[1],["start",w,"end"]);break;case"position":a=d.split(","),y.percent(l,a[0]),a.length===2&&y.alt("positionAlign",a[1],["start",w,"end","line-left","line-right","auto"]);break;case"size":y.percent(l,d);break;case"align":y.alt(l,d,["start",w,"end","left","right"]);break}},/:/,/\s/),E.region=y.get("region",null),E.vertical=y.get("vertical","");var T=y.get("line","auto");T==="auto"&&D.line===-1&&(T=-1),E.line=T,E.lineAlign=y.get("lineAlign","start"),E.snapToLines=y.get("snapToLines",!0),E.size=y.get("size",100),E.align=y.get("align",w);var _=y.get("position","auto");_==="auto"&&D.position===50&&(_=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=_}function o(){r=r.replace(/^\s+/,"")}if(o(),t.startTime=e(),o(),r.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);r=r.substr(3),o(),t.endTime=e(),o(),i(r,t)}function m(r){return r.replace(/<br(?: \/)?>/gi,`
|
|
`)}var u=function(){function r(){this.state="INITIAL",this.buffer="",this.decoder=new x,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=r.prototype;return t.parse=function(s){var e=this;s&&(e.buffer+=e.decoder.decode(s,{stream:!0}));function i(){var _=e.buffer,l=0;for(_=m(_);l<_.length&&_[l]!=="\r"&&_[l]!==`
|
|
`;)++l;var d=_.substr(0,l);return _[l]==="\r"&&++l,_[l]===`
|
|
`&&++l,e.buffer=_.substr(l),d}function o(_){h(_,function(l,d){},/:/)}try{var S="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;S=i();var E=S.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var y=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;y?y=!1:S=i();switch(e.state){case"HEADER":/:/.test(S)?o(S):S||(e.state="ID");continue;case"NOTE":S||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){e.state="NOTE";break}if(!S)continue;if(e.cue=new W.default(0,0,""),e.state="CUE",S.indexOf("-->")===-1){e.cue.id=S;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{g(S,e.cue,e.regionList)}catch(_){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{var T=S.indexOf("-->")!==-1;if(!S||T&&(y=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=`
|
|
`),e.cue.text+=S}continue;case"BADCUE":S||(e.state="ID")}}}catch(_){e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
|
|
|
|
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){s.onparsingerror&&s.onparsingerror(e)}return s.onflush&&s.onflush(),this},r}()},"./src/utils/webvtt-parser.ts":function(te,H,L){"use strict";L.r(H),L.d(H,"generateCueId",function(){return u}),L.d(H,"parseWebVTT",function(){return t});var W=L("./src/polyfills/number.ts"),x=L("./src/utils/vttparser.ts"),O=L("./src/demux/id3.ts"),j=L("./src/utils/timescale-conversion.ts"),h=L("./src/remux/mp4-remuxer.ts"),D=/\r\n|\n\r|\n|\r/g,w=function(s,e,i){return i===void 0&&(i=0),s.substr(i,e.length)===e},g=function(s){var e=parseInt(s.substr(-3)),i=parseInt(s.substr(-6,2)),o=parseInt(s.substr(-9,2)),S=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(W.isFiniteNumber)(e)||!Object(W.isFiniteNumber)(i)||!Object(W.isFiniteNumber)(o)||!Object(W.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return e+=1e3*i,e+=60*1e3*o,e+=60*60*1e3*S,e},m=function(s){for(var e=5381,i=s.length;i;)e=e*33^s.charCodeAt(--i);return(e>>>0).toString()};function u(n,s,e){return m(n.toString())+m(s.toString())+m(e)}var r=function(s,e,i){var o=s[e],S=s[o.prevCC];if(!S||!S.new&&o.new){s.ccOffset=s.presentationOffset=o.start,o.new=!1;return}for(;(E=S)!==null&&E!==void 0&&E.new;){var E;s.ccOffset+=o.start-S.start,o.new=!1,o=S,S=s[o.prevCC]}s.presentationOffset=i};function t(n,s,e,i,o,S,E,y){var T=new x.VTTParser,_=Object(O.utf8ArrayToStr)(new Uint8Array(n)).trim().replace(D,`
|
|
`).split(`
|
|
`),l=[],d=Object(j.toMpegTsClockFromTimescale)(s,e),a="00:00.000",c=0,v=0,f,b=!0,I=!1;T.oncue=function(R){var P=i[o],M=i.ccOffset,F=(c-d)/9e4;if(P!=null&&P.new&&(v!==void 0?M=i.ccOffset=P.start:r(i,o,F)),F&&(M=F-i.presentationOffset),I){var A=R.endTime-R.startTime,B=Object(h.normalizePts)((R.startTime+M-v)*9e4,S*9e4)/9e4;R.startTime=B,R.endTime=B+A}var z=R.text.trim();R.text=decodeURIComponent(encodeURIComponent(z)),R.id||(R.id=u(R.startTime,R.endTime,z)),R.endTime>0&&l.push(R)},T.onparsingerror=function(R){f=R},T.onflush=function(){if(f){y(f);return}E(l)},_.forEach(function(R){if(b)if(w(R,"X-TIMESTAMP-MAP=")){b=!1,I=!0,R.substr(16).split(",").forEach(function(P){w(P,"LOCAL:")?a=P.substr(6):w(P,"MPEGTS:")&&(c=parseInt(P.substr(7)))});try{v=g(a)/1e3}catch(P){I=!1,f=P}return}else R===""&&(b=!1);T.parse(R+`
|
|
`)}),T.flush()}},"./src/utils/xhr-loader.ts":function(te,H,L){"use strict";L.r(H);var W=L("./src/utils/logger.ts"),x=L("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,j=function(){function h(w){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=w?w.xhrSetup:null,this.stats=new x.LoadStats,this.retryDelay=0}var D=h.prototype;return D.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},D.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},D.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},D.load=function(g,m,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=m,this.callbacks=u,this.retryDelay=m.retryDelay,this.loadInternal()},D.loadInternal=function(){var g=this.config,m=this.context;if(!g)return;var u=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var t=this.xhrSetup;try{if(t)try{t(u,m.url)}catch(e){u.open("GET",m.url,!0),t(u,m.url)}u.readyState||u.open("GET",m.url,!0);var n=this.context.headers;if(n)for(var s in n)u.setRequestHeader(s,n[s])}catch(e){this.callbacks.onError({code:u.status,text:e.message},m,u);return}m.rangeEnd&&u.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),u.send()},D.readystatechange=function(){var g=this.context,m=this.loader,u=this.stats;if(!g||!m)return;var r=m.readyState,t=this.config;if(u.aborted)return;if(r>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),r===4){m.onreadystatechange=null,m.onprogress=null;var n=m.status;if(n>=200&&n<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var s,e;if(g.responseType==="arraybuffer"?(s=m.response,e=s.byteLength):(s=m.responseText,e=s.length),u.loaded=u.total=e,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(u,g,s,m),!this.callbacks)return;var o={url:m.responseURL,data:s};this.callbacks.onSuccess(o,u,g,m)}else u.retry>=t.maxRetry||n>=400&&n<499?(W.logger.error(n+" while loading "+g.url),this.callbacks.onError({code:n,text:m.statusText},g,m)):(W.logger.warn(n+" while loading "+g.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,t.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout)},D.loadtimeout=function(){W.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},D.loadprogress=function(g){var m=this.stats;m.loaded=g.loaded,g.lengthComputable&&(m.total=g.total)},D.getCacheAge=function(){var g=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");g=m?parseFloat(m):null}return g},h}();H.default=j}}).default})},vHTk:function(zt,Qe,G){zt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return Wt});var te=G("rePB"),H=G("VTBJ"),L=G("KQm4"),W=G("U8pU"),x=G("ODXe"),O=G("q1tI"),j=G("TSYQ"),h=G.n(j),D=G("Gytx"),w=G.n(D),g=G("Kwbf"),m=G("t23M"),u=G("qx4F"),r=G("6eGT"),t=G("IBYe"),n=G("Ff2n"),s=G("c+Xe"),e=G("fyJ8"),i=G("biw7");function o(Re,je,tt,dt,ke){var ot=tt[Re]||{},ve=tt[je]||{},le,ue;ot.fixed==="left"?le=dt.left[Re]:ve.fixed==="right"&&(ue=dt.right[je]);var $=!1,Q=!1,re=!1,fe=!1,Pe=tt[je+1],Ge=tt[Re-1];if(ke==="rtl"){if(le!==void 0){var bt=Ge&&Ge.fixed==="left";fe=!bt}else if(ue!==void 0){var Ft=Pe&&Pe.fixed==="right";re=!Ft}}else if(le!==void 0){var Xt=Pe&&Pe.fixed==="left";$=!Xt}else if(ue!==void 0){var Pt=Ge&&Ge.fixed==="right";Q=!Pt}return{fixLeft:le,fixRight:ue,lastFixLeft:$,firstFixRight:Q,lastFixRight:re,firstFixLeft:fe,isSticky:dt.isSticky}}var S=G("sR1s");function E(Re){var je=Re.cells,tt=Re.stickyOffsets,dt=Re.flattenColumns,ke=Re.rowComponent,ot=Re.cellComponent,ve=Re.onHeaderRow,le=Re.index,ue=O.useContext(i.a),$=ue.prefixCls,Q=ue.direction,re;ve&&(re=ve(je.map(function(Pe){return Pe.column}),le));var fe=Object(S.a)(je.map(function(Pe){return Pe.column}));return O.createElement(ke,Object.assign({},re),je.map(function(Pe,Ge){var bt=Pe.column,Ft=o(Pe.colStart,Pe.colEnd,dt,tt,Q),Xt;return bt&&bt.onHeaderCell&&(Xt=Pe.column.onHeaderCell(bt)),O.createElement(e.a,Object.assign({},Pe,{ellipsis:bt.ellipsis,align:bt.align,component:ot,prefixCls:$,key:fe[Ge]},Ft,{additionalProps:Xt,rowType:"header"}))}))}E.displayName="HeaderRow";var y=E;function T(Re){var je=[];function tt(ve,le){var ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;je[ue]=je[ue]||[];var $=le,Q=ve.filter(Boolean).map(function(re){var fe={key:re.key,className:re.className||"",children:re.title,column:re,colStart:$},Pe=1,Ge=re.children;return Ge&&Ge.length>0&&(Pe=tt(Ge,$,ue+1).reduce(function(bt,Ft){return bt+Ft},0),fe.hasSubColumns=!0),"colSpan"in re&&(Pe=re.colSpan),"rowSpan"in re&&(fe.rowSpan=re.rowSpan),fe.colSpan=Pe,fe.colEnd=fe.colStart+Pe-1,je[ue].push(fe),$+=Pe,Pe});return Q}tt(Re,0);for(var dt=je.length,ke=function(le){je[le].forEach(function(ue){!("rowSpan"in ue)&&!ue.hasSubColumns&&(ue.rowSpan=dt-le)})},ot=0;ot<dt;ot+=1)ke(ot);return je}function _(Re){var je=Re.stickyOffsets,tt=Re.columns,dt=Re.flattenColumns,ke=Re.onHeaderRow,ot=O.useContext(i.a),ve=ot.prefixCls,le=ot.getComponent,ue=O.useMemo(function(){return T(tt)},[tt]),$=le(["header","wrapper"],"thead"),Q=le(["header","row"],"tr"),re=le(["header","cell"],"th");return O.createElement($,{className:"".concat(ve,"-thead")},ue.map(function(fe,Pe){var Ge=O.createElement(y,{key:Pe,flattenColumns:dt,cells:fe,stickyOffsets:je,rowComponent:Q,cellComponent:re,onHeaderRow:ke,index:Pe});return Ge}))}var l=_,d=G("hW8S");function a(Re){for(var je=Re.colWidths,tt=Re.columns,dt=Re.columCount,ke=[],ot=dt||tt.length,ve=!1,le=ot-1;le>=0;le-=1){var ue=je[le],$=tt&&tt[le],Q=$&&$[d.a];(ue||Q||ve)&&(ke.unshift(O.createElement("col",Object.assign({key:le,style:{width:ue,minWidth:ue}},Q))),ve=!0)}return O.createElement("colgroup",null,ke)}var c=a;function v(Re,je){return Object(O.useMemo)(function(){for(var tt=[],dt=0;dt<je;dt+=1){var ke=Re[dt];if(ke!==void 0)tt[dt]=ke;else return null}return tt},[Re.join("_"),je])}var f=O.forwardRef(function(Re,je){var tt=Re.noData,dt=Re.columns,ke=Re.flattenColumns,ot=Re.colWidths,ve=Re.columCount,le=Re.stickyOffsets,ue=Re.direction,$=Re.fixHeader,Q=Re.offsetHeader,re=Re.stickyClassName,fe=Re.onScroll,Pe=Object(n.a)(Re,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ge=O.useContext(i.a),bt=Ge.prefixCls,Ft=Ge.scrollbarSize,Xt=Ge.isSticky,Pt=Xt&&!$?0:Ft,St=O.useRef(null),Ze=O.useCallback(function(xt){Object(s.b)(je,xt),Object(s.b)(St,xt)},[]);O.useEffect(function(){var xt;function Ot(xe){var Je=xe.currentTarget,wt=xe.deltaX;wt&&(fe({currentTarget:Je,scrollLeft:Je.scrollLeft+wt}),xe.preventDefault())}return(xt=St.current)===null||xt===void 0||xt.addEventListener("wheel",Ot),function(){var xe;(xe=St.current)===null||xe===void 0||xe.removeEventListener("wheel",Ot)}},[]);var qe=ke[ke.length-1],Me={fixed:qe?qe.fixed:null,onHeaderCell:function(){return{className:"".concat(bt,"-cell-scrollbar")}}},ne=Object(O.useMemo)(function(){return Pt?[].concat(Object(L.a)(dt),[Me]):dt},[Pt,dt]),me=Object(O.useMemo)(function(){return Pt?[].concat(Object(L.a)(ke),[Me]):ke},[Pt,ke]),rt=Object(O.useMemo)(function(){var xt=le.right,Ot=le.left;return Object(H.a)(Object(H.a)({},le),{},{left:ue==="rtl"?[].concat(Object(L.a)(Ot.map(function(xe){return xe+Pt})),[0]):Ot,right:ue==="rtl"?xt:[].concat(Object(L.a)(xt.map(function(xe){return xe+Pt})),[0]),isSticky:Xt})},[Pt,le,Xt]),Ke=v(ot,ve);return O.createElement("div",{style:Object(H.a)({overflow:"hidden"},Xt?{top:Q}:{}),ref:Ze,className:h()("".concat(bt,"-header"),Object(te.a)({},re,!!re))},O.createElement("table",{style:{tableLayout:"fixed",visibility:tt||Ke?null:"hidden"}},O.createElement(c,{colWidths:Ke?[].concat(Object(L.a)(Ke),[Pt]):[],columCount:ve+1,columns:me}),O.createElement(l,Object.assign({},Pe,{stickyOffsets:rt,columns:ne,flattenColumns:me}))))});f.displayName="FixedHeader";var b=f,I=O.createContext(null),R=I;function P(Re){var je=Re.prefixCls,tt=Re.children,dt=Re.component,ke=Re.cellComponent,ot=Re.fixHeader,ve=Re.fixColumn,le=Re.horizonScroll,ue=Re.className,$=Re.expanded,Q=Re.componentWidth,re=Re.colSpan,fe=O.useContext(i.a),Pe=fe.scrollbarSize;return O.useMemo(function(){var Ge=tt;return ve&&(Ge=O.createElement("div",{style:{width:Q-(ot?Pe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(je,"-expanded-row-fixed")},Ge)),O.createElement(dt,{className:ue,style:{display:$?null:"none"}},O.createElement(e.a,{component:ke,prefixCls:je,colSpan:re},Ge))},[tt,dt,ot,le,ue,$,Q,re,Pe])}var M=P;function F(Re){var je=Re.className,tt=Re.style,dt=Re.record,ke=Re.index,ot=Re.rowKey,ve=Re.getRowKey,le=Re.rowExpandable,ue=Re.expandedKeys,$=Re.onRow,Q=Re.indent,re=Q===void 0?0:Q,fe=Re.rowComponent,Pe=Re.cellComponent,Ge=Re.childrenColumnName,bt=O.useContext(i.a),Ft=bt.prefixCls,Xt=bt.fixedInfoList,Pt=O.useContext(R),St=Pt.fixHeader,Ze=Pt.fixColumn,qe=Pt.horizonScroll,Me=Pt.componentWidth,ne=Pt.flattenColumns,me=Pt.expandableType,rt=Pt.expandRowByClick,Ke=Pt.onTriggerExpand,xt=Pt.rowClassName,Ot=Pt.expandedRowClassName,xe=Pt.indentSize,Je=Pt.expandIcon,wt=Pt.expandedRowRender,jt=Pt.expandIconColumnIndex,Qt=O.useState(!1),Gn=Object(x.a)(Qt,2),Vn=Gn[0],ei=Gn[1],ci=ue&&ue.has(Re.recordKey);O.useEffect(function(){ci&&ei(!0)},[ci]);var ni=me==="row"&&(!le||le(dt)),_i=me==="nest",di=Ge&&dt&&dt[Ge],rn=ni||_i,Dt;$&&(Dt=$(dt,ke));var $t=function(p){if(rt&&rn&&Ke(dt,p),Dt&&Dt.onClick){for(var C,N=arguments.length,V=new Array(N>1?N-1:0),U=1;U<N;U++)V[U-1]=arguments[U];(C=Dt).onClick.apply(C,[p].concat(V))}},cn;typeof xt=="string"?cn=xt:typeof xt=="function"&&(cn=xt(dt,ke,re));var Sn=Object(S.a)(ne),Dn=O.createElement(fe,Object.assign({},Dt,{"data-row-key":ot,className:h()(je,"".concat(Ft,"-row"),"".concat(Ft,"-row-level-").concat(re),cn,Dt&&Dt.className),style:Object(H.a)(Object(H.a)({},tt),Dt?Dt.style:null),onClick:$t}),ne.map(function(k,p){var C=k.render,N=k.dataIndex,V=k.className,U=Sn[p],de=Xt[p],ze;p===(jt||0)&&_i&&(ze=O.createElement(O.Fragment,null,O.createElement("span",{style:{paddingLeft:"".concat(xe*re,"px")},className:"".concat(Ft,"-row-indent indent-level-").concat(re)}),Je({prefixCls:Ft,expanded:ci,expandable:di,record:dt,onExpand:Ke})));var _t;return k.onCell&&(_t=k.onCell(dt,ke)),O.createElement(e.a,Object.assign({className:V,ellipsis:k.ellipsis,align:k.align,component:Pe,prefixCls:Ft,key:U,record:dt,index:ke,dataIndex:N,render:C,shouldCellUpdate:k.shouldCellUpdate},de,{appendNode:ze,additionalProps:_t}))})),gn;if(ni&&(Vn||ci)){var En=wt(dt,ke,re+1,ci),sn=Ot&&Ot(dt,ke,re);gn=O.createElement(M,{expanded:ci,className:h()("".concat(Ft,"-expanded-row"),"".concat(Ft,"-expanded-row-level-").concat(re+1),sn),prefixCls:Ft,fixHeader:St,fixColumn:Ze,horizonScroll:qe,component:fe,componentWidth:Me,cellComponent:Pe,colSpan:ne.length},En)}var et;return di&&ci&&(et=(dt[Ge]||[]).map(function(k,p){var C=ve(k,p);return O.createElement(F,Object.assign({},Re,{key:C,rowKey:C,record:k,recordKey:C,index:p,indent:re+1}))})),O.createElement(O.Fragment,null,Dn,gn,et)}F.displayName="BodyRow";var A=F,B=O.createContext(null),z=B;function Z(Re){var je=Re.columnKey,tt=Re.onColumnResize,dt=O.useRef();return O.useEffect(function(){dt.current&&tt(je,dt.current.offsetWidth)},[]),O.createElement(m.a,{onResize:function(ot){var ve=ot.offsetWidth;tt(je,ve)}},O.createElement("td",{ref:dt,style:{padding:0,border:0,height:0}},O.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ae(Re){var je=Re.data,tt=Re.getRowKey,dt=Re.measureColumnWidth,ke=Re.expandedKeys,ot=Re.onRow,ve=Re.rowExpandable,le=Re.emptyNode,ue=Re.childrenColumnName,$=O.useContext(z),Q=$.onColumnResize,re=O.useContext(i.a),fe=re.prefixCls,Pe=re.getComponent,Ge=O.useContext(R),bt=Ge.fixHeader,Ft=Ge.horizonScroll,Xt=Ge.flattenColumns,Pt=Ge.componentWidth;return O.useMemo(function(){var St=Pe(["body","wrapper"],"tbody"),Ze=Pe(["body","row"],"tr"),qe=Pe(["body","cell"],"td"),Me;je.length?Me=je.map(function(me,rt){var Ke=tt(me,rt);return O.createElement(A,{key:Ke,rowKey:Ke,record:me,recordKey:Ke,index:rt,rowComponent:Ze,cellComponent:qe,expandedKeys:ke,onRow:ot,getRowKey:tt,rowExpandable:ve,childrenColumnName:ue})}):Me=O.createElement(M,{expanded:!0,className:"".concat(fe,"-placeholder"),prefixCls:fe,fixHeader:bt,fixColumn:Ft,horizonScroll:Ft,component:Ze,componentWidth:Pt,cellComponent:qe,colSpan:Xt.length},le);var ne=Object(S.a)(Xt);return O.createElement(St,{className:"".concat(fe,"-tbody")},dt&&O.createElement("tr",{"aria-hidden":"true",className:"".concat(fe,"-measure-row"),style:{height:0}},ne.map(function(me){return O.createElement(Z,{key:me,columnKey:me,onColumnResize:Q})})),Me)},[je,fe,ot,dt,ke,tt,Pe,Pt,le,Xt])}var De=O.memo(ae);De.displayName="Body";var _e=De,Oe=G("wRmb"),Ne=G("xEkU"),Ue=G.n(Ne);function Ee(Re){var je=Object(O.useRef)(Re),tt=Object(O.useState)({}),dt=Object(x.a)(tt,2),ke=dt[1],ot=Object(O.useRef)(null),ve=Object(O.useRef)([]);function le(ue){ot.current===null&&(ve.current=[],ot.current=Ue()(function(){ve.current.forEach(function($){je.current=$(je.current)}),ot.current=null,ke({})})),ve.current.push(ue)}return Object(O.useEffect)(function(){return function(){Ue.a.cancel(ot.current)}},[]),[je.current,le]}function q(Re){var je=Object(O.useRef)(Re),tt=Object(O.useRef)(null);function dt(){window.clearTimeout(tt.current)}function ke(ve){je.current=ve,dt(),tt.current=window.setTimeout(function(){je.current=null,tt.current=null},100)}function ot(){return je.current}return Object(O.useEffect)(function(){return dt},[]),[ke,ot]}function J(Re,je,tt){var dt=Object(O.useMemo)(function(){for(var ke=[],ot=[],ve=0,le=0,ue=0;ue<je;ue+=1)if(tt==="rtl"){ot[ue]=le,le+=Re[ue]||0;var $=je-ue-1;ke[$]=ve,ve+=Re[$]||0}else{ke[ue]=ve,ve+=Re[ue]||0;var Q=je-ue-1;ot[Q]=le,le+=Re[Q]||0}return{left:ke,right:ot}},[Re,je,tt]);return dt}var pe=J;function ee(Re){var je=Re.className,tt=Re.children;return O.createElement("div",{className:je},tt)}var Ae=ee,Ve=G("n6Qo");function Le(Re){var je,tt=Re.prefixCls,dt=Re.record,ke=Re.onExpand,ot=Re.expanded,ve=Re.expandable,le="".concat(tt,"-row-expand-icon");if(!ve)return O.createElement("span",{className:h()(le,"".concat(tt,"-row-spaced"))});var ue=function(Q){ke(dt,Q),Q.stopPropagation()};return O.createElement("span",{className:h()(le,(je={},Object(te.a)(je,"".concat(tt,"-row-expanded"),ot),Object(te.a)(je,"".concat(tt,"-row-collapsed"),!ot),je)),onClick:ue})}function Ye(Re,je,tt){var dt=[];function ke(ot){(ot||[]).forEach(function(ve,le){dt.push(je(ve,le)),ke(ve[tt])})}return ke(Re),dt}var it=G("zT1h"),vt=G("y0+3"),ut=function(je,tt){var dt,ke,ot=je.scrollBodyRef,ve=je.onScroll,le=je.offsetScroll,ue=O.useContext(i.a),$=ue.prefixCls,Q=((dt=ot.current)===null||dt===void 0?void 0:dt.scrollWidth)||0,re=((ke=ot.current)===null||ke===void 0?void 0:ke.clientWidth)||0,fe=Q&&re*(re/Q),Pe=O.useRef(),Ge=Ee({scrollLeft:0,isHiddenScrollBar:!1}),bt=Object(x.a)(Ge,2),Ft=bt[0],Xt=bt[1],Pt=O.useRef({delta:0,x:0}),St=O.useState(!1),Ze=Object(x.a)(St,2),qe=Ze[0],Me=Ze[1],ne=function(){Me(!1)},me=function(xe){xe.persist(),Pt.current.delta=xe.pageX-Ft.scrollLeft,Pt.current.x=0,Me(!0),xe.preventDefault()},rt=function(xe){var Je,wt=xe||((Je=window)===null||Je===void 0?void 0:Je.event),jt=wt.buttons;if(!qe||jt===0){qe&&Me(!1);return}var Qt=Pt.current.x+xe.pageX-Pt.current.x-Pt.current.delta;Qt<=0&&(Qt=0),Qt+fe>=re&&(Qt=re-fe),ve({scrollLeft:Qt/re*(Q+2)}),Pt.current.x=xe.pageX},Ke=function(){var xe=Object(vt.b)(ot.current).top,Je=xe+ot.current.offsetHeight,wt=document.documentElement.scrollTop+window.innerHeight;Je-Object(u.a)()<=wt||xe>=wt-le?Xt(function(jt){return Object(H.a)(Object(H.a)({},jt),{},{isHiddenScrollBar:!0})}):Xt(function(jt){return Object(H.a)(Object(H.a)({},jt),{},{isHiddenScrollBar:!1})})},xt=function(xe){Xt(function(Je){return Object(H.a)(Object(H.a)({},Je),{},{scrollLeft:xe/Q*re||0})})};return O.useImperativeHandle(tt,function(){return{setScrollLeft:xt}}),O.useEffect(function(){var Ot=Object(it.a)(document.body,"mouseup",ne,!1),xe=Object(it.a)(document.body,"mousemove",rt,!1);return Ke(),function(){Ot.remove(),xe.remove()}},[fe,qe]),O.useEffect(function(){var Ot=Object(it.a)(window,"scroll",Ke,!1),xe=Object(it.a)(window,"resize",Ke,!1);return function(){Ot.remove(),xe.remove()}},[]),O.useEffect(function(){Ft.isHiddenScrollBar||Xt(function(Ot){var xe,Je;return Object(H.a)(Object(H.a)({},Ot),{},{scrollLeft:ot.current.scrollLeft/((xe=ot.current)===null||xe===void 0?void 0:xe.scrollWidth)*((Je=ot.current)===null||Je===void 0?void 0:Je.clientWidth)})})},[Ft.isHiddenScrollBar]),Q<=re||!fe||Ft.isHiddenScrollBar?null:O.createElement("div",{style:{height:Object(u.a)(),width:re,bottom:le},className:"".concat($,"-sticky-scroll")},O.createElement("div",{onMouseDown:me,ref:Pe,className:h()("".concat($,"-sticky-scroll-bar"),Object(te.a)({},"".concat($,"-sticky-scroll-bar-active"),qe)),style:{width:"".concat(fe,"px"),transform:"translate3d(".concat(Ft.scrollLeft,"px, 0, 0)")}}))},mt=O.forwardRef(ut);function lt(Re,je){return O.useMemo(function(){var tt=!!Re;return{isSticky:tt,stickyClassName:tt?"".concat(je,"-sticky-header"):"",offsetHeader:Object(W.a)(Re)==="object"&&Re.offsetHeader||0,offsetScroll:Object(W.a)(Re)==="object"&&Re.offsetScroll||0}},[Re,je])}var Bt=[],Nt={},Wt="rc-table-internal-hook",Lt=O.memo(function(Re){var je=Re.children;return je},function(Re,je){return w()(Re.props,je.props)?Re.pingLeft!==je.pingLeft||Re.pingRight!==je.pingRight:!1});function Gt(Re){var je,tt=Re.prefixCls,dt=Re.className,ke=Re.rowClassName,ot=Re.style,ve=Re.data,le=Re.rowKey,ue=Re.scroll,$=Re.tableLayout,Q=Re.direction,re=Re.title,fe=Re.footer,Pe=Re.summary,Ge=Re.id,bt=Re.showHeader,Ft=Re.components,Xt=Re.emptyText,Pt=Re.onRow,St=Re.onHeaderRow,Ze=Re.internalHooks,qe=Re.transformColumns,Me=Re.internalRefs,ne=Re.sticky,me=ve||Bt,rt=!!me.length,Ke=O.useState(0),xt=Object(x.a)(Ke,2),Ot=xt[0],xe=xt[1];O.useEffect(function(){xe(Object(u.a)())});var Je=O.useMemo(function(){return Object(S.c)(Ft,{})},[Ft]),wt=O.useCallback(function(on,un){return Object(S.b)(Je,on)||un},[Je]),jt=O.useMemo(function(){return typeof le=="function"?le:function(on){var un=on&&on[le];return un}},[le]),Qt=Object(d.c)(Re),Gn=Qt.expandIcon,Vn=Qt.expandedRowKeys,ei=Qt.defaultExpandedRowKeys,ci=Qt.defaultExpandAllRows,ni=Qt.expandedRowRender,_i=Qt.onExpand,di=Qt.onExpandedRowsChange,rn=Qt.expandRowByClick,Dt=Qt.rowExpandable,$t=Qt.expandIconColumnIndex,cn=Qt.expandedRowClassName,Sn=Qt.childrenColumnName,Dn=Qt.indentSize,gn=Gn||Le,En=Sn||"children",sn=O.useMemo(function(){return ni?"row":Re.expandable&&Ze===Wt&&Re.expandable.__PARENT_RENDER_ICON__||me.some(function(on){return on&&Object(W.a)(on)==="object"&&on[En]})?"nest":!1},[!!ni,me]),et=O.useState(function(){return ei||(ci?Ye(me,jt,En):[])}),k=Object(x.a)(et,2),p=k[0],C=k[1],N=O.useMemo(function(){return new Set(Vn||p||[])},[Vn,p]),V=O.useCallback(function(on){var un=jt(on,me.indexOf(on)),Ln,ti=N.has(un);ti?(N.delete(un),Ln=Object(L.a)(N)):Ln=[].concat(Object(L.a)(N),[un]),C(Ln),_i&&_i(!ti,on),di&&di(Ln)},[jt,N,me,_i,di]),U=O.useState(0),de=Object(x.a)(U,2),ze=de[0],_t=de[1],Mt=Object(Oe.b)(Object(H.a)(Object(H.a)(Object(H.a)({},Re),Qt),{},{expandable:!!ni,expandedKeys:N,getRowKey:jt,onTriggerExpand:V,expandIcon:gn,expandIconColumnIndex:$t,direction:Q}),Ze===Wt?qe:null),ct=Object(x.a)(Mt,2),Vt=ct[0],Et=ct[1],Yt=O.useMemo(function(){return{columns:Vt,flattenColumns:Et}},[Vt,Et]),dn=O.useRef(),Un=O.useRef(),On=O.useRef(),bn=O.useState(!1),ln=Object(x.a)(bn,2),Jt=ln[0],In=ln[1],Wn=O.useState(!1),ii=Object(x.a)(Wn,2),Pn=ii[0],Nn=ii[1],Qn=Ee(new Map),ri=Object(x.a)(Qn,2),Oi=ri[0],hi=ri[1],K=Object(S.a)(Et),oe=K.map(function(on){return Oi.get(on)}),ye=O.useMemo(function(){return oe},[oe.join("_")]),Te=pe(ye,Et.length,Q),Fe=ue&&Object(S.d)(ue.y),Se=ue&&Object(S.d)(ue.x),He=Se&&Et.some(function(on){var un=on.fixed;return un}),We=O.useRef(),st=lt(ne,tt),Xe=st.isSticky,ft=st.offsetHeader,pt=st.offsetScroll,$e=st.stickyClassName,gt,at,It;Fe&&(at={overflowY:"scroll",maxHeight:ue.y}),Se&&(gt={overflowX:"auto"},Fe||(at={overflowY:"hidden"}),It={width:ue.x===!0?"auto":ue.x,minWidth:"100%"});var ht=O.useCallback(function(on,un){hi(function(Ln){var ti=new Map(Ln);return ti.set(on,un),ti})},[]),Tt=q(null),Rt=Object(x.a)(Tt,2),Zt=Rt[0],pn=Rt[1];function qt(on,un){if(!un)return;typeof un=="function"?un(on):un.scrollLeft!==on&&(un.scrollLeft=on)}var Kt=function(un){var Ln=un.currentTarget,ti=un.scrollLeft,mi=typeof ti=="number"?ti:Ln.scrollLeft,Ei=Ln||Nt;if(!pn()||pn()===Ei){var wi;Zt(Ei),qt(mi,Un.current),qt(mi,On.current),qt(mi,(wi=We.current)===null||wi===void 0?void 0:wi.setScrollLeft)}if(Ln){var Li=Ln.scrollWidth,Ri=Ln.clientWidth;In(mi>0),Nn(mi<Li-Ri)}},Tn=function(){On.current&&Kt({currentTarget:On.current})},an=function(un){var Ln=un.width;Tn(),_t(dn.current?dn.current.offsetWidth:Ln)};O.useEffect(function(){return Tn},[]),O.useEffect(function(){Se&&Tn()},[Se]),O.useEffect(function(){Ze===Wt&&Me&&(Me.body.current=On.current)});var Yn=wt(["table"],"table"),ai=O.useMemo(function(){return $||(He?ue.x==="max-content"?"auto":"fixed":Fe||Et.some(function(on){var un=on.ellipsis;return un})?"fixed":"auto")},[Fe,He,Et,$]),pi,li={colWidths:ye,columCount:Et.length,stickyOffsets:Te,onHeaderRow:St,fixHeader:Fe},yi=O.useMemo(function(){return rt?null:typeof Xt=="function"?Xt():Xt},[rt,Xt]),xi=O.createElement(_e,{data:me,measureColumnWidth:Fe||Se||Xe,expandedKeys:N,rowExpandable:Dt,getRowKey:jt,onRow:Pt,emptyNode:yi,childrenColumnName:En}),ki=O.createElement(c,{colWidths:Et.map(function(on){var un=on.width;return un}),columns:Et}),Gi=Pe&&O.createElement(Ve.b,null,Pe(me)),Ui=wt(["body"]);if(Fe||Xe){var Ni;typeof Ui=="function"?(Ni=Ui(me,{scrollbarSize:Ot,ref:On,onScroll:Kt}),li.colWidths=Et.map(function(on,un){var Ln=on.width,ti=un===Vt.length-1?Ln-Ot:Ln;return typeof ti=="number"&&!Number.isNaN(ti)?ti:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Ni=O.createElement("div",{style:Object(H.a)(Object(H.a)({},gt),at),onScroll:Kt,ref:On,className:h()("".concat(tt,"-body"))},O.createElement(Yn,{style:Object(H.a)(Object(H.a)({},It),{},{tableLayout:ai})},ki,xi,Gi),Xe&&O.createElement(mt,{ref:We,offsetScroll:pt,scrollBodyRef:On,onScroll:Kt})),pi=O.createElement(O.Fragment,null,bt!==!1&&O.createElement(b,Object.assign({noData:!me.length},li,Yt,{direction:Q,offsetHeader:ft,stickyClassName:$e,ref:Un,onScroll:Kt})),Ni)}else pi=O.createElement("div",{style:Object(H.a)(Object(H.a)({},gt),at),className:h()("".concat(tt,"-content")),onScroll:Kt,ref:On},O.createElement(Yn,{style:Object(H.a)(Object(H.a)({},It),{},{tableLayout:ai})},ki,bt!==!1&&O.createElement(l,Object.assign({},li,Yt)),xi,Gi));var Vi=Object(d.b)(Re),Ii=O.createElement("div",Object.assign({className:h()(tt,dt,(je={},Object(te.a)(je,"".concat(tt,"-rtl"),Q==="rtl"),Object(te.a)(je,"".concat(tt,"-ping-left"),Jt),Object(te.a)(je,"".concat(tt,"-ping-right"),Pn),Object(te.a)(je,"".concat(tt,"-layout-fixed"),$==="fixed"),Object(te.a)(je,"".concat(tt,"-fixed-header"),Fe),Object(te.a)(je,"".concat(tt,"-fixed-column"),He),Object(te.a)(je,"".concat(tt,"-scroll-horizontal"),Se),Object(te.a)(je,"".concat(tt,"-has-fix-left"),Et[0]&&Et[0].fixed),Object(te.a)(je,"".concat(tt,"-has-fix-right"),Et[Et.length-1]&&Et[Et.length-1].fixed==="right"),je)),style:ot,id:Ge,ref:dn},Vi),O.createElement(Lt,{pingLeft:Jt,pingRight:Pn,props:Object(H.a)(Object(H.a)({},Re),{},{stickyOffsets:Te,mergedExpandedKeys:N})},re&&O.createElement(Ae,{className:"".concat(tt,"-title")},re(me)),O.createElement("div",{className:"".concat(tt,"-container")},pi),fe&&O.createElement(Ae,{className:"".concat(tt,"-footer")},fe(me))));Se&&(Ii=O.createElement(m.a,{onResize:an},Ii));var Zi=O.useMemo(function(){return{prefixCls:tt,getComponent:wt,scrollbarSize:Ot,direction:Q,fixedInfoList:Et.map(function(on,un){return o(un,un,Et,Te,Q)}),isSticky:Xe}},[tt,wt,Ot,Q,Et,Te,Q,Xe]),Fi=O.useMemo(function(){return Object(H.a)(Object(H.a)({},Yt),{},{tableLayout:ai,rowClassName:ke,expandedRowClassName:cn,componentWidth:ze,fixHeader:Fe,fixColumn:He,horizonScroll:Se,expandIcon:gn,expandableType:sn,expandRowByClick:rn,expandedRowRender:ni,onTriggerExpand:V,expandIconColumnIndex:$t,indentSize:Dn})},[Yt,ai,ke,cn,ze,Fe,He,Se,gn,sn,rn,ni,V,$t,Dn]),zi=O.useMemo(function(){return{onColumnResize:ht}},[ht]);return O.createElement(i.a.Provider,{value:Zi},O.createElement(R.Provider,{value:Fi},O.createElement(z.Provider,{value:zi},Ii)))}Gt.Column=t.a,Gt.ColumnGroup=r.a,Gt.Summary=Ve.a,Gt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Ut=Qe.b=Gt},wRmb:function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return w});var te=G("rePB"),H=G("KQm4"),L=G("VTBJ"),W=G("Ff2n"),x=G("q1tI"),O=G.n(x),j=G("Kwbf"),h=G("Zm9Q"),D=G("hW8S");function w(t){return Object(h.a)(t).filter(function(n){return x.isValidElement(n)}).map(function(n){var s=n.key,e=n.props,i=e.children,o=Object(W.a)(e,["children"]),S=Object(L.a)({key:s},o);return i&&(S.children=w(i)),S})}function g(t){return t.reduce(function(n,s){var e=s.fixed,i=e===!0?"left":e,o=s.children;return o&&o.length>0?[].concat(Object(H.a)(n),Object(H.a)(g(o).map(function(S){return Object(L.a)({fixed:i},S)}))):[].concat(Object(H.a)(n),[Object(L.a)(Object(L.a)({},s),{},{fixed:i})])},[])}function m(t){for(var n=!0,s=0;s<t.length;s+=1){var e=t[s];if(n&&e.fixed!=="left")n=!1;else if(!n&&e.fixed==="left"){Object(j.a)(!1,"Index ".concat(s-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,o=t.length-1;o>=0;o-=1){var S=t[o];if(i&&S.fixed!=="right")i=!1;else if(!i&&S.fixed==="right"){Object(j.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function u(t){return t.map(function(n){var s=n.fixed,e=Object(W.a)(n,["fixed"]),i=s;return s==="left"?i="right":s==="right"&&(i="left"),Object(L.a)({fixed:i},e)})}function r(t,n){var s=t.prefixCls,e=t.columns,i=t.children,o=t.expandable,S=t.expandedKeys,E=t.getRowKey,y=t.onTriggerExpand,T=t.expandIcon,_=t.rowExpandable,l=t.expandIconColumnIndex,d=t.direction,a=t.expandRowByClick,c=x.useMemo(function(){return e||w(i)},[e,i]),v=x.useMemo(function(){if(o){var I,R=l||0,P=c[R],M=(I={},Object(te.a)(I,D.a,{className:"".concat(s,"-expand-icon-col")}),Object(te.a)(I,"title",""),Object(te.a)(I,"fixed",P?P.fixed:null),Object(te.a)(I,"className","".concat(s,"-row-expand-icon-cell")),Object(te.a)(I,"render",function(B,z,Z){var ae=E(z,Z),De=S.has(ae),_e=_?_(z):!0,Oe=T({prefixCls:s,expanded:De,expandable:_e,record:z,onExpand:y});return a?x.createElement("span",{onClick:function(Ue){return Ue.stopPropagation()}},Oe):Oe}),I),F=c.slice();return R>=0&&F.splice(R,0,M),F}return c},[o,c,E,S,T,d]),f=x.useMemo(function(){var I=v;return n&&(I=n(I)),I.length||(I=[{render:function(){return null}}]),I},[n,v,d]),b=x.useMemo(function(){return d==="rtl"?u(g(f)):g(f)},[f,d]);return[f,b]}Qe.b=r},"y0+3":function(zt,Qe,G){"use strict";G.d(Qe,"a",function(){return g}),G.d(Qe,"b",function(){return u});var te=/margin|padding|width|height|max|min|offset/,H={left:!0,top:!0},L={cssFloat:1,styleFloat:1,float:1};function W(r){return r.nodeType===1?r.ownerDocument.defaultView.getComputedStyle(r,null):{}}function x(r,t,n){if(t=t.toLowerCase(),n==="auto"){if(t==="height")return r.offsetHeight;if(t==="width")return r.offsetWidth}return t in H||(H[t]=te.test(t)),H[t]?parseFloat(n)||0:n}function O(r,t){var n=arguments.length,s=W(r);return t=L[t]?"cssFloat"in r.style?"cssFloat":"styleFloat":t,n===1?s:x(r,t,s[t]||r.style[t])}function j(r,t,n){var s=arguments.length;if(t=L[t]?"cssFloat"in r.style?"cssFloat":"styleFloat":t,s===3)return typeof n=="number"&&te.test(t)&&(n="".concat(n,"px")),r.style[t]=n,n;for(var e in t)t.hasOwnProperty(e)&&j(r,e,t[e]);return W(r)}function h(r){return r===document.body?document.documentElement.clientWidth:r.offsetWidth}function D(r){return r===document.body?window.innerHeight||document.documentElement.clientHeight:r.offsetHeight}function w(){var r=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:r,height:t}}function g(){var r=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:r,height:t}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function u(r){var t=r.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}}}]);
|