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

441 lines
1.1 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[195,6,7,8],{"+ua5":function(We,ce,F){},"+vTd":function(We,ce,F){We.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(We,ce,F){We.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"/cxE":function(We,ce,F){"use strict";F.d(ce,"f",function(){return ye}),F.d(ce,"g",function(){return ge}),F.d(ce,"h",function(){return ne}),F.d(ce,"e",function(){return O}),F.d(ce,"b",function(){return W}),F.d(ce,"c",function(){return e}),F.d(ce,"d",function(){return k}),F.d(ce,"a",function(){return L});class me{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(I){setTimeout(()=>{throw I.stack?new Error(I.message+`
`+I.stack):I},0)}}emit(I){this.listeners.forEach(u=>{u(I)})}onUnexpectedError(I){this.unexpectedErrorHandler(I),this.emit(I)}onUnexpectedExternalError(I){this.unexpectedErrorHandler(I)}}const be=new me;function ye(I){O(I)||be.onUnexpectedError(I);return}function ge(I){O(I)||be.onUnexpectedExternalError(I);return}function ne(I){if(I instanceof Error){let{name:u,message:m}=I;const i=I.stacktrace||I.stack;return{$isError:!0,name:u,message:m,stack:i}}return I}const G="Canceled";function O(I){return I instanceof Error&&I.name===G&&I.message===G}function W(){const I=new Error(G);return I.name=I.message,I}function e(I){return I?new Error(`Illegal argument: ${I}`):new Error("Illegal argument")}function k(I){return I?new Error(`Illegal state: ${I}`):new Error("Illegal state")}class L extends Error{constructor(I){super("NotSupported");I&&(this.message=I)}}},"0pdE":function(We,ce,F){"use strict";var me=F("yuO0"),be=F("XjgL"),ye=F("fNpE"),ge=F("6ASS"),ne=F("eA01"),G=F("fXDJ"),O=F("fhFH"),W=F("BPTR"),e=F("udol"),k=F("27eb"),L=F.n(k),I=F("E0BR"),u=F("T/Jt"),m=F("c27x"),i=function(l){for(var T=l.prefixCls,y=l.level,_=l.isStart,v=l.isEnd,n="".concat(T,"-indent-unit"),a=[],r=0;r<y;r+=1){var t;a.push(u.createElement("span",{key:r,className:L()(n,(t={},Object(be.a)(t,"".concat(n,"-start"),_[r]),Object(be.a)(t,"".concat(n,"-end"),v[r]),t))}))}return u.createElement("span",{"aria-hidden":"true",className:"".concat(T,"-indent")},a)},g=u.memo(i),w=F("El5i"),x=F("rgEC"),E=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],o="open",f="close",d="---",A=function(C){Object(W.a)(T,C);var l=Object(e.a)(T);function T(){var y;Object(ne.a)(this,T);for(var _=arguments.length,v=new Array(_),n=0;n<_;n++)v[n]=arguments[n];return y=l.call.apply(l,[this].concat(v)),y.state={dragNodeHighlight:!1},y.selectHandle=void 0,y.cacheIndent=void 0,y.onSelectorClick=function(a){var r=y.props.context.onNodeClick;r(a,Object(x.b)(y.props)),y.isSelectable()?y.onSelect(a):y.onCheck(a)},y.onSelectorDoubleClick=function(a){var r=y.props.context.onNodeDoubleClick;r(a,Object(x.b)(y.props))},y.onSelect=function(a){if(y.isDisabled())return;var r=y.props.context.onNodeSelect;r(a,Object(x.b)(y.props))},y.onCheck=function(a){if(y.isDisabled())return;var r=y.props,t=r.disableCheckbox,c=r.checked,b=y.props.context.onNodeCheck;if(!y.isCheckable()||t)return;var h=!c;b(a,Object(x.b)(y.props),h)},y.onMouseEnter=function(a){var r=y.props.context.onNodeMouseEnter;r(a,Object(x.b)(y.props))},y.onMouseLeave=function(a){var r=y.props.context.onNodeMouseLeave;r(a,Object(x.b)(y.props))},y.onContextMenu=function(a){var r=y.props.context.onNodeContextMenu;r(a,Object(x.b)(y.props))},y.onDragStart=function(a){var r=y.props.context.onNodeDragStart;a.stopPropagation(),y.setState({dragNodeHighlight:!0}),r(a,Object(O.a)(y));try{a.dataTransfer.setData("text/plain","")}catch(t){}},y.onDragEnter=function(a){var r=y.props.context.onNodeDragEnter;a.preventDefault(),a.stopPropagation(),r(a,Object(O.a)(y))},y.onDragOver=function(a){var r=y.props.context.onNodeDragOver;a.preventDefault(),a.stopPropagation(),r(a,Object(O.a)(y))},y.onDragLeave=function(a){var r=y.props.context.onNodeDragLeave;a.stopPropagation(),r(a,Object(O.a)(y))},y.onDragEnd=function(a){var r=y.props.context.onNodeDragEnd;a.stopPropagation(),y.setState({dragNodeHighlight:!1}),r(a,Object(O.a)(y))},y.onDrop=function(a){var r=y.props.context.onNodeDrop;a.preventDefault(),a.stopPropagation(),y.setState({dragNodeHighlight:!1}),r(a,Object(O.a)(y))},y.onExpand=function(a){var r=y.props,t=r.loading,c=r.context.onNodeExpand;if(t)return;c(a,Object(x.b)(y.props))},y.setSelectHandle=function(a){y.selectHandle=a},y.getNodeState=function(){var a=y.props.expanded;return y.isLeaf()?null:a?o:f},y.hasChildren=function(){var a=y.props.eventKey,r=y.props.context.keyEntities,t=Object(w.a)(r,a)||{},c=t.children;return!!(c||[]).length},y.isLeaf=function(){var a=y.props,r=a.isLeaf,t=a.loaded,c=y.props.context.loadData,b=y.hasChildren();return r===!1?!1:r||!c&&!b||c&&t&&!b},y.isDisabled=function(){var a=y.props.disabled,r=y.props.context.disabled;return!!(r||a)},y.isCheckable=function(){var a=y.props.checkable,r=y.props.context.checkable;return!r||a===!1?!1:r},y.syncLoadData=function(a){var r=a.expanded,t=a.loading,c=a.loaded,b=y.props.context,h=b.loadData,D=b.onNodeLoad;if(t)return;h&&r&&!y.isLeaf()&&(!y.hasChildren()&&!c&&D(Object(x.b)(y.props)))},y.isDraggable=function(){var a=y.props,r=a.data,t=a.context.draggable;return!!(t&&(!t.nodeDraggable||t.nodeDraggable(r)))},y.renderDragHandler=function(){var a=y.props.context,r=a.draggable,t=a.prefixCls;return(r==null?void 0:r.icon)?u.createElement("span",{className:"".concat(t,"-draggable-icon")},r.icon):null},y.renderSwitcherIconDom=function(a){var r=y.props.switcherIcon,t=y.props.context.switcherIcon,c=r||t;return typeof c=="function"?c(Object(ge.a)(Object(ge.a)({},y.props),{},{isLeaf:a})):c},y.renderSwitcher=function(){var a=y.props.expanded,r=y.props.context.prefixCls;if(y.isLeaf()){var t=y.renderSwitcherIconDom(!0);return t!==!1?u.createElement("span",{className:L()("".concat(r,"-switcher"),"".concat(r,"-switcher-noop"))},t):null}var c=L()("".concat(r,"-switcher"),"".concat(r,"-switcher_").concat(a?o:f)),b=y.renderSwitcherIconDom(!1);return b!==!1?u.createElement("span",{onClick:y.onExpand,className:c},b):null},y.renderCheckbox=function(){var a=y.props,r=a.checked,t=a.halfChecked,c=a.disableCheckbox,b=y.props.context.prefixCls,h=y.isDisabled(),D=y.isCheckable();if(!D)return null;var P=typeof D!="boolean"?D:null;return u.createElement("span",{className:L()("".concat(b,"-checkbox"),r&&"".concat(b,"-checkbox-checked"),!r&&t&&"".concat(b,"-checkbox-indeterminate"),(h||c)&&"".concat(b,"-checkbox-disabled")),onClick:y.onCheck},P)},y.renderIcon=function(){var a=y.props.loading,r=y.props.context.prefixCls;return u.createElement("span",{className:L()("".concat(r,"-iconEle"),"".concat(r,"-icon__").concat(y.getNodeState()||"docu"),a&&"".concat(r,"-icon_loading"))})},y.renderSelector=function(){var a=y.state.dragNodeHighlight,r=y.props,t=r.title,c=t===void 0?d:t,b=r.selected,h=r.icon,D=r.loading,P=r.data,j=y.props.context,N=j.prefixCls,H=j.showIcon,z=j.icon,J=j.loadData,Y=j.titleRender,le=y.isDisabled(),te="".concat(N,"-node-content-wrapper"),Z;if(H){var _e=h||z;Z=_e?u.createElement("span",{className:L()("".concat(N,"-iconEle"),"".concat(N,"-icon__customize"))},typeof _e=="function"?_e(y.props):_e):y.renderIcon()}else J&&D&&(Z=y.renderIcon());var we;typeof c=="function"?we=c(P):Y?we=Y(P):we=c;var De=u.createElement("span",{className:"".concat(N,"-title")},we);return u.createElement("span",{ref:y.setSelectHandle,title:typeof c=="string"?c:"",className:L()("".concat(te),"".concat(te,"-").concat(y.getNodeState()||"normal"),!le&&(b||a)&&"".concat(N,"-node-selected")),onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,onContextMenu:y.onContextMenu,onClick:y.onSelectorClick,onDoubleClick:y.onSelectorDoubleClick},Z,De,y.renderDropIndicator())},y.renderDropIndicator=function(){var a=y.props,r=a.disabled,t=a.eventKey,c=y.props.context,b=c.draggable,h=c.dropLevelOffset,D=c.dropPosition,P=c.prefixCls,j=c.indent,N=c.dropIndicatorRender,H=c.dragOverNodeKey,z=c.direction,J=!!b,Y=!r&&J&&H===t,le=j!=null?j:y.cacheIndent;return y.cacheIndent=j,Y?N({dropPosition:D,dropLevelOffset:h,indent:le,prefixCls:P,direction:z}):null},y}return Object(G.a)(T,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,v=this.props.context.selectable;return typeof _=="boolean"?_:v}},{key:"render",value:function(){var _,v=this.props,n=v.eventKey,a=v.className,r=v.style,t=v.dragOver,c=v.dragOverGapTop,b=v.dragOverGapBottom,h=v.isLeaf,D=v.isStart,P=v.isEnd,j=v.expanded,N=v.selected,H=v.checked,z=v.halfChecked,J=v.loading,Y=v.domRef,le=v.active,te=v.data,Z=v.onMouseMove,_e=v.selectable,we=Object(ye.a)(v,E),De=this.props.context,Ee=De.prefixCls,xe=De.filterTreeNode,ve=De.keyEntities,X=De.dropContainerKey,Ae=De.dropTargetKey,Q=De.draggingNodeKey,ue=this.isDisabled(),ee=Object(I.a)(we,{aria:!0,data:!0}),ae=Object(w.a)(ve,n)||{},fe=ae.level,Re=P[P.length-1],pe=this.isDraggable(),ie=!ue&&pe,Ie=Q===n,Oe=_e!==void 0?{"aria-selected":!!_e}:void 0;return u.createElement("div",Object(me.a)({ref:Y,className:L()(a,"".concat(Ee,"-treenode"),(_={},Object(be.a)(_,"".concat(Ee,"-treenode-disabled"),ue),Object(be.a)(_,"".concat(Ee,"-treenode-switcher-").concat(j?"open":"close"),!h),Object(be.a)(_,"".concat(Ee,"-treenode-checkbox-checked"),H),Object(be.a)(_,"".concat(Ee,"-treenode-checkbox-indeterminate"),z),Object(be.a)(_,"".concat(Ee,"-treenode-selected"),N),Object(be.a)(_,"".concat(Ee,"-treenode-loading"),J),Object(be.a)(_,"".concat(Ee,"-treenode-active"),le),Object(be.a)(_,"".concat(Ee,"-treenode-leaf-last"),Re),Object(be.a)(_,"".concat(Ee,"-treenode-draggable"),pe),Object(be.a)(_,"dragging",Ie),Object(be.a)(_,"drop-target",Ae===n),Object(be.a)(_,"drop-container",X===n),Object(be.a)(_,"drag-over",!ue&&t),Object(be.a)(_,"drag-over-gap-top",!ue&&c),Object(be.a)(_,"drag-over-gap-bottom",!ue&&b),Object(be.a)(_,"filter-node",xe&&xe(Object(x.b)(this.props))),_)),style:r,draggable:ie,"aria-grabbed":Ie,onDragStart:ie?this.onDragStart:void 0,onDragEnter:pe?this.onDragEnter:void 0,onDragOver:pe?this.onDragOver:void 0,onDragLeave:pe?this.onDragLeave:void 0,onDrop:pe?this.onDrop:void 0,onDragEnd:pe?this.onDragEnd:void 0,onMouseMove:Z},Oe,ee),u.createElement(g,{prefixCls:Ee,level:fe,isStart:D,isEnd:P}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),T}(u.Component),s=function(l){return u.createElement(m.a.Consumer,null,function(T){return u.createElement(A,Object(me.a)({},l,{context:T}))})};s.displayName="TreeNode",s.isTreeNode=1;var p=ce.a=s},"1vnw":function(We,ce,F){We.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(We,ce,F){"use strict";F.d(ce,"a",function(){return be});class me{constructor(ye){this.element=ye,this.next=me.Undefined,this.prev=me.Undefined}}me.Undefined=new me(void 0);class be{constructor(){this._first=me.Undefined,this._last=me.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===me.Undefined}clear(){let ye=this._first;for(;ye!==me.Undefined;){const ge=ye.next;ye.prev=me.Undefined,ye.next=me.Undefined,ye=ge}this._first=me.Undefined,this._last=me.Undefined,this._size=0}unshift(ye){return this._insert(ye,!1)}push(ye){return this._insert(ye,!0)}_insert(ye,ge){const ne=new me(ye);if(this._first===me.Undefined)this._first=ne,this._last=ne;else if(ge){const O=this._last;this._last=ne,ne.prev=O,O.next=ne}else{const O=this._first;this._first=ne,ne.next=O,O.prev=ne}this._size+=1;let G=!1;return()=>{G||(G=!0,this._remove(ne))}}shift(){if(this._first===me.Undefined)return;{const ye=this._first.element;return this._remove(this._first),ye}}pop(){if(this._last===me.Undefined)return;{const ye=this._last.element;return this._remove(this._last),ye}}_remove(ye){if(ye.prev!==me.Undefined&&ye.next!==me.Undefined){const ge=ye.prev;ge.next=ye.next,ye.next.prev=ge}else ye.prev===me.Undefined&&ye.next===me.Undefined?(this._first=me.Undefined,this._last=me.Undefined):ye.next===me.Undefined?(this._last=this._last.prev,this._last.next=me.Undefined):ye.prev===me.Undefined&&(this._first=this._first.next,this._first.prev=me.Undefined);this._size-=1}*[Symbol.iterator](){let ye=this._first;for(;ye!==me.Undefined;)yield ye.element,ye=ye.next}}},"3/fG":function(We,ce,F){"use strict";F.d(ce,"a",function(){return be});function me(ye,ge){let ne;return ge.length===0?ne=ye:ne=ye.replace(/\{(\d+)\}/g,function(G,O){const W=O[0];return typeof ge[W]!="undefined"?ge[W]:G}),ne}function be(ye,ge,...ne){return me(ge,ne)}},"5VLF":function(We,ce,F){"use strict";var me,be;function ye(ge,ne,G){var O=function(W,e){return ge.js_beautify(W,e)};return O.js=ge.js_beautify,O.css=ne.css_beautify,O.html=G.html_beautify,O.js_beautify=ge.js_beautify,O.css_beautify=ne.css_beautify,O.html_beautify=G.html_beautify,O}!(me=[F("6UM0"),F("TXwP"),F("psGv")],be=function(ge,ne,G){return ye(ge,ne,G)}.apply(ce,me),be!==void 0&&(We.exports=be))},"5Y4S":function(We,ce,F){"use strict";F.d(ce,"a",function(){return ye});var me=F("MNsG");const be=me.b.performance&&typeof me.b.performance.now=="function";class ye{constructor(ge){this._highResolution=be&&ge,this._startTime=this._now(),this._stopTime=-1}static create(ge=!0){return new ye(ge)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?me.b.performance.now():Date.now()}}},"6UM0":function(We,ce,F){var me,be;(function(){var ye;(function(){"use strict";var ne=[function(e,k,L){var I=L(1).Beautifier,u=L(5).Options;function m(i,g){var w=new I(i,g);return w.beautify()}e.exports=m,e.exports.defaultOptions=function(){return new u}},function(e,k,L){var I=L(2).Output,u=L(3).Token,m=L(4),i=L(5).Options,g=L(7).Tokenizer,w=L(7).line_starters,x=L(7).positionable_operators,E=L(7).TOKEN;function o(h,D){return D.indexOf(h)!==-1}function f(h){return h.replace(/^\s+/g,"")}function d(h){for(var D={},P=0;P<h.length;P++)D[h[P].replace(/-/g,"_")]=h[P];return D}function A(h,D){return h&&h.type===E.RESERVED&&h.text===D}function s(h,D){return h&&h.type===E.RESERVED&&o(h.text,D)}var p=["case","return","do","if","throw","else","await","break","continue","async"],C=["before-newline","after-newline","preserve-newline"],l=d(C),T=[l.before_newline,l.preserve_newline],y={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(h,D){if(D.multiline_frame||D.mode===y.ForInitializer||D.mode===y.Conditional)return;h.remove_indent(D.start_line_index)}function v(h){h=h.replace(m.allLineBreaks,`
`);for(var D=[],P=h.indexOf(`
`);P!==-1;)D.push(h.substring(0,P)),h=h.substring(P+1),P=h.indexOf(`
`);return h.length&&D.push(h),D}function n(h){return h===y.ArrayLiteral}function a(h){return o(h,[y.Expression,y.ForInitializer,y.Conditional])}function r(h,D){for(var P=0;P<h.length;P++){var j=h[P].trim();if(j.charAt(0)!==D)return!1}return!0}function t(h,D){for(var P=0,j=h.length,N;P<j;P++)if(N=h[P],N&&N.indexOf(D)!==0)return!1;return!0}function c(h,D){D=D||{},this._source_text=h||"",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 i(D)}c.prototype.create_flags=function(h,D){var P=0;h&&(P=h.indentation_level,!this._output.just_added_newline()&&h.line_indent_level>P&&(P=h.line_indent_level));var j={mode:D,parent:h,last_token:h?h.last_token:new u(E.START_BLOCK,""),last_word:h?h.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:P,alignment:0,line_indent_level:h?h.line_indent_level:P,start_line_index:this._output.get_line_number(),ternary_depth:0};return j},c.prototype._reset=function(h){var D=h.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new I(this._options,D),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(y.BlockStatement);var P=new g(h,this._options);return this._tokens=P.tokenize(),h},c.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var h,D=this._reset(this._source_text),P=this._options.eol;this._options.eol==="auto"&&(P=`
`,D&&m.lineBreak.test(D||"")&&(P=D.match(m.lineBreak)[0]));for(var j=this._tokens.next();j;)this.handle_token(j),this._last_last_text=this._flags.last_token.text,this._flags.last_token=j,j=this._tokens.next();return h=this._output.get_code(P),h},c.prototype.handle_token=function(h,D){h.type===E.START_EXPR?this.handle_start_expr(h):h.type===E.END_EXPR?this.handle_end_expr(h):h.type===E.START_BLOCK?this.handle_start_block(h):h.type===E.END_BLOCK?this.handle_end_block(h):h.type===E.WORD?this.handle_word(h):h.type===E.RESERVED?this.handle_word(h):h.type===E.SEMICOLON?this.handle_semicolon(h):h.type===E.STRING?this.handle_string(h):h.type===E.EQUALS?this.handle_equals(h):h.type===E.OPERATOR?this.handle_operator(h):h.type===E.COMMA?this.handle_comma(h):h.type===E.BLOCK_COMMENT?this.handle_block_comment(h,D):h.type===E.COMMENT?this.handle_comment(h,D):h.type===E.DOT?this.handle_dot(h):h.type===E.EOF?this.handle_eof(h):h.type===E.UNKNOWN?this.handle_unknown(h,D):this.handle_unknown(h,D)},c.prototype.handle_whitespace_and_comments=function(h,D){var P=h.newlines,j=this._options.keep_array_indentation&&n(this._flags.mode);if(h.comments_before)for(var N=h.comments_before.next();N;)this.handle_whitespace_and_comments(N,D),this.handle_token(N,D),N=h.comments_before.next();if(j)for(var H=0;H<P;H+=1)this.print_newline(H>0,D);else if(this._options.max_preserve_newlines&&P>this._options.max_preserve_newlines&&(P=this._options.max_preserve_newlines),this._options.preserve_newlines&&P>1){this.print_newline(!1,D);for(var z=1;z<P;z+=1)this.print_newline(!0,D)}};var b=["async","break","continue","return","throw","yield"];c.prototype.allow_wrap_or_preserved_newline=function(h,D){if(D=D===void 0?!1:D,this._output.just_added_newline())return;var P=this._options.preserve_newlines&&h.newlines||D,j=o(this._flags.last_token.text,x)||o(h.text,x);if(j){var N=o(this._flags.last_token.text,x)&&o(this._options.operator_position,T)||o(h.text,x);P=P&&N}if(P)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(s(this._flags.last_token,b))return;this._output.set_wrap_point()}},c.prototype.print_newline=function(h,D){if(!D&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==E.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var P=this._tokens.peek();this._flags.mode===y.Statement&&!(this._flags.if_block&&A(P,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(h)&&(this._flags.multiline_frame=!0)},c.prototype.print_token_line_indentation=function(h){this._output.just_added_newline()&&(this._options.keep_array_indentation&&h.newlines&&(h.text==="["||n(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(h.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))},c.prototype.print_token=function(h){if(this._output.raw){this._output.add_raw_token(h);return}if(this._options.comma_first&&h.previous&&h.previous.type===E.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var D=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(D),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(h),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(h),this._output.non_breaking_space=!0,this._output.add_token(h.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},c.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},c.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))},c.prototype.set_mode=function(h){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,h),this._flags=this.create_flags(this._previous_flags,h),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},c.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===y.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},c.prototype.start_of_object_property=function(){return this._flags.parent.mode===y.ObjectLiteral&&this._flags.mode===y.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||s(this._flags.last_token,["get","set"]))},c.prototype.start_of_statement=function(h){var D=!1;return D=D||s(this._flags.last_token,["var","let","const"])&&h.type===E.WORD,D=D||A(this._flags.last_token,"do"),D=D||!(this._flags.parent.mode===y.ObjectLiteral&&this._flags.mode===y.Statement)&&s(this._flags.last_token,b)&&!h.newlines,D=D||A(this._flags.last_token,"else")&&!(A(h,"if")&&!h.comments_before),D=D||this._flags.last_token.type===E.END_EXPR&&(this._previous_flags.mode===y.ForInitializer||this._previous_flags.mode===y.Conditional),D=D||this._flags.last_token.type===E.WORD&&this._flags.mode===y.BlockStatement&&!this._flags.in_case&&!(h.text==="--"||h.text==="++")&&this._last_last_text!=="function"&&h.type!==E.WORD&&h.type!==E.RESERVED,D=D||this._flags.mode===y.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||s(this._flags.last_token,["get","set"])),D?(this.set_mode(y.Statement),this.indent(),this.handle_whitespace_and_comments(h,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(h,s(h,["do","for","if","while"])),!0):!1},c.prototype.handle_start_expr=function(h){this.start_of_statement(h)||this.handle_whitespace_and_comments(h);var D=y.Expression;if(h.text==="["){if(this._flags.last_token.type===E.WORD||this._flags.last_token.text===")"){s(this._flags.last_token,w)&&(this._output.space_before_token=!0),this.print_token(h),this.set_mode(D),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}D=y.ArrayLiteral,n(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,[E.START_EXPR,E.END_EXPR,E.WORD,E.OPERATOR,E.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===E.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,D=y.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,D=y.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&h.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,w)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===E.EQUALS||this._flags.last_token.type===E.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(h);else if(this._flags.last_token.type===E.WORD){this._output.space_before_token=!1;var P=this._tokens.peek(-3);if(this._options.space_after_named_function&&P){var j=this._tokens.peek(-4);s(P,["async","function"])||P.text==="*"&&s(j,["async","function"])?this._output.space_before_token=!0:this._flags.mode===y.ObjectLiteral?(P.text==="{"||P.text===","||P.text==="*"&&(j.text==="{"||j.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(h);(this._flags.last_token.type===E.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===y.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===E.START_BLOCK?this.print_newline():(this._flags.last_token.type===E.END_EXPR||this._flags.last_token.type===E.START_EXPR||this._flags.last_token.type===E.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===E.COMMA)&&this.allow_wrap_or_preserved_newline(h,h.newlines),this.print_token(h),this.set_mode(D),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},c.prototype.handle_end_expr=function(h){for(;this._flags.mode===y.Statement;)this.restore_mode();this.handle_whitespace_and_comments(h),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(h,h.text==="]"&&n(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===E.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(h),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===y.Conditional&&(this._previous_flags.mode=y.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},c.prototype.handle_start_block=function(h){this.handle_whitespace_and_comments(h);var D=this._tokens.peek(),P=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===E.END_EXPR?(this.set_mode(y.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(y.BlockStatement):P&&(o(P.text,[":",","])&&o(D.type,[E.STRING,E.WORD,E.RESERVED])||o(D.text,["get","set","..."])&&o(P.type,[E.WORD,E.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(P.text,[":",","])?this.set_mode(y.BlockStatement):this.set_mode(y.ObjectLiteral):this._flags.last_token.type===E.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(y.BlockStatement):o(this._flags.last_token.type,[E.EQUALS,E.START_EXPR,E.COMMA,E.OPERATOR])||s(this._flags.last_token,["return","throw","import","default"])?this.set_mode(y.ObjectLiteral):this.set_mode(y.BlockStatement),this._flags.last_token&&(s(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var j=!D.comments_before&&D.text==="}",N=j&&this._flags.last_word==="function"&&this._flags.last_token.type===E.END_EXPR;if(this._options.brace_preserve_inline){var H=0,z=null;this._flags.inline_frame=!0;do if(H+=1,z=this._tokens.peek(H-1),z.newlines){this._flags.inline_frame=!1;break}while(z.type!==E.EOF&&!(z.type===E.END_BLOCK&&z.opened===h))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&h.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==E.OPERATOR&&(N||this._flags.last_token.type===E.EQUALS||s(this._flags.last_token,p)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(n(this._previous_flags.mode)&&(this._flags.last_token.type===E.START_EXPR||this._flags.last_token.type===E.COMMA)&&((this._flags.last_token.type===E.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===E.COMMA||this._flags.last_token.type===E.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(h),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==E.OPERATOR&&this._flags.last_token.type!==E.START_EXPR&&(this._flags.last_token.type===E.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(h),this.indent(),!j&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},c.prototype.handle_end_block=function(h){for(this.handle_whitespace_and_comments(h);this._flags.mode===y.Statement;)this.restore_mode();var D=this._flags.last_token.type===E.START_BLOCK;this._flags.inline_frame&&!D?this._output.space_before_token=!0:this._options.brace_style==="expand"?D||this.print_newline():D||(n(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(h)},c.prototype.handle_word=function(h){if(h.type===E.RESERVED){if(o(h.text,["set","get"])&&this._flags.mode!==y.ObjectLiteral)h.type=E.WORD;else if(h.text==="import"&&o(this._tokens.peek().text,["(","."]))h.type=E.WORD;else if(o(h.text,["as","from"])&&!this._flags.import_block)h.type=E.WORD;else if(this._flags.mode===y.ObjectLiteral){var D=this._tokens.peek();D.text===":"&&(h.type=E.WORD)}}if(this.start_of_statement(h)?s(this._flags.last_token,["var","let","const"])&&h.type===E.WORD&&(this._flags.declaration_statement=!0):h.newlines&&!a(this._flags.mode)&&(this._flags.last_token.type!==E.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==E.EQUALS&&(this._options.preserve_newlines||!s(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(h),this.print_newline()):this.handle_whitespace_and_comments(h),this._flags.do_block&&!this._flags.do_while)if(A(h,"while")){this._output.space_before_token=!0,this.print_token(h),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&&A(h,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===y.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&s(h,["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(h),this._flags.in_case=!0;return}if((this._flags.last_token.type===E.COMMA||this._flags.last_token.type===E.START_EXPR||this._flags.last_token.type===E.EQUALS||this._flags.last_token.type===E.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(h)),A(h,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===E.OPERATOR))&&(!this._output.just_added_blankline()&&!h.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===E.RESERVED||this._flags.last_token.type===E.WORD?s(this._flags.last_token,["get","set","new","export"])||s(this._flags.last_token,b)?this._output.space_before_token=!0:A(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===E.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(a(this._flags.mode)||n(this._flags.mode))||this.print_newline(),this.print_token(h),this._flags.last_word=h.text;return}var P="NONE";if(this._flags.last_token.type===E.END_BLOCK?this._previous_flags.inline_frame?P="SPACE":s(h,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&h.newlines?P="NEWLINE":(P="SPACE",this._output.space_before_token=!0):P="NEWLINE":this._flags.last_token.type===E.SEMICOLON&&this._flags.mode===y.BlockStatement?P="NEWLINE":this._flags.last_token.type===E.SEMICOLON&&a(this._flags.mode)?P="SPACE":this._flags.last_token.type===E.STRING?P="NEWLINE":this._flags.last_token.type===E.RESERVED||this._flags.last_token.type===E.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===y.ObjectLiteral&&o(this._last_last_text,["{",","]))?P="SPACE":this._flags.last_token.type===E.START_BLOCK?this._flags.inline_frame?P="SPACE":P="NEWLINE":this._flags.last_token.type===E.END_EXPR&&(this._output.space_before_token=!0,P="NEWLINE"),s(h,w)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?P="SPACE":P="NEWLINE"),s(h,["else","catch","finally"]))if((!(this._flags.last_token.type===E.END_BLOCK&&this._previous_flags.mode===y.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&h.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var j=this._output.current_line;j.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else P==="NEWLINE"?s(this._flags.last_token,p)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&s(h,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==E.END_EXPR?(this._flags.last_token.type!==E.START_EXPR||!s(h,["var","let","const"]))&&this._flags.last_token.text!==":"&&(A(h,"if")&&A(h.previous,"else")?this._output.space_before_token=!0:this.print_newline()):s(h,w)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&n(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():P==="SPACE"&&(this._output.space_before_token=!0);h.previous&&(h.previous.type===E.WORD||h.previous.type===E.RESERVED)&&(this._output.space_before_token=!0),this.print_token(h),this._flags.last_word=h.text,h.type===E.RESERVED&&(h.text==="do"?this._flags.do_block=!0:h.text==="if"?this._flags.if_block=!0:h.text==="import"?this._flags.import_block=!0:this._flags.import_block&&A(h,"from")&&(this._flags.import_block=!1))},c.prototype.handle_semicolon=function(h){this.start_of_statement(h)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(h);for(var D=this._tokens.peek();this._flags.mode===y.Statement&&!(this._flags.if_block&&A(D,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(h)},c.prototype.handle_string=function(h){h.text.startsWith("`")&&h.newlines===0&&h.whitespace_before===""&&(h.previous.text===")"||this._flags.last_token.type===E.WORD)||(this.start_of_statement(h)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(h),this._flags.last_token.type===E.RESERVED||this._flags.last_token.type===E.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===E.COMMA||this._flags.last_token.type===E.START_EXPR||this._flags.last_token.type===E.EQUALS||this._flags.last_token.type===E.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(h):h.text.startsWith("`")&&this._flags.last_token.type===E.END_EXPR&&(h.previous.text==="]"||h.previous.text===")")&&h.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(h)},c.prototype.handle_equals=function(h){this.start_of_statement(h)||this.handle_whitespace_and_comments(h),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(h),this._output.space_before_token=!0},c.prototype.handle_comma=function(h){this.handle_whitespace_and_comments(h,!0),this.print_token(h),this._output.space_before_token=!0,this._flags.declaration_statement?(a(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(h)):this._flags.mode===y.ObjectLiteral||this._flags.mode===y.Statement&&this._flags.parent.mode===y.ObjectLiteral?(this._flags.mode===y.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(h)},c.prototype.handle_operator=function(h){var D=h.text==="*"&&(s(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[E.START_BLOCK,E.COMMA,E.END_BLOCK,E.SEMICOLON])),P=o(h.text,["-","+"])&&(o(this._flags.last_token.type,[E.START_BLOCK,E.START_EXPR,E.EQUALS,E.OPERATOR])||o(this._flags.last_token.text,w)||this._flags.last_token.text===",");if(!this.start_of_statement(h)){var j=!D;this.handle_whitespace_and_comments(h,j)}if(h.text==="*"&&this._flags.last_token.type===E.DOT){this.print_token(h);return}if(h.text==="::"){this.print_token(h);return}if(this._flags.last_token.type===E.OPERATOR&&o(this._options.operator_position,T)&&this.allow_wrap_or_preserved_newline(h),h.text===":"&&this._flags.in_case){this.print_token(h),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==E.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 N=!0,H=!0,z=!1;if(h.text===":"?this._flags.ternary_depth===0?N=!1:(this._flags.ternary_depth-=1,z=!0):h.text==="?"&&(this._flags.ternary_depth+=1),!P&&!D&&this._options.preserve_newlines&&o(h.text,x)){var J=h.text===":",Y=J&&z,le=J&&!z;switch(this._options.operator_position){case l.before_newline:this._output.space_before_token=!le,this.print_token(h),(!J||Y)&&this.allow_wrap_or_preserved_newline(h),this._output.space_before_token=!0;return;case l.after_newline:this._output.space_before_token=!0,!J||Y?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(h):this._output.space_before_token=!1,this.print_token(h),this._output.space_before_token=!0;return;case l.preserve_newline:le||this.allow_wrap_or_preserved_newline(h),N=!(this._output.just_added_newline()||le),this._output.space_before_token=N,this.print_token(h),this._output.space_before_token=!0;return}}if(D){this.allow_wrap_or_preserved_newline(h),N=!1;var te=this._tokens.peek();H=te&&o(te.type,[E.WORD,E.RESERVED])}else if(h.text==="...")this.allow_wrap_or_preserved_newline(h),N=this._flags.last_token.type===E.START_BLOCK,H=!1;else if(o(h.text,["--","++","!","~"])||P){if((this._flags.last_token.type===E.COMMA||this._flags.last_token.type===E.START_EXPR)&&this.allow_wrap_or_preserved_newline(h),N=!1,H=!1,h.newlines&&(h.text==="--"||h.text==="++"||h.text==="~")){var Z=s(this._flags.last_token,p)&&h.newlines;Z&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Z,!0)}this._flags.last_token.text===";"&&a(this._flags.mode)&&(N=!0),this._flags.last_token.type===E.RESERVED?N=!0:this._flags.last_token.type===E.END_EXPR?N=!(this._flags.last_token.text==="]"&&(h.text==="--"||h.text==="++")):this._flags.last_token.type===E.OPERATOR&&(N=o(h.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(h.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(H=!0)),(this._flags.mode===y.BlockStatement&&!this._flags.inline_frame||this._flags.mode===y.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||N,this.print_token(h),this._output.space_before_token=H},c.prototype.handle_block_comment=function(h,D){if(this._output.raw){this._output.add_raw_token(h),h.directives&&h.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(h.directives){this.print_newline(!1,D),this.print_token(h),h.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!m.newline.test(h.text)&&!h.newlines){this._output.space_before_token=!0,this.print_token(h),this._output.space_before_token=!0;return}else this.print_block_commment(h,D)},c.prototype.print_block_commment=function(h,D){var P=v(h.text),j,N=!1,H=!1,z=h.whitespace_before,J=z.length;if(this.print_newline(!1,D),this.print_token_line_indentation(h),this._output.add_token(P[0]),this.print_newline(!1,D),P.length>1){for(P=P.slice(1),N=r(P,"*"),H=t(P,z),N&&(this._flags.alignment=1),j=0;j<P.length;j++)N?(this.print_token_line_indentation(h),this._output.add_token(f(P[j]))):H&&P[j]?(this.print_token_line_indentation(h),this._output.add_token(P[j].substring(J))):(this._output.current_line.set_indent(-1),this._output.add_token(P[j])),this.print_newline(!1,D);this._flags.alignment=0}},c.prototype.handle_comment=function(h,D){h.newlines?this.print_newline(!1,D):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(h),this.print_newline(!1,D)},c.prototype.handle_dot=function(h){this.start_of_statement(h)||this.handle_whitespace_and_comments(h,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),s(this._flags.last_token,p)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(h,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(h)},c.prototype.handle_unknown=function(h,D){this.print_token(h),h.text[h.text.length-1]===`
`&&this.print_newline(!1,D)},c.prototype.handle_eof=function(h){for(;this._flags.mode===y.Statement;)this.restore_mode();this.handle_whitespace_and_comments(h)},e.exports.Beautifier=c},function(e){function k(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=[]}k.prototype.clone_empty=function(){var u=new k(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},k.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},k.prototype.has_match=function(u){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(u))return!0;return!1},k.prototype.set_indent=function(u,m){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},k.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)},k.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},k.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},k.prototype.is_empty=function(){return this.__items.length===0},k.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},k.prototype.push=function(u){this.__items.push(u);var m=u.lastIndexOf(`
`);m!==-1?this.__character_count=u.length-m:this.__character_count+=u.length},k.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},k.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},k.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},k.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},k.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 L(u,m){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)),m=m||"",u.indent_level>0&&(m=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}L.prototype.get_indent_size=function(u,m){var i=this.__base_string_length;return m=m||0,u<0&&(i=0),i+=u*this.__indent_size,i+=m,i},L.prototype.get_indent_string=function(u,m){var i=this.__base_string;return m=m||0,u<0&&(u=0,i=""),m+=u*this.__indent_size,this.__ensure_cache(m),i+=this.__cache[m],i},L.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},L.prototype.__add_column=function(){var u=this.__cache.length,m=0,i="";this.__indent_size&&u>=this.__indent_size&&(m=Math.floor(u/this.__indent_size),u-=m*this.__indent_size,i=new Array(m+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function I(u,m){this.__indent_cache=new L(u,m),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 k(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}I.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},I.prototype.get_line_number=function(){return this.__lines.length},I.prototype.get_indent_string=function(u,m){return this.__indent_cache.get_indent_string(u,m)},I.prototype.get_indent_size=function(u,m){return this.__indent_cache.get_indent_size(u,m)},I.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},I.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},I.prototype.get_code=function(u){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return u!==`
`&&(i=i.replace(/[\n]/g,u)),i},I.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},I.prototype.set_indent=function(u,m){return u=u||0,m=m||0,this.next_line.set_indent(u,m),this.__lines.length>1?(this.current_line.set_indent(u,m),!0):(this.current_line.set_indent(),!1)},I.prototype.add_raw_token=function(u){for(var m=0;m<u.newlines;m++)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},I.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()},I.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(" "))},I.prototype.remove_indent=function(u){for(var m=this.__lines.length;u<m;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},I.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},I.prototype.just_added_newline=function(){return this.current_line.is_empty()},I.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},I.prototype.ensure_empty_line_above=function(u,m){for(var i=this.__lines.length-2;i>=0;){var g=this.__lines[i];if(g.is_empty())break;if(g.item(0).indexOf(u)!==0&&g.item(-1)!==m){this.__lines.splice(i+1,0,new k(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=I},function(e){function k(L,I,u,m){this.type=L,this.text=I,this.comments_before=null,this.newlines=u||0,this.whitespace_before=m||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=k},function(e,k){var L="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",I="\\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",m="\\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",i="(?:\\\\u[0-9a-fA-F]{4}|["+L+u+"])",g="(?:\\\\u[0-9a-fA-F]{4}|["+I+u+m+"])*";k.identifier=new RegExp(i+g,"g"),k.identifierStart=new RegExp(i),k.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+I+u+m+"])+");var w=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;k.newline=/[\n\r\u2028\u2029]/,k.lineBreak=new RegExp(`\r
|`+k.newline.source),k.allLineBreaks=new RegExp(k.lineBreak.source,"g")},function(e,k,L){var I=L(6).Options,u=["before-newline","after-newline","preserve-newline"];function m(i){I.call(this,i,"js");var g=this.raw_options.brace_style||null;g==="expand-strict"?this.raw_options.brace_style="expand":g==="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 w=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var x=0;x<w.length;x++)w[x]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=w[x];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)}m.prototype=new I,e.exports.Options=m},function(e){function k(u,m){this.raw_options=L(u,m),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"])}k.prototype._get_array=function(u,m){var i=this.raw_options[u],g=m||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(g=i.concat()):typeof i=="string"&&(g=i.split(/[^a-zA-Z0-9_\/\-]+/)),g},k.prototype._get_boolean=function(u,m){var i=this.raw_options[u],g=i===void 0?!!m:!!i;return g},k.prototype._get_characters=function(u,m){var i=this.raw_options[u],g=m||"";return typeof i=="string"&&(g=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),g},k.prototype._get_number=function(u,m){var i=this.raw_options[u];m=parseInt(m,10),isNaN(m)&&(m=0);var g=parseInt(i,10);return isNaN(g)&&(g=m),g},k.prototype._get_selection=function(u,m,i){var g=this._get_selection_list(u,m,i);if(g.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+m+`
You passed in: '`+this.raw_options[u]+"'");return g[0]},k.prototype._get_selection_list=function(u,m,i){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[m[0]],!this._is_valid_selection(i,m))throw new Error("Invalid Default Value!");var g=this._get_array(u,i);if(!this._is_valid_selection(g,m))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+m+`
You passed in: '`+this.raw_options[u]+"'");return g},k.prototype._is_valid_selection=function(u,m){return u.length&&m.length&&!u.some(function(i){return m.indexOf(i)===-1})};function L(u,m){var i={};u=I(u);var g;for(g in u)g!==m&&(i[g]=u[g]);if(m&&u[m])for(g in u[m])i[g]=u[m][g];return i}function I(u){var m={},i;for(i in u){var g=i.replace(/-/g,"_");m[g]=u[i]}return m}e.exports.Options=k,e.exports.normalizeOpts=I,e.exports.mergeOpts=L},function(e,k,L){var I=L(8).InputScanner,u=L(9).Tokenizer,m=L(9).TOKEN,i=L(13).Directives,g=L(4),w=L(12).Pattern,x=L(14).TemplatablePattern;function E(r,t){return t.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:m.START,RAW:m.RAW,EOF:m.EOF},f=new i(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,A=/[0-9]/,s=/[^\d\.]/,p=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),C="\\?\\.(?!\\d) "+C,C=C.replace(/ /g,"|");var l=new RegExp(C),T="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),y=T.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+y.join("|")+")$"),v,n=function(r,t){u.call(this,r,t),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var c=new w(this._input),b=new x(this._input).read_options(this._options);this.__patterns={template:b,identifier:b.starting_with(g.identifier).matching(g.identifierMatch),number:c.matching(d),punct:c.matching(l),comment:c.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:c.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:c.matching(/<!--/),html_comment_end:c.matching(/-->/),include:c.starting_with(/#include/).until_after(g.lineBreak),shebang:c.starting_with(/#!/).until_after(g.lineBreak),xml:c.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:b.until(/['\\\n\r\u2028\u2029]/),double_quote:b.until(/["\\\n\r\u2028\u2029]/),template_text:b.until(/[`\\$]/),template_expression:b.until(/[`}\\]/)}};n.prototype=new u,n.prototype._is_comment=function(r){return r.type===o.COMMENT||r.type===o.BLOCK_COMMENT||r.type===o.UNKNOWN},n.prototype._is_opening=function(r){return r.type===o.START_BLOCK||r.type===o.START_EXPR},n.prototype._is_closing=function(r,t){return(r.type===o.END_BLOCK||r.type===o.END_EXPR)&&t&&(r.text==="]"&&t.text==="["||r.text===")"&&t.text==="("||r.text==="}"&&t.text==="{")},n.prototype._reset=function(){v=!1},n.prototype._get_next_token=function(r,t){var c=null;this._readWhitespace();var b=this._input.peek();return b===null?this._create_token(o.EOF,""):(c=c||this._read_non_javascript(b),c=c||this._read_string(b),c=c||this._read_word(r),c=c||this._read_singles(b),c=c||this._read_comment(b),c=c||this._read_regexp(b,r),c=c||this._read_xml(b,r),c=c||this._read_punctuation(),c=c||this._create_token(o.UNKNOWN,this._input.next()),c)},n.prototype._read_word=function(r){var t;if(t=this.__patterns.identifier.read(),t!=="")return t=t.replace(g.allLineBreaks,`
`),!(r.type===o.DOT||r.type===o.RESERVED&&(r.text==="set"||r.text==="get"))&&_.test(t)?(t==="in"||t==="of")&&(r.type===o.WORD||r.type===o.STRING)?this._create_token(o.OPERATOR,t):this._create_token(o.RESERVED,t):this._create_token(o.WORD,t);if(t=this.__patterns.number.read(),t!=="")return this._create_token(o.WORD,t)},n.prototype._read_singles=function(r){var t=null;return r==="("||r==="["?t=this._create_token(o.START_EXPR,r):r===")"||r==="]"?t=this._create_token(o.END_EXPR,r):r==="{"?t=this._create_token(o.START_BLOCK,r):r==="}"?t=this._create_token(o.END_BLOCK,r):r===";"?t=this._create_token(o.SEMICOLON,r):r==="."&&s.test(this._input.peek(1))?t=this._create_token(o.DOT,r):r===","&&(t=this._create_token(o.COMMA,r)),t&&this._input.next(),t},n.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)},n.prototype._read_non_javascript=function(r){var t="";if(r==="#"){if(this._is_first_token()&&(t=this.__patterns.shebang.read(),t))return this._create_token(o.UNKNOWN,t.trim()+`
`);if(t=this.__patterns.include.read(),t)return this._create_token(o.UNKNOWN,t.trim()+`
`);r=this._input.next();var c="#";if(this._input.hasNext()&&this._input.testChar(A)){do r=this._input.next(),c+=r;while(this._input.hasNext()&&r!=="#"&&r!=="=");return r==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(c+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(c+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,c)}this._input.back()}else if(r==="<"&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read(),t){for(;this._input.hasNext()&&!this._input.testChar(g.newline);)t+=this._input.next();return v=!0,this._create_token(o.COMMENT,t)}}else if(v&&r==="-"&&(t=this.__patterns.html_comment_end.read(),t))return v=!1,this._create_token(o.COMMENT,t);return null},n.prototype._read_comment=function(r){var t=null;if(r==="/"){var c="";if(this._input.peek(1)==="*"){c=this.__patterns.block_comment.read();var b=f.get_directives(c);b&&b.ignore==="start"&&(c+=f.readIgnored(this._input)),c=c.replace(g.allLineBreaks,`
`),t=this._create_token(o.BLOCK_COMMENT,c),t.directives=b}else this._input.peek(1)==="/"&&(c=this.__patterns.comment.read(),t=this._create_token(o.COMMENT,c))}return t},n.prototype._read_string=function(r){if(r==="`"||r==="'"||r==='"'){var t=this._input.next();return this.has_char_escapes=!1,r==="`"?t+=this._read_string_recursive("`",!0,"${"):t+=this._read_string_recursive(r),this.has_char_escapes&&this._options.unescape_strings&&(t=a(t)),this._input.peek()===r&&(t+=this._input.next()),t=t.replace(g.allLineBreaks,`
`),this._create_token(o.STRING,t)}return null},n.prototype._allow_regexp_or_xml=function(r){return r.type===o.RESERVED&&E(r.text,["return","case","throw","else","do","typeof","yield"])||r.type===o.END_EXPR&&r.text===")"&&r.opened.previous.type===o.RESERVED&&E(r.opened.previous.text,["if","while","for"])||E(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])},n.prototype._read_regexp=function(r,t){if(r==="/"&&this._allow_regexp_or_xml(t)){for(var c=this._input.next(),b=!1,h=!1;this._input.hasNext()&&(b||h||this._input.peek()!==r)&&!this._input.testChar(g.newline);)c+=this._input.peek(),b?b=!1:(b=this._input.peek()==="\\",this._input.peek()==="["?h=!0:this._input.peek()==="]"&&(h=!1)),this._input.next();return this._input.peek()===r&&(c+=this._input.next(),c+=this._input.read(g.identifier)),this._create_token(o.STRING,c)}return null},n.prototype._read_xml=function(r,t){if(this._options.e4x&&r==="<"&&this._allow_regexp_or_xml(t)){var c="",b=this.__patterns.xml.read_match();if(b){for(var h=b[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),D=h.indexOf("{")===0,P=0;b;){var j=!!b[1],N=b[2],H=!!b[b.length-1]||N.slice(0,8)==="![CDATA[";if(!H&&(N===h||D&&N.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(j?--P:++P),c+=b[0],P<=0)break;b=this.__patterns.xml.read_match()}return b||(c+=this._input.match(/[\s\S]*/g)[0]),c=c.replace(g.allLineBreaks,`
`),this._create_token(o.STRING,c)}}return null};function a(r){for(var t="",c=0,b=new I(r),h=null;b.hasNext();)if(h=b.match(/([\s]|[^\\]|\\\\)+/g),h&&(t+=h[0]),b.peek()==="\\"){if(b.next(),b.peek()==="x")h=b.match(/x([0-9A-Fa-f]{2})/g);else if(b.peek()==="u")h=b.match(/u([0-9A-Fa-f]{4})/g);else{t+="\\",b.hasNext()&&(t+=b.next());continue}if(!h)return r;if(c=parseInt(h[1],16),c>126&&c<=255&&h[0].indexOf("x")===0)return r;if(c>=0&&c<32){t+="\\"+h[0];continue}else c===34||c===39||c===92?t+="\\"+String.fromCharCode(c):t+=String.fromCharCode(c)}return t}n.prototype._read_string_recursive=function(r,t,c){var b,h;r==="'"?h=this.__patterns.single_quote:r==='"'?h=this.__patterns.double_quote:r==="`"?h=this.__patterns.template_text:r==="}"&&(h=this.__patterns.template_expression);for(var D=h.read(),P="";this._input.hasNext();){if(P=this._input.next(),P===r||!t&&g.newline.test(P)){this._input.back();break}else P==="\\"&&this._input.hasNext()?(b=this._input.peek(),b==="x"||b==="u"?this.has_char_escapes=!0:b==="\r"&&this._input.peek(1)===`
`&&this._input.next(),P+=this._input.next()):c&&(c==="${"&&P==="$"&&this._input.peek()==="{"&&(P+=this._input.next()),c===P&&(r==="`"?P+=this._read_string_recursive("}",t,"`"):P+=this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(P+=this._input.next())));P+=h.read(),D+=P}return D},e.exports.Tokenizer=n,e.exports.TOKEN=o,e.exports.positionable_operators=p.slice(),e.exports.line_starters=T.slice()},function(e){var k=RegExp.prototype.hasOwnProperty("sticky");function L(I){this.__input=I||"",this.__input_length=this.__input.length,this.__position=0}L.prototype.restart=function(){this.__position=0},L.prototype.back=function(){this.__position>0&&(this.__position-=1)},L.prototype.hasNext=function(){return this.__position<this.__input_length},L.prototype.next=function(){var I=null;return this.hasNext()&&(I=this.__input.charAt(this.__position),this.__position+=1),I},L.prototype.peek=function(I){var u=null;return I=I||0,I+=this.__position,I>=0&&I<this.__input_length&&(u=this.__input.charAt(I)),u},L.prototype.__match=function(I,u){I.lastIndex=u;var m=I.exec(this.__input);return m&&!(k&&I.sticky)&&(m.index!==u&&(m=null)),m},L.prototype.test=function(I,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(I,u):!1},L.prototype.testChar=function(I,u){var m=this.peek(u);return I.lastIndex=0,m!==null&&I.test(m)},L.prototype.match=function(I){var u=this.__match(I,this.__position);return u?this.__position+=u[0].length:u=null,u},L.prototype.read=function(I,u,m){var i="",g;return I&&(g=this.match(I),g&&(i+=g[0])),u&&(g||!I)&&(i+=this.readUntil(u,m)),i},L.prototype.readUntil=function(I,u){var m="",i=this.__position;I.lastIndex=this.__position;var g=I.exec(this.__input);return g?(i=g.index,u&&(i+=g[0].length)):i=this.__input_length,m=this.__input.substring(this.__position,i),this.__position=i,m},L.prototype.readUntilAfter=function(I){return this.readUntil(I,!0)},L.prototype.get_regexp=function(I,u){var m=null,i="g";return u&&k&&(i="y"),typeof I=="string"&&I!==""?m=new RegExp(I,i):I&&(m=new RegExp(I.source,i)),m},L.prototype.get_literal_regexp=function(I){return RegExp(I.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},L.prototype.peekUntilAfter=function(I){var u=this.__position,m=this.readUntilAfter(I);return this.__position=u,m},L.prototype.lookBack=function(I){var u=this.__position-1;return u>=I.length&&this.__input.substring(u-I.length,u).toLowerCase()===I},e.exports.InputScanner=L},function(e,k,L){var I=L(8).InputScanner,u=L(3).Token,m=L(10).TokenStream,i=L(11).WhitespacePattern,g={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},w=function(x,E){this._input=new I(x),this._options=E||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};w.prototype.tokenize=function(){this._input.restart(),this.__tokens=new m,this._reset();for(var x,E=new u(g.START,""),o=null,f=[],d=new m;E.type!==g.EOF;){for(x=this._get_next_token(E,o);this._is_comment(x);)d.add(x),x=this._get_next_token(E,o);d.isEmpty()||(x.comments_before=d,d=new m),x.parent=o,this._is_opening(x)?(f.push(o),o=x):o&&this._is_closing(x,o)&&(x.opened=o,o.closed=x,o=f.pop(),x.parent=o),x.previous=E,E.next=x,this.__tokens.add(x),E=x}return this.__tokens},w.prototype._is_first_token=function(){return this.__tokens.isEmpty()},w.prototype._reset=function(){},w.prototype._get_next_token=function(x,E){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(g.RAW,o):this._create_token(g.EOF,"")},w.prototype._is_comment=function(x){return!1},w.prototype._is_opening=function(x){return!1},w.prototype._is_closing=function(x,E){return!1},w.prototype._create_token=function(x,E){var o=new u(x,E,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},w.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=w,e.exports.TOKEN=g},function(e){function k(L){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=L}k.prototype.restart=function(){this.__position=0},k.prototype.isEmpty=function(){return this.__tokens_length===0},k.prototype.hasNext=function(){return this.__position<this.__tokens_length},k.prototype.next=function(){var L=null;return this.hasNext()&&(L=this.__tokens[this.__position],this.__position+=1),L},k.prototype.peek=function(L){var I=null;return L=L||0,L+=this.__position,L>=0&&L<this.__tokens_length&&(I=this.__tokens[L]),I},k.prototype.add=function(L){this.__parent_token&&(L.parent=this.__parent_token),this.__tokens.push(L),this.__tokens_length+=1},e.exports.TokenStream=k},function(e,k,L){var I=L(12).Pattern;function u(m,i){I.call(this,m,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new I,u.prototype.__set_whitespace_patterns=function(m,i){m+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+m+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var m=this._input.read(this._match_pattern);if(m===" ")this.whitespace_before_token=" ";else if(m){var i=this.__split(this._newline_regexp,m);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return m},u.prototype.matching=function(m,i){var g=this._create();return g.__set_whitespace_patterns(m,i),g._update(),g},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(m,i){m.lastIndex=0;for(var g=0,w=[],x=m.exec(i);x;)w.push(i.substring(g,x.index)),g=x.index+x[0].length,x=m.exec(i);return g<i.length?w.push(i.substring(g,i.length)):w.push(""),w},e.exports.WhitespacePattern=u},function(e){function k(L,I){this._input=L,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,I&&(this._starting_pattern=this._input.get_regexp(I._starting_pattern,!0),this._match_pattern=this._input.get_regexp(I._match_pattern,!0),this._until_pattern=this._input.get_regexp(I._until_pattern),this._until_after=I._until_after)}k.prototype.read=function(){var L=this._input.read(this._starting_pattern);return(!this._starting_pattern||L)&&(L+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),L},k.prototype.read_match=function(){return this._input.match(this._match_pattern)},k.prototype.until_after=function(L){var I=this._create();return I._until_after=!0,I._until_pattern=this._input.get_regexp(L),I._update(),I},k.prototype.until=function(L){var I=this._create();return I._until_after=!1,I._until_pattern=this._input.get_regexp(L),I._update(),I},k.prototype.starting_with=function(L){var I=this._create();return I._starting_pattern=this._input.get_regexp(L,!0),I._update(),I},k.prototype.matching=function(L){var I=this._create();return I._match_pattern=this._input.get_regexp(L,!0),I._update(),I},k.prototype._create=function(){return new k(this._input,this)},k.prototype._update=function(){},e.exports.Pattern=k},function(e){function k(L,I){L=typeof L=="string"?L:L.source,I=typeof I=="string"?I:I.source,this.__directives_block_pattern=new RegExp(L+/ beautify( \w+[:]\w+)+ /.source+I,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(L+/\sbeautify\signore:end\s/.source+I,"g")}k.prototype.get_directives=function(L){if(!L.match(this.__directives_block_pattern))return null;var I={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(L);u;)I[u[1]]=u[2],u=this.__directive_pattern.exec(L);return I},k.prototype.readIgnored=function(L){return L.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=k},function(e,k,L){var I=L(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function m(i,g){I.call(this,i,g),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),g&&(this.__template_pattern=this._input.get_regexp(g.__template_pattern),this._excluded=Object.assign(this._excluded,g._excluded),this._disabled=Object.assign(this._disabled,g._disabled));var w=new I(i);this.__patterns={handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:w.starting_with(/{{{/).until_after(/}}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),php:w.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:w.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:w.starting_with(/{%/).until_after(/%}/),django_value:w.starting_with(/{{/).until_after(/}}/),django_comment:w.starting_with(/{#/).until_after(/#}/),smarty:w.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:w.starting_with(/{\*/).until_after(/\*}/),smarty_literal:w.starting_with(/{literal}/).until_after(/{\/literal}/)}}m.prototype=new I,m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){this.__set_templated_pattern()},m.prototype.disable=function(i){var g=this._create();return g._disabled[i]=!0,g._update(),g},m.prototype.read_options=function(i){var g=this._create();for(var w in u)g._disabled[w]=i.templating.indexOf(w)===-1;return g._update(),g},m.prototype.exclude=function(i){var g=this._create();return g._excluded[i]=!0,g._update(),g},m.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var g=this._read_template();g;)this._match_pattern?g+=this._input.read(this._match_pattern):g+=this._input.readUntil(this.__template_pattern),i+=g,g=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},m.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},m.prototype._read_template=function(){var i="",g=this._input.peek();if(g==="<"){var w=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&w==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&w==="%"&&(i=i||this.__patterns.erb.read())}else g==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},e.exports.TemplatablePattern=m}],G={};function O(e){var k=G[e];if(k!==void 0)return k.exports;var L=G[e]={exports:{}};return ne[e](L,L.exports,O),L.exports}var W=O(0);ye=W})();var ge=ye;!(me=[],be=function(){return{js_beautify:ge}}.apply(ce,me),be!==void 0&&(We.exports=be))})()},"746U":function(We,ce,F){"use strict";F.d(ce,"f",function(){return me}),F.d(ce,"l",function(){return be}),F.d(ce,"k",function(){return ye}),F.d(ce,"j",function(){return ge}),F.d(ce,"g",function(){return ne}),F.d(ce,"m",function(){return G}),F.d(ce,"h",function(){return O}),F.d(ce,"n",function(){return W}),F.d(ce,"c",function(){return e}),F.d(ce,"a",function(){return k}),F.d(ce,"i",function(){return L}),F.d(ce,"o",function(){return I}),F.d(ce,"e",function(){return i}),F.d(ce,"d",function(){return g}),F.d(ce,"p",function(){return w}),F.d(ce,"b",function(){return x});function me(E){return Array.isArray(E)}function be(E){return typeof E=="string"}function ye(E){return typeof E=="object"&&E!==null&&!Array.isArray(E)&&!(E instanceof RegExp)&&!(E instanceof Date)}function ge(E){return typeof E=="number"&&!isNaN(E)}function ne(E){return E===!0||E===!1}function G(E){return typeof E=="undefined"}function O(E){return!W(E)}function W(E){return G(E)||E===null}function e(E,o){if(!E)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function k(E){if(W(E))throw new Error("Assertion Failed: argument is undefined or null");return E}function L(E){return typeof E=="function"}function I(E,o){const f=Math.min(E.length,o.length);for(let d=0;d<f;d++)u(E[d],o[d])}function u(E,o){if(be(o)){if(typeof E!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(L(o)){try{if(E instanceof o)return}catch(f){}if(!W(E)&&E.constructor===o)return;if(o.length===1&&o.call(void 0,E)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function m(E){let o=[],f=Object.getPrototypeOf(E);for(;Object.prototype!==f;)o=o.concat(Object.getOwnPropertyNames(f)),f=Object.getPrototypeOf(f);return o}function i(E){const o=[];for(const f of m(E))typeof E[f]=="function"&&o.push(f);return o}function g(E,o){const f=A=>function(){const s=Array.prototype.slice.call(arguments,0);return o(A,s)};let d={};for(const A of E)d[A]=f(A);return d}function w(E){return E===null?void 0:E}function x(E,o="Unreachable"){throw new Error(o)}},"7J2G":function(We,ce,F){"use strict";F.d(ce,"a",function(){return A});var me=F("yuO0"),be=F("XjgL"),ye=F("6ASS"),ge=F("eA01"),ne=F("fXDJ"),G=F("BPTR"),O=F("udol"),W=F("T/Jt"),e=F.n(W),k=F("27eb"),L=F.n(k),I=function(p){var C,l="".concat(p.rootPrefixCls,"-item"),T=L()(l,"".concat(l,"-").concat(p.page),(C={},Object(be.a)(C,"".concat(l,"-active"),p.active),Object(be.a)(C,"".concat(l,"-disabled"),!p.page),Object(be.a)(C,p.className,!!p.className),C)),y=function(){p.onClick(p.page)},_=function(n){p.onKeyPress(n,p.onClick,p.page)};return e.a.createElement("li",{title:p.showTitle?p.page:null,className:T,onClick:y,onKeyPress:_,tabIndex:"0"},p.itemRender(p.page,"page",e.a.createElement("a",{rel:"nofollow"},p.page)))},u=I,m={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},i=function(s){Object(G.a)(C,s);var p=Object(O.a)(C);function C(){var l;Object(ge.a)(this,C);for(var T=arguments.length,y=new Array(T),_=0;_<T;_++)y[_]=arguments[_];return l=p.call.apply(p,[this].concat(y)),l.state={goInputText:""},l.buildOptionText=function(v){return"".concat(v," ").concat(l.props.locale.items_per_page)},l.changeSize=function(v){l.props.changeSize(Number(v))},l.handleChange=function(v){l.setState({goInputText:v.target.value})},l.handleBlur=function(v){var n=l.props,a=n.goButton,r=n.quickGo,t=n.rootPrefixCls,c=l.state.goInputText;if(a||c==="")return;if(l.setState({goInputText:""}),v.relatedTarget&&(v.relatedTarget.className.indexOf("".concat(t,"-item-link"))>=0||v.relatedTarget.className.indexOf("".concat(t,"-item"))>=0))return;r(l.getValidValue())},l.go=function(v){var n=l.state.goInputText;if(n==="")return;(v.keyCode===m.ENTER||v.type==="click")&&(l.setState({goInputText:""}),l.props.quickGo(l.getValidValue()))},l}return Object(ne.a)(C,[{key:"getValidValue",value:function(){var T=this.state.goInputText;return!T||isNaN(T)?void 0:Number(T)}},{key:"getPageSizeOptions",value:function(){var T=this.props,y=T.pageSize,_=T.pageSizeOptions;return _.some(function(v){return v.toString()===y.toString()})?_:_.concat([y.toString()]).sort(function(v,n){var a=isNaN(Number(v))?0:Number(v),r=isNaN(Number(n))?0:Number(n);return a-r})}},{key:"render",value:function(){var T=this,y=this.props,_=y.pageSize,v=y.locale,n=y.rootPrefixCls,a=y.changeSize,r=y.quickGo,t=y.goButton,c=y.selectComponentClass,b=y.buildOptionText,h=y.selectPrefixCls,D=y.disabled,P=this.state.goInputText,j="".concat(n,"-options"),N=c,H=null,z=null,J=null;if(!a&&!r)return null;var Y=this.getPageSizeOptions();if(a&&N){var le=Y.map(function(te,Z){return e.a.createElement(N.Option,{key:Z,value:te.toString()},(b||T.buildOptionText)(te))});H=e.a.createElement(N,{disabled:D,prefixCls:h,showSearch:!1,className:"".concat(j,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||Y[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Z){return Z.parentNode},"aria-label":v.page_size,defaultOpen:!1},le)}return r&&(t&&(J=typeof t=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:D,className:"".concat(j,"-quick-jumper-button")},v.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},t)),z=e.a.createElement("div",{className:"".concat(j,"-quick-jumper")},v.jump_to,e.a.createElement("input",{disabled:D,type:"text",value:P,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":v.page}),v.page,J)),e.a.createElement("li",{className:"".concat(j)},H,z)}}]),C}(e.a.Component);i.defaultProps={pageSizeOptions:["10","20","50","100"]};var g=i,w=F("MbTZ");function x(){}function E(s){var p=Number(s);return typeof p=="number"&&!isNaN(p)&&isFinite(p)&&Math.floor(p)===p}function o(s,p,C){return C}function f(s,p,C){var l=typeof s=="undefined"?p.pageSize:s;return Math.floor((C.total-1)/l)+1}var d=function(s){Object(G.a)(C,s);var p=Object(O.a)(C);function C(l){var T;Object(ge.a)(this,C),T=p.call(this,l),T.getJumpPrevPage=function(){return Math.max(1,T.state.current-(T.props.showLessItems?3:5))},T.getJumpNextPage=function(){return Math.min(f(void 0,T.state,T.props),T.state.current+(T.props.showLessItems?3:5))},T.getItemIcon=function(a,r){var t=T.props.prefixCls,c=a||e.a.createElement("button",{type:"button","aria-label":r,className:"".concat(t,"-item-link")});return typeof a=="function"&&(c=e.a.createElement(a,Object(ye.a)({},T.props))),c},T.savePaginationNode=function(a){T.paginationNode=a},T.isValid=function(a){var r=T.props.total;return E(a)&&a!==T.state.current&&E(r)&&r>0},T.shouldDisplayQuickJumper=function(){var a=T.props,r=a.showQuickJumper,t=a.total,c=T.state.pageSize;return t<=c?!1:r},T.handleKeyDown=function(a){(a.keyCode===m.ARROW_UP||a.keyCode===m.ARROW_DOWN)&&a.preventDefault()},T.handleKeyUp=function(a){var r=T.getValidValue(a),t=T.state.currentInputValue;r!==t&&T.setState({currentInputValue:r}),a.keyCode===m.ENTER?T.handleChange(r):a.keyCode===m.ARROW_UP?T.handleChange(r-1):a.keyCode===m.ARROW_DOWN&&T.handleChange(r+1)},T.handleBlur=function(a){var r=T.getValidValue(a);T.handleChange(r)},T.changePageSize=function(a){var r=T.state.current,t=f(a,T.state,T.props);r=r>t?t:r,t===0&&(r=T.state.current),typeof a=="number"&&("pageSize"in T.props||T.setState({pageSize:a}),"current"in T.props||T.setState({current:r,currentInputValue:r})),T.props.onShowSizeChange(r,a),"onChange"in T.props&&T.props.onChange&&T.props.onChange(r,a)},T.handleChange=function(a){var r=T.props,t=r.disabled,c=r.onChange,b=T.state,h=b.pageSize,D=b.current,P=b.currentInputValue;if(T.isValid(a)&&!t){var j=f(void 0,T.state,T.props),N=a;return a>j?N=j:a<1&&(N=1),"current"in T.props||T.setState({current:N}),N!==P&&T.setState({currentInputValue:N}),c(N,h),N}return D},T.prev=function(){T.hasPrev()&&T.handleChange(T.state.current-1)},T.next=function(){T.hasNext()&&T.handleChange(T.state.current+1)},T.jumpPrev=function(){T.handleChange(T.getJumpPrevPage())},T.jumpNext=function(){T.handleChange(T.getJumpNextPage())},T.hasPrev=function(){return T.state.current>1},T.hasNext=function(){return T.state.current<f(void 0,T.state,T.props)},T.runIfEnter=function(a,r){if(a.key==="Enter"||a.charCode===13){for(var t=arguments.length,c=new Array(t>2?t-2:0),b=2;b<t;b++)c[b-2]=arguments[b];r.apply(void 0,c)}},T.runIfEnterPrev=function(a){T.runIfEnter(a,T.prev)},T.runIfEnterNext=function(a){T.runIfEnter(a,T.next)},T.runIfEnterJumpPrev=function(a){T.runIfEnter(a,T.jumpPrev)},T.runIfEnterJumpNext=function(a){T.runIfEnter(a,T.jumpNext)},T.handleGoTO=function(a){(a.keyCode===m.ENTER||a.type==="click")&&T.handleChange(T.state.currentInputValue)};var y=l.onChange!==x,_="current"in l;_&&!y&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var v=l.defaultCurrent;"current"in l&&(v=l.current);var n=l.defaultPageSize;return"pageSize"in l&&(n=l.pageSize),v=Math.min(v,f(n,void 0,l)),T.state={current:v,currentInputValue:v,pageSize:n},T}return Object(ne.a)(C,[{key:"componentDidUpdate",value:function(T,y){var _=this.props.prefixCls;if(y.current!==this.state.current&&this.paginationNode){var v=this.paginationNode.querySelector(".".concat(_,"-item-").concat(y.current));v&&document.activeElement===v&&v.blur()}}},{key:"getValidValue",value:function(T){var y=T.target.value,_=f(void 0,this.state,this.props),v=this.state.currentInputValue,n;return y===""?n=y:isNaN(Number(y))?n=v:y>=_?n=_:n=Number(y),n}},{key:"getShowSizeChanger",value:function(){var T=this.props,y=T.showSizeChanger,_=T.total,v=T.totalBoundaryShowSizeChanger;return typeof y!="undefined"?y:_>v}},{key:"renderPrev",value:function(T){var y=this.props,_=y.prevIcon,v=y.itemRender,n=v(T,"prev",this.getItemIcon(_,"prev page")),a=!this.hasPrev();return Object(W.isValidElement)(n)?Object(W.cloneElement)(n,{disabled:a}):n}},{key:"renderNext",value:function(T){var y=this.props,_=y.nextIcon,v=y.itemRender,n=v(T,"next",this.getItemIcon(_,"next page")),a=!this.hasNext();return Object(W.isValidElement)(n)?Object(W.cloneElement)(n,{disabled:a}):n}},{key:"render",value:function(){var T=this,y=this.props,_=y.prefixCls,v=y.className,n=y.style,a=y.disabled,r=y.hideOnSinglePage,t=y.total,c=y.locale,b=y.showQuickJumper,h=y.showLessItems,D=y.showTitle,P=y.showTotal,j=y.simple,N=y.itemRender,H=y.showPrevNextJumpers,z=y.jumpPrevIcon,J=y.jumpNextIcon,Y=y.selectComponentClass,le=y.selectPrefixCls,te=y.pageSizeOptions,Z=this.state,_e=Z.current,we=Z.pageSize,De=Z.currentInputValue;if(r===!0&&t<=we)return null;var Ee=f(void 0,this.state,this.props),xe=[],ve=null,X=null,Ae=null,Q=null,ue=null,ee=b&&b.goButton,ae=h?1:2,fe=_e-1>0?_e-1:0,Re=_e+1<Ee?_e+1:Ee,pe=Object.keys(this.props).reduce(function(V,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(V[$]=T.props[$]),V},{}),ie=P&&e.a.createElement("li",{className:"".concat(_,"-total-text")},P(t,[t===0?0:(_e-1)*we+1,_e*we>t?t:_e*we]));if(j)return ee&&(typeof ee=="boolean"?ue=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},c.jump_to_confirm):ue=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ee),ue=e.a.createElement("li",{title:D?"".concat(c.jump_to).concat(_e,"/").concat(Ee):null,className:"".concat(_,"-simple-pager")},ue)),e.a.createElement("ul",Object(me.a)({className:L()(_,"".concat(_,"-simple"),Object(be.a)({},"".concat(_,"-disabled"),a),v),style:n,ref:this.savePaginationNode},pe),ie,e.a.createElement("li",{title:D?c.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:L()("".concat(_,"-prev"),Object(be.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(fe)),e.a.createElement("li",{title:D?"".concat(_e,"/").concat(Ee):null,className:"".concat(_,"-simple-pager")},e.a.createElement("input",{type:"text",value:De,disabled:a,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),e.a.createElement("span",{className:"".concat(_,"-slash")},"/"),Ee),e.a.createElement("li",{title:D?c.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:L()("".concat(_,"-next"),Object(be.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Re)),ue);if(Ee<=3+ae*2){var Ie={locale:c,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:D,itemRender:N};Ee||xe.push(e.a.createElement(u,Object(me.a)({},Ie,{key:"noPager",page:1,className:"".concat(_,"-item-disabled")})));for(var Oe=1;Oe<=Ee;Oe+=1){var Ne=_e===Oe;xe.push(e.a.createElement(u,Object(me.a)({},Ie,{key:Oe,page:Oe,active:Ne})))}}else{var Le=h?c.prev_3:c.prev_5,Ce=h?c.next_3:c.next_5;H&&(ve=e.a.createElement("li",{title:D?Le:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:L()("".concat(_,"-jump-prev"),Object(be.a)({},"".concat(_,"-jump-prev-custom-icon"),!!z))},N(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(z,"prev page"))),X=e.a.createElement("li",{title:D?Ce:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:L()("".concat(_,"-jump-next"),Object(be.a)({},"".concat(_,"-jump-next-custom-icon"),!!J))},N(this.getJumpNextPage(),"jump-next",this.getItemIcon(J,"next page")))),Q=e.a.createElement(u,{locale:c,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ee,page:Ee,active:!1,showTitle:D,itemRender:N}),Ae=e.a.createElement(u,{locale:c,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:D,itemRender:N});var Ue=Math.max(1,_e-ae),Te=Math.min(_e+ae,Ee);_e-1<=ae&&(Te=1+ae*2),Ee-_e<=ae&&(Ue=Ee-ae*2);for(var Pe=Ue;Pe<=Te;Pe+=1){var q=_e===Pe;xe.push(e.a.createElement(u,{locale:c,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Pe,page:Pe,active:q,showTitle:D,itemRender:N}))}_e-1>=ae*2&&_e!==1+2&&(xe[0]=Object(W.cloneElement)(xe[0],{className:"".concat(_,"-item-after-jump-prev")}),xe.unshift(ve)),Ee-_e>=ae*2&&_e!==Ee-2&&(xe[xe.length-1]=Object(W.cloneElement)(xe[xe.length-1],{className:"".concat(_,"-item-before-jump-next")}),xe.push(X)),Ue!==1&&xe.unshift(Ae),Te!==Ee&&xe.push(Q)}var se=!this.hasPrev()||!Ee,he=!this.hasNext()||!Ee;return e.a.createElement("ul",Object(me.a)({className:L()(_,v,Object(be.a)({},"".concat(_,"-disabled"),a)),style:n,ref:this.savePaginationNode},pe),ie,e.a.createElement("li",{title:D?c.prev_page:null,onClick:this.prev,tabIndex:se?null:0,onKeyPress:this.runIfEnterPrev,className:L()("".concat(_,"-prev"),Object(be.a)({},"".concat(_,"-disabled"),se)),"aria-disabled":se},this.renderPrev(fe)),xe,e.a.createElement("li",{title:D?c.next_page:null,onClick:this.next,tabIndex:he?null:0,onKeyPress:this.runIfEnterNext,className:L()("".concat(_,"-next"),Object(be.a)({},"".concat(_,"-disabled"),he)),"aria-disabled":he},this.renderNext(Re)),e.a.createElement(g,{disabled:a,locale:c,rootPrefixCls:_,selectComponentClass:Y,selectPrefixCls:le,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:_e,pageSize:we,pageSizeOptions:te,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ee}))}}],[{key:"getDerivedStateFromProps",value:function(T,y){var _={};if("current"in T&&(_.current=T.current,T.current!==y.current&&(_.currentInputValue=_.current)),"pageSize"in T&&T.pageSize!==y.pageSize){var v=y.current,n=f(T.pageSize,y,T);v=v>n?n:v,"current"in T||(_.current=v,_.currentInputValue=v),_.pageSize=T.pageSize}return _}}]),C}(e.a.Component);d.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:x,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:x,locale:w.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var A=d},"7O0G":function(We,ce,F){(function(me,be){We.exports=be()})(this,function(){"use strict";function me(q,se){for(var he=0;he<se.length;he++){var V=se[he];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(q,V.key,V)}}function be(q,se,he){return se&&me(q.prototype,se),he&&me(q,he),q}function ye(q,se){if(!q)return;if(typeof q=="string")return ge(q,se);var he=Object.prototype.toString.call(q).slice(8,-1);if(he==="Object"&&q.constructor&&(he=q.constructor.name),he==="Map"||he==="Set")return Array.from(q);if(he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he))return ge(q,se)}function ge(q,se){(se==null||se>q.length)&&(se=q.length);for(var he=0,V=new Array(se);he<se;he++)V[he]=q[he];return V}function ne(q,se){var he;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(he=ye(q))||se&&q&&typeof q.length=="number"){he&&(q=he);var V=0;return function(){return V>=q.length?{done:!0}:{done:!1,value:q[V++]}}}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 he=q[Symbol.iterator](),he.next.bind(he)}function G(q,se){return se={exports:{}},q(se,se.exports),se.exports}var O=G(function(q){function se(){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 he(V){q.exports.defaults=V}q.exports={defaults:se(),getDefaults:se,changeDefaults:he}}),W=O.defaults,e=O.getDefaults,k=O.changeDefaults,L=/[&<>"']/,I=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,m=/[<>"']|&(?!#?\w+;)/g,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g=function(se){return i[se]};function w(q,se){if(se){if(L.test(q))return q.replace(I,g)}else if(u.test(q))return q.replace(m,g);return q}var x=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function E(q){return q.replace(x,function(se,he){return he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""})}var o=/(^|[^\[])\^/g;function f(q,se){q=q.source||q,se=se||"";var he={replace:function($,re){return re=re.source||re,re=re.replace(o,"$1"),q=q.replace($,re),he},getRegex:function(){return new RegExp(q,se)}};return he}var d=/[^\w:]/g,A=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function s(q,se,he){if(q){var V;try{V=decodeURIComponent(E(he)).replace(d,"").toLowerCase()}catch($){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}se&&!A.test(he)&&(he=y(se,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch($){return null}return he}var p={},C=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(q,se){p[" "+q]||(C.test(q)?p[" "+q]=q+"/":p[" "+q]=a(q,"/",!0)),q=p[" "+q];var he=q.indexOf(":")===-1;return se.substring(0,2)==="//"?he?se:q.replace(l,"$1")+se:se.charAt(0)==="/"?he?se:q.replace(T,"$1")+se:q+se}var _={exec:function(){}};function v(q){for(var se=1,he,V;se<arguments.length;se++){he=arguments[se];for(V in he)Object.prototype.hasOwnProperty.call(he,V)&&(q[V]=he[V])}return q}function n(q,se){var he=q.replace(/\|/g,function(re,oe,Se){for(var Me=!1,Be=oe;--Be>=0&&Se[Be]==="\\";)Me=!Me;return Me?"|":" |"}),V=he.split(/ \|/),$=0;if(V.length>se)V.splice(se);else for(;V.length<se;)V.push("");for(;$<V.length;$++)V[$]=V[$].trim().replace(/\\\|/g,"|");return V}function a(q,se,he){var V=q.length;if(V===0)return"";for(var $=0;$<V;){var re=q.charAt(V-$-1);if(re===se&&!he)$++;else if(re!==se&&he)$++;else break}return q.substr(0,V-$)}function r(q,se){if(q.indexOf(se[1])===-1)return-1;for(var he=q.length,V=0,$=0;$<he;$++)if(q[$]==="\\")$++;else if(q[$]===se[0])V++;else if(q[$]===se[1]&&(V--,V<0))return $;return-1}function t(q){q&&q.sanitize&&!q.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 c={escape:w,unescape:E,edit:f,cleanUrl:s,resolveUrl:y,noopTest:_,merge:v,splitCells:n,rtrim:a,findClosingBracket:r,checkSanitizeDeprecation:t},b=O.defaults,h=c.rtrim,D=c.splitCells,P=c.escape,j=c.findClosingBracket;function N(q,se,he){var V=se.href,$=se.title?P(se.title):null,re=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:he,href:V,title:$,text:re}:{type:"image",raw:he,href:V,title:$,text:P(re)}}function H(q,se){var he=q.match(/^(\s+)(?:```)/);if(he===null)return se;var V=he[1];return se.split(`
`).map(function($){var re=$.match(/^\s+/);if(re===null)return $;var oe=re[0];return oe.length>=V.length?$.slice(V.length):$}).join(`
`)}var z=function(){function q(he){this.options=he||b}var se=q.prototype;return se.space=function(V){var $=this.rules.block.newline.exec(V);if($)return $[0].length>1?{type:"space",raw:$[0]}:{raw:`
`}},se.code=function(V,$){var re=this.rules.block.code.exec(V);if(re){var oe=$[$.length-1];if(oe&&oe.type==="paragraph")return{raw:re[0],text:re[0].trimRight()};var Se=re[0].replace(/^ {4}/gm,"");return{type:"code",raw:re[0],codeBlockStyle:"indented",text:this.options.pedantic?Se:h(Se,`
`)}}},se.fences=function(V){var $=this.rules.block.fences.exec(V);if($){var re=$[0],oe=H(re,$[3]||"");return{type:"code",raw:re,lang:$[2]?$[2].trim():$[2],text:oe}}},se.heading=function(V){var $=this.rules.block.heading.exec(V);if($)return{type:"heading",raw:$[0],depth:$[1].length,text:$[2]}},se.nptable=function(V){var $=this.rules.block.nptable.exec(V);if($){var re={type:"table",header:D($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
`):[],raw:$[0]};if(re.header.length===re.align.length){var oe=re.align.length,Se;for(Se=0;Se<oe;Se++)/^ *-+: *$/.test(re.align[Se])?re.align[Se]="right":/^ *:-+: *$/.test(re.align[Se])?re.align[Se]="center":/^ *:-+ *$/.test(re.align[Se])?re.align[Se]="left":re.align[Se]=null;for(oe=re.cells.length,Se=0;Se<oe;Se++)re.cells[Se]=D(re.cells[Se],re.header.length);return re}}},se.hr=function(V){var $=this.rules.block.hr.exec(V);if($)return{type:"hr",raw:$[0]}},se.blockquote=function(V){var $=this.rules.block.blockquote.exec(V);if($){var re=$[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:$[0],text:re}}},se.list=function(V){var $=this.rules.block.list.exec(V);if($){for(var re=$[0],oe=$[2],Se=oe.length>1,Me=oe[oe.length-1]===")",Be={type:"list",raw:re,ordered:Se,start:Se?+oe.slice(0,-1):"",loose:!1,items:[]},Ke=$[0].match(this.rules.block.item),Xe=!1,Ge,rt,qe,Ve,at,Qe,$e,nt=Ke.length,Ye=0;Ye<nt;Ye++)Ge=Ke[Ye],re=Ge,rt=Ge.length,Ge=Ge.replace(/^ *([*+-]|\d+[.)]) */,""),~Ge.indexOf(`
`)&&(rt-=Ge.length,Ge=this.options.pedantic?Ge.replace(/^ {1,4}/gm,""):Ge.replace(new RegExp("^ {1,"+rt+"}","gm"),"")),Ye!==nt-1&&(qe=this.rules.block.bullet.exec(Ke[Ye+1])[0],(Se?qe.length===1||!Me&&qe[qe.length-1]===")":qe.length>1||this.options.smartLists&&qe!==oe)&&(Ve=Ke.slice(Ye+1).join(`
`),Be.raw=Be.raw.substring(0,Be.raw.length-Ve.length),Ye=nt-1)),at=Xe||/\n\n(?!\s*$)/.test(Ge),Ye!==nt-1&&(Xe=Ge.charAt(Ge.length-1)===`
`,at||(at=Xe)),at&&(Be.loose=!0),Qe=/^\[[ xX]\] /.test(Ge),$e=void 0,Qe&&($e=Ge[1]!==" ",Ge=Ge.replace(/^\[[ xX]\] +/,"")),Be.items.push({type:"list_item",raw:re,task:Qe,checked:$e,loose:at,text:Ge});return Be}},se.html=function(V){var $=this.rules.block.html.exec(V);if($)return{type:this.options.sanitize?"paragraph":"html",raw:$[0],pre:!this.options.sanitizer&&($[1]==="pre"||$[1]==="script"||$[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer($[0]):P($[0]):$[0]}},se.def=function(V){var $=this.rules.block.def.exec(V);if($){$[3]&&($[3]=$[3].substring(1,$[3].length-1));var re=$[1].toLowerCase().replace(/\s+/g," ");return{tag:re,raw:$[0],href:$[2],title:$[3]}}},se.table=function(V){var $=this.rules.block.table.exec(V);if($){var re={type:"table",header:D($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
`):[]};if(re.header.length===re.align.length){re.raw=$[0];var oe=re.align.length,Se;for(Se=0;Se<oe;Se++)/^ *-+: *$/.test(re.align[Se])?re.align[Se]="right":/^ *:-+: *$/.test(re.align[Se])?re.align[Se]="center":/^ *:-+ *$/.test(re.align[Se])?re.align[Se]="left":re.align[Se]=null;for(oe=re.cells.length,Se=0;Se<oe;Se++)re.cells[Se]=D(re.cells[Se].replace(/^ *\| *| *\| *$/g,""),re.header.length);return re}}},se.lheading=function(V){var $=this.rules.block.lheading.exec(V);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1]}},se.paragraph=function(V){var $=this.rules.block.paragraph.exec(V);if($)return{type:"paragraph",raw:$[0],text:$[1].charAt($[1].length-1)===`
`?$[1].slice(0,-1):$[1]}},se.text=function(V,$){var re=this.rules.block.text.exec(V);if(re){var oe=$[$.length-1];return oe&&oe.type==="text"?{raw:re[0],text:re[0]}:{type:"text",raw:re[0],text:re[0]}}},se.escape=function(V){var $=this.rules.inline.escape.exec(V);if($)return{type:"escape",raw:$[0],text:P($[1])}},se.tag=function(V,$,re){var oe=this.rules.inline.tag.exec(V);if(oe)return!$&&/^<a /i.test(oe[0])?$=!0:$&&/^<\/a>/i.test(oe[0])&&($=!1),!re&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?re=!0:re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(re=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:$,inRawBlock:re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):P(oe[0]):oe[0]}},se.link=function(V){var $=this.rules.inline.link.exec(V);if($){var re=j($[2],"()");if(re>-1){var oe=$[0].indexOf("!")===0?5:4,Se=oe+$[1].length+re;$[2]=$[2].substring(0,re),$[0]=$[0].substring(0,Se).trim(),$[3]=""}var Me=$[2],Be="";if(this.options.pedantic){var Ke=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);Ke?(Me=Ke[1],Be=Ke[3]):Be=""}else Be=$[3]?$[3].slice(1,-1):"";Me=Me.trim().replace(/^<([\s\S]*)>$/,"$1");var Xe=N($,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},$[0]);return Xe}},se.reflink=function(V,$){var re;if((re=this.rules.inline.reflink.exec(V))||(re=this.rules.inline.nolink.exec(V))){var oe=(re[2]||re[1]).replace(/\s+/g," ");if(oe=$[oe.toLowerCase()],!oe||!oe.href){var Se=re[0].charAt(0);return{type:"text",raw:Se,text:Se}}var Me=N(re,oe,re[0]);return Me}},se.strong=function(V,$,re){re===void 0&&(re="");var oe=this.rules.inline.strong.start.exec(V);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){$=$.slice(-1*V.length);var Se=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Se.lastIndex=0;for(var Me;(oe=Se.exec($))!=null;)if(Me=this.rules.inline.strong.middle.exec($.slice(0,oe.index+3)),Me)return{type:"strong",raw:V.slice(0,Me[0].length),text:V.slice(2,Me[0].length-2)}}},se.em=function(V,$,re){re===void 0&&(re="");var oe=this.rules.inline.em.start.exec(V);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){$=$.slice(-1*V.length);var Se=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Se.lastIndex=0;for(var Me;(oe=Se.exec($))!=null;)if(Me=this.rules.inline.em.middle.exec($.slice(0,oe.index+2)),Me)return{type:"em",raw:V.slice(0,Me[0].length),text:V.slice(1,Me[0].length-1)}}},se.codespan=function(V){var $=this.rules.inline.code.exec(V);if($){var re=$[2].replace(/\n/g," "),oe=/[^ ]/.test(re),Se=re.startsWith(" ")&&re.endsWith(" ");return oe&&Se&&(re=re.substring(1,re.length-1)),re=P(re,!0),{type:"codespan",raw:$[0],text:re}}},se.br=function(V){var $=this.rules.inline.br.exec(V);if($)return{type:"br",raw:$[0]}},se.del=function(V){var $=this.rules.inline.del.exec(V);if($)return{type:"del",raw:$[0],text:$[1]}},se.autolink=function(V,$){var re=this.rules.inline.autolink.exec(V);if(re){var oe,Se;return re[2]==="@"?(oe=P(this.options.mangle?$(re[1]):re[1]),Se="mailto:"+oe):(oe=P(re[1]),Se=oe),{type:"link",raw:re[0],text:oe,href:Se,tokens:[{type:"text",raw:oe,text:oe}]}}},se.url=function(V,$){var re;if(re=this.rules.inline.url.exec(V)){var oe,Se;if(re[2]==="@")oe=P(this.options.mangle?$(re[0]):re[0]),Se="mailto:"+oe;else{var Me;do Me=re[0],re[0]=this.rules.inline._backpedal.exec(re[0])[0];while(Me!==re[0]);oe=P(re[0]),re[1]==="www."?Se="http://"+oe:Se=oe}return{type:"link",raw:re[0],text:oe,href:Se,tokens:[{type:"text",raw:oe,text:oe}]}}},se.inlineText=function(V,$,re){var oe=this.rules.inline.text.exec(V);if(oe){var Se;return $?Se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):P(oe[0]):oe[0]:Se=P(this.options.smartypants?re(oe[0]):oe[0]),{type:"text",raw:oe[0],text:Se}}},q}(),J=c.noopTest,Y=c.edit,le=c.merge,te={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:J,table:J,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,te.def=Y(te.def).replace("label",te._label).replace("title",te._title).getRegex(),te.bullet=/(?:[*+-]|\d{1,9}[.)])/,te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,te.item=Y(te.item,"gm").replace(/bull/g,te.bullet).getRegex(),te.list=Y(te.list).replace(/bull/g,te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+te.def.source+")").getRegex(),te._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",te._comment=/<!--(?!-?>)[\s\S]*?-->/,te.html=Y(te.html,"i").replace("comment",te._comment).replace("tag",te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te.paragraph=Y(te._paragraph).replace("hr",te.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",te._tag).getRegex(),te.blockquote=Y(te.blockquote).replace("paragraph",te.paragraph).getRegex(),te.normal=le({},te),te.gfm=le({},te.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*|$)"}),te.gfm.nptable=Y(te.gfm.nptable).replace("hr",te.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",te._tag).getRegex(),te.gfm.table=Y(te.gfm.table).replace("hr",te.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",te._tag).getRegex(),te.pedantic=le({},te.normal,{html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te._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:J,paragraph:Y(te.normal._paragraph).replace("hr",te.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:J,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:J,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Z.punctuation=Y(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=Y(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=Y(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=Y(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=Y(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=Y(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=Y(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=Y(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=Y(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=Y(Z._blockSkip,"g").getRegex(),Z.overlapSkip=Y(Z._overlapSkip,"g").getRegex(),Z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Z._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])?)+(?![-_])/,Z.autolink=Y(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex(),Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Z.tag=Y(Z.tag).replace("comment",te._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=Y(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=Y(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=Y(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=le({},Z),Z.pedantic=le({},Z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=le({},Z.normal,{escape:Y(Z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Z.gfm.url=Y(Z.gfm.url,"i").replace("email",Z.gfm._extended_email).getRegex(),Z.breaks=le({},Z.gfm,{br:Y(Z.br).replace("{2,}","*").getRegex(),text:Y(Z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var _e={block:te,inline:Z},we=O.defaults,De=_e.block,Ee=_e.inline;function xe(q){return q.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ve(q){var se="",he,V,$=q.length;for(he=0;he<$;he++)V=q.charCodeAt(he),Math.random()>.5&&(V="x"+V.toString(16)),se+="&#"+V+";";return se}var X=function(){function q(he){this.tokens=[],this.tokens.links=Object.create(null),this.options=he||we,this.options.tokenizer=this.options.tokenizer||new z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:De.normal,inline:Ee.normal};this.options.pedantic?(V.block=De.pedantic,V.inline=Ee.pedantic):this.options.gfm&&(V.block=De.gfm,this.options.breaks?V.inline=Ee.breaks:V.inline=Ee.gfm),this.tokenizer.rules=V}q.lex=function(V,$){var re=new q($);return re.lex(V)};var se=q.prototype;return se.lex=function(V){return V=V.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(V,$,re){$===void 0&&($=[]),re===void 0&&(re=!0),V=V.replace(/^ +$/gm,"");for(var oe,Se,Me,Be;V;){if(oe=this.tokenizer.space(V)){V=V.substring(oe.raw.length),oe.type&&$.push(oe);continue}if(oe=this.tokenizer.code(V,$)){V=V.substring(oe.raw.length),oe.type?$.push(oe):(Be=$[$.length-1],Be.raw+=`
`+oe.raw,Be.text+=`
`+oe.text);continue}if(oe=this.tokenizer.fences(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.heading(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.nptable(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.hr(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.blockquote(V)){V=V.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],re),$.push(oe);continue}if(oe=this.tokenizer.list(V)){for(V=V.substring(oe.raw.length),Me=oe.items.length,Se=0;Se<Me;Se++)oe.items[Se].tokens=this.blockTokens(oe.items[Se].text,[],!1);$.push(oe);continue}if(oe=this.tokenizer.html(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(re&&(oe=this.tokenizer.def(V))){V=V.substring(oe.raw.length),this.tokens.links[oe.tag]||(this.tokens.links[oe.tag]={href:oe.href,title:oe.title});continue}if(oe=this.tokenizer.table(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.lheading(V)){V=V.substring(oe.raw.length),$.push(oe);continue}if(re&&(oe=this.tokenizer.paragraph(V))){V=V.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.text(V,$)){V=V.substring(oe.raw.length),oe.type?$.push(oe):(Be=$[$.length-1],Be.raw+=`
`+oe.raw,Be.text+=`
`+oe.text);continue}if(V){var Ke="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return $},se.inline=function(V){var $,re,oe,Se,Me,Be,Ke=V.length;for($=0;$<Ke;$++){Be=V[$];switch(Be.type){case"paragraph":case"text":case"heading":{Be.tokens=[],this.inlineTokens(Be.text,Be.tokens);break}case"table":{for(Be.tokens={header:[],cells:[]},Se=Be.header.length,re=0;re<Se;re++)Be.tokens.header[re]=[],this.inlineTokens(Be.header[re],Be.tokens.header[re]);for(Se=Be.cells.length,re=0;re<Se;re++)for(Me=Be.cells[re],Be.tokens.cells[re]=[],oe=0;oe<Me.length;oe++)Be.tokens.cells[re][oe]=[],this.inlineTokens(Me[oe],Be.tokens.cells[re][oe]);break}case"blockquote":{this.inline(Be.tokens);break}case"list":{for(Se=Be.items.length,re=0;re<Se;re++)this.inline(Be.items[re].tokens);break}}}return V},se.inlineTokens=function(V,$,re,oe,Se){$===void 0&&($=[]),re===void 0&&(re=!1),oe===void 0&&(oe=!1),Se===void 0&&(Se="");var Me,Be=V,Ke;if(this.tokens.links){var Xe=Object.keys(this.tokens.links);if(Xe.length>0)for(;(Ke=this.tokenizer.rules.inline.reflinkSearch.exec(Be))!=null;)Xe.includes(Ke[0].slice(Ke[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ke=this.tokenizer.rules.inline.blockSkip.exec(Be))!=null;)Be=Be.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;V;){if(Me=this.tokenizer.escape(V)){V=V.substring(Me.raw.length),$.push(Me);continue}if(Me=this.tokenizer.tag(V,re,oe)){V=V.substring(Me.raw.length),re=Me.inLink,oe=Me.inRawBlock,$.push(Me);continue}if(Me=this.tokenizer.link(V)){V=V.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,oe)),$.push(Me);continue}if(Me=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,oe)),$.push(Me);continue}if(Me=this.tokenizer.strong(V,Be,Se)){V=V.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],re,oe),$.push(Me);continue}if(Me=this.tokenizer.em(V,Be,Se)){V=V.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],re,oe),$.push(Me);continue}if(Me=this.tokenizer.codespan(V)){V=V.substring(Me.raw.length),$.push(Me);continue}if(Me=this.tokenizer.br(V)){V=V.substring(Me.raw.length),$.push(Me);continue}if(Me=this.tokenizer.del(V)){V=V.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],re,oe),$.push(Me);continue}if(Me=this.tokenizer.autolink(V,ve)){V=V.substring(Me.raw.length),$.push(Me);continue}if(!re&&(Me=this.tokenizer.url(V,ve))){V=V.substring(Me.raw.length),$.push(Me);continue}if(Me=this.tokenizer.inlineText(V,oe,xe)){V=V.substring(Me.raw.length),Se=Me.raw.slice(-1),$.push(Me);continue}if(V){var Ge="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return $},be(q,null,[{key:"rules",get:function(){return{block:De,inline:Ee}}}]),q}(),Ae=O.defaults,Q=c.cleanUrl,ue=c.escape,ee=function(){function q(he){this.options=he||Ae}var se=q.prototype;return se.code=function(V,$,re){var oe=($||"").match(/\S*/)[0];if(this.options.highlight){var Se=this.options.highlight(V,oe);Se!=null&&Se!==V&&(re=!0,V=Se)}return oe?'<pre><code class="'+this.options.langPrefix+ue(oe,!0)+'">'+(re?V:ue(V,!0))+`</code></pre>
`:"<pre><code>"+(re?V:ue(V,!0))+`</code></pre>
`},se.blockquote=function(V){return`<blockquote>
`+V+`</blockquote>
`},se.html=function(V){return V},se.heading=function(V,$,re,oe){return this.options.headerIds?"<h"+$+' id="'+this.options.headerPrefix+oe.slug(re)+'">'+V+"</h"+$+`>
`:"<h"+$+">"+V+"</h"+$+`>
`},se.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},se.list=function(V,$,re){var oe=$?"ol":"ul",Se=$&&re!==1?' start="'+re+'"':"";return"<"+oe+Se+`>
`+V+"</"+oe+`>
`},se.listitem=function(V){return"<li>"+V+`</li>
`},se.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(V){return"<p>"+V+`</p>
`},se.table=function(V,$){return $&&($="<tbody>"+$+"</tbody>"),`<table>
<thead>
`+V+`</thead>
`+$+`</table>
`},se.tablerow=function(V){return`<tr>
`+V+`</tr>
`},se.tablecell=function(V,$){var re=$.header?"th":"td",oe=$.align?"<"+re+' align="'+$.align+'">':"<"+re+">";return oe+V+"</"+re+`>
`},se.strong=function(V){return"<strong>"+V+"</strong>"},se.em=function(V){return"<em>"+V+"</em>"},se.codespan=function(V){return"<code>"+V+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(V){return"<del>"+V+"</del>"},se.link=function(V,$,re){if(V=Q(this.options.sanitize,this.options.baseUrl,V),V===null)return re;var oe='<a href="'+ue(V)+'"';return $&&(oe+=' title="'+$+'"'),oe+=">"+re+"</a>",oe},se.image=function(V,$,re){if(V=Q(this.options.sanitize,this.options.baseUrl,V),V===null)return re;var oe='<img src="'+V+'" alt="'+re+'"';return $&&(oe+=' title="'+$+'"'),oe+=this.options.xhtml?"/>":">",oe},se.text=function(V){return V},q}(),ae=function(){function q(){}var se=q.prototype;return se.strong=function(V){return V},se.em=function(V){return V},se.codespan=function(V){return V},se.del=function(V){return V},se.html=function(V){return V},se.text=function(V){return V},se.link=function(V,$,re){return""+re},se.image=function(V,$,re){return""+re},se.br=function(){return""},q}(),fe=function(){function q(){this.seen={}}var se=q.prototype;return se.slug=function(V){var $=V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty($)){var re=$;do this.seen[re]++,$=re+"-"+this.seen[re];while(this.seen.hasOwnProperty($))}return this.seen[$]=0,$},q}(),Re=O.defaults,pe=c.unescape,ie=function(){function q(he){this.options=he||Re,this.options.renderer=this.options.renderer||new ee,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ae,this.slugger=new fe}q.parse=function(V,$){var re=new q($);return re.parse(V)};var se=q.prototype;return se.parse=function(V,$){$===void 0&&($=!0);var re="",oe,Se,Me,Be,Ke,Xe,Ge,rt,qe,Ve,at,Qe,$e,nt,Ye,st,Tt,wt,xt=V.length;for(oe=0;oe<xt;oe++){Ve=V[oe];switch(Ve.type){case"space":continue;case"hr":{re+=this.renderer.hr();continue}case"heading":{re+=this.renderer.heading(this.parseInline(Ve.tokens),Ve.depth,pe(this.parseInline(Ve.tokens,this.textRenderer)),this.slugger);continue}case"code":{re+=this.renderer.code(Ve.text,Ve.lang,Ve.escaped);continue}case"table":{for(rt="",Ge="",Be=Ve.header.length,Se=0;Se<Be;Se++)Ge+=this.renderer.tablecell(this.parseInline(Ve.tokens.header[Se]),{header:!0,align:Ve.align[Se]});for(rt+=this.renderer.tablerow(Ge),qe="",Be=Ve.cells.length,Se=0;Se<Be;Se++){for(Xe=Ve.tokens.cells[Se],Ge="",Ke=Xe.length,Me=0;Me<Ke;Me++)Ge+=this.renderer.tablecell(this.parseInline(Xe[Me]),{header:!1,align:Ve.align[Me]});qe+=this.renderer.tablerow(Ge)}re+=this.renderer.table(rt,qe);continue}case"blockquote":{qe=this.parse(Ve.tokens),re+=this.renderer.blockquote(qe);continue}case"list":{for(at=Ve.ordered,Qe=Ve.start,$e=Ve.loose,Be=Ve.items.length,qe="",Se=0;Se<Be;Se++)Ye=Ve.items[Se],st=Ye.checked,Tt=Ye.task,nt="",Ye.task&&(wt=this.renderer.checkbox(st),$e?Ye.tokens.length>0&&Ye.tokens[0].type==="text"?(Ye.tokens[0].text=wt+" "+Ye.tokens[0].text,Ye.tokens[0].tokens&&Ye.tokens[0].tokens.length>0&&Ye.tokens[0].tokens[0].type==="text"&&(Ye.tokens[0].tokens[0].text=wt+" "+Ye.tokens[0].tokens[0].text)):Ye.tokens.unshift({type:"text",text:wt}):nt+=wt),nt+=this.parse(Ye.tokens,$e),qe+=this.renderer.listitem(nt,Tt,st);re+=this.renderer.list(qe,at,Qe);continue}case"html":{re+=this.renderer.html(Ve.text);continue}case"paragraph":{re+=this.renderer.paragraph(this.parseInline(Ve.tokens));continue}case"text":{for(qe=Ve.tokens?this.parseInline(Ve.tokens):Ve.text;oe+1<xt&&V[oe+1].type==="text";)Ve=V[++oe],qe+=`
`+(Ve.tokens?this.parseInline(Ve.tokens):Ve.text);re+=$?this.renderer.paragraph(qe):qe;continue}default:{var je='Token with "'+Ve.type+'" type was not found.';if(this.options.silent){console.error(je);return}else throw new Error(je)}}}return re},se.parseInline=function(V,$){$=$||this.renderer;var re="",oe,Se,Me=V.length;for(oe=0;oe<Me;oe++){Se=V[oe];switch(Se.type){case"escape":{re+=$.text(Se.text);break}case"html":{re+=$.html(Se.text);break}case"link":{re+=$.link(Se.href,Se.title,this.parseInline(Se.tokens,$));break}case"image":{re+=$.image(Se.href,Se.title,Se.text);break}case"strong":{re+=$.strong(this.parseInline(Se.tokens,$));break}case"em":{re+=$.em(this.parseInline(Se.tokens,$));break}case"codespan":{re+=$.codespan(Se.text);break}case"br":{re+=$.br();break}case"del":{re+=$.del(this.parseInline(Se.tokens,$));break}case"text":{re+=$.text(Se.text);break}default:{var Be='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(Be);return}else throw new Error(Be)}}}return re},q}(),Ie=c.merge,Oe=c.checkSanitizeDeprecation,Ne=c.escape,Le=O.getDefaults,Ce=O.changeDefaults,Ue=O.defaults;function Te(q,se,he){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof se=="function"&&(he=se,se=null),se=Ie({},Te.defaults,se||{}),Oe(se),he){var V=se.highlight,$;try{$=X.lex(q,se)}catch(Me){return he(Me)}var re=function(Be){var Ke;if(!Be)try{Ke=ie.parse($,se)}catch(Xe){Be=Xe}return se.highlight=V,Be?he(Be):he(null,Ke)};if(!V||V.length<3)return re();if(delete se.highlight,!$.length)return re();var oe=0;Te.walkTokens($,function(Me){Me.type==="code"&&(oe++,setTimeout(function(){V(Me.text,Me.lang,function(Be,Ke){if(Be)return re(Be);Ke!=null&&Ke!==Me.text&&(Me.text=Ke,Me.escaped=!0),oe--,oe===0&&re()})},0))}),oe===0&&re();return}try{var Se=X.lex(q,se);return se.walkTokens&&Te.walkTokens(Se,se.walkTokens),ie.parse(Se,se)}catch(Me){if(Me.message+=`
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+Ne(Me.message+"",!0)+"</pre>";throw Me}}Te.options=Te.setOptions=function(q){return Ie(Te.defaults,q),Ce(Te.defaults),Te},Te.getDefaults=Le,Te.defaults=Ue,Te.use=function(q){var se=Ie({},q);if(q.renderer&&function(){var V=Te.defaults.renderer||new ee,$=function(Se){var Me=V[Se];V[Se]=function(){for(var Be=arguments.length,Ke=new Array(Be),Xe=0;Xe<Be;Xe++)Ke[Xe]=arguments[Xe];var Ge=q.renderer[Se].apply(V,Ke);return Ge===!1&&(Ge=Me.apply(V,Ke)),Ge}};for(var re in q.renderer)$(re);se.renderer=V}(),q.tokenizer&&function(){var V=Te.defaults.tokenizer||new z,$=function(Se){var Me=V[Se];V[Se]=function(){for(var Be=arguments.length,Ke=new Array(Be),Xe=0;Xe<Be;Xe++)Ke[Xe]=arguments[Xe];var Ge=q.tokenizer[Se].apply(V,Ke);return Ge===!1&&(Ge=Me.apply(V,Ke)),Ge}};for(var re in q.tokenizer)$(re);se.tokenizer=V}(),q.walkTokens){var he=Te.defaults.walkTokens;se.walkTokens=function(V){q.walkTokens(V),he&&he(V)}}Te.setOptions(se)},Te.walkTokens=function(q,se){for(var he=ne(q),V;!(V=he()).done;){var $=V.value;se($);switch($.type){case"table":{for(var re=ne($.tokens.header),oe;!(oe=re()).done;){var Se=oe.value;Te.walkTokens(Se,se)}for(var Me=ne($.tokens.cells),Be;!(Be=Me()).done;)for(var Ke=Be.value,Xe=ne(Ke),Ge;!(Ge=Xe()).done;){var rt=Ge.value;Te.walkTokens(rt,se)}break}case"list":{Te.walkTokens($.items,se);break}default:$.tokens&&Te.walkTokens($.tokens,se)}}},Te.Parser=ie,Te.parser=ie.parse,Te.Renderer=ee,Te.TextRenderer=ae,Te.Lexer=X,Te.lexer=X.lex,Te.Tokenizer=z,Te.Slugger=fe,Te.parse=Te;var Pe=Te;return Pe})},"8HAY":function(We,ce,F){"use strict";F.d(ce,"a",function(){return ne}),F.d(ce,"b",function(){return G}),F.d(ce,"d",function(){return O}),F.d(ce,"e",function(){return W}),F.d(ce,"c",function(){return e});var me=F("MI8n"),be=F("pmY6"),ye=F("3/fG"),ge=function(k,L,I,u){function m(i){return i instanceof I?i:new I(function(g){g(i)})}return new(I||(I=Promise))(function(i,g){function w(o){try{E(u.next(o))}catch(f){g(f)}}function x(o){try{E(u.throw(o))}catch(f){g(f)}}function E(o){o.done?i(o.value):m(o.value).then(w,x)}E((u=u.apply(k,L||[])).next())})};class ne extends be.a{constructor(k,L="",I="",u=!0,m){super();this._onDidChange=this._register(new me.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=k,this._label=L,this._cssClass=I,this._enabled=u,this._actionCallback=m}get id(){return this._id}get label(){return this._label}set label(k){this._setLabel(k)}_setLabel(k){this._label!==k&&(this._label=k,this._onDidChange.fire({label:k}))}get tooltip(){return this._tooltip||""}set tooltip(k){this._setTooltip(k)}_setTooltip(k){this._tooltip!==k&&(this._tooltip=k,this._onDidChange.fire({tooltip:k}))}get class(){return this._cssClass}set class(k){this._setClass(k)}_setClass(k){this._cssClass!==k&&(this._cssClass=k,this._onDidChange.fire({class:k}))}get enabled(){return this._enabled}set enabled(k){this._setEnabled(k)}_setEnabled(k){this._enabled!==k&&(this._enabled=k,this._onDidChange.fire({enabled:k}))}get checked(){return this._checked}set checked(k){this._setChecked(k)}_setChecked(k){this._checked!==k&&(this._checked=k,this._onDidChange.fire({checked:k}))}run(k,L){return ge(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(k))})}}class G extends be.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new me.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new me.b),this.onDidRun=this._onDidRun.event}run(k,L){return ge(this,void 0,void 0,function*(){if(!k.enabled)return;this._onBeforeRun.fire({action:k});let I;try{yield this.runAction(k,L)}catch(u){I=u}this._onDidRun.fire({action:k,error:I})})}runAction(k,L){return ge(this,void 0,void 0,function*(){yield k.run(L)})}}class O extends ne{constructor(k){super(O.ID,k,k?"separator text":"separator");this.checked=!1,this.enabled=!1}}O.ID="vs.actions.separator";class W{constructor(k,L,I,u){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=k,this.label=L,this.class=u,this._actions=I}get actions(){return this._actions}dispose(){}run(){return ge(this,void 0,void 0,function*(){})}}class e extends ne{constructor(){super(e.ID,ye.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(We,ce,F){We.exports={button:"button___1wy9m"}},"9Bee":function(We,ce,F){"use strict";var me=F("CDKA"),be=F("d7ih"),ye=F("dLI4"),ge=F("4d5L"),ne=F("YaWb"),G=F("IYef"),O=F("Hqw+"),W=F("XXmO"),e=F.n(W),k=F("T/Jt"),L=F.n(k),I=F("vg9a"),u=F("7O0G"),m=F.n(u),i=F("GcTH");function g(B,S){var R=B.match(/^(\s+)(?:```)/);if(R===null)return S;var M=R[1];return S.split(`
`).map(function(K){var U=K.match(/^\s+/);if(U===null)return K;var de=Object(O.a)(U,1),ke=de[0];return ke.length>=M.length?K.slice(M.length):K}).join(`
`)}var w=[],x=["<ul>"],E=new m.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){w.length=0,x=["<ul>"]}var d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function A(B,S,R,M){if(S>=B.length||B[S].level<=R)return S;var K=B[S];M.push("<li><a href='#"+K.anchor+"'>"+K.text+"</a>"),S++;var U=[];return S=A(B,S,K.level,U),U.length>0&&(M.push("<ul>"),U.forEach(function(de){M.push(de)}),M.push("</ul>")),M.push("</li>"),S=A(B,S,R,M),S}function s(){return A(w,0,0,x),x.push("</ul>"),x.join("")}var p={heading:function(S){var R=o.exec(S);if(R)return{type:"heading",raw:R[0],depth:R[1].length,text:R[2]}},fences:function(S){var R=this.rules.block.fences.exec(S);if(R){var M=R[0],K=g(M,R[3]||""),U=R[2]?R[2].trim():R[2];if(["latex","katex","math"].indexOf(U)>=0){var de=T(),ke=K;K=de,y[de]={type:"block",expression:ke}}return{type:"code",raw:M,lang:U,text:K}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,l=0,T=function(){return"__special_katext_id_".concat(l++,"__")},y={};function _(){return y}function v(){l=0,y={}}function n(B){return B=B.replace(C,function(S,R){var M=T();return y[M]={type:"inline",expression:R},M}),B}var a=E.listitem;E.listitem=function(B){return a(n(B))};var r=E.paragraph;E.paragraph=function(B){return r(n(B))};var t=E.tablecell;E.tablecell=function(B,S){return t(n(B),S)},E.code=function(B,S,R){var M=(S||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"<p class='editormd-tex'>".concat(B,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(S,'">').concat(R?B:Object(i.escape)(B,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(R?B:Object(i.escape)(B,!0))+"</code></pre>"},E.heading=function(B,S,R){var M=this.options.headerPrefix+R.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return w.push({anchor:M,level:S,text:B}),"<h"+S+' id="'+M+'">'+B+"</h"+S+">"},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:p,renderer:E});var c=m.a,b=F("SJMd"),h=F("ulZh"),D=F.n(h),P=F("m3rI"),j=F("Oy/b"),N=F("p5ED"),H=F("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 z=function(B,S){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,M){R.__proto__=M}||function(R,M){for(var K in M)Object.prototype.hasOwnProperty.call(M,K)&&(R[K]=M[K])})(B,S)};function J(B,S){function R(){this.constructor=B}z(B,S),B.prototype=S===null?Object.create(S):(R.prototype=S.prototype,new R)}function Y(B,S,R,M){return new(R||(R=Promise))(function(K,U){function de(ze){try{He(M.next(ze))}catch(Fe){U(Fe)}}function ke(ze){try{He(M.throw(ze))}catch(Fe){U(Fe)}}function He(ze){var Fe;ze.done?K(ze.value):(Fe=ze.value,Fe instanceof R?Fe:new R(function(Je){Je(Fe)})).then(de,ke)}He((M=M.apply(B,S||[])).next())})}function le(B,S){var R,M,K,U,de={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return U={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function ke(He){return function(ze){return function(Fe){if(R)throw new TypeError("Generator is already executing.");for(;de;)try{if(R=1,M&&(K=2&Fe[0]?M.return:Fe[0]?M.throw||((K=M.return)&&K.call(M),0):M.next)&&!(K=K.call(M,Fe[1])).done)return K;switch(M=0,K&&(Fe=[2&Fe[0],K.value]),Fe[0]){case 0:case 1:K=Fe;break;case 4:return de.label++,{value:Fe[1],done:!1};case 5:de.label++,M=Fe[1],Fe=[0];continue;case 7:Fe=de.ops.pop(),de.trys.pop();continue;default:if(!(K=de.trys,(K=K.length>0&&K[K.length-1])||Fe[0]!==6&&Fe[0]!==2)){de=0;continue}if(Fe[0]===3&&(!K||Fe[1]>K[0]&&Fe[1]<K[3])){de.label=Fe[1];break}if(Fe[0]===6&&de.label<K[1]){de.label=K[1],K=Fe;break}if(K&&de.label<K[2]){de.label=K[2],de.ops.push(Fe);break}K[2]&&de.ops.pop(),de.trys.pop();continue}Fe=S.call(B,de)}catch(Je){Fe=[6,Je],M=0}finally{R=K=0}if(5&Fe[0])throw Fe[1];return{value:Fe[0]?Fe[1]:void 0,done:!0}}([He,ze])}}}function te(){for(var B=0,S=0,R=arguments.length;S<R;S++)B+=arguments[S].length;var M=Array(B),K=0;for(S=0;S<R;S++)for(var U=arguments[S],de=0,ke=U.length;de<ke;de++,K++)M[K]=U[de];return M}var Z=function(){function B(){}return B.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},B.setAttributes=function(S,R){for(var M=0,K=R;M<K.length;M++){var U=K[M],de=U[0],ke=U[1];S.setAttribute(de,ke)}},B.createRect=function(S,R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",S.toString()),K.setAttribute("height",R.toString()),M&&B.setAttributes(K,M),K},B.createLine=function(S,R,M,K,U){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",S.toString()),de.setAttribute("y1",R.toString()),de.setAttribute("x2",M.toString()),de.setAttribute("y2",K.toString()),U&&B.setAttributes(de,U),de},B.createPolygon=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","polygon");return M.setAttribute("points",S),R&&B.setAttributes(M,R),M},B.createCircle=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","circle");return M.setAttribute("cx",(S/2).toString()),M.setAttribute("cy",(S/2).toString()),M.setAttribute("r",S.toString()),R&&B.setAttributes(M,R),M},B.createEllipse=function(S,R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(S/2).toString()),K.setAttribute("cy",(R/2).toString()),K.setAttribute("rx",(S/2).toString()),K.setAttribute("ry",(R/2).toString()),M&&B.setAttributes(K,M),K},B.createGroup=function(S){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&B.setAttributes(R,S),R},B.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},B.createMarker=function(S,R,M,K,U,de,ke){var He=document.createElementNS("http://www.w3.org/2000/svg","marker");return B.setAttributes(He,[["id",S],["orient",R],["markerWidth",M.toString()],["markerHeight",K.toString()],["refX",U.toString()],["refY",de.toString()]]),He.appendChild(ke),He},B.createText=function(S){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),S&&B.setAttributes(R,S),R},B.createTSpan=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","tspan");return M.textContent=S,R&&B.setAttributes(M,R),M},B.createImage=function(S){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&B.setAttributes(R,S),R},B.createPoint=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return M.x=S,M.y=R,M},B.createPath=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","path");return M.setAttribute("d",S),R&&B.setAttributes(M,R),M},B}(),_e=function(){function B(){}return B.addKey=function(S){B.key=S},Object.defineProperty(B,"isLicensed",{get:function(){return!!B.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(B.key)},enumerable:!1,configurable:!0}),B}(),we=function(){function B(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return B.prototype.rasterize=function(S,R,M){var K=this;return new Promise(function(U){var de=M!==void 0?M:document.createElement("canvas");S===null&&(K.markersOnly=!0,K.naturalSize=!1);var ke=document.createElementNS("http://www.w3.org/2000/svg","svg");ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),ke.setAttribute("width",R.width.baseVal.valueAsString),ke.setAttribute("height",R.height.baseVal.valueAsString),ke.setAttribute("viewBox","0 0 "+R.viewBox.baseVal.width.toString()+" "+R.viewBox.baseVal.height.toString()),ke.innerHTML=R.innerHTML,K.naturalSize===!0?(ke.width.baseVal.value=S.naturalWidth,ke.height.baseVal.value=S.naturalHeight):K.width!==void 0&&K.height!==void 0&&(ke.width.baseVal.value=K.width,ke.height.baseVal.value=K.height),de.width=ke.width.baseVal.value,de.height=ke.height.baseVal.value;var He=ke.outerHTML,ze=de.getContext("2d");K.markersOnly!==!0&&ze.drawImage(S,0,0,de.width,de.height);var Fe=window.URL,Je=new Image(de.width,de.height);Je.setAttribute("crossOrigin","anonymous");var dt=new Blob([He],{type:"image/svg+xml"}),It=Fe.createObjectURL(dt);Je.onload=function(){ze.drawImage(Je,0,0),Fe.revokeObjectURL(It);var Gt=de.toDataURL(K.imageType,K.imageQuality);U(Gt)},Je.src=It})},B}(),De=function(){},Ee=function(){function B(S){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(B.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(B.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(B.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),B.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},B.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},B.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ve("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ve("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},B.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},B}(),xe=function(B,S){this.selector=B,this.style=S},ve=function(B,S){this.localName=B,this.style=S},X=function(){function B(S,R,M,K,U){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=S,this.displayMode=R,this.markerItems=M,this.uiStyleSettings=K,this.styles=U,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return B.prototype.show=function(S){var R=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var M=document.createElement("div");M.className=this.toolbarBlockStyleClass.name,M.style.whiteSpace="nowrap",this.uiContainer.appendChild(M),this.addActionButton(M,'<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","Select mode"),this.addActionButton(M,'<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","Delete marker"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(M,'<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","Delete all markers"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(M,'<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","Undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(M,'<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","Redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(M,'<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","Zoom in"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(M,'<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","Zoom out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(M,'<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","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=""+R.toolbarButtonStyleClass.name,de.setAttribute("data-type-name",U.typeName),de.setAttribute("aria-label",U.title),de.setAttribute("title",U.title),de.innerHTML=U.icon,de.addEventListener("click",function(){R.markerToolbarButtonClicked(de,U)}),R.buttons.push(de),R.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 K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",K.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(K),this.addActionButton(K,'<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","Save and close"),this.addActionButton(K,'<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","Close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},B.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},B.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},B.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},B.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var R=0;R<this.markerButtons.length;R++)R<S||R===S&&this.markerButtons.length-1===S?this.markerButtonBlock.appendChild(this.markerButtons[R]):(R===S&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[R]))}},B.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")},B.prototype.resetButtonStyles=function(){var S=this;this.buttons.forEach(function(R){R.className=R.className.replace(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name,"").trim(),R.className=R.className.replace(S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:S.toolbarActiveButtonStyleColorsClass.name,"").trim(),R.className+=" "+(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name)})},B.prototype.addActionButton=function(S,R,M,K){var U=this,de=document.createElement("div");switch(de.className=""+this.toolbarButtonStyleClass.name,de.innerHTML=R,de.setAttribute("role","button"),de.setAttribute("data-action",M),de.title=K,de.setAttribute("aria-label",K),de.addEventListener("click",function(){U.actionToolbarButtonClicked(de,M)}),M){case"select":de.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":de.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":de.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":de.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":de.style.fill=this.uiStyleSettings.closeButtonColor}S.appendChild(de),this.buttons.push(de)},B.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ve("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 ve("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ve("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ve("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 ve("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ve("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
padding: `+S+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ve("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ve("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new xe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new xe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},B.prototype.markerToolbarButtonClicked=function(S,R){this.setActiveButton(S),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("marker",R)}),this.markerButtonOverflowBlock.style.display="none"},B.prototype.actionToolbarButtonClicked=function(S,R){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("action",R)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},B.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},B.prototype.setActiveMarkerButton=function(S){var R=this.markerButtons.find(function(M){return M.getAttribute("data-type-name")===S});R&&this.setActiveButton(R)},B.prototype.setCurrentMarker=function(S){var R=this;this.currentMarker=S,this.buttons.filter(function(M){return/delete|notes/.test(M.getAttribute("data-action"))}).forEach(function(M){R.currentMarker===void 0?(M.style.fillOpacity="0.4",M.style.pointerEvents="none"):(M.style.fillOpacity="1",M.style.pointerEvents="all")})},B}(),Ae=function(){function B(S,R,M,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=R,this.uiStyleSettings=M,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return B.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new ve("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 ve("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ve("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ve("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ve("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 ve("toolbox-panel-row_colors",`
background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ve("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
padding: `+R+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ve("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ve("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new xe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new xe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new xe("."+this.toolboxPanelRowStyleClass.name+" > div",`
scrollbar-width: thin;
`)),this.styles.addRule(new xe("."+this.toolboxPanelRowStyleClass.name+" > div::-webkit-scrollbar",`
height: 10px;
width: 10px;
`)),this.styles.addRule(new xe("."+this.toolboxPanelRowStyleClass.name+" > div::-webkit-scrollbar-track",`
background-color: transparent;
`)),this.styles.addRule(new xe("."+this.toolboxPanelRowStyleClass.name+" > div::-webkit-scrollbar-thumb",`
background-color: #444;
border-radius: 20px;
border: 2px solid #aaa;
`))},B.prototype.show=function(S){var R;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((R=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},B.prototype.setPanelButtons=function(S){var R,M,K=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((R=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var de;U.uiStyleSettings=K.uiStyleSettings;var ke=document.createElement("div");ke.className=K.toolboxButtonStyleClass.name+" "+((de=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&de!==void 0?de:K.toolboxButtonStyleColorsClass.name),ke.innerHTML=U.icon,ke.title=U.title,ke.setAttribute("role","button"),ke.setAttribute("aria-label",U.title),U.id&&ke.setAttribute("data-action",U.id),ke.addEventListener("click",function(){K.panelButtonClick(U)}),K.panelButtons.push(ke),K.buttonRow.appendChild(ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},B.prototype.panelButtonClick=function(S){var R=this,M=-1;if(S!==this.activePanel){M=this.panels.indexOf(S),this.panelRow.innerHTML="";var K=S.getUi();K.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(K),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){R.displayMode==="inline"?R.panelRow.style.display="none":R.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,de){var ke,He;U.className=R.toolboxButtonStyleClass.name+" "+(de===M?""+((ke=R.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ke!==void 0?ke:R.toolboxActiveButtonStyleColorsClass.name):""+((He=R.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&He!==void 0?He:R.toolboxButtonStyleColorsClass.name))})},B}(),Q=function(){function B(S,R,M){this.title=S,this.icon=R,this._id=M}return Object.defineProperty(B.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),B}(),ue=function(B){function S(R,M,K,U,de){var ke=B.call(this,R,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>',de||"color-picker-panel")||this;return ke.colors=[],ke.addTransparent=!1,ke.colorBoxes=[],ke.colors=M,ke.currentColor=K,ke.setCurrentColor=ke.setCurrentColor.bind(ke),ke.getColorBox=ke.getColorBox.bind(ke),ke}return J(S,B),S.prototype.getUi=function(){var R=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.overflowX="auto",M.style.whiteSpace="nowrap",this.colors.forEach(function(K){var U=R.getColorBox(K);M.appendChild(U),R.colorBoxes.push(U)}),M},S.prototype.getColorBox=function(R){var M=this,K=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-K,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=R===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",de.addEventListener("click",function(){M.setCurrentColor(R,de)});var ke=document.createElement("div");return ke.style.display="inline-block",ke.style.width=U-2+"px",ke.style.height=U-2+"px",ke.style.backgroundColor=R,ke.style.borderRadius=U/2+"px",R==="transparent"&&(ke.style.fill=this.uiStyleSettings.toolboxAccentColor,ke.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(ke),de},S.prototype.setCurrentColor=function(R,M){var K=this;this.currentColor=R,this.colorBoxes.forEach(function(U){U.style.borderColor=U===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(R)},S}(Q),ee=function(){function B(S,R,M){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=R,this.globalSettings=M,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(B.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(S){return!1},Object.defineProperty(B.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),B.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},B.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},B.prototype.pointerDown=function(S,R){},B.prototype.dblClick=function(S,R){},B.prototype.manipulate=function(S){},B.prototype.pointerUp=function(S){this.stateChanged()},B.prototype.dispose=function(){},B.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},B.prototype.getState=function(){return{typeName:B.typeName,state:this.state,notes:this.notes}},B.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},B.prototype.scale=function(S,R){},B.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},B.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},B.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},B.typeName="MarkerBase",B}(),ae=function(){function B(){this.findGripByVisual=this.findGripByVisual.bind(this)}return B.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},B}(),fe=function(){function B(){this.GRIP_SIZE=10,this.visual=Z.createGroup(),this.visual.appendChild(Z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Z.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return B.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},B}(),Re=function(){function B(){}return B.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},B.toSVGMatrix=function(S,R){return S.a=R.a,S.b=R.b,S.c=R.c,S.d=R.d,S.e=R.e,S.f=R.f,S},B}(),pe=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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(Z.createTransform()),U.setupControlBox(),U}return J(S,B),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(R){this._visual=R;var M=Z.createTransform();this._visual.transform.baseVal.appendItem(M)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(R){return!!B.prototype.ownsTarget.call(this,R)||!!(this.controlGrips.findGripByVisual(R)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(R))},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.state==="new"&&(this.left=R.x,this.top=R.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(R);if(this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.offsetX=K.x-this.left,this.offsetY=K.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(M),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M)){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"},S.prototype.pointerUp=function(R){var M=this.state;B.prototype.pointerUp.call(this,R),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(R),this._state="select",M==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(R){this.visual.style.transform="translate("+R.x+"px, "+R.y+"px)"},S.prototype.manipulate=function(R){var M=this.unrotatePoint(R);this.state==="creating"?this.resize(R):this.state==="move"?(this.left=this.manipulationStartLeft+(M.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(M.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(M):this.state==="rotate"&&this.rotate(R)},S.prototype.resize=function(R){var M=this.manipulationStartLeft,K=this.manipulationStartWidth,U=this.manipulationStartTop,de=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:M=this.manipulationStartLeft+R.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-M;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+R.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+R.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+R.y-this.manipulationStartY}K>=0?(this.left=M,this.width=K):(this.left=M+K,this.width=-K),de>=0?(this.top=U,this.height=de):(this.top=U+de,this.height=-de),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(R){if(Math.abs(R.x-this.centerX)>.1){var M=Math.sign(R.x-this.centerX);this.rotationAngle=180*Math.atan((R.y-this.centerY)/(R.x-this.centerX))/Math.PI+90*M,this.applyRotation()}},S.prototype.applyRotation=function(){var R=this.container.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(R,0)},S.prototype.rotatePoint=function(R){if(this.rotationAngle===0)return R;var M=this.container.getCTM(),K=Z.createPoint(R.x,R.y);return{x:(K=K.matrixTransform(M)).x,y:K.y}},S.prototype.unrotatePoint=function(R){if(this.rotationAngle===0)return R;var M=this.container.getCTM();M=M.inverse();var K=Z.createPoint(R.x,R.y);return{x:(K=K.matrixTransform(M)).x,y:K.y}},S.prototype.select=function(){B.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){B.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=Z.createGroup();var R=Z.createTransform();R.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(R),this.container.appendChild(this.controlBox),this.controlRect=Z.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=Z.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 ae,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var R=this.controlBox.transform.baseVal.getItem(0);R.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(R,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},S.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},S.prototype.createGrip=function(){var R=new fe;return R.visual.transform.baseVal.appendItem(Z.createTransform()),this.controlBox.appendChild(R.visual),R},S.prototype.positionGrips=function(){var R=this.controlGrips.topLeft.GRIP_SIZE,M=-R/2,K=M,U=(this.width+this.CB_DISTANCE)/2-R/2,de=(this.height+this.CB_DISTANCE)/2-R/2,ke=this.height+this.CB_DISTANCE-R/2,He=this.width+this.CB_DISTANCE-R/2;this.positionGrip(this.controlGrips.topLeft.visual,M,K),this.positionGrip(this.controlGrips.topCenter.visual,U,K),this.positionGrip(this.controlGrips.topRight.visual,He,K),this.positionGrip(this.controlGrips.centerLeft.visual,M,de),this.positionGrip(this.controlGrips.centerRight.visual,He,de),this.positionGrip(this.controlGrips.bottomLeft.visual,M,ke),this.positionGrip(this.controlGrips.bottomCenter.visual,U,ke),this.positionGrip(this.controlGrips.bottomRight.visual,He,ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,K-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(R,M,K){var U=R.transform.baseVal.getItem(0);U.setTranslate(M,K),R.transform.baseVal.replaceItem(U,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Re.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Re.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},B.prototype.getState.call(this))},S.prototype.restoreState=function(R){B.prototype.restoreState.call(this,R);var M=R;this.left=M.left,this.top=M.top,this.width=M.width,this.height=M.height,this.rotationAngle=M.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Re.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,M.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Re.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,M.containerTransformMatrix))},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M);var K=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:K.x*R,y:K.y*M});this.left=U.x,this.top=U.y,this.width=this.width*R,this.height=this.height*M,this.adjustControlBox()},S}(ee),ie=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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 J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.visual)},S.prototype.createVisual=function(){this.visual=Z.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},S.prototype.manipulate=function(R){B.prototype.manipulate.call(this,R)},S.prototype.resize=function(R){B.prototype.resize.call(this,R),this.setSize()},S.prototype.setSize=function(){B.prototype.setSize.call(this),Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(R){B.prototype.pointerUp.call(this,R),this.setSize()},S.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&Z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},S.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&Z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&Z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&Z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},B.prototype.getState.call(this))},S.prototype.restoreState=function(R){var M=R;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),B.prototype.restoreState.call(this,R),this.setSize()},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.setSize()},S.title="Rectangle marker",S}(pe),Ie=function(B){function S(R,M,K,U,de){var ke=B.call(this,R,U||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>',de||"line-width-panel")||this;return ke.widths=[],ke.widthBoxes=[],ke.widths=M,ke.currentWidth=K,ke.setCurrentWidth=ke.setCurrentWidth.bind(ke),ke}return J(S,B),S.prototype.getUi=function(){var R=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.widths.forEach(function(K){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=K===R.currentWidth?R.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){R.setCurrentWidth(K,U)}),M.appendChild(U);var de=document.createElement("div");de.innerText=K.toString(),de.style.marginRight="5px",U.appendChild(de);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.display="flex",ke.style.alignItems="center";var He=document.createElement("hr");He.style.minWidth="20px",He.style.border="0px",He.style.borderTop=K+"px solid "+R.uiStyleSettings.toolboxColor,He.style.flexGrow="2",ke.appendChild(He),U.appendChild(ke),R.widthBoxes.push(U)}),M},S.prototype.setCurrentWidth=function(R,M){var K=this;this.currentWidth=R,this.widthBoxes.forEach(function(U){U.style.borderColor=U===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(Q),Oe=function(B){function S(R,M,K,U,de){var ke=B.call(this,R,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>',de||"line-style-panel")||this;return ke.styles=[],ke.styleBoxes=[],ke.styles=M,ke.currentStyle=K,ke.setCurrentStyle=ke.setCurrentStyle.bind(ke),ke}return J(S,B),S.prototype.getUi=function(){var R=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.styles.forEach(function(K){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/R.styles.length-5+"%",U.style.borderColor=K===R.currentStyle?R.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){R.setCurrentStyle(K,U)}),M.appendChild(U);var de=document.createElement("div");de.style.minHeight="20px",de.style.flexGrow="2",de.style.overflow="hidden";var ke=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+R.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
</svg>`;de.innerHTML=ke,U.appendChild(de),R.styleBoxes.push(U)}),M},S.prototype.setCurrentStyle=function(R,M){var K=this;this.currentStyle=R,this.styleBoxes.forEach(function(U){U.style.borderColor=U===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(Q),Ne=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.strokeColor=K.defaultColor,U.strokeWidth=K.defaultStrokeWidth,U.strokeDasharray=K.defaultStrokeDasharray,U.strokePanel=new ue("Line color",K.defaultColorSet,K.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new Ie("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Oe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return J(S,B),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=B.prototype.getState.call(this);return R.typeName=S.typeName,R},S.typeName="FrameMarker",S.title="Frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',S}(ie),Le=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,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text",this.wrapText=!1,this.defaultText="Your text here"},Ce=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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 J(S,B),S.prototype.ownsTarget=function(R){return!!B.prototype.ownsTarget.call(this,R)||!(!this.grip1.ownsTarget(R)&&!this.grip2.ownsTarget(R))},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.manipulationStartX=R.x,this.manipulationStartY=R.y,this.state==="new"&&(this.x1=R.x,this.y1=R.y,this.x2=R.x,this.y2=R.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(M)?this.activeGrip=this.grip1:this.grip2.ownsTarget(M)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(R){var M=this.state;B.prototype.pointerUp.call(this,R),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(R),this._state="select",M==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(R){this.state==="creating"?this.resize(R):this.state==="move"?(this.x1=this.manipulationStartX1+R.x-this.manipulationStartX,this.y1=this.manipulationStartY1+R.y-this.manipulationStartY,this.x2=this.manipulationStartX2+R.x-this.manipulationStartX,this.y2=this.manipulationStartY2+R.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(R)},S.prototype.resize=function(R){switch(this.activeGrip){case this.grip1:this.x1=R.x,this.y1=R.y;break;case this.grip2:case void 0:this.x2=R.x,this.y2=R.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){B.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){B.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=Z.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var R=new fe;return R.visual.transform.baseVal.appendItem(Z.createTransform()),this.controlBox.appendChild(R.visual),R},S.prototype.positionGrips=function(){var R=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-R/2,this.y1-R/2),this.positionGrip(this.grip2.visual,this.x2-R/2,this.y2-R/2)},S.prototype.positionGrip=function(R,M,K){var U=R.transform.baseVal.getItem(0);U.setTranslate(M,K),R.transform.baseVal.replaceItem(U,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},B.prototype.getState.call(this))},S.prototype.restoreState=function(R){B.prototype.restoreState.call(this,R);var M=R;this.x1=M.x1,this.y1=M.y1,this.x2=M.x2,this.y2=M.y2},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.x1=this.x1*R,this.y1=this.y1*M,this.x2=this.x2*R,this.y2=this.y2*M,this.adjustVisual(),this.adjustControlBox()},S}(ee),Ue=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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=K.defaultColor,U.strokeWidth=K.defaultStrokeWidth,U.strokeDasharray=K.defaultStrokeDasharray,U.strokePanel=new ue("Line color",K.defaultColorSet,K.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new Ie("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Oe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorLine&&R!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=Z.createGroup(),this.selectorLine=Z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Z.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},S.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},S.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){B.prototype.restoreState.call(this,R);var M=R;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',S}(Ce),Te=function(B){function S(R,M,K,U,de){var ke=B.call(this,R,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>',de||"font-family-panel")||this;return ke.fonts=[],ke.fontBoxes=[],ke.fonts=M,ke.currentFont=K,ke.setCurrentFont=ke.setCurrentFont.bind(ke),ke}return J(S,B),S.prototype.getUi=function(){var R=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.flexGrow="2",this.fonts.forEach(function(K){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/R.fonts.length-5+"%",U.style.borderColor=K===R.currentFont?R.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){R.setCurrentFont(K,U)}),M.appendChild(U);var de=document.createElement("div");de.style.display="flex",de.style.minHeight="20px",de.style.flexGrow="2",de.style.fontFamily=K,de.style.overflow="hidden";var ke=document.createElement("div");ke.style.whiteSpace="nowrap",ke.style.overflow="hidden",ke.style.textOverflow="ellipsis",ke.innerHTML="The quick brown fox jumps over the lazy dog",de.appendChild(ke),U.appendChild(de),R.fontBoxes.push(U)}),M},S.prototype.setCurrentFont=function(R,M){var K=this;this.currentFont=R,this.fontBoxes.forEach(function(U){U.style.borderColor=U===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(Q),Pe=function(B){function S(R,M,K){var U,de=B.call(this,R,M,K)||this;return de.color="transparent",de.padding=5,de.DEFAULT_TEXT="your text here",de.isMoved=!1,de.color=K.defaultColor,de.fontFamily=K.defaultFontFamily,de.text=(U=K.defaultText)!==null&&U!==void 0?U:de.DEFAULT_TEXT,de.defaultSize={x:100,y:30},de.setColor=de.setColor.bind(de),de.setFont=de.setFont.bind(de),de.renderText=de.renderText.bind(de),de.sizeText=de.sizeText.bind(de),de.textEditDivClicked=de.textEditDivClicked.bind(de),de.showTextEditor=de.showTextEditor.bind(de),de.setSize=de.setSize.bind(de),de.positionTextEditor=de.positionTextEditor.bind(de),de.wrapText=de.wrapText.bind(de),de.colorPanel=new ue("Color",K.defaultColorSet,K.defaultColor),de.colorPanel.onColorChanged=de.setColor,de.fontFamilyPanel=new Te("Font",K.defaultFontFamilies,K.defaultFontFamily),de.fontFamilyPanel.onFontChanged=de.setFont,de}return J(S,B),S.prototype.ownsTarget=function(R){if(B.prototype.ownsTarget.call(this,R)||R===this.visual||R===this.textElement||R===this.bgRectangle)return!0;var M=!1;return this.textElement.childNodes.forEach(function(K){K===R&&(M=!0)}),M},S.prototype.createVisual=function(){this.visual=Z.createGroup(),this.bgRectangle=Z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Z.createTransform()),this.textElement.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.isMoved=!1,this.pointerDownPoint=R,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},S.prototype.wrapText=function(){function R(ze){var Fe=ze[0].length;return ze.forEach(function(Je){Je.length>Fe&&(Fe=Je.length)}),.35*Fe/ze.length}if(this.text!==""){for(var M=this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/),K=1*this.width/this.height,U=new(Array.bind.apply(Array,te([void 0],M))),de=R(U),ke=Number.MAX_VALUE,He=function(){var ze=U[0];U.forEach(function(Fe){Fe.length>ze.length&&(ze=Fe)}),(ke=ze.lastIndexOf(" ",ke-1))>0?(U=[],M.forEach(function(Fe){for(var Je=Fe;Je.length>ke;){var dt=Je.lastIndexOf(" ",ke);dt<0&&(dt=Je.indexOf(" ")),dt>0?(U.push(Je.substring(0,dt)),Je=Je.substring(dt).trim()):(U.push(Je),Je="")}U.push(Je)}),de=R(U)):de=-1};de>K;)He();return U.join(`\r
`)}return this.text},S.prototype.renderText=function(){var R=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);(this.globalSettings.wrapText?this.wrapText():this.text).split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(M){R.textElement.appendChild(Z.createTSpan(M.trim()===""?" ":M.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var R=this.textElement.getBBox(),M=1;if(R.width>0&&R.height>0){var K=(1*this.width-this.width*this.padding*2/100)/R.width,U=(1*this.height-this.height*this.padding*2/100)/R.height;M=Math.min(K,U)}return M},S.prototype.getTextPosition=function(R){var M=window.getComputedStyle(this.textElement).direction==="rtl"?1:-1,K=this.textElement.getBBox(),U=0,de=0;return K.width>0&&K.height>0&&(U=(this.width+M*K.width*R)/2,de=this.height/2-K.height*R/2),{x:U,y:de}},S.prototype.sizeText=function(){var R=this.textElement.getBBox(),M=this.getTextScale(),K=this.getTextPosition(M);K.y-=R.y*M,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+M+", "+M+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(M,M))},S.prototype.manipulate=function(R){B.prototype.manipulate.call(this,R),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(R.x-this.pointerDownPoint.x)>5||Math.abs(R.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(R){B.prototype.resize.call(this,R),this.isMoved=!0,this.setSize(),this.globalSettings.wrapText?this.renderText():this.sizeText()},S.prototype.setSize=function(){B.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(R){var M=this.state;M==="creating"&&(this._suppressMarkerCreateEvent=!0),B.prototype.pointerUp.call(this,R),this.setSize(),(M==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var R=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(M){M.stopPropagation()}),this.globalSettings.wrapText||this.textEditor.addEventListener("input",function(){for(var M=Number.parseFloat(R.textEditor.style.fontSize);R.textEditor.clientWidth>=Number.parseInt(R.textEditor.style.maxWidth)&&M>.9;)M-=.1,R.textEditor.style.fontSize=Math.max(M,.9)+"em"}),this.textEditor.addEventListener("keyup",function(M){M.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(M){if(M.clipboardData){var K=M.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(K)),M.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){R.textEditDivClicked(R.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else if(this.globalSettings.wrapText)this.textEditor.style.left=this.left+this.padding+"px",this.textEditor.style.top=this.top+this.padding+"px",this.textEditor.style.width=this.width-2*this.padding+"px",this.textEditor.style.height=this.height-2*this.padding+"px",this.textEditor.style.maxHeight=this.textEditor.style.height,this.textEditor.style.whiteSpace="wrap";else{this.textElement.style.display="";var R=this.getTextScale(),M=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),U={x:K.width*R,y:K.height*R};M.x-=U.x/2,M.y-=U.y/2,this.textEditor.style.top=M.y+"px",this.textEditor.style.left=M.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-M.x+"px",this.textEditor.style.fontSize=Math.max(16*R,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(R){this.text=R.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){B.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),B.prototype.deselect.call(this)},S.prototype.dblClick=function(R,M){B.prototype.dblClick.call(this,R,M),this.showTextEditor()},S.prototype.setColor=function(R){this.textElement&&Z.setAttributes(this.textElement,[["fill",R]]),this.color=R,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(R)},S.prototype.setFont=function(R){this.textElement&&Z.setAttributes(this.textElement,[["font-family",R]]),this.fontFamily=R,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text,wrapText:this.globalSettings.wrapText},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){var M=R;this.color=M.color,this.fontFamily=M.fontFamily,this.padding=M.padding,this.text=M.text,this.createVisual(),B.prototype.restoreState.call(this,R),this.setSize(),this.globalSettings.wrapText&&this.renderText()},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.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>',S}(pe),q=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=K.defaultColor,U.lineWidth=K.defaultStrokeWidth,U.pixelRatio=K.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 ue("Color",K.defaultColorSet,K.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new Ie("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=Z.createGroup(),this.drawingImage=Z.createImage(),this.visual.appendChild(this.drawingImage);var R=Z.createTransform();this.visual.transform.baseVal.appendItem(R),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(R,M){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(R.x,R.y),this.drawing=!0):B.prototype.pointerDown.call(this,R,M)},S.prototype.manipulate=function(R){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(R.x,R.y),this.canvasContext.stroke()):B.prototype.manipulate.call(this,R)},S.prototype.resize=function(R){B.prototype.resize.call(this,R),Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(R){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):B.prototype.pointerUp.call(this,R)},S.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),B.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),B.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var R=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),M=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=M[0],U=M[1],de=M[2],ke=M[3],He=!1,ze=0;ze<this.canvasElement.height;ze++)for(var Fe=0;Fe<this.canvasElement.width;Fe++)R.data[ze*this.canvasElement.width*4+4*Fe+3]>0&&(He=!0,ze<U&&(U=ze),Fe<K&&(K=Fe),ze>ke&&(ke=ze),Fe>de&&(de=Fe));if(He){this.left=K/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(de-K)/this.pixelRatio,this.height=(ke-U)/this.pixelRatio;var Je=document.createElement("canvas");Je.width=de-K,Je.height=ke-U,Je.getContext("2d").putImageData(this.canvasContext.getImageData(K,U,de-K,ke-U),0,0),this.drawingImgUrl=Je.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){Z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(R){this.color=R,this.colorChanged(R)},S.prototype.setLineWidth=function(R){this.lineWidth=R},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({drawingImgUrl:this.drawingImgUrl},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){this.createVisual(),B.prototype.restoreState.call(this,R),this.drawingImgUrl=R.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.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>',S}(pe),se=function(B){function S(R,M,K,U){var de=B.call(this,R,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>',U||"arrow-type-panel")||this;return de.typeBoxes=[],de.currentType=M,de.setCurrentType=de.setCurrentType.bind(de),de}return J(S,B),S.prototype.getUi=function(){var R=this,M=document.createElement("div");M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2";for(var K=function(ke){var He="both";switch(ke){case 0:He="both";break;case 1:He="start";break;case 2:He="end";break;case 3:He="none"}var ze=document.createElement("div");if(ze.style.display="flex",ze.style.flexGrow="2",ze.style.alignItems="center",ze.style.justifyContent="space-between",ze.style.padding="5px",ze.style.borderWidth="2px",ze.style.borderStyle="solid",ze.style.borderColor=He===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",ze.addEventListener("click",function(){R.setCurrentType(He,ze)}),M.appendChild(ze),He==="both"||He==="start"){var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.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>`,Fe.style.marginLeft="5px",ze.appendChild(Fe)}var Je=document.createElement("div");Je.style.display="flex",Je.style.alignItems="center",Je.style.minHeight="20px",Je.style.flexGrow="2";var dt=document.createElement("hr");if(dt.style.minWidth="20px",dt.style.border="0px",dt.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),dt.style.flexGrow="2",Je.appendChild(dt),ze.appendChild(Je),He==="both"||He==="end"){var It=document.createElement("div");It.style.display="flex",It.style.alignItems="center",It.style.minHeight="20px",It.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>`,It.style.marginRight="5px",ze.appendChild(It)}U.typeBoxes.push(ze)},U=this,de=0;de<4;de++)K(de);return M},S.prototype.setCurrentType=function(R,M){var K=this;this.currentType=R,this.typeBoxes.forEach(function(U){U.style.borderColor=U===M?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(Q),he=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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 se("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.arrow1&&R!==this.arrow2)},S.prototype.getArrowPoints=function(R,M){var K=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return R-K/2+","+(M+U/2)+" "+R+","+(M-U/2)+" "+(R+K/2)+","+(M+U/2)},S.prototype.createTips=function(){this.arrow1=Z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(B.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",Z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Z.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var R=0;Math.abs(this.x1-this.x2)>.1&&(R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var M=this.arrow1.transform.baseVal.getItem(0);M.setRotate(R,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(M,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(R+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},S.prototype.setArrowType=function(R){this.arrowType=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({arrowType:this.arrowType},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){B.prototype.restoreState.call(this,R);var M=R;this.arrowType=M.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',S}(Ue),V=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.fillColor=K.defaultFillColor,U.strokeWidth=0,U.fillPanel=new ue("Color",K.defaultColorSet,K.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return J(S,B),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=B.prototype.getState.call(this);return R.typeName=S.typeName,R},S.typeName="CoverMarker",S.title="Cover marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',S}(ie),$=function(B){function S(R,M,K,U,de){var ke=B.call(this,R,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>',de||"opacity-panel")||this;return ke.opacities=[],ke.opacityBoxes=[],ke.opacities=M,ke.currentOpacity=K,ke.setCurrentOpacity=ke.setCurrentOpacity.bind(ke),ke}return J(S,B),S.prototype.getUi=function(){var R=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",M.style.justifyContent="space-between",this.opacities.forEach(function(K){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=K===R.currentOpacity?R.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){R.setCurrentOpacity(K,U)}),M.appendChild(U);var de=document.createElement("div");de.innerText=100*K+"%",U.appendChild(de),R.opacityBoxes.push(U)}),M},S.prototype.setCurrentOpacity=function(R,M){var K=this;this.currentOpacity=R,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(Q),re=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=K.defaultHighlightColor,U.strokeWidth=0,U.opacity=K.defaultHighlightOpacity,U.fillPanel=new ue("Color",K.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new $("Opacity",K.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return J(S,B),S.prototype.setOpacity=function(R){this.opacity=R,this.visual&&Z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=B.prototype.getState.call(this);return R.typeName=S.typeName,R},S.typeName="HighlightMarker",S.title="Highlight marker",S.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>',S}(V),oe='<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>',Se='<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>',Me=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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=K.defaultStrokeColor,U.bgColor=K.defaultFillColor,U.fontFamily=K.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 ue("Text color",K.defaultColorSet,U.color,oe,"text-color-panel"),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new ue("Fill color",K.defaultColorSet,U.bgColor,Se,"fill-color-panel"),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new Te("Font",K.defaultFontFamilies,K.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new fe,U.tipGrip.visual.transform.baseVal.appendItem(Z.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return J(S,B),S.prototype.ownsTarget=function(R){return B.prototype.ownsTarget.call(this,R)||this.tipGrip.ownsTarget(R)||this.tip===R},S.prototype.createTip=function(){Z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Z.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(R,M){this.state==="new"&&B.prototype.pointerDown.call(this,R,M),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(M)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):B.prototype.pointerDown.call(this,R,M)},S.prototype.pointerUp=function(R){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,B.prototype.pointerUp.call(this,R);else{var M=this.state==="creating";B.prototype.pointerUp.call(this,R),this.setTipPoints(M),this.positionTip()}},S.prototype.manipulate=function(R){if(this.tipMoving){var M=this.unrotatePoint(R);this.tipPosition={x:M.x-this.manipulationStartLeft,y:M.y-this.manipulationStartTop},this.positionTip()}else B.prototype.manipulate.call(this,R)},S.prototype.setBgColor=function(R){this.bgRectangle&&this.tip&&(Z.setAttributes(this.bgRectangle,[["fill",R]]),Z.setAttributes(this.tip,[["fill",R]])),this.bgColor=R,this.fillColorChanged(R)},S.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},S.prototype.setTipPoints=function(R){R===void 0&&(R=!1);var M=Math.min(this.height/2,15),K=this.height/5;R&&(this.tipPosition={x:M+K/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))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:M,y:0},this.tipBase2Position={x:M+K,y:0}):(this.tipBase1Position={x:0,y:M},this.tipBase2Position={x:0,y:M+K}):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))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-M-K,y:0},this.tipBase2Position={x:this.width-M,y:0}):(this.tipBase1Position={x:this.width,y:M},this.tipBase2Position={x:this.width,y:M+K}):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))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-M-K,y:this.height},this.tipBase2Position={x:this.width-M,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-M-K},this.tipBase2Position={x:this.width,y:this.height-M}):U<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:M,y:this.height},this.tipBase2Position={x:M+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-M},this.tipBase2Position={x:0,y:this.height-M-K})},S.prototype.resize=function(R){B.prototype.resize.call(this,R),this.positionTip()},S.prototype.positionTip=function(){Z.setAttributes(this.tip,[["points",this.getTipPoints()]]);var R=this.tipGrip.visual.transform.baseVal.getItem(0);R.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(R,0)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.select=function(){this.positionTip(),B.prototype.select.call(this)},S.prototype.getState=function(){var R=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){var M=R;this.bgColor=M.bgColor,this.tipPosition=M.tipPosition,B.prototype.restoreState.call(this,R),this.createTip(),this.setTipPoints()},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.tipPosition={x:this.tipPosition.x*R,y:this.tipPosition.y*M},this.positionTip()},S.typeName="CalloutMarker",S.title="Callout marker",S.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>',S}(Pe),Be=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=K.defaultColor,U.strokeWidth=K.defaultStrokeWidth,U.strokeDasharray=K.defaultStrokeDasharray,U.fillColor=K.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 ue("Line color",te(K.defaultColorSet,["transparent"]),K.defaultColor,void 0,"stroke-color-panel"),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new ue("Fill color",te(K.defaultColorSet,["transparent"]),U.fillColor,Se,"fill-color-panel"),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new Ie("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Oe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new $("Opacity",K.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.visual)},S.prototype.createVisual=function(){this.visual=Z.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)},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},S.prototype.manipulate=function(R){B.prototype.manipulate.call(this,R)},S.prototype.resize=function(R){B.prototype.resize.call(this,R),this.setSize()},S.prototype.setSize=function(){B.prototype.setSize.call(this),Z.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},S.prototype.pointerUp=function(R){B.prototype.pointerUp.call(this,R),this.setSize()},S.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&Z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},S.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&Z.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(R),this.stateChanged()},S.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&Z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&Z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.setOpacity=function(R){this.opacity=R,this.visual&&Z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){var M=R;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),B.prototype.restoreState.call(this,R),this.setSize()},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.setSize()},S.typeName="EllipseMarker",S.title="Ellipse marker",S.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>',S}(pe),Ke=function(B){function S(R,M,K){return B.call(this,R,M,K)||this}return J(S,B),Object.defineProperty(S.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.tip1&&R!==this.tip2)},S.prototype.createTips=function(){this.tip1=Z.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(Z.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Z.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(Z.createTransform()),this.visual.appendChild(this.tip2)},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(B.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Z.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()]]),Z.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 R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.tip1.transform.baseVal.getItem(0);M.setRotate(R,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(M,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(R+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=B.prototype.getState.call(this);return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){B.prototype.restoreState.call(this,R),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.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>',S}(Ue),Xe=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.strokePanel.colors=K.defaultColorSet,U.fillColor="transparent",U}return J(S,B),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=B.prototype.getState.call(this);return R.typeName=S.typeName,R},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.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>',S}(Be),Ge=function(){function B(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(B.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),B.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},B.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},B.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},B.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},B.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},B}(),rt=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||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=K.defaultColor,U.strokeWidth=K.defaultStrokeWidth,U.strokeDasharray=K.defaultStrokeDasharray,U.strokePanel=new ue("Line color",K.defaultColorSet,K.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new Ie("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Oe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorCurve&&R!==this.visibleCurve&&!this.curveGrip.ownsTarget(R))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=Z.createGroup(),this.selectorCurve=Z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Z.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=R.x,this.curveY=R.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(M)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){B.prototype.setupControlBox.call(this),this.curveControlLine1=Z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Z.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,B.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){B.prototype.positionGrips.call(this);var R=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-R/2,this.curveY-R/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},S.prototype.manipulate=function(R){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+R.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+R.y-this.manipulationStartY),B.prototype.manipulate.call(this,R)},S.prototype.resize=function(R){this.activeGrip===this.curveGrip&&(this.curveX=R.x,this.curveY=R.y),B.prototype.resize.call(this,R),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},S.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},S.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual()},S.prototype.scale=function(R,M){this.curveX=this.curveX*R,this.curveY=this.curveY*M,B.prototype.scale.call(this,R,M)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},B.prototype.getState.call(this));return R.typeName=S.typeName,R},S.prototype.restoreState=function(R){B.prototype.restoreState.call(this,R);var M=R;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.curveX=M.curveX,this.curveY=M.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.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>',S}(Ce),qe=function(B){function S(R,M,K){var U=B.call(this,R,M,K)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.textColor="transparent",U.fontSize="1rem",U.isMoved=!1,U.captionText="Caption",U.PADDING=5,U.captionBoxWidth=0,U.captionBoxHeight=0,U.strokeColor=K.defaultColor,U.strokeWidth=K.defaultStrokeWidth,U.strokeDasharray=K.defaultStrokeDasharray,U.fillColor=K.defaultFillColor,U.textColor=K.defaultStrokeColor,U.fontFamily=K.defaultFontFamily,U.fontSize=K.defaultCaptionFontSize,U.captionText=K.defaultCaptionText,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.sizeCaption=U.sizeCaption.bind(U),U.setCaptionText=U.setCaptionText.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.finishTextEditing=U.finishTextEditing.bind(U),U.setFont=U.setFont.bind(U),U.setTextColor=U.setTextColor.bind(U),U.strokePanel=new ue("Line color",te(K.defaultColorSet,["transparent"]),U.strokeColor,void 0,"stroke-color-panel"),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new ue("Fill color",te(K.defaultColorSet,["transparent"]),U.fillColor,Se,"fill-color-panel"),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new Ie("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new Oe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.fontFamilyPanel=new Te("Font",K.defaultFontFamilies,K.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.textColorPanel=new ue("Text color",K.defaultColorSet,U.textColor,oe,"text-color-panel"),U.textColorPanel.onColorChanged=U.setTextColor,U}return J(S,B),S.prototype.ownsTarget=function(R){return!(!B.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.frame&&R!==this.captionBg&&R!==this.captionElement)},S.prototype.createVisual=function(){this.visual=Z.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Z.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Z.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=Z.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},S.prototype.setCaptionText=function(R){this.captionText=R,this.captionElement.textContent=this.captionText,this.sizeCaption()},S.prototype.pointerDown=function(R,M){B.prototype.pointerDown.call(this,R,M),this.isMoved=!1,this.pointerDownPoint=R,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},S.prototype.manipulate=function(R){B.prototype.manipulate.call(this,R),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(R.x-this.pointerDownPoint.x)>5||Math.abs(R.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(R){B.prototype.resize.call(this,R),this.setSize()},S.prototype.sizeCaption=function(){var R=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=R.width+2*this.PADDING,this.captionBoxHeight=R.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Z.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),Z.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},S.prototype.showTextEditor=function(){var R=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.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(M){M.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(M){M.key==="Enter"&&R.finishTextEditing(R.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(M){M.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){R.finishTextEditing(R.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){R.finishTextEditing(R.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},S.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},S.prototype.finishTextEditing=function(R){this.setCaptionText(R.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},S.prototype.setFont=function(R){this.captionElement&&Z.setAttributes(this.captionElement,[["font-family",R]]),this.fontFamily=R,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},S.prototype.setTextColor=function(R){this.captionElement&&Z.setAttributes(this.captionElement,[["fill",R]]),this.textColor=R,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},S.prototype.setSize=function(){B.prototype.setSize.call(this),Z.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},S.prototype.pointerUp=function(R){B.prototype.pointerUp.call(this,R),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.dblClick=function(R,M){B.prototype.dblClick.call(this,R,M),this.showTextEditor()},S.prototype.setStrokeColor=function(R){this.strokeColor=R,this.frame&&Z.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},S.prototype.setFillColor=function(R){this.fillColor=R,this.captionBg&&Z.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(R),this.stateChanged()},S.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.frame&&Z.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.frame&&Z.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var R=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},B.prototype.getState.call(this));return R.typeName=this.typeName,R},S.prototype.restoreState=function(R){var M=R;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.textColor=M.textColor,this.fontFamily=M.fontFamily,this.captionText=M.captionText,this.fontSize=M.fontSize,this.createVisual(),B.prototype.restoreState.call(this,R),this.setSize()},S.prototype.scale=function(R,M){B.prototype.scale.call(this,R,M),this.setSize()},S.typeName="CaptionFrameMarker",S.title="Caption frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',S}(pe),Ve=function(){function B(S,R){R===void 0&&(R=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=R}return Object.defineProperty(B.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),B.prototype.preventDefault=function(){this._defaultPrevented=!0},B}(),at=function(B){function S(R,M,K){var U=B.call(this,R,!1)||this;return U.dataUrl=M,U.state=K,U}return J(S,B),S}(Ve),Qe=function(B){function S(R,M,K){K===void 0&&(K=!1);var U=B.call(this,R,K)||this;return U.marker=M,U}return J(S,B),S}(Ve),$e=function(){function B(){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 B.prototype.addEventListener=function(S,R){this[S].push(R)},B.prototype.removeEventListener=function(S,R){var M=this[S].indexOf(R);M>-1&&this[S].splice(M,1)},B}(),nt=function(){function B(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Le,this._isOpen=!1,this.undoRedoManager=new Ge,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 $e,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=B.instanceCounter++,this.styles=new Ee(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this),this.addMarkerEvents=this.addMarkerEvents.bind(this)}return Object.defineProperty(B.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ne,q,he,Pe,Xe,Be,re,Me,Ke,V,Ue,rt,qe]},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,q,he,Pe,Be,re,Me]},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,q,he,Pe,re]},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var R=this;this._availableMarkerTypes.splice(0),S.forEach(function(M){if(typeof M=="string"){var K=R.ALL_MARKER_TYPES.find(function(U){return U.typeName===M});K!==void 0&&R._availableMarkerTypes.push(K)}else R._availableMarkerTypes.push(M)})},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),B.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),_e.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},B.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&De.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=De.styleSheetRoot),this.markers.splice(0),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(R){return R(new Ve(S))})},B.prototype.render=function(){return Y(this,void 0,void 0,function(){var S;return le(this,function(R){switch(R.label){case 0:return this.setCurrentMarker(),(S=new we).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return R.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,R.sent()]}})})},B.prototype.close=function(S){var R=this;if(S===void 0&&(S=!1),this.isOpen){var M=!1;S||this.eventListeners.beforeclose.forEach(function(K){var U=new Ve(R,!0);K(U),U.defaultPrevented&&(M=!0)}),M||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(K){return K(new Ve(R))}),this.detachEvents(),this._isOpen=!1)}},B.prototype.addMarkersToToolbar=function(){for(var S,R=[],M=0;M<arguments.length;M++)R[M]=arguments[M];(S=this._availableMarkerTypes).push.apply(S,R)},B.prototype.addRenderEventListener=function(S){this.addEventListener("render",function(R){S(R.dataUrl,R.state)})},B.prototype.removeRenderEventListener=function(S){},B.prototype.addCloseEventListener=function(S){this.addEventListener("close",function(){S()})},B.prototype.removeCloseEventListener=function(S){},B.prototype.setupResizeObserver=function(){var S=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return S.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},B.prototype.onPopupTargetResize=function(){var S=1*this.target.clientWidth/this.target.clientHeight,R=this.editorCanvas.clientWidth/S>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,M=R<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/S;this.resize(R,M)},B.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},B.prototype.resize=function(S,R){this._isResizing=!0;var M=S/this.imageWidth,K=R/this.imageHeight;this.imageWidth=Math.round(S),this.imageHeight=Math.round(R),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(M,K),this._isResizing=!1},B.prototype.scaleMarkers=function(S,R){var M,K=this;this._currentMarker&&this._currentMarker instanceof Pe?this._currentMarker.scale(S,R):(M=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(U){U!==K._currentMarker&&U.scale(S,R)}),M!==void 0&&this.setCurrentMarker(M)},B.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"},B.prototype.setTopLeft=function(){var S=this.editingTarget.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=S.left-R.left,this.top=S.top-R.top},B.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)},B.prototype.addDefs=function(){for(var S,R=[],M=0;M<arguments.length;M++)R[M]=arguments[M];this.defs=Z.createDefs(),this.addDefsToImage(),(S=this.defs).append.apply(S,R)},B.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},B.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)},B.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},B.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("touchmove",function(S){return S.preventDefault()}),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},B.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)},B.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},B.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)},B.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 S=document.createElement("a");S.href="https://markerjs.com/",S.target="_blank",S.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>',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},B.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")},B.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"},B.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},B.prototype.showUI=function(){var S;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 R=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0,M=this.target.offsetLeft+((S=this.settings.uiOffsetLeft)!==null&&S!==void 0?S:0);this.coverDiv.style.top=R+"px",this.coverDiv.style.left=M+"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="fixed",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.settings.displayMode==="popup"&&(this.uiDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px"),this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new X(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.settings.displayMode==="inline"&&this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ae(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},B.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv),this.coverDiv.remove(),this.coverDiv=null},B.prototype.removeMarker=function(S){this.markerImage.removeChild(S.container),this.markers.indexOf(S)>-1&&this.markers.splice(this.markers.indexOf(S),1),S.dispose()},B.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())},B.prototype.toolbarButtonClicked=function(S,R){if(S==="marker"&&R!==void 0)this.createNewMarker(R);else if(S==="action")switch(R){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()}},B.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0&&this._currentMarker.state==="select"){var R=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var U=new Qe(S,S._currentMarker,!0);K(U),U.defaultPrevented&&(R=!0)}),!R){var M=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(K){return K(new Qe(S,M))})}}},B.prototype.clear=function(){var S=this,R=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(de){var ke=new Qe(S,void 0,!0);de(ke),ke.defaultPrevented&&(R=!0)}),!R)){this.setCurrentMarker();for(var M=function(de){var ke=K.markers[de];K.setCurrentMarker(K.markers[de]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(He){return He(new Qe(S,ke))})},K=this,U=this.markers.length-1;U>=0;U--)M(U);this.addUndoStep()}},Object.defineProperty(B.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),B.prototype.showNotesEditor=function(){var S;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},B.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)},B.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},B.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var R=this.getState(),M=this.undoRedoManager.getLastUndoStep();if(!M||M.width===R.width&&M.height===R.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(R),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(U){return U(new Ve(S))})}else this.undoRedoManager.replaceLastUndoStep(R)}},B.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},B.prototype.undoStep=function(){var S=this,R=this.undoRedoManager.undo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(M){return M(new Ve(S))}))},B.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},B.prototype.redoStep=function(){var S=this,R=this.undoRedoManager.redo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(M){return M(new Ve(S))}))},B.prototype.stepZoom=function(){var S=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=S<this.zoomSteps.length-1?this.zoomSteps[S+1]:this.zoomSteps[0]},B.prototype.panTo=function(S){this.contentDiv.scrollBy({left:this.prevPanPoint.x-S.x,top:this.prevPanPoint.y-S.y}),this.prevPanPoint=S},B.prototype.startRenderAndClose=function(){return Y(this,void 0,void 0,function(){var S,R,M=this;return le(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return S=K.sent(),R=this.getState(),this.eventListeners.render.forEach(function(U){return U(new at(M,S,R))}),this.close(!0),[2]}})})},B.prototype.getState=function(S){S===!0&&this.setCurrentMarker();var R={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(M){return R.markers.push(M.getState())}),R},B.prototype.restoreState=function(S){var R=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);S.markers.forEach(function(M){var K=R._availableMarkerTypes.find(function(de){return de.typeName===M.typeName});if(K!==void 0){var U=R.addNewMarker(K);U.restoreState(M),R.addMarkerEvents(U),R.markers.push(U)}}),S.width&&S.height&&(S.width!==this.imageWidth||S.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/S.width,this.imageHeight/S.height),this.eventListeners.restorestate.forEach(function(M){return M(new Ve(R))})},B.prototype.addNewMarker=function(S){var R=Z.createGroup();return this.markerImage.appendChild(R),new S(R,this.overlayContainer,this.settings)},B.prototype.createNewMarker=function(S){var R,M=this;(R=typeof S=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===S}):S)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(R),this.addMarkerEvents(this._currentMarker),this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(R.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new Qe(M,M._currentMarker))}))},B.prototype.addMarkerEvents=function(S){S.onMarkerCreated=this.markerCreated,S.onColorChanged=this.colorChanged,S.onFillColorChanged=this.fillColorChanged,S.onStateChanged=this.markerStateChanged},B.prototype.markerCreated=function(S){var R=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(S),this.setCurrentMarker(S),S instanceof q&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(q):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(M){return M(new Qe(R,S))})},B.prototype.colorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=S,this.settings.defaultStrokeColor=S)},B.prototype.fillColorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=S)},B.prototype.markerStateChanged=function(S){var R=this;this.eventListeners.markerchange.forEach(function(M){return M(new Qe(R,S))})},B.prototype.setCurrentMarker=function(S){var R=this;this._currentMarker!==S&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(M){return M(new Qe(R,R._currentMarker))})),this._currentMarker=S,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(M){return M(new Qe(R,R._currentMarker))}))},B.prototype.onPointerDown=function(S){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||S.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var R=this.markers.find(function(M){return M.ownsTarget(S.target)});R!==void 0?(this.setCurrentMarker(R),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:S.clientX,y:S.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY))},B.prototype.onDblClick=function(S){if(this._isFocused||this.focus(),this.mode==="select"){var R=this.markers.find(function(M){return M.ownsTarget(S.target)});R!==void 0&&R!==this._currentMarker&&this.setCurrentMarker(R),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target):this.setCurrentMarker()}},B.prototype.onPointerMove=function(S){this.touchPoints!==1&&S.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||S.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(S.clientX,S.clientY)):this.zoomLevel>1&&this.panTo({x:S.clientX,y:S.clientY}))},B.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},B.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},B.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},B.prototype.clientToLocalCoordinates=function(S,R){var M=this.markerImage.getBoundingClientRect(),K=M.width/this.imageWidth/this.zoomLevel,U=M.height/this.imageHeight/this.zoomLevel;return{x:(S-M.left)/this.zoomLevel/K,y:(R-M.top)/this.zoomLevel/U}},B.prototype.onWindowResize=function(){this.positionUI()},B.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects(),R=S.length>0&&S.item(0)&&S.item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"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()},B.prototype.addLicenseKey=function(S){_e.addKey(S)},B.prototype.addEventListener=function(S,R){this.eventListeners.addEventListener(S,R)},B.prototype.removeEventListener=function(S,R){this.eventListeners.removeEventListener(S,R)},B.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(B.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),B.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(R){return R(new Ve(S))}))},B.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(R){return R(new Ve(S))}))},B.instanceCounter=0,B}();/* **********************************
cropro version 1.6.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 Ye=function(B,S){return(Ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,M){R.__proto__=M}||function(R,M){for(var K in M)Object.prototype.hasOwnProperty.call(M,K)&&(R[K]=M[K])})(B,S)};function st(B,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function R(){this.constructor=B}Ye(B,S),B.prototype=S===null?Object.create(S):(R.prototype=S.prototype,new R)}function Tt(B,S,R,M){return new(R||(R=Promise))(function(K,U){function de(ze){try{He(M.next(ze))}catch(Fe){U(Fe)}}function ke(ze){try{He(M.throw(ze))}catch(Fe){U(Fe)}}function He(ze){var Fe;ze.done?K(ze.value):(Fe=ze.value,Fe instanceof R?Fe:new R(function(Je){Je(Fe)})).then(de,ke)}He((M=M.apply(B,S||[])).next())})}function wt(B,S){var R,M,K,U,de={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return U={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function ke(He){return function(ze){return function(Fe){if(R)throw new TypeError("Generator is already executing.");for(;de;)try{if(R=1,M&&(K=2&Fe[0]?M.return:Fe[0]?M.throw||((K=M.return)&&K.call(M),0):M.next)&&!(K=K.call(M,Fe[1])).done)return K;switch(M=0,K&&(Fe=[2&Fe[0],K.value]),Fe[0]){case 0:case 1:K=Fe;break;case 4:return de.label++,{value:Fe[1],done:!1};case 5:de.label++,M=Fe[1],Fe=[0];continue;case 7:Fe=de.ops.pop(),de.trys.pop();continue;default:if(!(K=de.trys,(K=K.length>0&&K[K.length-1])||Fe[0]!==6&&Fe[0]!==2)){de=0;continue}if(Fe[0]===3&&(!K||Fe[1]>K[0]&&Fe[1]<K[3])){de.label=Fe[1];break}if(Fe[0]===6&&de.label<K[1]){de.label=K[1],K=Fe;break}if(K&&de.label<K[2]){de.label=K[2],de.ops.push(Fe);break}K[2]&&de.ops.pop(),de.trys.pop();continue}Fe=S.call(B,de)}catch(Je){Fe=[6,Je],M=0}finally{R=K=0}if(5&Fe[0])throw Fe[1];return{value:Fe[0]?Fe[1]:void 0,done:!0}}([He,ze])}}}var xt=function(){function B(){}return B.addKey=function(S){B.key=S},Object.defineProperty(B,"isLicensed",{get:function(){return!!B.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(B.key)},enumerable:!1,configurable:!0}),B}(),je=function(){function B(){}return B.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},B.setAttributes=function(S,R){for(var M=0,K=R;M<K.length;M++){var U=K[M],de=U[0],ke=U[1];S.setAttribute(de,ke)}},B.createRect=function(S,R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",S.toString()),K.setAttribute("height",R.toString()),M&&B.setAttributes(K,M),K},B.createLine=function(S,R,M,K,U){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",S.toString()),de.setAttribute("y1",R.toString()),de.setAttribute("x2",M.toString()),de.setAttribute("y2",K.toString()),U&&B.setAttributes(de,U),de},B.createPolygon=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","polygon");return M.setAttribute("points",S),R&&B.setAttributes(M,R),M},B.createCircle=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","circle");return M.setAttribute("cx",(S/2).toString()),M.setAttribute("cy",(S/2).toString()),M.setAttribute("r",S.toString()),R&&B.setAttributes(M,R),M},B.createEllipse=function(S,R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(S/2).toString()),K.setAttribute("cy",(R/2).toString()),K.setAttribute("rx",(S/2).toString()),K.setAttribute("ry",(R/2).toString()),M&&B.setAttributes(K,M),K},B.createGroup=function(S){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&B.setAttributes(R,S),R},B.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},B.createMarker=function(S,R,M,K,U,de,ke){var He=document.createElementNS("http://www.w3.org/2000/svg","marker");return B.setAttributes(He,[["id",S],["orient",R],["markerWidth",M.toString()],["markerHeight",K.toString()],["refX",U.toString()],["refY",de.toString()]]),He.appendChild(ke),He},B.createText=function(S){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),S&&B.setAttributes(R,S),R},B.createTSpan=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","tspan");return M.textContent=S,R&&B.setAttributes(M,R),M},B.createImage=function(S){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&B.setAttributes(R,S),R},B.createPoint=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return M.x=S,M.y=R,M},B.createPath=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg","path");return M.setAttribute("d",S),R&&B.setAttributes(M,R),M},B.createElement=function(S,R){var M=document.createElementNS("http://www.w3.org/2000/svg",S);return R&&B.setAttributes(M,R),M},B.getHollowRectanglePath=function(S,R,M,K,U,de,ke,He){return"M"+S+","+R+"V"+(R+K)+"H"+(S+M)+"V"+R+"H"+U+"V"+de+"H"+(U+ke)+"V"+(de+He)+"H"+U+"V"+R+"Z"},B}(),Ze=function(){function B(S){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(B.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(B.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(B.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),B.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},B.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},B.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new lt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new lt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},B.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},B}(),ut=function(B,S){this.selector=B,this.style=S},lt=function(B,S){this.localName=B,this.style=S},it=function(){function B(){this.blocks=[],this.display=""}return B.prototype.addButtonBlock=function(S){S.className=this.blockClassName,S.buttonClassName=this.buttonClassName,S.buttonColorsClassName=this.buttonColorsClassName,S.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(S)},B.prototype.addElementBlock=function(S){S.className===void 0&&(S.className=this.blockClassName),this.blocks.push(S)},B.prototype.getUI=function(){var S=document.createElement("div");return S.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,S.style.display=this.display,this.blocks.forEach(function(R){return S.appendChild(R.getUI())}),S},B}(),yt=function(){function B(){}return B.prototype.getUI=function(){var S=document.createElement("div");if(S.className=this.className,this.minWidth!==void 0&&(S.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":S.style.justifyContent="flex-start";break;case"center":S.style.justifyContent="center";break;case"end":S.style.justifyContent="flex-end"}return S.style.whiteSpace="nowrap",S},B}(),Lt=function(B){function S(){var R=B!==null&&B.apply(this,arguments)||this;return R.buttons=[],R}return st(S,B),S.prototype.addButton=function(R){R.className=this.buttonClassName,R.colorsClassName=this.buttonColorsClassName,R.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(R)},S.prototype.getUI=function(){var R=B.prototype.getUI.call(this);return this.buttons.forEach(function(M){return R.appendChild(M.getUI())}),R},S}(yt),ct=function(){function B(S,R){this._isActive=!1,this._isHidden=!1,this._icon=S,this.title=R,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(B.prototype,"icon",{get:function(){return this._icon},set:function(S){this._icon=S,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isActive",{get:function(){return this._isActive},set:function(S){this._isActive=S,this.adjustClassName()},enumerable:!1,configurable:!0}),B.prototype.getUI=function(){var S=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.setAttribute("role","button"),this.buttonContainer.setAttribute("aria-label",this.title),this.buttonContainer.setAttribute("data-action",this.title),this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return S.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},B.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,"")))},B.prototype.hide=function(){this._isHidden=!0},B}(),mt=function(B){function S(){var R=B!==null&&B.apply(this,arguments)||this;return R.elements=[],R}return st(S,B),S.prototype.addElement=function(R){this.elements.push(R)},S.prototype.getUI=function(){var R=B.prototype.getUI.call(this);return this.elements.forEach(function(M){return R.appendChild(M)}),R},S}(yt),Ct=function(){function B(S,R){this.horizontal=S,this.vertical=R}return Object.defineProperty(B.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),B.prototype.getVerticalLength=function(S){return S/this.ratio},B.prototype.getHorizontalLength=function(S){return S*this.ratio},B}(),Pt=function(){function B(){}return B.getIcon=function(S,R){if(S>0&&R>0){var M=new Ct(S,R),K=M.ratio>=1?20:M.getHorizontalLength(20),U=M.ratio<1?20:M.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 ke=je.createDefs();de.appendChild(ke);var He=je.createElement("clipPath",[["id","text-bg-clip"]]);ke.appendChild(He);var ze=je.createPath(je.getHollowRectanglePath((24-K)/2,(24-U)/2,K,U,(24-K)/2+2,(24-U)/2+2,K-4,U-4));de.appendChild(ze);var Fe=je.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Fe.appendChild(je.createTSpan(S+":"+R)),de.appendChild(Fe);var Je=Fe.getBBox();je.setAttributes(Fe,[["x",((24-Je.width)/2).toString()],["y",((24-Je.height)/2-Je.y).toString()]]);var dt=je.createPath(je.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Je.width))/2,(24-Math.ceil(Je.height))/2,Math.ceil(Je.width),Math.ceil(Je.height)));return He.appendChild(dt),je.setAttributes(ze,[["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>'},B}(),kt=function(B){function S(R,M,K){var U=B.call(this,R,M)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=K,U}return st(S,B),S.prototype.setupDropdown=function(){var R=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(M){M.className=R.className,M.colorsClassName=R.colorsClassName,R.dropdownBlock.appendChild(M.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},S.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},S.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},S.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},S.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},S.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},S}(ct),ht=function(){function B(S,R){this.GRIP_SIZE=10,this.color=S,this.fillColor=R,this.visual=je.createGroup(),this.visual.appendChild(je.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(je.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return B.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},B.prototype.setCenter=function(S,R){this.visual.childNodes.forEach(function(M){return je.setAttributes(M,[["cx",S.toString()],["cy",R.toString()]])})},B}(),Dt=function(){function B(S,R,M,K){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this._zoomToCropEnabled=!1,this.cropRectChanged=!1,this.canvasWidth=S,this.canvasHeight=R,this.margin=M,this.container=K,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(B.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(S){this._aspectRatio=S,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.gridContainer&&je.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(S){this._zoomFactor=S,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomToCropEnabled",{set:function(S){this._zoomToCropEnabled=S},enumerable:!1,configurable:!0}),B.prototype.open=function(){var S=this;this.cropShadeElement=je.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=je.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var R=0;R<this.numberOfGridLines;R++)this.horizontalGridLines.push(je.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(je.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(M){return S.gridContainer.appendChild(M)}),this.verticalGridLines.forEach(function(M){return S.gridContainer.appendChild(M)}),this.cropRectElement=je.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},B.prototype.setCropRectangle=function(S){this.cropRect=S;var R=Object.assign({},this.cropRect);this._zoomToCropEnabled&&(R.width=this.cropRect.width*this.zoomFactor,R.height=this.cropRect.height*this.zoomFactor,R.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-R.width/2,R.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-R.height/2),je.setAttributes(this.cropRectElement,[["x",R.x.toString()],["y",R.y.toString()],["width",R.width.toString()],["height",R.height.toString()]]);var M=R.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,de){var ke=R.y+M*(de+1);je.setAttributes(U,[["x1",""+R.x],["y1",""+ke],["x2",""+(R.x+R.width)],["y2",""+ke]])});var K=R.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,de){var ke=R.x+K*(de+1);je.setAttributes(U,[["x1",""+ke],["y1",""+R.y],["x2",""+ke],["y2",""+(R.y+R.height)]])}),je.setAttributes(this.cropShadeElement,[["d",je.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,R.x,R.y,R.width,R.height)]]),this.topLeftGrip.setCenter(R.x,R.y),this.topRightGrip.setCenter(R.x+R.width,R.y),this.bottomLeftGrip.setCenter(R.x,R.y+R.height),this.bottomRightGrip.setCenter(R.x+R.width,R.y+R.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},B.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)},B.prototype.clientToLocalCoordinates=function(S,R){var M=this.container.getBoundingClientRect();return{x:S-M.left+this.margin,y:R-M.top+this.margin}},B.prototype.onPointerDown=function(S){this.container.setPointerCapture(S.pointerId),this.previousPoint=this.clientToLocalCoordinates(S.clientX,S.clientY),this.cropRectElement===S.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(S.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(S.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(S.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(S.target)&&(this.activeGrip=this.bottomRightGrip)},B.prototype.onPointerMove=function(S){if(this.isMoving)this.move(this.clientToLocalCoordinates(S.clientX,S.clientY));else if(this.activeGrip){var R=this.clientToLocalCoordinates(S.clientX,S.clientY);this.resize(R)}S.preventDefault()},B.prototype.onPointerUp=function(S){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(S.pointerId)},B.prototype.move=function(S){var R=S.x-this.previousPoint.x,M=S.y-this.previousPoint.y;this.zoomFactor!==1&&(R=-R/this.zoomFactor,M=-M/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+R),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+M),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=S},B.prototype.resize=function(S){var R=Object.assign({},this.cropRect),M=S.x-this.previousPoint.x,K=S.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:R.x+M<this.margin&&(M=this.margin-R.x),R.x+=M,R.width=this.cropRect.x+this.cropRect.width-R.x;break;case this.bottomRightGrip:case this.topRightGrip:R.width+M>this.canvasWidth*this.zoomFactor&&(M=this.canvasWidth*this.zoomFactor-R.width),R.width+=M}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(R.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(M),R.height=this.aspectRatio.getVerticalLength(R.width)):(R.y+=K,R.height=this.cropRect.y+this.cropRect.height-R.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?R.height=this.aspectRatio.getVerticalLength(R.width):R.height+=K}R.width<10&&(R.x=this.cropRect.x,R.width=10),R.height<10&&(R.y=this.cropRect.y,R.height=10),this.previousPoint=S,R.x>=this.margin&&R.y>=this.margin&&Math.floor(R.x-this.margin+R.width)<=Math.ceil(this.canvasWidth)&&Math.floor(R.y-this.margin+R.height)<=Math.ceil(this.canvasHeight)&&(this.cropRect=R,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},B.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var S=this.cropRect.x+this.cropRect.width/2,R=this.cropRect.y+this.cropRect.height/2,M=this.aspectRatio.getHorizontalLength(this.cropRect.height),K=this.aspectRatio.getVerticalLength(this.cropRect.width);M/this.canvasWidth<K/this.canvasHeight?this.cropRect.width=M:this.cropRect.height=K,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=S-this.cropRect.width/2,this.cropRect.y=R-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)}},B.prototype.getRescaledRect=function(S,R,M,K,U,de){var ke=M/S,He=K/R;return{x:(U.x-de)*ke+de,y:(U.y-de)*He+de,width:U.width*ke,height:U.height*He}},B.prototype.scaleCanvas=function(S,R){var M=this.getRescaledRect(this.canvasWidth,this.canvasHeight,S,R,this.cropRect,this.margin);this.canvasWidth=S,this.canvasHeight=R,this.onCropChange&&this.onCropChange(M),this.setCropRectangle(M)},B}(),Nt=function(){function B(S){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=S,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(B.prototype,"angle",{get:function(){return this._angle},set:function(S){this._angle=S,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),B.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.setAttribute("role","button"),this.controlContainer.setAttribute("aria-label",this.title),this.controlContainer.setAttribute("data-action",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},B.prototype.onPointerDown=function(S){this.controlContainer.setPointerCapture(S.pointerId),this.isDragging=!0,this.previousPoint={x:S.clientX,y:S.clientY}},B.prototype.onPointerMove=function(S){this.isDragging&&(this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.previousPoint.x=S.clientX)},B.prototype.onPointerUp=function(S){this.isDragging&&this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(S.pointerId)},B.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var S=this.angleLabelText.getBBox();je.setAttributes(this.angleLabelElement,[["x",((this.width-S.width)/2).toString()],["y",(this.height/2).toString()]])}},B.prototype.positionScaleShape=function(){if(this.scaleShape){var S=this.scaleShape.transform.baseVal.getItem(0);S.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(S,0)}},B.prototype.getVisual=function(){var S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("width",this.width+"px"),S.setAttribute("height",this.height+"px"),S.setAttribute("viewBox","0 0 "+this.width+" "+this.height),S.style.flexShrink="0",document.body.appendChild(S);for(var R="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,M=1;M<=this.width/5+10;M++){var K=M%5==0?this.height/3:this.height/6;R+="h4v"+-K+"h1v"+K}R+="v1H0Z",this.scaleShape=je.createPath(R);var U=je.createTransform();this.scaleShape.transform.baseVal.appendItem(U),S.appendChild(this.scaleShape),this.angleLabelElement=je.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=je.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var de=je.createTSpan("");return de.innerHTML="&deg;",this.angleLabelElement.appendChild(de),S.appendChild(this.angleLabelElement),document.body.removeChild(S),S},B}(),jt=function(){function B(){this.naturalSize=!1,this.imageType="image/png",this.rasterize=this.rasterize.bind(this)}return B.prototype.rasterize=function(S,R,M,K,U,de,ke){var He=this;return new Promise(function(ze){var Fe=document.createElement("canvas");Fe.width=S.width.baseVal.value-2*K,Fe.height=S.height.baseVal.value-2*K;var Je=1,dt=1;if(He.naturalSize===!0?(Je=Math.abs(R.naturalWidth/(S.width.baseVal.value-2*K)/de),dt=Math.abs(R.naturalHeight/(S.height.baseVal.value-2*K)/ke),Fe.width=Math.abs(R.naturalWidth/de),Fe.height=Math.abs(R.naturalHeight/ke)):He.width!==void 0&&He.height!==void 0&&(Je=He.width/M.width,dt=He.height/M.height,Fe.width*=Je,Fe.height*=dt),He.maxSize!==void 0&&Fe.width*Fe.height>=He.maxSize){var It=Fe.width*Fe.height,Gt=Math.sqrt(He.maxSize/It);Je*=Gt,dt*=Gt,Fe.width*=Gt,Fe.height*=Gt}var Ft=Fe.getContext("2d");Ft.translate(Fe.width/2,Fe.height/2),Ft.rotate(U*Math.PI/180),Ft.scale(de,ke),Ft.translate(-Fe.width/2,-Fe.height/2),Ft.drawImage(R,0,0,Fe.width,Fe.height);var Ot=document.createElement("canvas");Ot.width=M.width*Je,Ot.height=M.height*dt,Ot.getContext("2d").putImageData(Ft.getImageData((M.x-K)*Je,(M.y-K)*dt,M.width*Je,M.height*dt),0,0),ze(Ot.toDataURL(He.imageType,He.imageQuality))})},B}(),Ht=function(){function B(S){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this.stateChangeEventListeners=[],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.previousState="",this._instanceNo=B.instanceCounter++,this.styles=new Ze(this.instanceNo),this.target=S,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this),this.renderState=this.renderState.bind(this),this.addStateChangeEventListener=this.addStateChangeEventListener.bind(this),this.removeStateChangeEventListener=this.removeStateChangeEventListener.bind(this),this.onStateChanged=this.onStateChanged.bind(this)}return Object.defineProperty(B.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(S){this._zoomToCropEnabled=S,this.cropLayer!==void 0&&(this.cropLayer.zoomToCropEnabled=this._zoomToCropEnabled),S?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"gridLines",{get:function(){return this._gridLines},set:function(S){this._gridLines=S,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(S){this._rotationAngle=S,this.straightener&&(this.straightener.angle=this._rotationAngle),this.onStateChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"aspectRatio",{get:function(){var S;return(S=this._aspectRatio)!==null&&S!==void 0?S:this.aspectRatios[0]},set:function(S){this._aspectRatio=S},enumerable:!1,configurable:!0}),B.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},B.prototype.show=function(){this.showUI(),this.open()},B.prototype.close=function(S){S===void 0&&(S=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),S||this.closeEventListeners.forEach(function(R){return R()}),this._isOpen=!1)},B.prototype.addRenderEventListener=function(S){this.renderEventListeners.push(S)},B.prototype.removeRenderEventListener=function(S){this.renderEventListeners.indexOf(S)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(S),1)},B.prototype.addCloseEventListener=function(S){this.closeEventListeners.push(S)},B.prototype.removeCloseEventListener=function(S){this.closeEventListeners.indexOf(S)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(S),1)},B.prototype.addStateChangeEventListener=function(S){this.stateChangeEventListeners.push(S)},B.prototype.removeStateChangeEventListener=function(S){this.stateChangeEventListeners.indexOf(S)>-1&&this.stateChangeEventListeners.splice(this.stateChangeEventListeners.indexOf(S),1)},B.prototype.setupResizeObserver=function(){var S=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},B.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var S=1*this.target.clientWidth/this.target.clientHeight,R=this.contentDiv.clientWidth/S>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*S:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,M=R+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/S;this.resize(R,M)}},B.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},B.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",je.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},B.prototype.resize=function(S,R){this.imageWidth=Math.round(S),this.imageHeight=Math.round(R),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(),this.onStateChanged()},B.prototype.setEditingTarget=function(){je.setAttributes(this.editingTarget,[["href",this.target.src]]),this.setEditingTargetSize()},B.prototype.setTopLeft=function(){var S=this.target.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=S.left-R.left-this.CANVAS_MARGIN,this.top=S.top-R.top-this.CANVAS_MARGIN},B.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=je.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=je.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=je.createGroup(),this.editingTargetRotationScaleContainer=je.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var S=je.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(S);var R=je.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(R),this.editingTargetContainer=je.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)},B.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},B.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=je.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.zoomToCropEnabled=this.zoomToCropEnabled,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},B.prototype.zoomToCrop=function(){if(this.cropRect){var S=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,R=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=S+"px "+R+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-S+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-R+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},B.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)},B.prototype.cropRectChanged=function(S){this.cropRect=S,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1,this.onStateChanged()},B.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},B.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"},B.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},B.prototype.showUI=function(){var S,R;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 M=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,K=this.target.offsetTop>M+this.CANVAS_MARGIN?this.target.offsetTop-(M+this.CANVAS_MARGIN):0;K+=(S=this.uiOffsetTop)!==null&&S!==void 0?S:0;var U=this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0;U+=(R=this.uiOffsetLeft)!==null&&R!==void 0?R:0,this.coverDiv.style.top=K+"px",this.coverDiv.style.left=U+"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.processingUi=document.createElement("div"),this.processingUi.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: none; display: block; shape-rendering: auto;" width="50px" height="50px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
<rect x="19" y="19" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0s" calcMode="discrete"></animate>
</rect><rect x="40" y="19" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.125s" calcMode="discrete"></animate>
</rect><rect x="61" y="19" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.25s" calcMode="discrete"></animate>
</rect><rect x="19" y="40" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.875s" calcMode="discrete"></animate>
</rect><rect x="61" y="40" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.375s" calcMode="discrete"></animate>
</rect><rect x="19" y="61" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.75s" calcMode="discrete"></animate>
</rect><rect x="40" y="61" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.625s" calcMode="discrete"></animate>
</rect><rect x="61" y="61" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.5s" calcMode="discrete"></animate>
</rect>
</svg>`,this.processingUi.style.position="absolute",this.processingUi.style.width="100%",this.processingUi.style.height="100%",this.processingUi.style.backgroundColor="rgba(0,0,0,0.3)",this.processingUi.style.alignItems="center",this.processingUi.style.justifyContent="center",this.processingUi.style.display="none",this.editorCanvas.appendChild(this.processingUi),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},B.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},B.prototype.addTopToolbar=function(){var S=this;this.topToolbar=new it,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 R=new Lt;R.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(R);var M=[];this.aspectRatios.forEach(function(dt){var It=new ct(Pt.getIcon(dt.horizontal,dt.vertical),dt.horizontal===0&&dt.vertical===0?"FREE":dt.horizontal+":"+dt.vertical);It.onClick=function(){return S.ratioButtonClicked(dt)},M.push(It)}),this.aspectRatioButton=new kt(Pt.getIcon(0,0),"Aspect ratio",M),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,R.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var K=new ct('<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");K.isActive=this.isGridVisible,K.onClick=function(){S.isGridVisible=!S.isGridVisible,K.isActive=S.isGridVisible},R.addButton(K);var U=new ct('<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(){S.zoomToCropEnabled=!S.zoomToCropEnabled,U.isActive=S.zoomToCropEnabled},R.addButton(U),!xt.isLicensed){var de=new mt;this.topToolbar.addElementBlock(de);var ke=document.createElement("div");ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var He=document.createElement("a");He.style.color="currentColor",He.href="https://markerjs.com/products/cropro",He.target="_blank",He.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>',ke.appendChild(He),de.addElement(ke)}var ze=new Lt;ze.minWidth=3*this.toolbarHeight+"px",ze.contentAlign="end",this.topToolbar.addButtonBlock(ze);var Fe=new ct('<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");Fe.onClick=function(){S.processingUi.style.display="flex",setTimeout(S.startRenderAndClose,100)},ze.addButton(Fe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Fe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Je=new ct('<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");Je.onClick=this.close,ze.addButton(Je),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Je.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},B.prototype.addBottomToolbar=function(){var S=this;this.bottomToolbar=new it,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 R=new Lt;R.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(R);var M=new ct('<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");M.onClick=this.rotateLeftButtonClicked,R.addButton(M);var K=new ct('<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");K.onClick=this.rotateRightButtonClicked,R.addButton(K);var U=new mt;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new Nt("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(ze){S.rotateBy(ze),S.straightener.angle=S.rotationAngle},U.addElement(this.straightener.getUI());var de=new Lt;de.minWidth=2*this.toolbarHeight+"px",de.contentAlign="end",this.bottomToolbar.addButtonBlock(de);var ke=new ct('<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");ke.onClick=this.flipHorizontallyButtonClicked,de.addButton(ke);var He=new ct('<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");He.onClick=this.flipVerticallyButtonClicked,de.addButton(He)},B.prototype.ratioButtonClicked=function(S){this.aspectRatio=S,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},B.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Pt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},B.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ct(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0,this.onStateChanged())},B.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},B.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},B.prototype.restoreState=function(S){if(S){var R=this.cropLayer.getRescaledRect(S.width,S.height,this.imageWidth,this.imageHeight,S.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(R),this.cropRectChanged(R),this.flippedHorizontally=S.flippedHorizontally,this.flippedVertically=S.flippedVertically,this.applyFlip(),this.rotationAngle=S.rotationAngle,this.applyRotation(),this.onStateChanged()}},B.prototype.renderState=function(S){this.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose()},B.prototype.clientToLocalCoordinates=function(S,R){var M=this.cropImage.getBoundingClientRect();return{x:S-M.left,y:R-M.top}},B.prototype.onWindowResize=function(){this.positionUI()},B.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var S=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},B.prototype.rotateLeftButtonClicked=function(){var S=this.rotationAngle-90;this.rotationAngle%90!=0&&(S+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(S)},B.prototype.rotateRightButtonClicked=function(){var S=this.rotationAngle+90;this.rotationAngle%90!=0&&(S-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(S)},B.prototype.rotateTo=function(S){S=(S=S>180?S-360:S)<=-180?S+360:S,this.rotationAngle=S,this.applyRotation()},B.prototype.rotateBy=function(S){this.rotateTo((this.rotationAngle+S)%360)},B.prototype.applyRotation=function(){var S=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var R=this.editingTargetRotationContainer.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(R,0);var M=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/M.width,this.imageHeight/M.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=S},B.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},B.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},B.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")",this.onStateChanged()},B.prototype.startRenderAndClose=function(){return Tt(this,void 0,void 0,function(){var S,R;return wt(this,function(M){switch(M.label){case 0:return[4,this.render()];case 1:return S=M.sent(),R=this.getState(),this.renderEventListeners.forEach(function(K){return K(S,R)}),this.close(!0),[2]}})})},B.prototype.render=function(){return Tt(this,void 0,void 0,function(){var S,R;return wt(this,function(M){switch(M.label){case 0:return(S=new jt).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.width=this.renderWidth,S.height=this.renderHeight,S.maxSize=this.renderMaxSize,this.unzoomFromCrop(),je.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return M.sent(),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return R=M.sent(),this.processingUi.style.display="none",[2,R]}})})},B.prototype.onStateChanged=function(){var S=this.getState(),R=JSON.stringify(S);this.previousState!==R&&(this.stateChangeEventListeners.forEach(function(M){return M(S)}),this.previousState=R)},B.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new lt("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 lt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new lt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var S=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new lt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*S)+`px;
height: `+(this.toolbarHeight-2*S)+`px;
padding: `+S+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new lt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new lt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new ut("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new ut("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new lt("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 lt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new lt("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 lt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*S)+`px;
padding: `+S+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new lt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},B.instanceCounter=0,B}(),Bt=F("8hTe"),gt=F.n(Bt),Et=/<pre[^>]*>/g;function Kt(B){var S=document.createElement("div");return S.innerHTML=B,S.childNodes.length===0?"":S.childNodes[0].nodeValue}var rr=ce.a=function(B){var S=B.value,R=S===void 0?"":S,M=B.edit,K=M===void 0?!1:M,U=B.className,de=B.showTextOnly,ke=B.showLines,He=B.replaces,ze=B.zoomImg,Fe=B.hasMask,Je=B.style,dt=Je===void 0?{}:Je,It=B.stylesPrev,Gt=It===void 0?{}:It,Ft=String(R),Ot=Object(k.useRef)(),Xt=Object(k.useRef)(),nr=Object(k.useState)(""),qt=Object(O.a)(nr,2),Jt=qt[0],et=qt[1],tt=Object(k.useState)("office"),ot=Object(O.a)(tt,2),ft=ot[0],Rt=ot[1],At=function(){var pt=new Ht(Xt.current);pt.displayMode="popup",pt.addRenderEventListener(function(){var Vt=Object(G.a)(e.a.mark(function vt(Yt){var St;return e.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Ot.current.style.display="none",Mt.next=3,Object(H.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Yt}});case 3:St=Mt.sent,St!=null&&St.id&&He(Xt.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(St==null?void 0:St.id,"?type=").concat(St.content_type));case 5:case"end":return Mt.stop()}},vt)}));return function(vt){return Vt.apply(this,arguments)}}()),pt.show()},lr=function(){var pt=new nt(Xt.current);pt.settings.displayMode="popup",pt.addEventListener("render",function(){var Vt=Object(G.a)(e.a.mark(function vt(Yt){var St;return e.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(Ot.current.style.display="none",!Xt.current){Mt.next=6;break}return Mt.next=4,Object(H.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Yt.dataUrl}});case 4:St=Mt.sent,St!=null&&St.id&&He(Xt.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(St==null?void 0:St.id,"?type=").concat(St.content_type));case 6:case"end":return Mt.stop()}},vt)}));return function(vt){return Vt.apply(this,arguments)}}()),pt.show(),window.markerArea=pt},tr=Object(k.useMemo)(function(){Ot.current&&(Ot.current.style.zIndex=-1);try{var Wt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,pt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Vt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ft=Ft.replace(Wt,"("+P.a.API_SERVER+"/api/attachments/").replace(pt,'"'+P.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+P.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(er){}var vt=c(Ft),Yt=_();if(Ft.match(/\[TOC\]/)&&(vt=vt.replace("<p>[TOC]</p>",s()),f()),vt=vt.replace(/(__special_katext_id_\d+__)/g,function(er,Mt){var ar=Yt[Mt],or=ar.type,bt=ar.expression;return Object(j.renderToString)(Kt(bt)||"",{displayMode:or==="block",throwOnError:!1,output:"html"})}),vt=vt.replace(/▁/g,"\u2581\u2581\u2581"),v(),de){var St=document.createElement("div");return St.innerHTML=vt,St.innerText}return setTimeout(function(){return sr()},500),vt},[Ft]),$t=Object(k.useRef)();d.WebkitLineClamp=ke,ke&&(dt=Object(ne.a)(Object(ne.a)({},dt),d));function ir(Wt){var pt=Wt.target;if(pt.tagName.toUpperCase()==="IMG"){if(ze){var Vt=pt.getAttribute("src");et(Vt),Rt("image")}}else if(pt.tagName.toUpperCase()==="A"){var vt=pt.getAttribute("href");if(vt.indexOf("office")>-1)Wt.preventDefault(),et(vt),Rt("office");else if(vt.indexOf("application/pdf")>-1)Wt.preventDefault(),et(vt),Rt("pdf");else if(vt.indexOf("text/html")>-1)Wt.preventDefault(),et(vt),Rt("html");else if(vt.startsWith("#")){Wt.preventDefault();var Yt=document.getElementById(vt.replace("#",""));Yt&&Yt.scrollIntoView(!0)}}}var sr=function(){var pt,Vt=(pt=$t.current)===null||pt===void 0?void 0:pt.querySelectorAll("video");Vt==null||Vt.forEach(function(vt){if(vt.oncontextmenu=function(){return!1},vt.src.indexOf(".m3u8")>-1&&!vt.canPlayType("application/vnd.apple.mpegurl")){if(D.a.isSupported()){var Yt=new D.a;Yt.loadSource(vt.src),Yt.attachMedia(vt)}}})};Object(k.useEffect)(function(){if($t.current&&tr&&(tr.match(Et)&&window.PR.prettyPrint()),$t.current)return $t.current.addEventListener("click",ir),function(){$t.current.removeEventListener("click",ir),v(),f()}},[tr,$t.current,ir]);var ur=function(pt){if(!K)return;pt.target.nodeName==="IMG"?(Ot.current.style.zIndex=1,Ot.current.style.display="flex",Ot.current.style.width=pt.target.clientWidth+"px",Ot.current.style.height=pt.target.clientHeight+"px",Ot.current.style.top=pt.target.offsetTop+"px",Ot.current.style.left=pt.target.offsetLeft+"px",Xt.current.src=pt.target.getAttribute("src")):Ot.current.style.display="none"};return L.a.createElement("div",{style:{position:"relative"}},L.a.createElement("div",{ref:$t,style:Object(ne.a)({},dt),className:"".concat(U||""," markdown-body ").concat(gt.a.mdBody),onMouseOver:ur,dangerouslySetInnerHTML:{__html:tr}}),L.a.createElement("div",{ref:Ot,className:gt.a.button},L.a.createElement(be.b,null,L.a.createElement(ge.a,{onClick:function(){return At()}},"\u88C1\u526A"),L.a.createElement(ge.a,{onClick:function(){return lr()}},"\u7F16\u8F91"))),L.a.createElement("img",{ref:Xt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),L.a.createElement(N.a,{close:!0,data:Jt,type:Jt!=null&&Jt.length?ft:"",style:Object(ne.a)({},Gt),onClose:function(){return et("")}}))}},BdwD:function(We,ce,F){"use strict";var me=F("dLI4"),be=F("4d5L"),ye=F("HPgX"),ge=F("YaWb"),ne=F("T/Jt"),G=F.n(ne),O=F("FOrL"),W=F.n(O),e=function(L){var I=L.buttonProps,u=I===void 0?{}:I,m=L.styles,i=m===void 0?{}:m,g=L.customText,w=L.ButtonText,x=L.ButtonClick,E=L.Buttonclass,o=L.ButtonTwo;return G.a.createElement("section",{className:"tc animated fadeIn",style:Object(ge.a)(Object(ge.a)({},{color:"#999",margin:"200px auto"}),i)},G.a.createElement("img",{src:W.a}),G.a.createElement("p",{className:"mt20 font14"},g||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),w&&G.a.createElement(be.a,Object(ye.a)({className:E,onClick:x},u),w),o&&o)};ce.a=e},BsWD:function(We,ce,F){"use strict";F.d(ce,"a",function(){return be});var me=F("a3WO");function be(ye,ge){if(!ye)return;if(typeof ye=="string")return Object(me.a)(ye,ge);var ne=Object.prototype.toString.call(ye).slice(8,-1);if(ne==="Object"&&ye.constructor&&(ne=ye.constructor.name),ne==="Map"||ne==="Set")return Array.from(ye);if(ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne))return Object(me.a)(ye,ge)}},"C/vA":function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(be){const ye=this;let ge=!1,ne;return function(){return ge||(ge=!0,ne=be.apply(ye,arguments)),ne}}},"Cg/j":function(We,ce,F){"use strict";F.d(ce,"b",function(){return me}),F.d(ce,"a",function(){return be}),F.d(ce,"c",function(){return ge}),F.d(ce,"d",function(){return ne});var me;(function(G){G.serviceIds=new Map,G.DI_TARGET="$di$target",G.DI_DEPENDENCIES="$di$dependencies";function O(W){return W[G.DI_DEPENDENCIES]||[]}G.getServiceDependencies=O})(me||(me={}));const be=ge("instantiationService");function ye(G,O,W,e){O[me.DI_TARGET]===O?O[me.DI_DEPENDENCIES].push({id:G,index:W,optional:e}):(O[me.DI_DEPENDENCIES]=[{id:G,index:W,optional:e}],O[me.DI_TARGET]=O)}function ge(G){if(me.serviceIds.has(G))return me.serviceIds.get(G);const O=function(W,e,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ye(O,W,k,!1)};return O.toString=()=>G,me.serviceIds.set(G,O),O}function ne(G){return function(O,W,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ye(G,O,e,!0)}}},EJTS:function(We,ce,F){"use strict";F.d(ce,"a",function(){return d});var me=F("tbnd"),be=F("5KI5"),ye=F("dX86"),ge=F("GwPp"),ne=F("P6vI"),G=F("N082"),O=F("nc60"),W=F("2yBE"),e=F("5LYH"),k=F("Hqw+"),L=F("T/Jt"),I=F.n(L),u=F("9Bee"),m=F("+vTd"),i=F.n(m),g=F("xKgJ"),w=F("Is5a"),x=F.n(w),E=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],o=["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"],f=function(s){var p,C=s.data,l=s.selectIds,T=s.onSelectCheckBox,y=T===void 0?function(){}:T,_=s.showCheckbox,v=_===void 0?!0:_,n=Object(L.useState)(!1),a=Object(k.a)(n,2),r=a[0],t=a[1],c=function(){if(C.item_type==="JUDGMENT")return I.a.createElement("div",{className:i.a.judgmentContent},C.choices.map(function(H,z){return I.a.createElement(e.a,{key:z,disabled:!0},H.choice_text)}));if(C.item_type==="PROGRAM"){var j;return I.a.createElement("div",{className:i.a.programContent},I.a.createElement(u.a,{value:(j=C.program_attr)===null||j===void 0?void 0:j.description}))}if(C.item_type==="COMBINATION"){var N;return I.a.createElement("div",{className:i.a.combinationContent},C==null||((N=C.sub_item_banks)===null||N===void 0)?void 0:N.map(function(H,z){var J,Y="(\u9898\u76EE".concat(z+1,"-\u5355\u9009\u9898) ");return I.a.createElement(L.Fragment,null,I.a.createElement("div",{style:{marginTop:10,marginBottom:10}},I.a.createElement(u.a,{value:Y+H.name})),H.choices.map(function(le,te){return I.a.createElement("div",{key:te,className:i.a.otherContentItem},I.a.createElement("p",null,E[te]),I.a.createElement(u.a,{className:i.a.otehrContentHtml,value:le.choice_text}))}),I.a.createElement("div",{className:i.a.con},I.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",o==null?void 0:o[H==null||((J=H.choices)===null||J===void 0)?void 0:J.findIndex(function(le){return le==null?void 0:le.is_answer})]," "),I.a.createElement("div",null,I.a.createElement("span",null,"\u89E3\u6790\uFF1A"),I.a.createElement(u.a,{className:i.a.parseAnswerHtml,value:H.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return I.a.createElement("div",{className:i.a.otherContent},C.choices.map(function(H,z){return I.a.createElement("div",{key:z,className:i.a.otherContentItem},I.a.createElement("p",null,E[z]),I.a.createElement(u.a,{className:i.a.otehrContentHtml,value:H.choice_text}))}))},b=function(){var j;return I.a.createElement("div",null,(j=C.standard_answer)===null||j===void 0?void 0:j.map(function(N,H){return I.a.createElement(u.a,{key:H,className:i.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(N.position,"\uFF09\uFF1A").concat(N.answer_text.join("\u3001"))})}))},h=function(){var j,N,H,z={SUBJECTIVE:(j=C.answer_texts)===null||j===void 0?void 0:j[0],JUDGMENT:(N=C.choices)===null||N===void 0||((H=N.find(function(we){return we.is_answer}))===null||H===void 0)?void 0:H.choice_text},J=C.choices.map(function(we){return we.is_answer}).findIndex(function(we){return we}),Y=J>-1?o[J]:"",le="";C.choices.map(function(we,De){we.is_answer&&(le+=o[De])});var te=z[C.item_type],Z={SINGLE:I.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Y||"\u65E0")}),MULTIPLE:I.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(le||"\u65E0")}),COMPLETION:b()},_e=I.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(te||"\u65E0")});return Z[C.item_type]||_e},D=function(j){var N=Object(O.a)(l);j.target.checked?N.push(C.id):N=N.filter(function(H){return H!==C.id}),y(N)};return I.a.createElement("div",{className:i.a.itemWrap},I.a.createElement("div",{className:i.a.list},v&&I.a.createElement(G.a,{className:"mr10",onChange:D,checked:l.includes(C.id)}),I.a.createElement("div",{className:i.a.title},I.a.createElement(u.a,{key:1,showLines:1,showTextOnly:!0,className:i.a.topicTitleContent,value:C.name})),I.a.createElement("div",{className:i.a.line},I.a.createElement("b",{className:i.a.b1}),I.a.createElement("b",{className:i.a.b2})),I.a.createElement("div",{onClick:function(){return t(!r)},className:i.a.tr},r?"\u6536\u8D77":"\u5C55\u5F00",I.a.createElement("i",{style:{transform:r?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),I.a.createElement("aside",{style:r?{display:"block"}:{display:"none"},className:i.a.itemDetail},I.a.createElement("div",{style:{marginBottom:44}},I.a.createElement(u.a,{key:2,className:i.a.topicTitleContent,value:C.name}),I.a.createElement("div",{className:"".concat(i.a.row," mt15")},c()),I.a.createElement("div",{className:i.a.row},I.a.createElement("div",{className:i.a.updateTimeRow},I.a.createElement("div",{className:i.a.updateTimeWrap},C.item_type==="PROGRAM"&&I.a.createElement("p",{className:i.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(p=C.program_attr)===null||p===void 0?void 0:p.language))))),C.item_type!=="PROGRAM"&&C.item_type!=="COMBINATION"&&I.a.createElement("div",{className:i.a.answerWrapper},I.a.createElement("img",{src:x.a,alt:"",className:i.a.decoration}),I.a.createElement("div",{className:i.a.answer},h()),I.a.createElement("div",{className:i.a.parse},I.a.createElement("div",{className:i.a.parseText},"\u89E3\u6790\uFF1A"),I.a.createElement("div",{className:i.a.parseAnswer},C.analysis?I.a.createElement(u.a,{className:i.a.parseAnswerHtml,value:C.analysis}):"\u6682\u65E0\u89E3\u6790")))))},d=function(s){var p,C,l,T,y,_,v,n,a,r,t,c,b,h,D,P,j=s.isProblemset,N=s.data,H=s.user,z=s.activeTabsKey,J=s.onPublicReview,Y=J===void 0?function(){}:J,le=s.onStartExperience,te=le===void 0?function(){}:le,Z=s.onSetPrivate,_e=Z===void 0?function(){}:Z,we=s.onCorrection,De=we===void 0?function(){}:we,Ee=s.onCollect,xe=Ee===void 0?function(){}:Ee,ve=s.onSetPublic,X=ve===void 0?function(){}:ve,Ae=s.onDelete,Q=Ae===void 0?function(){}:Ae,ue=s.onCancel,ee=ue===void 0?function(){}:ue,ae=s.onSelect,fe=ae===void 0?function(){}:ae,Re=s.onMoveTo,pe=Re===void 0?function(){}:Re,ie=s.onSetShare,Ie=ie===void 0?function(){}:ie,Oe=s.onCancelShare,Ne=Oe===void 0?function(){}:Oe,Le=s.onPublish,Ce=Le===void 0?function(){}:Le,Ue=s.onCancelPublish,Te=Ue===void 0?function(){}:Ue,Pe=N.item_type==="PROGRAM"?"/problems/".concat((p=N.program_attr)===null||p===void 0?void 0:p.identifier,"/edit"):"/problemset/edit/".concat(N.id),q=z==="0"&&!N.public&&!N.apply&&(N.item_type==="PROGRAM"&&((C=N.program_attr)===null||C===void 0?void 0:C.status)!==0||N.item_type!=="PROGRAM"),se=I.a.createElement(ge.a,{forceSubMenuRender:!0,className:i.a.menu},z==="0"&&!N.public&&I.a.createElement(ge.a.Item,{key:"-1"},I.a.createElement("a",{className:i.a.actionLink,target:"_blank",href:Pe},"\u7F16\u8F91")),(z==="0"||z==="3")&&N.item_type==="PROGRAM"&&((l=N.program_attr)===null||l===void 0?void 0:l.status)!==0&&!N.public&&((T=N.author)===null||T===void 0?void 0:T.login)===((y=H.userInfo)===null||y===void 0?void 0:y.login)&&I.a.createElement(ge.a.Item,{key:"0"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){var re;return Te(N==null||((re=N.program_attr)===null||re===void 0)?void 0:re.identifier)}},"\u64A4\u9500\u53D1\u5E03")),z==="0"&&I.a.createElement(ge.a.Item,{key:"1"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return pe(N.id)}},"\u79FB\u52A8\u5230")),z==="0"&&!(N!=null&&N.is_share)&&I.a.createElement(ge.a.Item,{key:"3"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ie(N.id)}},"\u5171\u4EAB")),(z==="0"&&(N==null?void 0:N.is_share)||z==="3"&&((_=N.author)===null||_===void 0?void 0:_.login)===((v=H.userInfo)===null||v===void 0?void 0:v.login))&&I.a.createElement(ge.a.Item,{key:"3"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ne(N.id)}},"\u64A4\u9500\u5171\u4EAB")),q&&I.a.createElement(ge.a.Item,{key:"4"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return X(N.id)}},"\u516C\u5F00")),z==="0"&&!N.public&&N.apply&&(N.item_type==="PROGRAM"&&N.program_attr.status!==0||N.item_type!=="PROGRAM")&&I.a.createElement(ge.a.Item,{key:"5"},I.a.createElement("a",{className:i.a.reviewFlag,onClick:Y},"\u5BA1\u6838\u4E2D")),(z==="0"||z==="1")&&N.public&&((n=N.author)===null||n===void 0?void 0:n.login)===((a=H.userInfo)===null||a===void 0?void 0:a.login)&&I.a.createElement(ge.a.Item,{key:"6"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return _e(N.id)}},"\u64A4\u9500\u516C\u5F00")),z==="2"&&I.a.createElement(ge.a.Item,{key:"7"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return xe(N.id,N.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(z==="0"||z==="3")&&N.item_type==="PROGRAM"&&((r=N.program_attr)===null||r===void 0?void 0:r.status)===0&&!N.public&&((t=N.author)===null||t===void 0?void 0:t.login)===((c=H.userInfo)===null||c===void 0?void 0:c.login)&&I.a.createElement(ge.a.Item,{key:"8"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){var re;return Ce(N==null||((re=N.program_attr)===null||re===void 0)?void 0:re.identifier)}},"\u53D1\u5E03")),(z==="1"||z==="3")&&!Object(g.o)()&&!Object(g.m)()&&((b=N.author)===null||b===void 0?void 0:b.login)!==((h=H.userInfo)===null||h===void 0?void 0:h.login)&&I.a.createElement(ge.a.Item,{key:"9"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return xe(N.id,N.is_collected)}},N.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),z!=="0"&&!Object(g.o)()&&!Object(g.m)()&&I.a.createElement(ge.a.Item,{key:"10"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return De(N.id)}},"\u7EA0\u9519")),(z==="0"&&!N.public||z==="1"&&Object(g.o)()&&((D=N.author)===null||D===void 0?void 0:D.login)!==((P=H.userInfo)===null||P===void 0?void 0:P.login))&&I.a.createElement(ge.a.Item,{key:"11"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Q(N.id)}},"\u5220\u9664"))),he=I.a.createElement(ge.a,{forceSubMenuRender:!0,className:i.a.menu},I.a.createElement(ge.a.Item,{key:"10"},I.a.createElement("a",{className:i.a.actionLink,onClick:function(){return De(N.id)}},"\u7EA0\u9519"))),V=z!=="0"&&!Object(g.o)()&&!Object(g.m)();return I.a.createElement(I.a.Fragment,null,j?I.a.createElement(I.a.Fragment,null,N.item_type!=="SUBJECTIVE"&&N.item_type!=="COMBINATION"&&I.a.createElement("span",{className:i.a.textBtn,style:{cursor:"pointer"},onClick:function(){return te(N)}},"\u4F53\u9A8C"),I.a.createElement(be.a,{overlay:se},I.a.createElement("span",{style:{cursor:"default"},onClick:function(re){return re.preventDefault()}},I.a.createElement("span",{className:i.a.textBtn},"\u66F4\u591A")))):V?I.a.createElement(be.a,{className:"ml40",overlay:he},I.a.createElement("span",{style:{cursor:"default"},onClick:function(re){return re.preventDefault()}},I.a.createElement("span",null,"\u66F4\u591A"))):I.a.createElement("span",null))};ce.b=f},El5i:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(be,ye){return be[ye]}},FER5:function(We,ce,F){"use strict";F.d(ce,"g",function(){return be}),F.d(ce,"b",function(){return ne}),F.d(ce,"f",function(){return G}),F.d(ce,"c",function(){return O}),F.d(ce,"e",function(){return W}),F.d(ce,"a",function(){return I}),F.d(ce,"d",function(){return u});var me=F("b3aT");function be(i,g,w){return{r:Object(me.a)(i,255)*255,g:Object(me.a)(g,255)*255,b:Object(me.a)(w,255)*255}}function ye(i,g,w){i=Object(me.a)(i,255),g=Object(me.a)(g,255),w=Object(me.a)(w,255);var x=Math.max(i,g,w),E=Math.min(i,g,w),o=0,f=0,d=(x+E)/2;if(x===E)f=0,o=0;else{var A=x-E;f=d>.5?A/(2-x-E):A/(x+E);switch(x){case i:o=(g-w)/A+(g<w?6:0);break;case g:o=(w-i)/A+2;break;case w:o=(i-g)/A+4;break;default:break}o/=6}return{h:o,s:f,l:d}}function ge(i,g,w){return w<0&&(w+=1),w>1&&(w-=1),w<1/6?i+(g-i)*(6*w):w<1/2?g:w<2/3?i+(g-i)*(2/3-w)*6:i}function ne(i,g,w){var x,E,o;if(i=Object(me.a)(i,360),g=Object(me.a)(g,100),w=Object(me.a)(w,100),g===0)E=w,o=w,x=w;else{var f=w<.5?w*(1+g):w+g-w*g,d=2*w-f;x=ge(d,f,i+1/3),E=ge(d,f,i),o=ge(d,f,i-1/3)}return{r:x*255,g:E*255,b:o*255}}function G(i,g,w){i=Object(me.a)(i,255),g=Object(me.a)(g,255),w=Object(me.a)(w,255);var x=Math.max(i,g,w),E=Math.min(i,g,w),o=0,f=x,d=x-E,A=x===0?0:d/x;if(x===E)o=0;else{switch(x){case i:o=(g-w)/d+(g<w?6:0);break;case g:o=(w-i)/d+2;break;case w:o=(i-g)/d+4;break;default:break}o/=6}return{h:o,s:A,v:f}}function O(i,g,w){i=Object(me.a)(i,360)*6,g=Object(me.a)(g,100),w=Object(me.a)(w,100);var x=Math.floor(i),E=i-x,o=w*(1-g),f=w*(1-E*g),d=w*(1-(1-E)*g),A=x%6,s=[w,f,o,o,d,w][A],p=[d,w,w,f,o,o][A],C=[o,o,d,w,w,f][A];return{r:s*255,g:p*255,b:C*255}}function W(i,g,w,x){var E=[Object(me.d)(Math.round(i).toString(16)),Object(me.d)(Math.round(g).toString(16)),Object(me.d)(Math.round(w).toString(16))];return x&&E[0].startsWith(E[0].charAt(1))&&E[1].startsWith(E[1].charAt(1))&&E[2].startsWith(E[2].charAt(1))?E[0].charAt(0)+E[1].charAt(0)+E[2].charAt(0):E.join("")}function e(i,g,w,x,E){var o=[Object(me.d)(Math.round(i).toString(16)),Object(me.d)(Math.round(g).toString(16)),Object(me.d)(Math.round(w).toString(16)),Object(me.d)(L(x))];return E&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function k(i,g,w,x){var E=[Object(me.d)(L(x)),Object(me.d)(Math.round(i).toString(16)),Object(me.d)(Math.round(g).toString(16)),Object(me.d)(Math.round(w).toString(16))];return E.join("")}function L(i){return Math.round(parseFloat(i)*255).toString(16)}function I(i){return u(i)/255}function u(i){return parseInt(i,16)}function m(i){return{r:i>>16,g:(i&65280)>>8,b:i&255}}},FKdj:function(We,ce,F){We.exports={flex_box_center:"flex_box_center___3uXpC",flex_space_between:"flex_space_between___1R5l3",flex_box_vertical_center:"flex_box_vertical_center___2whw-",flex_box_center_end:"flex_box_center_end___Jni7d",flex_box_column:"flex_box_column___bQWh0",page:"page___2wqIC",wrap:"wrap___3ThhU",title:"title___3BwkD",select:"select___2Ozsr",contentWrap:"contentWrap___3srp0",pngIcon:"pngIcon___2ckkq",tabsWrap:"tabsWrap___2Y959",searchWrap:"searchWrap___H9GsL",addQuestionBtn:"addQuestionBtn___1b8s_",search:"search___3d1EJ",searchIcon:"searchIcon___1mrzV",batchWrap:"batchWrap___j1Er3",contentListWrap:"contentListWrap___3pty2",li:"li___2UOPB",bottom:"bottom___I7MVG",actionLeftItem:"actionLeftItem___3bGeH",questionTypeName:"questionTypeName___Aiyux",more:"more___YExtS",btnAdd:"btnAdd___2RrWf",treeWrapper:"treeWrapper___U0OPC",treeHeader:"treeHeader___1LB2p",treeContent:"treeContent___Ckfqx",action:"action___Xn5RP",headerWrapper:"headerWrapper___3ECJD",exportBtn:"exportBtn___35cZE"}},FOrL:function(We,ce,F){We.exports=F.p+"static/nodata.a6b3f948.png"},FWmy:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(be,ye){if(!be)throw new Error(ye?`Assertion failed (${ye})`:"Assertion Failed")}},Ff2n:function(We,ce,F){"use strict";F.d(ce,"a",function(){return be});var me=F("zLVn");function be(ye,ge){if(ye==null)return{};var ne=Object(me.a)(ye,ge),G,O;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(ye);for(O=0;O<W.length;O++){if(G=W[O],ge.indexOf(G)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ye,G))continue;ne[G]=ye[G]}}return ne}},GcTH:function(We,ce){const F=/[&<>"']/,me=/[&<>"']/g,be=/[<>"']|&(?!#?\w+;)/,ye=/[<>"']|&(?!#?\w+;)/g,ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ne=p=>ge[p];function G(p,C){if(C){if(F.test(p))return p.replace(me,ne)}else if(be.test(p))return p.replace(ye,ne);return p}const O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(p){return p.replace(O,(C,l)=>(l=l.toLowerCase(),l==="colon"?":":l.charAt(0)==="#"?l.charAt(1)==="x"?String.fromCharCode(parseInt(l.substring(2),16)):String.fromCharCode(+l.substring(1)):""))}const e=/(^|[^\[])\^/g;function k(p,C){p=p.source||p,C=C||"";const l={replace:(T,y)=>(y=y.source||y,y=y.replace(e,"$1"),p=p.replace(T,y),l),getRegex:()=>new RegExp(p,C)};return l}const L=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(p,C,l){if(p){let T;try{T=decodeURIComponent(W(l)).replace(L,"").toLowerCase()}catch(y){return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}C&&!I.test(l)&&(l=x(C,l));try{l=encodeURI(l).replace(/%25/g,"%")}catch(T){return null}return l}const m={},i=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,w=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(p,C){m[" "+p]||(i.test(p)?m[" "+p]=p+"/":m[" "+p]=d(p,"/",!0)),p=m[" "+p];const l=p.indexOf(":")===-1;return C.substring(0,2)==="//"?l?C:p.replace(g,"$1")+C:C.charAt(0)==="/"?l?C:p.replace(w,"$1")+C:p+C}const E={exec:function(){}};function o(p){let C=1,l,T;for(;C<arguments.length;C++){l=arguments[C];for(T in l)Object.prototype.hasOwnProperty.call(l,T)&&(p[T]=l[T])}return p}function f(p,C){const l=p.replace(/\|/g,(_,v,n)=>{let a=!1,r=v;for(;--r>=0&&n[r]==="\\";)a=!a;return a?"|":" |"}),T=l.split(/ \|/);let y=0;if(T.length>C)T.splice(C);else for(;T.length<C;)T.push("");for(;y<T.length;y++)T[y]=T[y].trim().replace(/\\\|/g,"|");return T}function d(p,C,l){const T=p.length;if(T===0)return"";let y=0;for(;y<T;){const _=p.charAt(T-y-1);if(_===C&&!l)y++;else if(_!==C&&l)y++;else break}return p.substr(0,T-y)}function A(p,C){if(p.indexOf(C[1])===-1)return-1;const l=p.length;let T=0,y=0;for(;y<l;y++)if(p[y]==="\\")y++;else if(p[y]===C[0])T++;else if(p[y]===C[1]&&(T--,T<0))return y;return-1}function s(p){p&&p.sanitize&&!p.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")}We.exports={escape:G,unescape:W,edit:k,cleanUrl:u,resolveUrl:x,noopTest:E,merge:o,splitCells:f,rtrim:d,findClosingBracket:A,checkSanitizeDeprecation:s}},Is5a:function(We,ce){We.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(We,ce){We.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JYp7:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});var me;(function(be){function ye(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}be.is=ye;const ge=Object.freeze([]);function ne(){return ge}be.empty=ne;function*G(o){yield o}be.single=G;function O(o){return o||ge}be.from=O;function W(o){return!o||o[Symbol.iterator]().next().done===!0}be.isEmpty=W;function e(o){return o[Symbol.iterator]().next().value}be.first=e;function k(o,f){for(const d of o)if(f(d))return!0;return!1}be.some=k;function L(o,f){for(const d of o)if(f(d))return d;return}be.find=L;function*I(o,f){for(const d of o)f(d)&&(yield d)}be.filter=I;function*u(o,f){let d=0;for(const A of o)yield f(A,d++)}be.map=u;function*m(...o){for(const f of o)for(const d of f)yield d}be.concat=m;function*i(o){for(const f of o)for(const d of f)yield d}be.concatNested=i;function g(o,f,d){let A=d;for(const s of o)A=f(A,s);return A}be.reduce=g;function*w(o,f,d=o.length){for(f<0&&(f+=o.length),d<0?d+=o.length:d>o.length&&(d=o.length);f<d;f++)yield o[f]}be.slice=w;function x(o,f=Number.POSITIVE_INFINITY){const d=[];if(f===0)return[d,o];const A=o[Symbol.iterator]();for(let s=0;s<f;s++){const p=A.next();if(p.done)return[d,be.empty()];d.push(p.value)}return[d,{[Symbol.iterator](){return A}}]}be.consume=x;function E(o,f,d=(A,s)=>A===s){const A=o[Symbol.iterator](),s=f[Symbol.iterator]();for(;;){const p=A.next(),C=s.next();if(p.done!==C.done)return!1;if(p.done)return!0;if(!d(p.value,C.value))return!1}}be.equals=E})(me||(me={}))},KMxT:function(We,ce,F){"use strict";F.r(ce);var me=F("w7s4"),be=F("HC/W"),ye=F("tbnd"),ge=F("5KI5"),ne=F("dX86"),G=F("GwPp"),O=F("VUml"),W=F("RCAX"),e=F("dLI4"),k=F("4d5L"),L=F("YaWb"),I=F("IYef"),u=F("Hqw+"),m=F("ftSv"),i=F("47JS"),g=F("TOZL"),w=F("wd39"),x=F("szcH"),E=F("XXmO"),o=F.n(E),f=F("T/Jt"),d=F.n(f),A=F("9kvl"),s=F("iris"),p=F("jcZT"),C=F("BdwD"),l=F("SAoR"),T=F("FKdj"),y=F.n(T),_=F("EJTS"),v=F("LE3n"),n=F("xKgJ"),a=F("SVaM"),r=F("xTzM"),t=F.n(r),c=F("1vsH"),b=F("ErOA"),h=x.a.TabPane,D=g.a.Search,P;(function(N){N.Mine="0",N.Public="1",N.Collection="2",N.TeachGroupShare="3"})(P||(P={}));var j=function(H){var z,J,Y,le,te,Z,_e,we,De=H.classroomList,Ee=H.problemset,xe=H.user,ve=H.globalSetting,X=H.loading,Ae=H.dispatch,Q=H.match,ue=H.shixunHomeworks,ee=Object(m.a)(H,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),ae=Object(c.J)(),fe=Object(f.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:ae.qtype,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((z=ee.location)===null||z===void 0||((J=z.query)===null||J===void 0)?void 0:J.id)||null,exam_id:(Q==null||((Y=Q.params)===null||Y===void 0)?void 0:Y.id)||null,exercise_id:(Q==null||((le=Q.params)===null||le===void 0)?void 0:le.categoryId)||null}),Re=Object(u.a)(fe,2),pe=Re[0],ie=Re[1],Ie=Object(f.useState)(0),Oe=Object(u.a)(Ie,2),Ne=Oe[0],Le=Oe[1],Ce=Object(f.useState)([]),Ue=Object(u.a)(Ce,2),Te=Ue[0],Pe=Ue[1],q=Object(f.useState)(P.Mine),se=Object(u.a)(q,2),he=se[0],V=se[1],$=Object(f.useState)(-1),re=Object(u.a)($,2),oe=re[0],Se=re[1],Me=Object(f.useState)([]),Be=Object(u.a)(Me,2),Ke=Be[0],Xe=Be[1],Ge=Object(f.useState)([]),rt=Object(u.a)(Ge,2),qe=rt[0],Ve=rt[1],at=Object(f.useState)(!1),Qe=Object(u.a)(at,2),$e=Qe[0],nt=Qe[1],Ye=Object(f.useRef)(!1),st=Object(f.useState)([]),Tt=Object(u.a)(st,2),wt=Tt[0],xt=Tt[1],je=Object(f.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),Ze=Object(u.a)(je,2),ut=Ze[0],lt=Ze[1],it=Object(f.useState)([]),yt=Object(u.a)(it,2),Lt=yt[0],ct=yt[1],mt=Object(f.useRef)(null),Ct=Object(f.useState)(!1),Pt=Object(u.a)(Ct,2),kt=Pt[0],ht=Pt[1],Dt=Object(f.useState)(""),Nt=Object(u.a)(Dt,2),jt=Nt[0],Ht=Nt[1],Bt=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(f.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(f.useEffect)(function(){var et;Ae({type:"problemset/getDisciplines",payload:{source:"question"}});var tt=((et=ee.location.query)===null||et===void 0?void 0:et.group_id)||0;pe.group_id=Number(tt),ie(pe),Et(pe).then(function(ot){ot!=null&&ot.status||ct(ot==null?void 0:ot.item_banks_group),ht(!1)}),Kt(),gt()},[]),Object(f.useEffect)(function(){return Ae({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Ae({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Ae({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Ae({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(f.useEffect)(function(){return Ae({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Ae({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(f.useEffect)(function(){return Ae({type:"globalSetting/headerFooterToggle",payload:!1}),function(){Ae({type:"globalSetting/headerFooterToggle",payload:!0})}},[]);var gt=function(){var et=Object(I.a)(o.a.mark(function tt(){return o.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:Ae({type:"problemset/getTeachGroupData"});case 1:case"end":return ft.stop()}},tt)}));return function(){return et.apply(this,arguments)}}(),Et=function(){var et=Object(I.a)(o.a.mark(function tt(ot){var ft;return o.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return ot.item_type=ot.item_type,ht(!0),At.next=4,Ae({type:"problemset/getItemBanks",payload:ot});case 4:if(ft=At.sent,!(ft&&ft.status!==403&&ft.status!==401&&ft.status!==500)){At.next=14;break}return Le(ft.items_count||0),Pe(ft.items||[]),Xe(ft.tag_disciplines||[]),rr(ft.items||[]),xt([]),Ve((ft==null?void 0:ft.navigation)||[]),ht(!1),At.abrupt("return",ft);case 14:case"end":return At.stop()}},tt)}));return function(ot){return et.apply(this,arguments)}}(),Kt=function(){Ae({type:"problemset/getBasketList",payload:{}})},rr=function(tt){var ot=tt.every(function(ft){var Rt;return((Rt=ft.program_attr)===null||Rt===void 0?void 0:Rt.status)===0});Ye.current=ot},B=function(tt,ot){if(pe.discipline_id=tt||"",pe.sub_discipline_id=ot||"",pe.tag_discipline_id="",pe.page=1,pe.per_page=20,delete pe.id,Se(tt===null?-1:null),ie(pe),Et(pe),tt===null)return},S=function(tt){pe.difficulty=tt||"",pe.page=1,pe.per_page=20,delete pe.id,ie(pe),Et(pe)},R=function(tt){pe.tag_discipline_id=tt,pe.page=1,pe.per_page=20,delete pe.id,tt===-1&&(pe.discipline_id="",pe.sub_discipline_id="",pe.tag_discipline_id=""),Se(tt),ie(pe),Et(pe)},M=Object(f.useState)(!1),K=Object(u.a)(M,2),U=K[0],de=K[1],ke=function(tt){Ae({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:tt}}),pe.discipline_id="",pe.sub_discipline_id="",pe.tag_discipline_id="",pe.difficulty=null,pe.type=tt,tt==="0"?pe.group_id=0:pe.group_id=null,tt==="3"?de(!0):de(!1),pe.page=1,pe.per_page=20,delete pe.id,Se(-1),V(tt),ie(pe),Et(pe)},He=function(tt,ot){pe.page=tt,pe.per_page=ot,ie(pe),Et(pe)},ze=function(tt){pe.discipline_id="",pe.sub_discipline_id="",pe.tag_discipline_id="",pe.difficulty=null,pe.page=1,pe.keyword=tt,delete pe.id,tt?(nt(!0),Object(a.a)({name:tt,copywriting:tt,position:"ItemBank"})):nt(!1),Se(-1),ie(pe),Et(pe)},Fe=function(){pe.per_page=20,ie(pe),Et(pe)},Je=function(){var et=Object(I.a)(o.a.mark(function tt(ot){return o.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:Ae({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(ot),group_type:P.Mine}}),pe.page=1,pe.per_page=20,pe.group_id=Math.abs(ot),ie(pe),Et(pe).then(function(At){return ct(At==null?void 0:At.item_banks_group)});case 6:case"end":return Rt.stop()}},tt)}));return function(ot){return et.apply(this,arguments)}}(),dt=function(){Ae({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:pe}});return},It=function(){Ae({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u9A8C\u9879\u76EE"}})},Gt=function(){var et=Object(I.a)(o.a.mark(function tt(ot){return o.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:Ae({type:"problemset/getDisciplines",payload:{source:"question",group_id:ot,group_type:P.TeachGroupShare}}),pe.page=1,pe.group_id=ot||null,delete pe.id,ie(Object(L.a)({},pe)),Et(pe);case 6:case"end":return Rt.stop()}},tt)}));return function(ot){return et.apply(this,arguments)}}(),Ft=function(tt){pe.sort_by=tt.type,pe.sort_direction=tt.direction,pe.page=1,pe.per_page=20,lt(tt.name),ie(pe),Et(pe)},Ot=function(tt){pe.discipline_id="",pe.sub_discipline_id="",pe.tag_discipline_id="",pe.difficulty=null,pe.page=1,pe.per_page=20,pe.group_id=tt,Se(-1),ie(pe),Et(pe).then(function(ot){return ct(ot==null?void 0:ot.item_banks_group)})},Xt=function(tt){xt(tt)},nr=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],qt={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Jt=function(){var et=Object(I.a)(o.a.mark(function tt(ot){var ft;return o.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(ae.type==="exercise")){At.next=6;break}return At.next=3,Object(b.a)("/api/exercises/".concat(ae.exerciseid,"/toggle_random_question.json"),{method:"post",body:{question_id:ae.qid,item_bank_id:ot}});case 3:return ft=At.sent,ft!=null&&ft.status||A.d.push(ae.from),At.abrupt("return");case 6:case"end":return At.stop()}},tt)}));return function(ot){return et.apply(this,arguments)}}();return d.a.createElement("div",{className:y.a.page},d.a.createElement("section",null,d.a.createElement("div",{className:y.a.wrap},d.a.createElement("div",{className:y.a.title},"\u8BD5\u9898\u5E93"),d.a.createElement("div",{className:y.a.headerWrapper},d.a.createElement("div",{className:y.a.tabsWrap},d.a.createElement(x.a,{activeKey:he,onChange:ke,tabBarExtraContent:d.a.createElement("div",{className:y.a.searchWrap},d.a.createElement(D,{allowClear:!0,suffix:d.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(y.a.searchIcon),onClick:function(){return ze(pe.keyword)}}),className:y.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",value:pe.keyword,onChange:function(tt){pe.keyword=tt.target.value,ie(Object(L.a)({},pe))},onSearch:ze}))},d.a.createElement(h,{tab:"\u516C\u5171",key:"1"}),((te=Ee.teachGroupData)===null||te===void 0||((Z=te.groups)===null||Z===void 0)?void 0:Z.length)&&d.a.createElement(h,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(n.o)()&&!Object(n.m)()&&d.a.createElement(h,{tab:"\u6536\u85CF\u5939",key:"2"}),d.a.createElement(h,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),d.a.createElement(s.a,{showSelectAll:!1,className:y.a.select,disciplinesData:(_e=Ee.disciplinesData)===null||_e===void 0?void 0:_e.disciplines,knowledgeData:Ke,directionValue:pe.discipline_id,subDisciplineValue:pe.sub_discipline_id,typeValue:pe.item_type,isprogram_homework:!1,showItemType:!1,showKnowledge:!0,name:jt,setname:Ht,difficultyValue:pe.difficulty,showShixun:!1,onShixunChange:It,onDirectionChange:B,onTypeChange:function(){},onDifficultyChange:S,knowledgeValue:oe,onKnowledgeChange:R,teachGroupData:(we=Ee.teachGroupData)===null||we===void 0?void 0:we.groups,onTeachGroupChange:Gt,teachGroupValue:pe.group_id,showTeachGroup:U})),d.a.createElement("div",{className:y.a.treeWrapper,style:{display:he===P.Mine?"block":"none"}},d.a.createElement("div",{className:y.a.treeHeader},d.a.createElement(l.a,{data:qe,onClick:Je}),d.a.createElement(k.a,{type:"link",onClick:dt,className:y.a.exportBtn},d.a.createElement("img",{src:t.a,alt:"",className:y.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),d.a.createElement(W.a,{spinning:kt},d.a.createElement("div",{ref:mt,className:y.a.treeContent},d.a.createElement(v.a,{isProblemset:!1,reloadData:Fe,data:Lt,onShare:function(){},onOpen:Je})))),d.a.createElement("div",{className:y.a.contentWrap},d.a.createElement("div",{className:y.a.batchWrap},d.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},d.a.createElement("div",{className:"font14"},d.a.createElement(ge.a,{overlay:d.a.createElement(G.a,{selectedKeys:[ut]},Bt==null?void 0:Bt.map(function(et,tt){return d.a.createElement(G.a.Item,{key:et.name,onClick:function(){return Ft(et)}},et.name)}))},d.a.createElement("span",{style:{color:"#464F66"}},d.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),ut))))),$e?d.a.createElement("div",null,d.a.createElement(k.a,{style:{paddingLeft:0},onClick:function(){pe.page=1,pe.keyword=null,delete pe.id,ie(pe),nt(!1),Et(pe)},type:"link"},d.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),d.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",pe.keyword,"\u201D")):null,d.a.createElement("div",{className:y.a.contentListWrap},Ne!==0?d.a.createElement(W.a,{size:"large",spinning:X["problemset/getItemBanks"]},Te.map(function(et,tt){var ot,ft;return d.a.createElement("div",{className:y.a.li,key:et.id},d.a.createElement("div",{className:y.a.top},d.a.createElement(_.b,{showCheckbox:!1,data:et,selectIds:wt,onSelectCheckBox:Xt})),d.a.createElement("div",{className:y.a.bottom},d.a.createElement("p",{className:"".concat(y.a.actionLeftItem," ").concat(y.a.questionTypeName)},(ot=nr.find(function(Rt){return Rt.type===et.item_type}))===null||ot===void 0?void 0:ot.name),d.a.createElement("p",{className:y.a.actionLeftItem},qt[et.difficulty]),d.a.createElement("p",{className:y.a.actionLeftItem},"\u521B\u5EFA\u8005",d.a.createElement("span",{className:"c-grey-333"},et==null||((ft=et.author)===null||ft===void 0)?void 0:ft.name)),d.a.createElement("p",{className:y.a.actionLeftItem},"\u66F4\u65B0",d.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.updated_at)),d.a.createElement("p",{className:y.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",d.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.quotes)),d.a.createElement("div",{className:y.a.more},d.a.createElement("span",{className:y.a.btnAdd,onClick:function(){return Jt(et.id)}},"\u66FF\u6362"))))})):d.a.createElement(W.a,{size:"large",spinning:X["problemset/getItemBanks"]},d.a.createElement(C.a,null))),Ne!==0&&d.a.createElement(be.a,{showQuickJumper:!0,onChange:He,defaultCurrent:1,pageSize:pe==null?void 0:pe.per_page,current:pe.page||1,total:Ne,showTotal:function(tt){return d.a.createElement("span",{className:"mr10"},"\u5171",d.a.createElement("span",{className:"c-light-primary"},tt),"\u6761\u6570\u636E")}}))),d.a.createElement(p.a,{onOk:Ot})))};ce.default=Object(A.a)(function(N){var H=N.classroomList,z=N.problemset,J=N.user,Y=N.loading,le=N.globalSetting,te=N.shixunHomeworks;return{classroomList:H,problemset:z,user:J,globalSetting:le,loading:Y.effects,shixunHomeworks:te}})(j)},LE3n:function(We,ce,F){"use strict";var me=F("+kGG"),be=F("8JJ2"),ye=F("YaWb"),ge=F("dLI4"),ne=F("4d5L"),G=F("47JS"),O=F("TOZL"),W=F("c3Iv"),e=F("rBQ5"),k=F("8OG5"),L=F("mgsT"),I=F("IYef"),u=F("Hqw+"),m=F("XXmO"),i=F.n(m),g=F("T/Jt"),w=F.n(g),x=F("1vnw"),E=F.n(x),o=F("ErOA"),f=F("Ix/O"),d=F.n(f),A=F("xTzM"),s=F.n(A),p=F("WCUW"),C=F("LvDl"),l=F.n(C),T=function(v){var n=v.isProblemset,a=v.name,r=v.id,t=v.itemBanksCount,c=v.onOpen,b=c===void 0?function(){}:c,h=v.onShare,D=h===void 0?function(){}:h,P=v.onMove,j=P===void 0?function(){}:P,N=v.onDeleteOk,H=N===void 0?function(){}:N,z=Object(g.useState)(!1),J=Object(u.a)(z,2),Y=J[0],le=J[1],te=Object(g.useState)(a),Z=Object(u.a)(te,2),_e=Z[0],we=Z[1],De=Object(g.useState)(a),Ee=Object(u.a)(De,2),xe=Ee[0],ve=Ee[1],X=function(){var Q=Object(I.a)(i.a.mark(function ue(ee){var ae,fe,Re;return i.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:if(ae=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],xe.trim()){ie.next=4;break}return L.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),ie.abrupt("return");case 4:if(!(xe.charAt(0)===" ")){ie.next=7;break}return L.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),ie.abrupt("return");case 7:fe=0;case 8:if(!(fe<xe.length)){ie.next=15;break}if(!ae.includes(xe.charAt(fe))){ie.next=12;break}return L.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),ie.abrupt("return",!1);case 12:fe++,ie.next=8;break;case 15:return ie.next=17,Object(o.a)("/api/item_banks_groups/".concat(Math.abs(ee),".json"),{method:"put",body:{name:xe}});case 17:Re=ie.sent,Re.status===0&&(le(!1),we(xe));case 19:case"end":return ie.stop()}},ue)}));return function(ee){return Q.apply(this,arguments)}}(),Ae=function(ue){e.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:w.a.createElement("div",null,w.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),w.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var ee=Object(I.a)(i.a.mark(function fe(){var Re;return i.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(o.a)("/api/item_banks_groups/".concat(Math.abs(ue),".json"),{method:"delete",body:{}});case 2:Re=ie.sent,Re.status===0&&H(ue);case 4:case"end":return ie.stop()}},fe)}));function ae(){return ee.apply(this,arguments)}return ae}()})};return w.a.createElement("div",{className:E.a.list},Y?w.a.createElement(O.a,{style:{maxWidth:780},value:xe,onChange:function(ue){return ve(ue.target.value)}}):w.a.createElement("div",{title:_e,onClick:function(){return b(r)},className:E.a.name},_e),n&&w.a.createElement("div",{className:E.a.btns},Y?w.a.createElement(w.a.Fragment,null,w.a.createElement("div",{style:{height:16},onClick:function(){return X(r)},className:"ml0"},w.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),w.a.createElement("div",{style:{height:16},onClick:function(){ve(_e),le(!1)},className:"ml10"},w.a.createElement("i",{className:"iconfont icon-qingchu"}))):w.a.createElement(w.a.Fragment,null,w.a.createElement("div",{onClick:function(){return j(r,"up")},className:"ml0"},w.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),w.a.createElement("div",{onClick:function(){return j(r,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},w.a.createElement("i",{className:"iconfont icon-shangyi3"}))),w.a.createElement(ne.a,{className:"ml10",onClick:function(){if(!t){L.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}D(Math.abs(r))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),w.a.createElement(ne.a,{className:"ml10",onClick:function(){return le(!0)},type:"link"},"\u91CD\u547D\u540D"),w.a.createElement(ne.a,{onClick:function(){return Ae(r)},type:"link",danger:!0},"\u5220\u9664")))},y=function(v){var n=v.isProblemset,a=v.data,r=v.onOpen,t=r===void 0?function(){}:r,c=v.onShare,b=c===void 0?function(){}:c,h=v.reloadData,D=Object(g.useState)(),P=Object(u.a)(D,2),j=P[0],N=P[1];Object(g.useEffect)(function(){N(a==null?void 0:a.map(function(_e){return{title:w.a.createElement(T,{isProblemset:n,name:_e.name,id:_e.id,itemBanksCount:_e.item_banks_count,onMove:z,onOpen:t,onShare:b,onDeleteOk:Y}),key:_e.id,icon:w.a.createElement("img",{src:d.a,className:E.a.folderIcon}),isLeaf:!1}}))},[a]);var H=function _e(we,De,Ee){for(var xe=Object(C.cloneDeep)(we),ve=0;ve<xe.length;ve++){if(xe[ve].key===De){if(Ee==="up"){var X=[xe[ve],xe[ve-1]];xe[ve-1]=X[0],xe[ve]=X[1]}else{var Ae=[xe[ve+1],xe[ve]];xe[ve]=Ae[0],xe[ve+1]=Ae[1]}break}xe[ve].children&&(xe[ve].children=_e(xe[ve].children,De,Ee))}return xe},z=function(){var _e=Object(I.a)(i.a.mark(function we(De,Ee){var xe;return i.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(!(Ee==="up")){X.next=6;break}return X.next=3,Object(p.I)({id:Math.abs(De)});case 3:X.t0=X.sent,X.next=9;break;case 6:return X.next=8,Object(p.H)({id:Math.abs(De)});case 8:X.t0=X.sent;case 9:xe=X.t0,xe.status===0&&N(function(Ae){return H(Ae,De,Ee)});case 11:case"end":return X.stop()}},we)}));return function(De,Ee){return _e.apply(this,arguments)}}(),J=function _e(we,De){return we.filter(function(Ee){return Ee.key===De?!1:(Ee.children&&(Ee.children=_e(Ee.children,De)),!0)})},Y=function(we){N(function(De){return J(De,we)}),h()},le=function _e(we,De,Ee){return we.map(function(xe){return xe.key===De?Object(ye.a)(Object(ye.a)({},xe),Ee):xe.children?Object(ye.a)(Object(ye.a)({},xe),{},{children:_e(xe.children,De,Ee)}):xe})},te=function(){var _e=Object(I.a)(i.a.mark(function we(De){var Ee,xe,ve,X,Ae;return i.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return Ee=De.key,ue.next=3,Object(p.B)({group_id:Math.abs(Ee)});case 3:xe=ue.sent,ve=xe||{},X=ve.item_banks_group,Ae=ve.item_banks_group_count,Ae>0?N(function(ee){return le(ee,Ee,{children:X.map(function(ae){return{title:w.a.createElement(T,{isProblemset:n,name:ae.name,id:ae.id,itemBanksCount:ae.item_banks_count,onMove:z,onOpen:t,onShare:b,onDeleteOk:Y}),key:ae.id,icon:w.a.createElement("img",{src:d.a,className:E.a.folderIcon}),isLeaf:!1}})})}):N(function(ee){return le(ee,Ee,{isLeaf:!0})});case 6:case"end":return ue.stop()}},we)}));return function(De){return _e.apply(this,arguments)}}(),Z=function(we,De){var Ee=De.node,xe=De.expanded;N(function(ve){return le(ve,Ee.key,{icon:xe?w.a.createElement("img",{src:s.a,className:E.a.folderIcon}):w.a.createElement("img",{src:d.a,className:E.a.folderIcon})})})};return(j==null?void 0:j.length)>0&&w.a.createElement(be.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:j,loadData:te,onExpand:Z,className:E.a.folderWrapper,selectable:!1})};ce.a=y},LuSS:function(We,ce,F){"use strict";F.d(ce,"a",function(){return ge});var me=F("FER5"),be={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ye=F("b3aT");function ge(u){var m={r:0,g:0,b:0},i=1,g=null,w=null,x=null,E=!1,o=!1;return typeof u=="string"&&(u=L(u)),typeof u=="object"&&(I(u.r)&&I(u.g)&&I(u.b)?(m=Object(me.g)(u.r,u.g,u.b),E=!0,o=String(u.r).substr(-1)==="%"?"prgb":"rgb"):I(u.h)&&I(u.s)&&I(u.v)?(g=Object(ye.c)(u.s),w=Object(ye.c)(u.v),m=Object(me.c)(u.h,g,w),E=!0,o="hsv"):I(u.h)&&I(u.s)&&I(u.l)&&(g=Object(ye.c)(u.s),x=Object(ye.c)(u.l),m=Object(me.b)(u.h,g,x),E=!0,o="hsl"),Object.prototype.hasOwnProperty.call(u,"a")&&(i=u.a)),i=Object(ye.b)(i),{ok:E,format:u.format||o,r:Math.min(255,Math.max(m.r,0)),g:Math.min(255,Math.max(m.g,0)),b:Math.min(255,Math.max(m.b,0)),a:i}}var ne="[-\\+]?\\d+%?",G="[-\\+]?\\d*\\.\\d+%?",O="(?:".concat(G,")|(?:").concat(ne,")"),W="[\\s|\\(]+(".concat(O,")[,|\\s]+(").concat(O,")[,|\\s]+(").concat(O,")\\s*\\)?"),e="[\\s|\\(]+(".concat(O,")[,|\\s]+(").concat(O,")[,|\\s]+(").concat(O,")[,|\\s]+(").concat(O,")\\s*\\)?"),k={CSS_UNIT:new RegExp(O),rgb:new RegExp("rgb"+W),rgba:new RegExp("rgba"+e),hsl:new RegExp("hsl"+W),hsla:new RegExp("hsla"+e),hsv:new RegExp("hsv"+W),hsva:new RegExp("hsva"+e),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 L(u){if(u=u.trim().toLowerCase(),u.length===0)return!1;var m=!1;if(be[u])u=be[u],m=!0;else if(u==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var i=k.rgb.exec(u);return i?{r:i[1],g:i[2],b:i[3]}:(i=k.rgba.exec(u),i?{r:i[1],g:i[2],b:i[3],a:i[4]}:(i=k.hsl.exec(u),i?{h:i[1],s:i[2],l:i[3]}:(i=k.hsla.exec(u),i?{h:i[1],s:i[2],l:i[3],a:i[4]}:(i=k.hsv.exec(u),i?{h:i[1],s:i[2],v:i[3]}:(i=k.hsva.exec(u),i?{h:i[1],s:i[2],v:i[3],a:i[4]}:(i=k.hex8.exec(u),i?{r:Object(me.d)(i[1]),g:Object(me.d)(i[2]),b:Object(me.d)(i[3]),a:Object(me.a)(i[4]),format:m?"name":"hex8"}:(i=k.hex6.exec(u),i?{r:Object(me.d)(i[1]),g:Object(me.d)(i[2]),b:Object(me.d)(i[3]),format:m?"name":"hex"}:(i=k.hex4.exec(u),i?{r:Object(me.d)(i[1]+i[1]),g:Object(me.d)(i[2]+i[2]),b:Object(me.d)(i[3]+i[3]),a:Object(me.a)(i[4]+i[4]),format:m?"name":"hex8"}:(i=k.hex3.exec(u),i?{r:Object(me.d)(i[1]+i[1]),g:Object(me.d)(i[2]+i[2]),b:Object(me.d)(i[3]+i[3]),format:m?"name":"hex"}:!1)))))))))}function I(u){return Boolean(k.CSS_UNIT.exec(String(u)))}},MI8n:function(We,ce,F){"use strict";F.d(ce,"c",function(){return ne}),F.d(ce,"b",function(){return e}),F.d(ce,"e",function(){return k}),F.d(ce,"a",function(){return L}),F.d(ce,"d",function(){return I}),F.d(ce,"f",function(){return u});var me=F("/cxE"),be=F("pmY6"),ye=F("24hK"),ge=F("5Y4S"),ne;(function(m){m.None=()=>be.a.None;function i(n){return(a,r=null,t)=>{let c=!1,b;return b=n(h=>c?void 0:(b?b.dispose():c=!0,a.call(r,h)),null,t),c&&b.dispose(),b}}m.once=i;function g(n,a){return d((r,t=null,c)=>n(b=>r.call(t,a(b)),null,c))}m.map=g;function w(n,a){return d((r,t=null,c)=>n(b=>{a(b),r.call(t,b)},null,c))}m.forEach=w;function x(n,a){return d((r,t=null,c)=>n(b=>a(b)&&r.call(t,b),null,c))}m.filter=x;function E(n){return n}m.signal=E;function o(...n){return(a,r=null,t)=>Object(be.e)(...n.map(c=>c(b=>a.call(r,b),null,t)))}m.any=o;function f(n,a,r){let t=r;return g(n,c=>(t=a(t,c),t))}m.reduce=f;function d(n){let a;const r=new e({onFirstListenerAdd(){a=n(r.fire,r)},onLastListenerRemove(){a.dispose()}});return r.event}function A(n,a,r=100,t=!1,c){let b,h,D,P=0;const j=new e({leakWarningThreshold:c,onFirstListenerAdd(){b=n(N=>{P++,h=a(h,N),t&&!D&&(j.fire(h),h=void 0),clearTimeout(D),D=setTimeout(()=>{const H=h;h=void 0,D=void 0,(!t||P>1)&&j.fire(H),P=0},r)})},onLastListenerRemove(){b.dispose()}});return j.event}m.debounce=A;function s(n,a=(r,t)=>r===t){let r=!0,t;return x(n,c=>{const b=r||!a(c,t);return r=!1,t=c,b})}m.latch=s;function p(n,a){return[m.filter(n,a),m.filter(n,r=>!a(r))]}m.split=p;function C(n,a=!1,r=[]){let t=r.slice(),c=n(D=>{t?t.push(D):h.fire(D)});const b=()=>{t&&t.forEach(D=>h.fire(D)),t=null},h=new e({onFirstListenerAdd(){c||(c=n(D=>h.fire(D)))},onFirstListenerDidAdd(){t&&(a?setTimeout(b):b())},onLastListenerRemove(){c&&c.dispose(),c=null}});return h.event}m.buffer=C;class l{constructor(n){this.event=n}map(n){return new l(g(this.event,n))}forEach(n){return new l(w(this.event,n))}filter(n){return new l(x(this.event,n))}reduce(n,a){return new l(f(this.event,n,a))}latch(){return new l(s(this.event))}debounce(n,a=100,r=!1,t){return new l(A(this.event,n,a,r,t))}on(n,a,r){return this.event(n,a,r)}once(n,a,r){return i(this.event)(n,a,r)}}function T(n){return new l(n)}m.chain=T;function y(n,a,r=t=>t){const t=(...D)=>h.fire(r(...D)),c=()=>n.on(a,t),b=()=>n.removeListener(a,t),h=new e({onFirstListenerAdd:c,onLastListenerRemove:b});return h.event}m.fromNodeEventEmitter=y;function _(n,a,r=t=>t){const t=(...D)=>h.fire(r(...D)),c=()=>n.addEventListener(a,t),b=()=>n.removeEventListener(a,t),h=new e({onFirstListenerAdd:c,onLastListenerRemove:b});return h.event}m.fromDOMEventEmitter=_;function v(n){return new Promise(a=>i(n)(a))}m.toPromise=v})(ne||(ne={}));class G{constructor(m){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${m}_${G._idPool++}`}start(m){this._stopWatch=new ge.a(!0),this._listenerCount=m}stop(){if(this._stopWatch){const m=this._stopWatch.elapsed();this._elapsedOverall+=m,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${m.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}G._idPool=0;let O=-1;class W{constructor(m,i=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=i,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let i=O;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||m<i)return;this._stacks||(this._stacks=new Map);const g=new Error().stack.split(`
`).slice(3).join(`
`),w=this._stacks.get(g)||0;if(this._stacks.set(g,w+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let x,E=0;for(const[o,f]of this._stacks)(!x||E<f)&&(x=o,E=f);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${E}):`),console.warn(x)}return()=>{const x=this._stacks.get(g)||0;this._stacks.set(g,x-1)}}}class e{constructor(m){var i;this._disposed=!1,this._options=m,this._leakageMon=O>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new G(this._options._profName):void 0}get event(){return this._event||(this._event=(m,i,g)=>{var w;this._listeners||(this._listeners=new ye.a);const x=this._listeners.isEmpty();x&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const E=this._listeners.push(i?[m,i]:m);x&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,i);const o=(w=this._leakageMon)===null||w===void 0?void 0:w.check(this._listeners.size),f=Object(be.i)(()=>{if(o&&o(),!this._disposed&&(E(),this._options&&this._options.onLastListenerRemove)){const d=this._listeners&&!this._listeners.isEmpty();d||this._options.onLastListenerRemove(this)}});return g instanceof be.b?g.add(f):Array.isArray(g)&&g.push(f),f}),this._event}fire(m){var i,g;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ye.a);for(let w of this._listeners)this._deliveryQueue.push([w,m]);for((i=this._perfMon)===null||i===void 0||i.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[w,x]=this._deliveryQueue.shift();try{typeof w=="function"?w.call(void 0,x):w[0].call(w[1],x)}catch(E){Object(me.f)(E)}}(g=this._perfMon)===null||g===void 0||g.stop()}}dispose(){var m,i,g,w,x;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(i=this._deliveryQueue)===null||i===void 0||i.clear(),(w=(g=this._options)===null||g===void 0?void 0:g.onLastListenerRemove)===null||w===void 0||w.call(g),(x=this._leakageMon)===null||x===void 0||x.dispose())}}class k extends e{constructor(m){super(m);this._isPaused=0,this._eventQueue=new ye.a,this._mergeFn=m==null?void 0:m.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const m=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):super.fire(m))}}class L extends k{constructor(m){var i;super(m);this._delay=(i=m.delay)!==null&&i!==void 0?i:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class I{constructor(){this.buffers=[]}wrapEvent(m){return(i,g,w)=>m(x=>{const E=this.buffers[this.buffers.length-1];E?E.push(()=>i.call(g,x)):i.call(g,x)},void 0,w)}bufferEvents(m){const i=[];this.buffers.push(i);const g=m();return this.buffers.pop(),i.forEach(w=>w()),g}}class u{constructor(){this.listening=!1,this.inputEvent=ne.None,this.inputEventListener=be.a.None,this.emitter=new e({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(We,ce,F){"use strict";(function(me,be){F.d(ce,"b",function(){return g}),F.d(ce,"i",function(){return o}),F.d(ce,"f",function(){return f}),F.d(ce,"d",function(){return d}),F.d(ce,"g",function(){return A}),F.d(ce,"h",function(){return s}),F.d(ce,"c",function(){return p}),F.d(ce,"k",function(){return C}),F.d(ce,"j",function(){return l}),F.d(ce,"a",function(){return T}),F.d(ce,"e",function(){return v});var ye;const ge="en";let ne=!1,G=!1,O=!1,W=!1,e=!1,k=!1,L=!1,I,u=ge,m,i;const g=typeof self=="object"?self:typeof me=="object"?me:{};let w;typeof g.vscode!="undefined"&&typeof g.vscode.process!="undefined"?w=g.vscode.process:typeof be!="undefined"&&(w=be);const x=typeof((ye=w==null?void 0:w.versions)===null||ye===void 0?void 0:ye.electron)=="string"&&w.type==="renderer";if(typeof navigator=="object"&&!x)i=navigator.userAgent,ne=i.indexOf("Windows")>=0,G=i.indexOf("Macintosh")>=0,L=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,O=i.indexOf("Linux")>=0,k=!0,I=navigator.language,u=I;else if(typeof w=="object"){ne=w.platform==="win32",G=w.platform==="darwin",O=w.platform==="linux",W=O&&!!w.env.SNAP&&!!w.env.SNAP_REVISION,I=ge,u=ge;const n=w.env.VSCODE_NLS_CONFIG;if(n)try{const a=JSON.parse(n),r=a.availableLanguages["*"];I=a.locale,u=r||ge,m=a._translationsConfigFile}catch(a){}e=!0}else console.error("Unable to resolve platform.");let E=0;G?E=1:ne?E=3:O&&(E=2);const o=ne,f=G,d=O,A=e,s=k,p=L,C=i,l=function(){if(g.setImmediate)return g.setImmediate.bind(g);if(typeof g.postMessage=="function"&&!g.importScripts){let r=[];g.addEventListener("message",c=>{if(c.data&&c.data.vscodeSetImmediateId)for(let b=0,h=r.length;b<h;b++){const D=r[b];if(D.id===c.data.vscodeSetImmediateId){r.splice(b,1),D.callback();return}}});let t=0;return c=>{const b=++t;r.push({id:b,callback:c}),g.postMessage({vscodeSetImmediateId:b},"*")}}if(typeof(w==null?void 0:w.nextTick)=="function")return w.nextTick.bind(w);const a=Promise.resolve();return r=>a.then(r)}(),T=G||L?2:ne?1:3;let y=!0,_=!1;function v(){if(!_){_=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2;const a=new Uint16Array(n.buffer);y=a[0]===(2<<8)+1}return y}}).call(this,F("IGO8"),F("B0ME"))},N0LK:function(We,ce,F){"use strict";F.d(ce,"C",function(){return me}),F.d(ce,"v",function(){return ye}),F.d(ce,"s",function(){return ge}),F.d(ce,"t",function(){return ne}),F.d(ce,"U",function(){return G}),F.d(ce,"J",function(){return O}),F.d(ce,"O",function(){return W}),F.d(ce,"p",function(){return e}),F.d(ce,"T",function(){return k}),F.d(ce,"q",function(){return L}),F.d(ce,"N",function(){return I}),F.d(ce,"M",function(){return u}),F.d(ce,"Q",function(){return m}),F.d(ce,"u",function(){return i}),F.d(ce,"x",function(){return g}),F.d(ce,"I",function(){return w}),F.d(ce,"f",function(){return x}),F.d(ce,"h",function(){return E}),F.d(ce,"g",function(){return o}),F.d(ce,"i",function(){return f}),F.d(ce,"G",function(){return d}),F.d(ce,"H",function(){return A}),F.d(ce,"r",function(){return s}),F.d(ce,"R",function(){return p}),F.d(ce,"d",function(){return C}),F.d(ce,"e",function(){return l}),F.d(ce,"E",function(){return T}),F.d(ce,"F",function(){return y}),F.d(ce,"j",function(){return _}),F.d(ce,"z",function(){return v}),F.d(ce,"K",function(){return a}),F.d(ce,"L",function(){return r}),F.d(ce,"m",function(){return c}),F.d(ce,"k",function(){return h}),F.d(ce,"A",function(){return P}),F.d(ce,"a",function(){return j}),F.d(ce,"n",function(){return N}),F.d(ce,"l",function(){return H}),F.d(ce,"D",function(){return z}),F.d(ce,"B",function(){return J}),F.d(ce,"b",function(){return Y}),F.d(ce,"S",function(){return le}),F.d(ce,"o",function(){return te}),F.d(ce,"P",function(){return Z}),F.d(ce,"w",function(){return _e}),F.d(ce,"c",function(){return we}),F.d(ce,"y",function(){return xe});function me(Q){return!Q||typeof Q!="string"?!0:Q.trim().length===0}const be=/{(\d+)}/g;function ye(Q,...ue){return ue.length===0?Q:Q.replace(be,function(ee,ae){const fe=parseInt(ae,10);return isNaN(fe)||fe<0||fe>=ue.length?ee:ue[fe]})}function ge(Q){return Q.replace(/[<>&]/g,function(ue){switch(ue){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ue}})}function ne(Q){return Q.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function G(Q,ue=" "){const ee=O(Q,ue);return W(ee,ue)}function O(Q,ue){if(!Q||!ue)return Q;const ee=ue.length;if(ee===0||Q.length===0)return Q;let ae=0;for(;Q.indexOf(ue,ae)===ae;)ae=ae+ee;return Q.substring(ae)}function W(Q,ue){if(!Q||!ue)return Q;const ee=ue.length,ae=Q.length;if(ee===0||ae===0)return Q;let fe=ae,Re=-1;for(;!(Re=Q.lastIndexOf(ue,fe-1),Re===-1||Re+ee!==fe);){if(Re===0)return"";fe=Re}return Q.substring(0,fe)}function e(Q){return Q.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function k(Q){return Q.replace(/\*/g,"")}function L(Q,ue,ee={}){if(!Q)throw new Error("Cannot create regex from empty string");ue||(Q=ne(Q)),ee.wholeWord&&(/\B/.test(Q.charAt(0))||(Q="\\b"+Q),/\B/.test(Q.charAt(Q.length-1))||(Q=Q+"\\b"));let ae="";return ee.global&&(ae+="g"),ee.matchCase||(ae+="i"),ee.multiline&&(ae+="m"),ee.unicode&&(ae+="u"),new RegExp(Q,ae)}function I(Q){if(Q.source==="^"||Q.source==="^$"||Q.source==="$"||Q.source==="^\\s*$")return!1;const ue=Q.exec("");return!!(ue&&Q.lastIndex===0)}function u(Q){return(Q.global?"g":"")+(Q.ignoreCase?"i":"")+(Q.multiline?"m":"")+(Q.unicode?"u":"")}function m(Q){return Q.split(/\r\n|\r|\n/)}function i(Q){for(let ue=0,ee=Q.length;ue<ee;ue++){const ae=Q.charCodeAt(ue);if(ae!==32&&ae!==9)return ue}return-1}function g(Q,ue=0,ee=Q.length){for(let ae=ue;ae<ee;ae++){const fe=Q.charCodeAt(ae);if(fe!==32&&fe!==9)return Q.substring(ue,ae)}return Q.substring(ue,ee)}function w(Q,ue=Q.length-1){for(let ee=ue;ee>=0;ee--){const ae=Q.charCodeAt(ee);if(ae!==32&&ae!==9)return ee}return-1}function x(Q,ue){return Q<ue?-1:Q>ue?1:0}function E(Q,ue,ee=0,ae=Q.length,fe=0,Re=ue.length){for(;ee<ae&&fe<Re;ee++,fe++){let Ie=Q.charCodeAt(ee),Oe=ue.charCodeAt(fe);if(Ie<Oe)return-1;if(Ie>Oe)return 1}const pe=ae-ee,ie=Re-fe;return pe<ie?-1:pe>ie?1:0}function o(Q,ue){return f(Q,ue,0,Q.length,0,ue.length)}function f(Q,ue,ee=0,ae=Q.length,fe=0,Re=ue.length){for(;ee<ae&&fe<Re;ee++,fe++){let Ie=Q.charCodeAt(ee),Oe=ue.charCodeAt(fe);if(Ie===Oe)continue;if(Ie>=128||Oe>=128)return E(Q.toLowerCase(),ue.toLowerCase(),ee,ae,fe,Re);d(Ie)&&(Ie-=32),d(Oe)&&(Oe-=32);const Ne=Ie-Oe;if(Ne===0)continue;return Ne}const pe=ae-ee,ie=Re-fe;return pe<ie?-1:pe>ie?1:0}function d(Q){return Q>=97&&Q<=122}function A(Q){return Q>=65&&Q<=90}function s(Q,ue){return Q.length===ue.length&&f(Q,ue)===0}function p(Q,ue){const ee=ue.length;return ue.length>Q.length?!1:f(Q,ue,0,ee)===0}function C(Q,ue){let ee,ae=Math.min(Q.length,ue.length);for(ee=0;ee<ae;ee++)if(Q.charCodeAt(ee)!==ue.charCodeAt(ee))return ee;return ae}function l(Q,ue){let ee,ae=Math.min(Q.length,ue.length);const fe=Q.length-1,Re=ue.length-1;for(ee=0;ee<ae;ee++)if(Q.charCodeAt(fe-ee)!==ue.charCodeAt(Re-ee))return ee;return ae}function T(Q){return 55296<=Q&&Q<=56319}function y(Q){return 56320<=Q&&Q<=57343}function _(Q,ue){return(Q-55296<<10)+(ue-56320)+65536}function v(Q,ue,ee){const ae=Q.charCodeAt(ee);if(T(ae)&&ee+1<ue){const fe=Q.charCodeAt(ee+1);if(y(fe))return _(ae,fe)}return ae}function n(Q,ue){const ee=Q.charCodeAt(ue-1);if(y(ee)&&ue>1){const ae=Q.charCodeAt(ue-2);if(T(ae))return _(ae,ee)}return ee}function a(Q,ue){const ee=De.getInstance(),ae=ue,fe=Q.length,Re=v(Q,fe,ue);ue+=Re>=65536?2:1;let pe=ee.getGraphemeBreakType(Re);for(;ue<fe;){const ie=v(Q,fe,ue),Ie=ee.getGraphemeBreakType(ie);if(we(pe,Ie))break;ue+=ie>=65536?2:1,pe=Ie}return ue-ae}function r(Q,ue){const ee=De.getInstance(),ae=ue,fe=n(Q,ue);ue-=fe>=65536?2:1;let Re=ee.getGraphemeBreakType(fe);for(;ue>0;){const pe=n(Q,ue),ie=ee.getGraphemeBreakType(pe);if(we(ie,Re))break;ue-=pe>=65536?2:1,Re=ie}return ae-ue}const t=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function c(Q){return t.test(Q)}const b=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function h(Q){return b.test(Q)}const D=/^[\t\n\r\x20-\x7E]*$/;function P(Q){return D.test(Q)}const j=/[\u2028\u2029]/;function N(Q){return j.test(Q)}function H(Q){for(let ue=0,ee=Q.length;ue<ee;ue++)if(z(Q.charCodeAt(ue)))return!0;return!1}function z(Q){return Q=+Q,Q>=11904&&Q<=55215||Q>=63744&&Q<=64255||Q>=65281&&Q<=65374}function J(Q){return Q>=127462&&Q<=127487||Q===8986||Q===8987||Q===9200||Q===9203||Q>=9728&&Q<=10175||Q===11088||Q===11093||Q>=127744&&Q<=128591||Q>=128640&&Q<=128764||Q>=128992&&Q<=129003||Q>=129280&&Q<=129535||Q>=129648&&Q<=129750}const Y=String.fromCharCode(65279);function le(Q){return!!(Q&&Q.length>0&&Q.charCodeAt(0)===65279)}function te(Q,ue=!1){return Q?(ue&&(Q=Q.replace(/\\./g,"")),Q.toLowerCase()!==Q):!1}function Z(Q){const ue=90-65+1;return Q=Q%(2*ue),Q<ue?String.fromCharCode(97+Q):String.fromCharCode(65+Q-ue)}function _e(Q){const ue=De.getInstance();return ue.getGraphemeBreakType(Q)}function we(Q,ue){return Q===0?ue!==5&&ue!==7:Q===2&&ue===3?!1:Q===4||Q===2||Q===3||(ue===4||ue===2||ue===3)?!0:Q===8&&(ue===8||ue===9||ue===11||ue===12)||((Q===11||Q===9)&&(ue===9||ue===10)||((Q===12||Q===10)&&ue===10||(ue===5||ue===13||(ue===7||(Q===1||Q===13&&ue===14)))))?!1:!(Q===6&&ue===6)}class De{constructor(){this._data=Ee()}static getInstance(){return De._INSTANCE||(De._INSTANCE=new De),De._INSTANCE}getGraphemeBreakType(Q){if(Q<32)return Q===10?3:Q===13?2:4;if(Q<127)return 0;const ue=this._data,ee=ue.length/3;let ae=1;for(;ae<=ee;)if(Q<ue[3*ae])ae=2*ae;else if(Q>ue[3*ae+1])ae=2*ae+1;else return ue[3*ae+2];return 0}}De._INSTANCE=null;function Ee(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function xe(Q,ue){if(Q===0)return 0;const ee=ve(Q,ue);if(ee!==void 0)return ee;const ae=n(ue,Q);return Q-=X(ae),Q}function ve(Q,ue){let ee=n(ue,Q);for(Q-=X(ee);Ae(ee)||ee===65039||ee===8419;){if(Q===0)return;ee=n(ue,Q),Q-=X(ee)}if(!J(ee))return;if(Q>=0){const ae=n(ue,Q);ae===8205&&(Q-=X(ae))}return Q}function X(Q){return Q>=65536?2:1}function Ae(Q){return 127995<=Q&&Q<=127999}},ODXe:function(We,ce,F){"use strict";F.d(ce,"a",function(){return ne});function me(G){if(Array.isArray(G))return G}function be(G,O){var W=G==null?null:typeof Symbol!="undefined"&&G[Symbol.iterator]||G["@@iterator"];if(W!=null){var e,k,L,I,u=[],m=!0,i=!1;try{if(L=(W=W.call(G)).next,O===0){if(Object(W)!==W)return;m=!1}else for(;!(m=(e=L.call(W)).done)&&(u.push(e.value),u.length!==O);m=!0);}catch(g){i=!0,k=g}finally{try{if(!m&&W.return!=null&&(I=W.return(),Object(I)!==I))return}finally{if(i)throw k}}return u}}var ye=F("BsWD");function ge(){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 ne(G,O){return me(G)||be(G,O)||Object(ye.a)(G,O)||ge()}},"P/tu":function(We,ce,F){"use strict";var me=F("+kGG"),be=F("8JJ2"),ye=F("HPgX"),ge=F("IYef"),ne=F("Hqw+"),G=F("ftSv"),O=F("XXmO"),W=F.n(O),e=F("T/Jt"),k=F.n(e),L=F("WCUW"),I=F("spXi"),u=F.n(I),m=function(g){var w=g.value,x=g.onChange,E=g.defaultValue,o=g.disabled,f=Object(G.a)(g,["value","onChange","defaultValue","disabled"]),d=Object(e.useState)([]),A=Object(ne.a)(d,2),s=A[0],p=A[1],C=Object(e.useState)("1"),l=Object(ne.a)(C,2),T=l[0],y=l[1];Object(e.useEffect)(function(){_()},[]);var _=function(){var a=Object(ge.a)(W.a.mark(function r(){var t,c;return W.a.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Object(L.A)({});case 2:t=h.sent,t!=null&&t.data&&(c=[{title:k.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:u.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:k.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:v(t.data||[])}],p(c),y("2"));case 4:case"end":return h.stop()}},r)}));return function(){return a.apply(this,arguments)}}(),v=function(r){function t(c){var b=c.children,h=Array.isArray(b)&&b.length>0,D=c==null?void 0:c.group_id;return{title:k.a.createElement("div",{title:c==null?void 0:c.name,className:u.a.name},c==null?void 0:c.name),value:D,key:D,icon:k.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:h?b==null?void 0:b.map(function(P){return t(P)}):[]}}return r==null?void 0:r.map(function(c){return t(c)})},n=E?{defaultExpandedKeys:[0]}:{selectedKeys:w,defaultExpandedKeys:w};return k.a.createElement("div",{className:u.a.customTree},k.a.createElement(be.a,Object(ye.a)({key:T},n,{showIcon:!0,treeData:s,onSelect:x,disabled:o},f)))};ce.a=m},Q0Vu:function(We,ce,F){We.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(We,ce,F){"use strict";var me=F("Egpp"),be=F("UdgO"),ye=F("T/Jt"),ge=F.n(ye),ne=F("+z73"),G=F.n(ne),O=function(e){var k=e.data,L=k===void 0?[]:k,I=e.onClick,u=function(){return L.map(function(g,w){return ge.a.createElement("div",{key:w,className:G.a.few},ge.a.createElement("b",{title:g.name,style:{color:w===0?"#333333":"#999999"},onClick:function(){return I(g.id)}},g.name),w<L.length-1&&ge.a.createElement("span",null,"/"))})},m=function(){var g=!0,w=L.slice(2,-2),x=ge.a.createElement("div",{className:G.a.pWrap},w.map(function(E){return ge.a.createElement("span",{title:E.name,onClick:function(){return I(E.id)},key:E.id},E.name)}));return L.map(function(E,o){var f=null;return o>1&&o<L.length-2?g&&(f=ge.a.createElement(be.a,{key:o,placement:"bottom",content:x},ge.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),g=!1):f=ge.a.createElement("div",{key:o,className:G.a.few},ge.a.createElement("b",{title:E.name,style:{color:o===0?"#333333":"#999999"},onClick:function(){return I(E.id)}},E.name),o<L.length-1&&ge.a.createElement("span",null,"/")),f})};return ge.a.createElement("aside",{style:{overflowX:"auto"}},(L==null?void 0:L.length)>5?m():u())};ce.a=O},SJMd:function(We,ce){/**
* @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 F,me,be,ye=!1,ge,ne;window.PR_SHOULD_USE_CONTINUATION=!0;var G,O;(function(){var W=window,e=["break,continue,do,else,for,if,return,while"],k=[e,"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"],L=[k,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],I=[L,"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=[L,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[L,"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"],i="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",g=[L,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],w="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",x=[e,"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"],E=[e,"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=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],f=[I,m,u,g,w,x,E,o],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,A="str",s="kwd",p="com",C="typ",l="lit",T="pun",y="pln",_="tag",v="dec",n="src",a="atn",r="atv",t="nocode",c="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function b(ve){for(var X=0,Ae=!1,Q=!1,ue=0,ee=ve.length;ue<ee;++ue){var ae=ve[ue];if(ae.ignoreCase)Q=!0;else if(/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,Q=!1;break}}var fe={b:8,t:9,n:10,v:11,f:12,r:13};function Re(Ne){var Le=Ne.charCodeAt(0);if(Le!==92)return Le;var Ce=Ne.charAt(1);return Le=fe[Ce],Le||("0"<=Ce&&Ce<="7"?parseInt(Ne.substring(1),8):Ce==="u"||Ce==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function pe(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var Le=String.fromCharCode(Ne);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function ie(Ne){var Le=Ne.substring(1,Ne.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")),Ce=[],Ue=Le[0]==="^",Te=["["];Ue&&Te.push("^");for(var Pe=Ue?1:0,q=Le.length;Pe<q;++Pe){var se=Le[Pe];if(/\\[bdsw]/i.test(se))Te.push(se);else{var he=Re(se),V;Pe+2<q&&Le[Pe+1]==="-"?(V=Re(Le[Pe+2]),Pe+=2):V=he,Ce.push([he,V]),V<65||he>122||(V<65||he>90||Ce.push([Math.max(65,he)|32,Math.min(V,90)|32]),V<97||he>122||Ce.push([Math.max(97,he)&~32,Math.min(V,122)&~32]))}}Ce.sort(function(Se,Me){return Se[0]-Me[0]||Me[1]-Se[1]});for(var $=[],re=[],Pe=0;Pe<Ce.length;++Pe){var oe=Ce[Pe];oe[0]<=re[1]+1?re[1]=Math.max(re[1],oe[1]):$.push(re=oe)}for(var Pe=0;Pe<$.length;++Pe){var oe=$[Pe];Te.push(pe(oe[0])),oe[1]>oe[0]&&(oe[1]+1>oe[0]&&Te.push("-"),Te.push(pe(oe[1])))}return Te.push("]"),Te.join("")}function Ie(Ne){for(var Le=Ne.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")),Ce=Le.length,Ue=[],Te=0,Pe=0;Te<Ce;++Te){var q=Le[Te];if(q==="(")++Pe;else if(q.charAt(0)==="\\"){var se=+q.substring(1);se&&(se<=Pe?Ue[se]=-1:Le[Te]=pe(se))}}for(var Te=1;Te<Ue.length;++Te)Ue[Te]===-1&&(Ue[Te]=++X);for(var Te=0,Pe=0;Te<Ce;++Te){var q=Le[Te];if(q==="(")++Pe,Ue[Pe]||(Le[Te]="(?:");else if(q.charAt(0)==="\\"){var se=+q.substring(1);se&&se<=Pe&&(Le[Te]="\\"+Ue[se])}}for(var Te=0;Te<Ce;++Te)Le[Te]==="^"&&Le[Te+1]!=="^"&&(Le[Te]="");if(Ne.ignoreCase&&Ae)for(var Te=0;Te<Ce;++Te){var q=Le[Te],he=q.charAt(0);q.length>=2&&he==="["?Le[Te]=ie(q):he!=="\\"&&(Le[Te]=q.replace(/[a-zA-Z]/g,function(re){var oe=re.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return Le.join("")}for(var Oe=[],ue=0,ee=ve.length;ue<ee;++ue){var ae=ve[ue];if(ae.global||ae.multiline)throw new Error(""+ae);Oe.push("(?:"+Ie(ae)+")")}return new RegExp(Oe.join("|"),Q?"gi":"g")}function h(ve,X){var Ae=/(?:^|\s)nocode(?:\s|$)/,Q=[],ue=0,ee=[],ae=0;function fe(Re){var pe=Re.nodeType;if(pe==1){if(Ae.test(Re.className))return;for(var ie=Re.firstChild;ie;ie=ie.nextSibling)fe(ie);var Ie=Re.nodeName.toLowerCase();(Ie==="br"||Ie==="li")&&(Q[ae]=`
`,ee[ae<<1]=ue++,ee[ae++<<1|1]=Re)}else if(pe==3||pe==4){var Oe=Re.nodeValue;Oe.length&&(X?Oe=Oe.replace(/\r\n?/g,`
`):Oe=Oe.replace(/[ \t\r\n]+/g," "),Q[ae]=Oe,ee[ae<<1]=ue,ue+=Oe.length,ee[ae++<<1|1]=Re)}}return fe(ve),{sourceCode:Q.join("").replace(/\n$/,""),spans:ee}}function D(ve,X,Ae,Q,ue){if(!Ae)return;var ee={sourceNode:ve,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:X,decorations:null};Q(ee),ue.push.apply(ue,ee.decorations)}var P=/\S/;function j(ve){for(var X=void 0,Ae=ve.firstChild;Ae;Ae=Ae.nextSibling){var Q=Ae.nodeType;X=Q===1?X?ve:Ae:Q===3&&P.test(Ae.nodeValue)?ve:X}return X===ve?void 0:X}function N(ve,X){var Ae={},Q;(function(){for(var ae=ve.concat(X),fe=[],Re={},pe=0,ie=ae.length;pe<ie;++pe){var Ie=ae[pe],Oe=Ie[3];if(Oe)for(var Ne=Oe.length;--Ne>=0;)Ae[Oe.charAt(Ne)]=Ie;var Le=Ie[1],Ce=""+Le;Re.hasOwnProperty(Ce)||(fe.push(Le),Re[Ce]=null)}fe.push(/[\0-\uffff]/),Q=b(fe)})();var ue=X.length,ee=function(ae){for(var fe=ae.sourceCode,Re=ae.basePos,pe=ae.sourceNode,ie=[Re,y],Ie=0,Oe=fe.match(Q)||[],Ne={},Le=0,Ce=Oe.length;Le<Ce;++Le){var Ue=Oe[Le],Te=Ne[Ue],Pe=void 0,q;if(typeof Te=="string")q=!1;else{var se=Ae[Ue.charAt(0)];if(se)Pe=Ue.match(se[1]),Te=se[0];else{for(var he=0;he<ue;++he)if(se=X[he],Pe=Ue.match(se[1]),Pe){Te=se[0];break}Pe||(Te=y)}q=Te.length>=5&&Te.substring(0,5)==="lang-",q&&!(Pe&&typeof Pe[1]=="string")&&(q=!1,Te=n),q||(Ne[Ue]=Te)}var V=Ie;if(Ie+=Ue.length,!q)ie.push(Re+V,Te);else{var $=Pe[1],re=Ue.indexOf($),oe=re+$.length;Pe[2]&&(oe=Ue.length-Pe[2].length,re=oe-$.length);var Se=Te.substring(5);D(pe,Re+V,Ue.substring(0,re),ee,ie),D(pe,Re+V+re,$,Z(Se,$),ie),D(pe,Re+V+oe,Ue.substring(oe),ee,ie)}}ae.decorations=ie};return ee}function H(ve){var X=[],Ae=[];ve.tripleQuotedStrings?X.push([A,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ve.multiLineStrings?X.push([A,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):X.push([A,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ve.verbatimStrings&&Ae.push([A,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Q=ve.hashComments;Q&&(ve.cStyleComments?(Q>1?X.push([p,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):X.push([p,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([A,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):X.push([p,/^#[^\r\n]*/,null,"#"])),ve.cStyleComments&&(Ae.push([p,/^\/\/[^\r\n]*/,null]),Ae.push([p,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ue=ve.regexLiterals;if(ue){var ee=ue>1?"":`
\r`,ae=ee?".":"[\\S\\s]",fe="/(?=[^/*"+ee+"])(?:[^/\\x5B\\x5C"+ee+"]|\\x5C"+ae+"|\\x5B(?:[^\\x5C\\x5D"+ee+"]|\\x5C"+ae+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+c+"("+fe+")")])}var Re=ve.types;Re&&Ae.push([C,Re]);var pe=(""+ve.keywords).replace(/^ | $/g,"");pe.length&&Ae.push([s,new RegExp("^(?:"+pe.replace(/[\s,]+/g,"|")+")\\b"),null]),X.push([y,/^\s+/,null,` \r
\xA0`]);var ie="^.[^\\s\\w.$@'\"`/\\\\]*";return ve.regexLiterals&&(ie+="(?!s*/)"),Ae.push([l,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[y,/^[a-z_$][a-z_$@0-9]*/i,null],[l,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[y,/^\\[\s\S]?/,null],[T,new RegExp(ie),null]),N(X,Ae)}var z=H({keywords:f,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function J(ve,X,Ae){for(var Q=/(?:^|\s)nocode(?:\s|$)/,ue=/\r\n?|\n/,ee=ve.ownerDocument,ae=ee.createElement("li");ve.firstChild;)ae.appendChild(ve.firstChild);var fe=[ae];function Re(Le){var Ce=Le.nodeType;if(Ce==1&&!Q.test(Le.className))if(Le.nodeName==="br")pe(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var Ue=Le.firstChild;Ue;Ue=Ue.nextSibling)Re(Ue);else if((Ce==3||Ce==4)&&Ae){var Te=Le.nodeValue,Pe=Te.match(ue);if(Pe){var q=Te.substring(0,Pe.index);Le.nodeValue=q;var se=Te.substring(Pe.index+Pe[0].length);if(se){var he=Le.parentNode;he.insertBefore(ee.createTextNode(se),Le.nextSibling)}pe(Le),q||Le.parentNode.removeChild(Le)}}}function pe(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function Ce(Pe,q){var se=q?Pe.cloneNode(!1):Pe,he=Pe.parentNode;if(he){var V=Ce(he,1),$=Pe.nextSibling;V.appendChild(se);for(var re=$;re;re=$)$=re.nextSibling,V.appendChild(re)}return se}for(var Ue=Ce(Le.nextSibling,0),Te;(Te=Ue.parentNode)&&Te.nodeType===1;)Ue=Te;fe.push(Ue)}for(var ie=0;ie<fe.length;++ie)Re(fe[ie]);X===(X|0)&&fe[0].setAttribute("value",X);var Ie=ee.createElement("ol");Ie.className="linenums";for(var Oe=Math.max(0,X-1|0)||0,ie=0,Ne=fe.length;ie<Ne;++ie)ae=fe[ie],ae.className="L"+(ie+Oe)%10,ae.firstChild||ae.appendChild(ee.createTextNode("\xA0")),Ie.appendChild(ae);ve.appendChild(Ie)}function Y(ve){var X=/\bMSIE\s(\d+)/.exec(navigator.userAgent);X=X&&+X[1]<=8;var Ae=/\n/g,Q=ve.sourceCode,ue=Q.length,ee=0,ae=ve.spans,fe=ae.length,Re=0,pe=ve.decorations,ie=pe.length,Ie=0;pe[ie]=ue;var Oe,Ne;for(Ne=Oe=0;Ne<ie;)pe[Ne]!==pe[Ne+2]?(pe[Oe++]=pe[Ne++],pe[Oe++]=pe[Ne++]):Ne+=2;for(ie=Oe,Ne=Oe=0;Ne<ie;){for(var Le=pe[Ne],Ce=pe[Ne+1],Ue=Ne+2;Ue+2<=ie&&pe[Ue+1]===Ce;)Ue+=2;pe[Oe++]=Le,pe[Oe++]=Ce,Ne=Ue}ie=pe.length=Oe;var Te=ve.sourceNode,Pe="";Te&&(Pe=Te.style.display,Te.style.display="none");try{for(var q=null;Re<fe;){var se=ae[Re],he=ae[Re+2]||ue,V=pe[Ie+2]||ue,Ue=Math.min(he,V),$=ae[Re+1],re;if($.nodeType!==1&&(re=Q.substring(ee,Ue))){X&&(re=re.replace(Ae,"\r")),$.nodeValue=re;var oe=$.ownerDocument,Se=oe.createElement("span");Se.className=pe[Ie+1];var Me=$.parentNode;Me.replaceChild(Se,$),Se.appendChild($),ee<he&&(ae[Re+1]=$=oe.createTextNode(Q.substring(Ue,he)),Me.insertBefore($,Se.nextSibling))}ee=Ue,ee>=he&&(Re+=2),ee>=V&&(Ie+=2)}}finally{Te&&(Te.style.display=Pe)}}var le={};function te(ve,X){for(var Ae=X.length;--Ae>=0;){var Q=X[Ae];le.hasOwnProperty(Q)?W.console&&console.warn("cannot override language handler %s",Q):le[Q]=ve}}function Z(ve,X){return ve&&le.hasOwnProperty(ve)||(ve=/^\s*</.test(X)?"default-markup":"default-code"),le[ve]}te(z,["default-code"]),te(N([],[[y,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[p,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[T,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),te(N([[y,/^[\s]+/,null,` \r
`],[r,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[a,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[T,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),te(N([],[[r,/^[\s\S]+/]]),["uq.val"]),te(H({keywords:I,hashComments:!0,cStyleComments:!0,types:d}),["c","cc","cpp","cxx","cyc","m"]),te(H({keywords:"null,true,false"}),["json"]),te(H({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:d}),["cs"]),te(H({keywords:u,cStyleComments:!0}),["java"]),te(H({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),te(H({keywords:x,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),te(H({keywords:w,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),te(H({keywords:E,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),te(H({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),te(H({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),te(N([],[[A,/^[\s\S]+/]]),["regex"]);function _e(ve){var X=ve.langExtension;try{var Ae=h(ve.sourceNode,ve.pre),Q=Ae.sourceCode;ve.sourceCode=Q,ve.spans=Ae.spans,ve.basePos=0,Z(X,Q)(ve),Y(ve)}catch(ue){W.console&&console.log(ue&&ue.stack||ue)}}function we(ve,X,Ae){var Q=Ae||!1,ue=X||null,ee=document.createElement("div");ee.innerHTML="<pre>"+ve+"</pre>",ee=ee.firstChild,Q&&J(ee,Q,!0);var ae={langExtension:ue,numberLines:Q,sourceNode:ee,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return _e(ae),ee.innerHTML}function De(ve,X){var Ae=X||document.body,Q=Ae.ownerDocument||document;function ue(se){return Ae.getElementsByTagName(se)}for(var ee=[ue("pre"),ue("code"),ue("xmp")],ae=[],fe=0;fe<ee.length;++fe)for(var Re=0,pe=ee[fe].length;Re<pe;++Re)ae.push(ee[fe][Re]);ee=null;var ie=Date;ie.now||(ie={now:function(){return+new Date}});var Ie=0,Oe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,Le=/\bprettyprinted\b/,Ce=/pre|xmp/i,Ue=/^code$/i,Te=/^(?:pre|code|xmp)$/i,Pe={};function q(){for(var se=W.PR_SHOULD_USE_CONTINUATION?ie.now()+250:Infinity;Ie<ae.length&&ie.now()<se;Ie++){for(var he=ae[Ie],V=Pe,$=he;$=$.previousSibling;){var re=$.nodeType,oe=(re===7||re===8)&&$.nodeValue;if(oe?!/^\??prettify\b/.test(oe):re!==3||/\S/.test($.nodeValue))break;if(oe){V={},oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(nt,Ye,st){V[Ye]=st});break}}var Se=he.className;if((V!==Pe||Ne.test(Se))&&!Le.test(Se)){for(var Me=!1,Be=he.parentNode;Be;Be=Be.parentNode){var Ke=Be.tagName;if(Te.test(Ke)&&Be.className&&Ne.test(Be.className)){Me=!0;break}}if(!Me){he.className+=" prettyprinted";var Xe=V.lang;if(!Xe){Xe=Se.match(Oe);var Ge;!Xe&&(Ge=j(he))&&Ue.test(Ge.tagName)&&(Xe=Ge.className.match(Oe)),Xe&&(Xe=Xe[1])}var rt;if(Ce.test(he.tagName))rt=1;else{var qe=he.currentStyle,Ve=Q.defaultView,at=qe?qe.whiteSpace:Ve&&Ve.getComputedStyle?Ve.getComputedStyle(he,null).getPropertyValue("white-space"):0;rt=at&&at.substring(0,3)==="pre"}var Qe=V.linenums;(Qe=Qe==="true"||+Qe)||(Qe=Se.match(/\blinenums\b(?::(\d+))?/),Qe=Qe?Qe[1]&&Qe[1].length?+Qe[1]:!0:!1),Qe&&J(he,Qe,rt);var $e={langExtension:Xe,sourceNode:he,numberLines:Qe,pre:rt,sourceCode:null,basePos:null,spans:null,decorations:null};_e($e)}}}Ie<ae.length?W.setTimeout(q,250):typeof ve=="function"&&ve()}q()}var Ee=W.PR={createSimpleLexer:N,registerLangHandler:te,sourceDecorator:H,PR_ATTRIB_NAME:a,PR_ATTRIB_VALUE:r,PR_COMMENT:p,PR_DECLARATION:v,PR_KEYWORD:s,PR_LITERAL:l,PR_NOCODE:t,PR_PLAIN:y,PR_PUNCTUATION:T,PR_SOURCE:n,PR_STRING:A,PR_TAG:_,PR_TYPE:C,prettyPrintOne:ye?W.prettyPrintOne=we:G=we,prettyPrint:O=ye?W.prettyPrint=De:O=De},xe=W.define;typeof xe=="function"&&xe.amd&&xe("google-code-prettify",[],function(){return Ee})})()},T8No:function(We,ce,F){"use strict";F.d(ce,"a",function(){return O}),F.d(ce,"e",function(){return W}),F.d(ce,"c",function(){return T}),F.d(ce,"b",function(){return y}),F.d(ce,"d",function(){return _}),F.d(ce,"f",function(){return a});var me=F("MNsG"),be=F("N0LK"),ye=F("Cg/j");let ge=me.k||"";const ne=new Map;ne.set("false",!1),ne.set("true",!0),ne.set("isMac",me.f),ne.set("isLinux",me.d),ne.set("isWindows",me.i),ne.set("isWeb",me.h),ne.set("isMacNative",me.f&&!me.h),ne.set("isEdge",ge.indexOf("Edg/")>=0),ne.set("isFirefox",ge.indexOf("Firefox")>=0),ne.set("isChrome",ge.indexOf("Chrome")>=0),ne.set("isSafari",ge.indexOf("Safari")>=0);const G=Object.prototype.hasOwnProperty;class O{static has(t){return I.create(t)}static equals(t,c){return u.create(t,c)}static regex(t,c){return A.create(t,c)}static not(t){return w.create(t)}static and(...t){return C.create(t,null)}static or(...t){return l.create(t,null,!0)}static deserialize(t,c=!1){return t?this._deserializeOrExpression(t,c):void 0}static _deserializeOrExpression(t,c){let b=t.split("||");return l.create(b.map(h=>this._deserializeAndExpression(h,c)),null,!0)}static _deserializeAndExpression(t,c){let b=t.split("&&");return C.create(b.map(h=>this._deserializeOne(h,c)),null)}static _deserializeOne(t,c){if(t=t.trim(),t.indexOf("!=")>=0){let b=t.split("!=");return g.create(b[0].trim(),this._deserializeValue(b[1],c))}if(t.indexOf("==")>=0){let b=t.split("==");return u.create(b[0].trim(),this._deserializeValue(b[1],c))}if(t.indexOf("=~")>=0){let b=t.split("=~");return A.create(b[0].trim(),this._deserializeRegexValue(b[1],c))}if(t.indexOf(" in ")>=0){let b=t.split(" in ");return m.create(b[0].trim(),b[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(t)){const b=t.split(">=");return o.create(b[0].trim(),b[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(t)){const b=t.split(">");return E.create(b[0].trim(),b[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(t)){const b=t.split("<=");return d.create(b[0].trim(),b[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(t)){const b=t.split("<");return f.create(b[0].trim(),b[1].trim())}return/^\!\s*/.test(t)?w.create(t.substr(1).trim()):I.create(t)}static _deserializeValue(t,c){if(t=t.trim(),t==="true")return!0;if(t==="false")return!1;let b=/^'([^']*)'$/.exec(t);return b?b[1].trim():t}static _deserializeRegexValue(t,c){if(Object(be.C)(t)){if(c)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let b=t.indexOf("/"),h=t.lastIndexOf("/");if(b===h||b<0){if(c)throw new Error(`bad regexp-value '${t}', missing /-enclosure`);return console.warn(`bad regexp-value '${t}', missing /-enclosure`),null}let D=t.slice(b+1,h),P=t[h+1]==="i"?"i":"";try{return new RegExp(D,P)}catch(j){if(c)throw new Error(`bad regexp-value '${t}', parse error: ${j}`);return console.warn(`bad regexp-value '${t}', parse error: ${j}`),null}}}function W(t,c){const b=t?t.substituteConstants():void 0,h=c?c.substituteConstants():void 0;return!b&&!h?!0:!b||!h?!1:b.equals(h)}function e(t,c){return t.cmp(c)}class k{constructor(){this.type=0}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!1}serialize(){return"false"}keys(){return[]}negate(){return L.INSTANCE}}k.INSTANCE=new k;class L{constructor(){this.type=1}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!0}serialize(){return"true"}keys(){return[]}negate(){return k.INSTANCE}}L.INSTANCE=new L;class I{constructor(t,c){this.key=t,this.negated=c,this.type=2}static create(t,c=null){const b=ne.get(t);return typeof b=="boolean"?b?L.INSTANCE:k.INSTANCE:new I(t,c)}cmp(t){return t.type!==this.type?this.type-t.type:v(this.key,t.key)}equals(t){return t.type===this.type?this.key===t.key:!1}substituteConstants(){const t=ne.get(this.key);return typeof t=="boolean"?t?L.INSTANCE:k.INSTANCE:this}evaluate(t){return!!t.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this)),this.negated}}class u{constructor(t,c,b){this.key=t,this.value=c,this.negated=b,this.type=4}static create(t,c,b=null){if(typeof c=="boolean")return c?I.create(t,b):w.create(t,b);const h=ne.get(t);if(typeof h=="boolean"){const D=h?"true":"false";return c===D?L.INSTANCE:k.INSTANCE}return new u(t,c,b)}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){const t=ne.get(this.key);if(typeof t=="boolean"){const c=t?"true":"false";return this.value===c?L.INSTANCE:k.INSTANCE}return this}evaluate(t){return t.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class m{constructor(t,c){this.key=t,this.valueKey=c,this.type=10,this.negated=null}static create(t,c){return new m(t,c)}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.valueKey,t.key,t.valueKey)}equals(t){return t.type===this.type?this.key===t.key&&this.valueKey===t.valueKey:!1}substituteConstants(){return this}evaluate(t){const c=t.getValue(this.valueKey),b=t.getValue(this.key);return Array.isArray(c)?c.indexOf(b)>=0:typeof b=="string"&&typeof c=="object"&&c!==null?G.call(c,b):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=i.create(this)),this.negated}}class i{constructor(t){this._actual=t,this.type=11}static create(t){return new i(t)}cmp(t){return t.type!==this.type?this.type-t.type:this._actual.cmp(t._actual)}equals(t){return t.type===this.type?this._actual.equals(t._actual):!1}substituteConstants(){return this}evaluate(t){return!this._actual.evaluate(t)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class g{constructor(t,c,b){this.key=t,this.value=c,this.negated=b,this.type=5}static create(t,c,b=null){if(typeof c=="boolean")return c?w.create(t,b):I.create(t,b);const h=ne.get(t);if(typeof h=="boolean"){const D=h?"true":"false";return c===D?k.INSTANCE:L.INSTANCE}return new g(t,c,b)}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){const t=ne.get(this.key);if(typeof t=="boolean"){const c=t?"true":"false";return this.value===c?k.INSTANCE:L.INSTANCE}return this}evaluate(t){return t.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class w{constructor(t,c){this.key=t,this.negated=c,this.type=3}static create(t,c=null){const b=ne.get(t);return typeof b=="boolean"?b?k.INSTANCE:L.INSTANCE:new w(t,c)}cmp(t){return t.type!==this.type?this.type-t.type:v(this.key,t.key)}equals(t){return t.type===this.type?this.key===t.key:!1}substituteConstants(){const t=ne.get(this.key);return typeof t=="boolean"?t?k.INSTANCE:L.INSTANCE:this}evaluate(t){return!t.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this)),this.negated}}function x(t,c){if(typeof t=="string"){const b=parseFloat(t);isNaN(b)||(t=b)}return typeof t=="string"||typeof t=="number"?c(t):k.INSTANCE}class E{constructor(t,c,b){this.key=t,this.value=c,this.negated=b,this.type=12}static create(t,c,b=null){return x(c,h=>new E(t,h,b))}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class o{constructor(t,c,b){this.key=t,this.value=c,this.negated=b,this.type=13}static create(t,c,b=null){return x(c,h=>new o(t,h,b))}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class f{constructor(t,c,b){this.key=t,this.value=c,this.negated=b,this.type=14}static create(t,c,b=null){return x(c,h=>new f(t,h,b))}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class d{constructor(t,c,b){this.key=t,this.value=c,this.negated=b,this.type=15}static create(t,c,b=null){return x(c,h=>new d(t,h,b))}cmp(t){return t.type!==this.type?this.type-t.type:n(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class A{constructor(t,c){this.key=t,this.regexp=c,this.type=7,this.negated=null}static create(t,c){return new A(t,c)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.key<t.key)return-1;if(this.key>t.key)return 1;const c=this.regexp?this.regexp.source:"",b=t.regexp?t.regexp.source:"";return c<b?-1:c>b?1:0}equals(t){if(t.type===this.type){const c=this.regexp?this.regexp.source:"",b=t.regexp?t.regexp.source:"";return this.key===t.key&&c===b}return!1}substituteConstants(){return this}evaluate(t){let c=t.getValue(this.key);return this.regexp?this.regexp.test(c):!1}serialize(){const t=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${t}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this)),this.negated}}class s{constructor(t){this._actual=t,this.type=8}static create(t){return new s(t)}cmp(t){return t.type!==this.type?this.type-t.type:this._actual.cmp(t._actual)}equals(t){return t.type===this.type?this._actual.equals(t._actual):!1}substituteConstants(){return this}evaluate(t){return!this._actual.evaluate(t)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function p(t){let c=null;for(let b=0,h=t.length;b<h;b++){const D=t[b].substituteConstants();if(t[b]!==D&&c===null){c=[];for(let P=0;P<b;P++)c[P]=t[P]}c!==null&&(c[b]=D)}return c===null?t:c}class C{constructor(t,c){this.expr=t,this.negated=c,this.type=6}static create(t,c){return C._normalizeArr(t,c)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let c=0,b=this.expr.length;c<b;c++){const h=e(this.expr[c],t.expr[c]);if(h!==0)return h}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let c=0,b=this.expr.length;c<b;c++)if(!this.expr[c].equals(t.expr[c]))return!1;return!0}return!1}substituteConstants(){const t=p(this.expr);return t===this.expr?this:C.create(t,this.negated)}evaluate(t){for(let c=0,b=this.expr.length;c<b;c++)if(!this.expr[c].evaluate(t))return!1;return!0}static _normalizeArr(t,c){const b=[];let h=!1;for(const D of t){if(!D)continue;if(D.type===1){h=!0;continue}if(D.type===0)return k.INSTANCE;if(D.type===6){b.push(...D.expr);continue}b.push(D)}if(b.length===0&&h)return L.INSTANCE;if(b.length===0)return;if(b.length===1)return b[0];b.sort(e);for(let D=1;D<b.length;D++)b[D-1].equals(b[D])&&(b.splice(D,1),D--);if(b.length===1)return b[0];for(;b.length>1;){const D=b[b.length-1];if(D.type!==9)break;b.pop();const P=b.pop(),j=b.length===0,N=l.create(D.expr.map(H=>C.create([H,P],null)),null,j);N&&(b.push(N),b.sort(e))}return b.length===1?b[0]:new C(b,c)}serialize(){return this.expr.map(t=>t.serialize()).join(" && ")}keys(){const t=[];for(let c of this.expr)t.push(...c.keys());return t}negate(){if(!this.negated){const t=[];for(let c of this.expr)t.push(c.negate());this.negated=l.create(t,this,!0)}return this.negated}}class l{constructor(t,c){this.expr=t,this.negated=c,this.type=9}static create(t,c,b){return l._normalizeArr(t,c,b)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let c=0,b=this.expr.length;c<b;c++){const h=e(this.expr[c],t.expr[c]);if(h!==0)return h}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let c=0,b=this.expr.length;c<b;c++)if(!this.expr[c].equals(t.expr[c]))return!1;return!0}return!1}substituteConstants(){const t=p(this.expr);return t===this.expr?this:l.create(t,this.negated,!1)}evaluate(t){for(let c=0,b=this.expr.length;c<b;c++)if(this.expr[c].evaluate(t))return!0;return!1}static _normalizeArr(t,c,b){let h=[],D=!1;if(t){for(let P=0,j=t.length;P<j;P++){const N=t[P];if(!N)continue;if(N.type===0){D=!0;continue}if(N.type===1)return L.INSTANCE;if(N.type===9){h=h.concat(N.expr);continue}h.push(N)}if(h.length===0&&D)return k.INSTANCE;h.sort(e)}if(h.length===0)return;if(h.length===1)return h[0];for(let P=1;P<h.length;P++)h[P-1].equals(h[P])&&(h.splice(P,1),P--);if(h.length===1)return h[0];if(b){for(let P=0;P<h.length;P++)for(let j=P+1;j<h.length;j++)a(h[P],h[j])&&(h.splice(j,1),j--);if(h.length===1)return h[0]}return new l(h,c)}serialize(){return this.expr.map(t=>t.serialize()).join(" || ")}keys(){const t=[];for(let c of this.expr)t.push(...c.keys());return t}negate(){if(!this.negated){let t=[];for(let c of this.expr)t.push(c.negate());for(;t.length>1;){const c=t.shift(),b=t.shift(),h=[];for(const P of r(c))for(const j of r(b))h.push(C.create([P,j],null));const D=t.length===0;t.unshift(l.create(h,null,D))}this.negated=t[0]}return this.negated}}class T extends I{constructor(t,c,b){super(t,null);this._defaultValue=c,typeof b=="object"?T._info.push(Object.assign(Object.assign({},b),{key:t})):b!==!0&&T._info.push({key:t,description:b,type:c!=null?typeof c:void 0})}static all(){return T._info.values()}bindTo(t){return t.createKey(this.key,this._defaultValue)}getValue(t){return t.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(t){return u.create(this.key,t)}}T._info=[];const y=Object(ye.c)("contextKeyService"),_="setContext";function v(t,c){return t<c?-1:t>c?1:0}function n(t,c,b,h){return t<b?-1:t>b?1:c<h?-1:c>h?1:0}function a(t,c){if(c.type===6&&t.type!==9&&t.type!==6){for(const D of c.expr)if(t.equals(D))return!0}const b=t.negate(),h=r(b).concat(r(c));h.sort(e);for(let D=0;D<h.length;D++){const P=h[D],j=P.negate();for(let N=D+1;N<h.length;N++){const H=h[N];if(j.equals(H))return!0}}return!1}function r(t){return t.type===9?t.expr:[t]}},TSYQ:function(We,ce,F){var me,be;/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(){"use strict";var ye={}.hasOwnProperty,ge="[native code]";function ne(){for(var G=[],O=0;O<arguments.length;O++){var W=arguments[O];if(!W)continue;var e=typeof W;if(e==="string"||e==="number")G.push(W);else if(Array.isArray(W)){if(W.length){var k=ne.apply(null,W);k&&G.push(k)}}else if(e==="object"){if(W.toString!==Object.prototype.toString&&!W.toString.toString().includes("[native code]")){G.push(W.toString());continue}for(var L in W)ye.call(W,L)&&W[L]&&G.push(L)}}return G.join(" ")}We.exports?(ne.default=ne,We.exports=ne):!(me=[],be=function(){return ne}.apply(ce,me),be!==void 0&&(We.exports=be))})()},TXwP:function(We,ce,F){var me,be;(function(){var ye;(function(){"use strict";var ne=[,,function(e){function k(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=[]}k.prototype.clone_empty=function(){var u=new k(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},k.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},k.prototype.has_match=function(u){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(u))return!0;return!1},k.prototype.set_indent=function(u,m){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},k.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)},k.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},k.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},k.prototype.is_empty=function(){return this.__items.length===0},k.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},k.prototype.push=function(u){this.__items.push(u);var m=u.lastIndexOf(`
`);m!==-1?this.__character_count=u.length-m:this.__character_count+=u.length},k.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},k.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},k.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},k.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},k.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 L(u,m){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)),m=m||"",u.indent_level>0&&(m=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}L.prototype.get_indent_size=function(u,m){var i=this.__base_string_length;return m=m||0,u<0&&(i=0),i+=u*this.__indent_size,i+=m,i},L.prototype.get_indent_string=function(u,m){var i=this.__base_string;return m=m||0,u<0&&(u=0,i=""),m+=u*this.__indent_size,this.__ensure_cache(m),i+=this.__cache[m],i},L.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},L.prototype.__add_column=function(){var u=this.__cache.length,m=0,i="";this.__indent_size&&u>=this.__indent_size&&(m=Math.floor(u/this.__indent_size),u-=m*this.__indent_size,i=new Array(m+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function I(u,m){this.__indent_cache=new L(u,m),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 k(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}I.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},I.prototype.get_line_number=function(){return this.__lines.length},I.prototype.get_indent_string=function(u,m){return this.__indent_cache.get_indent_string(u,m)},I.prototype.get_indent_size=function(u,m){return this.__indent_cache.get_indent_size(u,m)},I.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},I.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},I.prototype.get_code=function(u){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return u!==`
`&&(i=i.replace(/[\n]/g,u)),i},I.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},I.prototype.set_indent=function(u,m){return u=u||0,m=m||0,this.next_line.set_indent(u,m),this.__lines.length>1?(this.current_line.set_indent(u,m),!0):(this.current_line.set_indent(),!1)},I.prototype.add_raw_token=function(u){for(var m=0;m<u.newlines;m++)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},I.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()},I.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(" "))},I.prototype.remove_indent=function(u){for(var m=this.__lines.length;u<m;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},I.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},I.prototype.just_added_newline=function(){return this.current_line.is_empty()},I.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},I.prototype.ensure_empty_line_above=function(u,m){for(var i=this.__lines.length-2;i>=0;){var g=this.__lines[i];if(g.is_empty())break;if(g.item(0).indexOf(u)!==0&&g.item(-1)!==m){this.__lines.splice(i+1,0,new k(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=I},,,,function(e){function k(u,m){this.raw_options=L(u,m),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"])}k.prototype._get_array=function(u,m){var i=this.raw_options[u],g=m||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(g=i.concat()):typeof i=="string"&&(g=i.split(/[^a-zA-Z0-9_\/\-]+/)),g},k.prototype._get_boolean=function(u,m){var i=this.raw_options[u],g=i===void 0?!!m:!!i;return g},k.prototype._get_characters=function(u,m){var i=this.raw_options[u],g=m||"";return typeof i=="string"&&(g=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),g},k.prototype._get_number=function(u,m){var i=this.raw_options[u];m=parseInt(m,10),isNaN(m)&&(m=0);var g=parseInt(i,10);return isNaN(g)&&(g=m),g},k.prototype._get_selection=function(u,m,i){var g=this._get_selection_list(u,m,i);if(g.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+m+`
You passed in: '`+this.raw_options[u]+"'");return g[0]},k.prototype._get_selection_list=function(u,m,i){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[m[0]],!this._is_valid_selection(i,m))throw new Error("Invalid Default Value!");var g=this._get_array(u,i);if(!this._is_valid_selection(g,m))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+m+`
You passed in: '`+this.raw_options[u]+"'");return g},k.prototype._is_valid_selection=function(u,m){return u.length&&m.length&&!u.some(function(i){return m.indexOf(i)===-1})};function L(u,m){var i={};u=I(u);var g;for(g in u)g!==m&&(i[g]=u[g]);if(m&&u[m])for(g in u[m])i[g]=u[m][g];return i}function I(u){var m={},i;for(i in u){var g=i.replace(/-/g,"_");m[g]=u[i]}return m}e.exports.Options=k,e.exports.normalizeOpts=I,e.exports.mergeOpts=L},,function(e){var k=RegExp.prototype.hasOwnProperty("sticky");function L(I){this.__input=I||"",this.__input_length=this.__input.length,this.__position=0}L.prototype.restart=function(){this.__position=0},L.prototype.back=function(){this.__position>0&&(this.__position-=1)},L.prototype.hasNext=function(){return this.__position<this.__input_length},L.prototype.next=function(){var I=null;return this.hasNext()&&(I=this.__input.charAt(this.__position),this.__position+=1),I},L.prototype.peek=function(I){var u=null;return I=I||0,I+=this.__position,I>=0&&I<this.__input_length&&(u=this.__input.charAt(I)),u},L.prototype.__match=function(I,u){I.lastIndex=u;var m=I.exec(this.__input);return m&&!(k&&I.sticky)&&(m.index!==u&&(m=null)),m},L.prototype.test=function(I,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(I,u):!1},L.prototype.testChar=function(I,u){var m=this.peek(u);return I.lastIndex=0,m!==null&&I.test(m)},L.prototype.match=function(I){var u=this.__match(I,this.__position);return u?this.__position+=u[0].length:u=null,u},L.prototype.read=function(I,u,m){var i="",g;return I&&(g=this.match(I),g&&(i+=g[0])),u&&(g||!I)&&(i+=this.readUntil(u,m)),i},L.prototype.readUntil=function(I,u){var m="",i=this.__position;I.lastIndex=this.__position;var g=I.exec(this.__input);return g?(i=g.index,u&&(i+=g[0].length)):i=this.__input_length,m=this.__input.substring(this.__position,i),this.__position=i,m},L.prototype.readUntilAfter=function(I){return this.readUntil(I,!0)},L.prototype.get_regexp=function(I,u){var m=null,i="g";return u&&k&&(i="y"),typeof I=="string"&&I!==""?m=new RegExp(I,i):I&&(m=new RegExp(I.source,i)),m},L.prototype.get_literal_regexp=function(I){return RegExp(I.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},L.prototype.peekUntilAfter=function(I){var u=this.__position,m=this.readUntilAfter(I);return this.__position=u,m},L.prototype.lookBack=function(I){var u=this.__position-1;return u>=I.length&&this.__input.substring(u-I.length,u).toLowerCase()===I},e.exports.InputScanner=L},,,,,function(e){function k(L,I){L=typeof L=="string"?L:L.source,I=typeof I=="string"?I:I.source,this.__directives_block_pattern=new RegExp(L+/ beautify( \w+[:]\w+)+ /.source+I,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(L+/\sbeautify\signore:end\s/.source+I,"g")}k.prototype.get_directives=function(L){if(!L.match(this.__directives_block_pattern))return null;var I={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(L);u;)I[u[1]]=u[2],u=this.__directive_pattern.exec(L);return I},k.prototype.readIgnored=function(L){return L.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=k},,function(e,k,L){var I=L(16).Beautifier,u=L(17).Options;function m(i,g){var w=new I(i,g);return w.beautify()}e.exports=m,e.exports.defaultOptions=function(){return new u}},function(e,k,L){var I=L(17).Options,u=L(2).Output,m=L(8).InputScanner,i=L(13).Directives,g=new i(/\/\*/,/\*\//),w=/\r\n|[\r\n]/,x=/\r\n|[\r\n]/g,E=/\s/,o=/(?:\s|\n)+/g,f=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,d=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function A(s,p){this._source_text=s||"",this._options=new I(p),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"]}A.prototype.eatString=function(s){var p="";for(this._ch=this._input.next();this._ch;){if(p+=this._ch,this._ch==="\\")p+=this._input.next();else if(s.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return p},A.prototype.eatWhitespace=function(s){for(var p=E.test(this._input.peek()),C=0;E.test(this._input.peek());)this._ch=this._input.next(),s&&this._ch===`
`&&((C===0||C<this._options.max_preserve_newlines)&&(C++,this._output.add_new_line(!0)));return p},A.prototype.foundNestedPseudoClass=function(){for(var s=0,p=1,C=this._input.peek(p);C;){if(C==="{")return!0;if(C==="(")s+=1;else if(C===")"){if(s===0)return!1;s-=1}else if(C===";"||C==="}")return!1;p++,C=this._input.peek(p)}return!1},A.prototype.print_string=function(s){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(s)},A.prototype.preserveSingleSpace=function(s){s&&(this._output.space_before_token=!0)},A.prototype.indent=function(){this._indentLevel++},A.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var s=this._source_text,p=this._options.eol;p==="auto"&&(p=`
`,s&&w.test(s||"")&&(p=s.match(w)[0])),s=s.replace(x,`
`);var C=s.match(/^[\t ]*/)[0];this._output=new u(this._options,C),this._input=new m(s),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var l=0,T=!1,y=!1,_=!1,v=!1,n=!1,a=!1,r=this._ch,t=!1,c,b,h;c=this._input.read(o),b=c!=="",h=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 D=this._input.read(f),P=g.get_directives(D);P&&P.ignore==="start"&&(D+=g.readIgnored(this._input)),this.print_string(D),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(d)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(b),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var j=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);j.match(/[ :]$/)&&(j=this.eatString(": ").replace(/\s$/,""),this.print_string(j),this._output.space_before_token=!0),j=j.replace(/\s$/,""),j==="extend"?v=!0:j==="import"&&(n=!0),j in this.NESTED_AT_RULE?(this._nestedLevel+=1,j in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!T&&l===0&&j.indexOf(":")!==-1&&(y=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(b),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")y&&(y=!1,this.outdent()),_?(_=!1,T=this._indentLevel>=this._nestedLevel):T=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&T&&(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)):(h==="("?this._output.space_before_token=!1:h!==","&&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(),h==="{"&&this._output.trim(!0),n=!1,v=!1,y&&(this.outdent(),y=!1),this.print_string(this._ch),T=!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 N=0;N<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;N++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[N])){t=!0;break}(T||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&l===0?(this.print_string(":"),y||(y=!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 H=h==='"'||h==="'";this.preserveSingleSpace(H||b),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")t=!1,l===0?(y&&(this.outdent(),y=!1),v=!1,n=!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(),l++,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(")")),l&&(l--,this.outdent()));else{var z=!1;this._input.lookBack("with")&&(z=!0),this.preserveSingleSpace(b||z),this.print_string(this._ch),y&&h==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),a=!0):(this.eatWhitespace(),l++,this.indent())}else if(this._ch===")")l&&(l--,this.outdent()),a&&this._input.peek()===";"&&this._options.selector_separator_newline&&(a=!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&&(!y||a)&&l===0&&!n&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!y&&l===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&&E.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(b),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),E.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 J=h==='"'||h==="'";this.preserveSingleSpace(J||b),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&t&&this._output.add_new_line()}var Y=this._output.get_code(p);return Y},e.exports.Beautifier=A},function(e,k,L){var I=L(6).Options;function u(m){I.call(this,m,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var g=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var w=0;w<g.length;w++)g[w]!=="expand"?this.brace_style="collapse":this.brace_style=g[w]}u.prototype=new I,e.exports.Options=u}],G={};function O(e){var k=G[e];if(k!==void 0)return k.exports;var L=G[e]={exports:{}};return ne[e](L,L.exports,O),L.exports}var W=O(15);ye=W})();var ge=ye;!(me=[],be=function(){return{css_beautify:ge}}.apply(ce,me),be!==void 0&&(We.exports=be))})()},U8pU:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(be){return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ye){return typeof ye}:function(ye){return ye&&typeof Symbol=="function"&&ye.constructor===Symbol&&ye!==Symbol.prototype?"symbol":typeof ye},me(be)}},VTBJ:function(We,ce,F){"use strict";F.d(ce,"a",function(){return ye});var me=F("rePB");function be(ge,ne){var G=Object.keys(ge);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(ge);ne&&(O=O.filter(function(W){return Object.getOwnPropertyDescriptor(ge,W).enumerable})),G.push.apply(G,O)}return G}function ye(ge){for(var ne=1;ne<arguments.length;ne++){var G=arguments[ne]!=null?arguments[ne]:{};ne%2?be(Object(G),!0).forEach(function(O){Object(me.a)(ge,O,G[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ge,Object.getOwnPropertyDescriptors(G)):be(Object(G)).forEach(function(O){Object.defineProperty(ge,O,Object.getOwnPropertyDescriptor(G,O))})}return ge}},Vhoy:function(We,ce,F){"use strict";F.d(ce,"d",function(){return ge}),F.d(ce,"e",function(){return ne}),F.d(ce,"c",function(){return G}),F.d(ce,"b",function(){return O}),F.d(ce,"a",function(){return W});var me=F("MI8n");class be{constructor(){this._icons=new Map,this._onDidRegister=new me.b}add(e){const k=this._icons.get(e.id);k?e.description?k.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const ye=new be,ge=ye;function ne(e,k){return new O(e,k)}function G(e){return e?e.replace(/\$\((.*?)\)/g,(k,L)=>` ${L} `).trim():""}class O{constructor(e,k,L){this.id=e,this.definition=k,this.description=L,ye.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const k=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function L(m){if(m instanceof O)return["codicon","codicon-"+m.id];const i=k.exec(m.id);if(!i)return L(O.error);let[,g,w]=i;const x=["codicon","codicon-"+g];return w&&x.push("codicon-modifier-"+w.substr(1)),x}e.asClassNameArray=L;function I(m){return L(m).join(" ")}e.asClassName=I;function u(m){return"."+L(m).join(".")}e.asCSSSelector=u})(W||(W={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(O||(O={}))},ZW9T:function(We,ce,F){"use strict";F.d(ce,"a",function(){return b});var me=F("YaWb"),be=F("nc60"),ye=F("8OG5"),ge=F("mgsT"),ne=F("sh+1"),G=F("Hqw+"),O=F("ftSv"),W=F("T/Jt"),e=F.n(W),k=F("bdgK"),L=F("IYef"),I=F("XXmO"),u=F.n(I),m={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"]},i={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"]},g={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","friend","gcnew","generic","goto","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:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $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 <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},w={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(`
`)}]},x=F("5VLF"),E=F.n(x),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"]}},f=function(D,P){return P.map(function(j){return{label:j,kind:D.languages.CompletionItemKind.Keyword,insertText:j}})},d=function(D){return Object.keys(o.tables).map(function(P){return{label:P,kind:D.languages.CompletionItemKind.Variable,insertText:P}})},A=function(D,P){var j=o.tables[D];return j?j.map(function(N){return{label:N,kind:P.languages.CompletionItemKind.Field,insertText:N}}):[]};function s(h,D,P,j,N){var H=D.getWordUntilPosition(P),z={startLineNumber:P.lineNumber,endLineNumber:P.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn},J=j.map(function(Y){return{label:Y,kind:h.languages.CompletionItemKind.Keyword,insertText:Y,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:z}});return N.map(function(Y){J.push(Object(me.a)(Object(me.a)({},Y),{},{range:z}))}),J}var p=function(h){o.languages.map(function(N){return h.languages.registerDocumentFormattingEditProvider(N,{provideDocumentFormattingEdits:function(z,J,Y){return Object(L.a)(u.a.mark(function le(){var te;return u.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return te=E()(z.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}),_e.abrupt("return",[{range:z.getFullModelRange(),text:te}]);case 2:case"end":return _e.stop()}},le)}))()}}),N});var D=g.quickKey.map(function(N){return{label:N.label,kind:h.languages.CompletionItemKind.Method,insertText:N.content,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),P=w.quickKey.map(function(N){return{label:N.label,kind:h.languages.CompletionItemKind.Method,insertText:N.content,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),j=i.quickKey.map(function(N){return{label:N.label,kind:h.languages.CompletionItemKind.Method,insertText:N.content,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}});h.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(H,z){var J=H.getWordUntilPosition(z),Y={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},le=H.getLineContent(z.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(be.a)(g.keywords.map(function(te){return{label:te,kind:h.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}})),Object(be.a)(g.quickKey.map(function(te){return{label:te.label,kind:h.languages.CompletionItemKind.Function,documentation:te.content,insertText:le.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}})))}}}),h.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(H,z){var J=H.getWordUntilPosition(z),Y={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn};return{suggestions:Object(be.a)(m.keywords.map(function(le){return{label:le,kind:h.languages.CompletionItemKind.Function,documentation:le,insertText:le,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}}))}}}),h.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(H,z){var J=H.getWordUntilPosition(z),Y={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},le=H.getLineContent(z.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(be.a)(i.keywords.map(function(te){return{label:te,kind:h.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}})),Object(be.a)(i.quickKey.map(function(te){return{label:te.label,kind:h.languages.CompletionItemKind.Function,documentation:te.content,insertText:le.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}})))}}}),h.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(H,z){var J=H.getWordUntilPosition(z),Y={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},le=H.getLineContent(z.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(be.a)(w.keywords.map(function(te){return{label:te,kind:h.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}})),Object(be.a)(w.quickKey.map(function(te){return{label:te.label,kind:h.languages.CompletionItemKind.Function,documentation:te.content,insertText:le.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Y}})))}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",l=F("fjLI"),T=F("LvDl"),y=F("+ua5");function _(h){return/^\d+$/.test(h)?"".concat(h,"px"):h}function v(){}var n=!1,a={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function r(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],D=h;if(Array.isArray(h)){for(var P=0;P<h.length;P++){var j=a[h[P]];if(j)return j}return D[0]}return a[D]||D}var t=null,c=ce.b=function(h){var D=h.width,P=D===void 0?"100%":D,j=h.height,N=j===void 0?"100%":j,H=h.value,z=h.language,J=z===void 0?"javascript":z,Y=h.style,le=Y===void 0?{}:Y,te=h.options,Z=te===void 0?{}:te,_e=h.overrideServices,we=_e===void 0?{}:_e,De=h.theme,Ee=De===void 0?"vs-dark":De,xe=h.onEditBlur,ve=h.onSave,X=h.autoHeight,Ae=X===void 0?!1:X,Q=h.forbidCopy,ue=Q===void 0?!1:Q,ee=h.onChange,ae=ee===void 0?v:ee,fe=h.editorDidMount,Re=fe===void 0?v:fe,pe=h.onFocus,ie=pe===void 0?v:pe,Ie=h.filename,Oe=Ie===void 0?"educoder.txt":Ie,Ne=h.errorLine,Le=h.errorContent,Ce=Le===void 0?"":Le,Ue=Object(O.a)(h,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Te=Object(W.useRef)(),Pe=Object(W.useRef)({}),q=Object(W.useRef)(),se=Object(W.useRef)(),he=Object(W.useRef)(!1),V=Object(W.useRef)(),$=Object(W.useState)(!1),re=Object(G.a)($,2),oe=re[0],Se=re[1];function Me(){var je;return Te.current&&(je=new k.a(function(Ze){var ut=Object(ne.a)(Ze),lt;try{for(ut.s();!(lt=ut.n()).done;){var it=lt.value;(it.target.offsetHeight>0||it.target.offsetWidth>0)&&Pe.current.instance.layout()}}catch(yt){ut.e(yt)}finally{ut.f()}}),je.observe(Te.current)),je}function Be(){ge.b.warn(decodeURIComponent(C))}var Ke=function(){var Ze=Pe.current.instance;if(H!=null&&Ze&&oe){var ut=Ze.getModel();ut&&H!==ut.getValue()&&(n=!0,ut.setValue(H),Ze.layout(),n=!1)}};Object(W.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){Ke()},500)},[H,oe,Pe.current]),Object(W.useEffect)(function(){if(Ne&&Pe.current&&Pe.current.instance){var je=Pe.current.instance;je.changeViewZones(function(ut){var lt=document.createElement("div");lt.style.padding="10px 20px",lt.style.width="calc(100% - 20px)",lt.className="my-error-line-wrp",lt.innerHTML=Ce,ut.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:lt})});var Ze={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}};je.addOverlayWidget(Ze),je.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,Pe.current,oe]);function Xe(){var je=Pe.current.instance;if(je){var Ze=je.getSelection(),ut=Pe.current.pastePos||{},lt=new t.Range(ut.startLineNumber||Ze.endLineNumber,ut.startColumn||Ze.endColumn,ut.endLineNumber||Ze.endLineNumber,ut.endColumn||Ze.endColumn);setTimeout(function(){je.executeEdits("",[{range:lt,text:""}])},300)}}function Ge(je){(window.navigator.platform.match("Mac")?je.metaKey:je.ctrlKey)&&je.keyCode==83&&(je.preventDefault(),ve())}var rt=function(){if(Ae&&Pe.current.instance){var Ze=Pe.current.instance.getContentHeight();wt(Ze<N?N:Ze)}else wt(N)};function qe(je){var Ze=document.createEvent("MouseEvents");Ze.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),je.dispatchEvent(Ze)}function Ve(je,Ze){var ut=window.URL||window.webkitURL||window,lt=new Blob([Ze]),it=document.createElementNS("http://www.w3.org/1999/xhtml","a");it.href=ut.createObjectURL(lt),it.download=je,qe(it)}Object(W.useEffect)(function(){rt()},[rt]),Object(W.useEffect)(function(){Te.current&&!oe&&F.e(26).then(F.t.bind(null,"M/lh",7)).then(function(je){try{t=je,Pe.current.instance=t.editor.create(Te.current,{value:H,language:r(J),theme:Ee,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},we);var Ze=Pe.current.instance,ut=l.d._menuItems,lt=Object(be.a)(ut).find(function(mt){return mt[0]._debugName=="EditorContext"}),it=lt[1],yt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Lt=function(Ct,Pt){var kt=Ct._first;do{var ht,Dt,Nt=Pt.includes((ht=kt.element)===null||ht===void 0||((Dt=ht.command)===null||Dt===void 0)?void 0:Dt.id);Nt&&Ct._remove(kt)}while(kt=kt.next)};if(Re(Ze,t),setTimeout(function(){rt(),Pe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ve(Oe||"educoder.txt",Ze.getValue())}}),Ze.getDomNode().addEventListener("input",function(){q.current.autoFormat&&Ze.getAction("editor.action.formatDocument").run()})},500),Pe.current.subscription=Ze.onDidChangeModelContent(function(mt){he.current?clearTimeout(V.current):(rt(),ae(Ze.getValue(),mt)),V.current=setTimeout(function(){he.current=!1},500)}),window.Monaco||p(t,r(J)),ue&&(Lt(it,yt),Te.current.classList.add("noCopyPaste"),Ze.onKeyDown(function(mt){var Ct=mt.keyCode,Pt=mt.ctrlKey,kt=mt.metaKey;(Ct===33||Ct===52)&&(kt||Pt)&&(Be(),mt.preventDefault())})),window.Monaco=t,xe&&Ze.onDidBlurEditorWidget(function(){xe(Ze.getValue())}),ie&&Ze.onDidFocusEditorText(function(){ie(Ze.getValue())}),ue){Ze.addCommand(t.KeyMod.CtrlCmd|t.KeyCode.KEY_V,function(){return Be(),null}),Ze.onDidPaste(function(mt){Pe.current.pastePos=mt});try{window.addEventListener("paste",Xe)}catch(mt){}}var ct=Me();return Se(!0),function(){var mt=Pe.current.instance;mt.dispose();var Ct=mt.getModel();Ct&&Ct.dispose(),Pe.current.subscription&&Pe.current.subscription.dispose(),ue&&window.removeEventListener("paste",Xe),ct.unobserve(Te.current)}}catch(mt){}})},[]),Object(W.useEffect)(function(){var je=Pe.current.instance;if(je&&oe)return document.addEventListener("keydown",Ge,!1),function(){document.removeEventListener("keydown",Ge)}},[ve,oe]),Object(W.useEffect)(function(){var je=Pe.current.instance;if(je&&oe){var Ze=r(J);t.editor.setModelLanguage(je.getModel(),Ze),console.log("language:",J,je.getModel(),Ze)}},[J,oe]),Object(W.useEffect)(function(){var je=Pe.current.instance;je&&oe&&t.editor.setTheme(Ee)},[Ee,oe]),Object(W.useEffect)(function(){var je=Pe.current.instance;q.current=Z,je&&oe&&(je.updateOptions(Object(me.a)({},Z)),setTimeout(function(){je.getModel().updateOptions(Object(me.a)({},Z))},200))},[JSON.stringify(Z),oe]),Object(W.useEffect)(function(){var je=Pe.current.instance;je&&oe&&je.layout()},[P,N,oe]);var at=Object(W.useState)(_(P)),Qe=Object(G.a)(at,2),$e=Qe[0],nt=Qe[1],Ye=Object(W.useState)(_(N)),st=Object(G.a)(Ye,2),Tt=st[0],wt=st[1],xt=Object(me.a)(Object(me.a)({},le),{},{width:$e,height:Tt});return e.a.createElement("div",{className:"my-monaco-editor",ref:Te,style:xt})};function b(h){var D=h.width,P=D===void 0?"100%":D,j=h.height,N=j===void 0?"100%":j,H=h.original,z=h.modified,J=h.language,Y=h.options,le=Y===void 0?{}:Y,te=Object(W.useRef)(),Z=Object(W.useState)(null),_e=Object(G.a)(Z,2),we=_e[0],De=_e[1];function Ee(Ae){var Q;return te.current&&(Q=new k.a(function(ue){var ee=Object(ne.a)(ue),ae;try{for(ee.s();!(ae=ee.n()).done;){var fe=ae.value;(fe.target.offsetHeight>0||fe.target.offsetWidth>0)&&Ae.layout()}}catch(Re){ee.e(Re)}finally{ee.f()}}),Q.observe(te.current)),Q}Object(W.useEffect)(function(){te.current&&F.e(26).then(F.t.bind(null,"M/lh",7)).then(function(Ae){t=Ae;var Q=t.editor.createDiffEditor(te.current,Object(me.a)(Object(me.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},le),{},{wordWrap:!0}));De(Q);var ue=Ee(Q);return function(){Q.dispose();var ee=Q.getModel();ee&&ee.dispose(),ue.unobserve(te.current)}})},[]),Object(W.useEffect)(function(){we&&we.setModel({original:t.editor.createModel(H,J),modified:t.editor.createModel(z,J)})},[H,z,J,we]);var xe=_(P),ve=_(N),X={width:xe,height:ve};return e.a.createElement("div",{className:"my-diff-editor",ref:te,style:X})}},Zaiq:function(We,ce,F){"use strict";F.d(ce,"a",function(){return p.a});var me=F("yuO0"),be=F("XjgL"),ye=F("kxoy"),ge=F("6ASS"),ne=F("aVTQ"),G=F("eA01"),O=F("fXDJ"),W=F("fhFH"),e=F("BPTR"),k=F("udol"),L=F("27eb"),I=F.n(L),u=F("sg8A"),m=F("E0BR"),i=F("B/uU"),g=F("T/Jt"),w=F("c27x");function x(Ee){var xe=Ee.dropPosition,ve=Ee.dropLevelOffset,X=Ee.indent,Ae={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(xe){case-1:Ae.top=0,Ae.left=-ve*X;break;case 1:Ae.bottom=0,Ae.left=-ve*X;break;case 0:Ae.bottom=0,Ae.left=X;break}return g.createElement("div",{style:Ae})}function E(Ee){if(Ee==null)throw new TypeError("Cannot destructure "+Ee)}var o=F("36hc"),f=F("fNpE"),d=F("s7W6"),A=F("JTpS"),s=F("J5No"),p=F("0pdE");function C(Ee,xe){var ve=g.useState(!1),X=Object(o.a)(ve,2),Ae=X[0],Q=X[1];g.useLayoutEffect(function(){if(Ae)return Ee(),function(){xe()}},[Ae]),g.useLayoutEffect(function(){return Q(!0),function(){Q(!1)}},[])}var l=F("rgEC"),T=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],y=function(xe,ve){var X=xe.className,Ae=xe.style,Q=xe.motion,ue=xe.motionNodes,ee=xe.motionType,ae=xe.onMotionStart,fe=xe.onMotionEnd,Re=xe.active,pe=xe.treeNodeRequiredProps,ie=Object(f.a)(xe,T),Ie=g.useState(!0),Oe=Object(o.a)(Ie,2),Ne=Oe[0],Le=Oe[1],Ce=g.useContext(w.a),Ue=Ce.prefixCls,Te=ue&&ee!=="hide";Object(d.a)(function(){ue&&(Te!==Ne&&Le(Te))},[ue]);var Pe=function(){ue&&ae()},q=g.useRef(!1),se=function(){ue&&!q.current&&(q.current=!0,fe())};C(Pe,se);var he=function($){Te===$&&se()};return ue?g.createElement(s.default,Object(me.a)({ref:ve,visible:Ne},Q,{motionAppear:ee==="show",onVisibleChanged:he}),function(V,$){var re=V.className,oe=V.style;return g.createElement("div",{ref:$,className:I()("".concat(Ue,"-treenode-motion"),re),style:oe},ue.map(function(Se){var Me=Object(me.a)({},(E(Se.data),Se.data)),Be=Se.title,Ke=Se.key,Xe=Se.isStart,Ge=Se.isEnd;delete Me.children;var rt=Object(l.g)(Ke,pe);return g.createElement(p.a,Object(me.a)({},Me,rt,{title:Be,active:Re,data:Se.data,key:Ke,isStart:Xe,isEnd:Ge}))}))}):g.createElement(p.a,Object(me.a)({domRef:ve,className:X,style:Ae},ie,{active:Re}))};y.displayName="MotionTreeNode";var _=g.forwardRef(y),v=_;function n(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ve=Ee.length,X=xe.length;if(Math.abs(ve-X)!==1)return{add:!1,key:null};function Ae(Q,ue){var ee=new Map;Q.forEach(function(fe){ee.set(fe,!0)});var ae=ue.filter(function(fe){return!ee.has(fe)});return ae.length===1?ae[0]:null}return ve<X?{add:!0,key:Ae(Ee,xe)}:{add:!1,key:Ae(xe,Ee)}}function a(Ee,xe,ve){var X=Ee.findIndex(function(ee){return ee.key===ve}),Ae=Ee[X+1],Q=xe.findIndex(function(ee){return ee.key===ve});if(Ae){var ue=xe.findIndex(function(ee){return ee.key===Ae.key});return xe.slice(Q+1,ue)}return xe.slice(Q+1)}var r=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],t={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},c=function(){},b="RC_TREE_MOTION_".concat(Math.random()),h={key:b},D={key:b,level:0,index:0,pos:"0",node:h,nodes:[h]},P={parent:null,children:[],pos:D.pos,data:h,title:null,key:b,isStart:[],isEnd:[]};function j(Ee,xe,ve,X){return xe===!1||!ve?Ee:Ee.slice(0,Math.ceil(ve/X)+1)}function N(Ee){var xe=Ee.key,ve=Ee.pos;return Object(l.f)(xe,ve)}function H(Ee){for(var xe=String(Ee.data.key),ve=Ee;ve.parent;)ve=ve.parent,xe="".concat(ve.data.key," > ").concat(xe);return xe}var z=g.forwardRef(function(Ee,xe){var ve=Ee.prefixCls,X=Ee.data,Ae=Ee.selectable,Q=Ee.checkable,ue=Ee.expandedKeys,ee=Ee.selectedKeys,ae=Ee.checkedKeys,fe=Ee.loadedKeys,Re=Ee.loadingKeys,pe=Ee.halfCheckedKeys,ie=Ee.keyEntities,Ie=Ee.disabled,Oe=Ee.dragging,Ne=Ee.dragOverNodeKey,Le=Ee.dropPosition,Ce=Ee.motion,Ue=Ee.height,Te=Ee.itemHeight,Pe=Ee.virtual,q=Ee.focusable,se=Ee.activeItem,he=Ee.focused,V=Ee.tabIndex,$=Ee.onKeyDown,re=Ee.onFocus,oe=Ee.onBlur,Se=Ee.onActiveChange,Me=Ee.onListChangeStart,Be=Ee.onListChangeEnd,Ke=Object(f.a)(Ee,r),Xe=g.useRef(null),Ge=g.useRef(null);g.useImperativeHandle(xe,function(){return{scrollTo:function(Dt){Xe.current.scrollTo(Dt)},getIndentWidth:function(){return Ge.current.offsetWidth}}});var rt=g.useState(ue),qe=Object(o.a)(rt,2),Ve=qe[0],at=qe[1],Qe=g.useState(X),$e=Object(o.a)(Qe,2),nt=$e[0],Ye=$e[1],st=g.useState(X),Tt=Object(o.a)(st,2),wt=Tt[0],xt=Tt[1],je=g.useState([]),Ze=Object(o.a)(je,2),ut=Ze[0],lt=Ze[1],it=g.useState(null),yt=Object(o.a)(it,2),Lt=yt[0],ct=yt[1],mt=g.useRef(X);mt.current=X;function Ct(){var ht=mt.current;Ye(ht),xt(ht),lt([]),ct(null),Be()}Object(d.a)(function(){at(ue);var ht=n(Ve,ue);if(ht.key!==null)if(ht.add){var Dt=nt.findIndex(function(Et){var Kt=Et.key;return Kt===ht.key}),Nt=j(a(nt,X,ht.key),Pe,Ue,Te),jt=nt.slice();jt.splice(Dt+1,0,P),xt(jt),lt(Nt),ct("show")}else{var Ht=X.findIndex(function(Et){var Kt=Et.key;return Kt===ht.key}),Bt=j(a(X,nt,ht.key),Pe,Ue,Te),gt=X.slice();gt.splice(Ht+1,0,P),xt(gt),lt(Bt),ct("hide")}else nt!==X&&(Ye(X),xt(X))},[ue,X]),g.useEffect(function(){Oe||Ct()},[Oe]);var Pt=Ce?wt:X,kt={expandedKeys:ue,selectedKeys:ee,loadedKeys:fe,loadingKeys:Re,checkedKeys:ae,halfCheckedKeys:pe,dragOverNodeKey:Ne,dropPosition:Le,keyEntities:ie};return g.createElement(g.Fragment,null,he&&se&&g.createElement("span",{style:t,"aria-live":"assertive"},H(se)),g.createElement("div",null,g.createElement("input",{style:t,disabled:q===!1||Ie,tabIndex:q!==!1?V:null,onKeyDown:$,onFocus:re,onBlur:oe,value:"",onChange:c,"aria-label":"for screen reader"})),g.createElement("div",{className:"".concat(ve,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},g.createElement("div",{className:"".concat(ve,"-indent")},g.createElement("div",{ref:Ge,className:"".concat(ve,"-indent-unit")}))),g.createElement(A.a,Object(me.a)({},Ke,{data:Pt,itemKey:N,height:Ue,fullHeight:!1,virtual:Pe,itemHeight:Te,prefixCls:"".concat(ve,"-list"),ref:Xe,onVisibleChange:function(Dt,Nt){var jt=new Set(Dt),Ht=Nt.filter(function(Bt){return!jt.has(Bt)});Ht.some(function(Bt){return N(Bt)===b})&&Ct()}}),function(ht){var Dt=ht.pos,Nt=Object(me.a)({},(E(ht.data),ht.data)),jt=ht.title,Ht=ht.key,Bt=ht.isStart,gt=ht.isEnd,Et=Object(l.f)(Ht,Dt);delete Nt.key,delete Nt.children;var Kt=Object(l.g)(Et,kt);return g.createElement(v,Object(me.a)({},Nt,Kt,{title:jt,active:!!se&&Ht===se.key,pos:Dt,data:ht.data,isStart:Bt,isEnd:gt,motion:Ce,motionNodes:Ht===b?ut:null,motionType:Lt,onMotionStart:Me,onMotionEnd:Ct,treeNodeRequiredProps:kt,onMouseMove:function(){Se(null)}}))}))});z.displayName="NodeList";var J=z,Y=F("ju+a"),le=F("vqdp"),te=F("El5i"),Z=10,_e=function(Ee){Object(e.a)(ve,Ee);var xe=Object(k.a)(ve);function ve(){var X;Object(G.a)(this,ve);for(var Ae=arguments.length,Q=new Array(Ae),ue=0;ue<Ae;ue++)Q[ue]=arguments[ue];return X=xe.call.apply(xe,[this].concat(Q)),X.destroyed=!1,X.delayedDragEnterLogic=void 0,X.loadingRetryTimes={},X.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:Object(l.d)()},X.dragStartMousePosition=null,X.dragNode=void 0,X.currentMouseOverDroppableNodeKey=null,X.listRef=g.createRef(),X.onNodeDragStart=function(ee,ae){var fe=X.state,Re=fe.expandedKeys,pe=fe.keyEntities,ie=X.props.onDragStart,Ie=ae.props.eventKey;X.dragNode=ae,X.dragStartMousePosition={x:ee.clientX,y:ee.clientY};var Oe=Object(Y.b)(Re,Ie);X.setState({draggingNodeKey:Ie,dragChildrenKeys:Object(Y.f)(Ie,pe),indent:X.listRef.current.getIndentWidth()}),X.setExpandedKeys(Oe),window.addEventListener("dragend",X.onWindowDragEnd),ie==null||ie({event:ee,node:Object(l.b)(ae.props)})},X.onNodeDragEnter=function(ee,ae){var fe=X.state,Re=fe.expandedKeys,pe=fe.keyEntities,ie=fe.dragChildrenKeys,Ie=fe.flattenNodes,Oe=fe.indent,Ne=X.props,Le=Ne.onDragEnter,Ce=Ne.onExpand,Ue=Ne.allowDrop,Te=Ne.direction,Pe=ae.props,q=Pe.pos,se=Pe.eventKey,he=Object(W.a)(X),V=he.dragNode;if(X.currentMouseOverDroppableNodeKey!==se&&(X.currentMouseOverDroppableNodeKey=se),!V){X.resetDragState();return}var $=Object(Y.c)(ee,V,ae,Oe,X.dragStartMousePosition,Ue,Ie,pe,Re,Te),re=$.dropPosition,oe=$.dropLevelOffset,Se=$.dropTargetKey,Me=$.dropContainerKey,Be=$.dropTargetPos,Ke=$.dropAllowed,Xe=$.dragOverNodeKey;if(ie.indexOf(Se)!==-1||!Ke){X.resetDragState();return}if(X.delayedDragEnterLogic||(X.delayedDragEnterLogic={}),Object.keys(X.delayedDragEnterLogic).forEach(function(Ge){clearTimeout(X.delayedDragEnterLogic[Ge])}),V.props.eventKey!==ae.props.eventKey&&(ee.persist(),X.delayedDragEnterLogic[q]=window.setTimeout(function(){if(X.state.draggingNodeKey===null)return;var Ge=Object(ne.a)(Re),rt=Object(te.a)(pe,ae.props.eventKey);rt&&(rt.children||[]).length&&(Ge=Object(Y.a)(Re,ae.props.eventKey)),"expandedKeys"in X.props||X.setExpandedKeys(Ge),Ce==null||Ce(Ge,{node:Object(l.b)(ae.props),expanded:!0,nativeEvent:ee.nativeEvent})},800)),V.props.eventKey===Se&&oe===0){X.resetDragState();return}X.setState({dragOverNodeKey:Xe,dropPosition:re,dropLevelOffset:oe,dropTargetKey:Se,dropContainerKey:Me,dropTargetPos:Be,dropAllowed:Ke}),Le==null||Le({event:ee,node:Object(l.b)(ae.props),expandedKeys:Re})},X.onNodeDragOver=function(ee,ae){var fe=X.state,Re=fe.dragChildrenKeys,pe=fe.flattenNodes,ie=fe.keyEntities,Ie=fe.expandedKeys,Oe=fe.indent,Ne=X.props,Le=Ne.onDragOver,Ce=Ne.allowDrop,Ue=Ne.direction,Te=Object(W.a)(X),Pe=Te.dragNode;if(!Pe)return;var q=Object(Y.c)(ee,Pe,ae,Oe,X.dragStartMousePosition,Ce,pe,ie,Ie,Ue),se=q.dropPosition,he=q.dropLevelOffset,V=q.dropTargetKey,$=q.dropContainerKey,re=q.dropAllowed,oe=q.dropTargetPos,Se=q.dragOverNodeKey;if(Re.indexOf(V)!==-1||!re)return;Pe.props.eventKey===V&&he===0?X.state.dropPosition===null&&X.state.dropLevelOffset===null&&X.state.dropTargetKey===null&&X.state.dropContainerKey===null&&X.state.dropTargetPos===null&&X.state.dropAllowed===!1&&X.state.dragOverNodeKey===null||X.resetDragState():se===X.state.dropPosition&&he===X.state.dropLevelOffset&&V===X.state.dropTargetKey&&$===X.state.dropContainerKey&&oe===X.state.dropTargetPos&&re===X.state.dropAllowed&&Se===X.state.dragOverNodeKey||X.setState({dropPosition:se,dropLevelOffset:he,dropTargetKey:V,dropContainerKey:$,dropTargetPos:oe,dropAllowed:re,dragOverNodeKey:Se}),Le==null||Le({event:ee,node:Object(l.b)(ae.props)})},X.onNodeDragLeave=function(ee,ae){X.currentMouseOverDroppableNodeKey===ae.props.eventKey&&!ee.currentTarget.contains(ee.relatedTarget)&&(X.resetDragState(),X.currentMouseOverDroppableNodeKey=null);var fe=X.props.onDragLeave;fe==null||fe({event:ee,node:Object(l.b)(ae.props)})},X.onWindowDragEnd=function(ee){X.onNodeDragEnd(ee,null,!0),window.removeEventListener("dragend",X.onWindowDragEnd)},X.onNodeDragEnd=function(ee,ae){var fe=X.props.onDragEnd;X.setState({dragOverNodeKey:null}),X.cleanDragState(),fe==null||fe({event:ee,node:Object(l.b)(ae.props)}),X.dragNode=null,window.removeEventListener("dragend",X.onWindowDragEnd)},X.onNodeDrop=function(ee,ae){var fe,Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,pe=X.state,ie=pe.dragChildrenKeys,Ie=pe.dropPosition,Oe=pe.dropTargetKey,Ne=pe.dropTargetPos,Le=pe.dropAllowed;if(!Le)return;var Ce=X.props.onDrop;if(X.setState({dragOverNodeKey:null}),X.cleanDragState(),Oe===null)return;var Ue=Object(ge.a)(Object(ge.a)({},Object(l.g)(Oe,X.getTreeNodeRequiredProps())),{},{active:((fe=X.getActiveItem())===null||fe===void 0?void 0:fe.key)===Oe,data:Object(te.a)(X.state.keyEntities,Oe).node}),Te=ie.indexOf(Oe)!==-1;Object(i.a)(!Te,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Pe=Object(Y.h)(Ne),q={event:ee,node:Object(l.b)(Ue),dragNode:X.dragNode?Object(l.b)(X.dragNode.props):null,dragNodesKeys:[X.dragNode.props.eventKey].concat(ie),dropToGap:Ie!==0,dropPosition:Ie+Number(Pe[Pe.length-1])};Re||(Ce==null||Ce(q)),X.dragNode=null},X.cleanDragState=function(){var ee=X.state.draggingNodeKey;ee!==null&&X.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),X.dragStartMousePosition=null,X.currentMouseOverDroppableNodeKey=null},X.triggerExpandActionExpand=function(ee,ae){var fe=X.state,Re=fe.expandedKeys,pe=fe.flattenNodes,ie=ae.expanded,Ie=ae.key,Oe=ae.isLeaf;if(Oe||ee.shiftKey||ee.metaKey||ee.ctrlKey)return;var Ne=pe.filter(function(Ce){return Ce.key===Ie})[0],Le=Object(l.b)(Object(ge.a)(Object(ge.a)({},Object(l.g)(Ie,X.getTreeNodeRequiredProps())),{},{data:Ne.data}));X.setExpandedKeys(ie?Object(Y.b)(Re,Ie):Object(Y.a)(Re,Ie)),X.onNodeExpand(ee,Le)},X.onNodeClick=function(ee,ae){var fe=X.props,Re=fe.onClick,pe=fe.expandAction;pe==="click"&&X.triggerExpandActionExpand(ee,ae),Re==null||Re(ee,ae)},X.onNodeDoubleClick=function(ee,ae){var fe=X.props,Re=fe.onDoubleClick,pe=fe.expandAction;pe==="doubleClick"&&X.triggerExpandActionExpand(ee,ae),Re==null||Re(ee,ae)},X.onNodeSelect=function(ee,ae){var fe=X.state.selectedKeys,Re=X.state,pe=Re.keyEntities,ie=Re.fieldNames,Ie=X.props,Oe=Ie.onSelect,Ne=Ie.multiple,Le=ae.selected,Ce=ae[ie.key],Ue=!Le;Ue?Ne?fe=Object(Y.a)(fe,Ce):fe=[Ce]:fe=Object(Y.b)(fe,Ce);var Te=fe.map(function(Pe){var q=Object(te.a)(pe,Pe);return q?q.node:null}).filter(function(Pe){return Pe});X.setUncontrolledState({selectedKeys:fe}),Oe==null||Oe(fe,{event:"select",selected:Ue,node:ae,selectedNodes:Te,nativeEvent:ee.nativeEvent})},X.onNodeCheck=function(ee,ae,fe){var Re=X.state,pe=Re.keyEntities,ie=Re.checkedKeys,Ie=Re.halfCheckedKeys,Oe=X.props,Ne=Oe.checkStrictly,Le=Oe.onCheck,Ce=ae.key,Ue,Te={event:"check",node:ae,checked:fe,nativeEvent:ee.nativeEvent};if(Ne){var Pe=fe?Object(Y.a)(ie,Ce):Object(Y.b)(ie,Ce),q=Object(Y.b)(Ie,Ce);Ue={checked:Pe,halfChecked:q},Te.checkedNodes=Pe.map(function(oe){return Object(te.a)(pe,oe)}).filter(function(oe){return oe}).map(function(oe){return oe.node}),X.setUncontrolledState({checkedKeys:Pe})}else{var se=Object(le.a)([].concat(Object(ne.a)(ie),[Ce]),!0,pe),he=se.checkedKeys,V=se.halfCheckedKeys;if(!fe){var $=new Set(he);$.delete(Ce);var re=Object(le.a)(Array.from($),{checked:!1,halfCheckedKeys:V},pe);he=re.checkedKeys,V=re.halfCheckedKeys}Ue=he,Te.checkedNodes=[],Te.checkedNodesPositions=[],Te.halfCheckedKeys=V,he.forEach(function(oe){var Se=Object(te.a)(pe,oe);if(!Se)return;var Me=Se.node,Be=Se.pos;Te.checkedNodes.push(Me),Te.checkedNodesPositions.push({node:Me,pos:Be})}),X.setUncontrolledState({checkedKeys:he},!1,{halfCheckedKeys:V})}Le==null||Le(Ue,Te)},X.onNodeLoad=function(ee){var ae=ee.key,fe=new Promise(function(Re,pe){X.setState(function(ie){var Ie=ie.loadedKeys,Oe=Ie===void 0?[]:Ie,Ne=ie.loadingKeys,Le=Ne===void 0?[]:Ne,Ce=X.props,Ue=Ce.loadData,Te=Ce.onLoad;if(!Ue||Oe.indexOf(ae)!==-1||Le.indexOf(ae)!==-1)return null;var Pe=Ue(ee);return Pe.then(function(){var q=X.state.loadedKeys,se=Object(Y.a)(q,ae);Te==null||Te(se,{event:"load",node:ee}),X.setUncontrolledState({loadedKeys:se}),X.setState(function(he){return{loadingKeys:Object(Y.b)(he.loadingKeys,ae)}}),Re()}).catch(function(q){if(X.setState(function(he){return{loadingKeys:Object(Y.b)(he.loadingKeys,ae)}}),X.loadingRetryTimes[ae]=(X.loadingRetryTimes[ae]||0)+1,X.loadingRetryTimes[ae]>=Z){var se=X.state.loadedKeys;Object(i.a)(!1,"Retry for `loadData` many times but still failed. No more retry."),X.setUncontrolledState({loadedKeys:Object(Y.a)(se,ae)}),Re()}pe(q)}),{loadingKeys:Object(Y.a)(Le,ae)}})});return fe.catch(function(){}),fe},X.onNodeMouseEnter=function(ee,ae){var fe=X.props.onMouseEnter;fe==null||fe({event:ee,node:ae})},X.onNodeMouseLeave=function(ee,ae){var fe=X.props.onMouseLeave;fe==null||fe({event:ee,node:ae})},X.onNodeContextMenu=function(ee,ae){var fe=X.props.onRightClick;fe&&(ee.preventDefault(),fe({event:ee,node:ae}))},X.onFocus=function(){var ee=X.props.onFocus;X.setState({focused:!0});for(var ae=arguments.length,fe=new Array(ae),Re=0;Re<ae;Re++)fe[Re]=arguments[Re];ee==null||ee.apply(void 0,fe)},X.onBlur=function(){var ee=X.props.onBlur;X.setState({focused:!1}),X.onActiveChange(null);for(var ae=arguments.length,fe=new Array(ae),Re=0;Re<ae;Re++)fe[Re]=arguments[Re];ee==null||ee.apply(void 0,fe)},X.getTreeNodeRequiredProps=function(){var ee=X.state,ae=ee.expandedKeys,fe=ee.selectedKeys,Re=ee.loadedKeys,pe=ee.loadingKeys,ie=ee.checkedKeys,Ie=ee.halfCheckedKeys,Oe=ee.dragOverNodeKey,Ne=ee.dropPosition,Le=ee.keyEntities;return{expandedKeys:ae||[],selectedKeys:fe||[],loadedKeys:Re||[],loadingKeys:pe||[],checkedKeys:ie||[],halfCheckedKeys:Ie||[],dragOverNodeKey:Oe,dropPosition:Ne,keyEntities:Le}},X.setExpandedKeys=function(ee){var ae=X.state,fe=ae.treeData,Re=ae.fieldNames,pe=Object(l.e)(fe,ee,Re);X.setUncontrolledState({expandedKeys:ee,flattenNodes:pe},!0)},X.onNodeExpand=function(ee,ae){var fe=X.state.expandedKeys,Re=X.state,pe=Re.listChanging,ie=Re.fieldNames,Ie=X.props,Oe=Ie.onExpand,Ne=Ie.loadData,Le=ae.expanded,Ce=ae[ie.key];if(pe)return;var Ue=fe.indexOf(Ce),Te=!Le;if(Object(i.a)(Le&&Ue!==-1||!Le&&Ue===-1,"Expand state not sync with index check"),Te?fe=Object(Y.a)(fe,Ce):fe=Object(Y.b)(fe,Ce),X.setExpandedKeys(fe),Oe==null||Oe(fe,{node:ae,expanded:Te,nativeEvent:ee.nativeEvent}),Te&&Ne){var Pe=X.onNodeLoad(ae);Pe&&Pe.then(function(){var q=Object(l.e)(X.state.treeData,fe,ie);X.setUncontrolledState({flattenNodes:q})}).catch(function(){var q=X.state.expandedKeys,se=Object(Y.b)(q,Ce);X.setExpandedKeys(se)})}},X.onListChangeStart=function(){X.setUncontrolledState({listChanging:!0})},X.onListChangeEnd=function(){setTimeout(function(){X.setUncontrolledState({listChanging:!1})})},X.onActiveChange=function(ee){var ae=X.state.activeKey,fe=X.props.onActiveChange;if(ae===ee)return;X.setState({activeKey:ee}),ee!==null&&X.scrollTo({key:ee}),fe==null||fe(ee)},X.getActiveItem=function(){var ee=X.state,ae=ee.activeKey,fe=ee.flattenNodes;return ae===null?null:fe.find(function(Re){var pe=Re.key;return pe===ae})||null},X.offsetActiveKey=function(ee){var ae=X.state,fe=ae.flattenNodes,Re=ae.activeKey,pe=fe.findIndex(function(Oe){var Ne=Oe.key;return Ne===Re});pe===-1&&ee<0&&(pe=fe.length),pe=(pe+ee+fe.length)%fe.length;var ie=fe[pe];if(ie){var Ie=ie.key;X.onActiveChange(Ie)}else X.onActiveChange(null)},X.onKeyDown=function(ee){var ae=X.state,fe=ae.activeKey,Re=ae.expandedKeys,pe=ae.checkedKeys,ie=ae.fieldNames,Ie=X.props,Oe=Ie.onKeyDown,Ne=Ie.checkable,Le=Ie.selectable;switch(ee.which){case u.a.UP:{X.offsetActiveKey(-1),ee.preventDefault();break}case u.a.DOWN:{X.offsetActiveKey(1),ee.preventDefault();break}}var Ce=X.getActiveItem();if(Ce&&Ce.data){var Ue=X.getTreeNodeRequiredProps(),Te=Ce.data.isLeaf===!1||!!(Ce.data[ie.children]||[]).length,Pe=Object(l.b)(Object(ge.a)(Object(ge.a)({},Object(l.g)(fe,Ue)),{},{data:Ce.data,active:!0}));switch(ee.which){case u.a.LEFT:{Te&&Re.includes(fe)?X.onNodeExpand({},Pe):Ce.parent&&X.onActiveChange(Ce.parent.key),ee.preventDefault();break}case u.a.RIGHT:{Te&&!Re.includes(fe)?X.onNodeExpand({},Pe):Ce.children&&Ce.children.length&&X.onActiveChange(Ce.children[0].key),ee.preventDefault();break}case u.a.ENTER:case u.a.SPACE:{Ne&&!Pe.disabled&&Pe.checkable!==!1&&!Pe.disableCheckbox?X.onNodeCheck({},Pe,!pe.includes(fe)):!Ne&&Le&&!Pe.disabled&&Pe.selectable!==!1&&X.onNodeSelect({},Pe);break}}}Oe==null||Oe(ee)},X.setUncontrolledState=function(ee){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!X.destroyed){var Re=!1,pe=!0,ie={};Object.keys(ee).forEach(function(Ie){if(Ie in X.props){pe=!1;return}Re=!0,ie[Ie]=ee[Ie]}),Re&&(!ae||pe)&&X.setState(Object(ge.a)(Object(ge.a)({},ie),fe))}},X.scrollTo=function(ee){X.listRef.current.scrollTo(ee)},X}return Object(O.a)(ve,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var Ae=this.props.activeKey;Ae!==void 0&&Ae!==this.state.activeKey&&(this.setState({activeKey:Ae}),Ae!==null&&this.scrollTo({key:Ae}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var Ae,Q=this.state,ue=Q.focused,ee=Q.flattenNodes,ae=Q.keyEntities,fe=Q.draggingNodeKey,Re=Q.activeKey,pe=Q.dropLevelOffset,ie=Q.dropContainerKey,Ie=Q.dropTargetKey,Oe=Q.dropPosition,Ne=Q.dragOverNodeKey,Le=Q.indent,Ce=this.props,Ue=Ce.prefixCls,Te=Ce.className,Pe=Ce.style,q=Ce.showLine,se=Ce.focusable,he=Ce.tabIndex,V=he===void 0?0:he,$=Ce.selectable,re=Ce.showIcon,oe=Ce.icon,Se=Ce.switcherIcon,Me=Ce.draggable,Be=Ce.checkable,Ke=Ce.checkStrictly,Xe=Ce.disabled,Ge=Ce.motion,rt=Ce.loadData,qe=Ce.filterTreeNode,Ve=Ce.height,at=Ce.itemHeight,Qe=Ce.virtual,$e=Ce.titleRender,nt=Ce.dropIndicatorRender,Ye=Ce.onContextMenu,st=Ce.onScroll,Tt=Ce.direction,wt=Ce.rootClassName,xt=Ce.rootStyle,je=Object(m.a)(this.props,{aria:!0,data:!0}),Ze;return Me&&(Object(ye.a)(Me)==="object"?Ze=Me:typeof Me=="function"?Ze={nodeDraggable:Me}:Ze={}),g.createElement(w.a.Provider,{value:{prefixCls:Ue,selectable:$,showIcon:re,icon:oe,switcherIcon:Se,draggable:Ze,draggingNodeKey:fe,checkable:Be,checkStrictly:Ke,disabled:Xe,keyEntities:ae,dropLevelOffset:pe,dropContainerKey:ie,dropTargetKey:Ie,dropPosition:Oe,dragOverNodeKey:Ne,indent:Le,direction:Tt,dropIndicatorRender:nt,loadData:rt,filterTreeNode:qe,titleRender:$e,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},g.createElement("div",{role:"tree",className:I()(Ue,Te,wt,(Ae={},Object(be.a)(Ae,"".concat(Ue,"-show-line"),q),Object(be.a)(Ae,"".concat(Ue,"-focused"),ue),Object(be.a)(Ae,"".concat(Ue,"-active-focused"),Re!==null),Ae)),style:xt},g.createElement(J,Object(me.a)({ref:this.listRef,prefixCls:Ue,style:Pe,data:ee,disabled:Xe,selectable:$,checkable:!!Be,motion:Ge,dragging:fe!==null,height:Ve,itemHeight:at,virtual:Qe,focusable:se,focused:ue,tabIndex:V,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Ye,onScroll:st},this.getTreeNodeRequiredProps(),je))))}}],[{key:"getDerivedStateFromProps",value:function(Ae,Q){var ue=Q.prevProps,ee={prevProps:Ae};function ae(se){return!ue&&se in Ae||ue&&ue[se]!==Ae[se]}var fe,Re=Q.fieldNames;if(ae("fieldNames")&&(Re=Object(l.d)(Ae.fieldNames),ee.fieldNames=Re),ae("treeData")?fe=Ae.treeData:ae("children")&&(Object(i.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),fe=Object(l.c)(Ae.children)),fe){ee.treeData=fe;var pe=Object(l.a)(fe,{fieldNames:Re});ee.keyEntities=Object(ge.a)(Object(be.a)({},b,D),pe.keyEntities)}var ie=ee.keyEntities||Q.keyEntities;if(ae("expandedKeys")||ue&&ae("autoExpandParent"))ee.expandedKeys=Ae.autoExpandParent||!ue&&Ae.defaultExpandParent?Object(Y.e)(Ae.expandedKeys,ie):Ae.expandedKeys;else if(!ue&&Ae.defaultExpandAll){var Ie=Object(ge.a)({},ie);delete Ie[b],ee.expandedKeys=Object.keys(Ie).map(function(se){return Ie[se].key})}else!ue&&Ae.defaultExpandedKeys&&(ee.expandedKeys=Ae.autoExpandParent||Ae.defaultExpandParent?Object(Y.e)(Ae.defaultExpandedKeys,ie):Ae.defaultExpandedKeys);if(ee.expandedKeys||delete ee.expandedKeys,fe||ee.expandedKeys){var Oe=Object(l.e)(fe||Q.treeData,ee.expandedKeys||Q.expandedKeys,Re);ee.flattenNodes=Oe}if(Ae.selectable&&(ae("selectedKeys")?ee.selectedKeys=Object(Y.d)(Ae.selectedKeys,Ae):!ue&&Ae.defaultSelectedKeys&&(ee.selectedKeys=Object(Y.d)(Ae.defaultSelectedKeys,Ae))),Ae.checkable){var Ne;if(ae("checkedKeys")?Ne=Object(Y.g)(Ae.checkedKeys)||{}:!ue&&Ae.defaultCheckedKeys?Ne=Object(Y.g)(Ae.defaultCheckedKeys)||{}:fe&&(Ne=Object(Y.g)(Ae.checkedKeys)||{checkedKeys:Q.checkedKeys,halfCheckedKeys:Q.halfCheckedKeys}),Ne){var Le=Ne,Ce=Le.checkedKeys,Ue=Ce===void 0?[]:Ce,Te=Le.halfCheckedKeys,Pe=Te===void 0?[]:Te;if(!Ae.checkStrictly){var q=Object(le.a)(Ue,!0,ie);Ue=q.checkedKeys,Pe=q.halfCheckedKeys}ee.checkedKeys=Ue,ee.halfCheckedKeys=Pe}}return ae("loadedKeys")&&(ee.loadedKeys=Ae.loadedKeys),ee}}]),ve}(g.Component);_e.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:x,allowDrop:function(){return!0},expandAction:!1},_e.TreeNode=p.a;var we=_e,De=ce.b=we},a3WO:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(be,ye){(ye==null||ye>be.length)&&(ye=be.length);for(var ge=0,ne=new Array(ye);ge<ye;ge++)ne[ge]=be[ge];return ne}},b3aT:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me}),F.d(ce,"b",function(){return ne}),F.d(ce,"c",function(){return G}),F.d(ce,"d",function(){return O});function me(W,e){ye(W)&&(W="100%");var k=ge(W);return W=e===360?W:Math.min(e,Math.max(0,parseFloat(W))),k&&(W=parseInt(String(W*e),10)/100),Math.abs(W-e)<1e-6?1:(e===360?W=(W<0?W%e+e:W%e)/parseFloat(String(e)):W=W%e/parseFloat(String(e)),W)}function be(W){return Math.min(1,Math.max(0,W))}function ye(W){return typeof W=="string"&&W.indexOf(".")!==-1&&parseFloat(W)===1}function ge(W){return typeof W=="string"&&W.indexOf("%")!==-1}function ne(W){return W=parseFloat(W),(isNaN(W)||W<0||W>1)&&(W=1),W}function G(W){return W<=1?"".concat(Number(W)*100,"%"):W}function O(W){return W.length===1?"0"+W:String(W)}},c27x:function(We,ce,F){"use strict";F.d(ce,"a",function(){return ye});var me=F("T/Jt"),be=F.n(me),ye=me.createContext(null)},d5o6:function(We,ce,F){We.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},fjLI:function(We,ce,F){"use strict";F.d(ce,"f",function(){return u}),F.d(ce,"b",function(){return m}),F.d(ce,"a",function(){return i}),F.d(ce,"d",function(){return g}),F.d(ce,"e",function(){return w}),F.d(ce,"c",function(){return x});var me=F("8HAY"),be=F("Vhoy"),ye=F("MI8n"),ge=F("JYp7"),ne=F("pmY6"),G=F("24hK"),O=F("nnTU"),W=F("T8No"),e=F("Cg/j"),k=F("t9D7"),L=function(E,o,f,d){var A=arguments.length,s=A<3?o:d===null?d=Object.getOwnPropertyDescriptor(o,f):d,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(E,o,f,d);else for(var C=E.length-1;C>=0;C--)(p=E[C])&&(s=(A<3?p(s):A>3?p(o,f,s):p(o,f))||s);return A>3&&s&&Object.defineProperty(o,f,s),s},I=function(E,o){return function(f,d){o(f,d,E)}};function u(E){return E.command!==void 0}class m{constructor(E){this.id=m._idPool++,this._debugName=E}}m._idPool=0,m.CommandPalette=new m("CommandPalette"),m.EditorContext=new m("EditorContext"),m.SimpleEditorContext=new m("SimpleEditorContext"),m.EditorContextCopy=new m("EditorContextCopy"),m.EditorContextPeek=new m("EditorContextPeek"),m.MenubarEditMenu=new m("MenubarEditMenu"),m.MenubarCopy=new m("MenubarCopy"),m.MenubarGoMenu=new m("MenubarGoMenu"),m.MenubarSelectionMenu=new m("MenubarSelectionMenu"),m.InlineCompletionsActions=new m("InlineCompletionsActions");const i=Object(e.c)("menuService"),g=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ye.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:E=>E===m.CommandPalette}}addCommand(E){return this.addCommands(ge.a.single(E))}addCommands(E){for(const o of E)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(ne.i)(()=>{let o=!1;for(const f of E)o=this._commands.delete(f.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(E){return this._commands.get(E)}getCommands(){const E=new Map;return this._commands.forEach((o,f)=>E.set(f,o)),E}appendMenuItem(E,o){return this.appendMenuItems(ge.a.single({id:E,item:o}))}appendMenuItems(E){const o=new Set,f=new G.a;for(const{id:d,item:A}of E){let s=this._menuItems.get(d);s||(s=new G.a,this._menuItems.set(d,s)),f.push(s.push(A)),o.add(d)}return this._onDidChangeMenu.fire(o),Object(ne.i)(()=>{if(f.size>0){for(let d of f)d();this._onDidChangeMenu.fire(o),f.clear()}})}getMenuItems(E){let o;return this._menuItems.has(E)?o=[...this._menuItems.get(E)]:o=[],E===m.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(E){const o=new Set;for(const f of E)u(f)&&(o.add(f.command.id),f.alt&&o.add(f.alt.id));this._commands.forEach((f,d)=>{o.has(d)||E.push({command:f})})}};class w extends me.e{constructor(E,o,f,d){super(`submenuitem.${E.submenu.id}`,typeof E.title=="string"?E.title:E.title.value,[],"submenu");this.item=E,this._menuService=o,this._contextKeyService=f,this._options=d}get actions(){const E=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),f=o.getActions(this._options);o.dispose();for(const[,d]of f)d.length>0&&(E.push(...d),E.push(new me.d));return E.length&&E.pop(),E}}let x=class E{constructor(o,f,d,A,s){var p,C;if(this._commandService=s,this.id=o.id,this.label=(d==null?void 0:d.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(C=typeof o.tooltip=="string"?o.tooltip:(p=o.tooltip)===null||p===void 0?void 0:p.value)!==null&&C!==void 0?C:"",this.enabled=!o.precondition||A.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const l=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=A.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}this.item=o,this.alt=f?new E(f,void 0,d,A,s):void 0,this._options=d,k.d.isThemeIcon(o.icon)&&(this.class=be.a.asClassName(o.icon))}dispose(){}run(...o){var f,d;let A=[];return((f=this._options)===null||f===void 0?void 0:f.arg)&&(A=[...A,this._options.arg]),((d=this._options)===null||d===void 0?void 0:d.shouldForwardArgs)&&(A=[...A,...o]),this._commandService.executeCommand(this.id,...A)}};x=L([I(3,W.b),I(4,O.b)],x)},ic2d:function(We,ce,F){"use strict";F.d(ce,"a",function(){return ge});var me=F("FWmy"),be=F("746U");class ye{constructor(){this.data=new Map}add(ne,G){me.a(be.l(ne)),me.a(be.k(G)),me.a(!this.data.has(ne),"There is already an extension with this id"),this.data.set(ne,G)}as(ne){return this.data.get(ne)||null}}const ge=new ye},iris:function(We,ce,F){"use strict";F.d(ce,"a",function(){return u});var me=F("tbnd"),be=F("5KI5"),ye=F("dX86"),ge=F("GwPp"),ne=F("Hqw+"),G=F("T/Jt"),O=F.n(G),W=F("Q0Vu"),e=F.n(W),k=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],L=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],I=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],u=function(i){var g=i.showSelectAll,w=g===void 0?!1:g,x=i.disciplinesData,E=x===void 0?[]:x,o=i.knowledgeData,f=o===void 0?[]:o,d=i.directionValue,A=i.subDisciplineValue,s=i.typeValue,p=i.knowledgeValue,C=i.showKnowledge,l=C===void 0?!1:C,T=i.showRandomType,y=T===void 0?!1:T,_=i.difficultyValue,v=i.randomValue,n=i.selectAll,a=i.languagesvalue,r=i.className,t=i.languages,c=t===void 0?[]:t,b=i.isprogram_homework,h=i.showShixun,D=h===void 0?!1:h,P=i.showItemType,j=P===void 0?!0:P,N=i.onShixunChange,H=N===void 0?function(){}:N,z=i.onDirectionChange,J=z===void 0?function(){}:z,Y=i.onTypeChange,le=Y===void 0?function(){}:Y,te=i.onDifficultyChange,Z=te===void 0?function(){}:te,_e=i.handlelanguagesChange,we=_e===void 0?function(){}:_e,De=i.onKnowledgeChange,Ee=De===void 0?function(){}:De,xe=i.onRandomChange,ve=xe===void 0?function(){}:xe,X=i.showTeachGroup,Ae=X===void 0?!1:X,Q=i.teachGroupData,ue=Q===void 0?[]:Q,ee=i.onTeachGroupChange,ae=ee===void 0?function(){}:ee,fe=i.teachGroupValue,Re=Object(G.useState)(0),pe=Object(ne.a)(Re,2),ie=pe[0],Ie=pe[1],Oe=Object(G.useRef)(null),Ne=Object(G.useState)(0),Le=Object(ne.a)(Ne,2),Ce=Le[0],Ue=Le[1],Te=Object(G.useRef)(null);Object(G.useEffect)(function(){if(E.length!==0){var q;(Oe==null||((q=Oe.current)===null||q===void 0)?void 0:q.clientHeight)>108?Ie(1):Ie(0)}E.length===0&&Ie(0)},[E]),Object(G.useEffect)(function(){if(console.log(f.length===0,"\u6570\u91CF"),f.length!==0){var q,se;console.log(Te==null||((q=Te.current)===null||q===void 0)?void 0:q.clientHeight,"\u9AD8\u5EA6"),(Te==null||((se=Te.current)===null||se===void 0)?void 0:se.clientHeight)>108?Ue(1):Ue(0)}f.length===0&&Ue(0)},[f]);var Pe=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],he=arguments.length>1?arguments[1]:void 0;return O.a.createElement(ge.a,{className:e.a.subMenu},se.map(function(V){return O.a.createElement(ge.a.Item,{key:V.id},O.a.createElement("a",{className:"".concat(e.a.subItem," ").concat(A===V.id?e.a.subActive:""),onClick:function(){return J(he,V.id)}},V.name))}))};return O.a.createElement("aside",{className:r?"".concat(e.a.main," ").concat(r):e.a.main},O.a.createElement("div",{className:e.a.wrap},b&&O.a.createElement("div",{className:e.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ae&&O.a.createElement("div",{className:e.a.content},O.a.createElement("span",{className:e.a.name},"\u56E2\u961F"),O.a.createElement("div",{className:e.a.directionContentWrap},O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(fe?"":e.a.active," "),onClick:function(){return ae(null)}},"\u5168\u90E8"),ue==null?void 0:ue.map(function(q){return O.a.createElement("li",{key:q.group_id,className:"".concat(e.a.directionItem," ").concat(fe===q.group_id?e.a.active:""," "),onClick:function(){return ae(q.group_id)}},q.name)}))),O.a.createElement("div",{className:e.a.content},O.a.createElement("span",{className:e.a.name},"\u65B9\u5411"),O.a.createElement("span",null),O.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:ie===1?88:"auto"}},O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(d?"":e.a.active," "),onClick:function(){return J(null)}},"\u5168\u90E8"),E.map(function(q){var se;return O.a.createElement(O.a.Fragment,{key:q.id},((se=q.sub_disciplines)===null||se===void 0?void 0:se.length)>0?O.a.createElement(be.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(V){return V.parentNode},overlay:function(){return Pe(q.sub_disciplines,q.id)}},O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(d===q.id?e.a.active:""," "),onClick:function(){return J(q.id)}},q.name)):O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(d===q.id?e.a.active:""," "),onClick:function(){return J(q.id)}},q.name))})),O.a.createElement("div",{className:e.a.directionContentWrap,ref:Oe,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},E.map(function(q){var se;return O.a.createElement(O.a.Fragment,{key:q.id},((se=q.sub_disciplines)===null||se===void 0?void 0:se.length)>0?O.a.createElement(be.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(V){return V.parentNode},overlay:function(){return Pe(q.sub_disciplines,q.id)}},O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(d===q.id?e.a.active:""," "),onClick:function(){return J(q.id)}},q.name)):O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(d===q.id?e.a.active:""," "),onClick:function(){return J(q.id)}},q.name))})),!!ie&&O.a.createElement("div",{className:e.a.action},ie===1&&O.a.createElement("span",{onClick:function(){return Ie(2)}},"\u5C55\u5F00",O.a.createElement("i",{className:"iconfont icon-xiala"})),ie===2&&O.a.createElement("span",{onClick:function(){return Ie(1)}},"\u6536\u8D77",O.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),l&&O.a.createElement("div",{className:e.a.content},O.a.createElement("span",{className:e.a.name},"\u77E5\u8BC6\u70B9"),O.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Ce===1?106:"auto"}},O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===-1?e.a.active:""," "),onClick:function(){return Ee(-1)}},"\u5168\u90E8"),f.map(function(q){return O.a.createElement("li",{key:q.id,className:"".concat(e.a.directionItem," ").concat(p===q.id?e.a.active:""," "),onClick:function(){return Ee(q.id)}},q.name)})),O.a.createElement("div",{ref:Te,className:e.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},f.map(function(q){return O.a.createElement("li",{key:q.id,className:"".concat(e.a.directionItem," ").concat(p===q.id?e.a.active:""," "),onClick:function(){return Ee(q.id)}},q.name)})),!!Ce&&O.a.createElement("div",{className:e.a.action},Ce===1&&O.a.createElement("span",{onClick:function(){return Ue(2)}},"\u5C55\u5F00",O.a.createElement("i",{className:"iconfont icon-xiala"})),Ce===2&&O.a.createElement("span",{onClick:function(){return Ue(1)}},"\u6536\u8D77",O.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),j&&!b&&O.a.createElement("div",{className:e.a.content},O.a.createElement("span",{className:e.a.name},"\u9898\u578B"),O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(s?"":e.a.active," "),onClick:function(){return le(null)}},"\u5168\u90E8"),O.a.createElement("div",{className:e.a.directionContentWrap},k.map(function(q){return O.a.createElement("li",{key:q.name,className:"".concat(e.a.directionItem," ").concat(s===q.value?e.a.active:""," "),onClick:function(){return le(q.value)}},q.name)}),D&&O.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:e.a.directionItem,onClick:function(){return H()}},"\u5B9E\u8BAD\u9898"))),O.a.createElement("div",{className:e.a.content},O.a.createElement("span",{className:e.a.name},"\u96BE\u5EA6"),O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(_?"":e.a.active," "),onClick:function(){return Z(null)}},"\u5168\u90E8"),O.a.createElement("div",{className:e.a.directionContentWrap},L.map(function(q){return O.a.createElement("li",{key:q.name,className:"".concat(e.a.directionItem," ").concat(_===q.value?e.a.active:""," "),onClick:function(){return Z(q.value)}},q.name)}))),y&&O.a.createElement("div",{className:e.a.content},O.a.createElement("span",{className:e.a.name},"\u7C7B\u578B"),O.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(v?"":e.a.active," "),onClick:function(){return ve(null)}},"\u5168\u90E8"),O.a.createElement("div",{className:e.a.directionContentWrap},I.map(function(q){return O.a.createElement("li",{key:q.name,className:"".concat(e.a.directionItem," ").concat(v===q.value?e.a.active:""," "),onClick:function(){return ve(q.value)}},q.name)})))))}},jcZT:function(We,ce,F){"use strict";var me=F("c3Iv"),be=F("rBQ5"),ye=F("47JS"),ge=F("TOZL"),ne=F("8OG5"),G=F("mgsT"),O=F("IYef"),W=F("Hqw+"),e=F("XXmO"),k=F.n(e),L=F("T/Jt"),I=F.n(L),u=F("d5o6"),m=F.n(u),i=F("P/tu"),g=F("WCUW"),w=F("9kvl"),x=function(o){var f=o.problemset,d=o.dispatch,A=o.onOk,s=Object(L.useState)(""),p=Object(W.a)(s,2),C=p[0],l=p[1],T=Object(L.useState)([0]),y=Object(W.a)(T,2),_=y[0],v=y[1],n=function(){d({type:"problemset/setActionTabs",payload:{}})};Object(L.useEffect)(function(){if(f.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var r,t;v([(r=f.actionTabs)===null||r===void 0||((t=r.params)===null||t===void 0)?void 0:t.group_id]),l("")}},[f.actionTabs.key]);var a=function(){var r=Object(O.a)(k.a.mark(function t(){var c,b,h;return k.a.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(c=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],C.trim()){P.next=4;break}return G.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),P.abrupt("return");case 4:if(!(C.charAt(0)===" ")){P.next=7;break}return G.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),P.abrupt("return");case 7:b=0;case 8:if(!(b<C.length)){P.next=15;break}if(!c.includes(C.charAt(b))){P.next=12;break}return G.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),P.abrupt("return",!1);case 12:b++,P.next=8;break;case 15:return P.next=17,Object(g.p)({parent_id:_.length>0?_[0]:0,name:C});case 17:h=P.sent,h.status===0&&(n(),A(h==null?void 0:h.id));case 19:case"end":return P.stop()}},t)}));return function(){return r.apply(this,arguments)}}();return I.a.createElement(be.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:f.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:n,onOk:a,destroyOnClose:!0},I.a.createElement("div",{className:m.a.addModal},I.a.createElement("div",{className:m.a.row},I.a.createElement("span",{className:m.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),I.a.createElement(ge.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:C,onChange:function(t){return l(t.target.value)}})),I.a.createElement("div",{className:m.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},I.a.createElement("span",{className:m.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),I.a.createElement(i.a,{value:_,onChange:function(t){return v(t)}}))))};ce.a=Object(w.a)(function(E){var o=E.problemset;return{problemset:o}})(x)},"ju+a":function(We,ce,F){"use strict";F.d(ce,"b",function(){return I}),F.d(ce,"a",function(){return u}),F.d(ce,"h",function(){return m}),F.d(ce,"f",function(){return i}),F.d(ce,"c",function(){return x}),F.d(ce,"d",function(){return E}),F.d(ce,"g",function(){return d}),F.d(ce,"e",function(){return A});var me=F("aVTQ"),be=F("kxoy"),ye=F("yuO0"),ge=F("fNpE"),ne=F("B/uU"),G=F("T/Jt"),O=F.n(G),W=F("0pdE"),e=F("El5i"),k=F("rgEC"),L=["children"];function I(s,p){if(!s)return[];var C=s.slice(),l=C.indexOf(p);return l>=0&&C.splice(l,1),C}function u(s,p){var C=(s||[]).slice();return C.indexOf(p)===-1&&C.push(p),C}function m(s){return s.split("-")}function i(s,p){var C=[],l=Object(e.a)(p,s);function T(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];y.forEach(function(_){var v=_.key,n=_.children;C.push(v),T(n)})}return T(l.children),C}function g(s){if(s.parent){var p=m(s.pos);return Number(p[p.length-1])===s.parent.children.length-1}return!1}function w(s){var p=m(s.pos);return Number(p[p.length-1])===0}function x(s,p,C,l,T,y,_,v,n,a){var r,t=s.clientX,c=s.clientY,b=s.target.getBoundingClientRect(),h=b.top,D=b.height,P=(a==="rtl"?-1:1)*(((T==null?void 0:T.x)||0)-t),j=(P-12)/l,N=Object(e.a)(v,C.props.eventKey);if(c<h+D/2){var H=_.findIndex(function(ve){return ve.key===N.key}),z=H<=0?0:H-1,J=_[z].key;N=Object(e.a)(v,J)}var Y=N.key,le=N,te=N.key,Z=0,_e=0;if(!n.includes(Y))for(var we=0;we<j&&g(N);we+=1)N=N.parent,_e+=1;var De=p.props.data,Ee=N.node,xe=!0;return w(N)&&N.level===0&&c<h+D/2&&y({dragNode:De,dropNode:Ee,dropPosition:-1})&&N.key===C.props.eventKey?Z=-1:(le.children||[]).length&&n.includes(te)?y({dragNode:De,dropNode:Ee,dropPosition:0})?Z=0:xe=!1:_e===0?j>-1.5?y({dragNode:De,dropNode:Ee,dropPosition:1})?Z=1:xe=!1:y({dragNode:De,dropNode:Ee,dropPosition:0})?Z=0:y({dragNode:De,dropNode:Ee,dropPosition:1})?Z=1:xe=!1:y({dragNode:De,dropNode:Ee,dropPosition:1})?Z=1:xe=!1,{dropPosition:Z,dropLevelOffset:_e,dropTargetKey:N.key,dropTargetPos:N.pos,dragOverNodeKey:te,dropContainerKey:Z===0?null:((r=N.parent)===null||r===void 0?void 0:r.key)||null,dropAllowed:xe}}function E(s,p){if(!s)return;var C=p.multiple;return C?s.slice():s.length?[s[0]]:s}var o=function(p){return p};function f(s,p){if(!s)return[];var C=p||{},l=C.processProps,T=l===void 0?o:l,y=Array.isArray(s)?s:[s];return y.map(function(_){var v=_.children,n=Object(ge.a)(_,L),a=f(v,p);return O.a.createElement(W.a,Object(ye.a)({key:n.key},T(n)),a)})}function d(s){if(!s)return null;var p;if(Array.isArray(s))p={checkedKeys:s,halfCheckedKeys:void 0};else if(Object(be.a)(s)==="object")p={checkedKeys:s.checked||void 0,halfCheckedKeys:s.halfChecked||void 0};else return Object(ne.a)(!1,"`checkedKeys` is not an array or an object"),null;return p}function A(s,p){var C=new Set;function l(T){if(C.has(T))return;var y=Object(e.a)(p,T);if(!y)return;C.add(T);var _=y.parent,v=y.node;if(v.disabled)return;_&&l(_.key)}return(s||[]).forEach(function(T){l(T)}),Object(me.a)(C)}},nEHx:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});var me;(function(be){be.DARK="dark",be.LIGHT="light",be.HIGH_CONTRAST="hc"})(me||(me={}))},nnTU:function(We,ce,F){"use strict";F.d(ce,"b",function(){return O}),F.d(ce,"a",function(){return W});var me=F("MI8n"),be=F("JYp7"),ye=F("pmY6"),ge=F("24hK"),ne=F("746U"),G=F("Cg/j");const O=Object(G.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new me.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,k){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!k)throw new Error("invalid command");return this.registerCommand({id:e,handler:k})}if(e.description){const i=[];for(let w of e.description.args)i.push(w.constraint);const g=e.handler;e.handler=function(w,...x){return Object(ne.o)(x,i),g(w,...x)}}const{id:L}=e;let I=this._commands.get(L);I||(I=new ge.a,this._commands.set(L,I));let u=I.unshift(e),m=Object(ye.i)(()=>{u();const i=this._commands.get(L);(i==null?void 0:i.isEmpty())&&this._commands.delete(L)});return this._onDidRegisterCommand.fire(L),m}registerCommandAlias(e,k){return W.registerCommand(e,(L,...I)=>L.get(O).executeCommand(k,...I))}getCommand(e){const k=this._commands.get(e);return!k||k.isEmpty()?void 0:be.a.first(k)}getCommands(){const e=new Map;for(const k of this._commands.keys()){const L=this.getCommand(k);L&&e.set(k,L)}return e}};W.registerCommand("noop",()=>{})},o46R:function(We,ce,F){"use strict";F.d(ce,"a",function(){return ye});var me=F("U8pU");function be(ge,ne){if(Object(me.a)(ge)!=="object"||ge===null)return ge;var G=ge[Symbol.toPrimitive];if(G!==void 0){var O=G.call(ge,ne||"default");if(Object(me.a)(O)!=="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ne==="string"?String:Number)(ge)}function ye(ge){var ne=be(ge,"string");return Object(me.a)(ne)==="symbol"?ne:String(ne)}},p5ED:function(We,ce,F){"use strict";var me=F("dLI4"),be=F("4d5L"),ye=F("YfA7"),ge=F("e4Gi"),ne=F("YaWb"),G=F("IYef"),O=F("Hqw+"),W=F("XXmO"),e=F.n(W),k=F("T/Jt"),L=F.n(k),I=F("vHTk"),u=F.n(I),m=F("yEEn"),i=F("ZW9T"),g=F("1vsH"),w=F("V0Rq"),x=F("m3rI");ce.a=function(E){var o,f,d,A,s,p,C,l=E.editOffice,T=l===void 0?"view":l,y=E.data,_=E.theme,v=E.type,n=E.filename,a=E.monacoEditor,r=E.className,t=E.style,c=E.close,b=E.onClose,h=E.hasMask,D=E.disabledDownload,P=Object(k.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),j=Object(O.a)(P,2),N=j[0],H=j[1],z=Object(k.useState)(""),J=Object(O.a)(z,2),Y=J[0],le=J[1],te=Object(k.useState)(),Z=Object(O.a)(te,2),_e=Z[0],we=Z[1],De=window.ENV==="build"?"/react/build":"",Ee=x.a.PROXY_SERVER||location.origin,xe,ve=1024*1024,X=10*ve,Ae=Object(k.useRef)();(o=y)!==null&&o!==void 0&&o.startsWith("/api")&&v!=="txt"&&(y=x.a.API_SERVER+y),v==="office"&&(xe=Object(g.U)(y).filesize,xe>X&&(v="other")),n&&a&&(a.filename=n),Object(k.useEffect)(function(){var ae,fe,Re=(ae=document.cookie)===null||ae===void 0||((fe=ae.replace(/\s/g,""))===null||fe===void 0)?void 0:fe.split(";");Re==null||Re.map(function(pe){var ie=pe.split("=");ie[0]==="_educoder_session"&&le(ie[1])})},[]),Object(k.useEffect)(function(){v==="office"&&Q()},[v,y]);var Q=function(){var ae=Object(G.a)(e.a.mark(function fe(){var Re,pe,ie;return e.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return console.log("data:",y),Re=y,y.startsWith("http")||(Re=location.origin+Re),pe=new URL(Re).pathname.split("/").pop(),Oe.next=6,Object(w.V)({attachment_id:pe});case 6:ie=Oe.sent,we(ie);case 8:case"end":return Oe.stop()}},fe)}));return function(){return ae.apply(this,arguments)}}(),ue=function(){if(y.startsWith("http")||y.startsWith("blob:")){ee();return}Object(g.z)(n||"educoder",y,n)},ee=function(){Object(g.x)(n||"educoder",decodeURIComponent(y))};return L.a.createElement("div",{style:Object(ne.a)({},t||{}),className:"".concat(h&&u.a.bgBlack," ").concat(v?u.a.wrp:"hide")},c&&L.a.createElement("div",{className:u.a.close,ref:Ae},!D&&L.a.createElement(ge.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ae.current}},L.a.createElement("span",{onClick:ee},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(ge.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ae.current}},L.a.createElement("span",{className:"",onClick:b},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(u.a[r]," ").concat(r," ").concat(u.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&L.a.createElement(i.b,a)),v==="audio"&&L.a.createElement("audio",{src:"".concat(((f=y)===null||f===void 0?void 0:f.indexOf("http://"))>-1||((d=y)===null||d===void 0?void 0:d.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(y),autoPlay:!0}),v==="video"&&L.a.createElement(L.a.Fragment,null,((A=y)===null||A===void 0?void 0:A.indexOf("http"))>-1?L.a.createElement("video",{controls:!0,src:"".concat(y),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(y),autoPlay:!0})),v==="office"&&_e&&L.a.createElement("iframe",{src:"".concat(De,"/office.html?key=").concat(_e.key,"&url=").concat(Ee+_e.url,"&callbackUrl=").concat(Ee+_e.callbackUrl,"&fileType=").concat(_e.fileType,"&title=").concat(_e.title,"&model=").concat(T,"&officeServer=").concat(x.a.OFFICE_SERVER,"&disabledDownload=").concat(!!D)}),v==="html"&&L.a.createElement("iframe",{src:y+"&disposition=inline"}),v==="pdf"&&L.a.createElement("iframe",{src:"".concat(De,"/js/pdfview/index.html?url=").concat(y,"&disabledDownload=").concat(!!D)}),v==="image"&&L.a.createElement("img",{src:"".concat(((s=y)===null||s===void 0?void 0:s.indexOf("http://"))>-1||((p=y)===null||p===void 0?void 0:p.indexOf("https://"))>-1||(C=y)!==null&&C!==void 0&&C.startsWith("/api")?"":"data:image/png;base64,").concat(y)}),v==="other"&&L.a.createElement("div",null,L.a.createElement(be.a,{type:"primary",size:"large",onClick:ue},L.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&L.a.createElement(be.a,{type:"primary",size:"large",onClick:ue},L.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(We,ce,F){"use strict";F.d(ce,"h",function(){return k}),F.d(ce,"g",function(){return I}),F.d(ce,"f",function(){return u}),F.d(ce,"e",function(){return m}),F.d(ce,"i",function(){return i}),F.d(ce,"b",function(){return g}),F.d(ce,"a",function(){return w}),F.d(ce,"d",function(){return x}),F.d(ce,"c",function(){return E});var me=F("C/vA"),be=F("JYp7");const ye=!1;let ge=null;function ne(o){ge=o}if(ye){const o="__is_disposable_tracked__";ne(new class{trackDisposable(f){const d=new Error("Potentially leaked disposable").stack;setTimeout(()=>{f[o]||console.log(d)},3e3)}setParent(f,d){if(f&&f!==w.None)try{f[o]=!0}catch(A){}}markAsDisposed(f){if(f&&f!==w.None)try{f[o]=!0}catch(d){}}markAsSingleton(f){}})}function G(o){return ge==null||ge.trackDisposable(o),o}function O(o){ge==null||ge.markAsDisposed(o)}function W(o,f){ge==null||ge.setParent(o,f)}function e(o,f){if(!ge)return;for(const d of o)ge.setParent(d,f)}function k(o){return ge==null||ge.markAsSingleton(o),o}class L extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function I(o){return typeof o.dispose=="function"&&o.dispose.length===0}function u(o){if(be.a.is(o)){let f=[];for(const d of o)if(d)try{d.dispose()}catch(A){f.push(A)}if(f.length===1)throw f[0];if(f.length>1)throw new L(f);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function m(...o){const f=i(()=>u(o));return e(o,f),f}function i(o){const f=G({dispose:Object(me.a)(()=>{O(f),o()})});return f}class g{constructor(){this._toDispose=new Set,this._isDisposed=!1,G(this)}dispose(){if(this._isDisposed)return;O(this),this._isDisposed=!0,this.clear()}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return W(o,this),this._isDisposed?g.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}}g.DISABLE_DISPOSED_WARNING=!1;class w{constructor(){this._store=new g,G(this),W(this._store,this)}dispose(){O(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}w.None=Object.freeze({dispose(){}});class x{constructor(){this._isDisposed=!1,G(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var f;if(this._isDisposed||o===this._value)return;(f=this._value)===null||f===void 0||f.dispose(),o&&W(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,O(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&W(o,null),o}}class E{constructor(o){this.object=o}dispose(){}}},psGv:function(We,ce,F){var me,be;(function(){var ye;(function(){"use strict";var O=[,,function(L){function I(i){this.__parent=i,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=[]}I.prototype.clone_empty=function(){var i=new I(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},I.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},I.prototype.has_match=function(i){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(i))return!0;return!1},I.prototype.set_indent=function(i,g){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=g||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var i=this.__parent.current_line;return i.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),i.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),i.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,i.__items[0]===" "&&(i.__items.splice(0,1),i.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(i){this.__items.push(i);var g=i.lastIndexOf(`
`);g!==-1?this.__character_count=i.length-g:this.__character_count+=i.length},I.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var i="";return this.is_empty()?this.__parent.indent_empty_lines&&(i=this.__parent.get_indent_string(this.__indent_count)):(i=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),i+=this.__items.join("")),i};function u(i,g){this.__cache=[""],this.__indent_size=i.indent_size,this.__indent_string=i.indent_char,i.indent_with_tabs||(this.__indent_string=new Array(i.indent_size+1).join(i.indent_char)),g=g||"",i.indent_level>0&&(g=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}u.prototype.get_indent_size=function(i,g){var w=this.__base_string_length;return g=g||0,i<0&&(w=0),w+=i*this.__indent_size,w+=g,w},u.prototype.get_indent_string=function(i,g){var w=this.__base_string;return g=g||0,i<0&&(i=0,w=""),g+=i*this.__indent_size,this.__ensure_cache(g),w+=this.__cache[g],w},u.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var i=this.__cache.length,g=0,w="";this.__indent_size&&i>=this.__indent_size&&(g=Math.floor(i/this.__indent_size),i-=g*this.__indent_size,w=new Array(g+1).join(this.__indent_string)),i&&(w+=new Array(i+1).join(" ")),this.__cache.push(w)};function m(i,g){this.__indent_cache=new u(i,g),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(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(i,g){return this.__indent_cache.get_indent_string(i,g)},m.prototype.get_indent_size=function(i,g){return this.__indent_cache.get_indent_size(i,g)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(i){return this.is_empty()||!i&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(i){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===`
`&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var w=this.__lines.join(`
`);return i!==`
`&&(w=w.replace(/[\n]/g,i)),w},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(i,g){return i=i||0,g=g||0,this.next_line.set_indent(i,g),this.__lines.length>1?(this.current_line.set_indent(i,g),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(i){for(var g=0;g<i.newlines;g++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(i.whitespace_before),this.current_line.push(i.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(i){this.__add_space_before_token(),this.current_line.push(i),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(i){for(var g=this.__lines.length;i<g;)this.__lines[i]._remove_indent(),i++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(i){for(i=i===void 0?!1:i,this.current_line.trim();i&&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(i,g){for(var w=this.__lines.length-2;w>=0;){var x=this.__lines[w];if(x.is_empty())break;if(x.item(0).indexOf(i)!==0&&x.item(-1)!==g){this.__lines.splice(w+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}w--}},L.exports.Output=m},function(L){function I(u,m,i,g){this.type=u,this.text=m,this.comments_before=null,this.newlines=i||0,this.whitespace_before=g||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=I},,,function(L){function I(i,g){this.raw_options=u(i,g),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"])}I.prototype._get_array=function(i,g){var w=this.raw_options[i],x=g||[];return typeof w=="object"?w!==null&&typeof w.concat=="function"&&(x=w.concat()):typeof w=="string"&&(x=w.split(/[^a-zA-Z0-9_\/\-]+/)),x},I.prototype._get_boolean=function(i,g){var w=this.raw_options[i],x=w===void 0?!!g:!!w;return x},I.prototype._get_characters=function(i,g){var w=this.raw_options[i],x=g||"";return typeof w=="string"&&(x=w.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),x},I.prototype._get_number=function(i,g){var w=this.raw_options[i];g=parseInt(g,10),isNaN(g)&&(g=0);var x=parseInt(w,10);return isNaN(x)&&(x=g),x},I.prototype._get_selection=function(i,g,w){var x=this._get_selection_list(i,g,w);if(x.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
`+g+`
You passed in: '`+this.raw_options[i]+"'");return x[0]},I.prototype._get_selection_list=function(i,g,w){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(w=w||[g[0]],!this._is_valid_selection(w,g))throw new Error("Invalid Default Value!");var x=this._get_array(i,w);if(!this._is_valid_selection(x,g))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
`+g+`
You passed in: '`+this.raw_options[i]+"'");return x},I.prototype._is_valid_selection=function(i,g){return i.length&&g.length&&!i.some(function(w){return g.indexOf(w)===-1})};function u(i,g){var w={};i=m(i);var x;for(x in i)x!==g&&(w[x]=i[x]);if(g&&i[g])for(x in i[g])w[x]=i[g][x];return w}function m(i){var g={},w;for(w in i){var x=w.replace(/-/g,"_");g[x]=i[w]}return g}L.exports.Options=I,L.exports.normalizeOpts=m,L.exports.mergeOpts=u},,function(L){var I=RegExp.prototype.hasOwnProperty("sticky");function u(m){this.__input=m||"",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 m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},u.prototype.peek=function(m){var i=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(i=this.__input.charAt(m)),i},u.prototype.__match=function(m,i){m.lastIndex=i;var g=m.exec(this.__input);return g&&!(I&&m.sticky)&&(g.index!==i&&(g=null)),g},u.prototype.test=function(m,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(m,i):!1},u.prototype.testChar=function(m,i){var g=this.peek(i);return m.lastIndex=0,g!==null&&m.test(g)},u.prototype.match=function(m){var i=this.__match(m,this.__position);return i?this.__position+=i[0].length:i=null,i},u.prototype.read=function(m,i,g){var w="",x;return m&&(x=this.match(m),x&&(w+=x[0])),i&&(x||!m)&&(w+=this.readUntil(i,g)),w},u.prototype.readUntil=function(m,i){var g="",w=this.__position;m.lastIndex=this.__position;var x=m.exec(this.__input);return x?(w=x.index,i&&(w+=x[0].length)):w=this.__input_length,g=this.__input.substring(this.__position,w),this.__position=w,g},u.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},u.prototype.get_regexp=function(m,i){var g=null,w="g";return i&&I&&(w="y"),typeof m=="string"&&m!==""?g=new RegExp(m,w):m&&(g=new RegExp(m.source,w)),g},u.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(m){var i=this.__position,g=this.readUntilAfter(m);return this.__position=i,g},u.prototype.lookBack=function(m){var i=this.__position-1;return i>=m.length&&this.__input.substring(i-m.length,i).toLowerCase()===m},L.exports.InputScanner=u},function(L,I,u){var m=u(8).InputScanner,i=u(3).Token,g=u(10).TokenStream,w=u(11).WhitespacePattern,x={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},E=function(o,f){this._input=new m(o),this._options=f||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new w(this._input)};E.prototype.tokenize=function(){this._input.restart(),this.__tokens=new g,this._reset();for(var o,f=new i(x.START,""),d=null,A=[],s=new g;f.type!==x.EOF;){for(o=this._get_next_token(f,d);this._is_comment(o);)s.add(o),o=this._get_next_token(f,d);s.isEmpty()||(o.comments_before=s,s=new g),o.parent=d,this._is_opening(o)?(A.push(d),d=o):d&&this._is_closing(o,d)&&(o.opened=d,d.closed=o,d=A.pop(),o.parent=d),o.previous=f,f.next=o,this.__tokens.add(o),f=o}return this.__tokens},E.prototype._is_first_token=function(){return this.__tokens.isEmpty()},E.prototype._reset=function(){},E.prototype._get_next_token=function(o,f){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(x.RAW,d):this._create_token(x.EOF,"")},E.prototype._is_comment=function(o){return!1},E.prototype._is_opening=function(o){return!1},E.prototype._is_closing=function(o,f){return!1},E.prototype._create_token=function(o,f){var d=new i(o,f,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},E.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=E,L.exports.TOKEN=x},function(L){function I(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},I.prototype.peek=function(u){var m=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(m=this.__tokens[u]),m},I.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},L.exports.TokenStream=I},function(L,I,u){var m=u(12).Pattern;function i(g,w){m.call(this,g,w),w?this._line_regexp=this._input.get_regexp(w._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new m,i.prototype.__set_whitespace_patterns=function(g,w){g+="\\t ",w+="\\n\\r",this._match_pattern=this._input.get_regexp("["+g+w+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+w+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var g=this._input.read(this._match_pattern);if(g===" ")this.whitespace_before_token=" ";else if(g){var w=this.__split(this._newline_regexp,g);this.newline_count=w.length-1,this.whitespace_before_token=w[this.newline_count]}return g},i.prototype.matching=function(g,w){var x=this._create();return x.__set_whitespace_patterns(g,w),x._update(),x},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(g,w){g.lastIndex=0;for(var x=0,E=[],o=g.exec(w);o;)E.push(w.substring(x,o.index)),x=o.index+o[0].length,o=g.exec(w);return x<w.length?E.push(w.substring(x,w.length)):E.push(""),E},L.exports.WhitespacePattern=i},function(L){function I(u,m){this._input=u,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)}I.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},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(u){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(u),m._update(),m},I.prototype.until=function(u){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(u),m._update(),m},I.prototype.starting_with=function(u){var m=this._create();return m._starting_pattern=this._input.get_regexp(u,!0),m._update(),m},I.prototype.matching=function(u){var m=this._create();return m._match_pattern=this._input.get_regexp(u,!0),m._update(),m},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},L.exports.Pattern=I},function(L){function I(u,m){u=typeof u=="string"?u:u.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(u);i;)m[i[1]]=i[2],i=this.__directive_pattern.exec(u);return m},I.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=I},function(L,I,u){var m=u(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function g(w,x){m.call(this,w,x),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),x&&(this.__template_pattern=this._input.get_regexp(x.__template_pattern),this._excluded=Object.assign(this._excluded,x._excluded),this._disabled=Object.assign(this._disabled,x._disabled));var E=new m(w);this.__patterns={handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:E.starting_with(/{{{/).until_after(/}}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),php:E.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:E.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:E.starting_with(/{%/).until_after(/%}/),django_value:E.starting_with(/{{/).until_after(/}}/),django_comment:E.starting_with(/{#/).until_after(/#}/),smarty:E.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:E.starting_with(/{\*/).until_after(/\*}/),smarty_literal:E.starting_with(/{literal}/).until_after(/{\/literal}/)}}g.prototype=new m,g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){this.__set_templated_pattern()},g.prototype.disable=function(w){var x=this._create();return x._disabled[w]=!0,x._update(),x},g.prototype.read_options=function(w){var x=this._create();for(var E in i)x._disabled[E]=w.templating.indexOf(E)===-1;return x._update(),x},g.prototype.exclude=function(w){var x=this._create();return x._excluded[w]=!0,x._update(),x},g.prototype.read=function(){var w="";this._match_pattern?w=this._input.read(this._starting_pattern):w=this._input.read(this._starting_pattern,this.__template_pattern);for(var x=this._read_template();x;)this._match_pattern?x+=this._input.read(this._match_pattern):x+=this._input.readUntil(this.__template_pattern),w+=x,x=this._read_template();return this._until_after&&(w+=this._input.readUntilAfter(this._until_pattern)),w},g.prototype.__set_templated_pattern=function(){var w=[];this._disabled.php||w.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||w.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||w.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(w.push(this.__patterns.django._starting_pattern.source),w.push(this.__patterns.django_value._starting_pattern.source),w.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||w.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&w.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+w.join("|")+")")},g.prototype._read_template=function(){var w="",x=this._input.peek();if(x==="<"){var E=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&E==="?"&&(w=w||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&E==="%"&&(w=w||this.__patterns.erb.read())}else x==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(w=w||this.__patterns.handlebars_comment.read(),w=w||this.__patterns.handlebars_unescaped.read(),w=w||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(w=w||this.__patterns.django_value.read()),this._excluded.django||(w=w||this.__patterns.django_comment.read(),w=w||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(w=w||this.__patterns.smarty_comment.read(),w=w||this.__patterns.smarty_literal.read(),w=w||this.__patterns.smarty.read()));return w},L.exports.TemplatablePattern=g},,,,function(L,I,u){var m=u(19).Beautifier,i=u(20).Options;function g(w,x,E,o){var f=new m(w,x,E,o);return f.beautify()}L.exports=g,L.exports.defaultOptions=function(){return new i}},function(L,I,u){var m=u(20).Options,i=u(2).Output,g=u(21).Tokenizer,w=u(21).TOKEN,x=/\r\n|[\r\n]/,E=/\r\n|[\r\n]/g,o=function(_,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new i(_,v)};o.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},o.prototype.set_space_before_token=function(_,v){this._output.space_before_token=_,this._output.non_breaking_space=v},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(_){this._output.add_raw_token(_)},o.prototype.print_preserved_newlines=function(_){var v=0;_.type!==w.TEXT&&_.previous.type!==w.TEXT&&(v=_.newlines?1:0),this.preserve_newlines&&(v=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var n=0;n<v;n++)this.print_newline(n>0);return v!==0},o.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(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(_){this._output.add_new_line(_)},o.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var f=function(_){for(var v=null,n=_.next;n.type!==w.EOF&&_.closed!==n;){if(n.type===w.ATTRIBUTE&&n.text==="type"){n.next&&n.next.type===w.EQUALS&&n.next.next&&n.next.next.type===w.VALUE&&(v=n.next.next.text);break}n=n.next}return v},d=function(_,v){var n=null,a=null;return v.closed?(_==="script"?n="text/javascript":_==="style"&&(n="text/css"),n=f(v)||n,n.search("text/css")>-1?a="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?a="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?a="html":n.search(/test\/null/)>-1&&(a="null"),a):null};function A(_,v){return v.indexOf(_)!==-1}function s(_,v,n){this.parent=_||null,this.tag=v?v.tag_name:"",this.indent_level=n||0,this.parser_token=v||null}function p(_){this._printer=_,this._current_frame=null}p.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},p.prototype.record_tag=function(_){var v=new s(this._current_frame,_,this._printer.indent_level);this._current_frame=v},p.prototype._try_pop_frame=function(_){var v=null;return _&&(v=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),v},p.prototype._get_frame=function(_,v){for(var n=this._current_frame;n&&!(_.indexOf(n.tag)!==-1);){if(v&&v.indexOf(n.tag)!==-1){n=null;break}n=n.parent}return n},p.prototype.try_pop=function(_,v){var n=this._get_frame([_],v);return this._try_pop_frame(n)},p.prototype.indent_to_tag=function(_){var v=this._get_frame(_);v&&(this._printer.indent_level=v.indent_level)};function C(_,v,n,a){this._source_text=_||"",v=v||{},this._js_beautify=n,this._css_beautify=a,this._tag_stack=null;var r=new m(v,"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"}C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
`,_&&x.test(_)&&(v=_.match(x)[0])),_=_.replace(E,`
`);var n=_.match(/^[\t ]*/)[0],a={text:"",type:""},r=new l,t=new o(this._options,n),c=new g(_,this._options).tokenize();this._tag_stack=new p(t);for(var b=null,h=c.next();h.type!==w.EOF;)h.type===w.TAG_OPEN||h.type===w.COMMENT?(b=this._handle_tag_open(t,h,r,a),r=b):h.type===w.ATTRIBUTE||h.type===w.EQUALS||h.type===w.VALUE||h.type===w.TEXT&&!r.tag_complete?b=this._handle_inside_tag(t,h,r,c):h.type===w.TAG_CLOSE?b=this._handle_tag_close(t,h,r):h.type===w.TEXT?b=this._handle_text(t,h,r):t.add_raw_token(h),a=b,h=c.next();var D=t._output.get_code(v);return D},C.prototype._handle_tag_close=function(_,v,n){var a={text:v.text,type:v.type};return _.alignment_size=0,n.tag_complete=!0,_.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),n.is_unformatted?_.add_raw_token(v):(n.tag_start_char==="<"&&(_.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(v)),n.indent_content&&!(n.is_unformatted||n.is_content_unformatted)&&(_.indent(),n.indent_content=!1),!n.is_inline_element&&!(n.is_unformatted||n.is_content_unformatted)&&_.set_wrap_point(),a},C.prototype._handle_inside_tag=function(_,v,n,a){var r=n.has_wrapped_attrs,t={text:v.text,type:v.type};if(_.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),n.is_unformatted)_.add_raw_token(v);else if(n.tag_start_char==="{"&&v.type===w.TEXT)_.print_preserved_newlines(v)?(v.newlines=0,_.add_raw_token(v)):_.print_token(v);else{if(v.type===w.ATTRIBUTE?(_.set_space_before_token(!0),n.attr_count+=1):(v.type===w.EQUALS||v.type===w.VALUE&&v.previous.type===w.EQUALS)&&_.set_space_before_token(!1),v.type===w.ATTRIBUTE&&n.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(v),r=r||v.newlines!==0),this._is_wrap_attributes_force)){var c=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&n.attr_count===1){var b=!0,h=0,D;do{if(D=a.peek(h),D.type===w.ATTRIBUTE){b=!1;break}h+=1}while(h<4&&D.type!==w.EOF&&D.type!==w.TAG_CLOSE);c=!b}c&&(_.print_newline(!1),r=!0)}_.print_token(v),r=r||_.previous_token_wrapped(),n.has_wrapped_attrs=r}return t},C.prototype._handle_text=function(_,v,n){var a={text:v.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(_,v,n):n.is_unformatted||n.is_content_unformatted?_.add_raw_token(v):(_.traverse_whitespace(v),_.print_token(v)),a},C.prototype._print_custom_beatifier_text=function(_,v,n){var a=this;if(v.text!==""){var r=v.text,t,c=1,b="",h="";n.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?t=this._js_beautify:n.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?t=this._css_beautify:n.custom_beautifier_name==="html"&&(t=function(z,J){var Y=new C(z,J,a._js_beautify,a._css_beautify);return Y.beautify()}),this._options.indent_scripts==="keep"?c=0:this._options.indent_scripts==="separate"&&(c=-_.indent_level);var D=_.get_full_indent(c);if(r=r.replace(/\n[ \t]*$/,""),n.custom_beautifier_name!=="html"&&r[0]==="<"&&r.match(/^(<!--|<!\[CDATA\[)/)){var P=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(r);if(!P){_.add_raw_token(v);return}b=D+P[1]+`
`,r=P[4],P[5]&&(h=D+P[5]),r=r.replace(/\n[ \t]*$/,""),(P[2]||P[3].indexOf(`
`)!==-1)&&(P=P[3].match(/[ \t]+$/),P&&(v.whitespace_before=P[0]))}if(r)if(t){var j=function(){this.eol=`
`};j.prototype=this._options.raw_options;var N=new j;r=t(D+r,N)}else{var H=v.whitespace_before;H&&(r=r.replace(new RegExp(`
(`+H+")?","g"),`
`)),r=D+r.replace(/\n/g,`
`+D)}b&&(r?r=b+r+`
`+h:r=b+h),_.print_newline(!1),r&&(v.text=r,v.whitespace_before="",v.newlines=0,_.add_raw_token(v),_.print_newline(!0))}},C.prototype._handle_tag_open=function(_,v,n,a){var r=this._get_tag_open_token(v);return(n.is_unformatted||n.is_content_unformatted)&&!n.is_empty_element&&v.type===w.TAG_OPEN&&v.text.indexOf("</")===0?(_.add_raw_token(v),r.start_tag_token=this._tag_stack.try_pop(r.tag_name)):(_.traverse_whitespace(v),this._set_tag_position(_,v,r,n,a),r.is_inline_element||_.set_wrap_point(),_.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(r.alignment_size=v.text.length+1),!r.tag_complete&&!r.is_unformatted&&(_.alignment_size=r.alignment_size),r};var l=function(_,v){if(this.parent=_||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="",!v)this.tag_complete=!0;else{var n;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(n=v.text.match(/^<([^\s>]*)/),this.tag_check=n?n[1]:""):(n=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===w.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||v.closed&&v.closed.text==="/>";var a=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(a=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(a)))}};C.prototype._get_tag_open_token=function(_){var v=new l(this._tag_stack.get_parser_token(),_);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||A(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&A(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&A(v.tag_check,this._options.content_unformatted),v.is_inline_element=A(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},C.prototype._set_tag_position=function(_,v,n,a,r){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(n),(n.tag_name==="script"||n.tag_name==="style")&&!(n.is_unformatted||n.is_content_unformatted)&&(n.custom_beautifier_name=d(n.tag_check,v)))),A(n.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),n.is_empty_element){if(n.tag_start_char==="{"&&n.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var t=_.current_line_has_match(/{{#if/);t||_.print_newline(!1)}n.tag_name==="!--"&&r.type===w.TAG_CLOSE&&a.is_end_tag&&n.text.indexOf(`
`)===-1||(n.is_inline_element||n.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,n))}else if(n.is_end_tag){var c=!1;c=n.start_tag_token&&n.start_tag_token.multiline_content,c=c||!n.is_inline_element&&!(a.is_inline_element||a.is_unformatted)&&!(r.type===w.TAG_CLOSE&&n.start_tag_token===a)&&r.type!=="TK_CONTENT",(n.is_content_unformatted||n.is_unformatted)&&(c=!1),c&&_.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,n.tag_start_char==="<"&&(n.tag_name==="html"?n.indent_content=this._options.indent_inner_html:n.tag_name==="head"?n.indent_content=this._options.indent_head_inner_html:n.tag_name==="body"&&(n.indent_content=this._options.indent_body_inner_html)),!(n.is_inline_element||n.is_unformatted)&&(r.type!=="TK_CONTENT"||n.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,n)},C.prototype._calcluate_parent_multiline=function(_,v){v.parent&&_._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.parent.multiline_content=!0)};var T=["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"],y=["a","audio","del","ins","map","noscript","video"];C.prototype._do_optional_end_element=function(_){var v=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(_.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&T.indexOf(_.tag_name)!==-1){var n=_.parent.parent;(!n||y.indexOf(n.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),v},L.exports.Beautifier=C},function(L,I,u){var m=u(6).Options;function i(g){m.call(this,g,"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"])}i.prototype=new m,L.exports.Options=i},function(L,I,u){var m=u(9).Tokenizer,i=u(9).TOKEN,g=u(13).Directives,w=u(14).TemplatablePattern,x=u(12).Pattern,E={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:i.START,RAW:i.RAW,EOF:i.EOF},o=new g(/<\!--/,/-->/),f=function(d,A){m.call(this,d,A),this._current_tag_name="";var s=new w(this._input).read_options(this._options),p=new x(this._input);if(this.__patterns={word:s.until(/[\n\r\t <]/),single_quote:s.until_after(/'/),double_quote:s.until_after(/"/),attribute:s.until(/[\n\r\t =>]|\/>/),element_name:s.until(/[\n\r\t >\/]/),handlebars_comment:p.starting_with(/{{!--/).until_after(/--}}/),handlebars:p.starting_with(/{{/).until_after(/}}/),handlebars_open:p.until(/[\n\r\t }]/),handlebars_raw_close:p.until(/}}/),comment:p.starting_with(/<!--/).until_after(/-->/),cdata:p.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:p.starting_with(/<!\[/).until_after(/]>/),processing:p.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 C=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=p.matching(C).until_after(C)}};f.prototype=new m,f.prototype._is_comment=function(d){return!1},f.prototype._is_opening=function(d){return d.type===E.TAG_OPEN},f.prototype._is_closing=function(d,A){return d.type===E.TAG_CLOSE&&A&&((d.text===">"||d.text==="/>")&&A.text[0]==="<"||d.text==="}}"&&A.text[0]==="{"&&A.text[1]==="{")},f.prototype._reset=function(){this._current_tag_name=""},f.prototype._get_next_token=function(d,A){var s=null;this._readWhitespace();var p=this._input.peek();return p===null?this._create_token(E.EOF,""):(s=s||this._read_open_handlebars(p,A),s=s||this._read_attribute(p,d,A),s=s||this._read_close(p,A),s=s||this._read_raw_content(p,d,A),s=s||this._read_content_word(p),s=s||this._read_comment_or_cdata(p),s=s||this._read_processing(p),s=s||this._read_open(p,A),s=s||this._create_token(E.UNKNOWN,this._input.next()),s)},f.prototype._read_comment_or_cdata=function(d){var A=null,s=null,p=null;if(d==="<"){var C=this._input.peek(1);C==="!"&&(s=this.__patterns.comment.read(),s?(p=o.get_directives(s),p&&p.ignore==="start"&&(s+=o.readIgnored(this._input))):s=this.__patterns.cdata.read()),s&&(A=this._create_token(E.COMMENT,s),A.directives=p)}return A},f.prototype._read_processing=function(d){var A=null,s=null,p=null;if(d==="<"){var C=this._input.peek(1);(C==="!"||C==="?")&&(s=this.__patterns.conditional_comment.read(),s=s||this.__patterns.processing.read()),s&&(A=this._create_token(E.COMMENT,s),A.directives=p)}return A},f.prototype._read_open=function(d,A){var s=null,p=null;return A||d==="<"&&(s=this._input.next(),this._input.peek()==="/"&&(s+=this._input.next()),s+=this.__patterns.element_name.read(),p=this._create_token(E.TAG_OPEN,s)),p},f.prototype._read_open_handlebars=function(d,A){var s=null,p=null;return A||this._options.indent_handlebars&&d==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(s=this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars.read(),p=this._create_token(E.COMMENT,s)):(s=this.__patterns.handlebars_open.read(),p=this._create_token(E.TAG_OPEN,s))),p},f.prototype._read_close=function(d,A){var s=null,p=null;return A&&(A.text[0]==="<"&&(d===">"||d==="/"&&this._input.peek(1)===">")?(s=this._input.next(),d==="/"&&(s+=this._input.next()),p=this._create_token(E.TAG_CLOSE,s)):A.text[0]==="{"&&d==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),p=this._create_token(E.TAG_CLOSE,"}}"))),p},f.prototype._read_attribute=function(d,A,s){var p=null,C="";if(s&&s.text[0]==="<")if(d==="=")p=this._create_token(E.EQUALS,this._input.next());else if(d==='"'||d==="'"){var l=this._input.next();d==='"'?l+=this.__patterns.double_quote.read():l+=this.__patterns.single_quote.read(),p=this._create_token(E.VALUE,l)}else C=this.__patterns.attribute.read(),C&&(A.type===E.EQUALS?p=this._create_token(E.VALUE,C):p=this._create_token(E.ATTRIBUTE,C));return p},f.prototype._is_content_unformatted=function(d){return this._options.void_elements.indexOf(d)===-1&&(this._options.content_unformatted.indexOf(d)!==-1||this._options.unformatted.indexOf(d)!==-1)},f.prototype._read_raw_content=function(d,A,s){var p="";if(s&&s.text[0]==="{")p=this.__patterns.handlebars_raw_close.read();else if(A.type===E.TAG_CLOSE&&A.opened.text[0]==="<"&&A.text[0]!=="/"){var C=A.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var l=this._read_comment_or_cdata(d);if(l)return l.type=E.TEXT,l;p=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(C)&&(p=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig")))}return p?this._create_token(E.TEXT,p):null},f.prototype._read_content_word=function(d){var A="";if(this._options.unformatted_content_delimiter&&(d===this._options.unformatted_content_delimiter[0]&&(A=this.__patterns.unformatted_content_delimiter.read())),A||(A=this.__patterns.word.read()),A)return this._create_token(E.TEXT,A)},L.exports.Tokenizer=f,L.exports.TOKEN=E}],W={};function e(L){var I=W[L];if(I!==void 0)return I.exports;var u=W[L]={exports:{}};return O[L](u,u.exports,e),u.exports}var k=e(18);ye=k})();var ge=ye;if(!0)!(me=[F,F("6UM0"),F("TXwP")],be=function(O){var W=F("6UM0"),e=F("TXwP");return{html_beautify:function(k,L){return ge(k,L,W.js_beautify,e.css_beautify)}}}.apply(ce,me),be!==void 0&&(We.exports=be));else var ne,G})()},rePB:function(We,ce,F){"use strict";F.d(ce,"a",function(){return be});var me=F("o46R");function be(ye,ge,ne){return ge=Object(me.a)(ge),ge in ye?Object.defineProperty(ye,ge,{value:ne,enumerable:!0,configurable:!0,writable:!0}):ye[ge]=ne,ye}},rgEC:function(We,ce,F){"use strict";F.d(ce,"f",function(){return I}),F.d(ce,"d",function(){return u}),F.d(ce,"c",function(){return i}),F.d(ce,"e",function(){return g}),F.d(ce,"a",function(){return x}),F.d(ce,"g",function(){return E}),F.d(ce,"b",function(){return o});var me=F("kxoy"),be=F("aVTQ"),ye=F("6ASS"),ge=F("fNpE"),ne=F("qoVz"),G=F("N7A4"),O=F("B/uU"),W=F("El5i"),e=["children"];function k(f,d){return"".concat(f,"-").concat(d)}function L(f){return f&&f.type&&f.type.isTreeNode}function I(f,d){return f!=null?f:d}function u(f){var d=f||{},A=d.title,s=d._title,p=d.key,C=d.children,l=A||"title";return{title:l,_title:s||[l],key:p||"key",children:C||"children"}}function m(f,d){var A=new Map;function s(p){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(p||[]).forEach(function(l){var T=l[d.key],y=l[d.children];Object(O.a)(T!=null,"Tree node must have a certain key: [".concat(C).concat(T,"]"));var _=String(T);Object(O.a)(!A.has(_)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(_)),A.set(_,!0),s(y,"".concat(C).concat(_," > "))})}s(f)}function i(f){function d(A){var s=Object(ne.a)(A);return s.map(function(p){if(!L(p))return Object(O.a)(!p,"Tree/TreeNode can only accept TreeNode as children."),null;var C=p.key,l=p.props,T=l.children,y=Object(ge.a)(l,e),_=Object(ye.a)({key:C},y),v=d(T);return v.length&&(_.children=v),_}).filter(function(p){return p})}return d(f)}function g(f,d,A){var s=u(A),p=s._title,C=s.key,l=s.children,T=new Set(d===!0?[]:d),y=[];function _(v){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return v.map(function(a,r){for(var t=k(n?n.pos:"0",r),c=I(a[C],t),b,h=0;h<p.length;h+=1){var D=p[h];if(a[D]!==void 0){b=a[D];break}}var P=Object(ye.a)(Object(ye.a)({},Object(G.a)(a,[].concat(Object(be.a)(p),[C,l]))),{},{title:b,key:c,parent:n,pos:t,children:null,data:a,isStart:[].concat(Object(be.a)(n?n.isStart:[]),[r===0]),isEnd:[].concat(Object(be.a)(n?n.isEnd:[]),[r===v.length-1])});return y.push(P),d===!0||T.has(c)?P.children=_(a[l]||[],P):P.children=[],P})}return _(f),y}function w(f,d,A){var s={};Object(me.a)(A)==="object"?s=A:s={externalGetKey:A},s=s||{};var p=s,C=p.childrenPropName,l=p.externalGetKey,T=p.fieldNames,y=u(T),_=y.key,v=y.children,n=C||v,a;l?typeof l=="string"?a=function(c){return c[l]}:typeof l=="function"&&(a=function(c){return l(c)}):a=function(c,b){return I(c[_],b)};function r(t,c,b,h){var D=t?t[n]:f,P=t?k(b.pos,c):"0",j=t?[].concat(Object(be.a)(h),[t]):[];if(t){var N=a(t,P),H={node:t,index:c,pos:P,key:N,parentPos:b.node?b.pos:null,level:b.level+1,nodes:j};d(H)}D&&D.forEach(function(z,J){r(z,J,{node:t,pos:P,level:b?b.level+1:-1},j)})}r(null)}function x(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=d.initWrapper,s=d.processEntity,p=d.onProcessFinished,C=d.externalGetKey,l=d.childrenPropName,T=d.fieldNames,y=arguments.length>2?arguments[2]:void 0,_=C||y,v={},n={},a={posEntities:v,keyEntities:n};return A&&(a=A(a)||a),w(f,function(r){var t=r.node,c=r.index,b=r.pos,h=r.key,D=r.parentPos,P=r.level,j=r.nodes,N={node:t,nodes:j,index:c,key:h,pos:b,level:P},H=I(h,b);v[b]=N,n[H]=N,N.parent=v[D],N.parent&&(N.parent.children=N.parent.children||[],N.parent.children.push(N)),s&&s(N,a)},{externalGetKey:_,childrenPropName:l,fieldNames:T}),p&&p(a),a}function E(f,d){var A=d.expandedKeys,s=d.selectedKeys,p=d.loadedKeys,C=d.loadingKeys,l=d.checkedKeys,T=d.halfCheckedKeys,y=d.dragOverNodeKey,_=d.dropPosition,v=d.keyEntities,n=Object(W.a)(v,f),a={eventKey:f,expanded:A.indexOf(f)!==-1,selected:s.indexOf(f)!==-1,loaded:p.indexOf(f)!==-1,loading:C.indexOf(f)!==-1,checked:l.indexOf(f)!==-1,halfChecked:T.indexOf(f)!==-1,pos:String(n?n.pos:""),dragOver:y===f&&_===0,dragOverGapTop:y===f&&_===-1,dragOverGapBottom:y===f&&_===1};return a}function o(f){var d=f.data,A=f.expanded,s=f.selected,p=f.checked,C=f.loaded,l=f.loading,T=f.halfChecked,y=f.dragOver,_=f.dragOverGapTop,v=f.dragOverGapBottom,n=f.pos,a=f.active,r=f.eventKey,t=Object(ye.a)(Object(ye.a)({},d),{},{expanded:A,selected:s,checked:p,loaded:C,loading:l,halfChecked:T,dragOver:y,dragOverGapTop:_,dragOverGapBottom:v,pos:n,active:a,key:r});return"props"in t||Object.defineProperty(t,"props",{get:function(){return Object(O.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),f}}),t}},"sh+1":function(We,ce,F){"use strict";F.d(ce,"a",function(){return be});var me=F("a247");function be(ye,ge){var ne;if(typeof Symbol=="undefined"||ye[Symbol.iterator]==null){if(Array.isArray(ye)||(ne=Object(me.a)(ye))||ge&&ye&&typeof ye.length=="number"){ne&&(ye=ne);var G=0,O=function(){};return{s:O,n:function(){return G>=ye.length?{done:!0}:{done:!1,value:ye[G++]}},e:function(I){throw I},f:O}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,e=!1,k;return{s:function(){ne=ye[Symbol.iterator]()},n:function(){var I=ne.next();return W=I.done,I},e:function(I){e=!0,k=I},f:function(){try{!W&&ne.return!=null&&ne.return()}finally{if(e)throw k}}}}},spXi:function(We,ce,F){We.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t9D7:function(We,ce,F){"use strict";F.d(ce,"b",function(){return O}),F.d(ce,"g",function(){return e}),F.d(ce,"d",function(){return k}),F.d(ce,"e",function(){return L}),F.d(ce,"a",function(){return I}),F.d(ce,"f",function(){return i}),F.d(ce,"c",function(){return g});var me=F("Vhoy"),be=F("MI8n"),ye=F("pmY6"),ge=F("Cg/j"),ne=F("ic2d"),G=F("nEHx");const O=Object(ge.c)("themeService");var W;(function(w){function x(E){return E&&typeof E=="object"&&typeof E.id=="string"}w.isThemeColor=x})(W||(W={}));function e(w){return{id:w}}var k;(function(w){function x(s){return s&&typeof s=="object"&&typeof s.id=="string"&&(typeof s.color=="undefined"||W.isThemeColor(s.color))}w.isThemeIcon=x;const E=new RegExp(`^\\$\\((${me.a.iconNameExpression}(?:${me.a.iconModifierExpression})?)\\)$`);function o(s){const p=E.exec(s);if(!p)return;let[,C]=p;return{id:C}}w.fromString=o;function f(s,p){let C=s.id;const l=C.lastIndexOf("~");return l!==-1&&(C=C.substring(0,l)),p&&(C=`${C}~${p}`),{id:C}}w.modify=f;function d(s,p){var C,l;return s.id===p.id&&((C=s.color)===null||C===void 0?void 0:C.id)===((l=p.color)===null||l===void 0?void 0:l.id)}w.isEqual=d;function A(s,p){return{id:s.id,color:p?e(p):void 0}}w.asThemeIcon=A,w.asClassNameArray=me.a.asClassNameArray,w.asClassName=me.a.asClassName,w.asCSSSelector=me.a.asCSSSelector})(k||(k={}));function L(w){switch(w){case G.a.DARK:return"vs-dark";case G.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const I={ThemingContribution:"base.contributions.theming"};class u{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new be.b}onColorThemeChange(w){return this.themingParticipants.push(w),this.onThemingParticipantAddedEmitter.fire(w),Object(ye.i)(()=>{const x=this.themingParticipants.indexOf(w);this.themingParticipants.splice(x,1)})}getThemingParticipants(){return this.themingParticipants}}let m=new u;ne.a.add(I.ThemingContribution,m);function i(w){return m.onColorThemeChange(w)}class g extends ye.a{constructor(w){super();this.themeService=w,this.theme=w.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(x=>this.onThemeChange(x)))}onThemeChange(w){this.theme=w,this.updateStyles()}updateStyles(){}}},ulZh:function(We,ce,F){typeof window!="undefined"&&function(be,ye){We.exports=ye()}(this,()=>(()=>{var me={"./src/config.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{enableStreamingMode:()=>a,hlsDefaultConfig:()=>_,mergeConfig:()=>n});var W=O("./src/controller/abr-controller.ts"),e=O("./src/controller/audio-stream-controller.ts"),k=O("./src/controller/audio-track-controller.ts"),L=O("./src/controller/subtitle-stream-controller.ts"),I=O("./src/controller/subtitle-track-controller.ts"),u=O("./src/controller/buffer-controller.ts"),m=O("./src/controller/timeline-controller.ts"),i=O("./src/controller/cap-level-controller.ts"),g=O("./src/controller/fps-controller.ts"),w=O("./src/controller/eme-controller.ts"),x=O("./src/controller/cmcd-controller.ts"),E=O("./src/utils/xhr-loader.ts"),o=O("./src/utils/fetch-loader.ts"),f=O("./src/utils/cues.ts"),d=O("./src/utils/mediakeys-helper.ts"),A=O("./src/utils/logger.ts");function s(){return s=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var c=arguments[t];for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(r[b]=c[b])}return r},s.apply(this,arguments)}function p(r,t){var c=Object.keys(r);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(r);t&&(b=b.filter(function(h){return Object.getOwnPropertyDescriptor(r,h).enumerable})),c.push.apply(c,b)}return c}function C(r){for(var t=1;t<arguments.length;t++){var c=arguments[t]!=null?arguments[t]:{};t%2?p(Object(c),!0).forEach(function(b){l(r,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(c)):p(Object(c)).forEach(function(b){Object.defineProperty(r,b,Object.getOwnPropertyDescriptor(c,b))})}return r}function l(r,t,c){return t=T(t),t in r?Object.defineProperty(r,t,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[t]=c,r}function T(r){var t=y(r,"string");return typeof t=="symbol"?t:String(t)}function y(r,t){if(typeof r!="object"||r===null)return r;var c=r[Symbol.toPrimitive];if(c!==void 0){var b=c.call(r,t||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}var _=C(C({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:E.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:W.default,bufferController:u.default,capLevelController:i.default,fpsController:g.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,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:d.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},v()),{},{subtitleStreamController:L.SubtitleStreamController,subtitleTrackController:I.default,timelineController:m.TimelineController,audioStreamController:e.default,audioTrackController:k.default,emeController:w.default,cmcdController:x.default});function v(){return{cueHandler:f.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function n(r,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},r,t)}function a(r){var t=r.loader;if(t!==o.default&&t!==E.default)A.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1;else{var c=(0,o.fetchSupported)();c&&(r.loader=o.default,r.progressive=!0,r.enableSoftwareAES=!0,A.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>E});var W=O("./src/polyfills/number.ts"),e=O("./src/utils/ewma-bandwidth-estimator.ts"),k=O("./src/events.ts"),L=O("./src/errors.ts"),I=O("./src/types/loader.ts"),u=O("./src/utils/logger.ts");function m(o,f){for(var d=0;d<f.length;d++){var A=f[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,g(A.key),A)}}function i(o,f,d){return f&&m(o.prototype,f),d&&m(o,d),Object.defineProperty(o,"prototype",{writable:!1}),o}function g(o){var f=w(o,"string");return typeof f=="symbol"?f:String(f)}function w(o,f){if(typeof o!="object"||o===null)return o;var d=o[Symbol.toPrimitive];if(d!==void 0){var A=d.call(o,f||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(o)}var x=function(){function o(d){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=d;var A=d.config;this.bwEstimator=new e.default(A.abrEwmaSlowVoD,A.abrEwmaFastVoD,A.abrEwmaDefaultEstimate),this.registerListeners()}var f=o.prototype;return f.registerListeners=function(){var A=this.hls;A.on(k.Events.FRAG_LOADING,this.onFragLoading,this),A.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),A.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(k.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var A=this.hls;A.off(k.Events.FRAG_LOADING,this.onFragLoading,this),A.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),A.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(k.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},f.onFragLoading=function(A,s){var p=s.frag;if(p.type===I.PlaylistLevelType.MAIN&&!this.timer){var C;this.fragCurrent=p,this.partCurrent=(C=s.part)!=null?C:null,this.timer=self.setInterval(this.onCheck,100)}},f.onLevelLoaded=function(A,s){var p=this.hls.config;s.details.live?this.bwEstimator.update(p.abrEwmaSlowLive,p.abrEwmaFastLive):this.bwEstimator.update(p.abrEwmaSlowVoD,p.abrEwmaFastVoD)},f._abandonRulesCheck=function(){var A=this.fragCurrent,s=this.partCurrent,p=this.hls,C=p.autoLevelEnabled,l=p.media;if(!A||!l)return;var T=s?s.stats:A.stats,y=s?s.duration:A.duration;if(T.aborted||T.loaded&&T.loaded===T.total||A.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!C||l.paused||!l.playbackRate||!l.readyState)return;var _=p.mainForwardBufferInfo;if(_===null)return;var v=performance.now()-T.loading.start,n=Math.abs(l.playbackRate);if(v<=500*y/n)return;var a=T.loaded&&T.loading.first,r=this.bwEstimator.getEstimate(),t=p.levels,c=p.minAutoLevel,b=t[A.level],h=T.total||Math.max(T.loaded,Math.round(y*b.maxBitrate/8)),D=a?T.loaded*1e3/v:0,P=D?(h-T.loaded)/D:h*8/r,j=_.len/n;if(P<=j)return;var N=Number.POSITIVE_INFINITY,H;for(H=A.level-1;H>c;H--){var z=t[H].maxBitrate;if(N=D?y*z/(8*.8*D):y*z/r,N<j)break}if(N>=P)return;u.logger.warn("Fragment "+A.sn+(s?" part "+s.index:"")+" of level "+A.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+((0,W.isFiniteNumber)(r)?(r/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+P.toFixed(3)+` s
Estimated load time for the next fragment: `+N.toFixed(3)+` s
Time to underbuffer: `+j.toFixed(3)+" s"),p.nextLoadLevel=H,a&&this.bwEstimator.sample(v,T.loaded),this.clearTimer(),(A.loader||A.keyLoader)&&(this.fragCurrent=this.partCurrent=null,A.abortRequests()),p.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:A,part:s,stats:T})},f.onFragLoaded=function(A,s){var p=s.frag,C=s.part;if(p.type===I.PlaylistLevelType.MAIN&&(0,W.isFiniteNumber)(p.sn)){var l=C?C.stats:p.stats,T=C?C.duration:p.duration;if(this.clearTimer(),this.lastLoadedFragLevel=p.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var y=this.hls.levels[p.level],_=(y.loaded?y.loaded.bytes:0)+l.loaded,v=(y.loaded?y.loaded.duration:0)+T;y.loaded={bytes:_,duration:v},y.realBitrate=Math.round(8*_/v)}if(p.bitrateTest){var n={stats:l,frag:p,part:C,id:p.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,n)}}},f.onFragBuffered=function(A,s){var p=s.frag,C=s.part,l=C?C.stats:p.stats;if(l.aborted)return;if(p.type!==I.PlaylistLevelType.MAIN||p.sn==="initSegment")return;var T=l.parsing.end-l.loading.start;this.bwEstimator.sample(T,l.loaded),l.bwEstimate=this.bwEstimator.getEstimate(),p.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},f.onError=function(A,s){var p;if(((p=s.frag)===null||p===void 0?void 0:p.type)===I.PlaylistLevelType.MAIN){if(s.type===L.ErrorTypes.KEY_SYSTEM_ERROR){this.clearTimer();return}switch(s.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},f.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},f.getNextABRAutoLevel=function(){var A=this.fragCurrent,s=this.partCurrent,p=this.hls,C=p.maxAutoLevel,l=p.config,T=p.minAutoLevel,y=p.media,_=s?s.duration:A?A.duration:0,v=y&&y.playbackRate!==0?Math.abs(y.playbackRate):1,n=this.bwEstimator?this.bwEstimator.getEstimate():l.abrEwmaDefaultEstimate,a=p.mainForwardBufferInfo,r=(a?a.len:0)/v,t=this.findBestLevel(n,T,C,r,l.abrBandWidthFactor,l.abrBandWidthUpFactor);if(t>=0)return t;u.logger.trace((r?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var c=_?Math.min(_,l.maxStarvationDelay):l.maxStarvationDelay,b=l.abrBandWidthFactor,h=l.abrBandWidthUpFactor;if(!r){var D=this.bitrateTestDelay;if(D){var P=_?Math.min(_,l.maxLoadingDelay):l.maxLoadingDelay;c=P-D,u.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*c)+" ms"),b=h=1}}return t=this.findBestLevel(n,T,C,r+c,b,h),Math.max(t,0)},f.findBestLevel=function(A,s,p,C,l,T){for(var y,_=this.fragCurrent,v=this.partCurrent,n=this.lastLoadedFragLevel,a=this.hls.levels,r=a[n],t=!!(r!=null&&(y=r.details)!==null&&y!==void 0&&y.live),c=r==null?void 0:r.codecSet,b=v?v.duration:_?_.duration:0,h=p;h>=s;h--){var D=a[h];if(!D||c&&D.codecSet!==c)continue;var P=D.details,j=(v?P==null?void 0:P.partTarget:P==null?void 0:P.averagetargetduration)||b,N=void 0;h<=n?N=l*A:N=T*A;var H=a[h].maxBitrate,z=H*j/N;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+h+"/"+Math.round(N)+"/"+H+"/"+j+"/"+C+"/"+z),N>H&&(z===0||!(0,W.isFiniteNumber)(z)||t&&!this.bitrateTestDelay||z<C))return h}return-1},i(o,[{key:"nextAutoLevel",get:function(){var A=this._nextAutoLevel,s=this.bwEstimator;if(A!==-1&&!s.canEstimate())return A;var p=this.getNextABRAutoLevel();return A!==-1&&this.hls.levels[p].loadError?A:(A!==-1&&(p=Math.min(A,p)),p)},set:function(A){this._nextAutoLevel=A}}]),o}();const E=x},"./src/controller/audio-stream-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>l});var W=O("./src/polyfills/number.ts"),e=O("./src/controller/base-stream-controller.ts"),k=O("./src/events.ts"),L=O("./src/utils/buffer-helper.ts"),I=O("./src/controller/fragment-tracker.ts"),u=O("./src/types/level.ts"),m=O("./src/types/loader.ts"),i=O("./src/loader/fragment.ts"),g=O("./src/demux/chunk-cache.ts"),w=O("./src/demux/transmuxer-interface.ts"),x=O("./src/types/transmuxer.ts"),E=O("./src/controller/fragment-finders.ts"),o=O("./src/utils/discontinuities.ts"),f=O("./src/errors.ts");function d(){return d=Object.assign?Object.assign.bind():function(T){for(var y=1;y<arguments.length;y++){var _=arguments[y];for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(T[v]=_[v])}return T},d.apply(this,arguments)}function A(T,y){T.prototype=Object.create(y.prototype),T.prototype.constructor=T,s(T,y)}function s(T,y){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,n){return v.__proto__=n,v},s(T,y)}var p=100,C=function(T){A(y,T);function y(v,n,a){var r;return r=T.call(this,v,n,a,"[audio-stream-controller]")||this,r.videoBuffer=null,r.videoTrackCC=-1,r.waitingVideoCC=-1,r.audioSwitch=!1,r.trackId=-1,r.waitingData=null,r.mainDetails=null,r.bufferFlushed=!1,r.cachedTrackLoadedData=null,r._registerListeners(),r}var _=y.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var n=this.hls;n.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),n.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),n.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),n.on(k.Events.ERROR,this.onError,this),n.on(k.Events.BUFFER_RESET,this.onBufferReset,this),n.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),n.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),n.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var n=this.hls;n.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),n.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),n.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),n.off(k.Events.ERROR,this.onError,this),n.off(k.Events.BUFFER_RESET,this.onBufferReset,this),n.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),n.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),n.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(n,a){var r=a.frag,t=a.id,c=a.initPTS;if(t==="main"){var b=r.cc;this.initPTS[r.cc]=c,this.log("InitPTS for cc: "+b+" found from main: "+c),this.videoTrackCC=b,this.state===e.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(n){if(!this.levels){this.startPosition=n,this.state=e.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,a>0&&n===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),n=a,this.state=e.State.IDLE):(this.loadedmetadata=!1,this.state=e.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=n,this.tick()},_.doTick=function(){switch(this.state){case e.State.IDLE:this.doTickIdle();break;case e.State.WAITING_TRACK:{var n,a=this.levels,r=this.trackId,t=a==null||((n=a[r])===null||n===void 0)?void 0:n.details;if(t){if(this.waitForCdnTuneIn(t))break;this.state=e.State.WAITING_INIT_PTS}break}case e.State.FRAG_LOADING_WAITING_RETRY:{var c,b=performance.now(),h=this.retryDate;(!h||b>=h||(c=this.media)!==null&&c!==void 0&&c.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=e.State.IDLE);break}case e.State.WAITING_INIT_PTS:{var D=this.waitingData;if(D){var P=D.frag,j=D.part,N=D.cache,H=D.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=e.State.FRAG_LOADING;var z=N.flush(),J={frag:P,part:j,payload:z,networkDetails:null};this._handleFragmentLoadProgress(J),H&&T.prototype._handleFragmentLoadComplete.call(this,J)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Y=this.getLoadPosition(),le=L.BufferHelper.bufferInfo(this.mediaBuffer,Y,this.config.maxBufferHole),te=(0,E.fragmentWithinToleranceTest)(le.end,this.config.maxFragLookUpTolerance,P);te<0&&(this.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+le.end+" is needed"),this.clearWaitingFragment())}}else this.state=e.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var n=this.waitingData;n&&(this.fragmentTracker.removeFragment(n.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=e.State.IDLE)},_.resetLoadingState=function(){this.clearWaitingFragment(),T.prototype.resetLoadingState.call(this)},_.onTickEnd=function(){var n=this.media;if(!n||!n.readyState)return;this.lastCurrentTime=n.currentTime},_.doTickIdle=function(){var n=this.hls,a=this.levels,r=this.media,t=this.trackId,c=n.config;if(!a||!a[t])return;if(!r&&(this.startFragRequested||!c.startFragPrefetch))return;var b=a[t],h=b.details;if(!h||h.live&&this.levelLastLoaded!==t||this.waitForCdnTuneIn(h)){this.state=e.State.WAITING_TRACK;return}var D=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&D&&(this.bufferFlushed=!1,this.afterBufferFlushed(D,i.ElementaryStreamTypes.AUDIO,m.PlaylistLevelType.AUDIO));var P=this.getFwdBufferInfo(D,m.PlaylistLevelType.AUDIO);if(P===null)return;var j=this.audioSwitch;if(!j&&this._streamEnded(P,h)){n.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=e.State.ENDED;return}var N=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,m.PlaylistLevelType.MAIN),H=P.len,z=this.getMaxBufferLength(N==null?void 0:N.len);if(H>=z&&!j)return;var J=h.fragments,Y=J[0].start,le=P.end;if(j&&r){var te=this.getLoadPosition();le=te,h.PTSKnown&&te<Y&&((P.end>Y||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=Y+.05))}if(N&&le>N.end+h.targetduration)return;if((!N||!N.len)&&P.len)return;var Z=this.getNextFragment(le,h);if(!Z){this.bufferFlushed=!0;return}this.loadFragment(Z,h,le)},_.getMaxBufferLength=function(n){var a=T.prototype.getMaxBufferLength.call(this);return n?Math.max(a,n):a},_.onMediaDetaching=function(){this.videoBuffer=null,T.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(n,a){var r=a.audioTracks;this.resetTransmuxer(),this.levels=r.map(function(t){return new u.Level(t)})},_.onAudioTrackSwitching=function(n,a){var r=!!a.url;this.trackId=a.id;var t=this.fragCurrent;t&&t.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(p):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=e.State.IDLE):this.state=e.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(n,a){this.mainDetails=a.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(k.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},_.onAudioTrackLoaded=function(n,a){var r;if(this.mainDetails==null){this.cachedTrackLoadedData=a;return}var t=this.levels,c=a.details,b=a.id;if(!t){this.warn("Audio tracks were reset while loading level "+b);return}this.log("Track "+b+" loaded ["+c.startSN+","+c.endSN+"],duration:"+c.totalduration);var h=t[b],D=0;if(c.live||(r=h.details)!==null&&r!==void 0&&r.live){var P=this.mainDetails;if(c.fragments[0]||(c.deltaUpdateFailed=!0),c.deltaUpdateFailed||!P)return;!h.details&&c.hasProgramDateTime&&P.hasProgramDateTime?((0,o.alignMediaPlaylistByPDT)(c,P),D=c.fragments[0].start):D=this.alignPlaylists(c,h.details)}h.details=c,this.levelLastLoaded=b,!this.startFragRequested&&(this.mainDetails||!c.live)&&this.setStartPosition(h.details,D),this.state===e.State.WAITING_TRACK&&!this.waitForCdnTuneIn(c)&&(this.state=e.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(n){var a,r=n.frag,t=n.part,c=n.payload,b=this.config,h=this.trackId,D=this.levels;if(!D){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered");return}var P=D[h];console.assert(P,"Audio track is defined on fragment load progress");var j=P.details;console.assert(j,"Audio track details are defined on fragment load progress");var N=b.defaultAudioCodec||P.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new w.default(this.hls,m.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[r.cc],J=(a=r.initSegment)===null||a===void 0?void 0:a.data;if(z!==void 0){var Y=!1,le=t?t.index:-1,te=le!==-1,Z=new x.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,c.byteLength,le,te);H.push(c,J,N,"",r,t,j.totalduration,Y,Z,z)}else{this.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+h);var _e=this.waitingData=this.waitingData||{frag:r,part:t,cache:new g.default,complete:!1},we=_e.cache;we.push(new Uint8Array(c)),this.waitingVideoCC=this.videoTrackCC,this.state=e.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(n){if(this.waitingData){this.waitingData.complete=!0;return}T.prototype._handleFragmentLoadComplete.call(this,n)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(n,a){var r=a.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer||null)},_.onFragBuffered=function(n,a){var r=a.frag,t=a.part;if(r.type!==m.PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&r.type===m.PlaylistLevelType.MAIN){var c;(c=this.videoBuffer||this.media)!==null&&c!==void 0&&c.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(r)){this.warn("Fragment "+r.sn+(t?" p: "+t.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}r.sn!=="initSegment"&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,t)},_.onError=function(n,a){if(a.type===f.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(m.PlaylistLevelType.AUDIO,a);return}switch(a.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.FRAG_PARSING_ERROR:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(m.PlaylistLevelType.AUDIO,a);break;case f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case f.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==e.State.ERROR&&this.state!==e.State.STOPPED&&(this.state=a.fatal?e.State.ERROR:e.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===e.State.PARSING||this.state===e.State.PARSED)){var r=!0,t=this.getFwdBufferInfo(this.mediaBuffer,m.PlaylistLevelType.AUDIO);t&&t.len>.5&&(r=!this.reduceMaxBufferLength(t.len)),r&&(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}},_.onBufferFlushed=function(n,a){var r=a.type;r===i.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===e.State.ENDED&&(this.state=e.State.IDLE))},_._handleTransmuxComplete=function(n){var a,r="audio",t=this.hls,c=n.remuxResult,b=n.chunkMeta,h=this.getCurrentContext(b);if(!h){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(b.level);return}var D=h.frag,P=h.part,j=h.level.details,N=c.audio,H=c.text,z=c.id3,J=c.initSegment;if(this.fragContextChanged(D)||!j)return;if(this.state=e.State.PARSING,this.audioSwitch&&N&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,D,b),t.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:r,tracks:J.tracks})),N){var Y=N.startPTS,le=N.endPTS,te=N.startDTS,Z=N.endDTS;P&&(P.elementaryStreams[i.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:le,startDTS:te,endDTS:Z}),D.setElementaryStreamInfo(i.ElementaryStreamTypes.AUDIO,Y,le,te,Z),this.bufferFragmentData(N,D,P,b)}if(z!=null&&(a=z.samples)!==null&&a!==void 0&&a.length){var _e=d({id:r,frag:D,details:j},z);t.trigger(k.Events.FRAG_PARSING_METADATA,_e)}if(H){var we=d({id:r,frag:D,details:j},H);t.trigger(k.Events.FRAG_PARSING_USERDATA,we)}},_._bufferInitSegment=function(n,a,r){if(this.state!==e.State.PARSING)return;n.video&&delete n.video;var t=n.audio;if(!t)return;t.levelCodec=t.codec,t.id="audio",this.log("Init audio buffer, container:"+t.container+", codecs[parsed]=["+t.codec+"]"),this.hls.trigger(k.Events.BUFFER_CODECS,n);var c=t.initSegment;if(c!=null&&c.byteLength){var b={type:"audio",frag:a,part:null,chunkMeta:r,parent:a.type,data:c};this.hls.trigger(k.Events.BUFFER_APPENDING,b)}this.tick()},_.loadFragment=function(n,a,r){var t=this.fragmentTracker.getState(n);this.fragCurrent=n,(this.audioSwitch||t===I.FragmentState.NOT_LOADED||t===I.FragmentState.PARTIAL)&&(n.sn==="initSegment"?this._loadInitSegment(n,a):a.live&&!(0,W.isFiniteNumber)(this.initPTS[n.cc])?(this.log("Waiting for video PTS in continuity counter "+n.cc+" of live stream before loading audio fragment "+n.sn+" of level "+this.trackId),this.state=e.State.WAITING_INIT_PTS):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,n,a,r)))},_.completeAudioSwitch=function(){var n=this.hls,a=this.media,r=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,n.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:r})},y}(e.default);const l=C},"./src/controller/audio-track-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>E});var W=O("./src/events.ts"),e=O("./src/errors.ts"),k=O("./src/controller/base-playlist-controller.ts"),L=O("./src/types/loader.ts");function I(o,f){for(var d=0;d<f.length;d++){var A=f[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,m(A.key),A)}}function u(o,f,d){return f&&I(o.prototype,f),d&&I(o,d),Object.defineProperty(o,"prototype",{writable:!1}),o}function m(o){var f=i(o,"string");return typeof f=="symbol"?f:String(f)}function i(o,f){if(typeof o!="object"||o===null)return o;var d=o[Symbol.toPrimitive];if(d!==void 0){var A=d.call(o,f||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(o)}function g(o,f){o.prototype=Object.create(f.prototype),o.prototype.constructor=o,w(o,f)}function w(o,f){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,s){return A.__proto__=s,A},w(o,f)}var x=function(o){g(f,o);function f(A){var s;return s=o.call(this,A,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var d=f.prototype;return d.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)},d.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)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(s,p){this.tracks=p.audioTracks||[]},d.onAudioTrackLoaded=function(s,p){var C=p.id,l=p.details,T=this.tracksInGroup[C];if(!T){this.warn("Invalid audio track id "+C);return}var y=T.details;T.details=p.details,this.log("audioTrack "+C+" loaded ["+l.startSN+"-"+l.endSN+"]"),C===this.trackId&&(this.retryCount=0,this.playlistLoaded(C,p,y))},d.onLevelLoading=function(s,p){this.switchLevel(p.level)},d.onLevelSwitching=function(s,p){this.switchLevel(p.level)},d.switchLevel=function(s){var p=this.hls.levels[s];if(!(p!=null&&p.audioGroupIds))return;var C=p.audioGroupIds[p.urlId];if(this.groupId!==C){this.groupId=C;var l=this.tracks.filter(function(y){return!C||y.groupId===C});this.selectDefaultTrack&&!l.some(function(y){return y.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var T={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+C+'" group-id'),this.hls.trigger(W.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},d.onError=function(s,p){if(o.prototype.onError.call(this,s,p),p.fatal||!p.context)return;p.context.type===L.PlaylistContextType.AUDIO_TRACK&&p.context.id===this.trackId&&p.context.groupId===this.groupId&&this.retryLoadingOrFail(p)},d.setAudioTrack=function(s){var p=this.tracksInGroup;if(s<0||s>=p.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var C=p[this.trackId];this.log("Now switching to audio-track index "+s);var l=p[s],T=l.id,y=l.groupId,_=y===void 0?"":y,v=l.name,n=l.type,a=l.url;if(this.trackId=s,this.trackName=v,this.selectDefaultTrack=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:_,name:v,type:n,url:a}),l.details&&!l.details.live)return;var r=this.switchParams(l.url,C==null?void 0:C.details);this.loadPlaylist(r)},d.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var p=this.trackName,C=this.findTrackId(p)||this.findTrackId();C!==-1?this.setAudioTrack(C):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(W.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(s){for(var p=this.tracksInGroup,C=0;C<p.length;C++){var l=p[C];if((!this.selectDefaultTrack||l.default)&&(!s||s===l.name))return l.id}return-1},d.loadPlaylist=function(s){o.prototype.loadPlaylist.call(this);var p=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(p)){var C=p.id,l=p.groupId,T=p.url;if(s)try{T=s.addDirectives(T)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("loading audio-track playlist for id: "+C),this.clearTimer(),this.hls.trigger(W.Events.AUDIO_TRACK_LOADING,{url:T,id:C,groupId:l,deliveryDirectives:s||null})}},u(f,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),f}(k.default);const E=x},"./src/controller/base-playlist-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>I});var W=O("./src/types/level.ts"),e=O("./src/controller/level-helper.ts"),k=O("./src/utils/logger.ts"),L=O("./src/errors.ts"),I=function(){function u(i,g){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=k.logger.log.bind(k.logger,g+":"),this.warn=k.logger.warn.bind(k.logger,g+":"),this.hls=i}var m=u.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(g,w){w.fatal&&(w.type===L.ErrorTypes.NETWORK_ERROR||w.type===L.ErrorTypes.KEY_SYSTEM_ERROR)&&this.stopLoad()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(g,w){var x=w==null?void 0:w.renditionReports;if(x)for(var E=0;E<x.length;E++){var o=x[E],f=void 0;try{f=new self.URL(o.URI,w.url).href}catch(p){k.logger.warn("Could not construct new URL for Rendition Report: "+p),f=o.URI||""}if(f===g.slice(-f.length)){var d=parseInt(o["LAST-MSN"])||(w==null?void 0:w.lastPartSn),A=parseInt(o["LAST-PART"])||(w==null?void 0:w.lastPartIndex);if(this.hls.config.lowLatencyMode){var s=Math.min(w.age-w.partTarget,w.targetduration);A>=0&&s>w.partTarget&&(A+=1)}return new W.HlsUrlParameters(d,A>=0?A:void 0,W.HlsSkip.No)}}},m.loadPlaylist=function(g){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},m.shouldLoadTrack=function(g){return this.canLoad&&g&&!!g.url&&(!g.details||g.details.live)},m.playlistLoaded=function(g,w,x){var E=this,o=w.details,f=w.stats,d=self.performance.now(),A=f.loading.first?Math.max(0,d-f.loading.first):0;if(o.advancedDateTime=Date.now()-A,o.live||x!=null&&x.live){if(o.reloaded(x),x&&this.log("live playlist "+g+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),x&&o.fragments.length>0&&(0,e.mergeDetails)(x,o),!this.canLoad||!o.live)return;var s,p=void 0,C=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var l=this.hls.config.lowLatencyMode,T=o.lastPartSn,y=o.endSN,_=o.lastPartIndex,v=_!==-1,n=T===y,a=l?0:_;v?(p=n?y+1:T,C=n?a:_+1):p=y+1;var r=o.age,t=r+o.ageHeader,c=Math.min(t-o.partTarget,o.targetduration*1.5);if(c>0){if(x&&c>x.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+x.tuneInGoal+" to: "+c+" with playlist age: "+o.age),c=0;else{var b=Math.floor(c/o.targetduration);if(p+=b,C!==void 0){var h=Math.round(c%o.targetduration/o.partTarget);C+=h}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+r.toFixed(2)+"s goal: "+c+" skip sn "+b+" to part "+C)}o.tuneInGoal=c}if(s=this.getDeliveryDirectives(o,w.deliveryDirectives,p,C),l||!n){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(o,w.deliveryDirectives,p,C);var D=this.hls.mainForwardBufferInfo,P=D?D.end-D.len:0,j=(o.edge-P)*1e3,N=(0,e.computeReloadInterval)(o,j);o.updated?d>this.requestScheduled+N&&(this.requestScheduled=f.loading.start):this.requestScheduled=-1,p!==void 0&&o.canBlockReload?this.requestScheduled=f.loading.first+N-(o.partTarget*1e3||1e3):this.requestScheduled=(this.requestScheduled===-1?d:this.requestScheduled)+N;var H=this.requestScheduled-d;H=Math.max(0,H),this.log("reload live playlist "+g+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return E.loadPlaylist(s)},H)}else this.clearTimer()},m.getDeliveryDirectives=function(g,w,x,E){var o=(0,W.getSkipValue)(g,x);return w!=null&&w.skip&&g.deltaUpdateFailed&&(x=w.msn,E=w.part,o=W.HlsSkip.No),new W.HlsUrlParameters(x,E,o)},m.retryLoadingOrFail=function(g){var w=this,x=this.hls.config,E=this.retryCount<x.levelLoadingMaxRetry;if(E){var o;if(this.requestScheduled=-1,this.retryCount++,g.details.indexOf("LoadTimeOut")>-1&&(o=g.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+g.details+'"'),this.loadPlaylist();else{var f=Math.min(Math.pow(2,this.retryCount)*x.levelLoadingRetryDelay,x.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return w.loadPlaylist()},f),this.warn("retry playlist loading #"+this.retryCount+" in "+f+' ms after "'+g.details+'"')}}else this.warn('cannot recover from error "'+g.details+'"'),this.clearTimer(),g.fatal=!0;return E},u}()},"./src/controller/base-stream-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{State:()=>v,default:()=>n});var W=O("./src/polyfills/number.ts"),e=O("./src/task-loop.ts"),k=O("./src/controller/fragment-tracker.ts"),L=O("./src/utils/buffer-helper.ts"),I=O("./src/utils/logger.ts"),u=O("./src/events.ts"),m=O("./src/errors.ts"),i=O("./src/types/transmuxer.ts"),g=O("./src/utils/mp4-tools.ts"),w=O("./src/utils/discontinuities.ts"),x=O("./src/controller/fragment-finders.ts"),E=O("./src/controller/level-helper.ts"),o=O("./src/loader/fragment-loader.ts"),f=O("./src/crypt/decrypter.ts"),d=O("./src/utils/time-ranges.ts"),A=O("./src/types/loader.ts");function s(a,r){for(var t=0;t<r.length;t++){var c=r[t];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,C(c.key),c)}}function p(a,r,t){return r&&s(a.prototype,r),t&&s(a,t),Object.defineProperty(a,"prototype",{writable:!1}),a}function C(a){var r=l(a,"string");return typeof r=="symbol"?r:String(r)}function l(a,r){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var c=t.call(a,r||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(a)}function T(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function y(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,_(a,r)}function _(a,r){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,b){return c.__proto__=b,c},_(a,r)}var v={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},n=function(a){y(r,a);function r(c,b,h,D){var P;return P=a.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=v.STOPPED,P.media=null,P.mediaBuffer=null,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.keyLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=D,P.log=I.logger.log.bind(I.logger,D+":"),P.warn=I.logger.warn.bind(I.logger,D+":"),P.hls=c,P.fragmentLoader=new o.default(c.config),P.keyLoader=h,P.fragmentTracker=b,P.config=c.config,P.decrypter=new f.default(c.config),c.on(u.Events.LEVEL_SWITCHING,P.onLevelSwitching,T(P)),P}var t=r.prototype;return t.doTick=function(){this.onTickEnd()},t.onTickEnd=function(){},t.startLoad=function(b){},t.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort();var b=this.fragCurrent;b&&(b.abortRequests(),this.fragmentTracker.removeFragment(b)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},t._streamEnded=function(b,h){if(h.live||b.nextStart||!b.end||!this.media)return!1;var D=h.partList;if(D!=null&&D.length){var P=D[D.length-1],j=L.BufferHelper.isBuffered(this.media,P.start+P.duration/2);return j}var N=h.fragments[h.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(N)},t.getLevelDetails=function(){if(this.levels&&this.levelLastLoaded!==null){var b;return(b=this.levels[this.levelLastLoaded])===null||b===void 0?void 0:b.details}},t.onMediaAttached=function(b,h){var D=this.media=this.mediaBuffer=h.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var P=this.config;this.levels&&P.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(P.startPosition)},t.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&this.onvseeking&&this.onvended&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},t.onMediaSeeking=function(){var b=this.config,h=this.fragCurrent,D=this.media,P=this.mediaBuffer,j=this.state,N=D?D.currentTime:0,H=L.BufferHelper.bufferInfo(P||D,N,b.maxBufferHole);if(this.log("media seeking to "+((0,W.isFiniteNumber)(N)?N.toFixed(3):N)+", state: "+j),this.state===v.ENDED)this.resetLoadingState();else if(h){var z=b.maxFragLookUpTolerance,J=h.start-z,Y=h.start+h.duration+z;if(!H.len||Y<H.start||J>H.end){var le=N>Y;(N<J||le)&&(le&&h.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),h.abortRequests()),this.resetLoadingState())}}D&&(this.lastCurrentTime=N),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=N),this.tickImmediate()},t.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},t.onLevelSwitching=function(b,h){this.fragLoadError=0},t.onHandlerDestroying=function(){this.stopLoad(),a.prototype.onHandlerDestroying.call(this)},t.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(u.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,a.prototype.onHandlerDestroyed.call(this)},t.loadFragment=function(b,h,D){this._loadFragForPlayback(b,h,D)},t._loadFragForPlayback=function(b,h,D){var P=this,j=function(H){if(P.fragContextChanged(b)){P.warn("Fragment "+b.sn+(H.part?" p: "+H.part.index:"")+" of level "+b.level+" was dropped during download."),P.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,P._handleFragmentLoadProgress(H)};this._doFragLoad(b,h,D,j).then(function(N){if(!N)return;P.fragLoadError=0;var H=P.state;if(P.fragContextChanged(b)){(H===v.FRAG_LOADING||!P.fragCurrent&&H===v.PARSING)&&(P.fragmentTracker.removeFragment(b),P.state=v.IDLE);return}"payload"in N&&(P.log("Loaded fragment "+b.sn+" of level "+b.level),P.hls.trigger(u.Events.FRAG_LOADED,N)),P._handleFragmentLoadComplete(N)}).catch(function(N){if(P.state===v.STOPPED||P.state===v.ERROR)return;P.warn(N),P.resetFragmentLoading(b)})},t.flushMainBuffer=function(b,h,D){if(D===void 0&&(D=null),!(b-h))return;var P={startOffset:b,endOffset:h,type:D};this.fragLoadError=0,this.hls.trigger(u.Events.BUFFER_FLUSHING,P)},t._loadInitSegment=function(b,h){var D=this;this._doFragLoad(b,h).then(function(P){if(!P||D.fragContextChanged(b)||!D.levels)throw new Error("init load aborted");return P}).then(function(P){var j=D.hls,N=P.payload,H=b.decryptdata;if(N&&N.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var z=self.performance.now();return D.decrypter.decrypt(new Uint8Array(N),H.key.buffer,H.iv.buffer).then(function(J){var Y=self.performance.now();return j.trigger(u.Events.FRAG_DECRYPTED,{frag:b,payload:J,stats:{tstart:z,tdecrypt:Y}}),P.payload=J,P})}return P}).then(function(P){var j=D.fragCurrent,N=D.hls,H=D.levels;if(!H)throw new Error("init load aborted, missing levels");var z=H[b.level].details;console.assert(z,"Level details are defined when init segment is loaded");var J=b.stats;D.state=v.IDLE,D.fragLoadError=0,b.data=new Uint8Array(P.payload),J.parsing.start=J.buffering.start=self.performance.now(),J.parsing.end=J.buffering.end=self.performance.now(),P.frag===j&&N.trigger(u.Events.FRAG_BUFFERED,{stats:J,frag:j,part:null,id:b.type}),D.tick()}).catch(function(P){if(D.state===v.STOPPED||D.state===v.ERROR)return;D.warn(P),D.resetFragmentLoading(b)})},t.fragContextChanged=function(b){var h=this.fragCurrent;return!b||!h||b.level!==h.level||b.sn!==h.sn||b.urlId!==h.urlId},t.fragBufferedComplete=function(b,h){var D,P,j,N,H=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log("Buffered "+b.type+" sn: "+b.sn+(h?" part: "+h.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" (frag:["+((D=b.startPTS)!=null?D:NaN).toFixed(3)+"-"+((P=b.endPTS)!=null?P:NaN).toFixed(3)+"] > buffer:"+(H?d.default.toString(L.BufferHelper.getBuffered(H)):"(detached)")+")"),this.state=v.IDLE,!H)return;!this.loadedmetadata&&b.type==A.PlaylistLevelType.MAIN&&H.buffered.length&&((j=this.fragCurrent)===null||j===void 0?void 0:j.sn)===((N=this.fragPrevious)===null||N===void 0?void 0:N.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick()},t.seekToStartPos=function(){},t._handleFragmentLoadComplete=function(b){var h=this.transmuxer;if(!h)return;var D=b.frag,P=b.part,j=b.partsLoaded,N=!j||j.length===0||j.some(function(z){return!z}),H=new i.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,P?P.index:-1,!N);h.flush(H)},t._handleFragmentLoadProgress=function(b){},t._doFragLoad=function(b,h,D,P){var j,N=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");var H=null;if(b.encrypted&&!((j=b.decryptdata)!==null&&j!==void 0&&j.key)?(this.log("Loading key for "+b.sn+" of ["+h.startSN+"-"+h.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=v.KEY_LOADING,this.fragCurrent=b,H=this.keyLoader.load(b).then(function(te){if(!N.fragContextChanged(te.frag))return N.hls.trigger(u.Events.KEY_LOADED,te),N.state===v.KEY_LOADING&&(N.state=v.IDLE),te}),this.hls.trigger(u.Events.KEY_LOADING,{frag:b}),this.throwIfFragContextChanged("KEY_LOADING")):!b.encrypted&&h.encryptedFragments.length&&this.keyLoader.loadClear(b,h.encryptedFragments),D=Math.max(b.start,D||0),this.config.lowLatencyMode&&h){var z=h.partList;if(z&&P){D>b.end&&h.fragmentHint&&(b=h.fragmentHint);var J=this.getNextPart(z,b,D);if(J>-1){var Y=z[J];return this.log("Loading part sn: "+b.sn+" p: "+Y.index+" cc: "+b.cc+" of playlist ["+h.startSN+"-"+h.endSN+"] parts [0-"+J+"-"+(z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=Y.start+Y.duration,this.state=v.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:b,part:z[J],targetBufferTime:D}),this.throwIfFragContextChanged("FRAG_LOADING parts"),H?H.then(function(te){return!te||N.fragContextChanged(te.frag)?null:N.doFragPartsLoad(b,z,J,P)}).catch(function(te){return N.handleFragLoadError(te)}):this.doFragPartsLoad(b,z,J,P).catch(function(te){return N.handleFragLoadError(te)})}else if(!b.url||this.loadedEndOfParts(z,D))return Promise.resolve(null)}}this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(h?"of ["+h.startSN+"-"+h.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(D.toFixed(3))),(0,W.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=v.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:b,targetBufferTime:D}),this.throwIfFragContextChanged("FRAG_LOADING");var le=this.config.progressive;return le&&H?H.then(function(te){return!te||N.fragContextChanged(te==null?void 0:te.frag)?null:N.fragmentLoader.load(b,P)}).catch(function(te){return N.handleFragLoadError(te)}):Promise.all([this.fragmentLoader.load(b,le?P:void 0),H]).then(function(te){var Z=te[0];return!le&&Z&&P&&P(Z),Z}).catch(function(te){return N.handleFragLoadError(te)})},t.throwIfFragContextChanged=function(b){if(this.fragCurrent===null)throw new Error("frag load aborted, context changed in "+b)},t.doFragPartsLoad=function(b,h,D,P){var j=this;return new Promise(function(N,H){var z=[],J=function Y(le){var te=h[le];j.fragmentLoader.loadPart(b,te,P).then(function(Z){z[te.index]=Z;var _e=Z.part;j.hls.trigger(u.Events.FRAG_LOADED,Z);var we=h[le+1];if(we&&we.fragment===b)Y(le+1);else return N({frag:b,part:_e,partsLoaded:z})}).catch(H)};J(D)})},t.handleFragLoadError=function(b){if("data"in b){var h=b.data;b.data&&h.details===m.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(h.frag,h.part):this.hls.trigger(u.Events.ERROR,h)}else this.hls.trigger(u.Events.ERROR,{type:m.ErrorTypes.OTHER_ERROR,details:m.ErrorDetails.INTERNAL_EXCEPTION,err:b,fatal:!0});return null},t._handleTransmuxerFlush=function(b){var h=this.getCurrentContext(b);if(!h||this.state!==v.PARSING){!this.fragCurrent&&this.state!==v.STOPPED&&this.state!==v.ERROR&&(this.state=v.IDLE);return}var D=h.frag,P=h.part,j=h.level,N=self.performance.now();D.stats.parsing.end=N,P&&(P.stats.parsing.end=N),this.updateLevelTiming(D,P,j,b.partial)},t.getCurrentContext=function(b){var h=this.levels,D=b.level,P=b.sn,j=b.part;if(!h||!h[D])return this.warn("Levels object was unset while buffering fragment "+P+" of level "+D+". The current chunk will not be buffered."),null;var N=h[D],H=j>-1?(0,E.getPartWith)(N,P,j):null,z=H?H.fragment:(0,E.getFragmentWithSN)(N,P,this.fragCurrent);return z?{frag:z,part:H,level:N}:null},t.bufferFragmentData=function(b,h,D,P){if(!b||this.state!==v.PARSING)return;var j=b.data1,N=b.data2,H=j;if(j&&N&&(H=(0,g.appendUint8Array)(j,N)),!H||!H.length)return;var z={type:b.type,frag:h,part:D,chunkMeta:P,parent:h.type,data:H};this.hls.trigger(u.Events.BUFFER_APPENDING,z),b.dropped&&b.independent&&!D&&this.flushBufferGap(h)},t.flushBufferGap=function(b){var h=this.media;if(!h)return;if(!L.BufferHelper.isBuffered(h,h.currentTime)){this.flushMainBuffer(0,b.start);return}var D=h.currentTime,P=L.BufferHelper.bufferInfo(h,D,0),j=b.duration,N=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),H=Math.max(Math.min(b.start-N,P.end-N),D+N);b.start-H>N&&this.flushMainBuffer(H,b.start)},t.getFwdBufferInfo=function(b,h){var D=this.config,P=this.getLoadPosition();if(!(0,W.isFiniteNumber)(P))return null;var j=L.BufferHelper.bufferInfo(b,P,D.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var N=this.fragmentTracker.getBufferedFrag(P,h);if(N&&j.nextStart<N.end)return L.BufferHelper.bufferInfo(b,P,Math.max(j.nextStart,D.maxBufferHole))}return j},t.getMaxBufferLength=function(b){var h=this.config,D;return b?D=Math.max(8*h.maxBufferSize/b,h.maxBufferLength):D=h.maxBufferLength,Math.min(D,h.maxMaxBufferLength)},t.reduceMaxBufferLength=function(b){var h=this.config,D=b||h.maxBufferLength;return h.maxMaxBufferLength>=D?(h.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+h.maxMaxBufferLength+"s"),!0):!1},t.getNextFragment=function(b,h){var D=h.fragments,P=D.length;if(!P)return null;var j=this.config,N=D[0].start,H;if(h.live){var z=j.initialLiveManifestSize;if(P<z)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+z+")"),null;!h.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(h,D),this.startPosition=H?this.hls.liveSyncPosition||H.start:b)}else b<=N&&(H=D[0]);if(!H){var J=j.lowLatencyMode?h.partEnd:h.fragmentEnd;H=this.getFragmentAtPosition(b,J,h)}return this.mapToInitFragWhenRequired(H)},t.mapToInitFragWhenRequired=function(b){return b!=null&&b.initSegment&&!(b!=null&&b.initSegment.data)&&!this.bitrateTest?b.initSegment:b},t.getNextPart=function(b,h,D){for(var P=-1,j=!1,N=!0,H=0,z=b.length;H<z;H++){var J=b[H];if(N=N&&!J.independent,P>-1&&D<J.start)break;var Y=J.loaded;Y?P=-1:(j||J.independent||N)&&J.fragment===h&&(P=H),j=Y}return P},t.loadedEndOfParts=function(b,h){var D=b[b.length-1];return D&&h>D.start&&D.loaded},t.getInitialLiveFragment=function(b,h){var D=this.fragPrevious,P=null;if(D){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),P=(0,x.findFragmentByPDT)(h,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!P){var j=D.sn+1;if(j>=b.startSN&&j<=b.endSN){var N=h[j-b.startSN];D.cc===N.cc&&(P=N,this.log("Live playlist, switching playlist, load frag with next SN: "+P.sn))}P||(P=(0,x.findFragWithCC)(h,D.cc),P&&this.log("Live playlist, switching playlist, load frag with same CC: "+P.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(P=this.getFragmentAtPosition(H,this.bitrateTest?b.fragmentEnd:b.edge,b))}return P},t.getFragmentAtPosition=function(b,h,D){var P=this.config,j=this.fragPrevious,N=D.fragments,H=D.endSN,z=D.fragmentHint,J=P.maxFragLookUpTolerance,Y=!!(P.lowLatencyMode&&D.partList&&z);Y&&z&&!this.bitrateTest&&(N=N.concat(z),H=z.sn);var le;if(b<h){var te=b>h-J?0:J;le=(0,x.findFragmentByPTS)(j,N,b,te)}else le=N[N.length-1];if(le){var Z=le.sn-D.startSN;if(this.fragmentTracker.getState(le)===k.FragmentState.OK&&(j=le),j&&le.sn===j.sn&&!Y){var _e=j&&le.level===j.level;if(_e){var we=N[Z+1];le.sn<H&&this.fragmentTracker.getState(we)!==k.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+we.sn),le=we):le=null}}}return le},t.synchronizeToLiveEdge=function(b){var h=this.config,D=this.media;if(!D)return;var P=this.hls.liveSyncPosition,j=D.currentTime,N=b.fragments[0].start,H=b.edge,z=j>=N-h.maxFragLookUpTolerance&&j<=H;if(P!==null&&D.duration>P&&(j<P||!z)){var J=h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:h.liveMaxLatencyDurationCount*b.targetduration;(!z&&D.readyState<4||j<H-J)&&(this.loadedmetadata||(this.nextLoadPosition=P),D.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+P.toFixed(3)),D.currentTime=P))}},t.alignPlaylists=function(b,h){var D=this.levels,P=this.levelLastLoaded,j=this.fragPrevious,N=P!==null?D[P]:null,H=b.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var z=b.fragments[0].start,J=!h,Y=b.alignedSliding&&(0,W.isFiniteNumber)(z);if(J||!Y&&!z){(0,w.alignStream)(j,N,b);var le=b.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(h?h.startSN:"na")+"->"+b.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+H),le}return z},t.waitForCdnTuneIn=function(b){var h=3;return b.live&&b.canBlockReload&&b.partTarget&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*h)},t.setStartPosition=function(b,h){var D=this.startPosition;if(D<h&&(D=-1),D===-1||this.lastCurrentTime===-1){var P=b.startTimeOffset;(0,W.isFiniteNumber)(P)?(D=h+P,P<0&&(D+=b.totalduration),D=Math.min(Math.max(h,D),h+b.totalduration),this.log("Start time offset "+P+" found in playlist, adjust startPosition to "+D),this.startPosition=D):b.live?D=this.hls.liveSyncPosition||h:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},t.getLoadPosition=function(){var b=this.media,h=0;return this.loadedmetadata&&b?h=b.currentTime:this.nextLoadPosition&&(h=this.nextLoadPosition),h},t.handleFragLoadAborted=function(b,h){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(h?" part"+h.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},t.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b)&&this.state!==v.FRAG_LOADING_WAITING_RETRY)&&(this.state=v.IDLE)},t.onFragmentOrKeyLoadError=function(b,h){if(h.fatal){this.stopLoad(),this.state=v.ERROR;return}var D=this.config;if(h.chunkMeta){var P=this.getCurrentContext(h.chunkMeta);P&&(h.frag=P.frag,h.levelRetry=!0,this.fragLoadError=D.fragLoadingMaxRetry)}var j=h.frag;if(!j||j.type!==b)return;var N=this.fragCurrent;if(console.assert(N&&j.sn===N.sn&&j.level===N.level&&j.urlId===N.urlId,"Frag load error must match current frag to retry"),this.fragLoadError+1<=D.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var H=Math.min(Math.pow(2,this.fragLoadError)*D.fragLoadingRetryDelay,D.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+b+" "+j.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else h.levelRetry?(b===A.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(I.logger.error(h.details+" reaches max retry, redispatch as fatal ..."),h.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},t.afterBufferFlushed=function(b,h,D){if(!b)return;var P=L.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(h,P,D),this.state===v.ENDED&&this.resetLoadingState()},t.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},t.resetStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var h=this.levels?this.levels[b].details:null;h!=null&&h.live?(this.startPosition=-1,this.setStartPosition(h,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},t.updateLevelTiming=function(b,h,D,P){var j=this,N=D.details;console.assert(!!N,"level.details must be defined");var H=Object.keys(b.elementaryStreams).reduce(function(z,J){var Y=b.elementaryStreams[J];if(Y){var le=Y.endPTS-Y.startPTS;if(le<=0)return j.warn("Could not parse fragment "+b.sn+" "+J+" duration reliably ("+le+")"),z||!1;var te=P?0:(0,E.updateFragPTSDTS)(N,b,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return j.hls.trigger(u.Events.LEVEL_PTS_UPDATED,{details:N,level:D,drift:te,type:J,frag:b,start:Y.startPTS,end:Y.endPTS}),!0}return z},!1);H||(this.warn("Found no media in fragment "+b.sn+" of level "+D.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=v.PARSED,this.hls.trigger(u.Events.FRAG_PARSED,{frag:b,part:h})},t.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},p(r,[{key:"state",get:function(){return this._state},set:function(b){var h=this._state;h!==b&&(this._state=b,this.log(h+"->"+b))}}]),r}(e.default)},"./src/controller/buffer-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>x});var W=O("./src/polyfills/number.ts"),e=O("./src/events.ts"),k=O("./src/utils/logger.ts"),L=O("./src/errors.ts"),I=O("./src/utils/buffer-helper.ts"),u=O("./src/utils/mediasource-helper.ts"),m=O("./src/loader/fragment.ts"),i=O("./src/controller/buffer-operation-queue.ts"),g=(0,u.getMediaSource)(),w=/([ha]vc.)(?:\.[^.,]+)+/,x=function(){function E(f){var d=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.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var A=d.media,s=d.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),A&&(A.removeEventListener("emptied",d._onMediaEmptied),d.updateMediaElementDuration(),d.hls.trigger(e.Events.MEDIA_ATTACHED,{media:A})),s&&s.removeEventListener("sourceopen",d._onMediaSourceOpen),d.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var A=d.media,s=d._objectUrl;A&&A.src!==s&&k.logger.error("Media element src was set while attaching MediaSource ("+s+" > "+A.src+")")},this.hls=f,this._initSourceBuffer(),this.registerListeners()}var o=E.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},o.registerListeners=function(){var d=this.hls;d.on(e.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(e.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(e.Events.BUFFER_RESET,this.onBufferReset,this),d.on(e.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.on(e.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(e.Events.BUFFER_EOS,this.onBufferEos,this),d.on(e.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.on(e.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.on(e.Events.FRAG_PARSED,this.onFragParsed,this),d.on(e.Events.FRAG_CHANGED,this.onFragChanged,this)},o.unregisterListeners=function(){var d=this.hls;d.off(e.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(e.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(e.Events.BUFFER_RESET,this.onBufferReset,this),d.off(e.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.off(e.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(e.Events.BUFFER_EOS,this.onBufferEos,this),d.off(e.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.off(e.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.off(e.Events.FRAG_PARSED,this.onFragParsed,this),d.off(e.Events.FRAG_CHANGED,this.onFragChanged,this)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new i.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},o.onManifestParsed=function(d,A){var s=2;(A.audio&&!A.video||!A.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(d,A){var s=this.media=A.media;if(s&&g){var p=this.mediaSource=new g;p.addEventListener("sourceopen",this._onMediaSourceOpen),p.addEventListener("sourceended",this._onMediaSourceEnded),p.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(p),this._objectUrl=s.src,s.addEventListener("emptied",this._onMediaEmptied)}},o.onMediaDetaching=function(){var d=this.media,A=this.mediaSource,s=this._objectUrl;if(A){if(k.logger.log("[buffer-controller]: media source detaching"),A.readyState==="open")try{A.endOfStream()}catch(p){k.logger.warn("[buffer-controller]: onMediaDetaching: "+p.message+" while calling endOfStream")}this.onBufferReset(),A.removeEventListener("sourceopen",this._onMediaSourceOpen),A.removeEventListener("sourceended",this._onMediaSourceEnded),A.removeEventListener("sourceclose",this._onMediaSourceClose),d&&(d.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),d.src===s?(d.removeAttribute("src"),d.load()):k.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(e.Events.MEDIA_DETACHED,void 0)},o.onBufferReset=function(){var d=this;this.getSourceBufferTypes().forEach(function(A){var s=d.sourceBuffer[A];try{s&&(d.removeBufferListeners(A),d.mediaSource&&d.mediaSource.removeSourceBuffer(s),d.sourceBuffer[A]=void 0)}catch(p){k.logger.warn("[buffer-controller]: Failed to reset the "+A+" buffer",p)}}),this._initSourceBuffer()},o.onBufferCodecs=function(d,A){var s=this,p=this.getSourceBufferTypes().length;if(Object.keys(A).forEach(function(C){if(p){var l=s.tracks[C];if(l&&typeof l.buffer.changeType=="function"){var T=A[C],y=T.id,_=T.codec,v=T.levelCodec,n=T.container,a=T.metadata,r=(l.levelCodec||l.codec).replace(w,"$1"),t=(v||_).replace(w,"$1");if(r!==t){var c=n+";codecs="+(v||_);s.appendChangeType(C,c),k.logger.log("[buffer-controller]: switching codec "+r+" to "+t),s.tracks[C]={buffer:l.buffer,codec:_,container:n,levelCodec:v,metadata:a,id:y}}}}else s.pendingTracks[C]=A[C]}),p)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(d,A){var s=this,p=this.operationQueue,C={execute:function(){var T=s.sourceBuffer[d];T&&(k.logger.log("[buffer-controller]: changing "+d+" sourceBuffer type to "+A),T.changeType(A)),p.shiftAndExecuteNext(d)},onStart:function(){},onComplete:function(){},onError:function(T){k.logger.warn("[buffer-controller]: Failed to change "+d+" SourceBuffer type",T)}};p.append(C,d)},o.onBufferAppending=function(d,A){var s=this,p=this.hls,C=this.operationQueue,l=this.tracks,T=A.data,y=A.type,_=A.frag,v=A.part,n=A.chunkMeta,a=n.buffering[y],r=self.performance.now();a.start=r;var t=_.stats.buffering,c=v?v.stats.buffering:null;t.start===0&&(t.start=r),c&&c.start===0&&(c.start=r);var b=l.audio,h=!1;y==="audio"&&(b==null?void 0:b.container)==="audio/mpeg"&&(h=!this.lastMpegAudioChunk||n.id===1||this.lastMpegAudioChunk.sn!==n.sn,this.lastMpegAudioChunk=n);var D=_.start,P={execute:function(){if(a.executeStart=self.performance.now(),h){var N=s.sourceBuffer[y];if(N){var H=D-N.timestampOffset;Math.abs(H)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+D+" (delta: "+H+") sn: "+_.sn+")"),N.timestampOffset=D)}}s.appendExecutor(T,y)},onStart:function(){},onComplete:function(){var N=self.performance.now();a.executeEnd=a.end=N,t.first===0&&(t.first=N),c&&c.first===0&&(c.first=N);var H=s.sourceBuffer,z={};for(var J in H)z[J]=I.BufferHelper.getBuffered(H[J]);s.appendError=0,s.hls.trigger(e.Events.BUFFER_APPENDED,{type:y,frag:_,part:v,chunkMeta:n,parent:_.type,timeRanges:z})},onError:function(N){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+y+" SourceBuffer",N);var H={type:L.ErrorTypes.MEDIA_ERROR,parent:_.type,details:L.ErrorDetails.BUFFER_APPEND_ERROR,err:N,fatal:!1};N.code===DOMException.QUOTA_EXCEEDED_ERR?H.details=L.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,H.details=L.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>p.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+p.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),H.fatal=!0,p.stopLoad())),p.trigger(e.Events.ERROR,H)}};C.append(P,y)},o.onBufferFlushing=function(d,A){var s=this,p=this.operationQueue,C=function(T){return{execute:s.removeExecutor.bind(s,T,A.startOffset,A.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(e.Events.BUFFER_FLUSHED,{type:T})},onError:function(_){k.logger.warn("[buffer-controller]: Failed to remove from "+T+" SourceBuffer",_)}}};A.type?p.append(C(A.type),A.type):this.getSourceBufferTypes().forEach(function(l){p.append(C(l),l)})},o.onFragParsed=function(d,A){var s=this,p=A.frag,C=A.part,l=[],T=C?C.elementaryStreams:p.elementaryStreams;T[m.ElementaryStreamTypes.AUDIOVIDEO]?l.push("audiovideo"):(T[m.ElementaryStreamTypes.AUDIO]&&l.push("audio"),T[m.ElementaryStreamTypes.VIDEO]&&l.push("video"));var y=function(){var v=self.performance.now();p.stats.buffering.end=v,C&&(C.stats.buffering.end=v);var n=C?C.stats:p.stats;s.hls.trigger(e.Events.FRAG_BUFFERED,{frag:p,part:C,stats:n,id:p.type})};l.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+p.type+" level: "+p.level+" sn: "+p.sn),this.blockBuffers(y,l)},o.onFragChanged=function(d,A){this.flushBackBuffer()},o.onBufferEos=function(d,A){var s=this,p=this.getSourceBufferTypes().reduce(function(C,l){var T=s.sourceBuffer[l];return T&&(!A.type||A.type===l)&&(T.ending=!0,T.ended||(T.ended=!0,k.logger.log("[buffer-controller]: "+l+" sourceBuffer now EOS"))),C&&!!(!T||T.ended)},!0);p&&(k.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(function(){s.getSourceBufferTypes().forEach(function(l){var T=s.sourceBuffer[l];T&&(T.ending=!1)});var C=s.mediaSource;if(!C||C.readyState!=="open"){C&&k.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+C.readyState);return}k.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),C.endOfStream()}))},o.onLevelUpdated=function(d,A){var s=A.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},o.flushBackBuffer=function(){var d=this.hls,A=this.details,s=this.media,p=this.sourceBuffer;if(!s||A===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var l=A.live&&d.config.liveBackBufferLength!==null?d.config.liveBackBufferLength:d.config.backBufferLength;if(!(0,W.isFiniteNumber)(l)||l<0)return;var T=s.currentTime,y=A.levelTargetDuration,_=Math.max(l,y),v=Math.floor(T/y)*y-_;C.forEach(function(n){var a=p[n];if(a){var r=I.BufferHelper.getBuffered(a);if(r.length>0&&v>r.start(0)){if(d.trigger(e.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),A.live)d.trigger(e.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v});else if(a.ended&&r.end(r.length-1)-T<y*2){k.logger.info("[buffer-controller]: Cannot flush "+n+" back buffer while SourceBuffer is in ended state");return}d.trigger(e.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:n})}}})},o.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var d=this.details,A=this.hls,s=this.media,p=this.mediaSource,C=d.fragments[0].start+d.totalduration,l=s.duration,T=(0,W.isFiniteNumber)(p.duration)?p.duration:0;d.live&&A.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),p.duration=Infinity,this.updateSeekableRange(d)):(C>T&&C>l||!(0,W.isFiniteNumber)(l))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),p.duration=C)},o.updateSeekableRange=function(d){var A=this.mediaSource,s=d.fragments,p=s.length;if(p&&d.live&&A!==null&&A!==void 0&&A.setLiveSeekableRange){var C=Math.max(0,s[0].start),l=Math.max(C,C+d.totalduration);A.setLiveSeekableRange(C,l)}},o.checkPendingTracks=function(){var d=this.bufferCodecEventsExpected,A=this.operationQueue,s=this.pendingTracks,p=Object.keys(s).length;if(p&&!d||p===2){this.createSourceBuffers(s),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(e.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(l){A.executeNext(l)})}},o.createSourceBuffers=function(d){var A=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var p=0;for(var C in d)if(!A[C]){var l=d[C];if(!l)throw Error("source buffer exists for track "+C+", however track does not");var T=l.levelCodec||l.codec,y=l.container+";codecs="+T;k.logger.log("[buffer-controller]: creating sourceBuffer("+y+")");try{var _=A[C]=s.addSourceBuffer(y),v=C;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[C]={buffer:_,codec:T,container:l.container,levelCodec:l.levelCodec,metadata:l.metadata,id:l.id},p++}catch(n){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+n.message),this.hls.trigger(e.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:n,mimeType:y})}}p&&this.hls.trigger(e.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(d){var A=this.operationQueue,s=A.current(d);s.onStart()},o._onSBUpdateEnd=function(d){var A=this.operationQueue,s=A.current(d);s.onComplete(),A.shiftAndExecuteNext(d)},o._onSBUpdateError=function(d,A){k.logger.error("[buffer-controller]: "+d+" SourceBuffer error",A),this.hls.trigger(e.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(d);s&&s.onError(A)},o.removeExecutor=function(d,A,s){var p=this.media,C=this.mediaSource,l=this.operationQueue,T=this.sourceBuffer,y=T[d];if(!p||!C||!y){k.logger.warn("[buffer-controller]: Attempting to remove from the "+d+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(d);return}var _=(0,W.isFiniteNumber)(p.duration)?p.duration:Infinity,v=(0,W.isFiniteNumber)(C.duration)?C.duration:Infinity,n=Math.max(0,A),a=Math.min(s,_,v);a>n&&!y.ending?(y.ended=!1,k.logger.log("[buffer-controller]: Removing ["+n+","+a+"] from the "+d+" SourceBuffer"),console.assert(!y.updating,d+" sourceBuffer must not be updating"),y.remove(n,a)):l.shiftAndExecuteNext(d)},o.appendExecutor=function(d,A){var s=this.operationQueue,p=this.sourceBuffer,C=p[A];if(!C){k.logger.warn("[buffer-controller]: Attempting to append to the "+A+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(A);return}C.ended=!1,console.assert(!C.updating,A+" sourceBuffer must not be updating"),C.appendBuffer(d)},o.blockBuffers=function(d,A){var s=this;if(A===void 0&&(A=this.getSourceBufferTypes()),!A.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(d);return}var p=this.operationQueue,C=A.map(function(l){return p.appendBlocker(l)});Promise.all(C).then(function(){d(),A.forEach(function(l){var T=s.sourceBuffer[l];(!T||!T.updating)&&p.shiftAndExecuteNext(l)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(d,A,s){var p=this.sourceBuffer[d];if(!p)return;var C=s.bind(this,d);this.listeners[d].push({event:A,listener:C}),p.addEventListener(A,C)},o.removeBufferListeners=function(d){var A=this.sourceBuffer[d];if(!A)return;this.listeners[d].forEach(function(s){A.removeEventListener(s.event,s.listener)})},E}()},"./src/controller/buffer-operation-queue.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>e});var W=O("./src/utils/logger.ts"),e=function(){function k(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var L=k.prototype;return L.append=function(u,m){var i=this.queues[m];i.push(u),i.length===1&&this.buffers[m]&&this.executeNext(m)},L.insertAbort=function(u,m){var i=this.queues[m];i.unshift(u),this.executeNext(m)},L.appendBlocker=function(u){var m,i=new Promise(function(w){m=w}),g={execute:m,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,u),i},L.executeNext=function(u){var m=this.buffers,i=this.queues,g=m[u],w=i[u];if(w.length){var x=w[0];try{x.execute()}catch(E){W.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),x.onError(E),(!g||!g.updating)&&(w.shift(),this.executeNext(u))}}},L.shiftAndExecuteNext=function(u){this.queues[u].shift(),this.executeNext(u)},L.current=function(u){return this.queues[u][0]},k}()},"./src/controller/cap-level-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>m});var W=O("./src/events.ts");function e(i,g){for(var w=0;w<g.length;w++){var x=g[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(i,L(x.key),x)}}function k(i,g,w){return g&&e(i.prototype,g),w&&e(i,w),Object.defineProperty(i,"prototype",{writable:!1}),i}function L(i){var g=I(i,"string");return typeof g=="symbol"?g:String(g)}function I(i,g){if(typeof i!="object"||i===null)return i;var w=i[Symbol.toPrimitive];if(w!==void 0){var x=w.call(i,g||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(i)}var u=function(){function i(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 g=i.prototype;return g.setStreamController=function(x){this.streamController=x},g.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},g.registerListeners=function(){var x=this.hls;x.on(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),x.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),x.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},g.unregisterListener=function(){var x=this.hls;x.off(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),x.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),x.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},g.onFpsDropLevelCapping=function(x,E){i.isLevelAllowed(E.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(E.droppedLevel)},g.onMediaAttaching=function(x,E){this.media=E.media instanceof HTMLVideoElement?E.media:null,this.clientRect=null},g.onManifestParsed=function(x,E){var o=this.hls;this.restrictedLevels=[],this.firstLevel=E.firstLevel,o.config.capLevelToPlayerSize&&E.video&&this.startCapping()},g.onBufferCodecs=function(x,E){var o=this.hls;o.config.capLevelToPlayerSize&&E.video&&this.startCapping()},g.onMediaDetaching=function(){this.stopCapping()},g.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var x=this.hls.levels;if(x.length){var E=this.hls;E.autoLevelCapping=this.getMaxLevel(x.length-1),E.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=E.autoLevelCapping}}},g.getMaxLevel=function(x){var E=this,o=this.hls.levels;if(!o.length)return-1;var f=o.filter(function(d,A){return i.isLevelAllowed(A,E.restrictedLevels)&&A<=x});return this.clientRect=null,i.getMaxLevelByMediaSize(f,this.mediaWidth,this.mediaHeight)},g.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()},g.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},g.getDimensions=function(){if(this.clientRect)return this.clientRect;var x=this.media,E={width:0,height:0};if(x){var o=x.getBoundingClientRect();E.width=o.width,E.height=o.height,!E.width&&!E.height&&(E.width=o.right-o.left||x.width||0,E.height=o.bottom-o.top||x.height||0)}return this.clientRect=E,E},i.isLevelAllowed=function(x,E){return E===void 0&&(E=[]),E.indexOf(x)===-1},i.getMaxLevelByMediaSize=function(x,E,o){if(!x||!x.length)return-1;for(var f=function(C,l){return l?C.width!==l.width||C.height!==l.height:!0},d=x.length-1,A=0;A<x.length;A+=1){var s=x[A];if((s.width>=E||s.height>=o)&&f(s,x[A+1])){d=A;break}}return d},k(i,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var x=1;if(!this.hls.config.ignoreDevicePixelRatio)try{x=self.devicePixelRatio}catch(E){}return x}}]),i}();const m=u},"./src/controller/cmcd-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>o});var W=O("./src/events.ts"),e=O("./src/types/cmcd.ts"),k=O("./src/utils/buffer-helper.ts"),L=O("./src/utils/logger.ts");function I(f,d){for(var A=0;A<d.length;A++){var s=d[A];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(f,m(s.key),s)}}function u(f,d,A){return d&&I(f.prototype,d),A&&I(f,A),Object.defineProperty(f,"prototype",{writable:!1}),f}function m(f){var d=i(f,"string");return typeof d=="symbol"?d:String(d)}function i(f,d){if(typeof f!="object"||f===null)return f;var A=f[Symbol.toPrimitive];if(A!==void 0){var s=A.call(f,d||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(f)}function g(f,d){var A=typeof Symbol!="undefined"&&f[Symbol.iterator]||f["@@iterator"];if(A)return(A=A.call(f)).next.bind(A);if(Array.isArray(f)||(A=w(f))||d&&f&&typeof f.length=="number"){A&&(f=A);var s=0;return function(){return s>=f.length?{done:!0}:{done:!1,value:f[s++]}}}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 w(f,d){if(!f)return;if(typeof f=="string")return x(f,d);var A=Object.prototype.toString.call(f).slice(8,-1);if(A==="Object"&&f.constructor&&(A=f.constructor.name),A==="Map"||A==="Set")return Array.from(f);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return x(f,d)}function x(f,d){(d==null||d>f.length)&&(d=f.length);for(var A=0,s=new Array(d);A<d;A++)s[A]=f[A];return s}function E(){return E=Object.assign?Object.assign.bind():function(f){for(var d=1;d<arguments.length;d++){var A=arguments[d];for(var s in A)Object.prototype.hasOwnProperty.call(A,s)&&(f[s]=A[s])}return f},E.apply(this,arguments)}var o=function(){function f(A){var s=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(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(l){try{s.apply(l,{ot:e.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(T){L.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(l){try{var T=l.frag,y=s.hls.levels[T.level],_=s.getObjectType(T),v={d:T.duration*1e3,ot:_};(_===e.CMCDObjectType.VIDEO||_===e.CMCDObjectType.AUDIO||_==e.CMCDObjectType.MUXED)&&(v.br=y.bitrate/1e3,v.tb=s.getTopBandwidth(_)/1e3,v.bl=s.getBufferLength(_)),s.apply(l,v)}catch(n){L.logger.warn("Could not generate segment CMCD data.",n)}},this.hls=A;var p=this.config=A.config,C=p.cmcd;C!=null&&(p.pLoader=this.createPlaylistLoader(),p.fLoader=this.createFragmentLoader(),this.sid=C.sessionId||f.uuid(),this.cid=C.contentId,this.useHeaders=C.useHeaders===!0,this.registerListeners())}var d=f.prototype;return d.registerListeners=function(){var s=this.hls;s.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var s=this.hls;s.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(s,p){this.media=p.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(s,p){var C,l;this.audioBuffer=(C=p.tracks.audio)===null||C===void 0?void 0:C.buffer,this.videoBuffer=(l=p.tracks.video)===null||l===void 0?void 0:l.buffer},d.createData=function(){var s;return{v:e.CMCDVersion,sf:e.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(s,p){p===void 0&&(p={}),E(p,this.createData());var C=p.ot===e.CMCDObjectType.INIT||p.ot===e.CMCDObjectType.VIDEO||p.ot===e.CMCDObjectType.MUXED;if(this.starved&&C&&(p.bs=!0,p.su=!0,this.starved=!1),p.su==null&&(p.su=this.buffering),this.useHeaders){var l=f.toHeaders(p);if(!Object.keys(l).length)return;s.headers||(s.headers={}),E(s.headers,l)}else{var T=f.toQuery(p);if(!T)return;s.url=f.appendQueryToUri(s.url,T)}},d.getObjectType=function(s){var p=s.type;return p==="subtitle"?e.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?e.CMCDObjectType.INIT:p==="audio"?e.CMCDObjectType.AUDIO:p==="main"?this.hls.audioTracks.length?e.CMCDObjectType.VIDEO:e.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(s){var p=0,C,l=this.hls;if(s===e.CMCDObjectType.AUDIO)C=l.audioTracks;else{var T=l.maxAutoLevel,y=T>-1?T+1:l.levels.length;C=l.levels.slice(0,y)}for(var _=g(C),v;!(v=_()).done;){var n=v.value;n.bitrate>p&&(p=n.bitrate)}return p>0?p:NaN},d.getBufferLength=function(s){var p=this.hls.media,C=s===e.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!C||!p)return NaN;var l=k.BufferHelper.bufferInfo(C,p.currentTime,this.config.maxBufferHole);return l.len*1e3},d.createPlaylistLoader=function(){var s=this.config.pLoader,p=this.applyPlaylistData,C=s||this.config.loader;return function(){function l(y){this.loader=void 0,this.loader=new C(y)}var T=l.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(_,v,n){p(_),this.loader.load(_,v,n)},u(l,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),l}()},d.createFragmentLoader=function(){var s=this.config.fLoader,p=this.applyFragmentData,C=s||this.config.loader;return function(){function l(y){this.loader=void 0,this.loader=new C(y)}var T=l.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(_,v,n){p(_),this.loader.load(_,v,n)},u(l,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),l}()},f.uuid=function(){var s=URL.createObjectURL(new Blob),p=s.toString();return URL.revokeObjectURL(s),p.slice(p.lastIndexOf("/")+1)},f.serialize=function(s){for(var p=[],C=function(P){return!Number.isNaN(P)&&P!=null&&P!==""&&P!==!1},l=function(P){return Math.round(P)},T=function(P){return l(P/100)*100},y=function(P){return encodeURIComponent(P)},_={br:l,d:l,bl:T,dl:T,mtp:T,nor:y,rtp:T,tb:l},v=Object.keys(s||{}).sort(),n=g(v),a;!(a=n()).done;){var r=a.value,t=s[r];if(!C(t))continue;if(r==="v"&&t===1)continue;if(r=="pr"&&t===1)continue;var c=_[r];c&&(t=c(t));var b=typeof t,h=void 0;r==="ot"||r==="sf"||r==="st"?h=r+"="+t:b==="boolean"?h=r:b==="number"?h=r+"="+t:h=r+"="+JSON.stringify(t),p.push(h)}return p.join(",")},f.toHeaders=function(s){for(var p=Object.keys(s),C={},l=["Object","Request","Session","Status"],T=[{},{},{},{}],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},_=0,v=p;_<v.length;_++){var n=v[_],a=y[n]!=null?y[n]:1;T[a][n]=s[n]}for(var r=0;r<T.length;r++){var t=f.serialize(T[r]);t&&(C["CMCD-"+l[r]]=t)}return C},f.toQuery=function(s){return"CMCD="+encodeURIComponent(f.serialize(s))},f.appendQueryToUri=function(s,p){if(!p)return s;var C=s.includes("?")?"&":"?";return""+s+C+p},f}()},"./src/controller/eme-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>_});var W=O("./src/events.ts"),e=O("./src/errors.ts"),k=O("./src/utils/logger.ts"),L=O("./src/utils/mediakeys-helper.ts"),I=O("./src/utils/keysystem-util.ts"),u=O("./src/utils/numeric-encoding-utils.ts"),m=O("./src/loader/level-key.ts"),i=O("./src/utils/hex.ts"),g=O("./src/utils/mp4-tools.ts"),w=O("./node_modules/eventemitter3/index.js"),x=O.n(w);function E(v,n){v.prototype=Object.create(n.prototype),v.prototype.constructor=v,s(v,n)}function o(v){var n=typeof Map=="function"?new Map:void 0;return o=function(r){if(r===null||!A(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(r))return n.get(r);n.set(r,t)}function t(){return f(r,arguments,p(this).constructor)}return t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),s(t,r)},o(v)}function f(v,n,a){return d()?f=Reflect.construct.bind():f=function(t,c,b){var h=[null];h.push.apply(h,c);var D=Function.bind.apply(t,h),P=new D;return b&&s(P,b.prototype),P},f.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(v){return!1}}function A(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function s(v,n){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},s(v,n)}function p(v){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},p(v)}var C=3,l="[eme]",T=function(){function v(a){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=v.CDMCleanupPromise?[v.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=k.logger.debug.bind(k.logger,l),this.log=k.logger.log.bind(k.logger,l),this.warn=k.logger.warn.bind(k.logger,l),this.error=k.logger.error.bind(k.logger,l),this.hls=a,this.config=a.config,this.registerListeners()}var n=v.prototype;return n.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},n.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_LOADED,this.onManifestLoaded,this)},n.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_LOADED,this.onManifestLoaded,this)},n.getLicenseServerUrl=function(r){var t=this.config,c=t.drmSystems,b=t.widevineLicenseUrl,h=c[r];if(h)return h.licenseUrl;if(r===L.KeySystems.WIDEVINE&&b)return b;throw new Error('no license server URL configured for key-system "'+r+'"')},n.getServerCertificateUrl=function(r){var t=this.config.drmSystems,c=t[r];if(c)return c.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+r+'"]')},n.attemptKeySystemAccess=function(r){var t=this,c=this.hls.levels,b=function(j,N,H){return!!j&&H.indexOf(j)===N},h=c.map(function(P){return P.audioCodec}).filter(b),D=c.map(function(P){return P.videoCodec}).filter(b);return h.length+D.length===0&&D.push("avc1.42e01e"),new Promise(function(P,j){var N=function H(z){var J=z.shift();t.getMediaKeysPromise(J,h,D).then(function(Y){return P({keySystem:J,mediaKeys:Y})}).catch(function(Y){z.length?H(z):Y instanceof y?j(Y):j(new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:Y,fatal:!0},Y.message))})};N(r)})},n.requestMediaKeySystemAccess=function(r,t){var c=this.config.requestMediaKeySystemAccessFunc;if(!(typeof c=="function")){var b="Configured requestMediaKeySystemAccess is not a function "+c;return L.requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(b="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(b))}return c(r,t)},n.getMediaKeysPromise=function(r,t,c){var b=this,h=(0,L.getSupportedMediaKeySystemConfigurations)(r,t,c,this.config.drmSystemOptions),D=this.keySystemAccessPromises[r],P=D==null?void 0:D.keySystemAccess;if(!P){this.log('Requesting encrypted media "'+r+'" key-system access with config: '+JSON.stringify(h)),P=this.requestMediaKeySystemAccess(r,h);var j=this.keySystemAccessPromises[r]={keySystemAccess:P};return P.catch(function(N){b.log('Failed to obtain access to key-system "'+r+'": '+N)}),P.then(function(N){b.log('Access for key-system "'+N.keySystem+'" obtained');var H=b.fetchServerCertificate(r);return b.log('Create media-keys for "'+r+'"'),j.mediaKeys=N.createMediaKeys().then(function(z){return b.log('Media-keys created for "'+r+'"'),H.then(function(J){return J?b.setMediaKeysServerCertificate(z,r,J):z})}),j.mediaKeys.catch(function(z){b.error('Failed to create media-keys for "'+r+'"}: '+z)}),j.mediaKeys})}return P.then(function(){return D.mediaKeys})},n.createMediaKeySessionContext=function(r){var t=r.decryptdata,c=r.keySystem,b=r.mediaKeys;console.assert(!!b,"mediaKeys is defined"),this.log('Creating key-system session "'+c+'" keyId: '+i.default.hexDump(t.keyId||[]));var h=b.createSession(),D={decryptdata:t,keySystem:c,mediaKeys:b,mediaKeysSession:h,keyStatus:"status-pending"};return this.mediaKeySessions.push(D),D},n.renewKeySession=function(r){var t=r.decryptdata;if(t.pssh){var c=this.createMediaKeySessionContext(r),b=this.getKeyIdString(t),h="cenc";this.keyIdToKeySessionPromise[b]=this.generateRequestWithPreferredKeySession(c,h,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(r)},n.getKeyIdString=function(r){if(!r)throw new Error("Could not read keyId of undefined decryptdata");if(r.keyId===null)throw new Error("keyId is null");return i.default.hexDump(r.keyId)},n.updateKeySession=function(r,t){var c,b=r.mediaKeysSession;return this.log('Updating key-session "'+b.sessionId+'" for keyID '+i.default.hexDump(((c=r.decryptdata)===null||c===void 0?void 0:c.keyId)||[])+`
} (data length: `+(t&&t.byteLength)+")"),b.update(t)},n.selectKeySystemFormat=function(r){var t=Object.keys(r.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+r.sn+" "+r.type+": "+r.level+") key formats "+t.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise},n.getKeyFormatPromise=function(r){var t=this;return new Promise(function(c,b){var h=(0,L.getKeySystemsForConfig)(t.config),D=r.map(L.keySystemFormatToKeySystemDomain).filter(function(P){return!!P&&h.indexOf(P)!==-1});return t.getKeySystemSelectionPromise(D).then(function(P){var j=P.keySystem,N=(0,L.keySystemDomainToKeySystemFormat)(j);N?c(N):b(new Error('Unable to find format for key-system "'+j+'"'))}).catch(b)})},n.loadKey=function(r){var t=this,c=r.keyInfo.decryptdata,b=this.getKeyIdString(c),h="(keyId: "+b+' format: "'+c.keyFormat+'" method: '+c.method+" uri: "+c.uri+")";this.log("Starting session for key "+h);var D=this.keyIdToKeySessionPromise[b];return D||(D=this.keyIdToKeySessionPromise[b]=this.getKeySystemForKeyPromise(c).then(function(P){var j=P.keySystem,N=P.mediaKeys;return t.throwIfDestroyed(),t.log("Handle encrypted media sn: "+r.frag.sn+" "+r.frag.type+": "+r.frag.level+" using key "+h),t.attemptSetMediaKeys(j,N).then(function(){t.throwIfDestroyed();var H=t.createMediaKeySessionContext({keySystem:j,mediaKeys:N,decryptdata:c}),z="cenc";return t.generateRequestWithPreferredKeySession(H,z,c.pssh,"playlist-key")})}),D.catch(function(P){return t.handleError(P)})),D},n.throwIfDestroyed=function(r){if(r===void 0&&(r="Invalid state"),!this.hls)throw new Error("invalid state")},n.handleError=function(r){if(!this.hls)return;this.error(r.message),r instanceof y?this.hls.trigger(W.Events.ERROR,r.data):this.hls.trigger(W.Events.ERROR,{type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:r,fatal:!0})},n.getKeySystemForKeyPromise=function(r){var t=this.getKeyIdString(r),c=this.keyIdToKeySessionPromise[t];if(!c){var b=(0,L.keySystemFormatToKeySystemDomain)(r.keyFormat),h=b?[b]:(0,L.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(h)}return c},n.getKeySystemSelectionPromise=function(r){if(r.length||(r=(0,L.getKeySystemsForConfig)(this.config)),r.length===0)throw new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(r)},n._onMediaEncrypted=function(r){var t=this,c=r.initDataType,b=r.initData;if(this.debug('"'+r.type+'" event: init data type: "'+c+'"'),b===null)return;var h,D;if(c==="sinf"&&this.config.drmSystems[L.KeySystems.FAIRPLAY]){var P=(0,g.bin2str)(new Uint8Array(b));try{var j=(0,u.base64Decode)(JSON.parse(P).sinf),N=(0,g.parseSinf)(new Uint8Array(j));if(!N)return;h=N.subarray(8,24),D=L.KeySystems.FAIRPLAY}catch(we){this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{var H=(0,g.parsePssh)(b);if(H===null)return;H.version===0&&H.systemId===L.KeySystemIds.WIDEVINE&&H.data&&(h=H.data.subarray(8,24)),D=(0,L.keySystemIdToKeySystemDomain)(H.systemId)}if(!D||!h)return;for(var z=i.default.hexDump(h),J=this.keyIdToKeySessionPromise,Y=this.mediaKeySessions,le=J[z],te=function(De){var Ee=Y[De],xe=Ee.decryptdata;if(xe.pssh||!xe.keyId)return"continue";var ve=i.default.hexDump(xe.keyId);if(z===ve||xe.uri.replace(/-/g,"").indexOf(z)!==-1)return le=J[ve],delete J[ve],xe.pssh=new Uint8Array(b),xe.keyId=h,le=J[z]=le.then(function(){return t.generateRequestWithPreferredKeySession(Ee,c,b,"encrypted-event-key-match")}),"break"},Z=0;Z<Y.length;Z++){var _e=te(Z);if(_e==="continue")continue;if(_e==="break")break}le||(le=J[z]=this.getKeySystemSelectionPromise([D]).then(function(we){var De,Ee=we.keySystem,xe=we.mediaKeys;t.throwIfDestroyed();var ve=new m.LevelKey("ISO-23001-7",z,(De=(0,L.keySystemDomainToKeySystemFormat)(Ee))!=null?De:"");return ve.pssh=new Uint8Array(b),ve.keyId=h,t.attemptSetMediaKeys(Ee,xe).then(function(){t.throwIfDestroyed();var X=t.createMediaKeySessionContext({decryptdata:ve,keySystem:Ee,mediaKeys:xe});return t.generateRequestWithPreferredKeySession(X,c,b,"encrypted-event-no-match")})})),le.catch(function(we){return t.handleError(we)})},n._onWaitingForKey=function(r){this.log('"'+r.type+'" event')},n.attemptSetMediaKeys=function(r,t){var c=this,b=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'+r+'"');var h=Promise.all(b).then(function(){if(!c.media)throw new Error("Attempted to set mediaKeys without media element attached");return c.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(h),h.then(function(){c.log('Media-keys set for "'+r+'"'),b.push(h),c.setMediaKeysQueue=c.setMediaKeysQueue.filter(function(D){return b.indexOf(D)===-1})})},n.generateRequestWithPreferredKeySession=function(r,t,c,b){var h,D,P=this,j=(h=this.config.drmSystems)===null||h===void 0||((D=h[r.keySystem])===null||D===void 0)?void 0:D.generateRequest;if(j)try{var N=j.call(this.hls,t,c,r);if(!N)throw new Error("Invalid response from configured generateRequest filter");t=N.initDataType,c=r.decryptdata.pssh=N.initData?new Uint8Array(N.initData):null}catch(le){var H;if(this.warn(le.message),(H=this.hls)!==null&&H!==void 0&&H.config.debug)throw le}if(c===null)return this.log('Skipping key-session request for "'+b+'" (no initData)'),Promise.resolve(r);var z=this.getKeyIdString(r.decryptdata);this.log('Generating key-session request for "'+b+'": '+z+" (init data type: "+t+" length: "+(c?c.byteLength:null)+")");var J=new(x());r.mediaKeysSession.onmessage=function(le){var te=r.mediaKeysSession;if(!te){J.emit("error",new Error("invalid state"));return}var Z=le.messageType,_e=le.message;P.log('"'+Z+'" message event for session "'+te.sessionId+'" message size: '+_e.byteLength),Z==="license-request"||Z==="license-renewal"?P.renewLicense(r,_e).catch(function(we){P.handleError(we),J.emit("error",we)}):Z==="license-release"?r.keySystem===L.KeySystems.FAIRPLAY&&(P.updateKeySession(r,(0,I.strToUtf8array)("acknowledged")),P.removeSession(r)):P.warn('unhandled media key message type "'+Z+'"')},r.mediaKeysSession.onkeystatuseschange=function(le){var te=r.mediaKeysSession;if(!te){J.emit("error",new Error("invalid state"));return}P.onKeyStatusChange(r);var Z=r.keyStatus;J.emit("keyStatus",Z),Z==="expired"&&(P.warn(r.keySystem+" expired for key "+z),P.renewKeySession(r))};var Y=new Promise(function(le,te){J.on("error",te),J.on("keyStatus",function(Z){Z.startsWith("usable")?le():Z==="output-restricted"?te(new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):Z==="internal-error"?te(new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+Z+'"')):Z==="expired"?te(new Error("key expired while generating request")):P.warn('unhandled key status change "'+Z+'"')})});return r.mediaKeysSession.generateRequest(t,c).then(function(){var le;P.log('Request generated for key-session "'+((le=r.mediaKeysSession)===null||le===void 0?void 0:le.sessionId)+'" keyId: '+z)}).catch(function(le){throw new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_NO_SESSION,error:le,fatal:!1},"Error generating key-session request: "+le)}).then(function(){return Y}).catch(function(le){throw J.removeAllListeners(),P.removeSession(r),le}).then(function(){return J.removeAllListeners(),r})},n.onKeyStatusChange=function(r){var t=this;r.mediaKeysSession.keyStatuses.forEach(function(c,b){t.log('key status change "'+c+'" for keyStatuses keyId: '+i.default.hexDump("buffer"in b?new Uint8Array(b.buffer,b.byteOffset,b.byteLength):new Uint8Array(b))+" session keyId: "+i.default.hexDump(new Uint8Array(r.decryptdata.keyId||[]))+" uri: "+r.decryptdata.uri),r.keyStatus=c})},n.fetchServerCertificate=function(r){var t=this;return new Promise(function(c,b){var h=t.getServerCertificateUrl(r);if(!h)return c();t.log('Fetching serverCertificate for "'+r+'"');var D=new XMLHttpRequest;D.open("GET",h,!0),D.responseType="arraybuffer",D.onreadystatechange=function(){D.readyState===XMLHttpRequest.DONE&&(D.status===200?c(D.response):b(new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:D},'"'+r+'" certificate request XHR failed ('+h+"). Status: "+D.status+" ("+D.statusText+")")))},D.send()})},n.setMediaKeysServerCertificate=function(r,t,c){var b=this;return new Promise(function(h,D){r.setServerCertificate(c).then(function(P){b.log("setServerCertificate "+(P?"success":"not supported by CDM")+" ("+(c==null?void 0:c.byteLength)+') on "'+t+'"'),h(r)}).catch(function(P){D(new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:P,fatal:!0},P.message))})})},n.renewLicense=function(r,t){var c=this;return this.requestLicense(r,new Uint8Array(t)).then(function(b){return c.updateKeySession(r,new Uint8Array(b)).catch(function(h){throw new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:h,fatal:!0},h.message)})})},n.setupLicenseXHR=function(r,t,c,b){var h=this,D=this.config.licenseXhrSetup;return D?Promise.resolve().then(function(){if(!c.decryptdata)throw new Error("Key removed");return D.call(h.hls,r,t,c,b)}).catch(function(P){if(!c.decryptdata)throw P;return r.open("POST",t,!0),D.call(h.hls,r,t,c,b)}).then(function(P){r.readyState||r.open("POST",t,!0);var j=P||b;return{xhr:r,licenseChallenge:j}}):(r.open("POST",t,!0),Promise.resolve({xhr:r,licenseChallenge:b}))},n.requestLicense=function(r,t){var c=this;return new Promise(function(b,h){var D=c.getLicenseServerUrl(r.keySystem);c.log("Sending license request to URL: "+D);var P=new XMLHttpRequest;P.responseType="arraybuffer",P.onreadystatechange=function(){if(!c.hls||!r.mediaKeysSession)return h(new Error("invalid state"));if(P.readyState===4)if(P.status===200){c._requestLicenseFailureCount=0;var j=P.response;c.log("License received "+(j instanceof ArrayBuffer?j.byteLength:j));var N=c.config.licenseResponseCallback;if(N)try{j=N.call(c.hls,P,D,r)}catch(z){c.error(z)}b(j)}else if(c._requestLicenseFailureCount++,c._requestLicenseFailureCount>C||P.status>=400&&P.status<500)h(new y({type:e.ErrorTypes.KEY_SYSTEM_ERROR,details:e.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:P},"License Request XHR failed ("+D+"). Status: "+P.status+" ("+P.statusText+")"));else{var H=C-c._requestLicenseFailureCount+1;c.warn("Retrying license request, "+H+" attempts left"),c.requestLicense(r,t).then(b,h)}},r.licenseXhr&&r.licenseXhr.readyState!==XMLHttpRequest.DONE&&r.licenseXhr.abort(),r.licenseXhr=P,c.setupLicenseXHR(P,D,r,t).then(function(j){var N=j.xhr,H=j.licenseChallenge;N.send(H)})})},n.onMediaAttached=function(r,t){if(!this.config.emeEnabled)return;var c=t.media;this.media=c,c.addEventListener("encrypted",this.onMediaEncrypted),c.addEventListener("waitingforkey",this.onWaitingForKey)},n.onMediaDetached=function(){var r=this,t=this.media,c=this.mediaKeySessions;t&&(t.removeEventListener("encrypted",this.onMediaEncrypted),t.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},m.LevelKey.clearKeyUriToKeyIdMap();var b=c.length;v.CDMCleanupPromise=Promise.all(c.map(function(h){return r.removeSession(h)}).concat(t==null?void 0:t.setMediaKeys(null).catch(function(h){r.log("Could not clear media keys: "+h+". media.src: "+(t==null?void 0:t.src))}))).then(function(){b&&(r.log("finished closing key sessions and clearing media keys"),c.length=0)}).catch(function(h){r.log("Could not close sessions and clear media keys: "+h+". media.src: "+(t==null?void 0:t.src))})},n.onManifestLoaded=function(r,t){var c=t.sessionKeys;if(!c||!this.config.emeEnabled)return;if(!this.keyFormatPromise){var b=c.reduce(function(h,D){return h.indexOf(D.keyFormat)===-1&&h.push(D.keyFormat),h},[]);this.log("Selecting key-system from session-keys "+b.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(b)}},n.removeSession=function(r){var t=this,c=r.mediaKeysSession,b=r.licenseXhr;if(c){this.log("Remove licenses and keys and close session "+c.sessionId),c.onmessage=null,c.onkeystatuseschange=null,b&&b.readyState!==XMLHttpRequest.DONE&&b.abort(),r.mediaKeysSession=r.decryptdata=r.licenseXhr=void 0;var h=this.mediaKeySessions.indexOf(r);return h>-1&&this.mediaKeySessions.splice(h,1),c.remove().catch(function(D){t.log("Could not remove session: "+D)}).then(function(){return c.close()}).catch(function(D){t.log("Could not close session: "+D)})}},v}();T.CDMCleanupPromise=void 0;var y=function(v){E(n,v);function n(a,r){var t;return t=v.call(this,r)||this,t.data=void 0,t.data=a,a.err=a.error,t}return n}(o(Error));const _=T},"./src/controller/fps-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>L});var W=O("./src/events.ts"),e=O("./src/utils/logger.ts"),k=function(){function I(m){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=m,this.registerListeners()}var u=I.prototype;return u.setStreamController=function(i){this.streamController=i},u.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},u.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching)},u.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},u.onMediaAttaching=function(i,g){var w=this.hls.config;if(w.capLevelOnFPSDrop){var x=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=x,x&&typeof x.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),w.fpsDroppedMonitoringPeriod)}},u.checkFPS=function(i,g,w){var x=performance.now();if(g){if(this.lastTime){var E=x-this.lastTime,o=w-this.lastDroppedFrames,f=g-this.lastDecodedFrames,d=1e3*o/E,A=this.hls;if(A.trigger(W.Events.FPS_DROP,{currentDropped:o,currentDecoded:f,totalDroppedFrames:w}),d>0&&o>A.config.fpsDroppedMonitoringThreshold*f){var s=A.currentLevel;e.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(A.autoLevelCapping===-1||A.autoLevelCapping>=s)&&(s=s-1,A.trigger(W.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:A.currentLevel}),A.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=x,this.lastDroppedFrames=w,this.lastDecodedFrames=g}},u.checkFPSInterval=function(){var i=this.media;if(i)if(this.isVideoPlaybackQualityAvailable){var g=i.getVideoPlaybackQuality();this.checkFPS(i,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(i,i.webkitDecodedFrameCount,i.webkitDroppedFrameCount)},I}();const L=k},"./src/controller/fragment-finders.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{findFragWithCC:()=>m,findFragmentByPDT:()=>k,findFragmentByPTS:()=>L,fragmentWithinToleranceTest:()=>I,pdtWithinToleranceTest:()=>u});var W=O("./src/polyfills/number.ts"),e=O("./src/utils/binary-search.ts");function k(i,g,w){if(g===null||!Array.isArray(i)||!i.length||!(0,W.isFiniteNumber)(g))return null;var x=i[0].programDateTime;if(g<(x||0))return null;var E=i[i.length-1].endProgramDateTime;if(g>=(E||0))return null;w=w||0;for(var o=0;o<i.length;++o){var f=i[o];if(u(g,w,f))return f}return null}function L(i,g,w,x){w===void 0&&(w=0),x===void 0&&(x=0);var E=null;if(i?E=g[i.sn-g[0].sn+1]||null:w===0&&g[0].start===0&&(E=g[0]),E&&I(w,x,E)===0)return E;var o=e.default.search(g,I.bind(null,w,x));return o&&(o!==i||!E)?o:E}function I(i,g,w){if(i===void 0&&(i=0),g===void 0&&(g=0),w.start<=i&&w.start+w.duration>i)return 0;var x=Math.min(g,w.duration+(w.deltaPTS?w.deltaPTS:0));return w.start+w.duration-x<=i?1:w.start-x>i&&w.start?-1:0}function u(i,g,w){var x=Math.min(g,w.duration+(w.deltaPTS?w.deltaPTS:0))*1e3,E=w.endProgramDateTime||0;return E-x>i}function m(i,g){return e.default.search(i,function(w){return w.cc<g?1:w.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{FragmentState:()=>k,FragmentTracker:()=>L});var W=O("./src/events.ts"),e=O("./src/types/loader.ts"),k;(function(m){m.NOT_LOADED="NOT_LOADED",m.APPENDING="APPENDING",m.PARTIAL="PARTIAL",m.OK="OK"})(k||(k={}));var L=function(){function m(g){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=g,this._registerListeners()}var i=m.prototype;return i._registerListeners=function(){var w=this.hls;w.on(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.on(W.Events.FRAG_LOADED,this.onFragLoaded,this)},i._unregisterListeners=function(){var w=this.hls;w.off(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.off(W.Events.FRAG_LOADED,this.onFragLoaded,this)},i.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},i.getAppendedFrag=function(w,x){if(x===e.PlaylistLevelType.MAIN){var E=this.activeFragment,o=this.activeParts;if(!E)return null;if(o)for(var f=o.length;f--;){var d=o[f],A=d?d.end:E.appendedPTS;if(d.start<=w&&A!==void 0&&w<=A)return f>9&&(this.activeParts=o.slice(f-9)),d}else if(E.start<=w&&E.appendedPTS!==void 0&&w<=E.appendedPTS)return E}return this.getBufferedFrag(w,x)},i.getBufferedFrag=function(w,x){for(var E=this.fragments,o=Object.keys(E),f=o.length;f--;){var d=E[o[f]];if((d==null?void 0:d.body.type)===x&&d.buffered){var A=d.body;if(A.start<=w&&w<=A.end)return A}}return null},i.detectEvictedFragments=function(w,x,E){var o=this;this.timeRanges&&(this.timeRanges[w]=x),Object.keys(this.fragments).forEach(function(f){var d=o.fragments[f];if(!d)return;if(!d.buffered&&!d.loaded){d.body.type===E&&o.removeFragment(d.body);return}var A=d.range[w];if(!A)return;A.time.some(function(s){var p=!o.isTimeBuffered(s.startPTS,s.endPTS,x);return p&&o.removeFragment(d.body),p})})},i.detectPartialFragments=function(w){var x=this,E=this.timeRanges,o=w.frag,f=w.part;if(!E||o.sn==="initSegment")return;var d=u(o),A=this.fragments[d];if(!A)return;Object.keys(E).forEach(function(s){var p=o.elementaryStreams[s];if(!p)return;var C=E[s],l=f!==null||p.partial===!0;A.range[s]=x.getBufferedTimes(o,f,l,C)}),A.loaded=null,Object.keys(A.range).length?(A.buffered=!0,A.body.endList&&(this.endListFragments[A.body.type]=A)):this.removeFragment(A.body)},i.fragBuffered=function(w){var x=u(w),E=this.fragments[x];E&&(E.loaded=null,E.buffered=!0)},i.getBufferedTimes=function(w,x,E,o){for(var f={time:[],partial:E},d=x?x.start:w.start,A=x?x.end:w.end,s=w.minEndPTS||A,p=w.maxStartPTS||d,C=0;C<o.length;C++){var l=o.start(C)-this.bufferPadding,T=o.end(C)+this.bufferPadding;if(p>=l&&s<=T){f.time.push({startPTS:Math.max(d,o.start(C)),endPTS:Math.min(A,o.end(C))});break}else if(d<T&&A>l)f.partial=!0,f.time.push({startPTS:Math.max(d,o.start(C)),endPTS:Math.min(A,o.end(C))});else if(A<=l)break}return f},i.getPartialFragment=function(w){var x=null,E,o,f,d=0,A=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(p){var C=s[p];if(!C)return;I(C)&&(o=C.body.start-A,f=C.body.end+A,w>=o&&w<=f&&(E=Math.min(w-o,f-w),d<=E&&(x=C.body,d=E)))}),x},i.isEndListAppended=function(w){var x=this.endListFragments[w];return x!==void 0&&(x.buffered||I(x))},i.getState=function(w){var x=u(w),E=this.fragments[x];return E?E.buffered?I(E)?k.PARTIAL:k.OK:k.APPENDING:k.NOT_LOADED},i.isTimeBuffered=function(w,x,E){for(var o,f,d=0;d<E.length;d++){if(o=E.start(d)-this.bufferPadding,f=E.end(d)+this.bufferPadding,w>=o&&x<=f)return!0;if(x<=o)return!1}return!1},i.onFragLoaded=function(w,x){var E=x.frag,o=x.part;if(E.sn==="initSegment"||E.bitrateTest||o)return;var f=u(E);this.fragments[f]={body:E,loaded:x,buffered:!1,range:Object.create(null)}},i.onBufferAppended=function(w,x){var E=this,o=x.frag,f=x.part,d=x.timeRanges;if(o.type===e.PlaylistLevelType.MAIN)if(this.activeFragment!==o&&(this.activeFragment=o,o.appendedPTS=void 0),f){var A=this.activeParts;A||(this.activeParts=A=[]),A.push(f)}else this.activeParts=null;this.timeRanges=d,Object.keys(d).forEach(function(s){var p=d[s];if(E.detectEvictedFragments(s,p),!f&&o.type===e.PlaylistLevelType.MAIN){var C=o.elementaryStreams[s];if(!C)return;for(var l=0;l<p.length;l++){var T=p.end(l);T<=C.endPTS&&T>C.startPTS?o.appendedPTS=Math.max(T,o.appendedPTS||0):o.appendedPTS=C.endPTS}}})},i.onFragBuffered=function(w,x){this.detectPartialFragments(x)},i.hasFragment=function(w){var x=u(w);return!!this.fragments[x]},i.removeFragmentsInRange=function(w,x,E){var o=this;Object.keys(this.fragments).forEach(function(f){var d=o.fragments[f];if(!d)return;if(d.buffered){var A=d.body;A.type===E&&A.start<x&&A.end>w&&o.removeFragment(A)}})},i.removeFragment=function(w){var x=u(w);w.stats.loaded=0,w.clearElementaryStreamInfo(),w.appendedPTS=void 0,delete this.fragments[x],w.endList&&delete this.endListFragments[w.type]},i.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},m}();function I(m){var i,g;return m.buffered&&(((i=m.range.video)===null||i===void 0?void 0:i.partial)||((g=m.range.audio)===null||g===void 0?void 0:g.partial))}function u(m){return m.type+"_"+m.level+"_"+m.urlId+"_"+m.sn}},"./src/controller/gap-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{MAX_START_GAP_JUMP:()=>u,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>m,SKIP_BUFFER_RANGE_START:()=>i,STALL_MINIMUM_DURATION_MS:()=>I,default:()=>g});var W=O("./src/utils/buffer-helper.ts"),e=O("./src/errors.ts"),k=O("./src/events.ts"),L=O("./src/utils/logger.ts"),I=250,u=2,m=.1,i=.05,g=function(){function w(E,o,f,d){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=E,this.media=o,this.fragmentTracker=f,this.hls=d}var x=w.prototype;return x.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},x.poll=function(o,f){var d=this.config,A=this.media,s=this.stalled;if(A===null)return;var p=A.currentTime,C=A.seeking,l=this.seeking&&!C,T=!this.seeking&&C;if(this.seeking=C,p!==o){if(this.moved=!0,s!==null){if(this.stallReported){var y=self.performance.now()-s;L.logger.warn("playback not stuck anymore @"+p+", after "+Math.round(y)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||l)&&(this.stalled=null),A.paused&&!C||A.ended||A.playbackRate===0||!W.BufferHelper.getBuffered(A).length)return;var _=W.BufferHelper.bufferInfo(A,p,0),v=_.len>0,n=_.nextStart||0;if(!v&&!n)return;if(C){var a=_.len>u,r=!n||f&&f.start<=p||n-p>u&&!this.fragmentTracker.getPartialFragment(p);if(a||r)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var t,c=Math.max(n,_.start||0)-p,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,h=b==null||((t=b.details)===null||t===void 0)?void 0:t.live,D=h?b.details.targetduration*2:u;if(c>0&&c<=D){this._trySkipBufferHole(null);return}}var P=self.performance.now();if(s===null){this.stalled=P;return}var j=P-s;if(!C&&j>=I&&(this._reportStall(_),!this.media))return;var N=W.BufferHelper.bufferInfo(A,p,d.maxBufferHole);this._tryFixBufferStall(N,j)},x._tryFixBufferStall=function(o,f){var d=this.config,A=this.fragmentTracker,s=this.media;if(s===null)return;var p=s.currentTime,C=A.getPartialFragment(p);if(C){var l=this._trySkipBufferHole(C);if(l||!this.media)return}o.len>d.maxBufferHole&&f>d.highBufferWatchdogPeriod*1e3&&(L.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},x._reportStall=function(o){var f=this.hls,d=this.media,A=this.stallReported;!A&&d&&(this.stallReported=!0,L.logger.warn("Playback stalling at @"+d.currentTime+" due to low buffer ("+JSON.stringify(o)+")"),f.trigger(k.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o.len}))},x._trySkipBufferHole=function(o){var f=this.config,d=this.hls,A=this.media;if(A===null)return 0;for(var s=A.currentTime,p=0,C=W.BufferHelper.getBuffered(A),l=0;l<C.length;l++){var T=C.start(l);if(s+f.maxBufferHole>=p&&s<T){var y=Math.max(T+i,A.currentTime+m);return L.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+y),this.moved=!0,this.stalled=null,A.currentTime=y,o&&d.trigger(k.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+y,frag:o}),y}p=C.end(l)}return 0},x._tryNudgeBuffer=function(){var o=this.config,f=this.hls,d=this.media,A=this.nudgeRetry;if(d===null)return;var s=d.currentTime;if(this.nudgeRetry++,A<o.nudgeMaxRetry){var p=s+(A+1)*o.nudgeOffset;L.logger.warn("Nudging 'currentTime' from "+s+" to "+p),d.currentTime=p,f.trigger(k.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else L.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+o.nudgeMaxRetry+" nudges"),f.trigger(k.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},w}()},"./src/controller/id3-track-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>o});var W=O("./src/polyfills/number.ts"),e=O("./src/events.ts"),k=O("./src/utils/texttrack-utils.ts"),L=O("./src/demux/id3.ts"),I=O("./src/loader/date-range.ts"),u=O("./src/types/demuxer.ts"),m=.25;function i(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var g=function(){var f=i();try{new f(0,Number.POSITIVE_INFINITY,"")}catch(d){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function w(f,d){return f.getTime()/1e3-d}function x(f){return Uint8Array.from(f.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var E=function(){function f(A){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=A,this._registerListeners()}var d=f.prototype;return d.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},d._registerListeners=function(){var s=this.hls;s.on(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(e.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.on(e.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(e.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},d._unregisterListeners=function(){var s=this.hls;s.off(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(e.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.off(e.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(e.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},d.onMediaAttached=function(s,p){this.media=p.media},d.onMediaDetaching=function(){if(!this.id3Track)return;(0,k.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={}},d.onManifestLoading=function(){this.dateRangeCuesAppended={}},d.createTrack=function(s){var p=this.getID3Track(s.textTracks);return p.mode="hidden",p},d.getID3Track=function(s){if(!this.media)return;for(var p=0;p<s.length;p++){var C=s[p];if(C.kind==="metadata"&&C.label==="id3")return(0,k.sendAddTrackEvent)(C,this.media),C}return this.media.addTextTrack("metadata","id3")},d.onFragParsingMetadata=function(s,p){if(!this.media)return;var C=this.hls.config,l=C.enableEmsgMetadataCues,T=C.enableID3MetadataCues;if(!l&&!T)return;var y=p.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var _=i(),v=0;v<y.length;v++){var n=y[v].type;if(n===u.MetadataSchema.emsg&&!l||!T)continue;var a=L.getID3Frames(y[v].data);if(a){var r=y[v].pts,t=r+y[v].duration;t>g&&(t=g);var c=t-r;c<=0&&(t=r+m);for(var b=0;b<a.length;b++){var h=a[b];if(!L.isTimeStampFrame(h)){this.updateId3CueEnds(r);var D=new _(r,t,"");D.value=h,n&&(D.type=n),this.id3Track.addCue(D)}}}}},d.updateId3CueEnds=function(s){var p,C=(p=this.id3Track)===null||p===void 0?void 0:p.cues;if(C)for(var l=C.length;l--;){var T=C[l];T.startTime<s&&T.endTime===g&&(T.endTime=s)}},d.onBufferFlushing=function(s,p){var C=p.startOffset,l=p.endOffset,T=p.type,y=this.id3Track,_=this.hls;if(!_)return;var v=_.config,n=v.enableEmsgMetadataCues,a=v.enableID3MetadataCues;if(y&&(n||a)){var r;T==="audio"?r=function(c){return c.type===u.MetadataSchema.audioId3&&a}:T==="video"?r=function(c){return c.type===u.MetadataSchema.emsg&&n}:r=function(c){return c.type===u.MetadataSchema.audioId3&&a||c.type===u.MetadataSchema.emsg&&n},(0,k.removeCuesInRange)(y,C,l,r)}},d.onLevelUpdated=function(s,p){var C=this,l=p.details;if(!this.media||!l.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;var T=this.dateRangeCuesAppended,y=this.id3Track,_=l.dateRanges,v=Object.keys(_);if(y)for(var n=Object.keys(T).filter(function(P){return!v.includes(P)}),a=function(j){var N=n[j];Object.keys(T[N].cues).forEach(function(H){y.removeCue(T[N].cues[H])}),delete T[N]},r=n.length;r--;)a(r);var t=l.fragments[l.fragments.length-1];if(v.length===0||!(0,W.isFiniteNumber)(t==null?void 0:t.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var c=t.programDateTime/1e3-t.start,b=i(),h=function(j){var N=v[j],H=_[N],z=T[N],J=(z==null?void 0:z.cues)||{},Y=(z==null?void 0:z.durationKnown)||!1,le=w(H.startDate,c),te=g,Z=H.endDate;if(Z)te=w(Z,c),Y=!0;else if(H.endOnNext&&!Y){var _e=v.reduce(function(X,Ae){var Q=_[Ae];return Q.class===H.class&&Q.id!==Ae&&Q.startDate>H.startDate&&X.push(Q),X},[]).sort(function(X,Ae){return X.startDate.getTime()-Ae.startDate.getTime()})[0];_e&&(te=w(_e.startDate,c),Y=!0)}for(var we=Object.keys(H.attr),De=0;De<we.length;De++){var Ee=we[De];if(Ee===I.DateRangeAttribute.ID||Ee===I.DateRangeAttribute.CLASS||Ee===I.DateRangeAttribute.START_DATE||Ee===I.DateRangeAttribute.DURATION||Ee===I.DateRangeAttribute.END_DATE||Ee===I.DateRangeAttribute.END_ON_NEXT)continue;var xe=J[Ee];if(xe)Y&&!z.durationKnown&&(xe.endTime=te);else{var ve=H.attr[Ee];xe=new b(le,te,""),(Ee===I.DateRangeAttribute.SCTE35_OUT||Ee===I.DateRangeAttribute.SCTE35_IN)&&(ve=x(ve)),xe.value={key:Ee,data:ve},xe.type=u.MetadataSchema.dateRange,C.id3Track.addCue(xe),J[Ee]=xe}}T[N]={cues:J,dateRange:H,durationKnown:Y}},D=0;D<v.length;D++)h(D)},f}();const o=E},"./src/controller/latency-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>i});var W=O("./src/errors.ts"),e=O("./src/events.ts"),k=O("./src/utils/logger.ts");function L(g,w){for(var x=0;x<w.length;x++){var E=w[x];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(g,u(E.key),E)}}function I(g,w,x){return w&&L(g.prototype,w),x&&L(g,x),Object.defineProperty(g,"prototype",{writable:!1}),g}function u(g){var w=m(g,"string");return typeof w=="symbol"?w:String(w)}function m(g,w){if(typeof g!="object"||g===null)return g;var x=g[Symbol.toPrimitive];if(x!==void 0){var E=x.call(g,w||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(g)}var i=function(){function g(x){var E=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 E.timeupdate()},this.hls=x,this.config=x.config,this.registerListeners()}var w=g.prototype;return w.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},w.registerListeners=function(){this.hls.on(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(e.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(e.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){this.hls.off(e.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(e.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(e.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(e.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(e.Events.ERROR,this.onError)},w.onMediaAttached=function(E,o){this.media=o.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},w.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},w.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},w.onLevelUpdated=function(E,o){var f=o.details;this.levelDetails=f,f.advanced&&this.timeupdate(),!f.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},w.onError=function(E,o){if(o.details!==W.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},w.timeupdate=function(){var E=this.media,o=this.levelDetails;if(!E||!o)return;this.currentTime=E.currentTime;var f=this.computeLatency();if(f===null)return;this._latency=f;var d=this.config,A=d.lowLatencyMode,s=d.maxLiveSyncPlaybackRate;if(!A||s===1)return;var p=this.targetLatency;if(p===null)return;var C=f-p,l=Math.min(this.maxLatency,p+o.targetduration),T=C<l;if(o.live&&T&&C>.05&&this.forwardBufferLength>1){var y=Math.min(2,Math.max(1,s)),_=Math.round(2/(1+Math.exp(-.75*C-this.edgeStalled))*20)/20;E.playbackRate=Math.min(y,Math.max(1,_))}else E.playbackRate!==1&&E.playbackRate!==0&&(E.playbackRate=1)},w.estimateLiveEdge=function(){var E=this.levelDetails;return E===null?null:E.edge+E.age},w.computeLatency=function(){var E=this.estimateLiveEdge();return E===null?null:E-this.currentTime},I(g,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var E=this.config,o=this.levelDetails;return E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:o?E.liveMaxLatencyDurationCount*o.targetduration:0}},{key:"targetLatency",get:function(){var E=this.levelDetails;if(E===null)return null;var o=E.holdBack,f=E.partHoldBack,d=E.targetduration,A=this.config,s=A.liveSyncDuration,p=A.liveSyncDurationCount,C=A.lowLatencyMode,l=this.hls.userConfig,T=C&&f||o;(l.liveSyncDuration||l.liveSyncDurationCount||T===0)&&(T=s!==void 0?s:p*d);var y=d,_=1;return T+Math.min(this.stallCount*_,y)}},{key:"liveSyncPosition",get:function(){var E=this.estimateLiveEdge(),o=this.targetLatency,f=this.levelDetails;if(E===null||o===null||f===null)return null;var d=f.edge,A=E-o-this.edgeStalled,s=d-f.totalduration,p=d-(this.config.lowLatencyMode&&f.partTarget||f.targetduration);return Math.min(Math.max(s,A),p)}},{key:"drift",get:function(){var E=this.levelDetails;return E===null?1:E.drift}},{key:"edgeStalled",get:function(){var E=this.levelDetails;if(E===null)return 0;var o=(this.config.lowLatencyMode&&E.partTarget||E.targetduration)*3;return Math.max(E.age-o,0)}},{key:"forwardBufferLength",get:function(){var E=this.media,o=this.levelDetails;if(!E||!o)return 0;var f=E.buffered.length;return(f?E.buffered.end(f-1):o.edge)-this.currentTime}}]),g}()},"./src/controller/level-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>A});var W=O("./src/types/level.ts"),e=O("./src/events.ts"),k=O("./src/errors.ts"),L=O("./src/utils/codecs.ts"),I=O("./src/controller/level-helper.ts"),u=O("./src/controller/base-playlist-controller.ts"),m=O("./src/types/loader.ts");function i(){return i=Object.assign?Object.assign.bind():function(s){for(var p=1;p<arguments.length;p++){var C=arguments[p];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},i.apply(this,arguments)}function g(s,p){for(var C=0;C<p.length;C++){var l=p[C];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(s,x(l.key),l)}}function w(s,p,C){return p&&g(s.prototype,p),C&&g(s,C),Object.defineProperty(s,"prototype",{writable:!1}),s}function x(s){var p=E(s,"string");return typeof p=="symbol"?p:String(p)}function E(s,p){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,p||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}function o(s,p){s.prototype=Object.create(p.prototype),s.prototype.constructor=s,f(s,p)}function f(s,p){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,T){return l.__proto__=T,l},f(s,p)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),A=function(s){o(p,s);function p(l){var T;return T=s.call(this,l,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var C=p.prototype;return C._registerListeners=function(){var T=this.hls;T.on(e.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(e.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(e.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(e.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(e.Events.ERROR,this.onError,this)},C._unregisterListeners=function(){var T=this.hls;T.off(e.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(e.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(e.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(e.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(e.Events.ERROR,this.onError,this)},C.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},C.startLoad=function(){var T=this._levels;T.forEach(function(y){y.loadError=0}),s.prototype.startLoad.call(this)},C.onManifestLoaded=function(T,y){var _=[],v=[],n=[],a,r={},t,c=!1,b=!1,h=!1;if(y.levels.forEach(function(N){var H=N.attrs;c=c||!!(N.width&&N.height),b=b||!!N.videoCodec,h=h||!!N.audioCodec,d&&N.audioCodec&&N.audioCodec.indexOf("mp4a.40.34")!==-1&&(N.audioCodec=void 0);var z=N.bitrate+"-"+N.attrs.RESOLUTION+"-"+N.attrs.CODECS;t=r[z],t?t.url.push(N.url):(t=new W.Level(N),r[z]=t,_.push(t)),H&&(H.AUDIO&&(0,I.addGroupId)(t,"audio",H.AUDIO),H.SUBTITLES&&(0,I.addGroupId)(t,"text",H.SUBTITLES))}),(c||b)&&h&&(_=_.filter(function(N){var H=N.videoCodec,z=N.width,J=N.height;return!!H||!!(z&&J)})),_=_.filter(function(N){var H=N.audioCodec,z=N.videoCodec;return(!H||(0,L.isCodecSupportedInMp4)(H,"audio"))&&(!z||(0,L.isCodecSupportedInMp4)(z,"video"))}),y.audioTracks&&(v=y.audioTracks.filter(function(N){return!N.audioCodec||(0,L.isCodecSupportedInMp4)(N.audioCodec,"audio")}),(0,I.assignTrackIdsByGroup)(v)),y.subtitles&&(n=y.subtitles,(0,I.assignTrackIdsByGroup)(n)),_.length>0){a=_[0].bitrate,_.sort(function(N,H){return N.attrs["HDCP-LEVEL"]!==H.attrs["HDCP-LEVEL"]?(N.attrs["HDCP-LEVEL"]||"")>(H.attrs["HDCP-LEVEL"]||"")?1:-1:N.bitrate!==H.bitrate?N.bitrate-H.bitrate:N.attrs.SCORE!==H.attrs.SCORE?N.attrs.decimalFloatingPoint("SCORE")-H.attrs.decimalFloatingPoint("SCORE"):c&&N.height!==H.height?N.height-H.height:0}),this._levels=_;for(var D=0;D<_.length;D++)if(_[D].bitrate===a){this._firstLevel=D,this.log("manifest loaded, "+_.length+" level(s) found, first bitrate: "+a);break}var P=h&&!b,j={levels:_,audioTracks:v,subtitleTracks:n,sessionData:y.sessionData,sessionKeys:y.sessionKeys,firstLevel:this._firstLevel,stats:y.stats,audio:h,video:b,altAudio:!P&&v.some(function(N){return!!N.url})};this.hls.trigger(e.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(e.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:y.url,reason:"no level with compatible codecs found in manifest"})},C.onError=function(T,y){var _,v;if(s.prototype.onError.call(this,T,y),y.fatal)return;var n=y.context,a=this._levels[this.currentLevelIndex];if(n&&(n.type===m.PlaylistContextType.AUDIO_TRACK&&a.audioGroupIds&&n.groupId===a.audioGroupIds[a.urlId]||n.type===m.PlaylistContextType.SUBTITLE_TRACK&&a.textGroupIds&&n.groupId===a.textGroupIds[a.urlId])){this.redundantFailover(this.currentLevelIndex);return}var r=!1,t=!0,c;switch(y.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.ErrorDetails.KEY_LOAD_TIMEOUT:if(y.frag){var b=y.frag.type===m.PlaylistLevelType.MAIN?y.frag.level:this.currentLevelIndex,h=this._levels[b];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(c=b)):c=b}break;case k.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{var D=a.attrs["HDCP-LEVEL"];D&&(this.hls.maxHdcpLevel=W.HdcpLevels[W.HdcpLevels.indexOf(D)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'))}case k.ErrorDetails.FRAG_PARSING_ERROR:case k.ErrorDetails.KEY_SYSTEM_NO_SESSION:c=((_=y.frag)===null||_===void 0?void 0:_.type)===m.PlaylistLevelType.MAIN?y.frag.level:this.currentLevelIndex,y.levelRetry=!1;break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:n&&(n.deliveryDirectives&&(t=!1),c=n.level),r=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:c=(v=y.level)!=null?v:this.currentLevelIndex,r=!0;break}c!==void 0&&this.recoverLevel(y,c,r,t)},C.recoverLevel=function(T,y,_,v){var n=T.details,a=this._levels[y];if(a.loadError++,_){var r=this.retryLoadingOrFail(T);if(r)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var t=a.url.length;if(t>1&&a.loadError<t)T.levelRetry=!0,this.redundantFailover(y);else if(this.manualLevelIndex===-1){for(var c=-1,b=this._levels,h=b.length;h--;){var D=(h+this.currentLevelIndex)%b.length;if(D!==this.currentLevelIndex&&b[D].loadError===0){c=D;break}}c>-1&&this.currentLevelIndex!==c?(this.warn(n+": switch to "+c),T.levelRetry=!0,this.hls.nextAutoLevel=c):T.levelRetry===!1&&(T.fatal=!0)}}},C.redundantFailover=function(T){var y=this._levels[T],_=y.url.length;if(_>1){var v=(y.urlId+1)%_;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(n){n.urlId=v}),this.level=T}},C.onFragLoaded=function(T,y){var _=y.frag;if(_!==void 0&&_.type===m.PlaylistLevelType.MAIN){var v=this._levels[_.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},C.onLevelLoaded=function(T,y){var _,v=y.level,n=y.details,a=this._levels[v];if(!a){var r;this.warn("Invalid level index "+v),(r=y.deliveryDirectives)!==null&&r!==void 0&&r.skip&&(n.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(a.fragmentError===0&&(a.loadError=0,this.retryCount=0),this.playlistLoaded(v,y,a.details)):(_=y.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(n.deltaUpdateFailed=!0)},C.onAudioTrackSwitched=function(T,y){var _=this.hls.levels[this.currentLevelIndex];if(!_)return;if(_.audioGroupIds){for(var v=-1,n=this.hls.audioTracks[y.id].groupId,a=0;a<_.audioGroupIds.length;a++)if(_.audioGroupIds[a]===n){v=a;break}v!==_.urlId&&(_.urlId=v,this.startLoad())}},C.loadPlaylist=function(T){s.prototype.loadPlaylist.call(this);var y=this.currentLevelIndex,_=this._levels[y];if(this.canLoad&&_&&_.url.length>0){var v=_.urlId,n=_.url[v];if(T)try{n=T.addDirectives(n)}catch(a){this.warn("Could not construct new URL with HLS Delivery Directives: "+a)}this.log("Attempt loading level index "+y+((T==null?void 0:T.msn)!==void 0?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+v+" "+n),this.clearTimer(),this.hls.trigger(e.Events.LEVEL_LOADING,{url:n,level:y,id:v,deliveryDirectives:T||null})}},C.removeLevel=function(T,y){var _=function(a,r){return r!==y},v=this._levels.filter(function(n,a){return a!==T?!0:n.url.length>1&&y!==void 0?(n.url=n.url.filter(_),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(_)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(_)),n.urlId=0,!0):!1}).map(function(n,a){var r=n.details;return r!=null&&r.fragments&&r.fragments.forEach(function(t){t.level=a}),n});this._levels=v,this.hls.trigger(e.Events.LEVELS_UPDATED,{levels:v})},w(p,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var y,_=this._levels;if(_.length===0)return;if(this.currentLevelIndex===T&&(y=_[T])!==null&&y!==void 0&&y.details)return;if(T<0||T>=_.length){var v=T<0;if(this.hls.trigger(e.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:v,reason:"invalid level idx"}),v)return;T=Math.min(T,_.length-1)}this.clearTimer();var n=this.currentLevelIndex,a=_[n],r=_[T];this.log("switching to level "+T+" from "+n),this.currentLevelIndex=T;var t=i({},r,{level:T,maxBitrate:r.maxBitrate,uri:r.uri,urlId:r.urlId});delete t._urlId,this.hls.trigger(e.Events.LEVEL_SWITCHING,t);var c=r.details;if(!c||c.live){var b=this.switchParams(r.uri,a==null?void 0:a.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),p}(u.default)},"./src/controller/level-helper.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{addGroupId:()=>I,addSliding:()=>d,adjustSliding:()=>f,assignTrackIdsByGroup:()=>u,computeReloadInterval:()=>A,getFragmentWithSN:()=>s,getPartWith:()=>p,mapFragmentIntersection:()=>o,mapPartIntersection:()=>E,mergeDetails:()=>w,updateFragPTSDTS:()=>g,updatePTS:()=>m});var W=O("./src/polyfills/number.ts"),e=O("./src/utils/logger.ts"),k=O("./src/loader/date-range.ts");function L(){return L=Object.assign?Object.assign.bind():function(C){for(var l=1;l<arguments.length;l++){var T=arguments[l];for(var y in T)Object.prototype.hasOwnProperty.call(T,y)&&(C[y]=T[y])}return C},L.apply(this,arguments)}function I(C,l,T){switch(l){case"audio":C.audioGroupIds||(C.audioGroupIds=[]),C.audioGroupIds.push(T);break;case"text":C.textGroupIds||(C.textGroupIds=[]),C.textGroupIds.push(T);break}}function u(C){var l={};C.forEach(function(T){var y=T.groupId||"";T.id=l[y]=l[y]||0,l[y]++})}function m(C,l,T){var y=C[l],_=C[T];i(y,_)}function i(C,l){var T=l.startPTS;if((0,W.isFiniteNumber)(T)){var y=0,_;l.sn>C.sn?(y=T-C.start,_=C):(y=C.start-T,_=l),_.duration!==y&&(_.duration=y)}else if(l.sn>C.sn){var v=C.cc===l.cc;v&&C.minEndPTS?l.start=C.start+(C.minEndPTS-C.start):l.start=C.start+C.duration}else l.start=Math.max(C.start-l.duration,0)}function g(C,l,T,y,_,v){var n=y-T;n<=0&&(e.logger.warn("Fragment should have a positive duration",l),y=T+l.duration,v=_+l.duration);var a=T,r=y,t=l.startPTS,c=l.endPTS;if((0,W.isFiniteNumber)(t)){var b=Math.abs(t-T);(0,W.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(b,l.deltaPTS):l.deltaPTS=b,a=Math.max(T,t),T=Math.min(T,t),_=Math.min(_,l.startDTS),r=Math.min(y,c),y=Math.max(y,c),v=Math.max(v,l.endDTS)}l.duration=y-T;var h=T-l.start;l.start=l.startPTS=T,l.maxStartPTS=a,l.startDTS=_,l.endPTS=y,l.minEndPTS=r,l.endDTS=v;var D=l.sn;if(!C||D<C.startSN||D>C.endSN)return 0;var P,j=D-C.startSN,N=C.fragments;for(N[j]=l,P=j;P>0;P--)i(N[P],N[P-1]);for(P=j;P<N.length-1;P++)i(N[P],N[P+1]);return C.fragmentHint&&i(N[N.length-1],C.fragmentHint),C.PTSKnown=C.alignedSliding=!0,h}function w(C,l){for(var T=null,y=C.fragments,_=y.length-1;_>=0;_--){var v=y[_].initSegment;if(v){T=v;break}}C.fragmentHint&&delete C.fragmentHint.endPTS;var n=0,a;if(o(C,l,function(P,j){P.relurl&&(n=P.cc-j.cc),(0,W.isFiniteNumber)(P.startPTS)&&(0,W.isFiniteNumber)(P.endPTS)&&(j.start=j.startPTS=P.startPTS,j.startDTS=P.startDTS,j.appendedPTS=P.appendedPTS,j.maxStartPTS=P.maxStartPTS,j.endPTS=P.endPTS,j.endDTS=P.endDTS,j.minEndPTS=P.minEndPTS,j.duration=P.endPTS-P.startPTS,j.duration&&(a=j),l.PTSKnown=l.alignedSliding=!0),j.elementaryStreams=P.elementaryStreams,j.loader=P.loader,j.stats=P.stats,j.urlId=P.urlId,P.initSegment&&(j.initSegment=P.initSegment,T=P.initSegment)}),T){var r=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;r.forEach(function(P){var j;(!P.initSegment||P.initSegment.relurl===((j=T)===null||j===void 0?void 0:j.relurl))&&(P.initSegment=T)})}if(l.skippedSegments)if(l.deltaUpdateFailed=l.fragments.some(function(P){return!P}),l.deltaUpdateFailed){e.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var t=l.skippedSegments;t--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}else l.canSkipDateRanges&&(l.dateRanges=x(C.dateRanges,l.dateRanges,l.recentlyRemovedDateranges));var c=l.fragments;if(n){e.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b<c.length;b++)c[b].cc+=n}l.skippedSegments&&(l.startCC=l.fragments[0].cc),E(C.partList,l.partList,function(P,j){j.elementaryStreams=P.elementaryStreams,j.stats=P.stats}),a?g(l,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS):f(C,l),c.length&&(l.totalduration=l.edge-c[0].start),l.driftStartTime=C.driftStartTime,l.driftStart=C.driftStart;var h=l.advancedDateTime;if(l.advanced&&h){var D=l.edge;l.driftStart||(l.driftStartTime=h,l.driftStart=D),l.driftEndTime=h,l.driftEnd=D}else l.driftEndTime=C.driftEndTime,l.driftEnd=C.driftEnd,l.advancedDateTime=C.advancedDateTime}function x(C,l,T){var y=L({},C);return T&&T.forEach(function(_){delete y[_]}),Object.keys(l).forEach(function(_){var v=new k.DateRange(l[_].attr,y[_]);v.isValid?y[_]=v:e.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(l[_].attr)+'"')}),y}function E(C,l,T){if(C&&l)for(var y=0,_=0,v=C.length;_<=v;_++){var n=C[_],a=l[_+y];n&&a&&n.index===a.index&&n.fragment.sn===a.fragment.sn?T(n,a):y--}}function o(C,l,T){for(var y=l.skippedSegments,_=Math.max(C.startSN,l.startSN)-l.startSN,v=(C.fragmentHint?1:0)+(y?l.endSN:Math.min(C.endSN,l.endSN))-l.startSN,n=l.startSN-C.startSN,a=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,r=C.fragmentHint?C.fragments.concat(C.fragmentHint):C.fragments,t=_;t<=v;t++){var c=r[n+t],b=a[t];y&&!b&&t<y&&(b=l.fragments[t]=c),c&&b&&T(c,b)}}function f(C,l){var T=l.startSN+l.skippedSegments-C.startSN,y=C.fragments;if(T<0||T>=y.length)return;d(l,y[T].start)}function d(C,l){if(l){for(var T=C.fragments,y=C.skippedSegments;y<T.length;y++)T[y].start+=l;C.fragmentHint&&(C.fragmentHint.start+=l)}}function A(C,l){l===void 0&&(l=Infinity);var T=1e3*C.targetduration;if(C.updated){var y=C.fragments,_=4;if(y.length&&T*_>l){var v=y[y.length-1].duration*1e3;v<T&&(T=v)}}else T/=2;return Math.round(T)}function s(C,l,T){if(!C||!C.details)return null;var y=C.details,_=y.fragments[l-y.startSN];return _||(_=y.fragmentHint,_&&_.sn===l?_:l<y.startSN&&T&&T.sn===l?T:null)}function p(C,l,T){if(!C||!C.details)return null;var y=C.details.partList;if(y)for(var _=y.length;_--;){var v=y[_];if(v.index===T&&v.fragment.sn===l)return v}return null}},"./src/controller/stream-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>l});var W=O("./src/polyfills/number.ts"),e=O("./src/controller/base-stream-controller.ts"),k=O("./src/is-supported.ts"),L=O("./src/events.ts"),I=O("./src/utils/buffer-helper.ts"),u=O("./src/controller/fragment-tracker.ts"),m=O("./src/types/loader.ts"),i=O("./src/loader/fragment.ts"),g=O("./src/demux/transmuxer-interface.ts"),w=O("./src/types/transmuxer.ts"),x=O("./src/controller/gap-controller.ts"),E=O("./src/errors.ts");function o(T,y){for(var _=0;_<y.length;_++){var v=y[_];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,d(v.key),v)}}function f(T,y,_){return y&&o(T.prototype,y),_&&o(T,_),Object.defineProperty(T,"prototype",{writable:!1}),T}function d(T){var y=A(T,"string");return typeof y=="symbol"?y:String(y)}function A(T,y){if(typeof T!="object"||T===null)return T;var _=T[Symbol.toPrimitive];if(_!==void 0){var v=_.call(T,y||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(T)}function s(T,y){T.prototype=Object.create(y.prototype),T.prototype.constructor=T,p(T,y)}function p(T,y){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,n){return v.__proto__=n,v},p(T,y)}var C=100,l=function(T){s(y,T);function y(v,n,a){var r;return r=T.call(this,v,n,a,"[stream-controller]")||this,r.audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.couldBacktrack=!1,r.backtrackFragment=null,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}var _=y.prototype;return _._registerListeners=function(){var n=this.hls;n.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.on(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),n.on(L.Events.ERROR,this.onError,this),n.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),n.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),n.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),n.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),n.on(L.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),n.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var n=this.hls;n.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.off(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),n.off(L.Events.ERROR,this.onError,this),n.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),n.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),n.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),n.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),n.off(L.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),n.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(n){if(this.levels){var a=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var t=r.startLevel;t===-1&&(r.config.testBandwidth&&this.levels.length>1?(t=0,this.bitrateTest=!0):t=r.nextAutoLevel),this.level=r.nextLoadLevel=t,this.loadedmetadata=!1}a>0&&n===-1&&(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),n=a),this.state=e.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=n,this.tick()}else this._forceStartLoad=!0,this.state=e.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case e.State.IDLE:this.doTickIdle();break;case e.State.WAITING_LEVEL:{var n,a=this.levels,r=this.level,t=a==null||((n=a[r])===null||n===void 0)?void 0:n.details;if(t&&(!t.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(t))break;this.state=e.State.IDLE;break}break}case e.State.FRAG_LOADING_WAITING_RETRY:{var c,b=self.performance.now(),h=this.retryDate;(!h||b>=h||(c=this.media)!==null&&c!==void 0&&c.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=e.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var n=this.hls,a=this.levelLastLoaded,r=this.levels,t=this.media,c=n.config,b=n.nextLoadLevel;if(a===null||!t&&(this.startFragRequested||!c.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!r||!r[b])return;var h=r[b],D=this.getMainFwdBufferInfo();if(D===null)return;var P=this.getLevelDetails();if(P&&this._streamEnded(D,P)){var j={};this.altAudio&&(j.type="video"),this.hls.trigger(L.Events.BUFFER_EOS,j),this.state=e.State.ENDED;return}this.level=n.nextLoadLevel=b;var N=h.details;if(!N||this.state===e.State.WAITING_LEVEL||N.live&&this.levelLastLoaded!==b){this.level=b,this.state=e.State.WAITING_LEVEL;return}var H=D.len,z=this.getMaxBufferLength(h.maxBitrate);if(H>=z)return;this.backtrackFragment&&this.backtrackFragment.start>D.end&&(this.backtrackFragment=null);var J=this.backtrackFragment?this.backtrackFragment.start:D.end,Y=this.getNextFragment(J,N);if(this.couldBacktrack&&!this.fragPrevious&&Y&&Y.sn!=="initSegment"&&this.fragmentTracker.getState(Y)!==u.FragmentState.OK){var le,te=((le=this.backtrackFragment)!=null?le:Y).sn,Z=te-N.startSN,_e=N.fragments[Z-1];_e&&Y.cc===_e.cc&&(Y=_e,this.fragmentTracker.removeFragment(_e))}else this.backtrackFragment&&D.len&&(this.backtrackFragment=null);if(Y&&this.fragmentTracker.getState(Y)===u.FragmentState.OK&&this.nextLoadPosition>J){var we=this.audioOnly&&!this.altAudio?i.ElementaryStreamTypes.AUDIO:i.ElementaryStreamTypes.VIDEO,De=(we===i.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;De&&this.afterBufferFlushed(De,we,m.PlaylistLevelType.MAIN),Y=this.getNextFragment(this.nextLoadPosition,N)}if(!Y)return;Y.initSegment&&!Y.initSegment.data&&!this.bitrateTest&&(Y=Y.initSegment),this.loadFragment(Y,N,J)},_.loadFragment=function(n,a,r){var t,c=this.fragmentTracker.getState(n);this.fragCurrent=n,c===u.FragmentState.NOT_LOADED?n.sn==="initSegment"?this._loadInitSegment(n,a):this.bitrateTest?(this.log("Fragment "+n.sn+" of level "+n.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(n,a)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,n,a,r)):c===u.FragmentState.APPENDING?this.reduceMaxBufferLength(n.duration)&&this.fragmentTracker.removeFragment(n):((t=this.media)===null||t===void 0?void 0:t.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(n){var a=this.fragmentTracker.getAppendedFrag(n,m.PlaylistLevelType.MAIN);return a&&"fragment"in a?a.fragment:a},_.getBufferedFrag=function(n){return this.fragmentTracker.getBufferedFrag(n,m.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(n){return n?this.getBufferedFrag(n.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var n=this.levels,a=this.media;if(a!=null&&a.readyState){var r,t=this.getAppendedFrag(a.currentTime);if(t&&t.start>1&&this.flushMainBuffer(0,t.start-1),!a.paused&&n){var c=this.hls.nextLoadLevel,b=n[c],h=this.fragLastKbps;h&&this.fragCurrent?r=this.fragCurrent.duration*b.maxBitrate/(1e3*h)+1:r=0}else r=0;var D=this.getBufferedFrag(a.currentTime+r);if(D){var P=this.followingBufferedFrag(D);if(P){this.abortCurrentFrag();var j=P.maxStartPTS?P.maxStartPTS:P.start,N=P.duration,H=Math.max(D.end,j+Math.min(Math.max(N-this.config.maxFragLookUpTolerance,N*.5),N*.75));this.flushMainBuffer(H,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var n=this.fragCurrent;this.fragCurrent=null,this.backtrackFragment=null,n&&n.abortRequests();switch(this.state){case e.State.KEY_LOADING:case e.State.FRAG_LOADING:case e.State.FRAG_LOADING_WAITING_RETRY:case e.State.PARSING:case e.State.PARSED:this.state=e.State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(n,a){T.prototype.flushMainBuffer.call(this,n,a,this.altAudio?"video":null)},_.onMediaAttached=function(n,a){T.prototype.onMediaAttached.call(this,n,a);var r=a.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new x.default(this.config,r,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var n=this.media;n&&this.onvplaying&&this.onvseeked&&(n.removeEventListener("playing",this.onvplaying),n.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var n=this.media,a=n?n.currentTime:null;(0,W.isFiniteNumber)(a)&&this.log("Media seeked to "+a.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(L.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},_.onManifestParsed=function(n,a){var r=!1,t=!1,c;a.levels.forEach(function(b){c=b.audioCodec,c&&(c.indexOf("mp4a.40.2")!==-1&&(r=!0),c.indexOf("mp4a.40.5")!==-1&&(t=!0))}),this.audioCodecSwitch=r&&t&&!(0,k.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(n,a){var r=this.levels;if(!r||this.state!==e.State.IDLE)return;var t=r[a.level];(!t.details||t.details.live&&this.levelLastLoaded!==a.level||this.waitForCdnTuneIn(t.details))&&(this.state=e.State.WAITING_LEVEL)},_.onLevelLoaded=function(n,a){var r,t=this.levels,c=a.level,b=a.details,h=b.totalduration;if(!t){this.warn("Levels were reset while loading level "+c);return}this.log("Level "+c+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+h);var D=this.fragCurrent;D&&(this.state===e.State.FRAG_LOADING||this.state===e.State.FRAG_LOADING_WAITING_RETRY)&&(D.level!==a.level&&D.loader&&(this.state=e.State.IDLE,this.backtrackFragment=null,D.abortRequests()));var P=t[c],j=0;if(b.live||(r=P.details)!==null&&r!==void 0&&r.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;j=this.alignPlaylists(b,P.details)}if(P.details=b,this.levelLastLoaded=c,this.hls.trigger(L.Events.LEVEL_UPDATED,{details:b,level:c}),this.state===e.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=e.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,j),this.tick()},_._handleFragmentLoadProgress=function(n){var a,r=n.frag,t=n.part,c=n.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered");return}var h=b[r.level],D=h.details;if(!D){this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset");return}var P=h.videoCodec,j=D.PTSKnown||!D.live,N=(a=r.initSegment)===null||a===void 0?void 0:a.data,H=this._getAudioCodec(h),z=this.transmuxer=this.transmuxer||new g.default(this.hls,m.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=t?t.index:-1,Y=J!==-1,le=new w.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,c.byteLength,J,Y),te=this.initPTS[r.cc];z.push(c,N,H,P,r,t,D.totalduration,j,le,te)},_.onAudioTrackSwitching=function(n,a){var r=this.altAudio,t=!!a.url,c=a.id;if(!t){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&&(this.log("Switching to main audio track, cancel main fragment load"),b.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var h=this.hls;r&&h.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),h.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:c})}},_.onAudioTrackSwitched=function(n,a){var r=a.id,t=!!this.hls.audioTracks[r].url;if(t){var c=this.videoBuffer;c&&this.mediaBuffer!==c&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=c)}this.altAudio=t,this.tick()},_.onBufferCreated=function(n,a){var r=a.tracks,t,c,b=!1;for(var h in r){var D=r[h];if(D.id==="main"){if(c=h,t=D,h==="video"){var P=r[h];P&&(this.videoBuffer=P.buffer)}}else b=!0}b&&t?(this.log("Alternate track found, use "+c+".buffered to schedule main fragment loading"),this.mediaBuffer=t.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(n,a){var r=a.frag,t=a.part;if(r&&r.type!==m.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(r)){this.warn("Fragment "+r.sn+(t?" p: "+t.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),this.state===e.State.PARSED&&(this.state=e.State.IDLE);return}var c=t?t.stats:r.stats;this.fragLastKbps=Math.round(8*c.total/(c.buffering.end-c.loading.first)),r.sn!=="initSegment"&&(this.fragPrevious=r),this.fragBufferedComplete(r,t)},_.onError=function(n,a){if(a.type===E.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(m.PlaylistLevelType.MAIN,a);return}switch(a.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.FRAG_PARSING_ERROR:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(m.PlaylistLevelType.MAIN,a);break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==e.State.ERROR&&(a.fatal?(this.warn(""+a.details),this.state=e.State.ERROR):!a.levelRetry&&this.state===e.State.WAITING_LEVEL&&(this.state=e.State.IDLE));break;case E.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="main"&&(this.state===e.State.PARSING||this.state===e.State.PARSED)){var r=!0,t=this.getFwdBufferInfo(this.media,m.PlaylistLevelType.MAIN);t&&t.len>.5&&(r=!this.reduceMaxBufferLength(t.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var n=this.media,a=this.gapController;if(!n||!a||!n.readyState)return;if(this.loadedmetadata||!I.BufferHelper.getBuffered(n).length){var r=this.state!==e.State.IDLE?this.fragCurrent:null;a.poll(this.lastCurrentTime,r)}this.lastCurrentTime=n.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=e.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(n,a){var r=a.type;if(r!==i.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var t=(r===i.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(t,r,m.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(n,a){this.levels=a.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var n=this.media;if(!n)return;var a=n.currentTime,r=this.startPosition;if(r>=0&&a<r){if(n.seeking){this.log("could not seek to "+r+", already seeking at "+a);return}var t=I.BufferHelper.getBuffered(n),c=t.length?t.start(0):0,b=c-r;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+b+" to match buffer start"),r+=b,this.startPosition=r),this.log("seek to target start position "+r+" from current time "+a),n.currentTime=r}},_._getAudioCodec=function(n){var a=this.config.defaultAudioCodec||n.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(n,a){var r=this;n.bitrateTest=!0,this._doFragLoad(n,a).then(function(t){var c=r.hls;if(!t||r.fragContextChanged(n))return;r.fragLoadError=0,r.state=e.State.IDLE,r.startFragRequested=!1,r.bitrateTest=!1;var b=n.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),c.trigger(L.Events.FRAG_LOADED,t),n.bitrateTest=!1})},_._handleTransmuxComplete=function(n){var a,r="main",t=this.hls,c=n.remuxResult,b=n.chunkMeta,h=this.getCurrentContext(b);if(!h){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(b.level);return}var D=h.frag,P=h.part,j=h.level,N=c.video,H=c.text,z=c.id3,J=c.initSegment,Y=j.details,le=this.altAudio?void 0:c.audio;if(this.fragContextChanged(D))return;if(this.state=e.State.PARSING,J){J.tracks&&(this._bufferInitSegment(j,J.tracks,D,b),t.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:r,tracks:J.tracks}));var te=J.initPTS,Z=J.timescale;(0,W.isFiniteNumber)(te)&&(this.initPTS[D.cc]=te,t.trigger(L.Events.INIT_PTS_FOUND,{frag:D,id:r,initPTS:te,timescale:Z}))}if(N&&c.independent!==!1){if(Y){var _e=N.startPTS,we=N.endPTS,De=N.startDTS,Ee=N.endDTS;if(P)P.elementaryStreams[N.type]={startPTS:_e,endPTS:we,startDTS:De,endDTS:Ee};else if(N.firstKeyFrame&&N.independent&&b.id===1&&(this.couldBacktrack=!0),N.dropped&&N.independent){var xe=this.getMainFwdBufferInfo(),ve=(xe?xe.end:this.getLoadPosition())+this.config.maxBufferHole,X=N.firstKeyFramePTS?N.firstKeyFramePTS:_e;if(ve<X-this.config.maxBufferHole){this.backtrack(D);return}D.setElementaryStreamInfo(N.type,D.start,we,D.start,Ee,!0)}D.setElementaryStreamInfo(N.type,_e,we,De,Ee),this.backtrackFragment&&(this.backtrackFragment=D),this.bufferFragmentData(N,D,P,b)}}else if(c.independent===!1){this.backtrack(D);return}if(le){var Ae=le.startPTS,Q=le.endPTS,ue=le.startDTS,ee=le.endDTS;P&&(P.elementaryStreams[i.ElementaryStreamTypes.AUDIO]={startPTS:Ae,endPTS:Q,startDTS:ue,endDTS:ee}),D.setElementaryStreamInfo(i.ElementaryStreamTypes.AUDIO,Ae,Q,ue,ee),this.bufferFragmentData(le,D,P,b)}if(Y&&z!==null&&z!==void 0&&(a=z.samples)!==null&&a!==void 0&&a.length){var ae={id:r,frag:D,details:Y,samples:z.samples};t.trigger(L.Events.FRAG_PARSING_METADATA,ae)}if(Y&&H){var fe={id:r,frag:D,details:Y,samples:H.samples};t.trigger(L.Events.FRAG_PARSING_USERDATA,fe)}},_._bufferInitSegment=function(n,a,r,t){var c=this;if(this.state!==e.State.PARSING)return;this.audioOnly=!!a.audio&&!a.video,this.altAudio&&!this.audioOnly&&delete a.audio;var b=a.audio,h=a.video,D=a.audiovideo;if(b){var P=n.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(P&&(P.indexOf("mp4a.40.5")!==-1?P="mp4a.40.2":P="mp4a.40.5"),b.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(P="mp4a.40.5")),j.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(P="mp4a.40.2",this.log("Android: force audio codec to "+P)),n.audioCodec&&n.audioCodec!==P&&this.log('Swapping manifest audio codec "'+n.audioCodec+'" for "'+P+'"'),b.levelCodec=P,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(P||"")+"/"+(n.audioCodec||"")+"/"+b.codec+"]")}h&&(h.levelCodec=n.videoCodec,h.id="main",this.log("Init video buffer, container:"+h.container+", codecs[level/parsed]=["+(n.videoCodec||"")+"/"+h.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(n.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,a),Object.keys(a).forEach(function(N){var H=a[N],z=H.initSegment;z!=null&&z.byteLength&&c.hls.trigger(L.Events.BUFFER_APPENDING,{type:N,data:z,frag:r,part:null,chunkMeta:t,parent:r.type})}),this.tick()},_.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,m.PlaylistLevelType.MAIN)},_.backtrack=function(n){this.couldBacktrack=!0,this.backtrackFragment=n,this.resetTransmuxer(),this.flushBufferGap(n),this.fragmentTracker.removeFragment(n),this.fragPrevious=null,this.nextLoadPosition=n.start,this.state=e.State.IDLE},_.checkFragmentChanged=function(){var n=this.media,a=null;if(n&&n.readyState>1&&n.seeking===!1){var r=n.currentTime;if(I.BufferHelper.isBuffered(n,r)?a=this.getAppendedFrag(r):I.BufferHelper.isBuffered(n,r+.1)&&(a=this.getAppendedFrag(r+.1)),a){this.backtrackFragment=null;var t=this.fragPlaying,c=a.level;(!t||a.sn!==t.sn||t.level!==c||a.urlId!==t.urlId)&&(this.fragPlaying=a,this.hls.trigger(L.Events.FRAG_CHANGED,{frag:a}),(!t||t.level!==c)&&this.hls.trigger(L.Events.LEVEL_SWITCHED,{level:c}))}}},f(y,[{key:"nextLevel",get:function(){var n=this.nextBufferedFrag;return n?n.level:-1}},{key:"currentFrag",get:function(){var n=this.media;return n?this.fragPlaying||this.getAppendedFrag(n.currentTime):null}},{key:"currentProgramDateTime",get:function(){var n=this.media;if(n){var a=n.currentTime,r=this.currentFrag;if(r&&(0,W.isFiniteNumber)(a)&&(0,W.isFiniteNumber)(r.programDateTime)){var t=r.programDateTime+(a-r.start)*1e3;return new Date(t)}}return null}},{key:"currentLevel",get:function(){var n=this.currentFrag;return n?n.level:-1}},{key:"nextBufferedFrag",get:function(){var n=this.currentFrag;return n?this.followingBufferedFrag(n):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),y}(e.default)},"./src/controller/subtitle-stream-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{SubtitleStreamController:()=>s});var W=O("./src/events.ts"),e=O("./src/utils/buffer-helper.ts"),k=O("./src/controller/fragment-finders.ts"),L=O("./src/utils/discontinuities.ts"),I=O("./src/controller/level-helper.ts"),u=O("./src/controller/fragment-tracker.ts"),m=O("./src/controller/base-stream-controller.ts"),i=O("./src/types/loader.ts"),g=O("./src/types/level.ts");function w(C,l){for(var T=0;T<l.length;T++){var y=l[T];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(C,E(y.key),y)}}function x(C,l,T){return l&&w(C.prototype,l),T&&w(C,T),Object.defineProperty(C,"prototype",{writable:!1}),C}function E(C){var l=o(C,"string");return typeof l=="symbol"?l:String(l)}function o(C,l){if(typeof C!="object"||C===null)return C;var T=C[Symbol.toPrimitive];if(T!==void 0){var y=T.call(C,l||"default");if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(C)}function f(C,l){C.prototype=Object.create(l.prototype),C.prototype.constructor=C,d(C,l)}function d(C,l){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,_){return y.__proto__=_,y},d(C,l)}var A=500,s=function(C){f(l,C);function l(y,_,v){var n;return n=C.call(this,y,_,v,"[subtitle-stream-controller]")||this,n.levels=[],n.currentTrackId=-1,n.tracksBuffered=[],n.mainDetails=null,n._registerListeners(),n}var T=l.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var _=this.hls;_.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(W.Events.ERROR,this.onError,this),_.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.on(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.on(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),_.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T._unregisterListeners=function(){var _=this.hls;_.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(W.Events.ERROR,this.onError,this),_.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.off(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.off(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),_.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T.startLoad=function(_){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(A),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(_,v){this.mainDetails=v.details},T.onSubtitleFragProcessed=function(_,v){var n=v.frag,a=v.success;if(this.fragPrevious=n,this.state=m.State.IDLE,!a)return;var r=this.tracksBuffered[this.currentTrackId];if(!r)return;for(var t,c=n.start,b=0;b<r.length;b++)if(c>=r[b].start&&c<=r[b].end){t=r[b];break}var h=n.start+n.duration;t?t.end=h:(t={start:c,end:h},r.push(t)),this.fragmentTracker.fragBuffered(n)},T.onBufferFlushing=function(_,v){var n=v.startOffset,a=v.endOffset;if(n===0&&a!==Number.POSITIVE_INFINITY){var r=this.currentTrackId,t=this.levels;if(!t.length||!t[r]||!t[r].details)return;var c=t[r].details,b=c.targetduration,h=a-b;if(h<=0)return;v.endOffsetSubtitles=Math.max(0,h),this.tracksBuffered.forEach(function(D){for(var P=0;P<D.length;){if(D[P].end<=h){D.shift();continue}else if(D[P].start<h)D[P].start=h;else break;P++}}),this.fragmentTracker.removeFragmentsInRange(n,h,i.PlaylistLevelType.SUBTITLE)}},T.onFragBuffered=function(_,v){if(!this.loadedmetadata&&v.frag.type===i.PlaylistLevelType.MAIN){var n;(n=this.media)!==null&&n!==void 0&&n.buffered.length&&(this.loadedmetadata=!0)}},T.onError=function(_,v){var n=v.frag;if(!n||n.type!==i.PlaylistLevelType.SUBTITLE)return;this.fragCurrent&&this.fragCurrent.abortRequests(),this.state=m.State.IDLE},T.onSubtitleTracksUpdated=function(_,v){var n=this,a=v.subtitleTracks;this.tracksBuffered=[],this.levels=a.map(function(r){return new g.Level(r)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(r){n.tracksBuffered[r.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(_,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var n=this.levels[this.currentTrackId];n!=null&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.setInterval(A)},T.onSubtitleTrackLoaded=function(_,v){var n,a=v.details,r=v.id,t=this.currentTrackId,c=this.levels;if(!c.length)return;var b=c[t];if(r>=c.length||r!==t||!b)return;this.mediaBuffer=this.mediaBufferTimeRanges;var h=0;if(a.live||(n=b.details)!==null&&n!==void 0&&n.live){var D=this.mainDetails;if(a.deltaUpdateFailed||!D)return;var P=D.fragments[0];b.details?(h=this.alignPlaylists(a,b.details),h===0&&P&&(h=P.start,(0,I.addSliding)(a,h))):a.hasProgramDateTime&&D.hasProgramDateTime?((0,L.alignMediaPlaylistByPDT)(a,D),h=a.fragments[0].start):P&&(h=P.start,(0,I.addSliding)(a,h))}if(b.details=a,this.levelLastLoaded=r,!this.startFragRequested&&(this.mainDetails||!a.live)&&this.setStartPosition(b.details,h),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var j=(0,k.findFragmentByPTS)(null,a.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},T._handleFragmentLoadComplete=function(_){var v=this,n=_.frag,a=_.payload,r=n.decryptdata,t=this.hls;if(this.fragContextChanged(n))return;if(a&&a.byteLength>0&&r&&r.key&&r.iv&&r.method==="AES-128"){var c=performance.now();this.decrypter.decrypt(new Uint8Array(a),r.key.buffer,r.iv.buffer).then(function(b){var h=performance.now();t.trigger(W.Events.FRAG_DECRYPTED,{frag:n,payload:b,stats:{tstart:c,tdecrypt:h}})}).catch(function(b){v.warn(b.name+": "+b.message),v.state=m.State.IDLE})}},T.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var _=this.currentTrackId,v=this.levels;if(!v.length||!v[_]||!v[_].details)return;var n=v[_].details,a=n.targetduration,r=this.config,t=this.getLoadPosition(),c=e.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],t-a,r.maxBufferHole),b=c.end,h=c.len,D=this.getFwdBufferInfo(this.media,i.PlaylistLevelType.MAIN),P=this.getMaxBufferLength(D==null?void 0:D.len)+a;if(h>P)return;console.assert(n,"Subtitle track details are defined on idle subtitle stream controller tick");var j=n.fragments,N=j.length,H=n.edge,z=null,J=this.fragPrevious;if(b<H){var Y=r.maxFragLookUpTolerance;z=(0,k.findFragmentByPTS)(J,j,Math.max(j[0].start,b),Y),!z&&J&&J.start<j[0].start&&(z=j[0])}else z=j[N-1];if(!z)return;z=this.mapToInitFragWhenRequired(z),this.fragmentTracker.getState(z)===u.FragmentState.NOT_LOADED&&this.loadFragment(z,n,b)}},T.getMaxBufferLength=function(_){var v=C.prototype.getMaxBufferLength.call(this);return _?Math.max(v,_):v},T.loadFragment=function(_,v,n){this.fragCurrent=_,_.sn==="initSegment"?this._loadInitSegment(_,v):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,_,v,n))},x(l,[{key:"mediaBufferTimeRanges",get:function(){return new p(this.tracksBuffered[this.currentTrackId]||[])}}]),l}(m.default),p=function(l){this.buffered=void 0;var T=function(_,v,n){if(v=v>>>0,v>n-1)throw new DOMException("Failed to execute '"+_+"' on 'TimeRanges': The index provided ("+v+") is greater than the maximum bound ("+n+")");return l[v][_]};this.buffered={get length(){return l.length},end:function(_){return T("end",_,l.length)},start:function(_){return T("start",_,l.length)}}}},"./src/controller/subtitle-track-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>o});var W=O("./src/events.ts"),e=O("./src/utils/texttrack-utils.ts"),k=O("./src/controller/base-playlist-controller.ts"),L=O("./src/types/loader.ts");function I(f,d){for(var A=0;A<d.length;A++){var s=d[A];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(f,m(s.key),s)}}function u(f,d,A){return d&&I(f.prototype,d),A&&I(f,A),Object.defineProperty(f,"prototype",{writable:!1}),f}function m(f){var d=i(f,"string");return typeof d=="symbol"?d:String(d)}function i(f,d){if(typeof f!="object"||f===null)return f;var A=f[Symbol.toPrimitive];if(A!==void 0){var s=A.call(f,d||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(f)}function g(f,d){f.prototype=Object.create(d.prototype),f.prototype.constructor=f,w(f,d)}function w(f,d){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,p){return s.__proto__=p,s},w(f,d)}var x=function(f){g(d,f);function d(s){var p;return p=f.call(this,s,"[subtitle-track-controller]")||this,p.media=null,p.tracks=[],p.groupId=null,p.tracksInGroup=[],p.trackId=-1,p.selectDefaultTrack=!0,p.queuedDefaultTrack=-1,p.trackChangeListener=function(){return p.onTextTracksChanged()},p.asyncPollTrackChange=function(){return p.pollTrackChange(0)},p.useTextTrackPolling=!1,p.subtitlePollingInterval=-1,p._subtitleDisplay=!0,p.registerListeners(),p}var A=d.prototype;return A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,f.prototype.destroy.call(this)},A.registerListeners=function(){var p=this.hls;p.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),p.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),p.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),p.on(W.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var p=this.hls;p.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),p.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),p.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),p.off(W.Events.ERROR,this.onError,this)},A.onMediaAttached=function(p,C){if(this.media=C.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)},A.pollTrackChange=function(p){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,p)},A.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 p=E(this.media.textTracks);p.forEach(function(C){(0,e.clearCurrentCues)(C)}),this.subtitleTrack=-1,this.media=null},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},A.onManifestParsed=function(p,C){this.tracks=C.subtitleTracks},A.onSubtitleTrackLoaded=function(p,C){var l=C.id,T=C.details,y=this.trackId,_=this.tracksInGroup[y];if(!_){this.warn("Invalid subtitle track id "+l);return}var v=_.details;_.details=C.details,this.log("subtitle track "+l+" loaded ["+T.startSN+"-"+T.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,C,v))},A.onLevelLoading=function(p,C){this.switchLevel(C.level)},A.onLevelSwitching=function(p,C){this.switchLevel(C.level)},A.switchLevel=function(p){var C=this.hls.levels[p];if(!(C!=null&&C.textGroupIds))return;var l=C.textGroupIds[C.urlId];if(this.groupId!==l){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,y=this.tracks.filter(function(n){return!l||n.groupId===l});this.tracksInGroup=y;var _=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=l;var v={subtitleTracks:y};this.log("Updating subtitle tracks, "+y.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(W.Events.SUBTITLE_TRACKS_UPDATED,v),_!==-1&&this.setSubtitleTrack(_,T)}},A.findTrackId=function(p){for(var C=this.tracksInGroup,l=0;l<C.length;l++){var T=C[l];if((!this.selectDefaultTrack||T.default)&&(!p||p===T.name))return T.id}return-1},A.onError=function(p,C){if(f.prototype.onError.call(this,p,C),C.fatal||!C.context)return;C.context.type===L.PlaylistContextType.SUBTITLE_TRACK&&C.context.id===this.trackId&&C.context.groupId===this.groupId&&this.retryLoadingOrFail(C)},A.loadPlaylist=function(p){f.prototype.loadPlaylist.call(this);var C=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(C)){var l=C.id,T=C.groupId,y=C.url;if(p)try{y=p.addDirectives(y)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADING,{url:y,id:l,groupId:T,deliveryDirectives:p||null})}},A.toggleTrackModes=function(p){var C=this,l=this.media,T=this.trackId;if(!l)return;var y=E(l.textTracks),_=y.filter(function(a){return a.groupId===C.groupId});if(p===-1)[].slice.call(y).forEach(function(a){a.mode="disabled"});else{var v=_[T];v&&(v.mode="disabled")}var n=_[p];n&&(n.mode=this.subtitleDisplay?"showing":"hidden")},A.setSubtitleTrack=function(p,C){var l,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=p;return}if(this.trackId!==p&&this.toggleTrackModes(p),this.trackId===p&&(p===-1||(l=T[p])!==null&&l!==void 0&&l.details)||p<-1||p>=T.length)return;this.clearTimer();var y=T[p];if(this.log("Switching to subtitle track "+p),this.trackId=p,y){var _=y.id,v=y.groupId,n=v===void 0?"":v,a=y.name,r=y.type,t=y.url;this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:_,groupId:n,name:a,type:r,url:t});var c=this.switchParams(y.url,C==null?void 0:C.details);this.loadPlaylist(c)}else this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:p})},A.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var p=-1,C=E(this.media.textTracks),l=0;l<C.length;l++)if(C[l].mode==="hidden")p=l;else if(C[l].mode==="showing"){p=l;break}this.subtitleTrack!==p&&(this.subtitleTrack=p)},u(d,[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(p){this._subtitleDisplay=p,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(p){this.selectDefaultTrack=!1;var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(p,C)}}]),d}(k.default);function E(f){for(var d=[],A=0;A<f.length;A++){var s=f[A];(s.kind==="subtitles"||s.kind==="captions")&&s.label&&d.push(f[A])}return d}const o=x},"./src/controller/timeline-controller.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{TimelineController:()=>x});var W=O("./src/polyfills/number.ts"),e=O("./src/events.ts"),k=O("./src/utils/cea-608-parser.ts"),L=O("./src/utils/output-filter.ts"),I=O("./src/utils/webvtt-parser.ts"),u=O("./src/utils/texttrack-utils.ts"),m=O("./src/utils/imsc1-ttml-parser.ts"),i=O("./src/utils/mp4-tools.ts"),g=O("./src/types/loader.ts"),w=O("./src/utils/logger.ts"),x=function(){function d(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var p=new L.default(this,"textTrack1"),C=new L.default(this,"textTrack2"),l=new L.default(this,"textTrack3"),T=new L.default(this,"textTrack4");this.cea608Parser1=new k.default(1,p,C),this.cea608Parser2=new k.default(3,l,T)}s.on(e.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(e.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(e.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(e.Events.FRAG_LOADING,this.onFragLoading,this),s.on(e.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(e.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(e.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(e.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(e.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(e.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var A=d.prototype;return A.destroy=function(){var p=this.hls;p.off(e.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(e.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.off(e.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),p.off(e.Events.FRAG_LOADING,this.onFragLoading,this),p.off(e.Events.FRAG_LOADED,this.onFragLoaded,this),p.off(e.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),p.off(e.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),p.off(e.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.off(e.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),p.off(e.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},A.addCues=function(p,C,l,T,y){for(var _=!1,v=y.length;v--;){var n=y[v],a=o(n[0],n[1],C,l);if(a>=0&&(n[0]=Math.min(n[0],C),n[1]=Math.max(n[1],l),_=!0,a/(l-C)>.5))return}if(_||y.push([C,l]),this.config.renderTextTracksNatively){var r=this.captionsTracks[p];this.Cues.newCue(r,C,l,T)}else{var t=this.Cues.newCue(null,C,l,T);this.hls.trigger(e.Events.CUES_PARSED,{type:"captions",cues:t,track:p})}},A.onInitPtsFound=function(p,C){var l=this,T=C.frag,y=C.id,_=C.initPTS,v=C.timescale,n=this.unparsedVttFrags;y==="main"&&(this.initPTS[T.cc]=_,this.timescale[T.cc]=v),n.length&&(this.unparsedVttFrags=[],n.forEach(function(a){l.onFragLoaded(e.Events.FRAG_LOADED,a)}))},A.getExistingTrack=function(p){var C=this.media;if(C)for(var l=0;l<C.textTracks.length;l++){var T=C.textTracks[l];if(T[p])return T}return null},A.createCaptionsTrack=function(p){this.config.renderTextTracksNatively?this.createNativeTrack(p):this.createNonNativeTrack(p)},A.createNativeTrack=function(p){if(this.captionsTracks[p])return;var C=this.captionsProperties,l=this.captionsTracks,T=this.media,y=C[p],_=y.label,v=y.languageCode,n=this.getExistingTrack(p);if(n)l[p]=n,(0,u.clearCurrentCues)(l[p]),(0,u.sendAddTrackEvent)(l[p],T);else{var a=this.createTextTrack("captions",_,v);a&&(a[p]=!0,l[p]=a)}},A.createNonNativeTrack=function(p){if(this.nonNativeCaptionsTracks[p])return;var C=this.captionsProperties[p];if(!C)return;var l=C.label,T={_id:p,label:l,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[p]=T,this.hls.trigger(e.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},A.createTextTrack=function(p,C,l){var T=this.media;return T?T.addTextTrack(p,C,l):void 0},A.onMediaAttaching=function(p,C){this.media=C.media,this._cleanTracks()},A.onMediaDetaching=function(){var p=this.captionsTracks;Object.keys(p).forEach(function(C){(0,u.clearCurrentCues)(p[C]),delete p[C]}),this.nonNativeCaptionsTracks={}},A.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),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())},A._cleanTracks=function(){var p=this.media;if(!p)return;var C=p.textTracks;if(C)for(var l=0;l<C.length;l++)(0,u.clearCurrentCues)(C[l])},A.onSubtitleTracksUpdated=function(p,C){var l=this;this.textTracks=[];var T=C.subtitleTracks||[],y=T.some(function(a){return a.textCodec===m.IMSC1_CODEC});if(this.config.enableWebVTT||y&&this.config.enableIMSC1){var _=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(a,r){var t;if(r<v.length){for(var c=null,b=0;b<v.length;b++)if(E(v[b],a)){c=v[b];break}c&&(t=c)}if(t)(0,u.clearCurrentCues)(t);else{var h=l._captionsOrSubtitlesFromCharacteristics(a);t=l.createTextTrack(h,a.name,a.lang),t&&(t.mode="disabled")}t&&(t.groupId=a.groupId,l.textTracks.push(t))})}else if(!_&&this.tracks&&this.tracks.length){var n=this.tracks.map(function(a){return{label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}});this.hls.trigger(e.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}},A._captionsOrSubtitlesFromCharacteristics=function(p){var C;if((C=p.attrs)!==null&&C!==void 0&&C.CHARACTERISTICS){var l=/transcribes-spoken-dialog/gi.test(p.attrs.CHARACTERISTICS),T=/describes-music-and-sound/gi.test(p.attrs.CHARACTERISTICS);if(l&&T)return"captions"}return"subtitles"},A.onManifestLoaded=function(p,C){var l=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(T){var y=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!y)return;var _="textTrack"+y[1],v=l.captionsProperties[_];if(!v)return;v.label=T.name,T.lang&&(v.languageCode=T.lang),v.media=T})},A.closedCaptionsForLevel=function(p){var C=this.hls.levels[p.level];return C==null?void 0:C.attrs["CLOSED-CAPTIONS"]},A.onFragLoading=function(p,C){var l=this.cea608Parser1,T=this.cea608Parser2,y=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(l&&T))return;if(C.frag.type===g.PlaylistLevelType.MAIN){var v,n,a=C.frag.sn,r=(v=C==null||((n=C.part)===null||n===void 0)?void 0:n.index)!=null?v:-1;a===y+1||a===y&&r===_+1||(l.reset(),T.reset()),this.lastSn=a,this.lastPartIndex=r}},A.onFragLoaded=function(p,C){var l=C.frag,T=C.payload,y=this.initPTS,_=this.unparsedVttFrags;if(l.type===g.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!(0,W.isFiniteNumber)(y[l.cc])){_.push(C),y.length&&this.hls.trigger(e.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:new Error("Missing initial subtitle PTS")});return}var v=l.decryptdata,n="stats"in C;if(v==null||!v.encrypted||n){var a=this.tracks[l.level],r=this.vttCCs;r[l.cc]||(r[l.cc]={start:l.start,prevCC:this.prevCC,new:!0},this.prevCC=l.cc),a&&a.textCodec===m.IMSC1_CODEC?this._parseIMSC1(l,T):this._parseVTTs(l,T,r)}}else this.hls.trigger(e.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:new Error("Empty subtitle payload")})},A._parseIMSC1=function(p,C){var l=this,T=this.hls;(0,m.parseIMSC1)(C,this.initPTS[p.cc],this.timescale[p.cc],function(y){l._appendCues(y,p.level),T.trigger(e.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:p})},function(y){w.logger.log("Failed to parse IMSC1: "+y),T.trigger(e.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:y})})},A._parseVTTs=function(p,C,l){var T,y=this,_=this.hls,v=(T=p.initSegment)!==null&&T!==void 0&&T.data?(0,i.appendUint8Array)(p.initSegment.data,new Uint8Array(C)):C;(0,I.parseWebVTT)(v,this.initPTS[p.cc],this.timescale[p.cc],l,p.cc,p.start,function(n){y._appendCues(n,p.level),_.trigger(e.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:p})},function(n){y._fallbackToIMSC1(p,C),w.logger.log("Failed to parse VTT cue: "+n),_.trigger(e.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:n})})},A._fallbackToIMSC1=function(p,C){var l=this,T=this.tracks[p.level];T.textCodec||(0,m.parseIMSC1)(C,this.initPTS[p.cc],this.timescale[p.cc],function(){T.textCodec=m.IMSC1_CODEC,l._parseIMSC1(p,C)},function(){T.textCodec="wvtt"})},A._appendCues=function(p,C){var l=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[C];if(!T||T.mode==="disabled")return;p.forEach(function(v){return(0,u.addCueToTrack)(T,v)})}else{var y=this.tracks[C];if(!y)return;var _=y.default?"default":"subtitles"+C;l.trigger(e.Events.CUES_PARSED,{type:"subtitles",cues:p,track:_})}},A.onFragDecrypted=function(p,C){var l=C.frag;if(l.type===g.PlaylistLevelType.SUBTITLE){if(!(0,W.isFiniteNumber)(this.initPTS[l.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(e.Events.FRAG_LOADED,C)}},A.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},A.onFragParsingUserdata=function(p,C){var l=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(l&&T))return;var y=C.frag,_=C.samples;if(y.type===g.PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(y)==="NONE")return;for(var v=0;v<_.length;v++){var n=_[v].bytes;if(n){var a=this.extractCea608Data(n);l.addData(_[v].pts,a[0]),T.addData(_[v].pts,a[1])}}},A.onBufferFlushing=function(p,C){var l=C.startOffset,T=C.endOffset,y=C.endOffsetSubtitles,_=C.type,v=this.media;if(!v||v.currentTime<T)return;if(!_||_==="video"){var n=this.captionsTracks;Object.keys(n).forEach(function(r){return(0,u.removeCuesInRange)(n[r],l,T)})}if(this.config.renderTextTracksNatively&&(l===0&&y!==void 0)){var a=this.textTracks;Object.keys(a).forEach(function(r){return(0,u.removeCuesInRange)(a[r],l,y)})}},A.extractCea608Data=function(p){for(var C=[[],[]],l=p[0]&31,T=2,y=0;y<l;y++){var _=p[T++],v=127&p[T++],n=127&p[T++];if(v===0&&n===0)continue;var a=(4&_)!==0;if(a){var r=3&_;(r===0||r===1)&&(C[r].push(v),C[r].push(n))}}return C},d}();function E(d,A){return d&&d.label===A.name&&!(d.textTrack1||d.textTrack2)}function o(d,A,s,p){return Math.min(A,p)-Math.max(d,s)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}},"./src/crypt/aes-crypto.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>W});var W=function(){function e(L,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=L,this.aesIV=I}var k=e.prototype;return k.decrypt=function(I,u){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},u,I)},e}()},"./src/crypt/aes-decryptor.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>k,removePadding:()=>e});var W=O("./src/utils/typed-array.ts");function e(L){var I=L.byteLength,u=I&&new DataView(L.buffer).getUint8(I-1);return u?(0,W.sliceUint8)(L,0,I-u):L}var k=function(){function L(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var I=L.prototype;return I.uint8ArrayToUint32Array_=function(m){for(var i=new DataView(m),g=new Uint32Array(4),w=0;w<4;w++)g[w]=i.getUint32(w*4);return g},I.initTable=function(){var m=this.sBox,i=this.invSBox,g=this.subMix,w=g[0],x=g[1],E=g[2],o=g[3],f=this.invSubMix,d=f[0],A=f[1],s=f[2],p=f[3],C=new Uint32Array(256),l=0,T=0,y=0;for(y=0;y<256;y++)y<128?C[y]=y<<1:C[y]=y<<1^283;for(y=0;y<256;y++){var _=T^T<<1^T<<2^T<<3^T<<4;_=_>>>8^_&255^99,m[l]=_,i[_]=l;var v=C[l],n=C[v],a=C[n],r=C[_]*257^_*16843008;w[l]=r<<24|r>>>8,x[l]=r<<16|r>>>16,E[l]=r<<8|r>>>24,o[l]=r,r=a*16843009^n*65537^v*257^l*16843008,d[_]=r<<24|r>>>8,A[_]=r<<16|r>>>16,s[_]=r<<8|r>>>24,p[_]=r,l?(l=v^C[C[C[a^v]]],T^=C[C[T]]):l=T=1}},I.expandKey=function(m){for(var i=this.uint8ArrayToUint32Array_(m),g=!0,w=0;w<i.length&&g;)g=i[w]===this.key[w],w++;if(g)return;this.key=i;var x=this.keySize=i.length;if(x!==4&&x!==6&&x!==8)throw new Error("Invalid aes key size="+x);var E=this.ksRows=(x+6+1)*4,o,f,d=this.keySchedule=new Uint32Array(E),A=this.invKeySchedule=new Uint32Array(E),s=this.sBox,p=this.rcon,C=this.invSubMix,l=C[0],T=C[1],y=C[2],_=C[3],v,n;for(o=0;o<E;o++){if(o<x){v=d[o]=i[o];continue}n=v,o%x===0?(n=n<<8|n>>>24,n=s[n>>>24]<<24|s[n>>>16&255]<<16|s[n>>>8&255]<<8|s[n&255],n^=p[o/x|0]<<24):x>6&&o%x===4&&(n=s[n>>>24]<<24|s[n>>>16&255]<<16|s[n>>>8&255]<<8|s[n&255]),d[o]=v=(d[o-x]^n)>>>0}for(f=0;f<E;f++)o=E-f,f&3?n=d[o]:n=d[o-4],f<4||o<=4?A[f]=n:A[f]=l[s[n>>>24]]^T[s[n>>>16&255]]^y[s[n>>>8&255]]^_[s[n&255]],A[f]=A[f]>>>0},I.networkToHostOrderSwap=function(m){return m<<24|(m&65280)<<8|(m&16711680)>>8|m>>>24},I.decrypt=function(m,i,g){for(var w=this.keySize+6,x=this.invKeySchedule,E=this.invSBox,o=this.invSubMix,f=o[0],d=o[1],A=o[2],s=o[3],p=this.uint8ArrayToUint32Array_(g),C=p[0],l=p[1],T=p[2],y=p[3],_=new Int32Array(m),v=new Int32Array(_.length),n,a,r,t,c,b,h,D,P,j,N,H,z,J,Y=this.networkToHostOrderSwap;i<_.length;){for(P=Y(_[i]),j=Y(_[i+1]),N=Y(_[i+2]),H=Y(_[i+3]),c=P^x[0],b=H^x[1],h=N^x[2],D=j^x[3],z=4,J=1;J<w;J++)n=f[c>>>24]^d[b>>16&255]^A[h>>8&255]^s[D&255]^x[z],a=f[b>>>24]^d[h>>16&255]^A[D>>8&255]^s[c&255]^x[z+1],r=f[h>>>24]^d[D>>16&255]^A[c>>8&255]^s[b&255]^x[z+2],t=f[D>>>24]^d[c>>16&255]^A[b>>8&255]^s[h&255]^x[z+3],c=n,b=a,h=r,D=t,z=z+4;n=E[c>>>24]<<24^E[b>>16&255]<<16^E[h>>8&255]<<8^E[D&255]^x[z],a=E[b>>>24]<<24^E[h>>16&255]<<16^E[D>>8&255]<<8^E[c&255]^x[z+1],r=E[h>>>24]<<24^E[D>>16&255]<<16^E[c>>8&255]<<8^E[b&255]^x[z+2],t=E[D>>>24]<<24^E[c>>16&255]<<16^E[b>>8&255]<<8^E[h&255]^x[z+3],v[i]=Y(n^C),v[i+1]=Y(t^l),v[i+2]=Y(r^T),v[i+3]=Y(a^y),C=P,l=j,T=N,y=H,i=i+4}return v.buffer},L}()},"./src/crypt/decrypter.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>i});var W=O("./src/crypt/aes-crypto.ts"),e=O("./src/crypt/fast-aes-key.ts"),k=O("./src/crypt/aes-decryptor.ts"),L=O("./src/utils/logger.ts"),I=O("./src/utils/mp4-tools.ts"),u=O("./src/utils/typed-array.ts"),m=16,i=function(){function g(x,E){var o=E===void 0?{}:E,f=o.removePKCS7Padding,d=f===void 0?!0:f;if(this.logEnabled=!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.useSoftware=void 0,this.useSoftware=x.enableSoftwareAES,this.removePKCS7Padding=d,d)try{var A=self.crypto;A&&(this.subtle=A.subtle||A.webkitSubtle)}catch(s){}this.subtle===null&&(this.useSoftware=!0)}var w=g.prototype;return w.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},w.isSync=function(){return this.useSoftware},w.flush=function(){var E=this.currentResult,o=this.remainderData;if(!E||o)return this.reset(),null;var f=new Uint8Array(E);return this.reset(),this.removePKCS7Padding?(0,k.removePadding)(f):f},w.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},w.decrypt=function(E,o,f){var d=this;return this.useSoftware?new Promise(function(A,s){d.softwareDecrypt(new Uint8Array(E),o,f);var p=d.flush();p?A(p.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(E),o,f)},w.softwareDecrypt=function(E,o,f){var d=this.currentIV,A=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(E=(0,I.appendUint8Array)(s,E),this.remainderData=null);var p=this.getValidChunk(E);if(!p.length)return null;d&&(f=d);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new k.default),C.expandKey(o);var l=A;return this.currentResult=C.decrypt(p.buffer,0,f),this.currentIV=(0,u.sliceUint8)(p,-16).buffer,l||null},w.webCryptoDecrypt=function(E,o,f){var d=this,A=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new e.default(A,o)),this.fastAesKey.expandKey().then(function(s){if(!A)return Promise.reject(new Error("web crypto not initialized"));d.logOnce("WebCrypto AES decrypt");var p=new W.default(A,new Uint8Array(f));return p.decrypt(E.buffer,s)}).catch(function(s){return L.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+s.name+": "+s.message),d.onWebCryptoError(E,o,f)})},w.onWebCryptoError=function(E,o,f){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(E,o,f);var d=this.flush();if(d)return d.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},w.getValidChunk=function(E){var o=E,f=E.length-E.length%m;return f!==E.length&&(o=(0,u.sliceUint8)(E,0,f),this.remainderData=(0,u.sliceUint8)(E,f)),o},w.logOnce=function(E){if(!this.logEnabled)return;L.logger.log("[decrypter]: "+E),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>W});var W=function(){function e(L,I){this.subtle=void 0,this.key=void 0,this.subtle=L,this.key=I}var k=e.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}()},"./src/demux/aacdemuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>i});var W=O("./src/demux/base-audio-demuxer.ts"),e=O("./src/demux/adts.ts"),k=O("./src/utils/logger.ts"),L=O("./src/demux/id3.ts");function I(g,w){g.prototype=Object.create(w.prototype),g.prototype.constructor=g,u(g,w)}function u(g,w){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,o){return E.__proto__=o,E},u(g,w)}var m=function(g){I(w,g);function w(E,o){var f;return f=g.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=E,f.config=o,f}var x=w.prototype;return x.resetInitSegment=function(o,f,d,A){g.prototype.resetInitSegment.call(this,o,f,d,A),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:f,duration:A,inputTimeScale:9e4,dropped:0}},w.probe=function(o){if(!o)return!1;for(var f=L.getID3Data(o,0)||[],d=f.length,A=o.length;d<A;d++)if(e.probe(o,d))return k.logger.log("ADTS sync word found !"),!0;return!1},x.canParse=function(o,f){return e.canParse(o,f)},x.appendFrame=function(o,f,d){e.initTrackConfig(o,this.observer,f,d,o.manifestCodec);var A=e.appendFrame(o,f,d,this.basePTS,this.frameIndex);if(A&&A.missing===0)return A},w}(W.default);const i=m},"./src/demux/adts.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{appendFrame:()=>d,canGetFrameLength:()=>i,canParse:()=>w,getAudioConfig:()=>L,getFrameDuration:()=>o,getFullFrameLength:()=>m,getHeaderLength:()=>u,initTrackConfig:()=>E,isHeader:()=>g,isHeaderPattern:()=>I,parseFrameHeader:()=>f,probe:()=>x});var W=O("./src/utils/logger.ts"),e=O("./src/errors.ts"),k=O("./src/events.ts");function L(A,s,p,C){var l,T,y,_,v=navigator.userAgent.toLowerCase(),n=C,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];l=((s[p+2]&192)>>>6)+1;var r=(s[p+2]&60)>>>2;if(r>a.length-1){A.trigger(k.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+r});return}return y=(s[p+2]&1)<<2,y|=(s[p+3]&192)>>>6,W.logger.log("manifest codec:"+C+", ADTS type:"+l+", samplingIndex:"+r),/firefox/i.test(v)?r>=6?(l=5,_=new Array(4),T=r-3):(l=2,_=new Array(2),T=r):v.indexOf("android")!==-1?(l=2,_=new Array(2),T=r):(l=5,_=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&r>=6?T=r-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(r>=6&&y===1||/vivaldi/i.test(v))||!C&&y===1)&&(l=2,_=new Array(2)),T=r)),_[0]=l<<3,_[0]|=(r&14)>>1,_[1]|=(r&1)<<7,_[1]|=y<<3,l===5&&(_[1]|=(T&14)>>1,_[2]=(T&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:a[r],channelCount:y,codec:"mp4a.40."+l,manifestCodec:n}}function I(A,s){return A[s]===255&&(A[s+1]&246)===240}function u(A,s){return A[s+1]&1?7:9}function m(A,s){return(A[s+3]&3)<<11|A[s+4]<<3|(A[s+5]&224)>>>5}function i(A,s){return s+5<A.length}function g(A,s){return s+1<A.length&&I(A,s)}function w(A,s){return i(A,s)&&I(A,s)&&m(A,s)<=A.length-s}function x(A,s){if(g(A,s)){var p=u(A,s);if(s+p>=A.length)return!1;var C=m(A,s);if(C<=p)return!1;var l=s+C;return l===A.length||g(A,l)}return!1}function E(A,s,p,C,l){if(!A.samplerate){var T=L(s,p,C,l);if(!T)return;A.config=T.config,A.samplerate=T.samplerate,A.channelCount=T.channelCount,A.codec=T.codec,A.manifestCodec=T.manifestCodec,W.logger.log("parsed codec:"+A.codec+", rate:"+T.samplerate+", channels:"+T.channelCount)}}function o(A){return 1024*9e4/A}function f(A,s){var p=u(A,s);if(s+p<=A.length){var C=m(A,s)-p;if(C>0)return{headerLength:p,frameLength:C}}}function d(A,s,p,C,l){var T=o(A.samplerate),y=C+l*T,_=f(s,p),v;if(_){var n=_.frameLength,a=_.headerLength,r=a+n,t=Math.max(0,p+r-s.length);t?(v=new Uint8Array(r-a),v.set(s.subarray(p+a,s.length),0)):v=s.subarray(p+a,p+r);var c={unit:v,pts:y};return t||A.samples.push(c),{sample:c,length:r,missing:t}}var b=s.length-p;v=new Uint8Array(b),v.set(s.subarray(p,s.length),0);var h={unit:v,pts:y};return{sample:h,length:b,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>g,initPTSFn:()=>i});var W=O("./src/polyfills/number.ts"),e=O("./src/demux/id3.ts"),k=O("./src/types/demuxer.ts"),L=O("./src/demux/dummy-demuxed-track.ts"),I=O("./src/utils/mp4-tools.ts"),u=O("./src/utils/typed-array.ts"),m=function(){function w(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var x=w.prototype;return x.resetInitSegment=function(o,f,d,A){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},x.resetTimeStamp=function(o){this.initPTS=o,this.resetContiguity()},x.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},x.canParse=function(o,f){return!1},x.appendFrame=function(o,f,d){},x.demux=function(o,f){this.cachedData&&(o=(0,I.appendUint8Array)(this.cachedData,o),this.cachedData=null);var d=e.getID3Data(o,0),A=d?d.length:0,s,p=this._audioTrack,C=this._id3Track,l=d?e.getTimeStamp(d):void 0,T=o.length;for((this.basePTS===null||this.frameIndex===0&&(0,W.isFiniteNumber)(l))&&(this.basePTS=i(l,f,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),d&&d.length>0&&C.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:d,type:k.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});A<T;){if(this.canParse(o,A)){var y=this.appendFrame(p,o,A);y?(this.frameIndex++,this.lastPTS=y.sample.pts,A+=y.length,s=A):A=T}else e.canParse(o,A)?(d=e.getID3Data(o,A),C.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:d,type:k.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY}),A+=d.length,s=A):A++;if(A===T&&s!==T){var _=(0,u.sliceUint8)(o,s);this.cachedData?this.cachedData=(0,I.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:p,videoTrack:(0,L.dummyTrack)(),id3Track:C,textTrack:(0,L.dummyTrack)()}},x.demuxSampleAes=function(o,f,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},x.flush=function(o){var f=this.cachedData;return f&&(this.cachedData=null,this.demux(f,0)),{audioTrack:this._audioTrack,videoTrack:(0,L.dummyTrack)(),id3Track:this._id3Track,textTrack:(0,L.dummyTrack)()}},x.destroy=function(){},w}(),i=function(x,E,o){return(0,W.isFiniteNumber)(x)?x*90:E*9e4+(o||0)};const g=m},"./src/demux/chunk-cache.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>W});var W=function(){function k(){this.chunks=[],this.dataLength=0}var L=k.prototype;return L.push=function(u){this.chunks.push(u),this.dataLength+=u.length},L.flush=function(){var u=this.chunks,m=this.dataLength,i;if(u.length)u.length===1?i=u[0]:i=e(u,m);else return new Uint8Array(0);return this.reset(),i},L.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function e(k,L){for(var I=new Uint8Array(L),u=0,m=0;m<k.length;m++){var i=k[m];I.set(i,u),u+=i.length}return I}},"./src/demux/dummy-demuxed-track.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{dummyTrack:()=>W});function W(e,k){return e===void 0&&(e=""),k===void 0&&(k=9e4),{type:e,id:-1,pid:-1,inputTimeScale:k,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>k});var W=O("./src/utils/logger.ts"),e=function(){function L(u){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=u,this.bytesAvailable=u.byteLength,this.word=0,this.bitsAvailable=0}var I=L.prototype;return I.loadWord=function(){var m=this.data,i=this.bytesAvailable,g=m.byteLength-i,w=new Uint8Array(4),x=Math.min(4,i);if(x===0)throw new Error("no bytes available");w.set(m.subarray(g,g+x)),this.word=new DataView(w.buffer).getUint32(0),this.bitsAvailable=x*8,this.bytesAvailable-=x},I.skipBits=function(m){var i;m=Math.min(m,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>m?(this.word<<=m,this.bitsAvailable-=m):(m-=this.bitsAvailable,i=m>>3,m-=i<<3,this.bytesAvailable-=i,this.loadWord(),this.word<<=m,this.bitsAvailable-=m)},I.readBits=function(m){var i=Math.min(this.bitsAvailable,m),g=this.word>>>32-i;if(m>32&&W.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=i,this.bitsAvailable>0)this.word<<=i;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return i=m-i,i>0&&this.bitsAvailable?g<<i|this.readBits(i):g},I.skipLZ=function(){var m;for(m=0;m<this.bitsAvailable;++m)if((this.word&2147483648>>>m)!==0)return this.word<<=m,this.bitsAvailable-=m,m;return this.loadWord(),m+this.skipLZ()},I.skipUEG=function(){this.skipBits(1+this.skipLZ())},I.skipEG=function(){this.skipBits(1+this.skipLZ())},I.readUEG=function(){var m=this.skipLZ();return this.readBits(m+1)-1},I.readEG=function(){var m=this.readUEG();return 1&m?1+m>>>1:-1*(m>>>1)},I.readBoolean=function(){return this.readBits(1)===1},I.readUByte=function(){return this.readBits(8)},I.readUShort=function(){return this.readBits(16)},I.readUInt=function(){return this.readBits(32)},I.skipScalingList=function(m){for(var i=8,g=8,w,x=0;x<m;x++)g!==0&&(w=this.readEG(),g=(i+w+256)%256),i=g===0?i:g},I.readSPS=function(){var m=0,i=0,g=0,w=0,x,E,o,f=this.readUByte.bind(this),d=this.readBits.bind(this),A=this.readUEG.bind(this),s=this.readBoolean.bind(this),p=this.skipBits.bind(this),C=this.skipEG.bind(this),l=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);f();var y=f();if(d(5),p(3),f(),l(),y===100||y===110||y===122||y===244||y===44||y===83||y===86||y===118||y===128){var _=A();if(_===3&&p(1),l(),l(),p(1),s())for(E=_!==3?8:12,o=0;o<E;o++)s()&&(o<6?T(16):T(64))}l();var v=A();if(v===0)A();else if(v===1)for(p(1),C(),C(),x=A(),o=0;o<x;o++)C();l(),p(1);var n=A(),a=A(),r=d(1);r===0&&p(1),p(1),s()&&(m=A(),i=A(),g=A(),w=A());var t=[1,1];if(s()&&s()){var c=f();switch(c){case 1:t=[1,1];break;case 2:t=[12,11];break;case 3:t=[10,11];break;case 4:t=[16,11];break;case 5:t=[40,33];break;case 6:t=[24,11];break;case 7:t=[20,11];break;case 8:t=[32,11];break;case 9:t=[80,33];break;case 10:t=[18,11];break;case 11:t=[15,11];break;case 12:t=[64,33];break;case 13:t=[160,99];break;case 14:t=[4,3];break;case 15:t=[3,2];break;case 16:t=[2,1];break;case 255:{t=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((n+1)*16-m*2-i*2),height:(2-r)*(a+1)*16-(r?2:4)*(g+w),pixelRatio:t}},I.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();const k=e},"./src/demux/id3.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{canParse:()=>I,decodeFrame:()=>w,getID3Data:()=>k,getID3Frames:()=>g,getTimeStamp:()=>u,isFooter:()=>e,isHeader:()=>W,isTimeStampFrame:()=>m,testables:()=>A,utf8ArrayToStr:()=>d});var W=function(l,T){return T+10<=l.length&&(l[T]===73&&l[T+1]===68&&l[T+2]===51&&(l[T+3]<255&&l[T+4]<255&&(l[T+6]<128&&l[T+7]<128&&l[T+8]<128&&l[T+9]<128)))},e=function(l,T){return T+10<=l.length&&(l[T]===51&&l[T+1]===68&&l[T+2]===73&&(l[T+3]<255&&l[T+4]<255&&(l[T+6]<128&&l[T+7]<128&&l[T+8]<128&&l[T+9]<128)))},k=function(l,T){for(var y=T,_=0;W(l,T);){_+=10;var v=L(l,T+6);_+=v,e(l,T+10)&&(_+=10),T+=_}return _>0?l.subarray(y,y+_):void 0},L=function(l,T){var y=0;return y=(l[T]&127)<<21,y|=(l[T+1]&127)<<14,y|=(l[T+2]&127)<<7,y|=l[T+3]&127,y},I=function(l,T){return W(l,T)&&L(l,T+6)+10<=l.length-T},u=function(l){for(var T=g(l),y=0;y<T.length;y++){var _=T[y];if(m(_))return f(_)}return},m=function(l){return l&&l.key==="PRIV"&&l.info==="com.apple.streaming.transportStreamTimestamp"},i=function(l){var T=String.fromCharCode(l[0],l[1],l[2],l[3]),y=L(l,4),_=10;return{type:T,size:y,data:l.subarray(_,_+y)}},g=function(l){for(var T=0,y=[];W(l,T);){var _=L(l,T+6);T+=10;for(var v=T+_;T+8<v;){var n=i(l.subarray(T)),a=w(n);a&&y.push(a),T+=n.size+10}e(l,T)&&(T+=10)}return y},w=function(l){return l.type==="PRIV"?x(l):l.type[0]==="W"?o(l):E(l)},x=function(l){if(l.size<2)return;var T=d(l.data,!0),y=new Uint8Array(l.data.subarray(T.length+1));return{key:l.type,info:T,data:y.buffer}},E=function(l){if(l.size<2)return;if(l.type==="TXXX"){var T=1,y=d(l.data.subarray(T),!0);T+=y.length+1;var _=d(l.data.subarray(T));return{key:l.type,info:y,data:_}}var v=d(l.data.subarray(1));return{key:l.type,data:v}},o=function(l){if(l.type==="WXXX"){if(l.size<2)return;var T=1,y=d(l.data.subarray(T),!0);T+=y.length+1;var _=d(l.data.subarray(T));return{key:l.type,info:y,data:_}}var v=d(l.data);return{key:l.type,data:v}},f=function(l){if(l.data.byteLength===8){var T=new Uint8Array(l.data),y=T[3]&1,_=(T[4]<<23)+(T[5]<<15)+(T[6]<<7)+T[7];return _/=45,y&&(_+=4772185884e-2),Math.round(_)}return},d=function(l,T){T===void 0&&(T=!1);var y=p();if(y){var _=y.decode(l);if(T){var v=_.indexOf("\0");return v!==-1?_.substring(0,v):_}return _.replace(/\0/g,"")}for(var n=l.length,a,r,t,c="",b=0;b<n;){if(a=l[b++],a===0&&T)return c;if(a===0||a===3)continue;switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(a);break;case 12:case 13:r=l[b++],c+=String.fromCharCode((a&31)<<6|r&63);break;case 14:r=l[b++],t=l[b++],c+=String.fromCharCode((a&15)<<12|(r&63)<<6|(t&63)<<0);break;default:}}return c},A={decodeTextFrame:E},s;function p(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>i});var W=O("./src/demux/base-audio-demuxer.ts"),e=O("./src/demux/id3.ts"),k=O("./src/utils/logger.ts"),L=O("./src/demux/mpegaudio.ts");function I(g,w){g.prototype=Object.create(w.prototype),g.prototype.constructor=g,u(g,w)}function u(g,w){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,o){return E.__proto__=o,E},u(g,w)}var m=function(g){I(w,g);function w(){return g.apply(this,arguments)||this}var x=w.prototype;return x.resetInitSegment=function(o,f,d,A){g.prototype.resetInitSegment.call(this,o,f,d,A),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:f,duration:A,inputTimeScale:9e4,dropped:0}},w.probe=function(o){if(!o)return!1;for(var f=e.getID3Data(o,0)||[],d=f.length,A=o.length;d<A;d++)if(L.probe(o,d))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},x.canParse=function(o,f){return L.canParse(o,f)},x.appendFrame=function(o,f,d){return this.basePTS===null?void 0:L.appendFrame(o,f,d,this.basePTS,this.frameIndex)},w}(W.default);const i=m},"./src/demux/mp4demuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>m});var W=O("./src/polyfills/number.ts"),e=O("./src/types/demuxer.ts"),k=O("./src/utils/mp4-tools.ts"),L=O("./src/demux/dummy-demuxed-track.ts"),I=/\/emsg[-/]ID3/i,u=function(){function i(w,x){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=x}var g=i.prototype;return g.resetTimeStamp=function(){},g.resetInitSegment=function(x,E,o,f){var d=this.videoTrack=(0,L.dummyTrack)("video",1),A=this.audioTrack=(0,L.dummyTrack)("audio",1),s=this.txtTrack=(0,L.dummyTrack)("text",1);if(this.id3Track=(0,L.dummyTrack)("id3",1),this.timeOffset=0,!x||!x.byteLength)return;var p=(0,k.parseInitSegment)(x);if(p.video){var C=p.video,l=C.id,T=C.timescale,y=C.codec;d.id=l,d.timescale=s.timescale=T,d.codec=y}if(p.audio){var _=p.audio,v=_.id,n=_.timescale,a=_.codec;A.id=v,A.timescale=n,A.codec=a}s.id=k.RemuxerTrackIdConfig.text,d.sampleDuration=0,d.duration=A.duration=f},g.resetContiguity=function(){},i.probe=function(x){return x=x.length>16384?x.subarray(0,16384):x,(0,k.findBox)(x,["moof"]).length>0},g.demux=function(x,E){this.timeOffset=E;var o=x,f=this.videoTrack,d=this.txtTrack;if(this.config.progressive){this.remainderData&&(o=(0,k.appendUint8Array)(this.remainderData,x));var A=(0,k.segmentValidRange)(o);this.remainderData=A.remainder,f.samples=A.valid||new Uint8Array}else f.samples=o;var s=this.extractID3Track(f,E);return d.samples=(0,k.parseSamples)(E,f),{videoTrack:f,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},g.flush=function(){var x=this.timeOffset,E=this.videoTrack,o=this.txtTrack;E.samples=this.remainderData||new Uint8Array,this.remainderData=null;var f=this.extractID3Track(E,this.timeOffset);return o.samples=(0,k.parseSamples)(x,E),{videoTrack:E,audioTrack:(0,L.dummyTrack)(),id3Track:f,textTrack:(0,L.dummyTrack)()}},g.extractID3Track=function(x,E){var o=this.id3Track;if(x.samples.length){var f=(0,k.findBox)(x.samples,["emsg"]);f&&f.forEach(function(d){var A=(0,k.parseEmsg)(d);if(I.test(A.schemeIdUri)){var s=(0,W.isFiniteNumber)(A.presentationTime)?A.presentationTime/A.timeScale:E+A.presentationTimeDelta/A.timeScale,p=A.eventDuration===4294967295?Number.POSITIVE_INFINITY:A.eventDuration/A.timeScale;p<=.001&&(p=Number.POSITIVE_INFINITY);var C=A.payload;o.samples.push({data:C,len:C.byteLength,dts:s,pts:s,type:e.MetadataSchema.emsg,duration:p})}})}return o},g.demuxSampleAes=function(x,E,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},g.destroy=function(){},i}();const m=u},"./src/demux/mpegaudio.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{appendFrame:()=>u,canParse:()=>w,isHeader:()=>g,isHeaderPattern:()=>i,parseHeader:()=>m,probe:()=>x});var W=null,e=[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],k=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],L=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function u(E,o,f,d,A){if(f+24>o.length)return;var s=m(o,f);if(s&&f+s.frameLength<=o.length){var p=s.samplesPerFrame*9e4/s.sampleRate,C=d+A*p,l={unit:o.subarray(f,f+s.frameLength),pts:C,dts:C};return E.config=[],E.channelCount=s.channelCount,E.samplerate=s.sampleRate,E.samples.push(l),{sample:l,length:s.frameLength,missing:0}}}function m(E,o){var f=E[o+1]>>3&3,d=E[o+1]>>1&3,A=E[o+2]>>4&15,s=E[o+2]>>2&3;if(f!==1&&A!==0&&A!==15&&s!==3){var p=E[o+2]>>1&1,C=E[o+3]>>6,l=f===3?3-d:d===3?3:4,T=e[l*14+A-1]*1e3,y=f===3?0:f===2?1:2,_=k[y*3+s],v=C===3?1:2,n=L[f][d],a=I[d],r=n*8*a,t=Math.floor(n*T/_+p)*a;if(W===null){var c=navigator.userAgent||"",b=c.match(/Chrome\/(\d+)/i);W=b?parseInt(b[1]):0}var h=!!W&&W<=87;return h&&d===2&&T>=224e3&&C===0&&(E[o+3]=E[o+3]|128),{sampleRate:_,channelCount:v,frameLength:t,samplesPerFrame:r}}}function i(E,o){return E[o]===255&&(E[o+1]&224)===224&&(E[o+1]&6)!==0}function g(E,o){return o+1<E.length&&i(E,o)}function w(E,o){var f=4;return i(E,o)&&f<=E.length-o}function x(E,o){if(o+1<E.length&&i(E,o)){var f=4,d=m(E,o),A=f;d!=null&&d.frameLength&&(A=d.frameLength);var s=o+A;return s===E.length||g(E,s)}return!1}},"./src/demux/sample-aes.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>L});var W=O("./src/crypt/decrypter.ts"),e=O("./src/utils/mp4-tools.ts"),k=function(){function I(m,i,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new W.default(i,{removePKCS7Padding:!1})}var u=I.prototype;return u.decryptBuffer=function(i){return this.decrypter.decrypt(i,this.keyData.key.buffer,this.keyData.iv.buffer)},u.decryptAacSample=function(i,g,w){var x=this,E=i[g].unit;if(E.length<=16)return;var o=E.subarray(16,E.length-E.length%16),f=o.buffer.slice(o.byteOffset,o.byteOffset+o.length);this.decryptBuffer(f).then(function(d){var A=new Uint8Array(d);E.set(A,16),x.decrypter.isSync()||x.decryptAacSamples(i,g+1,w)})},u.decryptAacSamples=function(i,g,w){for(;;g++){if(g>=i.length){w();return}if(i[g].unit.length<32)continue;if(this.decryptAacSample(i,g,w),!this.decrypter.isSync())return}},u.getAvcEncryptedData=function(i){for(var g=Math.floor((i.length-48)/160)*16+16,w=new Int8Array(g),x=0,E=32;E<i.length-16;E+=160,x+=16)w.set(i.subarray(E,E+16),x);return w},u.getAvcDecryptedUnit=function(i,g){for(var w=new Uint8Array(g),x=0,E=32;E<i.length-16;E+=160,x+=16)i.set(w.subarray(x,x+16),E);return i},u.decryptAvcSample=function(i,g,w,x,E){var o=this,f=(0,e.discardEPB)(E.data),d=this.getAvcEncryptedData(f);this.decryptBuffer(d.buffer).then(function(A){E.data=o.getAvcDecryptedUnit(f,A),o.decrypter.isSync()||o.decryptAvcSamples(i,g,w+1,x)})},u.decryptAvcSamples=function(i,g,w,x){if(i instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,w=0){if(g>=i.length){x();return}for(var E=i[g].units;!(w>=E.length);w++){var o=E[w];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;if(this.decryptAvcSample(i,g,w,x,o),!this.decrypter.isSync())return}}},I}();const L=k},"./src/demux/transmuxer-interface.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>w});var W=O("./src/demux/webworkify-webpack.js"),e=O("./src/events.ts"),k=O("./src/demux/transmuxer.ts"),L=O("./src/utils/logger.ts"),I=O("./src/errors.ts"),u=O("./src/utils/mediasource-helper.ts"),m=O("./node_modules/eventemitter3/index.js"),i=O.n(m),g=(0,u.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function x(o,f,d,A){var s=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var p=o.config;this.hls=o,this.id=f,this.useWorker=!!p.enableWorker,this.onTransmuxComplete=d,this.onFlush=A;var C=function(v,n){n=n||{},n.frag=s.frag,n.id=s.id,s.hls.trigger(v,n)};this.observer=new m.EventEmitter,this.observer.on(e.Events.FRAG_DECRYPTED,C),this.observer.on(e.Events.ERROR,C);var l={mp4:g.isTypeSupported("video/mp4"),mpeg:g.isTypeSupported("audio/mpeg"),mp3:g.isTypeSupported('audio/mp4; codecs="mp3"')},T=navigator.vendor;if(this.useWorker&&typeof Worker!="undefined"){L.logger.log("demuxing in webworker");var y;try{y=this.worker=(0,W.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(_){s.useWorker=!1,L.logger.warn("Exception in webworker, fallback to inline"),s.hls.trigger(e.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},y.postMessage({cmd:"init",typeSupported:l,vendor:T,id:f,config:JSON.stringify(p)})}catch(_){L.logger.warn("Error in worker:",_),L.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new k.default(this.observer,l,p,T,f),this.worker=null}}else this.transmuxer=new k.default(this.observer,l,p,T,f)}var E=x.prototype;return E.destroy=function(){var f=this.worker;if(f)f.removeEventListener("message",this.onwmsg),f.terminate(),this.worker=null,this.onwmsg=void 0;else{var d=this.transmuxer;d&&(d.destroy(),this.transmuxer=null)}var A=this.observer;A&&A.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},E.push=function(f,d,A,s,p,C,l,T,y,_){var v,n,a=this;y.transmuxing.start=self.performance.now();var r=this.transmuxer,t=this.worker,c=C?C.start:p.start,b=p.decryptdata,h=this.frag,D=!(h&&p.cc===h.cc),P=!(h&&y.level===h.level),j=h?y.sn-h.sn:-1,N=this.part?y.part-this.part.index:-1,H=j===0&&y.id>1&&y.id===(h==null?void 0:h.stats.chunkCount),z=!P&&(j===1||j===0&&(N===1||H&&N<=0)),J=self.performance.now();(P||j||p.stats.parsing.start===0)&&(p.stats.parsing.start=J),C&&(N||!z)&&(C.stats.parsing.start=J);var Y=!(h&&((v=p.initSegment)===null||v===void 0?void 0:v.url)===((n=h.initSegment)===null||n===void 0?void 0:n.url)),le=new k.TransmuxState(D,z,T,P,c,Y);if(!z||D||Y){L.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
discontinuity: `+D+`
trackSwitch: `+P+`
contiguous: `+z+`
accurateTimeOffset: `+T+`
timeOffset: `+c+`
initSegmentChange: `+Y);var te=new k.TransmuxConfig(A,s,d,l,_);this.configureTransmuxer(te)}if(this.frag=p,this.part=C,t)t.postMessage({cmd:"demux",data:f,decryptdata:b,chunkMeta:y,state:le},f instanceof ArrayBuffer?[f]:[]);else if(r){var Z=r.push(f,b,y,le);(0,k.isPromise)(Z)?(r.async=!0,Z.then(function(_e){a.handleTransmuxComplete(_e)}).catch(function(_e){a.transmuxerError(_e,y,"transmuxer-interface push error")})):(r.async=!1,this.handleTransmuxComplete(Z))}},E.flush=function(f){var d=this;f.transmuxing.start=self.performance.now();var A=this.transmuxer,s=this.worker;if(s)s.postMessage({cmd:"flush",chunkMeta:f});else if(A){var p=A.flush(f),C=(0,k.isPromise)(p);C||A.async?((0,k.isPromise)(p)||(p=Promise.resolve(p)),p.then(function(l){d.handleFlushResult(l,f)}).catch(function(l){d.transmuxerError(l,f,"transmuxer-interface flush error")})):this.handleFlushResult(p,f)}},E.transmuxerError=function(f,d,A){if(!this.hls)return;this.hls.trigger(e.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:d,fatal:!1,error:f,err:f,reason:A})},E.handleFlushResult=function(f,d){var A=this;f.forEach(function(s){A.handleTransmuxComplete(s)}),this.onFlush(d)},E.onWorkerMessage=function(f){var d=f.data,A=this.hls;switch(d.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(d.data);break}case"flush":{this.onFlush(d.data);break}case"workerLog":L.logger[d.data.logType]&&L.logger[d.data.logType](d.data.message);break;default:{d.data=d.data||{},d.data.frag=this.frag,d.data.id=this.id,A.trigger(d.event,d.data);break}}},E.configureTransmuxer=function(f){var d=this.worker,A=this.transmuxer;d?d.postMessage({cmd:"configure",config:f}):A&&A.configure(f)},E.handleTransmuxComplete=function(f){f.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(f)},x}()},"./src/demux/transmuxer-worker.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>m});var W=O("./src/demux/transmuxer.ts"),e=O("./src/events.ts"),k=O("./src/utils/logger.ts"),L=O("./node_modules/eventemitter3/index.js"),I=O.n(L),u=O("./src/errors.ts");function m(E){var o=new L.EventEmitter,f=function(s,p){E.postMessage({event:s,data:p})};o.on(e.Events.FRAG_DECRYPTED,f),o.on(e.Events.ERROR,f);var d=function(){var s=function(l){var T=function(_){f("workerLog",{logType:l,message:_})};k.logger[l]=T};for(var p in k.logger)s(p)};E.addEventListener("message",function(A){var s=A.data;switch(s.cmd){case"init":{var p=JSON.parse(s.config);E.transmuxer=new W.default(o,s.typeSupported,p,s.vendor,s.id),(0,k.enableLogs)(p.debug,s.id),d(),f("init",null);break}case"configure":{E.transmuxer.configure(s.config);break}case"demux":{var C=E.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);(0,W.isPromise)(C)?(E.transmuxer.async=!0,C.then(function(_){i(E,_)}).catch(function(_){f(e.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:s.chunkMeta,fatal:!1,error:_,err:_,reason:"transmuxer-worker push error"})})):(E.transmuxer.async=!1,i(E,C));break}case"flush":{var l=s.chunkMeta,T=E.transmuxer.flush(l),y=(0,W.isPromise)(T);y||E.transmuxer.async?((0,W.isPromise)(T)||(T=Promise.resolve(T)),T.then(function(_){w(E,_,l)}).catch(function(_){f(e.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:s.chunkMeta,fatal:!1,error:_,err:_,reason:"transmuxer-worker flush error"})})):w(E,T,l);break}default:break}})}function i(E,o){if(x(o.remuxResult))return!1;var f=[],d=o.remuxResult,A=d.audio,s=d.video;return A&&g(f,A),s&&g(f,s),E.postMessage({event:"transmuxComplete",data:o},f),!0}function g(E,o){o.data1&&E.push(o.data1.buffer),o.data2&&E.push(o.data2.buffer)}function w(E,o,f){var d=o.reduce(function(A,s){return i(E,s)||A},!1);d||E.postMessage({event:"transmuxComplete",data:o[0]}),E.postMessage({event:"flush",data:f})}function x(E){return!E.audio&&!E.video&&!E.text&&!E.id3&&!E.initSegment}},"./src/demux/transmuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{TransmuxConfig:()=>s,TransmuxState:()=>p,default:()=>o,isPromise:()=>A});var W=O("./src/events.ts"),e=O("./src/errors.ts"),k=O("./src/crypt/decrypter.ts"),L=O("./src/demux/aacdemuxer.ts"),I=O("./src/demux/mp4demuxer.ts"),u=O("./src/demux/tsdemuxer.ts"),m=O("./src/demux/mp3demuxer.ts"),i=O("./src/remux/mp4-remuxer.ts"),g=O("./src/remux/passthrough-remuxer.ts"),w=O("./src/utils/logger.ts"),x;try{x=self.performance.now.bind(self.performance)}catch(C){w.logger.debug("Unable to use Performance API on this environment"),x=self.Date.now}var E=[{demux:I.default,remux:g.default},{demux:u.default,remux:i.default},{demux:L.default,remux:i.default},{demux:m.default,remux:i.default}],o=function(){function C(T,y,_,v,n){this.async=!1,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.observer=T,this.typeSupported=y,this.config=_,this.vendor=v,this.id=n}var l=C.prototype;return l.configure=function(y){this.transmuxConfig=y,this.decrypter&&this.decrypter.reset()},l.push=function(y,_,v,n){var a=this,r=v.transmuxing;r.executeStart=x();var t=new Uint8Array(y),c=this.currentTransmuxState,b=this.transmuxConfig;n&&(this.currentTransmuxState=n);var h=n||c,D=h.contiguous,P=h.discontinuity,j=h.trackSwitch,N=h.accurateTimeOffset,H=h.timeOffset,z=h.initSegmentChange,J=b.audioCodec,Y=b.videoCodec,le=b.defaultInitPts,te=b.duration,Z=b.initSegmentData,_e=f(t,_);if(_e&&_e.method==="AES-128"){var we=this.getDecrypter();if(we.isSync()){var De=we.softwareDecrypt(t,_e.key.buffer,_e.iv.buffer),Ee=v.part>-1;if(Ee&&(De=we.flush()),!De)return r.executeEnd=x(),d(v);t=new Uint8Array(De)}else return this.decryptionPromise=we.webCryptoDecrypt(t,_e.key.buffer,_e.iv.buffer).then(function(Ae){var Q=a.push(Ae,null,v);return a.decryptionPromise=null,Q}),this.decryptionPromise}var xe=this.needsProbing(P,j);xe&&this.configureTransmuxer(t),(P||j||z||xe)&&this.resetInitSegment(Z,J,Y,te,_),(P||z||xe)&&this.resetInitialTimestamp(le),D||this.resetContiguity();var ve=this.transmux(t,_e,H,N,v),X=this.currentTransmuxState;return X.contiguous=!0,X.discontinuity=!1,X.trackSwitch=!1,r.executeEnd=x(),ve},l.flush=function(y){var _=this,v=y.transmuxing;v.executeStart=x();var n=this.decrypter,a=this.currentTransmuxState,r=this.decryptionPromise;if(r)return r.then(function(){return _.flush(y)});var t=[],c=a.timeOffset;if(n){var b=n.flush();b&&t.push(this.push(b,null,y))}var h=this.demuxer,D=this.remuxer;if(!h||!D)return this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=x(),[d(y)];var P=h.flush(c);return A(P)?P.then(function(j){return _.flushRemux(t,j,y),t}):(this.flushRemux(t,P,y),t)},l.flushRemux=function(y,_,v){var n=_.audioTrack,a=_.videoTrack,r=_.id3Track,t=_.textTrack,c=this.currentTransmuxState,b=c.accurateTimeOffset,h=c.timeOffset;w.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var D=this.remuxer.remux(n,a,r,t,h,b,!0,this.id);y.push({remuxResult:D,chunkMeta:v}),v.transmuxing.executeEnd=x()},l.resetInitialTimestamp=function(y){var _=this.demuxer,v=this.remuxer;if(!_||!v)return;_.resetTimeStamp(y),v.resetTimeStamp(y)},l.resetContiguity=function(){var y=this.demuxer,_=this.remuxer;if(!y||!_)return;y.resetContiguity(),_.resetNextTimestamp()},l.resetInitSegment=function(y,_,v,n,a){var r=this.demuxer,t=this.remuxer;if(!r||!t)return;r.resetInitSegment(y,_,v,n),t.resetInitSegment(y,_,v,a)},l.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},l.transmux=function(y,_,v,n,a){var r;return _&&_.method==="SAMPLE-AES"?r=this.transmuxSampleAes(y,_,v,n,a):r=this.transmuxUnencrypted(y,v,n,a),r},l.transmuxUnencrypted=function(y,_,v,n){var a=this.demuxer.demux(y,_,!1,!this.config.progressive),r=a.audioTrack,t=a.videoTrack,c=a.id3Track,b=a.textTrack,h=this.remuxer.remux(r,t,c,b,_,v,!1,this.id);return{remuxResult:h,chunkMeta:n}},l.transmuxSampleAes=function(y,_,v,n,a){var r=this;return this.demuxer.demuxSampleAes(y,_,v).then(function(t){var c=r.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,v,n,!1,r.id);return{remuxResult:c,chunkMeta:a}})},l.configureTransmuxer=function(y){for(var _=this.config,v=this.observer,n=this.typeSupported,a=this.vendor,r,t=0,c=E.length;t<c;t++)if(E[t].demux.probe(y)){r=E[t];break}r||(w.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),r={demux:I.default,remux:g.default});var b=this.demuxer,h=this.remuxer,D=r.remux,P=r.demux;(!h||!(h instanceof D))&&(this.remuxer=new D(v,_,n,a)),(!b||!(b instanceof P))&&(this.demuxer=new P(v,_,n),this.probe=P.probe)},l.needsProbing=function(y,_){return!this.demuxer||!this.remuxer||y||_},l.getDecrypter=function(){var y=this.decrypter;return y||(y=this.decrypter=new k.default(this.config)),y},C}();function f(C,l){var T=null;return C.byteLength>0&&l!=null&&l.key!=null&&l.iv!==null&&l.method!=null&&(T=l),T}var d=function(l){return{remuxResult:{},chunkMeta:l}};function A(C){return"then"in C&&C.then instanceof Function}var s=function(l,T,y,_,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=T,this.initSegmentData=y,this.duration=_,this.defaultInitPts=v},p=function(l,T,y,_,v,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=l,this.contiguous=T,this.accurateTimeOffset=y,this.trackSwitch=_,this.timeOffset=v,this.initSegmentChange=n}},"./src/demux/tsdemuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>C});var W=O("./src/demux/adts.ts"),e=O("./src/demux/mpegaudio.ts"),k=O("./src/demux/exp-golomb.ts"),L=O("./src/demux/sample-aes.ts"),I=O("./src/events.ts"),u=O("./src/utils/mp4-tools.ts"),m=O("./src/utils/logger.ts"),i=O("./src/errors.ts"),g=O("./src/types/demuxer.ts");function w(){return w=Object.assign?Object.assign.bind():function(l){for(var T=1;T<arguments.length;T++){var y=arguments[T];for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(l[_]=y[_])}return l},w.apply(this,arguments)}var x=188,E=function(){function l(y,_,v){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._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=y,this.config=_,this.typeSupported=v}l.probe=function(_){var v=l.syncOffset(_);return v>0&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v),v!==-1},l.syncOffset=function(_){for(var v=_.length,n=Math.min(x*5,_.length-x)+1,a=0;a<n;){for(var r=!1,t=a;t<v&&_[t]===71;t+=x)if(!r&&f(_,t)===0&&(r=!0),r&&t+x>n)return a;a++}return-1},l.createTrack=function(_,v){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:u.RemuxerTrackIdConfig[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?v:void 0}};var T=l.prototype;return T.resetInitSegment=function(_,v,n,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=l.createTrack("video"),this._audioTrack=l.createTrack("audio",a),this._id3Track=l.createTrack("id3"),this._txtTrack=l.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=v,this.videoCodec=n,this._duration=a},T.resetTimeStamp=function(){},T.resetContiguity=function(){var _=this._audioTrack,v=this._avcTrack,n=this._id3Track;_&&(_.pesData=null),v&&(v.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},T.demux=function(_,v,n,a){n===void 0&&(n=!1),a===void 0&&(a=!1),n||(this.sampleAes=null);var r,t=this._avcTrack,c=this._audioTrack,b=this._id3Track,h=this._txtTrack,D=t.pid,P=t.pesData,j=c.pid,N=b.pid,H=c.pesData,z=b.pesData,J=null,Y=this.pmtParsed,le=this._pmtId,te=_.length;if(this.remainderData&&(_=(0,u.appendUint8Array)(this.remainderData,_),te=_.length,this.remainderData=null),te<x&&!a)return this.remainderData=_,{audioTrack:c,videoTrack:t,id3Track:b,textTrack:h};var Z=Math.max(0,l.syncOffset(_));te-=(te-Z)%x,te<_.byteLength&&!a&&(this.remainderData=new Uint8Array(_.buffer,te,_.buffer.byteLength-te));for(var _e=0,we=Z;we<te;we+=x)if(_[we]===71){var De=!!(_[we+1]&64),Ee=f(_,we),xe=(_[we+3]&48)>>4,ve=void 0;if(xe>1){if(ve=we+5+_[we+4],ve===we+x)continue}else ve=we+4;switch(Ee){case D:De&&(P&&(r=s(P))&&this.parseAVCPES(t,h,r,!1),P={data:[],size:0}),P&&(P.data.push(_.subarray(ve,we+x)),P.size+=we+x-ve);break;case j:if(De){if(H&&(r=s(H)))switch(c.segmentCodec){case"aac":this.parseAACPES(c,r);break;case"mp3":this.parseMPEGPES(c,r);break}H={data:[],size:0}}H&&(H.data.push(_.subarray(ve,we+x)),H.size+=we+x-ve);break;case N:De&&(z&&(r=s(z))&&this.parseID3PES(b,r),z={data:[],size:0}),z&&(z.data.push(_.subarray(ve,we+x)),z.size+=we+x-ve);break;case 0:De&&(ve+=_[ve]+1),le=this._pmtId=d(_,ve);break;case le:{De&&(ve+=_[ve]+1);var X=A(_,ve,this.typeSupported,n);D=X.avc,D>0&&(t.pid=D),j=X.audio,j>0&&(c.pid=j,c.segmentCodec=X.segmentCodec),N=X.id3,N>0&&(b.pid=N),J!==null&&!Y&&(m.logger.warn("MPEG-TS PMT found at "+we+" after unknown PID '"+J+"'. Backtracking to sync byte @"+Z+" to parse all TS packets."),J=null,we=Z-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=Ee;break}}else _e++;_e>0&&this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+_e+" TS packet/s that do not start with 0x47"}),t.pesData=P,c.pesData=H,b.pesData=z;var Ae={audioTrack:c,videoTrack:t,id3Track:b,textTrack:h};return a&&this.extractRemainingSamples(Ae),Ae},T.flush=function(){var _=this.remainderData;this.remainderData=null;var v;return _?v=this.demux(_,-1,!1,!0):v={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},T.extractRemainingSamples=function(_){var v=_.audioTrack,n=_.videoTrack,a=_.id3Track,r=_.textTrack,t=n.pesData,c=v.pesData,b=a.pesData,h;if(t&&(h=s(t))?(this.parseAVCPES(n,r,h,!0),n.pesData=null):n.pesData=t,c&&(h=s(c))){switch(v.segmentCodec){case"aac":this.parseAACPES(v,h);break;case"mp3":this.parseMPEGPES(v,h);break}v.pesData=null}else c!=null&&c.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=c;b&&(h=s(b))?(this.parseID3PES(a,h),a.pesData=null):a.pesData=b},T.demuxSampleAes=function(_,v,n){var a=this.demux(_,n,!0,!this.config.progressive),r=this.sampleAes=new L.default(this.observer,this.config,v);return this.decrypt(a,r)},T.decrypt=function(_,v){return new Promise(function(n){var a=_.audioTrack,r=_.videoTrack;a.samples&&a.segmentCodec==="aac"?v.decryptAacSamples(a.samples,0,function(){r.samples?v.decryptAvcSamples(r.samples,0,0,function(){n(_)}):n(_)}):r.samples&&v.decryptAvcSamples(r.samples,0,0,function(){n(_)})})},T.destroy=function(){this._duration=0},T.parseAVCPES=function(_,v,n,a){var r=this,t=this.parseAVCNALu(_,n.data),c=!1,b=this.avcSample,h,D=!1;n.data=null,b&&t.length&&!_.audFound&&(p(b,_),b=this.avcSample=o(!1,n.pts,n.dts,"")),t.forEach(function(P){switch(P.type){case 1:{h=!0,b||(b=r.avcSample=o(!0,n.pts,n.dts,"")),c&&(b.debug+="NDR "),b.frame=!0;var j=P.data;if(D&&j.length>4){var N=new k.default(j).readSliceType();(N===2||N===4||N===7||N===9)&&(b.key=!0)}break}case 5:h=!0,b||(b=r.avcSample=o(!0,n.pts,n.dts,"")),c&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{h=!0,c&&b&&(b.debug+="SEI "),(0,u.parseSEIMessageFromNALu)(P.data,1,n.pts,v.samples);break}case 7:if(h=!0,D=!0,c&&b&&(b.debug+="SPS "),!_.sps){var H=new k.default(P.data),z=H.readSPS();_.width=z.width,_.height=z.height,_.pixelRatio=z.pixelRatio,_.sps=[P.data],_.duration=r._duration;for(var J=P.data.subarray(1,4),Y="avc1.",le=0;le<3;le++){var te=J[le].toString(16);te.length<2&&(te="0"+te),Y+=te}_.codec=Y}break;case 8:h=!0,c&&b&&(b.debug+="PPS "),_.pps||(_.pps=[P.data]);break;case 9:h=!1,_.audFound=!0,b&&p(b,_),b=r.avcSample=o(!1,n.pts,n.dts,c?"AUD ":"");break;case 12:h=!0;break;default:h=!1,b&&(b.debug+="unknown NAL "+P.type+" ");break}if(b&&h){var Z=b.units;Z.push(P)}}),a&&b&&(p(b,_),this.avcSample=null)},T.getLastNalUnit=function(_){var v,n=this.avcSample,a;if((!n||n.units.length===0)&&(n=_[_.length-1]),(v=n)!==null&&v!==void 0&&v.units){var r=n.units;a=r[r.length-1]}return a},T.parseAVCNALu=function(_,v){var n=v.byteLength,a=_.naluState||0,r=a,t=[],c=0,b,h,D,P=-1,j=0;for(a===-1&&(P=0,j=v[0]&31,a=0,c=1);c<n;){if(b=v[c++],!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 N={data:v.subarray(P,c-a-1),type:j};t.push(N)}else{var H=this.getLastNalUnit(_.samples);if(H&&(r&&c<=4-r&&(H.state&&(H.data=H.data.subarray(0,H.data.byteLength-r))),h=c-a-1,h>0)){var z=new Uint8Array(H.data.byteLength+h);z.set(H.data,0),z.set(v.subarray(0,h),H.data.byteLength),H.data=z,H.state=0}}c<n?(D=v[c]&31,P=c,j=D,a=0):a=-1}else a=0}if(P>=0&&a>=0){var J={data:v.subarray(P,n),type:j,state:a};t.push(J)}if(t.length===0){var Y=this.getLastNalUnit(_.samples);if(Y){var le=new Uint8Array(Y.data.byteLength+v.byteLength);le.set(Y.data,0),le.set(v,Y.data.byteLength),Y.data=le}}return _.naluState=a,t},T.parseAACPES=function(_,v){var n=0,a=this.aacOverFlow,r=v.data;if(a){this.aacOverFlow=null;var t=a.missing,c=a.sample.unit.byteLength;if(t===-1){var b=new Uint8Array(c+r.byteLength);b.set(a.sample.unit,0),b.set(r,c),r=b}else{var h=c-t;a.sample.unit.set(r.subarray(0,t),h),_.samples.push(a.sample),n=a.missing}}var D,P;for(D=n,P=r.length;D<P-1&&!W.isHeader(r,D);D++);if(D!==n){var j,N;if(D<P-1?(j="AAC PES did not start with ADTS header,offset:"+D,N=!1):(j="no ADTS header found in AAC PES",N=!0),m.logger.warn("parsing error:"+j),this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:N,reason:j}),N)return}W.initTrackConfig(_,this.observer,r,D,this.audioCodec);var H;if(v.pts!==void 0)H=v.pts;else if(a){var z=W.getFrameDuration(_.samplerate);H=a.sample.pts+z}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0,Y;D<P;)if(Y=W.appendFrame(_,r,D,H,J),D+=Y.length,Y.missing){this.aacOverFlow=Y;break}else for(J++;D<P-1&&!W.isHeader(r,D);D++);},T.parseMPEGPES=function(_,v){var n=v.data,a=n.length,r=0,t=0,c=v.pts;if(c===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;t<a;)if(e.isHeader(n,t)){var b=e.appendFrame(_,n,t,c,r);if(b)t+=b.length,r++;else break}else t++},T.parseID3PES=function(_,v){if(v.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var n=w({},v,{type:this._avcTrack?g.MetadataSchema.emsg:g.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});_.samples.push(n)},l}();function o(l,T,y,_){return{key:l,frame:!1,pts:T,dts:y,units:[],debug:_,length:0}}function f(l,T){return((l[T+1]&31)<<8)+l[T+2]}function d(l,T){return(l[T+10]&31)<<8|l[T+11]}function A(l,T,y,_){var v={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},n=(l[T+1]&15)<<8|l[T+2],a=T+3+n-4,r=(l[T+10]&15)<<8|l[T+11];for(T+=12+r;T<a;){var t=f(l,T);switch(l[T]){case 207:if(!_){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=t);break;case 21:v.id3===-1&&(v.id3=t);break;case 219:if(!_){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=t);break;case 3:case 4:y.mpeg!==!0&&y.mp3!==!0?m.logger.log("MPEG audio found, not supported in this browser"):v.audio===-1&&(v.audio=t,v.segmentCodec="mp3");break;case 36:m.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((l[T+3]&15)<<8|l[T+4])+5}return v}function s(l){var T=0,y,_,v,n,a,r=l.data;if(!l||l.size===0)return null;for(;r[0].length<19&&r.length>1;){var t=new Uint8Array(r[0].length+r[1].length);t.set(r[0]),t.set(r[1],r[0].length),r[0]=t,r.splice(1,1)}y=r[0];var c=(y[0]<<16)+(y[1]<<8)+y[2];if(c===1){if(_=(y[4]<<8)+y[5],_&&_>l.size-6)return null;var b=y[7];b&192&&(n=(y[9]&14)*536870912+(y[10]&255)*4194304+(y[11]&254)*16384+(y[12]&255)*128+(y[13]&254)/2,b&64?(a=(y[14]&14)*536870912+(y[15]&255)*4194304+(y[16]&254)*16384+(y[17]&255)*128+(y[18]&254)/2,n-a>60*9e4&&(m.logger.warn(Math.round((n-a)/9e4)+"s delta between PTS and DTS, align them"),n=a)):a=n),v=y[8];var h=v+9;if(l.size<=h)return null;l.size-=h;for(var D=new Uint8Array(l.size),P=0,j=r.length;P<j;P++){y=r[P];var N=y.byteLength;if(h)if(h>N){h-=N;continue}else y=y.subarray(h),N-=h,h=0;D.set(y,T),T+=N}return _&&(_-=v+3),{data:D,pts:n,dts:a,len:_}}return null}function p(l,T){if(l.units.length&&l.frame){if(l.pts===void 0){var y=T.samples,_=y.length;if(_){var v=y[_-1];l.pts=v.pts,l.dts=v.dts}else{T.dropped++;return}}T.samples.push(l)}l.debug.length&&m.logger.log(l.pts+"/"+l.dts+":"+l.debug)}const C=E},"./src/demux/webworkify-webpack.js":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>x});var W=function(){var o=ENTRY_MODULE,f={},d=function s(p){var C=f[p];if(C!==void 0)return C.exports;var l=f[p]={exports:{}};return o[p].call(l.exports,l,l.exports,s),l.exports};d.m=o,function(){d.n=function(s){var p=s&&s.__esModule?function(){return s.default}:function(){return s};return d.d(p,{a:p}),p}}(),function(){d.d=function(s,p){for(var C in p)d.o(p,C)&&!d.o(s,C)&&Object.defineProperty(s,C,{enumerable:!0,get:p[C]})}}(),function(){d.o=function(s,p){return Object.prototype.hasOwnProperty.call(s,p)}}(),function(){d.r=function(s){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}}();var A=d(ENTRY_MODULE);return A.default||A},e=W.toString().split("ENTRY_MODULE"),k="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+k+").*?\\)";function I(E){return(E+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function u(E){return!isNaN(1*E)}function m(E,o,f){var d={};d[f]=[];var A=o.toString().replace(/^"[^"]+"/,"function"),s=A.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||A.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return d;for(var p=s[1],C=new RegExp("(\\\\n|\\W)"+I(p)+L,"g"),l;l=C.exec(A);){if(l[3]==="dll-reference")continue;d[f].push(l[3])}for(C=new RegExp("\\("+I(p)+'\\("(dll-reference\\s('+k+'))"\\)\\)'+L,"g");l=C.exec(A);)E[l[2]]||(d[f].push(l[1]),E[l[2]]=O(l[1]).m),d[l[2]]=d[l[2]]||[],d[l[2]].push(l[4]);for(var T=Object.keys(d),y=0;y<T.length;y++)for(var _=0;_<d[T[y]].length;_++)u(d[T[y]][_])&&(d[T[y]][_]=1*d[T[y]][_]);return d}function i(E){var o=Object.keys(E);return o.reduce(function(f,d){return f||E[d].length>0},!1)}function g(E,o){for(var f={main:[o]},d={main:[]},A={main:{}};i(f);)for(var s=Object.keys(f),p=0;p<s.length;p++){var C=s[p],l=f[C],T=l.pop();if(A[C]=A[C]||{},A[C][T]||!E[C][T])continue;A[C][T]=!0,d[C]=d[C]||[],d[C].push(T);for(var y=m(E,E[C][T],C),_=Object.keys(y),v=0;v<_.length;v++)f[_[v]]=f[_[v]]||[],f[_[v]]=f[_[v]].concat(y[_[v]])}return d}function w(E,o,f,d){var A=E[d].map(function(s){return'"'+s+'": '+o[d][s].toString().replace(/^"[^"]+"/,"function")}).join(",");return e[0]+"{"+A+"}"+e[1]+'"'+f+'"'+e[2]}function x(E,o){o=o||{};var f={main:O.m},d=o.all?{main:Object.keys(f.main)}:g(f,E),A="";Object.keys(d).filter(function(T){return T!=="main"}).forEach(function(T){for(var y=0;d[T][y];)y++;d[T].push(y),f[T][y]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",A=A+("var "+T+" = ("+w(d,f,y,modules)+`)();
`)}),A=A+("new (("+w(d,f,E,"main")+")())(self);");var s=new window.Blob([A],{type:"text/javascript"}),p=window.URL||window.webkitURL||window.mozURL||window.msURL,C=p.createObjectURL(s),l=new window.Worker(C);return l.objectURL=C,l}},"./src/errors.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{ErrorDetails:()=>e,ErrorTypes:()=>W});var W;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(W||(W={}));var e;(function(k){k.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",k.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",k.KEY_SYSTEM_NO_SESSION="keySystemNoSession",k.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",k.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",k.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",k.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",k.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",k.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",k.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",k.MANIFEST_LOAD_ERROR="manifestLoadError",k.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",k.MANIFEST_PARSING_ERROR="manifestParsingError",k.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",k.LEVEL_EMPTY_ERROR="levelEmptyError",k.LEVEL_LOAD_ERROR="levelLoadError",k.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",k.LEVEL_SWITCH_ERROR="levelSwitchError",k.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",k.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",k.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",k.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",k.FRAG_LOAD_ERROR="fragLoadError",k.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",k.FRAG_DECRYPT_ERROR="fragDecryptError",k.FRAG_PARSING_ERROR="fragParsingError",k.REMUX_ALLOC_ERROR="remuxAllocError",k.KEY_LOAD_ERROR="keyLoadError",k.KEY_LOAD_TIMEOUT="keyLoadTimeOut",k.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",k.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",k.BUFFER_APPEND_ERROR="bufferAppendError",k.BUFFER_APPENDING_ERROR="bufferAppendingError",k.BUFFER_STALLED_ERROR="bufferStalledError",k.BUFFER_FULL_ERROR="bufferFullError",k.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",k.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",k.INTERNAL_EXCEPTION="internalException",k.INTERNAL_ABORTED="aborted",k.UNKNOWN="unknown"})(e||(e={}))},"./src/events.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{Events:()=>W});var W;(function(e){e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached"})(W||(W={}))},"./src/hls.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>y});var W=O("./node_modules/url-toolkit/src/url-toolkit.js"),e=O.n(W),k=O("./src/loader/playlist-loader.ts"),L=O("./src/controller/id3-track-controller.ts"),I=O("./src/controller/latency-controller.ts"),u=O("./src/controller/level-controller.ts"),m=O("./src/controller/fragment-tracker.ts"),i=O("./src/loader/key-loader.ts"),g=O("./src/controller/stream-controller.ts"),w=O("./src/is-supported.ts"),x=O("./src/utils/logger.ts"),E=O("./src/config.ts"),o=O("./node_modules/eventemitter3/index.js"),f=O.n(o),d=O("./src/events.ts"),A=O("./src/errors.ts"),s=O("./src/types/level.ts");function p(_,v){for(var n=0;n<v.length;n++){var a=v[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(_,l(a.key),a)}}function C(_,v,n){return v&&p(_.prototype,v),n&&p(_,n),Object.defineProperty(_,"prototype",{writable:!1}),_}function l(_){var v=T(_,"string");return typeof v=="symbol"?v:String(v)}function T(_,v){if(typeof _!="object"||_===null)return _;var n=_[Symbol.toPrimitive];if(n!==void 0){var a=n.call(_,v||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(_)}var y=function(){_.isSupported=function(){return(0,w.isSupported)()};function _(n){n===void 0&&(n={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.EventEmitter,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var a=this.config=(0,E.mergeConfig)(_.DefaultConfig,n);this.userConfig=n,(0,x.enableLogs)(a.debug,"Hls instance"),this._autoLevelCapping=-1,a.progressive&&(0,E.enableStreamingMode)(a);var r=a.abrController,t=a.bufferController,c=a.capLevelController,b=a.fpsController,h=this.abrController=new r(this),D=this.bufferController=new t(this),P=this.capLevelController=new c(this),j=new b(this),N=new k.default(this),H=new L.default(this),z=this.levelController=new u.default(this),J=new m.FragmentTracker(this),Y=new i.default(this.config),le=this.streamController=new g.default(this,J,Y);P.setStreamController(le),j.setStreamController(le);var te=[N,z,le];this.networkControllers=te;var Z=[h,D,P,j,H,J];this.audioTrackController=this.createController(a.audioTrackController,te);var _e=a.audioStreamController;_e&&te.push(new _e(this,J,Y)),this.subtitleTrackController=this.createController(a.subtitleTrackController,te);var we=a.subtitleStreamController;we&&te.push(new we(this,J,Y)),this.createController(a.timelineController,Z),Y.emeController=this.emeController=this.createController(a.emeController,Z),this.cmcdController=this.createController(a.cmcdController,Z),this.latencyController=this.createController(I.default,Z),this.coreComponents=Z}var v=_.prototype;return v.createController=function(a,r){if(a){var t=new a(this);return r&&r.push(t),t}return null},v.on=function(a,r,t){t===void 0&&(t=this),this._emitter.on(a,r,t)},v.once=function(a,r,t){t===void 0&&(t=this),this._emitter.once(a,r,t)},v.removeAllListeners=function(a){this._emitter.removeAllListeners(a)},v.off=function(a,r,t,c){t===void 0&&(t=this),this._emitter.off(a,r,t,c)},v.listeners=function(a){return this._emitter.listeners(a)},v.emit=function(a,r,t){return this._emitter.emit(a,r,t)},v.trigger=function(a,r){if(this.config.debug)return this.emit(a,a,r);try{return this.emit(a,a,r)}catch(t){x.logger.error("An internal error happened while handling event "+a+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(d.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:a,error:t})}return!1},v.listenerCount=function(a){return this._emitter.listenerCount(a)},v.destroy=function(){x.logger.log("destroy"),this.trigger(d.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(a){return a.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(a){return a.destroy()}),this.coreComponents.length=0},v.attachMedia=function(a){x.logger.log("attachMedia"),this._media=a,this.trigger(d.Events.MEDIA_ATTACHING,{media:a})},v.detachMedia=function(){x.logger.log("detachMedia"),this.trigger(d.Events.MEDIA_DETACHING,void 0),this._media=null},v.loadSource=function(a){this.stopLoad();var r=this.media,t=this.url,c=this.url=W.buildAbsoluteURL(self.location.href,a,{alwaysNormalize:!0});x.logger.log("loadSource:"+c),r&&t&&t!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(r)),this.trigger(d.Events.MANIFEST_LOADING,{url:a})},v.startLoad=function(a){a===void 0&&(a=-1),x.logger.log("startLoad("+a+")"),this.networkControllers.forEach(function(r){r.startLoad(a)})},v.stopLoad=function(){x.logger.log("stopLoad"),this.networkControllers.forEach(function(a){a.stopLoad()})},v.swapAudioCodec=function(){x.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},v.recoverMediaError=function(){x.logger.log("recoverMediaError");var a=this._media;this.detachMedia(),a&&this.attachMedia(a)},v.removeLevel=function(a,r){r===void 0&&(r=0),this.levelController.removeLevel(a,r)},C(_,[{key:"levels",get:function(){var a=this.levelController.levels;return a||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(a){x.logger.log("set currentLevel:"+a),this.loadLevel=a,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(a){x.logger.log("set nextLevel:"+a),this.levelController.manualLevel=a,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(a){x.logger.log("set loadLevel:"+a),this.levelController.manualLevel=a}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(a){this.levelController.nextLoadLevel=a}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(a){x.logger.log("set firstLevel:"+a),this.levelController.firstLevel=a}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(a){x.logger.log("set startLevel:"+a),a!==-1&&(a=Math.max(a,this.minAutoLevel)),this.levelController.startLevel=a}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(a){var r=!!a;r!==this.config.capLevelToPlayerSize&&(r?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=r)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(a){this._autoLevelCapping!==a&&(x.logger.log("set autoLevelCapping:"+a),this._autoLevelCapping=a)}},{key:"bandwidthEstimate",get:function(){var a=this.abrController.bwEstimator;return a?a.getEstimate():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(a){s.HdcpLevels.indexOf(a)>-1&&(this._maxHdcpLevel=a)}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var a=this.levels,r=this.config.minAutoBitrate;if(!a)return 0;for(var t=a.length,c=0;c<t;c++)if(a[c].maxBitrate>=r)return c;return 0}},{key:"maxAutoLevel",get:function(){var a=this.levels,r=this.autoLevelCapping,t=this.maxHdcpLevel,c;if(r===-1&&a&&a.length?c=a.length-1:c=r,t)for(var b=c;b--;){var h=a[b].attrs["HDCP-LEVEL"];if(h&&h<=t)return b}return c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(a){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,a)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var a=this.audioTrackController;return a?a.audioTracks:[]}},{key:"audioTrack",get:function(){var a=this.audioTrackController;return a?a.audioTrack:-1},set:function(a){var r=this.audioTrackController;r&&(r.audioTrack=a)}},{key:"subtitleTracks",get:function(){var a=this.subtitleTrackController;return a?a.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var a=this.subtitleTrackController;return a?a.subtitleTrack:-1},set:function(a){var r=this.subtitleTrackController;r&&(r.subtitleTrack=a)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var a=this.subtitleTrackController;return a?a.subtitleDisplay:!1},set:function(a){var r=this.subtitleTrackController;r&&(r.subtitleDisplay=a)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(a){this.config.lowLatencyMode=a}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.3.5"}},{key:"Events",get:function(){return d.Events}},{key:"ErrorTypes",get:function(){return A.ErrorTypes}},{key:"ErrorDetails",get:function(){return A.ErrorDetails}},{key:"DefaultConfig",get:function(){return _.defaultConfig?_.defaultConfig:E.hlsDefaultConfig},set:function(a){_.defaultConfig=a}}]),_}();y.defaultConfig=void 0},"./src/is-supported.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{changeTypeSupported:()=>L,isSupported:()=>k});var W=O("./src/utils/mediasource-helper.ts");function e(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var I=(0,W.getMediaSource)();if(!I)return!1;var u=e(),m=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!u||u.prototype&&typeof u.prototype.appendBuffer=="function"&&typeof u.prototype.remove=="function";return!!m&&!!i}function L(){var I,u=e();return typeof(u==null||((I=u.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/date-range.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{DateRange:()=>w,DateRangeAttribute:()=>g});var W=O("./src/polyfills/number.ts"),e=O("./src/utils/attr-list.ts"),k=O("./src/utils/logger.ts");function L(){return L=Object.assign?Object.assign.bind():function(x){for(var E=1;E<arguments.length;E++){var o=arguments[E];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(x[f]=o[f])}return x},L.apply(this,arguments)}function I(x,E){for(var o=0;o<E.length;o++){var f=E[o];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(x,m(f.key),f)}}function u(x,E,o){return E&&I(x.prototype,E),o&&I(x,o),Object.defineProperty(x,"prototype",{writable:!1}),x}function m(x){var E=i(x,"string");return typeof E=="symbol"?E:String(E)}function i(x,E){if(typeof x!="object"||x===null)return x;var o=x[Symbol.toPrimitive];if(o!==void 0){var f=o.call(x,E||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(x)}var g;(function(x){x.ID="ID",x.CLASS="CLASS",x.START_DATE="START-DATE",x.DURATION="DURATION",x.END_DATE="END-DATE",x.END_ON_NEXT="END-ON-NEXT",x.PLANNED_DURATION="PLANNED-DURATION",x.SCTE35_OUT="SCTE35-OUT",x.SCTE35_IN="SCTE35-IN"})(g||(g={}));var w=function(){function x(E,o){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,o){var f=o.attr;for(var d in f)if(Object.prototype.hasOwnProperty.call(E,d)&&E[d]!==f[d]){k.logger.warn('DATERANGE tag attribute: "'+d+'" does not match for tags with ID: "'+E.ID+'"'),this._badValueForSameId=d;break}E=L(new e.AttrList({}),f,E)}if(this.attr=E,this._startDate=new Date(E[g.START_DATE]),g.END_DATE in this.attr){var A=new Date(this.attr[g.END_DATE]);(0,W.isFiniteNumber)(A.getTime())&&(this._endDate=A)}}return u(x,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var o=this.duration;return o!==null?new Date(this._startDate.getTime()+o*1e3):null}},{key:"duration",get:function(){if(g.DURATION in this.attr){var o=this.attr.decimalFloatingPoint(g.DURATION);if((0,W.isFiniteNumber)(o))return o}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return g.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(g.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(g.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&(0,W.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),x}()},"./src/loader/fragment-loader.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{LoadError:()=>o,default:()=>x});var W=O("./src/polyfills/number.ts"),e=O("./src/errors.ts");function k(f,d){f.prototype=Object.create(d.prototype),f.prototype.constructor=f,i(f,d)}function L(f){var d=typeof Map=="function"?new Map:void 0;return L=function(s){if(s===null||!m(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(s))return d.get(s);d.set(s,p)}function p(){return I(s,arguments,g(this).constructor)}return p.prototype=Object.create(s.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),i(p,s)},L(f)}function I(f,d,A){return u()?I=Reflect.construct.bind():I=function(p,C,l){var T=[null];T.push.apply(T,C);var y=Function.bind.apply(p,T),_=new y;return l&&i(_,l.prototype),_},I.apply(null,arguments)}function u(){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(f){return!1}}function m(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function i(f,d){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,p){return s.__proto__=p,s},i(f,d)}function g(f){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},g(f)}var w=Math.pow(2,17),x=function(){function f(A){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=A}var d=f.prototype;return d.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},d.abort=function(){this.loader&&this.loader.abort()},d.load=function(s,p){var C=this,l=s.url;if(!l)return Promise.reject(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(l?"part list":"url")));this.abort();var T=this.config,y=T.fLoader,_=T.loader;return new Promise(function(v,n){C.loader&&C.loader.destroy();var a=C.loader=s.loader=y?new y(T):new _(T),r=E(s),t={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:s.sn==="initSegment"?Infinity:w};s.stats=a.stats,a.load(r,t,{onSuccess:function(b,h,D,P){C.resetLoader(s,a);var j=b.data;D.resetIV&&s.decryptdata&&(s.decryptdata.iv=new Uint8Array(j.slice(0,16)),j=j.slice(16)),v({frag:s,part:null,payload:j,networkDetails:P})},onError:function(b,h,D){C.resetLoader(s,a),n(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:b,networkDetails:D}))},onAbort:function(b,h,D){C.resetLoader(s,a),n(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:D}))},onTimeout:function(b,h,D){C.resetLoader(s,a),n(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:D}))},onProgress:function(b,h,D,P){p&&p({frag:s,part:null,payload:D,networkDetails:P})}})})},d.loadPart=function(s,p,C){var l=this;this.abort();var T=this.config,y=T.fLoader,_=T.loader;return new Promise(function(v,n){l.loader&&l.loader.destroy();var a=l.loader=s.loader=y?new y(T):new _(T),r=E(s,p),t={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:w};p.stats=a.stats,a.load(r,t,{onSuccess:function(b,h,D,P){l.resetLoader(s,a),l.updateStatsFromPart(s,p);var j={frag:s,part:p,payload:b.data,networkDetails:P};C(j),v(j)},onError:function(b,h,D){l.resetLoader(s,a),n(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:p,response:b,networkDetails:D}))},onAbort:function(b,h,D){s.stats.aborted=p.stats.aborted,l.resetLoader(s,a),n(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:p,networkDetails:D}))},onTimeout:function(b,h,D){l.resetLoader(s,a),n(new o({type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:p,networkDetails:D}))}})})},d.updateStatsFromPart=function(s,p){var C=s.stats,l=p.stats,T=l.total;if(C.loaded+=l.loaded,T){var y=Math.round(s.duration/p.duration),_=Math.min(Math.round(C.loaded/T),y),v=y-_,n=v*Math.round(C.loaded/_);C.total=C.loaded+n}else C.total=Math.max(C.loaded,C.total);var a=C.loading,r=l.loading;a.start?a.first+=r.first-r.start:(a.start=r.start,a.first=r.first),a.end=r.end},d.resetLoader=function(s,p){s.loader=null,this.loader===p&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),p.destroy()},f}();function E(f,d){d===void 0&&(d=null);var A=d||f,s={frag:f,part:d,responseType:"arraybuffer",url:A.url,headers:{},rangeStart:0,rangeEnd:0},p=A.byteRangeStartOffset,C=A.byteRangeEndOffset;if((0,W.isFiniteNumber)(p)&&(0,W.isFiniteNumber)(C)){var l,T=p,y=C;if(f.sn==="initSegment"&&((l=f.decryptdata)===null||l===void 0?void 0:l.method)==="AES-128"){var _=C-p;_%16&&(y=C+(16-_%16)),p!==0&&(s.resetIV=!0,T=p-16)}s.rangeStart=T,s.rangeEnd=y}return s}var o=function(f){k(d,f);function d(A){for(var s,p=arguments.length,C=new Array(p>1?p-1:0),l=1;l<p;l++)C[l-1]=arguments[l];return s=f.call.apply(f,[this].concat(C))||this,s.data=void 0,s.data=A,s}return d}(L(Error))},"./src/loader/fragment.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{BaseSegment:()=>E,ElementaryStreamTypes:()=>x,Fragment:()=>o,Part:()=>f});var W=O("./src/polyfills/number.ts"),e=O("./node_modules/url-toolkit/src/url-toolkit.js"),k=O.n(e),L=O("./src/loader/load-stats.ts");function I(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,u(d,A)}function u(d,A){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,C){return p.__proto__=C,p},u(d,A)}function m(d,A){for(var s=0;s<A.length;s++){var p=A[s];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(d,g(p.key),p)}}function i(d,A,s){return A&&m(d.prototype,A),s&&m(d,s),Object.defineProperty(d,"prototype",{writable:!1}),d}function g(d){var A=w(d,"string");return typeof A=="symbol"?A:String(A)}function w(d,A){if(typeof d!="object"||d===null)return d;var s=d[Symbol.toPrimitive];if(s!==void 0){var p=s.call(d,A||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(d)}var x;(function(d){d.AUDIO="audio",d.VIDEO="video",d.AUDIOVIDEO="audiovideo"})(x||(x={}));var E=function(){function d(s){var p;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(p={},p[x.AUDIO]=null,p[x.VIDEO]=null,p[x.AUDIOVIDEO]=null,p),this.baseurl=s}var A=d.prototype;return A.setByteRange=function(p,C){var l=p.split("@",2),T=[];l.length===1?T[0]=C?C.byteRangeEndOffset:0:T[0]=parseInt(l[1]),T[1]=parseInt(l[0])+T[0],this._byteRange=T},i(d,[{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=(0,e.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(p){this._url=p}}]),d}(),o=function(d){I(A,d);function A(p,C){var l;return l=d.call(this,C)||this,l._decryptdata=null,l.rawProgramDateTime=null,l.programDateTime=null,l.tagList=[],l.duration=0,l.sn=0,l.levelkeys=void 0,l.type=void 0,l.loader=null,l.keyLoader=null,l.level=-1,l.cc=0,l.startPTS=void 0,l.endPTS=void 0,l.appendedPTS=void 0,l.startDTS=void 0,l.endDTS=void 0,l.start=0,l.deltaPTS=void 0,l.maxStartPTS=void 0,l.minEndPTS=void 0,l.stats=new L.LoadStats,l.urlId=0,l.data=void 0,l.bitrateTest=!1,l.title=null,l.initSegment=null,l.endList=void 0,l.type=p,l}var s=A.prototype;return s.setKeyFormat=function(C){if(this.levelkeys){var l=this.levelkeys[C];l&&!this._decryptdata&&(this._decryptdata=l.getDecryptData(this.sn))}},s.abortRequests=function(){var C,l;(C=this.loader)===null||C===void 0||C.abort(),(l=this.keyLoader)===null||l===void 0||l.abort()},s.setElementaryStreamInfo=function(C,l,T,y,_,v){v===void 0&&(v=!1);var n=this.elementaryStreams,a=n[C];if(!a){n[C]={startPTS:l,endPTS:T,startDTS:y,endDTS:_,partial:v};return}a.startPTS=Math.min(a.startPTS,l),a.endPTS=Math.max(a.endPTS,T),a.startDTS=Math.min(a.startDTS,y),a.endDTS=Math.max(a.endDTS,_)},s.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[x.AUDIO]=null,C[x.VIDEO]=null,C[x.AUDIOVIDEO]=null},i(A,[{key:"decryptdata",get:function(){var C=this.levelkeys;if(!C&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var l=this.levelkeys.identity;if(l)this._decryptdata=l.getDecryptData(this.sn);else{var T=Object.keys(this.levelkeys);if(T.length===1)return this._decryptdata=this.levelkeys[T[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!(0,W.isFiniteNumber)(this.programDateTime))return null;var C=(0,W.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;if((C=this._decryptdata)!==null&&C!==void 0&&C.encrypted)return!0;if(this.levelkeys){var l=Object.keys(this.levelkeys),T=l.length;if(T>1||T===1&&this.levelkeys[l[0]].encrypted)return!0}return!1}}]),A}(E),f=function(d){I(A,d);function A(s,p,C,l,T){var y;y=d.call(this,C)||this,y.fragOffset=0,y.duration=0,y.gap=!1,y.independent=!1,y.relurl=void 0,y.fragment=void 0,y.index=void 0,y.stats=new L.LoadStats,y.duration=s.decimalFloatingPoint("DURATION"),y.gap=s.bool("GAP"),y.independent=s.bool("INDEPENDENT"),y.relurl=s.enumeratedString("URI"),y.fragment=p,y.index=l;var _=s.enumeratedString("BYTERANGE");return _&&y.setByteRange(_,T),T&&(y.fragOffset=T.fragOffset+T.duration),y}return i(A,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var p=this.elementaryStreams;return!!(p.audio||p.video||p.audiovideo)}}]),A}(E)},"./src/loader/key-loader.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>k});var W=O("./src/errors.ts"),e=O("./src/loader/fragment-loader.ts"),k=function(){function L(u){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=u}var I=L.prototype;return I.abort=function(){for(var m in this.keyUriToKeyInfo){var i=this.keyUriToKeyInfo[m].loader;i&&i.abort()}},I.detach=function(){for(var m in this.keyUriToKeyInfo){var i=this.keyUriToKeyInfo[m];(i.mediaKeySessionContext||i.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[m]}},I.destroy=function(){this.detach();for(var m in this.keyUriToKeyInfo){var i=this.keyUriToKeyInfo[m].loader;i&&i.destroy()}this.keyUriToKeyInfo={}},I.createKeyLoadError=function(m,i,g,w){return i===void 0&&(i=W.ErrorDetails.KEY_LOAD_ERROR),new e.LoadError({type:W.ErrorTypes.NETWORK_ERROR,details:i,fatal:!1,frag:m,networkDetails:g})},I.loadClear=function(m,i){var g=this;if(this.emeController&&this.config.emeEnabled)for(var w=m.sn,x=m.cc,E=function(A){var s=i[A];if(x<=s.cc&&(w==="initSegment"||w<s.sn))return g.emeController.selectKeySystemFormat(s).then(function(p){s.setKeyFormat(p)}),"break"},o=0;o<i.length;o++){var f=E(o);if(f==="break")break}},I.load=function(m){var i=this;return!m.decryptdata&&m.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(m).then(function(g){return i.loadInternal(m,g)}):this.loadInternal(m)},I.loadInternal=function(m,i){var g,w;i&&m.setKeyFormat(i);var x=m.decryptdata;if(!x){var E=i?"Expected frag.decryptdata to be defined after setting format "+i:"Missing decryption data on fragment in onKeyLoading";return Promise.reject(this.createKeyLoadError(m,W.ErrorDetails.KEY_LOAD_ERROR,null,E))}var o=x.uri;if(!o)return Promise.reject(this.createKeyLoadError(m,W.ErrorDetails.KEY_LOAD_ERROR,null,'Invalid key URI: "'+o+'"'));var f=this.keyUriToKeyInfo[o];if((g=f)!==null&&g!==void 0&&g.decryptdata.key)return x.key=f.decryptdata.key,Promise.resolve({frag:m,keyInfo:f});if((w=f)!==null&&w!==void 0&&w.keyLoadPromise){var d;switch((d=f.mediaKeySessionContext)===null||d===void 0?void 0:d.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return f.keyLoadPromise.then(function(A){return x.key=A.keyInfo.decryptdata.key,{frag:m,keyInfo:f}})}}f=this.keyUriToKeyInfo[o]={decryptdata:x,keyLoadPromise:null,loader:null,mediaKeySessionContext:null};switch(x.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return x.keyFormat==="identity"?this.loadKeyHTTP(f,m):this.loadKeyEME(f,m);case"AES-128":return this.loadKeyHTTP(f,m);default:return Promise.reject(this.createKeyLoadError(m,W.ErrorDetails.KEY_LOAD_ERROR,null,'Key supplied with unsupported METHOD: "'+x.method+'"'))}},I.loadKeyEME=function(m,i){var g={frag:i,keyInfo:m};if(this.emeController&&this.config.emeEnabled){var w=this.emeController.loadKey(g);if(w)return(m.keyLoadPromise=w.then(function(x){return m.mediaKeySessionContext=x,g})).catch(function(x){throw m.keyLoadPromise=null,x})}return Promise.resolve(g)},I.loadKeyHTTP=function(m,i){var g=this,w=this.config,x=w.loader,E=new x(w);return i.keyLoader=m.loader=E,m.keyLoadPromise=new Promise(function(o,f){var d={keyInfo:m,frag:i,responseType:"arraybuffer",url:m.decryptdata.uri},A={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:w.fragLoadingRetryDelay,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:0},s={onSuccess:function(C,l,T,y){var _=T.frag,v=T.keyInfo,n=T.url;if(!_.decryptdata||v!==g.keyUriToKeyInfo[n])return f(g.createKeyLoadError(_,W.ErrorDetails.KEY_LOAD_ERROR,y,"after key load, decryptdata unset or changed"));v.decryptdata.key=_.decryptdata.key=new Uint8Array(C.data),_.keyLoader=null,v.loader=null,o({frag:_,keyInfo:v})},onError:function(C,l,T){g.resetLoader(l),f(g.createKeyLoadError(i,W.ErrorDetails.KEY_LOAD_ERROR,T))},onTimeout:function(C,l,T){g.resetLoader(l),f(g.createKeyLoadError(i,W.ErrorDetails.KEY_LOAD_TIMEOUT,T))},onAbort:function(C,l,T){g.resetLoader(l),f(g.createKeyLoadError(i,W.ErrorDetails.INTERNAL_ABORTED,T))}};E.load(d,A,s)})},I.resetLoader=function(m){var i=m.frag,g=m.keyInfo,w=m.url,x=g.loader;i.keyLoader===x&&(i.keyLoader=null,g.loader=null),delete this.keyUriToKeyInfo[w],x&&x.destroy()},L}()},"./src/loader/level-details.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{LevelDetails:()=>m});var W=O("./src/polyfills/number.ts");function e(i,g){for(var w=0;w<g.length;w++){var x=g[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(i,L(x.key),x)}}function k(i,g,w){return g&&e(i.prototype,g),w&&e(i,w),Object.defineProperty(i,"prototype",{writable:!1}),i}function L(i){var g=I(i,"string");return typeof g=="symbol"?g:String(g)}function I(i,g){if(typeof i!="object"||i===null)return i;var w=i[Symbol.toPrimitive];if(w!==void 0){var x=w.call(i,g||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(i)}var u=10,m=function(){function i(w){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.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,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.encryptedFragments=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=w}var g=i.prototype;return g.reloaded=function(x){if(!x){this.advanced=!0,this.updated=!0;return}var E=this.lastPartSn-x.lastPartSn,o=this.lastPartIndex-x.lastPartIndex;this.updated=this.endSN!==x.endSN||!!o||!!E,this.advanced=this.endSN>x.endSN||E>0||E===0&&o>0,this.updated||this.advanced?this.misses=Math.floor(x.misses*.6):this.misses=x.misses+1,this.availabilityDelay=x.availabilityDelay},k(i,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?(0,W.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||u}},{key:"drift",get:function(){var x=this.driftEndTime-this.driftStartTime;if(x>0){var E=this.driftEnd-this.driftStart;return E*1e3/x}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var x;return(x=this.partList)!==null&&x!==void 0&&x.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var x;return(x=this.fragments)!==null&&x!==void 0&&x.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 x;return(x=this.partList)!==null&&x!==void 0&&x.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var x;return(x=this.partList)!==null&&x!==void 0&&x.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{LevelKey:()=>m});var W=O("./src/utils/keysystem-util.ts"),e=O("./src/utils/mediakeys-helper.ts"),k=O("./src/utils/mp4-tools.ts"),L=O("./src/utils/logger.ts"),I=O("./src/utils/numeric-encoding-utils.ts"),u={},m=function(){g.clearKeyUriToKeyIdMap=function(){u={}};function g(x,E,o,f,d){f===void 0&&(f=[1]),d===void 0&&(d=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=x,this.uri=E,this.keyFormat=o,this.keyFormatVersions=f,this.iv=d,this.encrypted=x?x!=="NONE":!1,this.isCommonEncryption=this.encrypted&&x!=="AES-128"}var w=g.prototype;return w.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;switch(this.keyFormat){case"identity":return this.method==="SAMPLE-AES";case e.KeySystemFormats.FAIRPLAY:case e.KeySystemFormats.WIDEVINE:case e.KeySystemFormats.PLAYREADY:case e.KeySystemFormats.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},w.getDecryptData=function(E){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof E!="number"&&(this.method==="AES-128"&&!this.iv&&L.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),E=0);var o=i(E),f=new g(this.method,this.uri,"identity",this.keyFormatVersions,o);return f}var d=(0,W.convertDataUriToArrayBytes)(this.uri);if(d)switch(this.keyFormat){case e.KeySystemFormats.WIDEVINE:this.pssh=d,d.length>=22&&(this.keyId=d.subarray(d.length-22,d.length-6));break;case e.KeySystemFormats.PLAYREADY:{var A=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,k.mp4pssh)(A,null,d);var s=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/2),p=String.fromCharCode.apply(null,Array.from(s)),C=p.substring(p.indexOf("<"),p.length),l=new DOMParser,T=l.parseFromString(C,"text/xml"),y=T.getElementsByTagName("KID")[0];if(y){var _=y.childNodes[0]?y.childNodes[0].nodeValue:y.getAttribute("VALUE");if(_){var v=(0,I.base64Decode)(_).subarray(0,16);(0,W.changeEndianness)(v),this.keyId=v}}break}default:{var n=d.subarray(0,16);if(n.length!==16){var a=new Uint8Array(16);a.set(n,16-n.length),n=a}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){var r=u[this.uri];if(!r){var t=Object.keys(u).length%Number.MAX_SAFE_INTEGER;r=new Uint8Array(16);var c=new DataView(r.buffer,12,4);c.setUint32(0,t),u[this.uri]=r}this.keyId=r}return this},g}();function i(g){for(var w=new Uint8Array(16),x=12;x<16;x++)w[x]=g>>8*(15-x)&255;return w}},"./src/loader/load-stats.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{LoadStats:()=>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":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>A});var W=O("./src/polyfills/number.ts"),e=O("./node_modules/url-toolkit/src/url-toolkit.js"),k=O.n(e),L=O("./src/loader/date-range.ts"),I=O("./src/loader/fragment.ts"),u=O("./src/loader/level-details.ts"),m=O("./src/loader/level-key.ts"),i=O("./src/utils/attr-list.ts"),g=O("./src/utils/logger.ts"),w=O("./src/utils/codecs.ts");function x(){return x=Object.assign?Object.assign.bind():function(v){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(v[r]=a[r])}return v},x.apply(this,arguments)}var E=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+|#EXT-X-SESSION-KEY:([^\n\r]*)[\r\n]+/g,o=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),A=function(){function v(){}return v.findGroup=function(a,r){for(var t=0;t<a.length;t++){var c=a[t];if(c.id===r)return c}},v.convertAVC1ToAVCOTI=function(a){var r=a.split(".");if(r.length>2){var t=r.shift()+".";return t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).slice(-4),t}return a},v.resolve=function(a,r){return(0,e.buildAbsoluteURL)(r,a,{alwaysNormalize:!0})},v.parseMasterPlaylist=function(a,r){var t=[],c=[],b={},h=[],D=!1;E.lastIndex=0;for(var P;(P=E.exec(a))!=null;)if(P[1]){var j,N=new i.AttrList(P[1]),H={attrs:N,bitrate:N.decimalInteger("AVERAGE-BANDWIDTH")||N.decimalInteger("BANDWIDTH"),name:N.NAME,url:v.resolve(P[2],r)},z=N.decimalResolution("RESOLUTION");z&&(H.width=z.width,H.height=z.height),p((N.CODECS||"").split(/[ ,]+/).filter(function(Z){return Z}),H),H.videoCodec&&H.videoCodec.indexOf("avc1")!==-1&&(H.videoCodec=v.convertAVC1ToAVCOTI(H.videoCodec)),(j=H.unknownCodecs)!==null&&j!==void 0&&j.length||c.push(H),t.push(H)}else if(P[3]){var J=new i.AttrList(P[3]);J["DATA-ID"]&&(D=!0,b[J["DATA-ID"]]=J)}else if(P[4]){var Y=P[4],le=s(Y,r);le.encrypted&&le.isSupported()?h.push(le):g.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+Y+'"')}var te=c.length>0&&c.length<t.length;return{levels:te?c:t,sessionData:D?b:null,sessionKeys:h.length?h:null}},v.parseMasterPlaylistMedia=function(a,r,t,c){c===void 0&&(c=[]);var b,h=[],D=0;for(o.lastIndex=0;(b=o.exec(a))!==null;){var P=new i.AttrList(b[1]);if(P.TYPE===t){var j={attrs:P,bitrate:0,id:D++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:t,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?v.resolve(P.URI,r):""};if(c.length){var N=v.findGroup(c,j.groupId)||c[0];C(j,N,"audioCodec"),C(j,N,"textCodec")}h.push(j)}}return h},v.parseLevelPlaylist=function(a,r,t,c,b){var h=new u.LevelDetails(r),D=h.fragments,P=null,j=0,N=0,H=0,z=0,J=null,Y=new I.Fragment(c,r),le,te,Z,_e=-1,we=!1;for(f.lastIndex=0,h.m3u8=a;(le=f.exec(a))!==null;){we&&(we=!1,Y=new I.Fragment(c,r),Y.start=H,Y.sn=j,Y.cc=z,Y.level=t,P&&(Y.initSegment=P,Y.rawProgramDateTime=P.rawProgramDateTime,P.rawProgramDateTime=null));var De=le[1];if(De){Y.duration=parseFloat(De);var Ee=(" "+le[2]).slice(1);Y.title=Ee||null,Y.tagList.push(Ee?["INF",De,Ee]:["INF",De])}else if(le[3])(0,W.isFiniteNumber)(Y.duration)&&(Y.start=H,Z&&_(Y,Z,h),Y.sn=j,Y.level=t,Y.cc=z,Y.urlId=b,D.push(Y),Y.relurl=(" "+le[3]).slice(1),T(Y,J),J=Y,H+=Y.duration,j++,N=0,we=!0);else if(le[4]){var xe=(" "+le[4]).slice(1);J?Y.setByteRange(xe,J):Y.setByteRange(xe)}else if(le[5])Y.rawProgramDateTime=(" "+le[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),_e===-1&&(_e=D.length);else{if(le=le[0].match(d),!le){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(te=1;te<le.length&&!(typeof le[te]!="undefined");te++);var ve=(" "+le[te]).slice(1),X=(" "+le[te+1]).slice(1),Ae=le[te+2]?(" "+le[te+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":h.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":j=h.startSN=parseInt(X);break;case"SKIP":{var Q=new i.AttrList(X),ue=Q.decimalInteger("SKIPPED-SEGMENTS");if((0,W.isFiniteNumber)(ue)){h.skippedSegments=ue;for(var ee=ue;ee--;)D.unshift(null);j+=ue}var ae=Q.enumeratedString("RECENTLY-REMOVED-DATERANGES");ae&&(h.recentlyRemovedDateranges=ae.split(" "));break}case"TARGETDURATION":h.targetduration=parseFloat(X);break;case"VERSION":h.version=parseInt(X);break;case"EXTM3U":break;case"ENDLIST":h.live=!1;break;case"#":(X||Ae)&&Y.tagList.push(Ae?[X,Ae]:[X]);break;case"DISCONTINUITY":z++,Y.tagList.push(["DIS"]);break;case"GAP":Y.tagList.push([ve]);break;case"BITRATE":Y.tagList.push([ve,X]);break;case"DATERANGE":{var fe=new i.AttrList(X),Re=new L.DateRange(fe,h.dateRanges[fe.ID]);Re.isValid||h.skippedSegments?h.dateRanges[Re.id]=Re:g.logger.warn('Ignoring invalid DATERANGE tag: "'+X+'"'),Y.tagList.push(["EXT-X-DATERANGE",X]);break}case"DISCONTINUITY-SEQUENCE":z=parseInt(X);break;case"KEY":{var pe=s(X,r);if(pe.isSupported()){if(pe.method==="NONE"){Z=void 0;break}Z||(Z={}),Z[pe.keyFormat]&&(Z=x({},Z)),Z[pe.keyFormat]=pe}else g.logger.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+X+'"');break}case"START":{var ie=new i.AttrList(X),Ie=ie.decimalFloatingPoint("TIME-OFFSET");(0,W.isFiniteNumber)(Ie)&&(h.startTimeOffset=Ie);break}case"MAP":{var Oe=new i.AttrList(X);if(Y.duration){var Ne=new I.Fragment(c,r);y(Ne,Oe,t,Z),P=Ne,Y.initSegment=P,P.rawProgramDateTime&&!Y.rawProgramDateTime&&(Y.rawProgramDateTime=P.rawProgramDateTime)}else y(Y,Oe,t,Z),P=Y,we=!0;break}case"SERVER-CONTROL":{var Le=new i.AttrList(X);h.canBlockReload=Le.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=Le.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&Le.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=Le.optionalFloat("PART-HOLD-BACK",0),h.holdBack=Le.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ce=new i.AttrList(X);h.partTarget=Ce.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ue=h.partList;Ue||(Ue=h.partList=[]);var Te=N>0?Ue[Ue.length-1]:void 0,Pe=N++,q=new I.Part(new i.AttrList(X),Y,r,Pe,Te);Ue.push(q),Y.duration+=q.duration;break}case"PRELOAD-HINT":{var se=new i.AttrList(X);h.preloadHint=se;break}case"RENDITION-REPORT":{var he=new i.AttrList(X);h.renditionReports=h.renditionReports||[],h.renditionReports.push(he);break}default:g.logger.warn("line parsed but not handled: "+le);break}}}J&&!J.relurl?(D.pop(),H-=J.duration,h.partList&&(h.fragmentHint=J)):h.partList&&(T(Y,J),Y.cc=z,h.fragmentHint=Y,Z&&_(Y,Z,h));var V=D.length,$=D[0],re=D[V-1];if(H+=h.skippedSegments*h.targetduration,H>0&&V&&re){h.averagetargetduration=H/V;var oe=re.sn;h.endSN=oe!=="initSegment"?oe:0,h.live||(re.endList=!0),$&&(h.startCC=$.cc)}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(H+=h.fragmentHint.duration),h.totalduration=H,h.endCC=z,_e>0&&l(D,_e),h},v}();function s(v,n){var a,r,t=new i.AttrList(v),c=(a=t.enumeratedString("METHOD"))!=null?a:"",b=t.URI,h=t.hexadecimalInteger("IV"),D=t.enumeratedString("KEYFORMATVERSIONS"),P=(r=t.enumeratedString("KEYFORMAT"))!=null?r:"identity";b&&t.IV&&!h&&g.logger.error("Invalid IV: "+t.IV);var j=b?A.resolve(b,n):"",N=(D||"1").split("/").map(Number).filter(Number.isFinite);return new m.LevelKey(c,j,P,N,h)}function p(v,n){["video","audio","text"].forEach(function(a){var r=v.filter(function(c){return(0,w.isCodecType)(c,a)});if(r.length){var t=r.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});n[a+"Codec"]=t.length>0?t[0]:r[0],v=v.filter(function(c){return r.indexOf(c)===-1})}}),n.unknownCodecs=v}function C(v,n,a){var r=n[a];r&&(v[a]=r)}function l(v,n){for(var a=v[n],r=n;r--;){var t=v[r];if(!t)return;t.programDateTime=a.programDateTime-t.duration*1e3,a=t}}function T(v,n){v.rawProgramDateTime?v.programDateTime=Date.parse(v.rawProgramDateTime):n!=null&&n.programDateTime&&(v.programDateTime=n.endProgramDateTime),(0,W.isFiniteNumber)(v.programDateTime)||(v.programDateTime=null,v.rawProgramDateTime=null)}function y(v,n,a,r){v.relurl=n.URI,n.BYTERANGE&&v.setByteRange(n.BYTERANGE),v.level=a,v.sn="initSegment",r&&(v.levelkeys=r),v.initSegment=null}function _(v,n,a){v.levelkeys=n;var r=a.encryptedFragments;(!r.length||r[r.length-1].levelkeys!==n)&&Object.keys(n).some(function(t){return n[t].isCommonEncryption})&&r.push(v)}},"./src/loader/playlist-loader.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>x});var W=O("./src/polyfills/number.ts"),e=O("./src/events.ts"),k=O("./src/errors.ts"),L=O("./src/utils/logger.ts"),I=O("./src/loader/m3u8-parser.ts"),u=O("./src/types/loader.ts"),m=O("./src/utils/attr-list.ts");function i(E){var o=E.type;switch(o){case u.PlaylistContextType.AUDIO_TRACK:return u.PlaylistLevelType.AUDIO;case u.PlaylistContextType.SUBTITLE_TRACK:return u.PlaylistLevelType.SUBTITLE;default:return u.PlaylistLevelType.MAIN}}function g(E,o){var f=E.url;return(f===void 0||f.indexOf("data:")===0)&&(f=o.url),f}var w=function(){function E(f){this.hls=void 0,this.loaders=Object.create(null),this.hls=f,this.registerListeners()}var o=E.prototype;return o.startLoad=function(d){},o.stopLoad=function(){this.destroyInternalLoaders()},o.registerListeners=function(){var d=this.hls;d.on(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(e.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(e.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.on(e.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.unregisterListeners=function(){var d=this.hls;d.off(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(e.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(e.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.off(e.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.createInternalLoader=function(d){var A=this.hls.config,s=A.pLoader,p=A.loader,C=s||p,l=new C(A);return d.loader=l,this.loaders[d.type]=l,l},o.getInternalLoader=function(d){return this.loaders[d.type]},o.resetInternalLoader=function(d){this.loaders[d]&&delete this.loaders[d]},o.destroyInternalLoaders=function(){for(var d in this.loaders){var A=this.loaders[d];A&&A.destroy(),this.resetInternalLoader(d)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.onManifestLoading=function(d,A){var s=A.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:u.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},o.onLevelLoading=function(d,A){var s=A.id,p=A.level,C=A.url,l=A.deliveryDirectives;this.load({id:s,groupId:null,level:p,responseType:"text",type:u.PlaylistContextType.LEVEL,url:C,deliveryDirectives:l})},o.onAudioTrackLoading=function(d,A){var s=A.id,p=A.groupId,C=A.url,l=A.deliveryDirectives;this.load({id:s,groupId:p,level:null,responseType:"text",type:u.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:l})},o.onSubtitleTrackLoading=function(d,A){var s=A.id,p=A.groupId,C=A.url,l=A.deliveryDirectives;this.load({id:s,groupId:p,level:null,responseType:"text",type:u.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:l})},o.load=function(d){var A,s=this.hls.config,p=this.getInternalLoader(d);if(p){var C=p.context;if(C&&C.url===d.url){L.logger.trace("[playlist-loader]: playlist request ongoing");return}L.logger.log("[playlist-loader]: aborting previous loader for type: "+d.type),p.abort()}var l,T,y,_;switch(d.type){case u.PlaylistContextType.MANIFEST:l=s.manifestLoadingMaxRetry,T=s.manifestLoadingTimeOut,y=s.manifestLoadingRetryDelay,_=s.manifestLoadingMaxRetryTimeout;break;case u.PlaylistContextType.LEVEL:case u.PlaylistContextType.AUDIO_TRACK:case u.PlaylistContextType.SUBTITLE_TRACK:l=0,T=s.levelLoadingTimeOut;break;default:l=s.levelLoadingMaxRetry,T=s.levelLoadingTimeOut,y=s.levelLoadingRetryDelay,_=s.levelLoadingMaxRetryTimeout;break}if(p=this.createInternalLoader(d),(A=d.deliveryDirectives)!==null&&A!==void 0&&A.part){var v;if(d.type===u.PlaylistContextType.LEVEL&&d.level!==null?v=this.hls.levels[d.level].details:d.type===u.PlaylistContextType.AUDIO_TRACK&&d.id!==null?v=this.hls.audioTracks[d.id].details:d.type===u.PlaylistContextType.SUBTITLE_TRACK&&d.id!==null&&(v=this.hls.subtitleTracks[d.id].details),v){var n=v.partTarget,a=v.targetduration;n&&a&&(T=Math.min(Math.max(n*3,a*.8)*1e3,T))}}var r={timeout:T,maxRetry:l,retryDelay:y,maxRetryDelay:_,highWaterMark:0},t={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};p.load(d,r,t)},o.loadsuccess=function(d,A,s,p){p===void 0&&(p=null),this.resetInternalLoader(s.type);var C=d.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(d,s,"no EXTM3U delimiter",p);return}A.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(d,A,s,p):this.handleMasterPlaylist(d,A,s,p)},o.loaderror=function(d,A,s){s===void 0&&(s=null),this.handleNetworkError(A,s,!1,d)},o.loadtimeout=function(d,A,s){s===void 0&&(s=null),this.handleNetworkError(A,s,!0)},o.handleMasterPlaylist=function(d,A,s,p){var C=this.hls,l=d.data,T=g(d,s),y=I.default.parseMasterPlaylist(l,T),_=y.levels,v=y.sessionData,n=y.sessionKeys;if(!_.length){this.handleManifestParsingError(d,s,"no level found in manifest",p);return}var a=_.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),r=_.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),t=I.default.parseMasterPlaylistMedia(l,T,"AUDIO",a),c=I.default.parseMasterPlaylistMedia(l,T,"SUBTITLES",r),b=I.default.parseMasterPlaylistMedia(l,T,"CLOSED-CAPTIONS");if(t.length){var h=t.some(function(D){return!D.url});!h&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(L.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),t.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}C.trigger(e.Events.MANIFEST_LOADED,{levels:_,audioTracks:t,subtitles:c,captions:b,url:T,stats:A,networkDetails:p,sessionData:v,sessionKeys:n})},o.handleTrackOrLevelPlaylist=function(d,A,s,p){var C=this.hls,l=s.id,T=s.level,y=s.type,_=g(d,s),v=(0,W.isFiniteNumber)(l)?l:0,n=(0,W.isFiniteNumber)(T)?T:v,a=i(s),r=I.default.parseLevelPlaylist(d.data,_,n,a,v);if(!r.fragments.length){C.trigger(e.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(y===u.PlaylistContextType.MANIFEST){var t={attrs:new m.AttrList({}),bitrate:0,details:r,name:"",url:_};C.trigger(e.Events.MANIFEST_LOADED,{levels:[t],audioTracks:[],url:_,stats:A,networkDetails:p,sessionData:null,sessionKeys:null})}A.parsing.end=performance.now(),s.levelDetails=r,this.handlePlaylistLoaded(d,A,s,p)},o.handleManifestParsingError=function(d,A,s,p){this.hls.trigger(e.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:A.type===u.PlaylistContextType.MANIFEST,url:d.url,reason:s,response:d,context:A,networkDetails:p})},o.handleNetworkError=function(d,A,s,p){s===void 0&&(s=!1),L.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+d.type+" level: "+d.level+" id: "+d.id+' group-id: "'+d.groupId+'"');var C=k.ErrorDetails.UNKNOWN,l=!1,T=this.getInternalLoader(d);switch(d.type){case u.PlaylistContextType.MANIFEST:C=s?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case u.PlaylistContextType.LEVEL:C=s?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case u.PlaylistContextType.AUDIO_TRACK:C=s?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case u.PlaylistContextType.SUBTITLE_TRACK:C=s?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1;break}T&&this.resetInternalLoader(d.type);var y={type:k.ErrorTypes.NETWORK_ERROR,details:C,fatal:l,url:d.url,loader:T,context:d,networkDetails:A};p&&(y.response=p),this.hls.trigger(e.Events.ERROR,y)},o.handlePlaylistLoaded=function(d,A,s,p){var C=s.type,l=s.level,T=s.id,y=s.groupId,_=s.loader,v=s.levelDetails,n=s.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(d,s,"invalid target duration",p);return}if(!_)return;v.live&&(_.getCacheAge&&(v.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(C){case u.PlaylistContextType.MANIFEST:case u.PlaylistContextType.LEVEL:this.hls.trigger(e.Events.LEVEL_LOADED,{details:v,level:l||0,id:T||0,stats:A,networkDetails:p,deliveryDirectives:n});break;case u.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(e.Events.AUDIO_TRACK_LOADED,{details:v,id:T||0,groupId:y||"",stats:A,networkDetails:p,deliveryDirectives:n});break;case u.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(e.Events.SUBTITLE_TRACK_LOADED,{details:v,id:T||0,groupId:y||"",stats:A,networkDetails:p,deliveryDirectives:n});break}},E}();const x=w},"./src/polyfills/number.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{MAX_SAFE_INTEGER:()=>e,isFiniteNumber:()=>W});var W=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},e=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>e});var W=function(){function k(){}return k.getSilentFrame=function(I,u){switch(I){case"mp4a.40.2":if(u===1)return new Uint8Array([0,200,0,128,35,128]);if(u===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(u===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(u===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(u===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(u===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(u===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(u===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(u===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},k}();const e=W},"./src/remux/mp4-generator.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>k});var W=Math.pow(2,32)-1,e=function(){function L(){}return L.init=function(){L.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 u;for(u in L.types)L.types.hasOwnProperty(u)&&(L.types[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);var m=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]),i=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]);L.HDLR_TYPES={video:m,audio:i};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=w,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var x=new Uint8Array([105,115,111,109]),E=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,x,o,x,E),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,g))},L.box=function(u){for(var m=8,i=arguments.length,g=new Array(i>1?i-1:0),w=1;w<i;w++)g[w-1]=arguments[w];for(var x=g.length,E=x;x--;)m+=g[x].byteLength;var o=new Uint8Array(m);for(o[0]=m>>24&255,o[1]=m>>16&255,o[2]=m>>8&255,o[3]=m&255,o.set(u,4),x=0,m=8;x<E;x++)o.set(g[x],m),m+=g[x].byteLength;return o},L.hdlr=function(u){return L.box(L.types.hdlr,L.HDLR_TYPES[u])},L.mdat=function(u){return L.box(L.types.mdat,u)},L.mdhd=function(u,m){m*=u;var i=Math.floor(m/(W+1)),g=Math.floor(m%(W+1));return L.box(L.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,u>>24&255,u>>16&255,u>>8&255,u&255,i>>24,i>>16&255,i>>8&255,i&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},L.mdia=function(u){return L.box(L.types.mdia,L.mdhd(u.timescale,u.duration),L.hdlr(u.type),L.minf(u))},L.mfhd=function(u){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255]))},L.minf=function(u){return u.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(u)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(u))},L.moof=function(u,m,i){return L.box(L.types.moof,L.mfhd(u),L.traf(i,m))},L.moov=function(u){for(var m=u.length,i=[];m--;)i[m]=L.trak(u[m]);return L.box.apply(null,[L.types.moov,L.mvhd(u[0].timescale,u[0].duration)].concat(i).concat(L.mvex(u)))},L.mvex=function(u){for(var m=u.length,i=[];m--;)i[m]=L.trex(u[m]);return L.box.apply(null,[L.types.mvex].concat(i))},L.mvhd=function(u,m){m*=u;var i=Math.floor(m/(W+1)),g=Math.floor(m%(W+1)),w=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,u>>24&255,u>>16&255,u>>8&255,u&255,i>>24,i>>16&255,i>>8&255,i&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 L.box(L.types.mvhd,w)},L.sdtp=function(u){var m=u.samples||[],i=new Uint8Array(4+m.length),g,w;for(g=0;g<m.length;g++)w=m[g].flags,i[g+4]=w.dependsOn<<4|w.isDependedOn<<2|w.hasRedundancy;return L.box(L.types.sdtp,i)},L.stbl=function(u){return L.box(L.types.stbl,L.stsd(u),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(u){var m=[],i=[],g,w,x;for(g=0;g<u.sps.length;g++)w=u.sps[g],x=w.byteLength,m.push(x>>>8&255),m.push(x&255),m=m.concat(Array.prototype.slice.call(w));for(g=0;g<u.pps.length;g++)w=u.pps[g],x=w.byteLength,i.push(x>>>8&255),i.push(x&255),i=i.concat(Array.prototype.slice.call(w));var E=L.box(L.types.avcC,new Uint8Array([1,m[3],m[4],m[5],252|3,224|u.sps.length].concat(m).concat([u.pps.length]).concat(i))),o=u.width,f=u.height,d=u.pixelRatio[0],A=u.pixelRatio[1];return L.box(L.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,o>>8&255,o&255,f>>8&255,f&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]),E,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,A>>24,A>>16&255,A>>8&255,A&255])))},L.esds=function(u){var m=u.config.length;return new Uint8Array([0,0,0,0,3,23+m,0,1,0,4,15+m,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([m]).concat(u.config).concat([6,1,2]))},L.mp4a=function(u){var m=u.samplerate;return L.box(L.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,u.channelCount,0,16,0,0,0,0,m>>8&255,m&255,0,0]),L.box(L.types.esds,L.esds(u)))},L.mp3=function(u){var m=u.samplerate;return L.box(L.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,u.channelCount,0,16,0,0,0,0,m>>8&255,m&255,0,0]))},L.stsd=function(u){return u.type==="audio"?u.segmentCodec==="mp3"&&u.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(u)):L.box(L.types.stsd,L.STSD,L.mp4a(u)):L.box(L.types.stsd,L.STSD,L.avc1(u))},L.tkhd=function(u){var m=u.id,i=u.duration*u.timescale,g=u.width,w=u.height,x=Math.floor(i/(W+1)),E=Math.floor(i%(W+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,m>>24&255,m>>16&255,m>>8&255,m&255,0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255,E>>24,E>>16&255,E>>8&255,E&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,w>>8&255,w&255,0,0]))},L.traf=function(u,m){var i=L.sdtp(u),g=u.id,w=Math.floor(m/(W+1)),x=Math.floor(m%(W+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,x>>24,x>>16&255,x>>8&255,x&255])),L.trun(u,i.length+16+20+8+16+8+8),i)},L.trak=function(u){return u.duration=u.duration||4294967295,L.box(L.types.trak,L.tkhd(u),L.mdia(u))},L.trex=function(u){var m=u.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},L.trun=function(u,m){var i=u.samples||[],g=i.length,w=12+16*g,x=new Uint8Array(w),E,o,f,d,A,s;for(m+=8+w,x.set([u.type==="video"?1:0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255],0),E=0;E<g;E++)o=i[E],f=o.duration,d=o.size,A=o.flags,s=o.cts,x.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,A.isLeading<<2|A.dependsOn,A.isDependedOn<<6|A.hasRedundancy<<4|A.paddingValue<<1|A.isNonSync,A.degradPrio&240<<8,A.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*E);return L.box(L.types.trun,x)},L.initSegment=function(u){L.types||L.init();var m=L.moov(u),i=new Uint8Array(L.FTYP.byteLength+m.byteLength);return i.set(L.FTYP),i.set(m,L.FTYP.byteLength),i},L}();e.types=void 0,e.HDLR_TYPES=void 0,e.STTS=void 0,e.STSC=void 0,e.STCO=void 0,e.STSZ=void 0,e.VMHD=void 0,e.SMHD=void 0,e.STSD=void 0,e.FTYP=void 0,e.DINF=void 0;const k=e},"./src/remux/mp4-remuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>d,flushTextTrackMetadataCueSamples:()=>p,flushTextTrackUserdataCueSamples:()=>C,normalizePts:()=>A});var W=O("./src/polyfills/number.ts"),e=O("./src/remux/aac-helper.ts"),k=O("./src/remux/mp4-generator.ts"),L=O("./src/events.ts"),I=O("./src/errors.ts"),u=O("./src/utils/logger.ts"),m=O("./src/types/loader.ts"),i=O("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign?Object.assign.bind():function(y){for(var _=1;_<arguments.length;_++){var v=arguments[_];for(var n in v)Object.prototype.hasOwnProperty.call(v,n)&&(y[n]=v[n])}return y},g.apply(this,arguments)}var w=10*1e3,x=1024,E=1152,o=null,f=null,d=function(){function y(v,n,a,r){if(r===void 0&&(r=""),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.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=v,this.config=n,this.typeSupported=a,this.ISGenerated=!1,o===null){var t=navigator.userAgent||"",c=t.match(/Chrome\/(\d+)/i);o=c?parseInt(c[1]):0}if(f===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);f=b?parseInt(b[1]):0}}var _=y.prototype;return _.destroy=function(){},_.resetTimeStamp=function(n){u.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=n},_.resetNextTimestamp=function(){u.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){u.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(n){var a=!1,r=n.reduce(function(t,c){var b=c.pts-t;return b<-4294967296?(a=!0,A(t,c.pts)):b>0?t:c.pts},n[0].pts);return a&&u.logger.debug("PTS rollover detected"),r},_.remux=function(n,a,r,t,c,b,h,D){var P,j,N,H,z,J,Y=c,le=c,te=n.pid>-1,Z=a.pid>-1,_e=a.samples.length,we=n.samples.length>0,De=h&&_e>0||_e>1,Ee=(!te||we)&&(!Z||De)||this.ISGenerated||h;if(Ee){this.ISGenerated||(N=this.generateIS(n,a,c));var xe=this.isVideoContiguous,ve=-1,X;if(De&&(ve=s(a.samples),!xe&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,ve>0){u.logger.warn("[mp4-remuxer]: Dropped "+ve+" out of "+_e+" video samples due to a missing keyframe");var Ae=this.getVideoStartPts(a.samples);a.samples=a.samples.slice(ve),a.dropped+=ve,le+=(a.samples[0].pts-Ae)/a.inputTimeScale,X=le}else ve===-1&&(u.logger.warn("[mp4-remuxer]: No keyframe found out of "+_e+" video samples"),J=!1);if(this.ISGenerated){if(we&&De){var Q=this.getVideoStartPts(a.samples),ue=A(n.samples[0].pts,Q)-Q,ee=ue/a.inputTimeScale;Y+=Math.max(0,ee),le+=Math.max(0,-ee)}if(we){if(n.samplerate||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(n,a,c)),j=this.remuxAudio(n,Y,this.isAudioContiguous,b,Z||De||D===m.PlaylistLevelType.AUDIO?le:void 0),De){var ae=j?j.endPTS-j.startPTS:0;a.inputTimeScale||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(n,a,c)),P=this.remuxVideo(a,le,xe,ae)}}else De&&(P=this.remuxVideo(a,le,xe,0));P&&(P.firstKeyFrame=ve,P.independent=ve!==-1,P.firstKeyFramePTS=X)}}return this.ISGenerated&&(r.samples.length&&(z=p(r,c,this._initPTS,this._initDTS)),t.samples.length&&(H=C(t,c,this._initPTS))),{audio:j,video:P,initSegment:N,independent:J,text:H,id3:z}},_.generateIS=function(n,a,r){var t=n.samples,c=a.samples,b=this.typeSupported,h={},D=!(0,W.isFiniteNumber)(this._initPTS),P="audio/mp4",j,N,H;if(D&&(j=N=Infinity),n.config&&t.length){n.timescale=n.samplerate;switch(n.segmentCodec){case"mp3":b.mpeg?(P="audio/mpeg",n.codec=""):b.mp3&&(n.codec="mp3");break}h.audio={id:"audio",container:P,codec:n.codec,initSegment:n.segmentCodec==="mp3"&&b.mpeg?new Uint8Array(0):k.default.initSegment([n]),metadata:{channelCount:n.channelCount}},D&&(H=n.inputTimeScale,j=N=t[0].pts-Math.round(H*r))}if(a.sps&&a.pps&&c.length&&(a.timescale=a.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:a.codec,initSegment:k.default.initSegment([a]),metadata:{width:a.width,height:a.height}},D)){H=a.inputTimeScale;var z=this.getVideoStartPts(c),J=Math.round(H*r);N=Math.min(N,A(c[0].dts,z)-J),j=Math.min(j,z-J)}if(Object.keys(h).length)return this.ISGenerated=!0,D&&(this._initPTS=j,this._initDTS=N),{tracks:h,initPTS:j,timescale:H}},_.remuxVideo=function(n,a,r,t){var c=n.inputTimeScale,b=n.samples,h=[],D=b.length,P=this._initPTS,j=this.nextAvcDts,N=8,H=this.videoSampleDuration,z,J,Y=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,te=!1;if(!r||j===null){var Z=a*c,_e=b[0].pts-A(b[0].dts,b[0].pts);j=Z-_e}for(var we=0;we<D;we++){var De=b[we];De.pts=A(De.pts-P,j),De.dts=A(De.dts-P,j),De.dts<b[we>0?we-1:we].dts&&(te=!0)}te&&b.sort(function(Ze,ut){var lt=Ze.dts-ut.dts,it=Ze.pts-ut.pts;return lt||it}),z=b[0].dts,J=b[b.length-1].dts;var Ee=J-z,xe=Ee?Math.round(Ee/(D-1)):H||n.inputTimeScale/30;if(r){var ve=z-j,X=ve>xe,Ae=ve<-1;if((X||Ae)&&(X?u.logger.warn("AVC: "+(0,i.toMsFromMpegTsClock)(ve,!0)+" ms ("+ve+"dts) hole between fragments detected, filling it"):u.logger.warn("AVC: "+(0,i.toMsFromMpegTsClock)(-ve,!0)+" ms ("+ve+"dts) overlapping between fragments detected"),!Ae||j>b[0].pts)){z=j;var Q=b[0].pts-ve;b[0].dts=z,b[0].pts=Q,u.logger.log("Video: First PTS/DTS adjusted: "+(0,i.toMsFromMpegTsClock)(Q,!0)+"/"+(0,i.toMsFromMpegTsClock)(z,!0)+", delta: "+(0,i.toMsFromMpegTsClock)(ve,!0)+" ms")}}z=Math.max(0,z);for(var ue=0,ee=0,ae=0;ae<D;ae++){for(var fe=b[ae],Re=fe.units,pe=Re.length,ie=0,Ie=0;Ie<pe;Ie++)ie+=Re[Ie].data.length;ee+=ie,ue+=pe,fe.length=ie,fe.dts=Math.max(fe.dts,z),Y=Math.min(fe.pts,Y),le=Math.max(fe.pts,le)}J=b[D-1].dts;var Oe=ee+4*ue+8,Ne;try{Ne=new Uint8Array(Oe)}catch(Ze){this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Oe,reason:"fail allocating video mdat "+Oe});return}var Le=new DataView(Ne.buffer);Le.setUint32(0,Oe),Ne.set(k.default.types.mdat,4);for(var Ce=!1,Ue=Number.POSITIVE_INFINITY,Te=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,q=Number.NEGATIVE_INFINITY,se=0;se<D;se++){for(var he=b[se],V=he.units,$=0,re=0,oe=V.length;re<oe;re++){var Se=V[re],Me=Se.data,Be=Se.data.byteLength;Le.setUint32(N,Be),N+=4,Ne.set(Me,N),N+=Be,$+=4+Be}var Ke=void 0;if(se<D-1)H=b[se+1].dts-he.dts,Ke=b[se+1].pts-he.pts;else{var Xe=this.config,Ge=se>0?he.dts-b[se-1].dts:xe;if(Ke=se>0?he.pts-b[se-1].pts:xe,Xe.stretchShortVideoTrack&&this.nextAudioPts!==null){var rt=Math.floor(Xe.maxBufferHole*c),qe=(t?Y+t*c:this.nextAudioPts)-he.pts;qe>rt?(H=qe-Ge,H<0?H=Ge:Ce=!0,u.logger.log("[mp4-remuxer]: It is approximately "+qe/90+" ms to the next segment; using duration "+H/90+" ms for the last video frame.")):H=Ge}else H=Ge}var Ve=Math.round(he.pts-he.dts);Ue=Math.min(Ue,H),Pe=Math.max(Pe,H),Te=Math.min(Te,Ke),q=Math.max(q,Ke),h.push(new l(he.key,H,$,Ve))}if(h.length){if(o){if(o<70){var at=h[0].flags;at.dependsOn=2,at.isNonSync=0}}else if(f&&(q-Te<Pe-Ue&&xe/Pe<.025&&h[0].cts===0)){u.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var Qe=z,$e=0,nt=h.length;$e<nt;$e++){var Ye=Qe+h[$e].duration,st=Qe+h[$e].cts;if($e<nt-1){var Tt=Ye+h[$e+1].cts;h[$e].duration=Tt-st}else h[$e].duration=$e?h[$e-1].duration:xe;h[$e].cts=0,Qe=Ye}}}console.assert(H!==null,"mp4SampleDuration must be computed"),H=Ce||!H?xe:H,this.nextAvcDts=j=J+H,this.videoSampleDuration=H,this.isVideoContiguous=!0;var wt=k.default.moof(n.sequenceNumber++,z,g({},n,{samples:h})),xt="video",je={data1:wt,data2:Ne,startPTS:Y/c,endPTS:(le+H)/c,startDTS:z/c,endDTS:j/c,type:xt,hasAudio:!1,hasVideo:!0,nb:h.length,dropped:n.dropped};return n.samples=[],n.dropped=0,console.assert(Ne.length,"MDAT length must not be zero"),je},_.remuxAudio=function(n,a,r,t,c){var b=n.inputTimeScale,h=n.samplerate?n.samplerate:b,D=b/h,P=n.segmentCodec==="aac"?x:E,j=P*D,N=this._initPTS,H=n.segmentCodec==="mp3"&&this.typeSupported.mpeg,z=[],J=c!==void 0,Y=n.samples,le=H?0:8,te=this.nextAudioPts||-1,Z=a*b;if(this.isAudioContiguous=r=r||Y.length&&te>0&&(t&&Math.abs(Z-te)<9e3||Math.abs(A(Y[0].pts-N,Z)-te)<20*j),Y.forEach(function(Se){Se.pts=A(Se.pts-N,Z)}),!r||te<0){if(Y=Y.filter(function(Se){return Se.pts>=0}),!Y.length)return;c===0?te=0:t&&!J?te=Math.max(0,Z):te=Y[0].pts}if(n.segmentCodec==="aac")for(var _e=this.config.maxAudioFramesDrift,we=0,De=te;we<Y.length;we++){var Ee=Y[we],xe=Ee.pts,ve=xe-De,X=Math.abs(1e3*ve/b);if(ve<=-_e*j&&J)we===0&&(u.logger.warn("Audio frame @ "+(xe/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ve/b)+" ms."),this.nextAudioPts=te=De=xe);else if(ve>=_e*j&&X<w&&J){var Ae=Math.round(ve/j);De=xe-Ae*j,De<0&&(Ae--,De+=j),we===0&&(this.nextAudioPts=te=De),u.logger.warn("[mp4-remuxer]: Injecting "+Ae+" audio frame @ "+(De/b).toFixed(3)+"s due to "+Math.round(1e3*ve/b)+" ms gap.");for(var Q=0;Q<Ae;Q++){var ue=Math.max(De,0),ee=e.default.getSilentFrame(n.manifestCodec||n.codec,n.channelCount);ee||(u.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ee=Ee.unit.subarray()),Y.splice(we,0,{unit:ee,pts:ue}),De+=j,we++}}Ee.pts=De,De+=j}for(var ae=null,fe=null,Re,pe=0,ie=Y.length;ie--;)pe+=Y[ie].unit.byteLength;for(var Ie=0,Oe=Y.length;Ie<Oe;Ie++){var Ne=Y[Ie],Le=Ne.unit,Ce=Ne.pts;if(fe!==null){var Ue=z[Ie-1];Ue.duration=Math.round((Ce-fe)/D)}else if(r&&n.segmentCodec==="aac"&&(Ce=te),ae=Ce,pe>0){pe+=le;try{Re=new Uint8Array(pe)}catch(Se){this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:pe,reason:"fail allocating audio mdat "+pe});return}if(!H){var Te=new DataView(Re.buffer);Te.setUint32(0,pe),Re.set(k.default.types.mdat,4)}}else return;Re.set(Le,le);var Pe=Le.byteLength;le+=Pe,z.push(new l(!0,P,Pe,0)),fe=Ce}var q=z.length;if(!q)return;var se=z[z.length-1];this.nextAudioPts=te=fe+D*se.duration;var he=H?new Uint8Array(0):k.default.moof(n.sequenceNumber++,ae/D,g({},n,{samples:z}));n.samples=[];var V=ae/b,$=te/b,re="audio",oe={data1:he,data2:Re,startPTS:V,endPTS:$,startDTS:V,endDTS:$,type:re,hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,console.assert(Re.length,"MDAT length must not be zero"),oe},_.remuxEmptyAudio=function(n,a,r,t){var c=n.inputTimeScale,b=n.samplerate?n.samplerate:c,h=c/b,D=this.nextAudioPts,P=(D!==null?D:t.startDTS*c)+this._initDTS,j=t.endDTS*c+this._initDTS,N=h*x,H=Math.ceil((j-P)/N),z=e.default.getSilentFrame(n.manifestCodec||n.codec,n.channelCount);if(u.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){u.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],Y=0;Y<H;Y++){var le=P+Y*N;J.push({unit:z,pts:le,dts:le})}return n.samples=J,this.remuxAudio(n,a,r,!1)},y}();function A(y,_){var v;if(_===null)return y;for(_<y?v=-8589934592:v=8589934592;Math.abs(y-_)>4294967296;)y+=v;return y}function s(y){for(var _=0;_<y.length;_++)if(y[_].key)return _;return-1}function p(y,_,v,n){var a=y.samples.length;if(!a)return;for(var r=y.inputTimeScale,t=0;t<a;t++){var c=y.samples[t];c.pts=A(c.pts-v,_*r)/r,c.dts=A(c.dts-n,_*r)/r}var b=y.samples;return y.samples=[],{samples:b}}function C(y,_,v){var n=y.samples.length;if(!n)return;for(var a=y.inputTimeScale,r=0;r<n;r++){var t=y.samples[r];t.pts=A(t.pts-v,_*a)/a}y.samples.sort(function(b,h){return b.pts-h.pts});var c=y.samples;return y.samples=[],{samples:c}}var l=function(_,v,n,a){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=n,this.cts=a,this.flags=new T(_)},T=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":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>i});var W=O("./src/polyfills/number.ts"),e=O("./src/remux/mp4-remuxer.ts"),k=O("./src/utils/mp4-tools.ts"),L=O("./src/loader/fragment.ts"),I=O("./src/utils/logger.ts"),u=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.lastEndTime=null}var w=g.prototype;return w.destroy=function(){},w.resetTimeStamp=function(E){this.initPTS=E,this.lastEndTime=null},w.resetNextTimestamp=function(){this.lastEndTime=null},w.resetInitSegment=function(E,o,f,d){this.audioCodec=o,this.videoCodec=f,this.generateInitSegment((0,k.patchEncyptionData)(E,d)),this.emitInitSegment=!0},w.generateInitSegment=function(E){var o=this.audioCodec,f=this.videoCodec;if(!E||!E.byteLength){this.initTracks=void 0,this.initData=void 0;return}var d=this.initData=(0,k.parseInitSegment)(E);o||(o=m(d.audio,L.ElementaryStreamTypes.AUDIO)),f||(f=m(d.video,L.ElementaryStreamTypes.VIDEO));var A={};d.audio&&d.video?A.audiovideo={container:"video/mp4",codec:o+","+f,initSegment:E,id:"main"}:d.audio?A.audio={container:"audio/mp4",codec:o,initSegment:E,id:"audio"}:d.video?A.video={container:"video/mp4",codec:f,initSegment:E,id:"main"}:I.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=A},w.remux=function(E,o,f,d,A){var s,p=this.initPTS,C=this.lastEndTime,l={audio:void 0,video:void 0,text:d,id3:f,initSegment:void 0};(0,W.isFiniteNumber)(C)||(C=this.lastEndTime=A||0);var T=o.samples;if(!T||!T.length)return l;var y={initPTS:void 0,timescale:1},_=this.initData;if((!_||!_.length)&&(this.generateInitSegment(T),_=this.initData),!_||!_.length)return I.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),l;this.emitInitSegment&&(y.tracks=this.initTracks,this.emitInitSegment=!1);var v=(0,k.getStartDTS)(_,T);(0,W.isFiniteNumber)(p)||(this.initPTS=y.initPTS=p=v-A);var n=(0,k.getDuration)(T,_),a=E?v-p:C,r=a+n;(0,k.offsetStartDTS)(_,T,p),n>0?this.lastEndTime=r:(I.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var t=!!_.audio,c=!!_.video,b="";t&&(b+="audio"),c&&(b+="video");var h={data1:T,startPTS:a,startDTS:a,endPTS:r,endDTS:r,type:b,hasAudio:t,hasVideo:c,nb:1,dropped:0};l.audio=h.type==="audio"?h:void 0,l.video=h.type!=="audio"?h:void 0,l.initSegment=y;var D=(s=this.initPTS)!=null?s:0;return l.id3=(0,e.flushTextTrackMetadataCueSamples)(f,A,D,D),d.samples.length&&(l.text=(0,e.flushTextTrackUserdataCueSamples)(d,A,D)),l},g}();function m(g,w){var x=g==null?void 0:g.codec;return x&&x.length>4?x:x==="hvc1"||x==="hev1"?"hvc1.1.c.L120.90":x==="av01"?"av01.0.04M.08":x==="avc1"||w===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const i=u},"./src/task-loop.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>W});var W=function(){function e(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=e.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},e}()},"./src/types/cmcd.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{CMCDObjectType:()=>e,CMCDStreamType:()=>L,CMCDStreamingFormat:()=>k,CMCDVersion:()=>W});var W=1,e;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(e||(e={}));var k;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(k||(k={}));var L;(function(I){I.VOD="v",I.LIVE="l"})(L||(L={}))},"./src/types/demuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{MetadataSchema:()=>W});var W;(function(e){e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3"})(W||(W={}))},"./src/types/level.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{HdcpLevels:()=>I,HlsSkip:()=>u,HlsUrlParameters:()=>i,Level:()=>g,getSkipValue:()=>m});function W(w,x){for(var E=0;E<x.length;E++){var o=x[E];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(w,k(o.key),o)}}function e(w,x,E){return x&&W(w.prototype,x),E&&W(w,E),Object.defineProperty(w,"prototype",{writable:!1}),w}function k(w){var x=L(w,"string");return typeof x=="symbol"?x:String(x)}function L(w,x){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var o=E.call(w,x||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(w)}var I=["NONE","TYPE-0","TYPE-1","TYPE-2",null],u;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(u||(u={}));function m(w,x){var E=w.canSkipUntil,o=w.canSkipDateRanges,f=w.endSN,d=x!==void 0?x-f:0;return E&&d<E?o?u.v2:u.Yes:u.No}var i=function(){function w(E,o,f){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=E,this.part=o,this.skip=f}var x=w.prototype;return x.addDirectives=function(o){var f=new self.URL(o);return this.msn!==void 0&&f.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&f.searchParams.set("_HLS_part",this.part.toString()),this.skip&&f.searchParams.set("_HLS_skip",this.skip),f.href},w}(),g=function(){function w(x){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=[x.url],this.attrs=x.attrs,this.bitrate=x.bitrate,x.details&&(this.details=x.details),this.id=x.id||0,this.name=x.name,this.width=x.width||0,this.height=x.height||0,this.audioCodec=x.audioCodec,this.videoCodec=x.videoCodec,this.unknownCodecs=x.unknownCodecs,this.codecSet=[x.videoCodec,x.audioCodec].filter(function(E){return E}).join(",").replace(/\.[^.,]+/g,"")}return e(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(E){var o=E%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),w}()},"./src/types/loader.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{PlaylistContextType:()=>W,PlaylistLevelType:()=>e});var W;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(W||(W={}));var e;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(e||(e={}))},"./src/types/transmuxer.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{ChunkMetadata:()=>W});var W=function(L,I,u,m,i,g){m===void 0&&(m=0),i===void 0&&(i=-1),g===void 0&&(g=!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=e(),this.buffering={audio:e(),video:e(),audiovideo:e()},this.level=L,this.sn=I,this.id=u,this.size=m,this.part=i,this.partial=g};function e(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{AttrList:()=>k});var W=/^(\d+)x(\d+)$/,e=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function L(u){typeof u=="string"&&(u=L.parseAttrList(u));for(var m in u)u.hasOwnProperty(m)&&(this[m]=u[m])}var I=L.prototype;return I.decimalInteger=function(m){var i=parseInt(this[m],10);return i>Number.MAX_SAFE_INTEGER?Infinity:i},I.hexadecimalInteger=function(m){if(this[m]){var i=(this[m]||"0x").slice(2);i=(i.length&1?"0":"")+i;for(var g=new Uint8Array(i.length/2),w=0;w<i.length/2;w++)g[w]=parseInt(i.slice(w*2,w*2+2),16);return g}else return null},I.hexadecimalIntegerAsNumber=function(m){var i=parseInt(this[m],16);return i>Number.MAX_SAFE_INTEGER?Infinity:i},I.decimalFloatingPoint=function(m){return parseFloat(this[m])},I.optionalFloat=function(m,i){var g=this[m];return g?parseFloat(g):i},I.enumeratedString=function(m){return this[m]},I.bool=function(m){return this[m]==="YES"},I.decimalResolution=function(m){var i=W.exec(this[m]);return i===null?void 0:{width:parseInt(i[1],10),height:parseInt(i[2],10)}},L.parseAttrList=function(m){var i,g={},w='"';for(e.lastIndex=0;(i=e.exec(m))!==null;){var x=i[2];x.indexOf(w)===0&&x.lastIndexOf(w)===x.length-1&&(x=x.slice(1,-1)),g[i[1]]=x}return g},L}()},"./src/utils/binary-search.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>e});var W={search:function(L,I){for(var u=0,m=L.length-1,i=null,g=null;u<=m;){i=(u+m)/2|0,g=L[i];var w=I(g);if(w>0)u=i+1;else if(w<0)m=i-1;else return g}return null}};const e=W},"./src/utils/buffer-helper.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{BufferHelper:()=>k});var W=O("./src/utils/logger.ts"),e={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function L(){}return L.isBuffered=function(u,m){try{if(u){for(var i=L.getBuffered(u),g=0;g<i.length;g++)if(m>=i.start(g)&&m<=i.end(g))return!0}}catch(w){}return!1},L.bufferInfo=function(u,m,i){try{if(u){var g=L.getBuffered(u),w=[],x;for(x=0;x<g.length;x++)w.push({start:g.start(x),end:g.end(x)});return this.bufferedInfo(w,m,i)}}catch(E){}return{len:0,start:m,end:m,nextStart:void 0}},L.bufferedInfo=function(u,m,i){m=Math.max(0,m),u.sort(function(l,T){var y=l.start-T.start;return y||T.end-l.end});var g=[];if(i)for(var w=0;w<u.length;w++){var x=g.length;if(x){var E=g[x-1].end;u[w].start-E<i?u[w].end>E&&(g[x-1].end=u[w].end):g.push(u[w])}else g.push(u[w])}else g=u;for(var o=0,f,d=m,A=m,s=0;s<g.length;s++){var p=g[s].start,C=g[s].end;if(m+i>=p&&m<C)d=p,A=C,o=A-m;else if(m+i<p){f=p;break}}return{len:o,start:d||0,end:A||0,nextStart:f}},L.getBuffered=function(u){try{return u.buffered}catch(m){return W.logger.log("failed to get media.buffered",m),e}},L}()},"./src/utils/cea-608-parser.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{CaptionScreen:()=>s,Row:()=>A,default:()=>_});var W=O("./src/utils/logger.ts"),e={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},k=function(n){var a=n;return e.hasOwnProperty(n)&&(a=e[n]),String.fromCharCode(a)},L=15,I=100,u={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},m={17:2,18:4,21:6,22:8,23:10,19:13,20:15},i={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},w=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],x;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(x||(x={}));var E=function(){function v(){this.time=null,this.verboseLevel=x.ERROR}var n=v.prototype;return n.log=function(r,t){if(this.verboseLevel>=r){var c=typeof t=="function"?t():t;W.logger.log(this.time+" ["+r+"] "+c)}},v}(),o=function(n){for(var a=[],r=0;r<n.length;r++)a.push(n[r].toString(16));return a},f=function(){function v(a,r,t,c,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=r||!1,this.italics=t||!1,this.background=c||"black",this.flash=b||!1}var n=v.prototype;return n.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},n.setStyles=function(r){for(var t=["foreground","underline","italics","background","flash"],c=0;c<t.length;c++){var b=t[c];r.hasOwnProperty(b)&&(this[b]=r[b])}},n.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},n.equals=function(r){return this.foreground===r.foreground&&this.underline===r.underline&&this.italics===r.italics&&this.background===r.background&&this.flash===r.flash},n.copy=function(r){this.foreground=r.foreground,this.underline=r.underline,this.italics=r.italics,this.background=r.background,this.flash=r.flash},n.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),d=function(){function v(a,r,t,c,b,h){this.uchar=void 0,this.penState=void 0,this.uchar=a||" ",this.penState=new f(r,t,c,b,h)}var n=v.prototype;return n.reset=function(){this.uchar=" ",this.penState.reset()},n.setChar=function(r,t){this.uchar=r,this.penState.copy(t)},n.setPenState=function(r){this.penState.copy(r)},n.equals=function(r){return this.uchar===r.uchar&&this.penState.equals(r.penState)},n.copy=function(r){this.uchar=r.uchar,this.penState.copy(r.penState)},n.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),A=function(){function v(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 r=0;r<I;r++)this.chars.push(new d);this.logger=a,this.pos=0,this.currPenState=new f}var n=v.prototype;return n.equals=function(r){for(var t=!0,c=0;c<I;c++)if(!this.chars[c].equals(r.chars[c])){t=!1;break}return t},n.copy=function(r){for(var t=0;t<I;t++)this.chars[t].copy(r.chars[t])},n.isEmpty=function(){for(var r=!0,t=0;t<I;t++)if(!this.chars[t].isEmpty()){r=!1;break}return r},n.setCursor=function(r){this.pos!==r&&(this.pos=r),this.pos<0?(this.logger.log(x.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(x.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},n.moveCursor=function(r){var t=this.pos+r;if(r>1)for(var c=this.pos+1;c<t+1;c++)this.chars[c].setPenState(this.currPenState);this.setCursor(t)},n.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},n.insertChar=function(r){var t=this;r>=144&&this.backSpace();var c=k(r);if(this.pos>=I){this.logger.log(x.ERROR,function(){return"Cannot insert "+r.toString(16)+" ("+c+") at position "+t.pos+". Skipping it!"});return}this.chars[this.pos].setChar(c,this.currPenState),this.moveCursor(1)},n.clearFromPos=function(r){var t;for(t=r;t<I;t++)this.chars[t].reset()},n.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},n.clearToEndOfRow=function(){this.clearFromPos(this.pos)},n.getTextString=function(){for(var r=[],t=!0,c=0;c<I;c++){var b=this.chars[c].uchar;b!==" "&&(t=!1),r.push(b)}return t?"":r.join("")},n.setPenStyles=function(r){this.currPenState.setStyles(r);var t=this.chars[this.pos];t.setPenState(this.currPenState)},v}(),s=function(){function v(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 r=0;r<L;r++)this.rows.push(new A(a));this.logger=a,this.currRow=L-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var n=v.prototype;return n.reset=function(){for(var r=0;r<L;r++)this.rows[r].clear();this.currRow=L-1},n.equals=function(r){for(var t=!0,c=0;c<L;c++)if(!this.rows[c].equals(r.rows[c])){t=!1;break}return t},n.copy=function(r){for(var t=0;t<L;t++)this.rows[t].copy(r.rows[t])},n.isEmpty=function(){for(var r=!0,t=0;t<L;t++)if(!this.rows[t].isEmpty()){r=!1;break}return r},n.backSpace=function(){var r=this.rows[this.currRow];r.backSpace()},n.clearToEndOfRow=function(){var r=this.rows[this.currRow];r.clearToEndOfRow()},n.insertChar=function(r){var t=this.rows[this.currRow];t.insertChar(r)},n.setPen=function(r){var t=this.rows[this.currRow];t.setPenStyles(r)},n.moveCursor=function(r){var t=this.rows[this.currRow];t.moveCursor(r)},n.setCursor=function(r){this.logger.log(x.INFO,"setCursor: "+r);var t=this.rows[this.currRow];t.setCursor(r)},n.setPAC=function(r){this.logger.log(x.INFO,function(){return"pacData = "+JSON.stringify(r)});var t=r.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var c=0;c<L;c++)this.rows[c].clear();var b=this.currRow+1-this.nrRollUpRows,h=this.lastOutputScreen;if(h){var D=h.rows[b].cueStartTime,P=this.logger.time;if(D&&P!==null&&D<P)for(var j=0;j<this.nrRollUpRows;j++)this.rows[t-this.nrRollUpRows+j+1].copy(h.rows[b+j])}}this.currRow=t;var N=this.rows[this.currRow];if(r.indent!==null){var H=r.indent,z=Math.max(H-1,0);N.setCursor(r.indent),r.color=N.chars[z].penState.foreground}var J={foreground:r.color,underline:r.underline,italics:r.italics,background:"black",flash:!1};this.setPen(J)},n.setBkgData=function(r){this.logger.log(x.INFO,function(){return"bkgData = "+JSON.stringify(r)}),this.backSpace(),this.setPen(r),this.insertChar(32)},n.setRollUpRows=function(r){this.nrRollUpRows=r},n.rollUp=function(){var r=this;if(this.nrRollUpRows===null){this.logger.log(x.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(x.TEXT,function(){return r.getDisplayText()});var t=this.currRow+1-this.nrRollUpRows,c=this.rows.splice(t,1)[0];c.clear(),this.rows.splice(this.currRow,0,c),this.logger.log(x.INFO,"Rolling up")},n.getDisplayText=function(r){r=r||!1;for(var t=[],c="",b=-1,h=0;h<L;h++){var D=this.rows[h].getTextString();D&&(b=h+1,r?t.push("Row "+b+": '"+D+"'"):t.push(D.trim()))}return t.length>0&&(r?c="["+t.join(" | ")+"]":c=t.join(`
`)),c},n.getTextAndFormat=function(){return this.rows},v}(),p=function(){function v(a,r,t){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=r,this.mode=null,this.verbose=0,this.displayedMemory=new s(t),this.nonDisplayedMemory=new s(t),this.lastOutputScreen=new s(t),this.currRollUpRow=this.displayedMemory.rows[L-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=t}var n=v.prototype;return n.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[L-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},n.getHandler=function(){return this.outputFilter},n.setHandler=function(r){this.outputFilter=r},n.setPAC=function(r){this.writeScreen.setPAC(r)},n.setBkgData=function(r){this.writeScreen.setBkgData(r)},n.setMode=function(r){if(r===this.mode)return;this.mode=r,this.logger.log(x.INFO,function(){return"MODE="+r}),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=r},n.insertChars=function(r){for(var t=this,c=0;c<r.length;c++)this.writeScreen.insertChar(r[c]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(x.INFO,function(){return b+": "+t.writeScreen.getDisplayText(!0)}),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(x.TEXT,function(){return"DISPLAYED: "+t.displayedMemory.getDisplayText(!0)}),this.outputDataUpdate())},n.ccRCL=function(){this.logger.log(x.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},n.ccBS=function(){if(this.logger.log(x.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},n.ccAOF=function(){},n.ccAON=function(){},n.ccDER=function(){this.logger.log(x.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},n.ccRU=function(r){this.logger.log(x.INFO,"RU("+r+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(r)},n.ccFON=function(){this.logger.log(x.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},n.ccRDC=function(){this.logger.log(x.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},n.ccTR=function(){this.logger.log(x.INFO,"TR"),this.setMode("MODE_TEXT")},n.ccRTD=function(){this.logger.log(x.INFO,"RTD"),this.setMode("MODE_TEXT")},n.ccEDM=function(){this.logger.log(x.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},n.ccCR=function(){this.logger.log(x.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},n.ccENM=function(){this.logger.log(x.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},n.ccEOC=function(){var r=this;if(this.logger.log(x.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(x.TEXT,function(){return"DISP: "+r.displayedMemory.getDisplayText()})}this.outputDataUpdate(!0)},n.ccTO=function(r){this.logger.log(x.INFO,"TO("+r+") - Tab Offset"),this.writeScreen.moveCursor(r)},n.ccMIDROW=function(r){var t={flash:!1};if(t.underline=r%2===1,t.italics=r>=46,t.italics)t.foreground="white";else{var c=Math.floor(r/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=b[c]}this.logger.log(x.INFO,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},n.outputDataUpdate=function(r){r===void 0&&(r=!1);var t=this.logger.time;if(t===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),r&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))},n.cueSplitAtTime=function(r){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,r,this.displayedMemory),this.cueStartTime=r))},v}(),C=function(){function v(a,r,t){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var c=new E;this.channels=[null,new p(a,r,c),new p(a+1,t,c)],this.cmdHistory=y(),this.logger=c}var n=v.prototype;return n.getHandler=function(r){return this.channels[r].getHandler()},n.setHandler=function(r,t){this.channels[r].setHandler(t)},n.addData=function(r,t){var c,b,h,D=!1;this.logger.time=r;for(var P=0;P<t.length;P+=2){if(b=t[P]&127,h=t[P+1]&127,b===0&&h===0)continue;if(this.logger.log(x.DATA,"["+o([t[P],t[P+1]])+"] -> ("+o([b,h])+")"),c=this.parseCmd(b,h),c||(c=this.parseMidrow(b,h)),c||(c=this.parsePAC(b,h)),c||(c=this.parseBackgroundAttributes(b,h)),!c&&(D=this.parseChars(b,h),D)){var j=this.currentChannel;if(j&&j>0){var N=this.channels[j];N.insertChars(D)}else this.logger.log(x.WARNING,"No channel found yet. TEXT-MODE?")}!c&&!D&&this.logger.log(x.WARNING,"Couldn't parse cleaned data "+o([b,h])+" orig: "+o([t[P],t[P+1]]))}},n.parseCmd=function(r,t){var c=this.cmdHistory,b=(r===20||r===28||r===21||r===29)&&t>=32&&t<=47,h=(r===23||r===31)&&t>=33&&t<=35;if(!(b||h))return!1;if(T(r,t,c))return l(null,null,c),this.logger.log(x.DEBUG,"Repeated command ("+o([r,t])+") is dropped"),!0;var D=r===20||r===21||r===23?1:2,P=this.channels[D];return r===20||r===21||r===28||r===29?t===32?P.ccRCL():t===33?P.ccBS():t===34?P.ccAOF():t===35?P.ccAON():t===36?P.ccDER():t===37?P.ccRU(2):t===38?P.ccRU(3):t===39?P.ccRU(4):t===40?P.ccFON():t===41?P.ccRDC():t===42?P.ccTR():t===43?P.ccRTD():t===44?P.ccEDM():t===45?P.ccCR():t===46?P.ccENM():t===47&&P.ccEOC():P.ccTO(t-32),l(r,t,c),this.currentChannel=D,!0},n.parseMidrow=function(r,t){var c=0;if((r===17||r===25)&&t>=32&&t<=47){if(r===17?c=1:c=2,c!==this.currentChannel)return this.logger.log(x.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[c];return b?(b.ccMIDROW(t),this.logger.log(x.DEBUG,"MIDROW ("+o([r,t])+")"),!0):!1}return!1},n.parsePAC=function(r,t){var c,b=this.cmdHistory,h=(r>=17&&r<=23||r>=25&&r<=31)&&t>=64&&t<=127,D=(r===16||r===24)&&t>=64&&t<=95;if(!(h||D))return!1;if(T(r,t,b))return l(null,null,b),!0;var P=r<=23?1:2;t>=64&&t<=95?c=P===1?u[r]:i[r]:c=P===1?m[r]:g[r];var j=this.channels[P];return j?(j.setPAC(this.interpretPAC(c,t)),l(r,t,b),this.currentChannel=P,!0):!1},n.interpretPAC=function(r,t){var c,b={color:null,italics:!1,indent:null,underline:!1,row:r};return t>95?c=t-96:c=t-64,b.underline=(c&1)===1,c<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(c/2)]:c<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((c-16)/2)*4,b},n.parseChars=function(r,t){var c,b=null,h=null;if(r>=25?(c=2,h=r-8):(c=1,h=r),h>=17&&h<=19){var D;h===17?D=t+80:h===18?D=t+112:D=t+144,this.logger.log(x.INFO,"Special char '"+k(D)+"' in channel "+c),b=[D]}else r>=32&&r<=127&&(b=t===0?[r]:[r,t]);if(b){var P=o(b);this.logger.log(x.DEBUG,"Char codes = "+P.join(",")),l(r,t,this.cmdHistory)}return b},n.parseBackgroundAttributes=function(r,t){var c=(r===16||r===24)&&t>=32&&t<=47,b=(r===23||r===31)&&t>=45&&t<=47;if(!(c||b))return!1;var h,D={};r===16||r===24?(h=Math.floor((t-32)/2),D.background=w[h],t%2===1&&(D.background=D.background+"_semi")):t===45?D.background="transparent":(D.foreground="black",t===47&&(D.underline=!0));var P=r<=23?1:2,j=this.channels[P];return j.setBkgData(D),l(r,t,this.cmdHistory),!0},n.reset=function(){for(var r=0;r<Object.keys(this.channels).length;r++){var t=this.channels[r];t&&t.reset()}this.cmdHistory=y()},n.cueSplitAtTime=function(r){for(var t=0;t<this.channels.length;t++){var c=this.channels[t];c&&c.cueSplitAtTime(r)}},v}();function l(v,n,a){a.a=v,a.b=n}function T(v,n,a){return a.a===v&&a.b===n}function y(){return{a:null,b:null}}const _=C},"./src/utils/codecs.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{isCodecSupportedInMp4:()=>k,isCodecType:()=>e});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,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,dva1:!0,dvav:!0,dvh1:!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 e(L,I){var u=W[I];return!!u&&u[L.slice(0,4)]===!0}function k(L,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+L+'"')}},"./src/utils/cues.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>u});var W=O("./src/utils/vttparser.ts"),e=O("./src/utils/webvtt-parser.ts"),k=O("./src/utils/texttrack-utils.ts"),L=/\s/,I={newCue:function(i,g,w,x){for(var E=[],o,f,d,A,s,p=self.VTTCue||self.TextTrackCue,C=0;C<x.rows.length;C++)if(o=x.rows[C],d=!0,A=0,s="",!o.isEmpty()){for(var l=0;l<o.chars.length;l++)L.test(o.chars[l].uchar)&&d?A++:(s+=o.chars[l].uchar,d=!1);o.cueStartTime=g,g===w&&(w+=1e-4),A>=16?A--:A++;var T=(0,W.fixLineBreaks)(s.trim()),y=(0,e.generateCueId)(g,w,T);(!i||!i.cues||!i.cues.getCueById(y))&&(f=new p(g,w,T),f.id=y,f.line=C+1,f.align="left",f.position=10+Math.min(80,Math.floor(A*8/32)*10),E.push(f))}return i&&E.length&&(E.sort(function(_,v){return _.line==="auto"||v.line==="auto"?0:_.line>8&&v.line>8?v.line-_.line:_.line-v.line}),E.forEach(function(_){return(0,k.addCueToTrack)(i,_)})),E}};const u=I},"./src/utils/discontinuities.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{adjustSlidingStart:()=>i,alignMediaPlaylistByPDT:()=>E,alignPDT:()=>x,alignStream:()=>g,findDiscontinuousReferenceFrag:()=>u,findFirstFragWithCC:()=>L,shouldAlignOnDiscontinuities:()=>I});var W=O("./src/polyfills/number.ts"),e=O("./src/utils/logger.ts"),k=O("./src/controller/level-helper.ts");function L(o,f){for(var d=null,A=0,s=o.length;A<s;A++){var p=o[A];if(p&&p.cc===f){d=p;break}}return d}function I(o,f,d){return!!(f.details&&(d.endCC>d.startCC||o&&o.cc<d.startCC))}function u(o,f,d){d===void 0&&(d=0);var A=o.fragments,s=f.fragments;if(!s.length||!A.length){e.logger.log("No fragments to align");return}var p=L(A,s[0].cc);if(!p||p&&!p.startPTS){e.logger.log("No frag in previous level to align on");return}return p}function m(o,f){if(o){var d=o.start+f;o.start=o.startPTS=d,o.endPTS=d+o.duration}}function i(o,f){for(var d=f.fragments,A=0,s=d.length;A<s;A++)m(d[A],o);f.fragmentHint&&m(f.fragmentHint,o),f.alignedSliding=!0}function g(o,f,d){if(!f)return;w(o,d,f),!d.alignedSliding&&f.details&&x(d,f.details),!d.alignedSliding&&f.details&&!d.skippedSegments&&(0,k.adjustSliding)(f.details,d)}function w(o,f,d){if(I(o,d,f)){var A=u(d.details,f);A&&(0,W.isFiniteNumber)(A.start)&&(e.logger.log("Adjusting PTS using last level due to CC increase within current level "+f.url),i(A.start,f))}}function x(o,f){if(!f.fragments.length||!o.hasProgramDateTime||!f.hasProgramDateTime)return;var d=f.fragments[0].programDateTime,A=o.fragments[0].programDateTime,s=(A-d)/1e3+f.fragments[0].start;s&&(0,W.isFiniteNumber)(s)&&(e.logger.log("Adjusting PTS using programDateTime delta "+(A-d)+"ms, sliding:"+s.toFixed(3)+" "+o.url+" "),i(s,o))}function E(o,f){if(!o.hasProgramDateTime||!f.hasProgramDateTime)return;var d=o.fragments,A=f.fragments;if(!d.length||!A.length)return;var s=Math.round(A.length/2)-1,p=A[s],C=L(d,p.cc)||d[Math.round(d.length/2)-1],l=p.programDateTime,T=C.programDateTime;if(l===null||T===null)return;var y=(T-l)/1e3-(C.start-p.start);i(y,o)}},"./src/utils/ewma-bandwidth-estimator.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>k});var W=O("./src/utils/ewma.ts"),e=function(){function L(u,m,i){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new W.default(u),this.fast_=new W.default(m)}var I=L.prototype;return I.update=function(m,i){var g=this.slow_,w=this.fast_;this.slow_.halfLife!==m&&(this.slow_=new W.default(m,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==i&&(this.fast_=new W.default(i,w.getEstimate(),w.getTotalWeight()))},I.sample=function(m,i){m=Math.max(m,this.minDelayMs_);var g=8*i,w=m/1e3,x=g/w;this.fast_.sample(w,x),this.slow_.sample(w,x)},I.canEstimate=function(){var m=this.fast_;return m&&m.getTotalWeight()>=this.minWeight_},I.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},I.destroy=function(){},L}();const k=e},"./src/utils/ewma.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>e});var W=function(){function k(I,u,m){u===void 0&&(u=0),m===void 0&&(m=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=I,this.alpha_=I?Math.exp(Math.log(.5)/I):0,this.estimate_=u,this.totalWeight_=m}var L=k.prototype;return L.sample=function(u,m){var i=Math.pow(this.alpha_,u);this.estimate_=m*(1-i)+i*this.estimate_,this.totalWeight_+=u},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var u=1-Math.pow(this.alpha_,this.totalWeight_);if(u)return this.estimate_/u}return this.estimate_},k}();const e=W},"./src/utils/fetch-loader.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>s,fetchSupported:()=>E});var W=O("./src/polyfills/number.ts"),e=O("./src/loader/load-stats.ts"),k=O("./src/demux/chunk-cache.ts");function L(p,C){p.prototype=Object.create(C.prototype),p.prototype.constructor=p,g(p,C)}function I(p){var C=typeof Map=="function"?new Map:void 0;return I=function(T){if(T===null||!i(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(T))return C.get(T);C.set(T,y)}function y(){return u(T,arguments,w(this).constructor)}return y.prototype=Object.create(T.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g(y,T)},I(p)}function u(p,C,l){return m()?u=Reflect.construct.bind():u=function(y,_,v){var n=[null];n.push.apply(n,_);var a=Function.bind.apply(y,n),r=new a;return v&&g(r,v.prototype),r},u.apply(null,arguments)}function m(){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(p){return!1}}function i(p){return Function.toString.call(p).indexOf("[native code]")!==-1}function g(p,C){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,y){return T.__proto__=y,T},g(p,C)}function w(p){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},w(p)}function x(){return x=Object.assign?Object.assign.bind():function(p){for(var C=1;C<arguments.length;C++){var l=arguments[C];for(var T in l)Object.prototype.hasOwnProperty.call(l,T)&&(p[T]=l[T])}return p},x.apply(this,arguments)}function E(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(p){}return!1}var o=function(){function p(l){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=l.fetchSetup||d,this.controller=new self.AbortController,this.stats=new e.LoadStats}var C=p.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(T,y,_){var v=this,n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();var a=f(T,this.controller.signal),r=_.onProgress,t=T.responseType==="arraybuffer",c=t?"byteLength":"length";this.context=T,this.config=y,this.callbacks=_,this.request=this.fetchSetup(T,a),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),_.onTimeout(n,T,v.response)},y.timeout),self.fetch(this.request).then(function(b){if(v.response=v.loader=b,!b.ok){var h=b.status,D=b.statusText;throw new A(D||"fetch, bad network response",h,b)}return n.loading.first=Math.max(self.performance.now(),n.loading.start),n.total=parseInt(b.headers.get("Content-Length")||"0"),r&&(0,W.isFiniteNumber)(y.highWaterMark)?v.loadProgressively(b,n,T,y.highWaterMark,r):t?b.arrayBuffer():b.text()}).then(function(b){var h=v.response;self.clearTimeout(v.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);var D=b[c];D&&(n.loaded=n.total=D);var P={url:h.url,data:b};r&&!(0,W.isFiniteNumber)(y.highWaterMark)&&r(n,T,b,h),_.onSuccess(P,n,T,h)}).catch(function(b){if(self.clearTimeout(v.requestTimeout),n.aborted)return;var h=b&&b.code||0,D=b?b.message:null;_.onError({code:h,text:D},T,b?b.details:null)})},C.getCacheAge=function(){var T=null;if(this.response){var y=this.response.headers.get("age");T=y?parseFloat(y):null}return T},C.loadProgressively=function(T,y,_,v,n){v===void 0&&(v=0);var a=new k.default,r=T.body.getReader(),t=function c(){return r.read().then(function(b){if(b.done)return a.dataLength&&n(y,_,a.flush(),T),Promise.resolve(new ArrayBuffer(0));var h=b.value,D=h.length;return y.loaded+=D,D<v||a.dataLength?(a.push(h),a.dataLength>=v&&n(y,_,a.flush(),T)):n(y,_,h,T),c()}).catch(function(){return Promise.reject()})};return t()},p}();function f(p,C){var l={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(x({},p.headers))};return p.rangeEnd&&l.headers.set("Range","bytes="+p.rangeStart+"-"+String(p.rangeEnd-1)),l}function d(p,C){return new self.Request(p.url,C)}var A=function(p){L(C,p);function C(l,T,y){var _;return _=p.call(this,l)||this,_.code=void 0,_.details=void 0,_.code=T,_.details=y,_}return C}(I(Error));const s=o},"./src/utils/hex.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>e});var W={hexDump:function(L){for(var I="",u=0;u<L.length;u++){var m=L[u].toString(16);m.length<2&&(m="0"+m),I+=m}return I}};const e=W},"./src/utils/imsc1-ttml-parser.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{IMSC1_CODEC:()=>i,parseIMSC1:()=>E});var W=O("./src/utils/mp4-tools.ts"),e=O("./src/utils/vttparser.ts"),k=O("./src/utils/vttcue.ts"),L=O("./src/demux/id3.ts"),I=O("./src/utils/timescale-conversion.ts"),u=O("./src/utils/webvtt-parser.ts");function m(){return m=Object.assign?Object.assign.bind():function(_){for(var v=1;v<arguments.length;v++){var n=arguments[v];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(_[a]=n[a])}return _},m.apply(this,arguments)}var i="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,w=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,x={left:"start",center:"center",right:"end",start:"start",end:"end"};function E(_,v,n,a,r){var t=(0,W.findBox)(new Uint8Array(_),["mdat"]);if(t.length===0){r(new Error("Could not parse IMSC1 mdat"));return}var c=t.map(function(h){return(0,L.utf8ArrayToStr)(h)}),b=(0,I.toTimescaleFromScale)(v,1,n);try{c.forEach(function(h){return a(o(h,b))})}catch(h){r(h)}}function o(_,v){var n=new DOMParser,a=n.parseFromString(_,"text/xml"),r=a.getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var t={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},c=Object.keys(t).reduce(function(j,N){return j[N]=r.getAttribute("ttp:"+N)||t[N],j},{}),b=r.getAttribute("xml:space")!=="preserve",h=d(f(r,"styling","style")),D=d(f(r,"layout","region")),P=f(r,"body","[begin]");return[].map.call(P,function(j){var N=A(j,b);if(!N||!j.hasAttribute("begin"))return null;var H=l(j.getAttribute("begin"),c),z=l(j.getAttribute("dur"),c),J=l(j.getAttribute("end"),c);if(H===null)throw C(j);if(J===null){if(z===null)throw C(j);J=H+z}var Y=new k.default(H-v,J-v,N);Y.id=(0,u.generateCueId)(Y.startTime,Y.endTime,Y.text);var le=D[j.getAttribute("region")],te=h[j.getAttribute("style")],Z=s(le,te,h),_e=Z.textAlign;if(_e){var we=x[_e];we&&(Y.lineAlign=we),Y.align=_e}return m(Y,Z),Y}).filter(function(j){return j!==null})}function f(_,v,n){var a=_.getElementsByTagName(v)[0];return a?[].slice.call(a.querySelectorAll(n)):[]}function d(_){return _.reduce(function(v,n){var a=n.getAttribute("xml:id");return a&&(v[a]=n),v},{})}function A(_,v){return[].slice.call(_.childNodes).reduce(function(n,a,r){var t;return a.nodeName==="br"&&r?n+`
`:(t=a.childNodes)!==null&&t!==void 0&&t.length?A(a,v):v?n+a.textContent.trim().replace(/\s+/g," "):n+a.textContent},"")}function s(_,v,n){var a="http://www.w3.org/ns/ttml#styling",r=null,t=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],c=_!=null&&_.hasAttribute("style")?_.getAttribute("style"):null;return c&&n.hasOwnProperty(c)&&(r=n[c]),t.reduce(function(b,h){var D=p(v,a,h)||p(_,a,h)||p(r,a,h);return D&&(b[h]=D),b},{})}function p(_,v,n){return _&&_.hasAttributeNS(v,n)?_.getAttributeNS(v,n):null}function C(_){return new Error("Could not parse ttml timestamp "+_)}function l(_,v){if(!_)return null;var n=(0,e.parseTimeStamp)(_);return n===null&&(g.test(_)?n=T(_,v):w.test(_)&&(n=y(_,v))),n}function T(_,v){var n=g.exec(_),a=(n[4]|0)+(n[5]|0)/v.subFrameRate;return(n[1]|0)*3600+(n[2]|0)*60+(n[3]|0)+a/v.frameRate}function y(_,v){var n=w.exec(_),a=Number(n[1]),r=n[2];switch(r){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/v.frameRate;case"t":return a/v.tickRate}return a}},"./src/utils/keysystem-util.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{changeEndianness:()=>k,convertDataUriToArrayBytes:()=>L,strToUtf8array:()=>I});var W=O("./src/utils/numeric-encoding-utils.ts");function e(u){var m=I(u).subarray(0,16),i=new Uint8Array(16);return i.set(m,16-m.length),i}function k(u){var m=function(g,w,x){var E=g[w];g[w]=g[x],g[x]=E};m(u,0,3),m(u,1,2),m(u,4,5),m(u,6,7)}function L(u){var m=u.split(":"),i=null;if(m[0]==="data"&&m.length===2){var g=m[1].split(";"),w=g[g.length-1].split(",");if(w.length===2){var x=w[0]==="base64",E=w[1];x?(g.splice(-1,1),i=(0,W.base64Decode)(E)):i=e(E)}}return i}function I(u){return Uint8Array.from(unescape(encodeURIComponent(u)),function(m){return m.charCodeAt(0)})}},"./src/utils/logger.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{enableLogs:()=>u,logger:()=>m});var W=function(){},e={trace:W,debug:W,log:W,warn:W,info:W,error:W},k=e;function L(i){var g=self.console[i];return g?g.bind(self.console,"["+i+"] >"):W}function I(i){for(var g=arguments.length,w=new Array(g>1?g-1:0),x=1;x<g;x++)w[x-1]=arguments[x];w.forEach(function(E){k[E]=i[E]?i[E].bind(i):L(E)})}function u(i,g){if(self.console&&i===!0||typeof i=="object"){I(i,"debug","log","info","warn","error");try{k.log('Debug logs enabled for "'+g+'"')}catch(w){k=e}}else k=e}var m=k},"./src/utils/mediakeys-helper.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{KeySystemFormats:()=>e,KeySystemIds:()=>L,KeySystems:()=>W,getKeySystemsForConfig:()=>m,getSupportedMediaKeySystemConfigurations:()=>g,keySystemDomainToKeySystemFormat:()=>u,keySystemFormatToKeySystemDomain:()=>k,keySystemIdToKeySystemDomain:()=>I,requestMediaKeySystemAccess:()=>i});var W;(function(x){x.CLEARKEY="org.w3.clearkey",x.FAIRPLAY="com.apple.fps",x.PLAYREADY="com.microsoft.playready",x.WIDEVINE="com.widevine.alpha"})(W||(W={}));var e;(function(x){x.CLEARKEY="org.w3.clearkey",x.FAIRPLAY="com.apple.streamingkeydelivery",x.PLAYREADY="com.microsoft.playready",x.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"})(e||(e={}));function k(x){switch(x){case e.FAIRPLAY:return W.FAIRPLAY;case e.PLAYREADY:return W.PLAYREADY;case e.WIDEVINE:return W.WIDEVINE;case e.CLEARKEY:return W.CLEARKEY}}var L;(function(x){x.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"})(L||(L={}));function I(x){if(x===L.WIDEVINE)return W.WIDEVINE}function u(x){switch(x){case W.FAIRPLAY:return e.FAIRPLAY;case W.PLAYREADY:return e.PLAYREADY;case W.WIDEVINE:return e.WIDEVINE;case W.CLEARKEY:return e.CLEARKEY}}function m(x){var E=x.drmSystems,o=x.widevineLicenseUrl,f=E?[W.FAIRPLAY,W.WIDEVINE,W.PLAYREADY,W.CLEARKEY].filter(function(d){return!!E[d]}):[];return!f[W.WIDEVINE]&&o&&f.push(W.WIDEVINE),f}var i=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function g(x,E,o,f){var d;switch(x){case W.FAIRPLAY:d=["cenc","sinf"];break;case W.WIDEVINE:case W.PLAYREADY:d=["cenc"];break;case W.CLEARKEY:d=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+x)}return w(d,E,o,f)}function w(x,E,o,f){var d={initDataTypes:x,persistentState:f.persistentState||"not-allowed",distinctiveIdentifier:f.distinctiveIdentifier||"not-allowed",sessionTypes:f.sessionTypes||[f.sessionType||"temporary"],audioCapabilities:E.map(function(A){return{contentType:'audio/mp4; codecs="'+A+'"',robustness:f.audioRobustness||"",encryptionScheme:f.audioEncryptionScheme||null}}),videoCapabilities:o.map(function(A){return{contentType:'video/mp4; codecs="'+A+'"',robustness:f.videoRobustness||"",encryptionScheme:f.videoEncryptionScheme||null}})};return[d]}},"./src/utils/mediasource-helper.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{getMediaSource:()=>W});function W(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{RemuxerTrackIdConfig:()=>i,appendUint8Array:()=>v,bin2str:()=>g,computeRawDurationFromSamples:()=>T,discardEPB:()=>c,findBox:()=>f,getDuration:()=>l,getStartDTS:()=>C,mp4Box:()=>h,mp4pssh:()=>D,offsetStartDTS:()=>y,parseEmsg:()=>b,parseInitSegment:()=>A,parsePssh:()=>P,parseSEIMessageFromNALu:()=>t,parseSamples:()=>n,parseSegmentIndex:()=>d,parseSinf:()=>p,patchEncyptionData:()=>s,readSint32:()=>E,readUint16:()=>w,readUint32:()=>x,segmentValidRange:()=>_,writeUint32:()=>o});var W=O("./src/loader/fragment.ts"),e=O("./src/utils/typed-array.ts"),k=O("./src/demux/id3.ts"),L=O("./src/utils/logger.ts"),I=O("./src/utils/hex.ts"),u=Math.pow(2,32)-1,m=[].push,i={video:1,audio:2,id3:3,text:4};function g(j){return String.fromCharCode.apply(null,j)}function w(j,N){var H=j[N]<<8|j[N+1];return H<0?65536+H:H}function x(j,N){var H=E(j,N);return H<0?4294967296+H:H}function E(j,N){return j[N]<<24|j[N+1]<<16|j[N+2]<<8|j[N+3]}function o(j,N,H){j[N]=H>>24,j[N+1]=H>>16&255,j[N+2]=H>>8&255,j[N+3]=H&255}function f(j,N){var H=[];if(!N.length)return H;for(var z=j.byteLength,J=0;J<z;){var Y=x(j,J),le=g(j.subarray(J+4,J+8)),te=Y>1?J+Y:z;if(le===N[0])if(N.length===1)H.push(j.subarray(J+8,te));else{var Z=f(j.subarray(J+8,te),N.slice(1));Z.length&&m.apply(H,Z)}J=te}return H}function d(j){var N=[],H=j[0],z=8,J=x(j,z);z+=4;var Y=0,le=0;H===0?z+=8:z+=16,z+=2;var te=j.length+le,Z=w(j,z);z+=2;for(var _e=0;_e<Z;_e++){var we=z,De=x(j,we);we+=4;var Ee=De&2147483647,xe=(De&2147483648)>>>31;if(xe===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ve=x(j,we);we+=4,N.push({referenceSize:Ee,subsegmentDuration:ve,info:{duration:ve/J,start:te,end:te+Ee-1}}),te+=Ee,we+=4,z=we}return{earliestPresentationTime:Y,timescale:J,version:H,referencesCount:Z,references:N}}function A(j){for(var N=[],H=f(j,["moov","trak"]),z=0;z<H.length;z++){var J=H[z],Y=f(J,["tkhd"])[0];if(Y){var le=Y[0],te=le===0?12:20,Z=x(Y,te),_e=f(J,["mdia","mdhd"])[0];if(_e){le=_e[0],te=le===0?12:20;var we=x(_e,te),De=f(J,["mdia","hdlr"])[0];if(De){var Ee=g(De.subarray(8,12)),xe={soun:W.ElementaryStreamTypes.AUDIO,vide:W.ElementaryStreamTypes.VIDEO}[Ee];if(xe){var ve=f(J,["mdia","minf","stbl","stsd"])[0],X=void 0;ve&&(X=g(ve.subarray(12,16))),N[Z]={timescale:we,type:xe},N[xe]={timescale:we,id:Z,codec:X}}}}}}var Ae=f(j,["moov","mvex","trex"]);return Ae.forEach(function(Q){var ue=x(Q,4),ee=N[ue];ee&&(ee.default={duration:x(Q,12),flags:x(Q,20)})}),N}function s(j,N){if(!j||!N)return j;var H=N.keyId;if(H&&N.isCommonEncryption){var z=f(j,["moov","trak"]);z.forEach(function(J){var Y=f(J,["mdia","minf","stbl","stsd"])[0],le=Y.subarray(8),te=f(le,["enca"]),Z=te.length>0;Z||(te=f(le,["encv"])),te.forEach(function(_e){var we=Z?_e.subarray(28):_e.subarray(78),De=f(we,["sinf"]);De.forEach(function(Ee){var xe=p(Ee);if(xe){var ve=xe.subarray(8,24);ve.some(function(X){return X!==0})||(L.logger.log("[eme] Patching keyId in 'enc"+(Z?"a":"v")+">sinf>>tenc' box: "+I.default.hexDump(ve)+" -> "+I.default.hexDump(H)),xe.set(H,8))}})})})}return j}function p(j){var N=f(j,["schm"])[0];if(N){var H=g(N.subarray(4,8));if(H==="cbcs"||H==="cenc")return f(j,["schi","tenc"])[0]}return L.logger.error("[eme] missing 'schm' box"),null}function C(j,N){return f(N,["moof","traf"]).reduce(function(H,z){var J=f(z,["tfdt"])[0],Y=J[0],le=f(z,["tfhd"]).reduce(function(te,Z){var _e=x(Z,4),we=j[_e];if(we){var De=x(J,4);Y===1&&(De*=Math.pow(2,32),De+=x(J,8));var Ee=we.timescale||9e4,xe=De/Ee;if(isFinite(xe)&&(te===null||xe<te))return xe}return te},null);return le!==null&&isFinite(le)&&(H===null||le<H)?le:H},null)||0}function l(j,N){for(var H=0,z=0,J=0,Y=f(j,["moof","traf"]),le=0;le<Y.length;le++){var te=Y[le],Z=f(te,["tfhd"])[0],_e=x(Z,4),we=N[_e];if(!we)continue;var De=we.default,Ee=x(Z,0)|(De==null?void 0:De.flags),xe=De==null?void 0:De.duration;Ee&8&&(Ee&2?xe=x(Z,12):xe=x(Z,8));for(var ve=we.timescale||9e4,X=f(te,["trun"]),Ae=0;Ae<X.length;Ae++){if(H=T(X[Ae]),!H&&xe){var Q=x(X[Ae],4);H=xe*Q}we.type===W.ElementaryStreamTypes.VIDEO?z+=H/ve:we.type===W.ElementaryStreamTypes.AUDIO&&(J+=H/ve)}}if(z===0&&J===0){for(var ue=0,ee=f(j,["sidx"]),ae=0;ae<ee.length;ae++){var fe=d(ee[ae]);fe!=null&&fe.references&&(ue+=fe.references.reduce(function(Re,pe){return Re+pe.info.duration||0},0))}return ue}return z||J}function T(j){var N=x(j,0),H=8;N&1&&(H+=4),N&4&&(H+=4);for(var z=0,J=x(j,4),Y=0;Y<J;Y++){if(N&256){var le=x(j,H);z+=le,H+=4}N&512&&(H+=4),N&1024&&(H+=4),N&2048&&(H+=4)}return z}function y(j,N,H){f(N,["moof","traf"]).forEach(function(z){f(z,["tfhd"]).forEach(function(J){var Y=x(J,4),le=j[Y];if(!le)return;var te=le.timescale||9e4;f(z,["tfdt"]).forEach(function(Z){var _e=Z[0],we=x(Z,4);if(_e===0)we-=H*te,we=Math.max(we,0),o(Z,4,we);else{we*=Math.pow(2,32),we+=x(Z,8),we-=H*te,we=Math.max(we,0);var De=Math.floor(we/(u+1)),Ee=Math.floor(we%(u+1));o(Z,4,De),o(Z,8,Ee)}})})})}function _(j){var N={valid:null,remainder:null},H=f(j,["moof"]);if(H){if(H.length<2)return N.remainder=j,N}else return N;var z=H[H.length-1];return N.valid=(0,e.sliceUint8)(j,0,z.byteOffset-8),N.remainder=(0,e.sliceUint8)(j,z.byteOffset-8),N}function v(j,N){var H=new Uint8Array(j.length+N.length);return H.set(j),H.set(N,j.length),H}function n(j,N){var H=[],z=N.samples,J=N.timescale,Y=N.id,le=!1,te=f(z,["moof"]);return te.map(function(Z){var _e=Z.byteOffset-8,we=f(Z,["traf"]);we.map(function(De){var Ee=f(De,["tfdt"]).map(function(xe){var ve=xe[0],X=x(xe,4);return ve===1&&(X*=Math.pow(2,32),X+=x(xe,8)),X/J})[0];return Ee!==void 0&&(j=Ee),f(De,["tfhd"]).map(function(xe){var ve=x(xe,4),X=x(xe,0)&16777215,Ae=(X&1)!==0,Q=(X&2)!==0,ue=(X&8)!==0,ee=0,ae=(X&16)!==0,fe=0,Re=(X&32)!==0,pe=8;ve===Y&&(Ae&&(pe+=8),Q&&(pe+=4),ue&&(ee=x(xe,pe),pe+=4),ae&&(fe=x(xe,pe),pe+=4),Re&&(pe+=4),N.type==="video"&&(le=a(N.codec)),f(De,["trun"]).map(function(ie){var Ie=ie[0],Oe=x(ie,0)&16777215,Ne=(Oe&1)!==0,Le=0,Ce=(Oe&4)!==0,Ue=(Oe&256)!==0,Te=0,Pe=(Oe&512)!==0,q=0,se=(Oe&1024)!==0,he=(Oe&2048)!==0,V=0,$=x(ie,4),re=8;Ne&&(Le=x(ie,re),re+=4),Ce&&(re+=4);for(var oe=Le+_e,Se=0;Se<$;Se++){if(Ue?(Te=x(ie,re),re+=4):Te=ee,Pe?(q=x(ie,re),re+=4):q=fe,se&&(re+=4),he&&(Ie===0?V=x(ie,re):V=E(ie,re),re+=4),N.type===W.ElementaryStreamTypes.VIDEO)for(var Me=0;Me<q;){var Be=x(z,oe);if(oe+=4,r(le,z[oe])){var Ke=z.subarray(oe,oe+Be);t(Ke,le?2:1,j+V/J,H)}oe+=Be,Me+=Be+4}j+=Te/J}}))})})}),H}function a(j){if(!j)return!1;var N=j.indexOf("."),H=N<0?j:j.substring(0,N);return H==="hvc1"||H==="hev1"||H==="dvh1"||H==="dvhe"}function r(j,N){if(j){var H=N>>1&63;return H===39||H===40}else{var z=N&31;return z===6}}function t(j,N,H,z){var J=c(j),Y=0;Y+=N;for(var le=0,te=0,Z=!1,_e=0;Y<J.length;){le=0;do{if(Y>=J.length)break;_e=J[Y++],le+=_e}while(_e===255);te=0;do{if(Y>=J.length)break;_e=J[Y++],te+=_e}while(_e===255);var we=J.length-Y;if(!Z&&le===4&&Y<J.length){Z=!0;var De=J[Y++];if(De===181){var Ee=w(J,Y);if(Y+=2,Ee===49){var xe=x(J,Y);if(Y+=4,xe===1195456820){var ve=J[Y++];if(ve===3){var X=J[Y++],Ae=31&X,Q=64&X,ue=Q?2+Ae*3:0,ee=new Uint8Array(ue);if(Q){ee[0]=X;for(var ae=1;ae<ue;ae++)ee[ae]=J[Y++]}z.push({type:ve,payloadType:le,pts:H,bytes:ee})}}}}}else if(le===5&&te<we){if(Z=!0,te>16){for(var fe=[],Re=0;Re<16;Re++){var pe=J[Y++].toString(16);fe.push(pe.length==1?"0"+pe:pe),(Re===3||Re===5||Re===7||Re===9)&&fe.push("-")}for(var ie=te-16,Ie=new Uint8Array(ie),Oe=0;Oe<ie;Oe++)Ie[Oe]=J[Y++];z.push({payloadType:le,pts:H,uuid:fe.join(""),userData:(0,k.utf8ArrayToStr)(Ie),userDataBytes:Ie})}}else if(te<we)Y+=te;else if(te>we)break}}function c(j){for(var N=j.byteLength,H=[],z=1;z<N-2;)j[z]===0&&j[z+1]===0&&j[z+2]===3?(H.push(z+2),z+=2):z++;if(H.length===0)return j;var J=N-H.length,Y=new Uint8Array(J),le=0;for(z=0;z<J;le++,z++)le===H[0]&&(le++,H.shift()),Y[z]=j[le];return Y}function b(j){var N=j[0],H="",z="",J=0,Y=0,le=0,te=0,Z=0,_e=0;if(N===0){for(;g(j.subarray(_e,_e+1))!=="\0";)H+=g(j.subarray(_e,_e+1)),_e+=1;for(H+=g(j.subarray(_e,_e+1)),_e+=1;g(j.subarray(_e,_e+1))!=="\0";)z+=g(j.subarray(_e,_e+1)),_e+=1;z+=g(j.subarray(_e,_e+1)),_e+=1,J=x(j,12),Y=x(j,16),te=x(j,20),Z=x(j,24),_e=28}else if(N===1){_e+=4,J=x(j,_e),_e+=4;var we=x(j,_e);_e+=4;var De=x(j,_e);for(_e+=4,le=Math.pow(2,32)*we+De,Number.isSafeInteger(le)||(le=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),te=x(j,_e),_e+=4,Z=x(j,_e),_e+=4;g(j.subarray(_e,_e+1))!=="\0";)H+=g(j.subarray(_e,_e+1)),_e+=1;for(H+=g(j.subarray(_e,_e+1)),_e+=1;g(j.subarray(_e,_e+1))!=="\0";)z+=g(j.subarray(_e,_e+1)),_e+=1;z+=g(j.subarray(_e,_e+1)),_e+=1}var Ee=j.subarray(_e,j.byteLength);return{schemeIdUri:H,value:z,timeScale:J,presentationTime:le,presentationTimeDelta:Y,eventDuration:te,id:Z,payload:Ee}}function h(j){for(var N=arguments.length,H=new Array(N>1?N-1:0),z=1;z<N;z++)H[z-1]=arguments[z];for(var J=H.length,Y=8,le=J;le--;)Y+=H[le].byteLength;var te=new Uint8Array(Y);for(te[0]=Y>>24&255,te[1]=Y>>16&255,te[2]=Y>>8&255,te[3]=Y&255,te.set(j,4),le=0,Y=8;le<J;le++)te.set(H[le],Y),Y+=H[le].byteLength;return te}function D(j,N,H){if(j.byteLength!==16)throw new RangeError("Invalid system id");var z,J;if(N){z=1,J=new Uint8Array(N.length*16);for(var Y=0;Y<N.length;Y++){var le=N[Y];if(le.byteLength!==16)throw new RangeError("Invalid key");J.set(le,Y*16)}}else z=0,J=new Uint8Array;var te;z>0?(te=new Uint8Array(4),N.length>0&&new DataView(te.buffer).setUint32(0,N.length,!1)):te=new Uint8Array;var Z=new Uint8Array(4);return H&&H.byteLength>0&&new DataView(Z.buffer).setUint32(0,H.byteLength,!1),h([112,115,115,104],new Uint8Array([z,0,0,0]),j,te,J,Z,H||new Uint8Array)}function P(j){if(!(j instanceof ArrayBuffer)||j.byteLength<32)return null;var N={version:0,systemId:"",kids:null,data:null},H=new DataView(j),z=H.getUint32(0);if(j.byteLength!==z&&z>44)return null;var J=H.getUint32(4);if(J!==1886614376)return null;if(N.version=H.getUint32(8)>>>24,N.version>1)return null;N.systemId=I.default.hexDump(new Uint8Array(j,12,16));var Y=H.getUint32(28);if(N.version===0){if(z-32<Y)return null;N.data=new Uint8Array(j,32,Y)}else if(N.version===1){N.kids=[];for(var le=0;le<Y;le++)N.kids.push(new Uint8Array(j,32+le*16,16))}return N}},"./src/utils/numeric-encoding-utils.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{base64Decode:()=>u,base64DecodeToStr:()=>k,base64Encode:()=>L,base64ToBase64Url:()=>W,base64UrlEncode:()=>I,strToBase64Encode:()=>e});function W(m){return m.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function e(m){return btoa(m)}function k(m){return atob(m)}function L(m){return btoa(String.fromCharCode.apply(String,m))}function I(m){return W(L(m))}function u(m){return Uint8Array.from(atob(m),function(i){return i.charCodeAt(0)})}},"./src/utils/output-filter.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>W});var W=function(){function e(L,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=L,this.trackName=I}var k=e.prototype;return k.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},k.newCue=function(I,u,m){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=u,this.screen=m,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[],this.startTime=null},e}()},"./src/utils/texttrack-utils.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{addCueToTrack:()=>k,clearCurrentCues:()=>L,getCuesInRange:()=>m,removeCuesInRange:()=>I,sendAddTrackEvent:()=>e});var W=O("./src/utils/logger.ts");function e(i,g){var w;try{w=new Event("addtrack")}catch(x){w=document.createEvent("Event"),w.initEvent("addtrack",!1,!1)}w.track=i,g.dispatchEvent(w)}function k(i,g){var w=i.mode;if(w==="disabled"&&(i.mode="hidden"),i.cues&&!i.cues.getCueById(g.id))try{if(i.addCue(g),!i.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(E){W.logger.debug("[texttrack-utils]: "+E);var x=new self.TextTrackCue(g.startTime,g.endTime,g.text);x.id=g.id,i.addCue(x)}w==="disabled"&&(i.mode=w)}function L(i){var g=i.mode;if(g==="disabled"&&(i.mode="hidden"),i.cues)for(var w=i.cues.length;w--;)i.removeCue(i.cues[w]);g==="disabled"&&(i.mode=g)}function I(i,g,w,x){var E=i.mode;if(E==="disabled"&&(i.mode="hidden"),i.cues&&i.cues.length>0)for(var o=m(i.cues,g,w),f=0;f<o.length;f++)(!x||x(o[f]))&&i.removeCue(o[f]);E==="disabled"&&(i.mode=E)}function u(i,g){if(g<i[0].startTime)return 0;var w=i.length-1;if(g>i[w].endTime)return-1;for(var x=0,E=w;x<=E;){var o=Math.floor((E+x)/2);if(g<i[o].startTime)E=o-1;else if(g>i[o].startTime&&x<w)x=o+1;else return o}return i[x].startTime-g<g-i[E].startTime?x:E}function m(i,g,w){var x=[],E=u(i,g);if(E>-1)for(var o=E,f=i.length;o<f;o++){var d=i[o];if(d.startTime>=g&&d.endTime<=w)x.push(d);else if(d.startTime>w)return x}return x}},"./src/utils/time-ranges.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>e});var W={toString:function(L){for(var I="",u=L.length,m=0;m<u;m++)I+="["+L.start(m).toFixed(3)+"-"+L.end(m).toFixed(3)+"]";return I}};const e=W},"./src/utils/timescale-conversion.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{toMpegTsClockFromTimescale:()=>I,toMsFromMpegTsClock:()=>L,toTimescaleFromBase:()=>e,toTimescaleFromScale:()=>k});var W=9e4;function e(u,m,i,g){i===void 0&&(i=1),g===void 0&&(g=!1);var w=u*m*i;return g?Math.round(w):w}function k(u,m,i,g){return i===void 0&&(i=1),g===void 0&&(g=!1),e(u,m,1/i,g)}function L(u,m){return m===void 0&&(m=!1),e(u,1e3,1/W,m)}function I(u,m){return m===void 0&&(m=1),e(u,W,1/m)}},"./src/utils/typed-array.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{sliceUint8:()=>W});function W(e,k,L){return Uint8Array.prototype.slice?e.slice(k,L):new Uint8Array(Array.prototype.slice.call(e,k,L))}},"./src/utils/vttcue.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>W});const W=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],k=["start","middle","end","left","right"];function L(g,w){if(typeof w!="string")return!1;if(!Array.isArray(g))return!1;var x=w.toLowerCase();return~g.indexOf(x)?x:!1}function I(g){return L(e,g)}function u(g){return L(k,g)}function m(g){for(var w=arguments.length,x=new Array(w>1?w-1:0),E=1;E<w;E++)x[E-1]=arguments[E];for(var o=1;o<arguments.length;o++){var f=arguments[o];for(var d in f)g[d]=f[d]}return g}function i(g,w,x){var E=this,o={enumerable:!0};E.hasBeenReset=!1;var f="",d=!1,A=g,s=w,p=x,C=null,l="",T=!0,y="auto",_="start",v=50,n="middle",a=50,r="middle";Object.defineProperty(E,"id",m({},o,{get:function(){return f},set:function(c){f=""+c}})),Object.defineProperty(E,"pauseOnExit",m({},o,{get:function(){return d},set:function(c){d=!!c}})),Object.defineProperty(E,"startTime",m({},o,{get:function(){return A},set:function(c){if(typeof c!="number")throw new TypeError("Start time must be set to a number.");A=c,this.hasBeenReset=!0}})),Object.defineProperty(E,"endTime",m({},o,{get:function(){return s},set:function(c){if(typeof c!="number")throw new TypeError("End time must be set to a number.");s=c,this.hasBeenReset=!0}})),Object.defineProperty(E,"text",m({},o,{get:function(){return p},set:function(c){p=""+c,this.hasBeenReset=!0}})),Object.defineProperty(E,"region",m({},o,{get:function(){return C},set:function(c){C=c,this.hasBeenReset=!0}})),Object.defineProperty(E,"vertical",m({},o,{get:function(){return l},set:function(c){var b=I(c);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");l=b,this.hasBeenReset=!0}})),Object.defineProperty(E,"snapToLines",m({},o,{get:function(){return T},set:function(c){T=!!c,this.hasBeenReset=!0}})),Object.defineProperty(E,"line",m({},o,{get:function(){return y},set:function(c){if(typeof c!="number"&&c!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");y=c,this.hasBeenReset=!0}})),Object.defineProperty(E,"lineAlign",m({},o,{get:function(){return _},set:function(c){var b=u(c);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(E,"position",m({},o,{get:function(){return v},set:function(c){if(c<0||c>100)throw new Error("Position must be between 0 and 100.");v=c,this.hasBeenReset=!0}})),Object.defineProperty(E,"positionAlign",m({},o,{get:function(){return n},set:function(c){var b=u(c);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");n=b,this.hasBeenReset=!0}})),Object.defineProperty(E,"size",m({},o,{get:function(){return a},set:function(c){if(c<0||c>100)throw new Error("Size must be between 0 and 100.");a=c,this.hasBeenReset=!0}})),Object.defineProperty(E,"align",m({},o,{get:function(){return r},set:function(c){var b=u(c);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");r=b,this.hasBeenReset=!0}})),E.displayState=void 0}return i.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},i}()},"./src/utils/vttparser.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{VTTParser:()=>w,fixLineBreaks:()=>g,parseTimeStamp:()=>k});var W=O("./src/utils/vttcue.ts"),e=function(){function x(){}var E=x.prototype;return E.decode=function(f,d){if(!f)return"";if(typeof f!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(f))},x}();function k(x){function E(f,d,A,s){return(f|0)*3600+(d|0)*60+(A|0)+parseFloat(s||0)}var o=x.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?E(o[2],o[3],0,o[4]):E(o[1],o[2],o[3],o[4]):null}var L=function(){function x(){this.values=Object.create(null)}var E=x.prototype;return E.set=function(f,d){!this.get(f)&&d!==""&&(this.values[f]=d)},E.get=function(f,d,A){return A?this.has(f)?this.values[f]:d[A]:this.has(f)?this.values[f]:d},E.has=function(f){return f in this.values},E.alt=function(f,d,A){for(var s=0;s<A.length;++s)if(d===A[s]){this.set(f,d);break}},E.integer=function(f,d){/^-?\d+$/.test(d)&&this.set(f,parseInt(d,10))},E.percent=function(f,d){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(d)){var A=parseFloat(d);if(A>=0&&A<=100)return this.set(f,A),!0}return!1},x}();function I(x,E,o,f){var d=f?x.split(f):[x];for(var A in d){if(typeof d[A]!="string")continue;var s=d[A].split(o);if(s.length!==2)continue;var p=s[0],C=s[1];E(p,C)}}var u=new W.default(0,0,""),m=u.align==="middle"?"middle":"center";function i(x,E,o){var f=x;function d(){var p=k(x);if(p===null)throw new Error("Malformed timestamp: "+f);return x=x.replace(/^[^\sa-zA-Z-]+/,""),p}function A(p,C){var l=new L;I(p,function(_,v){var n;switch(_){case"region":for(var a=o.length-1;a>=0;a--)if(o[a].id===v){l.set(_,o[a].region);break}break;case"vertical":l.alt(_,v,["rl","lr"]);break;case"line":n=v.split(","),l.integer(_,n[0]),l.percent(_,n[0])&&l.set("snapToLines",!1),l.alt(_,n[0],["auto"]),n.length===2&&l.alt("lineAlign",n[1],["start",m,"end"]);break;case"position":n=v.split(","),l.percent(_,n[0]),n.length===2&&l.alt("positionAlign",n[1],["start",m,"end","line-left","line-right","auto"]);break;case"size":l.percent(_,v);break;case"align":l.alt(_,v,["start",m,"end","left","right"]);break}},/:/,/\s/),C.region=l.get("region",null),C.vertical=l.get("vertical","");var T=l.get("line","auto");T==="auto"&&u.line===-1&&(T=-1),C.line=T,C.lineAlign=l.get("lineAlign","start"),C.snapToLines=l.get("snapToLines",!0),C.size=l.get("size",100),C.align=l.get("align",m);var y=l.get("position","auto");y==="auto"&&u.position===50&&(y=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=y}function s(){x=x.replace(/^\s+/,"")}if(s(),E.startTime=d(),s(),x.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+f);x=x.slice(3),s(),E.endTime=d(),s(),A(x,E)}function g(x){return x.replace(/<br(?: \/)?>/gi,`
`)}var w=function(){function x(){this.state="INITIAL",this.buffer="",this.decoder=new e,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var E=x.prototype;return E.parse=function(f){var d=this;f&&(d.buffer+=d.decoder.decode(f,{stream:!0}));function A(){var y=d.buffer,_=0;for(y=g(y);_<y.length&&y[_]!=="\r"&&y[_]!==`
`;)++_;var v=y.slice(0,_);return y[_]==="\r"&&++_,y[_]===`
`&&++_,d.buffer=y.slice(_),v}function s(y){I(y,function(_,v){},/:/)}try{var p="";if(d.state==="INITIAL"){if(!/\r\n|\n/.test(d.buffer))return this;p=A();var C=p.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");d.state="HEADER"}for(var l=!1;d.buffer;){if(!/\r\n|\n/.test(d.buffer))return this;l?l=!1:p=A();switch(d.state){case"HEADER":/:/.test(p)?s(p):p||(d.state="ID");continue;case"NOTE":p||(d.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(p)){d.state="NOTE";break}if(!p)continue;if(d.cue=new W.default(0,0,""),d.state="CUE",p.indexOf("-->")===-1){d.cue.id=p;continue}case"CUE":if(!d.cue){d.state="BADCUE";continue}try{i(p,d.cue,d.regionList)}catch(y){d.cue=null,d.state="BADCUE";continue}d.state="CUETEXT";continue;case"CUETEXT":{var T=p.indexOf("-->")!==-1;if(!p||T&&(l=!0)){d.oncue&&d.cue&&d.oncue(d.cue),d.cue=null,d.state="ID";continue}if(d.cue===null)continue;d.cue.text&&(d.cue.text+=`
`),d.cue.text+=p}continue;case"BADCUE":p||(d.state="ID")}}}catch(y){d.state==="CUETEXT"&&d.cue&&d.oncue&&d.oncue(d.cue),d.cue=null,d.state=d.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},E.flush=function(){var f=this;try{if((f.cue||f.state==="HEADER")&&(f.buffer+=`
`,f.parse()),f.state==="INITIAL"||f.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(d){f.onparsingerror&&f.onparsingerror(d)}return f.onflush&&f.onflush(),this},x}()},"./src/utils/webvtt-parser.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{generateCueId:()=>w,parseWebVTT:()=>E});var W=O("./src/polyfills/number.ts"),e=O("./src/utils/vttparser.ts"),k=O("./src/demux/id3.ts"),L=O("./src/utils/timescale-conversion.ts"),I=O("./src/remux/mp4-remuxer.ts"),u=/\r\n|\n\r|\n|\r/g,m=function(f,d,A){return A===void 0&&(A=0),f.slice(A,A+d.length)===d},i=function(f){var d=parseInt(f.slice(-3)),A=parseInt(f.slice(-6,-4)),s=parseInt(f.slice(-9,-7)),p=f.length>9?parseInt(f.substring(0,f.indexOf(":"))):0;if(!(0,W.isFiniteNumber)(d)||!(0,W.isFiniteNumber)(A)||!(0,W.isFiniteNumber)(s)||!(0,W.isFiniteNumber)(p))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+f);return d+=1e3*A,d+=60*1e3*s,d+=60*60*1e3*p,d},g=function(f){for(var d=5381,A=f.length;A;)d=d*33^f.charCodeAt(--A);return(d>>>0).toString()};function w(o,f,d){return g(o.toString())+g(f.toString())+g(d)}var x=function(f,d,A){var s=f[d],p=f[s.prevCC];if(!p||!p.new&&s.new){f.ccOffset=f.presentationOffset=s.start,s.new=!1;return}for(;(C=p)!==null&&C!==void 0&&C.new;){var C;f.ccOffset+=s.start-p.start,s.new=!1,s=p,p=f[s.prevCC]}f.presentationOffset=A};function E(o,f,d,A,s,p,C,l){var T=new e.VTTParser,y=(0,k.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(u,`
`).split(`
`),_=[],v=(0,L.toMpegTsClockFromTimescale)(f,d),n="00:00.000",a=0,r=0,t,c=!0;T.oncue=function(b){var h=A[s],D=A.ccOffset,P=(a-v)/9e4;h!=null&&h.new&&(r!==void 0?D=A.ccOffset=h.start:x(A,s,P)),P&&(D=P-A.presentationOffset);var j=b.endTime-b.startTime,N=(0,I.normalizePts)((b.startTime+D-r)*9e4,p*9e4)/9e4;b.startTime=Math.max(N,0),b.endTime=Math.max(N+j,0);var H=b.text.trim();b.text=decodeURIComponent(encodeURIComponent(H)),b.id||(b.id=w(b.startTime,b.endTime,H)),b.endTime>0&&_.push(b)},T.onparsingerror=function(b){t=b},T.onflush=function(){if(t){l(t);return}C(_)},y.forEach(function(b){if(c)if(m(b,"X-TIMESTAMP-MAP=")){c=!1,b.slice(16).split(",").forEach(function(h){m(h,"LOCAL:")?n=h.slice(6):m(h,"MPEGTS:")&&(a=parseInt(h.slice(7)))});try{r=i(n)/1e3}catch(h){t=h}return}else b===""&&(c=!1);T.parse(b+`
`)}),T.flush()}},"./src/utils/xhr-loader.ts":(ne,G,O)=>{"use strict";O.r(G),O.d(G,{default:()=>I});var W=O("./src/utils/logger.ts"),e=O("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,L=function(){function u(i){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=i?i.xhrSetup:null,this.stats=new e.LoadStats,this.retryDelay=0}var m=u.prototype;return m.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},m.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()))},m.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},m.load=function(g,w,x){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=w,this.callbacks=x,this.retryDelay=w.retryDelay,this.loadInternal()},m.loadInternal=function(){var g=this.config,w=this.context;if(!g)return;var x=this.loader=new self.XMLHttpRequest,E=this.stats;E.loading.first=0,E.loaded=0;var o=this.xhrSetup;try{if(o)try{o(x,w.url)}catch(A){x.open("GET",w.url,!0),o(x,w.url)}x.readyState||x.open("GET",w.url,!0);var f=this.context.headers;if(f)for(var d in f)x.setRequestHeader(d,f[d])}catch(A){this.callbacks.onError({code:x.status,text:A.message},w,x);return}w.rangeEnd&&x.setRequestHeader("Range","bytes="+w.rangeStart+"-"+(w.rangeEnd-1)),x.onreadystatechange=this.readystatechange.bind(this),x.onprogress=this.loadprogress.bind(this),x.responseType=w.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),x.send()},m.readystatechange=function(){var g=this.context,w=this.loader,x=this.stats;if(!g||!w)return;var E=w.readyState,o=this.config;if(x.aborted)return;if(E>=2)if(self.clearTimeout(this.requestTimeout),x.loading.first===0&&(x.loading.first=Math.max(self.performance.now(),x.loading.start)),E===4){w.onreadystatechange=null,w.onprogress=null;var f=w.status,d=w.responseType==="arraybuffer";if(f>=200&&f<300&&(d&&w.response||w.responseText!==null)){x.loading.end=Math.max(self.performance.now(),x.loading.first);var A,s;if(d?(A=w.response,s=A.byteLength):(A=w.responseText,s=A.length),x.loaded=x.total=s,!this.callbacks)return;var p=this.callbacks.onProgress;if(p&&p(x,g,A,w),!this.callbacks)return;var C={url:w.responseURL,data:A};this.callbacks.onSuccess(C,x,g,w)}else x.retry>=o.maxRetry||f>=400&&f<499?(W.logger.error(f+" while loading "+g.url),this.callbacks.onError({code:f,text:w.statusText},g,w)):(W.logger.warn(f+" 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,o.maxRetryDelay),x.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},m.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))},m.loadprogress=function(g){var w=this.stats;w.loaded=g.loaded,g.lengthComputable&&(w.total=g.total)},m.getCacheAge=function(){var g=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var w=this.loader.getResponseHeader("age");g=w?parseFloat(w):null}return g},u}();const I=L},"./node_modules/eventemitter3/index.js":ne=>{"use strict";var G=Object.prototype.hasOwnProperty,O="~";function W(){}Object.create&&(W.prototype=Object.create(null),new W().__proto__||(O=!1));function e(u,m,i){this.fn=u,this.context=m,this.once=i||!1}function k(u,m,i,g,w){if(typeof i!="function")throw new TypeError("The listener must be a function");var x=new e(i,g||u,w),E=O?O+m:m;return u._events[E]?u._events[E].fn?u._events[E]=[u._events[E],x]:u._events[E].push(x):(u._events[E]=x,u._eventsCount++),u}function L(u,m){--u._eventsCount===0?u._events=new W:delete u._events[m]}function I(){this._events=new W,this._eventsCount=0}I.prototype.eventNames=function(){var m=[],i,g;if(this._eventsCount===0)return m;for(g in i=this._events)G.call(i,g)&&m.push(O?g.slice(1):g);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(i)):m},I.prototype.listeners=function(m){var i=O?O+m:m,g=this._events[i];if(!g)return[];if(g.fn)return[g.fn];for(var w=0,x=g.length,E=new Array(x);w<x;w++)E[w]=g[w].fn;return E},I.prototype.listenerCount=function(m){var i=O?O+m:m,g=this._events[i];return g?g.fn?1:g.length:0},I.prototype.emit=function(m,i,g,w,x,E){var o=O?O+m:m;if(!this._events[o])return!1;var f=this._events[o],d=arguments.length,A,s;if(f.fn){f.once&&this.removeListener(m,f.fn,void 0,!0);switch(d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,i),!0;case 3:return f.fn.call(f.context,i,g),!0;case 4:return f.fn.call(f.context,i,g,w),!0;case 5:return f.fn.call(f.context,i,g,w,x),!0;case 6:return f.fn.call(f.context,i,g,w,x,E),!0}for(s=1,A=new Array(d-1);s<d;s++)A[s-1]=arguments[s];f.fn.apply(f.context,A)}else{var p=f.length,C;for(s=0;s<p;s++){f[s].once&&this.removeListener(m,f[s].fn,void 0,!0);switch(d){case 1:f[s].fn.call(f[s].context);break;case 2:f[s].fn.call(f[s].context,i);break;case 3:f[s].fn.call(f[s].context,i,g);break;case 4:f[s].fn.call(f[s].context,i,g,w);break;default:if(!A)for(C=1,A=new Array(d-1);C<d;C++)A[C-1]=arguments[C];f[s].fn.apply(f[s].context,A)}}}return!0},I.prototype.on=function(m,i,g){return k(this,m,i,g,!1)},I.prototype.once=function(m,i,g){return k(this,m,i,g,!0)},I.prototype.removeListener=function(m,i,g,w){var x=O?O+m:m;if(!this._events[x])return this;if(!i)return L(this,x),this;var E=this._events[x];if(E.fn)E.fn===i&&(!w||E.once)&&(!g||E.context===g)&&L(this,x);else{for(var o=0,f=[],d=E.length;o<d;o++)(E[o].fn!==i||w&&!E[o].once||g&&E[o].context!==g)&&f.push(E[o]);f.length?this._events[x]=f.length===1?f[0]:f:L(this,x)}return this},I.prototype.removeAllListeners=function(m){var i;return m?(i=O?O+m:m,this._events[i]&&L(this,i)):(this._events=new W,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=O,I.EventEmitter=I,ne.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne){(function(G){var O=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,W=/^(?=([^\/?#]*))\1([^]*)$/,e=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,L={buildAbsoluteURL:function(I,u,m){if(m=m||{},I=I.trim(),u=u.trim(),!u){if(!m.alwaysNormalize)return I;var i=L.parseURL(I);if(!i)throw new Error("Error trying to parse base URL.");return i.path=L.normalizePath(i.path),L.buildURLFromParts(i)}var g=L.parseURL(u);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return m.alwaysNormalize?(g.path=L.normalizePath(g.path),L.buildURLFromParts(g)):u;var w=L.parseURL(I);if(!w)throw new Error("Error trying to parse base URL.");if(!w.netLoc&&w.path&&w.path[0]!=="/"){var x=W.exec(w.path);w.netLoc=x[1],w.path=x[2]}w.netLoc&&!w.path&&(w.path="/");var E={scheme:w.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(E.netLoc=w.netLoc,g.path[0]!=="/"))if(!g.path)E.path=w.path,g.params||(E.params=w.params,g.query||(E.query=w.query));else{var o=w.path,f=o.substring(0,o.lastIndexOf("/")+1)+g.path;E.path=L.normalizePath(f)}return E.path===null&&(E.path=m.alwaysNormalize?L.normalizePath(g.path):g.path),L.buildURLFromParts(E)},parseURL:function(I){var u=O.exec(I);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(e,"");I.length!==(I=I.replace(k,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};ne.exports=L})(this)}},be={};function ye(ne){var G=be[ne];if(G!==void 0)return G.exports;var O=be[ne]={exports:{}};return me[ne].call(O.exports,O,O.exports,ye),O.exports}ye.m=me,(()=>{ye.n=ne=>{var G=ne&&ne.__esModule?()=>ne.default:()=>ne;return ye.d(G,{a:G}),G}})(),(()=>{ye.d=(ne,G)=>{for(var O in G)ye.o(G,O)&&!ye.o(ne,O)&&Object.defineProperty(ne,O,{enumerable:!0,get:G[O]})}})(),(()=>{ye.o=(ne,G)=>Object.prototype.hasOwnProperty.call(ne,G)})(),(()=>{ye.r=ne=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ne,"__esModule",{value:!0})}})();var ge=ye("./src/hls.ts");return ge=ge.default,ge})())},vHTk:function(We,ce,F){We.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vqdp:function(We,ce,F){"use strict";F.d(ce,"a",function(){return O});var me=F("B/uU"),be=F("El5i");function ye(W,e){var k=new Set;return W.forEach(function(L){e.has(L)||k.add(L)}),k}function ge(W){var e=W||{},k=e.disabled,L=e.disableCheckbox,I=e.checkable;return!!(k||L)||I===!1}function ne(W,e,k,L){for(var I=new Set(W),u=new Set,m=0;m<=k;m+=1){var i=e.get(m)||new Set;i.forEach(function(E){var o=E.key,f=E.node,d=E.children,A=d===void 0?[]:d;I.has(o)&&!L(f)&&A.filter(function(s){return!L(s.node)}).forEach(function(s){I.add(s.key)})})}for(var g=new Set,w=k;w>=0;w-=1){var x=e.get(w)||new Set;x.forEach(function(E){var o=E.parent,f=E.node;if(L(f)||!E.parent||g.has(E.parent.key))return;if(L(E.parent.node)){g.add(o.key);return}var d=!0,A=!1;(o.children||[]).filter(function(s){return!L(s.node)}).forEach(function(s){var p=s.key,C=I.has(p);d&&!C&&(d=!1),!A&&(C||u.has(p))&&(A=!0)}),d&&I.add(o.key),A&&u.add(o.key),g.add(o.key)})}return{checkedKeys:Array.from(I),halfCheckedKeys:Array.from(ye(u,I))}}function G(W,e,k,L,I){for(var u=new Set(W),m=new Set(e),i=0;i<=L;i+=1){var g=k.get(i)||new Set;g.forEach(function(o){var f=o.key,d=o.node,A=o.children,s=A===void 0?[]:A;!u.has(f)&&!m.has(f)&&!I(d)&&s.filter(function(p){return!I(p.node)}).forEach(function(p){u.delete(p.key)})})}m=new Set;for(var w=new Set,x=L;x>=0;x-=1){var E=k.get(x)||new Set;E.forEach(function(o){var f=o.parent,d=o.node;if(I(d)||!o.parent||w.has(o.parent.key))return;if(I(o.parent.node)){w.add(f.key);return}var A=!0,s=!1;(f.children||[]).filter(function(p){return!I(p.node)}).forEach(function(p){var C=p.key,l=u.has(C);A&&!l&&(A=!1),!s&&(l||m.has(C))&&(s=!0)}),A||u.delete(f.key),s&&m.add(f.key),w.add(f.key)})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(ye(m,u))}}function O(W,e,k,L){var I=[],u;L?u=L:u=ge;var m=new Set(W.filter(function(x){var E=!!Object(be.a)(k,x);return E||I.push(x),E})),i=new Map,g=0;Object.keys(k).forEach(function(x){var E=k[x],o=E.level,f=i.get(o);f||(f=new Set,i.set(o,f)),f.add(E),g=Math.max(g,o)}),Object(me.a)(!I.length,"Tree missing follow keys: ".concat(I.slice(0,100).map(function(x){return"'".concat(x,"'")}).join(", ")));var w;return e===!0?w=ne(m,i,g,u):w=G(m,e.halfCheckedKeys,i,g,u),w}},wx14:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(){return me=Object.assign?Object.assign.bind():function(be){for(var ye=1;ye<arguments.length;ye++){var ge=arguments[ye];for(var ne in ge)Object.prototype.hasOwnProperty.call(ge,ne)&&(be[ne]=ge[ne])}return be},me.apply(this,arguments)}},xTzM:function(We,ce){We.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="},xYGA:function(We,ce,F){"use strict";F.r(ce),F.d(ce,"ResizableTextArea",function(){return y});var me=F("yuO0"),be=F("eA01"),ye=F("fXDJ"),ge=F("BPTR"),ne=F("udol"),G=F("T/Jt"),O=F("XjgL"),W=F("6ASS"),e=F("kxoy"),k=F("36hc"),L=F("fNpE"),I=F("s3yx"),u=F("s7W6"),m=F("IRwA"),i=F("8wWb"),g=F("27eb"),w=F.n(g),x=`
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;
pointer-events: none !important;
`,E=["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"],o={},f;function d(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=n.getAttribute("id")||n.getAttribute("data-reactid")||n.getAttribute("name");if(a&&o[r])return o[r];var t=window.getComputedStyle(n),c=t.getPropertyValue("box-sizing")||t.getPropertyValue("-moz-box-sizing")||t.getPropertyValue("-webkit-box-sizing"),b=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),h=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width")),D=E.map(function(j){return"".concat(j,":").concat(t.getPropertyValue(j))}).join(";"),P={sizingStyle:D,paddingSize:b,borderSize:h,boxSizing:c};return a&&r&&(o[r]=P),P}function A(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;f||(f=document.createElement("textarea"),f.setAttribute("tab-index","-1"),f.setAttribute("aria-hidden","true"),document.body.appendChild(f)),n.getAttribute("wrap")?f.setAttribute("wrap",n.getAttribute("wrap")):f.removeAttribute("wrap");var c=d(n,a),b=c.paddingSize,h=c.borderSize,D=c.boxSizing,P=c.sizingStyle;f.setAttribute("style","".concat(P,";").concat(x)),f.value=n.value||n.placeholder||"";var j=void 0,N=void 0,H,z=f.scrollHeight;if(D==="border-box"?z+=h:D==="content-box"&&(z-=b),r!==null||t!==null){f.value=" ";var J=f.scrollHeight-b;r!==null&&(j=J*r,D==="border-box"&&(j=j+b+h),z=Math.max(j,z)),t!==null&&(N=J*t,D==="border-box"&&(N=N+b+h),H=z>N?"":"hidden",z=Math.min(N,z))}var Y={height:z,overflowY:H,resize:"none"};return j&&(Y.minHeight=j),N&&(Y.maxHeight=N),Y}var s=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],p=0,C=1,l=2,T=G.forwardRef(function(n,a){var r=n.prefixCls,t=r===void 0?"rc-textarea":r,c=n.onPressEnter,b=n.defaultValue,h=n.value,D=n.autoSize,P=n.onResize,j=n.className,N=n.style,H=n.disabled,z=n.onChange,J=n.onInternalAutoSize,Y=Object(L.a)(n,s),le=Object(i.a)(b,{value:h,postState:function(q){return q!=null?q:""}}),te=Object(k.a)(le,2),Z=te[0],_e=te[1],we=function(q){_e(q.target.value),z==null||z(q)},De=G.useRef();G.useImperativeHandle(a,function(){return{textArea:De.current}});var Ee=G.useMemo(function(){return D&&Object(e.a)(D)==="object"?[D.minRows,D.maxRows]:[]},[D]),xe=Object(k.a)(Ee,2),ve=xe[0],X=xe[1],Ae=!!D,Q=function(){try{if(document.activeElement===De.current){var q=De.current,se=q.selectionStart,he=q.selectionEnd,V=q.scrollTop;De.current.setSelectionRange(se,he),De.current.scrollTop=V}}catch($){}},ue=G.useState(l),ee=Object(k.a)(ue,2),ae=ee[0],fe=ee[1],Re=G.useState(),pe=Object(k.a)(Re,2),ie=pe[0],Ie=pe[1],Oe=function(){fe(p)};Object(u.a)(function(){Ae&&Oe()},[h,ve,X,Ae]),Object(u.a)(function(){if(ae===p)fe(C);else if(ae===C){var Pe=A(De.current,!1,ve,X);fe(l),Ie(Pe)}else Q()},[ae]);var Ne=G.useRef(),Le=function(){m.a.cancel(Ne.current)},Ce=function(q){ae===l&&(P==null||P(q),D&&(Le(),Ne.current=Object(m.a)(function(){Oe()})))};G.useEffect(function(){return Le},[]);var Ue=Ae?ie:null,Te=Object(W.a)(Object(W.a)({},N),Ue);return(ae===p||ae===C)&&(Te.overflowY="hidden",Te.overflowX="hidden"),G.createElement(I.a,{onResize:Ce,disabled:!(D||P)},G.createElement("textarea",Object(me.a)({},Y,{ref:De,style:Te,className:w()(t,j,Object(O.a)({},"".concat(t,"-disabled"),H)),disabled:H,value:Z,onChange:we})))}),y=T,_=function(n){Object(ge.a)(r,n);var a=Object(ne.a)(r);function r(t){var c;Object(be.a)(this,r),c=a.call(this,t),c.resizableTextArea=void 0,c.focus=function(){c.resizableTextArea.textArea.focus()},c.saveTextArea=function(h){c.resizableTextArea=h},c.handleChange=function(h){var D=c.props.onChange;c.setValue(h.target.value),D&&D(h)},c.handleKeyDown=function(h){var D=c.props,P=D.onPressEnter,j=D.onKeyDown;h.keyCode===13&&P&&P(h),j&&j(h)};var b=typeof t.value=="undefined"||t.value===null?t.defaultValue:t.value;return c.state={value:b},c}return Object(ye.a)(r,[{key:"setValue",value:function(c,b){"value"in this.props||this.setState({value:c},b)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return G.createElement(y,Object(me.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(c){return"value"in c?{value:c.value}:null}}]),r}(G.Component),v=ce.default=_},"yg+E":function(We,ce,F){"use strict";F.r(ce),F.d(ce,"BaseInput",function(){return u});var me=F("XjgL"),be=F("kxoy"),ye=F("T/Jt"),ge=F.n(ye),ne=F("27eb"),G=F.n(ne);function O(s){return!!(s.addonBefore||s.addonAfter)}function W(s){return!!(s.prefix||s.suffix||s.allowClear)}function e(s,p,C,l){if(!C)return;var T=p;if(p.type==="click"){var y=s.cloneNode(!0);T=Object.create(p,{target:{value:y},currentTarget:{value:y}}),y.value="",C(T);return}if(l!==void 0){T=Object.create(p,{target:{value:s},currentTarget:{value:s}}),s.value=l,C(T);return}C(T)}function k(s,p){if(!s)return;s.focus(p);var C=p||{},l=C.cursor;if(l){var T=s.value.length;switch(l){case"start":s.setSelectionRange(0,0);break;case"end":s.setSelectionRange(T,T);break;default:s.setSelectionRange(0,T)}}}function L(s){return typeof s=="undefined"||s===null?"":String(s)}var I=function(p){var C=p.inputElement,l=p.prefixCls,T=p.prefix,y=p.suffix,_=p.addonBefore,v=p.addonAfter,n=p.className,a=p.style,r=p.affixWrapperClassName,t=p.groupClassName,c=p.wrapperClassName,b=p.disabled,h=p.readOnly,D=p.focused,P=p.triggerFocus,j=p.allowClear,N=p.value,H=p.handleReset,z=p.hidden,J=Object(ye.useRef)(null),Y=function(Q){var ue;(ue=J.current)!==null&&ue!==void 0&&ue.contains(Q.target)&&(P==null||P())},le=function(){var Q;if(!j)return null;var ue=!b&&!h&&N,ee="".concat(l,"-clear-icon"),ae=Object(be.a)(j)==="object"&&j!==null&&j!==void 0&&j.clearIcon?j.clearIcon:"\u2716";return ge.a.createElement("span",{onClick:H,onMouseDown:function(Re){return Re.preventDefault()},className:G()(ee,(Q={},Object(me.a)(Q,"".concat(ee,"-hidden"),!ue),Object(me.a)(Q,"".concat(ee,"-has-suffix"),!!y),Q)),role:"button",tabIndex:-1},ae)},te=Object(ye.cloneElement)(C,{value:N,hidden:z});if(W(p)){var Z,_e="".concat(l,"-affix-wrapper"),we=G()(_e,(Z={},Object(me.a)(Z,"".concat(_e,"-disabled"),b),Object(me.a)(Z,"".concat(_e,"-focused"),D),Object(me.a)(Z,"".concat(_e,"-readonly"),h),Object(me.a)(Z,"".concat(_e,"-input-with-clear-btn"),y&&j&&N),Z),!O(p)&&n,r),De=(y||j)&&ge.a.createElement("span",{className:"".concat(l,"-suffix")},le(),y);te=ge.a.createElement("span",{className:we,style:a,hidden:!O(p)&&z,onClick:Y,ref:J},T&&ge.a.createElement("span",{className:"".concat(l,"-prefix")},T),Object(ye.cloneElement)(C,{style:null,value:N,hidden:null}),De)}if(O(p)){var Ee="".concat(l,"-group"),xe="".concat(Ee,"-addon"),ve=G()("".concat(l,"-wrapper"),Ee,c),X=G()("".concat(l,"-group-wrapper"),n,t);return ge.a.createElement("span",{className:X,style:a,hidden:z},ge.a.createElement("span",{className:ve},_&&ge.a.createElement("span",{className:xe},_),Object(ye.cloneElement)(te,{style:null,hidden:null}),v&&ge.a.createElement("span",{className:xe},v)))}return te},u=I,m=F("aVTQ"),i=F("yuO0"),g=F("36hc"),w=F("fNpE"),x=F("N7A4"),E=F("8wWb"),o=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],f=Object(ye.forwardRef)(function(s,p){var C=s.autoComplete,l=s.onChange,T=s.onFocus,y=s.onBlur,_=s.onPressEnter,v=s.onKeyDown,n=s.prefixCls,a=n===void 0?"rc-input":n,r=s.disabled,t=s.htmlSize,c=s.className,b=s.maxLength,h=s.suffix,D=s.showCount,P=s.type,j=P===void 0?"text":P,N=s.inputClassName,H=Object(w.a)(s,o),z=Object(E.a)(s.defaultValue,{value:s.value}),J=Object(g.a)(z,2),Y=J[0],le=J[1],te=Object(ye.useState)(!1),Z=Object(g.a)(te,2),_e=Z[0],we=Z[1],De=Object(ye.useRef)(null),Ee=function(fe){De.current&&k(De.current,fe)};Object(ye.useImperativeHandle)(p,function(){return{focus:Ee,blur:function(){var fe;(fe=De.current)===null||fe===void 0||fe.blur()},setSelectionRange:function(fe,Re,pe){var ie;(ie=De.current)===null||ie===void 0||ie.setSelectionRange(fe,Re,pe)},select:function(){var fe;(fe=De.current)===null||fe===void 0||fe.select()},input:De.current}}),Object(ye.useEffect)(function(){we(function(ae){return ae&&r?!1:ae})},[r]);var xe=function(fe){s.value===void 0&&le(fe.target.value),De.current&&e(De.current,fe,l)},ve=function(fe){_&&fe.key==="Enter"&&_(fe),v==null||v(fe)},X=function(fe){we(!0),T==null||T(fe)},Ae=function(fe){we(!1),y==null||y(fe)},Q=function(fe){le(""),Ee(),De.current&&e(De.current,fe,l)},ue=function(){var fe=Object(x.a)(s,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return ge.a.createElement("input",Object(i.a)({autoComplete:C},fe,{onChange:xe,onFocus:X,onBlur:Ae,onKeyDown:ve,className:G()(a,Object(me.a)({},"".concat(a,"-disabled"),r),N,!O(s)&&!W(s)&&c),ref:De,size:t,type:j}))},ee=function(){var fe=Number(b)>0;if(h||D){var Re=L(Y),pe=Object(m.a)(Re).length,ie=Object(be.a)(D)==="object"?D.formatter({value:Re,count:pe,maxLength:b}):"".concat(pe).concat(fe?" / ".concat(b):"");return ge.a.createElement(ge.a.Fragment,null,!!D&&ge.a.createElement("span",{className:G()("".concat(a,"-show-count-suffix"),Object(me.a)({},"".concat(a,"-show-count-has-suffix"),!!h))},ie),h)}return null};return ge.a.createElement(u,Object(i.a)({},H,{prefixCls:a,className:c,inputElement:ue(),handleReset:Q,value:L(Y),focused:_e,triggerFocus:Ee,suffix:ee(),disabled:r}))}),d=f,A=ce.default=d},yhAM:function(We,ce,F){"use strict";var me=F("yuO0"),be=F("XjgL"),ye=F("6ASS"),ge=F("36hc"),ne=F("kxoy"),G=F("fNpE"),O=F("T/Jt"),W=F("27eb"),e=F.n(W),k=F("EOd9"),L=F("8wWb"),I=F("J5No"),u=Object(O.createContext)(null),m=O.forwardRef(function(ie,Ie){var Oe=ie.prefixCls,Ne=ie.className,Le=ie.style,Ce=ie.id,Ue=ie.active,Te=ie.tabKey,Pe=ie.children;return O.createElement("div",{id:Ce&&"".concat(Ce,"-panel-").concat(Te),role:"tabpanel",tabIndex:Ue?0:-1,"aria-labelledby":Ce&&"".concat(Ce,"-tab-").concat(Te),"aria-hidden":!Ue,style:Le,className:e()(Oe,Ue&&"".concat(Oe,"-active"),Ne),ref:Ie},Pe)}),i=m,g=["key","forceRender","style","className"];function w(ie){var Ie=ie.id,Oe=ie.activeKey,Ne=ie.animated,Le=ie.tabPosition,Ce=ie.destroyInactiveTabPane,Ue=O.useContext(u),Te=Ue.prefixCls,Pe=Ue.tabs,q=Ne.tabPane,se="".concat(Te,"-tabpane");return O.createElement("div",{className:e()("".concat(Te,"-content-holder"))},O.createElement("div",{className:e()("".concat(Te,"-content"),"".concat(Te,"-content-").concat(Le),Object(be.a)({},"".concat(Te,"-content-animated"),q))},Pe.map(function(he){var V=he.key,$=he.forceRender,re=he.style,oe=he.className,Se=Object(G.a)(he,g),Me=V===Oe;return O.createElement(I.default,Object(me.a)({key:V,visible:Me,forceRender:$,removeOnLeave:!!Ce,leavedClassName:"".concat(se,"-hidden")},Ne.tabPaneMotion),function(Be,Ke){var Xe=Be.style,Ge=Be.className;return O.createElement(i,Object(me.a)({},Se,{prefixCls:se,id:Ie,tabKey:V,animated:q,active:Me,style:Object(ye.a)(Object(ye.a)({},re),Xe),className:e()(oe,Ge),ref:Ke}))})})))}var x=F("aVTQ"),E=F("s3yx"),o=F("HnKm"),f=F("IRwA"),d=F("Eiay"),A={width:0,height:0,left:0,top:0};function s(ie,Ie,Oe){return Object(O.useMemo)(function(){for(var Ne,Le=new Map,Ce=Ie.get((Ne=ie[0])===null||Ne===void 0?void 0:Ne.key)||A,Ue=Ce.left+Ce.width,Te=0;Te<ie.length;Te+=1){var Pe=ie[Te].key,q=Ie.get(Pe);if(!q){var se;q=Ie.get((se=ie[Te-1])===null||se===void 0?void 0:se.key)||A}var he=Le.get(Pe)||Object(ye.a)({},q);he.right=Ue-he.left-he.width,Le.set(Pe,he)}return Le},[ie.map(function(Ne){return Ne.key}).join("_"),Ie,Oe])}function p(ie,Ie){var Oe=O.useRef(ie),Ne=O.useState({}),Le=Object(ge.a)(Ne,2),Ce=Le[1];function Ue(Te){var Pe=typeof Te=="function"?Te(Oe.current):Te;Pe!==Oe.current&&Ie(Pe,Oe.current),Oe.current=Pe,Ce({})}return[Oe.current,Ue]}var C=.1,l=.01,T=20,y=Math.pow(.995,T);function _(ie,Ie){var Oe=Object(O.useState)(),Ne=Object(ge.a)(Oe,2),Le=Ne[0],Ce=Ne[1],Ue=Object(O.useState)(0),Te=Object(ge.a)(Ue,2),Pe=Te[0],q=Te[1],se=Object(O.useState)(0),he=Object(ge.a)(se,2),V=he[0],$=he[1],re=Object(O.useState)(),oe=Object(ge.a)(re,2),Se=oe[0],Me=oe[1],Be=Object(O.useRef)();function Ke(at){var Qe=at.touches[0],$e=Qe.screenX,nt=Qe.screenY;Ce({x:$e,y:nt}),window.clearInterval(Be.current)}function Xe(at){if(!Le)return;at.preventDefault();var Qe=at.touches[0],$e=Qe.screenX,nt=Qe.screenY;Ce({x:$e,y:nt});var Ye=$e-Le.x,st=nt-Le.y;Ie(Ye,st);var Tt=Date.now();q(Tt),$(Tt-Pe),Me({x:Ye,y:st})}function Ge(){if(!Le)return;if(Ce(null),Me(null),Se){var at=Se.x/V,Qe=Se.y/V,$e=Math.abs(at),nt=Math.abs(Qe);if(Math.max($e,nt)<C)return;var Ye=at,st=Qe;Be.current=window.setInterval(function(){if(Math.abs(Ye)<l&&Math.abs(st)<l){window.clearInterval(Be.current);return}Ye*=y,st*=y,Ie(Ye*T,st*T)},T)}}var rt=Object(O.useRef)();function qe(at){var Qe=at.deltaX,$e=at.deltaY,nt=0,Ye=Math.abs(Qe),st=Math.abs($e);Ye===st?nt=rt.current==="x"?Qe:$e:Ye>st?(nt=Qe,rt.current="x"):(nt=$e,rt.current="y"),Ie(-nt,-nt)&&at.preventDefault()}var Ve=Object(O.useRef)(null);Ve.current={onTouchStart:Ke,onTouchMove:Xe,onTouchEnd:Ge,onWheel:qe},O.useEffect(function(){function at(Ye){Ve.current.onTouchStart(Ye)}function Qe(Ye){Ve.current.onTouchMove(Ye)}function $e(Ye){Ve.current.onTouchEnd(Ye)}function nt(Ye){Ve.current.onWheel(Ye)}return document.addEventListener("touchmove",Qe,{passive:!1}),document.addEventListener("touchend",$e,{passive:!1}),ie.current.addEventListener("touchstart",at,{passive:!1}),ie.current.addEventListener("wheel",nt),function(){document.removeEventListener("touchmove",Qe),document.removeEventListener("touchend",$e)}},[])}var v=F("s7W6");function n(ie){var Ie=Object(O.useState)(0),Oe=Object(ge.a)(Ie,2),Ne=Oe[0],Le=Oe[1],Ce=Object(O.useRef)(0),Ue=Object(O.useRef)();return Ue.current=ie,Object(v.b)(function(){var Te;(Te=Ue.current)===null||Te===void 0||Te.call(Ue)},[Ne]),function(){if(Ce.current!==Ne)return;Ce.current+=1,Le(Ce.current)}}function a(ie){var Ie=Object(O.useRef)([]),Oe=Object(O.useState)({}),Ne=Object(ge.a)(Oe,2),Le=Ne[1],Ce=Object(O.useRef)(typeof ie=="function"?ie():ie),Ue=n(function(){var Pe=Ce.current;Ie.current.forEach(function(q){Pe=q(Pe)}),Ie.current=[],Ce.current=Pe,Le({})});function Te(Pe){Ie.current.push(Pe),Ue()}return[Ce.current,Te]}var r={width:0,height:0,left:0,top:0,right:0};function t(ie,Ie,Oe,Ne,Le,Ce,Ue){var Te=Ue.tabs,Pe=Ue.tabPosition,q=Ue.rtl,se,he,V;return["top","bottom"].includes(Pe)?(se="width",he=q?"right":"left",V=Math.abs(Oe)):(se="height",he="top",V=-Oe),Object(O.useMemo)(function(){if(!Te.length)return[0,0];for(var $=Te.length,re=$,oe=0;oe<$;oe+=1){var Se=ie.get(Te[oe].key)||r;if(Se[he]+Se[se]>V+Ie){re=oe-1;break}}for(var Me=0,Be=$-1;Be>=0;Be-=1){var Ke=ie.get(Te[Be].key)||r;if(Ke[he]<V){Me=Be+1;break}}return[Me,re]},[ie,Ie,Ne,Le,Ce,V,Pe,Te.map(function($){return $.key}).join("_"),q])}function c(ie){var Ie;return ie instanceof Map?(Ie={},ie.forEach(function(Oe,Ne){Ie[Ne]=Oe})):Ie=ie,JSON.stringify(Ie)}var b="TABS_DQ";function h(ie){return String(ie).replace(/"/g,b)}function D(ie,Ie){var Oe=ie.prefixCls,Ne=ie.editable,Le=ie.locale,Ce=ie.style;return!Ne||Ne.showAdd===!1?null:O.createElement("button",{ref:Ie,type:"button",className:"".concat(Oe,"-nav-add"),style:Ce,"aria-label":(Le==null?void 0:Le.addAriaLabel)||"Add tab",onClick:function(Te){Ne.onEdit("add",{event:Te})}},Ne.addIcon||"+")}var P=O.forwardRef(D),j=O.forwardRef(function(ie,Ie){var Oe=ie.position,Ne=ie.prefixCls,Le=ie.extra;if(!Le)return null;var Ce,Ue={};return Object(ne.a)(Le)==="object"&&!O.isValidElement(Le)?Ue=Le:Ue.right=Le,Oe==="right"&&(Ce=Ue.right),Oe==="left"&&(Ce=Ue.left),Ce?O.createElement("div",{className:"".concat(Ne,"-extra-content"),ref:Ie},Ce):null}),N=j,H=F("bgne"),z=F("ADms"),J=F("sg8A");function Y(ie,Ie){var Oe=ie.prefixCls,Ne=ie.id,Le=ie.tabs,Ce=ie.locale,Ue=ie.mobile,Te=ie.moreIcon,Pe=Te===void 0?"More":Te,q=ie.moreTransitionName,se=ie.style,he=ie.className,V=ie.editable,$=ie.tabBarGutter,re=ie.rtl,oe=ie.removeAriaLabel,Se=ie.onTabClick,Me=ie.getPopupContainer,Be=ie.popupClassName,Ke=Object(O.useState)(!1),Xe=Object(ge.a)(Ke,2),Ge=Xe[0],rt=Xe[1],qe=Object(O.useState)(null),Ve=Object(ge.a)(qe,2),at=Ve[0],Qe=Ve[1],$e="".concat(Ne,"-more-popup"),nt="".concat(Oe,"-dropdown"),Ye=at!==null?"".concat($e,"-").concat(at):null,st=Ce==null?void 0:Ce.dropdownAriaLabel;function Tt(it,yt){it.preventDefault(),it.stopPropagation(),V.onEdit("remove",{key:yt,event:it})}var wt=O.createElement(z.g,{onClick:function(yt){var Lt=yt.key,ct=yt.domEvent;Se(Lt,ct),rt(!1)},prefixCls:"".concat(nt,"-menu"),id:$e,tabIndex:-1,role:"listbox","aria-activedescendant":Ye,selectedKeys:[at],"aria-label":st!==void 0?st:"expanded dropdown"},Le.map(function(it){var yt=V&&it.closable!==!1&&!it.disabled;return O.createElement(z.d,{key:it.key,id:"".concat($e,"-").concat(it.key),role:"option","aria-controls":Ne&&"".concat(Ne,"-panel-").concat(it.key),disabled:it.disabled},O.createElement("span",null,it.label),yt&&O.createElement("button",{type:"button","aria-label":oe||"remove",tabIndex:0,className:"".concat(nt,"-menu-item-remove"),onClick:function(ct){ct.stopPropagation(),Tt(ct,it.key)}},it.closeIcon||V.removeIcon||"\xD7"))}));function xt(it){for(var yt=Le.filter(function(Pt){return!Pt.disabled}),Lt=yt.findIndex(function(Pt){return Pt.key===at})||0,ct=yt.length,mt=0;mt<ct;mt+=1){Lt=(Lt+it+ct)%ct;var Ct=yt[Lt];if(!Ct.disabled){Qe(Ct.key);return}}}function je(it){var yt=it.which;if(!Ge){[J.a.DOWN,J.a.SPACE,J.a.ENTER].includes(yt)&&(rt(!0),it.preventDefault());return}switch(yt){case J.a.UP:xt(-1),it.preventDefault();break;case J.a.DOWN:xt(1),it.preventDefault();break;case J.a.ESC:rt(!1);break;case J.a.SPACE:case J.a.ENTER:at!==null&&Se(at,it);break}}Object(O.useEffect)(function(){var it=document.getElementById(Ye);it&&it.scrollIntoView&&it.scrollIntoView(!1)},[at]),Object(O.useEffect)(function(){Ge||Qe(null)},[Ge]);var Ze=Object(be.a)({},re?"marginRight":"marginLeft",$);Le.length||(Ze.visibility="hidden",Ze.order=1);var ut=e()(Object(be.a)({},"".concat(nt,"-rtl"),re)),lt=Ue?null:O.createElement(H.a,{prefixCls:nt,overlay:wt,trigger:["hover"],visible:Le.length?Ge:!1,transitionName:q,onVisibleChange:rt,overlayClassName:e()(ut,Be),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Me},O.createElement("button",{type:"button",className:"".concat(Oe,"-nav-more"),style:Ze,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":$e,id:"".concat(Ne,"-more"),"aria-expanded":Ge,onKeyDown:je},Pe));return O.createElement("div",{className:e()("".concat(Oe,"-nav-operations"),he),style:se,ref:Ie},lt,O.createElement(P,{prefixCls:Oe,locale:Ce,editable:V}))}var le=O.memo(O.forwardRef(Y),function(ie,Ie){return Ie.tabMoving});function te(ie){var Ie,Oe=ie.prefixCls,Ne=ie.id,Le=ie.active,Ce=ie.tab,Ue=Ce.key,Te=Ce.label,Pe=Ce.disabled,q=Ce.closeIcon,se=ie.closable,he=ie.renderWrapper,V=ie.removeAriaLabel,$=ie.editable,re=ie.onClick,oe=ie.onFocus,Se=ie.style,Me="".concat(Oe,"-tab"),Be=$&&se!==!1&&!Pe;function Ke(rt){if(Pe)return;re(rt)}function Xe(rt){rt.preventDefault(),rt.stopPropagation(),$.onEdit("remove",{key:Ue,event:rt})}var Ge=O.createElement("div",{key:Ue,"data-node-key":h(Ue),className:e()(Me,(Ie={},Object(be.a)(Ie,"".concat(Me,"-with-remove"),Be),Object(be.a)(Ie,"".concat(Me,"-active"),Le),Object(be.a)(Ie,"".concat(Me,"-disabled"),Pe),Ie)),style:Se,onClick:Ke},O.createElement("div",{role:"tab","aria-selected":Le,id:Ne&&"".concat(Ne,"-tab-").concat(Ue),className:"".concat(Me,"-btn"),"aria-controls":Ne&&"".concat(Ne,"-panel-").concat(Ue),"aria-disabled":Pe,tabIndex:Pe?null:0,onClick:function(qe){qe.stopPropagation(),Ke(qe)},onKeyDown:function(qe){[J.a.SPACE,J.a.ENTER].includes(qe.which)&&(qe.preventDefault(),Ke(qe))},onFocus:oe},Te),Be&&O.createElement("button",{type:"button","aria-label":V||"remove",tabIndex:0,className:"".concat(Me,"-remove"),onClick:function(qe){qe.stopPropagation(),Xe(qe)}},q||$.removeIcon||"\xD7"));return he?he(Ge):Ge}var Z=te,_e=function(Ie){var Oe=Ie.current||{},Ne=Oe.offsetWidth,Le=Ne===void 0?0:Ne,Ce=Oe.offsetHeight,Ue=Ce===void 0?0:Ce;return[Le,Ue]},we=function(Ie,Oe){return Ie[Oe?0:1]};function De(ie,Ie){var Oe,Ne=O.useContext(u),Le=Ne.prefixCls,Ce=Ne.tabs,Ue=ie.className,Te=ie.style,Pe=ie.id,q=ie.animated,se=ie.activeKey,he=ie.rtl,V=ie.extra,$=ie.editable,re=ie.locale,oe=ie.tabPosition,Se=ie.tabBarGutter,Me=ie.children,Be=ie.onTabClick,Ke=ie.onTabScroll,Xe=Object(O.useRef)(),Ge=Object(O.useRef)(),rt=Object(O.useRef)(),qe=Object(O.useRef)(),Ve=Object(O.useRef)(),at=Object(O.useRef)(),Qe=Object(O.useRef)(),$e=oe==="top"||oe==="bottom",nt=p(0,function(bt,_t){$e&&Ke&&Ke({direction:bt>_t?"left":"right"})}),Ye=Object(ge.a)(nt,2),st=Ye[0],Tt=Ye[1],wt=p(0,function(bt,_t){!$e&&Ke&&Ke({direction:bt>_t?"top":"bottom"})}),xt=Object(ge.a)(wt,2),je=xt[0],Ze=xt[1],ut=Object(O.useState)([0,0]),lt=Object(ge.a)(ut,2),it=lt[0],yt=lt[1],Lt=Object(O.useState)([0,0]),ct=Object(ge.a)(Lt,2),mt=ct[0],Ct=ct[1],Pt=Object(O.useState)([0,0]),kt=Object(ge.a)(Pt,2),ht=kt[0],Dt=kt[1],Nt=Object(O.useState)([0,0]),jt=Object(ge.a)(Nt,2),Ht=jt[0],Bt=jt[1],gt=a(new Map),Et=Object(ge.a)(gt,2),Kt=Et[0],rr=Et[1],B=s(Ce,Kt,mt[0]),S=we(it,$e),R=we(mt,$e),M=we(ht,$e),K=we(Ht,$e),U=S<R+M,de=U?S-K:S-M,ke="".concat(Le,"-nav-operations-hidden"),He=0,ze=0;$e&&he?(He=0,ze=Math.max(0,R-de)):(He=Math.min(0,de-R),ze=0);function Fe(bt){return bt<He?He:bt>ze?ze:bt}var Je=Object(O.useRef)(),dt=Object(O.useState)(),It=Object(ge.a)(dt,2),Gt=It[0],Ft=It[1];function Ot(){Ft(Date.now())}function Xt(){window.clearTimeout(Je.current)}_(qe,function(bt,_t){function Ut(zt,Zt){zt(function(Qt){var dr=Fe(Qt+Zt);return dr})}return U?($e?Ut(Tt,bt):Ut(Ze,_t),Xt(),Ot(),!0):!1}),Object(O.useEffect)(function(){return Xt(),Gt&&(Je.current=window.setTimeout(function(){Ft(0)},100)),Xt},[Gt]);var nr=t(B,de,$e?st:je,R,M,K,Object(ye.a)(Object(ye.a)({},ie),{},{tabs:Ce})),qt=Object(ge.a)(nr,2),Jt=qt[0],et=qt[1],tt=Object(o.a)(function(){var bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:se,_t=B.get(bt)||{width:0,height:0,left:0,right:0,top:0};if($e){var Ut=st;he?_t.right<st?Ut=_t.right:_t.right+_t.width>st+de&&(Ut=_t.right+_t.width-de):_t.left<-st?Ut=-_t.left:_t.left+_t.width>-st+de&&(Ut=-(_t.left+_t.width-de)),Ze(0),Tt(Fe(Ut))}else{var zt=je;_t.top<-je?zt=-_t.top:_t.top+_t.height>-je+de&&(zt=-(_t.top+_t.height-de)),Tt(0),Ze(Fe(zt))}}),ot={};oe==="top"||oe==="bottom"?ot[he?"marginRight":"marginLeft"]=Se:ot.marginTop=Se;var ft=Ce.map(function(bt,_t){var Ut=bt.key;return O.createElement(Z,{id:Pe,prefixCls:Le,key:Ut,tab:bt,style:_t===0?void 0:ot,closable:bt.closable,editable:$,active:Ut===se,renderWrapper:Me,removeAriaLabel:re==null?void 0:re.removeAriaLabel,onClick:function(Zt){Be(Ut,Zt)},onFocus:function(){if(tt(Ut),Ot(),!qe.current)return;he||(qe.current.scrollLeft=0),qe.current.scrollTop=0}})}),Rt=function(){return rr(function(){var _t=new Map;return Ce.forEach(function(Ut){var zt,Zt=Ut.key,Qt=(zt=Ve.current)===null||zt===void 0?void 0:zt.querySelector('[data-node-key="'.concat(h(Zt),'"]'));Qt&&_t.set(Zt,{width:Qt.offsetWidth,height:Qt.offsetHeight,left:Qt.offsetLeft,top:Qt.offsetTop})}),_t})};Object(O.useEffect)(function(){Rt()},[Ce.map(function(bt){return bt.key}).join("_")]);var At=n(function(){var bt=_e(Xe),_t=_e(Ge),Ut=_e(rt);yt([bt[0]-_t[0]-Ut[0],bt[1]-_t[1]-Ut[1]]);var zt=_e(Qe);Dt(zt);var Zt=_e(at);Bt(Zt);var Qt=_e(Ve);Ct([Qt[0]-zt[0],Qt[1]-zt[1]]),Rt()}),lr=Ce.slice(0,Jt),tr=Ce.slice(et+1),$t=[].concat(Object(x.a)(lr),Object(x.a)(tr)),ir=Object(O.useState)(),sr=Object(ge.a)(ir,2),ur=sr[0],Wt=sr[1],pt=B.get(se),Vt=Object(O.useRef)();function vt(){f.a.cancel(Vt.current)}Object(O.useEffect)(function(){var bt={};return pt&&($e?(he?bt.right=pt.right:bt.left=pt.left,bt.width=pt.width):(bt.top=pt.top,bt.height=pt.height)),vt(),Vt.current=Object(f.a)(function(){Wt(bt)}),vt},[pt,$e,he]),Object(O.useEffect)(function(){tt()},[se,He,ze,c(pt),c(B),$e]),Object(O.useEffect)(function(){At()},[he]);var Yt=!!$t.length,St="".concat(Le,"-nav-wrap"),er,Mt,ar,or;return $e?he?(Mt=st>0,er=st!==ze):(er=st<0,Mt=st!==He):(ar=je<0,or=je!==He),O.createElement(E.a,{onResize:At},O.createElement("div",{ref:Object(d.d)(Ie,Xe),role:"tablist",className:e()("".concat(Le,"-nav"),Ue),style:Te,onKeyDown:function(){Ot()}},O.createElement(N,{ref:Ge,position:"left",extra:V,prefixCls:Le}),O.createElement("div",{className:e()(St,(Oe={},Object(be.a)(Oe,"".concat(St,"-ping-left"),er),Object(be.a)(Oe,"".concat(St,"-ping-right"),Mt),Object(be.a)(Oe,"".concat(St,"-ping-top"),ar),Object(be.a)(Oe,"".concat(St,"-ping-bottom"),or),Oe)),ref:qe},O.createElement(E.a,{onResize:At},O.createElement("div",{ref:Ve,className:"".concat(Le,"-nav-list"),style:{transform:"translate(".concat(st,"px, ").concat(je,"px)"),transition:Gt?"none":void 0}},ft,O.createElement(P,{ref:Qe,prefixCls:Le,locale:re,editable:$,style:Object(ye.a)(Object(ye.a)({},ft.length===0?void 0:ot),{},{visibility:Yt?"hidden":null})}),O.createElement("div",{className:e()("".concat(Le,"-ink-bar"),Object(be.a)({},"".concat(Le,"-ink-bar-animated"),q.inkBar)),style:ur})))),O.createElement(le,Object(me.a)({},ie,{removeAriaLabel:re==null?void 0:re.removeAriaLabel,ref:at,prefixCls:Le,tabs:$t,className:!Yt&&ke,tabMoving:!!Gt})),O.createElement(N,{ref:rt,position:"right",extra:V,prefixCls:Le})))}var Ee=O.forwardRef(De),xe=["renderTabBar"],ve=["label","key"];function X(ie){var Ie=ie.renderTabBar,Oe=Object(G.a)(ie,xe),Ne=O.useContext(u),Le=Ne.tabs;if(Ie){var Ce=Object(ye.a)(Object(ye.a)({},Oe),{},{panes:Le.map(function(Ue){var Te=Ue.label,Pe=Ue.key,q=Object(G.a)(Ue,ve);return O.createElement(i,Object(me.a)({tab:Te,key:Pe,tabKey:Pe},q))})});return Ie(Ce,Ee)}return O.createElement(Ee,Oe)}var Ae=F("B/uU");function Q(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Ie;return ie===!1?Ie={inkBar:!1,tabPane:!1}:ie===!0?Ie={inkBar:!0,tabPane:!1}:Ie=Object(ye.a)({inkBar:!0},Object(ne.a)(ie)==="object"?ie:{}),Ie.tabPaneMotion&&Ie.tabPane===void 0&&(Ie.tabPane=!0),!Ie.tabPaneMotion&&Ie.tabPane&&(Ie.tabPane=!1),Ie}var ue=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName"],ee=0;function ae(ie,Ie){var Oe,Ne=ie.id,Le=ie.prefixCls,Ce=Le===void 0?"rc-tabs":Le,Ue=ie.className,Te=ie.items,Pe=ie.direction,q=ie.activeKey,se=ie.defaultActiveKey,he=ie.editable,V=ie.animated,$=ie.tabPosition,re=$===void 0?"top":$,oe=ie.tabBarGutter,Se=ie.tabBarStyle,Me=ie.tabBarExtraContent,Be=ie.locale,Ke=ie.moreIcon,Xe=ie.moreTransitionName,Ge=ie.destroyInactiveTabPane,rt=ie.renderTabBar,qe=ie.onChange,Ve=ie.onTabClick,at=ie.onTabScroll,Qe=ie.getPopupContainer,$e=ie.popupClassName,nt=Object(G.a)(ie,ue),Ye=O.useMemo(function(){return(Te||[]).filter(function(gt){return gt&&Object(ne.a)(gt)==="object"&&"key"in gt})},[Te]),st=Pe==="rtl",Tt=Q(V),wt=Object(O.useState)(!1),xt=Object(ge.a)(wt,2),je=xt[0],Ze=xt[1];Object(O.useEffect)(function(){Ze(Object(k.a)())},[]);var ut=Object(L.a)(function(){var gt;return(gt=Ye[0])===null||gt===void 0?void 0:gt.key},{value:q,defaultValue:se}),lt=Object(ge.a)(ut,2),it=lt[0],yt=lt[1],Lt=Object(O.useState)(function(){return Ye.findIndex(function(gt){return gt.key===it})}),ct=Object(ge.a)(Lt,2),mt=ct[0],Ct=ct[1];Object(O.useEffect)(function(){var gt=Ye.findIndex(function(Kt){return Kt.key===it});if(gt===-1){var Et;gt=Math.max(0,Math.min(mt,Ye.length-1)),yt((Et=Ye[gt])===null||Et===void 0?void 0:Et.key)}Ct(gt)},[Ye.map(function(gt){return gt.key}).join("_"),it,mt]);var Pt=Object(L.a)(null,{value:Ne}),kt=Object(ge.a)(Pt,2),ht=kt[0],Dt=kt[1];Object(O.useEffect)(function(){Ne||(Dt("rc-tabs-".concat(ee)),ee+=1)},[]);function Nt(gt,Et){Ve==null||Ve(gt,Et);var Kt=gt!==it;yt(gt),Kt&&(qe==null||qe(gt))}var jt={id:ht,activeKey:it,animated:Tt,tabPosition:re,rtl:st,mobile:je},Ht,Bt=Object(ye.a)(Object(ye.a)({},jt),{},{editable:he,locale:Be,moreIcon:Ke,moreTransitionName:Xe,tabBarGutter:oe,onTabClick:Nt,onTabScroll:at,extra:Me,style:Se,panes:null,getPopupContainer:Qe,popupClassName:$e});return O.createElement(u.Provider,{value:{tabs:Ye,prefixCls:Ce}},O.createElement("div",Object(me.a)({ref:Ie,id:Ne,className:e()(Ce,"".concat(Ce,"-").concat(re),(Oe={},Object(be.a)(Oe,"".concat(Ce,"-mobile"),je),Object(be.a)(Oe,"".concat(Ce,"-editable"),he),Object(be.a)(Oe,"".concat(Ce,"-rtl"),st),Oe),Ue)},nt),Ht,O.createElement(X,Object(me.a)({},Bt,{renderTabBar:rt})),O.createElement(w,Object(me.a)({destroyInactiveTabPane:Ge},jt,{animated:Tt}))))}var fe=O.forwardRef(ae),Re=fe,pe=ce.a=Re},zLVn:function(We,ce,F){"use strict";F.d(ce,"a",function(){return me});function me(be,ye){if(be==null)return{};var ge={},ne=Object.keys(be),G,O;for(O=0;O<ne.length;O++){if(G=ne[O],ye.indexOf(G)>=0)continue;ge[G]=be[G]}return ge}}}]);