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.
393 lines
986 KiB
393 lines
986 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[101,5,7,8,14],{"+ua5":function(st,ve,z){},"/cxE":function(st,ve,z){"use strict";z.d(ve,"f",function(){return A}),z.d(ve,"g",function(){return U}),z.d(ve,"h",function(){return O}),z.d(ve,"e",function(){return H}),z.d(ve,"b",function(){return F}),z.d(ve,"c",function(){return e}),z.d(ve,"d",function(){return C}),z.d(ve,"a",function(){return f});class q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(o=>{o(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const j=new q;function A(p){H(p)||j.onUnexpectedError(p);return}function U(p){H(p)||j.onUnexpectedExternalError(p);return}function O(p){if(p instanceof Error){let{name:o,message:a}=p;const r=p.stacktrace||p.stack;return{$isError:!0,name:o,message:a,stack:r}}return p}const M="Canceled";function H(p){return p instanceof Error&&p.name===M&&p.message===M}function F(){const p=new Error(M);return p.name=p.message,p}function e(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function C(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class f extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"24hK":function(st,ve,z){"use strict";z.d(ve,"a",function(){return j});class q{constructor(A){this.element=A,this.next=q.Undefined,this.prev=q.Undefined}}q.Undefined=new q(void 0);class j{constructor(){this._first=q.Undefined,this._last=q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===q.Undefined}clear(){let A=this._first;for(;A!==q.Undefined;){const U=A.next;A.prev=q.Undefined,A.next=q.Undefined,A=U}this._first=q.Undefined,this._last=q.Undefined,this._size=0}unshift(A){return this._insert(A,!1)}push(A){return this._insert(A,!0)}_insert(A,U){const O=new q(A);if(this._first===q.Undefined)this._first=O,this._last=O;else if(U){const H=this._last;this._last=O,O.prev=H,H.next=O}else{const H=this._first;this._first=O,O.next=H,H.prev=O}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(O))}}shift(){if(this._first===q.Undefined)return;{const A=this._first.element;return this._remove(this._first),A}}pop(){if(this._last===q.Undefined)return;{const A=this._last.element;return this._remove(this._last),A}}_remove(A){if(A.prev!==q.Undefined&&A.next!==q.Undefined){const U=A.prev;U.next=A.next,A.next.prev=U}else A.prev===q.Undefined&&A.next===q.Undefined?(this._first=q.Undefined,this._last=q.Undefined):A.next===q.Undefined?(this._last=this._last.prev,this._last.next=q.Undefined):A.prev===q.Undefined&&(this._first=this._first.next,this._first.prev=q.Undefined);this._size-=1}*[Symbol.iterator](){let A=this._first;for(;A!==q.Undefined;)yield A.element,A=A.next}}},"3/fG":function(st,ve,z){"use strict";z.d(ve,"a",function(){return j});function q(A,U){let O;return U.length===0?O=A:O=A.replace(/\{(\d+)\}/g,function(M,H){const F=H[0];return typeof U[F]!="undefined"?U[F]:M}),O}function j(A,U,...O){return q(U,O)}},"479L":function(st,ve){st.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAWCAYAAAAvg9c4AAAAAXNSR0IArs4c6QAABPdJREFUSEullWloHGUYx//vzO7sHDuzm93sZpM2l/SgRyK7xSYxrfYgbdUq6JcixXqAUrxItGAVMT1A+kH7Re1WWppa6afiAYJIi7ZB07vkIARzVJqYbJMmu90zszOzM6/MVEXQotR3mPky8/7e//N7ZuYl+J+jt7fX7/f7i/X19cU/UORemZRSZnBwsKNQKLztdrtHOI57sqGhYcbm3ROUUsoOD4++Mz9f2CtJItE0DaVSqTMWi+27Jyil1DM0NLTfsmgHpZbLhthQSmlfTU3NmkgkUvjPSSmlZGRkZI2maZ2mWdpAGBehpgnd0KBpOkzTLPn9/gei0Wjfv0JHR0cXGpq2xTDNHZTSJsu0OJNaIIRFUc07KXXdgGVZCAQCL7e0tMT/Br3ja3iRaZptlmU9YVHayhBGoAApGTpKhgHCsFCLRaRvp+yEtk9QaiEYDHy0cWPb639CbdjAwADP8/zRkmk9BYADIU4nLUqdycX5Agxdh4cXkLh5E8m5WTD2A4SAZVmEwxVnNm3a9AiJx+MrdSI8nslm25YtqlMaVi6LWab1+2IUFIB9NXQDuUwapmFAUnwYHBhAOp0Ex3nAcRx4QUA4FL62ecuWVnL01Om8V1YkXdewpMoLn6zYC4NhGLhcLng4t4OdnEognUqCIQSSJOPipYvI5gsQBBGyV4KiyAgFgz83NDauImevDtFUJo+ZqXGsW7UcvjK/zQDDEBBCHF+pZBKTU1NOl1mWgYfnMTNzy1FTWbUA6UzWuVce9N2QRKmRfP3d9zSRLOBS9xlsbVsLv893p2TLcjzqhgGtqEEvGWAI47izyx27ft2ppq6uHpIoIFcowqfIkz7Fu4LEjxyhVUtX4cuTn2FxdQiiKILYKe3DbpTtwu4Fw4Bzu8F5PGAZFqnbKWdhRVEQDkegm5YNnVhYFVlJ9uzbb2x++iXXxwf2o0Jxg+N5J4ENs/0RlgVLCFwuNyRJhCAITgX+sgCyubzjXZK88Hq9ttuRMr8SI2d+OHdCqFz8zMkjh1SeqqXy8qBsGIbj0rQs56UGpXCxLCRZhiLLmFdVyF4FmmFAUXzw+RRIogSvV+xdUFX5ILl07drBIh/quHD2bNeK+vLLum7ENXUe+Xweqqo6p6brMEsleDweJ1Eul0MgWA7Too6uYCAAryxDEvlzzU1NbeTClSsHDTHScaG7+/D6pmU9k2nt8/TU+NUl91UP53K5dblcrjKfzzOFQsFpmu01k8mgrCwAC4yjygZXVkYgy9LR1paWF0n3jz0fMMGaN8+f6z68oXnp+V/T1omRgd7ju9t3Pp9IJMTZ2dmHMpnMtnQ6/Wg2mw2pqkqy2SzcbjdcnAiOczuJIxUhVIRCu5qbV39Ivj19+oBSvfytyz/1HG5trLs4NU+O3xge6npj53Mv/PUHPj09HR4bG9s+NzfXnkymatSiCoEX4C8rA+fh4eE4GioPrI1Goz3k1Fdf7KlcEuvsu3z1mN9jjY3fSr/vgX5oV/trr/zTrtDf379wYmIinkqlHrMsi8iyDFnxQRCFsdrq6tW1tbW3yXt79z77y42J44KL5FPJOeJiXUb0/oYdu9/t/OZuW42tpa+v75iqqtvy+RwqwiEIvPjJw+vXv+q8011dXXx/f/9WWZaVQCBwE0Bfe3v7NCHE/rDuOmzw+Pj4p4lEYruLZWeqa2o2xmKxIXvCb487Tm3fsdeDAAAAAElFTkSuQmCC"},"55Ip":function(st,ve,z){"use strict";z.d(ve,"a",function(){return i});var q=z("Ty5D"),j=z("dI71"),A=z("q1tI"),U=z.n(A),O=z("YS25"),M=z("17x9"),H=z.n(M),F=z("wx14"),e=z("zLVn"),C=z("9R94"),f=function(c){Object(j.a)(u,c);function u(){for(var b,m=arguments.length,w=new Array(m),I=0;I<m;I++)w[I]=arguments[I];return b=c.call.apply(c,[this].concat(w))||this,b.history=Object(O.a)(b.props),b}var l=u.prototype;return l.render=function(){return U.a.createElement(q.c,{history:this.history,children:this.props.children})},u}(U.a.Component),p=function(c){Object(j.a)(u,c);function u(){for(var b,m=arguments.length,w=new Array(m),I=0;I<m;I++)w[I]=arguments[I];return b=c.call.apply(c,[this].concat(w))||this,b.history=Object(O.b)(b.props),b}var l=u.prototype;return l.render=function(){return U.a.createElement(q.c,{history:this.history,children:this.props.children})},u}(U.a.Component),o=function(u,l){return typeof u=="function"?u(l):u},a=function(u,l){return typeof u=="string"?Object(O.c)(u,null,null,l):u},r=function(u){return u},h=U.a.forwardRef;typeof h=="undefined"&&(h=r);function s(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var n=h(function(c,u){var l=c.innerRef,b=c.navigate,m=c.onClick,w=Object(e.a)(c,["innerRef","navigate","onClick"]),I=w.target,L=Object(F.a)({},w,{onClick:function(D){try{m&&m(D)}catch(B){throw D.preventDefault(),B}!D.defaultPrevented&&D.button===0&&(!I||I==="_self")&&!s(D)&&(D.preventDefault(),b())}});return r!==h?L.ref=u||l:L.ref=l,U.a.createElement("a",L)}),i=h(function(c,u){var l=c.component,b=l===void 0?n:l,m=c.replace,w=c.to,I=c.innerRef,L=Object(e.a)(c,["component","replace","to","innerRef"]);return U.a.createElement(q.e.Consumer,null,function(S){S||Object(C.a)(!1);var D=S.history,B=a(o(w,S.location),S.location),R=B?D.createHref(B):"",W=Object(F.a)({},L,{href:R,navigate:function(){var se=o(w,S.location),ne=m?D.replace:D.push;ne(se)}});return r!==h?W.ref=u||I:W.innerRef=I,U.a.createElement(b,W)})});if(!1)var t,_;var g=function(u){return u},v=U.a.forwardRef;typeof v=="undefined"&&(v=g);function x(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];return u.filter(function(b){return b}).join(" ")}var E=v(function(c,u){var l=c["aria-current"],b=l===void 0?"page":l,m=c.activeClassName,w=m===void 0?"active":m,I=c.activeStyle,L=c.className,S=c.exact,D=c.isActive,B=c.location,R=c.sensitive,W=c.strict,Y=c.style,se=c.to,ne=c.innerRef,Se=Object(e.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return U.a.createElement(q.e.Consumer,null,function(xe){xe||Object(C.a)(!1);var we=B||xe.location,Re=a(o(se,we),we),Pe=Re.pathname,ye=Pe&&Pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ee=ye?Object(q.f)(we.pathname,{path:ye,exact:S,sensitive:R,strict:W}):null,je=!!(D?D(ee,we):ee),et=je?x(L,w):L,He=je?Object(F.a)({},Y,{},I):Y,Ne=Object(F.a)({"aria-current":je&&b||null,className:et,style:He,to:Re},Se);return g!==v?Ne.ref=u||ne:Ne.innerRef=ne,U.a.createElement(i,Ne)})});if(!1)var y},"5VLF":function(st,ve,z){"use strict";var q,j;function A(U,O,M){var H=function(F,e){return U.js_beautify(F,e)};return H.js=U.js_beautify,H.css=O.css_beautify,H.html=M.html_beautify,H.js_beautify=U.js_beautify,H.css_beautify=O.css_beautify,H.html_beautify=M.html_beautify,H}!(q=[z("6UM0"),z("TXwP"),z("psGv")],j=function(U,O,M){return A(U,O,M)}.apply(ve,q),j!==void 0&&(st.exports=j))},"5Y4S":function(st,ve,z){"use strict";z.d(ve,"a",function(){return A});var q=z("MNsG");const j=q.b.performance&&typeof q.b.performance.now=="function";class A{constructor(U){this._highResolution=j&&U,this._startTime=this._now(),this._stopTime=-1}static create(U=!0){return new A(U)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?q.b.performance.now():Date.now()}}},"6+eU":function(st,ve,z){"use strict";z.d(ve,"a",function(){return v});var q=z("wx14"),j=z("rePB"),A=z("VTBJ"),U=z("1OyB"),O=z("vuIU"),M=z("Ji7U"),H=z("LK+K"),F=z("q1tI"),e=z.n(F),C=z("TSYQ"),f=z.n(C),p=function(E){var y,c="".concat(E.rootPrefixCls,"-item"),u=f()(c,"".concat(c,"-").concat(E.page),(y={},Object(j.a)(y,"".concat(c,"-active"),E.active),Object(j.a)(y,E.className,!!E.className),Object(j.a)(y,"".concat(c,"-disabled"),!E.page),y)),l=function(){E.onClick(E.page)},b=function(w){E.onKeyPress(w,E.onClick,E.page)};return e.a.createElement("li",{title:E.showTitle?E.page:null,className:u,onClick:l,onKeyPress:b,tabIndex:"0"},E.itemRender(E.page,"page",e.a.createElement("a",{rel:"nofollow"},E.page)))},o=p,a={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},r=function(x){Object(M.a)(y,x);var E=Object(H.a)(y);function y(){var c;Object(U.a)(this,y);for(var u=arguments.length,l=new Array(u),b=0;b<u;b++)l[b]=arguments[b];return c=E.call.apply(E,[this].concat(l)),c.state={goInputText:""},c.buildOptionText=function(m){return"".concat(m," ").concat(c.props.locale.items_per_page)},c.changeSize=function(m){c.props.changeSize(Number(m))},c.handleChange=function(m){c.setState({goInputText:m.target.value})},c.handleBlur=function(m){var w=c.props,I=w.goButton,L=w.quickGo,S=w.rootPrefixCls,D=c.state.goInputText;if(I||D==="")return;if(m.relatedTarget&&(m.relatedTarget.className.indexOf("".concat(S,"-prev"))>=0||m.relatedTarget.className.indexOf("".concat(S,"-next"))>=0))return;c.setState({goInputText:""}),L(c.getValidValue())},c.go=function(m){var w=c.state.goInputText;if(w==="")return;(m.keyCode===a.ENTER||m.type==="click")&&(c.setState({goInputText:""}),c.props.quickGo(c.getValidValue()))},c}return Object(O.a)(y,[{key:"getValidValue",value:function(){var u=this.state,l=u.goInputText,b=u.current;return!l||isNaN(l)?b:Number(l)}},{key:"getPageSizeOptions",value:function(){var u=this.props,l=u.pageSize,b=u.pageSizeOptions;return b.some(function(m){return m.toString()===l.toString()})?b:b.concat([l.toString()]).sort(function(m,w){var I=isNaN(Number(m))?0:Number(m),L=isNaN(Number(w))?0:Number(w);return I-L})}},{key:"render",value:function(){var u=this,l=this.props,b=l.pageSize,m=l.locale,w=l.rootPrefixCls,I=l.changeSize,L=l.quickGo,S=l.goButton,D=l.selectComponentClass,B=l.buildOptionText,R=l.selectPrefixCls,W=l.disabled,Y=this.state.goInputText,se="".concat(w,"-options"),ne=D,Se=null,xe=null,we=null;if(!I&&!L)return null;var Re=this.getPageSizeOptions();if(I&&ne){var Pe=Re.map(function(ye,ee){return e.a.createElement(ne.Option,{key:ee,value:ye.toString()},(B||u.buildOptionText)(ye))});Se=e.a.createElement(ne,{disabled:W,prefixCls:R,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||Re[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ee){return ee.parentNode}},Pe)}return L&&(S&&(we=typeof S=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:W,className:"".concat(se,"-quick-jumper-button")},m.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},S)),xe=e.a.createElement("div",{className:"".concat(se,"-quick-jumper")},m.jump_to,e.a.createElement("input",{disabled:W,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),m.page,we)),e.a.createElement("li",{className:"".concat(se)},Se,xe)}}]),y}(e.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=r,s=z("N2Kk");function n(){}function i(x){return typeof x=="number"&&isFinite(x)&&Math.floor(x)===x}function t(x,E,y){return y}function _(x,E,y){var c=typeof x=="undefined"?E.pageSize:x;return Math.floor((y.total-1)/c)+1}var g=function(x){Object(M.a)(y,x);var E=Object(H.a)(y);function y(c){var u;Object(U.a)(this,y),u=E.call(this,c),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(_(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(I,L){var S=u.props.prefixCls,D=I||e.a.createElement("button",{type:"button","aria-label":L,className:"".concat(S,"-item-link")});return typeof I=="function"&&(D=e.a.createElement(I,Object(A.a)({},u.props))),D},u.savePaginationNode=function(I){u.paginationNode=I},u.isValid=function(I){return i(I)&&I!==u.state.current},u.shouldDisplayQuickJumper=function(){var I=u.props,L=I.showQuickJumper,S=I.pageSize,D=I.total;return D<=S?!1:L},u.handleKeyDown=function(I){(I.keyCode===a.ARROW_UP||I.keyCode===a.ARROW_DOWN)&&I.preventDefault()},u.handleKeyUp=function(I){var L=u.getValidValue(I),S=u.state.currentInputValue;L!==S&&u.setState({currentInputValue:L}),I.keyCode===a.ENTER?u.handleChange(L):I.keyCode===a.ARROW_UP?u.handleChange(L-1):I.keyCode===a.ARROW_DOWN&&u.handleChange(L+1)},u.changePageSize=function(I){var L=u.state.current,S=_(I,u.state,u.props);L=L>S?S:L,S===0&&(L=u.state.current),typeof I=="number"&&("pageSize"in u.props||u.setState({pageSize:I}),"current"in u.props||u.setState({current:L,currentInputValue:L})),u.props.onShowSizeChange(L,I),"onChange"in u.props&&u.props.onChange&&u.props.onChange(L,I)},u.handleChange=function(I){var L=u.props.disabled,S=I;if(u.isValid(S)&&!L){var D=_(void 0,u.state,u.props);S>D?S=D:S<1&&(S=1),"current"in u.props||u.setState({current:S,currentInputValue:S});var B=u.state.pageSize;return u.props.onChange(S,B),S}return u.state.current},u.prev=function(){u.hasPrev()&&u.handleChange(u.state.current-1)},u.next=function(){u.hasNext()&&u.handleChange(u.state.current+1)},u.jumpPrev=function(){u.handleChange(u.getJumpPrevPage())},u.jumpNext=function(){u.handleChange(u.getJumpNextPage())},u.hasPrev=function(){return u.state.current>1},u.hasNext=function(){return u.state.current<_(void 0,u.state,u.props)},u.runIfEnter=function(I,L){if(I.key==="Enter"||I.charCode===13){for(var S=arguments.length,D=new Array(S>2?S-2:0),B=2;B<S;B++)D[B-2]=arguments[B];L.apply(void 0,D)}},u.runIfEnterPrev=function(I){u.runIfEnter(I,u.prev)},u.runIfEnterNext=function(I){u.runIfEnter(I,u.next)},u.runIfEnterJumpPrev=function(I){u.runIfEnter(I,u.jumpPrev)},u.runIfEnterJumpNext=function(I){u.runIfEnter(I,u.jumpNext)},u.handleGoTO=function(I){(I.keyCode===a.ENTER||I.type==="click")&&u.handleChange(u.state.currentInputValue)};var l=c.onChange!==n,b="current"in c;b&&!l&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var m=c.defaultCurrent;"current"in c&&(m=c.current);var w=c.defaultPageSize;return"pageSize"in c&&(w=c.pageSize),m=Math.min(m,_(w,void 0,c)),u.state={current:m,currentInputValue:m,pageSize:w},u}return Object(O.a)(y,[{key:"componentDidUpdate",value:function(u,l){var b=this.props.prefixCls;if(l.current!==this.state.current&&this.paginationNode){var m=this.paginationNode.querySelector(".".concat(b,"-item-").concat(l.current));m&&document.activeElement===m&&m.blur()}}},{key:"getValidValue",value:function(u){var l=u.target.value,b=_(void 0,this.state,this.props),m=this.state.currentInputValue,w;return l===""?w=l:isNaN(Number(l))?w=m:l>=b?w=b:w=Number(l),w}},{key:"getShowSizeChanger",value:function(){var u=this.props,l=u.showSizeChanger,b=u.total,m=u.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:b>m}},{key:"renderPrev",value:function(u){var l=this.props,b=l.prevIcon,m=l.itemRender,w=m(u,"prev",this.getItemIcon(b,"prev page")),I=!this.hasPrev();return Object(F.isValidElement)(w)?Object(F.cloneElement)(w,{disabled:I}):w}},{key:"renderNext",value:function(u){var l=this.props,b=l.nextIcon,m=l.itemRender,w=m(u,"next",this.getItemIcon(b,"next page")),I=!this.hasNext();return Object(F.isValidElement)(w)?Object(F.cloneElement)(w,{disabled:I}):w}},{key:"render",value:function(){var u=this,l=this.props,b=l.prefixCls,m=l.className,w=l.style,I=l.disabled,L=l.hideOnSinglePage,S=l.total,D=l.locale,B=l.showQuickJumper,R=l.showLessItems,W=l.showTitle,Y=l.showTotal,se=l.simple,ne=l.itemRender,Se=l.showPrevNextJumpers,xe=l.jumpPrevIcon,we=l.jumpNextIcon,Re=l.selectComponentClass,Pe=l.selectPrefixCls,ye=l.pageSizeOptions,ee=this.state,je=ee.current,et=ee.pageSize,He=ee.currentInputValue;if(L===!0&&S<=et)return null;var Ne=_(void 0,this.state,this.props),Ye=[],Ae=null,Ue=null,Ve=null,Q=null,fe=null,be=B&&B.goButton,Ee=R?1:2,ke=je-1>0?je-1:0,We=je+1<Ne?je+1:Ne,Xe=Object.keys(this.props).reduce(function(X,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(X[$]=u.props[$]),X},{});if(se)return be&&(typeof be=="boolean"?fe=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},D.jump_to_confirm):fe=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},be),fe=e.a.createElement("li",{title:W?"".concat(D.jump_to).concat(je,"/").concat(Ne):null,className:"".concat(b,"-simple-pager")},fe)),e.a.createElement("ul",Object(q.a)({className:f()(b,"".concat(b,"-simple"),Object(j.a)({},"".concat(b,"-disabled"),I),m),style:w,ref:this.savePaginationNode},Xe),e.a.createElement("li",{title:W?D.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:f()("".concat(b,"-prev"),Object(j.a)({},"".concat(b,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ke)),e.a.createElement("li",{title:W?"".concat(je,"/").concat(Ne):null,className:"".concat(b,"-simple-pager")},e.a.createElement("input",{type:"text",value:He,disabled:I,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(b,"-slash")},"/"),Ne),e.a.createElement("li",{title:W?D.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:f()("".concat(b,"-next"),Object(j.a)({},"".concat(b,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(We)),fe);if(Ne<=3+Ee*2){var ze={locale:D,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:W,itemRender:ne};Ne||Ye.push(e.a.createElement(o,Object(q.a)({},ze,{key:"noPager",page:Ne,className:"".concat(b,"-disabled")})));for(var qe=1;qe<=Ne;qe+=1){var Qe=je===qe;Ye.push(e.a.createElement(o,Object(q.a)({},ze,{key:qe,page:qe,active:Qe})))}}else{var Ze=R?D.prev_3:D.prev_5,Ge=R?D.next_3:D.next_5;Se&&(Ae=e.a.createElement("li",{title:W?Ze:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:f()("".concat(b,"-jump-prev"),Object(j.a)({},"".concat(b,"-jump-prev-custom-icon"),!!xe))},ne(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),Ue=e.a.createElement("li",{title:W?Ge:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:f()("".concat(b,"-jump-next"),Object(j.a)({},"".concat(b,"-jump-next-custom-icon"),!!we))},ne(this.getJumpNextPage(),"jump-next",this.getItemIcon(we,"next page")))),Q=e.a.createElement(o,{locale:D,last:!0,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:!1,showTitle:W,itemRender:ne}),Ve=e.a.createElement(o,{locale:D,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:W,itemRender:ne});var it=Math.max(1,je-Ee),nt=Math.min(je+Ee,Ne);je-1<=Ee&&(nt=1+Ee*2),Ne-je<=Ee&&(it=Ne-Ee*2);for(var Ie=it;Ie<=nt;Ie+=1){var Me=je===Ie;Ye.push(e.a.createElement(o,{locale:D,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ie,page:Ie,active:Me,showTitle:W,itemRender:ne}))}je-1>=Ee*2&&je!==1+2&&(Ye[0]=Object(F.cloneElement)(Ye[0],{className:"".concat(b,"-item-after-jump-prev")}),Ye.unshift(Ae)),Ne-je>=Ee*2&&je!==Ne-2&&(Ye[Ye.length-1]=Object(F.cloneElement)(Ye[Ye.length-1],{className:"".concat(b,"-item-before-jump-next")}),Ye.push(Ue)),it!==1&&Ye.unshift(Ve),nt!==Ne&&Ye.push(Q)}var pe=null;Y&&(pe=e.a.createElement("li",{className:"".concat(b,"-total-text")},Y(S,[S===0?0:(je-1)*et+1,je*et>S?S:je*et])));var ue=!this.hasPrev()||!Ne,ce=!this.hasNext()||!Ne;return e.a.createElement("ul",Object(q.a)({className:f()(b,m,Object(j.a)({},"".concat(b,"-disabled"),I)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},Xe),pe,e.a.createElement("li",{title:W?D.prev_page:null,onClick:this.prev,tabIndex:ue?null:0,onKeyPress:this.runIfEnterPrev,className:f()("".concat(b,"-prev"),Object(j.a)({},"".concat(b,"-disabled"),ue)),"aria-disabled":ue},this.renderPrev(ke)),Ye,e.a.createElement("li",{title:W?D.next_page:null,onClick:this.next,tabIndex:ce?null:0,onKeyPress:this.runIfEnterNext,className:f()("".concat(b,"-next"),Object(j.a)({},"".concat(b,"-disabled"),ce)),"aria-disabled":ce},this.renderNext(We)),e.a.createElement(h,{disabled:I,locale:D,rootPrefixCls:b,selectComponentClass:Re,selectPrefixCls:Pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:je,pageSize:et,pageSizeOptions:ye,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:be}))}}],[{key:"getDerivedStateFromProps",value:function(u,l){var b={};if("current"in u&&(b.current=u.current,u.current!==l.current&&(b.currentInputValue=b.current)),"pageSize"in u&&u.pageSize!==l.pageSize){var m=l.current,w=_(u.pageSize,l,u);m=m>w?w:m,"current"in u||(b.current=m,b.currentInputValue=m),b.pageSize=u.pageSize}return b}}]),y}(e.a.Component);g.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:s.a,style:{},itemRender:t,totalBoundaryShowSizeChanger:50};var v=g},"6UM0":function(st,ve,z){var q,j;(function(){var A;(function(){"use strict";var O=[function(e,C,f){var p=f(1).Beautifier,o=f(5).Options;function a(r,h){var s=new p(r,h);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new o}},function(e,C,f){var p=f(2).Output,o=f(3).Token,a=f(4),r=f(5).Options,h=f(7).Tokenizer,s=f(7).line_starters,n=f(7).positionable_operators,i=f(7).TOKEN;function t(R,W){return W.indexOf(R)!==-1}function _(R){return R.replace(/^\s+/g,"")}function g(R){for(var W={},Y=0;Y<R.length;Y++)W[R[Y].replace(/-/g,"_")]=R[Y];return W}function v(R,W){return R&&R.type===i.RESERVED&&R.text===W}function x(R,W){return R&&R.type===i.RESERVED&&t(R.text,W)}var E=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],c=g(y),u=[c.before_newline,c.preserve_newline],l={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function b(R,W){if(W.multiline_frame||W.mode===l.ForInitializer||W.mode===l.Conditional)return;R.remove_indent(W.start_line_index)}function m(R){R=R.replace(a.allLineBreaks,`
|
|
`);for(var W=[],Y=R.indexOf(`
|
|
`);Y!==-1;)W.push(R.substring(0,Y)),R=R.substring(Y+1),Y=R.indexOf(`
|
|
`);return R.length&&W.push(R),W}function w(R){return R===l.ArrayLiteral}function I(R){return t(R,[l.Expression,l.ForInitializer,l.Conditional])}function L(R,W){for(var Y=0;Y<R.length;Y++){var se=R[Y].trim();if(se.charAt(0)!==W)return!1}return!0}function S(R,W){for(var Y=0,se=R.length,ne;Y<se;Y++)if(ne=R[Y],ne&&ne.indexOf(W)!==0)return!1;return!0}function D(R,W){W=W||{},this._source_text=R||"",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 r(W)}D.prototype.create_flags=function(R,W){var Y=0;R&&(Y=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>Y&&(Y=R.line_indent_level));var se={mode:W,parent:R,last_token:R?R.last_token:new o(i.START_BLOCK,""),last_word:R?R.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:Y,alignment:0,line_indent_level:R?R.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},D.prototype._reset=function(R){var W=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(l.BlockStatement);var Y=new h(R,this._options);return this._tokens=Y.tokenize(),R},D.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,W=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
|
|
`,W&&a.lineBreak.test(W||"")&&(Y=W.match(a.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return R=this._output.get_code(Y),R},D.prototype.handle_token=function(R,W){R.type===i.START_EXPR?this.handle_start_expr(R):R.type===i.END_EXPR?this.handle_end_expr(R):R.type===i.START_BLOCK?this.handle_start_block(R):R.type===i.END_BLOCK?this.handle_end_block(R):R.type===i.WORD?this.handle_word(R):R.type===i.RESERVED?this.handle_word(R):R.type===i.SEMICOLON?this.handle_semicolon(R):R.type===i.STRING?this.handle_string(R):R.type===i.EQUALS?this.handle_equals(R):R.type===i.OPERATOR?this.handle_operator(R):R.type===i.COMMA?this.handle_comma(R):R.type===i.BLOCK_COMMENT?this.handle_block_comment(R,W):R.type===i.COMMENT?this.handle_comment(R,W):R.type===i.DOT?this.handle_dot(R):R.type===i.EOF?this.handle_eof(R):R.type===i.UNKNOWN?this.handle_unknown(R,W):this.handle_unknown(R,W)},D.prototype.handle_whitespace_and_comments=function(R,W){var Y=R.newlines,se=this._options.keep_array_indentation&&w(this._flags.mode);if(R.comments_before)for(var ne=R.comments_before.next();ne;)this.handle_whitespace_and_comments(ne,W),this.handle_token(ne,W),ne=R.comments_before.next();if(se)for(var Se=0;Se<Y;Se+=1)this.print_newline(Se>0,W);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,W);for(var xe=1;xe<Y;xe+=1)this.print_newline(!0,W)}};var B=["async","break","continue","return","throw","yield"];D.prototype.allow_wrap_or_preserved_newline=function(R,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var Y=this._options.preserve_newlines&&R.newlines||W,se=t(this._flags.last_token.text,n)||t(R.text,n);if(se){var ne=t(this._flags.last_token.text,n)&&t(this._options.operator_position,u)||t(R.text,n);Y=Y&&ne}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(x(this._flags.last_token,B))return;this._output.set_wrap_point()}},D.prototype.print_newline=function(R,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Y=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&v(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(R)&&(this._flags.multiline_frame=!0)},D.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(R.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))},D.prototype.print_token=function(R){if(this._output.raw){this._output.add_raw_token(R);return}if(this._options.comma_first&&R.previous&&R.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(R),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(R),this._output.non_breaking_space=!0,this._output.add_token(R.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},D.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.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))},D.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===l.Statement&&b(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.start_of_object_property=function(){return this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||x(this._flags.last_token,["get","set"]))},D.prototype.start_of_statement=function(R){var W=!1;return W=W||x(this._flags.last_token,["var","let","const"])&&R.type===i.WORD,W=W||v(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement)&&x(this._flags.last_token,B)&&!R.newlines,W=W||v(this._flags.last_token,"else")&&!(v(R,"if")&&!R.comments_before),W=W||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===l.ForInitializer||this._previous_flags.mode===l.Conditional),W=W||this._flags.last_token.type===i.WORD&&this._flags.mode===l.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==i.WORD&&R.type!==i.RESERVED,W=W||this._flags.mode===l.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||x(this._flags.last_token,["get","set"])),W?(this.set_mode(l.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,x(R,["do","for","if","while"])),!0):!1},D.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var W=l.Expression;if(R.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){x(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=l.ArrayLiteral,w(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())),t(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=l.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=l.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var se=this._tokens.peek(-4);x(Y,["async","function"])||Y.text==="*"&&x(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===l.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(se.text==="{"||se.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(R);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&t(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},D.prototype.handle_end_expr=function(R){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(R),this.restore_mode(),b(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===l.Conditional&&(this._previous_flags.mode=l.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},D.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var W=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(l.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(l.BlockStatement):Y&&(t(Y.text,[":",","])&&t(W.type,[i.STRING,i.WORD,i.RESERVED])||t(W.text,["get","set","..."])&&t(Y.type,[i.WORD,i.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(Y.text,[":",","])?this.set_mode(l.BlockStatement):this.set_mode(l.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(l.BlockStatement):t(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||x(this._flags.last_token,["return","throw","import","default"])?this.set_mode(l.ObjectLiteral):this.set_mode(l.BlockStatement),this._flags.last_token&&(x(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!W.comments_before&&W.text==="}",ne=se&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Se=0,xe=null;this._flags.inline_frame=!0;do if(Se+=1,xe=this._tokens.peek(Se-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==i.EOF&&!(xe.type===i.END_BLOCK&&xe.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(ne||this._flags.last_token.type===i.EQUALS||x(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},D.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===l.Statement;)this.restore_mode();var W=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(w(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(R)},D.prototype.handle_word=function(R){if(R.type===i.RESERVED){if(t(R.text,["set","get"])&&this._flags.mode!==l.ObjectLiteral)R.type=i.WORD;else if(R.text==="import"&&t(this._tokens.peek().text,["(","."]))R.type=i.WORD;else if(t(R.text,["as","from"])&&!this._flags.import_block)R.type=i.WORD;else if(this._flags.mode===l.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(R.type=i.WORD)}}if(this.start_of_statement(R)?x(this._flags.last_token,["var","let","const"])&&R.type===i.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!I(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!x(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(v(R,"while")){this._output.space_before_token=!0,this.print_token(R),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&&v(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===l.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&x(R,["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(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R)),v(R,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?x(this._flags.last_token,["get","set","new","export"])||x(this._flags.last_token,B)?this._output.space_before_token=!0:v(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(I(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var Y="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":x(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===l.BlockStatement?Y="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&I(this._flags.mode)?Y="SPACE":this._flags.last_token.type===i.STRING?Y="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&t(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),x(R,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),x(R,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===l.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?x(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&x(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!x(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(v(R,"if")&&v(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):x(R,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===i.WORD||R.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===i.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&v(R,"from")&&(this._flags.import_block=!1))},D.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var W=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&v(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},D.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},D.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},D.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(I(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)):this._flags.mode===l.ObjectLiteral||this._flags.mode===l.Statement&&this._flags.parent.mode===l.ObjectLiteral?(this._flags.mode===l.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},D.prototype.handle_operator=function(R){var W=R.text==="*"&&(x(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),Y=t(R.text,["-","+"])&&(t(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var se=!W;this.handle_whitespace_and_comments(R,se)}if(R.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===i.OPERATOR&&t(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ne=!0,Se=!0,xe=!1;if(R.text===":"?this._flags.ternary_depth===0?ne=!1:(this._flags.ternary_depth-=1,xe=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!W&&this._options.preserve_newlines&&t(R.text,n)){var we=R.text===":",Re=we&&xe,Pe=we&&!xe;switch(this._options.operator_position){case c.before_newline:this._output.space_before_token=!Pe,this.print_token(R),(!we||Re)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case c.after_newline:this._output.space_before_token=!0,!we||Re?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case c.preserve_newline:Pe||this.allow_wrap_or_preserved_newline(R),ne=!(this._output.just_added_newline()||Pe),this._output.space_before_token=ne,this.print_token(R),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(R),ne=!1;var ye=this._tokens.peek();Se=ye&&t(ye.type,[i.WORD,i.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),ne=this._flags.last_token.type===i.START_BLOCK,Se=!1;else if(t(R.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),ne=!1,Se=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var ee=x(this._flags.last_token,E)&&R.newlines;ee&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ee,!0)}this._flags.last_token.text===";"&&I(this._flags.mode)&&(ne=!0),this._flags.last_token.type===i.RESERVED?ne=!0:this._flags.last_token.type===i.END_EXPR?ne=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===i.OPERATOR&&(ne=t(R.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(R.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(Se=!0)),(this._flags.mode===l.BlockStatement&&!this._flags.inline_frame||this._flags.mode===l.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ne,this.print_token(R),this._output.space_before_token=Se},D.prototype.handle_block_comment=function(R,W){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,W),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,W)},D.prototype.print_block_commment=function(R,W){var Y=m(R.text),se,ne=!1,Se=!1,xe=R.whitespace_before,we=xe.length;if(this.print_newline(!1,W),this.print_token_line_indentation(R),this._output.add_token(Y[0]),this.print_newline(!1,W),Y.length>1){for(Y=Y.slice(1),ne=L(Y,"*"),Se=S(Y,xe),ne&&(this._flags.alignment=1),se=0;se<Y.length;se++)ne?(this.print_token_line_indentation(R),this._output.add_token(_(Y[se]))):Se&&Y[se]?(this.print_token_line_indentation(R),this._output.add_token(Y[se].substring(we))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[se])),this.print_newline(!1,W);this._flags.alignment=0}},D.prototype.handle_comment=function(R,W){R.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(R),this.print_newline(!1,W)},D.prototype.handle_dot=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),x(this._flags.last_token,E)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(R,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(R)},D.prototype.handle_unknown=function(R,W){this.print_token(R),R.text[R.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},D.prototype.handle_eof=function(R){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},e.exports.Beautifier=D},function(e){function C(o){this.__parent=o,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=[]}C.prototype.clone_empty=function(){var o=new C(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},C.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},C.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},C.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},C.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)},C.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},C.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},C.prototype.is_empty=function(){return this.__items.length===0},C.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},C.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},C.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},C.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},C.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},C.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},C.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function f(o,a){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}f.prototype.get_indent_size=function(o,a){var r=this.__base_string_length;return a=a||0,o<0&&(r=0),r+=o*this.__indent_size,r+=a,r},f.prototype.get_indent_string=function(o,a){var r=this.__base_string;return a=a||0,o<0&&(o=0,r=""),a+=o*this.__indent_size,this.__ensure_cache(a),r+=this.__cache[a],r},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,a=0,r="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,r=new Array(a+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function p(o,a){this.__indent_cache=new f(o,a),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new C(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},p.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(r=r.replace(/[\n]/g,o)),r},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(o,a){for(var r=this.__lines.length-2;r>=0;){var h=this.__lines[r];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==a){this.__lines.splice(r+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=p},function(e){function C(f,p,o,a){this.type=f,this.text=p,this.comments_before=null,this.newlines=o||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=C},function(e,C){var f="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",o="\\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",a="\\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",r="(?:\\\\u[0-9a-fA-F]{4}|["+f+o+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+p+o+a+"])*";C.identifier=new RegExp(r+h,"g"),C.identifierStart=new RegExp(r),C.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+o+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;C.newline=/[\n\r\u2028\u2029]/,C.lineBreak=new RegExp(`\r
|
|
|`+C.newline.source),C.allLineBreaks=new RegExp(C.lineBreak.source,"g")},function(e,C,f){var p=f(6).Options,o=["before-newline","after-newline","preserve-newline"];function a(r){p.call(this,r,"js");var h=this.raw_options.brace_style||null;h==="expand-strict"?this.raw_options.brace_style="expand":h==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<s.length;n++)s[n]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[n];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",o),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new p,e.exports.Options=a},function(e){function C(o,a){this.raw_options=f(o,a),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"])}C.prototype._get_array=function(o,a){var r=this.raw_options[o],h=a||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(h=r.concat()):typeof r=="string"&&(h=r.split(/[^a-zA-Z0-9_\/\-]+/)),h},C.prototype._get_boolean=function(o,a){var r=this.raw_options[o],h=r===void 0?!!a:!!r;return h},C.prototype._get_characters=function(o,a){var r=this.raw_options[o],h=a||"";return typeof r=="string"&&(h=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},C.prototype._get_number=function(o,a){var r=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var h=parseInt(r,10);return isNaN(h)&&(h=a),h},C.prototype._get_selection=function(o,a,r){var h=this._get_selection_list(o,a,r);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},C.prototype._get_selection_list=function(o,a,r){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[a[0]],!this._is_valid_selection(r,a))throw new Error("Invalid Default Value!");var h=this._get_array(o,r);if(!this._is_valid_selection(h,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},C.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(r){return a.indexOf(r)===-1})};function f(o,a){var r={};o=p(o);var h;for(h in o)h!==a&&(r[h]=o[h]);if(a&&o[a])for(h in o[a])r[h]=o[a][h];return r}function p(o){var a={},r;for(r in o){var h=r.replace(/-/g,"_");a[h]=o[r]}return a}e.exports.Options=C,e.exports.normalizeOpts=p,e.exports.mergeOpts=f},function(e,C,f){var p=f(8).InputScanner,o=f(9).Tokenizer,a=f(9).TOKEN,r=f(13).Directives,h=f(4),s=f(12).Pattern,n=f(14).TemplatablePattern;function i(L,S){return S.indexOf(L)!==-1}var t={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:a.START,RAW:a.RAW,EOF:a.EOF},_=new r(/\/\*/,/\*\//),g=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,v=/[0-9]/,x=/[^\d\.]/,E=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var c=new RegExp(y),u="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),l=u.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),b=new RegExp("^(?:"+l.join("|")+")$"),m,w=function(L,S){o.call(this,L,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var D=new s(this._input),B=new n(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(h.identifier).matching(h.identifierMatch),number:D.matching(g),punct:D.matching(c),comment:D.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:D.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:D.matching(/<!--/),html_comment_end:D.matching(/-->/),include:D.starting_with(/#include/).until_after(h.lineBreak),shebang:D.starting_with(/#!/).until_after(h.lineBreak),xml:D.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(/[`}\\]/)}};w.prototype=new o,w.prototype._is_comment=function(L){return L.type===t.COMMENT||L.type===t.BLOCK_COMMENT||L.type===t.UNKNOWN},w.prototype._is_opening=function(L){return L.type===t.START_BLOCK||L.type===t.START_EXPR},w.prototype._is_closing=function(L,S){return(L.type===t.END_BLOCK||L.type===t.END_EXPR)&&S&&(L.text==="]"&&S.text==="["||L.text===")"&&S.text==="("||L.text==="}"&&S.text==="{")},w.prototype._reset=function(){m=!1},w.prototype._get_next_token=function(L,S){var D=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(t.EOF,""):(D=D||this._read_non_javascript(B),D=D||this._read_string(B),D=D||this._read_word(L),D=D||this._read_singles(B),D=D||this._read_comment(B),D=D||this._read_regexp(B,L),D=D||this._read_xml(B,L),D=D||this._read_punctuation(),D=D||this._create_token(t.UNKNOWN,this._input.next()),D)},w.prototype._read_word=function(L){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(h.allLineBreaks,`
|
|
`),!(L.type===t.DOT||L.type===t.RESERVED&&(L.text==="set"||L.text==="get"))&&b.test(S)?(S==="in"||S==="of")&&(L.type===t.WORD||L.type===t.STRING)?this._create_token(t.OPERATOR,S):this._create_token(t.RESERVED,S):this._create_token(t.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(t.WORD,S)},w.prototype._read_singles=function(L){var S=null;return L==="("||L==="["?S=this._create_token(t.START_EXPR,L):L===")"||L==="]"?S=this._create_token(t.END_EXPR,L):L==="{"?S=this._create_token(t.START_BLOCK,L):L==="}"?S=this._create_token(t.END_BLOCK,L):L===";"?S=this._create_token(t.SEMICOLON,L):L==="."&&x.test(this._input.peek(1))?S=this._create_token(t.DOT,L):L===","&&(S=this._create_token(t.COMMA,L)),S&&this._input.next(),S},w.prototype._read_punctuation=function(){var L=this.__patterns.punct.read();if(L!=="")return L==="="?this._create_token(t.EQUALS,L):L==="?."?this._create_token(t.DOT,L):this._create_token(t.OPERATOR,L)},w.prototype._read_non_javascript=function(L){var S="";if(L==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(t.UNKNOWN,S.trim()+`
|
|
`);if(S=this.__patterns.include.read(),S)return this._create_token(t.UNKNOWN,S.trim()+`
|
|
`);L=this._input.next();var D="#";if(this._input.hasNext()&&this._input.testChar(v)){do L=this._input.next(),D+=L;while(this._input.hasNext()&&L!=="#"&&L!=="=");return L==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(D+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(D+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,D)}this._input.back()}else if(L==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(h.newline);)S+=this._input.next();return m=!0,this._create_token(t.COMMENT,S)}}else if(m&&L==="-"&&(S=this.__patterns.html_comment_end.read(),S))return m=!1,this._create_token(t.COMMENT,S);return null},w.prototype._read_comment=function(L){var S=null;if(L==="/"){var D="";if(this._input.peek(1)==="*"){D=this.__patterns.block_comment.read();var B=_.get_directives(D);B&&B.ignore==="start"&&(D+=_.readIgnored(this._input)),D=D.replace(h.allLineBreaks,`
|
|
`),S=this._create_token(t.BLOCK_COMMENT,D),S.directives=B}else this._input.peek(1)==="/"&&(D=this.__patterns.comment.read(),S=this._create_token(t.COMMENT,D))}return S},w.prototype._read_string=function(L){if(L==="`"||L==="'"||L==='"'){var S=this._input.next();return this.has_char_escapes=!1,L==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(L),this.has_char_escapes&&this._options.unescape_strings&&(S=I(S)),this._input.peek()===L&&(S+=this._input.next()),S=S.replace(h.allLineBreaks,`
|
|
`),this._create_token(t.STRING,S)}return null},w.prototype._allow_regexp_or_xml=function(L){return L.type===t.RESERVED&&i(L.text,["return","case","throw","else","do","typeof","yield"])||L.type===t.END_EXPR&&L.text===")"&&L.opened.previous.type===t.RESERVED&&i(L.opened.previous.text,["if","while","for"])||i(L.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},w.prototype._read_regexp=function(L,S){if(L==="/"&&this._allow_regexp_or_xml(S)){for(var D=this._input.next(),B=!1,R=!1;this._input.hasNext()&&(B||R||this._input.peek()!==L)&&!this._input.testChar(h.newline);)D+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===L&&(D+=this._input.next(),D+=this._input.read(h.identifier)),this._create_token(t.STRING,D)}return null},w.prototype._read_xml=function(L,S){if(this._options.e4x&&L==="<"&&this._allow_regexp_or_xml(S)){var D="",B=this.__patterns.xml.read_match();if(B){for(var R=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=R.indexOf("{")===0,Y=0;B;){var se=!!B[1],ne=B[2],Se=!!B[B.length-1]||ne.slice(0,8)==="![CDATA[";if(!Se&&(ne===R||W&&ne.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--Y:++Y),D+=B[0],Y<=0)break;B=this.__patterns.xml.read_match()}return B||(D+=this._input.match(/[\s\S]*/g)[0]),D=D.replace(h.allLineBreaks,`
|
|
`),this._create_token(t.STRING,D)}}return null};function I(L){for(var S="",D=0,B=new p(L),R=null;B.hasNext();)if(R=B.match(/([\s]|[^\\]|\\\\)+/g),R&&(S+=R[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")R=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")R=B.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",B.hasNext()&&(S+=B.next());continue}if(!R)return L;if(D=parseInt(R[1],16),D>126&&D<=255&&R[0].indexOf("x")===0)return L;if(D>=0&&D<32){S+="\\"+R[0];continue}else D===34||D===39||D===92?S+="\\"+String.fromCharCode(D):S+=String.fromCharCode(D)}return S}w.prototype._read_string_recursive=function(L,S,D){var B,R;L==="'"?R=this.__patterns.single_quote:L==='"'?R=this.__patterns.double_quote:L==="`"?R=this.__patterns.template_text:L==="}"&&(R=this.__patterns.template_expression);for(var W=R.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===L||!S&&h.newline.test(Y)){this._input.back();break}else Y==="\\"&&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(),Y+=this._input.next()):D&&(D==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),D===Y&&(L==="`"?Y+=this._read_string_recursive("}",S,"`"):Y+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=R.read(),W+=Y}return W},e.exports.Tokenizer=w,e.exports.TOKEN=t,e.exports.positionable_operators=E.slice(),e.exports.line_starters=u.slice()},function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function f(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},f.prototype.peek=function(p){var o=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(o=this.__input.charAt(p)),o},f.prototype.__match=function(p,o){p.lastIndex=o;var a=p.exec(this.__input);return a&&!(C&&p.sticky)&&(a.index!==o&&(a=null)),a},f.prototype.test=function(p,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(p,o):!1},f.prototype.testChar=function(p,o){var a=this.peek(o);return p.lastIndex=0,a!==null&&p.test(a)},f.prototype.match=function(p){var o=this.__match(p,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(p,o,a){var r="",h;return p&&(h=this.match(p),h&&(r+=h[0])),o&&(h||!p)&&(r+=this.readUntil(o,a)),r},f.prototype.readUntil=function(p,o){var a="",r=this.__position;p.lastIndex=this.__position;var h=p.exec(this.__input);return h?(r=h.index,o&&(r+=h[0].length)):r=this.__input_length,a=this.__input.substring(this.__position,r),this.__position=r,a},f.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},f.prototype.get_regexp=function(p,o){var a=null,r="g";return o&&C&&(r="y"),typeof p=="string"&&p!==""?a=new RegExp(p,r):p&&(a=new RegExp(p.source,r)),a},f.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(p){var o=this.__position,a=this.readUntilAfter(p);return this.__position=o,a},f.prototype.lookBack=function(p){var o=this.__position-1;return o>=p.length&&this.__input.substring(o-p.length,o).toLowerCase()===p},e.exports.InputScanner=f},function(e,C,f){var p=f(8).InputScanner,o=f(3).Token,a=f(10).TokenStream,r=f(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(n,i){this._input=new p(n),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var n,i=new o(h.START,""),t=null,_=[],g=new a;i.type!==h.EOF;){for(n=this._get_next_token(i,t);this._is_comment(n);)g.add(n),n=this._get_next_token(i,t);g.isEmpty()||(n.comments_before=g,g=new a),n.parent=t,this._is_opening(n)?(_.push(t),t=n):t&&this._is_closing(n,t)&&(n.opened=t,t.closed=n,t=_.pop(),n.parent=t),n.previous=i,i.next=n,this.__tokens.add(n),i=n}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(n,i){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(h.RAW,t):this._create_token(h.EOF,"")},s.prototype._is_comment=function(n){return!1},s.prototype._is_opening=function(n){return!1},s.prototype._is_closing=function(n,i){return!1},s.prototype._create_token=function(n,i){var t=new o(n,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=h},function(e){function C(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}C.prototype.restart=function(){this.__position=0},C.prototype.isEmpty=function(){return this.__tokens_length===0},C.prototype.hasNext=function(){return this.__position<this.__tokens_length},C.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},C.prototype.peek=function(f){var p=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(p=this.__tokens[f]),p},C.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},e.exports.TokenStream=C},function(e,C,f){var p=f(12).Pattern;function o(a,r){p.call(this,a,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new p,o.prototype.__set_whitespace_patterns=function(a,r){a+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var r=this.__split(this._newline_regexp,a);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return a},o.prototype.matching=function(a,r){var h=this._create();return h.__set_whitespace_patterns(a,r),h._update(),h},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(a,r){a.lastIndex=0;for(var h=0,s=[],n=a.exec(r);n;)s.push(r.substring(h,n.index)),h=n.index+n[0].length,n=a.exec(r);return h<r.length?s.push(r.substring(h,r.length)):s.push(""),s},e.exports.WhitespacePattern=o},function(e){function C(f,p){this._input=f,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}C.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},C.prototype.read_match=function(){return this._input.match(this._match_pattern)},C.prototype.until_after=function(f){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(f),p._update(),p},C.prototype.until=function(f){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(f),p._update(),p},C.prototype.starting_with=function(f){var p=this._create();return p._starting_pattern=this._input.get_regexp(f,!0),p._update(),p},C.prototype.matching=function(f){var p=this._create();return p._match_pattern=this._input.get_regexp(f,!0),p._update(),p},C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){},e.exports.Pattern=C},function(e){function C(f,p){f=typeof f=="string"?f:f.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+p,"g")}C.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)p[o[1]]=o[2],o=this.__directive_pattern.exec(f);return p},C.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},function(e,C,f){var p=f(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(r,h){p.call(this,r,h),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var s=new p(r);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new p,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(r){var h=this._create();return h._disabled[r]=!0,h._update(),h},a.prototype.read_options=function(r){var h=this._create();for(var s in o)h._disabled[s]=r.templating.indexOf(s)===-1;return h._update(),h},a.prototype.exclude=function(r){var h=this._create();return h._excluded[r]=!0,h._update(),h},a.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),r+=h,h=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},a.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},a.prototype._read_template=function(){var r="",h=this._input.peek();if(h==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(r=r||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},e.exports.TemplatablePattern=a}],M={};function H(e){var C=M[e];if(C!==void 0)return C.exports;var f=M[e]={exports:{}};return O[e](f,f.exports,H),f.exports}var F=H(0);A=F})();var U=A;!(q=[],j=function(){return{js_beautify:U}}.apply(ve,q),j!==void 0&&(st.exports=j))})()},"746U":function(st,ve,z){"use strict";z.d(ve,"f",function(){return q}),z.d(ve,"l",function(){return j}),z.d(ve,"k",function(){return A}),z.d(ve,"j",function(){return U}),z.d(ve,"g",function(){return O}),z.d(ve,"m",function(){return M}),z.d(ve,"h",function(){return H}),z.d(ve,"n",function(){return F}),z.d(ve,"c",function(){return e}),z.d(ve,"a",function(){return C}),z.d(ve,"i",function(){return f}),z.d(ve,"o",function(){return p}),z.d(ve,"e",function(){return r}),z.d(ve,"d",function(){return h}),z.d(ve,"p",function(){return s}),z.d(ve,"b",function(){return n});function q(i){return Array.isArray(i)}function j(i){return typeof i=="string"}function A(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function U(i){return typeof i=="number"&&!isNaN(i)}function O(i){return i===!0||i===!1}function M(i){return typeof i=="undefined"}function H(i){return!F(i)}function F(i){return M(i)||i===null}function e(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function C(i){if(F(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function f(i){return typeof i=="function"}function p(i,t){const _=Math.min(i.length,t.length);for(let g=0;g<_;g++)o(i[g],t[g])}function o(i,t){if(j(t)){if(typeof i!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(f(t)){try{if(i instanceof t)return}catch(_){}if(!F(i)&&i.constructor===t)return;if(t.length===1&&t.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(i){let t=[],_=Object.getPrototypeOf(i);for(;Object.prototype!==_;)t=t.concat(Object.getOwnPropertyNames(_)),_=Object.getPrototypeOf(_);return t}function r(i){const t=[];for(const _ of a(i))typeof i[_]=="function"&&t.push(_);return t}function h(i,t){const _=v=>function(){const x=Array.prototype.slice.call(arguments,0);return t(v,x)};let g={};for(const v of i)g[v]=_(v);return g}function s(i){return i===null?void 0:i}function n(i,t="Unreachable"){throw new Error(t)}},"8HAY":function(st,ve,z){"use strict";z.d(ve,"a",function(){return O}),z.d(ve,"b",function(){return M}),z.d(ve,"d",function(){return H}),z.d(ve,"e",function(){return F}),z.d(ve,"c",function(){return e});var q=z("MI8n"),j=z("pmY6"),A=z("3/fG"),U=function(C,f,p,o){function a(r){return r instanceof p?r:new p(function(h){h(r)})}return new(p||(p=Promise))(function(r,h){function s(t){try{i(o.next(t))}catch(_){h(_)}}function n(t){try{i(o.throw(t))}catch(_){h(_)}}function i(t){t.done?r(t.value):a(t.value).then(s,n)}i((o=o.apply(C,f||[])).next())})};class O extends j.a{constructor(C,f="",p="",o=!0,a){super();this._onDidChange=this._register(new q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=C,this._label=f,this._cssClass=p,this._enabled=o,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(C){this._setLabel(C)}_setLabel(C){this._label!==C&&(this._label=C,this._onDidChange.fire({label:C}))}get tooltip(){return this._tooltip||""}set tooltip(C){this._setTooltip(C)}_setTooltip(C){this._tooltip!==C&&(this._tooltip=C,this._onDidChange.fire({tooltip:C}))}get class(){return this._cssClass}set class(C){this._setClass(C)}_setClass(C){this._cssClass!==C&&(this._cssClass=C,this._onDidChange.fire({class:C}))}get enabled(){return this._enabled}set enabled(C){this._setEnabled(C)}_setEnabled(C){this._enabled!==C&&(this._enabled=C,this._onDidChange.fire({enabled:C}))}get checked(){return this._checked}set checked(C){this._setChecked(C)}_setChecked(C){this._checked!==C&&(this._checked=C,this._onDidChange.fire({checked:C}))}run(C,f){return U(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(C))})}}class M extends j.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new q.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new q.b),this.onDidRun=this._onDidRun.event}run(C,f){return U(this,void 0,void 0,function*(){if(!C.enabled)return;this._onBeforeRun.fire({action:C});let p;try{yield this.runAction(C,f)}catch(o){p=o}this._onDidRun.fire({action:C,error:p})})}runAction(C,f){return U(this,void 0,void 0,function*(){yield C.run(f)})}}class H extends O{constructor(C){super(H.ID,C,C?"separator text":"separator");this.checked=!1,this.enabled=!1}}H.ID="vs.actions.separator";class F{constructor(C,f,p,o){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=C,this.label=f,this.class=o,this._actions=p}get actions(){return this._actions}dispose(){}run(){return U(this,void 0,void 0,function*(){})}}class e extends O{constructor(){super(e.ID,A.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(st,ve,z){st.exports={button:"button___1wy9m"}},"9Bee":function(st,ve,z){"use strict";var q=z("DYRE"),j=z("zeV3"),A=z("+L6B"),U=z("2/Rp"),O=z("k1fw"),M=z("9og8"),H=z("tJVT"),F=z("WmNS"),e=z.n(F),C=z("q1tI"),f=z.n(C),p=z("vg9a"),o=z("DlQD"),a=z.n(o),r=z("rUJ1");function h(N,d){var T=N.match(/^(\s+)(?:```)/);if(T===null)return d;var P=T[1];return d.split(`
|
|
`).map(function(K){var k=K.match(/^\s+/);if(k===null)return K;var le=Object(H.a)(k,1),Le=le[0];return Le.length>=P.length?K.slice(P.length):K}).join(`
|
|
`)}var s=[],n=["<ul>"],i=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _(){s.length=0,n=["<ul>"]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function v(N,d,T,P){if(d>=N.length||N[d].level<=T)return d;var K=N[d];P.push("<li><a href='#"+K.anchor+"'>"+K.text+"</a>"),d++;var k=[];return d=v(N,d,K.level,k),k.length>0&&(P.push("<ul>"),k.forEach(function(le){P.push(le)}),P.push("</ul>")),P.push("</li>"),d=v(N,d,T,P),d}function x(){return v(s,0,0,n),n.push("</ul>"),n.join("")}var E={heading:function(d){var T=t.exec(d);if(T)return{type:"heading",raw:T[0],depth:T[1].length,text:T[2]}},fences:function(d){var T=this.rules.block.fences.exec(d);if(T){var P=T[0],K=h(P,T[3]||""),k=T[2]?T[2].trim():T[2];if(["latex","katex","math"].indexOf(k)>=0){var le=u(),Le=K;K=le,l[le]={type:"block",expression:Le}}return{type:"code",raw:P,lang:k,text:K}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,u=function(){return"__special_katext_id_".concat(c++,"__")},l={};function b(){return l}function m(){c=0,l={}}function w(N){return N=N.replace(y,function(d,T){var P=u();return l[P]={type:"inline",expression:T},P}),N}var I=i.listitem;i.listitem=function(N){return I(w(N))};var L=i.paragraph;i.paragraph=function(N){return L(w(N))};var S=i.tablecell;i.tablecell=function(N,d){return S(w(N),d)},i.code=function(N,d,T){var P=(d||"").match(/\S*/)[0];return P?["latex","katex","math"].indexOf(P)>=0?"<p class='editormd-tex'>".concat(N,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(d,'">').concat(T?N:Object(r.escape)(N,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(T?N:Object(r.escape)(N,!0))+"</code></pre>"},i.heading=function(N,d,T){var P=this.options.headerPrefix+T.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:P,level:d,text:N}),"<h"+d+' id="'+P+'">'+N+"</h"+d+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:E,renderer:i});var D=a.a,B=z("SJMd"),R=z("ulZh"),W=z.n(R),Y=z("m3rI"),se=z("Oy/b"),ne=z("p5ED"),Se=z("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 xe=function(N,d){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,P){T.__proto__=P}||function(T,P){for(var K in P)Object.prototype.hasOwnProperty.call(P,K)&&(T[K]=P[K])})(N,d)};function we(N,d){function T(){this.constructor=N}xe(N,d),N.prototype=d===null?Object.create(d):(T.prototype=d.prototype,new T)}function Re(N,d,T,P){return new(T||(T=Promise))(function(K,k){function le(at){try{Je(P.next(at))}catch(De){k(De)}}function Le(at){try{Je(P.throw(at))}catch(De){k(De)}}function Je(at){var De;at.done?K(at.value):(De=at.value,De instanceof T?De:new T(function(mt){mt(De)})).then(le,Le)}Je((P=P.apply(N,d||[])).next())})}function Pe(N,d){var T,P,K,k,le={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return k={next:Le(0),throw:Le(1),return:Le(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function Le(Je){return function(at){return function(De){if(T)throw new TypeError("Generator is already executing.");for(;le;)try{if(T=1,P&&(K=2&De[0]?P.return:De[0]?P.throw||((K=P.return)&&K.call(P),0):P.next)&&!(K=K.call(P,De[1])).done)return K;switch(P=0,K&&(De=[2&De[0],K.value]),De[0]){case 0:case 1:K=De;break;case 4:return le.label++,{value:De[1],done:!1};case 5:le.label++,P=De[1],De=[0];continue;case 7:De=le.ops.pop(),le.trys.pop();continue;default:if(!(K=le.trys,(K=K.length>0&&K[K.length-1])||De[0]!==6&&De[0]!==2)){le=0;continue}if(De[0]===3&&(!K||De[1]>K[0]&&De[1]<K[3])){le.label=De[1];break}if(De[0]===6&&le.label<K[1]){le.label=K[1],K=De;break}if(K&&le.label<K[2]){le.label=K[2],le.ops.push(De);break}K[2]&&le.ops.pop(),le.trys.pop();continue}De=d.call(N,le)}catch(mt){De=[6,mt],P=0}finally{T=K=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([Je,at])}}}function ye(){for(var N=0,d=0,T=arguments.length;d<T;d++)N+=arguments[d].length;var P=Array(N),K=0;for(d=0;d<T;d++)for(var k=arguments[d],le=0,Le=k.length;le<Le;le++,K++)P[K]=k[le];return P}var ee=function(){function N(){}return N.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},N.setAttributes=function(d,T){for(var P=0,K=T;P<K.length;P++){var k=K[P],le=k[0],Le=k[1];d.setAttribute(le,Le)}},N.createRect=function(d,T,P){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",d.toString()),K.setAttribute("height",T.toString()),P&&N.setAttributes(K,P),K},N.createLine=function(d,T,P,K,k){var le=document.createElementNS("http://www.w3.org/2000/svg","line");return le.setAttribute("x1",d.toString()),le.setAttribute("y1",T.toString()),le.setAttribute("x2",P.toString()),le.setAttribute("y2",K.toString()),k&&N.setAttributes(le,k),le},N.createPolygon=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","polygon");return P.setAttribute("points",d),T&&N.setAttributes(P,T),P},N.createCircle=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","circle");return P.setAttribute("cx",(d/2).toString()),P.setAttribute("cy",(d/2).toString()),P.setAttribute("r",d.toString()),T&&N.setAttributes(P,T),P},N.createEllipse=function(d,T,P){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(d/2).toString()),K.setAttribute("cy",(T/2).toString()),K.setAttribute("rx",(d/2).toString()),K.setAttribute("ry",(T/2).toString()),P&&N.setAttributes(K,P),K},N.createGroup=function(d){var T=document.createElementNS("http://www.w3.org/2000/svg","g");return d&&N.setAttributes(T,d),T},N.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},N.createMarker=function(d,T,P,K,k,le,Le){var Je=document.createElementNS("http://www.w3.org/2000/svg","marker");return N.setAttributes(Je,[["id",d],["orient",T],["markerWidth",P.toString()],["markerHeight",K.toString()],["refX",k.toString()],["refY",le.toString()]]),Je.appendChild(Le),Je},N.createText=function(d){var T=document.createElementNS("http://www.w3.org/2000/svg","text");return T.setAttribute("x","0"),T.setAttribute("y","0"),d&&N.setAttributes(T,d),T},N.createTSpan=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","tspan");return P.textContent=d,T&&N.setAttributes(P,T),P},N.createImage=function(d){var T=document.createElementNS("http://www.w3.org/2000/svg","image");return d&&N.setAttributes(T,d),T},N.createPoint=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return P.x=d,P.y=T,P},N.createPath=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","path");return P.setAttribute("d",d),T&&N.setAttributes(P,T),P},N}(),je=function(){function N(){}return N.addKey=function(d){N.key=d},Object.defineProperty(N,"isLicensed",{get:function(){return!!N.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(N.key)},enumerable:!1,configurable:!0}),N}(),et=function(){function N(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return N.prototype.rasterize=function(d,T,P){var K=this;return new Promise(function(k){var le=P!==void 0?P:document.createElement("canvas");d===null&&(K.markersOnly=!0,K.naturalSize=!1);var Le=document.createElementNS("http://www.w3.org/2000/svg","svg");Le.setAttribute("xmlns","http://www.w3.org/2000/svg"),Le.setAttribute("width",T.width.baseVal.valueAsString),Le.setAttribute("height",T.height.baseVal.valueAsString),Le.setAttribute("viewBox","0 0 "+T.viewBox.baseVal.width.toString()+" "+T.viewBox.baseVal.height.toString()),Le.innerHTML=T.innerHTML,K.naturalSize===!0?(Le.width.baseVal.value=d.naturalWidth,Le.height.baseVal.value=d.naturalHeight):K.width!==void 0&&K.height!==void 0&&(Le.width.baseVal.value=K.width,Le.height.baseVal.value=K.height),le.width=Le.width.baseVal.value,le.height=Le.height.baseVal.value;var Je=Le.outerHTML,at=le.getContext("2d");K.markersOnly!==!0&&at.drawImage(d,0,0,le.width,le.height);var De=window.URL,mt=new Image(le.width,le.height);mt.setAttribute("crossOrigin","anonymous");var kt=new Blob([Je],{type:"image/svg+xml"}),Kt=De.createObjectURL(kt);mt.onload=function(){at.drawImage(mt,0,0),De.revokeObjectURL(Kt);var wi=le.toDataURL(K.imageType,K.imageQuality);k(wi)},mt.src=Kt})},N}(),He=function(){},Ne=function(){function N(d){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+d+"_"}return Object.defineProperty(N.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(N.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(N.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),N.prototype.addClass=function(d){return this.styleSheet===void 0&&this.addStyleSheet(),d.name=""+this.classNamePrefix+d.localName,this.classes.push(d),this.styleSheet.sheet.insertRule("."+d.name+" {"+d.style+"}",this.styleSheet.sheet.cssRules.length),d},N.prototype.addRule=function(d){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(d),this.styleSheet.sheet.insertRule(d.selector+" {"+d.style+"}",this.styleSheet.sheet.cssRules.length)},N.prototype.addStyleSheet=function(){var d;this.styleSheet=document.createElement("style"),((d=this.styleSheetRoot)!==null&&d!==void 0?d:document.head).appendChild(this.styleSheet),this.addRule(new Ye("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ye("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ye("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ae("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ae("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},N.prototype.removeStyleSheet=function(){var d;this.styleSheet&&(((d=this.styleSheetRoot)!==null&&d!==void 0?d:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},N}(),Ye=function(N,d){this.selector=N,this.style=d},Ae=function(N,d){this.localName=N,this.style=d},Ue=function(){function N(d,T,P,K,k){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=d,this.displayMode=T,this.markerItems=P,this.uiStyleSettings=K,this.styles=k,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return N.prototype.show=function(d){var T=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=d,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var P=document.createElement("div");P.className=this.toolbarBlockStyleClass.name,P.style.whiteSpace="nowrap",this.uiContainer.appendChild(P),this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(P,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(k){var le=document.createElement("div");le.className=""+T.toolbarButtonStyleClass.name,le.setAttribute("data-type-name",k.typeName),le.innerHTML=k.icon,le.addEventListener("click",function(){T.markerToolbarButtonClicked(le,k)}),T.buttons.push(le),T.markerButtons.push(le)}),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"),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"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},N.prototype.addButtonClickListener=function(d){this.buttonClickListeners.push(d)},N.prototype.removeButtonClickListener=function(d){this.buttonClickListeners.indexOf(d)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(d),1)},N.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},N.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var d=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var T=0;T<this.markerButtons.length;T++)T<d||T===d&&this.markerButtons.length-1===d?this.markerButtonBlock.appendChild(this.markerButtons[T]):(T===d&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[T]))}},N.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")},N.prototype.resetButtonStyles=function(){var d=this;this.buttons.forEach(function(T){T.className=T.className.replace(d.uiStyleSettings.toolbarButtonStyleColorsClassName?d.uiStyleSettings.toolbarButtonStyleColorsClassName:d.toolbarButtonStyleColorsClass.name,"").trim(),T.className=T.className.replace(d.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?d.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:d.toolbarActiveButtonStyleColorsClass.name,"").trim(),T.className+=" "+(d.uiStyleSettings.toolbarButtonStyleColorsClassName?d.uiStyleSettings.toolbarButtonStyleColorsClassName:d.toolbarButtonStyleColorsClass.name)})},N.prototype.addActionButton=function(d,T,P){var K=this,k=document.createElement("div");switch(k.className=""+this.toolbarButtonStyleClass.name,k.innerHTML=T,k.setAttribute("data-action",P),k.addEventListener("click",function(){K.actionToolbarButtonClicked(k,P)}),P){case"select":k.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":k.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":k.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":k.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":k.style.fill=this.uiStyleSettings.closeButtonColor}d.appendChild(k),this.buttons.push(k)},N.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ae("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var d=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ae("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*d)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*d)+`px;
|
|
padding: `+d+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ye("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ye("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},N.prototype.markerToolbarButtonClicked=function(d,T){this.setActiveButton(d),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(P){return P("marker",T)}),this.markerButtonOverflowBlock.style.display="none"},N.prototype.actionToolbarButtonClicked=function(d,T){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(P){return P("action",T)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},N.prototype.setActiveButton=function(d){this.resetButtonStyles(),d.className=d.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),d.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},N.prototype.setActiveMarkerButton=function(d){var T=this.markerButtons.find(function(P){return P.getAttribute("data-type-name")===d});T&&this.setActiveButton(T)},N.prototype.setCurrentMarker=function(d){var T=this;this.currentMarker=d,this.buttons.filter(function(P){return/delete|notes/.test(P.getAttribute("data-action"))}).forEach(function(P){T.currentMarker===void 0?(P.style.fillOpacity="0.4",P.style.pointerEvents="none"):(P.style.fillOpacity="1",P.style.pointerEvents="all")})},N}(),Ve=function(){function N(d,T,P,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=d,this.displayMode=T,this.uiStyleSettings=P,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return N.prototype.addStyles=function(){var d;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
|
|
background-color: `+((d=this.uiStyleSettings.toolboxBackgroundColor)!==null&&d!==void 0?d:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},N.prototype.show=function(d){var T;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=d,this.uiContainer.className=this.toolboxStyleClass.name+" "+((T=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&T!==void 0?T:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},N.prototype.setPanelButtons=function(d){var T,P,K=this;this.panels=d,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((T=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&T!==void 0?T:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((P=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&P!==void 0?P:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(k){var le;k.uiStyleSettings=K.uiStyleSettings;var Le=document.createElement("div");Le.className=K.toolboxButtonStyleClass.name+" "+((le=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&le!==void 0?le:K.toolboxButtonStyleColorsClass.name),Le.innerHTML=k.icon,Le.title=k.title,Le.addEventListener("click",function(){K.panelButtonClick(k)}),K.panelButtons.push(Le),K.buttonRow.appendChild(Le)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},N.prototype.panelButtonClick=function(d){var T=this,P=-1;if(d!==this.activePanel){P=this.panels.indexOf(d),this.panelRow.innerHTML="";var K=d.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=d}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){T.displayMode==="inline"?T.panelRow.style.display="none":T.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(k,le){var Le,Je;k.className=T.toolboxButtonStyleClass.name+" "+(le===P?""+((Le=T.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Le!==void 0?Le:T.toolboxActiveButtonStyleColorsClass.name):""+((Je=T.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Je!==void 0?Je:T.toolboxButtonStyleColorsClass.name))})},N}(),Q=function(N,d){this.title=N,this.icon=d},fe=function(N){function d(T,P,K,k){var le=N.call(this,T,k||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return le.colors=[],le.addTransparent=!1,le.colorBoxes=[],le.colors=P,le.currentColor=K,le.setCurrentColor=le.setCurrentColor.bind(le),le.getColorBox=le.getColorBox.bind(le),le}return we(d,N),d.prototype.getUi=function(){var T=this,P=document.createElement("div");return P.style.overflow="hidden",P.style.whiteSpace="nowrap",this.colors.forEach(function(K){var k=T.getColorBox(K);P.appendChild(k),T.colorBoxes.push(k)}),P},d.prototype.getColorBox=function(T){var P=this,K=this.uiStyleSettings.toolbarHeight/4,k=this.uiStyleSettings.toolbarHeight-K,le=document.createElement("div");le.style.display="inline-block",le.style.boxSizing="content-box",le.style.width=k-2+"px",le.style.height=k-2+"px",le.style.padding="1px",le.style.marginRight="2px",le.style.marginBottom="2px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderRadius=(k+2)/2+"px",le.style.borderColor=T===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){P.setCurrentColor(T,le)});var Le=document.createElement("div");return Le.style.display="inline-block",Le.style.width=k-2+"px",Le.style.height=k-2+"px",Le.style.backgroundColor=T,Le.style.borderRadius=k/2+"px",T==="transparent"&&(Le.style.fill=this.uiStyleSettings.toolboxAccentColor,Le.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>`),le.appendChild(Le),le},d.prototype.setCurrentColor=function(T,P){var K=this;this.currentColor=T,this.colorBoxes.forEach(function(k){k.style.borderColor=k===P?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(T)},d}(Q),be=function(){function N(d,T,P){this._state="new",this._isSelected=!1,this._container=d,this._overlayContainer=T,this.globalSettings=P,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(N.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(d){return!1},Object.defineProperty(N.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),N.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},N.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},N.prototype.pointerDown=function(d,T){},N.prototype.dblClick=function(d,T){},N.prototype.manipulate=function(d){},N.prototype.pointerUp=function(d){this.stateChanged()},N.prototype.dispose=function(){},N.prototype.addMarkerVisualToContainer=function(d){this.container.childNodes.length>0?this.container.insertBefore(d,this.container.childNodes[0]):this.container.appendChild(d)},N.prototype.getState=function(){return{typeName:N.typeName,state:this.state,notes:this.notes}},N.prototype.restoreState=function(d){this._state=d.state,this.notes=d.notes},N.prototype.scale=function(d,T){},N.prototype.colorChanged=function(d){this.onColorChanged&&this.onColorChanged(d),this.stateChanged()},N.prototype.fillColorChanged=function(d){this.onFillColorChanged&&this.onFillColorChanged(d),this.stateChanged()},N.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var d=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),d.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(d)&&this.onStateChanged(this)}},N.typeName="MarkerBase",N}(),Ee=function(){function N(){this.findGripByVisual=this.findGripByVisual.bind(this)}return N.prototype.findGripByVisual=function(d){return this.topLeft.ownsTarget(d)?this.topLeft:this.topCenter.ownsTarget(d)?this.topCenter:this.topRight.ownsTarget(d)?this.topRight:this.centerLeft.ownsTarget(d)?this.centerLeft:this.centerRight.ownsTarget(d)?this.centerRight:this.bottomLeft.ownsTarget(d)?this.bottomLeft:this.bottomCenter.ownsTarget(d)?this.bottomCenter:this.bottomRight.ownsTarget(d)?this.bottomRight:void 0},N}(),ke=function(){function N(){this.GRIP_SIZE=10,this.visual=ee.createGroup(),this.visual.appendChild(ee.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ee.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return N.prototype.ownsTarget=function(d){return d===this.visual||d===this.visual.childNodes[0]||d===this.visual.childNodes[1]},N}(),We=function(){function N(){}return N.toITransformMatrix=function(d){return{a:d.a,b:d.b,c:d.c,d:d.d,e:d.e,f:d.f}},N.toSVGMatrix=function(d,T){return d.a=T.a,d.b=T.b,d.c=T.c,d.d=T.d,d.e=T.e,d.f=T.f,d},N}(),Xe=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.left=0,k.top=0,k.width=0,k.height=0,k.defaultSize={x:50,y:20},k.offsetX=0,k.offsetY=0,k.rotationAngle=0,k.CB_DISTANCE=10,k._suppressMarkerCreateEvent=!1,k.container.transform.baseVal.appendItem(ee.createTransform()),k.setupControlBox(),k}return we(d,N),Object.defineProperty(d.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"visual",{get:function(){return this._visual},set:function(T){this._visual=T;var P=ee.createTransform();this._visual.transform.baseVal.appendItem(P)},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(T){return!!N.prototype.ownsTarget.call(this,T)||!!(this.controlGrips.findGripByVisual(T)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(T))},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.state==="new"&&(this.left=T.x,this.top=T.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(T);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(P),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(P)){this.activeGrip=this.rotatorGrip;var k=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=k.x-this.width/2,this.top=k.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var le=this.container.transform.baseVal.getItem(0);le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(le,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},d.prototype.pointerUp=function(T){var P=this.state;N.prototype.pointerUp.call(this,T),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(T),this._state="select",P==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},d.prototype.moveVisual=function(T){this.visual.style.transform="translate("+T.x+"px, "+T.y+"px)"},d.prototype.manipulate=function(T){var P=this.unrotatePoint(T);this.state==="creating"?this.resize(T):this.state==="move"?(this.left=this.manipulationStartLeft+(P.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(P.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(P):this.state==="rotate"&&this.rotate(T)},d.prototype.resize=function(T){var P=this.manipulationStartLeft,K=this.manipulationStartWidth,k=this.manipulationStartTop,le=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:P=this.manipulationStartLeft+T.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-P;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+T.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:k=this.manipulationStartTop+T.y-this.manipulationStartY,le=this.manipulationStartHeight+this.manipulationStartTop-k;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:le=this.manipulationStartHeight+T.y-this.manipulationStartY}K>=0?(this.left=P,this.width=K):(this.left=P+K,this.width=-K),le>=0?(this.top=k,this.height=le):(this.top=k+le,this.height=-le),this.setSize()},d.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},d.prototype.rotate=function(T){if(Math.abs(T.x-this.centerX)>.1){var P=Math.sign(T.x-this.centerX);this.rotationAngle=180*Math.atan((T.y-this.centerY)/(T.x-this.centerX))/Math.PI+90*P,this.applyRotation()}},d.prototype.applyRotation=function(){var T=this.container.transform.baseVal.getItem(0);T.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(T,0)},d.prototype.rotatePoint=function(T){if(this.rotationAngle===0)return T;var P=this.container.getCTM(),K=ee.createPoint(T.x,T.y);return{x:(K=K.matrixTransform(P)).x,y:K.y}},d.prototype.unrotatePoint=function(T){if(this.rotationAngle===0)return T;var P=this.container.getCTM();P=P.inverse();var K=ee.createPoint(T.x,T.y);return{x:(K=K.matrixTransform(P)).x,y:K.y}},d.prototype.select=function(){N.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},d.prototype.deselect=function(){N.prototype.deselect.call(this),this.controlBox.style.display="none"},d.prototype.setupControlBox=function(){this.controlBox=ee.createGroup();var T=ee.createTransform();T.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(T),this.container.appendChild(this.controlBox),this.controlRect=ee.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=ee.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 Ee,this.addControlGrips(),this.controlBox.style.display="none"},d.prototype.adjustControlBox=function(){var T=this.controlBox.transform.baseVal.getItem(0);T.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(T,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()},d.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()},d.prototype.createGrip=function(){var T=new ke;return T.visual.transform.baseVal.appendItem(ee.createTransform()),this.controlBox.appendChild(T.visual),T},d.prototype.positionGrips=function(){var T=this.controlGrips.topLeft.GRIP_SIZE,P=-T/2,K=P,k=(this.width+this.CB_DISTANCE)/2-T/2,le=(this.height+this.CB_DISTANCE)/2-T/2,Le=this.height+this.CB_DISTANCE-T/2,Je=this.width+this.CB_DISTANCE-T/2;this.positionGrip(this.controlGrips.topLeft.visual,P,K),this.positionGrip(this.controlGrips.topCenter.visual,k,K),this.positionGrip(this.controlGrips.topRight.visual,Je,K),this.positionGrip(this.controlGrips.centerLeft.visual,P,le),this.positionGrip(this.controlGrips.centerRight.visual,Je,le),this.positionGrip(this.controlGrips.bottomLeft.visual,P,Le),this.positionGrip(this.controlGrips.bottomCenter.visual,k,Le),this.positionGrip(this.controlGrips.bottomRight.visual,Je,Le),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,k,K-3*this.CB_DISTANCE)},d.prototype.positionGrip=function(T,P,K){var k=T.transform.baseVal.getItem(0);k.setTranslate(P,K),T.transform.baseVal.replaceItem(k,0)},d.prototype.hideControlBox=function(){this.controlBox.style.display="none"},d.prototype.showControlBox=function(){this.controlBox.style.display=""},d.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:We.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:We.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},N.prototype.getState.call(this))},d.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var P=T;this.left=P.left,this.top=P.top,this.width=P.width,this.height=P.height,this.rotationAngle=P.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(We.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,P.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(We.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,P.containerTransformMatrix))},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P);var K=this.rotatePoint({x:this.left,y:this.top}),k=this.unrotatePoint({x:K.x*T,y:K.y*P});this.left=k.x,this.top=k.y,this.width=this.width*T,this.height=this.height*P,this.adjustControlBox()},d}(be),ze=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.fillColor="transparent",k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.opacity=1,k.setStrokeColor=k.setStrokeColor.bind(k),k.setFillColor=k.setFillColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.createVisual=k.createVisual.bind(k),k}return we(d,N),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual)},d.prototype.createVisual=function(){this.visual=ee.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)},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},d.prototype.manipulate=function(T){N.prototype.manipulate.call(this,T)},d.prototype.resize=function(T){N.prototype.resize.call(this,T),this.setSize()},d.prototype.setSize=function(){N.prototype.setSize.call(this),ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},d.prototype.pointerUp=function(T){N.prototype.pointerUp.call(this,T),this.setSize()},d.prototype.setStrokeColor=function(T){this.strokeColor=T,this.visual&&ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(T),this.stateChanged()},d.prototype.setFillColor=function(T){this.fillColor=T,this.visual&&ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},d.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.visual&&ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},d.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.visual&&ee.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},d.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},N.prototype.getState.call(this))},d.prototype.restoreState=function(T){var P=T;this.fillColor=P.fillColor,this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.opacity=P.opacity,this.createVisual(),N.prototype.restoreState.call(this,T),this.setSize()},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P),this.setSize()},d.title="Rectangle marker",d}(Xe),qe=function(N){function d(T,P,K,k){var le=N.call(this,T,k||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return le.widths=[],le.widthBoxes=[],le.widths=P,le.currentWidth=K,le.setCurrentWidth=le.setCurrentWidth.bind(le),le}return we(d,N),d.prototype.getUi=function(){var T=this,P=document.createElement("div");return P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2",this.widths.forEach(function(K){var k=document.createElement("div");k.style.display="flex",k.style.flexGrow="2",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.borderColor=K===T.currentWidth?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentWidth(K,k)}),P.appendChild(k);var le=document.createElement("div");le.innerText=K.toString(),le.style.marginRight="5px",k.appendChild(le);var Le=document.createElement("div");Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.display="flex",Le.style.alignItems="center";var Je=document.createElement("hr");Je.style.minWidth="20px",Je.style.border="0px",Je.style.borderTop=K+"px solid "+T.uiStyleSettings.toolboxColor,Je.style.flexGrow="2",Le.appendChild(Je),k.appendChild(Le),T.widthBoxes.push(k)}),P},d.prototype.setCurrentWidth=function(T,P){var K=this;this.currentWidth=T,this.widthBoxes.forEach(function(k){k.style.borderColor=k===P?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},d}(Q),Qe=function(N){function d(T,P,K,k){var le=N.call(this,T,k||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return le.styles=[],le.styleBoxes=[],le.styles=P,le.currentStyle=K,le.setCurrentStyle=le.setCurrentStyle.bind(le),le}return we(d,N),d.prototype.getUi=function(){var T=this,P=document.createElement("div");return P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2",this.styles.forEach(function(K){var k=document.createElement("div");k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.overflow="hidden",k.style.maxWidth=100/T.styles.length-5+"%",k.style.borderColor=K===T.currentStyle?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentStyle(K,k)}),P.appendChild(k);var le=document.createElement("div");le.style.minHeight="20px",le.style.flexGrow="2",le.style.overflow="hidden";var Le=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+T.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
|
|
</svg>`;le.innerHTML=Le,k.appendChild(le),T.styleBoxes.push(k)}),P},d.prototype.setCurrentStyle=function(T,P){var K=this;this.currentStyle=T,this.styleBoxes.forEach(function(k){k.style.borderColor=k===P?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},d}(Q),Ze=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.strokeColor=K.defaultColor,k.strokeWidth=K.defaultStrokeWidth,k.strokeDasharray=K.defaultStrokeDasharray,k.strokePanel=new fe("Line color",K.defaultColorSet,K.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new qe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Qe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return we(d,N),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=d.typeName,T},d.typeName="FrameMarker",d.title="Frame marker",d.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',d}(ze),Ge=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},it=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.x1=0,k.y1=0,k.x2=0,k.y2=0,k.defaultLength=50,k.manipulationStartX=0,k.manipulationStartY=0,k.manipulationStartX1=0,k.manipulationStartY1=0,k.manipulationStartX2=0,k.manipulationStartY2=0,k.setupControlBox(),k}return we(d,N),d.prototype.ownsTarget=function(T){return!!N.prototype.ownsTarget.call(this,T)||!(!this.grip1.ownsTarget(T)&&!this.grip2.ownsTarget(T))},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.manipulationStartX=T.x,this.manipulationStartY=T.y,this.state==="new"&&(this.x1=T.x,this.y1=T.y,this.x2=T.x,this.y2=T.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(P)?this.activeGrip=this.grip1:this.grip2.ownsTarget(P)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},d.prototype.pointerUp=function(T){var P=this.state;N.prototype.pointerUp.call(this,T),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(T),this._state="select",P==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},d.prototype.adjustVisual=function(){},d.prototype.manipulate=function(T){this.state==="creating"?this.resize(T):this.state==="move"?(this.x1=this.manipulationStartX1+T.x-this.manipulationStartX,this.y1=this.manipulationStartY1+T.y-this.manipulationStartY,this.x2=this.manipulationStartX2+T.x-this.manipulationStartX,this.y2=this.manipulationStartY2+T.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(T)},d.prototype.resize=function(T){switch(this.activeGrip){case this.grip1:this.x1=T.x,this.y1=T.y;break;case this.grip2:case void 0:this.x2=T.x,this.y2=T.y}this.adjustVisual(),this.adjustControlBox()},d.prototype.select=function(){N.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},d.prototype.deselect=function(){N.prototype.deselect.call(this),this.controlBox.style.display="none"},d.prototype.setupControlBox=function(){this.controlBox=ee.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},d.prototype.adjustControlBox=function(){this.positionGrips()},d.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},d.prototype.createGrip=function(){var T=new ke;return T.visual.transform.baseVal.appendItem(ee.createTransform()),this.controlBox.appendChild(T.visual),T},d.prototype.positionGrips=function(){var T=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-T/2,this.y1-T/2),this.positionGrip(this.grip2.visual,this.x2-T/2,this.y2-T/2)},d.prototype.positionGrip=function(T,P,K){var k=T.transform.baseVal.getItem(0);k.setTranslate(P,K),T.transform.baseVal.replaceItem(k,0)},d.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},N.prototype.getState.call(this))},d.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var P=T;this.x1=P.x1,this.y1=P.y1,this.x2=P.x2,this.y2=P.y2},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P),this.x1=this.x1*T,this.y1=this.y1*P,this.x2=this.x2*T,this.y2=this.y2*P,this.adjustVisual(),this.adjustControlBox()},d}(be),nt=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.setStrokeColor=k.setStrokeColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.strokeColor=K.defaultColor,k.strokeWidth=K.defaultStrokeWidth,k.strokeDasharray=K.defaultStrokeDasharray,k.strokePanel=new fe("Line color",K.defaultColorSet,K.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new qe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Qe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return we(d,N),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.selectorLine&&T!==this.visibleLine)},d.prototype.createVisual=function(){this.visual=ee.createGroup(),this.selectorLine=ee.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ee.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)},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},d.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()),ee.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ee.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ee.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},d.prototype.setStrokeColor=function(T){this.strokeColor=T,this.adjustVisual(),this.colorChanged(T)},d.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.adjustVisual()},d.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.adjustVisual(),this.stateChanged()},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var P=T;this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.createVisual(),this.adjustVisual()},d.typeName="LineMarker",d.title="Line marker",d.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',d}(it),Ie=function(N){function d(T,P,K,k){var le=N.call(this,T,k||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return le.fonts=[],le.fontBoxes=[],le.fonts=P,le.currentFont=K,le.setCurrentFont=le.setCurrentFont.bind(le),le}return we(d,N),d.prototype.getUi=function(){var T=this,P=document.createElement("div");return P.style.overflow="hidden",P.style.flexGrow="2",this.fonts.forEach(function(K){var k=document.createElement("div");k.style.display="inline-block",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.overflow="hidden",k.style.maxWidth=100/T.fonts.length-5+"%",k.style.borderColor=K===T.currentFont?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentFont(K,k)}),P.appendChild(k);var le=document.createElement("div");le.style.display="flex",le.style.minHeight="20px",le.style.flexGrow="2",le.style.fontFamily=K,le.style.overflow="hidden";var Le=document.createElement("div");Le.style.whiteSpace="nowrap",Le.style.overflow="hidden",Le.style.textOverflow="ellipsis",Le.innerHTML="The quick brown fox jumps over the lazy dog",le.appendChild(Le),k.appendChild(le),T.fontBoxes.push(k)}),P},d.prototype.setCurrentFont=function(T,P){var K=this;this.currentFont=T,this.fontBoxes.forEach(function(k){k.style.borderColor=k===P?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},d}(Q),Me=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.color="transparent",k.padding=5,k.DEFAULT_TEXT="your text here",k.text=k.DEFAULT_TEXT,k.isMoved=!1,k.color=K.defaultColor,k.fontFamily=K.defaultFontFamily,k.defaultSize={x:100,y:30},k.setColor=k.setColor.bind(k),k.setFont=k.setFont.bind(k),k.renderText=k.renderText.bind(k),k.sizeText=k.sizeText.bind(k),k.textEditDivClicked=k.textEditDivClicked.bind(k),k.showTextEditor=k.showTextEditor.bind(k),k.setSize=k.setSize.bind(k),k.positionTextEditor=k.positionTextEditor.bind(k),k.colorPanel=new fe("Color",K.defaultColorSet,K.defaultColor),k.colorPanel.onColorChanged=k.setColor,k.fontFamilyPanel=new Ie("Font",K.defaultFontFamilies,K.defaultFontFamily),k.fontFamilyPanel.onFontChanged=k.setFont,k}return we(d,N),d.prototype.ownsTarget=function(T){if(N.prototype.ownsTarget.call(this,T)||T===this.visual||T===this.textElement||T===this.bgRectangle)return!0;var P=!1;return this.textElement.childNodes.forEach(function(K){K===T&&(P=!0)}),P},d.prototype.createVisual=function(){this.visual=ee.createGroup(),this.bgRectangle=ee.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ee.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ee.createTransform()),this.textElement.transform.baseVal.appendItem(ee.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.isMoved=!1,this.pointerDownPoint=T,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},d.prototype.renderText=function(){var T=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(P){T.textElement.appendChild(ee.createTSpan(P.trim()===""?" ":P.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},d.prototype.getTextScale=function(){var T=this.textElement.getBBox(),P=1;if(T.width>0&&T.height>0){var K=(1*this.width-this.width*this.padding*2/100)/T.width,k=(1*this.height-this.height*this.padding*2/100)/T.height;P=Math.min(K,k)}return P},d.prototype.getTextPosition=function(T){var P=this.textElement.getBBox(),K=0,k=0;return P.width>0&&P.height>0&&(K=(this.width-P.width*T)/2,k=this.height/2-P.height*T/2),{x:K,y:k}},d.prototype.sizeText=function(){var T=this.textElement.getBBox(),P=this.getTextScale(),K=this.getTextPosition(P);K.y-=T.y*P,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+P+", "+P+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(P,P))},d.prototype.manipulate=function(T){N.prototype.manipulate.call(this,T),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(T.x-this.pointerDownPoint.x)>5||Math.abs(T.y-this.pointerDownPoint.y)>5)},d.prototype.resize=function(T){N.prototype.resize.call(this,T),this.isMoved=!0,this.setSize(),this.sizeText()},d.prototype.setSize=function(){N.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ee.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},d.prototype.pointerUp=function(T){var P=this.state;P==="creating"&&(this._suppressMarkerCreateEvent=!0),N.prototype.pointerUp.call(this,T),this.setSize(),(P==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},d.prototype.showTextEditor=function(){var T=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(P){P.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var P=Number.parseFloat(T.textEditor.style.fontSize);T.textEditor.clientWidth>=Number.parseInt(T.textEditor.style.maxWidth)&&P>.9;)P-=.1,T.textEditor.style.fontSize=Math.max(P,.9)+"em"}),this.textEditor.addEventListener("keyup",function(P){P.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(P){if(P.clipboardData){var K=P.clipboardData.getData("text"),k=window.getSelection();if(!k.rangeCount)return!1;k.deleteFromDocument(),k.getRangeAt(0).insertNode(document.createTextNode(K)),P.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){T.textEditDivClicked(T.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},d.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var T=this.getTextScale(),P=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),k={x:K.width*T,y:K.height*T};P.x-=k.x/2,P.y-=k.y/2,this.textEditor.style.top=P.y+"px",this.textEditor.style.left=P.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-P.x+"px",this.textEditor.style.fontSize=Math.max(16*T,12)+"px",this.textElement.style.display="none"}},d.prototype.textEditDivClicked=function(T){this.text=T.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},d.prototype.select=function(){N.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},d.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),N.prototype.deselect.call(this)},d.prototype.dblClick=function(T,P){N.prototype.dblClick.call(this,T,P),this.showTextEditor()},d.prototype.setColor=function(T){this.textElement&&ee.setAttributes(this.textElement,[["fill",T]]),this.color=T,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(T)},d.prototype.setFont=function(T){this.textElement&&ee.setAttributes(this.textElement,[["font-family",T]]),this.fontFamily=T,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},d.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},d.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){var P=T;this.color=P.color,this.fontFamily=P.fontFamily,this.padding=P.padding,this.text=P.text,this.createVisual(),N.prototype.restoreState.call(this,T),this.setSize()},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P),this.setSize(),this.sizeText(),this.positionTextEditor()},d.typeName="TextMarker",d.title="Text marker",d.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>',d}(Xe),pe=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.color="transparent",k.lineWidth=3,k.drawing=!1,k.pixelRatio=1,k.color=K.defaultColor,k.lineWidth=K.defaultStrokeWidth,k.pixelRatio=K.freehandPixelRatio,k.setColor=k.setColor.bind(k),k.addCanvas=k.addCanvas.bind(k),k.finishCreation=k.finishCreation.bind(k),k.setLineWidth=k.setLineWidth.bind(k),k.colorPanel=new fe("Color",K.defaultColorSet,K.defaultColor),k.colorPanel.onColorChanged=k.setColor,k.lineWidthPanel=new qe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),k.lineWidthPanel.onWidthChanged=k.setLineWidth,k}return we(d,N),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.drawingImage)},d.prototype.createVisual=function(){this.visual=ee.createGroup(),this.drawingImage=ee.createImage(),this.visual.appendChild(this.drawingImage);var T=ee.createTransform();this.visual.transform.baseVal.appendItem(T),this.addMarkerVisualToContainer(this.visual)},d.prototype.pointerDown=function(T,P){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(T.x,T.y),this.drawing=!0):N.prototype.pointerDown.call(this,T,P)},d.prototype.manipulate=function(T){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(T.x,T.y),this.canvasContext.stroke()):N.prototype.manipulate.call(this,T)},d.prototype.resize=function(T){N.prototype.resize.call(this,T),ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},d.prototype.pointerUp=function(T){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):N.prototype.pointerUp.call(this,T)},d.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)},d.prototype.select=function(){this.state==="creating"&&this.finishCreation(),N.prototype.select.call(this)},d.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),N.prototype.deselect.call(this)},d.prototype.finishCreation=function(){for(var T=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),P=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=P[0],k=P[1],le=P[2],Le=P[3],Je=!1,at=0;at<this.canvasElement.height;at++)for(var De=0;De<this.canvasElement.width;De++)T.data[at*this.canvasElement.width*4+4*De+3]>0&&(Je=!0,at<k&&(k=at),De<K&&(K=De),at>Le&&(Le=at),De>le&&(le=De));if(Je){this.left=K/this.pixelRatio,this.top=k/this.pixelRatio,this.width=(le-K)/this.pixelRatio,this.height=(Le-k)/this.pixelRatio;var mt=document.createElement("canvas");mt.width=le-K,mt.height=Le-k,mt.getContext("2d").putImageData(this.canvasContext.getImageData(K,k,le-K,Le-k),0,0),this.drawingImgUrl=mt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},d.prototype.setDrawingImage=function(){ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ee.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},d.prototype.setColor=function(T){this.color=T,this.colorChanged(T)},d.prototype.setLineWidth=function(T){this.lineWidth=T},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=Object.assign({drawingImgUrl:this.drawingImgUrl},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){this.createVisual(),N.prototype.restoreState.call(this,T),this.drawingImgUrl=T.drawingImgUrl,this.setDrawingImage()},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P),this.setDrawingImage()},d.typeName="FreehandMarker",d.title="Freehand marker",d.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>',d}(Xe),ue=function(N){function d(T,P,K){var k=N.call(this,T,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return k.typeBoxes=[],k.currentType=P,k.setCurrentType=k.setCurrentType.bind(k),k}return we(d,N),d.prototype.getUi=function(){var T=this,P=document.createElement("div");P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2";for(var K=function(Le){var Je="both";switch(Le){case 0:Je="both";break;case 1:Je="start";break;case 2:Je="end";break;case 3:Je="none"}var at=document.createElement("div");if(at.style.display="flex",at.style.flexGrow="2",at.style.alignItems="center",at.style.justifyContent="space-between",at.style.padding="5px",at.style.borderWidth="2px",at.style.borderStyle="solid",at.style.borderColor=Je===k.currentType?k.uiStyleSettings.toolboxAccentColor:"transparent",at.addEventListener("click",function(){T.setCurrentType(Je,at)}),P.appendChild(at),Je==="both"||Je==="start"){var De=document.createElement("div");De.style.display="flex",De.style.alignItems="center",De.style.minHeight="20px",De.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,De.style.marginLeft="5px",at.appendChild(De)}var mt=document.createElement("div");mt.style.display="flex",mt.style.alignItems="center",mt.style.minHeight="20px",mt.style.flexGrow="2";var kt=document.createElement("hr");if(kt.style.minWidth="20px",kt.style.border="0px",kt.style.borderTop="3px solid "+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee"),kt.style.flexGrow="2",mt.appendChild(kt),at.appendChild(mt),Je==="both"||Je==="end"){var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Kt.style.marginRight="5px",at.appendChild(Kt)}k.typeBoxes.push(at)},k=this,le=0;le<4;le++)K(le);return P},d.prototype.setCurrentType=function(T,P){var K=this;this.currentType=T,this.typeBoxes.forEach(function(k){k.style.borderColor=k===P?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},d}(Q),ce=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.arrowType="end",k.arrowBaseHeight=10,k.arrowBaseWidth=10,k.getArrowPoints=k.getArrowPoints.bind(k),k.setArrowType=k.setArrowType.bind(k),k.arrowTypePanel=new ue("Arrow type","end"),k.arrowTypePanel.onArrowTypeChanged=k.setArrowType,k}return we(d,N),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.arrow1&&T!==this.arrow2)},d.prototype.getArrowPoints=function(T,P){var K=this.arrowBaseWidth+2*this.strokeWidth,k=this.arrowBaseHeight+2*this.strokeWidth;return T-K/2+","+(P+k/2)+" "+T+","+(P-k/2)+" "+(T+K/2)+","+(P+k/2)},d.prototype.createTips=function(){this.arrow1=ee.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ee.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ee.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ee.createTransform()),this.visual.appendChild(this.arrow2)},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.state==="creating"&&this.createTips()},d.prototype.adjustVisual=function(){if(N.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",ee.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ee.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var T=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),P=this.arrow1.transform.baseVal.getItem(0);P.setRotate(T,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(P,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(T+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},d.prototype.setArrowType=function(T){this.arrowType=T,this.adjustVisual(),this.stateChanged()},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=Object.assign({arrowType:this.arrowType},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var P=T;this.arrowType=P.arrowType,this.createTips(),this.adjustVisual()},d.typeName="ArrowMarker",d.title="Arrow marker",d.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',d}(nt),X=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.fillColor=K.defaultFillColor,k.strokeWidth=0,k.fillPanel=new fe("Color",K.defaultColorSet,K.defaultFillColor),k.fillPanel.onColorChanged=k.setFillColor,k}return we(d,N),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=d.typeName,T},d.typeName="CoverMarker",d.title="Cover marker",d.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',d}(ze),$=function(N){function d(T,P,K,k){var le=N.call(this,T,k||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return le.opacities=[],le.opacityBoxes=[],le.opacities=P,le.currentOpacity=K,le.setCurrentOpacity=le.setCurrentOpacity.bind(le),le}return we(d,N),d.prototype.getUi=function(){var T=this,P=document.createElement("div");return P.style.display="flex",P.style.overflow="hidden",P.style.flexGrow="2",P.style.justifyContent="space-between",this.opacities.forEach(function(K){var k=document.createElement("div");k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="center",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.borderColor=K===T.currentOpacity?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentOpacity(K,k)}),P.appendChild(k);var le=document.createElement("div");le.innerText=100*K+"%",k.appendChild(le),T.opacityBoxes.push(k)}),P},d.prototype.setCurrentOpacity=function(T,P){var K=this;this.currentOpacity=T,this.opacityBoxes.forEach(function(k){k.style.borderColor=k===P?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},d}(Q),te=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.setOpacity=k.setOpacity.bind(k),k.fillColor=K.defaultHighlightColor,k.strokeWidth=0,k.opacity=K.defaultHighlightOpacity,k.fillPanel=new fe("Color",K.defaultColorSet,k.fillColor),k.fillPanel.onColorChanged=k.setFillColor,k.opacityPanel=new $("Opacity",K.defaultOpacitySteps,k.opacity),k.opacityPanel.onOpacityChanged=k.setOpacity,k}return we(d,N),d.prototype.setOpacity=function(T){this.opacity=T,this.visual&&ee.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=d.typeName,T},d.typeName="HighlightMarker",d.title="Highlight marker",d.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>',d}(X),oe='<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>',Te=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.bgColor="transparent",k.tipPosition={x:0,y:0},k.tipBase1Position={x:0,y:0},k.tipBase2Position={x:0,y:0},k.tipMoving=!1,k.color=K.defaultStrokeColor,k.bgColor=K.defaultFillColor,k.fontFamily=K.defaultFontFamily,k.defaultSize={x:100,y:30},k.setBgColor=k.setBgColor.bind(k),k.getTipPoints=k.getTipPoints.bind(k),k.positionTip=k.positionTip.bind(k),k.setTipPoints=k.setTipPoints.bind(k),k.colorPanel=new fe("Text color",K.defaultColorSet,k.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),k.colorPanel.onColorChanged=k.setColor,k.bgColorPanel=new fe("Fill color",K.defaultColorSet,k.bgColor,oe),k.bgColorPanel.onColorChanged=k.setBgColor,k.fontFamilyPanel=new Ie("Font",K.defaultFontFamilies,K.defaultFontFamily),k.fontFamilyPanel.onFontChanged=k.setFont,k.tipGrip=new ke,k.tipGrip.visual.transform.baseVal.appendItem(ee.createTransform()),k.controlBox.appendChild(k.tipGrip.visual),k}return we(d,N),d.prototype.ownsTarget=function(T){return N.prototype.ownsTarget.call(this,T)||this.tipGrip.ownsTarget(T)||this.tip===T},d.prototype.createTip=function(){ee.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ee.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},d.prototype.pointerDown=function(T,P){this.state==="new"&&N.prototype.pointerDown.call(this,T,P),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(P)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):N.prototype.pointerDown.call(this,T,P)},d.prototype.pointerUp=function(T){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,N.prototype.pointerUp.call(this,T);else{var P=this.state==="creating";N.prototype.pointerUp.call(this,T),this.setTipPoints(P),this.positionTip()}},d.prototype.manipulate=function(T){if(this.tipMoving){var P=this.unrotatePoint(T);this.tipPosition={x:P.x-this.manipulationStartLeft,y:P.y-this.manipulationStartTop},this.positionTip()}else N.prototype.manipulate.call(this,T)},d.prototype.setBgColor=function(T){this.bgRectangle&&this.tip&&(ee.setAttributes(this.bgRectangle,[["fill",T]]),ee.setAttributes(this.tip,[["fill",T]])),this.bgColor=T,this.fillColorChanged(T)},d.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},d.prototype.setTipPoints=function(T){T===void 0&&(T=!1);var P=Math.min(this.height/2,15),K=this.height/5;T&&(this.tipPosition={x:P+K/2,y:this.height+20});var k=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?k<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(K=this.width/5,P=Math.min(this.width/2,15),this.tipBase1Position={x:P,y:0},this.tipBase2Position={x:P+K,y:0}):(this.tipBase1Position={x:0,y:P},this.tipBase2Position={x:0,y:P+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?k<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(K=this.width/5,P=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-P-K,y:0},this.tipBase2Position={x:this.width-P,y:0}):(this.tipBase1Position={x:this.width,y:P},this.tipBase2Position={x:this.width,y:P+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?k<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(K=this.width/5,P=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-P-K,y:this.height},this.tipBase2Position={x:this.width-P,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-P-K},this.tipBase2Position={x:this.width,y:this.height-P}):k<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,P=Math.min(this.width/2,15),this.tipBase1Position={x:P,y:this.height},this.tipBase2Position={x:P+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-P},this.tipBase2Position={x:0,y:this.height-P-K})},d.prototype.resize=function(T){N.prototype.resize.call(this,T),this.positionTip()},d.prototype.positionTip=function(){ee.setAttributes(this.tip,[["points",this.getTipPoints()]]);var T=this.tipGrip.visual.transform.baseVal.getItem(0);T.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(T,0)},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),d.prototype.select=function(){this.positionTip(),N.prototype.select.call(this)},d.prototype.getState=function(){var T=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){var P=T;this.bgColor=P.bgColor,this.tipPosition=P.tipPosition,N.prototype.restoreState.call(this,T),this.createTip(),this.setTipPoints()},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P),this.tipPosition={x:this.tipPosition.x*T,y:this.tipPosition.y*P},this.positionTip()},d.typeName="CalloutMarker",d.title="Callout marker",d.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>',d}(Me),Ce=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.fillColor="transparent",k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.opacity=1,k.strokeColor=K.defaultColor,k.strokeWidth=K.defaultStrokeWidth,k.strokeDasharray=K.defaultStrokeDasharray,k.fillColor=K.defaultFillColor,k.setStrokeColor=k.setStrokeColor.bind(k),k.setFillColor=k.setFillColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.setOpacity=k.setOpacity.bind(k),k.createVisual=k.createVisual.bind(k),k.strokePanel=new fe("Line color",ye(K.defaultColorSet,["transparent"]),K.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.fillPanel=new fe("Fill color",ye(K.defaultColorSet,["transparent"]),k.fillColor,oe),k.fillPanel.onColorChanged=k.setFillColor,k.strokeWidthPanel=new qe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Qe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k.opacityPanel=new $("Opacity",K.defaultOpacitySteps,k.opacity),k.opacityPanel.onOpacityChanged=k.setOpacity,k}return we(d,N),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual)},d.prototype.createVisual=function(){this.visual=ee.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)},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},d.prototype.manipulate=function(T){N.prototype.manipulate.call(this,T)},d.prototype.resize=function(T){N.prototype.resize.call(this,T),this.setSize()},d.prototype.setSize=function(){N.prototype.setSize.call(this),ee.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},d.prototype.pointerUp=function(T){N.prototype.pointerUp.call(this,T),this.setSize()},d.prototype.setStrokeColor=function(T){this.strokeColor=T,this.visual&&ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(T),this.stateChanged()},d.prototype.setFillColor=function(T){this.fillColor=T,this.visual&&ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(T),this.stateChanged()},d.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.visual&&ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},d.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.visual&&ee.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},d.prototype.setOpacity=function(T){this.opacity=T,this.visual&&ee.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){var P=T;this.fillColor=P.fillColor,this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.opacity=P.opacity,this.createVisual(),N.prototype.restoreState.call(this,T),this.setSize()},d.prototype.scale=function(T,P){N.prototype.scale.call(this,T,P),this.setSize()},d.typeName="EllipseMarker",d.title="Ellipse marker",d.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>',d}(Xe),Ke=function(N){function d(T,P,K){return N.call(this,T,P,K)||this}return we(d,N),Object.defineProperty(d.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.tip1&&T!==this.tip2)},d.prototype.createTips=function(){this.tip1=ee.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(ee.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ee.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(ee.createTransform()),this.visual.appendChild(this.tip2)},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.state==="creating"&&this.createTips()},d.prototype.adjustVisual=function(){if(N.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ee.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()]]),ee.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 T=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),P=this.tip1.transform.baseVal.getItem(0);P.setRotate(T,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(P,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(T+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T),this.createTips(),this.adjustVisual()},d.typeName="MeasurementMarker",d.title="Measurement marker",d.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>',d}(nt),lt=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.strokePanel.colors=K.defaultColorSet,k.fillColor="transparent",k}return we(d,N),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=d.typeName,T},d.typeName="EllipseFrameMarker",d.title="Ellipse frame marker",d.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>',d}(Ce),gt=function(){function N(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(N.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),N.prototype.addUndoStep=function(d){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(d)||(this.undoStack.push(d),JSON.stringify(this.lastRedoStep)!==JSON.stringify(d)&&this.redoStack.splice(0,this.redoStack.length))},N.prototype.replaceLastUndoStep=function(d){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=d)},N.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},N.prototype.undo=function(){if(this.undoStack.length>1){var d=this.undoStack.pop();return d!==void 0&&this.redoStack.push(d),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},N.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},N}(),ut=function(N){function d(T,P,K){var k=N.call(this,T,P,K)||this;return k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.curveX=0,k.curveY=0,k.manipulationStartCurveX=0,k.manipulationStartCurveY=0,k.setStrokeColor=k.setStrokeColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.positionGrips=k.positionGrips.bind(k),k.addControlGrips=k.addControlGrips.bind(k),k.adjustVisual=k.adjustVisual.bind(k),k.setupControlBox=k.setupControlBox.bind(k),k.resize=k.resize.bind(k),k.strokeColor=K.defaultColor,k.strokeWidth=K.defaultStrokeWidth,k.strokeDasharray=K.defaultStrokeDasharray,k.strokePanel=new fe("Line color",K.defaultColorSet,K.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new qe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Qe("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return we(d,N),d.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.selectorCurve&&T!==this.visibleCurve&&!this.curveGrip.ownsTarget(T))},d.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},d.prototype.createVisual=function(){this.visual=ee.createGroup(),this.selectorCurve=ee.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ee.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)},d.prototype.pointerDown=function(T,P){N.prototype.pointerDown.call(this,T,P),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=T.x,this.curveY=T.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(P)&&(this.activeGrip=this.curveGrip,this._state="resize")},d.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ee.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ee.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ee.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},d.prototype.setupControlBox=function(){N.prototype.setupControlBox.call(this),this.curveControlLine1=ee.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ee.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)},d.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,N.prototype.addControlGrips.call(this)},d.prototype.positionGrips=function(){N.prototype.positionGrips.call(this);var T=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-T/2,this.curveY-T/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()))},d.prototype.manipulate=function(T){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+T.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+T.y-this.manipulationStartY),N.prototype.manipulate.call(this,T)},d.prototype.resize=function(T){this.activeGrip===this.curveGrip&&(this.curveX=T.x,this.curveY=T.y),N.prototype.resize.call(this,T),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},d.prototype.setStrokeColor=function(T){this.strokeColor=T,this.adjustVisual(),this.colorChanged(T)},d.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.adjustVisual()},d.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.adjustVisual()},d.prototype.scale=function(T,P){this.curveX=this.curveX*T,this.curveY=this.curveY*P,N.prototype.scale.call(this,T,P)},Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),d.prototype.getState=function(){var T=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},N.prototype.getState.call(this));return T.typeName=d.typeName,T},d.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var P=T;this.strokeColor=P.strokeColor,this.strokeWidth=P.strokeWidth,this.strokeDasharray=P.strokeDasharray,this.curveX=P.curveX,this.curveY=P.curveY,this.createVisual(),this.adjustVisual()},d.typeName="CurveMarker",d.title="Curve marker",d.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>',d}(it),yt=function(){function N(d,T){T===void 0&&(T=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=d,this.cancelable=T}return Object.defineProperty(N.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),N.prototype.preventDefault=function(){this._defaultPrevented=!0},N}(),wt=function(N){function d(T,P,K){var k=N.call(this,T,!1)||this;return k.dataUrl=P,k.state=K,k}return we(d,N),d}(yt),rt=function(N){function d(T,P,K){K===void 0&&(K=!1);var k=N.call(this,T,K)||this;return k.marker=P,k}return we(d,N),d}(yt),Vt=function(){function N(){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 N.prototype.addEventListener=function(d,T){this[d].push(T)},N.prototype.removeEventListener=function(d,T){var P=this[d].indexOf(T);P>-1&&this[d].splice(P,1)},N}(),Pt=function(){function N(d){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ge,this._isOpen=!1,this.undoRedoManager=new gt,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 Vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=N.instanceCounter++,this.styles=new Ne(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=d,this.targetRoot=document.body,this.width=d.clientWidth,this.height=d.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(N.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ze,pe,ce,Me,lt,Ce,te,Te,Ke,X,nt,ut]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ze,pe,ce,Me,Ce,te,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ze,pe,ce,Me,te]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(d){var T=this;this._availableMarkerTypes.splice(0),d.forEach(function(P){if(typeof P=="string"){var K=T.ALL_MARKER_TYPES.find(function(k){return k.typeName===P});K!==void 0&&T._availableMarkerTypes.push(K)}else T._availableMarkerTypes.push(P)})},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(d){this._zoomLevel=d,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(N.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),N.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),je.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},N.prototype.show=function(){var d=this;this.styles.styleSheetRoot===void 0&&He.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=He.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(T){return T(new yt(d))})},N.prototype.render=function(){return Re(this,void 0,void 0,function(){var d;return Pe(this,function(T){switch(T.label){case 0:return this.setCurrentMarker(),(d=new et).naturalSize=this.renderAtNaturalSize,d.imageType=this.renderImageType,d.imageQuality=this.renderImageQuality,d.markersOnly=this.renderMarkersOnly,d.width=this.renderWidth,d.height=this.renderHeight,[4,d.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return T.sent(),[4,d.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,T.sent()]}})})},N.prototype.close=function(d){var T=this;if(d===void 0&&(d=!1),this.isOpen){var P=!1;d||this.eventListeners.beforeclose.forEach(function(K){var k=new yt(T,!0);K(k),k.defaultPrevented&&(P=!0)}),P||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(K){return K(new yt(T))}),this.detachEvents(),this._isOpen=!1)}},N.prototype.addMarkersToToolbar=function(){for(var d,T=[],P=0;P<arguments.length;P++)T[P]=arguments[P];(d=this._availableMarkerTypes).push.apply(d,T)},N.prototype.addRenderEventListener=function(d){this.addEventListener("render",function(T){d(T.dataUrl,T.state)})},N.prototype.removeRenderEventListener=function(d){},N.prototype.addCloseEventListener=function(d){this.addEventListener("close",function(){d()})},N.prototype.removeCloseEventListener=function(d){},N.prototype.setupResizeObserver=function(){var d=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){d.resize(d.target.clientWidth,d.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return d.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},N.prototype.onPopupTargetResize=function(){var d=1*this.target.clientWidth/this.target.clientHeight,T=this.editorCanvas.clientWidth/d>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*d:this.editorCanvas.clientWidth,P=T<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/d;this.resize(T,P)},N.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},N.prototype.resize=function(d,T){this._isResizing=!0;var P=d/this.imageWidth,K=T/this.imageHeight;this.imageWidth=Math.round(d),this.imageHeight=Math.round(T),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(P,K),this._isResizing=!1},N.prototype.scaleMarkers=function(d,T){var P,K=this;this._currentMarker&&this._currentMarker instanceof Me?this._currentMarker.scale(d,T):(P=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(k){k!==K._currentMarker&&k.scale(d,T)}),P!==void 0&&this.setCurrentMarker(P)},N.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"},N.prototype.setTopLeft=function(){var d=this.editingTarget.getBoundingClientRect(),T=this.editorCanvas.getBoundingClientRect();this.left=d.left-T.left,this.top=d.top-T.top},N.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)},N.prototype.addDefs=function(){for(var d,T=[],P=0;P<arguments.length;P++)T[P]=arguments[P];this.defs=ee.createDefs(),this.addDefsToImage(),(d=this.defs).append.apply(d,T)},N.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},N.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)},N.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},N.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},N.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)},N.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},N.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)},N.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 d=document.createElement("a");d.href="https://markerjs.com/",d.target="_blank",d.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>',d.title="Powered by marker.js",d.style.display="grid",d.style.alignItems="center",d.style.justifyItems="center",d.style.padding="3px",d.style.width="20px",d.style.height="20px",this.logoUI.appendChild(d),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},N.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")},N.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"},N.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},N.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var d=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=d+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ue(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ve(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},N.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},N.prototype.removeMarker=function(d){this.markerImage.removeChild(d.container),this.markers.indexOf(d)>-1&&this.markers.splice(this.markers.indexOf(d),1),d.dispose()},N.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())},N.prototype.toolbarButtonClicked=function(d,T){if(d==="marker"&&T!==void 0)this.createNewMarker(T);else if(d==="action")switch(T){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()}},N.prototype.deleteSelectedMarker=function(){var d=this;if(this._currentMarker!==void 0){var T=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var k=new rt(d,d._currentMarker,!0);K(k),k.defaultPrevented&&(T=!0)}),!T){var P=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 rt(d,P))})}}},N.prototype.clear=function(){var d=this,T=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(le){var Le=new rt(d,void 0,!0);le(Le),Le.defaultPrevented&&(T=!0)}),!T)){this.setCurrentMarker();for(var P=function(le){var Le=K.markers[le];K.setCurrentMarker(K.markers[le]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(Je){return Je(new rt(d,Le))})},K=this,k=this.markers.length-1;k>=0;k--)P(k);this.addUndoStep()}},Object.defineProperty(N.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),N.prototype.showNotesEditor=function(){var d;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=(d=this._currentMarker.notes)!==null&&d!==void 0?d:"",this.overlayContainer.appendChild(this.notesArea))},N.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)},N.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},N.prototype.addUndoStep=function(){var d=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var T=this.getState(),P=this.undoRedoManager.getLastUndoStep();if(!P||P.width===T.width&&P.height===T.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(T),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(k){return k(new yt(d))})}else this.undoRedoManager.replaceLastUndoStep(T),this.eventListeners.statechange.forEach(function(k){return k(new yt(d))})}},N.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},N.prototype.undoStep=function(){var d=this,T=this.undoRedoManager.undo();T!==void 0&&(this.restoreState(T),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(P){return P(new yt(d))}))},N.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},N.prototype.redoStep=function(){var d=this,T=this.undoRedoManager.redo();T!==void 0&&(this.restoreState(T),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(P){return P(new yt(d))}))},N.prototype.stepZoom=function(){var d=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=d<this.zoomSteps.length-1?this.zoomSteps[d+1]:this.zoomSteps[0]},N.prototype.panTo=function(d){this.contentDiv.scrollBy({left:this.prevPanPoint.x-d.x,top:this.prevPanPoint.y-d.y}),this.prevPanPoint=d},N.prototype.startRenderAndClose=function(){return Re(this,void 0,void 0,function(){var d,T,P=this;return Pe(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return d=K.sent(),T=this.getState(),this.eventListeners.render.forEach(function(k){return k(new wt(P,d,T))}),this.close(!0),[2]}})})},N.prototype.getState=function(d){d===!0&&this.setCurrentMarker();var T={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(P){return T.markers.push(P.getState())}),T},N.prototype.restoreState=function(d){var T=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);d.markers.forEach(function(P){var K=T._availableMarkerTypes.find(function(le){return le.typeName===P.typeName});if(K!==void 0){var k=T.addNewMarker(K);k.restoreState(P),T.markers.push(k)}}),d.width&&d.height&&(d.width!==this.imageWidth||d.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/d.width,this.imageHeight/d.height),this.eventListeners.restorestate.forEach(function(P){return P(new yt(T))})},N.prototype.addNewMarker=function(d){var T=ee.createGroup();return this.markerImage.appendChild(T),new d(T,this.overlayContainer,this.settings)},N.prototype.createNewMarker=function(d){var T,P=this;(T=typeof d=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===d}):d)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(T),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(T.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new rt(P,P._currentMarker))}))},N.prototype.markerCreated=function(d){var T=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(d),this.setCurrentMarker(d),d instanceof pe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(pe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(P){return P(new rt(T,T._currentMarker))})},N.prototype.colorChanged=function(d){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=d,this.settings.defaultStrokeColor=d)},N.prototype.fillColorChanged=function(d){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=d)},N.prototype.markerStateChanged=function(d){var T=this;this.eventListeners.markerchange.forEach(function(P){return P(new rt(T,d))})},N.prototype.setCurrentMarker=function(d){var T=this;this._currentMarker!==d&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(P){return P(new rt(T,T._currentMarker))})),this._currentMarker=d,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(P){return P(new rt(T,T._currentMarker))}))},N.prototype.onPointerDown=function(d){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||d.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var T=this.markers.find(function(P){return P.ownsTarget(d.target)});T!==void 0?(this.setCurrentMarker(T),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(d.clientX,d.clientY),d.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:d.clientX,y:d.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(d.clientX,d.clientY))},N.prototype.onDblClick=function(d){if(this._isFocused||this.focus(),this.mode==="select"){var T=this.markers.find(function(P){return P.ownsTarget(d.target)});T!==void 0&&T!==this._currentMarker&&this.setCurrentMarker(T),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(d.clientX,d.clientY),d.target):this.setCurrentMarker()}},N.prototype.onPointerMove=function(d){this.touchPoints!==1&&d.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||d.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(d.clientX,d.clientY)):this.zoomLevel>1&&this.panTo({x:d.clientX,y:d.clientY}))},N.prototype.onPointerUp=function(d){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(d.clientX,d.clientY)),this.isDragging=!1,this.addUndoStep()},N.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},N.prototype.onKeyUp=function(d){this._currentMarker===void 0||this.notesArea!==void 0||d.key!=="Delete"&&d.key!=="Backspace"||this.deleteSelectedMarker()},N.prototype.clientToLocalCoordinates=function(d,T){var P=this.markerImage.getBoundingClientRect();return{x:(d-P.left)/this.zoomLevel,y:(T-P.top)/this.zoomLevel}},N.prototype.onWindowResize=function(){this.positionUI()},N.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var d=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=d+"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()},N.prototype.addLicenseKey=function(d){je.addKey(d)},N.prototype.addEventListener=function(d,T){this.eventListeners.addEventListener(d,T)},N.prototype.removeEventListener=function(d,T){this.eventListeners.removeEventListener(d,T)},N.prototype.renderState=function(d){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(d),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(N.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),N.prototype.focus=function(){var d=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(T){return T(new yt(d))}))},N.prototype.blur=function(){var d=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(T){return T(new yt(d))}))},N.instanceCounter=0,N}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Zt=function(N,d){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,P){T.__proto__=P}||function(T,P){for(var K in P)Object.prototype.hasOwnProperty.call(P,K)&&(T[K]=P[K])})(N,d)};function qt(N,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");function T(){this.constructor=N}Zt(N,d),N.prototype=d===null?Object.create(d):(T.prototype=d.prototype,new T)}function bt(N,d,T,P){return new(T||(T=Promise))(function(K,k){function le(at){try{Je(P.next(at))}catch(De){k(De)}}function Le(at){try{Je(P.throw(at))}catch(De){k(De)}}function Je(at){var De;at.done?K(at.value):(De=at.value,De instanceof T?De:new T(function(mt){mt(De)})).then(le,Le)}Je((P=P.apply(N,d||[])).next())})}function ii(N,d){var T,P,K,k,le={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return k={next:Le(0),throw:Le(1),return:Le(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function Le(Je){return function(at){return function(De){if(T)throw new TypeError("Generator is already executing.");for(;le;)try{if(T=1,P&&(K=2&De[0]?P.return:De[0]?P.throw||((K=P.return)&&K.call(P),0):P.next)&&!(K=K.call(P,De[1])).done)return K;switch(P=0,K&&(De=[2&De[0],K.value]),De[0]){case 0:case 1:K=De;break;case 4:return le.label++,{value:De[1],done:!1};case 5:le.label++,P=De[1],De=[0];continue;case 7:De=le.ops.pop(),le.trys.pop();continue;default:if(!(K=le.trys,(K=K.length>0&&K[K.length-1])||De[0]!==6&&De[0]!==2)){le=0;continue}if(De[0]===3&&(!K||De[1]>K[0]&&De[1]<K[3])){le.label=De[1];break}if(De[0]===6&&le.label<K[1]){le.label=K[1],K=De;break}if(K&&le.label<K[2]){le.label=K[2],le.ops.push(De);break}K[2]&&le.ops.pop(),le.trys.pop();continue}De=d.call(N,le)}catch(mt){De=[6,mt],P=0}finally{T=K=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([Je,at])}}}var vi=function(){function N(){}return N.addKey=function(d){N.key=d},Object.defineProperty(N,"isLicensed",{get:function(){return!!N.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(N.key)},enumerable:!1,configurable:!0}),N}(),ht=function(){function N(){}return N.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},N.setAttributes=function(d,T){for(var P=0,K=T;P<K.length;P++){var k=K[P],le=k[0],Le=k[1];d.setAttribute(le,Le)}},N.createRect=function(d,T,P){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",d.toString()),K.setAttribute("height",T.toString()),P&&N.setAttributes(K,P),K},N.createLine=function(d,T,P,K,k){var le=document.createElementNS("http://www.w3.org/2000/svg","line");return le.setAttribute("x1",d.toString()),le.setAttribute("y1",T.toString()),le.setAttribute("x2",P.toString()),le.setAttribute("y2",K.toString()),k&&N.setAttributes(le,k),le},N.createPolygon=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","polygon");return P.setAttribute("points",d),T&&N.setAttributes(P,T),P},N.createCircle=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","circle");return P.setAttribute("cx",(d/2).toString()),P.setAttribute("cy",(d/2).toString()),P.setAttribute("r",d.toString()),T&&N.setAttributes(P,T),P},N.createEllipse=function(d,T,P){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(d/2).toString()),K.setAttribute("cy",(T/2).toString()),K.setAttribute("rx",(d/2).toString()),K.setAttribute("ry",(T/2).toString()),P&&N.setAttributes(K,P),K},N.createGroup=function(d){var T=document.createElementNS("http://www.w3.org/2000/svg","g");return d&&N.setAttributes(T,d),T},N.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},N.createMarker=function(d,T,P,K,k,le,Le){var Je=document.createElementNS("http://www.w3.org/2000/svg","marker");return N.setAttributes(Je,[["id",d],["orient",T],["markerWidth",P.toString()],["markerHeight",K.toString()],["refX",k.toString()],["refY",le.toString()]]),Je.appendChild(Le),Je},N.createText=function(d){var T=document.createElementNS("http://www.w3.org/2000/svg","text");return T.setAttribute("x","0"),T.setAttribute("y","0"),d&&N.setAttributes(T,d),T},N.createTSpan=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","tspan");return P.textContent=d,T&&N.setAttributes(P,T),P},N.createImage=function(d){var T=document.createElementNS("http://www.w3.org/2000/svg","image");return d&&N.setAttributes(T,d),T},N.createPoint=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return P.x=d,P.y=T,P},N.createPath=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg","path");return P.setAttribute("d",d),T&&N.setAttributes(P,T),P},N.createElement=function(d,T){var P=document.createElementNS("http://www.w3.org/2000/svg",d);return T&&N.setAttributes(P,T),P},N.getHollowRectanglePath=function(d,T,P,K,k,le,Le,Je){return"M"+d+","+T+"V"+(T+K)+"H"+(d+P)+"V"+T+"H"+k+"V"+le+"H"+(k+Le)+"V"+(le+Je)+"H"+k+"V"+T+"Z"},N}(),Si=function(){function N(d){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+d+"_"}return Object.defineProperty(N.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(N.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(N.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),N.prototype.addClass=function(d){return this.styleSheet===void 0&&this.addStyleSheet(),d.name=""+this.classNamePrefix+d.localName,this.classes.push(d),this.styleSheet.sheet.insertRule("."+d.name+" {"+d.style+"}",this.styleSheet.sheet.cssRules.length),d},N.prototype.addRule=function(d){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(d),this.styleSheet.sheet.insertRule(d.selector+" {"+d.style+"}",this.styleSheet.sheet.cssRules.length)},N.prototype.addStyleSheet=function(){var d;this.styleSheet=document.createElement("style"),((d=this.styleSheetRoot)!==null&&d!==void 0?d:document.head).appendChild(this.styleSheet),this.addRule(new pt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new pt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new pt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new dt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new dt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},N.prototype.removeStyleSheet=function(){var d;this.styleSheet&&(((d=this.styleSheetRoot)!==null&&d!==void 0?d:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},N}(),pt=function(N,d){this.selector=N,this.style=d},dt=function(N,d){this.localName=N,this.style=d},Ht=function(){function N(){this.blocks=[],this.display=""}return N.prototype.addButtonBlock=function(d){d.className=this.blockClassName,d.buttonClassName=this.buttonClassName,d.buttonColorsClassName=this.buttonColorsClassName,d.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(d)},N.prototype.addElementBlock=function(d){d.className===void 0&&(d.className=this.blockClassName),this.blocks.push(d)},N.prototype.getUI=function(){var d=document.createElement("div");return d.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,d.style.display=this.display,this.blocks.forEach(function(T){return d.appendChild(T.getUI())}),d},N}(),ei=function(){function N(){}return N.prototype.getUI=function(){var d=document.createElement("div");if(d.className=this.className,this.minWidth!==void 0&&(d.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":d.style.justifyContent="flex-start";break;case"center":d.style.justifyContent="center";break;case"end":d.style.justifyContent="flex-end"}return d.style.whiteSpace="nowrap",d},N}(),oi=function(N){function d(){var T=N!==null&&N.apply(this,arguments)||this;return T.buttons=[],T}return qt(d,N),d.prototype.addButton=function(T){T.className=this.buttonClassName,T.colorsClassName=this.buttonColorsClassName,T.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(T)},d.prototype.getUI=function(){var T=N.prototype.getUI.call(this);return this.buttons.forEach(function(P){return T.appendChild(P.getUI())}),T},d}(ei),li=function(){function N(d,T){this._isActive=!1,this._isHidden=!1,this._icon=d,this.title=T,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(N.prototype,"icon",{get:function(){return this._icon},set:function(d){this._icon=d,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isActive",{get:function(){return this._isActive},set:function(d){this._isActive=d,this.adjustClassName()},enumerable:!1,configurable:!0}),N.prototype.getUI=function(){var d=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return d.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},N.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,"")))},N.prototype.hide=function(){this._isHidden=!0},N}(),ki=function(N){function d(){var T=N!==null&&N.apply(this,arguments)||this;return T.elements=[],T}return qt(d,N),d.prototype.addElement=function(T){this.elements.push(T)},d.prototype.getUI=function(){var T=N.prototype.getUI.call(this);return this.elements.forEach(function(P){return T.appendChild(P)}),T},d}(ei),Wi=function(){function N(d,T){this.horizontal=d,this.vertical=T}return Object.defineProperty(N.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),N.prototype.getVerticalLength=function(d){return d/this.ratio},N.prototype.getHorizontalLength=function(d){return d*this.ratio},N}(),Yt=function(){function N(){}return N.getIcon=function(d,T){if(d>0&&T>0){var P=new Wi(d,T),K=P.ratio>=1?20:P.getHorizontalLength(20),k=P.ratio<1?20:P.getVerticalLength(20),le=document.createElementNS("http://www.w3.org/2000/svg","svg");le.setAttribute("xmlns","http://www.w3.org/2000/svg"),le.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(le);var Le=ht.createDefs();le.appendChild(Le);var Je=ht.createElement("clipPath",[["id","text-bg-clip"]]);Le.appendChild(Je);var at=ht.createPath(ht.getHollowRectanglePath((24-K)/2,(24-k)/2,K,k,(24-K)/2+2,(24-k)/2+2,K-4,k-4));le.appendChild(at);var De=ht.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);De.appendChild(ht.createTSpan(d+":"+T)),le.appendChild(De);var mt=De.getBBox();ht.setAttributes(De,[["x",((24-mt.width)/2).toString()],["y",((24-mt.height)/2-mt.y).toString()]]);var kt=ht.createPath(ht.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(mt.width))/2,(24-Math.ceil(mt.height))/2,Math.ceil(mt.width),Math.ceil(mt.height)));return Je.appendChild(kt),ht.setAttributes(at,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(le),le.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>'},N}(),_i=function(N){function d(T,P,K){var k=N.call(this,T,P)||this;return k.isDropdownOpen=!1,k.onClick=k.dropdownButtonClicked,k.dropdownButtons=K,k}return qt(d,N),d.prototype.setupDropdown=function(){var T=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(P){P.className=T.className,P.colorsClassName=T.colorsClassName,T.dropdownBlock.appendChild(P.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},d.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},d.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},d.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},d.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},d.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},d}(li),Oi=function(){function N(d,T){this.GRIP_SIZE=10,this.color=d,this.fillColor=T,this.visual=ht.createGroup(),this.visual.appendChild(ht.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ht.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return N.prototype.ownsTarget=function(d){return d===this.visual||d===this.visual.childNodes[0]||d===this.visual.childNodes[1]},N.prototype.setCenter=function(d,T){this.visual.childNodes.forEach(function(P){return ht.setAttributes(P,[["cx",d.toString()],["cy",T.toString()]])})},N}(),Ci=function(){function N(d,T,P,K){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=d,this.canvasHeight=T,this.margin=P,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(N.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(d){this._aspectRatio=d,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(d){this._isGridVisible=d,this.gridContainer&&ht.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(d){this._zoomFactor=d,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),N.prototype.open=function(){var d=this;this.cropShadeElement=ht.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ht.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var T=0;T<this.numberOfGridLines;T++)this.horizontalGridLines.push(ht.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ht.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(P){return d.gridContainer.appendChild(P)}),this.verticalGridLines.forEach(function(P){return d.gridContainer.appendChild(P)}),this.cropRectElement=ht.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Oi(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Oi(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Oi(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Oi(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},N.prototype.setCropRectangle=function(d){this.cropRect=d;var T=Object.assign({},this.cropRect);this.zoomFactor!==1&&(T.width=this.cropRect.width*this.zoomFactor,T.height=this.cropRect.height*this.zoomFactor,T.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-T.width/2,T.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-T.height/2),ht.setAttributes(this.cropRectElement,[["x",T.x.toString()],["y",T.y.toString()],["width",T.width.toString()],["height",T.height.toString()]]);var P=T.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(k,le){var Le=T.y+P*(le+1);ht.setAttributes(k,[["x1",""+T.x],["y1",""+Le],["x2",""+(T.x+T.width)],["y2",""+Le]])});var K=T.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(k,le){var Le=T.x+K*(le+1);ht.setAttributes(k,[["x1",""+Le],["y1",""+T.y],["x2",""+Le],["y2",""+(T.y+T.height)]])}),ht.setAttributes(this.cropShadeElement,[["d",ht.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,T.x,T.y,T.width,T.height)]]),this.topLeftGrip.setCenter(T.x,T.y),this.topRightGrip.setCenter(T.x+T.width,T.y),this.bottomLeftGrip.setCenter(T.x,T.y+T.height),this.bottomRightGrip.setCenter(T.x+T.width,T.y+T.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},N.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)},N.prototype.clientToLocalCoordinates=function(d,T){var P=this.container.getBoundingClientRect();return{x:d-P.left+this.margin,y:T-P.top+this.margin}},N.prototype.onPointerDown=function(d){this.container.setPointerCapture(d.pointerId),this.previousPoint=this.clientToLocalCoordinates(d.clientX,d.clientY),this.cropRectElement===d.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(d.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(d.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(d.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(d.target)&&(this.activeGrip=this.bottomRightGrip)},N.prototype.onPointerMove=function(d){if(this.isMoving)this.move(this.clientToLocalCoordinates(d.clientX,d.clientY));else if(this.activeGrip){var T=this.clientToLocalCoordinates(d.clientX,d.clientY);this.resize(T)}d.preventDefault()},N.prototype.onPointerUp=function(d){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(d.pointerId)},N.prototype.move=function(d){var T=d.x-this.previousPoint.x,P=d.y-this.previousPoint.y;this.zoomFactor!==1&&(T=-T/this.zoomFactor,P=-P/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+T),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+P),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=d},N.prototype.resize=function(d){var T=Object.assign({},this.cropRect),P=d.x-this.previousPoint.x,K=d.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:T.x+P<this.margin&&(P=this.margin-T.x),T.x+=P,T.width=this.cropRect.x+this.cropRect.width-T.x;break;case this.bottomRightGrip:case this.topRightGrip:T.width+P>this.canvasWidth*this.zoomFactor&&(P=this.canvasWidth*this.zoomFactor-T.width),T.width+=P}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(T.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(P),T.height=this.aspectRatio.getVerticalLength(T.width)):(T.y+=K,T.height=this.cropRect.y+this.cropRect.height-T.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?T.height=this.aspectRatio.getVerticalLength(T.width):T.height+=K}T.width<10&&(T.x=this.cropRect.x,T.width=10),T.height<10&&(T.y=this.cropRect.y,T.height=10),this.previousPoint=d,T.x>=this.margin&&T.y>=this.margin&&T.x-this.margin+T.width<=this.canvasWidth&&T.y-this.margin+T.height<=this.canvasHeight&&(this.cropRect=T,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},N.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var d=this.cropRect.x+this.cropRect.width/2,T=this.cropRect.y+this.cropRect.height/2,P=this.aspectRatio.getHorizontalLength(this.cropRect.height),K=this.aspectRatio.getVerticalLength(this.cropRect.width);P/this.canvasWidth<K/this.canvasHeight?this.cropRect.width=P: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=d-this.cropRect.width/2,this.cropRect.y=T-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)}},N.prototype.getRescaledRect=function(d,T,P,K,k,le){var Le=P/d,Je=K/T;return{x:(k.x-le)*Le+le,y:(k.y-le)*Je+le,width:k.width*Le,height:k.height*Je}},N.prototype.scaleCanvas=function(d,T){var P=this.getRescaledRect(this.canvasWidth,this.canvasHeight,d,T,this.cropRect,this.margin);this.canvasWidth=d,this.canvasHeight=T,this.onCropChange&&this.onCropChange(P),this.setCropRectangle(P)},N}(),Ni=function(){function N(d){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=d,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(N.prototype,"angle",{get:function(){return this._angle},set:function(d){this._angle=d,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),N.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},N.prototype.onPointerDown=function(d){this.controlContainer.setPointerCapture(d.pointerId),this.isDragging=!0,this.previousPoint={x:d.clientX,y:d.clientY}},N.prototype.onPointerMove=function(d){this.isDragging&&(this.onAngleChange&&this.onAngleChange((d.clientX-this.previousPoint.x)/5),this.previousPoint.x=d.clientX)},N.prototype.onPointerUp=function(d){this.isDragging&&this.onAngleChange&&this.onAngleChange((d.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(d.pointerId)},N.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var d=this.angleLabelText.getBBox();ht.setAttributes(this.angleLabelElement,[["x",((this.width-d.width)/2).toString()],["y",(this.height/2).toString()]])}},N.prototype.positionScaleShape=function(){if(this.scaleShape){var d=this.scaleShape.transform.baseVal.getItem(0);d.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(d,0)}},N.prototype.getVisual=function(){var d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("xmlns","http://www.w3.org/2000/svg"),d.setAttribute("width",this.width+"px"),d.setAttribute("height",this.height+"px"),d.setAttribute("viewBox","0 0 "+this.width+" "+this.height),d.style.flexShrink="0",document.body.appendChild(d);for(var T="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,P=1;P<=this.width/5+10;P++){var K=P%5==0?this.height/3:this.height/6;T+="h4v"+-K+"h1v"+K}T+="v1H0Z",this.scaleShape=ht.createPath(T);var k=ht.createTransform();this.scaleShape.transform.baseVal.appendItem(k),d.appendChild(this.scaleShape),this.angleLabelElement=ht.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ht.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var le=ht.createTSpan("");return le.innerHTML="°",this.angleLabelElement.appendChild(le),d.appendChild(this.angleLabelElement),document.body.removeChild(d),d},N}(),Li=function(){function N(){this.naturalSize=!1,this.imageType="image/png"}return N.prototype.rasterize=function(d,T,P,K,k,le,Le){var Je=this;return new Promise(function(at){var De=document.createElement("canvas");De.width=d.width.baseVal.value-2*K,De.height=d.height.baseVal.value-2*K;var mt=1,kt=1;Je.naturalSize===!0?(mt=T.naturalWidth/(d.width.baseVal.value-2*K)/le,kt=T.naturalHeight/(d.height.baseVal.value-2*K)/Le,De.width=T.naturalWidth/le,De.height=T.naturalHeight/Le):Je.width!==void 0&&Je.height!==void 0&&(mt=Je.width/P.width,kt=Je.height/P.height,De.width*=mt,De.height*=kt);var Kt=De.getContext("2d");Kt.translate(De.width/2,De.height/2),Kt.rotate(k*Math.PI/180),Kt.scale(le,Le),Kt.translate(-De.width/2,-De.height/2),Kt.drawImage(T,0,0,De.width,De.height);var wi=document.createElement("canvas");wi.width=P.width*mt,wi.height=P.height*kt,wi.getContext("2d").putImageData(Kt.getImageData((P.x-K)*mt,(P.y-K)*kt,P.width*mt,P.height*kt),0,0),at(wi.toDataURL(Je.imageType,Je.imageQuality))})},N}(),Ui=function(){function N(d){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=N.instanceCounter++,this.styles=new Si(this.instanceNo),this.target=d,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(N.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(d){this._zoomToCropEnabled=d,d?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(d){this._isGridVisible=d,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"gridLines",{get:function(){return this._gridLines},set:function(d){this._gridLines=d,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(d){this._rotationAngle=d,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"aspectRatio",{get:function(){var d;return(d=this._aspectRatio)!==null&&d!==void 0?d:this.aspectRatios[0]},set:function(d){this._aspectRatio=d},enumerable:!1,configurable:!0}),N.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},N.prototype.show=function(){this.showUI(),this.open()},N.prototype.close=function(d){d===void 0&&(d=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),d||this.closeEventListeners.forEach(function(T){return T()}),this._isOpen=!1)},N.prototype.addRenderEventListener=function(d){this.renderEventListeners.push(d)},N.prototype.removeRenderEventListener=function(d){this.renderEventListeners.indexOf(d)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(d),1)},N.prototype.addCloseEventListener=function(d){this.closeEventListeners.push(d)},N.prototype.removeCloseEventListener=function(d){this.closeEventListeners.indexOf(d)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(d),1)},N.prototype.setupResizeObserver=function(){var d=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){d.resize(d.target.clientWidth,d.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))},N.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var d=1*this.target.clientWidth/this.target.clientHeight,T=this.contentDiv.clientWidth/d>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*d:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,P=T+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/d;this.resize(T,P)}},N.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},N.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",ht.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},N.prototype.resize=function(d,T){this.imageWidth=Math.round(d),this.imageHeight=Math.round(T),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()},N.prototype.setEditingTarget=function(){var d=document.createElement("canvas");d.width=this.target.naturalWidth,d.height=this.target.naturalHeight,d.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var T=d.toDataURL();ht.setAttributes(this.editingTarget,[["href",T]]),this.setEditingTargetSize()},N.prototype.setTopLeft=function(){var d=this.target.getBoundingClientRect(),T=this.editorCanvas.getBoundingClientRect();this.left=d.left-T.left-this.CANVAS_MARGIN,this.top=d.top-T.top-this.CANVAS_MARGIN},N.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=ht.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ht.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ht.createGroup(),this.editingTargetRotationScaleContainer=ht.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var d=ht.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(d);var T=ht.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(T),this.editingTargetContainer=ht.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)},N.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},N.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ht.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ci(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},N.prototype.zoomToCrop=function(){if(this.cropRect){var d=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,T=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=d+"px "+T+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-d+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-T+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},N.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)},N.prototype.cropRectChanged=function(d){this.cropRect=d,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},N.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},N.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"},N.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},N.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var d=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,T=this.target.offsetTop>d+this.CANVAS_MARGIN?this.target.offsetTop-(d+this.CANVAS_MARGIN):0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},N.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},N.prototype.addTopToolbar=function(){var d=this;this.topToolbar=new Ht,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 T=new oi;T.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(T);var P=[];this.aspectRatios.forEach(function(kt){var Kt=new li(Yt.getIcon(kt.horizontal,kt.vertical),kt.horizontal===0&&kt.vertical===0?"FREE":kt.horizontal+":"+kt.vertical);Kt.onClick=function(){return d.ratioButtonClicked(kt)},P.push(Kt)}),this.aspectRatioButton=new _i(Yt.getIcon(0,0),"Aspect ratio",P),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,T.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var K=new li('<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(){d.isGridVisible=!d.isGridVisible,K.isActive=d.isGridVisible},T.addButton(K);var k=new li('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(k.isActive=this.zoomToCropEnabled,k.onClick=function(){d.zoomToCropEnabled=!d.zoomToCropEnabled,k.isActive=d.zoomToCropEnabled},T.addButton(k),!vi.isLicensed){var le=new ki;this.topToolbar.addElementBlock(le);var Le=document.createElement("div");Le.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Je=document.createElement("a");Je.style.color="currentColor",Je.href="https://markerjs.com/products/cropro",Je.target="_blank",Je.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>',Le.appendChild(Je),le.addElement(Le)}var at=new oi;at.minWidth=3*this.toolbarHeight+"px",at.contentAlign="end",this.topToolbar.addButtonBlock(at);var De=new li('<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");De.onClick=this.startRenderAndClose,at.addButton(De),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(De.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var mt=new li('<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");mt.onClick=this.close,at.addButton(mt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(mt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},N.prototype.addBottomToolbar=function(){var d=this;this.bottomToolbar=new Ht,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 T=new oi;T.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(T);var P=new li('<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");P.onClick=this.rotateLeftButtonClicked,T.addButton(P);var K=new li('<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,T.addButton(K);var k=new ki;k.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(k),this.straightener=new Ni("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(at){d.rotateBy(at),d.straightener.angle=d.rotationAngle},k.addElement(this.straightener.getUI());var le=new oi;le.minWidth=2*this.toolbarHeight+"px",le.contentAlign="end",this.bottomToolbar.addButtonBlock(le);var Le=new li('<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");Le.onClick=this.flipHorizontallyButtonClicked,le.addButton(Le);var Je=new li('<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");Je.onClick=this.flipVerticallyButtonClicked,le.addButton(Je)},N.prototype.ratioButtonClicked=function(d){this.aspectRatio=d,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},N.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Yt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},N.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Wi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},N.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},N.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},N.prototype.restoreState=function(d){if(d){var T=this.cropLayer.getRescaledRect(d.width,d.height,this.imageWidth,this.imageHeight,d.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(T),this.cropRectChanged(T),this.flippedHorizontally=d.flippedHorizontally,this.flippedVertically=d.flippedVertically,this.applyFlip(),this.rotationAngle=d.rotationAngle,this.applyRotation()}},N.prototype.clientToLocalCoordinates=function(d,T){var P=this.cropImage.getBoundingClientRect();return{x:d-P.left,y:T-P.top}},N.prototype.onWindowResize=function(){this.positionUI()},N.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var d=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=d+"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()},N.prototype.rotateLeftButtonClicked=function(){var d=this.rotationAngle-90;this.rotationAngle%90!=0&&(d+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(d)},N.prototype.rotateRightButtonClicked=function(){var d=this.rotationAngle+90;this.rotationAngle%90!=0&&(d-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(d)},N.prototype.rotateTo=function(d){d=(d=d>180?d-360:d)<=-180?d+360:d,this.rotationAngle=d,this.applyRotation()},N.prototype.rotateBy=function(d){this.rotateTo((this.rotationAngle+d)%360)},N.prototype.applyRotation=function(){var d=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var T=this.editingTargetRotationContainer.transform.baseVal.getItem(0);T.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(T,0);var P=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/P.width,this.imageHeight/P.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=d},N.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},N.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},N.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},N.prototype.startRenderAndClose=function(){return bt(this,void 0,void 0,function(){var d,T;return ii(this,function(P){switch(P.label){case 0:return[4,this.render()];case 1:return d=P.sent(),T=this.getState(),this.renderEventListeners.forEach(function(K){return K(d,T)}),this.close(!0),[2]}})})},N.prototype.render=function(){return bt(this,void 0,void 0,function(){var d;return ii(this,function(T){switch(T.label){case 0:return(d=new Li).naturalSize=this.renderAtNaturalSize,d.imageType=this.renderImageType,d.imageQuality=this.renderImageQuality,d.width=this.renderWidth,d.height=this.renderHeight,this.unzoomFromCrop(),ht.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,d.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 T.sent(),[4,d.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,T.sent()]}})})},N.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new dt("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 dt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new dt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var d=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new dt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*d)+`px;
|
|
height: `+(this.toolbarHeight-2*d)+`px;
|
|
padding: `+d+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new pt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new pt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new dt("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 dt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new dt("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 dt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*d)+`px;
|
|
padding: `+d+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new dt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},N.instanceCounter=0,N}(),qi=z("8hTe"),Ki=z.n(qi),cn=/<pre[^>]*>/g;function yn(N){var d=document.createElement("div");return d.innerHTML=N,d.childNodes.length===0?"":d.childNodes[0].nodeValue}var dn=ve.a=function(N){var d=N.value,T=d===void 0?"":d,P=N.edit,K=P===void 0?!1:P,k=N.className,le=N.showTextOnly,Le=N.showLines,Je=N.replaces,at=N.zoomImg,De=N.hasMask,mt=N.style,kt=mt===void 0?{}:mt,Kt=N.stylesPrev,wi=Kt===void 0?{}:Kt,Fi=String(T),pi=Object(C.useRef)(),Ri=Object(C.useRef)(),bn=Object(C.useState)(""),en=Object(H.a)(bn,2),Gi=en[0],Bi=en[1],fn=Object(C.useState)("office"),zi=Object(H.a)(fn,2),_n=zi[0],Vi=zi[1],En=function(){var Bt=new Ui(Ri.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var ri=Object(M.a)(e.a.mark(function Mt(mi){var $t;return e.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:return pi.current.style.display="none",hi.next=3,Object(Se.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mi}});case 3:$t=hi.sent,$t!=null&&$t.id&&Je(Ri.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return hi.stop()}},Mt)}));return function(Mt){return ri.apply(this,arguments)}}()),Bt.show()},Tn=function(){var Bt=new Pt(Ri.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var ri=Object(M.a)(e.a.mark(function Mt(mi){var $t;return e.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:if(pi.current.style.display="none",!Ri.current){hi.next=6;break}return hi.next=4,Object(Se.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mi.dataUrl}});case 4:$t=hi.sent,$t!=null&&$t.id&&Je(Ri.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return hi.stop()}},Mt)}));return function(Mt){return ri.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Yi=Object(C.useMemo)(function(){pi.current&&(pi.current.style.zIndex=-1);try{var ni=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ri=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Fi=Fi.replace(ni,"("+Y.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+Y.a.API_SERVER+"/api/attachments/").replace(ri,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch($i){}var Mt=D(Fi),mi=b();if(Fi.match(/\[TOC\]/)&&(Mt=Mt.replace("<p>[TOC]</p>",x()),_()),Mt=Mt.replace(/(__special_katext_id_\d+__)/g,function($i,hi){var tn=mi[hi],wn=tn.type,Sn=tn.expression;return Object(se.renderToString)(yn(Sn)||"",{displayMode:wn==="block",throwOnError:!1,output:"html"})}),Mt=Mt.replace(/▁/g,"\u2581\u2581\u2581"),m(),le){var $t=document.createElement("div");return $t.innerHTML=Mt,$t.innerText}return setTimeout(function(){return xn()},500),Mt},[Fi]),ui=Object(C.useRef)();g.WebkitLineClamp=Le,Le&&(kt=Object(O.a)(Object(O.a)({},kt),g));function Xi(ni){var Bt=ni.target;if(Bt.tagName.toUpperCase()==="IMG"){if(at){var ri=Bt.getAttribute("src");Bi(ri),Vi("image")}}else if(Bt.tagName.toUpperCase()==="A"){var Mt=Bt.getAttribute("href");if(Mt.indexOf("office")>-1)ni.preventDefault(),Bi(Mt),Vi("office");else if(Mt.indexOf("application/pdf")>-1)ni.preventDefault(),Bi(Mt),Vi("pdf");else if(Mt.indexOf("text/html")>-1)ni.preventDefault(),Bi(Mt),Vi("html");else if(Mt.startsWith("#")){ni.preventDefault();var mi=document.getElementById(Mt.replace("#",""));mi&&mi.scrollIntoView(!0)}}}var xn=function(){var Bt,ri=(Bt=ui.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");ri==null||ri.forEach(function(Mt){if(Mt.oncontextmenu=function(){return!1},Mt.src.indexOf(".m3u8")>-1&&!Mt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var mi=new W.a;mi.loadSource(Mt.src),mi.attachMedia(Mt)}}})};Object(C.useEffect)(function(){if(ui.current&&Yi&&(Yi.match(cn)&&window.PR.prettyPrint()),ui.current)return ui.current.addEventListener("click",Xi),function(){ui.current.removeEventListener("click",Xi),m(),_()}},[Yi,ui.current,Xi]);var Fn=function(Bt){if(!K)return;Bt.target.nodeName==="IMG"?(pi.current.style.zIndex=1,pi.current.style.display="flex",pi.current.style.width=Bt.target.clientWidth+"px",pi.current.style.height=Bt.target.clientHeight+"px",pi.current.style.top=Bt.target.offsetTop+"px",pi.current.style.left=Bt.target.offsetLeft+"px",Ri.current.src=Bt.target.getAttribute("src")):pi.current.style.display="none"};return f.a.createElement("div",{style:{position:"relative"}},f.a.createElement("div",{ref:ui,style:Object(O.a)({},kt),className:"".concat(k||""," markdown-body ").concat(Ki.a.mdBody),onMouseOver:Fn,dangerouslySetInnerHTML:{__html:Yi}}),f.a.createElement("div",{ref:pi,className:Ki.a.button},f.a.createElement(j.a,null,f.a.createElement(U.a,{onClick:function(){return En()}},"\u88C1\u526A"),f.a.createElement(U.a,{onClick:function(){return Tn()}},"\u7F16\u8F91"))),f.a.createElement("img",{ref:Ri,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),f.a.createElement(ne.a,{close:!0,data:Gi,type:Gi!=null&&Gi.length?_n:"",style:Object(O.a)({},wi),onClose:function(){return Bi("")}}))}},BU3w:function(st,ve,z){"use strict";z.d(ve,"a",function(){return M});var q=z("MNnm"),j="rc-util-key";function A(H){if(H.attachTo)return H.attachTo;var F=document.querySelector("head");return F||document.body}function U(H){var F,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var C=document.createElement("style");if((F=e.csp)===null||F===void 0?void 0:F.nonce){var f;C.nonce=(f=e.csp)===null||f===void 0?void 0:f.nonce}C.innerHTML=H;var p=A(e),o=p.firstChild;return e.prepend&&p.prepend?p.prepend(C):e.prepend&&o?p.insertBefore(C,o):p.appendChild(C),C}var O=new Map;function M(H,F){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=A(e);if(!O.has(C)){var f=U("",e),p=f.parentNode;O.set(C,p),p.removeChild(f)}var o=Array.from(O.get(C).children).find(function(n){return n.tagName==="STYLE"&&n[j]===F});if(o){var a,r;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&o.nonce!==((r=e.csp)===null||r===void 0?void 0:r.nonce)){var h;o.nonce=(h=e.csp)===null||h===void 0?void 0:h.nonce}return o.innerHTML!==H&&(o.innerHTML=H),o}var s=U(H,e);return s[j]=F,s}},BdwD:function(st,ve,z){"use strict";var q=z("+L6B"),j=z("2/Rp"),A=z("0Owb"),U=z("k1fw"),O=z("q1tI"),M=z.n(O),H=z("FOrL"),F=z.n(H),e=function(f){var p=f.buttonProps,o=p===void 0?{}:p,a=f.styles,r=a===void 0?{}:a,h=f.customText,s=f.ButtonText,n=f.ButtonClick,i=f.Buttonclass,t=f.ButtonTwo;return M.a.createElement("section",{className:"tc animated fadeIn",style:Object(U.a)(Object(U.a)({},{color:"#999",margin:"200px auto"}),r)},M.a.createElement("img",{src:F.a}),M.a.createElement("p",{className:"mt20 font14"},h||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&M.a.createElement(j.a,Object(A.a)({className:i,onClick:n},o),s),t&&t)};ve.a=e},"C/vA":function(st,ve,z){"use strict";z.d(ve,"a",function(){return q});function q(j){const A=this;let U=!1,O;return function(){return U||(U=!0,O=j.apply(A,arguments)),O}}},"Cg/j":function(st,ve,z){"use strict";z.d(ve,"b",function(){return q}),z.d(ve,"a",function(){return j}),z.d(ve,"c",function(){return U}),z.d(ve,"d",function(){return O});var q;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function H(F){return F[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=H})(q||(q={}));const j=U("instantiationService");function A(M,H,F,e){H[q.DI_TARGET]===H?H[q.DI_DEPENDENCIES].push({id:M,index:F,optional:e}):(H[q.DI_DEPENDENCIES]=[{id:M,index:F,optional:e}],H[q.DI_TARGET]=H)}function U(M){if(q.serviceIds.has(M))return q.serviceIds.get(M);const H=function(F,e,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");A(H,F,C,!1)};return H.toString=()=>M,q.serviceIds.set(M,H),H}function O(M){return function(H,F,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");A(M,H,e,!0)}}},DlQD:function(st,ve,z){(function(q,j){st.exports=j()})(this,function(){"use strict";function q(pe,ue){for(var ce=0;ce<ue.length;ce++){var X=ue[ce];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(pe,X.key,X)}}function j(pe,ue,ce){return ue&&q(pe.prototype,ue),ce&&q(pe,ce),pe}function A(pe,ue){if(!pe)return;if(typeof pe=="string")return U(pe,ue);var ce=Object.prototype.toString.call(pe).slice(8,-1);if(ce==="Object"&&pe.constructor&&(ce=pe.constructor.name),ce==="Map"||ce==="Set")return Array.from(pe);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return U(pe,ue)}function U(pe,ue){(ue==null||ue>pe.length)&&(ue=pe.length);for(var ce=0,X=new Array(ue);ce<ue;ce++)X[ce]=pe[ce];return X}function O(pe,ue){var ce;if(typeof Symbol=="undefined"||pe[Symbol.iterator]==null){if(Array.isArray(pe)||(ce=A(pe))||ue&&pe&&typeof pe.length=="number"){ce&&(pe=ce);var X=0;return function(){return X>=pe.length?{done:!0}:{done:!1,value:pe[X++]}}}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 ce=pe[Symbol.iterator](),ce.next.bind(ce)}function M(pe,ue){return ue={exports:{}},pe(ue,ue.exports),ue.exports}var H=M(function(pe){function ue(){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 ce(X){pe.exports.defaults=X}pe.exports={defaults:ue(),getDefaults:ue,changeDefaults:ce}}),F=H.defaults,e=H.getDefaults,C=H.changeDefaults,f=/[&<>"']/,p=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(ue){return r[ue]};function s(pe,ue){if(ue){if(f.test(pe))return pe.replace(p,h)}else if(o.test(pe))return pe.replace(a,h);return pe}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(pe){return pe.replace(n,function(ue,ce){return ce=ce.toLowerCase(),ce==="colon"?":":ce.charAt(0)==="#"?ce.charAt(1)==="x"?String.fromCharCode(parseInt(ce.substring(2),16)):String.fromCharCode(+ce.substring(1)):""})}var t=/(^|[^\[])\^/g;function _(pe,ue){pe=pe.source||pe,ue=ue||"";var ce={replace:function($,te){return te=te.source||te,te=te.replace(t,"$1"),pe=pe.replace($,te),ce},getRegex:function(){return new RegExp(pe,ue)}};return ce}var g=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function x(pe,ue,ce){if(pe){var X;try{X=decodeURIComponent(i(ce)).replace(g,"").toLowerCase()}catch($){return null}if(X.indexOf("javascript:")===0||X.indexOf("vbscript:")===0||X.indexOf("data:")===0)return null}ue&&!v.test(ce)&&(ce=l(ue,ce));try{ce=encodeURI(ce).replace(/%25/g,"%")}catch($){return null}return ce}var E={},y=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(pe,ue){E[" "+pe]||(y.test(pe)?E[" "+pe]=pe+"/":E[" "+pe]=I(pe,"/",!0)),pe=E[" "+pe];var ce=pe.indexOf(":")===-1;return ue.substring(0,2)==="//"?ce?ue:pe.replace(c,"$1")+ue:ue.charAt(0)==="/"?ce?ue:pe.replace(u,"$1")+ue:pe+ue}var b={exec:function(){}};function m(pe){for(var ue=1,ce,X;ue<arguments.length;ue++){ce=arguments[ue];for(X in ce)Object.prototype.hasOwnProperty.call(ce,X)&&(pe[X]=ce[X])}return pe}function w(pe,ue){var ce=pe.replace(/\|/g,function(te,oe,Te){for(var Ce=!1,Ke=oe;--Ke>=0&&Te[Ke]==="\\";)Ce=!Ce;return Ce?"|":" |"}),X=ce.split(/ \|/),$=0;if(X.length>ue)X.splice(ue);else for(;X.length<ue;)X.push("");for(;$<X.length;$++)X[$]=X[$].trim().replace(/\\\|/g,"|");return X}function I(pe,ue,ce){var X=pe.length;if(X===0)return"";for(var $=0;$<X;){var te=pe.charAt(X-$-1);if(te===ue&&!ce)$++;else if(te!==ue&&ce)$++;else break}return pe.substr(0,X-$)}function L(pe,ue){if(pe.indexOf(ue[1])===-1)return-1;for(var ce=pe.length,X=0,$=0;$<ce;$++)if(pe[$]==="\\")$++;else if(pe[$]===ue[0])X++;else if(pe[$]===ue[1]&&(X--,X<0))return $;return-1}function S(pe){pe&&pe.sanitize&&!pe.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 D={escape:s,unescape:i,edit:_,cleanUrl:x,resolveUrl:l,noopTest:b,merge:m,splitCells:w,rtrim:I,findClosingBracket:L,checkSanitizeDeprecation:S},B=H.defaults,R=D.rtrim,W=D.splitCells,Y=D.escape,se=D.findClosingBracket;function ne(pe,ue,ce){var X=ue.href,$=ue.title?Y(ue.title):null,te=pe[1].replace(/\\([\[\]])/g,"$1");return pe[0].charAt(0)!=="!"?{type:"link",raw:ce,href:X,title:$,text:te}:{type:"image",raw:ce,href:X,title:$,text:Y(te)}}function Se(pe,ue){var ce=pe.match(/^(\s+)(?:```)/);if(ce===null)return ue;var X=ce[1];return ue.split(`
|
|
`).map(function($){var te=$.match(/^\s+/);if(te===null)return $;var oe=te[0];return oe.length>=X.length?$.slice(X.length):$}).join(`
|
|
`)}var xe=function(){function pe(ce){this.options=ce||B}var ue=pe.prototype;return ue.space=function(X){var $=this.rules.block.newline.exec(X);if($)return $[0].length>1?{type:"space",raw:$[0]}:{raw:`
|
|
`}},ue.code=function(X,$){var te=this.rules.block.code.exec(X);if(te){var oe=$[$.length-1];if(oe&&oe.type==="paragraph")return{raw:te[0],text:te[0].trimRight()};var Te=te[0].replace(/^ {4}/gm,"");return{type:"code",raw:te[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:R(Te,`
|
|
`)}}},ue.fences=function(X){var $=this.rules.block.fences.exec(X);if($){var te=$[0],oe=Se(te,$[3]||"");return{type:"code",raw:te,lang:$[2]?$[2].trim():$[2],text:oe}}},ue.heading=function(X){var $=this.rules.block.heading.exec(X);if($)return{type:"heading",raw:$[0],depth:$[1].length,text:$[2]}},ue.nptable=function(X){var $=this.rules.block.nptable.exec(X);if($){var te={type:"table",header:W($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
|
|
`):[],raw:$[0]};if(te.header.length===te.align.length){var oe=te.align.length,Te;for(Te=0;Te<oe;Te++)/^ *-+: *$/.test(te.align[Te])?te.align[Te]="right":/^ *:-+: *$/.test(te.align[Te])?te.align[Te]="center":/^ *:-+ *$/.test(te.align[Te])?te.align[Te]="left":te.align[Te]=null;for(oe=te.cells.length,Te=0;Te<oe;Te++)te.cells[Te]=W(te.cells[Te],te.header.length);return te}}},ue.hr=function(X){var $=this.rules.block.hr.exec(X);if($)return{type:"hr",raw:$[0]}},ue.blockquote=function(X){var $=this.rules.block.blockquote.exec(X);if($){var te=$[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:$[0],text:te}}},ue.list=function(X){var $=this.rules.block.list.exec(X);if($){for(var te=$[0],oe=$[2],Te=oe.length>1,Ce=oe[oe.length-1]===")",Ke={type:"list",raw:te,ordered:Te,start:Te?+oe.slice(0,-1):"",loose:!1,items:[]},lt=$[0].match(this.rules.block.item),gt=!1,ut,yt,wt,rt,Vt,Pt,Zt,qt=lt.length,bt=0;bt<qt;bt++)ut=lt[bt],te=ut,yt=ut.length,ut=ut.replace(/^ *([*+-]|\d+[.)]) */,""),~ut.indexOf(`
|
|
`)&&(yt-=ut.length,ut=this.options.pedantic?ut.replace(/^ {1,4}/gm,""):ut.replace(new RegExp("^ {1,"+yt+"}","gm"),"")),bt!==qt-1&&(wt=this.rules.block.bullet.exec(lt[bt+1])[0],(Te?wt.length===1||!Ce&&wt[wt.length-1]===")":wt.length>1||this.options.smartLists&&wt!==oe)&&(rt=lt.slice(bt+1).join(`
|
|
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-rt.length),bt=qt-1)),Vt=gt||/\n\n(?!\s*$)/.test(ut),bt!==qt-1&&(gt=ut.charAt(ut.length-1)===`
|
|
`,Vt||(Vt=gt)),Vt&&(Ke.loose=!0),Pt=/^\[[ xX]\] /.test(ut),Zt=void 0,Pt&&(Zt=ut[1]!==" ",ut=ut.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:te,task:Pt,checked:Zt,loose:Vt,text:ut});return Ke}},ue.html=function(X){var $=this.rules.block.html.exec(X);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]):Y($[0]):$[0]}},ue.def=function(X){var $=this.rules.block.def.exec(X);if($){$[3]&&($[3]=$[3].substring(1,$[3].length-1));var te=$[1].toLowerCase().replace(/\s+/g," ");return{tag:te,raw:$[0],href:$[2],title:$[3]}}},ue.table=function(X){var $=this.rules.block.table.exec(X);if($){var te={type:"table",header:W($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
|
|
`):[]};if(te.header.length===te.align.length){te.raw=$[0];var oe=te.align.length,Te;for(Te=0;Te<oe;Te++)/^ *-+: *$/.test(te.align[Te])?te.align[Te]="right":/^ *:-+: *$/.test(te.align[Te])?te.align[Te]="center":/^ *:-+ *$/.test(te.align[Te])?te.align[Te]="left":te.align[Te]=null;for(oe=te.cells.length,Te=0;Te<oe;Te++)te.cells[Te]=W(te.cells[Te].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},ue.lheading=function(X){var $=this.rules.block.lheading.exec(X);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1]}},ue.paragraph=function(X){var $=this.rules.block.paragraph.exec(X);if($)return{type:"paragraph",raw:$[0],text:$[1].charAt($[1].length-1)===`
|
|
`?$[1].slice(0,-1):$[1]}},ue.text=function(X,$){var te=this.rules.block.text.exec(X);if(te){var oe=$[$.length-1];return oe&&oe.type==="text"?{raw:te[0],text:te[0]}:{type:"text",raw:te[0],text:te[0]}}},ue.escape=function(X){var $=this.rules.inline.escape.exec(X);if($)return{type:"escape",raw:$[0],text:Y($[1])}},ue.tag=function(X,$,te){var oe=this.rules.inline.tag.exec(X);if(oe)return!$&&/^<a /i.test(oe[0])?$=!0:$&&/^<\/a>/i.test(oe[0])&&($=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:$,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):Y(oe[0]):oe[0]}},ue.link=function(X){var $=this.rules.inline.link.exec(X);if($){var te=se($[2],"()");if(te>-1){var oe=$[0].indexOf("!")===0?5:4,Te=oe+$[1].length+te;$[2]=$[2].substring(0,te),$[0]=$[0].substring(0,Te).trim(),$[3]=""}var Ce=$[2],Ke="";if(this.options.pedantic){var lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);lt?(Ce=lt[1],Ke=lt[3]):Ke=""}else Ke=$[3]?$[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var gt=ne($,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},$[0]);return gt}},ue.reflink=function(X,$){var te;if((te=this.rules.inline.reflink.exec(X))||(te=this.rules.inline.nolink.exec(X))){var oe=(te[2]||te[1]).replace(/\s+/g," ");if(oe=$[oe.toLowerCase()],!oe||!oe.href){var Te=te[0].charAt(0);return{type:"text",raw:Te,text:Te}}var Ce=ne(te,oe,te[0]);return Ce}},ue.strong=function(X,$,te){te===void 0&&(te="");var oe=this.rules.inline.strong.start.exec(X);if(oe&&(!oe[1]||oe[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){$=$.slice(-1*X.length);var Te=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var Ce;(oe=Te.exec($))!=null;)if(Ce=this.rules.inline.strong.middle.exec($.slice(0,oe.index+3)),Ce)return{type:"strong",raw:X.slice(0,Ce[0].length),text:X.slice(2,Ce[0].length-2)}}},ue.em=function(X,$,te){te===void 0&&(te="");var oe=this.rules.inline.em.start.exec(X);if(oe&&(!oe[1]||oe[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){$=$.slice(-1*X.length);var Te=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var Ce;(oe=Te.exec($))!=null;)if(Ce=this.rules.inline.em.middle.exec($.slice(0,oe.index+2)),Ce)return{type:"em",raw:X.slice(0,Ce[0].length),text:X.slice(1,Ce[0].length-1)}}},ue.codespan=function(X){var $=this.rules.inline.code.exec(X);if($){var te=$[2].replace(/\n/g," "),oe=/[^ ]/.test(te),Te=te.startsWith(" ")&&te.endsWith(" ");return oe&&Te&&(te=te.substring(1,te.length-1)),te=Y(te,!0),{type:"codespan",raw:$[0],text:te}}},ue.br=function(X){var $=this.rules.inline.br.exec(X);if($)return{type:"br",raw:$[0]}},ue.del=function(X){var $=this.rules.inline.del.exec(X);if($)return{type:"del",raw:$[0],text:$[1]}},ue.autolink=function(X,$){var te=this.rules.inline.autolink.exec(X);if(te){var oe,Te;return te[2]==="@"?(oe=Y(this.options.mangle?$(te[1]):te[1]),Te="mailto:"+oe):(oe=Y(te[1]),Te=oe),{type:"link",raw:te[0],text:oe,href:Te,tokens:[{type:"text",raw:oe,text:oe}]}}},ue.url=function(X,$){var te;if(te=this.rules.inline.url.exec(X)){var oe,Te;if(te[2]==="@")oe=Y(this.options.mangle?$(te[0]):te[0]),Te="mailto:"+oe;else{var Ce;do Ce=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(Ce!==te[0]);oe=Y(te[0]),te[1]==="www."?Te="http://"+oe:Te=oe}return{type:"link",raw:te[0],text:oe,href:Te,tokens:[{type:"text",raw:oe,text:oe}]}}},ue.inlineText=function(X,$,te){var oe=this.rules.inline.text.exec(X);if(oe){var Te;return $?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):Y(oe[0]):oe[0]:Te=Y(this.options.smartypants?te(oe[0]):oe[0]),{type:"text",raw:oe[0],text:Te}}},pe}(),we=D.noopTest,Re=D.edit,Pe=D.merge,ye={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:we,table:we,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Re(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Re(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Re(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=Re(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Re(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=Re(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Pe({},ye),ye.gfm=Pe({},ye.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*|$)"}),ye.gfm.nptable=Re(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=Re(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=Pe({},ye.normal,{html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._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:we,paragraph:Re(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:we,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:we,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ee._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ee.punctuation=Re(ee.punctuation).replace(/punctuation/g,ee._punctuation).getRegex(),ee._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ee._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ee.em.start=Re(ee.em.start).replace(/punctuation/g,ee._punctuation).getRegex(),ee.em.middle=Re(ee.em.middle).replace(/punctuation/g,ee._punctuation).replace(/overlapSkip/g,ee._overlapSkip).getRegex(),ee.em.endAst=Re(ee.em.endAst,"g").replace(/punctuation/g,ee._punctuation).getRegex(),ee.em.endUnd=Re(ee.em.endUnd,"g").replace(/punctuation/g,ee._punctuation).getRegex(),ee.strong.start=Re(ee.strong.start).replace(/punctuation/g,ee._punctuation).getRegex(),ee.strong.middle=Re(ee.strong.middle).replace(/punctuation/g,ee._punctuation).replace(/blockSkip/g,ee._blockSkip).getRegex(),ee.strong.endAst=Re(ee.strong.endAst,"g").replace(/punctuation/g,ee._punctuation).getRegex(),ee.strong.endUnd=Re(ee.strong.endUnd,"g").replace(/punctuation/g,ee._punctuation).getRegex(),ee.blockSkip=Re(ee._blockSkip,"g").getRegex(),ee.overlapSkip=Re(ee._overlapSkip,"g").getRegex(),ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ee._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])?)+(?![-_])/,ee.autolink=Re(ee.autolink).replace("scheme",ee._scheme).replace("email",ee._email).getRegex(),ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ee.tag=Re(ee.tag).replace("comment",ye._comment).replace("attribute",ee._attribute).getRegex(),ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ee._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ee.link=Re(ee.link).replace("label",ee._label).replace("href",ee._href).replace("title",ee._title).getRegex(),ee.reflink=Re(ee.reflink).replace("label",ee._label).getRegex(),ee.reflinkSearch=Re(ee.reflinkSearch,"g").replace("reflink",ee.reflink).replace("nolink",ee.nolink).getRegex(),ee.normal=Pe({},ee),ee.pedantic=Pe({},ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",ee._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee._label).getRegex()}),ee.gfm=Pe({},ee.normal,{escape:Re(ee.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ee.gfm.url=Re(ee.gfm.url,"i").replace("email",ee.gfm._extended_email).getRegex(),ee.breaks=Pe({},ee.gfm,{br:Re(ee.br).replace("{2,}","*").getRegex(),text:Re(ee.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var je={block:ye,inline:ee},et=H.defaults,He=je.block,Ne=je.inline;function Ye(pe){return pe.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 Ae(pe){var ue="",ce,X,$=pe.length;for(ce=0;ce<$;ce++)X=pe.charCodeAt(ce),Math.random()>.5&&(X="x"+X.toString(16)),ue+="&#"+X+";";return ue}var Ue=function(){function pe(ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=ce||et,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var X={block:He.normal,inline:Ne.normal};this.options.pedantic?(X.block=He.pedantic,X.inline=Ne.pedantic):this.options.gfm&&(X.block=He.gfm,this.options.breaks?X.inline=Ne.breaks:X.inline=Ne.gfm),this.tokenizer.rules=X}pe.lex=function(X,$){var te=new pe($);return te.lex(X)};var ue=pe.prototype;return ue.lex=function(X){return X=X.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(X,this.tokens,!0),this.inline(this.tokens),this.tokens},ue.blockTokens=function(X,$,te){$===void 0&&($=[]),te===void 0&&(te=!0),X=X.replace(/^ +$/gm,"");for(var oe,Te,Ce,Ke;X;){if(oe=this.tokenizer.space(X)){X=X.substring(oe.raw.length),oe.type&&$.push(oe);continue}if(oe=this.tokenizer.code(X,$)){X=X.substring(oe.raw.length),oe.type?$.push(oe):(Ke=$[$.length-1],Ke.raw+=`
|
|
`+oe.raw,Ke.text+=`
|
|
`+oe.text);continue}if(oe=this.tokenizer.fences(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.heading(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.nptable(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.hr(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.blockquote(X)){X=X.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],te),$.push(oe);continue}if(oe=this.tokenizer.list(X)){for(X=X.substring(oe.raw.length),Ce=oe.items.length,Te=0;Te<Ce;Te++)oe.items[Te].tokens=this.blockTokens(oe.items[Te].text,[],!1);$.push(oe);continue}if(oe=this.tokenizer.html(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(te&&(oe=this.tokenizer.def(X))){X=X.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(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.lheading(X)){X=X.substring(oe.raw.length),$.push(oe);continue}if(te&&(oe=this.tokenizer.paragraph(X))){X=X.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.text(X,$)){X=X.substring(oe.raw.length),oe.type?$.push(oe):(Ke=$[$.length-1],Ke.raw+=`
|
|
`+oe.raw,Ke.text+=`
|
|
`+oe.text);continue}if(X){var lt="Infinite loop on byte: "+X.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return $},ue.inline=function(X){var $,te,oe,Te,Ce,Ke,lt=X.length;for($=0;$<lt;$++){Ke=X[$];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},Te=Ke.header.length,te=0;te<Te;te++)Ke.tokens.header[te]=[],this.inlineTokens(Ke.header[te],Ke.tokens.header[te]);for(Te=Ke.cells.length,te=0;te<Te;te++)for(Ce=Ke.cells[te],Ke.tokens.cells[te]=[],oe=0;oe<Ce.length;oe++)Ke.tokens.cells[te][oe]=[],this.inlineTokens(Ce[oe],Ke.tokens.cells[te][oe]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(Te=Ke.items.length,te=0;te<Te;te++)this.inline(Ke.items[te].tokens);break}}}return X},ue.inlineTokens=function(X,$,te,oe,Te){$===void 0&&($=[]),te===void 0&&(te=!1),oe===void 0&&(oe=!1),Te===void 0&&(Te="");var Ce,Ke=X,lt;if(this.tokens.links){var gt=Object.keys(this.tokens.links);if(gt.length>0)for(;(lt=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)gt.includes(lt[0].slice(lt[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(lt=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;X;){if(Ce=this.tokenizer.escape(X)){X=X.substring(Ce.raw.length),$.push(Ce);continue}if(Ce=this.tokenizer.tag(X,te,oe)){X=X.substring(Ce.raw.length),te=Ce.inLink,oe=Ce.inRawBlock,$.push(Ce);continue}if(Ce=this.tokenizer.link(X)){X=X.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,oe)),$.push(Ce);continue}if(Ce=this.tokenizer.reflink(X,this.tokens.links)){X=X.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,oe)),$.push(Ce);continue}if(Ce=this.tokenizer.strong(X,Ke,Te)){X=X.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],te,oe),$.push(Ce);continue}if(Ce=this.tokenizer.em(X,Ke,Te)){X=X.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],te,oe),$.push(Ce);continue}if(Ce=this.tokenizer.codespan(X)){X=X.substring(Ce.raw.length),$.push(Ce);continue}if(Ce=this.tokenizer.br(X)){X=X.substring(Ce.raw.length),$.push(Ce);continue}if(Ce=this.tokenizer.del(X)){X=X.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],te,oe),$.push(Ce);continue}if(Ce=this.tokenizer.autolink(X,Ae)){X=X.substring(Ce.raw.length),$.push(Ce);continue}if(!te&&(Ce=this.tokenizer.url(X,Ae))){X=X.substring(Ce.raw.length),$.push(Ce);continue}if(Ce=this.tokenizer.inlineText(X,oe,Ye)){X=X.substring(Ce.raw.length),Te=Ce.raw.slice(-1),$.push(Ce);continue}if(X){var ut="Infinite loop on byte: "+X.charCodeAt(0);if(this.options.silent){console.error(ut);break}else throw new Error(ut)}}return $},j(pe,null,[{key:"rules",get:function(){return{block:He,inline:Ne}}}]),pe}(),Ve=H.defaults,Q=D.cleanUrl,fe=D.escape,be=function(){function pe(ce){this.options=ce||Ve}var ue=pe.prototype;return ue.code=function(X,$,te){var oe=($||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(X,oe);Te!=null&&Te!==X&&(te=!0,X=Te)}return oe?'<pre><code class="'+this.options.langPrefix+fe(oe,!0)+'">'+(te?X:fe(X,!0))+`</code></pre>
|
|
`:"<pre><code>"+(te?X:fe(X,!0))+`</code></pre>
|
|
`},ue.blockquote=function(X){return`<blockquote>
|
|
`+X+`</blockquote>
|
|
`},ue.html=function(X){return X},ue.heading=function(X,$,te,oe){return this.options.headerIds?"<h"+$+' id="'+this.options.headerPrefix+oe.slug(te)+'">'+X+"</h"+$+`>
|
|
`:"<h"+$+">"+X+"</h"+$+`>
|
|
`},ue.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ue.list=function(X,$,te){var oe=$?"ol":"ul",Te=$&&te!==1?' start="'+te+'"':"";return"<"+oe+Te+`>
|
|
`+X+"</"+oe+`>
|
|
`},ue.listitem=function(X){return"<li>"+X+`</li>
|
|
`},ue.checkbox=function(X){return"<input "+(X?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ue.paragraph=function(X){return"<p>"+X+`</p>
|
|
`},ue.table=function(X,$){return $&&($="<tbody>"+$+"</tbody>"),`<table>
|
|
<thead>
|
|
`+X+`</thead>
|
|
`+$+`</table>
|
|
`},ue.tablerow=function(X){return`<tr>
|
|
`+X+`</tr>
|
|
`},ue.tablecell=function(X,$){var te=$.header?"th":"td",oe=$.align?"<"+te+' align="'+$.align+'">':"<"+te+">";return oe+X+"</"+te+`>
|
|
`},ue.strong=function(X){return"<strong>"+X+"</strong>"},ue.em=function(X){return"<em>"+X+"</em>"},ue.codespan=function(X){return"<code>"+X+"</code>"},ue.br=function(){return this.options.xhtml?"<br/>":"<br>"},ue.del=function(X){return"<del>"+X+"</del>"},ue.link=function(X,$,te){if(X=Q(this.options.sanitize,this.options.baseUrl,X),X===null)return te;var oe='<a href="'+fe(X)+'"';return $&&(oe+=' title="'+$+'"'),oe+=">"+te+"</a>",oe},ue.image=function(X,$,te){if(X=Q(this.options.sanitize,this.options.baseUrl,X),X===null)return te;var oe='<img src="'+X+'" alt="'+te+'"';return $&&(oe+=' title="'+$+'"'),oe+=this.options.xhtml?"/>":">",oe},ue.text=function(X){return X},pe}(),Ee=function(){function pe(){}var ue=pe.prototype;return ue.strong=function(X){return X},ue.em=function(X){return X},ue.codespan=function(X){return X},ue.del=function(X){return X},ue.html=function(X){return X},ue.text=function(X){return X},ue.link=function(X,$,te){return""+te},ue.image=function(X,$,te){return""+te},ue.br=function(){return""},pe}(),ke=function(){function pe(){this.seen={}}var ue=pe.prototype;return ue.slug=function(X){var $=X.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty($)){var te=$;do this.seen[te]++,$=te+"-"+this.seen[te];while(this.seen.hasOwnProperty($))}return this.seen[$]=0,$},pe}(),We=H.defaults,Xe=D.unescape,ze=function(){function pe(ce){this.options=ce||We,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ee,this.slugger=new ke}pe.parse=function(X,$){var te=new pe($);return te.parse(X)};var ue=pe.prototype;return ue.parse=function(X,$){$===void 0&&($=!0);var te="",oe,Te,Ce,Ke,lt,gt,ut,yt,wt,rt,Vt,Pt,Zt,qt,bt,ii,vi,ht,Si=X.length;for(oe=0;oe<Si;oe++){rt=X[oe];switch(rt.type){case"space":continue;case"hr":{te+=this.renderer.hr();continue}case"heading":{te+=this.renderer.heading(this.parseInline(rt.tokens),rt.depth,Xe(this.parseInline(rt.tokens,this.textRenderer)),this.slugger);continue}case"code":{te+=this.renderer.code(rt.text,rt.lang,rt.escaped);continue}case"table":{for(yt="",ut="",Ke=rt.header.length,Te=0;Te<Ke;Te++)ut+=this.renderer.tablecell(this.parseInline(rt.tokens.header[Te]),{header:!0,align:rt.align[Te]});for(yt+=this.renderer.tablerow(ut),wt="",Ke=rt.cells.length,Te=0;Te<Ke;Te++){for(gt=rt.tokens.cells[Te],ut="",lt=gt.length,Ce=0;Ce<lt;Ce++)ut+=this.renderer.tablecell(this.parseInline(gt[Ce]),{header:!1,align:rt.align[Ce]});wt+=this.renderer.tablerow(ut)}te+=this.renderer.table(yt,wt);continue}case"blockquote":{wt=this.parse(rt.tokens),te+=this.renderer.blockquote(wt);continue}case"list":{for(Vt=rt.ordered,Pt=rt.start,Zt=rt.loose,Ke=rt.items.length,wt="",Te=0;Te<Ke;Te++)bt=rt.items[Te],ii=bt.checked,vi=bt.task,qt="",bt.task&&(ht=this.renderer.checkbox(ii),Zt?bt.tokens.length>0&&bt.tokens[0].type==="text"?(bt.tokens[0].text=ht+" "+bt.tokens[0].text,bt.tokens[0].tokens&&bt.tokens[0].tokens.length>0&&bt.tokens[0].tokens[0].type==="text"&&(bt.tokens[0].tokens[0].text=ht+" "+bt.tokens[0].tokens[0].text)):bt.tokens.unshift({type:"text",text:ht}):qt+=ht),qt+=this.parse(bt.tokens,Zt),wt+=this.renderer.listitem(qt,vi,ii);te+=this.renderer.list(wt,Vt,Pt);continue}case"html":{te+=this.renderer.html(rt.text);continue}case"paragraph":{te+=this.renderer.paragraph(this.parseInline(rt.tokens));continue}case"text":{for(wt=rt.tokens?this.parseInline(rt.tokens):rt.text;oe+1<Si&&X[oe+1].type==="text";)rt=X[++oe],wt+=`
|
|
`+(rt.tokens?this.parseInline(rt.tokens):rt.text);te+=$?this.renderer.paragraph(wt):wt;continue}default:{var pt='Token with "'+rt.type+'" type was not found.';if(this.options.silent){console.error(pt);return}else throw new Error(pt)}}}return te},ue.parseInline=function(X,$){$=$||this.renderer;var te="",oe,Te,Ce=X.length;for(oe=0;oe<Ce;oe++){Te=X[oe];switch(Te.type){case"escape":{te+=$.text(Te.text);break}case"html":{te+=$.html(Te.text);break}case"link":{te+=$.link(Te.href,Te.title,this.parseInline(Te.tokens,$));break}case"image":{te+=$.image(Te.href,Te.title,Te.text);break}case"strong":{te+=$.strong(this.parseInline(Te.tokens,$));break}case"em":{te+=$.em(this.parseInline(Te.tokens,$));break}case"codespan":{te+=$.codespan(Te.text);break}case"br":{te+=$.br();break}case"del":{te+=$.del(this.parseInline(Te.tokens,$));break}case"text":{te+=$.text(Te.text);break}default:{var Ke='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return te},pe}(),qe=D.merge,Qe=D.checkSanitizeDeprecation,Ze=D.escape,Ge=H.getDefaults,it=H.changeDefaults,nt=H.defaults;function Ie(pe,ue,ce){if(typeof pe=="undefined"||pe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof pe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(pe)+", string expected");if(typeof ue=="function"&&(ce=ue,ue=null),ue=qe({},Ie.defaults,ue||{}),Qe(ue),ce){var X=ue.highlight,$;try{$=Ue.lex(pe,ue)}catch(Ce){return ce(Ce)}var te=function(Ke){var lt;if(!Ke)try{lt=ze.parse($,ue)}catch(gt){Ke=gt}return ue.highlight=X,Ke?ce(Ke):ce(null,lt)};if(!X||X.length<3)return te();if(delete ue.highlight,!$.length)return te();var oe=0;Ie.walkTokens($,function(Ce){Ce.type==="code"&&(oe++,setTimeout(function(){X(Ce.text,Ce.lang,function(Ke,lt){if(Ke)return te(Ke);lt!=null&<!==Ce.text&&(Ce.text=lt,Ce.escaped=!0),oe--,oe===0&&te()})},0))}),oe===0&&te();return}try{var Te=Ue.lex(pe,ue);return ue.walkTokens&&Ie.walkTokens(Te,ue.walkTokens),ze.parse(Te,ue)}catch(Ce){if(Ce.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ue.silent)return"<p>An error occurred:</p><pre>"+Ze(Ce.message+"",!0)+"</pre>";throw Ce}}Ie.options=Ie.setOptions=function(pe){return qe(Ie.defaults,pe),it(Ie.defaults),Ie},Ie.getDefaults=Ge,Ie.defaults=nt,Ie.use=function(pe){var ue=qe({},pe);if(pe.renderer&&function(){var X=Ie.defaults.renderer||new be,$=function(Te){var Ce=X[Te];X[Te]=function(){for(var Ke=arguments.length,lt=new Array(Ke),gt=0;gt<Ke;gt++)lt[gt]=arguments[gt];var ut=pe.renderer[Te].apply(X,lt);return ut===!1&&(ut=Ce.apply(X,lt)),ut}};for(var te in pe.renderer)$(te);ue.renderer=X}(),pe.tokenizer&&function(){var X=Ie.defaults.tokenizer||new xe,$=function(Te){var Ce=X[Te];X[Te]=function(){for(var Ke=arguments.length,lt=new Array(Ke),gt=0;gt<Ke;gt++)lt[gt]=arguments[gt];var ut=pe.tokenizer[Te].apply(X,lt);return ut===!1&&(ut=Ce.apply(X,lt)),ut}};for(var te in pe.tokenizer)$(te);ue.tokenizer=X}(),pe.walkTokens){var ce=Ie.defaults.walkTokens;ue.walkTokens=function(X){pe.walkTokens(X),ce&&ce(X)}}Ie.setOptions(ue)},Ie.walkTokens=function(pe,ue){for(var ce=O(pe),X;!(X=ce()).done;){var $=X.value;ue($);switch($.type){case"table":{for(var te=O($.tokens.header),oe;!(oe=te()).done;){var Te=oe.value;Ie.walkTokens(Te,ue)}for(var Ce=O($.tokens.cells),Ke;!(Ke=Ce()).done;)for(var lt=Ke.value,gt=O(lt),ut;!(ut=gt()).done;){var yt=ut.value;Ie.walkTokens(yt,ue)}break}case"list":{Ie.walkTokens($.items,ue);break}default:$.tokens&&Ie.walkTokens($.tokens,ue)}}},Ie.Parser=ze,Ie.parser=ze.parse,Ie.Renderer=be,Ie.TextRenderer=Ee,Ie.Lexer=Ue,Ie.lexer=Ue.lex,Ie.Tokenizer=xe,Ie.Slugger=ke,Ie.parse=Ie;var Me=Ie;return Me})},FOrL:function(st,ve,z){st.exports=z.p+"static/nodata.a6b3f948.png"},FWmy:function(st,ve,z){"use strict";z.d(ve,"a",function(){return q});function q(j,A){if(!j)throw new Error(A?`Assertion failed (${A})`:"Assertion Failed")}},INg4:function(st,ve,z){st.exports={flex_box_center:"flex_box_center___2rJad",flex_space_between:"flex_space_between___3xFPg",flex_box_vertical_center:"flex_box_vertical_center___3_RIS",flex_box_center_end:"flex_box_center_end___h0Di5",flex_box_column:"flex_box_column___Q5LEA",right:"right___1Gnba",title:"title___2HvSR",titles:"titles___2UU6k",tips:"tips___1iWOB"}},JYp7:function(st,ve,z){"use strict";z.d(ve,"a",function(){return q});var q;(function(j){function A(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}j.is=A;const U=Object.freeze([]);function O(){return U}j.empty=O;function*M(t){yield t}j.single=M;function H(t){return t||U}j.from=H;function F(t){return!t||t[Symbol.iterator]().next().done===!0}j.isEmpty=F;function e(t){return t[Symbol.iterator]().next().value}j.first=e;function C(t,_){for(const g of t)if(_(g))return!0;return!1}j.some=C;function f(t,_){for(const g of t)if(_(g))return g;return}j.find=f;function*p(t,_){for(const g of t)_(g)&&(yield g)}j.filter=p;function*o(t,_){let g=0;for(const v of t)yield _(v,g++)}j.map=o;function*a(...t){for(const _ of t)for(const g of _)yield g}j.concat=a;function*r(t){for(const _ of t)for(const g of _)yield g}j.concatNested=r;function h(t,_,g){let v=g;for(const x of t)v=_(v,x);return v}j.reduce=h;function*s(t,_,g=t.length){for(_<0&&(_+=t.length),g<0?g+=t.length:g>t.length&&(g=t.length);_<g;_++)yield t[_]}j.slice=s;function n(t,_=Number.POSITIVE_INFINITY){const g=[];if(_===0)return[g,t];const v=t[Symbol.iterator]();for(let x=0;x<_;x++){const E=v.next();if(E.done)return[g,j.empty()];g.push(E.value)}return[g,{[Symbol.iterator](){return v}}]}j.consume=n;function i(t,_,g=(v,x)=>v===x){const v=t[Symbol.iterator](),x=_[Symbol.iterator]();for(;;){const E=v.next(),y=x.next();if(E.done!==y.done)return!1;if(E.done)return!0;if(!g(E.value,y.value))return!1}}j.equals=i})(q||(q={}))},LdHM:function(st,ve,z){"use strict";z.d(ve,"b",function(){return t}),z.d(ve,"a",function(){return g});var q=z("1OyB"),j=z("vuIU"),A=z("Ji7U"),U=z("LK+K"),O=z("q1tI"),M=z("rePB"),H=z("Ff2n"),F=z("ODXe"),e=z("4IlW"),C=z("bX4T"),f=z("YrtM"),p=z("TSYQ"),o=z.n(p),a=z("+nKL"),r=z("8OUc"),h=function(W,Y){var se=W.prefixCls,ne=W.id,Se=W.flattenOptions,xe=W.childrenAsData,we=W.values,Re=W.searchValue,Pe=W.multiple,ye=W.defaultActiveFirstOption,ee=W.height,je=W.itemHeight,et=W.notFoundContent,He=W.open,Ne=W.menuItemSelectedIcon,Ye=W.virtual,Ae=W.onSelect,Ue=W.onToggleOpen,Ve=W.onActiveValue,Q=W.onScroll,fe=W.onMouseEnter,be="".concat(se,"-item"),Ee=Object(f.a)(function(){return Se},[He,Se],function(Me,pe){return pe[0]&&Me[1]!==pe[1]}),ke=O.useRef(null),We=function(pe){pe.preventDefault()},Xe=function(pe){ke.current&&ke.current.scrollTo({index:pe})},ze=function(pe){for(var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=Ee.length,X=0;X<ce;X+=1){var $=(pe+X*ue+ce)%ce,te=Ee[$],oe=te.group,Te=te.data;if(!oe&&!Te.disabled)return $}return-1},qe=O.useState(function(){return ze(0)}),Qe=Object(F.a)(qe,2),Ze=Qe[0],Ge=Qe[1],it=function(pe){Ge(pe);var ue=Ee[pe];if(!ue){Ve(null,-1);return}Ve(ue.data.value,pe)};O.useEffect(function(){it(ye!==!1?ze(0):-1)},[Ee.length,Re]),O.useEffect(function(){var Me=setTimeout(function(){if(!Pe&&He&&we.size===1){var pe=Array.from(we)[0],ue=Ee.findIndex(function(ce){var X=ce.data;return X.value===pe});it(ue),Xe(ue)}});return function(){return clearTimeout(Me)}},[He]);var nt=function(pe){pe!==void 0&&Ae(pe,{selected:!we.has(pe)}),Pe||Ue(!1)};if(O.useImperativeHandle(Y,function(){return{onKeyDown:function(pe){var ue=pe.which;switch(ue){case e.a.UP:case e.a.DOWN:{var ce=0;if(ue===e.a.UP?ce=-1:ue===e.a.DOWN&&(ce=1),ce!==0){var X=ze(Ze+ce,ce);Xe(X),it(X)}break}case e.a.ENTER:{var $=Ee[Ze];$&&!$.data.disabled?nt($.data.value):nt(void 0),He&&pe.preventDefault();break}case e.a.ESC:Ue(!1)}},onKeyUp:function(){},scrollTo:function(pe){Xe(pe)}}}),Ee.length===0)return O.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),className:"".concat(be,"-empty"),onMouseDown:We},et);function Ie(Me){var pe=Ee[Me];if(!pe)return null;var ue=pe.data||{},ce=ue.value,X=ue.label,$=ue.children,te=Object(C.a)(ue,!0),oe=xe?$:X;return pe?O.createElement("div",Object.assign({"aria-label":typeof oe=="string"?oe:null},te,{key:Me,role:"option",id:"".concat(ne,"_list_").concat(Me),"aria-selected":we.has(ce)}),ce):null}return O.createElement(O.Fragment,null,O.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ie(Ze-1),Ie(Ze),Ie(Ze+1)),O.createElement(a.a,{itemKey:"key",ref:ke,data:Ee,height:ee,itemHeight:je,fullHeight:!1,onMouseDown:We,onScroll:Q,virtual:Ye,onMouseEnter:fe},function(Me,pe){var ue,ce=Me.group,X=Me.groupOption,$=Me.data,te=$.label,oe=$.key;if(ce)return O.createElement("div",{className:o()(be,"".concat(be,"-group"))},te!==void 0?te:oe);var Te=$.disabled,Ce=$.value,Ke=$.title,lt=$.children,gt=$.style,ut=$.className,yt=Object(H.a)($,["disabled","value","title","children","style","className"]),wt=we.has(Ce),rt="".concat(be,"-option"),Vt=o()(be,rt,ut,(ue={},Object(M.a)(ue,"".concat(rt,"-grouped"),X),Object(M.a)(ue,"".concat(rt,"-active"),Ze===pe&&!Te),Object(M.a)(ue,"".concat(rt,"-disabled"),Te),Object(M.a)(ue,"".concat(rt,"-selected"),wt),ue)),Pt=xe?lt:te,Zt=!Ne||typeof Ne=="function"||wt;return O.createElement("div",Object.assign({},yt,{"aria-selected":wt,className:Vt,title:Ke,onMouseMove:function(){if(Ze===pe||Te)return;it(pe)},onClick:function(){Te||nt(Ce)},style:gt}),O.createElement("div",{className:"".concat(rt,"-content")},Pt||Ce),O.isValidElement(Ne)||wt,Zt&&O.createElement(r.a,{className:"".concat(be,"-option-state"),customizeIcon:Ne,customizeIconProps:{isSelected:wt}},wt?"\u2713":null))}))},s=O.forwardRef(h);s.displayName="OptionList";var n=s,i=function(){return null};i.isSelectOption=!0;var t=i,_=function(){return null};_.isSelectOptGroup=!0;var g=_,v=z("VTBJ"),x=z("Zm9Q");function E(R){var W=R.key,Y=R.props,se=Y.children,ne=Y.value,Se=Object(H.a)(Y,["children","value"]);return Object(v.a)({key:W,value:ne!==void 0?ne:W,children:se},Se)}function y(R){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(x.a)(R).map(function(Y,se){if(!O.isValidElement(Y)||!Y.type)return null;var ne=Y.type.isSelectOptGroup,Se=Y.key,xe=Y.props,we=xe.children,Re=Object(H.a)(xe,["children"]);return W||!ne?E(Y):Object(v.a)(Object(v.a)({key:"__RC_SELECT_GRP__".concat(Se===null?se:Se,"__"),label:Se},Re),{},{options:y(we)})}).filter(function(Y){return Y})}var c=z("2Qr1"),u=z("qNPg"),l=z("U8pU"),b=z("Kwbf"),m=z("WKfj");function w(R){var W=R.mode,Y=R.options,se=R.children,ne=R.backfill,Se=R.allowClear,xe=R.placeholder,we=R.getInputElement,Re=R.showSearch,Pe=R.onSearch,ye=R.defaultOpen,ee=R.autoFocus,je=R.labelInValue,et=R.value,He=R.inputValue,Ne=R.optionLabelProp,Ye=W==="multiple"||W==="tags",Ae=Re!==void 0?Re:Ye||W==="combobox",Ue=Y||y(se);if(Object(b.a)(W!=="tags"||Ue.every(function(be){return!be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Ve=Ue.some(function(be){return be.options?be.options.some(function(Ee){return typeof("value"in Ee?Ee.value:Ee.key)=="number"}):typeof("value"in be?be.value:be.key)=="number"});Object(b.a)(!Ve,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(W!=="combobox"||!Ne,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(W==="combobox"||!ne,"`backfill` only works with `combobox` mode."),Object(b.a)(W==="combobox"||!we,"`getInputElement` only work with `combobox` mode."),Object(b.b)(W!=="combobox"||!we||!Se||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!Ae&&W!=="combobox"&&W!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!ye||ee,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),et!=null){var Q=Object(m.d)(et);Object(b.a)(!je||Q.every(function(be){return Object(l.a)(be)==="object"&&("key"in be||"value"in be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ye||Array.isArray(et),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var fe=null;Object(x.a)(se).some(function(be){if(!O.isValidElement(be)||!be.type)return!1;var Ee=be.type;if(Ee.isSelectOption)return!1;if(Ee.isSelectOptGroup){var ke=Object(x.a)(be.props.children).every(function(We){return!O.isValidElement(We)||!be.type||We.type.isSelectOption?!0:(fe=We.type,!1)});return!ke}return fe=Ee,!0}),fe&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(fe.displayName||fe.name||fe,"`.")),Object(b.a)(He===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=w,L=Object(u.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:y,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:I,fillOptionsWithMissingValue:c.a}),S=function(R){Object(A.a)(Y,R);var W=Object(U.a)(Y);function Y(){var se;return Object(q.a)(this,Y),se=W.apply(this,arguments),se.selectRef=O.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(j.a)(Y,[{key:"render",value:function(){return O.createElement(L,Object.assign({ref:this.selectRef},this.props))}}]),Y}(O.Component);S.Option=t,S.OptGroup=g;var D=S,B=ve.c=D},MI8n:function(st,ve,z){"use strict";z.d(ve,"c",function(){return O}),z.d(ve,"b",function(){return e}),z.d(ve,"e",function(){return C}),z.d(ve,"a",function(){return f}),z.d(ve,"d",function(){return p}),z.d(ve,"f",function(){return o});var q=z("/cxE"),j=z("pmY6"),A=z("24hK"),U=z("5Y4S"),O;(function(a){a.None=()=>j.a.None;function r(w){return(I,L=null,S)=>{let D=!1,B;return B=w(R=>D?void 0:(B?B.dispose():D=!0,I.call(L,R)),null,S),D&&B.dispose(),B}}a.once=r;function h(w,I){return g((L,S=null,D)=>w(B=>L.call(S,I(B)),null,D))}a.map=h;function s(w,I){return g((L,S=null,D)=>w(B=>{I(B),L.call(S,B)},null,D))}a.forEach=s;function n(w,I){return g((L,S=null,D)=>w(B=>I(B)&&L.call(S,B),null,D))}a.filter=n;function i(w){return w}a.signal=i;function t(...w){return(I,L=null,S)=>Object(j.e)(...w.map(D=>D(B=>I.call(L,B),null,S)))}a.any=t;function _(w,I,L){let S=L;return h(w,D=>(S=I(S,D),S))}a.reduce=_;function g(w){let I;const L=new e({onFirstListenerAdd(){I=w(L.fire,L)},onLastListenerRemove(){I.dispose()}});return L.event}function v(w,I,L=100,S=!1,D){let B,R,W,Y=0;const se=new e({leakWarningThreshold:D,onFirstListenerAdd(){B=w(ne=>{Y++,R=I(R,ne),S&&!W&&(se.fire(R),R=void 0),clearTimeout(W),W=setTimeout(()=>{const Se=R;R=void 0,W=void 0,(!S||Y>1)&&se.fire(Se),Y=0},L)})},onLastListenerRemove(){B.dispose()}});return se.event}a.debounce=v;function x(w,I=(L,S)=>L===S){let L=!0,S;return n(w,D=>{const B=L||!I(D,S);return L=!1,S=D,B})}a.latch=x;function E(w,I){return[a.filter(w,I),a.filter(w,L=>!I(L))]}a.split=E;function y(w,I=!1,L=[]){let S=L.slice(),D=w(W=>{S?S.push(W):R.fire(W)});const B=()=>{S&&S.forEach(W=>R.fire(W)),S=null},R=new e({onFirstListenerAdd(){D||(D=w(W=>R.fire(W)))},onFirstListenerDidAdd(){S&&(I?setTimeout(B):B())},onLastListenerRemove(){D&&D.dispose(),D=null}});return R.event}a.buffer=y;class c{constructor(w){this.event=w}map(w){return new c(h(this.event,w))}forEach(w){return new c(s(this.event,w))}filter(w){return new c(n(this.event,w))}reduce(w,I){return new c(_(this.event,w,I))}latch(){return new c(x(this.event))}debounce(w,I=100,L=!1,S){return new c(v(this.event,w,I,L,S))}on(w,I,L){return this.event(w,I,L)}once(w,I,L){return r(this.event)(w,I,L)}}function u(w){return new c(w)}a.chain=u;function l(w,I,L=S=>S){const S=(...W)=>R.fire(L(...W)),D=()=>w.on(I,S),B=()=>w.removeListener(I,S),R=new e({onFirstListenerAdd:D,onLastListenerRemove:B});return R.event}a.fromNodeEventEmitter=l;function b(w,I,L=S=>S){const S=(...W)=>R.fire(L(...W)),D=()=>w.addEventListener(I,S),B=()=>w.removeEventListener(I,S),R=new e({onFirstListenerAdd:D,onLastListenerRemove:B});return R.event}a.fromDOMEventEmitter=b;function m(w){return new Promise(I=>r(w)(I))}a.toPromise=m})(O||(O={}));class M{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${M._idPool++}`}start(a){this._stopWatch=new U.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}M._idPool=0;let H=-1;class F{constructor(a,r=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=r,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let r=H;if(typeof this.customThreshold=="number"&&(r=this.customThreshold),r<=0||a<r)return;this._stacks||(this._stacks=new Map);const h=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),s=this._stacks.get(h)||0;if(this._stacks.set(h,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let n,i=0;for(const[t,_]of this._stacks)(!n||i<_)&&(n=t,i=_);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${i}):`),console.warn(n)}return()=>{const n=this._stacks.get(h)||0;this._stacks.set(h,n-1)}}}class e{constructor(a){var r;this._disposed=!1,this._options=a,this._leakageMon=H>0?new F(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((r=this._options)===null||r===void 0?void 0:r._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(a,r,h)=>{var s;this._listeners||(this._listeners=new A.a);const n=this._listeners.isEmpty();n&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(r?[a,r]:a);n&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,r);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),_=Object(j.i)(()=>{if(t&&t(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const g=this._listeners&&!this._listeners.isEmpty();g||this._options.onLastListenerRemove(this)}});return h instanceof j.b?h.add(_):Array.isArray(h)&&h.push(_),_}),this._event}fire(a){var r,h;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new A.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((r=this._perfMon)===null||r===void 0||r.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,n]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,n):s[0].call(s[1],n)}catch(i){Object(q.f)(i)}}(h=this._perfMon)===null||h===void 0||h.stop()}}dispose(){var a,r,h,s,n;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(r=this._deliveryQueue)===null||r===void 0||r.clear(),(s=(h=this._options)===null||h===void 0?void 0:h.onLastListenerRemove)===null||s===void 0||s.call(h),(n=this._leakageMon)===null||n===void 0||n.dispose())}}class C extends e{constructor(a){super(a);this._isPaused=0,this._eventQueue=new A.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class f extends C{constructor(a){var r;super(a);this._delay=(r=a.delay)!==null&&r!==void 0?r:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class p{constructor(){this.buffers=[]}wrapEvent(a){return(r,h,s)=>a(n=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>r.call(h,n)):r.call(h,n)},void 0,s)}bufferEvents(a){const r=[];this.buffers.push(r);const h=a();return this.buffers.pop(),r.forEach(s=>s()),h}}class o{constructor(){this.listening=!1,this.inputEvent=O.None,this.inputEventListener=j.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(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(st,ve,z){"use strict";(function(q,j){z.d(ve,"b",function(){return h}),z.d(ve,"i",function(){return t}),z.d(ve,"f",function(){return _}),z.d(ve,"d",function(){return g}),z.d(ve,"g",function(){return v}),z.d(ve,"h",function(){return x}),z.d(ve,"c",function(){return E}),z.d(ve,"k",function(){return y}),z.d(ve,"j",function(){return c}),z.d(ve,"a",function(){return u}),z.d(ve,"e",function(){return m});var A;const U="en";let O=!1,M=!1,H=!1,F=!1,e=!1,C=!1,f=!1,p,o=U,a,r;const h=typeof self=="object"?self:typeof q=="object"?q:{};let s;typeof h.vscode!="undefined"&&typeof h.vscode.process!="undefined"?s=h.vscode.process:typeof j!="undefined"&&(s=j);const n=typeof((A=s==null?void 0:s.versions)===null||A===void 0?void 0:A.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!n)r=navigator.userAgent,O=r.indexOf("Windows")>=0,M=r.indexOf("Macintosh")>=0,f=(r.indexOf("Macintosh")>=0||r.indexOf("iPad")>=0||r.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,H=r.indexOf("Linux")>=0,C=!0,p=navigator.language,o=p;else if(typeof s=="object"){O=s.platform==="win32",M=s.platform==="darwin",H=s.platform==="linux",F=H&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,p=U,o=U;const w=s.env.VSCODE_NLS_CONFIG;if(w)try{const I=JSON.parse(w),L=I.availableLanguages["*"];p=I.locale,o=L||U,a=I._translationsConfigFile}catch(I){}e=!0}else console.error("Unable to resolve platform.");let i=0;M?i=1:O?i=3:H&&(i=2);const t=O,_=M,g=H,v=e,x=C,E=f,y=r,c=function(){if(h.setImmediate)return h.setImmediate.bind(h);if(typeof h.postMessage=="function"&&!h.importScripts){let L=[];h.addEventListener("message",D=>{if(D.data&&D.data.vscodeSetImmediateId)for(let B=0,R=L.length;B<R;B++){const W=L[B];if(W.id===D.data.vscodeSetImmediateId){L.splice(B,1),W.callback();return}}});let S=0;return D=>{const B=++S;L.push({id:B,callback:D}),h.postMessage({vscodeSetImmediateId:B},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const I=Promise.resolve();return L=>I.then(L)}(),u=M||f?2:O?1:3;let l=!0,b=!1;function m(){if(!b){b=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const I=new Uint16Array(w.buffer);l=I[0]===(2<<8)+1}return l}}).call(this,z("IyRk"),z("Q2Ig"))},N0LK:function(st,ve,z){"use strict";z.d(ve,"C",function(){return q}),z.d(ve,"v",function(){return A}),z.d(ve,"s",function(){return U}),z.d(ve,"t",function(){return O}),z.d(ve,"U",function(){return M}),z.d(ve,"J",function(){return H}),z.d(ve,"O",function(){return F}),z.d(ve,"p",function(){return e}),z.d(ve,"T",function(){return C}),z.d(ve,"q",function(){return f}),z.d(ve,"N",function(){return p}),z.d(ve,"M",function(){return o}),z.d(ve,"Q",function(){return a}),z.d(ve,"u",function(){return r}),z.d(ve,"x",function(){return h}),z.d(ve,"I",function(){return s}),z.d(ve,"f",function(){return n}),z.d(ve,"h",function(){return i}),z.d(ve,"g",function(){return t}),z.d(ve,"i",function(){return _}),z.d(ve,"G",function(){return g}),z.d(ve,"H",function(){return v}),z.d(ve,"r",function(){return x}),z.d(ve,"R",function(){return E}),z.d(ve,"d",function(){return y}),z.d(ve,"e",function(){return c}),z.d(ve,"E",function(){return u}),z.d(ve,"F",function(){return l}),z.d(ve,"j",function(){return b}),z.d(ve,"z",function(){return m}),z.d(ve,"K",function(){return I}),z.d(ve,"L",function(){return L}),z.d(ve,"m",function(){return D}),z.d(ve,"k",function(){return R}),z.d(ve,"A",function(){return Y}),z.d(ve,"a",function(){return se}),z.d(ve,"n",function(){return ne}),z.d(ve,"l",function(){return Se}),z.d(ve,"D",function(){return xe}),z.d(ve,"B",function(){return we}),z.d(ve,"b",function(){return Re}),z.d(ve,"S",function(){return Pe}),z.d(ve,"o",function(){return ye}),z.d(ve,"P",function(){return ee}),z.d(ve,"w",function(){return je}),z.d(ve,"c",function(){return et}),z.d(ve,"y",function(){return Ye});function q(Q){return!Q||typeof Q!="string"?!0:Q.trim().length===0}const j=/{(\d+)}/g;function A(Q,...fe){return fe.length===0?Q:Q.replace(j,function(be,Ee){const ke=parseInt(Ee,10);return isNaN(ke)||ke<0||ke>=fe.length?be:fe[ke]})}function U(Q){return Q.replace(/[<>&]/g,function(fe){switch(fe){case"<":return"<";case">":return">";case"&":return"&";default:return fe}})}function O(Q){return Q.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(Q,fe=" "){const be=H(Q,fe);return F(be,fe)}function H(Q,fe){if(!Q||!fe)return Q;const be=fe.length;if(be===0||Q.length===0)return Q;let Ee=0;for(;Q.indexOf(fe,Ee)===Ee;)Ee=Ee+be;return Q.substring(Ee)}function F(Q,fe){if(!Q||!fe)return Q;const be=fe.length,Ee=Q.length;if(be===0||Ee===0)return Q;let ke=Ee,We=-1;for(;!(We=Q.lastIndexOf(fe,ke-1),We===-1||We+be!==ke);){if(We===0)return"";ke=We}return Q.substring(0,ke)}function e(Q){return Q.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function C(Q){return Q.replace(/\*/g,"")}function f(Q,fe,be={}){if(!Q)throw new Error("Cannot create regex from empty string");fe||(Q=O(Q)),be.wholeWord&&(/\B/.test(Q.charAt(0))||(Q="\\b"+Q),/\B/.test(Q.charAt(Q.length-1))||(Q=Q+"\\b"));let Ee="";return be.global&&(Ee+="g"),be.matchCase||(Ee+="i"),be.multiline&&(Ee+="m"),be.unicode&&(Ee+="u"),new RegExp(Q,Ee)}function p(Q){if(Q.source==="^"||Q.source==="^$"||Q.source==="$"||Q.source==="^\\s*$")return!1;const fe=Q.exec("");return!!(fe&&Q.lastIndex===0)}function o(Q){return(Q.global?"g":"")+(Q.ignoreCase?"i":"")+(Q.multiline?"m":"")+(Q.unicode?"u":"")}function a(Q){return Q.split(/\r\n|\r|\n/)}function r(Q){for(let fe=0,be=Q.length;fe<be;fe++){const Ee=Q.charCodeAt(fe);if(Ee!==32&&Ee!==9)return fe}return-1}function h(Q,fe=0,be=Q.length){for(let Ee=fe;Ee<be;Ee++){const ke=Q.charCodeAt(Ee);if(ke!==32&&ke!==9)return Q.substring(fe,Ee)}return Q.substring(fe,be)}function s(Q,fe=Q.length-1){for(let be=fe;be>=0;be--){const Ee=Q.charCodeAt(be);if(Ee!==32&&Ee!==9)return be}return-1}function n(Q,fe){return Q<fe?-1:Q>fe?1:0}function i(Q,fe,be=0,Ee=Q.length,ke=0,We=fe.length){for(;be<Ee&&ke<We;be++,ke++){let qe=Q.charCodeAt(be),Qe=fe.charCodeAt(ke);if(qe<Qe)return-1;if(qe>Qe)return 1}const Xe=Ee-be,ze=We-ke;return Xe<ze?-1:Xe>ze?1:0}function t(Q,fe){return _(Q,fe,0,Q.length,0,fe.length)}function _(Q,fe,be=0,Ee=Q.length,ke=0,We=fe.length){for(;be<Ee&&ke<We;be++,ke++){let qe=Q.charCodeAt(be),Qe=fe.charCodeAt(ke);if(qe===Qe)continue;if(qe>=128||Qe>=128)return i(Q.toLowerCase(),fe.toLowerCase(),be,Ee,ke,We);g(qe)&&(qe-=32),g(Qe)&&(Qe-=32);const Ze=qe-Qe;if(Ze===0)continue;return Ze}const Xe=Ee-be,ze=We-ke;return Xe<ze?-1:Xe>ze?1:0}function g(Q){return Q>=97&&Q<=122}function v(Q){return Q>=65&&Q<=90}function x(Q,fe){return Q.length===fe.length&&_(Q,fe)===0}function E(Q,fe){const be=fe.length;return fe.length>Q.length?!1:_(Q,fe,0,be)===0}function y(Q,fe){let be,Ee=Math.min(Q.length,fe.length);for(be=0;be<Ee;be++)if(Q.charCodeAt(be)!==fe.charCodeAt(be))return be;return Ee}function c(Q,fe){let be,Ee=Math.min(Q.length,fe.length);const ke=Q.length-1,We=fe.length-1;for(be=0;be<Ee;be++)if(Q.charCodeAt(ke-be)!==fe.charCodeAt(We-be))return be;return Ee}function u(Q){return 55296<=Q&&Q<=56319}function l(Q){return 56320<=Q&&Q<=57343}function b(Q,fe){return(Q-55296<<10)+(fe-56320)+65536}function m(Q,fe,be){const Ee=Q.charCodeAt(be);if(u(Ee)&&be+1<fe){const ke=Q.charCodeAt(be+1);if(l(ke))return b(Ee,ke)}return Ee}function w(Q,fe){const be=Q.charCodeAt(fe-1);if(l(be)&&fe>1){const Ee=Q.charCodeAt(fe-2);if(u(Ee))return b(Ee,be)}return be}function I(Q,fe){const be=He.getInstance(),Ee=fe,ke=Q.length,We=m(Q,ke,fe);fe+=We>=65536?2:1;let Xe=be.getGraphemeBreakType(We);for(;fe<ke;){const ze=m(Q,ke,fe),qe=be.getGraphemeBreakType(ze);if(et(Xe,qe))break;fe+=ze>=65536?2:1,Xe=qe}return fe-Ee}function L(Q,fe){const be=He.getInstance(),Ee=fe,ke=w(Q,fe);fe-=ke>=65536?2:1;let We=be.getGraphemeBreakType(ke);for(;fe>0;){const Xe=w(Q,fe),ze=be.getGraphemeBreakType(Xe);if(et(ze,We))break;fe-=Xe>=65536?2:1,We=ze}return Ee-fe}const S=/(?:[\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 D(Q){return S.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 R(Q){return B.test(Q)}const W=/^[\t\n\r\x20-\x7E]*$/;function Y(Q){return W.test(Q)}const se=/[\u2028\u2029]/;function ne(Q){return se.test(Q)}function Se(Q){for(let fe=0,be=Q.length;fe<be;fe++)if(xe(Q.charCodeAt(fe)))return!0;return!1}function xe(Q){return Q=+Q,Q>=11904&&Q<=55215||Q>=63744&&Q<=64255||Q>=65281&&Q<=65374}function we(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 Re=String.fromCharCode(65279);function Pe(Q){return!!(Q&&Q.length>0&&Q.charCodeAt(0)===65279)}function ye(Q,fe=!1){return Q?(fe&&(Q=Q.replace(/\\./g,"")),Q.toLowerCase()!==Q):!1}function ee(Q){const fe=90-65+1;return Q=Q%(2*fe),Q<fe?String.fromCharCode(97+Q):String.fromCharCode(65+Q-fe)}function je(Q){const fe=He.getInstance();return fe.getGraphemeBreakType(Q)}function et(Q,fe){return Q===0?fe!==5&&fe!==7:Q===2&&fe===3?!1:Q===4||Q===2||Q===3||(fe===4||fe===2||fe===3)?!0:Q===8&&(fe===8||fe===9||fe===11||fe===12)||((Q===11||Q===9)&&(fe===9||fe===10)||((Q===12||Q===10)&&fe===10||(fe===5||fe===13||(fe===7||(Q===1||Q===13&&fe===14)))))?!1:!(Q===6&&fe===6)}class He{constructor(){this._data=Ne()}static getInstance(){return He._INSTANCE||(He._INSTANCE=new He),He._INSTANCE}getGraphemeBreakType(Q){if(Q<32)return Q===10?3:Q===13?2:4;if(Q<127)return 0;const fe=this._data,be=fe.length/3;let Ee=1;for(;Ee<=be;)if(Q<fe[3*Ee])Ee=2*Ee;else if(Q>fe[3*Ee+1])Ee=2*Ee+1;else return fe[3*Ee+2];return 0}}He._INSTANCE=null;function Ne(){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 Ye(Q,fe){if(Q===0)return 0;const be=Ae(Q,fe);if(be!==void 0)return be;const Ee=w(fe,Q);return Q-=Ue(Ee),Q}function Ae(Q,fe){let be=w(fe,Q);for(Q-=Ue(be);Ve(be)||be===65039||be===8419;){if(Q===0)return;be=w(fe,Q),Q-=Ue(be)}if(!we(be))return;if(Q>=0){const Ee=w(fe,Q);Ee===8205&&(Q-=Ue(Ee))}return Q}function Ue(Q){return Q>=65536?2:1}function Ve(Q){return 127995<=Q&&Q<=127999}},SJMd:function(st,ve){/**
|
|
* @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 z,q,j,A=!1,U,O;window.PR_SHOULD_USE_CONTINUATION=!0;var M,H;(function(){var F=window,e=["break,continue,do,else,for,if,return,while"],C=[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"],f=[C,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[f,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],o=[f,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[f,"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"],r="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",h=[f,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",n=[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"],i=[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"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],_=[p,a,o,h,s,n,i,t],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,v="str",x="kwd",E="com",y="typ",c="lit",u="pun",l="pln",b="tag",m="dec",w="src",I="atn",L="atv",S="nocode",D="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(Ae){for(var Ue=0,Ve=!1,Q=!1,fe=0,be=Ae.length;fe<be;++fe){var Ee=Ae[fe];if(Ee.ignoreCase)Q=!0;else if(/[a-z]/i.test(Ee.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ve=!0,Q=!1;break}}var ke={b:8,t:9,n:10,v:11,f:12,r:13};function We(Ze){var Ge=Ze.charCodeAt(0);if(Ge!==92)return Ge;var it=Ze.charAt(1);return Ge=ke[it],Ge||("0"<=it&&it<="7"?parseInt(Ze.substring(1),8):it==="u"||it==="x"?parseInt(Ze.substring(2),16):Ze.charCodeAt(1))}function Xe(Ze){if(Ze<32)return(Ze<16?"\\x0":"\\x")+Ze.toString(16);var Ge=String.fromCharCode(Ze);return Ge==="\\"||Ge==="-"||Ge==="]"||Ge==="^"?"\\"+Ge:Ge}function ze(Ze){var Ge=Ze.substring(1,Ze.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")),it=[],nt=Ge[0]==="^",Ie=["["];nt&&Ie.push("^");for(var Me=nt?1:0,pe=Ge.length;Me<pe;++Me){var ue=Ge[Me];if(/\\[bdsw]/i.test(ue))Ie.push(ue);else{var ce=We(ue),X;Me+2<pe&&Ge[Me+1]==="-"?(X=We(Ge[Me+2]),Me+=2):X=ce,it.push([ce,X]),X<65||ce>122||(X<65||ce>90||it.push([Math.max(65,ce)|32,Math.min(X,90)|32]),X<97||ce>122||it.push([Math.max(97,ce)&~32,Math.min(X,122)&~32]))}}it.sort(function(Te,Ce){return Te[0]-Ce[0]||Ce[1]-Te[1]});for(var $=[],te=[],Me=0;Me<it.length;++Me){var oe=it[Me];oe[0]<=te[1]+1?te[1]=Math.max(te[1],oe[1]):$.push(te=oe)}for(var Me=0;Me<$.length;++Me){var oe=$[Me];Ie.push(Xe(oe[0])),oe[1]>oe[0]&&(oe[1]+1>oe[0]&&Ie.push("-"),Ie.push(Xe(oe[1])))}return Ie.push("]"),Ie.join("")}function qe(Ze){for(var Ge=Ze.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")),it=Ge.length,nt=[],Ie=0,Me=0;Ie<it;++Ie){var pe=Ge[Ie];if(pe==="(")++Me;else if(pe.charAt(0)==="\\"){var ue=+pe.substring(1);ue&&(ue<=Me?nt[ue]=-1:Ge[Ie]=Xe(ue))}}for(var Ie=1;Ie<nt.length;++Ie)nt[Ie]===-1&&(nt[Ie]=++Ue);for(var Ie=0,Me=0;Ie<it;++Ie){var pe=Ge[Ie];if(pe==="(")++Me,nt[Me]||(Ge[Ie]="(?:");else if(pe.charAt(0)==="\\"){var ue=+pe.substring(1);ue&&ue<=Me&&(Ge[Ie]="\\"+nt[ue])}}for(var Ie=0;Ie<it;++Ie)Ge[Ie]==="^"&&Ge[Ie+1]!=="^"&&(Ge[Ie]="");if(Ze.ignoreCase&&Ve)for(var Ie=0;Ie<it;++Ie){var pe=Ge[Ie],ce=pe.charAt(0);pe.length>=2&&ce==="["?Ge[Ie]=ze(pe):ce!=="\\"&&(Ge[Ie]=pe.replace(/[a-zA-Z]/g,function(te){var oe=te.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return Ge.join("")}for(var Qe=[],fe=0,be=Ae.length;fe<be;++fe){var Ee=Ae[fe];if(Ee.global||Ee.multiline)throw new Error(""+Ee);Qe.push("(?:"+qe(Ee)+")")}return new RegExp(Qe.join("|"),Q?"gi":"g")}function R(Ae,Ue){var Ve=/(?:^|\s)nocode(?:\s|$)/,Q=[],fe=0,be=[],Ee=0;function ke(We){var Xe=We.nodeType;if(Xe==1){if(Ve.test(We.className))return;for(var ze=We.firstChild;ze;ze=ze.nextSibling)ke(ze);var qe=We.nodeName.toLowerCase();(qe==="br"||qe==="li")&&(Q[Ee]=`
|
|
`,be[Ee<<1]=fe++,be[Ee++<<1|1]=We)}else if(Xe==3||Xe==4){var Qe=We.nodeValue;Qe.length&&(Ue?Qe=Qe.replace(/\r\n?/g,`
|
|
`):Qe=Qe.replace(/[ \t\r\n]+/g," "),Q[Ee]=Qe,be[Ee<<1]=fe,fe+=Qe.length,be[Ee++<<1|1]=We)}}return ke(Ae),{sourceCode:Q.join("").replace(/\n$/,""),spans:be}}function W(Ae,Ue,Ve,Q,fe){if(!Ve)return;var be={sourceNode:Ae,pre:1,langExtension:null,numberLines:null,sourceCode:Ve,spans:null,basePos:Ue,decorations:null};Q(be),fe.push.apply(fe,be.decorations)}var Y=/\S/;function se(Ae){for(var Ue=void 0,Ve=Ae.firstChild;Ve;Ve=Ve.nextSibling){var Q=Ve.nodeType;Ue=Q===1?Ue?Ae:Ve:Q===3&&Y.test(Ve.nodeValue)?Ae:Ue}return Ue===Ae?void 0:Ue}function ne(Ae,Ue){var Ve={},Q;(function(){for(var Ee=Ae.concat(Ue),ke=[],We={},Xe=0,ze=Ee.length;Xe<ze;++Xe){var qe=Ee[Xe],Qe=qe[3];if(Qe)for(var Ze=Qe.length;--Ze>=0;)Ve[Qe.charAt(Ze)]=qe;var Ge=qe[1],it=""+Ge;We.hasOwnProperty(it)||(ke.push(Ge),We[it]=null)}ke.push(/[\0-\uffff]/),Q=B(ke)})();var fe=Ue.length,be=function(Ee){for(var ke=Ee.sourceCode,We=Ee.basePos,Xe=Ee.sourceNode,ze=[We,l],qe=0,Qe=ke.match(Q)||[],Ze={},Ge=0,it=Qe.length;Ge<it;++Ge){var nt=Qe[Ge],Ie=Ze[nt],Me=void 0,pe;if(typeof Ie=="string")pe=!1;else{var ue=Ve[nt.charAt(0)];if(ue)Me=nt.match(ue[1]),Ie=ue[0];else{for(var ce=0;ce<fe;++ce)if(ue=Ue[ce],Me=nt.match(ue[1]),Me){Ie=ue[0];break}Me||(Ie=l)}pe=Ie.length>=5&&Ie.substring(0,5)==="lang-",pe&&!(Me&&typeof Me[1]=="string")&&(pe=!1,Ie=w),pe||(Ze[nt]=Ie)}var X=qe;if(qe+=nt.length,!pe)ze.push(We+X,Ie);else{var $=Me[1],te=nt.indexOf($),oe=te+$.length;Me[2]&&(oe=nt.length-Me[2].length,te=oe-$.length);var Te=Ie.substring(5);W(Xe,We+X,nt.substring(0,te),be,ze),W(Xe,We+X+te,$,ee(Te,$),ze),W(Xe,We+X+oe,nt.substring(oe),be,ze)}}Ee.decorations=ze};return be}function Se(Ae){var Ue=[],Ve=[];Ae.tripleQuotedStrings?Ue.push([v,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ae.multiLineStrings?Ue.push([v,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ue.push([v,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ae.verbatimStrings&&Ve.push([v,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Q=Ae.hashComments;Q&&(Ae.cStyleComments?(Q>1?Ue.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ue.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ve.push([v,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ue.push([E,/^#[^\r\n]*/,null,"#"])),Ae.cStyleComments&&(Ve.push([E,/^\/\/[^\r\n]*/,null]),Ve.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var fe=Ae.regexLiterals;if(fe){var be=fe>1?"":`
|
|
\r`,Ee=be?".":"[\\S\\s]",ke="/(?=[^/*"+be+"])(?:[^/\\x5B\\x5C"+be+"]|\\x5C"+Ee+"|\\x5B(?:[^\\x5C\\x5D"+be+"]|\\x5C"+Ee+")*(?:\\x5D|$))+/";Ve.push(["lang-regex",RegExp("^"+D+"("+ke+")")])}var We=Ae.types;We&&Ve.push([y,We]);var Xe=(""+Ae.keywords).replace(/^ | $/g,"");Xe.length&&Ve.push([x,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),Ue.push([l,/^\s+/,null,` \r
|
|
\xA0`]);var ze="^.[^\\s\\w.$@'\"`/\\\\]*";return Ae.regexLiterals&&(ze+="(?!s*/)"),Ve.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[u,new RegExp(ze),null]),ne(Ue,Ve)}var xe=Se({keywords:_,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function we(Ae,Ue,Ve){for(var Q=/(?:^|\s)nocode(?:\s|$)/,fe=/\r\n?|\n/,be=Ae.ownerDocument,Ee=be.createElement("li");Ae.firstChild;)Ee.appendChild(Ae.firstChild);var ke=[Ee];function We(Ge){var it=Ge.nodeType;if(it==1&&!Q.test(Ge.className))if(Ge.nodeName==="br")Xe(Ge),Ge.parentNode&&Ge.parentNode.removeChild(Ge);else for(var nt=Ge.firstChild;nt;nt=nt.nextSibling)We(nt);else if((it==3||it==4)&&Ve){var Ie=Ge.nodeValue,Me=Ie.match(fe);if(Me){var pe=Ie.substring(0,Me.index);Ge.nodeValue=pe;var ue=Ie.substring(Me.index+Me[0].length);if(ue){var ce=Ge.parentNode;ce.insertBefore(be.createTextNode(ue),Ge.nextSibling)}Xe(Ge),pe||Ge.parentNode.removeChild(Ge)}}}function Xe(Ge){for(;!Ge.nextSibling;)if(Ge=Ge.parentNode,!Ge)return;function it(Me,pe){var ue=pe?Me.cloneNode(!1):Me,ce=Me.parentNode;if(ce){var X=it(ce,1),$=Me.nextSibling;X.appendChild(ue);for(var te=$;te;te=$)$=te.nextSibling,X.appendChild(te)}return ue}for(var nt=it(Ge.nextSibling,0),Ie;(Ie=nt.parentNode)&&Ie.nodeType===1;)nt=Ie;ke.push(nt)}for(var ze=0;ze<ke.length;++ze)We(ke[ze]);Ue===(Ue|0)&&ke[0].setAttribute("value",Ue);var qe=be.createElement("ol");qe.className="linenums";for(var Qe=Math.max(0,Ue-1|0)||0,ze=0,Ze=ke.length;ze<Ze;++ze)Ee=ke[ze],Ee.className="L"+(ze+Qe)%10,Ee.firstChild||Ee.appendChild(be.createTextNode("\xA0")),qe.appendChild(Ee);Ae.appendChild(qe)}function Re(Ae){var Ue=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ue=Ue&&+Ue[1]<=8;var Ve=/\n/g,Q=Ae.sourceCode,fe=Q.length,be=0,Ee=Ae.spans,ke=Ee.length,We=0,Xe=Ae.decorations,ze=Xe.length,qe=0;Xe[ze]=fe;var Qe,Ze;for(Ze=Qe=0;Ze<ze;)Xe[Ze]!==Xe[Ze+2]?(Xe[Qe++]=Xe[Ze++],Xe[Qe++]=Xe[Ze++]):Ze+=2;for(ze=Qe,Ze=Qe=0;Ze<ze;){for(var Ge=Xe[Ze],it=Xe[Ze+1],nt=Ze+2;nt+2<=ze&&Xe[nt+1]===it;)nt+=2;Xe[Qe++]=Ge,Xe[Qe++]=it,Ze=nt}ze=Xe.length=Qe;var Ie=Ae.sourceNode,Me="";Ie&&(Me=Ie.style.display,Ie.style.display="none");try{for(var pe=null;We<ke;){var ue=Ee[We],ce=Ee[We+2]||fe,X=Xe[qe+2]||fe,nt=Math.min(ce,X),$=Ee[We+1],te;if($.nodeType!==1&&(te=Q.substring(be,nt))){Ue&&(te=te.replace(Ve,"\r")),$.nodeValue=te;var oe=$.ownerDocument,Te=oe.createElement("span");Te.className=Xe[qe+1];var Ce=$.parentNode;Ce.replaceChild(Te,$),Te.appendChild($),be<ce&&(Ee[We+1]=$=oe.createTextNode(Q.substring(nt,ce)),Ce.insertBefore($,Te.nextSibling))}be=nt,be>=ce&&(We+=2),be>=X&&(qe+=2)}}finally{Ie&&(Ie.style.display=Me)}}var Pe={};function ye(Ae,Ue){for(var Ve=Ue.length;--Ve>=0;){var Q=Ue[Ve];Pe.hasOwnProperty(Q)?F.console&&console.warn("cannot override language handler %s",Q):Pe[Q]=Ae}}function ee(Ae,Ue){return Ae&&Pe.hasOwnProperty(Ae)||(Ae=/^\s*</.test(Ue)?"default-markup":"default-code"),Pe[Ae]}ye(xe,["default-code"]),ye(ne([],[[l,/^[^<?]+/],[m,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["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"]),ye(ne([[l,/^[\s]+/,null,` \r
|
|
`],[L,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["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"]),ye(ne([],[[L,/^[\s\S]+/]]),["uq.val"]),ye(Se({keywords:p,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),ye(Se({keywords:"null,true,false"}),["json"]),ye(Se({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),ye(Se({keywords:o,cStyleComments:!0}),["java"]),ye(Se({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(Se({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(Se({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(Se({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(Se({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(Se({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(ne([],[[v,/^[\s\S]+/]]),["regex"]);function je(Ae){var Ue=Ae.langExtension;try{var Ve=R(Ae.sourceNode,Ae.pre),Q=Ve.sourceCode;Ae.sourceCode=Q,Ae.spans=Ve.spans,Ae.basePos=0,ee(Ue,Q)(Ae),Re(Ae)}catch(fe){F.console&&console.log(fe&&fe.stack||fe)}}function et(Ae,Ue,Ve){var Q=Ve||!1,fe=Ue||null,be=document.createElement("div");be.innerHTML="<pre>"+Ae+"</pre>",be=be.firstChild,Q&&we(be,Q,!0);var Ee={langExtension:fe,numberLines:Q,sourceNode:be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return je(Ee),be.innerHTML}function He(Ae,Ue){var Ve=Ue||document.body,Q=Ve.ownerDocument||document;function fe(ue){return Ve.getElementsByTagName(ue)}for(var be=[fe("pre"),fe("code"),fe("xmp")],Ee=[],ke=0;ke<be.length;++ke)for(var We=0,Xe=be[ke].length;We<Xe;++We)Ee.push(be[ke][We]);be=null;var ze=Date;ze.now||(ze={now:function(){return+new Date}});var qe=0,Qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ze=/\bprettyprint\b/,Ge=/\bprettyprinted\b/,it=/pre|xmp/i,nt=/^code$/i,Ie=/^(?:pre|code|xmp)$/i,Me={};function pe(){for(var ue=F.PR_SHOULD_USE_CONTINUATION?ze.now()+250:Infinity;qe<Ee.length&&ze.now()<ue;qe++){for(var ce=Ee[qe],X=Me,$=ce;$=$.previousSibling;){var te=$.nodeType,oe=(te===7||te===8)&&$.nodeValue;if(oe?!/^\??prettify\b/.test(oe):te!==3||/\S/.test($.nodeValue))break;if(oe){X={},oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(qt,bt,ii){X[bt]=ii});break}}var Te=ce.className;if((X!==Me||Ze.test(Te))&&!Ge.test(Te)){for(var Ce=!1,Ke=ce.parentNode;Ke;Ke=Ke.parentNode){var lt=Ke.tagName;if(Ie.test(lt)&&Ke.className&&Ze.test(Ke.className)){Ce=!0;break}}if(!Ce){ce.className+=" prettyprinted";var gt=X.lang;if(!gt){gt=Te.match(Qe);var ut;!gt&&(ut=se(ce))&&nt.test(ut.tagName)&&(gt=ut.className.match(Qe)),gt&&(gt=gt[1])}var yt;if(it.test(ce.tagName))yt=1;else{var wt=ce.currentStyle,rt=Q.defaultView,Vt=wt?wt.whiteSpace:rt&&rt.getComputedStyle?rt.getComputedStyle(ce,null).getPropertyValue("white-space"):0;yt=Vt&&Vt.substring(0,3)==="pre"}var Pt=X.linenums;(Pt=Pt==="true"||+Pt)||(Pt=Te.match(/\blinenums\b(?::(\d+))?/),Pt=Pt?Pt[1]&&Pt[1].length?+Pt[1]:!0:!1),Pt&&we(ce,Pt,yt);var Zt={langExtension:gt,sourceNode:ce,numberLines:Pt,pre:yt,sourceCode:null,basePos:null,spans:null,decorations:null};je(Zt)}}}qe<Ee.length?F.setTimeout(pe,250):typeof Ae=="function"&&Ae()}pe()}var Ne=F.PR={createSimpleLexer:ne,registerLangHandler:ye,sourceDecorator:Se,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:L,PR_COMMENT:E,PR_DECLARATION:m,PR_KEYWORD:x,PR_LITERAL:c,PR_NOCODE:S,PR_PLAIN:l,PR_PUNCTUATION:u,PR_SOURCE:w,PR_STRING:v,PR_TAG:b,PR_TYPE:y,prettyPrintOne:A?F.prettyPrintOne=et:M=et,prettyPrint:H=A?F.prettyPrint=He:H=He},Ye=F.define;typeof Ye=="function"&&Ye.amd&&Ye("google-code-prettify",[],function(){return Ne})})()},T8No:function(st,ve,z){"use strict";z.d(ve,"a",function(){return H}),z.d(ve,"e",function(){return F}),z.d(ve,"c",function(){return u}),z.d(ve,"b",function(){return l}),z.d(ve,"d",function(){return b}),z.d(ve,"f",function(){return I});var q=z("MNsG"),j=z("N0LK"),A=z("Cg/j");let U=q.k||"";const O=new Map;O.set("false",!1),O.set("true",!0),O.set("isMac",q.f),O.set("isLinux",q.d),O.set("isWindows",q.i),O.set("isWeb",q.h),O.set("isMacNative",q.f&&!q.h),O.set("isEdge",U.indexOf("Edg/")>=0),O.set("isFirefox",U.indexOf("Firefox")>=0),O.set("isChrome",U.indexOf("Chrome")>=0),O.set("isSafari",U.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class H{static has(S){return p.create(S)}static equals(S,D){return o.create(S,D)}static regex(S,D){return v.create(S,D)}static not(S){return s.create(S)}static and(...S){return y.create(S,null)}static or(...S){return c.create(S,null,!0)}static deserialize(S,D=!1){return S?this._deserializeOrExpression(S,D):void 0}static _deserializeOrExpression(S,D){let B=S.split("||");return c.create(B.map(R=>this._deserializeAndExpression(R,D)),null,!0)}static _deserializeAndExpression(S,D){let B=S.split("&&");return y.create(B.map(R=>this._deserializeOne(R,D)),null)}static _deserializeOne(S,D){if(S=S.trim(),S.indexOf("!=")>=0){let B=S.split("!=");return h.create(B[0].trim(),this._deserializeValue(B[1],D))}if(S.indexOf("==")>=0){let B=S.split("==");return o.create(B[0].trim(),this._deserializeValue(B[1],D))}if(S.indexOf("=~")>=0){let B=S.split("=~");return v.create(B[0].trim(),this._deserializeRegexValue(B[1],D))}if(S.indexOf(" in ")>=0){let B=S.split(" in ");return a.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const B=S.split(">=");return t.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const B=S.split(">");return i.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const B=S.split("<=");return g.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const B=S.split("<");return _.create(B[0].trim(),B[1].trim())}return/^\!\s*/.test(S)?s.create(S.substr(1).trim()):p.create(S)}static _deserializeValue(S,D){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let B=/^'([^']*)'$/.exec(S);return B?B[1].trim():S}static _deserializeRegexValue(S,D){if(Object(j.C)(S)){if(D)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let B=S.indexOf("/"),R=S.lastIndexOf("/");if(B===R||B<0){if(D)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let W=S.slice(B+1,R),Y=S[R+1]==="i"?"i":"";try{return new RegExp(W,Y)}catch(se){if(D)throw new Error(`bad regexp-value '${S}', parse error: ${se}`);return console.warn(`bad regexp-value '${S}', parse error: ${se}`),null}}}function F(S,D){const B=S?S.substituteConstants():void 0,R=D?D.substituteConstants():void 0;return!B&&!R?!0:!B||!R?!1:B.equals(R)}function e(S,D){return S.cmp(D)}class C{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return f.INSTANCE}}C.INSTANCE=new C;class f{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return C.INSTANCE}}f.INSTANCE=new f;class p{constructor(S,D){this.key=S,this.negated=D,this.type=2}static create(S,D=null){const B=O.get(S);return typeof B=="boolean"?B?f.INSTANCE:C.INSTANCE:new p(S,D)}cmp(S){return S.type!==this.type?this.type-S.type:m(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=O.get(this.key);return typeof S=="boolean"?S?f.INSTANCE:C.INSTANCE:this}evaluate(S){return!!S.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class o{constructor(S,D,B){this.key=S,this.value=D,this.negated=B,this.type=4}static create(S,D,B=null){if(typeof D=="boolean")return D?p.create(S,B):s.create(S,B);const R=O.get(S);if(typeof R=="boolean"){const W=R?"true":"false";return D===W?f.INSTANCE:C.INSTANCE}return new o(S,D,B)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=O.get(this.key);if(typeof S=="boolean"){const D=S?"true":"false";return this.value===D?f.INSTANCE:C.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class a{constructor(S,D){this.key=S,this.valueKey=D,this.type=10,this.negated=null}static create(S,D){return new a(S,D)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const D=S.getValue(this.valueKey),B=S.getValue(this.key);return Array.isArray(D)?D.indexOf(B)>=0:typeof B=="string"&&typeof D=="object"&&D!==null?M.call(D,B):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=r.create(this)),this.negated}}class r{constructor(S){this._actual=S,this.type=11}static create(S){return new r(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class h{constructor(S,D,B){this.key=S,this.value=D,this.negated=B,this.type=5}static create(S,D,B=null){if(typeof D=="boolean")return D?s.create(S,B):p.create(S,B);const R=O.get(S);if(typeof R=="boolean"){const W=R?"true":"false";return D===W?C.INSTANCE:f.INSTANCE}return new h(S,D,B)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=O.get(this.key);if(typeof S=="boolean"){const D=S?"true":"false";return this.value===D?C.INSTANCE:f.INSTANCE}return this}evaluate(S){return S.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 s{constructor(S,D){this.key=S,this.negated=D,this.type=3}static create(S,D=null){const B=O.get(S);return typeof B=="boolean"?B?C.INSTANCE:f.INSTANCE:new s(S,D)}cmp(S){return S.type!==this.type?this.type-S.type:m(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=O.get(this.key);return typeof S=="boolean"?S?C.INSTANCE:f.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function n(S,D){if(typeof S=="string"){const B=parseFloat(S);isNaN(B)||(S=B)}return typeof S=="string"||typeof S=="number"?D(S):C.INSTANCE}class i{constructor(S,D,B){this.key=S,this.value=D,this.negated=B,this.type=12}static create(S,D,B=null){return n(D,R=>new i(S,R,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.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 t{constructor(S,D,B){this.key=S,this.value=D,this.negated=B,this.type=13}static create(S,D,B=null){return n(D,R=>new t(S,R,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class _{constructor(S,D,B){this.key=S,this.value=D,this.negated=B,this.type=14}static create(S,D,B=null){return n(D,R=>new _(S,R,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class g{constructor(S,D,B){this.key=S,this.value=D,this.negated=B,this.type=15}static create(S,D,B=null){return n(D,R=>new g(S,R,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class v{constructor(S,D){this.key=S,this.regexp=D,this.type=7,this.negated=null}static create(S,D){return new v(S,D)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const D=this.regexp?this.regexp.source:"",B=S.regexp?S.regexp.source:"";return D<B?-1:D>B?1:0}equals(S){if(S.type===this.type){const D=this.regexp?this.regexp.source:"",B=S.regexp?S.regexp.source:"";return this.key===S.key&&D===B}return!1}substituteConstants(){return this}evaluate(S){let D=S.getValue(this.key);return this.regexp?this.regexp.test(D):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this)),this.negated}}class x{constructor(S){this._actual=S,this.type=8}static create(S){return new x(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function E(S){let D=null;for(let B=0,R=S.length;B<R;B++){const W=S[B].substituteConstants();if(S[B]!==W&&D===null){D=[];for(let Y=0;Y<B;Y++)D[Y]=S[Y]}D!==null&&(D[B]=W)}return D===null?S:D}class y{constructor(S,D){this.expr=S,this.negated=D,this.type=6}static create(S,D){return y._normalizeArr(S,D)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let D=0,B=this.expr.length;D<B;D++){const R=e(this.expr[D],S.expr[D]);if(R!==0)return R}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let D=0,B=this.expr.length;D<B;D++)if(!this.expr[D].equals(S.expr[D]))return!1;return!0}return!1}substituteConstants(){const S=E(this.expr);return S===this.expr?this:y.create(S,this.negated)}evaluate(S){for(let D=0,B=this.expr.length;D<B;D++)if(!this.expr[D].evaluate(S))return!1;return!0}static _normalizeArr(S,D){const B=[];let R=!1;for(const W of S){if(!W)continue;if(W.type===1){R=!0;continue}if(W.type===0)return C.INSTANCE;if(W.type===6){B.push(...W.expr);continue}B.push(W)}if(B.length===0&&R)return f.INSTANCE;if(B.length===0)return;if(B.length===1)return B[0];B.sort(e);for(let W=1;W<B.length;W++)B[W-1].equals(B[W])&&(B.splice(W,1),W--);if(B.length===1)return B[0];for(;B.length>1;){const W=B[B.length-1];if(W.type!==9)break;B.pop();const Y=B.pop(),se=B.length===0,ne=c.create(W.expr.map(Se=>y.create([Se,Y],null)),null,se);ne&&(B.push(ne),B.sort(e))}return B.length===1?B[0]:new y(B,D)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let D of this.expr)S.push(...D.keys());return S}negate(){if(!this.negated){const S=[];for(let D of this.expr)S.push(D.negate());this.negated=c.create(S,this,!0)}return this.negated}}class c{constructor(S,D){this.expr=S,this.negated=D,this.type=9}static create(S,D,B){return c._normalizeArr(S,D,B)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let D=0,B=this.expr.length;D<B;D++){const R=e(this.expr[D],S.expr[D]);if(R!==0)return R}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let D=0,B=this.expr.length;D<B;D++)if(!this.expr[D].equals(S.expr[D]))return!1;return!0}return!1}substituteConstants(){const S=E(this.expr);return S===this.expr?this:c.create(S,this.negated,!1)}evaluate(S){for(let D=0,B=this.expr.length;D<B;D++)if(this.expr[D].evaluate(S))return!0;return!1}static _normalizeArr(S,D,B){let R=[],W=!1;if(S){for(let Y=0,se=S.length;Y<se;Y++){const ne=S[Y];if(!ne)continue;if(ne.type===0){W=!0;continue}if(ne.type===1)return f.INSTANCE;if(ne.type===9){R=R.concat(ne.expr);continue}R.push(ne)}if(R.length===0&&W)return C.INSTANCE;R.sort(e)}if(R.length===0)return;if(R.length===1)return R[0];for(let Y=1;Y<R.length;Y++)R[Y-1].equals(R[Y])&&(R.splice(Y,1),Y--);if(R.length===1)return R[0];if(B){for(let Y=0;Y<R.length;Y++)for(let se=Y+1;se<R.length;se++)I(R[Y],R[se])&&(R.splice(se,1),se--);if(R.length===1)return R[0]}return new c(R,D)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let D of this.expr)S.push(...D.keys());return S}negate(){if(!this.negated){let S=[];for(let D of this.expr)S.push(D.negate());for(;S.length>1;){const D=S.shift(),B=S.shift(),R=[];for(const Y of L(D))for(const se of L(B))R.push(y.create([Y,se],null));const W=S.length===0;S.unshift(c.create(R,null,W))}this.negated=S[0]}return this.negated}}class u extends p{constructor(S,D,B){super(S,null);this._defaultValue=D,typeof B=="object"?u._info.push(Object.assign(Object.assign({},B),{key:S})):B!==!0&&u._info.push({key:S,description:B,type:D!=null?typeof D:void 0})}static all(){return u._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return o.create(this.key,S)}}u._info=[];const l=Object(A.c)("contextKeyService"),b="setContext";function m(S,D){return S<D?-1:S>D?1:0}function w(S,D,B,R){return S<B?-1:S>B?1:D<R?-1:D>R?1:0}function I(S,D){if(D.type===6&&S.type!==9&&S.type!==6){for(const W of D.expr)if(S.equals(W))return!0}const B=S.negate(),R=L(B).concat(L(D));R.sort(e);for(let W=0;W<R.length;W++){const Y=R[W],se=Y.negate();for(let ne=W+1;ne<R.length;ne++){const Se=R[ne];if(se.equals(Se))return!0}}return!1}function L(S){return S.type===9?S.expr:[S]}},TXwP:function(st,ve,z){var q,j;(function(){var A;(function(){"use strict";var O=[,,function(e){function C(o){this.__parent=o,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=[]}C.prototype.clone_empty=function(){var o=new C(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},C.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},C.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},C.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},C.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)},C.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},C.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},C.prototype.is_empty=function(){return this.__items.length===0},C.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},C.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},C.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},C.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},C.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},C.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},C.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function f(o,a){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}f.prototype.get_indent_size=function(o,a){var r=this.__base_string_length;return a=a||0,o<0&&(r=0),r+=o*this.__indent_size,r+=a,r},f.prototype.get_indent_string=function(o,a){var r=this.__base_string;return a=a||0,o<0&&(o=0,r=""),a+=o*this.__indent_size,this.__ensure_cache(a),r+=this.__cache[a],r},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,a=0,r="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,r=new Array(a+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function p(o,a){this.__indent_cache=new f(o,a),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new C(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},p.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(r=r.replace(/[\n]/g,o)),r},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(o,a){for(var r=this.__lines.length-2;r>=0;){var h=this.__lines[r];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==a){this.__lines.splice(r+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=p},,,,function(e){function C(o,a){this.raw_options=f(o,a),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"])}C.prototype._get_array=function(o,a){var r=this.raw_options[o],h=a||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(h=r.concat()):typeof r=="string"&&(h=r.split(/[^a-zA-Z0-9_\/\-]+/)),h},C.prototype._get_boolean=function(o,a){var r=this.raw_options[o],h=r===void 0?!!a:!!r;return h},C.prototype._get_characters=function(o,a){var r=this.raw_options[o],h=a||"";return typeof r=="string"&&(h=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},C.prototype._get_number=function(o,a){var r=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var h=parseInt(r,10);return isNaN(h)&&(h=a),h},C.prototype._get_selection=function(o,a,r){var h=this._get_selection_list(o,a,r);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},C.prototype._get_selection_list=function(o,a,r){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[a[0]],!this._is_valid_selection(r,a))throw new Error("Invalid Default Value!");var h=this._get_array(o,r);if(!this._is_valid_selection(h,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},C.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(r){return a.indexOf(r)===-1})};function f(o,a){var r={};o=p(o);var h;for(h in o)h!==a&&(r[h]=o[h]);if(a&&o[a])for(h in o[a])r[h]=o[a][h];return r}function p(o){var a={},r;for(r in o){var h=r.replace(/-/g,"_");a[h]=o[r]}return a}e.exports.Options=C,e.exports.normalizeOpts=p,e.exports.mergeOpts=f},,function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function f(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},f.prototype.peek=function(p){var o=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(o=this.__input.charAt(p)),o},f.prototype.__match=function(p,o){p.lastIndex=o;var a=p.exec(this.__input);return a&&!(C&&p.sticky)&&(a.index!==o&&(a=null)),a},f.prototype.test=function(p,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(p,o):!1},f.prototype.testChar=function(p,o){var a=this.peek(o);return p.lastIndex=0,a!==null&&p.test(a)},f.prototype.match=function(p){var o=this.__match(p,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(p,o,a){var r="",h;return p&&(h=this.match(p),h&&(r+=h[0])),o&&(h||!p)&&(r+=this.readUntil(o,a)),r},f.prototype.readUntil=function(p,o){var a="",r=this.__position;p.lastIndex=this.__position;var h=p.exec(this.__input);return h?(r=h.index,o&&(r+=h[0].length)):r=this.__input_length,a=this.__input.substring(this.__position,r),this.__position=r,a},f.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},f.prototype.get_regexp=function(p,o){var a=null,r="g";return o&&C&&(r="y"),typeof p=="string"&&p!==""?a=new RegExp(p,r):p&&(a=new RegExp(p.source,r)),a},f.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(p){var o=this.__position,a=this.readUntilAfter(p);return this.__position=o,a},f.prototype.lookBack=function(p){var o=this.__position-1;return o>=p.length&&this.__input.substring(o-p.length,o).toLowerCase()===p},e.exports.InputScanner=f},,,,,function(e){function C(f,p){f=typeof f=="string"?f:f.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+p,"g")}C.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)p[o[1]]=o[2],o=this.__directive_pattern.exec(f);return p},C.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},,function(e,C,f){var p=f(16).Beautifier,o=f(17).Options;function a(r,h){var s=new p(r,h);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new o}},function(e,C,f){var p=f(17).Options,o=f(2).Output,a=f(8).InputScanner,r=f(13).Directives,h=new r(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,i=/\s/,t=/(?:\s|\n)+/g,_=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,g=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function v(x,E){this._source_text=x||"",this._options=new p(E),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"]}v.prototype.eatString=function(x){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(x.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return E},v.prototype.eatWhitespace=function(x){for(var E=i.test(this._input.peek()),y=0;i.test(this._input.peek());)this._ch=this._input.next(),x&&this._ch===`
|
|
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return E},v.prototype.foundNestedPseudoClass=function(){for(var x=0,E=1,y=this._input.peek(E);y;){if(y==="{")return!0;if(y==="(")x+=1;else if(y===")"){if(x===0)return!1;x-=1}else if(y===";"||y==="}")return!1;E++,y=this._input.peek(E)}return!1},v.prototype.print_string=function(x){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(x)},v.prototype.preserveSingleSpace=function(x){x&&(this._output.space_before_token=!0)},v.prototype.indent=function(){this._indentLevel++},v.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,E=this._options.eol;E==="auto"&&(E=`
|
|
`,x&&s.test(x||"")&&(E=x.match(s)[0])),x=x.replace(n,`
|
|
`);var y=x.match(/^[\t ]*/)[0];this._output=new o(this._options,y),this._input=new a(x),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var c=0,u=!1,l=!1,b=!1,m=!1,w=!1,I=!1,L=this._ch,S=!1,D,B,R;D=this._input.read(t),B=D!=="",R=L,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),L=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(_),Y=h.get_directives(W);Y&&Y.ignore==="start"&&(W+=h.readIgnored(this._input)),this.print_string(W),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(g)),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 se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?m=!0:se==="import"&&(w=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(b=!0)):!u&&c===0&&se.indexOf(":")!==-1&&(l=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")l&&(l=!1,this.outdent()),b?(b=!1,u=this._indentLevel>=this._nestedLevel):u=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&u&&(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)):(R==="("?this._output.space_before_token=!1:R!==","&&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(),R==="{"&&this._output.trim(!0),w=!1,m=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),u=!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 ne=0;ne<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ne++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ne])){S=!0;break}(u||b)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!m&&c===0?(this.print_string(":"),l||(l=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Se=R==='"'||R==="'";this.preserveSingleSpace(Se||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,c===0?(l&&(this.outdent(),l=!1),m=!1,w=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),c++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),c&&(c--,this.outdent()));else{var xe=!1;this._input.lookBack("with")&&(xe=!0),this.preserveSingleSpace(B||xe),this.print_string(this._ch),l&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),I=!0):(this.eatWhitespace(),c++,this.indent())}else if(this._ch===")")c&&(c--,this.outdent()),I&&this._input.peek()===";"&&this._options.selector_separator_newline&&(I=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!l||I)&&c===0&&!w&&!m?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!l&&c===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.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("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var we=R==='"'||R==="'";this.preserveSingleSpace(we||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&S&&this._output.add_new_line()}var Re=this._output.get_code(E);return Re},e.exports.Beautifier=v},function(e,C,f){var p=f(6).Options;function o(a){p.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<h.length;s++)h[s]!=="expand"?this.brace_style="collapse":this.brace_style=h[s]}o.prototype=new p,e.exports.Options=o}],M={};function H(e){var C=M[e];if(C!==void 0)return C.exports;var f=M[e]={exports:{}};return O[e](f,f.exports,H),f.exports}var F=H(15);A=F})();var U=A;!(q=[],j=function(){return{css_beautify:U}}.apply(ve,q),j!==void 0&&(st.exports=j))})()},Vhoy:function(st,ve,z){"use strict";z.d(ve,"d",function(){return U}),z.d(ve,"e",function(){return O}),z.d(ve,"c",function(){return M}),z.d(ve,"b",function(){return H}),z.d(ve,"a",function(){return F});var q=z("MI8n");class j{constructor(){this._icons=new Map,this._onDidRegister=new q.b}add(e){const C=this._icons.get(e.id);C?e.description?C.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 A=new j,U=A;function O(e,C){return new H(e,C)}function M(e){return e?e.replace(/\$\((.*?)\)/g,(C,f)=>` ${f} `).trim():""}class H{constructor(e,C,f){this.id=e,this.definition=C,this.description=f,A.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var F;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const C=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function f(a){if(a instanceof H)return["codicon","codicon-"+a.id];const r=C.exec(a.id);if(!r)return f(H.error);let[,h,s]=r;const n=["codicon","codicon-"+h];return s&&n.push("codicon-modifier-"+s.substr(1)),n}e.asClassNameArray=f;function p(a){return f(a).join(" ")}e.asClassName=p;function o(a){return"."+f(a).join(".")}e.asCSSSelector=o})(F||(F={})),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"})}(H||(H={}))},ZW9T:function(st,ve,z){"use strict";z.d(ve,"a",function(){return B});var q=z("k1fw"),j=z("oBTY"),A=z("miYZ"),U=z("tsqr"),O=z("rAM+"),M=z("tJVT"),H=z("PpiC"),F=z("q1tI"),e=z.n(F),C=z("bdgK"),f=z("9og8"),p=z("WmNS"),o=z.n(p),a={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"]},r={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"]},h={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(`
|
|
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},n=z("5VLF"),i=z.n(n),t={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"]}},_=function(W,Y){return Y.map(function(se){return{label:se,kind:W.languages.CompletionItemKind.Keyword,insertText:se}})},g=function(W){return Object.keys(t.tables).map(function(Y){return{label:Y,kind:W.languages.CompletionItemKind.Variable,insertText:Y}})},v=function(W,Y){var se=t.tables[W];return se?se.map(function(ne){return{label:ne,kind:Y.languages.CompletionItemKind.Field,insertText:ne}}):[]};function x(R,W,Y,se,ne){var Se=W.getWordUntilPosition(Y),xe={startLineNumber:Y.lineNumber,endLineNumber:Y.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},we=se.map(function(Re){return{label:Re,kind:R.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return ne.map(function(Re){we.push(Object(q.a)(Object(q.a)({},Re),{},{range:xe}))}),we}var E=function(R){t.languages.map(function(ne){return R.languages.registerDocumentFormattingEditProvider(ne,{provideDocumentFormattingEdits:function(xe,we,Re){return Object(f.a)(o.a.mark(function Pe(){var ye;return o.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return ye=i()(xe.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}),je.abrupt("return",[{range:xe.getFullModelRange(),text:ye}]);case 2:case"end":return je.stop()}},Pe)}))()}}),ne});var W=h.quickKey.map(function(ne){return{label:ne.label,kind:R.languages.CompletionItemKind.Method,insertText:ne.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Y=s.quickKey.map(function(ne){return{label:ne.label,kind:R.languages.CompletionItemKind.Method,insertText:ne.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),se=r.quickKey.map(function(ne){return{label:ne.label,kind:R.languages.CompletionItemKind.Method,insertText:ne.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}});R.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Se,xe){var we=Se.getWordUntilPosition(xe),Re={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},Pe=Se.getLineContent(xe.lineNumber).substring(we.startColumn-2,we.endColumn);return{suggestions:[].concat(Object(j.a)(h.keywords.map(function(ye){return{label:ye,kind:R.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(j.a)(h.quickKey.map(function(ye){return{label:ye.label,kind:R.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Pe.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Se,xe){var we=Se.getWordUntilPosition(xe),Re={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn};return{suggestions:Object(j.a)(a.keywords.map(function(Pe){return{label:Pe,kind:R.languages.CompletionItemKind.Function,documentation:Pe,insertText:Pe,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}}))}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Se,xe){var we=Se.getWordUntilPosition(xe),Re={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},Pe=Se.getLineContent(xe.lineNumber).substring(we.startColumn-2,we.endColumn);return{suggestions:[].concat(Object(j.a)(r.keywords.map(function(ye){return{label:ye,kind:R.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(j.a)(r.quickKey.map(function(ye){return{label:ye.label,kind:R.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Pe.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Se,xe){var we=Se.getWordUntilPosition(xe),Re={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},Pe=Se.getLineContent(xe.lineNumber).substring(we.startColumn-2,we.endColumn);return{suggestions:[].concat(Object(j.a)(s.keywords.map(function(ye){return{label:ye,kind:R.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(j.a)(s.quickKey.map(function(ye){return{label:ye.label,kind:R.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Pe.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",c=z("fjLI"),u=z("LvDl"),l=z("+ua5");function b(R){return/^\d+$/.test(R)?"".concat(R,"px"):R}function m(){}var w=!1,I={"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 L(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=R;if(Array.isArray(R)){for(var Y=0;Y<R.length;Y++){var se=I[R[Y]];if(se)return se}return W[0]}return I[W]||W}var S=null,D=ve.b=function(R){var W=R.width,Y=W===void 0?"100%":W,se=R.height,ne=se===void 0?"100%":se,Se=R.value,xe=R.language,we=xe===void 0?"javascript":xe,Re=R.style,Pe=Re===void 0?{}:Re,ye=R.options,ee=ye===void 0?{}:ye,je=R.overrideServices,et=je===void 0?{}:je,He=R.theme,Ne=He===void 0?"vs-dark":He,Ye=R.onEditBlur,Ae=R.onSave,Ue=R.autoHeight,Ve=Ue===void 0?!1:Ue,Q=R.forbidCopy,fe=Q===void 0?!1:Q,be=R.onChange,Ee=be===void 0?m:be,ke=R.editorDidMount,We=ke===void 0?m:ke,Xe=R.onFocus,ze=Xe===void 0?m:Xe,qe=R.filename,Qe=qe===void 0?"educoder.txt":qe,Ze=R.errorLine,Ge=R.errorContent,it=Ge===void 0?"":Ge,nt=Object(H.a)(R,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ie=Object(F.useRef)(),Me=Object(F.useRef)({}),pe=Object(F.useRef)(),ue=Object(F.useRef)(),ce=Object(F.useRef)(!1),X=Object(F.useRef)(),$=Object(F.useState)(!1),te=Object(M.a)($,2),oe=te[0],Te=te[1];function Ce(){var pt;return Ie.current&&(pt=new C.default(function(dt){var Ht=Object(O.a)(dt),ei;try{for(Ht.s();!(ei=Ht.n()).done;){var oi=ei.value;(oi.target.offsetHeight>0||oi.target.offsetWidth>0)&&Me.current.instance.layout()}}catch(li){Ht.e(li)}finally{Ht.f()}}),pt.observe(Ie.current)),pt}function Ke(){U.b.warn(decodeURIComponent(y))}var lt=function(){var dt=Me.current.instance;if(Se!=null&&dt&&oe){var Ht=dt.getModel();Ht&&Se!==Ht.getValue()&&(w=!0,Ht.setValue(Se),dt.layout(),w=!1)}};Object(F.useEffect)(function(){ue.current&&clearTimeout(ue.current),ue.current=setTimeout(function(){lt()},500)},[Se,oe,Me.current]),Object(F.useEffect)(function(){if(Ze&&Me.current&&Me.current.instance){var pt=Me.current.instance;pt.changeViewZones(function(Ht){var ei=document.createElement("div");ei.style.padding="10px 20px",ei.style.width="calc(100% - 20px)",ei.className="my-error-line-wrp",ei.innerHTML=it,Ht.addZone({afterLineNumber:Ze||11,heightInLines:3,domNode:ei})});var dt={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}};pt.addOverlayWidget(dt),pt.revealPositionInCenter({lineNumber:20,column:1})}},[Ze,Me.current,oe]);function gt(){var pt=Me.current.instance;if(pt){var dt=pt.getSelection(),Ht=Me.current.pastePos||{},ei=new S.Range(Ht.startLineNumber||dt.endLineNumber,Ht.startColumn||dt.endColumn,Ht.endLineNumber||dt.endLineNumber,Ht.endColumn||dt.endColumn);setTimeout(function(){pt.executeEdits("",[{range:ei,text:""}])},300)}}function ut(pt){(window.navigator.platform.match("Mac")?pt.metaKey:pt.ctrlKey)&&pt.keyCode==83&&(pt.preventDefault(),Ae())}var yt=function(){if(Ve&&Me.current.instance){var dt=Me.current.instance.getContentHeight();ht(dt<ne?ne:dt)}else ht(ne)};function wt(pt){var dt=document.createEvent("MouseEvents");dt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),pt.dispatchEvent(dt)}function rt(pt,dt){var Ht=window.URL||window.webkitURL||window,ei=new Blob([dt]),oi=document.createElementNS("http://www.w3.org/1999/xhtml","a");oi.href=Ht.createObjectURL(ei),oi.download=pt,wt(oi)}Object(F.useEffect)(function(){yt()},[yt]),Object(F.useEffect)(function(){Ie.current&&!oe&&Promise.all([z.e(16),z.e(28)]).then(z.t.bind(null,"M/lh",7)).then(function(pt){try{S=pt,Me.current.instance=S.editor.create(Ie.current,{value:Se,language:L(we),theme:Ne,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},et);var dt=Me.current.instance,Ht=c.d._menuItems,ei=Object(j.a)(Ht).find(function(Yt){return Yt[0]._debugName=="EditorContext"}),oi=ei[1],li=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ki=function(_i,Oi){var Ci=_i._first;do{var Ni,Li,Ui=Oi.includes((Ni=Ci.element)===null||Ni===void 0||((Li=Ni.command)===null||Li===void 0)?void 0:Li.id);Ui&&_i._remove(Ci)}while(Ci=Ci.next)};if(We(dt,S),setTimeout(function(){yt(),Me.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){rt(Qe||"educoder.txt",dt.getValue())}}),dt.getDomNode().addEventListener("input",function(){pe.current.autoFormat&&dt.getAction("editor.action.formatDocument").run()})},500),Me.current.subscription=dt.onDidChangeModelContent(function(Yt){ce.current?clearTimeout(X.current):(yt(),Ee(dt.getValue(),Yt)),X.current=setTimeout(function(){ce.current=!1},500)}),window.Monaco||E(S,L(we)),fe&&(ki(oi,li),Ie.current.classList.add("noCopyPaste"),dt.onKeyDown(function(Yt){var _i=Yt.keyCode,Oi=Yt.ctrlKey,Ci=Yt.metaKey;(_i===33||_i===52)&&(Ci||Oi)&&(Ke(),Yt.preventDefault())})),window.Monaco=S,Ye&&dt.onDidBlurEditorWidget(function(){Ye(dt.getValue())}),ze&&dt.onDidFocusEditorText(function(){ze(dt.getValue())}),fe){dt.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Ke(),null}),dt.onDidPaste(function(Yt){Me.current.pastePos=Yt});try{window.addEventListener("paste",gt)}catch(Yt){}}var Wi=Ce();return Te(!0),function(){var Yt=Me.current.instance;Yt.dispose();var _i=Yt.getModel();_i&&_i.dispose(),Me.current.subscription&&Me.current.subscription.dispose(),fe&&window.removeEventListener("paste",gt),Wi.unobserve(Ie.current)}}catch(Yt){}})},[]),Object(F.useEffect)(function(){var pt=Me.current.instance;if(pt&&oe)return document.addEventListener("keydown",ut,!1),function(){document.removeEventListener("keydown",ut)}},[Ae,oe]),Object(F.useEffect)(function(){var pt=Me.current.instance;if(pt&&oe){var dt=L(we);S.editor.setModelLanguage(pt.getModel(),dt),console.log("language:",we,pt.getModel(),dt)}},[we,oe]),Object(F.useEffect)(function(){var pt=Me.current.instance;pt&&oe&&S.editor.setTheme(Ne)},[Ne,oe]),Object(F.useEffect)(function(){var pt=Me.current.instance;pe.current=ee,pt&&oe&&(pt.updateOptions(Object(q.a)({},ee)),setTimeout(function(){pt.getModel().updateOptions(Object(q.a)({},ee))},200))},[JSON.stringify(ee),oe]),Object(F.useEffect)(function(){var pt=Me.current.instance;pt&&oe&&pt.layout()},[Y,ne,oe]);var Vt=Object(F.useState)(b(Y)),Pt=Object(M.a)(Vt,2),Zt=Pt[0],qt=Pt[1],bt=Object(F.useState)(b(ne)),ii=Object(M.a)(bt,2),vi=ii[0],ht=ii[1],Si=Object(q.a)(Object(q.a)({},Pe),{},{width:Zt,height:vi});return e.a.createElement("div",{className:"my-monaco-editor",ref:Ie,style:Si})};function B(R){var W=R.width,Y=W===void 0?"100%":W,se=R.height,ne=se===void 0?"100%":se,Se=R.original,xe=R.modified,we=R.language,Re=R.options,Pe=Re===void 0?{}:Re,ye=Object(F.useRef)(),ee=Object(F.useState)(null),je=Object(M.a)(ee,2),et=je[0],He=je[1];function Ne(Ve){var Q;return ye.current&&(Q=new C.default(function(fe){var be=Object(O.a)(fe),Ee;try{for(be.s();!(Ee=be.n()).done;){var ke=Ee.value;(ke.target.offsetHeight>0||ke.target.offsetWidth>0)&&Ve.layout()}}catch(We){be.e(We)}finally{be.f()}}),Q.observe(ye.current)),Q}Object(F.useEffect)(function(){ye.current&&Promise.all([z.e(16),z.e(28)]).then(z.t.bind(null,"M/lh",7)).then(function(Ve){S=Ve;var Q=S.editor.createDiffEditor(ye.current,Object(q.a)(Object(q.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},Pe),{},{wordWrap:!0}));He(Q);var fe=Ne(Q);return function(){Q.dispose();var be=Q.getModel();be&&be.dispose(),fe.unobserve(ye.current)}})},[]),Object(F.useEffect)(function(){et&&et.setModel({original:S.editor.createModel(Se,we),modified:S.editor.createModel(xe,we)})},[Se,xe,we,et]);var Ye=b(Y),Ae=b(ne),Ue={width:Ye,height:Ae};return e.a.createElement("div",{className:"my-diff-editor",ref:ye,style:Ue})}},bT9E:function(st,ve,z){"use strict";z.d(ve,"a",function(){return j});var q=z("VTBJ");function j(A,U){var O=Object(q.a)({},A);return Array.isArray(U)&&U.forEach(function(M){delete O[M]}),O}},fjLI:function(st,ve,z){"use strict";z.d(ve,"f",function(){return o}),z.d(ve,"b",function(){return a}),z.d(ve,"a",function(){return r}),z.d(ve,"d",function(){return h}),z.d(ve,"e",function(){return s}),z.d(ve,"c",function(){return n});var q=z("8HAY"),j=z("Vhoy"),A=z("MI8n"),U=z("JYp7"),O=z("pmY6"),M=z("24hK"),H=z("nnTU"),F=z("T8No"),e=z("Cg/j"),C=z("t9D7"),f=function(i,t,_,g){var v=arguments.length,x=v<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,_):g,E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(i,t,_,g);else for(var y=i.length-1;y>=0;y--)(E=i[y])&&(x=(v<3?E(x):v>3?E(t,_,x):E(t,_))||x);return v>3&&x&&Object.defineProperty(t,_,x),x},p=function(i,t){return function(_,g){t(_,g,i)}};function o(i){return i.command!==void 0}class a{constructor(i){this.id=a._idPool++,this._debugName=i}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const r=Object(e.c)("menuService"),h=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new A.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===a.CommandPalette}}addCommand(i){return this.addCommands(U.a.single(i))}addCommands(i){for(const t of i)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(O.i)(()=>{let t=!1;for(const _ of i)t=this._commands.delete(_.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((t,_)=>i.set(_,t)),i}appendMenuItem(i,t){return this.appendMenuItems(U.a.single({id:i,item:t}))}appendMenuItems(i){const t=new Set,_=new M.a;for(const{id:g,item:v}of i){let x=this._menuItems.get(g);x||(x=new M.a,this._menuItems.set(g,x)),_.push(x.push(v)),t.add(g)}return this._onDidChangeMenu.fire(t),Object(O.i)(()=>{if(_.size>0){for(let g of _)g();this._onDidChangeMenu.fire(t),_.clear()}})}getMenuItems(i){let t;return this._menuItems.has(i)?t=[...this._menuItems.get(i)]:t=[],i===a.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(i){const t=new Set;for(const _ of i)o(_)&&(t.add(_.command.id),_.alt&&t.add(_.alt.id));this._commands.forEach((_,g)=>{t.has(g)||i.push({command:_})})}};class s extends q.e{constructor(i,t,_,g){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=t,this._contextKeyService=_,this._options=g}get actions(){const i=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),_=t.getActions(this._options);t.dispose();for(const[,g]of _)g.length>0&&(i.push(...g),i.push(new q.d));return i.length&&i.pop(),i}}let n=class i{constructor(t,_,g,v,x){var E,y;if(this._commandService=x,this.id=t.id,this.label=(g==null?void 0:g.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(y=typeof t.tooltip=="string"?t.tooltip:(E=t.tooltip)===null||E===void 0?void 0:E.value)!==null&&y!==void 0?y:"",this.enabled=!t.precondition||v.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const c=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=v.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}this.item=t,this.alt=_?new i(_,void 0,g,v,x):void 0,this._options=g,C.d.isThemeIcon(t.icon)&&(this.class=j.a.asClassName(t.icon))}dispose(){}run(...t){var _,g;let v=[];return((_=this._options)===null||_===void 0?void 0:_.arg)&&(v=[...v,this._options.arg]),((g=this._options)===null||g===void 0?void 0:g.shouldForwardArgs)&&(v=[...v,...t]),this._commandService.executeCommand(this.id,...v)}};n=f([p(3,F.b),p(4,H.b)],n)},ic2d:function(st,ve,z){"use strict";z.d(ve,"a",function(){return U});var q=z("FWmy"),j=z("746U");class A{constructor(){this.data=new Map}add(O,M){q.a(j.l(O)),q.a(j.k(M)),q.a(!this.data.has(O),"There is already an extension with this id"),this.data.set(O,M)}as(O){return this.data.get(O)||null}}const U=new A},k3GJ:function(st,ve,z){"use strict";z.d(ve,"a",function(){return $n});var q=z("rePB"),j=z("ODXe"),A=z("Ff2n"),U=z("VTBJ"),O=z("q1tI"),M=z("TSYQ"),H=z.n(M),F=z("Zm9Q"),e=z("6cGi"),C=z("KQm4"),f=z("xEkU"),p=z.n(f),o=z("t23M");function a(Z){var he=Object(O.useRef)(),me=Object(O.useRef)(!1);function re(){for(var G=arguments.length,J=new Array(G),V=0;V<G;V++)J[V]=arguments[V];me.current||(p.a.cancel(he.current),he.current=p()(function(){Z.apply(void 0,J)}))}return Object(O.useEffect)(function(){return function(){me.current=!0,p.a.cancel(he.current)}},[]),re}function r(Z){var he=Object(O.useRef)([]),me=Object(O.useState)({}),re=Object(j.a)(me,2),G=re[1],J=Object(O.useRef)(typeof Z=="function"?Z():Z),V=a(function(){var ae=J.current;he.current.forEach(function(ge){ae=ge(ae)}),he.current=[],J.current=ae,G({})});function ie(ae){he.current.push(ae),V()}return[J.current,ie]}var h=z("4IlW");function s(Z,he){var me,re=Z.prefixCls,G=Z.id,J=Z.active,V=Z.rtl,ie=Z.tab,ae=ie.key,ge=ie.tab,de=ie.disabled,_e=ie.closeIcon,Oe=Z.tabBarGutter,Be=Z.tabPosition,Fe=Z.closable,$e=Z.renderWrapper,ft=Z.removeAriaLabel,Tt=Z.editable,vt=Z.onClick,St=Z.onRemove,xt=Z.onFocus,_t="".concat(re,"-tab");O.useEffect(function(){return St},[]);var Et={};Be==="top"||Be==="bottom"?Et[V?"marginLeft":"marginRight"]=Oe:Et.marginBottom=Oe;var It=Tt&&Fe!==!1&&!de;function Ot(ct){if(de)return;vt(ct)}function Jt(ct){ct.preventDefault(),ct.stopPropagation(),Tt.onEdit("remove",{key:ae,event:ct})}var Ut=O.createElement("div",{key:ae,ref:he,className:H()(_t,(me={},Object(q.a)(me,"".concat(_t,"-with-remove"),It),Object(q.a)(me,"".concat(_t,"-active"),J),Object(q.a)(me,"".concat(_t,"-disabled"),de),me)),style:Et,onClick:Ot},O.createElement("div",{role:"tab","aria-selected":J,id:G&&"".concat(G,"-tab-").concat(ae),className:"".concat(_t,"-btn"),"aria-controls":G&&"".concat(G,"-panel-").concat(ae),"aria-disabled":de,tabIndex:de?null:0,onClick:function(ot){ot.stopPropagation(),Ot(ot)},onKeyDown:function(ot){[h.a.SPACE,h.a.ENTER].includes(ot.which)&&(ot.preventDefault(),Ot(ot))},onFocus:xt},ge),It&&O.createElement("button",{type:"button","aria-label":ft||"remove",tabIndex:0,className:"".concat(_t,"-remove"),onClick:function(ot){ot.stopPropagation(),Jt(ot)}},_e||Tt.removeIcon||"\xD7"));return $e&&(Ut=$e(Ut)),Ut}var n=O.forwardRef(s),i={width:0,height:0,left:0,top:0};function t(Z,he,me){return Object(O.useMemo)(function(){for(var re,G=new Map,J=he.get((re=Z[0])===null||re===void 0?void 0:re.key)||i,V=J.left+J.width,ie=0;ie<Z.length;ie+=1){var ae=Z[ie].key,ge=he.get(ae);if(!ge){var de;ge=he.get((de=Z[ie-1])===null||de===void 0?void 0:de.key)||i}var _e=G.get(ae)||Object(U.a)({},ge);_e.right=V-_e.left-_e.width,G.set(ae,_e)}return G},[Z.map(function(re){return re.key}).join("_"),he,me])}var _={width:0,height:0,left:0,top:0,right:0};function g(Z,he,me,re,G){var J=G.tabs,V=G.tabPosition,ie=G.rtl,ae,ge,de;["top","bottom"].includes(V)?(ae="width",ge=ie?"right":"left",de=Math.abs(he.left)):(ae="height",ge="top",de=-he.top);var _e=he[ae],Oe=me[ae],Be=re[ae],Fe=_e;return Oe+Be>_e&&(Fe=_e-Be),Object(O.useMemo)(function(){if(!J.length)return[0,0];for(var $e=J.length,ft=$e,Tt=0;Tt<$e;Tt+=1){var vt=Z.get(J[Tt].key)||_;if(vt[ge]+vt[ae]>de+Fe){ft=Tt-1;break}}for(var St=0,xt=$e-1;xt>=0;xt-=1){var _t=Z.get(J[xt].key)||_;if(_t[ge]<de){St=xt+1;break}}return[St,ft]},[Z,de,Fe,V,J.map(function($e){return $e.key}).join("_"),ie])}var v=z("wx14"),x=z("1OyB"),E=z("vuIU"),y=z("JX7q"),c=z("Ji7U"),u=z("LK+K"),l=z("I8Z2"),b=z("bT9E"),m=z("2GS6"),w=z("Gytx"),I=z.n(w),L=z("U8pU"),S=/iPhone/i,D=/iPod/i,B=/iPad/i,R=/\bAndroid(?:.+)Mobile\b/i,W=/Android/i,Y=/\bAndroid(?:.+)SD4930UR\b/i,se=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ne=/Windows Phone/i,Se=/\bWindows(?:.+)ARM\b/i,xe=/BlackBerry/i,we=/BB10/i,Re=/Opera Mini/i,Pe=/\b(CriOS|Chrome)(?:.+)Mobile/i,ye=/Mobile(?:.+)Firefox\b/i;function ee(Z,he){return Z.test(he)}function je(Z){var he=Z||(typeof navigator!="undefined"?navigator.userAgent:""),me=(he||"").split("[FBAN");if(typeof me[1]!="undefined"){var re=me,G=Object(j.a)(re,1);he=G[0]}if(me=he.split("Twitter"),typeof me[1]!="undefined"){var J=me,V=Object(j.a)(J,1);he=V[0]}var ie={apple:{phone:ee(S,he)&&!ee(ne,he),ipod:ee(D,he),tablet:!ee(S,he)&&ee(B,he)&&!ee(ne,he),device:(ee(S,he)||ee(D,he)||ee(B,he))&&!ee(ne,he)},amazon:{phone:ee(Y,he),tablet:!ee(Y,he)&&ee(se,he),device:ee(Y,he)||ee(se,he)},android:{phone:!ee(ne,he)&&ee(Y,he)||!ee(ne,he)&&ee(R,he),tablet:!ee(ne,he)&&!ee(Y,he)&&!ee(R,he)&&(ee(se,he)||ee(W,he)),device:!ee(ne,he)&&(ee(Y,he)||ee(se,he)||ee(R,he)||ee(W,he))||ee(/\bokhttp\b/i,he)},windows:{phone:ee(ne,he),tablet:ee(Se,he),device:ee(ne,he)||ee(Se,he)},other:{blackberry:ee(xe,he),blackberry10:ee(we,he),opera:ee(Re,he),firefox:ee(ye,he),chrome:ee(Pe,he),device:ee(xe,he)||ee(we,he)||ee(Re,he)||ee(ye,he)||ee(Pe,he)},any:null,phone:null,tablet:null};return ie.any=ie.apple.device||ie.android.device||ie.windows.device||ie.other.device,ie.phone=ie.apple.phone||ie.android.phone||ie.windows.phone,ie.tablet=ie.apple.tablet||ie.android.tablet||ie.windows.tablet,ie}var et=Object(U.a)(Object(U.a)({},je()),{},{isMobile:je}),He=et;function Ne(){}function Ye(Z,he,me){var re=he||"";return Z.key||"".concat(re,"item_").concat(me)}function Ae(Z){return"".concat(Z,"-menu-")}function Ue(Z,he){var me=-1;O.Children.forEach(Z,function(re){me+=1,re&&re.type&&re.type.isMenuItemGroup?O.Children.forEach(re.props.children,function(G){me+=1,he(G,me)}):he(re,me)})}function Ve(Z,he,me){if(!Z||me.find)return;O.Children.forEach(Z,function(re){if(re){var G=re.type;if(!G||!(G.isSubMenu||G.isMenuItem||G.isMenuItemGroup))return;he.indexOf(re.key)!==-1?me.find=!0:re.props.children&&Ve(re.props.children,he,me)}})}var Q=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],fe=function(he){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,re=he&&typeof he.getBoundingClientRect=="function"&&he.getBoundingClientRect().width;if(re){if(me){var G=getComputedStyle(he),J=G.marginLeft,V=G.marginRight;re+=+J.replace("px","")+ +V.replace("px","")}re=+re.toFixed(6)}return re||0},be=function(he,me,re){he&&Object(L.a)(he.style)==="object"&&(he.style[me]=re)},Ee=function(){return He.any},ke=z("bdgK"),We=z("i8i4"),Xe=z.n(We),ze=z("wgJM"),qe=z("l4aY"),Qe=z("m+aA"),Ze=z("c+Xe"),Ge=z("zT1h"),it=z("QC+M");function nt(Z,he,me){return me?Z[0]===he[0]:Z[0]===he[0]&&Z[1]===he[1]}function Ie(Z,he,me){var re=Z[he]||{};return Object(U.a)(Object(U.a)({},re),me)}function Me(Z,he,me,re){for(var G=me.points,J=Object.keys(Z),V=0;V<J.length;V+=1){var ie=J[V];if(nt(Z[ie].points,G,re))return"".concat(he,"-placement-").concat(ie)}return""}var pe=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Z=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Z)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Z==null?void 0:Z.substr(0,4)))},ue=z("MNnm");function ce(Z,he){var me={};return me[Z.toLowerCase()]=he.toLowerCase(),me["Webkit".concat(Z)]="webkit".concat(he),me["Moz".concat(Z)]="moz".concat(he),me["ms".concat(Z)]="MS".concat(he),me["O".concat(Z)]="o".concat(he.toLowerCase()),me}function X(Z,he){var me={animationend:ce("Animation","AnimationEnd"),transitionend:ce("Transition","TransitionEnd")};return Z&&("AnimationEvent"in he||delete me.animationend.animation,"TransitionEvent"in he||delete me.transitionend.transition),me}var $=X(Object(ue.a)(),typeof window!="undefined"?window:{}),te={};if(Object(ue.a)()){var oe=document.createElement("div");te=oe.style}var Te={};function Ce(Z){if(Te[Z])return Te[Z];var he=$[Z];if(he)for(var me=Object.keys(he),re=me.length,G=0;G<re;G+=1){var J=me[G];if(Object.prototype.hasOwnProperty.call(he,J)&&J in te)return Te[Z]=he[J],Te[Z]}return""}var Ke=Ce("animationend"),lt=Ce("transitionend"),gt=!!(Ke&<),ut=Ke||"animationend",yt=lt||"transitionend";function wt(Z,he){if(!Z)return null;if(Object(L.a)(Z)==="object"){var me=he.replace(/-\w/g,function(re){return re[1].toUpperCase()});return Z[me]}return"".concat(Z,"-").concat(he)}var rt="none",Vt="appear",Pt="enter",Zt="leave",qt="none",bt="prepare",ii="start",vi="active",ht="end";function Si(Z){var he=Object(O.useRef)(!1),me=Object(O.useState)(Z),re=Object(j.a)(me,2),G=re[0],J=re[1];function V(ie){he.current||J(ie)}return Object(O.useEffect)(function(){return function(){he.current=!0}},[]),[G,V]}var pt=Object(ue.a)()?O.useLayoutEffect:O.useEffect,dt=pt,Ht=function(){var Z=O.useRef(null);function he(){ze.a.cancel(Z.current)}function me(re){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;he();var J=Object(ze.a)(function(){G<=1?re({isCanceled:function(){return J!==Z.current}}):me(re,G-1)});Z.current=J}return O.useEffect(function(){return function(){he()}},[]),[me,he]},ei=[bt,ii,vi,ht],oi=!1,li=!0;function ki(Z){return Z===vi||Z===ht}var Wi=function(Z,he){var me=O.useState(qt),re=Object(j.a)(me,2),G=re[0],J=re[1],V=Ht(),ie=Object(j.a)(V,2),ae=ie[0],ge=ie[1];function de(){J(bt)}return dt(function(){if(G!==qt&&G!==ht){var _e=ei.indexOf(G),Oe=ei[_e+1],Be=he(G);Be===oi?J(Oe):ae(function(Fe){function $e(){if(Fe.isCanceled())return;J(Oe)}Be===!0?$e():Promise.resolve(Be).then($e)})}},[Z,G]),O.useEffect(function(){return function(){ge()}},[]),[de,G]},Yt=function(Z){var he=Object(O.useRef)(),me=Object(O.useRef)(Z);me.current=Z;var re=O.useCallback(function(V){me.current(V)},[]);function G(V){V&&(V.removeEventListener(yt,re),V.removeEventListener(ut,re))}function J(V){he.current&&he.current!==V&&G(he.current),V&&V!==he.current&&(V.addEventListener(yt,re),V.addEventListener(ut,re),he.current=V)}return O.useEffect(function(){return function(){G(he.current)}},[]),[J,G]};function _i(Z,he,me,re){var G=re.motionEnter,J=G===void 0?!0:G,V=re.motionAppear,ie=V===void 0?!0:V,ae=re.motionLeave,ge=ae===void 0?!0:ae,de=re.motionDeadline,_e=re.motionLeaveImmediately,Oe=re.onAppearPrepare,Be=re.onEnterPrepare,Fe=re.onLeavePrepare,$e=re.onAppearStart,ft=re.onEnterStart,Tt=re.onLeaveStart,vt=re.onAppearActive,St=re.onEnterActive,xt=re.onLeaveActive,_t=re.onAppearEnd,Et=re.onEnterEnd,It=re.onLeaveEnd,Ot=re.onVisibleChanged,Jt=Si(),Ut=Object(j.a)(Jt,2),ct=Ut[0],ot=Ut[1],Ct=Si(rt),Rt=Object(j.a)(Ct,2),tt=Rt[0],Lt=Rt[1],Gt=Si(null),Dt=Object(j.a)(Gt,2),jt=Dt[0],Xt=Dt[1],ci=Object(O.useRef)(!1),yi=Object(O.useRef)(null),Qt=Object(O.useRef)(!1),bi=Object(O.useRef)(null);function Ai(){var zt=me();return zt||bi.current}var Ei=Object(O.useRef)(!1);function Ti(zt){var Nt=Ai();if(zt&&!zt.deadline&&zt.target!==Nt)return;var fi;tt===Vt&&Ei.current?fi=_t==null?void 0:_t(Nt,zt):tt===Pt&&Ei.current?fi=Et==null?void 0:Et(Nt,zt):tt===Zt&&Ei.current&&(fi=It==null?void 0:It(Nt,zt)),fi!==!1&&!Qt.current&&(Lt(rt),Xt(null))}var ti=Yt(Ti),gi=Object(j.a)(ti,1),di=gi[0],ai=O.useMemo(function(){var zt,Nt,fi;switch(tt){case"appear":return zt={},Object(q.a)(zt,bt,Oe),Object(q.a)(zt,ii,$e),Object(q.a)(zt,vi,vt),zt;case"enter":return Nt={},Object(q.a)(Nt,bt,Be),Object(q.a)(Nt,ii,ft),Object(q.a)(Nt,vi,St),Nt;case"leave":return fi={},Object(q.a)(fi,bt,Fe),Object(q.a)(fi,ii,Tt),Object(q.a)(fi,vi,xt),fi;default:return{}}},[tt]),Di=Wi(tt,function(zt){if(zt===bt){var Nt=ai[bt];return Nt?Nt(Ai()):oi}if(Wt in ai){var fi;Xt(((fi=ai[Wt])===null||fi===void 0?void 0:fi.call(ai,Ai(),null))||null)}return Wt===vi&&(di(Ai()),de>0&&(clearTimeout(yi.current),yi.current=setTimeout(function(){Ti({deadline:!0})},de))),li}),Mi=Object(j.a)(Di,2),ji=Mi[0],Wt=Mi[1],Ii=ki(Wt);Ei.current=Ii,dt(function(){ot(he);var zt=ci.current;if(ci.current=!0,!Z)return;var Nt;!zt&&he&&ie&&(Nt=Vt),zt&&he&&J&&(Nt=Pt),(zt&&!he&&ge||!zt&&_e&&!he&&ge)&&(Nt=Zt),Nt&&(Lt(Nt),ji())},[he]),Object(O.useEffect)(function(){(tt===Vt&&!ie||tt===Pt&&!J||tt===Zt&&!ge)&&Lt(rt)},[ie,J,ge]),Object(O.useEffect)(function(){return function(){clearTimeout(yi.current),Qt.current=!0}},[]),Object(O.useEffect)(function(){ct!==void 0&&tt===rt&&(Ot==null||Ot(ct))},[ct,tt]);var Hi=jt;return ai[bt]&&Wt===ii&&(Hi=Object(U.a)({transition:"none"},Hi)),[tt,Wt,Hi,ct!=null?ct:he]}var Oi=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(){return Object(x.a)(this,me),he.apply(this,arguments)}return Object(E.a)(me,[{key:"render",value:function(){return this.props.children}}]),me}(O.Component),Ci=Oi;function Ni(Z){var he=Z;Object(L.a)(Z)==="object"&&(he=Z.transitionSupport);function me(G){return!!(G.motionName&&he)}var re=O.forwardRef(function(G,J){var V=G.visible,ie=V===void 0?!0:V,ae=G.removeOnLeave,ge=ae===void 0?!0:ae,de=G.forceRender,_e=G.children,Oe=G.motionName,Be=G.leavedClassName,Fe=G.eventProps,$e=me(G),ft=Object(O.useRef)(),Tt=Object(O.useRef)();function vt(){try{return Object(Qe.a)(ft.current||Tt.current)}catch(Lt){return null}}var St=_i($e,ie,vt,G),xt=Object(j.a)(St,4),_t=xt[0],Et=xt[1],It=xt[2],Ot=xt[3],Jt=O.useRef(Ot);Ot&&(Jt.current=!0);var Ut=Object(O.useRef)(J);Ut.current=J;var ct=O.useCallback(function(Lt){ft.current=Lt,Object(Ze.b)(Ut.current,Lt)},[]),ot,Ct=Object(U.a)(Object(U.a)({},Fe),{},{visible:ie});if(!_e)ot=null;else if(_t===rt||!me(G))Ot?ot=_e(Object(U.a)({},Ct),ct):!ge&&Jt.current?ot=_e(Object(U.a)(Object(U.a)({},Ct),{},{className:Be}),ct):de?ot=_e(Object(U.a)(Object(U.a)({},Ct),{},{style:{display:"none"}}),ct):ot=null;else{var Rt,tt;Et===bt?tt="prepare":ki(Et)?tt="active":Et===ii&&(tt="start"),ot=_e(Object(U.a)(Object(U.a)({},Ct),{},{className:H()(wt(Oe,_t),(Rt={},Object(q.a)(Rt,wt(Oe,"".concat(_t,"-").concat(tt)),tt),Object(q.a)(Rt,Oe,typeof Oe=="string"),Rt)),style:It}),ct)}return O.createElement(Ci,{ref:Tt},ot)});return re.displayName="CSSMotion",re}var Li=Ni(gt),Ui="add",qi="keep",Ki="remove",cn="removed";function yn(Z){var he;return Z&&Object(L.a)(Z)==="object"&&"key"in Z?he=Z:he={key:Z},Object(U.a)(Object(U.a)({},he),{},{key:String(he.key)})}function dn(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Z.map(yn)}function N(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],me=[],re=0,G=he.length,J=dn(Z),V=dn(he);J.forEach(function(ge){for(var de=!1,_e=re;_e<G;_e+=1){var Oe=V[_e];if(Oe.key===ge.key){re<_e&&(me=me.concat(V.slice(re,_e).map(function(Be){return Object(U.a)(Object(U.a)({},Be),{},{status:Ui})})),re=_e),me.push(Object(U.a)(Object(U.a)({},Oe),{},{status:qi})),re+=1,de=!0;break}}de||me.push(Object(U.a)(Object(U.a)({},ge),{},{status:Ki}))}),re<G&&(me=me.concat(V.slice(re).map(function(ge){return Object(U.a)(Object(U.a)({},ge),{},{status:Ui})})));var ie={};me.forEach(function(ge){var de=ge.key;ie[de]=(ie[de]||0)+1});var ae=Object.keys(ie).filter(function(ge){return ie[ge]>1});return ae.forEach(function(ge){me=me.filter(function(de){var _e=de.key,Oe=de.status;return _e!==ge||Oe!==Ki}),me.forEach(function(de){de.key===ge&&(de.status=qi)})}),me}var d=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function T(Z){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Li,me=function(re){Object(c.a)(J,re);var G=Object(u.a)(J);function J(){var V;return Object(x.a)(this,J),V=G.apply(this,arguments),V.state={keyEntities:[]},V.removeKey=function(ie){V.setState(function(ae){var ge=ae.keyEntities;return{keyEntities:ge.map(function(de){return de.key!==ie?de:Object(U.a)(Object(U.a)({},de),{},{status:cn})})}})},V}return Object(E.a)(J,[{key:"render",value:function(){var ie=this,ae=this.state.keyEntities,ge=this.props,de=ge.component,_e=ge.children,Oe=ge.onVisibleChanged,Be=Object(A.a)(ge,["component","children","onVisibleChanged"]),Fe=de||O.Fragment,$e={};return d.forEach(function(ft){$e[ft]=Be[ft],delete Be[ft]}),delete Be.keys,O.createElement(Fe,Be,ae.map(function(ft){var Tt=ft.status,vt=Object(A.a)(ft,["status"]),St=Tt===Ui||Tt===qi;return O.createElement(he,Object(v.a)({},$e,{key:vt.key,visible:St,eventProps:vt,onVisibleChanged:function(_t){Oe==null||Oe(_t,{key:vt.key}),_t||ie.removeKey(vt.key)}}),_e)}))}}],[{key:"getDerivedStateFromProps",value:function(ie,ae){var ge=ie.keys,de=ae.keyEntities,_e=dn(ge),Oe=N(de,_e);return{keyEntities:Oe.filter(function(Be){var Fe=de.find(function($e){var ft=$e.key;return Be.key===ft});return!(Fe&&Fe.status===cn&&Be.status===Ki)})}}}]),J}(O.Component);return me.defaultProps={component:"div"},me}var P=T(gt),K=Li;function k(Z){var he=Z.prefixCls,me=Z.motion,re=Z.animation,G=Z.transitionName;return me||(re?{motionName:"".concat(he,"-").concat(re)}:G?{motionName:G}:null)}function le(Z){var he=Z.prefixCls,me=Z.visible,re=Z.zIndex,G=Z.mask,J=Z.maskMotion,V=Z.maskAnimation,ie=Z.maskTransitionName;if(!G)return null;var ae={};return(J||ie||V)&&(ae=Object(U.a)({motionAppear:!0},k({motion:J,prefixCls:he,transitionName:ie,animation:V}))),O.createElement(K,Object(v.a)({},ae,{visible:me,removeOnLeave:!0}),function(ge){var de=ge.className;return O.createElement("div",{style:{zIndex:re},className:H()("".concat(he,"-mask"),de)})})}var Le=z("9mu1"),Je=z("o0o1"),at=z.n(Je),De=z("HaE+"),mt=["measure","align",null,"motion"],kt=function(Z,he){var me=Object(O.useState)(null),re=Object(j.a)(me,2),G=re[0],J=re[1],V=Object(O.useRef)(),ie=Object(O.useRef)(!1);function ae(_e){ie.current||J(_e)}function ge(){ze.a.cancel(V.current)}function de(_e){ge(),V.current=Object(ze.a)(function(){ae(function(Oe){switch(G){case"align":return"motion";case"motion":return"stable";default:}return Oe}),_e==null||_e()})}return Object(O.useEffect)(function(){ae("measure")},[Z]),Object(O.useEffect)(function(){switch(G){case"measure":he();break;default:}G&&(V.current=Object(ze.a)(Object(De.a)(at.a.mark(function _e(){var Oe,Be;return at.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:Oe=mt.indexOf(G),Be=mt[Oe+1],Be&&Oe!==-1&&ae(Be);case 3:case"end":return $e.stop()}},_e)}))))},[G]),Object(O.useEffect)(function(){return function(){ie.current=!0,ge()}},[]),[G,de]},Kt=function(Z){var he=O.useState({width:0,height:0}),me=Object(j.a)(he,2),re=me[0],G=me[1];function J(ie){G({width:ie.offsetWidth,height:ie.offsetHeight})}var V=O.useMemo(function(){var ie={};if(Z){var ae=re.width,ge=re.height;Z.indexOf("height")!==-1&&ge?ie.height=ge:Z.indexOf("minHeight")!==-1&&ge&&(ie.minHeight=ge),Z.indexOf("width")!==-1&&ae?ie.width=ae:Z.indexOf("minWidth")!==-1&&ae&&(ie.minWidth=ae)}return ie},[Z,re]);return[V,J]},wi=O.forwardRef(function(Z,he){var me=Z.visible,re=Z.prefixCls,G=Z.className,J=Z.style,V=Z.children,ie=Z.zIndex,ae=Z.stretch,ge=Z.destroyPopupOnHide,de=Z.forceRender,_e=Z.align,Oe=Z.point,Be=Z.getRootDomNode,Fe=Z.getClassNameFromAlign,$e=Z.onAlign,ft=Z.onMouseEnter,Tt=Z.onMouseLeave,vt=Z.onMouseDown,St=Z.onTouchStart,xt=Object(O.useRef)(),_t=Object(O.useRef)(),Et=Object(O.useState)(),It=Object(j.a)(Et,2),Ot=It[0],Jt=It[1],Ut=Kt(ae),ct=Object(j.a)(Ut,2),ot=ct[0],Ct=ct[1];function Rt(){ae&&Ct(Be())}var tt=kt(me,Rt),Lt=Object(j.a)(tt,2),Gt=Lt[0],Dt=Lt[1],jt=Object(O.useRef)();function Xt(){return Oe||Be}function ci(){var ti;(ti=xt.current)===null||ti===void 0||ti.forceAlign()}function yi(ti,gi){var di=Fe(gi);Ot!==di&&Jt(di),Gt==="align"&&(Ot!==di?Promise.resolve().then(function(){ci()}):Dt(function(){var ai;(ai=jt.current)===null||ai===void 0||ai.call(jt)}),$e==null||$e(ti,gi))}var Qt=Object(U.a)({},k(Z));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ti){var gi=Qt[ti];Qt[ti]=function(di,ai){return Dt(),gi==null?void 0:gi(di,ai)}});function bi(){return new Promise(function(ti){jt.current=ti})}O.useEffect(function(){!Qt.motionName&&Gt==="motion"&&Dt()},[Qt.motionName,Gt]),O.useImperativeHandle(he,function(){return{forceAlign:ci,getElement:function(){return _t.current}}});var Ai=Object(U.a)(Object(U.a)({},ot),{},{zIndex:ie,opacity:Gt==="motion"||Gt==="stable"||!me?void 0:0,pointerEvents:Gt==="stable"?void 0:"none"},J),Ei=!0;(_e==null?void 0:_e.points)&&(Gt==="align"||Gt==="stable")&&(Ei=!1);var Ti=V;return O.Children.count(V)>1&&(Ti=O.createElement("div",{className:"".concat(re,"-content")},V)),O.createElement(K,Object(v.a)({visible:me,ref:_t,leavedClassName:"".concat(re,"-hidden")},Qt,{onAppearPrepare:bi,onEnterPrepare:bi,removeOnLeave:ge,forceRender:de}),function(ti,gi){var di=ti.className,ai=ti.style,Di=H()(re,G,Ot,di);return O.createElement(Le.a,{target:Xt(),key:"popup",ref:xt,monitorWindowResize:!0,disabled:Ei,align:_e,onAlign:yi},O.createElement("div",{ref:gi,className:Di,onMouseEnter:ft,onMouseLeave:Tt,onMouseDownCapture:vt,onTouchStartCapture:St,style:Object(U.a)(Object(U.a)({},ai),Ai)},Ti))})});wi.displayName="PopupInner";var Fi=wi,pi=O.forwardRef(function(Z,he){var me=Z.prefixCls,re=Z.visible,G=Z.zIndex,J=Z.children,V=Z.mobile;V=V===void 0?{}:V;var ie=V.popupClassName,ae=V.popupStyle,ge=V.popupMotion,de=ge===void 0?{}:ge,_e=V.popupRender,Oe=O.useRef();O.useImperativeHandle(he,function(){return{forceAlign:function(){},getElement:function(){return Oe.current}}});var Be=Object(U.a)({zIndex:G},ae),Fe=J;return O.Children.count(J)>1&&(Fe=O.createElement("div",{className:"".concat(me,"-content")},J)),_e&&(Fe=_e(Fe)),O.createElement(K,Object(v.a)({visible:re,ref:Oe,removeOnLeave:!0},de),function($e,ft){var Tt=$e.className,vt=$e.style,St=H()(me,ie,Tt);return O.createElement("div",{ref:ft,className:St,style:Object(U.a)(Object(U.a)({},vt),Be)},Fe)})});pi.displayName="MobilePopupInner";var Ri=pi,bn=["visible","mobile"],en=O.forwardRef(function(Z,he){var me=Z.visible,re=Z.mobile,G=Object(A.a)(Z,bn),J=Object(O.useState)(me),V=Object(j.a)(J,2),ie=V[0],ae=V[1],ge=Object(O.useState)(!1),de=Object(j.a)(ge,2),_e=de[0],Oe=de[1],Be=Object(U.a)(Object(U.a)({},G),{},{visible:ie});Object(O.useEffect)(function(){ae(me),me&&re&&Oe(pe())},[me,re]);var Fe=_e?O.createElement(Ri,Object(v.a)({},Be,{mobile:re,ref:he})):O.createElement(Fi,Object(v.a)({},Be,{ref:he}));return O.createElement("div",null,O.createElement(le,Be),Fe)});en.displayName="Popup";var Gi=en,Bi=O.createContext(null),fn=Bi;function zi(){}function _n(){return""}function Vi(Z){return Z?Z.ownerDocument:window.document}var En=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Tn(Z){var he=function(me){Object(c.a)(G,me);var re=Object(u.a)(G);function G(J){var V;Object(x.a)(this,G),V=re.call(this,J),V.popupRef=O.createRef(),V.triggerRef=O.createRef(),V.attachId=void 0,V.clickOutsideHandler=void 0,V.touchOutsideHandler=void 0,V.contextMenuOutsideHandler1=void 0,V.contextMenuOutsideHandler2=void 0,V.mouseDownTimeout=void 0,V.focusTime=void 0,V.preClickTime=void 0,V.preTouchTime=void 0,V.delayTimer=void 0,V.hasPopupMouseDown=void 0,V.onMouseEnter=function(ae){var ge=V.props.mouseEnterDelay;V.fireEvents("onMouseEnter",ae),V.delaySetPopupVisible(!0,ge,ge?null:ae)},V.onMouseMove=function(ae){V.fireEvents("onMouseMove",ae),V.setPoint(ae)},V.onMouseLeave=function(ae){V.fireEvents("onMouseLeave",ae),V.delaySetPopupVisible(!1,V.props.mouseLeaveDelay)},V.onPopupMouseEnter=function(){V.clearDelayTimer()},V.onPopupMouseLeave=function(ae){var ge;if(ae.relatedTarget&&!ae.relatedTarget.setTimeout&&Object(qe.a)((ge=V.popupRef.current)===null||ge===void 0?void 0:ge.getElement(),ae.relatedTarget))return;V.delaySetPopupVisible(!1,V.props.mouseLeaveDelay)},V.onFocus=function(ae){V.fireEvents("onFocus",ae),V.clearDelayTimer(),V.isFocusToShow()&&(V.focusTime=Date.now(),V.delaySetPopupVisible(!0,V.props.focusDelay))},V.onMouseDown=function(ae){V.fireEvents("onMouseDown",ae),V.preClickTime=Date.now()},V.onTouchStart=function(ae){V.fireEvents("onTouchStart",ae),V.preTouchTime=Date.now()},V.onBlur=function(ae){V.fireEvents("onBlur",ae),V.clearDelayTimer(),V.isBlurToHide()&&V.delaySetPopupVisible(!1,V.props.blurDelay)},V.onContextMenu=function(ae){ae.preventDefault(),V.fireEvents("onContextMenu",ae),V.setPopupVisible(!0,ae)},V.onContextMenuClose=function(){V.isContextMenuToShow()&&V.close()},V.onClick=function(ae){if(V.fireEvents("onClick",ae),V.focusTime){var ge;if(V.preClickTime&&V.preTouchTime?ge=Math.min(V.preClickTime,V.preTouchTime):V.preClickTime?ge=V.preClickTime:V.preTouchTime&&(ge=V.preTouchTime),Math.abs(ge-V.focusTime)<20)return;V.focusTime=0}V.preClickTime=0,V.preTouchTime=0,V.isClickToShow()&&(V.isClickToHide()||V.isBlurToHide())&&ae&&ae.preventDefault&&ae.preventDefault();var de=!V.state.popupVisible;(V.isClickToHide()&&!de||de&&V.isClickToShow())&&V.setPopupVisible(!V.state.popupVisible,ae)},V.onPopupMouseDown=function(){if(V.hasPopupMouseDown=!0,clearTimeout(V.mouseDownTimeout),V.mouseDownTimeout=window.setTimeout(function(){V.hasPopupMouseDown=!1},0),V.context){var ae;(ae=V.context).onPopupMouseDown.apply(ae,arguments)}},V.onDocumentClick=function(ae){if(V.props.mask&&!V.props.maskClosable)return;var ge=ae.target,de=V.getRootDomNode(),_e=V.getPopupDomNode();(!Object(qe.a)(de,ge)||V.isContextMenuOnly())&&!Object(qe.a)(_e,ge)&&!V.hasPopupMouseDown&&V.close()},V.getRootDomNode=function(){var ae=V.props.getTriggerDOMNode;if(ae)return ae(V.triggerRef.current);try{var ge=Object(Qe.a)(V.triggerRef.current);if(ge)return ge}catch(de){}return Xe.a.findDOMNode(Object(y.a)(V))},V.getPopupClassNameFromAlign=function(ae){var ge=[],de=V.props,_e=de.popupPlacement,Oe=de.builtinPlacements,Be=de.prefixCls,Fe=de.alignPoint,$e=de.getPopupClassNameFromAlign;return _e&&Oe&&ge.push(Me(Oe,Be,ae,Fe)),$e&&ge.push($e(ae)),ge.join(" ")},V.getComponent=function(){var ae=V.props,ge=ae.prefixCls,de=ae.destroyPopupOnHide,_e=ae.popupClassName,Oe=ae.onPopupAlign,Be=ae.popupMotion,Fe=ae.popupAnimation,$e=ae.popupTransitionName,ft=ae.popupStyle,Tt=ae.mask,vt=ae.maskAnimation,St=ae.maskTransitionName,xt=ae.maskMotion,_t=ae.zIndex,Et=ae.popup,It=ae.stretch,Ot=ae.alignPoint,Jt=ae.mobile,Ut=ae.forceRender,ct=V.state,ot=ct.popupVisible,Ct=ct.point,Rt=V.getPopupAlign(),tt={};return V.isMouseEnterToShow()&&(tt.onMouseEnter=V.onPopupMouseEnter),V.isMouseLeaveToHide()&&(tt.onMouseLeave=V.onPopupMouseLeave),tt.onMouseDown=V.onPopupMouseDown,tt.onTouchStart=V.onPopupMouseDown,O.createElement(Gi,Object(v.a)({prefixCls:ge,destroyPopupOnHide:de,visible:ot,point:Ot&&Ct,className:_e,align:Rt,onAlign:Oe,animation:Fe,getClassNameFromAlign:V.getPopupClassNameFromAlign},tt,{stretch:It,getRootDomNode:V.getRootDomNode,style:ft,mask:Tt,zIndex:_t,transitionName:$e,maskAnimation:vt,maskTransitionName:St,maskMotion:xt,ref:V.popupRef,motion:Be,mobile:Jt,forceRender:Ut}),typeof Et=="function"?Et():Et)},V.attachParent=function(ae){ze.a.cancel(V.attachId);var ge=V.props,de=ge.getPopupContainer,_e=ge.getDocument,Oe=V.getRootDomNode(),Be;de?(Oe||de.length===0)&&(Be=de(Oe)):Be=_e(V.getRootDomNode()).body,Be?Be.appendChild(ae):V.attachId=Object(ze.a)(function(){V.attachParent(ae)})},V.getContainer=function(){var ae=V.props.getDocument,ge=ae(V.getRootDomNode()).createElement("div");return ge.style.position="absolute",ge.style.top="0",ge.style.left="0",ge.style.width="100%",V.attachParent(ge),ge},V.setPoint=function(ae){var ge=V.props.alignPoint;if(!ge||!ae)return;V.setState({point:{pageX:ae.pageX,pageY:ae.pageY}})},V.handlePortalUpdate=function(){V.state.prevPopupVisible!==V.state.popupVisible&&V.props.afterPopupVisibleChange(V.state.popupVisible)},V.triggerContextValue={onPopupMouseDown:V.onPopupMouseDown};var ie;return"popupVisible"in J?ie=!!J.popupVisible:ie=!!J.defaultPopupVisible,V.state={prevPopupVisible:ie,popupVisible:ie},En.forEach(function(ae){V["fire".concat(ae)]=function(ge){V.fireEvents(ae,ge)}}),V}return Object(E.a)(G,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var V=this.props,ie=this.state;if(ie.popupVisible){var ae;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ae=V.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ge.a)(ae,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ae=ae||V.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ge.a)(ae,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ae=ae||V.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ge.a)(ae,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ge.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ze.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var V;return((V=this.popupRef.current)===null||V===void 0?void 0:V.getElement())||null}},{key:"getPopupAlign",value:function(){var V=this.props,ie=V.popupPlacement,ae=V.popupAlign,ge=V.builtinPlacements;return ie&&ge?Ie(ge,ie,ae):ae}},{key:"setPopupVisible",value:function(V,ie){var ae=this.props.alignPoint,ge=this.state.popupVisible;this.clearDelayTimer(),ge!==V&&("popupVisible"in this.props||this.setState({popupVisible:V,prevPopupVisible:ge}),this.props.onPopupVisibleChange(V)),ae&&ie&&V&&this.setPoint(ie)}},{key:"delaySetPopupVisible",value:function(V,ie,ae){var ge=this,de=ie*1e3;if(this.clearDelayTimer(),de){var _e=ae?{pageX:ae.pageX,pageY:ae.pageY}:null;this.delayTimer=window.setTimeout(function(){ge.setPopupVisible(V,_e),ge.clearDelayTimer()},de)}else this.setPopupVisible(V,ae)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(V){var ie=this.props.children.props,ae=this.props;return ie[V]&&ae[V]?this["fire".concat(V)]:ie[V]||ae[V]}},{key:"isClickToShow",value:function(){var V=this.props,ie=V.action,ae=V.showAction;return ie.indexOf("click")!==-1||ae.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var V=this.props.action;return V==="contextMenu"||V.length===1&&V[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var V=this.props,ie=V.action,ae=V.showAction;return ie.indexOf("contextMenu")!==-1||ae.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var V=this.props,ie=V.action,ae=V.hideAction;return ie.indexOf("click")!==-1||ae.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var V=this.props,ie=V.action,ae=V.showAction;return ie.indexOf("hover")!==-1||ae.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var V=this.props,ie=V.action,ae=V.hideAction;return ie.indexOf("hover")!==-1||ae.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var V=this.props,ie=V.action,ae=V.showAction;return ie.indexOf("focus")!==-1||ae.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var V=this.props,ie=V.action,ae=V.hideAction;return ie.indexOf("focus")!==-1||ae.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var V;(V=this.popupRef.current)===null||V===void 0||V.forceAlign()}}},{key:"fireEvents",value:function(V,ie){var ae=this.props.children.props[V];ae&&ae(ie);var ge=this.props[V];ge&&ge(ie)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var V=this.state.popupVisible,ie=this.props,ae=ie.children,ge=ie.forceRender,de=ie.alignPoint,_e=ie.className,Oe=ie.autoDestroy,Be=O.Children.only(ae),Fe={key:"trigger"};this.isContextMenuToShow()?Fe.onContextMenu=this.onContextMenu:Fe.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Fe.onClick=this.onClick,Fe.onMouseDown=this.onMouseDown,Fe.onTouchStart=this.onTouchStart):(Fe.onClick=this.createTwoChains("onClick"),Fe.onMouseDown=this.createTwoChains("onMouseDown"),Fe.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Fe.onMouseEnter=this.onMouseEnter,de&&(Fe.onMouseMove=this.onMouseMove)):Fe.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Fe.onMouseLeave=this.onMouseLeave:Fe.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Fe.onFocus=this.onFocus,Fe.onBlur=this.onBlur):(Fe.onFocus=this.createTwoChains("onFocus"),Fe.onBlur=this.createTwoChains("onBlur"));var $e=H()(Be&&Be.props&&Be.props.className,_e);$e&&(Fe.className=$e);var ft=Object(U.a)({},Fe);Object(Ze.c)(Be)&&(ft.ref=Object(Ze.a)(this.triggerRef,Be.ref));var Tt=O.cloneElement(Be,ft),vt;return(V||this.popupRef.current||ge)&&(vt=O.createElement(Z,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!V&&Oe&&(vt=null),O.createElement(fn.Provider,{value:this.triggerContextValue},Tt,vt)}}],[{key:"getDerivedStateFromProps",value:function(V,ie){var ae=V.popupVisible,ge={};return ae!==void 0&&ie.popupVisible!==ae&&(ge.popupVisible=ae,ge.prevPopupVisible=ie.popupVisible),ge}}]),G}(O.Component);return he.contextType=fn,he.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:_n,getDocument:Vi,onPopupVisibleChange:zi,afterPopupVisibleChange:zi,onPopupAlign:zi,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},he}var Yi=Tn(it.a),ui={adjustX:1,adjustY:1},Xi={topLeft:{points:["bl","tl"],overflow:ui,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ui,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ui,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ui,offset:[4,0]}},xn={topLeft:{points:["bl","tl"],overflow:ui,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ui,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ui,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ui,offset:[4,0]}},Fn=Xi,ni=0,Bt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ri=function(he,me,re){var G=Ae(me),J=he.getState();he.setState({defaultActiveFirst:Object(U.a)(Object(U.a)({},J.defaultActiveFirst),{},Object(q.a)({},G,re))})},Mt=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(re){var G;Object(x.a)(this,me),G=he.call(this,re),G.onDestroy=function(de){G.props.onDestroy(de)},G.onKeyDown=function(de){var _e=de.keyCode,Oe=G.menuInstance,Be=G.props.store,Fe=G.getVisible();if(_e===h.a.ENTER)return G.onTitleClick(de),ri(Be,G.props.eventKey,!0),!0;if(_e===h.a.RIGHT)return Fe?Oe.onKeyDown(de):(G.triggerOpenChange(!0),ri(Be,G.props.eventKey,!0)),!0;if(_e===h.a.LEFT){var $e;if(Fe)$e=Oe.onKeyDown(de);else return;return $e||(G.triggerOpenChange(!1),$e=!0),$e}return Fe&&(_e===h.a.UP||_e===h.a.DOWN)?Oe.onKeyDown(de):void 0},G.onOpenChange=function(de){G.props.onOpenChange(de)},G.onPopupVisibleChange=function(de){G.triggerOpenChange(de,de?"mouseenter":"mouseleave")},G.onMouseEnter=function(de){var _e=G.props,Oe=_e.eventKey,Be=_e.onMouseEnter,Fe=_e.store;ri(Fe,G.props.eventKey,!1),Be({key:Oe,domEvent:de})},G.onMouseLeave=function(de){var _e=G.props,Oe=_e.parentMenu,Be=_e.eventKey,Fe=_e.onMouseLeave;Oe.subMenuInstance=Object(y.a)(G),Fe({key:Be,domEvent:de})},G.onTitleMouseEnter=function(de){var _e=G.props,Oe=_e.eventKey,Be=_e.onItemHover,Fe=_e.onTitleMouseEnter;Be({key:Oe,hover:!0}),Fe({key:Oe,domEvent:de})},G.onTitleMouseLeave=function(de){var _e=G.props,Oe=_e.parentMenu,Be=_e.eventKey,Fe=_e.onItemHover,$e=_e.onTitleMouseLeave;Oe.subMenuInstance=Object(y.a)(G),Fe({key:Be,hover:!1}),$e({key:Be,domEvent:de})},G.onTitleClick=function(de){var _e=Object(y.a)(G),Oe=_e.props;if(Oe.onTitleClick({key:Oe.eventKey,domEvent:de}),Oe.triggerSubMenuAction==="hover")return;G.triggerOpenChange(!G.getVisible(),"click"),ri(Oe.store,G.props.eventKey,!1)},G.onSubMenuClick=function(de){typeof G.props.onClick=="function"&&G.props.onClick(G.addKeyPath(de))},G.onSelect=function(de){G.props.onSelect(de)},G.onDeselect=function(de){G.props.onDeselect(de)},G.getPrefixCls=function(){return"".concat(G.props.rootPrefixCls,"-submenu")},G.getActiveClassName=function(){return"".concat(G.getPrefixCls(),"-active")},G.getDisabledClassName=function(){return"".concat(G.getPrefixCls(),"-disabled")},G.getSelectedClassName=function(){return"".concat(G.getPrefixCls(),"-selected")},G.getOpenClassName=function(){return"".concat(G.props.rootPrefixCls,"-submenu-open")},G.getVisible=function(){return G.state.isOpen},G.getMode=function(){return G.state.mode},G.saveMenuInstance=function(de){G.menuInstance=de},G.addKeyPath=function(de){return Object(U.a)(Object(U.a)({},de),{},{keyPath:(de.keyPath||[]).concat(G.props.eventKey)})},G.triggerOpenChange=function(de,_e){var Oe=G.props.eventKey,Be=function(){G.onOpenChange({key:Oe,item:Object(y.a)(G),trigger:_e,open:de})};_e==="mouseenter"?G.mouseenterTimeout=setTimeout(function(){Be()},0):Be()},G.isChildrenSelected=function(){var de={find:!1};return Ve(G.props.children,G.props.selectedKeys,de),de.find},G.isInlineMode=function(){return G.getMode()==="inline"},G.adjustWidth=function(){if(!G.subMenuTitle||!G.menuInstance)return;var de=We.findDOMNode(G.menuInstance);if(de.offsetWidth>=G.subMenuTitle.offsetWidth)return;de.style.minWidth="".concat(G.subMenuTitle.offsetWidth,"px")},G.saveSubMenuTitle=function(de){G.subMenuTitle=de},G.getBaseProps=function(){var de=Object(y.a)(G),_e=de.props,Oe=G.getMode();return{mode:Oe==="horizontal"?"vertical":Oe,visible:G.getVisible(),level:_e.level+1,inlineIndent:_e.inlineIndent,focusable:!1,onClick:G.onSubMenuClick,onSelect:G.onSelect,onDeselect:G.onDeselect,onDestroy:G.onDestroy,selectedKeys:_e.selectedKeys,eventKey:"".concat(_e.eventKey,"-menu-"),openKeys:_e.openKeys,motion:_e.motion,onOpenChange:G.onOpenChange,subMenuOpenDelay:_e.subMenuOpenDelay,parentMenu:Object(y.a)(G),subMenuCloseDelay:_e.subMenuCloseDelay,forceSubMenuRender:_e.forceSubMenuRender,triggerSubMenuAction:_e.triggerSubMenuAction,builtinPlacements:_e.builtinPlacements,defaultActiveFirst:_e.store.getState().defaultActiveFirst[Ae(_e.eventKey)],multiple:_e.multiple,prefixCls:_e.rootPrefixCls,id:G.internalMenuId,manualRef:G.saveMenuInstance,itemIcon:_e.itemIcon,expandIcon:_e.expandIcon,direction:_e.direction}},G.getMotion=function(de,_e){var Oe=Object(y.a)(G),Be=Oe.haveRendered,Fe=G.props,$e=Fe.motion,ft=Fe.rootPrefixCls,Tt=Object(U.a)(Object(U.a)({},$e),{},{leavedClassName:"".concat(ft,"-hidden"),removeOnLeave:!1,motionAppear:Be||!_e||de!=="inline"});return Tt};var J=re.store,V=re.eventKey,ie=J.getState(),ae=ie.defaultActiveFirst;G.isRootMenu=!1;var ge=!1;return ae&&(ge=ae[V]),ri(J,V,ge),G.state={mode:re.mode,isOpen:re.isOpen},G}return Object(E.a)(me,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var G=this,J=this.props,V=J.mode,ie=J.parentMenu,ae=J.manualRef,ge=J.isOpen,de=function(){G.setState({mode:V,isOpen:ge})},_e=ge!==this.state.isOpen,Oe=V!==this.state.mode;if((Oe||_e)&&(ze.a.cancel(this.updateStateRaf),Oe?this.updateStateRaf=Object(ze.a)(de):de()),ae&&ae(this),V!=="horizontal"||!(ie==null?void 0:ie.isRootMenu)||!ge)return;this.minWidthTimeout=setTimeout(function(){return G.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var G=this.props,J=G.onDestroy,V=G.eventKey;J&&J(V),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),ze.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(G,J){var V=this.getBaseProps();return O.createElement(jn,Object(v.a)({},V,{id:this.internalMenuId,className:G,style:J}),this.props.children)}},{key:"renderChildren",value:function(){var G=this,J=this.getBaseProps(),V=J.mode,ie=J.visible,ae=J.forceSubMenuRender,ge=J.direction,de=this.getMotion(V,ie);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ie||ae,!this.haveOpened)return O.createElement("div",null);var _e=H()("".concat(J.prefixCls,"-sub"),Object(q.a)({},"".concat(J.prefixCls,"-rtl"),ge==="rtl"));return this.isInlineMode()?O.createElement(K,Object(v.a)({visible:J.visible,forceRender:ae},de),function(Oe){var Be=Oe.className,Fe=Oe.style,$e=H()(_e,Be);return G.renderPopupMenu($e,Fe)}):this.renderPopupMenu(_e)}},{key:"render",value:function(){var G,J,V,ie=Object(U.a)({},this.props),ae=this.getVisible(),ge=this.getPrefixCls(),de=this.isInlineMode(),_e=this.getMode(),Oe=H()(ge,"".concat(ge,"-").concat(_e),(G={},Object(q.a)(G,ie.className,!!ie.className),Object(q.a)(G,this.getOpenClassName(),ae),Object(q.a)(G,this.getActiveClassName(),ie.active||ae&&!de),Object(q.a)(G,this.getDisabledClassName(),ie.disabled),Object(q.a)(G,this.getSelectedClassName(),this.isChildrenSelected()),G));this.internalMenuId||(ie.eventKey?this.internalMenuId="".concat(ie.eventKey,"$Menu"):(ni+=1,this.internalMenuId="$__$".concat(ni,"$Menu")));var Be={},Fe={},$e={};ie.disabled||(Be={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Fe={onClick:this.onTitleClick},$e={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var ft={},Tt=ie.direction,vt=Tt==="rtl";de&&(vt?ft.paddingRight=ie.inlineIndent*ie.level:ft.paddingLeft=ie.inlineIndent*ie.level);var St={};this.getVisible()&&(St={"aria-owns":this.internalMenuId});var xt=null;_e!=="horizontal"&&(xt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(xt=O.createElement(this.props.expandIcon,Object(U.a)({},this.props))));var _t=O.createElement("div",Object(v.a)({ref:this.saveSubMenuTitle,style:ft,className:"".concat(ge,"-title"),role:"button"},$e,Fe,{"aria-expanded":ae},St,{"aria-haspopup":"true",title:typeof ie.title=="string"?ie.title:void 0}),ie.title,xt||O.createElement("i",{className:"".concat(ge,"-arrow")})),Et=this.renderChildren(),It=((J=ie.parentMenu)===null||J===void 0?void 0:J.isRootMenu)?ie.parentMenu.props.getPopupContainer:function(Xt){return Xt.parentNode},Ot=Bt[_e],Jt=ie.popupOffset?{offset:ie.popupOffset}:{},Ut=H()((V={},Object(q.a)(V,ie.popupClassName,ie.popupClassName&&!de),Object(q.a)(V,"".concat(ge,"-rtl"),vt),V)),ct=ie.disabled,ot=ie.triggerSubMenuAction,Ct=ie.subMenuOpenDelay,Rt=ie.forceSubMenuRender,tt=ie.subMenuCloseDelay,Lt=ie.builtinPlacements;Q.forEach(function(Xt){return delete ie[Xt]}),delete ie.onClick;var Gt=vt?Object(U.a)(Object(U.a)({},xn),Lt):Object(U.a)(Object(U.a)({},Xi),Lt);delete ie.direction;var Dt=this.getBaseProps(),jt=de?null:this.getMotion(Dt.mode,Dt.visible);return O.createElement("li",Object(v.a)({},ie,Be,{className:Oe,role:"menuitem"}),O.createElement(Yi,{prefixCls:ge,popupClassName:H()("".concat(ge,"-popup"),Ut),getPopupContainer:It,builtinPlacements:Gt,popupPlacement:Ot,popupVisible:de?!1:ae,popupAlign:Jt,popup:de?null:Et,action:ct||de?[]:[ot],mouseEnterDelay:Ct,mouseLeaveDelay:tt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Rt,popupMotion:jt},_t),de?Et:null)}}]),me}(O.Component);Mt.defaultProps={onMouseEnter:Ne,onMouseLeave:Ne,onTitleMouseEnter:Ne,onTitleMouseLeave:Ne,onTitleClick:Ne,manualRef:Ne,mode:"vertical",title:""};var mi=Object(l.b)(function(Z,he){var me=Z.openKeys,re=Z.activeKey,G=Z.selectedKeys,J=he.eventKey,V=he.subMenuKey;return{isOpen:me.indexOf(J)>-1,active:re[V]===J,selectedKeys:G}})(Mt);mi.isSubMenu=!0;var $t=mi,$i="menuitem-overflowed",hi=.5,tn=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(){var re;return Object(x.a)(this,me),re=he.apply(this,arguments),re.resizeObserver=null,re.mutationObserver=null,re.originalTotalWidth=0,re.overflowedItems=[],re.menuItemSizes=[],re.cancelFrameId=null,re.state={lastVisibleIndex:void 0},re.childRef=O.createRef(),re.getMenuItemNodes=function(){var G=re.props.prefixCls,J=re.childRef.current;return J?[].slice.call(J.children).filter(function(V){return V.className.split(" ").indexOf("".concat(G,"-overflowed-submenu"))<0}):[]},re.getOverflowedSubMenuItem=function(G,J,V){var ie=re.props,ae=ie.overflowedIndicator,ge=ie.level,de=ie.mode,_e=ie.prefixCls,Oe=ie.theme;if(ge!==1||de!=="horizontal")return null;var Be=re.props.children[0],Fe=Be.props,$e=Fe.children,ft=Fe.title,Tt=Fe.style,vt=Object(A.a)(Fe,["children","title","style"]),St=Object(U.a)({},Tt),xt="".concat(G,"-overflowed-indicator"),_t="".concat(G,"-overflowed-indicator");J.length===0&&V!==!0?St=Object(U.a)(Object(U.a)({},St),{},{display:"none"}):V&&(St=Object(U.a)(Object(U.a)({},St),{},{visibility:"hidden",position:"absolute"}),xt="".concat(xt,"-placeholder"),_t="".concat(_t,"-placeholder"));var Et=Oe?"".concat(_e,"-").concat(Oe):"",It={};return Q.forEach(function(Ot){vt[Ot]!==void 0&&(It[Ot]=vt[Ot])}),O.createElement($t,Object(v.a)({title:ae,className:"".concat(_e,"-overflowed-submenu"),popupClassName:Et},It,{key:xt,eventKey:_t,disabled:!1,style:St}),J)},re.setChildrenWidthAndResize=function(){if(re.props.mode!=="horizontal")return;var G=re.childRef.current;if(!G)return;var J=G.children;if(!J||J.length===0)return;var V=G.children[J.length-1];be(V,"display","inline-block");var ie=re.getMenuItemNodes(),ae=ie.filter(function(ge){return ge.className.split(" ").indexOf($i)>=0});ae.forEach(function(ge){be(ge,"display","inline-block")}),re.menuItemSizes=ie.map(function(ge){return fe(ge,!0)}),ae.forEach(function(ge){be(ge,"display","none")}),re.overflowedIndicatorWidth=fe(G.children[G.children.length-1],!0),re.originalTotalWidth=re.menuItemSizes.reduce(function(ge,de){return ge+de},0),re.handleResize(),be(V,"display","none")},re.handleResize=function(){if(re.props.mode!=="horizontal")return;var G=re.childRef.current;if(!G)return;var J=fe(G);re.overflowedItems=[];var V=0,ie;re.originalTotalWidth>J+hi&&(ie=-1,re.menuItemSizes.forEach(function(ae){V+=ae,V+re.overflowedIndicatorWidth<=J&&(ie+=1)})),re.setState({lastVisibleIndex:ie})},re}return Object(E.a)(me,[{key:"componentDidMount",value:function(){var G=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var J=this.childRef.current;if(!J)return;this.resizeObserver=new ke.default(function(V){V.forEach(function(){var ie=G.cancelFrameId;cancelAnimationFrame(ie),G.cancelFrameId=requestAnimationFrame(G.setChildrenWidthAndResize)})}),[].slice.call(J.children).concat(J).forEach(function(V){G.resizeObserver.observe(V)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){G.resizeObserver.disconnect(),[].slice.call(J.children).concat(J).forEach(function(V){G.resizeObserver.observe(V)}),G.setChildrenWidthAndResize()}),this.mutationObserver.observe(J,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(G){var J=this,V=this.state.lastVisibleIndex;return(G||[]).reduce(function(ie,ae,ge){var de=ae;if(J.props.mode==="horizontal"){var _e=J.getOverflowedSubMenuItem(ae.props.eventKey,[]);V!==void 0&&J.props.className.indexOf("".concat(J.props.prefixCls,"-root"))!==-1&&(ge>V&&(de=O.cloneElement(ae,{style:{display:"none"},eventKey:"".concat(ae.props.eventKey,"-hidden"),className:"".concat($i)})),ge===V+1&&(J.overflowedItems=G.slice(V+1).map(function(Be){return O.cloneElement(Be,{key:Be.props.eventKey,mode:"vertical-left"})}),_e=J.getOverflowedSubMenuItem(ae.props.eventKey,J.overflowedItems)));var Oe=[].concat(Object(C.a)(ie),[_e,de]);return ge===G.length-1&&Oe.push(J.getOverflowedSubMenuItem(ae.props.eventKey,[],!0)),Oe}return[].concat(Object(C.a)(ie),[de])},[])}},{key:"render",value:function(){var G=this.props,J=G.visible,V=G.prefixCls,ie=G.overflowedIndicator,ae=G.mode,ge=G.level,de=G.tag,_e=G.children,Oe=G.theme,Be=Object(A.a)(G,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Fe=de;return O.createElement(Fe,Object(v.a)({ref:this.childRef},Be),this.renderChildren(_e))}}]),me}(O.Component);tn.defaultProps={tag:"div",className:""};var wn=tn;function Sn(Z){return Z.length?Z.every(function(he){return!!he.props.disabled}):!0}function pn(Z,he,me){var re=Z.getState();Z.setState({activeKey:Object(U.a)(Object(U.a)({},re.activeKey),{},Object(q.a)({},he,me))})}function Ji(Z){return Z.eventKey||"0-menu-"}function mn(Z,he){var me=he,re=Z.children,G=Z.eventKey;if(me){var J;if(Ue(re,function(V,ie){V&&V.props&&!V.props.disabled&&me===Ye(V,G,ie)&&(J=!0)}),J)return me}return me=null,Z.defaultActiveFirst&&Ue(re,function(V,ie){!me&&V&&!V.props.disabled&&(me=Ye(V,G,ie))}),me}function Tr(Z){if(!Z)return;var he=this.instanceArray.indexOf(Z);he!==-1?this.instanceArray[he]=Z:this.instanceArray.push(Z)}var Bn=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(re){var G;return Object(x.a)(this,me),G=he.call(this,re),G.onKeyDown=function(J,V){var ie=J.keyCode,ae;if(G.getFlatInstanceArray().forEach(function(de){de&&de.props.active&&de.onKeyDown&&(ae=de.onKeyDown(J))}),ae)return 1;var ge=null;return(ie===h.a.UP||ie===h.a.DOWN)&&(ge=G.step(ie===h.a.UP?-1:1)),ge?(J.preventDefault(),pn(G.props.store,Ji(G.props),ge.props.eventKey),typeof V=="function"&&V(ge),1):void 0},G.onItemHover=function(J){var V=J.key,ie=J.hover;pn(G.props.store,Ji(G.props),ie?V:null)},G.onDeselect=function(J){G.props.onDeselect(J)},G.onSelect=function(J){G.props.onSelect(J)},G.onClick=function(J){G.props.onClick(J)},G.onOpenChange=function(J){G.props.onOpenChange(J)},G.onDestroy=function(J){G.props.onDestroy(J)},G.getFlatInstanceArray=function(){return G.instanceArray},G.step=function(J){var V=G.getFlatInstanceArray(),ie=G.props.store.getState().activeKey[Ji(G.props)],ae=V.length;if(!ae)return null;J<0&&(V=V.concat().reverse());var ge=-1;if(V.every(function(Be,Fe){return Be&&Be.props.eventKey===ie?(ge=Fe,!1):!0}),!G.props.defaultActiveFirst&&ge!==-1&&Sn(V.slice(ge,ae-1)))return;var de=(ge+1)%ae,_e=de;do{var Oe=V[_e];if(!Oe||Oe.props.disabled)_e=(_e+1)%ae;else return Oe}while(_e!==de);return null},G.renderCommonMenuItem=function(J,V,ie){var ae=G.props.store.getState(),ge=Object(y.a)(G),de=ge.props,_e=Ye(J,de.eventKey,V),Oe=J.props;if(!Oe||typeof J.type=="string")return J;var Be=_e===ae.activeKey,Fe=Object(U.a)(Object(U.a)({mode:Oe.mode||de.mode,level:de.level,inlineIndent:de.inlineIndent,renderMenuItem:G.renderMenuItem,rootPrefixCls:de.prefixCls,index:V,parentMenu:de.parentMenu,manualRef:Oe.disabled?void 0:Object(m.a)(J.ref,Tr.bind(Object(y.a)(G))),eventKey:_e,active:!Oe.disabled&&Be,multiple:de.multiple,onClick:function(ft){(Oe.onClick||Ne)(ft),G.onClick(ft)},onItemHover:G.onItemHover,motion:de.motion,subMenuOpenDelay:de.subMenuOpenDelay,subMenuCloseDelay:de.subMenuCloseDelay,forceSubMenuRender:de.forceSubMenuRender,onOpenChange:G.onOpenChange,onDeselect:G.onDeselect,onSelect:G.onSelect,builtinPlacements:de.builtinPlacements,itemIcon:Oe.itemIcon||G.props.itemIcon,expandIcon:Oe.expandIcon||G.props.expandIcon},ie),{},{direction:de.direction});return(de.mode==="inline"||Ee())&&(Fe.triggerSubMenuAction="click"),O.cloneElement(J,Object(U.a)(Object(U.a)({},Fe),{},{key:_e||V}))},G.renderMenuItem=function(J,V,ie){if(!J)return null;var ae=G.props.store.getState(),ge={openKeys:ae.openKeys,selectedKeys:ae.selectedKeys,triggerSubMenuAction:G.props.triggerSubMenuAction,subMenuKey:ie};return G.renderCommonMenuItem(J,V,ge)},re.store.setState({activeKey:Object(U.a)(Object(U.a)({},re.store.getState().activeKey),{},Object(q.a)({},re.eventKey,mn(re,re.activeKey)))}),G.instanceArray=[],G}return Object(E.a)(me,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(G){return this.props.visible||G.visible||this.props.className!==G.className||!I()(this.props.style,G.style)}},{key:"componentDidUpdate",value:function(G){var J=this.props,V="activeKey"in J?J.activeKey:J.store.getState().activeKey[Ji(J)],ie=mn(J,V);if(ie!==V)pn(J.store,Ji(J),ie);else if("activeKey"in G){var ae=mn(G,G.activeKey);ie!==ae&&pn(J.store,Ji(J),ie)}}},{key:"render",value:function(){var G=this,J=Object(v.a)({},this.props);this.instanceArray=[];var V=H()(J.prefixCls,J.className,"".concat(J.prefixCls,"-").concat(J.mode)),ie={className:V,role:J.role||"menu"};J.id&&(ie.id=J.id),J.focusable&&(ie.tabIndex=0,ie.onKeyDown=this.onKeyDown);var ae=J.prefixCls,ge=J.eventKey,de=J.visible,_e=J.level,Oe=J.mode,Be=J.overflowedIndicator,Fe=J.theme;return Q.forEach(function($e){return delete J[$e]}),delete J.onClick,O.createElement(wn,Object(v.a)({},J,{prefixCls:ae,mode:Oe,tag:"ul",level:_e,theme:Fe,visible:de,overflowedIndicator:Be},ie),Object(F.a)(J.children).map(function($e,ft){return G.renderMenuItem($e,ft,ge||"0-menu-")}))}}]),me}(O.Component);Bn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ne};var xr=Object(l.b)()(Bn),jn=xr,wr=z("Kwbf");function Sr(Z,he,me){var re=Z.prefixCls,G=Z.motion,J=Z.defaultMotions,V=J===void 0?{}:J,ie=Z.openAnimation,ae=Z.openTransitionName,ge=he.switchingModeFromInline;if(G)return G;if(Object(L.a)(ie)==="object"&&ie)Object(wr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ie=="string")return{motionName:"".concat(re,"-open-").concat(ie)};if(ae)return{motionName:ae};var de=V[me];return de||(ge?null:V.other)}var Hn=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(re){var G;Object(x.a)(this,me),G=he.call(this,re),G.onSelect=function(ie){var ae=Object(y.a)(G),ge=ae.props;if(ge.selectable){var de=G.store.getState(),_e=de.selectedKeys,Oe=ie.key;ge.multiple?_e=_e.concat([Oe]):_e=[Oe],"selectedKeys"in ge||G.store.setState({selectedKeys:_e}),ge.onSelect(Object(U.a)(Object(U.a)({},ie),{},{selectedKeys:_e}))}},G.onClick=function(ie){var ae=G.getRealMenuMode(),ge=Object(y.a)(G),de=ge.store,_e=ge.props.onOpenChange;ae!=="inline"&&!("openKeys"in G.props)&&(de.setState({openKeys:[]}),_e([])),G.props.onClick(ie)},G.onKeyDown=function(ie,ae){G.innerMenu.getWrappedInstance().onKeyDown(ie,ae)},G.onOpenChange=function(ie){var ae=Object(y.a)(G),ge=ae.props,de=G.store.getState().openKeys.concat(),_e=!1,Oe=function(Fe){var $e=!1;if(Fe.open)$e=de.indexOf(Fe.key)===-1,$e&&de.push(Fe.key);else{var ft=de.indexOf(Fe.key);$e=ft!==-1,$e&&de.splice(ft,1)}_e=_e||$e};Array.isArray(ie)?ie.forEach(Oe):Oe(ie),_e&&("openKeys"in G.props||G.store.setState({openKeys:de}),ge.onOpenChange(de))},G.onDeselect=function(ie){var ae=Object(y.a)(G),ge=ae.props;if(ge.selectable){var de=G.store.getState().selectedKeys.concat(),_e=ie.key,Oe=de.indexOf(_e);Oe!==-1&&de.splice(Oe,1),"selectedKeys"in ge||G.store.setState({selectedKeys:de}),ge.onDeselect(Object(U.a)(Object(U.a)({},ie),{},{selectedKeys:de}))}},G.onMouseEnter=function(ie){G.restoreModeVerticalFromInline();var ae=G.props.onMouseEnter;ae&&ae(ie)},G.onTransitionEnd=function(ie){var ae=ie.propertyName==="width"&&ie.target===ie.currentTarget,ge=ie.target.className,de=Object.prototype.toString.call(ge)==="[object SVGAnimatedString]"?ge.animVal:ge,_e=ie.propertyName==="font-size"&&de.indexOf("anticon")>=0;(ae||_e)&&G.restoreModeVerticalFromInline()},G.setInnerMenu=function(ie){G.innerMenu=ie},G.isRootMenu=!0;var J=re.defaultSelectedKeys,V=re.defaultOpenKeys;return"selectedKeys"in re&&(J=re.selectedKeys||[]),"openKeys"in re&&(V=re.openKeys||[]),G.store=Object(l.c)({selectedKeys:J,openKeys:V,activeKey:{"0-menu-":mn(re,re.activeKey)}}),G.state={switchingModeFromInline:!1,prevProps:re,inlineOpenKeys:[],store:G.store},G}return Object(E.a)(me,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(G){var J=this.props,V=J.siderCollapsed,ie=J.inlineCollapsed,ae=J.onOpenChange;(!G.inlineCollapsed&&ie||!G.siderCollapsed&&V)&&ae([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var G=this.props.collapsedWidth,J=this.store,V=this.prevOpenKeys,ie=this.getInlineCollapsed()&&(G===0||G==="0"||G==="0px");ie?(this.prevOpenKeys=J.getState().openKeys.concat(),this.store.setState({openKeys:[]})):V&&(this.store.setState({openKeys:V}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var G=this.props.mode,J=this.state.switchingModeFromInline,V=this.getInlineCollapsed();return J&&V?"inline":V?"vertical":G}},{key:"getInlineCollapsed",value:function(){var G=this.props,J=G.inlineCollapsed,V=G.siderCollapsed;return V!==void 0?V:J}},{key:"restoreModeVerticalFromInline",value:function(){var G=this.state.switchingModeFromInline;G&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var G=Object(U.a)({},Object(b.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),J=this.getRealMenuMode();return G.className+=" ".concat(G.prefixCls,"-root"),G.direction==="rtl"&&(G.className+=" ".concat(G.prefixCls,"-rtl")),G=Object(U.a)(Object(U.a)({},G),{},{mode:J,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Sr(this.props,this.state,J)}),delete G.openAnimation,delete G.openTransitionName,O.createElement(l.a,{store:this.store},O.createElement(jn,Object(v.a)({},G,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(G,J){var V=J.prevProps,ie=J.store,ae=ie.getState(),ge={},de={prevProps:G};return V.mode==="inline"&&G.mode!=="inline"&&(de.switchingModeFromInline=!0),"openKeys"in G?ge.openKeys=G.openKeys||[]:((G.inlineCollapsed&&!V.inlineCollapsed||G.siderCollapsed&&!V.siderCollapsed)&&(de.switchingModeFromInline=!0,de.inlineOpenKeys=ae.openKeys,ge.openKeys=[]),(!G.inlineCollapsed&&V.inlineCollapsed||!G.siderCollapsed&&V.siderCollapsed)&&(ge.openKeys=J.inlineOpenKeys,de.inlineOpenKeys=[])),Object.keys(ge).length&&ie.setState(ge),de}}]),me}(O.Component);Hn.defaultProps={selectable:!0,onClick:Ne,onSelect:Ne,onOpenChange:Ne,onDeselect:Ne,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:O.createElement("span",null,"\xB7\xB7\xB7")};var Or=Hn,On=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(){var re;return Object(x.a)(this,me),re=he.apply(this,arguments),re.onKeyDown=function(G){var J=G.keyCode;return J===h.a.ENTER?(re.onClick(G),!0):void 0},re.onMouseLeave=function(G){var J=re.props,V=J.eventKey,ie=J.onItemHover,ae=J.onMouseLeave;ie({key:V,hover:!1}),ae({key:V,domEvent:G})},re.onMouseEnter=function(G){var J=re.props,V=J.eventKey,ie=J.onItemHover,ae=J.onMouseEnter;ie({key:V,hover:!0}),ae({key:V,domEvent:G})},re.onClick=function(G){var J=re.props,V=J.eventKey,ie=J.multiple,ae=J.onClick,ge=J.onSelect,de=J.onDeselect,_e=J.isSelected,Oe={key:V,keyPath:[V],item:Object(y.a)(re),domEvent:G};ae(Oe),ie?_e?de(Oe):ge(Oe):_e||ge(Oe)},re.saveNode=function(G){re.node=G},re}return Object(E.a)(me,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var G=this.props;G.onDestroy&&G.onDestroy(G.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var G,J=Object(U.a)({},this.props),V=H()(this.getPrefixCls(),J.className,(G={},Object(q.a)(G,this.getActiveClassName(),!J.disabled&&J.active),Object(q.a)(G,this.getSelectedClassName(),J.isSelected),Object(q.a)(G,this.getDisabledClassName(),J.disabled),G)),ie=Object(U.a)(Object(U.a)({},J.attribute),{},{title:typeof J.title=="string"?J.title:void 0,className:V,role:J.role||"menuitem","aria-disabled":J.disabled});J.role==="option"?ie=Object(U.a)(Object(U.a)({},ie),{},{role:"option","aria-selected":J.isSelected}):(J.role===null||J.role==="none")&&(ie.role="none");var ae={onClick:J.disabled?null:this.onClick,onMouseLeave:J.disabled?null:this.onMouseLeave,onMouseEnter:J.disabled?null:this.onMouseEnter},ge=Object(U.a)({},J.style);J.mode==="inline"&&(J.direction==="rtl"?ge.paddingRight=J.inlineIndent*J.level:ge.paddingLeft=J.inlineIndent*J.level),Q.forEach(function(_e){return delete J[_e]}),delete J.direction;var de=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(de=O.createElement(this.props.itemIcon,this.props)),O.createElement("li",Object(v.a)({},Object(b.a)(J,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ie,ae,{style:ge,ref:this.saveNode}),J.children,de)}}]),me}(O.Component);On.isMenuItem=!0,On.defaultProps={onSelect:Ne,onMouseEnter:Ne,onMouseLeave:Ne,manualRef:Ne};var Cr=Object(l.b)(function(Z,he){var me=Z.activeKey,re=Z.selectedKeys,G=he.eventKey,J=he.subMenuKey;return{active:me[J]===G,isSelected:Array.isArray(re)?re.indexOf(G)!==-1:re===G}})(On),Ar=Cr,Cn=function(Z){Object(c.a)(me,Z);var he=Object(u.a)(me);function me(){var re;return Object(x.a)(this,me),re=he.apply(this,arguments),re.renderInnerMenuItem=function(G){var J=re.props,V=J.renderMenuItem,ie=J.index;return V(G,ie,re.props.subMenuKey)},re}return Object(E.a)(me,[{key:"render",value:function(){var G=Object(v.a)({},this.props),J=G.className,V=J===void 0?"":J,ie=G.rootPrefixCls,ae="".concat(ie,"-item-group-title"),ge="".concat(ie,"-item-group-list"),de=G.title,_e=G.children;return Q.forEach(function(Oe){return delete G[Oe]}),delete G.direction,O.createElement("li",Object(v.a)({},G,{onClick:function(Be){return Be.stopPropagation()},className:"".concat(V," ").concat(ie,"-item-group")}),O.createElement("div",{className:ae,title:typeof de=="string"?de:void 0},de),O.createElement("ul",{className:ge},O.Children.map(_e,this.renderInnerMenuItem)))}}]),me}(O.Component);Cn.isMenuItemGroup=!0,Cn.defaultProps={disabled:!0};var fa=Cn,Wn=function(he){var me=he.className,re=he.rootPrefixCls,G=he.style;return O.createElement("li",{className:"".concat(me," ").concat(re,"-item-divider"),style:G})};Wn.defaultProps={disabled:!0,className:"",style:{}};var pa=Wn,Rr=Or,Ir=z("eDIo");function Lr(Z,he){var me=Z.prefixCls,re=Z.editable,G=Z.locale,J=Z.style;return!re||re.showAdd===!1?null:O.createElement("button",{ref:he,type:"button",className:"".concat(me,"-nav-add"),style:J,"aria-label":(G==null?void 0:G.addAriaLabel)||"Add tab",onClick:function(ie){re.onEdit("add",{event:ie})}},re.addIcon||"+")}var Kn=O.forwardRef(Lr);function Dr(Z,he){var me=Z.prefixCls,re=Z.id,G=Z.tabs,J=Z.locale,V=Z.mobile,ie=Z.moreIcon,ae=ie===void 0?"More":ie,ge=Z.moreTransitionName,de=Z.style,_e=Z.className,Oe=Z.editable,Be=Z.tabBarGutter,Fe=Z.rtl,$e=Z.onTabClick,ft=Object(O.useState)(!1),Tt=Object(j.a)(ft,2),vt=Tt[0],St=Tt[1],xt=Object(O.useState)(null),_t=Object(j.a)(xt,2),Et=_t[0],It=_t[1],Ot="".concat(re,"-more-popup"),Jt="".concat(me,"-dropdown"),Ut=Et!==null?"".concat(Ot,"-").concat(Et):null,ct=J==null?void 0:J.dropdownAriaLabel,ot=O.createElement(Rr,{onClick:function(jt){var Xt=jt.key,ci=jt.domEvent;$e(Xt,ci),St(!1)},id:Ot,tabIndex:-1,role:"listbox","aria-activedescendant":Ut,selectedKeys:[Et],"aria-label":ct!==void 0?ct:"expanded dropdown"},G.map(function(Dt){return O.createElement(Ar,{key:Dt.key,id:"".concat(Ot,"-").concat(Dt.key),role:"option","aria-controls":re&&"".concat(re,"-panel-").concat(Dt.key),disabled:Dt.disabled},Dt.tab)}));function Ct(Dt){for(var jt=G.filter(function(bi){return!bi.disabled}),Xt=jt.findIndex(function(bi){return bi.key===Et})||0,ci=jt.length,yi=0;yi<ci;yi+=1){Xt=(Xt+Dt+ci)%ci;var Qt=jt[Xt];if(!Qt.disabled){It(Qt.key);return}}}function Rt(Dt){var jt=Dt.which;if(!vt){[h.a.DOWN,h.a.SPACE,h.a.ENTER].includes(jt)&&(St(!0),Dt.preventDefault());return}switch(jt){case h.a.UP:Ct(-1),Dt.preventDefault();break;case h.a.DOWN:Ct(1),Dt.preventDefault();break;case h.a.ESC:St(!1);break;case h.a.SPACE:case h.a.ENTER:Et!==null&&$e(Et,Dt);break}}Object(O.useEffect)(function(){var Dt=document.getElementById(Ut);Dt&&Dt.scrollIntoView&&Dt.scrollIntoView(!1)},[Et]),Object(O.useEffect)(function(){vt||It(null)},[vt]);var tt=Object(q.a)({},Fe?"marginLeft":"marginRight",Be);G.length||(tt.visibility="hidden",tt.order=1);var Lt=H()(Object(q.a)({},"".concat(Jt,"-rtl"),Fe)),Gt=V?null:O.createElement(Ir.a,{prefixCls:Jt,overlay:ot,trigger:["hover"],visible:vt,transitionName:ge,onVisibleChange:St,overlayClassName:Lt,mouseEnterDelay:.1,mouseLeaveDelay:.1},O.createElement("button",{type:"button",className:"".concat(me,"-nav-more"),style:tt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Ot,id:"".concat(re,"-more"),"aria-expanded":vt,onKeyDown:Rt},ae));return O.createElement("div",{className:H()("".concat(me,"-nav-operations"),_e),style:de,ref:he},Gt,O.createElement(Kn,{prefixCls:me,locale:J,editable:Oe}))}var Mr=O.forwardRef(Dr),An=Object(O.createContext)(null),Pr=.1,Gn=.01,gn=20,zn=Math.pow(.995,gn);function kr(){var Z=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Z)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Z.substr(0,4)))}function Nr(Z,he){var me=Object(O.useState)(),re=Object(j.a)(me,2),G=re[0],J=re[1],V=Object(O.useState)(0),ie=Object(j.a)(V,2),ae=ie[0],ge=ie[1],de=Object(O.useState)(0),_e=Object(j.a)(de,2),Oe=_e[0],Be=_e[1],Fe=Object(O.useState)(),$e=Object(j.a)(Fe,2),ft=$e[0],Tt=$e[1],vt=Object(O.useRef)();function St(ct){var ot=ct.touches[0],Ct=ot.screenX,Rt=ot.screenY;J({x:Ct,y:Rt}),window.clearInterval(vt.current)}function xt(ct){if(!G)return;ct.preventDefault();var ot=ct.touches[0],Ct=ot.screenX,Rt=ot.screenY;J({x:Ct,y:Rt});var tt=Ct-G.x,Lt=Rt-G.y;he(tt,Lt);var Gt=Date.now();ge(Gt),Be(Gt-ae),Tt({x:tt,y:Lt})}function _t(){if(!G)return;if(J(null),Tt(null),ft){var ct=ft.x/Oe,ot=ft.y/Oe,Ct=Math.abs(ct),Rt=Math.abs(ot);if(Math.max(Ct,Rt)<Pr)return;var tt=ct,Lt=ot;vt.current=window.setInterval(function(){if(Math.abs(tt)<Gn&&Math.abs(Lt)<Gn){window.clearInterval(vt.current);return}tt*=zn,Lt*=zn,he(tt*gn,Lt*gn)},gn)}}var Et=Object(O.useRef)(0),It=Object(O.useRef)(!1),Ot=Object(O.useRef)();function Jt(ct){var ot=ct.deltaX,Ct=ct.deltaY,Rt=0,tt=Math.abs(ot),Lt=Math.abs(Ct);tt===Lt?Rt=Ot.current==="x"?ot:Ct:tt>Lt?(Rt=ot,Ot.current="x"):(Rt=Ct,Ot.current="y");var Gt=Date.now();Gt-Et.current>100&&(It.current=!1),(he(-Rt,-Rt)||It.current)&&(ct.preventDefault(),It.current=!0),Et.current=Gt}var Ut=Object(O.useRef)(null);Ut.current={onTouchStart:St,onTouchMove:xt,onTouchEnd:_t,onWheel:Jt},O.useEffect(function(){function ct(tt){Ut.current.onTouchStart(tt)}function ot(tt){Ut.current.onTouchMove(tt)}function Ct(tt){Ut.current.onTouchEnd(tt)}function Rt(tt){Ut.current.onWheel(tt)}return document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Ct,{passive:!1}),Z.current.addEventListener("touchstart",ct,{passive:!1}),Z.current.addEventListener("wheel",Rt),function(){document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Ct)}},[])}function Ur(){var Z=Object(O.useRef)(new Map);function he(re){return Z.current.has(re)||Z.current.set(re,O.createRef()),Z.current.get(re)}function me(re){Z.current.delete(re)}return[he,me]}function Vn(Z,he){var me=O.useRef(Z),re=O.useState({}),G=Object(j.a)(re,2),J=G[1];function V(ie){var ae=typeof ie=="function"?ie(me.current):ie;ae!==me.current&&he(ae,me.current),me.current=ae,J({})}return[me.current,V]}var Yn=function(he){var me=he.position,re=he.prefixCls,G=he.extra;if(!G)return null;var J,V=G;return me==="right"&&(J=V.right||!V.left&&V||null),me==="left"&&(J=V.left||null),J?O.createElement("div",{className:"".concat(re,"-extra-content")},J):null};function Fr(Z,he){var me,re=O.useContext(An),G=re.prefixCls,J=re.tabs,V=Z.className,ie=Z.style,ae=Z.id,ge=Z.animated,de=Z.activeKey,_e=Z.rtl,Oe=Z.extra,Be=Z.editable,Fe=Z.locale,$e=Z.tabPosition,ft=Z.tabBarGutter,Tt=Z.children,vt=Z.onTabClick,St=Z.onTabScroll,xt=Object(O.useRef)(),_t=Object(O.useRef)(),Et=Object(O.useRef)(),It=Object(O.useRef)(),Ot=Ur(),Jt=Object(j.a)(Ot,2),Ut=Jt[0],ct=Jt[1],ot=$e==="top"||$e==="bottom",Ct=Vn(0,function(Ft,At){ot&&St&&St({direction:Ft>At?"left":"right"})}),Rt=Object(j.a)(Ct,2),tt=Rt[0],Lt=Rt[1],Gt=Vn(0,function(Ft,At){!ot&&St&&St({direction:Ft>At?"top":"bottom"})}),Dt=Object(j.a)(Gt,2),jt=Dt[0],Xt=Dt[1],ci=Object(O.useState)(0),yi=Object(j.a)(ci,2),Qt=yi[0],bi=yi[1],Ai=Object(O.useState)(0),Ei=Object(j.a)(Ai,2),Ti=Ei[0],ti=Ei[1],gi=Object(O.useState)(0),di=Object(j.a)(gi,2),ai=di[0],Di=di[1],Mi=Object(O.useState)(0),ji=Object(j.a)(Mi,2),Wt=ji[0],Ii=ji[1],Hi=Object(O.useState)(null),zt=Object(j.a)(Hi,2),Nt=zt[0],fi=zt[1],Kr=Object(O.useState)(null),Zn=Object(j.a)(Kr,2),Qi=Zn[0],Gr=Zn[1],zr=Object(O.useState)(0),qn=Object(j.a)(zr,2),Vr=qn[0],Yr=qn[1],Xr=Object(O.useState)(0),er=Object(j.a)(Xr,2),$r=er[0],Jr=er[1],Qr=r(new Map),tr=Object(j.a)(Qr,2),Zr=tr[0],qr=tr[1],vn=t(J,Zr,Qt),ir="".concat(G,"-nav-operations-hidden"),nn=0,rn=0;ot?_e?(nn=0,rn=Math.max(0,Qt-Nt)):(nn=Math.min(0,Nt-Qt),rn=0):(nn=Math.min(0,Qi-Ti),rn=0);function Rn(Ft){return Ft<nn?[nn,!1]:Ft>rn?[rn,!1]:[Ft,!0]}var nr=Object(O.useRef)(),ea=Object(O.useState)(),rr=Object(j.a)(ea,2),In=rr[0],ar=rr[1];function Ln(){ar(Date.now())}function Dn(){window.clearTimeout(nr.current)}Nr(xt,function(Ft,At){var si=!1;function xi(sn,on){sn(function(ln){var un=Rn(ln+on),Zi=Object(j.a)(un,2),Nn=Zi[0],Un=Zi[1];return si=Un,Nn})}if(ot){if(Nt>=Qt)return si;xi(Lt,Ft)}else{if(Qi>=Ti)return si;xi(Xt,At)}return Dn(),Ln(),si}),Object(O.useEffect)(function(){return Dn(),In&&(nr.current=window.setTimeout(function(){ar(0)},100)),Dn},[In]);function sr(){var Ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:de,At=vn.get(Ft);if(!At)return;if(ot){var si=tt;_e?At.right<tt?si=At.right:At.right+At.width>tt+Nt&&(si=At.right+At.width-Nt):At.left<-tt?si=-At.left:At.left+At.width>-tt+Nt&&(si=-(At.left+At.width-Nt)),Xt(0),Lt(Rn(si)[0])}else{var xi=jt;At.top<-jt?xi=-At.top:At.top+At.height>-jt+Qi&&(xi=-(At.top+At.height-Qi)),Lt(0),Xt(Rn(xi)[0])}}var ta=g(vn,{width:Nt,height:Qi,left:tt,top:jt},{width:ai,height:Wt},{width:Vr,height:$r},Object(U.a)(Object(U.a)({},Z),{},{tabs:J})),or=Object(j.a)(ta,2),ia=or[0],na=or[1],ra=J.map(function(Ft){var At=Ft.key;return O.createElement(n,{id:ae,prefixCls:G,key:At,rtl:_e,tab:Ft,closable:Ft.closable,editable:Be,active:At===de,tabPosition:$e,tabBarGutter:ft,renderWrapper:Tt,removeAriaLabel:Fe==null?void 0:Fe.removeAriaLabel,ref:Ut(At),onClick:function(xi){vt(At,xi)},onRemove:function(){ct(At)},onFocus:function(){sr(At),Ln(),_e||(xt.current.scrollLeft=0),xt.current.scrollTop=0}})}),Mn=a(function(){var Ft,At,si,xi,sn,on,ln,un,Zi,Nn=((Ft=xt.current)===null||Ft===void 0?void 0:Ft.offsetWidth)||0,Un=((At=xt.current)===null||At===void 0?void 0:At.offsetHeight)||0,mr=((si=It.current)===null||si===void 0?void 0:si.offsetWidth)||0,gr=((xi=It.current)===null||xi===void 0?void 0:xi.offsetHeight)||0,ha=((sn=Et.current)===null||sn===void 0?void 0:sn.offsetWidth)||0,ca=((on=Et.current)===null||on===void 0?void 0:on.offsetHeight)||0;fi(Nn),Gr(Un),Yr(mr),Jr(gr);var vr=(((ln=_t.current)===null||ln===void 0?void 0:ln.offsetWidth)||0)-mr,yr=(((un=_t.current)===null||un===void 0?void 0:un.offsetHeight)||0)-gr;bi(vr),ti(yr);var br=(Zi=Et.current)===null||Zi===void 0?void 0:Zi.className.includes(ir);Di(vr-(br?0:ha)),Ii(yr-(br?0:ca)),qr(function(){var _r=new Map;return J.forEach(function(da){var Er=da.key,hn=Ut(Er).current;hn&&_r.set(Er,{width:hn.offsetWidth,height:hn.offsetHeight,left:hn.offsetLeft,top:hn.offsetTop})}),_r})}),aa=J.slice(0,ia),sa=J.slice(na+1),lr=[].concat(Object(C.a)(aa),Object(C.a)(sa)),oa=Object(O.useState)(),ur=Object(j.a)(oa,2),la=ur[0],ua=ur[1],Pi=vn.get(de),hr=Object(O.useRef)();function cr(){p.a.cancel(hr.current)}Object(O.useEffect)(function(){var Ft={};return Pi&&(ot?(_e?Ft.right=Pi.right:Ft.left=Pi.left,Ft.width=Pi.width):(Ft.top=Pi.top,Ft.height=Pi.height)),cr(),hr.current=p()(function(){ua(Ft)}),cr},[Pi,ot,_e]),Object(O.useEffect)(function(){sr()},[de,Pi,vn,ot]),Object(O.useEffect)(function(){Mn()},[_e,ft,de,J.map(function(Ft){return Ft.key}).join("_")]);var dr=!!lr.length,an="".concat(G,"-nav-wrap"),Pn,kn,fr,pr;return ot?_e?(kn=tt>0,Pn=tt+Nt<Qt):(Pn=tt<0,kn=-tt+Nt<Qt):(fr=jt<0,pr=-jt+Qi<Ti),O.createElement("div",{ref:he,role:"tablist",className:H()("".concat(G,"-nav"),V),style:ie,onKeyDown:function(){Ln()}},O.createElement(Yn,{position:"left",extra:Oe,prefixCls:G}),O.createElement(o.a,{onResize:Mn},O.createElement("div",{className:H()(an,(me={},Object(q.a)(me,"".concat(an,"-ping-left"),Pn),Object(q.a)(me,"".concat(an,"-ping-right"),kn),Object(q.a)(me,"".concat(an,"-ping-top"),fr),Object(q.a)(me,"".concat(an,"-ping-bottom"),pr),me)),ref:xt},O.createElement(o.a,{onResize:Mn},O.createElement("div",{ref:_t,className:"".concat(G,"-nav-list"),style:{transform:"translate(".concat(tt,"px, ").concat(jt,"px)"),transition:In?"none":void 0}},ra,O.createElement(Kn,{ref:It,prefixCls:G,locale:Fe,editable:Be,style:{visibility:dr?"hidden":null}}),O.createElement("div",{className:H()("".concat(G,"-ink-bar"),Object(q.a)({},"".concat(G,"-ink-bar-animated"),ge.inkBar)),style:la}))))),O.createElement(Mr,Object.assign({},Z,{ref:Et,prefixCls:G,tabs:lr,className:!dr&&ir})),O.createElement(Yn,{position:"right",extra:Oe,prefixCls:G}))}var Xn=O.forwardRef(Fr);function Br(Z){var he=Z.id,me=Z.activeKey,re=Z.animated,G=Z.tabPosition,J=Z.rtl,V=Z.destroyInactiveTabPane,ie=O.useContext(An),ae=ie.prefixCls,ge=ie.tabs,de=re.tabPane,_e=ge.findIndex(function(Oe){return Oe.key===me});return O.createElement("div",{className:H()("".concat(ae,"-content-holder"))},O.createElement("div",{className:H()("".concat(ae,"-content"),"".concat(ae,"-content-").concat(G),Object(q.a)({},"".concat(ae,"-content-animated"),de)),style:_e&&de?Object(q.a)({},J?"marginRight":"marginLeft","-".concat(_e,"00%")):null},ge.map(function(Oe){return O.cloneElement(Oe.node,{key:Oe.key,prefixCls:ae,tabKey:Oe.key,id:he,animated:de,active:Oe.key===me,destroyInactiveTabPane:V})})))}function $n(Z){var he=Z.prefixCls,me=Z.forceRender,re=Z.className,G=Z.style,J=Z.id,V=Z.active,ie=Z.animated,ae=Z.destroyInactiveTabPane,ge=Z.tabKey,de=Z.children,_e=O.useState(me),Oe=Object(j.a)(_e,2),Be=Oe[0],Fe=Oe[1];O.useEffect(function(){V?Fe(!0):ae&&Fe(!1)},[V,ae]);var $e={};return V||(ie?($e.visibility="hidden",$e.height=0,$e.overflowY="hidden"):$e.display="none"),O.createElement("div",{id:J&&"".concat(J,"-panel-").concat(ge),role:"tabpanel",tabIndex:V?0:-1,"aria-labelledby":J&&"".concat(J,"-tab-").concat(ge),"aria-hidden":!V,style:Object(U.a)(Object(U.a)({},$e),G),className:H()("".concat(he,"-tabpane"),V&&"".concat(he,"-tabpane-active"),re)},(V||Be||me)&&de)}var Jn=0;function jr(Z){return Object(F.a)(Z).map(function(he){if(O.isValidElement(he)){var me=he.key!==void 0?String(he.key):void 0;return Object(U.a)(Object(U.a)({key:me},he.props),{},{node:he})}return null}).filter(function(he){return he})}function Hr(Z,he){var me,re=Z.id,G=Z.prefixCls,J=G===void 0?"rc-tabs":G,V=Z.className,ie=Z.children,ae=Z.direction,ge=Z.activeKey,de=Z.defaultActiveKey,_e=Z.editable,Oe=Z.animated,Be=Z.tabPosition,Fe=Be===void 0?"top":Be,$e=Z.tabBarGutter,ft=Z.tabBarStyle,Tt=Z.tabBarExtraContent,vt=Z.locale,St=Z.moreIcon,xt=Z.moreTransitionName,_t=Z.destroyInactiveTabPane,Et=Z.renderTabBar,It=Z.onChange,Ot=Z.onTabClick,Jt=Z.onTabScroll,Ut=Object(A.a)(Z,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),ct=jr(ie),ot=ae==="rtl",Ct;Oe===!1?Ct={inkBar:!1,tabPane:!1}:Ct=Object(U.a)({inkBar:!0,tabPane:!1},Oe!==!0?Oe:null);var Rt=Object(O.useState)(!1),tt=Object(j.a)(Rt,2),Lt=tt[0],Gt=tt[1];Object(O.useEffect)(function(){Gt(kr())},[]);var Dt=Object(e.a)(function(){var Wt;return(Wt=ct[0])===null||Wt===void 0?void 0:Wt.key},{value:ge,defaultValue:de}),jt=Object(j.a)(Dt,2),Xt=jt[0],ci=jt[1],yi=Object(O.useState)(function(){return ct.findIndex(function(Wt){return Wt.key===Xt})}),Qt=Object(j.a)(yi,2),bi=Qt[0],Ai=Qt[1];Object(O.useEffect)(function(){var Wt=ct.findIndex(function(Hi){return Hi.key===Xt});if(Wt===-1){var Ii;Wt=Math.max(0,Math.min(bi,ct.length-1)),ci((Ii=ct[Wt])===null||Ii===void 0?void 0:Ii.key)}Ai(Wt)},[ct.map(function(Wt){return Wt.key}).join("_"),Xt,bi]);var Ei=Object(e.a)(null,{value:re}),Ti=Object(j.a)(Ei,2),ti=Ti[0],gi=Ti[1],di=Fe;Lt&&!["left","right"].includes(Fe)&&(di="top"),Object(O.useEffect)(function(){re||(gi("rc-tabs-".concat(Jn)),Jn+=1)},[]);function ai(Wt,Ii){Ot==null||Ot(Wt,Ii),ci(Wt),It==null||It(Wt)}var Di={id:ti,activeKey:Xt,animated:Ct,tabPosition:di,rtl:ot,mobile:Lt},Mi,ji=Object(U.a)(Object(U.a)({},Di),{},{editable:_e,locale:vt,moreIcon:St,moreTransitionName:xt,tabBarGutter:$e,onTabClick:ai,onTabScroll:Jt,extra:Tt,style:ft,panes:ie});return Et?Mi=Et(ji,Xn):Mi=O.createElement(Xn,Object.assign({},ji)),O.createElement(An.Provider,{value:{tabs:ct,prefixCls:J}},O.createElement("div",Object.assign({ref:he,id:re,className:H()(J,"".concat(J,"-").concat(di),(me={},Object(q.a)(me,"".concat(J,"-mobile"),Lt),Object(q.a)(me,"".concat(J,"-editable"),_e),Object(q.a)(me,"".concat(J,"-rtl"),ot),me),V)},Ut),Mi,O.createElement(Br,Object.assign({destroyInactiveTabPane:_t},Di,{animated:Ct}))))}var Qn=O.forwardRef(Hr);Qn.TabPane=$n;var Wr=Qn,ma=ve.b=Wr},kUb9:function(st,ve,z){"use strict";z.r(ve);var q=z("DjyN"),j=z("NUBc"),A=z("Znn+"),U=z("ZTPi"),O=z("+L6B"),M=z("2/Rp"),H=z("sPJy"),F=z("bE4q"),e=z("9og8"),C=z("k1fw"),f=z("tJVT"),p=z("WmNS"),o=z.n(p),a=z("q1tI"),r=z.n(a),h=z("Ty5D"),s=z("55Ip"),n=z("9kvl"),i=z("xKgJ"),t=z("ErOA"),_=z("BdwD"),g=z("INg4"),v=z.n(g),x=z("479L"),E=z.n(x),y=z("/zsF"),c=z("PArb"),u=z("rAM+"),l=z("9Bee"),b=z("m3rI"),m=function(D){var B,R=D.user,W=D.item,Y=D.getdata,se=D.params,ne=Object(a.useRef)(),Se=Object(a.useState)(),xe=Object(f.a)(Se,2),we=xe[0],Re=xe[1],Pe=Object(a.useState)(!0),ye=Object(f.a)(Pe,2),ee=ye[0],je=ye[1];return Object(a.useEffect)(function(){if(!ne.current)return;function et(){var Ne,Ye=new ResizeObserver(function(Ae){var Ue=Object(u.a)(Ae),Ve;try{for(Ue.s();!(Ve=Ue.n()).done;){var Q=Ve.value;console.log("----",Q,Ae),Re(Q.target.offsetHeight>=52)}}catch(fe){Ue.e(fe)}finally{Ue.f()}});return Ye.observe((Ne=ne.current)===null||Ne===void 0?void 0:Ne.firstElementChild),Ye}var He=et();return function(){var Ne,Ye;((Ne=ne.current)===null||Ne===void 0?void 0:Ne.firstElementChild)&&He.unobserve((Ye=ne.current)===null||Ye===void 0?void 0:Ye.firstElementChild)}},[ne.current]),r.a.createElement("div",{onClick:function(){n.d.push("/classrooms/".concat(se.coursesId,"/program_homework/").concat(se.categoryId,"/answer/").concat(W.id,"/detail"))},style:{marginTop:30,padding:"0px 20px",cursor:"pointer"}},r.a.createElement("div",{className:v.a.titles,style:{fontWeight:600,fontSize:18,color:"#000000"}},W.name),r.a.createElement("div",{style:{display:"flex",marginTop:10}},r.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",color:"#5F6368"}},r.a.createElement("img",{style:{width:24,borderRadius:50},src:"".concat(b.a.IMG_SERVER,"/images/").concat(W.author.image_url)}),r.a.createElement("span",{style:{margin:"0px 12px 0px 8px"}},W==null||((B=W.author)===null||B===void 0)?void 0:B.name),r.a.createElement("span",null,"\u53D1\u8868\u4E8E",W.created_at)),r.a.createElement("div",null,r.a.createElement("span",{style:{color:"#5F6368",cursor:"pointer"},onClick:function(){}},"\u56DE\u590D\uFF08",(W==null?void 0:W.descendants_count)||0,"\uFF09"),Object(i.j)()&&r.a.createElement("span",{onClick:function(){var et=Object(e.a)(o.a.mark(function He(Ne){var Ye;return o.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ne.stopPropagation(),Ue.next=3,Object(t.a)("/api/hack_messages/".concat(W.id,"/update_public"),{method:"post"});case 3:Ye=Ue.sent,Ye.status===0&&Y();case 5:case"end":return Ue.stop()}},He)}));return function(He){return et.apply(this,arguments)}}(),style:{color:"#44D7B6",cursor:"pointer",marginLeft:20}},W.is_public?"\u53D6\u6D88\u516C\u5F00":"\u516C\u5F00"))),r.a.createElement("div",{ref:ne,style:{margin:"15px 0px",maxHeight:ee?52:"",overflow:"hidden"}},r.a.createElement(l.a,{style:{color:"#434D6C",fontSize:14},value:W.content})),(W==null?void 0:W.hack_identifier)&&r.a.createElement("span",{onClick:function(){var et=Object(e.a)(o.a.mark(function He(Ne){var Ye,Ae;return o.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(Ne.stopPropagation(),!Object(i.s)()){Ve.next=3;break}return Ve.abrupt("return");case 3:return Ve.next=5,Object(t.a)("/api/problems/".concat(W==null?void 0:W.hack_identifier,"/start.json"),{method:"get",params:{hack_user_id:W==null||((Ye=W.author)===null||Ye===void 0)?void 0:Ye.id}});case 5:Ae=Ve.sent,Ae&&(window.open("/myproblems/".concat(Ae==null?void 0:Ae.identifier,"?type=1")),localStorage.setItem("program_homework",[se.coursesId,se.categoryId]));case 7:case"end":return Ve.stop()}},He)}));return function(He){return et.apply(this,arguments)}}(),className:v.a.tips},W==null?void 0:W.hack_name),we&&r.a.createElement("div",{onClick:function(He){He.stopPropagation(),je(!ee)}},r.a.createElement(c.a,{dashed:!1,className:"",style:{cursor:"pointer"}},r.a.createElement("a",{className:"font14 ".concat(v.a.color999)},ee?"\u9605\u8BFB\u5168\u6587 ":"\u6536\u8D77\u5168\u6587 ",r.a.createElement("i",{className:"iconfont font14 ".concat(ee?"icon-jiantou9":"icon-changyongtubiao-xianxingdaochu-zhuanqu-")})))))},w=Object(n.a)(function(S){var D=S.user;return{user:D}})(m),I=function(D){var B,R,W,Y,se=D.user,ne=Object(a.useState)(Object(C.a)(Object(C.a)({},Object(h.i)()),{},{page:1,per_page:10,type:1,sort_by:"",course_group:Object(i.s)()?[se.userInfo.course.course_group_id]:[]})),Se=Object(f.a)(ne,2),xe=Se[0],we=Se[1],Re=Object(a.useState)([]),Pe=Object(f.a)(Re,2),ye=Pe[0],ee=Pe[1];Object(a.useEffect)(function(){je()},[]);function je(){return et.apply(this,arguments)}function et(){return et=Object(e.a)(o.a.mark(function He(){var Ne;return o.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:return Ae.next=2,Object(t.a)("/api/homework_commons/".concat(xe.categoryId,"/hack_messages"),{method:"get",params:Object(C.a)(Object(C.a)({},xe),{},{type:1})});case 2:Ne=Ae.sent,ee(Ne);case 4:case"end":return Ae.stop()}},He)})),et.apply(this,arguments)}return r.a.createElement("div",{style:{width:1200,margin:"0px auto"}},r.a.createElement(F.a,{separator:">",style:{marginTop:20}},r.a.createElement(F.a.Item,null,r.a.createElement(s.a,{to:"/classrooms/".concat(ye==null?void 0:ye.course_id,"/program_homework")},ye==null?void 0:ye.course_name)),r.a.createElement(F.a.Item,null,r.a.createElement(s.a,{to:"/classrooms/".concat(ye==null?void 0:ye.course_id,"/program_homework/").concat(ye==null?void 0:ye.homework_id,"/detail")},ye==null?void 0:ye.homework_name)),r.a.createElement(F.a.Item,null,"\u9898\u89E3&\u95EE\u7B54")),r.a.createElement("div",{style:{marginTop:10,display:"flex"}},r.a.createElement("div",{style:{width:"860px",marginRight:30,background:"#fff"}},r.a.createElement(U.a,{tabBarStyle:{padding:"0px 10px"},style:{width:"850px"},tabBarExtraContent:Object(i.s)()&&r.a.createElement(M.a,{type:"primary",style:{width:88},onClick:function(){n.d.push("/classrooms/".concat(xe.coursesId,"/program_homework/").concat(xe.categoryId,"/answer/add"))}},"\u53D1\u8868\u7B54\u7591"," "),onChange:function(Ne){Ne==="1"?xe.sort_by="":xe.sort_by="created_at",we(Object(C.a)({},xe)),je()}},r.a.createElement(U.a.TabPane,{key:"1",tab:"\u6700\u65B0\u56DE\u590D"}),r.a.createElement(U.a.TabPane,{key:"2",tab:"\u6700\u65B0\u53D1\u8868"})),(ye==null||((B=ye.data)===null||B===void 0)?void 0:B.length)<=0&&r.a.createElement(_.a,{customText:"\u6682\u65E0\u8BA8\u8BBA"}),ye==null||((R=ye.data)===null||R===void 0)?void 0:R.map(function(He){return r.a.createElement(w,{item:He,params:xe,getdata:je})}),r.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},r.a.createElement(j.a,{current:xe.page,pageSize:xe.per_page,total:ye==null?void 0:ye.count,hideOnSinglePage:!0,onChange:function(Ne,Ye){xe.page=Ne,xe.per_page=Ye,we(Object(C.a)({},xe)),je()}}))),r.a.createElement("div",{className:v.a.right,style:{width:300,height:"100%"}},r.a.createElement("div",{style:{display:"flex"}},r.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},r.a.createElement("span",{style:{marginRight:3,fontSize:20,fontWeight:600,color:"#000"}},"\u5E7F\u64AD"),r.a.createElement("img",{width:21,src:E.a})," "),Object(i.c)()&&r.a.createElement(M.a,{type:"primary",onClick:function(){n.d.push("/classrooms/".concat(xe.coursesId,"/program_homework/").concat(xe.categoryId,"/answer/add"))}},"\u53D1\u5E03\u5E7F\u64AD")),(ye==null||((W=ye.radio_messages)===null||W===void 0)?void 0:W.length)<=0&&r.a.createElement(_.a,null),ye==null||((Y=ye.radio_messages)===null||Y===void 0)?void 0:Y.map(function(He){return r.a.createElement("div",{onClick:function(){n.d.push("/classrooms/".concat(xe.coursesId,"/program_homework/").concat(xe.categoryId,"/answer/").concat(He.id,"/detail"))},style:{marginTop:30,cursor:"pointer"}},r.a.createElement("div",{className:v.a.title,style:{fontSize:"16px",fontWeight:600}},r.a.createElement("span",{style:{color:(He==null?void 0:He.message_type)===2?"#4C7BE6":"#E17E7E"}},(He==null?void 0:He.message_type)===2?"\u3010\u9898\u89E3\u3011":"\u3010\u901A\u77E5\u3011"),r.a.createElement("span",{title:He.name},He.name)),r.a.createElement("div",{style:{marginTop:15,color:"#5F6368"}},"\u53D1\u8868\u4E8E",He.created_at))}))))},L=ve.default=Object(n.a)(function(S){var D=S.user;return{user:D}})(I)},nEHx:function(st,ve,z){"use strict";z.d(ve,"a",function(){return q});var q;(function(j){j.DARK="dark",j.LIGHT="light",j.HIGH_CONTRAST="hc"})(q||(q={}))},nnTU:function(st,ve,z){"use strict";z.d(ve,"b",function(){return H}),z.d(ve,"a",function(){return F});var q=z("MI8n"),j=z("JYp7"),A=z("pmY6"),U=z("24hK"),O=z("746U"),M=z("Cg/j");const H=Object(M.c)("commandService"),F=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,C){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!C)throw new Error("invalid command");return this.registerCommand({id:e,handler:C})}if(e.description){const r=[];for(let s of e.description.args)r.push(s.constraint);const h=e.handler;e.handler=function(s,...n){return Object(O.o)(n,r),h(s,...n)}}const{id:f}=e;let p=this._commands.get(f);p||(p=new U.a,this._commands.set(f,p));let o=p.unshift(e),a=Object(A.i)(()=>{o();const r=this._commands.get(f);(r==null?void 0:r.isEmpty())&&this._commands.delete(f)});return this._onDidRegisterCommand.fire(f),a}registerCommandAlias(e,C){return F.registerCommand(e,(f,...p)=>f.get(H).executeCommand(C,...p))}getCommand(e){const C=this._commands.get(e);return!C||C.isEmpty()?void 0:j.a.first(C)}getCommands(){const e=new Map;for(const C of this._commands.keys()){const f=this.getCommand(C);f&&e.set(C,f)}return e}};F.registerCommand("noop",()=>{})},p5ED:function(st,ve,z){"use strict";var q=z("+L6B"),j=z("2/Rp"),A=z("5Dmo"),U=z("3S7+"),O=z("k1fw"),M=z("9og8"),H=z("tJVT"),F=z("WmNS"),e=z.n(F),C=z("q1tI"),f=z.n(C),p=z("vHTk"),o=z.n(p),a=z("yEEn"),r=z("ZW9T"),h=z("1vsH"),s=z("V0Rq"),n=z("m3rI");ve.a=function(i){var t,_,g,v,x,E,y,c=i.editOffice,u=c===void 0?"view":c,l=i.data,b=i.theme,m=i.type,w=i.filename,I=i.monacoEditor,L=i.className,S=i.style,D=i.close,B=i.onClose,R=i.hasMask,W=i.disabledDownload,Y=Object(C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),se=Object(H.a)(Y,2),ne=se[0],Se=se[1],xe=Object(C.useState)(""),we=Object(H.a)(xe,2),Re=we[0],Pe=we[1],ye=Object(C.useState)(),ee=Object(H.a)(ye,2),je=ee[0],et=ee[1],He=window.ENV==="build"?"/react/build":"",Ne=n.a.PROXY_SERVER||location.origin,Ye,Ae=1024*1024,Ue=10*Ae,Ve=Object(C.useRef)();(t=l)!==null&&t!==void 0&&t.startsWith("/api")&&m!=="txt"&&(l=n.a.API_SERVER+l),m==="office"&&(Ye=Object(h.T)(l).filesize,Ye>Ue&&(m="other")),w&&I&&(I.filename=w),Object(C.useEffect)(function(){var Ee,ke,We=(Ee=document.cookie)===null||Ee===void 0||((ke=Ee.replace(/\s/g,""))===null||ke===void 0)?void 0:ke.split(";");We==null||We.map(function(Xe){var ze=Xe.split("=");ze[0]==="_educoder_session"&&Pe(ze[1])})},[]),Object(C.useEffect)(function(){m==="office"&&Q()},[m,l]);var Q=function(){var Ee=Object(M.a)(e.a.mark(function ke(){var We,Xe,ze;return e.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return console.log("data:",l),We=l,l.startsWith("http")||(We=location.origin+We),Xe=new URL(We).pathname.split("/").pop(),Qe.next=6,Object(s.V)({attachment_id:Xe});case 6:ze=Qe.sent,et(ze);case 8:case"end":return Qe.stop()}},ke)}));return function(){return Ee.apply(this,arguments)}}(),fe=function(){if(l.startsWith("http")||l.startsWith("blob:")){be();return}Object(h.z)(w||"educoder",l,w)},be=function(){Object(h.x)(w||"educoder",decodeURIComponent(l))};return f.a.createElement("div",{style:Object(O.a)({},S||{}),className:"".concat(R&&o.a.bgBlack," ").concat(m?o.a.wrp:"hide")},D&&f.a.createElement("div",{className:o.a.close,ref:Ve},!W&&f.a.createElement(U.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ve.current}},f.a.createElement("span",{onClick:be},f.a.createElement("i",{className:"icon-quxiaozhiding"}))),f.a.createElement(U.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ve.current}},f.a.createElement("span",{className:"",onClick:B},f.a.createElement("i",{className:"icon-guanbi1"})))),f.a.createElement("div",{className:"".concat(o.a[L]," ").concat(L," ").concat(o.a.monaco," ").concat(m==="txt"?"show":"hide")},m==="txt"&&f.a.createElement(r.b,I)),m==="audio"&&f.a.createElement("audio",{src:"".concat(((_=l)===null||_===void 0?void 0:_.indexOf("http://"))>-1||((g=l)===null||g===void 0?void 0:g.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(l),autoPlay:!0}),m==="video"&&f.a.createElement(f.a.Fragment,null,((v=l)===null||v===void 0?void 0:v.indexOf("http"))>-1?f.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):f.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),m==="office"&&je&&f.a.createElement("iframe",{src:"".concat(He,"/office.html?key=").concat(je.key,"&url=").concat(Ne+je.url,"&callbackUrl=").concat(Ne+je.callbackUrl,"&fileType=").concat(je.fileType,"&title=").concat(je.title,"&model=").concat(u,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),m==="html"&&f.a.createElement("iframe",{src:l+"&disposition=inline"}),m==="pdf"&&f.a.createElement("iframe",{src:"".concat(He,"/js/pdfview/index.html?url=").concat(l,"&disabledDownload=").concat(!!W)}),m==="image"&&f.a.createElement("img",{src:"".concat(((x=l)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((E=l)===null||E===void 0?void 0:E.indexOf("https://"))>-1||(y=l)!==null&&y!==void 0&&y.startsWith("/api")?"":"data:image/png;base64,").concat(l)}),m==="other"&&f.a.createElement("div",null,f.a.createElement(j.a,{type:"primary",size:"large",onClick:fe},f.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),m==="download"&&f.a.createElement(j.a,{type:"primary",size:"large",onClick:fe},f.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(st,ve,z){"use strict";z.d(ve,"h",function(){return C}),z.d(ve,"g",function(){return p}),z.d(ve,"f",function(){return o}),z.d(ve,"e",function(){return a}),z.d(ve,"i",function(){return r}),z.d(ve,"b",function(){return h}),z.d(ve,"a",function(){return s}),z.d(ve,"d",function(){return n}),z.d(ve,"c",function(){return i});var q=z("C/vA"),j=z("JYp7");const A=!1;let U=null;function O(t){U=t}if(A){const t="__is_disposable_tracked__";O(new class{trackDisposable(_){const g=new Error("Potentially leaked disposable").stack;setTimeout(()=>{_[t]||console.log(g)},3e3)}setParent(_,g){if(_&&_!==s.None)try{_[t]=!0}catch(v){}}markAsDisposed(_){if(_&&_!==s.None)try{_[t]=!0}catch(g){}}markAsSingleton(_){}})}function M(t){return U==null||U.trackDisposable(t),t}function H(t){U==null||U.markAsDisposed(t)}function F(t,_){U==null||U.setParent(t,_)}function e(t,_){if(!U)return;for(const g of t)U.setParent(g,_)}function C(t){return U==null||U.markAsSingleton(t),t}class f extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function p(t){return typeof t.dispose=="function"&&t.dispose.length===0}function o(t){if(j.a.is(t)){let _=[];for(const g of t)if(g)try{g.dispose()}catch(v){_.push(v)}if(_.length===1)throw _[0];if(_.length>1)throw new f(_);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const _=r(()=>o(t));return e(t,_),_}function r(t){const _=M({dispose:Object(q.a)(()=>{H(_),t()})});return _}class h{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;H(this),this._isDisposed=!0,this.clear()}clear(){try{o(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return F(t,this),this._isDisposed?h.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(t),t}}h.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new h,M(this),F(this._store,this)}dispose(){H(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}s.None=Object.freeze({dispose(){}});class n{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var _;if(this._isDisposed||t===this._value)return;(_=this._value)===null||_===void 0||_.dispose(),t&&F(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,H(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&F(t,null),t}}class i{constructor(t){this.object=t}dispose(){}}},psGv:function(st,ve,z){var q,j;(function(){var A;(function(){"use strict";var H=[,,function(f){function p(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var r=new p(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},p.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},p.prototype.has_match=function(r){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(r))return!0;return!1},p.prototype.set_indent=function(r,h){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(r){this.__items.push(r);var h=r.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=r.length-h:this.__character_count+=r.length},p.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function o(r,h){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),h=h||"",r.indent_level>0&&(h=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}o.prototype.get_indent_size=function(r,h){var s=this.__base_string_length;return h=h||0,r<0&&(s=0),s+=r*this.__indent_size,s+=h,s},o.prototype.get_indent_string=function(r,h){var s=this.__base_string;return h=h||0,r<0&&(r=0,s=""),h+=r*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},o.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var r=this.__cache.length,h=0,s="";this.__indent_size&&r>=this.__indent_size&&(h=Math.floor(r/this.__indent_size),r-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),r&&(s+=new Array(r+1).join(" ")),this.__cache.push(s)};function a(r,h){this.__indent_cache=new o(r,h),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(r,h){return this.__indent_cache.get_indent_string(r,h)},a.prototype.get_indent_size=function(r,h){return this.__indent_cache.get_indent_size(r,h)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(r){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
|
|
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return r!==`
|
|
`&&(s=s.replace(/[\n]/g,r)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(r,h){return r=r||0,h=h||0,this.next_line.set_indent(r,h),this.__lines.length>1?(this.current_line.set_indent(r,h),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(r){for(var h=0;h<r.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.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(" "))},a.prototype.remove_indent=function(r){for(var h=this.__lines.length;r<h;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&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},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(r,h){for(var s=this.__lines.length-2;s>=0;){var n=this.__lines[s];if(n.is_empty())break;if(n.item(0).indexOf(r)!==0&&n.item(-1)!==h){this.__lines.splice(s+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},f.exports.Output=a},function(f){function p(o,a,r,h){this.type=o,this.text=a,this.comments_before=null,this.newlines=r||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=p},,,function(f){function p(r,h){this.raw_options=o(r,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(r,h){var s=this.raw_options[r],n=h||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(n=s.concat()):typeof s=="string"&&(n=s.split(/[^a-zA-Z0-9_\/\-]+/)),n},p.prototype._get_boolean=function(r,h){var s=this.raw_options[r],n=s===void 0?!!h:!!s;return n},p.prototype._get_characters=function(r,h){var s=this.raw_options[r],n=h||"";return typeof s=="string"&&(n=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),n},p.prototype._get_number=function(r,h){var s=this.raw_options[r];h=parseInt(h,10),isNaN(h)&&(h=0);var n=parseInt(s,10);return isNaN(n)&&(n=h),n},p.prototype._get_selection=function(r,h,s){var n=this._get_selection_list(r,h,s);if(n.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[r]+"'");return n[0]},p.prototype._get_selection_list=function(r,h,s){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[h[0]],!this._is_valid_selection(s,h))throw new Error("Invalid Default Value!");var n=this._get_array(r,s);if(!this._is_valid_selection(n,h))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[r]+"'");return n},p.prototype._is_valid_selection=function(r,h){return r.length&&h.length&&!r.some(function(s){return h.indexOf(s)===-1})};function o(r,h){var s={};r=a(r);var n;for(n in r)n!==h&&(s[n]=r[n]);if(h&&r[h])for(n in r[h])s[n]=r[h][n];return s}function a(r){var h={},s;for(s in r){var n=s.replace(/-/g,"_");h[n]=r[s]}return h}f.exports.Options=p,f.exports.normalizeOpts=a,f.exports.mergeOpts=o},,function(f){var p=RegExp.prototype.hasOwnProperty("sticky");function o(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},o.prototype.peek=function(a){var r=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(r=this.__input.charAt(a)),r},o.prototype.__match=function(a,r){a.lastIndex=r;var h=a.exec(this.__input);return h&&!(p&&a.sticky)&&(h.index!==r&&(h=null)),h},o.prototype.test=function(a,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(a,r):!1},o.prototype.testChar=function(a,r){var h=this.peek(r);return a.lastIndex=0,h!==null&&a.test(h)},o.prototype.match=function(a){var r=this.__match(a,this.__position);return r?this.__position+=r[0].length:r=null,r},o.prototype.read=function(a,r,h){var s="",n;return a&&(n=this.match(a),n&&(s+=n[0])),r&&(n||!a)&&(s+=this.readUntil(r,h)),s},o.prototype.readUntil=function(a,r){var h="",s=this.__position;a.lastIndex=this.__position;var n=a.exec(this.__input);return n?(s=n.index,r&&(s+=n[0].length)):s=this.__input_length,h=this.__input.substring(this.__position,s),this.__position=s,h},o.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},o.prototype.get_regexp=function(a,r){var h=null,s="g";return r&&p&&(s="y"),typeof a=="string"&&a!==""?h=new RegExp(a,s):a&&(h=new RegExp(a.source,s)),h},o.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(a){var r=this.__position,h=this.readUntilAfter(a);return this.__position=r,h},o.prototype.lookBack=function(a){var r=this.__position-1;return r>=a.length&&this.__input.substring(r-a.length,r).toLowerCase()===a},f.exports.InputScanner=o},function(f,p,o){var a=o(8).InputScanner,r=o(3).Token,h=o(10).TokenStream,s=o(11).WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,_){this._input=new a(t),this._options=_||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var t,_=new r(n.START,""),g=null,v=[],x=new h;_.type!==n.EOF;){for(t=this._get_next_token(_,g);this._is_comment(t);)x.add(t),t=this._get_next_token(_,g);x.isEmpty()||(t.comments_before=x,x=new h),t.parent=g,this._is_opening(t)?(v.push(g),g=t):g&&this._is_closing(t,g)&&(t.opened=g,g.closed=t,g=v.pop(),t.parent=g),t.previous=_,_.next=t,this.__tokens.add(t),_=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,_){this._readWhitespace();var g=this._input.read(/.+/g);return g?this._create_token(n.RAW,g):this._create_token(n.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,_){return!1},i.prototype._create_token=function(t,_){var g=new r(t,_,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return g},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=i,f.exports.TOKEN=n},function(f){function p(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},p.prototype.peek=function(o){var a=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(a=this.__tokens[o]),a},p.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},f.exports.TokenStream=p},function(f,p,o){var a=o(12).Pattern;function r(h,s){a.call(this,h,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new a,r.prototype.__set_whitespace_patterns=function(h,s){h+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var s=this.__split(this._newline_regexp,h);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return h},r.prototype.matching=function(h,s){var n=this._create();return n.__set_whitespace_patterns(h,s),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(h,s){h.lastIndex=0;for(var n=0,i=[],t=h.exec(s);t;)i.push(s.substring(n,t.index)),n=t.index+t[0].length,t=h.exec(s);return n<s.length?i.push(s.substring(n,s.length)):i.push(""),i},f.exports.WhitespacePattern=r},function(f){function p(o,a){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}p.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(o){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(o),a._update(),a},p.prototype.until=function(o){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(o),a._update(),a},p.prototype.starting_with=function(o){var a=this._create();return a._starting_pattern=this._input.get_regexp(o,!0),a._update(),a},p.prototype.matching=function(o){var a=this._create();return a._match_pattern=this._input.get_regexp(o,!0),a._update(),a},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},f.exports.Pattern=p},function(f){function p(o,a){o=typeof o=="string"?o:o.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+a,"g")}p.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(o);r;)a[r[1]]=r[2],r=this.__directive_pattern.exec(o);return a},p.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=p},function(f,p,o){var a=o(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(s,n){a.call(this,s,n),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),n&&(this.__template_pattern=this._input.get_regexp(n.__template_pattern),this._excluded=Object.assign(this._excluded,n._excluded),this._disabled=Object.assign(this._disabled,n._disabled));var i=new a(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new a,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(s){var n=this._create();return n._disabled[s]=!0,n._update(),n},h.prototype.read_options=function(s){var n=this._create();for(var i in r)n._disabled[i]=s.templating.indexOf(i)===-1;return n._update(),n},h.prototype.exclude=function(s){var n=this._create();return n._excluded[s]=!0,n._update(),n},h.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),s+=n,n=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},h.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},h.prototype._read_template=function(){var s="",n=this._input.peek();if(n==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else n==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},f.exports.TemplatablePattern=h},,,,function(f,p,o){var a=o(19).Beautifier,r=o(20).Options;function h(s,n,i,t){var _=new a(s,n,i,t);return _.beautify()}f.exports=h,f.exports.defaultOptions=function(){return new r}},function(f,p,o){var a=o(20).Options,r=o(2).Output,h=o(21).Tokenizer,s=o(21).TOKEN,n=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=function(b,m){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=b.max_preserve_newlines,this.preserve_newlines=b.preserve_newlines,this._output=new r(b,m)};t.prototype.current_line_has_match=function(b){return this._output.current_line.has_match(b)},t.prototype.set_space_before_token=function(b,m){this._output.space_before_token=b,this._output.non_breaking_space=m},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(b){this._output.add_raw_token(b)},t.prototype.print_preserved_newlines=function(b){var m=0;b.type!==s.TEXT&&b.previous.type!==s.TEXT&&(m=b.newlines?1:0),this.preserve_newlines&&(m=b.newlines<this.max_preserve_newlines+1?b.newlines:this.max_preserve_newlines+1);for(var w=0;w<m;w++)this.print_newline(w>0);return m!==0},t.prototype.traverse_whitespace=function(b){return b.whitespace_before||b.newlines?(this.print_preserved_newlines(b)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(b){this._output.add_new_line(b)},t.prototype.print_token=function(b){b.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(b.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(b){return b=this.indent_level+(b||0),b<1?"":this._output.get_indent_string(b)};var _=function(b){for(var m=null,w=b.next;w.type!==s.EOF&&b.closed!==w;){if(w.type===s.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===s.EQUALS&&w.next.next&&w.next.next.type===s.VALUE&&(m=w.next.next.text);break}w=w.next}return m},g=function(b,m){var w=null,I=null;return m.closed?(b==="script"?w="text/javascript":b==="style"&&(w="text/css"),w=_(m)||w,w.search("text/css")>-1?I="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?I="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?I="html":w.search(/test\/null/)>-1&&(I="null"),I):null};function v(b,m){return m.indexOf(b)!==-1}function x(b,m,w){this.parent=b||null,this.tag=m?m.tag_name:"",this.indent_level=w||0,this.parser_token=m||null}function E(b){this._printer=b,this._current_frame=null}E.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},E.prototype.record_tag=function(b){var m=new x(this._current_frame,b,this._printer.indent_level);this._current_frame=m},E.prototype._try_pop_frame=function(b){var m=null;return b&&(m=b.parser_token,this._printer.indent_level=b.indent_level,this._current_frame=b.parent),m},E.prototype._get_frame=function(b,m){for(var w=this._current_frame;w&&!(b.indexOf(w.tag)!==-1);){if(m&&m.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},E.prototype.try_pop=function(b,m){var w=this._get_frame([b],m);return this._try_pop_frame(w)},E.prototype.indent_to_tag=function(b){var m=this._get_frame(b);m&&(this._printer.indent_level=m.indent_level)};function y(b,m,w,I){this._source_text=b||"",m=m||{},this._js_beautify=w,this._css_beautify=I,this._tag_stack=null;var L=new a(m,"html");this._options=L,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"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b=this._source_text,m=this._options.eol;this._options.eol==="auto"&&(m=`
|
|
`,b&&n.test(b)&&(m=b.match(n)[0])),b=b.replace(i,`
|
|
`);var w=b.match(/^[\t ]*/)[0],I={text:"",type:""},L=new c,S=new t(this._options,w),D=new h(b,this._options).tokenize();this._tag_stack=new E(S);for(var B=null,R=D.next();R.type!==s.EOF;)R.type===s.TAG_OPEN||R.type===s.COMMENT?(B=this._handle_tag_open(S,R,L,I),L=B):R.type===s.ATTRIBUTE||R.type===s.EQUALS||R.type===s.VALUE||R.type===s.TEXT&&!L.tag_complete?B=this._handle_inside_tag(S,R,L,D):R.type===s.TAG_CLOSE?B=this._handle_tag_close(S,R,L):R.type===s.TEXT?B=this._handle_text(S,R,L):S.add_raw_token(R),I=B,R=D.next();var W=S._output.get_code(m);return W},y.prototype._handle_tag_close=function(b,m,w){var I={text:m.text,type:m.type};return b.alignment_size=0,w.tag_complete=!0,b.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),w.is_unformatted?b.add_raw_token(m):(w.tag_start_char==="<"&&(b.set_space_before_token(m.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&b.print_newline(!1)),b.print_token(m)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(b.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&b.set_wrap_point(),I},y.prototype._handle_inside_tag=function(b,m,w,I){var L=w.has_wrapped_attrs,S={text:m.text,type:m.type};if(b.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),w.is_unformatted)b.add_raw_token(m);else if(w.tag_start_char==="{"&&m.type===s.TEXT)b.print_preserved_newlines(m)?(m.newlines=0,b.add_raw_token(m)):b.print_token(m);else{if(m.type===s.ATTRIBUTE?(b.set_space_before_token(!0),w.attr_count+=1):(m.type===s.EQUALS||m.type===s.VALUE&&m.previous.type===s.EQUALS)&&b.set_space_before_token(!1),m.type===s.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(b.traverse_whitespace(m),L=L||m.newlines!==0),this._is_wrap_attributes_force)){var D=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var B=!0,R=0,W;do{if(W=I.peek(R),W.type===s.ATTRIBUTE){B=!1;break}R+=1}while(R<4&&W.type!==s.EOF&&W.type!==s.TAG_CLOSE);D=!B}D&&(b.print_newline(!1),L=!0)}b.print_token(m),L=L||b.previous_token_wrapped(),w.has_wrapped_attrs=L}return S},y.prototype._handle_text=function(b,m,w){var I={text:m.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(b,m,w):w.is_unformatted||w.is_content_unformatted?b.add_raw_token(m):(b.traverse_whitespace(m),b.print_token(m)),I},y.prototype._print_custom_beatifier_text=function(b,m,w){var I=this;if(m.text!==""){var L=m.text,S,D=1,B="",R="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:w.custom_beautifier_name==="html"&&(S=function(xe,we){var Re=new y(xe,we,I._js_beautify,I._css_beautify);return Re.beautify()}),this._options.indent_scripts==="keep"?D=0:this._options.indent_scripts==="separate"&&(D=-b.indent_level);var W=b.get_full_indent(D);if(L=L.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&L[0]==="<"&&L.match(/^(<!--|<!\[CDATA\[)/)){var Y=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(L);if(!Y){b.add_raw_token(m);return}B=W+Y[1]+`
|
|
`,L=Y[4],Y[5]&&(R=W+Y[5]),L=L.replace(/\n[ \t]*$/,""),(Y[2]||Y[3].indexOf(`
|
|
`)!==-1)&&(Y=Y[3].match(/[ \t]+$/),Y&&(m.whitespace_before=Y[0]))}if(L)if(S){var se=function(){this.eol=`
|
|
`};se.prototype=this._options.raw_options;var ne=new se;L=S(W+L,ne)}else{var Se=m.whitespace_before;Se&&(L=L.replace(new RegExp(`
|
|
(`+Se+")?","g"),`
|
|
`)),L=W+L.replace(/\n/g,`
|
|
`+W)}B&&(L?L=B+L+`
|
|
`+R:L=B+R),b.print_newline(!1),L&&(m.text=L,m.whitespace_before="",m.newlines=0,b.add_raw_token(m),b.print_newline(!0))}},y.prototype._handle_tag_open=function(b,m,w,I){var L=this._get_tag_open_token(m);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&m.type===s.TAG_OPEN&&m.text.indexOf("</")===0?(b.add_raw_token(m),L.start_tag_token=this._tag_stack.try_pop(L.tag_name)):(b.traverse_whitespace(m),this._set_tag_position(b,m,L,w,I),L.is_inline_element||b.set_wrap_point(),b.print_token(m)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(L.alignment_size=m.text.length+1),!L.tag_complete&&!L.is_unformatted&&(b.alignment_size=L.alignment_size),L};var c=function(b,m){if(this.parent=b||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="",!m)this.tag_complete=!0;else{var w;this.tag_start_char=m.text[0],this.text=m.text,this.tag_start_char==="<"?(w=m.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=m.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(m.text.startsWith("{{#>")||m.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&m.next!==null?this.tag_check=m.next.text.split(" ")[0]:this.tag_check=m.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),m.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||m.closed&&m.closed.text==="/>";var I=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(I=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(I)))}};y.prototype._get_tag_open_token=function(b){var m=new c(this._tag_stack.get_parser_token(),b);return m.alignment_size=this._options.wrap_attributes_indent_size,m.is_end_tag=m.is_end_tag||v(m.tag_check,this._options.void_elements),m.is_empty_element=m.tag_complete||m.is_start_tag&&m.is_end_tag,m.is_unformatted=!m.tag_complete&&v(m.tag_check,this._options.unformatted),m.is_content_unformatted=!m.is_empty_element&&v(m.tag_check,this._options.content_unformatted),m.is_inline_element=v(m.tag_name,this._options.inline)||m.tag_name.includes("-")||m.tag_start_char==="{",m},y.prototype._set_tag_position=function(b,m,w,I,L){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||b.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=g(w.tag_check,m)))),v(w.tag_check,this._options.extra_liners)&&(b.print_newline(!1),b._output.just_added_blankline()||b.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var S=b.current_line_has_match(/{{#if/);S||b.print_newline(!1)}w.tag_name==="!--"&&L.type===s.TAG_CLOSE&&I.is_end_tag&&w.text.indexOf(`
|
|
`)===-1||(w.is_inline_element||w.is_unformatted||b.print_newline(!1),this._calcluate_parent_multiline(b,w))}else if(w.is_end_tag){var D=!1;D=w.start_tag_token&&w.start_tag_token.multiline_content,D=D||!w.is_inline_element&&!(I.is_inline_element||I.is_unformatted)&&!(L.type===s.TAG_CLOSE&&w.start_tag_token===I)&&L.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(D=!1),D&&b.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(L.type!=="TK_CONTENT"||w.is_content_unformatted)&&b.print_newline(!1),this._calcluate_parent_multiline(b,w)},y.prototype._calcluate_parent_multiline=function(b,m){m.parent&&b._output.just_added_newline()&&!((m.is_inline_element||m.is_unformatted)&&m.parent.is_inline_element)&&(m.parent.multiline_content=!0)};var u=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],l=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(b){var m=null;if(b.is_empty_element||!b.is_start_tag||!b.parent)return;if(b.tag_name==="body")m=m||this._tag_stack.try_pop("head");else if(b.tag_name==="li")m=m||this._tag_stack.try_pop("li",["ol","ul"]);else if(b.tag_name==="dd"||b.tag_name==="dt")m=m||this._tag_stack.try_pop("dt",["dl"]),m=m||this._tag_stack.try_pop("dd",["dl"]);else if(b.parent.tag_name==="p"&&u.indexOf(b.tag_name)!==-1){var w=b.parent.parent;(!w||l.indexOf(w.tag_name)===-1)&&(m=m||this._tag_stack.try_pop("p"))}else b.tag_name==="rp"||b.tag_name==="rt"?(m=m||this._tag_stack.try_pop("rt",["ruby","rtc"]),m=m||this._tag_stack.try_pop("rp",["ruby","rtc"])):b.tag_name==="optgroup"?m=m||this._tag_stack.try_pop("optgroup",["select"]):b.tag_name==="option"?m=m||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):b.tag_name==="colgroup"?m=m||this._tag_stack.try_pop("caption",["table"]):b.tag_name==="thead"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"])):b.tag_name==="tbody"||b.tag_name==="tfoot"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("thead",["table"]),m=m||this._tag_stack.try_pop("tbody",["table"])):b.tag_name==="tr"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(b.tag_name==="th"||b.tag_name==="td")&&(m=m||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),m=m||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return b.parent=this._tag_stack.get_parser_token(),m},f.exports.Beautifier=y},function(f,p,o){var a=o(6).Options;function r(h){a.call(this,h,"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"])}r.prototype=new a,f.exports.Options=r},function(f,p,o){var a=o(9).Tokenizer,r=o(9).TOKEN,h=o(13).Directives,s=o(14).TemplatablePattern,n=o(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},t=new h(/<\!--/,/-->/),_=function(g,v){a.call(this,g,v),this._current_tag_name="";var x=new s(this._input).read_options(this._options),E=new n(this._input);if(this.__patterns={word:x.until(/[\n\r\t <]/),single_quote:x.until_after(/'/),double_quote:x.until_after(/"/),attribute:x.until(/[\n\r\t =>]|\/>/),element_name:x.until(/[\n\r\t >\/]/),handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),handlebars_open:E.until(/[\n\r\t }]/),handlebars_raw_close:E.until(/}}/),comment:E.starting_with(/<!--/).until_after(/-->/),cdata:E.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:E.starting_with(/<!\[/).until_after(/]>/),processing:E.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 y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=E.matching(y).until_after(y)}};_.prototype=new a,_.prototype._is_comment=function(g){return!1},_.prototype._is_opening=function(g){return g.type===i.TAG_OPEN},_.prototype._is_closing=function(g,v){return g.type===i.TAG_CLOSE&&v&&((g.text===">"||g.text==="/>")&&v.text[0]==="<"||g.text==="}}"&&v.text[0]==="{"&&v.text[1]==="{")},_.prototype._reset=function(){this._current_tag_name=""},_.prototype._get_next_token=function(g,v){var x=null;this._readWhitespace();var E=this._input.peek();return E===null?this._create_token(i.EOF,""):(x=x||this._read_open_handlebars(E,v),x=x||this._read_attribute(E,g,v),x=x||this._read_close(E,v),x=x||this._read_raw_content(E,g,v),x=x||this._read_content_word(E),x=x||this._read_comment_or_cdata(E),x=x||this._read_processing(E),x=x||this._read_open(E,v),x=x||this._create_token(i.UNKNOWN,this._input.next()),x)},_.prototype._read_comment_or_cdata=function(g){var v=null,x=null,E=null;if(g==="<"){var y=this._input.peek(1);y==="!"&&(x=this.__patterns.comment.read(),x?(E=t.get_directives(x),E&&E.ignore==="start"&&(x+=t.readIgnored(this._input))):x=this.__patterns.cdata.read()),x&&(v=this._create_token(i.COMMENT,x),v.directives=E)}return v},_.prototype._read_processing=function(g){var v=null,x=null,E=null;if(g==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(x=this.__patterns.conditional_comment.read(),x=x||this.__patterns.processing.read()),x&&(v=this._create_token(i.COMMENT,x),v.directives=E)}return v},_.prototype._read_open=function(g,v){var x=null,E=null;return v||g==="<"&&(x=this._input.next(),this._input.peek()==="/"&&(x+=this._input.next()),x+=this.__patterns.element_name.read(),E=this._create_token(i.TAG_OPEN,x)),E},_.prototype._read_open_handlebars=function(g,v){var x=null,E=null;return v||this._options.indent_handlebars&&g==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(x=this.__patterns.handlebars_comment.read(),x=x||this.__patterns.handlebars.read(),E=this._create_token(i.COMMENT,x)):(x=this.__patterns.handlebars_open.read(),E=this._create_token(i.TAG_OPEN,x))),E},_.prototype._read_close=function(g,v){var x=null,E=null;return v&&(v.text[0]==="<"&&(g===">"||g==="/"&&this._input.peek(1)===">")?(x=this._input.next(),g==="/"&&(x+=this._input.next()),E=this._create_token(i.TAG_CLOSE,x)):v.text[0]==="{"&&g==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),E=this._create_token(i.TAG_CLOSE,"}}"))),E},_.prototype._read_attribute=function(g,v,x){var E=null,y="";if(x&&x.text[0]==="<")if(g==="=")E=this._create_token(i.EQUALS,this._input.next());else if(g==='"'||g==="'"){var c=this._input.next();g==='"'?c+=this.__patterns.double_quote.read():c+=this.__patterns.single_quote.read(),E=this._create_token(i.VALUE,c)}else y=this.__patterns.attribute.read(),y&&(v.type===i.EQUALS?E=this._create_token(i.VALUE,y):E=this._create_token(i.ATTRIBUTE,y));return E},_.prototype._is_content_unformatted=function(g){return this._options.void_elements.indexOf(g)===-1&&(this._options.content_unformatted.indexOf(g)!==-1||this._options.unformatted.indexOf(g)!==-1)},_.prototype._read_raw_content=function(g,v,x){var E="";if(x&&x.text[0]==="{")E=this.__patterns.handlebars_raw_close.read();else if(v.type===i.TAG_CLOSE&&v.opened.text[0]==="<"&&v.text[0]!=="/"){var y=v.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var c=this._read_comment_or_cdata(g);if(c)return c.type=i.TEXT,c;E=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(E=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return E?this._create_token(i.TEXT,E):null},_.prototype._read_content_word=function(g){var v="";if(this._options.unformatted_content_delimiter&&(g===this._options.unformatted_content_delimiter[0]&&(v=this.__patterns.unformatted_content_delimiter.read())),v||(v=this.__patterns.word.read()),v)return this._create_token(i.TEXT,v)},f.exports.Tokenizer=_,f.exports.TOKEN=i}],F={};function e(f){var p=F[f];if(p!==void 0)return p.exports;var o=F[f]={exports:{}};return H[f](o,o.exports,e),o.exports}var C=e(18);A=C})();var U=A;if(!0)!(q=[z,z("6UM0"),z("TXwP")],j=function(H){var F=z("6UM0"),e=z("TXwP");return{html_beautify:function(C,f){return U(C,f,F.js_beautify,e.css_beautify)}}}.apply(ve,q),j!==void 0&&(st.exports=j));else var O,M})()},"rAM+":function(st,ve,z){"use strict";z.d(ve,"a",function(){return j});var q=z("Qw5x");function j(A,U){var O;if(typeof Symbol=="undefined"||A[Symbol.iterator]==null){if(Array.isArray(A)||(O=Object(q.a)(A))||U&&A&&typeof A.length=="number"){O&&(A=O);var M=0,H=function(){};return{s:H,n:function(){return M>=A.length?{done:!0}:{done:!1,value:A[M++]}},e:function(p){throw p},f:H}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var F=!0,e=!1,C;return{s:function(){O=A[Symbol.iterator]()},n:function(){var p=O.next();return F=p.done,p},e:function(p){e=!0,C=p},f:function(){try{!F&&O.return!=null&&O.return()}finally{if(e)throw C}}}}},rUJ1:function(st,ve){const z=/[&<>"']/,q=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,U={"&":"&","<":"<",">":">",'"':""","'":"'"},O=E=>U[E];function M(E,y){if(y){if(z.test(E))return E.replace(q,O)}else if(j.test(E))return E.replace(A,O);return E}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(E){return E.replace(H,(y,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const e=/(^|[^\[])\^/g;function C(E,y){E=E.source||E,y=y||"";const c={replace:(u,l)=>(l=l.source||l,l=l.replace(e,"$1"),E=E.replace(u,l),c),getRegex:()=>new RegExp(E,y)};return c}const f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(E,y,c){if(E){let u;try{u=decodeURIComponent(F(c)).replace(f,"").toLowerCase()}catch(l){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}y&&!p.test(c)&&(c=n(y,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(u){return null}return c}const a={},r=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(E,y){a[" "+E]||(r.test(E)?a[" "+E]=E+"/":a[" "+E]=g(E,"/",!0)),E=a[" "+E];const c=E.indexOf(":")===-1;return y.substring(0,2)==="//"?c?y:E.replace(h,"$1")+y:y.charAt(0)==="/"?c?y:E.replace(s,"$1")+y:E+y}const i={exec:function(){}};function t(E){let y=1,c,u;for(;y<arguments.length;y++){c=arguments[y];for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(E[u]=c[u])}return E}function _(E,y){const c=E.replace(/\|/g,(b,m,w)=>{let I=!1,L=m;for(;--L>=0&&w[L]==="\\";)I=!I;return I?"|":" |"}),u=c.split(/ \|/);let l=0;if(u.length>y)u.splice(y);else for(;u.length<y;)u.push("");for(;l<u.length;l++)u[l]=u[l].trim().replace(/\\\|/g,"|");return u}function g(E,y,c){const u=E.length;if(u===0)return"";let l=0;for(;l<u;){const b=E.charAt(u-l-1);if(b===y&&!c)l++;else if(b!==y&&c)l++;else break}return E.substr(0,u-l)}function v(E,y){if(E.indexOf(y[1])===-1)return-1;const c=E.length;let u=0,l=0;for(;l<c;l++)if(E[l]==="\\")l++;else if(E[l]===y[0])u++;else if(E[l]===y[1]&&(u--,u<0))return l;return-1}function x(E){E&&E.sanitize&&!E.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")}st.exports={escape:M,unescape:F,edit:C,cleanUrl:o,resolveUrl:n,noopTest:i,merge:t,splitCells:_,rtrim:g,findClosingBracket:v,checkSanitizeDeprecation:x}},t23M:function(st,ve,z){"use strict";var q=z("VTBJ"),j=z("1OyB"),A=z("vuIU"),U=z("Ji7U"),O=z("LK+K"),M=z("q1tI"),H=z.n(M),F=z("m+aA"),e=z("Zm9Q"),C=z("Kwbf"),f=z("c+Xe"),p=z("bdgK"),o="rc-observer-key",a=function(r){Object(U.a)(s,r);var h=Object(O.a)(s);function s(){var n;return Object(j.a)(this,s),n=h.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(i){var t=n.props.onResize,_=i[0].target,g=_.getBoundingClientRect(),v=g.width,x=g.height,E=_.offsetWidth,y=_.offsetHeight,c=Math.floor(v),u=Math.floor(x);if(n.state.width!==c||n.state.height!==u||n.state.offsetWidth!==E||n.state.offsetHeight!==y){var l={width:c,height:u,offsetWidth:E,offsetHeight:y};n.setState(l),t&&Promise.resolve().then(function(){t(Object(q.a)(Object(q.a)({},l),{},{offsetWidth:E,offsetHeight:y}))})}},n.setChildNode=function(i){n.childNode=i},n}return Object(A.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var t=Object(F.a)(this.childNode||this),_=t!==this.currentElement;_&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,t=Object(e.a)(i);if(t.length>1)Object(C.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(C.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var _=t[0];if(M.isValidElement(_)&&Object(f.c)(_)){var g=_.ref;t[0]=M.cloneElement(_,{ref:Object(f.a)(g,this.setChildNode)})}return t.length===1?t[0]:t.map(function(v,x){return!M.isValidElement(v)||"key"in v&&v.key!==null?v:M.cloneElement(v,{key:"".concat(o,"-").concat(x)})})}}]),s}(M.Component);a.displayName="ResizeObserver",ve.a=a},t9D7:function(st,ve,z){"use strict";z.d(ve,"b",function(){return H}),z.d(ve,"g",function(){return e}),z.d(ve,"d",function(){return C}),z.d(ve,"e",function(){return f}),z.d(ve,"a",function(){return p}),z.d(ve,"f",function(){return r}),z.d(ve,"c",function(){return h});var q=z("Vhoy"),j=z("MI8n"),A=z("pmY6"),U=z("Cg/j"),O=z("ic2d"),M=z("nEHx");const H=Object(U.c)("themeService");var F;(function(s){function n(i){return i&&typeof i=="object"&&typeof i.id=="string"}s.isThemeColor=n})(F||(F={}));function e(s){return{id:s}}var C;(function(s){function n(x){return x&&typeof x=="object"&&typeof x.id=="string"&&(typeof x.color=="undefined"||F.isThemeColor(x.color))}s.isThemeIcon=n;const i=new RegExp(`^\\$\\((${q.a.iconNameExpression}(?:${q.a.iconModifierExpression})?)\\)$`);function t(x){const E=i.exec(x);if(!E)return;let[,y]=E;return{id:y}}s.fromString=t;function _(x,E){let y=x.id;const c=y.lastIndexOf("~");return c!==-1&&(y=y.substring(0,c)),E&&(y=`${y}~${E}`),{id:y}}s.modify=_;function g(x,E){var y,c;return x.id===E.id&&((y=x.color)===null||y===void 0?void 0:y.id)===((c=E.color)===null||c===void 0?void 0:c.id)}s.isEqual=g;function v(x,E){return{id:x.id,color:E?e(E):void 0}}s.asThemeIcon=v,s.asClassNameArray=q.a.asClassNameArray,s.asClassName=q.a.asClassName,s.asCSSSelector=q.a.asCSSSelector})(C||(C={}));function f(s){switch(s){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class o{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new j.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(A.i)(()=>{const n=this.themingParticipants.indexOf(s);this.themingParticipants.splice(n,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new o;O.a.add(p.ThemingContribution,a);function r(s){return a.onColorThemeChange(s)}class h extends A.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(n=>this.onThemeChange(n)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(st,ve,z){typeof window!="undefined"&&function(j,A){st.exports=A()}(this,function(){return function(q){var j={};function A(U){if(j[U])return j[U].exports;var O=j[U]={i:U,l:!1,exports:{}};return q[U].call(O.exports,O,O.exports,A),O.l=!0,O.exports}return A.m=q,A.c=j,A.d=function(U,O,M){A.o(U,O)||Object.defineProperty(U,O,{enumerable:!0,get:M})},A.r=function(U){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(U,"__esModule",{value:!0})},A.t=function(U,O){if(O&1&&(U=A(U)),O&8)return U;if(O&4&&typeof U=="object"&&U&&U.__esModule)return U;var M=Object.create(null);if(A.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:U}),O&2&&typeof U!="string")for(var H in U)A.d(M,H,function(F){return U[F]}.bind(null,H));return M},A.n=function(U){var O=U&&U.__esModule?function(){return U.default}:function(){return U};return A.d(O,"a",O),O},A.o=function(U,O){return Object.prototype.hasOwnProperty.call(U,O)},A.p="/dist/",A(A.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,j,A){"use strict";var U=Object.prototype.hasOwnProperty,O="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(O=!1));function H(f,p,o){this.fn=f,this.context=p,this.once=o||!1}function F(f,p,o,a,r){if(typeof o!="function")throw new TypeError("The listener must be a function");var h=new H(o,a||f,r),s=O?O+p:p;return f._events[s]?f._events[s].fn?f._events[s]=[f._events[s],h]:f._events[s].push(h):(f._events[s]=h,f._eventsCount++),f}function e(f,p){--f._eventsCount===0?f._events=new M:delete f._events[p]}function C(){this._events=new M,this._eventsCount=0}C.prototype.eventNames=function(){var p=[],o,a;if(this._eventsCount===0)return p;for(a in o=this._events)U.call(o,a)&&p.push(O?a.slice(1):a);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(o)):p},C.prototype.listeners=function(p){var o=O?O+p:p,a=this._events[o];if(!a)return[];if(a.fn)return[a.fn];for(var r=0,h=a.length,s=new Array(h);r<h;r++)s[r]=a[r].fn;return s},C.prototype.listenerCount=function(p){var o=O?O+p:p,a=this._events[o];return a?a.fn?1:a.length:0},C.prototype.emit=function(p,o,a,r,h,s){var n=O?O+p:p;if(!this._events[n])return!1;var i=this._events[n],t=arguments.length,_,g;if(i.fn){i.once&&this.removeListener(p,i.fn,void 0,!0);switch(t){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,o),!0;case 3:return i.fn.call(i.context,o,a),!0;case 4:return i.fn.call(i.context,o,a,r),!0;case 5:return i.fn.call(i.context,o,a,r,h),!0;case 6:return i.fn.call(i.context,o,a,r,h,s),!0}for(g=1,_=new Array(t-1);g<t;g++)_[g-1]=arguments[g];i.fn.apply(i.context,_)}else{var v=i.length,x;for(g=0;g<v;g++){i[g].once&&this.removeListener(p,i[g].fn,void 0,!0);switch(t){case 1:i[g].fn.call(i[g].context);break;case 2:i[g].fn.call(i[g].context,o);break;case 3:i[g].fn.call(i[g].context,o,a);break;case 4:i[g].fn.call(i[g].context,o,a,r);break;default:if(!_)for(x=1,_=new Array(t-1);x<t;x++)_[x-1]=arguments[x];i[g].fn.apply(i[g].context,_)}}}return!0},C.prototype.on=function(p,o,a){return F(this,p,o,a,!1)},C.prototype.once=function(p,o,a){return F(this,p,o,a,!0)},C.prototype.removeListener=function(p,o,a,r){var h=O?O+p:p;if(!this._events[h])return this;if(!o)return e(this,h),this;var s=this._events[h];if(s.fn)s.fn===o&&(!r||s.once)&&(!a||s.context===a)&&e(this,h);else{for(var n=0,i=[],t=s.length;n<t;n++)(s[n].fn!==o||r&&!s[n].once||a&&s[n].context!==a)&&i.push(s[n]);i.length?this._events[h]=i.length===1?i[0]:i:e(this,h)}return this},C.prototype.removeAllListeners=function(p){var o;return p?(o=O?O+p:p,this._events[o]&&e(this,o)):(this._events=new M,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=O,C.EventEmitter=C,q.exports=C},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,j,A){(function(U){var O=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(C,f,p){if(p=p||{},C=C.trim(),f=f.trim(),!f){if(!p.alwaysNormalize)return C;var o=e.parseURL(C);if(!o)throw new Error("Error trying to parse base URL.");return o.path=e.normalizePath(o.path),e.buildURLFromParts(o)}var a=e.parseURL(f);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return p.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):f;var r=e.parseURL(C);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var h=M.exec(r.path);r.netLoc=h[1],r.path=h[2]}r.netLoc&&!r.path&&(r.path="/");var s={scheme:r.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=r.netLoc,a.path[0]!=="/"))if(!a.path)s.path=r.path,a.params||(s.params=r.params,a.query||(s.query=r.query));else{var n=r.path,i=n.substring(0,n.lastIndexOf("/")+1)+a.path;s.path=e.normalizePath(i)}return s.path===null&&(s.path=p.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(C){var f=O.exec(C);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(C){for(C=C.split("").reverse().join("").replace(H,"");C.length!==(C=C.replace(F,"")).length;);return C.split("").reverse().join("")},buildURLFromParts:function(C){return C.scheme+C.netLoc+C.path+C.params+C.query+C.fragment}};q.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(q,j,A){function U(p){var o={};function a(h){if(o[h])return o[h].exports;var s=o[h]={i:h,l:!1,exports:{}};return p[h].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=p,a.c=o,a.i=function(h){return h},a.d=function(h,s,n){a.o(h,s)||Object.defineProperty(h,s,{configurable:!1,enumerable:!0,get:n})},a.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},a.n=function(h){var s=h&&h.__esModule?function(){return h.default}:function(){return h};return a.d(s,"a",s),s},a.o=function(h,s){return Object.prototype.hasOwnProperty.call(h,s)},a.p="/",a.oe=function(h){throw console.error(h),h};var r=a(a.s=ENTRY_MODULE);return r.default||r}var O="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+O+").*?\\)";function H(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(p){return!isNaN(1*p)}function e(p,o,a){var r={};r[a]=[];var h=o.toString(),s=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return r;for(var n=s[1],i=new RegExp("(\\\\n|\\W)"+H(n)+M,"g"),t;t=i.exec(h);){if(t[3]==="dll-reference")continue;r[a].push(t[3])}for(i=new RegExp("\\("+H(n)+'\\("(dll-reference\\s('+O+'))"\\)\\)'+M,"g");t=i.exec(h);)p[t[2]]||(r[a].push(t[1]),p[t[2]]=A(t[1]).m),r[t[2]]=r[t[2]]||[],r[t[2]].push(t[4]);for(var _=Object.keys(r),g=0;g<_.length;g++)for(var v=0;v<r[_[g]].length;v++)F(r[_[g]][v])&&(r[_[g]][v]=1*r[_[g]][v]);return r}function C(p){var o=Object.keys(p);return o.reduce(function(a,r){return a||p[r].length>0},!1)}function f(p,o){for(var a={main:[o]},r={main:[]},h={main:{}};C(a);)for(var s=Object.keys(a),n=0;n<s.length;n++){var i=s[n],t=a[i],_=t.pop();if(h[i]=h[i]||{},h[i][_]||!p[i][_])continue;h[i][_]=!0,r[i]=r[i]||[],r[i].push(_);for(var g=e(p,p[i][_],i),v=Object.keys(g),x=0;x<v.length;x++)a[v[x]]=a[v[x]]||[],a[v[x]]=a[v[x]].concat(g[v[x]])}return r}q.exports=function(p,o){o=o||{};var a={main:A.m},r=o.all?{main:Object.keys(a.main)}:f(a,p),h="";Object.keys(r).filter(function(_){return _!=="main"}).forEach(function(_){for(var g=0;r[_][g];)g++;r[_].push(g),a[_][g]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+_+" = ("+U.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+r[_].map(function(v){return""+JSON.stringify(v)+": "+a[_][v].toString()}).join(",")+`});
|
|
`}),h=h+"new (("+U.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+r.main.map(function(_){return""+JSON.stringify(_)+": "+a.main[_].toString()}).join(",")+"}))(self);";var s=new window.Blob([h],{type:"text/javascript"});if(o.bare)return s;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,i=n.createObjectURL(s),t=new window.Worker(i);return t.objectURL=i,t}},"./src/config.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"hlsDefaultConfig",function(){return x}),A.d(j,"mergeConfig",function(){return y}),A.d(j,"enableStreamingMode",function(){return c});var U=A("./src/controller/abr-controller.ts"),O=A("./src/controller/audio-stream-controller.ts"),M=A("./src/controller/audio-track-controller.ts"),H=A("./src/controller/subtitle-stream-controller.ts"),F=A("./src/controller/subtitle-track-controller.ts"),e=A("./src/controller/buffer-controller.ts"),C=A("./src/controller/timeline-controller.ts"),f=A("./src/controller/cap-level-controller.ts"),p=A("./src/controller/fps-controller.ts"),o=A("./src/controller/eme-controller.ts"),a=A("./src/controller/cmcd-controller.ts"),r=A("./src/utils/xhr-loader.ts"),h=A("./src/utils/fetch-loader.ts"),s=A("./src/utils/cues.ts"),n=A("./src/utils/mediakeys-helper.ts"),i=A("./src/utils/logger.ts");function t(){return t=Object.assign||function(u){for(var l=1;l<arguments.length;l++){var b=arguments[l];for(var m in b)Object.prototype.hasOwnProperty.call(b,m)&&(u[m]=b[m])}return u},t.apply(this,arguments)}function _(u,l){var b=Object.keys(u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(u);l&&(m=m.filter(function(w){return Object.getOwnPropertyDescriptor(u,w).enumerable})),b.push.apply(b,m)}return b}function g(u){for(var l=1;l<arguments.length;l++){var b=arguments[l]!=null?arguments[l]:{};l%2?_(Object(b),!0).forEach(function(m){v(u,m,b[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(b)):_(Object(b)).forEach(function(m){Object.defineProperty(u,m,Object.getOwnPropertyDescriptor(b,m))})}return u}function v(u,l,b){return l in u?Object.defineProperty(u,l,{value:b,enumerable:!0,configurable:!0,writable:!0}):u[l]=b,u}var x=g(g({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:U.default,bufferController:e.default,capLevelController:f.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:F.default,timelineController:C.TimelineController,audioStreamController:O.default,audioTrackController:M.default,emeController:o.default,cmcdController:a.default});function E(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function y(u,l){if((l.liveSyncDurationCount||l.liveMaxLatencyDurationCount)&&(l.liveSyncDuration||l.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(l.liveMaxLatencyDurationCount!==void 0&&(l.liveSyncDurationCount===void 0||l.liveMaxLatencyDurationCount<=l.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(l.liveMaxLatencyDuration!==void 0&&(l.liveSyncDuration===void 0||l.liveMaxLatencyDuration<=l.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},u,l)}function c(u){var l=u.loader;if(l!==h.default&&l!==r.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var b=Object(h.fetchSupported)();b&&(u.loader=h.default,u.progressive=!0,u.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/polyfills/number.ts"),O=A("./src/utils/ewma-bandwidth-estimator.ts"),M=A("./src/events.ts"),H=A("./src/utils/buffer-helper.ts"),F=A("./src/errors.ts"),e=A("./src/types/loader.ts"),C=A("./src/utils/logger.ts");function f(a,r){for(var h=0;h<r.length;h++){var s=r[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function p(a,r,h){return r&&f(a.prototype,r),h&&f(a,h),a}var o=function(){function a(h){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=h;var s=h.config;this.bwEstimator=new O.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var r=a.prototype;return r.registerListeners=function(){var s=this.hls;s.on(M.Events.FRAG_LOADING,this.onFragLoading,this),s.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(M.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var s=this.hls;s.off(M.Events.FRAG_LOADING,this.onFragLoading,this),s.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(M.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(s,n){var i=n.frag;if(i.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=i,this.partCurrent=(t=n.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(s,n){var i=this.hls.config;n.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var s=this.fragCurrent,n=this.partCurrent,i=this.hls,t=i.autoLevelEnabled,_=i.config,g=i.media;if(!s||!g)return;var v=n?n.stats:s.stats,x=n?n.duration:s.duration;if(v.aborted){C.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||g.paused||!g.playbackRate||!g.readyState)return;var E=performance.now()-v.loading.start,y=Math.abs(g.playbackRate);if(E<=500*x/y)return;var c=i.levels,u=i.minAutoLevel,l=c[s.level],b=v.total||Math.max(v.loaded,Math.round(x*l.maxBitrate/8)),m=Math.max(1,v.bwEstimate?v.bwEstimate/8:v.loaded*1e3/E),w=(b-v.loaded)/m,I=g.currentTime,L=(H.BufferHelper.bufferInfo(g,I,_.maxBufferHole).end-I)/y;if(L>=2*x/y||w<=L)return;var S=Number.POSITIVE_INFINITY,D;for(D=s.level-1;D>u;D--){var B=c[D].maxBitrate;if(S=x*B/(8*.8*m),S<L)break}if(S>=w)return;var R=this.bwEstimator.getEstimate();C.logger.warn("Fragment "+s.sn+(n?" part "+n.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+D+`
|
|
Current BW estimate: `+(Object(U.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+w.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+S.toFixed(3)+` s
|
|
Time to underbuffer: `+L.toFixed(3)+" s"),i.nextLoadLevel=D,this.bwEstimator.sample(E,v.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),i.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:n,stats:v})},r.onFragLoaded=function(s,n){var i=n.frag,t=n.part;if(i.type===e.PlaylistLevelType.MAIN&&Object(U.isFiniteNumber)(i.sn)){var _=t?t.stats:i.stats,g=t?t.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var v=this.hls.levels[i.level],x=(v.loaded?v.loaded.bytes:0)+_.loaded,E=(v.loaded?v.loaded.duration:0)+g;v.loaded={bytes:x,duration:E},v.realBitrate=Math.round(8*x/E)}if(i.bitrateTest){var y={stats:_,frag:i,part:t,id:i.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,y),i.bitrateTest=!1}}},r.onFragBuffered=function(s,n){var i=n.frag,t=n.part,_=t?t.stats:i.stats;if(_.aborted)return;if(i.type!==e.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var g=_.parsing.end-_.loading.start;this.bwEstimator.sample(g,_.loaded),_.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},r.onError=function(s,n){switch(n.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var s=this.fragCurrent,n=this.partCurrent,i=this.hls,t=i.maxAutoLevel,_=i.config,g=i.minAutoLevel,v=i.media,x=n?n.duration:s?s.duration:0,E=v?v.currentTime:0,y=v&&v.playbackRate!==0?Math.abs(v.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():_.abrEwmaDefaultEstimate,u=(H.BufferHelper.bufferInfo(v,E,_.maxBufferHole).end-E)/y,l=this.findBestLevel(c,g,t,u,_.abrBandWidthFactor,_.abrBandWidthUpFactor);if(l>=0)return l;C.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=x?Math.min(x,_.maxStarvationDelay):_.maxStarvationDelay,m=_.abrBandWidthFactor,w=_.abrBandWidthUpFactor;if(!u){var I=this.bitrateTestDelay;if(I){var L=x?Math.min(x,_.maxLoadingDelay):_.maxLoadingDelay;b=L-I,C.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),m=w=1}}return l=this.findBestLevel(c,g,t,u+b,m,w),Math.max(l,0)},r.findBestLevel=function(s,n,i,t,_,g){for(var v,x=this.fragCurrent,E=this.partCurrent,y=this.lastLoadedFragLevel,c=this.hls.levels,u=c[y],l=!!(u!=null&&(v=u.details)!==null&&v!==void 0&&v.live),b=u==null?void 0:u.codecSet,m=E?E.duration:x?x.duration:0,w=i;w>=n;w--){var I=c[w];if(!I||b&&I.codecSet!==b)continue;var L=I.details,S=(E?L==null?void 0:L.partTarget:L==null?void 0:L.averagetargetduration)||m,D=void 0;w<=y?D=_*s:D=g*s;var B=c[w].maxBitrate,R=B*S/D;if(C.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(D)+"/"+B+"/"+S+"/"+t+"/"+R),D>B&&(!R||l&&!this.bitrateTestDelay||R<t))return w}return-1},p(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,n=this.bwEstimator;if(s!==-1&&(!n||!n.canEstimate()))return s;var i=this.getNextABRAutoLevel();return s!==-1&&(i=Math.min(s,i)),i},set:function(s){this._nextAutoLevel=s}}]),a}();j.default=o},"./src/controller/audio-stream-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/polyfills/number.ts"),O=A("./src/controller/base-stream-controller.ts"),M=A("./src/events.ts"),H=A("./src/utils/buffer-helper.ts"),F=A("./src/controller/fragment-tracker.ts"),e=A("./src/types/level.ts"),C=A("./src/types/loader.ts"),f=A("./src/loader/fragment.ts"),p=A("./src/demux/chunk-cache.ts"),o=A("./src/demux/transmuxer-interface.ts"),a=A("./src/types/transmuxer.ts"),r=A("./src/controller/fragment-finders.ts"),h=A("./src/utils/discontinuities.ts"),s=A("./src/errors.ts"),n=A("./src/utils/logger.ts");function i(){return i=Object.assign||function(x){for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&(x[c]=y[c])}return x},i.apply(this,arguments)}function t(x,E){x.prototype=Object.create(E.prototype),x.prototype.constructor=x,_(x,E)}function _(x,E){return _=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},_(x,E)}var g=100,v=function(x){t(E,x);function E(c,u){var l;return l=x.call(this,c,u,"[audio-stream-controller]")||this,l.videoBuffer=null,l.videoTrackCC=-1,l.waitingVideoCC=-1,l.audioSwitch=!1,l.trackId=-1,l.waitingData=null,l.mainDetails=null,l.bufferFlushed=!1,l._registerListeners(),l}var y=E.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var u=this.hls;u.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(M.Events.ERROR,this.onError,this),u.on(M.Events.BUFFER_RESET,this.onBufferReset,this),u.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var u=this.hls;u.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(M.Events.ERROR,this.onError,this),u.off(M.Events.BUFFER_RESET,this.onBufferReset,this),u.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(u,l){var b=l.frag,m=l.id,w=l.initPTS;if(m==="main"){var I=b.cc;this.initPTS[b.cc]=w,this.log("InitPTS for cc: "+I+" found from main: "+w),this.videoTrackCC=I,this.state===O.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=O.State.STOPPED;return}var l=this.lastCurrentTime;this.stopLoad(),this.setInterval(g),this.fragLoadError=0,l>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),this.state=O.State.IDLE):(this.loadedmetadata=!1,this.state=O.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},y.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_TRACK:{var u,l=this.levels,b=this.trackId,m=l==null||((u=l[b])===null||u===void 0)?void 0:u.details;if(m){if(this.waitForCdnTuneIn(m))break;this.state=O.State.WAITING_INIT_PTS}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var w,I=performance.now(),L=this.retryDate;(!L||I>=L||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=O.State.IDLE);break}case O.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var D=S.frag,B=S.part,R=S.cache,W=S.complete;if(this.initPTS[D.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.FRAG_LOADING;var Y=R.flush(),se={frag:D,part:B,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(se),W&&x.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+D.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ne=this.getLoadPosition(),Se=H.BufferHelper.bufferInfo(this.mediaBuffer,ne,this.config.maxBufferHole),xe=Object(r.fragmentWithinToleranceTest)(Se.end,this.config.maxFragLookUpTolerance,D);xe<0&&(n.logger.log("Waiting fragment cc ("+D.cc+") @ "+D.start+" cancelled because another fragment at "+Se.end+" is needed"),this.clearWaitingFragment())}}else this.state=O.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.IDLE)},y.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var l=this.mediaBuffer?this.mediaBuffer:u,b=l.buffered;!this.loadedmetadata&&b.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},y.doTickIdle=function(){var u,l,b=this.hls,m=this.levels,w=this.media,I=this.trackId,L=b.config;if(!m||!m[I])return;if(!w&&(this.startFragRequested||!L.startFragPrefetch))return;var S=m[I],D=S.details;if(!D||D.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(D)){this.state=O.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,f.ElementaryStreamTypes.AUDIO,C.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,C.PlaylistLevelType.AUDIO);if(B===null)return;var R=B.len,W=this.getMaxBufferLength(),Y=this.audioSwitch;if(R>=W&&!Y)return;if(!Y&&this._streamEnded(B,D)){b.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=O.State.ENDED;return}var se=D.fragments,ne=se[0].start,Se=B.end;if(Y){var xe=this.getLoadPosition();Se=xe,D.PTSKnown&&xe<ne&&((B.end>ne||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=ne+.05))}var we=this.getNextFragment(Se,D);if(!we){this.bufferFlushed=!0;return}((u=we.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((l=we.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(we,D):this.loadFragment(we,D,Se)},y.getMaxBufferLength=function(){var u=x.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,C.PlaylistLevelType.MAIN);return l===null?u:Math.max(u,l.len)},y.onMediaDetaching=function(){this.videoBuffer=null,x.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(u,l){var b=l.audioTracks;this.resetTransmuxer(),this.levels=b.map(function(m){return new e.Level(m)})},y.onAudioTrackSwitching=function(u,l){var b=!!l.url;this.trackId=l.id;var m=this.fragCurrent;m!=null&&m.loader&&m.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),b?this.setInterval(g):this.resetTransmuxer(),b?(this.audioSwitch=!0,this.state=O.State.IDLE):this.state=O.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(u,l){this.mainDetails=l.details},y.onAudioTrackLoaded=function(u,l){var b,m=this.levels,w=l.details,I=l.id;if(!m){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var L=m[I],S=0;if(w.live||(b=L.details)!==null&&b!==void 0&&b.live){var D=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!D)return;!L.details&&w.hasProgramDateTime&&D.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(w,D),S=w.fragments[0].start):S=this.alignPlaylists(w,L.details)}L.details=w,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(L.details,S),this.state===O.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=O.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(u){var l,b=u.frag,m=u.part,w=u.payload,I=this.config,L=this.trackId,S=this.levels;if(!S){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+b.sn+" of level "+b.level+" will not be buffered");return}var D=S[L];console.assert(D,"Audio track is defined on fragment load progress");var B=D.details;console.assert(B,"Audio track details are defined on fragment load progress");var R=I.defaultAudioCodec||D.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new o.default(this.hls,C.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[b.cc],se=(l=b.initSegment)===null||l===void 0?void 0:l.data;if(Y!==void 0){var ne=!1,Se=m?m.index:-1,xe=Se!==-1,we=new a.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,w.byteLength,Se,xe);W.push(w,se,R,"",b,m,B.totalduration,ne,we,Y)}else{n.logger.log("Unknown video PTS for cc "+b.cc+", waiting for video PTS before demuxing audio frag "+b.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+L);var Re=this.waitingData=this.waitingData||{frag:b,part:m,cache:new p.default,complete:!1},Pe=Re.cache;Pe.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=O.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}x.prototype._handleFragmentLoadComplete.call(this,u)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(u,l){var b=l.tracks.audio;b&&(this.mediaBuffer=b.buffer),l.tracks.video&&(this.videoBuffer=l.tracks.video.buffer)},y.onFragBuffered=function(u,l){var b=l.frag,m=l.part;if(b.type!==C.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(b)){this.warn("Fragment "+b.sn+(m?" p: "+m.index:"")+" of level "+b.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}b.sn!=="initSegment"&&(this.fragPrevious=b,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(b,m)},y.onError=function(u,l){switch(l.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(C.PlaylistLevelType.AUDIO,l);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==O.State.ERROR&&this.state!==O.State.STOPPED&&(this.state=l.fatal?O.State.ERROR:O.State.IDLE,this.warn(l.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="audio"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var b=!0,m=this.getFwdBufferInfo(this.mediaBuffer,C.PlaylistLevelType.AUDIO);m&&m.len>.5&&(b=!this.reduceMaxBufferLength(m.len)),b&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,x.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(u,l){var b=l.type;b===f.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(u){var l,b="audio",m=this.hls,w=u.remuxResult,I=u.chunkMeta,L=this.getCurrentContext(I);if(!L){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var S=L.frag,D=L.part,B=w.audio,R=w.text,W=w.id3,Y=w.initSegment;if(this.fragContextChanged(S))return;if(this.state=O.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,S,I),m.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:b,tracks:Y.tracks})),B){var se=B.startPTS,ne=B.endPTS,Se=B.startDTS,xe=B.endDTS;D&&(D.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:ne,startDTS:Se,endDTS:xe}),S.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,se,ne,Se,xe),this.bufferFragmentData(B,S,D,I)}if(W!=null&&(l=W.samples)!==null&&l!==void 0&&l.length){var we=i({frag:S,id:b},W);m.trigger(M.Events.FRAG_PARSING_METADATA,we)}if(R){var Re=i({frag:S,id:b},R);m.trigger(M.Events.FRAG_PARSING_USERDATA,Re)}},y._bufferInitSegment=function(u,l,b){if(this.state!==O.State.PARSING)return;u.video&&delete u.video;var m=u.audio;if(!m)return;m.levelCodec=m.codec,m.id="audio",this.log("Init audio buffer, container:"+m.container+", codecs[parsed]=["+m.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,u);var w=m.initSegment;if(w!=null&&w.byteLength){var I={type:"audio",frag:l,part:null,chunkMeta:b,parent:l.type,data:w};this.hls.trigger(M.Events.BUFFER_APPENDING,I)}this.tick()},y.loadFragment=function(u,l,b){var m=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||m===F.FragmentState.NOT_LOADED||m===F.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):l.live&&!Object(U.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=O.State.WAITING_INIT_PTS):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,u,l,b)))},y.completeAudioSwitch=function(){var u=this.hls,l=this.media,b=this.trackId;l&&(this.log("Switching audio track : flushing all audio"),x.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:b})},E}(O.default);j.default=v},"./src/controller/audio-track-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/events.ts"),O=A("./src/errors.ts"),M=A("./src/controller/base-playlist-controller.ts"),H=A("./src/types/loader.ts");function F(o,a){for(var r=0;r<a.length;r++){var h=a[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(o,h.key,h)}}function e(o,a,r){return a&&F(o.prototype,a),r&&F(o,r),o}function C(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,f(o,a)}function f(o,a){return f=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},f(o,a)}var p=function(o){C(a,o);function a(h){var s;return s=o.call(this,h,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var r=a.prototype;return r.registerListeners=function(){var s=this.hls;s.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(U.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var s=this.hls;s.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(U.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(s,n){this.tracks=n.audioTracks||[]},r.onAudioTrackLoaded=function(s,n){var i=n.id,t=n.details,_=this.tracksInGroup[i];if(!_){this.warn("Invalid audio track id "+i);return}var g=_.details;_.details=n.details,this.log("audioTrack "+i+" loaded ["+t.startSN+"-"+t.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,n,g))},r.onLevelLoading=function(s,n){this.switchLevel(n.level)},r.onLevelSwitching=function(s,n){this.switchLevel(n.level)},r.switchLevel=function(s){var n=this.hls.levels[s];if(!(n!=null&&n.audioGroupIds))return;var i=n.audioGroupIds[n.urlId];if(this.groupId!==i){this.groupId=i;var t=this.tracks.filter(function(g){return!i||g.groupId===i});this.selectDefaultTrack&&!t.some(function(g){return g.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var _={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(U.Events.AUDIO_TRACKS_UPDATED,_),this.selectInitialTrack()}},r.onError=function(s,n){if(o.prototype.onError.call(this,s,n),n.fatal||!n.context)return;n.context.type===H.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},r.setAudioTrack=function(s){var n=this.tracksInGroup;if(s<0||s>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=n[this.trackId];this.log("Now switching to audio-track index "+s);var t=n[s],_=t.id,g=t.groupId,v=g===void 0?"":g,x=t.name,E=t.type,y=t.url;if(this.trackId=s,this.trackName=x,this.selectDefaultTrack=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHING,{id:_,groupId:v,name:x,type:E,url:y}),t.details&&!t.details.live)return;var c=this.switchParams(t.url,i==null?void 0:i.details);this.loadPlaylist(c)},r.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,i=this.findTrackId(n)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(s){for(var n=this.tracksInGroup,i=0;i<n.length;i++){var t=n[i];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},r.loadPlaylist=function(s){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var i=n.id,t=n.groupId,_=n.url;if(s)try{_=s.addDirectives(_)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(U.Events.AUDIO_TRACK_LOADING,{url:_,id:i,groupId:t,deliveryDirectives:s||null})}},e(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(M.default);j.default=p},"./src/controller/base-playlist-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return e});var U=A("./src/polyfills/number.ts"),O=A("./src/types/level.ts"),M=A("./src/controller/level-helper.ts"),H=A("./src/utils/logger.ts"),F=A("./src/errors.ts"),e=function(){function C(p,o){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,o+":"),this.warn=H.logger.warn.bind(H.logger,o+":"),this.hls=p}var f=C.prototype;return f.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},f.onError=function(o,a){a.fatal&&a.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},f.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},f.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},f.stopLoad=function(){this.canLoad=!1,this.clearTimer()},f.switchParams=function(o,a){var r=a==null?void 0:a.renditionReports;if(r)for(var h=0;h<r.length;h++){var s=r[h],n=""+s.URI;if(n===o.substr(-n.length)){var i=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var _=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&_>a.partTarget&&(t+=1)}if(Object(U.isFiniteNumber)(i))return new O.HlsUrlParameters(i,Object(U.isFiniteNumber)(t)?t:void 0,O.HlsSkip.No)}}},f.loadPlaylist=function(o){},f.shouldLoadTrack=function(o){return this.canLoad&&o&&!!o.url&&(!o.details||o.details.live)},f.playlistLoaded=function(o,a,r){var h=this,s=a.details,n=a.stats,i=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(s.advancedDateTime=Date.now()-i,s.live||r!=null&&r.live){if(s.reloaded(r),r&&this.log("live playlist "+o+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),r&&s.fragments.length>0&&Object(M.mergeDetails)(r,s),!this.canLoad||!s.live)return;var t,_=void 0,g=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var v=this.hls.config.lowLatencyMode,x=s.lastPartSn,E=s.endSN,y=s.lastPartIndex,c=y!==-1,u=x===E,l=v?0:y;c?(_=u?E+1:x,g=u?l:y+1):_=E+1;var b=s.age,m=b+s.ageHeader,w=Math.min(m-s.partTarget,s.targetduration*1.5);if(w>0){if(r&&w>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+w+" with playlist age: "+s.age),w=0;else{var I=Math.floor(w/s.targetduration);if(_+=I,g!==void 0){var L=Math.round(w%s.targetduration/s.partTarget);g+=L}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+w+" skip sn "+I+" to part "+g)}s.tuneInGoal=w}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,_,g),v||!u){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,_,g);var S=Object(M.computeReloadInterval)(s,n);_!==void 0&&s.canBlockReload&&(S-=s.partTarget||1),this.log("reload live playlist "+o+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(t)},S)}else this.clearTimer()},f.getDeliveryDirectives=function(o,a,r,h){var s=Object(O.getSkipValue)(o,r);return a!=null&&a.skip&&o.deltaUpdateFailed&&(r=a.msn,h=a.part,s=O.HlsSkip.No),new O.HlsUrlParameters(r,h,s)},f.retryLoadingOrFail=function(o){var a=this,r=this.hls.config,h=this.retryCount<r.levelLoadingMaxRetry;if(h){var s;if(this.retryCount++,o.details.indexOf("LoadTimeOut")>-1&&(s=o.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+o.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+o.details+'"')}}else this.warn('cannot recover from error "'+o.details+'"'),this.clearTimer(),o.fatal=!0;return h},C}()},"./src/controller/base-stream-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"State",function(){return E}),A.d(j,"default",function(){return y});var U=A("./src/polyfills/number.ts"),O=A("./src/task-loop.ts"),M=A("./src/controller/fragment-tracker.ts"),H=A("./src/utils/buffer-helper.ts"),F=A("./src/utils/logger.ts"),e=A("./src/events.ts"),C=A("./src/errors.ts"),f=A("./src/types/transmuxer.ts"),p=A("./src/utils/mp4-tools.ts"),o=A("./src/utils/discontinuities.ts"),a=A("./src/controller/fragment-finders.ts"),r=A("./src/controller/level-helper.ts"),h=A("./src/loader/fragment-loader.ts"),s=A("./src/crypt/decrypter.ts"),n=A("./src/utils/time-ranges.ts"),i=A("./src/types/loader.ts");function t(c,u){for(var l=0;l<u.length;l++){var b=u[l];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}function _(c,u,l){return u&&t(c.prototype,u),l&&t(c,l),c}function g(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function v(c,u){c.prototype=Object.create(u.prototype),c.prototype.constructor=c,x(c,u)}function x(c,u){return x=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},x(c,u)}var E={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},y=function(c){v(u,c);function u(b,m,w){var I;return I=c.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=E.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=w,I.log=F.logger.log.bind(F.logger,w+":"),I.warn=F.logger.warn.bind(F.logger,w+":"),I.hls=b,I.fragmentLoader=new h.default(b.config),I.fragmentTracker=m,I.config=b.config,I.decrypter=new s.default(b,b.config),b.on(e.Events.KEY_LOADED,I.onKeyLoaded,g(I)),I}var l=u.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(m){},l.stopLoad=function(){this.fragmentLoader.abort();var m=this.fragCurrent;m&&this.fragmentTracker.removeFragment(m),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},l._streamEnded=function(m,w){var I=this.fragCurrent,L=this.fragmentTracker;if(!w.live&&I&&I.sn===w.endSN&&!m.nextStart){var S=L.getState(I);return S===M.FragmentState.PARTIAL||S===M.FragmentState.OK}return!1},l.onMediaAttached=function(m,w){var I=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var L=this.config;this.levels&&L.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(L.startPosition)},l.onMediaDetaching=function(){var m=this.media;m!=null&&m.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),m&&(m.removeEventListener("seeking",this.onvseeking),m.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},l.onMediaSeeking=function(){var m=this.config,w=this.fragCurrent,I=this.media,L=this.mediaBuffer,S=this.state,D=I?I.currentTime:0,B=H.BufferHelper.bufferInfo(L||I,D,m.maxBufferHole);if(this.log("media seeking to "+(Object(U.isFiniteNumber)(D)?D.toFixed(3):D)+", state: "+S),S===E.ENDED)this.resetLoadingState();else if(w&&!B.len){var R=m.maxFragLookUpTolerance,W=w.start-R,Y=w.start+w.duration+R,se=D>Y;(D<W||se)&&(se&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=D),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=D),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(m,w){if(this.state!==E.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var I=this.levels[w.frag.level].details;I&&this.loadFragment(w.frag,I,w.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},l.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(e.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,c.prototype.onHandlerDestroyed.call(this)},l.loadKey=function(m,w){this.log("Loading key for "+m.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level),this.state=E.KEY_LOADING,this.fragCurrent=m,this.hls.trigger(e.Events.KEY_LOADING,{frag:m})},l.loadFragment=function(m,w,I){this._loadFragForPlayback(m,w,I)},l._loadFragForPlayback=function(m,w,I){var L=this,S=function(B){if(L.fragContextChanged(m)){L.warn("Fragment "+m.sn+(B.part?" p: "+B.part.index:"")+" of level "+m.level+" was dropped during download."),L.fragmentTracker.removeFragment(m);return}m.stats.chunkCount++,L._handleFragmentLoadProgress(B)};this._doFragLoad(m,w,I,S).then(function(D){if(!D)return;L.fragLoadError=0;var B=L.state;if(L.fragContextChanged(m)){(B===E.FRAG_LOADING||B===E.BACKTRACKING||!L.fragCurrent&&B===E.PARSING)&&(L.fragmentTracker.removeFragment(m),L.state=E.IDLE);return}if("payload"in D&&(L.log("Loaded fragment "+m.sn+" of level "+m.level),L.hls.trigger(e.Events.FRAG_LOADED,D),L.state===E.BACKTRACKING)){L.fragmentTracker.backtrack(m,D),L.resetFragmentLoading(m);return}L._handleFragmentLoadComplete(D)}).catch(function(D){L.warn(D),L.resetFragmentLoading(m)})},l.flushMainBuffer=function(m,w,I){if(I===void 0&&(I=null),!(m-w))return;var L={startOffset:m,endOffset:w,type:I};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,L)},l._loadInitSegment=function(m){var w=this;this._doFragLoad(m).then(function(I){if(!I||w.fragContextChanged(m)||!w.levels)throw new Error("init load aborted");return I}).then(function(I){var L=w.hls,S=I.payload,D=m.decryptdata;if(S&&S.byteLength>0&&D&&D.key&&D.iv&&D.method==="AES-128"){var B=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(S),D.key.buffer,D.iv.buffer).then(function(R){var W=self.performance.now();return L.trigger(e.Events.FRAG_DECRYPTED,{frag:m,payload:R,stats:{tstart:B,tdecrypt:W}}),I.payload=R,I})}return I}).then(function(I){var L=w.fragCurrent,S=w.hls,D=w.levels;if(!D)throw new Error("init load aborted, missing levels");var B=D[m.level].details;console.assert(B,"Level details are defined when init segment is loaded");var R=m.stats;w.state=E.IDLE,w.fragLoadError=0,m.data=new Uint8Array(I.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),I.frag===L&&S.trigger(e.Events.FRAG_BUFFERED,{stats:R,frag:L,part:null,id:m.type}),w.tick()}).catch(function(I){w.warn(I),w.resetFragmentLoading(m)})},l.fragContextChanged=function(m){var w=this.fragCurrent;return!m||!w||m.level!==w.level||m.sn!==w.sn||m.urlId!==w.urlId},l.fragBufferedComplete=function(m,w){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+m.type+" sn: "+m.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level+" "+n.default.toString(H.BufferHelper.getBuffered(I))),this.state=E.IDLE,this.tick()},l._handleFragmentLoadComplete=function(m){var w=this.transmuxer;if(!w)return;var I=m.frag,L=m.part,S=m.partsLoaded,D=!S||S.length===0||S.some(function(R){return!R}),B=new f.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,L?L.index:-1,!D);w.flush(B)},l._handleFragmentLoadProgress=function(m){},l._doFragLoad=function(m,w,I,L){var S=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(m.start,I||0),this.config.lowLatencyMode&&w){var D=w.partList;if(D&&L){I>m.end&&w.fragmentHint&&(m=w.fragmentHint);var B=this.getNextPart(D,m,I);if(B>-1){var R=D[B];return this.log("Loading part sn: "+m.sn+" p: "+R.index+" cc: "+m.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+B+"-"+(D.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=E.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:m,part:D[B],targetBufferTime:I}),this.doFragPartsLoad(m,D,B,L).catch(function(W){return S.handleFragLoadError(W)})}else if(!m.url||this.loadedEndOfParts(D,I))return Promise.resolve(null)}}return this.log("Loading fragment "+m.sn+" cc: "+m.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(I.toFixed(3))),Object(U.isFiniteNumber)(m.sn)&&!this.bitrateTest&&(this.nextLoadPosition=m.start+m.duration),this.state=E.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:m,targetBufferTime:I}),this.fragmentLoader.load(m,L).catch(function(W){return S.handleFragLoadError(W)})},l.doFragPartsLoad=function(m,w,I,L){var S=this;return new Promise(function(D,B){var R=[],W=function Y(se){var ne=w[se];S.fragmentLoader.loadPart(m,ne,L).then(function(Se){R[ne.index]=Se;var xe=Se.part;S.hls.trigger(e.Events.FRAG_LOADED,Se);var we=w[se+1];if(we&&we.fragment===m)Y(se+1);else return D({frag:m,part:xe,partsLoaded:R})}).catch(B)};W(I)})},l.handleFragLoadError=function(m){var w=m.data;return w&&w.details===C.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(e.Events.ERROR,w),null},l._handleTransmuxerFlush=function(m){var w=this.getCurrentContext(m);if(!w||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var I=w.frag,L=w.part,S=w.level,D=self.performance.now();I.stats.parsing.end=D,L&&(L.stats.parsing.end=D),this.updateLevelTiming(I,L,S,m.partial)},l.getCurrentContext=function(m){var w=this.levels,I=m.level,L=m.sn,S=m.part;if(!w||!w[I])return this.warn("Levels object was unset while buffering fragment "+L+" of level "+I+". The current chunk will not be buffered."),null;var D=w[I],B=S>-1?Object(r.getPartWith)(D,L,S):null,R=B?B.fragment:Object(r.getFragmentWithSN)(D,L,this.fragCurrent);return R?{frag:R,part:B,level:D}:null},l.bufferFragmentData=function(m,w,I,L){if(!m||this.state!==E.PARSING)return;var S=m.data1,D=m.data2,B=S;if(S&&D&&(B=Object(p.appendUint8Array)(S,D)),!B||!B.length)return;var R={type:m.type,frag:w,part:I,chunkMeta:L,parent:w.type,data:B};this.hls.trigger(e.Events.BUFFER_APPENDING,R),m.dropped&&m.independent&&!I&&this.flushBufferGap(w)},l.flushBufferGap=function(m){var w=this.media;if(!w)return;if(!H.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,m.start);return}var I=w.currentTime,L=H.BufferHelper.bufferInfo(w,I,0),S=m.duration,D=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),B=Math.max(Math.min(m.start-D,L.end-D),I+D);m.start-B>D&&this.flushMainBuffer(B,m.start)},l.getFwdBufferInfo=function(m,w){var I=this.config,L=this.getLoadPosition();if(!Object(U.isFiniteNumber)(L))return null;var S=H.BufferHelper.bufferInfo(m,L,I.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var D=this.fragmentTracker.getBufferedFrag(L,w);if(D&&S.nextStart<D.end)return H.BufferHelper.bufferInfo(m,L,Math.max(S.nextStart,I.maxBufferHole))}return S},l.getMaxBufferLength=function(m){var w=this.config,I;return m?I=Math.max(8*w.maxBufferSize/m,w.maxBufferLength):I=w.maxBufferLength,Math.min(I,w.maxMaxBufferLength)},l.reduceMaxBufferLength=function(m){var w=this.config,I=m||w.maxBufferLength;return w.maxMaxBufferLength>=I?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(m,w){var I,L,S=w.fragments,D=S.length;if(!D)return null;var B=this.config,R=S[0].start,W;if(w.live){var Y=B.initialLiveManifestSize;if(D<Y)return this.warn("Not enough fragments to start playback (have: "+D+", need: "+Y+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(w,S),this.startPosition=W?this.hls.liveSyncPosition||W.start:m)}else m<=R&&(W=S[0]);if(!W){var se=B.lowLatencyMode?w.partEnd:w.fragmentEnd;W=this.getFragmentAtPosition(m,se,w)}return(I=W)!==null&&I!==void 0&&I.initSegment&&!((L=W)!==null&&L!==void 0&&L.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},l.getNextPart=function(m,w,I){for(var L=-1,S=!1,D=!0,B=0,R=m.length;B<R;B++){var W=m[B];if(D=D&&!W.independent,L>-1&&I<W.start)break;var Y=W.loaded;!Y&&(S||W.independent||D)&&W.fragment===w&&(L=B),S=Y}return L},l.loadedEndOfParts=function(m,w){var I=m[m.length-1];return I&&w>I.start&&I.loaded},l.getInitialLiveFragment=function(m,w){var I=this.fragPrevious,L=null;if(I){if(m.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),L=Object(a.findFragmentByPDT)(w,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!L){var S=I.sn+1;if(S>=m.startSN&&S<=m.endSN){var D=w[S-m.startSN];I.cc===D.cc&&(L=D,this.log("Live playlist, switching playlist, load frag with next SN: "+L.sn))}L||(L=Object(a.findFragWithCC)(w,I.cc),L&&this.log("Live playlist, switching playlist, load frag with same CC: "+L.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(L=this.getFragmentAtPosition(B,this.bitrateTest?m.fragmentEnd:m.edge,m))}return L},l.getFragmentAtPosition=function(m,w,I){var L=this.config,S=this.fragPrevious,D=I.fragments,B=I.endSN,R=I.fragmentHint,W=L.maxFragLookUpTolerance,Y=!!(L.lowLatencyMode&&I.partList&&R);Y&&R&&!this.bitrateTest&&(D=D.concat(R),B=R.sn);var se;if(m<w){var ne=m>w-W?0:W;se=Object(a.findFragmentByPTS)(S,D,m,ne)}else se=D[D.length-1];if(se){var Se=se.sn-I.startSN,xe=S&&se.level===S.level,we=D[Se+1],Re=this.fragmentTracker.getState(se);if(Re===M.FragmentState.BACKTRACKED){se=null;for(var Pe=Se;D[Pe]&&this.fragmentTracker.getState(D[Pe])===M.FragmentState.BACKTRACKED;)S?se=D[Pe--]:se=D[--Pe];se||(se=we)}else S&&se.sn===S.sn&&!Y&&(xe&&(se.sn<B&&this.fragmentTracker.getState(we)!==M.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+we.sn),se=we):se=null))}return se},l.synchronizeToLiveEdge=function(m){var w=this.config,I=this.media;if(!I)return;var L=this.hls.liveSyncPosition,S=I.currentTime,D=m.fragments[0].start,B=m.edge,R=S>=D-w.maxFragLookUpTolerance&&S<=B;if(L!==null&&I.duration>L&&(S<L||!R)){var W=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*m.targetduration;(!R&&I.readyState<4||S<B-W)&&(this.loadedmetadata||(this.nextLoadPosition=L),I.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+L.toFixed(3)),I.currentTime=L))}},l.alignPlaylists=function(m,w){var I=this.levels,L=this.levelLastLoaded,S=this.fragPrevious,D=L!==null?I[L]:null,B=m.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var R=m.fragments[0].start,W=!w,Y=m.alignedSliding&&Object(U.isFiniteNumber)(R);if(W||!Y&&!R){Object(o.alignStream)(S,D,m);var se=m.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+m.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+B),se}return R},l.waitForCdnTuneIn=function(m){var w=3;return m.live&&m.canBlockReload&&m.tuneInGoal>Math.max(m.partHoldBack,m.partTarget*w)},l.setStartPosition=function(m,w){var I=this.startPosition;if(I<w&&(I=-1),I===-1||this.lastCurrentTime===-1){var L=m.startTimeOffset;Object(U.isFiniteNumber)(L)?(I=w+L,L<0&&(I+=m.totalduration),I=Math.min(Math.max(w,I),w+m.totalduration),this.log("Start time offset "+L+" found in playlist, adjust startPosition to "+I),this.startPosition=I):m.live?I=this.hls.liveSyncPosition||w:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},l.getLoadPosition=function(){var m=this.media,w=0;return this.loadedmetadata&&m?w=m.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},l.handleFragLoadAborted=function(m,w){this.transmuxer&&m.sn!=="initSegment"&&m.stats.aborted&&(this.warn("Fragment "+m.sn+(w?" part"+w.index:"")+" of level "+m.level+" was aborted"),this.resetFragmentLoading(m))},l.resetFragmentLoading=function(m){(!this.fragCurrent||!this.fragContextChanged(m))&&(this.state=E.IDLE)},l.onFragmentOrKeyLoadError=function(m,w){if(w.fatal)return;var I=w.frag;if(!I||I.type!==m)return;var L=this.fragCurrent;console.assert(L&&I.sn===L.sn&&I.level===L.level&&I.urlId===L.urlId,"Frag load error must match current frag to retry");var S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var D=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+m+" "+I.level+" failed to load, retrying in "+D+"ms"),this.retryDate=self.performance.now()+D,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(m===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(F.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},l.afterBufferFlushed=function(m,w,I){if(!m)return;var L=H.BufferHelper.getBuffered(m);this.fragmentTracker.detectEvictedFragments(w,L,I),this.state===E.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},l.resetLiveStartWhenNotLoaded=function(m){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[m].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(m,w,I,L){var S=this,D=I.details;console.assert(!!D,"level.details must be defined");var B=Object.keys(m.elementaryStreams).reduce(function(R,W){var Y=m.elementaryStreams[W];if(Y){var se=Y.endPTS-Y.startPTS;if(se<=0)return S.warn("Could not parse fragment "+m.sn+" "+W+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),R||!1;var ne=L?0:Object(r.updateFragPTSDTS)(D,m,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return S.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:D,level:I,drift:ne,type:W,frag:m,start:Y.startPTS,end:Y.endPTS}),!0}return R},!1);B?(this.state=E.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:m,part:w})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},_(u,[{key:"state",get:function(){return this._state},set:function(m){var w=this._state;w!==m&&(this._state=m,this.log(w+"->"+m))}}]),u}(O.default)},"./src/controller/buffer-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return a});var U=A("./src/polyfills/number.ts"),O=A("./src/events.ts"),M=A("./src/utils/logger.ts"),H=A("./src/errors.ts"),F=A("./src/utils/buffer-helper.ts"),e=A("./src/utils/mediasource-helper.ts"),C=A("./src/loader/fragment.ts"),f=A("./src/controller/buffer-operation-queue.ts"),p=Object(e.getMediaSource)(),o=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function r(s){var n=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var i=n.hls,t=n.media,_=n.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),t&&(n.updateMediaElementDuration(),i.trigger(O.Events.MEDIA_ATTACHED,{media:t})),_&&_.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var h=r.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var n=this.hls;n.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(O.Events.BUFFER_RESET,this.onBufferReset,this),n.on(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(O.Events.BUFFER_EOS,this.onBufferEos,this),n.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(O.Events.FRAG_PARSED,this.onFragParsed,this),n.on(O.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var n=this.hls;n.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(O.Events.BUFFER_RESET,this.onBufferReset,this),n.off(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(O.Events.BUFFER_EOS,this.onBufferEos,this),n.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(O.Events.FRAG_PARSED,this.onFragParsed,this),n.off(O.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new f.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(n,i){var t=2;(i.audio&&!i.video||!i.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(n,i){var t=this.media=i.media;if(t&&p){var _=this.mediaSource=new p;_.addEventListener("sourceopen",this._onMediaSourceOpen),_.addEventListener("sourceended",this._onMediaSourceEnded),_.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(_),this._objectUrl=t.src}},h.onMediaDetaching=function(){var n=this.media,i=this.mediaSource,t=this._objectUrl;if(i){if(M.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(_){M.logger.warn("[buffer-controller]: onMediaDetaching: "+_.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(t&&self.URL.revokeObjectURL(t),n.src===t?(n.removeAttribute("src"),n.load()):M.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(O.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(i){var t=n.sourceBuffer[i];try{t&&(n.removeBufferListeners(i),n.mediaSource&&n.mediaSource.removeSourceBuffer(t),n.sourceBuffer[i]=void 0)}catch(_){M.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",_)}}),this._initSourceBuffer()},h.onBufferCodecs=function(n,i){var t=this,_=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(g){if(_){var v=t.tracks[g];if(v&&typeof v.buffer.changeType=="function"){var x=i[g],E=x.codec,y=x.levelCodec,c=x.container,u=(v.levelCodec||v.codec).replace(o,"$1"),l=(y||E).replace(o,"$1");if(u!==l){var b=c+";codecs="+(y||E);t.appendChangeType(g,b)}}}else t.pendingTracks[g]=i[g]}),_)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(n,i){var t=this,_=this.operationQueue,g={execute:function(){var x=t.sourceBuffer[n];x&&(M.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+i),x.changeType(i)),_.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(x){M.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",x)}};_.append(g,n)},h.onBufferAppending=function(n,i){var t=this,_=this.hls,g=this.operationQueue,v=this.tracks,x=i.data,E=i.type,y=i.frag,c=i.part,u=i.chunkMeta,l=u.buffering[E],b=self.performance.now();l.start=b;var m=y.stats.buffering,w=c?c.stats.buffering:null;m.start===0&&(m.start=b),w&&w.start===0&&(w.start=b);var I=v.audio,L=E==="audio"&&u.id===1&&(I==null?void 0:I.container)==="audio/mpeg",S={execute:function(){if(l.executeStart=self.performance.now(),L){var B=t.sourceBuffer[E];if(B){var R=y.start-B.timestampOffset;Math.abs(R)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+R+") sn: "+y.sn+")"),B.timestampOffset=y.start)}}t.appendExecutor(x,E)},onStart:function(){},onComplete:function(){var B=self.performance.now();l.executeEnd=l.end=B,m.first===0&&(m.first=B),w&&w.first===0&&(w.first=B);var R=t.sourceBuffer,W={};for(var Y in R)W[Y]=F.BufferHelper.getBuffered(R[Y]);t.appendError=0,t.hls.trigger(O.Events.BUFFER_APPENDED,{type:E,frag:y,part:c,chunkMeta:u,parent:y.type,timeRanges:W})},onError:function(B){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",B);var R={type:H.ErrorTypes.MEDIA_ERROR,parent:y.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=H.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,R.details=H.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>_.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+_.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),_.trigger(O.Events.ERROR,R)}};g.append(S,E)},h.onBufferFlushing=function(n,i){var t=this,_=this.operationQueue,g=function(x){return{execute:t.removeExecutor.bind(t,x,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(O.Events.BUFFER_FLUSHED,{type:x})},onError:function(y){M.logger.warn("[buffer-controller]: Failed to remove from "+x+" SourceBuffer",y)}}};i.type?_.append(g(i.type),i.type):this.getSourceBufferTypes().forEach(function(v){_.append(g(v),v)})},h.onFragParsed=function(n,i){var t=this,_=i.frag,g=i.part,v=[],x=g?g.elementaryStreams:_.elementaryStreams;x[C.ElementaryStreamTypes.AUDIOVIDEO]?v.push("audiovideo"):(x[C.ElementaryStreamTypes.AUDIO]&&v.push("audio"),x[C.ElementaryStreamTypes.VIDEO]&&v.push("video"));var E=function(){var c=self.performance.now();_.stats.buffering.end=c,g&&(g.stats.buffering.end=c);var u=g?g.stats:_.stats;t.hls.trigger(O.Events.FRAG_BUFFERED,{frag:_,part:g,stats:u,id:_.type})};v.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+_.type+" level: "+_.level+" sn: "+_.sn),this.blockBuffers(E,v)},h.onFragChanged=function(n,i){this.flushBackBuffer()},h.onBufferEos=function(n,i){var t=this,_=this.getSourceBufferTypes().reduce(function(g,v){var x=t.sourceBuffer[v];return(!i.type||i.type===v)&&(x&&!x.ended&&(x.ended=!0,M.logger.log("[buffer-controller]: "+v+" sourceBuffer now EOS"))),g&&!!(!x||x.ended)},!0);_&&this.blockBuffers(function(){var g=t.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},h.onLevelUpdated=function(n,i){var t=i.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var n=this.hls,i=this.details,t=this.media,_=this.sourceBuffer;if(!t||i===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var v=i.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(U.isFiniteNumber)(v)||v<0)return;var x=t.currentTime,E=i.levelTargetDuration,y=Math.max(v,E),c=Math.floor(x/E)*E-y;g.forEach(function(u){var l=_[u];if(l){var b=F.BufferHelper.getBuffered(l);b.length>0&&c>b.start(0)&&(n.trigger(O.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),i.live&&n.trigger(O.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),n.trigger(O.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:u}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,i=this.hls,t=this.media,_=this.mediaSource,g=n.fragments[0].start+n.totalduration,v=t.duration,x=Object(U.isFiniteNumber)(_.duration)?_.duration:0;n.live&&i.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),_.duration=Infinity,this.updateSeekableRange(n)):(g>x&&g>v||!Object(U.isFiniteNumber)(v))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),_.duration=g)},h.updateSeekableRange=function(n){var i=this.mediaSource,t=n.fragments,_=t.length;if(_&&n.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var g=Math.max(0,t[0].start),v=Math.max(g,g+n.totalduration);i.setLiveSeekableRange(g,v)}},h.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,i=this.operationQueue,t=this.pendingTracks,_=Object.keys(t).length;if(_&&!n||_===2){this.createSourceBuffers(t),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(O.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}g.forEach(function(v){i.executeNext(v)})}},h.createSourceBuffers=function(n){var i=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var _=0;for(var g in n)if(!i[g]){var v=n[g];if(!v)throw Error("source buffer exists for track "+g+", however track does not");var x=v.levelCodec||v.codec,E=v.container+";codecs="+x;M.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var y=i[g]=t.addSourceBuffer(E),c=g;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[g]={buffer:y,codec:x,container:v.container,levelCodec:v.levelCodec,id:v.id},_++}catch(u){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(O.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:E})}}_&&this.hls.trigger(O.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(n){var i=this.operationQueue,t=i.current(n);t.onStart()},h._onSBUpdateEnd=function(n){var i=this.operationQueue,t=i.current(n);t.onComplete(),i.shiftAndExecuteNext(n)},h._onSBUpdateError=function(n,i){M.logger.error("[buffer-controller]: "+n+" SourceBuffer error",i),this.hls.trigger(O.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(n);t&&t.onError(i)},h.removeExecutor=function(n,i,t){var _=this.media,g=this.mediaSource,v=this.operationQueue,x=this.sourceBuffer,E=x[n];if(!_||!g||!E){M.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),v.shiftAndExecuteNext(n);return}var y=Object(U.isFiniteNumber)(_.duration)?_.duration:Infinity,c=Object(U.isFiniteNumber)(g.duration)?g.duration:Infinity,u=Math.max(0,i),l=Math.min(t,y,c);l>u?(M.logger.log("[buffer-controller]: Removing ["+u+","+l+"] from the "+n+" SourceBuffer"),console.assert(!E.updating,n+" sourceBuffer must not be updating"),E.remove(u,l)):v.shiftAndExecuteNext(n)},h.appendExecutor=function(n,i){var t=this.operationQueue,_=this.sourceBuffer,g=_[i];if(!g){M.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(i);return}g.ended=!1,console.assert(!g.updating,i+" sourceBuffer must not be updating"),g.appendBuffer(n)},h.blockBuffers=function(n,i){var t=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var _=this.operationQueue,g=i.map(function(v){return _.appendBlocker(v)});Promise.all(g).then(function(){n(),i.forEach(function(v){var x=t.sourceBuffer[v];(!x||!x.updating)&&_.shiftAndExecuteNext(v)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(n,i,t){var _=this.sourceBuffer[n];if(!_)return;var g=t.bind(this,n);this.listeners[n].push({event:i,listener:g}),_.addEventListener(i,g)},h.removeBufferListeners=function(n){var i=this.sourceBuffer[n];if(!i)return;this.listeners[n].forEach(function(t){i.removeEventListener(t.event,t.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return O});var U=A("./src/utils/logger.ts"),O=function(){function M(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var H=M.prototype;return H.append=function(e,C){var f=this.queues[C];f.push(e),f.length===1&&this.buffers[C]&&this.executeNext(C)},H.insertAbort=function(e,C){var f=this.queues[C];f.unshift(e),this.executeNext(C)},H.appendBlocker=function(e){var C,f=new Promise(function(o){C=o}),p={execute:C,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,e),f},H.executeNext=function(e){var C=this.buffers,f=this.queues,p=C[e],o=f[e];if(o.length){var a=o[0];try{a.execute()}catch(r){U.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(r),(!p||!p.updating)&&(o.shift(),this.executeNext(e))}}},H.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},H.current=function(e){return this.queues[e][0]},M}()},"./src/controller/cap-level-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/events.ts");function O(F,e){for(var C=0;C<e.length;C++){var f=e[C];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(F,f.key,f)}}function M(F,e,C){return e&&O(F.prototype,e),C&&O(F,C),F}var H=function(){function F(C){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=C,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=F.prototype;return e.setStreamController=function(f){this.streamController=f},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var f=this.hls;f.on(U.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var f=this.hls;f.off(U.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(f,p){F.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},e.onMediaAttaching=function(f,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},e.onManifestParsed=function(f,p){var o=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,o.config.capLevelToPlayerSize&&p.video&&this.startCapping()},e.onBufferCodecs=function(f,p){var o=this.hls;o.config.capLevelToPlayerSize&&p.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var f=this.hls.levels;if(f.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(f.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},e.getMaxLevel=function(f){var p=this,o=this.hls.levels;if(!o.length)return-1;var a=o.filter(function(r,h){return F.isLevelAllowed(h,p.restrictedLevels)&&h<=f});return this.clientRect=null,F.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},e.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()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var f=this.media,p={width:0,height:0};if(f){var o=f.getBoundingClientRect();p.width=o.width,p.height=o.height,!p.width&&!p.height&&(p.width=o.right-o.left||f.width||0,p.height=o.bottom-o.top||f.height||0)}return this.clientRect=p,p},F.isLevelAllowed=function(f,p){return p===void 0&&(p=[]),p.indexOf(f)===-1},F.getMaxLevelByMediaSize=function(f,p,o){if(!f||!f.length)return-1;for(var a=function(i,t){return t?i.width!==t.width||i.height!==t.height:!0},r=f.length-1,h=0;h<f.length;h+=1){var s=f[h];if((s.width>=p||s.height>=o)&&a(s,f[h+1])){r=h;break}}return r},M(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var f=1;try{f=self.devicePixelRatio}catch(p){}return f}}]),F}();j.default=H},"./src/controller/cmcd-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return a});var U=A("./src/events.ts"),O=A("./src/types/cmcd.ts"),M=A("./src/utils/buffer-helper.ts"),H=A("./src/utils/logger.ts");function F(r,h){for(var s=0;s<h.length;s++){var n=h[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function e(r,h,s){return h&&F(r.prototype,h),s&&F(r,s),r}function C(r,h){var s=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(s)return(s=s.call(r)).next.bind(s);if(Array.isArray(r)||(s=f(r))||h&&r&&typeof r.length=="number"){s&&(r=s);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(r,h){if(!r)return;if(typeof r=="string")return p(r,h);var s=Object.prototype.toString.call(r).slice(8,-1);if(s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set")return Array.from(r);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return p(r,h)}function p(r,h){(h==null||h>r.length)&&(h=r.length);for(var s=0,n=new Array(h);s<h;s++)n[s]=r[s];return n}function o(){return o=Object.assign||function(r){for(var h=1;h<arguments.length;h++){var s=arguments[h];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[n]=s[n])}return r},o.apply(this,arguments)}var a=function(){function r(s){var n=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(_){try{n.apply(_,{ot:O.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(g){H.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=function(_){try{var g=_.frag,v=n.hls.levels[g.level],x=n.getObjectType(g),E={d:g.duration*1e3,ot:x};(x===O.CMCDObjectType.VIDEO||x===O.CMCDObjectType.AUDIO||x==O.CMCDObjectType.MUXED)&&(E.br=v.bitrate/1e3,E.tb=n.getTopBandwidth(x),E.bl=n.getBufferLength(x)),n.apply(_,E)}catch(y){H.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=s;var i=this.config=s.config,t=i.cmcd;t!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||r.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var h=r.prototype;return h.registerListeners=function(){var n=this.hls;n.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var n=this.hls;n.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(n,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(n,i){var t,_;this.audioBuffer=(t=i.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(_=i.tracks.video)===null||_===void 0?void 0:_.buffer},h.createData=function(){var n;return{v:O.CMCDVersion,sf:O.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(n,i){i===void 0&&(i={}),o(i,this.createData());var t=i.ot===O.CMCDObjectType.INIT||i.ot===O.CMCDObjectType.VIDEO||i.ot===O.CMCDObjectType.MUXED;if(this.starved&&t&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var _=r.toHeaders(i);if(!Object.keys(_).length)return;n.headers||(n.headers={}),o(n.headers,_)}else{var g=r.toQuery(i);if(!g)return;n.url=r.appendQueryToUri(n.url,g)}},h.getObjectType=function(n){var i=n.type;return i==="subtitle"?O.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?O.CMCDObjectType.INIT:i==="audio"?O.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?O.CMCDObjectType.VIDEO:O.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(n){for(var i=0,t=n===O.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,_=C(t),g;!(g=_()).done;){var v=g.value;v.bitrate>i&&(i=v.bitrate)}return i>0?i:NaN},h.getBufferLength=function(n){var i=this.hls.media,t=n===O.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!i)return NaN;var _=M.BufferHelper.bufferInfo(t,i.currentTime,this.config.maxBufferHole);return _.len*1e3},h.createPlaylistLoader=function(){var n=this.config.pLoader,i=this.applyPlaylistData,t=n||this.config.loader;return function(){function _(v){this.loader=void 0,this.loader=new t(v)}var g=_.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(x,E,y){i(x),this.loader.load(x,E,y)},e(_,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),_}()},h.createFragmentLoader=function(){var n=this.config.fLoader,i=this.applyFragmentData,t=n||this.config.loader;return function(){function _(v){this.loader=void 0,this.loader=new t(v)}var g=_.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(x,E,y){i(x),this.loader.load(x,E,y)},e(_,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),_}()},r.uuid=function(){var n=URL.createObjectURL(new Blob),i=n.toString();return URL.revokeObjectURL(n),i.substr(i.lastIndexOf("/")+1)},r.serialize=function(n){for(var i=[],t=function(L){return!Number.isNaN(L)&&L!=null&&L!==""&&L!==!1},_=function(L){return Math.round(L)},g=function(L){return _(L/100)*100},v=function(L){return encodeURIComponent(L)},x={br:_,d:_,bl:g,dl:g,mtp:g,nor:v,rtp:g,tb:_},E=Object.keys(n||{}).sort(),y=C(E),c;!(c=y()).done;){var u=c.value,l=n[u];if(!t(l))continue;if(u==="v"&&l===1)continue;if(u=="pr"&&l===1)continue;var b=x[u];b&&(l=b(l));var m=typeof l,w=void 0;u==="ot"||u==="sf"||u==="st"?w=u+"="+l:m==="boolean"?w=u:m==="number"?w=u+"="+l:w=u+"="+JSON.stringify(l),i.push(w)}return i.join(",")},r.toHeaders=function(n){for(var i=Object.keys(n),t={},_=["Object","Request","Session","Status"],g=[{},{},{},{}],v={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},x=0,E=i;x<E.length;x++){var y=E[x],c=v[y]!=null?v[y]:1;g[c][y]=n[y]}for(var u=0;u<g.length;u++){var l=r.serialize(g[u]);l&&(t["CMCD-"+_[u]]=l)}return t},r.toQuery=function(n){return"CMCD="+encodeURIComponent(r.serialize(n))},r.appendQueryToUri=function(n,i){if(!i)return n;var t=n.includes("?")?"&":"?";return""+n+t+i},r}()},"./src/controller/eme-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/events.ts"),O=A("./src/errors.ts"),M=A("./src/utils/logger.ts"),H=A("./src/utils/mediakeys-helper.ts");function F(a,r){for(var h=0;h<r.length;h++){var s=r[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,r,h){return r&&F(a.prototype,r),h&&F(a,h),a}var C=3,f=function(r,h,s){var n={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(i){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:s.audioRobustness||""})}),h.forEach(function(i){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:s.videoRobustness||""})}),[n]},p=function(r,h,s,n){switch(r){case H.KeySystems.WIDEVINE:return f(h,s,n);default:throw new Error("Unknown key-system: "+r)}},o=function(){function a(h){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=h,this._config=h.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var r=a.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(U.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(s){switch(s){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},r._attemptKeySystemAccess=function(s,n,i){var t=this,_=p(s,n,i,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var g=this.requestMediaKeySystemAccess(s,_);this.mediaKeysPromise=g.then(function(v){return t._onMediaKeySystemAccessObtained(s,v)}),g.catch(function(v){M.logger.error('Failed to obtain key-system "'+s+'" access:',v)})},r._onMediaKeySystemAccessObtained=function(s,n){var i=this;M.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var _=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(g){return t.mediaKeys=g,M.logger.log('Media-keys created for key-system "'+s+'"'),i._onMediaKeysCreated(),g});return _.catch(function(g){M.logger.error("Failed to create media-keys:",g)}),_},r._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),s._onNewMediaKeySession(n.mediaKeysSession))})},r._onNewMediaKeySession=function(s){var n=this;M.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(i){n._onKeySessionMessage(s,i.message)},!1)},r._onKeySessionMessage=function(s,n){M.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(i){M.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),s.update(i)})},r.onMediaEncrypted=function(s){var n=this;if(M.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(_){if(!n._media)return;n._attemptSetMediaKeys(_),n._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(i).catch(i)},r._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(s,n){var i=this,t=this._mediaKeysList[0];if(!t){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var _=t.mediaKeysSession;if(!_){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,_.generateRequest(s,n).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(g){M.logger.error("Error generating key-session request:",g),i.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(s,n,i){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,n,i);var _=this._licenseXhrSetup;if(_)try{_.call(this.hls,t,s),_=void 0}catch(g){M.logger.error(g)}try{t.readyState||t.open("POST",s,!0),_&&_.call(this.hls,t,s)}catch(g){throw new Error("issue setting up KeySystem license XHR "+g)}return t},r._onLicenseRequestReadyStageChange=function(s,n,i,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var _=s.response,g=this._licenseResponseCallback;if(g)try{_=g.call(this.hls,s,n)}catch(x){M.logger.error(x)}t(_)}else{if(M.logger.error("License Request XHR failed ("+n+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>C){this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var v=C-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+v+" attempts left"),this._requestLicense(i,t)}break}},r._generateLicenseRequestChallenge=function(s,n){switch(s.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},r._requestLicense=function(s,n){M.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(i.mediaKeySystemDomain),_=this._createLicenseXhr(t,s,n);M.logger.log("Sending license request to URL: "+t);var g=this._generateLicenseRequestChallenge(i,s);_.send(g)}catch(v){M.logger.error("Failure requesting DRM license: "+v),this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(s,n){if(!this._emeEnabled)return;var i=n.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var s=this._media,n=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(s,n){if(!this._emeEnabled)return;var i=n.levels.map(function(_){return _.audioCodec}).filter(function(_){return!!_}),t=n.levels.map(function(_){return _.videoCodec}).filter(function(_){return!!_});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,i,t)},e(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();j.default=o},"./src/controller/fps-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/events.ts"),O=A("./src/utils/logger.ts"),M=function(){function H(e){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=e,this.registerListeners()}var F=H.prototype;return F.setStreamController=function(C){this.streamController=C},F.registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(C,f){var p=this.hls.config;if(p.capLevelOnFPSDrop){var o=f.media instanceof self.HTMLVideoElement?f.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(C,f,p){var o=performance.now();if(f){if(this.lastTime){var a=o-this.lastTime,r=p-this.lastDroppedFrames,h=f-this.lastDecodedFrames,s=1e3*r/a,n=this.hls;if(n.trigger(U.Events.FPS_DROP,{currentDropped:r,currentDecoded:h,totalDroppedFrames:p}),s>0&&r>n.config.fpsDroppedMonitoringThreshold*h){var i=n.currentLevel;O.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=i)&&(i=i-1,n.trigger(U.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:n.currentLevel}),n.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=p,this.lastDecodedFrames=f}},F.checkFPSInterval=function(){var C=this.media;if(C)if(this.isVideoPlaybackQualityAvailable){var f=C.getVideoPlaybackQuality();this.checkFPS(C,f.totalVideoFrames,f.droppedVideoFrames)}else this.checkFPS(C,C.webkitDecodedFrameCount,C.webkitDroppedFrameCount)},H}();j.default=M},"./src/controller/fragment-finders.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"findFragmentByPDT",function(){return M}),A.d(j,"findFragmentByPTS",function(){return H}),A.d(j,"fragmentWithinToleranceTest",function(){return F}),A.d(j,"pdtWithinToleranceTest",function(){return e}),A.d(j,"findFragWithCC",function(){return C});var U=A("./src/polyfills/number.ts"),O=A("./src/utils/binary-search.ts");function M(f,p,o){if(p===null||!Array.isArray(f)||!f.length||!Object(U.isFiniteNumber)(p))return null;var a=f[0].programDateTime;if(p<(a||0))return null;var r=f[f.length-1].endProgramDateTime;if(p>=(r||0))return null;o=o||0;for(var h=0;h<f.length;++h){var s=f[h];if(e(p,o,s))return s}return null}function H(f,p,o,a){o===void 0&&(o=0),a===void 0&&(a=0);var r=null;if(f?r=p[f.sn-p[0].sn+1]||null:o===0&&p[0].start===0&&(r=p[0]),r&&F(o,a,r)===0)return r;var h=O.default.search(p,F.bind(null,o,a));return h||r}function F(f,p,o){f===void 0&&(f=0),p===void 0&&(p=0);var a=Math.min(p,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-a<=f?1:o.start-a>f&&o.start?-1:0}function e(f,p,o){var a=Math.min(p,o.duration+(o.deltaPTS?o.deltaPTS:0))*1e3,r=o.endProgramDateTime||0;return r-a>f}function C(f,p){return O.default.search(f,function(o){return o.cc<p?1:o.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"FragmentState",function(){return M}),A.d(j,"FragmentTracker",function(){return H});var U=A("./src/events.ts"),O=A("./src/types/loader.ts"),M;(function(C){C.NOT_LOADED="NOT_LOADED",C.BACKTRACKED="BACKTRACKED",C.APPENDING="APPENDING",C.PARTIAL="PARTIAL",C.OK="OK"})(M||(M={}));var H=function(){function C(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var f=C.prototype;return f._registerListeners=function(){var o=this.hls;o.on(U.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(U.Events.FRAG_LOADED,this.onFragLoaded,this)},f._unregisterListeners=function(){var o=this.hls;o.off(U.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(U.Events.FRAG_LOADED,this.onFragLoaded,this)},f.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},f.getAppendedFrag=function(o,a){if(a===O.PlaylistLevelType.MAIN){var r=this.activeFragment,h=this.activeParts;if(!r)return null;if(h)for(var s=h.length;s--;){var n=h[s],i=n?n.end:r.appendedPTS;if(n.start<=o&&i!==void 0&&o<=i)return s>9&&(this.activeParts=h.slice(s-9)),n}else if(r.start<=o&&r.appendedPTS!==void 0&&o<=r.appendedPTS)return r}return this.getBufferedFrag(o,a)},f.getBufferedFrag=function(o,a){for(var r=this.fragments,h=Object.keys(r),s=h.length;s--;){var n=r[h[s]];if((n==null?void 0:n.body.type)===a&&n.buffered){var i=n.body;if(i.start<=o&&o<=i.end)return i}}return null},f.detectEvictedFragments=function(o,a,r){var h=this;Object.keys(this.fragments).forEach(function(s){var n=h.fragments[s];if(!n)return;if(!n.buffered){n.body.type===r&&h.removeFragment(n.body);return}var i=n.range[o];if(!i)return;i.time.some(function(t){var _=!h.isTimeBuffered(t.startPTS,t.endPTS,a);return _&&h.removeFragment(n.body),_})})},f.detectPartialFragments=function(o){var a=this,r=this.timeRanges,h=o.frag,s=o.part;if(!r||h.sn==="initSegment")return;var n=e(h),i=this.fragments[n];if(!i)return;Object.keys(r).forEach(function(t){var _=h.elementaryStreams[t];if(!_)return;var g=r[t],v=s!==null||_.partial===!0;i.range[t]=a.getBufferedTimes(h,s,v,g)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},f.fragBuffered=function(o){var a=e(o),r=this.fragments[a];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},f.getBufferedTimes=function(o,a,r,h){for(var s={time:[],partial:r},n=a?a.start:o.start,i=a?a.end:o.end,t=o.minEndPTS||i,_=o.maxStartPTS||n,g=0;g<h.length;g++){var v=h.start(g)-this.bufferPadding,x=h.end(g)+this.bufferPadding;if(_>=v&&t<=x){s.time.push({startPTS:Math.max(n,h.start(g)),endPTS:Math.min(i,h.end(g))});break}else if(n<x&&i>v)s.partial=!0,s.time.push({startPTS:Math.max(n,h.start(g)),endPTS:Math.min(i,h.end(g))});else if(i<=v)break}return s},f.getPartialFragment=function(o){var a=null,r,h,s,n=0,i=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(_){var g=t[_];if(!g)return;F(g)&&(h=g.body.start-i,s=g.body.end+i,o>=h&&o<=s&&(r=Math.min(o-h,s-o),n<=r&&(a=g.body,n=r)))}),a},f.getState=function(o){var a=e(o),r=this.fragments[a];return r?r.buffered?F(r)?M.PARTIAL:M.OK:r.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},f.backtrack=function(o,a){var r=e(o),h=this.fragments[r];if(!h||h.backtrack)return null;var s=h.backtrack=a||h.loaded;return h.loaded=null,s},f.getBacktrackData=function(o){var a=e(o),r=this.fragments[a];if(r){var h,s=r.backtrack;if(s!=null&&(h=s.payload)!==null&&h!==void 0&&h.byteLength)return s;this.removeFragment(o)}return null},f.isTimeBuffered=function(o,a,r){for(var h,s,n=0;n<r.length;n++){if(h=r.start(n)-this.bufferPadding,s=r.end(n)+this.bufferPadding,o>=h&&a<=s)return!0;if(a<=h)return!1}return!1},f.onFragLoaded=function(o,a){var r=a.frag,h=a.part;if(r.sn==="initSegment"||r.bitrateTest||h)return;var s=e(r);this.fragments[s]={body:r,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},f.onBufferAppended=function(o,a){var r=this,h=a.frag,s=a.part,n=a.timeRanges;if(h.type===O.PlaylistLevelType.MAIN)if(this.activeFragment=h,s){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(s)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(t){var _=n[t];if(r.detectEvictedFragments(t,_),!s)for(var g=0;g<_.length;g++)h.appendedPTS=Math.max(_.end(g),h.appendedPTS||0)})},f.onFragBuffered=function(o,a){this.detectPartialFragments(a)},f.hasFragment=function(o){var a=e(o);return!!this.fragments[a]},f.removeFragmentsInRange=function(o,a,r){var h=this;Object.keys(this.fragments).forEach(function(s){var n=h.fragments[s];if(!n)return;if(n.buffered){var i=n.body;i.type===r&&i.start<a&&i.end>o&&h.removeFragment(i)}})},f.removeFragment=function(o){var a=e(o);o.stats.loaded=0,o.clearElementaryStreamInfo(),delete this.fragments[a]},f.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},C}();function F(C){var f,p;return C.buffered&&(((f=C.range.video)===null||f===void 0?void 0:f.partial)||((p=C.range.audio)===null||p===void 0?void 0:p.partial))}function e(C){return C.type+"_"+C.level+"_"+C.urlId+"_"+C.sn}},"./src/controller/gap-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"STALL_MINIMUM_DURATION_MS",function(){return F}),A.d(j,"MAX_START_GAP_JUMP",function(){return e}),A.d(j,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return C}),A.d(j,"SKIP_BUFFER_RANGE_START",function(){return f}),A.d(j,"default",function(){return p});var U=A("./src/utils/buffer-helper.ts"),O=A("./src/errors.ts"),M=A("./src/events.ts"),H=A("./src/utils/logger.ts"),F=250,e=2,C=.1,f=.05,p=function(){function o(r,h,s,n){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=r,this.media=h,this.fragmentTracker=s,this.hls=n}var a=o.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(h){var s=this.config,n=this.media,i=this.stalled,t=n.currentTime,_=n.seeking,g=this.seeking&&!_,v=!this.seeking&&_;if(this.seeking=_,t!==h){if(this.moved=!0,i!==null){if(this.stallReported){var x=self.performance.now()-i;H.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(x)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((v||g)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!U.BufferHelper.getBuffered(n).length)return;var E=U.BufferHelper.bufferInfo(n,t,0),y=E.len>0,c=E.nextStart||0;if(!y&&!c)return;if(_){var u=E.len>e,l=!c||c-t>e&&!this.fragmentTracker.getPartialFragment(t);if(u||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var b,m=Math.max(c,E.start||0)-t,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=w==null||((b=w.details)===null||b===void 0)?void 0:b.live,L=I?w.details.targetduration*2:e;if(m>0&&m<=L){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(i===null){this.stalled=S;return}var D=S-i;!_&&D>=F&&this._reportStall(E.len);var B=U.BufferHelper.bufferInfo(n,t,s.maxBufferHole);this._tryFixBufferStall(B,D)},a._tryFixBufferStall=function(h,s){var n=this.config,i=this.fragmentTracker,t=this.media,_=t.currentTime,g=i.getPartialFragment(_);if(g){var v=this._trySkipBufferHole(g);if(v)return}h.len>n.maxBufferHole&&s>n.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(h){var s=this.hls,n=this.media,i=this.stallReported;i||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+h+")"),s.trigger(M.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},a._trySkipBufferHole=function(h){for(var s=this.config,n=this.hls,i=this.media,t=i.currentTime,_=0,g=U.BufferHelper.getBuffered(i),v=0;v<g.length;v++){var x=g.start(v);if(t+s.maxBufferHole>=_&&t<x){var E=Math.max(x+f,i.currentTime+C);return H.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+E),this.moved=!0,this.stalled=null,i.currentTime=E,h&&n.trigger(M.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+E,frag:h}),E}_=g.end(v)}return 0},a._tryNudgeBuffer=function(){var h=this.config,s=this.hls,n=this.media,i=n.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<h.nudgeMaxRetry){var _=i+t*h.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+i+" to "+_),n.currentTime=_,s.trigger(M.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+h.nudgeMaxRetry+" nudges"),s.trigger(M.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},o}()},"./src/controller/id3-track-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/events.ts"),O=A("./src/utils/texttrack-utils.ts"),M=A("./src/demux/id3.ts"),H=.25,F=function(){function e(f){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=f,this._registerListeners()}var C=e.prototype;return C.destroy=function(){this._unregisterListeners()},C._registerListeners=function(){var p=this.hls;p.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(U.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var p=this.hls;p.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(U.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.onMediaAttached=function(p,o){this.media=o.media},C.onMediaDetaching=function(){if(!this.id3Track)return;Object(O.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},C.getID3Track=function(p){if(!this.media)return;for(var o=0;o<p.length;o++){var a=p[o];if(a.kind==="metadata"&&a.label==="id3")return Object(O.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},C.onFragParsingMetadata=function(p,o){if(!this.media)return;var a=o.frag,r=o.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<r.length;s++){var n=M.getID3Frames(r[s].data);if(n){var i=r[s].pts,t=s<r.length-1?r[s+1].pts:a.end,_=t-i;_<=0&&(t=i+H);for(var g=0;g<n.length;g++){var v=n[g];if(!M.isTimeStampFrame(v)){var x=new h(i,t,"");x.value=v,this.id3Track.addCue(x)}}}}},C.onBufferFlushing=function(p,o){var a=o.startOffset,r=o.endOffset,h=o.type;if(!h||h==="audio"){var s=this.id3Track;s&&Object(O.removeCuesInRange)(s,a,r)}},e}();j.default=F},"./src/controller/latency-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return e});var U=A("./src/errors.ts"),O=A("./src/events.ts"),M=A("./src/utils/logger.ts");function H(C,f){for(var p=0;p<f.length;p++){var o=f[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(C,o.key,o)}}function F(C,f,p){return f&&H(C.prototype,f),p&&H(C,p),C}var e=function(){function C(p){var o=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 o.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var f=C.prototype;return f.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},f.registerListeners=function(){this.hls.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(O.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){this.hls.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(O.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(O.Events.ERROR,this.onError)},f.onMediaAttached=function(o,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},f.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},f.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},f.onLevelUpdated=function(o,a){var r=a.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},f.onError=function(o,a){if(a.details!==U.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},f.timeupdate=function(){var o=this.media,a=this.levelDetails;if(!o||!a)return;this.currentTime=o.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var h=this.config,s=h.lowLatencyMode,n=h.maxLiveSyncPlaybackRate;if(!s||n===1)return;var i=this.targetLatency;if(i===null)return;var t=r-i,_=Math.min(this.maxLatency,i+a.targetduration),g=t<_;if(a.live&&g&&t>.05&&this.forwardBufferLength>1){var v=Math.min(2,Math.max(1,n)),x=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;o.playbackRate=Math.min(v,Math.max(1,x))}else o.playbackRate!==1&&o.playbackRate!==0&&(o.playbackRate=1)},f.estimateLiveEdge=function(){var o=this.levelDetails;return o===null?null:o.edge+o.age},f.computeLatency=function(){var o=this.estimateLiveEdge();return o===null?null:o-this.currentTime},F(C,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var o=this.config,a=this.levelDetails;return o.liveMaxLatencyDuration!==void 0?o.liveMaxLatencyDuration:a?o.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var o=this.levelDetails;if(o===null)return null;var a=o.holdBack,r=o.partHoldBack,h=o.targetduration,s=this.config,n=s.liveSyncDuration,i=s.liveSyncDurationCount,t=s.lowLatencyMode,_=this.hls.userConfig,g=t&&r||a;(_.liveSyncDuration||_.liveSyncDurationCount||g===0)&&(g=n!==void 0?n:i*h);var v=h,x=1;return g+Math.min(this.stallCount*x,v)}},{key:"liveSyncPosition",get:function(){var o=this.estimateLiveEdge(),a=this.targetLatency,r=this.levelDetails;if(o===null||a===null||r===null)return null;var h=r.edge,s=o-a-this.edgeStalled,n=h-r.totalduration,i=h-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(n,s),i)}},{key:"drift",get:function(){var o=this.levelDetails;return o===null?1:o.drift}},{key:"edgeStalled",get:function(){var o=this.levelDetails;if(o===null)return 0;var a=(this.config.lowLatencyMode&&o.partTarget||o.targetduration)*3;return Math.max(o.age-a,0)}},{key:"forwardBufferLength",get:function(){var o=this.media,a=this.levelDetails;if(!o||!a)return 0;var r=o.buffered.length;return r?o.buffered.end(r-1):a.edge-this.currentTime}}]),C}()},"./src/controller/level-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return s});var U=A("./src/types/level.ts"),O=A("./src/events.ts"),M=A("./src/errors.ts"),H=A("./src/utils/codecs.ts"),F=A("./src/controller/level-helper.ts"),e=A("./src/controller/base-playlist-controller.ts"),C=A("./src/types/loader.ts");function f(){return f=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var _ in t)Object.prototype.hasOwnProperty.call(t,_)&&(n[_]=t[_])}return n},f.apply(this,arguments)}function p(n,i){for(var t=0;t<i.length;t++){var _=i[t];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}function o(n,i,t){return i&&p(n.prototype,i),t&&p(n,t),n}function a(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,r(n,i)}function r(n,i){return r=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},r(n,i)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(n){a(i,n);function i(_){var g;return g=n.call(this,_,"[level-controller]")||this,g._levels=[],g._firstLevel=-1,g._startLevel=void 0,g.currentLevelIndex=-1,g.manualLevelIndex=-1,g.onParsedComplete=void 0,g._registerListeners(),g}var t=i.prototype;return t._registerListeners=function(){var g=this.hls;g.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),g.on(O.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var g=this.hls;g.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(O.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},t.startLoad=function(){var g=this._levels;g.forEach(function(v){v.loadError=0}),n.prototype.startLoad.call(this)},t.onManifestLoaded=function(g,v){var x=[],E=[],y=[],c,u={},l,b=!1,m=!1,w=!1;if(v.levels.forEach(function(D){var B=D.attrs;b=b||!!(D.width&&D.height),m=m||!!D.videoCodec,w=w||!!D.audioCodec,h&&D.audioCodec&&D.audioCodec.indexOf("mp4a.40.34")!==-1&&(D.audioCodec=void 0);var R=D.bitrate+"-"+D.attrs.RESOLUTION+"-"+D.attrs.CODECS;l=u[R],l?l.url.push(D.url):(l=new U.Level(D),u[R]=l,x.push(l)),B&&(B.AUDIO&&Object(F.addGroupId)(l,"audio",B.AUDIO),B.SUBTITLES&&Object(F.addGroupId)(l,"text",B.SUBTITLES))}),(b||m)&&w&&(x=x.filter(function(D){var B=D.videoCodec,R=D.width,W=D.height;return!!B||!!(R&&W)})),x=x.filter(function(D){var B=D.audioCodec,R=D.videoCodec;return(!B||Object(H.isCodecSupportedInMp4)(B,"audio"))&&(!R||Object(H.isCodecSupportedInMp4)(R,"video"))}),v.audioTracks&&(E=v.audioTracks.filter(function(D){return!D.audioCodec||Object(H.isCodecSupportedInMp4)(D.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(E)),v.subtitles&&(y=v.subtitles,Object(F.assignTrackIdsByGroup)(y)),x.length>0){c=x[0].bitrate,x.sort(function(D,B){return D.bitrate-B.bitrate}),this._levels=x;for(var I=0;I<x.length;I++)if(x[I].bitrate===c){this._firstLevel=I,this.log("manifest loaded, "+x.length+" level(s) found, first bitrate: "+c);break}var L=w&&!m,S={levels:x,audioTracks:E,subtitleTracks:y,firstLevel:this._firstLevel,stats:v.stats,audio:w,video:m,altAudio:!L&&E.some(function(D){return!!D.url})};this.hls.trigger(O.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(O.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:v.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(g,v){if(n.prototype.onError.call(this,g,v),v.fatal)return;var x=v.context,E=this._levels[this.currentLevelIndex];if(x&&(x.type===C.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&x.groupId===E.audioGroupIds[E.urlId]||x.type===C.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&x.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,c=!0,u;switch(v.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(v.frag){var l=this._levels[v.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=v.frag.level)):u=v.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:x&&(x.deliveryDirectives&&(c=!1),u=x.level),y=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:u=v.level,y=!0;break}u!==void 0&&this.recoverLevel(v,u,y,c)},t.recoverLevel=function(g,v,x,E){var y=g.details,c=this._levels[v];if(c.loadError++,x){var u=this.retryLoadingOrFail(g);if(u)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var l=c.url.length;if(l>1&&c.loadError<l)g.levelRetry=!0,this.redundantFailover(v);else if(this.manualLevelIndex===-1){var b=v===0?this._levels.length-1:v-1;this.currentLevelIndex!==b&&this._levels[b].loadError===0&&(this.warn(y+": switch to "+b),g.levelRetry=!0,this.hls.nextAutoLevel=b)}}},t.redundantFailover=function(g){var v=this._levels[g],x=v.url.length;if(x>1){var E=(v.urlId+1)%x;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(y){y.urlId=E}),this.level=g}},t.onFragLoaded=function(g,v){var x=v.frag;if(x!==void 0&&x.type===C.PlaylistLevelType.MAIN){var E=this._levels[x.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},t.onLevelLoaded=function(g,v){var x,E=v.level,y=v.details,c=this._levels[E];if(!c){var u;this.warn("Invalid level index "+E),(u=v.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(y.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(E,v,c.details)):(x=v.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(y.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(g,v){var x=this.hls.levels[this.currentLevelIndex];if(!x)return;if(x.audioGroupIds){for(var E=-1,y=this.hls.audioTracks[v.id].groupId,c=0;c<x.audioGroupIds.length;c++)if(x.audioGroupIds[c]===y){E=c;break}E!==x.urlId&&(x.urlId=E,this.startLoad())}},t.loadPlaylist=function(g){var v=this.currentLevelIndex,x=this._levels[v];if(this.canLoad&&x&&x.url.length>0){var E=x.urlId,y=x.url[E];if(g)try{y=g.addDirectives(y)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+v+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+E+" "+y),this.clearTimer(),this.hls.trigger(O.Events.LEVEL_LOADING,{url:y,level:v,id:E,deliveryDirectives:g||null})}},t.removeLevel=function(g,v){var x=function(c,u){return u!==v},E=this._levels.filter(function(y,c){return c!==g?!0:y.url.length>1&&v!==void 0?(y.url=y.url.filter(x),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(x)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(x)),y.urlId=0,!0):!1}).map(function(y,c){var u=y.details;return u!=null&&u.fragments&&u.fragments.forEach(function(l){l.level=c}),y});this._levels=E,this.hls.trigger(O.Events.LEVELS_UPDATED,{levels:E})},o(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var v,x=this._levels;if(x.length===0)return;if(this.currentLevelIndex===g&&(v=x[g])!==null&&v!==void 0&&v.details)return;if(g<0||g>=x.length){var E=g<0;if(this.hls.trigger(O.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:E,reason:"invalid level idx"}),E)return;g=Math.min(g,x.length-1)}this.clearTimer();var y=this.currentLevelIndex,c=x[y],u=x[g];this.log("switching to level "+g+" from "+y),this.currentLevelIndex=g;var l=f({},u,{level:g,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete l._urlId,this.hls.trigger(O.Events.LEVEL_SWITCHING,l);var b=u.details;if(!b||b.live){var m=this.switchParams(u.uri,c==null?void 0:c.details);this.loadPlaylist(m)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),i}(e.default)},"./src/controller/level-helper.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"addGroupId",function(){return M}),A.d(j,"assignTrackIdsByGroup",function(){return H}),A.d(j,"updatePTS",function(){return F}),A.d(j,"updateFragPTSDTS",function(){return C}),A.d(j,"mergeDetails",function(){return f}),A.d(j,"mapPartIntersection",function(){return p}),A.d(j,"mapFragmentIntersection",function(){return o}),A.d(j,"adjustSliding",function(){return a}),A.d(j,"addSliding",function(){return r}),A.d(j,"computeReloadInterval",function(){return h}),A.d(j,"getFragmentWithSN",function(){return s}),A.d(j,"getPartWith",function(){return n});var U=A("./src/polyfills/number.ts"),O=A("./src/utils/logger.ts");function M(i,t,_){switch(t){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(_);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(_);break}}function H(i){var t={};i.forEach(function(_){var g=_.groupId||"";_.id=t[g]=t[g]||0,t[g]++})}function F(i,t,_){var g=i[t],v=i[_];e(g,v)}function e(i,t){var _=t.startPTS;if(Object(U.isFiniteNumber)(_)){var g=0,v;t.sn>i.sn?(g=_-i.start,v=i):(g=i.start-_,v=t),v.duration!==g&&(v.duration=g)}else if(t.sn>i.sn){var x=i.cc===t.cc;x&&i.minEndPTS?t.start=i.start+(i.minEndPTS-i.start):t.start=i.start+i.duration}else t.start=Math.max(i.start-t.duration,0)}function C(i,t,_,g,v,x){var E=g-_;E<=0&&(O.logger.warn("Fragment should have a positive duration",t),g=_+t.duration,x=v+t.duration);var y=_,c=g,u=t.startPTS,l=t.endPTS;if(Object(U.isFiniteNumber)(u)){var b=Math.abs(u-_);Object(U.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(b,t.deltaPTS):t.deltaPTS=b,y=Math.max(_,u),_=Math.min(_,u),v=Math.min(v,t.startDTS),c=Math.min(g,l),g=Math.max(g,l),x=Math.max(x,t.endDTS)}t.duration=g-_;var m=_-t.start;t.appendedPTS=g,t.start=t.startPTS=_,t.maxStartPTS=y,t.startDTS=v,t.endPTS=g,t.minEndPTS=c,t.endDTS=x;var w=t.sn;if(!i||w<i.startSN||w>i.endSN)return 0;var I,L=w-i.startSN,S=i.fragments;for(S[L]=t,I=L;I>0;I--)e(S[I],S[I-1]);for(I=L;I<S.length-1;I++)e(S[I],S[I+1]);return i.fragmentHint&&e(S[S.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,m}function f(i,t){for(var _=null,g=i.fragments,v=g.length-1;v>=0;v--){var x=g[v].initSegment;if(x){_=x;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var E=0,y;if(o(i,t,function(I,L){I.relurl&&(E=I.cc-L.cc),Object(U.isFiniteNumber)(I.startPTS)&&Object(U.isFiniteNumber)(I.endPTS)&&(L.start=L.startPTS=I.startPTS,L.startDTS=I.startDTS,L.appendedPTS=I.appendedPTS,L.maxStartPTS=I.maxStartPTS,L.endPTS=I.endPTS,L.endDTS=I.endDTS,L.minEndPTS=I.minEndPTS,L.duration=I.endPTS-I.startPTS,L.duration&&(y=L),t.PTSKnown=t.alignedSliding=!0),L.elementaryStreams=I.elementaryStreams,L.loader=I.loader,L.stats=I.stats,L.urlId=I.urlId,I.initSegment&&(L.initSegment=I.initSegment,_=I.initSegment)}),_){var c=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;c.forEach(function(I){var L;(!I.initSegment||I.initSegment.relurl===((L=_)===null||L===void 0?void 0:L.relurl))&&(I.initSegment=_)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(I){return!I}),t.deltaUpdateFailed)){O.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=t.skippedSegments;u--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var l=t.fragments;if(E){O.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b<l.length;b++)l[b].cc+=E}t.skippedSegments&&(t.startCC=t.fragments[0].cc),p(i.partList,t.partList,function(I,L){L.elementaryStreams=I.elementaryStreams,L.stats=I.stats}),y?C(t,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):a(i,t),l.length&&(t.totalduration=t.edge-l[0].start),t.driftStartTime=i.driftStartTime,t.driftStart=i.driftStart;var m=t.advancedDateTime;if(t.advanced&&m){var w=t.edge;t.driftStart||(t.driftStartTime=m,t.driftStart=w),t.driftEndTime=m,t.driftEnd=w}else t.driftEndTime=i.driftEndTime,t.driftEnd=i.driftEnd,t.advancedDateTime=i.advancedDateTime}function p(i,t,_){if(i&&t)for(var g=0,v=0,x=i.length;v<=x;v++){var E=i[v],y=t[v+g];E&&y&&E.index===y.index&&E.fragment.sn===y.fragment.sn?_(E,y):g--}}function o(i,t,_){for(var g=t.skippedSegments,v=Math.max(i.startSN,t.startSN)-t.startSN,x=(i.fragmentHint?1:0)+(g?t.endSN:Math.min(i.endSN,t.endSN))-t.startSN,E=t.startSN-i.startSN,y=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,u=v;u<=x;u++){var l=c[E+u],b=y[u];g&&!b&&u<g&&(b=t.fragments[u]=l),l&&b&&_(l,b)}}function a(i,t){var _=t.startSN+t.skippedSegments-i.startSN,g=i.fragments;if(_<0||_>=g.length)return;r(t,g[_].start)}function r(i,t){if(t){for(var _=i.fragments,g=i.skippedSegments;g<_.length;g++)_[g].start+=t;i.fragmentHint&&(i.fragmentHint.start+=t)}}function h(i,t){var _=1e3*i.levelTargetDuration,g=_/2,v=i.age,x=v>0&&v<_*3,E=t.loading.end-t.loading.start,y,c=i.availabilityDelay;if(i.updated===!1)if(x){var u=333*i.misses;y=Math.max(Math.min(g,E*2),u),i.availabilityDelay=(i.availabilityDelay||0)+y}else y=g;else x?(c=Math.min(c||_/2,v),i.availabilityDelay=c,y=c+_-v):y=_-E;return Math.round(y)}function s(i,t,_){if(!i||!i.details)return null;var g=i.details,v=g.fragments[t-g.startSN];return v||(v=g.fragmentHint,v&&v.sn===t?v:t<g.startSN&&_&&_.sn===t?_:null)}function n(i,t,_){if(!i||!i.details)return null;var g=i.details.partList;if(g)for(var v=g.length;v--;){var x=g[v];if(x.index===_&&x.fragment.sn===t)return x}return null}},"./src/controller/stream-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return g});var U=A("./src/polyfills/number.ts"),O=A("./src/controller/base-stream-controller.ts"),M=A("./src/is-supported.ts"),H=A("./src/events.ts"),F=A("./src/utils/buffer-helper.ts"),e=A("./src/controller/fragment-tracker.ts"),C=A("./src/types/loader.ts"),f=A("./src/loader/fragment.ts"),p=A("./src/demux/transmuxer-interface.ts"),o=A("./src/types/transmuxer.ts"),a=A("./src/controller/gap-controller.ts"),r=A("./src/errors.ts"),h=A("./src/utils/logger.ts");function s(v,x){for(var E=0;E<x.length;E++){var y=x[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}function n(v,x,E){return x&&s(v.prototype,x),E&&s(v,E),v}function i(v,x){v.prototype=Object.create(x.prototype),v.prototype.constructor=v,t(v,x)}function t(v,x){return t=Object.setPrototypeOf||function(y,c){return y.__proto__=c,y},t(v,x)}var _=100,g=function(v){i(x,v);function x(y,c){var u;return u=v.call(this,y,c,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var E=x.prototype;return E._registerListeners=function(){var c=this.hls;c.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(H.Events.ERROR,this.onError,this),c.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var c=this.hls;c.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(H.Events.ERROR,this.onError,this),c.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(c){if(this.levels){var u=this.lastCurrentTime,l=this.hls;if(this.stopLoad(),this.setInterval(_),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var b=l.startLevel;b===-1&&(l.config.testBandwidth?(b=0,this.bitrateTest=!0):b=l.nextAutoLevel),this.level=l.nextLoadLevel=b,this.loadedmetadata=!1}u>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),c=u),this.state=O.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=O.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,v.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_LEVEL:{var c,u=this.levels,l=this.level,b=u==null||((c=u[l])===null||c===void 0)?void 0:c.details;if(b&&(!b.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(b))break;this.state=O.State.IDLE;break}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var m,w=self.performance.now(),I=this.retryDate;(!I||w>=I||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=O.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){v.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var c,u,l=this.hls,b=this.levelLastLoaded,m=this.levels,w=this.media,I=l.config,L=l.nextLoadLevel;if(b===null||!w&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!m||!m[L])return;var S=m[L];this.level=l.nextLoadLevel=L;var D=S.details;if(!D||this.state===O.State.WAITING_LEVEL||D.live&&this.levelLastLoaded!==L){this.state=O.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,C.PlaylistLevelType.MAIN);if(B===null)return;var R=B.len,W=this.getMaxBufferLength(S.maxBitrate);if(R>=W)return;if(this._streamEnded(B,D)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,Y),this.state=O.State.ENDED;return}var se=B.end,ne=this.getNextFragment(se,D);if(this.couldBacktrack&&!this.fragPrevious&&ne&&ne.sn!=="initSegment"){var Se=ne.sn-D.startSN;Se>1&&(ne=D.fragments[Se-1],this.fragmentTracker.removeFragment(ne))}if(ne&&this.fragmentTracker.getState(ne)===e.FragmentState.OK&&this.nextLoadPosition>se){var xe=this.audioOnly&&!this.altAudio?f.ElementaryStreamTypes.AUDIO:f.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,xe,C.PlaylistLevelType.MAIN),ne=this.getNextFragment(this.nextLoadPosition,D)}if(!ne)return;ne.initSegment&&!ne.initSegment.data&&!this.bitrateTest&&(ne=ne.initSegment),((c=ne.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((u=ne.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ne,D):this.loadFragment(ne,D,se)},E.loadFragment=function(c,u,l){var b,m=this.fragmentTracker.getState(c);if(this.fragCurrent=c,m===e.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(c);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else m=e.FragmentState.NOT_LOADED}m===e.FragmentState.NOT_LOADED||m===e.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,v.prototype.loadFragment.call(this,c,u,l)):m===e.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((b=this.media)===null||b===void 0?void 0:b.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(c){var u=this.fragmentTracker.getAppendedFrag(c,C.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},E.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,C.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var c=this.levels,u=this.media;if(u!=null&&u.readyState){var l,b=this.getAppendedFrag(u.currentTime);if(b&&b.start>1&&this.flushMainBuffer(0,b.start-1),!u.paused&&c){var m=this.hls.nextLoadLevel,w=c[m],I=this.fragLastKbps;I&&this.fragCurrent?l=this.fragCurrent.duration*w.maxBitrate/(1e3*I)+1:l=0}else l=0;var L=this.getBufferedFrag(u.currentTime+l);if(L){var S=this.followingBufferedFrag(L);if(S){this.abortCurrentFrag();var D=S.maxStartPTS?S.maxStartPTS:S.start,B=S.duration,R=Math.max(L.end,D+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===O.State.KEY_LOADING&&(this.state=O.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(c,u){v.prototype.flushMainBuffer.call(this,c,u,this.altAudio?"video":null)},E.onMediaAttached=function(c,u){v.prototype.onMediaAttached.call(this,c,u);var l=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),l.addEventListener("playing",this.onvplaying),l.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,l,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),v.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var c=this.media,u=c?c.currentTime:null;Object(U.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(c,u){var l=!1,b=!1,m;u.levels.forEach(function(w){m=w.audioCodec,m&&(m.indexOf("mp4a.40.2")!==-1&&(l=!0),m.indexOf("mp4a.40.5")!==-1&&(b=!0))}),this.audioCodecSwitch=l&&b&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},E.onLevelLoading=function(c,u){var l=this.levels;if(!l||this.state!==O.State.IDLE)return;var b=l[u.level];(!b.details||b.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(b.details))&&(this.state=O.State.WAITING_LEVEL)},E.onLevelLoaded=function(c,u){var l,b=this.levels,m=u.level,w=u.details,I=w.totalduration;if(!b){this.warn("Levels were reset while loading level "+m);return}this.log("Level "+m+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+I);var L=this.fragCurrent;L&&(this.state===O.State.FRAG_LOADING||this.state===O.State.FRAG_LOADING_WAITING_RETRY)&&(L.level!==u.level&&L.loader&&(this.state=O.State.IDLE,L.loader.abort()));var S=b[m],D=0;if(w.live||(l=S.details)!==null&&l!==void 0&&l.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;D=this.alignPlaylists(w,S.details)}if(S.details=w,this.levelLastLoaded=m,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:w,level:m}),this.state===O.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=O.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,D),this.tick()},E._handleFragmentLoadProgress=function(c){var u,l=c.frag,b=c.part,m=c.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var I=w[l.level],L=I.details;if(!L){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var S=I.videoCodec,D=L.PTSKnown||!L.live,B=(u=l.initSegment)===null||u===void 0?void 0:u.data,R=this._getAudioCodec(I),W=this.transmuxer=this.transmuxer||new p.default(this.hls,C.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=b?b.index:-1,se=Y!==-1,ne=new o.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,m.byteLength,Y,se),Se=this.initPTS[l.cc];W.push(m,B,R,S,l,b,L.totalduration,D,ne,Se)},E.onAudioTrackSwitching=function(c,u){var l=this.altAudio,b=!!u.url,m=u.id;if(!b){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;l&&I.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:m})}},E.onAudioTrackSwitched=function(c,u){var l=u.id,b=!!this.hls.audioTracks[l].url;if(b){var m=this.videoBuffer;m&&this.mediaBuffer!==m&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=m)}this.altAudio=b,this.tick()},E.onBufferCreated=function(c,u){var l=u.tracks,b,m,w=!1;for(var I in l){var L=l[I];if(L.id==="main"){if(m=I,b=L,I==="video"){var S=l[I];S&&(this.videoBuffer=S.buffer)}}else w=!0}w&&b?(this.log("Alternate track found, use "+m+".buffered to schedule main fragment loading"),this.mediaBuffer=b.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(c,u){var l=u.frag,b=u.part;if(l&&l.type!==C.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(l)){this.warn("Fragment "+l.sn+(b?" p: "+b.index:"")+" of level "+l.level+" finished buffering, but was aborted. state: "+this.state),this.state===O.State.PARSED&&(this.state=O.State.IDLE);return}var m=b?b.stats:l.stats;this.fragLastKbps=Math.round(8*m.total/(m.buffering.end-m.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,b)},E.onError=function(c,u){switch(u.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(C.PlaylistLevelType.MAIN,u);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==O.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=O.State.ERROR):!u.levelRetry&&this.state===O.State.WAITING_LEVEL&&(this.state=O.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var l=!0,b=this.getFwdBufferInfo(this.media,C.PlaylistLevelType.MAIN);b&&b.len>.5&&(l=!this.reduceMaxBufferLength(b.len)),l&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var c=this.media,u=this.gapController;if(!c||!u||!c.readyState)return;var l=F.BufferHelper.getBuffered(c);!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=O.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(c,u){var l=u.type;if(l!==f.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var b=(l===f.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(b,l,C.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(c,u){this.levels=u.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var c=this.media,u=c.currentTime,l=this.startPosition;if(l>=0&&u<l){if(c.seeking){h.logger.log("could not seek to "+l+", already seeking at "+u);return}var b=F.BufferHelper.getBuffered(c),m=b.length?b.start(0):0,w=m-l;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+w+" to match buffer start"),l+=w,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+u),c.currentTime=l}},E._getAudioCodec=function(c){var u=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},E._loadBitrateTestFrag=function(c){var u=this;this._doFragLoad(c).then(function(l){var b=u.hls;if(!l||b.nextLoadLevel||u.fragContextChanged(c))return;u.fragLoadError=0,u.state=O.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var m=c.stats;m.parsing.start=m.parsing.end=m.buffering.start=m.buffering.end=self.performance.now(),b.trigger(H.Events.FRAG_LOADED,l)})},E._handleTransmuxComplete=function(c){var u,l="main",b=this.hls,m=c.remuxResult,w=c.chunkMeta,I=this.getCurrentContext(w);if(!I){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var L=I.frag,S=I.part,D=I.level,B=m.video,R=m.text,W=m.id3,Y=m.initSegment,se=this.altAudio?void 0:m.audio;if(this.fragContextChanged(L))return;if(this.state=O.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(D,Y.tracks,L,w),b.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:l,tracks:Y.tracks}));var ne=Y.initPTS,Se=Y.timescale;Object(U.isFiniteNumber)(ne)&&(this.initPTS[L.cc]=ne,b.trigger(H.Events.INIT_PTS_FOUND,{frag:L,id:l,initPTS:ne,timescale:Se}))}if(B&&m.independent!==!1){if(D.details){var xe=B.startPTS,we=B.endPTS,Re=B.startDTS,Pe=B.endDTS;if(S)S.elementaryStreams[B.type]={startPTS:xe,endPTS:we,startDTS:Re,endDTS:Pe};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<xe){this.backtrack(L);return}L.setElementaryStreamInfo(B.type,L.start,we,L.start,Pe,!0)}L.setElementaryStreamInfo(B.type,xe,we,Re,Pe),this.bufferFragmentData(B,L,S,w)}}else if(m.independent===!1){this.backtrack(L);return}if(se){var ee=se.startPTS,je=se.endPTS,et=se.startDTS,He=se.endDTS;S&&(S.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:ee,endPTS:je,startDTS:et,endDTS:He}),L.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,ee,je,et,He),this.bufferFragmentData(se,L,S,w)}if(W!=null&&(u=W.samples)!==null&&u!==void 0&&u.length){var Ne={frag:L,id:l,samples:W.samples};b.trigger(H.Events.FRAG_PARSING_METADATA,Ne)}if(R){var Ye={frag:L,id:l,samples:R.samples};b.trigger(H.Events.FRAG_PARSING_USERDATA,Ye)}},E._bufferInitSegment=function(c,u,l,b){var m=this;if(this.state!==O.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var w=u.audio,I=u.video,L=u.audiovideo;if(w){var S=c.audioCodec,D=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),w.metadata.channelCount!==1&&D.indexOf("firefox")===-1&&(S="mp4a.40.5")),D.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),c.audioCodec&&c.audioCodec!==S&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+S+'"'),w.levelCodec=S,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(c.audioCodec||"")+"/"+w.codec+"]")}I&&(I.levelCodec=c.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+I.codec+"]")),L&&this.log("Init audiovideo buffer, container:"+L.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+L.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(B){var R=u[B],W=R.initSegment;W!=null&&W.byteLength&&m.hls.trigger(H.Events.BUFFER_APPENDING,{type:B,data:W,frag:l,part:null,chunkMeta:b,parent:l.type})}),this.tick()},E.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var u=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,u?this.resetFragmentLoading(c):this.state=O.State.BACKTRACKING},E.checkFragmentChanged=function(){var c=this.media,u=null;if(c&&c.readyState>1&&c.seeking===!1){var l=c.currentTime;if(F.BufferHelper.isBuffered(c,l)?u=this.getAppendedFrag(l):F.BufferHelper.isBuffered(c,l+.1)&&(u=this.getAppendedFrag(l+.1)),u){var b=this.fragPlaying,m=u.level;(!b||u.sn!==b.sn||b.level!==m||u.urlId!==b.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:u}),(!b||b.level!==m)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:m}),this.fragPlaying=u)}}},n(x,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),x}(O.default)},"./src/controller/subtitle-stream-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"SubtitleStreamController",function(){return i});var U=A("./src/events.ts"),O=A("./src/utils/logger.ts"),M=A("./src/utils/buffer-helper.ts"),H=A("./src/controller/fragment-finders.ts"),F=A("./src/utils/discontinuities.ts"),e=A("./src/controller/level-helper.ts"),C=A("./src/controller/fragment-tracker.ts"),f=A("./src/controller/base-stream-controller.ts"),p=A("./src/types/loader.ts"),o=A("./src/types/level.ts");function a(t,_){for(var g=0;g<_.length;g++){var v=_[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(t,v.key,v)}}function r(t,_,g){return _&&a(t.prototype,_),g&&a(t,g),t}function h(t,_){t.prototype=Object.create(_.prototype),t.prototype.constructor=t,s(t,_)}function s(t,_){return s=Object.setPrototypeOf||function(v,x){return v.__proto__=x,v},s(t,_)}var n=500,i=function(t){h(_,t);function _(v,x){var E;return E=t.call(this,v,x,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var g=_.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var x=this.hls;x.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(U.Events.ERROR,this.onError,this),x.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.on(U.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),x.on(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.on(U.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),x.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g._unregisterListeners=function(){var x=this.hls;x.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(U.Events.ERROR,this.onError,this),x.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.off(U.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),x.off(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.off(U.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),x.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g.startLoad=function(){this.stopLoad(),this.state=f.State.IDLE,this.setInterval(n),this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},g.onLevelLoaded=function(x,E){this.mainDetails=E.details},g.onSubtitleFragProcessed=function(x,E){var y=E.frag,c=E.success;if(this.fragPrevious=y,this.state=f.State.IDLE,!c)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var l,b=y.start,m=0;m<u.length;m++)if(b>=u[m].start&&b<=u[m].end){l=u[m];break}var w=y.start+y.duration;l?l.end=w:(l={start:b,end:w},u.push(l)),this.fragmentTracker.fragBuffered(y)},g.onBufferFlushing=function(x,E){var y=E.startOffset,c=E.endOffset;if(y===0&&c!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,l=this.levels;if(!l.length||!l[u]||!l[u].details)return;var b=l[u].details,m=b.targetduration,w=c-m;if(w<=0)return;E.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(I){for(var L=0;L<I.length;){if(I[L].end<=w){I.shift();continue}else if(I[L].start<w)I[L].start=w;else break;L++}}),this.fragmentTracker.removeFragmentsInRange(y,w,p.PlaylistLevelType.SUBTITLE)}},g.onError=function(x,E){var y,c=E.frag;if(!c||c.type!==p.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=f.State.IDLE},g.onSubtitleTracksUpdated=function(x,E){var y=this,c=E.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(u){return new o.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){y.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},g.onSubtitleTrackSwitch=function(x,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(n)},g.onSubtitleTrackLoaded=function(x,E){var y,c=E.details,u=E.id,l=this.currentTrackId,b=this.levels;if(!b.length)return;var m=b[l];if(u>=b.length||u!==l||!m)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(y=m.details)!==null&&y!==void 0&&y.live){var w=this.mainDetails;if(c.deltaUpdateFailed||!w)return;var I=w.fragments[0];if(!m.details)c.hasProgramDateTime&&w.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(c,w):I&&Object(e.addSliding)(c,I.start);else{var L=this.alignPlaylists(c,m.details);L===0&&I&&Object(e.addSliding)(c,I.start)}}if(m.details=c,this.levelLastLoaded=u,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===f.State.IDLE){var S=Object(H.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),m.details=void 0)}},g._handleFragmentLoadComplete=function(x){var E=x.frag,y=x.payload,c=E.decryptdata,u=this.hls;if(this.fragContextChanged(E))return;if(y&&y.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var l=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),c.key.buffer,c.iv.buffer).then(function(b){var m=performance.now();u.trigger(U.Events.FRAG_DECRYPTED,{frag:E,payload:b,stats:{tstart:l,tdecrypt:m}})})}},g.doTick=function(){if(!this.media){this.state=f.State.IDLE;return}if(this.state===f.State.IDLE){var x,E=this.currentTrackId,y=this.levels;if(!y.length||!y[E]||!y[E].details)return;var c=y[E].details,u=c.targetduration,l=this.config,b=this.media,m=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-u,l.maxBufferHole),w=m.end,I=m.len,L=this.getMaxBufferLength()+u;if(I>L)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var S=c.fragments,D=S.length,B=c.edge,R,W=this.fragPrevious;if(w<B){var Y=l.maxFragLookUpTolerance;W&&c.hasProgramDateTime&&(R=Object(H.findFragmentByPDT)(S,W.endProgramDateTime,Y)),R||(R=Object(H.findFragmentByPTS)(W,S,w,Y),!R&&W&&W.start<S[0].start&&(R=S[0]))}else R=S[D-1];(x=R)!==null&&x!==void 0&&x.encrypted?(O.logger.log("Loading key for "+R.sn),this.state=f.State.KEY_LOADING,this.hls.trigger(U.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===C.FragmentState.NOT_LOADED&&this.loadFragment(R,c,w)}},g.loadFragment=function(x,E,y){this.fragCurrent=x,t.prototype.loadFragment.call(this,x,E,y)},r(_,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),_}(f.default)},"./src/controller/subtitle-track-controller.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/events.ts"),O=A("./src/utils/texttrack-utils.ts"),M=A("./src/controller/base-playlist-controller.ts"),H=A("./src/types/loader.ts");function F(a,r){for(var h=0;h<r.length;h++){var s=r[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,r,h){return r&&F(a.prototype,r),h&&F(a,h),a}function C(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,f(a,r)}function f(a,r){return f=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},f(a,r)}var p=function(a){C(r,a);function r(s){var n;return n=a.call(this,s,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var h=r.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},h.registerListeners=function(){var n=this.hls;n.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(U.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var n=this.hls;n.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(U.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(U.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(U.Events.ERROR,this.onError,this)},h.onMediaAttached=function(n,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},h.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},h.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var n=o(this.media.textTracks);n.forEach(function(i){Object(O.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(n,i){this.tracks=i.subtitleTracks},h.onSubtitleTrackLoaded=function(n,i){var t=i.id,_=i.details,g=this.trackId,v=this.tracksInGroup[g];if(!v){this.warn("Invalid subtitle track id "+t);return}var x=v.details;v.details=i.details,this.log("subtitle track "+t+" loaded ["+_.startSN+"-"+_.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,i,x))},h.onLevelLoading=function(n,i){this.switchLevel(i.level)},h.onLevelSwitching=function(n,i){this.switchLevel(i.level)},h.switchLevel=function(n){var i=this.hls.levels[n];if(!(i!=null&&i.textGroupIds))return;var t=i.textGroupIds[i.urlId];if(this.groupId!==t){var _=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(E){return!t||E.groupId===t});this.tracksInGroup=g;var v=this.findTrackId(_==null?void 0:_.name)||this.findTrackId();this.groupId=t;var x={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(U.Events.SUBTITLE_TRACKS_UPDATED,x),v!==-1&&this.setSubtitleTrack(v,_)}},h.findTrackId=function(n){for(var i=this.tracksInGroup,t=0;t<i.length;t++){var _=i[t];if((!this.selectDefaultTrack||_.default)&&(!n||n===_.name))return _.id}return-1},h.onError=function(n,i){if(a.prototype.onError.call(this,n,i),i.fatal||!i.context)return;i.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},h.loadPlaylist=function(n){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var t=i.id,_=i.groupId,g=i.url;if(n)try{g=n.addDirectives(g)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADING,{url:g,id:t,groupId:_,deliveryDirectives:n||null})}},h.toggleTrackModes=function(n){var i=this,t=this.media,_=this.subtitleDisplay,g=this.trackId;if(!t)return;var v=o(t.textTracks),x=v.filter(function(c){return c.groupId===i.groupId});if(n===-1)[].slice.call(v).forEach(function(c){c.mode="disabled"});else{var E=x[g];E&&(E.mode="disabled")}var y=x[n];y&&(y.mode=_?"showing":"hidden")},h.setSubtitleTrack=function(n,i){var t,_=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(t=_[n])!==null&&t!==void 0&&t.details)||n<-1||n>=_.length)return;this.clearTimer();var g=_[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,g){var v=g.id,x=g.groupId,E=x===void 0?"":x,y=g.name,c=g.type,u=g.url;this.hls.trigger(U.Events.SUBTITLE_TRACK_SWITCH,{id:v,groupId:E,name:y,type:c,url:u});var l=this.switchParams(g.url,i==null?void 0:i.details);this.loadPlaylist(l)}else this.hls.trigger(U.Events.SUBTITLE_TRACK_SWITCH,{id:n})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,i=o(this.media.textTracks),t=0;t<i.length;t++)if(i[t].mode==="hidden")n=t;else if(i[t].mode==="showing"){n=t;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},e(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,i)}}]),r}(M.default);function o(a){for(var r=[],h=0;h<a.length;h++){var s=a[h];s.kind==="subtitles"&&s.label&&r.push(a[h])}return r}j.default=p},"./src/controller/timeline-controller.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"TimelineController",function(){return o});var U=A("./src/polyfills/number.ts"),O=A("./src/events.ts"),M=A("./src/utils/cea-608-parser.ts"),H=A("./src/utils/output-filter.ts"),F=A("./src/utils/webvtt-parser.ts"),e=A("./src/utils/texttrack-utils.ts"),C=A("./src/utils/imsc1-ttml-parser.ts"),f=A("./src/types/loader.ts"),p=A("./src/utils/logger.ts"),o=function(){function s(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new H.default(this,"textTrack1"),_=new H.default(this,"textTrack2"),g=new H.default(this,"textTrack3"),v=new H.default(this,"textTrack4");this.cea608Parser1=new M.default(1,t,_),this.cea608Parser2=new M.default(3,g,v)}i.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(O.Events.FRAG_LOADING,this.onFragLoading,this),i.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=s.prototype;return n.destroy=function(){var t=this.hls;t.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(O.Events.FRAG_LOADING,this.onFragLoading,this),t.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(t,_,g,v,x){for(var E=!1,y=x.length;y--;){var c=x[y],u=r(c[0],c[1],_,g);if(u>=0&&(c[0]=Math.min(c[0],_),c[1]=Math.max(c[1],g),E=!0,u/(g-_)>.5))return}if(E||x.push([_,g]),this.config.renderTextTracksNatively){var l=this.captionsTracks[t];this.Cues.newCue(l,_,g,v)}else{var b=this.Cues.newCue(null,_,g,v);this.hls.trigger(O.Events.CUES_PARSED,{type:"captions",cues:b,track:t})}},n.onInitPtsFound=function(t,_){var g=this,v=_.frag,x=_.id,E=_.initPTS,y=_.timescale,c=this.unparsedVttFrags;x==="main"&&(this.initPTS[v.cc]=E,this.timescale[v.cc]=y),c.length&&(this.unparsedVttFrags=[],c.forEach(function(u){g.onFragLoaded(O.Events.FRAG_LOADED,u)}))},n.getExistingTrack=function(t){var _=this.media;if(_)for(var g=0;g<_.textTracks.length;g++){var v=_.textTracks[g];if(v[t])return v}return null},n.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},n.createNativeTrack=function(t){if(this.captionsTracks[t])return;var _=this.captionsProperties,g=this.captionsTracks,v=this.media,x=_[t],E=x.label,y=x.languageCode,c=this.getExistingTrack(t);if(c)g[t]=c,Object(e.clearCurrentCues)(g[t]),Object(e.sendAddTrackEvent)(g[t],v);else{var u=this.createTextTrack("captions",E,y);u&&(u[t]=!0,g[t]=u)}},n.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var _=this.captionsProperties[t];if(!_)return;var g=_.label,v={_id:t,label:g,kind:"captions",default:_.media?!!_.media.default:!1,closedCaptions:_.media};this.nonNativeCaptionsTracks[t]=v,this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[v]})},n.createTextTrack=function(t,_,g){var v=this.media;return v?v.addTextTrack(t,_,g):void 0},n.onMediaAttaching=function(t,_){this.media=_.media,this._cleanTracks()},n.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(_){Object(e.clearCurrentCues)(t[_]),delete t[_]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},n._cleanTracks=function(){var t=this.media;if(!t)return;var _=t.textTracks;if(_)for(var g=0;g<_.length;g++)Object(e.clearCurrentCues)(_[g])},n.onSubtitleTracksUpdated=function(t,_){var g=this;this.textTracks=[];var v=_.subtitleTracks||[],x=v.some(function(u){return u.textCodec===C.IMSC1_CODEC});if(this.config.enableWebVTT||x&&this.config.enableIMSC1){var E=this.tracks&&v&&this.tracks.length===v.length;if(this.tracks=v||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,l){var b;if(l<y.length){for(var m=null,w=0;w<y.length;w++)if(a(y[w],u)){m=y[w];break}m&&(b=m)}b?Object(e.clearCurrentCues)(b):(b=g.createTextTrack("subtitles",u.name,u.lang),b&&(b.mode="disabled")),b&&(b.groupId=u.groupId,g.textTracks.push(b))})}else if(!E&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},n.onManifestLoaded=function(t,_){var g=this;this.config.enableCEA708Captions&&_.captions&&_.captions.forEach(function(v){var x=/(?:CC|SERVICE)([1-4])/.exec(v.instreamId);if(!x)return;var E="textTrack"+x[1],y=g.captionsProperties[E];if(!y)return;y.label=v.name,v.lang&&(y.languageCode=v.lang),y.media=v})},n.onFragLoading=function(t,_){var g=this.cea608Parser1,v=this.cea608Parser2,x=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(g&&v))return;if(_.frag.type===f.PlaylistLevelType.MAIN){var y,c,u=_.frag.sn,l=(y=_==null||((c=_.part)===null||c===void 0)?void 0:c.index)!=null?y:-1;u===x+1||u===x&&l===E+1||(g.reset(),v.reset()),this.lastSn=u,this.lastPartIndex=l}},n.onFragLoaded=function(t,_){var g=_.frag,v=_.payload,x=this.initPTS,E=this.unparsedVttFrags;if(g.type===f.PlaylistLevelType.SUBTITLE)if(v.byteLength){if(!Object(U.isFiniteNumber)(x[g.cc])){E.push(_),x.length&&this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Missing initial subtitle PTS")});return}var y=g.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var c=this.tracks[g.level],u=this.vttCCs;u[g.cc]||(u[g.cc]={start:g.start,prevCC:this.prevCC,new:!0},this.prevCC=g.cc),c&&c.textCodec===C.IMSC1_CODEC?this._parseIMSC1(g,v):this._parseVTTs(g,v,u)}}else this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(t,_){var g=this,v=this.hls;Object(C.parseIMSC1)(_,this.initPTS[t.cc],this.timescale[t.cc],function(x){g._appendCues(x,t.level),v.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(x){p.logger.log("Failed to parse IMSC1: "+x),v.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:x})})},n._parseVTTs=function(t,_,g){var v=this,x=this.hls;Object(F.parseWebVTT)(_,this.initPTS[t.cc],this.timescale[t.cc],g,t.cc,t.start,function(E){v._appendCues(E,t.level),x.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(E){v._fallbackToIMSC1(t,_),p.logger.log("Failed to parse VTT cue: "+E),x.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:E})})},n._fallbackToIMSC1=function(t,_){var g=this,v=this.tracks[t.level];v.textCodec||Object(C.parseIMSC1)(_,this.initPTS[t.cc],this.timescale[t.cc],function(){v.textCodec=C.IMSC1_CODEC,g._parseIMSC1(t,_)},function(){v.textCodec="wvtt"})},n._appendCues=function(t,_){var g=this.hls;if(this.config.renderTextTracksNatively){var v=this.textTracks[_];if(v.mode==="disabled")return;t.forEach(function(y){return Object(e.addCueToTrack)(v,y)})}else{var x=this.tracks[_],E=x.default?"default":"subtitles"+_;g.trigger(O.Events.CUES_PARSED,{type:"subtitles",cues:t,track:E})}},n.onFragDecrypted=function(t,_){var g=_.frag;if(g.type===f.PlaylistLevelType.SUBTITLE){if(!Object(U.isFiniteNumber)(this.initPTS[g.cc])){this.unparsedVttFrags.push(_);return}this.onFragLoaded(O.Events.FRAG_LOADED,_)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(t,_){var g=this.cea608Parser1,v=this.cea608Parser2;if(!this.enabled||!(g&&v))return;for(var x=0;x<_.samples.length;x++){var E=_.samples[x].bytes;if(E){var y=this.extractCea608Data(E);g.addData(_.samples[x].pts,y[0]),v.addData(_.samples[x].pts,y[1])}}},n.onBufferFlushing=function(t,_){var g=_.startOffset,v=_.endOffset,x=_.endOffsetSubtitles,E=_.type,y=this.media;if(!y||y.currentTime<v)return;if(!E||E==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(l){return Object(e.removeCuesInRange)(c[l],g,v)})}if(this.config.renderTextTracksNatively&&(g===0&&x!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(l){return Object(e.removeCuesInRange)(u[l],g,x)})}},n.extractCea608Data=function(t){for(var _=t[0]&31,g=2,v=[[],[]],x=0;x<_;x++){var E=t[g++],y=127&t[g++],c=127&t[g++],u=(4&E)!==0,l=3&E;if(y===0&&c===0)continue;u&&((l===0||l===1)&&(v[l].push(y),v[l].push(c)))}return v},s}();function a(s,n){return s&&s.label===n.name&&!(s.textTrack1||s.textTrack2)}function r(s,n,i,t){return Math.min(n,t)-Math.max(s,i)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return U});var U=function(){function O(H,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=F}var M=O.prototype;return M.decrypt=function(F,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,F)},O}()},"./src/crypt/aes-decryptor.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"removePadding",function(){return O}),A.d(j,"default",function(){return M});var U=A("./src/utils/typed-array.ts");function O(H){var F=H.byteLength,e=F&&new DataView(H.buffer).getUint8(F-1);return e?Object(U.sliceUint8)(H,0,F-e):H}var M=function(){function H(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var F=H.prototype;return F.uint8ArrayToUint32Array_=function(C){for(var f=new DataView(C),p=new Uint32Array(4),o=0;o<4;o++)p[o]=f.getUint32(o*4);return p},F.initTable=function(){var C=this.sBox,f=this.invSBox,p=this.subMix,o=p[0],a=p[1],r=p[2],h=p[3],s=this.invSubMix,n=s[0],i=s[1],t=s[2],_=s[3],g=new Uint32Array(256),v=0,x=0,E=0;for(E=0;E<256;E++)E<128?g[E]=E<<1:g[E]=E<<1^283;for(E=0;E<256;E++){var y=x^x<<1^x<<2^x<<3^x<<4;y=y>>>8^y&255^99,C[v]=y,f[y]=v;var c=g[v],u=g[c],l=g[u],b=g[y]*257^y*16843008;o[v]=b<<24|b>>>8,a[v]=b<<16|b>>>16,r[v]=b<<8|b>>>24,h[v]=b,b=l*16843009^u*65537^c*257^v*16843008,n[y]=b<<24|b>>>8,i[y]=b<<16|b>>>16,t[y]=b<<8|b>>>24,_[y]=b,v?(v=c^g[g[g[l^c]]],x^=g[g[x]]):v=x=1}},F.expandKey=function(C){for(var f=this.uint8ArrayToUint32Array_(C),p=!0,o=0;o<f.length&&p;)p=f[o]===this.key[o],o++;if(p)return;this.key=f;var a=this.keySize=f.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var r=this.ksRows=(a+6+1)*4,h,s,n=this.keySchedule=new Uint32Array(r),i=this.invKeySchedule=new Uint32Array(r),t=this.sBox,_=this.rcon,g=this.invSubMix,v=g[0],x=g[1],E=g[2],y=g[3],c,u;for(h=0;h<r;h++){if(h<a){c=n[h]=f[h];continue}u=c,h%a===0?(u=u<<8|u>>>24,u=t[u>>>24]<<24|t[u>>>16&255]<<16|t[u>>>8&255]<<8|t[u&255],u^=_[h/a|0]<<24):a>6&&h%a===4&&(u=t[u>>>24]<<24|t[u>>>16&255]<<16|t[u>>>8&255]<<8|t[u&255]),n[h]=c=(n[h-a]^u)>>>0}for(s=0;s<r;s++)h=r-s,s&3?u=n[h]:u=n[h-4],s<4||h<=4?i[s]=u:i[s]=v[t[u>>>24]]^x[t[u>>>16&255]]^E[t[u>>>8&255]]^y[t[u&255]],i[s]=i[s]>>>0},F.networkToHostOrderSwap=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},F.decrypt=function(C,f,p){for(var o=this.keySize+6,a=this.invKeySchedule,r=this.invSBox,h=this.invSubMix,s=h[0],n=h[1],i=h[2],t=h[3],_=this.uint8ArrayToUint32Array_(p),g=_[0],v=_[1],x=_[2],E=_[3],y=new Int32Array(C),c=new Int32Array(y.length),u,l,b,m,w,I,L,S,D,B,R,W,Y,se,ne=this.networkToHostOrderSwap;f<y.length;){for(D=ne(y[f]),B=ne(y[f+1]),R=ne(y[f+2]),W=ne(y[f+3]),w=D^a[0],I=W^a[1],L=R^a[2],S=B^a[3],Y=4,se=1;se<o;se++)u=s[w>>>24]^n[I>>16&255]^i[L>>8&255]^t[S&255]^a[Y],l=s[I>>>24]^n[L>>16&255]^i[S>>8&255]^t[w&255]^a[Y+1],b=s[L>>>24]^n[S>>16&255]^i[w>>8&255]^t[I&255]^a[Y+2],m=s[S>>>24]^n[w>>16&255]^i[I>>8&255]^t[L&255]^a[Y+3],w=u,I=l,L=b,S=m,Y=Y+4;u=r[w>>>24]<<24^r[I>>16&255]<<16^r[L>>8&255]<<8^r[S&255]^a[Y],l=r[I>>>24]<<24^r[L>>16&255]<<16^r[S>>8&255]<<8^r[w&255]^a[Y+1],b=r[L>>>24]<<24^r[S>>16&255]<<16^r[w>>8&255]<<8^r[I&255]^a[Y+2],m=r[S>>>24]<<24^r[w>>16&255]<<16^r[I>>8&255]<<8^r[L&255]^a[Y+3],c[f]=ne(u^g),c[f+1]=ne(m^v),c[f+2]=ne(b^x),c[f+3]=ne(l^E),g=D,v=B,x=R,E=W,f=f+4}return c.buffer},H}()},"./src/crypt/decrypter.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return f});var U=A("./src/crypt/aes-crypto.ts"),O=A("./src/crypt/fast-aes-key.ts"),M=A("./src/crypt/aes-decryptor.ts"),H=A("./src/utils/logger.ts"),F=A("./src/utils/mp4-tools.ts"),e=A("./src/utils/typed-array.ts"),C=16,f=function(){function p(a,r,h){var s=h===void 0?{}:h,n=s.removePKCS7Padding,i=n===void 0?!0:n;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=a,this.config=r,this.removePKCS7Padding=i,i)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(_){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var o=p.prototype;return o.destroy=function(){this.observer=null},o.isSync=function(){return this.config.enableSoftwareAES},o.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var h=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(h):h},o.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},o.decrypt=function(r,h,s,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),h,s);var i=this.flush();i&&n(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),h,s).then(n)},o.softwareDecrypt=function(r,h,s){var n=this.currentIV,i=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(r=Object(F.appendUint8Array)(t,r),this.remainderData=null);var _=this.getValidChunk(r);if(!_.length)return null;n&&(s=n);var g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new M.default),g.expandKey(h);var v=i;return this.currentResult=g.decrypt(_.buffer,0,s),this.currentIV=Object(e.sliceUint8)(_,-16).buffer,v||null},o.webCryptoDecrypt=function(r,h,s){var n=this,i=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new O.default(i,h)),this.fastAesKey.expandKey().then(function(t){if(!i)return Promise.reject(new Error("web crypto not initialized"));var _=new U.default(i,s);return _.decrypt(r.buffer,t)}).catch(function(t){return n.onWebCryptoError(t,r,h,s)})},o.onWebCryptoError=function(r,h,s,n){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,s,n)},o.getValidChunk=function(r){var h=r,s=r.length-r.length%C;return s!==r.length&&(h=Object(e.sliceUint8)(r,0,s),this.remainderData=Object(e.sliceUint8)(r,s)),h},o.logOnce=function(r){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return U});var U=function(){function O(H,F){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=F}var M=O.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},O}()},"./src/demux/aacdemuxer.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/demux/base-audio-demuxer.ts"),O=A("./src/demux/adts.ts"),M=A("./src/utils/logger.ts"),H=A("./src/demux/id3.ts");function F(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,e(f,p)}function e(f,p){return e=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},e(f,p)}var C=function(f){F(p,f);function p(a,r){var h;return h=f.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=a,h.config=r,h}var o=p.prototype;return o.resetInitSegment=function(r,h,s){f.prototype.resetInitSegment.call(this,r,h,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:s,inputTimeScale:9e4,dropped:0}},p.probe=function(r){if(!r)return!1;for(var h=H.getID3Data(r,0)||[],s=h.length,n=r.length;s<n;s++)if(O.probe(r,s))return M.logger.log("ADTS sync word found !"),!0;return!1},o.canParse=function(r,h){return O.canParse(r,h)},o.appendFrame=function(r,h,s){O.initTrackConfig(r,this.observer,h,s,r.manifestCodec);var n=O.appendFrame(r,h,s,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},p}(U.default);C.minProbeByteLength=9,j.default=C},"./src/demux/adts.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"getAudioConfig",function(){return H}),A.d(j,"isHeaderPattern",function(){return F}),A.d(j,"getHeaderLength",function(){return e}),A.d(j,"getFullFrameLength",function(){return C}),A.d(j,"canGetFrameLength",function(){return f}),A.d(j,"isHeader",function(){return p}),A.d(j,"canParse",function(){return o}),A.d(j,"probe",function(){return a}),A.d(j,"initTrackConfig",function(){return r}),A.d(j,"getFrameDuration",function(){return h}),A.d(j,"parseFrameHeader",function(){return s}),A.d(j,"appendFrame",function(){return n});var U=A("./src/utils/logger.ts"),O=A("./src/errors.ts"),M=A("./src/events.ts");function H(i,t,_,g){var v,x,E,y,c=navigator.userAgent.toLowerCase(),u=g,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];v=((t[_+2]&192)>>>6)+1;var b=(t[_+2]&60)>>>2;if(b>l.length-1){i.trigger(M.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b});return}return E=(t[_+2]&1)<<2,E|=(t[_+3]&192)>>>6,U.logger.log("manifest codec:"+g+", ADTS type:"+v+", samplingIndex:"+b),/firefox/i.test(c)?b>=6?(v=5,y=new Array(4),x=b-3):(v=2,y=new Array(2),x=b):c.indexOf("android")!==-1?(v=2,y=new Array(2),x=b):(v=5,y=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&b>=6?x=b-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(b>=6&&E===1||/vivaldi/i.test(c))||!g&&E===1)&&(v=2,y=new Array(2)),x=b)),y[0]=v<<3,y[0]|=(b&14)>>1,y[1]|=(b&1)<<7,y[1]|=E<<3,v===5&&(y[1]|=(x&14)>>1,y[2]=(x&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:l[b],channelCount:E,codec:"mp4a.40."+v,manifestCodec:u}}function F(i,t){return i[t]===255&&(i[t+1]&246)===240}function e(i,t){return i[t+1]&1?7:9}function C(i,t){return(i[t+3]&3)<<11|i[t+4]<<3|(i[t+5]&224)>>>5}function f(i,t){return t+5<i.length}function p(i,t){return t+1<i.length&&F(i,t)}function o(i,t){return f(i,t)&&F(i,t)&&C(i,t)<=i.length-t}function a(i,t){if(p(i,t)){var _=e(i,t);if(t+_>=i.length)return!1;var g=C(i,t);if(g<=_)return!1;var v=t+g;return v===i.length||p(i,v)}return!1}function r(i,t,_,g,v){if(!i.samplerate){var x=H(t,_,g,v);if(!x)return;i.config=x.config,i.samplerate=x.samplerate,i.channelCount=x.channelCount,i.codec=x.codec,i.manifestCodec=x.manifestCodec,U.logger.log("parsed codec:"+i.codec+", rate:"+x.samplerate+", channels:"+x.channelCount)}}function h(i){return 1024*9e4/i}function s(i,t,_,g,v){var x=e(i,t),E=C(i,t);if(E-=x,E>0){var y=_+g*v;return{headerLength:x,frameLength:E,stamp:y}}}function n(i,t,_,g,v){var x=h(i.samplerate),E=s(t,_,g,v,x);if(E){var y=E.frameLength,c=E.headerLength,u=E.stamp,l=c+y,b=Math.max(0,_+l-t.length),m;b?(m=new Uint8Array(l-c),m.set(t.subarray(_+c,t.length),0)):m=t.subarray(_+c,_+l);var w={unit:m,pts:u};return b||i.samples.push(w),{sample:w,length:l,missing:b}}}},"./src/demux/base-audio-demuxer.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"initPTSFn",function(){return C});var U=A("./src/polyfills/number.ts"),O=A("./src/demux/id3.ts"),M=A("./src/demux/dummy-demuxed-track.ts"),H=A("./src/utils/mp4-tools.ts"),F=A("./src/utils/typed-array.ts"),e=function(){function f(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=f.prototype;return p.resetInitSegment=function(a,r,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(a,r){return!1},p.appendFrame=function(a,r,h){},p.demux=function(a,r){this.cachedData&&(a=Object(H.appendUint8Array)(this.cachedData,a),this.cachedData=null);var h=O.getID3Data(a,0),s=h?h.length:0,n,i,t=this._audioTrack,_=this._id3Track,g=h?O.getTimeStamp(h):void 0,v=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=C(g,r)),h&&h.length>0&&_.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),i=this.initPTS;s<v;){if(this.canParse(a,s)){var x=this.appendFrame(t,a,s);x?(this.frameIndex++,i=x.sample.pts,s+=x.length,n=s):s=v}else O.canParse(a,s)?(h=O.getID3Data(a,s),_.samples.push({pts:i,dts:i,data:h}),s+=h.length,n=s):s++;if(s===v&&n!==v){var E=Object(F.sliceUint8)(a,n);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:t,avcTrack:Object(M.dummyTrack)(),id3Track:_,textTrack:Object(M.dummyTrack)()}},p.demuxSampleAes=function(a,r,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(a){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},p.destroy=function(){},f}(),C=function(p,o){return Object(U.isFiniteNumber)(p)?p*90:o*9e4};j.default=e},"./src/demux/chunk-cache.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return U});var U=function(){function M(){this.chunks=[],this.dataLength=0}var H=M.prototype;return H.push=function(e){this.chunks.push(e),this.dataLength+=e.length},H.flush=function(){var e=this.chunks,C=this.dataLength,f;if(e.length)e.length===1?f=e[0]:f=O(e,C);else return new Uint8Array(0);return this.reset(),f},H.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function O(M,H){for(var F=new Uint8Array(H),e=0,C=0;C<M.length;C++){var f=M[C];F.set(f,e),e+=f.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"dummyTrack",function(){return U});function U(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/utils/logger.ts"),O=function(){function M(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var H=M.prototype;return H.loadWord=function(){var e=this.data,C=this.bytesAvailable,f=e.byteLength-C,p=new Uint8Array(4),o=Math.min(4,C);if(o===0)throw new Error("no bytes available");p.set(e.subarray(f,f+o)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=o*8,this.bytesAvailable-=o},H.skipBits=function(e){var C;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,C=e>>3,e-=C>>3,this.bytesAvailable-=C,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},H.readBits=function(e){var C=Math.min(this.bitsAvailable,e),f=this.word>>>32-C;return e>32&&U.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=C,this.bitsAvailable>0?this.word<<=C:this.bytesAvailable>0&&this.loadWord(),C=e-C,C>0&&this.bitsAvailable?f<<C|this.readBits(C):f},H.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},H.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(e){for(var C=8,f=8,p,o=0;o<e;o++)f!==0&&(p=this.readEG(),f=(C+p+256)%256),C=f===0?C:f},H.readSPS=function(){var e=0,C=0,f=0,p=0,o,a,r,h=this.readUByte.bind(this),s=this.readBits.bind(this),n=this.readUEG.bind(this),i=this.readBoolean.bind(this),t=this.skipBits.bind(this),_=this.skipEG.bind(this),g=this.skipUEG.bind(this),v=this.skipScalingList.bind(this);h();var x=h();if(s(5),t(3),h(),g(),x===100||x===110||x===122||x===244||x===44||x===83||x===86||x===118||x===128){var E=n();if(E===3&&t(1),g(),g(),t(1),i())for(a=E!==3?8:12,r=0;r<a;r++)i()&&(r<6?v(16):v(64))}g();var y=n();if(y===0)n();else if(y===1)for(t(1),_(),_(),o=n(),r=0;r<o;r++)_();g(),t(1);var c=n(),u=n(),l=s(1);l===0&&t(1),t(1),i()&&(e=n(),C=n(),f=n(),p=n());var b=[1,1];if(i()&&i()){var m=h();switch(m){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:{b=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((c+1)*16-e*2-C*2),height:(2-l)*(u+1)*16-(l?2:4)*(f+p),pixelRatio:b}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();j.default=O},"./src/demux/id3.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"isHeader",function(){return U}),A.d(j,"isFooter",function(){return O}),A.d(j,"getID3Data",function(){return M}),A.d(j,"canParse",function(){return F}),A.d(j,"getTimeStamp",function(){return e}),A.d(j,"isTimeStampFrame",function(){return C}),A.d(j,"getID3Frames",function(){return p}),A.d(j,"decodeFrame",function(){return o}),A.d(j,"utf8ArrayToStr",function(){return n}),A.d(j,"testables",function(){return i});var U=function(v,x){return x+10<=v.length&&(v[x]===73&&v[x+1]===68&&v[x+2]===51&&(v[x+3]<255&&v[x+4]<255&&(v[x+6]<128&&v[x+7]<128&&v[x+8]<128&&v[x+9]<128)))},O=function(v,x){return x+10<=v.length&&(v[x]===51&&v[x+1]===68&&v[x+2]===73&&(v[x+3]<255&&v[x+4]<255&&(v[x+6]<128&&v[x+7]<128&&v[x+8]<128&&v[x+9]<128)))},M=function(v,x){for(var E=x,y=0;U(v,x);){y+=10;var c=H(v,x+6);y+=c,O(v,x+10)&&(y+=10),x+=y}return y>0?v.subarray(E,E+y):void 0},H=function(v,x){var E=0;return E=(v[x]&127)<<21,E|=(v[x+1]&127)<<14,E|=(v[x+2]&127)<<7,E|=v[x+3]&127,E},F=function(v,x){return U(v,x)&&H(v,x+6)+10<=v.length-x},e=function(v){for(var x=p(v),E=0;E<x.length;E++){var y=x[E];if(C(y))return s(y)}return},C=function(v){return v&&v.key==="PRIV"&&v.info==="com.apple.streaming.transportStreamTimestamp"},f=function(v){var x=String.fromCharCode(v[0],v[1],v[2],v[3]),E=H(v,4),y=10;return{type:x,size:E,data:v.subarray(y,y+E)}},p=function(v){for(var x=0,E=[];U(v,x);){var y=H(v,x+6);x+=10;for(var c=x+y;x+8<c;){var u=f(v.subarray(x)),l=o(u);l&&E.push(l),x+=u.size+10}O(v,x)&&(x+=10)}return E},o=function(v){return v.type==="PRIV"?a(v):v.type[0]==="W"?h(v):r(v)},a=function(v){if(v.size<2)return;var x=n(v.data,!0),E=new Uint8Array(v.data.subarray(x.length+1));return{key:v.type,info:x,data:E.buffer}},r=function(v){if(v.size<2)return;if(v.type==="TXXX"){var x=1,E=n(v.data.subarray(x),!0);x+=E.length+1;var y=n(v.data.subarray(x));return{key:v.type,info:E,data:y}}var c=n(v.data.subarray(1));return{key:v.type,data:c}},h=function(v){if(v.type==="WXXX"){if(v.size<2)return;var x=1,E=n(v.data.subarray(x),!0);x+=E.length+1;var y=n(v.data.subarray(x));return{key:v.type,info:E,data:y}}var c=n(v.data);return{key:v.type,data:c}},s=function(v){if(v.data.byteLength===8){var x=new Uint8Array(v.data),E=x[3]&1,y=(x[4]<<23)+(x[5]<<15)+(x[6]<<7)+x[7];return y/=45,E&&(y+=4772185884e-2),Math.round(y)}return},n=function(v,x){x===void 0&&(x=!1);var E=_();if(E){var y=E.decode(v);if(x){var c=y.indexOf("\0");return c!==-1?y.substring(0,c):y}return y.replace(/\0/g,"")}for(var u=v.length,l,b,m,w="",I=0;I<u;){if(l=v[I++],l===0&&x)return w;if(l===0||l===3)continue;switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(l);break;case 12:case 13:b=v[I++],w+=String.fromCharCode((l&31)<<6|b&63);break;case 14:b=v[I++],m=v[I++],w+=String.fromCharCode((l&15)<<12|(b&63)<<6|(m&63)<<0);break;default:}}return w},i={decodeTextFrame:r},t;function _(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/demux/base-audio-demuxer.ts"),O=A("./src/demux/id3.ts"),M=A("./src/utils/logger.ts"),H=A("./src/demux/mpegaudio.ts");function F(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,e(f,p)}function e(f,p){return e=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},e(f,p)}var C=function(f){F(p,f);function p(){return f.apply(this,arguments)||this}var o=p.prototype;return o.resetInitSegment=function(r,h,s){f.prototype.resetInitSegment.call(this,r,h,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:s,inputTimeScale:9e4,dropped:0}},p.probe=function(r){if(!r)return!1;for(var h=O.getID3Data(r,0)||[],s=h.length,n=r.length;s<n;s++)if(H.probe(r,s))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},o.canParse=function(r,h){return H.canParse(r,h)},o.appendFrame=function(r,h,s){return this.initPTS===null?void 0:H.appendFrame(r,h,s,this.initPTS,this.frameIndex)},p}(U.default);C.minProbeByteLength=4,j.default=C},"./src/demux/mp4demuxer.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/utils/mp4-tools.ts"),O=A("./src/demux/dummy-demuxed-track.ts"),M=function(){function H(e,C){this.remainderData=null,this.config=void 0,this.config=C}var F=H.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},H.probe=function(C){return Object(U.findBox)({data:C,start:0,end:Math.min(C.length,16384)},["moof"]).length>0},F.demux=function(C){var f=C,p=Object(O.dummyTrack)();if(this.config.progressive){this.remainderData&&(f=Object(U.appendUint8Array)(this.remainderData,C));var o=Object(U.segmentValidRange)(f);this.remainderData=o.remainder,p.samples=o.valid||new Uint8Array}else p.samples=f;return{audioTrack:Object(O.dummyTrack)(),avcTrack:p,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},F.flush=function(){var C=Object(O.dummyTrack)();return C.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(O.dummyTrack)(),avcTrack:C,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},F.demuxSampleAes=function(C,f,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},H}();M.minProbeByteLength=1024,j.default=M},"./src/demux/mpegaudio.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"appendFrame",function(){return e}),A.d(j,"parseHeader",function(){return C}),A.d(j,"isHeaderPattern",function(){return f}),A.d(j,"isHeader",function(){return p}),A.d(j,"canParse",function(){return o}),A.d(j,"probe",function(){return a});var U=null,O=[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],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function e(r,h,s,n,i){if(s+24>h.length)return;var t=C(h,s);if(t&&s+t.frameLength<=h.length){var _=t.samplesPerFrame*9e4/t.sampleRate,g=n+i*_,v={unit:h.subarray(s,s+t.frameLength),pts:g,dts:g};return r.config=[],r.channelCount=t.channelCount,r.samplerate=t.sampleRate,r.samples.push(v),{sample:v,length:t.frameLength,missing:0}}}function C(r,h){var s=r[h+1]>>3&3,n=r[h+1]>>1&3,i=r[h+2]>>4&15,t=r[h+2]>>2&3;if(s!==1&&i!==0&&i!==15&&t!==3){var _=r[h+2]>>1&1,g=r[h+3]>>6,v=s===3?3-n:n===3?3:4,x=O[v*14+i-1]*1e3,E=s===3?0:s===2?1:2,y=M[E*3+t],c=g===3?1:2,u=H[s][n],l=F[n],b=u*8*l,m=Math.floor(u*x/y+_)*l;if(U===null){var w=navigator.userAgent||"",I=w.match(/Chrome\/(\d+)/i);U=I?parseInt(I[1]):0}var L=!!U&&U<=87;return L&&n===2&&x>=224e3&&g===0&&(r[h+3]=r[h+3]|128),{sampleRate:y,channelCount:c,frameLength:m,samplesPerFrame:b}}}function f(r,h){return r[h]===255&&(r[h+1]&224)===224&&(r[h+1]&6)!==0}function p(r,h){return h+1<r.length&&f(r,h)}function o(r,h){var s=4;return f(r,h)&&s<=r.length-h}function a(r,h){if(h+1<r.length&&f(r,h)){var s=4,n=C(r,h),i=s;n!=null&&n.frameLength&&(i=n.frameLength);var t=h+i;return t===r.length||p(r,t)}return!1}},"./src/demux/sample-aes.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/crypt/decrypter.ts"),O=A("./src/demux/tsdemuxer.ts"),M=function(){function H(e,C,f){this.keyData=void 0,this.decrypter=void 0,this.keyData=f,this.decrypter=new U.default(e,C,{removePKCS7Padding:!1})}var F=H.prototype;return F.decryptBuffer=function(C,f){this.decrypter.decrypt(C,this.keyData.key.buffer,this.keyData.iv.buffer,f)},F.decryptAacSample=function(C,f,p,o){var a=C[f].unit,r=a.subarray(16,a.length-a.length%16),h=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),s=this;this.decryptBuffer(h,function(n){var i=new Uint8Array(n);a.set(i,16),o||s.decryptAacSamples(C,f+1,p)})},F.decryptAacSamples=function(C,f,p){for(;;f++){if(f>=C.length){p();return}if(C[f].unit.length<32)continue;var o=this.decrypter.isSync();if(this.decryptAacSample(C,f,p,o),!o)return}},F.getAvcEncryptedData=function(C){for(var f=Math.floor((C.length-48)/160)*16+16,p=new Int8Array(f),o=0,a=32;a<=C.length-16;a+=160,o+=16)p.set(C.subarray(a,a+16),o);return p},F.getAvcDecryptedUnit=function(C,f){for(var p=new Uint8Array(f),o=0,a=32;a<=C.length-16;a+=160,o+=16)C.set(p.subarray(o,o+16),a);return C},F.decryptAvcSample=function(C,f,p,o,a,r){var h=Object(O.discardEPB)(a.data),s=this.getAvcEncryptedData(h),n=this;this.decryptBuffer(s.buffer,function(i){a.data=n.getAvcDecryptedUnit(h,i),r||n.decryptAvcSamples(C,f,p+1,o)})},F.decryptAvcSamples=function(C,f,p,o){if(C instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;f++,p=0){if(f>=C.length){o();return}for(var a=C[f].units;!(p>=a.length);p++){var r=a[p];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(C,f,p,o,r,h),!h)return}}},H}();j.default=M},"./src/demux/transmuxer-interface.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return a});var U=A("./node_modules/webworkify-webpack/index.js"),O=A.n(U),M=A("./src/events.ts"),H=A("./src/demux/transmuxer.ts"),F=A("./src/utils/logger.ts"),e=A("./src/errors.ts"),C=A("./src/utils/mediasource-helper.ts"),f=A("./node_modules/eventemitter3/index.js"),p=A.n(f),o=Object(C.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function r(s,n,i,t){var _=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=s,this.id=n,this.onTransmuxComplete=i,this.onFlush=t;var g=s.config,v=function(u,l){l=l||{},l.frag=_.frag,l.id=_.id,s.trigger(u,l)};this.observer=new f.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,v),this.observer.on(M.Events.ERROR,v);var x={mp4:o.isTypeSupported("video/mp4"),mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var y;try{y=this.worker=U("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(c){s.trigger(M.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},y.postMessage({cmd:"init",typeSupported:x,vendor:E,id:n,config:JSON.stringify(g)})}catch(c){F.logger.warn("Error in worker:",c),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new H.default(this.observer,x,g,E,n),this.worker=null}}else this.transmuxer=new H.default(this.observer,x,g,E,n)}var h=r.prototype;return h.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},h.push=function(n,i,t,_,g,v,x,E,y,c){var u=this;y.transmuxing.start=self.performance.now();var l=this.transmuxer,b=this.worker,m=v?v.start:g.start,w=g.decryptdata,I=this.frag,L=!(I&&g.cc===I.cc),S=!(I&&y.level===I.level),D=I?y.sn-I.sn:-1,B=this.part?y.part-this.part.index:1,R=!S&&(D===1||D===0&&B===1),W=self.performance.now();(S||D||g.stats.parsing.start===0)&&(g.stats.parsing.start=W),v&&(B||!R)&&(v.stats.parsing.start=W);var Y=new H.TransmuxState(L,R,E,S,m);if(!R||L){F.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
|
|
discontinuity: `+L+`
|
|
trackSwitch: `+S+`
|
|
contiguous: `+R+`
|
|
accurateTimeOffset: `+E+`
|
|
timeOffset: `+m);var se=new H.TransmuxConfig(t,_,i,x,c);this.configureTransmuxer(se)}if(this.frag=g,this.part=v,b)b.postMessage({cmd:"demux",data:n,decryptdata:w,chunkMeta:y,state:Y},n instanceof ArrayBuffer?[n]:[]);else if(l){var ne=l.push(n,w,y,Y);Object(H.isPromise)(ne)?ne.then(function(Se){u.handleTransmuxComplete(Se)}):this.handleTransmuxComplete(ne)}},h.flush=function(n){var i=this;n.transmuxing.start=self.performance.now();var t=this.transmuxer,_=this.worker;if(_)_.postMessage({cmd:"flush",chunkMeta:n});else if(t){var g=t.flush(n);Object(H.isPromise)(g)?g.then(function(v){i.handleFlushResult(v,n)}):this.handleFlushResult(g,n)}},h.handleFlushResult=function(n,i){var t=this;n.forEach(function(_){t.handleTransmuxComplete(_)}),this.onFlush(i)},h.onWorkerMessage=function(n){var i=n.data,t=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,t.trigger(i.event,i.data);break}}},h.configureTransmuxer=function(n){var i=this.worker,t=this.transmuxer;i?i.postMessage({cmd:"configure",config:n}):t&&t.configure(n)},h.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},r}()},"./src/demux/transmuxer-worker.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return e});var U=A("./src/demux/transmuxer.ts"),O=A("./src/events.ts"),M=A("./src/utils/logger.ts"),H=A("./node_modules/eventemitter3/index.js"),F=A.n(H);function e(a){var r=new H.EventEmitter,h=function(n,i){a.postMessage({event:n,data:i})};r.on(O.Events.FRAG_DECRYPTED,h),r.on(O.Events.ERROR,h),a.addEventListener("message",function(s){var n=s.data;switch(n.cmd){case"init":{var i=JSON.parse(n.config);a.transmuxer=new U.default(r,n.typeSupported,i,n.vendor,n.id),Object(M.enableLogs)(i.debug),h("init",null);break}case"configure":{a.transmuxer.configure(n.config);break}case"demux":{var t=a.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(U.isPromise)(t)?t.then(function(v){C(a,v)}):C(a,t);break}case"flush":{var _=n.chunkMeta,g=a.transmuxer.flush(_);Object(U.isPromise)(g)?g.then(function(v){p(a,v,_)}):p(a,g,_);break}default:break}})}function C(a,r){if(o(r.remuxResult))return;var h=[],s=r.remuxResult,n=s.audio,i=s.video;n&&f(h,n),i&&f(h,i),a.postMessage({event:"transmuxComplete",data:r},h)}function f(a,r){r.data1&&a.push(r.data1.buffer),r.data2&&a.push(r.data2.buffer)}function p(a,r,h){r.forEach(function(s){C(a,s)}),a.postMessage({event:"flush",data:h})}function o(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return i}),A.d(j,"isPromise",function(){return g}),A.d(j,"TransmuxConfig",function(){return v}),A.d(j,"TransmuxState",function(){return x});var U=A("./src/events.ts"),O=A("./src/errors.ts"),M=A("./src/crypt/decrypter.ts"),H=A("./src/demux/aacdemuxer.ts"),F=A("./src/demux/mp4demuxer.ts"),e=A("./src/demux/tsdemuxer.ts"),C=A("./src/demux/mp3demuxer.ts"),f=A("./src/remux/mp4-remuxer.ts"),p=A("./src/remux/passthrough-remuxer.ts"),o=A("./src/demux/chunk-cache.ts"),a=A("./src/utils/mp4-tools.ts"),r=A("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(E){r.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var s=[{demux:e.default,remux:f.default},{demux:F.default,remux:p.default},{demux:H.default,remux:f.default},{demux:C.default,remux:f.default}],n=1024;s.forEach(function(E){var y=E.demux;n=Math.max(n,y.minProbeByteLength)});var i=function(){function E(c,u,l,b,m){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new o.default,this.observer=c,this.typeSupported=u,this.config=l,this.vendor=b,this.id=m}var y=E.prototype;return y.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},y.push=function(u,l,b,m){var w=this,I=b.transmuxing;I.executeStart=h();var L=new Uint8Array(u),S=this.cache,D=this.config,B=this.currentTransmuxState,R=this.transmuxConfig;m&&(this.currentTransmuxState=m);var W=t(L,l);if(W&&W.method==="AES-128"){var Y=this.getDecrypter();if(D.enableSoftwareAES){var se=Y.softwareDecrypt(L,W.key.buffer,W.iv.buffer);if(!se)return I.executeEnd=h(),_(b);L=new Uint8Array(se)}else return this.decryptionPromise=Y.webCryptoDecrypt(L,W.key.buffer,W.iv.buffer).then(function(Ue){var Ve=w.push(Ue,null,b);return w.decryptionPromise=null,Ve}),this.decryptionPromise}var ne=m||B,Se=ne.contiguous,xe=ne.discontinuity,we=ne.trackSwitch,Re=ne.accurateTimeOffset,Pe=ne.timeOffset,ye=R.audioCodec,ee=R.videoCodec,je=R.defaultInitPts,et=R.duration,He=R.initSegmentData;if((xe||we)&&this.resetInitSegment(He,ye,ee,et),xe&&this.resetInitialTimestamp(je),Se||this.resetContiguity(),this.needsProbing(L,xe,we)){if(S.dataLength){var Ne=S.flush();L=Object(a.appendUint8Array)(Ne,L)}this.configureTransmuxer(L,R)}var Ye=this.transmux(L,W,Pe,Re,b),Ae=this.currentTransmuxState;return Ae.contiguous=!0,Ae.discontinuity=!1,Ae.trackSwitch=!1,I.executeEnd=h(),Ye},y.flush=function(u){var l=this,b=u.transmuxing;b.executeStart=h();var m=this.decrypter,w=this.cache,I=this.currentTransmuxState,L=this.decryptionPromise;if(L)return L.then(function(){return l.flush(u)});var S=[],D=I.timeOffset;if(m){var B=m.flush();B&&S.push(this.push(B,null,u))}var R=w.dataLength;w.reset();var W=this.demuxer,Y=this.remuxer;if(!W||!Y)return R>=n&&this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),b.executeEnd=h(),[_(u)];var se=W.flush(D);return g(se)?se.then(function(ne){return l.flushRemux(S,ne,u),S}):(this.flushRemux(S,se,u),S)},y.flushRemux=function(u,l,b){var m=l.audioTrack,w=l.avcTrack,I=l.id3Track,L=l.textTrack,S=this.currentTransmuxState,D=S.accurateTimeOffset,B=S.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var R=this.remuxer.remux(m,w,I,L,B,D,!0,this.id);u.push({remuxResult:R,chunkMeta:b}),b.transmuxing.executeEnd=h()},y.resetInitialTimestamp=function(u){var l=this.demuxer,b=this.remuxer;if(!l||!b)return;l.resetTimeStamp(u),b.resetTimeStamp(u)},y.resetContiguity=function(){var u=this.demuxer,l=this.remuxer;if(!u||!l)return;u.resetContiguity(),l.resetNextTimestamp()},y.resetInitSegment=function(u,l,b,m){var w=this.demuxer,I=this.remuxer;if(!w||!I)return;w.resetInitSegment(l,b,m),I.resetInitSegment(u,l,b)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(u,l,b,m,w){var I;return l&&l.method==="SAMPLE-AES"?I=this.transmuxSampleAes(u,l,b,m,w):I=this.transmuxUnencrypted(u,b,m,w),I},y.transmuxUnencrypted=function(u,l,b,m){var w=this.demuxer.demux(u,l,!1,!this.config.progressive),I=w.audioTrack,L=w.avcTrack,S=w.id3Track,D=w.textTrack,B=this.remuxer.remux(I,L,S,D,l,b,!1,this.id);return{remuxResult:B,chunkMeta:m}},y.transmuxSampleAes=function(u,l,b,m,w){var I=this;return this.demuxer.demuxSampleAes(u,l,b).then(function(L){var S=I.remuxer.remux(L.audioTrack,L.avcTrack,L.id3Track,L.textTrack,b,m,!1,I.id);return{remuxResult:S,chunkMeta:w}})},y.configureTransmuxer=function(u,l){for(var b=this.config,m=this.observer,w=this.typeSupported,I=this.vendor,L=l.audioCodec,S=l.defaultInitPts,D=l.duration,B=l.initSegmentData,R=l.videoCodec,W,Y=0,se=s.length;Y<se;Y++)if(s[Y].demux.probe(u)){W=s[Y];break}W||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:F.default,remux:p.default});var ne=this.demuxer,Se=this.remuxer,xe=W.remux,we=W.demux;(!Se||!(Se instanceof xe))&&(this.remuxer=new xe(m,b,w,I)),(!ne||!(ne instanceof we))&&(this.demuxer=new we(m,b,w),this.probe=we.probe),this.resetInitSegment(B,L,R,D),this.resetInitialTimestamp(S)},y.needsProbing=function(u,l,b){return!this.demuxer||!this.remuxer||l||b},y.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new M.default(this.observer,this.config)),u},E}();function t(E,y){var c=null;return E.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(c=y),c}var _=function(y){return{remuxResult:{},chunkMeta:y}};function g(E){return"then"in E&&E.then instanceof Function}var v=function(y,c,u,l,b){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=c,this.initSegmentData=u,this.duration=l,this.defaultInitPts=b},x=function(y,c,u,l,b){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=c,this.accurateTimeOffset=u,this.trackSwitch=l,this.timeOffset=b}},"./src/demux/tsdemuxer.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"discardEPB",function(){return _});var U=A("./src/demux/adts.ts"),O=A("./src/demux/mpegaudio.ts"),M=A("./src/demux/exp-golomb.ts"),H=A("./src/demux/id3.ts"),F=A("./src/demux/sample-aes.ts"),e=A("./src/events.ts"),C=A("./src/utils/mp4-tools.ts"),f=A("./src/utils/logger.ts"),p=A("./src/errors.ts"),o={video:1,audio:2,id3:3,text:4},a=function(){function g(x,E,y){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=x,this.config=E,this.typeSupported=y}g.probe=function(E){var y=g.syncOffset(E);return y<0?!1:(y&&f.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},g.syncOffset=function(E){for(var y=Math.min(1e3,E.length-3*188),c=0;c<y;){if(E[c]===71&&E[c+188]===71&&E[c+2*188]===71)return c;c++}return-1},g.createTrack=function(E,y){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:o[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?y:void 0}};var v=g.prototype;return v.resetInitSegment=function(E,y,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=g.createTrack("video",c),this._audioTrack=g.createTrack("audio",c),this._id3Track=g.createTrack("id3",c),this._txtTrack=g.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=y,this._duration=c},v.resetTimeStamp=function(){},v.resetContiguity=function(){var E=this._audioTrack,y=this._avcTrack,c=this._id3Track;E&&(E.pesData=null),y&&(y.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},v.demux=function(E,y,c,u){c===void 0&&(c=!1),u===void 0&&(u=!1),c||(this.sampleAes=null);var l,b=this._avcTrack,m=this._audioTrack,w=this._id3Track,I=b.pid,L=b.pesData,S=m.pid,D=w.pid,B=m.pesData,R=w.pesData,W=!1,Y=this.pmtParsed,se=this._pmtId,ne=E.length;if(this.remainderData&&(E=Object(C.appendUint8Array)(this.remainderData,E),ne=E.length,this.remainderData=null),ne<188&&!u)return this.remainderData=E,{audioTrack:m,avcTrack:b,id3Track:w,textTrack:this._txtTrack};var Se=Math.max(0,g.syncOffset(E));ne-=(ne+Se)%188,ne<E.byteLength&&!u&&(this.remainderData=new Uint8Array(E.buffer,ne,E.buffer.byteLength-ne));for(var xe=Se;xe<ne;xe+=188)if(E[xe]===71){var we=!!(E[xe+1]&64),Re=((E[xe+1]&31)<<8)+E[xe+2],Pe=(E[xe+3]&48)>>4,ye=void 0;if(Pe>1){if(ye=xe+5+E[xe+4],ye===xe+188)continue}else ye=xe+4;switch(Re){case I:we&&(L&&(l=n(L))&&this.parseAVCPES(l,!1),L={data:[],size:0}),L&&(L.data.push(E.subarray(ye,xe+188)),L.size+=xe+188-ye);break;case S:we&&(B&&(l=n(B))&&(m.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),B={data:[],size:0}),B&&(B.data.push(E.subarray(ye,xe+188)),B.size+=xe+188-ye);break;case D:we&&(R&&(l=n(R))&&this.parseID3PES(l),R={data:[],size:0}),R&&(R.data.push(E.subarray(ye,xe+188)),R.size+=xe+188-ye);break;case 0:we&&(ye+=E[ye]+1),se=this._pmtId=h(E,ye);break;case se:{we&&(ye+=E[ye]+1);var ee=s(E,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);I=ee.avc,I>0&&(b.pid=I),S=ee.audio,S>0&&(m.pid=S,m.isAAC=ee.isAAC),D=ee.id3,D>0&&(w.pid=D),W&&!Y&&(f.logger.log("reparse from beginning"),W=!1,xe=Se-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=L,m.pesData=B,w.pesData=R;var je={audioTrack:m,avcTrack:b,id3Track:w,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(je),je},v.flush=function(){var E=this.remainderData;this.remainderData=null;var y;return E?y=this.demux(E,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},v.extractRemainingSamples=function(E){var y=E.audioTrack,c=E.avcTrack,u=E.id3Track,l=c.pesData,b=y.pesData,m=u.pesData,w;l&&(w=n(l))?(this.parseAVCPES(w,!0),c.pesData=null):c.pesData=l,b&&(w=n(b))?(y.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),y.pesData=null):(b!=null&&b.size&&f.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=b),m&&(w=n(m))?(this.parseID3PES(w),u.pesData=null):u.pesData=m},v.demuxSampleAes=function(E,y,c){var u=this.demux(E,c,!0,!this.config.progressive),l=this.sampleAes=new F.default(this.observer,this.config,y);return this.decrypt(u,l)},v.decrypt=function(E,y){return new Promise(function(c){var u=E.audioTrack,l=E.avcTrack;u.samples&&u.isAAC?y.decryptAacSamples(u.samples,0,function(){l.samples?y.decryptAvcSamples(l.samples,0,0,function(){c(E)}):c(E)}):l.samples&&y.decryptAvcSamples(l.samples,0,0,function(){c(E)})})},v.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},v.parseAVCPES=function(E,y){var c=this,u=this._avcTrack,l=this.parseAVCNALu(E.data),b=!1,m=this.avcSample,w,I=!1;E.data=null,m&&l.length&&!u.audFound&&(i(m,u),m=this.avcSample=r(!1,E.pts,E.dts,"")),l.forEach(function(L){switch(L.type){case 1:{w=!0,m||(m=c.avcSample=r(!0,E.pts,E.dts,"")),b&&(m.debug+="NDR "),m.frame=!0;var S=L.data;if(I&&S.length>4){var D=new M.default(S).readSliceType();(D===2||D===4||D===7||D===9)&&(m.key=!0)}break}case 5:w=!0,m||(m=c.avcSample=r(!0,E.pts,E.dts,"")),b&&(m.debug+="IDR "),m.key=!0,m.frame=!0;break;case 6:{w=!0,b&&m&&(m.debug+="SEI ");var B=new M.default(_(L.data));B.readUByte();for(var R=0,W=0,Y=!1,se=0;!Y&&B.bytesAvailable>1;){R=0;do se=B.readUByte(),R+=se;while(se===255);W=0;do se=B.readUByte(),W+=se;while(se===255);if(R===4&&B.bytesAvailable!==0){Y=!0;var ne=B.readUByte();if(ne===181){var Se=B.readUShort();if(Se===49){var xe=B.readUInt();if(xe===1195456820){var we=B.readUByte();if(we===3){for(var Re=B.readUByte(),Pe=B.readUByte(),ye=31&Re,ee=[Re,Pe],je=0;je<ye;je++)ee.push(B.readUByte()),ee.push(B.readUByte()),ee.push(B.readUByte());t(c._txtTrack.samples,{type:3,pts:E.pts,bytes:ee})}}}}}else if(R===5&&B.bytesAvailable!==0){if(Y=!0,W>16){for(var et=[],He=0;He<16;He++)et.push(B.readUByte().toString(16)),(He===3||He===5||He===7||He===9)&&et.push("-");for(var Ne=W-16,Ye=new Uint8Array(Ne),Ae=0;Ae<Ne;Ae++)Ye[Ae]=B.readUByte();t(c._txtTrack.samples,{pts:E.pts,payloadType:R,uuid:et.join(""),userData:Object(H.utf8ArrayToStr)(Ye),userDataBytes:Ye})}}else if(W<B.bytesAvailable)for(var Ue=0;Ue<W;Ue++)B.readUByte()}break}case 7:if(w=!0,I=!0,b&&m&&(m.debug+="SPS "),!u.sps){var Ve=new M.default(L.data),Q=Ve.readSPS();u.width=Q.width,u.height=Q.height,u.pixelRatio=Q.pixelRatio,u.sps=[L.data],u.duration=c._duration;for(var fe=L.data.subarray(1,4),be="avc1.",Ee=0;Ee<3;Ee++){var ke=fe[Ee].toString(16);ke.length<2&&(ke="0"+ke),be+=ke}u.codec=be}break;case 8:w=!0,b&&m&&(m.debug+="PPS "),u.pps||(u.pps=[L.data]);break;case 9:w=!1,u.audFound=!0,m&&i(m,u),m=c.avcSample=r(!1,E.pts,E.dts,b?"AUD ":"");break;case 12:w=!1;break;default:w=!1,m&&(m.debug+="unknown NAL "+L.type+" ");break}if(m&&w){var We=m.units;We.push(L)}}),y&&m&&(i(m,u),this.avcSample=null)},v.getLastNalUnit=function(){var E,y=this.avcSample,c;if(!y||y.units.length===0){var u=this._avcTrack.samples;y=u[u.length-1]}if((E=y)!==null&&E!==void 0&&E.units){var l=y.units;c=l[l.length-1]}return c},v.parseAVCNALu=function(E){var y=E.byteLength,c=this._avcTrack,u=c.naluState||0,l=u,b=[],m=0,w,I,L,S=-1,D=0;for(u===-1&&(S=0,D=E[0]&31,u=0,m=1);m<y;){if(w=E[m++],!u){u=w?0:1;continue}if(u===1){u=w?0:2;continue}if(!w)u=3;else if(w===1){if(S>=0){var B={data:E.subarray(S,m-u-1),type:D};b.push(B)}else{var R=this.getLastNalUnit();if(R&&(l&&m<=4-l&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-l))),I=m-u-1,I>0)){var W=new Uint8Array(R.data.byteLength+I);W.set(R.data,0),W.set(E.subarray(0,I),R.data.byteLength),R.data=W,R.state=0}}m<y?(L=E[m]&31,S=m,D=L,u=0):u=-1}else u=0}if(S>=0&&u>=0){var Y={data:E.subarray(S,y),type:D,state:u};b.push(Y)}if(b.length===0){var se=this.getLastNalUnit();if(se){var ne=new Uint8Array(se.data.byteLength+E.byteLength);ne.set(se.data,0),ne.set(E,se.data.byteLength),se.data=ne}}return c.naluState=u,b},v.parseAACPES=function(E){var y=0,c=this._audioTrack,u=this.aacOverFlow,l=E.data;if(u){this.aacOverFlow=null;var b=u.sample.unit.byteLength,m=Math.min(u.missing,b),w=b-m;u.sample.unit.set(l.subarray(0,m),w),c.samples.push(u.sample),y=u.missing}var I,L;for(I=y,L=l.length;I<L-1&&!U.isHeader(l,I);I++);if(I!==y){var S,D;if(I<L-1?(S="AAC PES did not start with ADTS header,offset:"+I,D=!1):(S="no ADTS header found in AAC PES",D=!0),f.logger.warn("parsing error:"+S),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:D,reason:S}),D)return}U.initTrackConfig(c,this.observer,l,I,this.audioCodec);var B;if(E.pts!==void 0)B=E.pts;else if(u){var R=U.getFrameDuration(c.samplerate);B=u.sample.pts+R}else{f.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;I<L;)if(U.isHeader(l,I)){if(I+5<L){var Y=U.appendFrame(c,l,I,B,W);if(Y)if(Y.missing)this.aacOverFlow=Y;else{I+=Y.length,W++;continue}}break}else I++},v.parseMPEGPES=function(E){var y=E.data,c=y.length,u=0,l=0,b=E.pts;if(b===void 0){f.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<c;)if(O.isHeader(y,l)){var m=O.appendFrame(this._audioTrack,y,l,b,u);if(m)l+=m.length,u++;else break}else l++},v.parseID3PES=function(E){if(E.pts===void 0){f.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},g}();a.minProbeByteLength=188;function r(g,v,x,E){return{key:g,frame:!1,pts:v,dts:x,units:[],debug:E,length:0}}function h(g,v){return(g[v+10]&31)<<8|g[v+11]}function s(g,v,x,E){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(g[v+1]&15)<<8|g[v+2],u=v+3+c-4,l=(g[v+10]&15)<<8|g[v+11];for(v+=12+l;v<u;){var b=(g[v+1]&31)<<8|g[v+2];switch(g[v]){case 207:if(!E){f.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=b);break;case 21:y.id3===-1&&(y.id3=b);break;case 219:if(!E){f.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=b);break;case 3:case 4:x?y.audio===-1&&(y.audio=b,y.isAAC=!1):f.logger.log("MPEG audio found, not supported in this browser");break;case 36:f.logger.warn("Unsupported HEVC stream type found");break;default:break}v+=((g[v+3]&15)<<8|g[v+4])+5}return y}function n(g){var v=0,x,E,y,c,u,l=g.data;if(!g||g.size===0)return null;for(;l[0].length<19&&l.length>1;){var b=new Uint8Array(l[0].length+l[1].length);b.set(l[0]),b.set(l[1],l[0].length),l[0]=b,l.splice(1,1)}x=l[0];var m=(x[0]<<16)+(x[1]<<8)+x[2];if(m===1){if(E=(x[4]<<8)+x[5],E&&E>g.size-6)return null;var w=x[7];w&192&&(c=(x[9]&14)*536870912+(x[10]&255)*4194304+(x[11]&254)*16384+(x[12]&255)*128+(x[13]&254)/2,w&64?(u=(x[14]&14)*536870912+(x[15]&255)*4194304+(x[16]&254)*16384+(x[17]&255)*128+(x[18]&254)/2,c-u>60*9e4&&(f.logger.warn(Math.round((c-u)/9e4)+"s delta between PTS and DTS, align them"),c=u)):u=c),y=x[8];var I=y+9;if(g.size<=I)return null;g.size-=I;for(var L=new Uint8Array(g.size),S=0,D=l.length;S<D;S++){x=l[S];var B=x.byteLength;if(I)if(I>B){I-=B;continue}else x=x.subarray(I),B-=I,I=0;L.set(x,v),v+=B}return E&&(E-=y+3),{data:L,pts:c,dts:u,len:E}}return null}function i(g,v){if(g.units.length&&g.frame){if(g.pts===void 0){var x=v.samples,E=x.length;if(E){var y=x[E-1];g.pts=y.pts,g.dts=y.dts}else{v.dropped++;return}}v.samples.push(g)}g.debug.length&&f.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function t(g,v){var x=g.length;if(x>0){if(v.pts>=g[x-1].pts)g.push(v);else for(var E=x-1;E>=0;E--)if(v.pts<g[E].pts){g.splice(E,0,v);break}}else g.push(v)}function _(g){for(var v=g.byteLength,x=[],E=1;E<v-2;)g[E]===0&&g[E+1]===0&&g[E+2]===3?(x.push(E+2),E+=2):E++;if(x.length===0)return g;var y=v-x.length,c=new Uint8Array(y),u=0;for(E=0;E<y;u++,E++)u===x[0]&&(u++,x.shift()),c[E]=g[u];return c}j.default=a},"./src/errors.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"ErrorTypes",function(){return U}),A.d(j,"ErrorDetails",function(){return O});var U;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(U||(U={}));var O;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(O||(O={}))},"./src/events.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"Events",function(){return U});var U;(function(O){O.MEDIA_ATTACHING="hlsMediaAttaching",O.MEDIA_ATTACHED="hlsMediaAttached",O.MEDIA_DETACHING="hlsMediaDetaching",O.MEDIA_DETACHED="hlsMediaDetached",O.BUFFER_RESET="hlsBufferReset",O.BUFFER_CODECS="hlsBufferCodecs",O.BUFFER_CREATED="hlsBufferCreated",O.BUFFER_APPENDING="hlsBufferAppending",O.BUFFER_APPENDED="hlsBufferAppended",O.BUFFER_EOS="hlsBufferEos",O.BUFFER_FLUSHING="hlsBufferFlushing",O.BUFFER_FLUSHED="hlsBufferFlushed",O.MANIFEST_LOADING="hlsManifestLoading",O.MANIFEST_LOADED="hlsManifestLoaded",O.MANIFEST_PARSED="hlsManifestParsed",O.LEVEL_SWITCHING="hlsLevelSwitching",O.LEVEL_SWITCHED="hlsLevelSwitched",O.LEVEL_LOADING="hlsLevelLoading",O.LEVEL_LOADED="hlsLevelLoaded",O.LEVEL_UPDATED="hlsLevelUpdated",O.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",O.LEVELS_UPDATED="hlsLevelsUpdated",O.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",O.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",O.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",O.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",O.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",O.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",O.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",O.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",O.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",O.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",O.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",O.CUES_PARSED="hlsCuesParsed",O.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",O.INIT_PTS_FOUND="hlsInitPtsFound",O.FRAG_LOADING="hlsFragLoading",O.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",O.FRAG_LOADED="hlsFragLoaded",O.FRAG_DECRYPTED="hlsFragDecrypted",O.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",O.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",O.FRAG_PARSING_METADATA="hlsFragParsingMetadata",O.FRAG_PARSED="hlsFragParsed",O.FRAG_BUFFERED="hlsFragBuffered",O.FRAG_CHANGED="hlsFragChanged",O.FPS_DROP="hlsFpsDrop",O.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",O.ERROR="hlsError",O.DESTROYING="hlsDestroying",O.KEY_LOADING="hlsKeyLoading",O.KEY_LOADED="hlsKeyLoaded",O.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",O.BACK_BUFFER_REACHED="hlsBackBufferReached"})(U||(U={}))},"./src/hls.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return g});var U=A("./node_modules/url-toolkit/src/url-toolkit.js"),O=A.n(U),M=A("./src/loader/playlist-loader.ts"),H=A("./src/loader/key-loader.ts"),F=A("./src/controller/id3-track-controller.ts"),e=A("./src/controller/latency-controller.ts"),C=A("./src/controller/level-controller.ts"),f=A("./src/controller/fragment-tracker.ts"),p=A("./src/controller/stream-controller.ts"),o=A("./src/is-supported.ts"),a=A("./src/utils/logger.ts"),r=A("./src/config.ts"),h=A("./node_modules/eventemitter3/index.js"),s=A.n(h),n=A("./src/events.ts"),i=A("./src/errors.ts");function t(v,x){for(var E=0;E<x.length;E++){var y=x[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}function _(v,x,E){return x&&t(v.prototype,x),E&&t(v,E),v}var g=function(){v.isSupported=function(){return Object(o.isSupported)()};function v(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var y=this.config=Object(r.mergeConfig)(v.DefaultConfig,E);this.userConfig=E,Object(a.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(r.enableStreamingMode)(y);var c=y.abrController,u=y.bufferController,l=y.capLevelController,b=y.fpsController,m=this.abrController=new c(this),w=this.bufferController=new u(this),I=this.capLevelController=new l(this),L=new b(this),S=new M.default(this),D=new H.default(this),B=new F.default(this),R=this.levelController=new C.default(this),W=new f.FragmentTracker(this),Y=this.streamController=new p.default(this,W);I.setStreamController(Y),L.setStreamController(Y);var se=[R,Y];this.networkControllers=se;var ne=[S,D,m,w,I,L,B,W];this.audioTrackController=this.createController(y.audioTrackController,null,se),this.createController(y.audioStreamController,W,se),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,se),this.createController(y.subtitleStreamController,W,se),this.createController(y.timelineController,null,ne),this.emeController=this.createController(y.emeController,null,ne),this.cmcdController=this.createController(y.cmcdController,null,ne),this.latencyController=this.createController(e.default,null,ne),this.coreComponents=ne}var x=v.prototype;return x.createController=function(y,c,u){if(y){var l=c?new y(this,c):new y(this);return u&&u.push(l),l}return null},x.on=function(y,c,u){u===void 0&&(u=this),this._emitter.on(y,c,u)},x.once=function(y,c,u){u===void 0&&(u=this),this._emitter.once(y,c,u)},x.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},x.off=function(y,c,u,l){u===void 0&&(u=this),this._emitter.off(y,c,u,l)},x.listeners=function(y){return this._emitter.listeners(y)},x.emit=function(y,c,u){return this._emitter.emit(y,c,u)},x.trigger=function(y,c){if(this.config.debug)return this.emit(y,y,c);try{return this.emit(y,y,c)}catch(u){a.logger.error("An internal error happened while handling event "+y+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(n.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:u})}return!1},x.listenerCount=function(y){return this._emitter.listenerCount(y)},x.destroy=function(){a.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},x.attachMedia=function(y){a.logger.log("attachMedia"),this._media=y,this.trigger(n.Events.MEDIA_ATTACHING,{media:y})},x.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},x.loadSource=function(y){this.stopLoad();var c=this.media,u=this.url,l=this.url=U.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});a.logger.log("loadSource:"+l),c&&u&&u!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(n.Events.MANIFEST_LOADING,{url:y})},x.startLoad=function(y){y===void 0&&(y=-1),a.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(c){c.startLoad(y)})},x.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},x.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},x.recoverMediaError=function(){a.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},x.removeLevel=function(y,c){c===void 0&&(c=0),this.levelController.removeLevel(y,c)},_(v,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){a.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){a.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){a.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){a.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){a.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var c=!!y;c!==this.config.capLevelToPlayerSize&&(c?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=c)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(a.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,c=this.config.minAutoBitrate;if(!y)return 0;for(var u=y.length,l=0;l<u;l++)if(y[l].maxBitrate>c)return l;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,c=this.autoLevelCapping,u;return c===-1&&y&&y.length?u=y.length-1:u=c,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var c=this.audioTrackController;c&&(c.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var c=this.subtitleTrackController;c&&(c.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return n.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return v.defaultConfig?v.defaultConfig:r.hlsDefaultConfig},set:function(y){v.defaultConfig=y}}]),v}();g.defaultConfig=void 0},"./src/is-supported.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"isSupported",function(){return M}),A.d(j,"changeTypeSupported",function(){return H});var U=A("./src/utils/mediasource-helper.ts");function O(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var F=Object(U.getMediaSource)();if(!F)return!1;var e=O(),C=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),f=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!C&&!!f}function H(){var F,e=O();return typeof(e==null||((F=e.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return a}),A.d(j,"LoadError",function(){return h});var U=A("./src/polyfills/number.ts"),O=A("./src/errors.ts");function M(s,n){s.prototype=Object.create(n.prototype),s.prototype.constructor=s,f(s,n)}function H(s){var n=typeof Map=="function"?new Map:void 0;return H=function(t){if(t===null||!C(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(t))return n.get(t);n.set(t,_)}function _(){return F(t,arguments,p(this).constructor)}return _.prototype=Object.create(t.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),f(_,t)},H(s)}function F(s,n,i){return e()?F=Reflect.construct:F=function(_,g,v){var x=[null];x.push.apply(x,g);var E=Function.bind.apply(_,x),y=new E;return v&&f(y,v.prototype),y},F.apply(null,arguments)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function C(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function f(s,n){return f=Object.setPrototypeOf||function(t,_){return t.__proto__=_,t},f(s,n)}function p(s){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(s)}var o=Math.pow(2,17),a=function(){function s(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var n=s.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(t,_){var g=this,v=t.url;if(!v)return Promise.reject(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(v?"part list":"url")));this.abort();var x=this.config,E=x.fLoader,y=x.loader;return new Promise(function(c,u){g.loader&&g.loader.destroy();var l=g.loader=t.loader=E?new E(x):new y(x),b=r(t),m={timeout:x.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:x.fragLoadingMaxRetryTimeout,highWaterMark:o};t.stats=l.stats,l.load(b,m,{onSuccess:function(I,L,S,D){g.resetLoader(t,l),c({frag:t,part:null,payload:I.data,networkDetails:D})},onError:function(I,L,S){g.resetLoader(t,l),u(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:I,networkDetails:S}))},onAbort:function(I,L,S){g.resetLoader(t,l),u(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:S}))},onTimeout:function(I,L,S){g.resetLoader(t,l),u(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:S}))},onProgress:function(I,L,S,D){_&&_({frag:t,part:null,payload:S,networkDetails:D})}})})},n.loadPart=function(t,_,g){var v=this;this.abort();var x=this.config,E=x.fLoader,y=x.loader;return new Promise(function(c,u){v.loader&&v.loader.destroy();var l=v.loader=t.loader=E?new E(x):new y(x),b=r(t,_),m={timeout:x.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:x.fragLoadingMaxRetryTimeout,highWaterMark:o};_.stats=l.stats,l.load(b,m,{onSuccess:function(I,L,S,D){v.resetLoader(t,l),v.updateStatsFromPart(t,_);var B={frag:t,part:_,payload:I.data,networkDetails:D};g(B),c(B)},onError:function(I,L,S){v.resetLoader(t,l),u(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:_,response:I,networkDetails:S}))},onAbort:function(I,L,S){t.stats.aborted=_.stats.aborted,v.resetLoader(t,l),u(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:_,networkDetails:S}))},onTimeout:function(I,L,S){v.resetLoader(t,l),u(new h({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:_,networkDetails:S}))}})})},n.updateStatsFromPart=function(t,_){var g=t.stats,v=_.stats,x=v.total;if(g.loaded+=v.loaded,x){var E=Math.round(t.duration/_.duration),y=Math.min(Math.round(g.loaded/x),E),c=E-y,u=c*Math.round(g.loaded/y);g.total=g.loaded+u}else g.total=Math.max(g.loaded,g.total);var l=g.loading,b=v.loading;l.start?l.first+=b.first-b.start:(l.start=b.start,l.first=b.first),l.end=b.end},n.resetLoader=function(t,_){t.loader=null,this.loader===_&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),_.destroy()},s}();function r(s,n){n===void 0&&(n=null);var i=n||s,t={frag:s,part:n,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},_=i.byteRangeStartOffset,g=i.byteRangeEndOffset;return Object(U.isFiniteNumber)(_)&&Object(U.isFiniteNumber)(g)&&(t.rangeStart=_,t.rangeEnd=g),t}var h=function(s){M(n,s);function n(i){for(var t,_=arguments.length,g=new Array(_>1?_-1:0),v=1;v<_;v++)g[v-1]=arguments[v];return t=s.call.apply(s,[this].concat(g))||this,t.data=void 0,t.data=i,t}return n}(H(Error))},"./src/loader/fragment.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"ElementaryStreamTypes",function(){return a}),A.d(j,"BaseSegment",function(){return r}),A.d(j,"Fragment",function(){return h}),A.d(j,"Part",function(){return s});var U=A("./src/polyfills/number.ts"),O=A("./node_modules/url-toolkit/src/url-toolkit.js"),M=A.n(O),H=A("./src/utils/logger.ts"),F=A("./src/loader/level-key.ts"),e=A("./src/loader/load-stats.ts");function C(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,f(n,i)}function f(n,i){return f=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},f(n,i)}function p(n,i){for(var t=0;t<i.length;t++){var _=i[t];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}function o(n,i,t){return i&&p(n.prototype,i),t&&p(n,t),n}var a;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(a||(a={}));var r=function(){function n(t){var _;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(_={},_[a.AUDIO]=null,_[a.VIDEO]=null,_[a.AUDIOVIDEO]=null,_),this.baseurl=t}var i=n.prototype;return i.setByteRange=function(_,g){var v=_.split("@",2),x=[];v.length===1?x[0]=g?g.byteRangeEndOffset:0:x[0]=parseInt(v[1]),x[1]=parseInt(v[0])+x[0],this._byteRange=x},o(n,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(O.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(_){this._url=_}}]),n}(),h=function(n){C(i,n);function i(_,g){var v;return v=n.call(this,g)||this,v._decryptdata=null,v.rawProgramDateTime=null,v.programDateTime=null,v.tagList=[],v.duration=0,v.sn=0,v.levelkey=void 0,v.type=void 0,v.loader=null,v.level=-1,v.cc=0,v.startPTS=void 0,v.endPTS=void 0,v.appendedPTS=void 0,v.startDTS=void 0,v.endDTS=void 0,v.start=0,v.deltaPTS=void 0,v.maxStartPTS=void 0,v.minEndPTS=void 0,v.stats=new e.LoadStats,v.urlId=0,v.data=void 0,v.bitrateTest=!1,v.title=null,v.initSegment=null,v.type=_,v}var t=i.prototype;return t.createInitializationVector=function(g){for(var v=new Uint8Array(16),x=12;x<16;x++)v[x]=g>>8*(15-x)&255;return v},t.setDecryptDataFromLevelKey=function(g,v){var x=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(x=F.LevelKey.fromURI(g.uri),x.method=g.method,x.iv=this.createInitializationVector(v),x.keyFormat="identity"),x},t.setElementaryStreamInfo=function(g,v,x,E,y,c){c===void 0&&(c=!1);var u=this.elementaryStreams,l=u[g];if(!l){u[g]={startPTS:v,endPTS:x,startDTS:E,endDTS:y,partial:c};return}l.startPTS=Math.min(l.startPTS,v),l.endPTS=Math.max(l.endPTS,x),l.startDTS=Math.min(l.startDTS,E),l.endDTS=Math.max(l.endDTS,y)},t.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[a.AUDIO]=null,g[a.VIDEO]=null,g[a.AUDIOVIDEO]=null},o(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(U.isFiniteNumber)(this.programDateTime))return null;var g=Object(U.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),i}(r),s=function(n){C(i,n);function i(t,_,g,v,x){var E;E=n.call(this,g)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new e.LoadStats,E.duration=t.decimalFloatingPoint("DURATION"),E.gap=t.bool("GAP"),E.independent=t.bool("INDEPENDENT"),E.relurl=t.enumeratedString("URI"),E.fragment=_,E.index=v;var y=t.enumeratedString("BYTERANGE");return y&&E.setByteRange(y,x),x&&(E.fragOffset=x.fragOffset+x.duration),E}return o(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var _=this.elementaryStreams;return!!(_.audio||_.video||_.audiovideo)}}]),i}(r)},"./src/loader/key-loader.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return H});var U=A("./src/events.ts"),O=A("./src/errors.ts"),M=A("./src/utils/logger.ts"),H=function(){function F(C){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=C,this._registerListeners()}var e=F.prototype;return e._registerListeners=function(){this.hls.on(U.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(U.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var f in this.loaders){var p=this.loaders[f];p&&p.destroy()}this.loaders={}},e.onKeyLoading=function(f,p){var o=p.frag,a=o.type,r=this.loaders[a];if(!o.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=o.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(r&&(M.logger.warn("abort previous key loader for type:"+a),r.abort()),!h){M.logger.warn("key uri is falsy");return}var n=s.loader,i=o.loader=this.loaders[a]=new n(s);this.decrypturl=h,this.decryptkey=null;var t={url:h,frag:o,responseType:"arraybuffer"},_={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(t,_,g)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(U.Events.KEY_LOADED,{frag:o}))},e.loadsuccess=function(f,p,o){var a=o.frag;if(!a.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(f.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(U.Events.KEY_LOADED,{frag:a})},e.loaderror=function(f,p){var o=p.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:f})},e.loadtimeout=function(f,p){var o=p.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},F}()},"./src/loader/level-details.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"LevelDetails",function(){return F});var U=A("./src/polyfills/number.ts");function O(e,C){for(var f=0;f<C.length;f++){var p=C[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(e,p.key,p)}}function M(e,C,f){return C&&O(e.prototype,C),f&&O(e,f),e}var H=10,F=function(){function e(f){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=f}var C=e.prototype;return C.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var o=this.lastPartSn-p.lastPartSn,a=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!a||!!o,this.advanced=this.endSN>p.endSN||o>0||o===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},M(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(U.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var o=this.driftEnd-this.driftStart;return o*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"LevelKey",function(){return F});var U=A("./node_modules/url-toolkit/src/url-toolkit.js"),O=A.n(U);function M(e,C){for(var f=0;f<C.length;f++){var p=C[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(e,p.key,p)}}function H(e,C,f){return C&&M(e.prototype,C),f&&M(e,f),e}var F=function(){e.fromURL=function(f,p){return new e(f,p)},e.fromURI=function(f){return new e(f)};function e(C,f){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,f?this._uri=Object(U.buildAbsoluteURL)(C,f,{alwaysNormalize:!0}):this._uri=C}return H(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"LoadStats",function(){return U});var U=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return i});var U=A("./src/polyfills/number.ts"),O=A("./node_modules/url-toolkit/src/url-toolkit.js"),M=A.n(O),H=A("./src/loader/fragment.ts"),F=A("./src/loader/level-details.ts"),e=A("./src/loader/level-key.ts"),C=A("./src/utils/attr-list.ts"),f=A("./src/utils/logger.ts"),p=A("./src/utils/codecs.ts"),o=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),h=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function n(x){var E,y;return s.test((E=(y=O.parseURL(x))===null||y===void 0?void 0:y.path)!=null?E:"")}var i=function(){function x(){}return x.findGroup=function(y,c){for(var u=0;u<y.length;u++){var l=y[u];if(l.id===c)return l}},x.convertAVC1ToAVCOTI=function(y){var c=y.split(".");if(c.length>2){var u=c.shift()+".";return u+=parseInt(c.shift()).toString(16),u+=("000"+parseInt(c.shift()).toString(16)).substr(-4),u}return y},x.resolve=function(y,c){return O.buildAbsoluteURL(c,y,{alwaysNormalize:!0})},x.parseMasterPlaylist=function(y,c){var u=[],l={},b=!1;o.lastIndex=0;for(var m;(m=o.exec(y))!=null;)if(m[1]){var w=new C.AttrList(m[1]),I={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:x.resolve(m[2],c)},L=w.decimalResolution("RESOLUTION");L&&(I.width=L.width,I.height=L.height),t((w.CODECS||"").split(/[ ,]+/).filter(function(D){return D}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=x.convertAVC1ToAVCOTI(I.videoCodec)),u.push(I)}else if(m[3]){var S=new C.AttrList(m[3]);S["DATA-ID"]&&(b=!0,l[S["DATA-ID"]]=S)}return{levels:u,sessionData:b?l:null}},x.parseMasterPlaylistMedia=function(y,c,u,l){l===void 0&&(l=[]);var b,m=[],w=0;for(a.lastIndex=0;(b=a.exec(y))!==null;){var I=new C.AttrList(b[1]);if(I.TYPE===u){var L={attrs:I,bitrate:0,id:w++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:u,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?x.resolve(I.URI,c):""};if(l.length){var S=x.findGroup(l,L.groupId)||l[0];_(L,S,"audioCodec"),_(L,S,"textCodec")}m.push(L)}}return m},x.parseLevelPlaylist=function(y,c,u,l,b){var m=new F.LevelDetails(c),w=m.fragments,I=null,L=0,S=0,D=0,B=0,R=null,W=new H.Fragment(l,c),Y,se,ne,Se=-1,xe=!1;for(r.lastIndex=0,m.m3u8=y;(Y=r.exec(y))!==null;){xe&&(xe=!1,W=new H.Fragment(l,c),W.start=D,W.sn=L,W.cc=B,W.level=u,I&&(W.initSegment=I,W.rawProgramDateTime=I.rawProgramDateTime));var we=Y[1];if(we){W.duration=parseFloat(we);var Re=(" "+Y[2]).slice(1);W.title=Re||null,W.tagList.push(Re?["INF",we,Re]:["INF",we])}else if(Y[3])Object(U.isFiniteNumber)(W.duration)&&(W.start=D,ne&&(W.levelkey=ne),W.sn=L,W.level=u,W.cc=B,W.urlId=b,w.push(W),W.relurl=(" "+Y[3]).slice(1),v(W,R),R=W,D+=W.duration,L++,S=0,xe=!0);else if(Y[4]){var Pe=(" "+Y[4]).slice(1);R?W.setByteRange(Pe,R):W.setByteRange(Pe)}else if(Y[5])W.rawProgramDateTime=(" "+Y[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Se===-1&&(Se=w.length);else{if(Y=Y[0].match(h),!Y){f.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<Y.length&&!(typeof Y[se]!="undefined");se++);var ye=(" "+Y[se]).slice(1),ee=(" "+Y[se+1]).slice(1),je=Y[se+2]?(" "+Y[se+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":m.type=ee.toUpperCase();break;case"MEDIA-SEQUENCE":L=m.startSN=parseInt(ee);break;case"SKIP":{var et=new C.AttrList(ee),He=et.decimalInteger("SKIPPED-SEGMENTS");if(Object(U.isFiniteNumber)(He)){m.skippedSegments=He;for(var Ne=He;Ne--;)w.unshift(null);L+=He}var Ye=et.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ye&&(m.recentlyRemovedDateranges=Ye.split(" "));break}case"TARGETDURATION":m.targetduration=parseFloat(ee);break;case"VERSION":m.version=parseInt(ee);break;case"EXTM3U":break;case"ENDLIST":m.live=!1;break;case"#":(ee||je)&&W.tagList.push(je?[ee,je]:[ee]);break;case"DIS":B++;case"GAP":W.tagList.push([ye]);break;case"BITRATE":W.tagList.push([ye,ee]);break;case"DISCONTINUITY-SEQ":B=parseInt(ee);break;case"KEY":{var Ae,Ue=new C.AttrList(ee),Ve=Ue.enumeratedString("METHOD"),Q=Ue.URI,fe=Ue.hexadecimalInteger("IV"),be=Ue.enumeratedString("KEYFORMATVERSIONS"),Ee=Ue.enumeratedString("KEYID"),ke=(Ae=Ue.enumeratedString("KEYFORMAT"))!=null?Ae:"identity",We=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(We.indexOf(ke)>-1){f.logger.warn("Keyformat "+ke+" is not supported from the manifest");continue}else if(ke!=="identity")continue;Ve&&(ne=e.LevelKey.fromURL(c,Q),Q&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ve)>=0&&(ne.method=Ve,ne.keyFormat=ke,Ee&&(ne.keyID=Ee),be&&(ne.keyFormatVersions=be),ne.iv=fe));break}case"START":{var Xe=new C.AttrList(ee),ze=Xe.decimalFloatingPoint("TIME-OFFSET");Object(U.isFiniteNumber)(ze)&&(m.startTimeOffset=ze);break}case"MAP":{var qe=new C.AttrList(ee);W.relurl=qe.URI,qe.BYTERANGE&&W.setByteRange(qe.BYTERANGE),W.level=u,W.sn="initSegment",ne&&(W.levelkey=ne),W.initSegment=null,I=W,xe=!0;break}case"SERVER-CONTROL":{var Qe=new C.AttrList(ee);m.canBlockReload=Qe.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=Qe.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&Qe.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=Qe.optionalFloat("PART-HOLD-BACK",0),m.holdBack=Qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ze=new C.AttrList(ee);m.partTarget=Ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ge=m.partList;Ge||(Ge=m.partList=[]);var it=S>0?Ge[Ge.length-1]:void 0,nt=S++,Ie=new H.Part(new C.AttrList(ee),W,c,nt,it);Ge.push(Ie),W.duration+=Ie.duration;break}case"PRELOAD-HINT":{var Me=new C.AttrList(ee);m.preloadHint=Me;break}case"RENDITION-REPORT":{var pe=new C.AttrList(ee);m.renditionReports=m.renditionReports||[],m.renditionReports.push(pe);break}default:f.logger.warn("line parsed but not handled: "+Y);break}}}R&&!R.relurl?(w.pop(),D-=R.duration,m.partList&&(m.fragmentHint=R)):m.partList&&(v(W,R),W.cc=B,m.fragmentHint=W);var ue=w.length,ce=w[0],X=w[ue-1];if(D+=m.skippedSegments*m.targetduration,D>0&&ue&&X){m.averagetargetduration=D/ue;var $=X.sn;m.endSN=$!=="initSegment"?$:0,ce&&(m.startCC=ce.cc,ce.initSegment||m.fragments.every(function(te){return te.relurl&&n(te.relurl)})&&(f.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new H.Fragment(l,c),W.relurl=X.relurl,W.level=u,W.sn="initSegment",ce.initSegment=W,m.needSidxRanges=!0))}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(D+=m.fragmentHint.duration),m.totalduration=D,m.endCC=B,Se>0&&g(w,Se),m},x}();function t(x,E){["video","audio","text"].forEach(function(y){var c=x.filter(function(l){return Object(p.isCodecType)(l,y)});if(c.length){var u=c.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});E[y+"Codec"]=u.length>0?u[0]:c[0],x=x.filter(function(l){return c.indexOf(l)===-1})}}),E.unknownCodecs=x}function _(x,E,y){var c=E[y];c&&(x[y]=c)}function g(x,E){for(var y=x[E],c=E;c--;){var u=x[c];if(!u)return;u.programDateTime=y.programDateTime-u.duration*1e3,y=u}}function v(x,E){x.rawProgramDateTime?x.programDateTime=Date.parse(x.rawProgramDateTime):E!=null&&E.programDateTime&&(x.programDateTime=E.endProgramDateTime),Object(U.isFiniteNumber)(x.programDateTime)||(x.programDateTime=null,x.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/polyfills/number.ts"),O=A("./src/events.ts"),M=A("./src/errors.ts"),H=A("./src/utils/logger.ts"),F=A("./src/utils/mp4-tools.ts"),e=A("./src/loader/m3u8-parser.ts"),C=A("./src/types/loader.ts"),f=A("./src/utils/attr-list.ts");function p(r){var h=r.type;switch(h){case C.PlaylistContextType.AUDIO_TRACK:return C.PlaylistLevelType.AUDIO;case C.PlaylistContextType.SUBTITLE_TRACK:return C.PlaylistLevelType.SUBTITLE;default:return C.PlaylistLevelType.MAIN}}function o(r,h){var s=r.url;return(s===void 0||s.indexOf("data:")===0)&&(s=h.url),s}var a=function(){function r(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var h=r.prototype;return h.registerListeners=function(){var n=this.hls;n.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(O.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var n=this.hls;n.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(O.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(n){var i=this.hls.config,t=i.pLoader,_=i.loader,g=t||_,v=new g(i);return n.loader=v,this.loaders[n.type]=v,v},h.getInternalLoader=function(n){return this.loaders[n.type]},h.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},h.destroyInternalLoaders=function(){for(var n in this.loaders){var i=this.loaders[n];i&&i.destroy(),this.resetInternalLoader(n)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(n,i){var t=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:C.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},h.onLevelLoading=function(n,i){var t=i.id,_=i.level,g=i.url,v=i.deliveryDirectives;this.load({id:t,groupId:null,level:_,responseType:"text",type:C.PlaylistContextType.LEVEL,url:g,deliveryDirectives:v})},h.onAudioTrackLoading=function(n,i){var t=i.id,_=i.groupId,g=i.url,v=i.deliveryDirectives;this.load({id:t,groupId:_,level:null,responseType:"text",type:C.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:v})},h.onSubtitleTrackLoading=function(n,i){var t=i.id,_=i.groupId,g=i.url,v=i.deliveryDirectives;this.load({id:t,groupId:_,level:null,responseType:"text",type:C.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:v})},h.load=function(n){var i,t=this.hls.config,_=this.getInternalLoader(n);if(_){var g=_.context;if(g&&g.url===n.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),_.abort()}var v,x,E,y;switch(n.type){case C.PlaylistContextType.MANIFEST:v=t.manifestLoadingMaxRetry,x=t.manifestLoadingTimeOut,E=t.manifestLoadingRetryDelay,y=t.manifestLoadingMaxRetryTimeout;break;case C.PlaylistContextType.LEVEL:case C.PlaylistContextType.AUDIO_TRACK:case C.PlaylistContextType.SUBTITLE_TRACK:v=0,x=t.levelLoadingTimeOut;break;default:v=t.levelLoadingMaxRetry,x=t.levelLoadingTimeOut,E=t.levelLoadingRetryDelay,y=t.levelLoadingMaxRetryTimeout;break}if(_=this.createInternalLoader(n),(i=n.deliveryDirectives)!==null&&i!==void 0&&i.part){var c;if(n.type===C.PlaylistContextType.LEVEL&&n.level!==null?c=this.hls.levels[n.level].details:n.type===C.PlaylistContextType.AUDIO_TRACK&&n.id!==null?c=this.hls.audioTracks[n.id].details:n.type===C.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(c=this.hls.subtitleTracks[n.id].details),c){var u=c.partTarget,l=c.targetduration;u&&l&&(x=Math.min(Math.max(u*3,l*.8)*1e3,x))}}var b={timeout:x,maxRetry:v,retryDelay:E,maxRetryDelay:y,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};_.load(n,b,m)},h.loadsuccess=function(n,i,t,_){if(_===void 0&&(_=null),t.isSidxRequest){this.handleSidxRequest(n,t),this.handlePlaylistLoaded(n,i,t,_);return}this.resetInternalLoader(t.type);var g=n.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,t,"no EXTM3U delimiter",_);return}i.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,i,t,_):this.handleMasterPlaylist(n,i,t,_)},h.loaderror=function(n,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!1,n)},h.loadtimeout=function(n,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!0)},h.handleMasterPlaylist=function(n,i,t,_){var g=this.hls,v=n.data,x=o(n,t),E=e.default.parseMasterPlaylist(v,x),y=E.levels,c=E.sessionData;if(!y.length){this.handleManifestParsingError(n,t,"no level found in manifest",_);return}var u=y.map(function(L){return{id:L.attrs.AUDIO,audioCodec:L.audioCodec}}),l=y.map(function(L){return{id:L.attrs.SUBTITLES,textCodec:L.textCodec}}),b=e.default.parseMasterPlaylistMedia(v,x,"AUDIO",u),m=e.default.parseMasterPlaylistMedia(v,x,"SUBTITLES",l),w=e.default.parseMasterPlaylistMedia(v,x,"CLOSED-CAPTIONS");if(b.length){var I=b.some(function(L){return!L.url});!I&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new f.AttrList({}),bitrate:0,url:""}))}g.trigger(O.Events.MANIFEST_LOADED,{levels:y,audioTracks:b,subtitles:m,captions:w,url:x,stats:i,networkDetails:_,sessionData:c})},h.handleTrackOrLevelPlaylist=function(n,i,t,_){var g=this.hls,v=t.id,x=t.level,E=t.type,y=o(n,t),c=Object(U.isFiniteNumber)(v)?v:0,u=Object(U.isFiniteNumber)(x)?x:c,l=p(t),b=e.default.parseLevelPlaylist(n.data,y,u,l,c);if(!b.fragments.length){g.trigger(O.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(E===C.PlaylistContextType.MANIFEST){var m={attrs:new f.AttrList({}),bitrate:0,details:b,name:"",url:y};g.trigger(O.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:y,stats:i,networkDetails:_,sessionData:null})}if(i.parsing.end=performance.now(),b.needSidxRanges){var w,I=(w=b.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:I,isSidxRequest:!0,type:E,level:x,levelDetails:b,id:v,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=b,this.handlePlaylistLoaded(n,i,t,_)},h.handleSidxRequest=function(n,i){var t=Object(F.parseSegmentIndex)(new Uint8Array(n.data));if(!t)return;var _=t.references,g=i.levelDetails;_.forEach(function(v,x){var E=v.info,y=g.fragments[x];y.byteRange.length===0&&y.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),y.initSegment&&y.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(n,i,t,_){this.hls.trigger(O.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===C.PlaylistContextType.MANIFEST,url:n.url,reason:t,response:n,context:i,networkDetails:_})},h.handleNetworkError=function(n,i,t,_){t===void 0&&(t=!1),H.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var g=M.ErrorDetails.UNKNOWN,v=!1,x=this.getInternalLoader(n);switch(n.type){case C.PlaylistContextType.MANIFEST:g=t?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,v=!0;break;case C.PlaylistContextType.LEVEL:g=t?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,v=!1;break;case C.PlaylistContextType.AUDIO_TRACK:g=t?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,v=!1;break;case C.PlaylistContextType.SUBTITLE_TRACK:g=t?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,v=!1;break}x&&this.resetInternalLoader(n.type);var E={type:M.ErrorTypes.NETWORK_ERROR,details:g,fatal:v,url:n.url,loader:x,context:n,networkDetails:i};_&&(E.response=_),this.hls.trigger(O.Events.ERROR,E)},h.handlePlaylistLoaded=function(n,i,t,_){var g=t.type,v=t.level,x=t.id,E=t.groupId,y=t.loader,c=t.levelDetails,u=t.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(n,t,"invalid target duration",_);return}if(!y)return;c.live&&(y.getCacheAge&&(c.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(g){case C.PlaylistContextType.MANIFEST:case C.PlaylistContextType.LEVEL:this.hls.trigger(O.Events.LEVEL_LOADED,{details:c,level:v||0,id:x||0,stats:i,networkDetails:_,deliveryDirectives:u});break;case C.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(O.Events.AUDIO_TRACK_LOADED,{details:c,id:x||0,groupId:E||"",stats:i,networkDetails:_,deliveryDirectives:u});break;case C.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(O.Events.SUBTITLE_TRACK_LOADED,{details:c,id:x||0,groupId:E||"",stats:i,networkDetails:_,deliveryDirectives:u});break}},r}();j.default=a},"./src/polyfills/number.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"isFiniteNumber",function(){return U}),A.d(j,"MAX_SAFE_INTEGER",function(){return O});var U=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},O=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,j,A){"use strict";A.r(j);var U=function(){function O(){}return O.getSilentFrame=function(H,F){switch(H){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(F===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(F===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(F===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(F===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},O}();j.default=U},"./src/remux/mp4-generator.ts":function(q,j,A){"use strict";A.r(j);var U=Math.pow(2,32)-1,O=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var F;for(F in M.types)M.types.hasOwnProperty(F)&&(M.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var e=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]),C=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]);M.HDLR_TYPES={video:e,audio:C};var f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=p,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,o,r,o,a),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,f))},M.box=function(F){for(var e=8,C=arguments.length,f=new Array(C>1?C-1:0),p=1;p<C;p++)f[p-1]=arguments[p];for(var o=f.length,a=o;o--;)e+=f[o].byteLength;var r=new Uint8Array(e);for(r[0]=e>>24&255,r[1]=e>>16&255,r[2]=e>>8&255,r[3]=e&255,r.set(F,4),o=0,e=8;o<a;o++)r.set(f[o],e),e+=f[o].byteLength;return r},M.hdlr=function(F){return M.box(M.types.hdlr,M.HDLR_TYPES[F])},M.mdat=function(F){return M.box(M.types.mdat,F)},M.mdhd=function(F,e){e*=F;var C=Math.floor(e/(U+1)),f=Math.floor(e%(U+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,C>>24,C>>16&255,C>>8&255,C&255,f>>24,f>>16&255,f>>8&255,f&255,85,196,0,0]))},M.mdia=function(F){return M.box(M.types.mdia,M.mdhd(F.timescale,F.duration),M.hdlr(F.type),M.minf(F))},M.mfhd=function(F){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},M.minf=function(F){return F.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(F)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(F))},M.moof=function(F,e,C){return M.box(M.types.moof,M.mfhd(F),M.traf(C,e))},M.moov=function(F){for(var e=F.length,C=[];e--;)C[e]=M.trak(F[e]);return M.box.apply(null,[M.types.moov,M.mvhd(F[0].timescale,F[0].duration)].concat(C).concat(M.mvex(F)))},M.mvex=function(F){for(var e=F.length,C=[];e--;)C[e]=M.trex(F[e]);return M.box.apply(null,[M.types.mvex].concat(C))},M.mvhd=function(F,e){e*=F;var C=Math.floor(e/(U+1)),f=Math.floor(e%(U+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,C>>24,C>>16&255,C>>8&255,C&255,f>>24,f>>16&255,f>>8&255,f&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 M.box(M.types.mvhd,p)},M.sdtp=function(F){var e=F.samples||[],C=new Uint8Array(4+e.length),f,p;for(f=0;f<e.length;f++)p=e[f].flags,C[f+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return M.box(M.types.sdtp,C)},M.stbl=function(F){return M.box(M.types.stbl,M.stsd(F),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(F){var e=[],C=[],f,p,o;for(f=0;f<F.sps.length;f++)p=F.sps[f],o=p.byteLength,e.push(o>>>8&255),e.push(o&255),e=e.concat(Array.prototype.slice.call(p));for(f=0;f<F.pps.length;f++)p=F.pps[f],o=p.byteLength,C.push(o>>>8&255),C.push(o&255),C=C.concat(Array.prototype.slice.call(p));var a=M.box(M.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|F.sps.length].concat(e).concat([F.pps.length]).concat(C))),r=F.width,h=F.height,s=F.pixelRatio[0],n=F.pixelRatio[1];return M.box(M.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,r>>8&255,r&255,h>>8&255,h&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]),a,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,n>>24,n>>16&255,n>>8&255,n&255])))},M.esds=function(F){var e=F.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(F.config).concat([6,1,2]))},M.mp4a=function(F){var e=F.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),M.box(M.types.esds,M.esds(F)))},M.mp3=function(F){var e=F.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},M.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(F)):M.box(M.types.stsd,M.STSD,M.mp4a(F)):M.box(M.types.stsd,M.STSD,M.avc1(F))},M.tkhd=function(F){var e=F.id,C=F.duration*F.timescale,f=F.width,p=F.height,o=Math.floor(C/(U+1)),a=Math.floor(C%(U+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,f>>8&255,f&255,0,0,p>>8&255,p&255,0,0]))},M.traf=function(F,e){var C=M.sdtp(F),f=F.id,p=Math.floor(e/(U+1)),o=Math.floor(e%(U+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,o>>24,o>>16&255,o>>8&255,o&255])),M.trun(F,C.length+16+20+8+16+8+8),C)},M.trak=function(F){return F.duration=F.duration||4294967295,M.box(M.types.trak,M.tkhd(F),M.mdia(F))},M.trex=function(F){var e=F.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(F,e){var C=F.samples||[],f=C.length,p=12+16*f,o=new Uint8Array(p),a,r,h,s,n,i;for(e+=8+p,o.set([0,0,15,1,f>>>24&255,f>>>16&255,f>>>8&255,f&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<f;a++)r=C[a],h=r.duration,s=r.size,n=r.flags,i=r.cts,o.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*a);return M.box(M.types.trun,o)},M.initSegment=function(F){M.types||M.init();var e=M.moov(F),C=new Uint8Array(M.FTYP.byteLength+e.byteLength);return C.set(M.FTYP),C.set(e,M.FTYP.byteLength),C},M}();O.types=void 0,O.HDLR_TYPES=void 0,O.STTS=void 0,O.STSC=void 0,O.STCO=void 0,O.STSZ=void 0,O.VMHD=void 0,O.SMHD=void 0,O.STSD=void 0,O.FTYP=void 0,O.DINF=void 0,j.default=O},"./src/remux/mp4-remuxer.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return i}),A.d(j,"normalizePts",function(){return t});var U=A("./src/polyfills/number.ts"),O=A("./src/remux/aac-helper.ts"),M=A("./src/remux/mp4-generator.ts"),H=A("./src/events.ts"),F=A("./src/errors.ts"),e=A("./src/utils/logger.ts"),C=A("./src/types/loader.ts"),f=A("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(x){for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&(x[c]=y[c])}return x},p.apply(this,arguments)}var o=10*1e3,a=1024,r=1152,h=null,s=null,n=!1,i=function(){function x(y,c,u,l){if(l===void 0&&(l=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=y,this.config=c,this.typeSupported=u,this.ISGenerated=!1,h===null){var b=navigator.userAgent||"",m=b.match(/Chrome\/(\d+)/i);h=m?parseInt(m[1]):0}if(s===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);s=w?parseInt(w[1]):0}n=!!h&&h<75||!!s&&s<600}var E=x.prototype;return E.destroy=function(){},E.resetTimeStamp=function(c){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},E.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(c){var u=!1,l=c.reduce(function(b,m){var w=m.pts-b;return w<-4294967296?(u=!0,t(b,m.pts)):w>0?b:m.pts},c[0].pts);return u&&e.logger.debug("PTS rollover detected"),l},E.remux=function(c,u,l,b,m,w,I,L){var S,D,B,R,W,Y,se=m,ne=m,Se=c.pid>-1,xe=u.pid>-1,we=u.samples.length,Re=c.samples.length>0,Pe=we>1,ye=(!Se||Re)&&(!xe||Pe)||this.ISGenerated||I;if(ye){this.ISGenerated||(B=this.generateIS(c,u,m));var ee=this.isVideoContiguous,je=-1;if(Pe&&(je=_(u.samples),!ee&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,je>0){e.logger.warn("[mp4-remuxer]: Dropped "+je+" out of "+we+" video samples due to a missing keyframe");var et=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(je),u.dropped+=je,ne+=(u.samples[0].pts-et)/(u.timescale||9e4)}else je===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+we+" video samples"),Y=!1);if(this.ISGenerated){if(Re&&Pe){var He=this.getVideoStartPts(u.samples),Ne=t(c.samples[0].pts,He)-He,Ye=Ne/u.inputTimeScale;se+=Math.max(0,Ye),ne+=Math.max(0,-Ye)}if(Re){if(c.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(c,u,m)),D=this.remuxAudio(c,se,this.isAudioContiguous,w,xe||Pe||L===C.PlaylistLevelType.AUDIO?ne:void 0),Pe){var Ae=D?D.endPTS-D.startPTS:0;u.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(c,u,m)),S=this.remuxVideo(u,ne,ee,Ae)}}else Pe&&(S=this.remuxVideo(u,ne,ee,0));S&&(S.firstKeyFrame=je,S.independent=je!==-1)}}return this.ISGenerated&&(l.samples.length&&(W=this.remuxID3(l,m)),b.samples.length&&(R=this.remuxText(b,m))),{audio:D,video:S,initSegment:B,independent:Y,text:R,id3:W}},E.generateIS=function(c,u,l){var b=c.samples,m=u.samples,w=this.typeSupported,I={},L=!Object(U.isFiniteNumber)(this._initPTS),S="audio/mp4",D,B,R;if(L&&(D=B=Infinity),c.config&&b.length&&(c.timescale=c.samplerate,c.isAAC||(w.mpeg?(S="audio/mpeg",c.codec=""):w.mp3&&(c.codec="mp3")),I.audio={id:"audio",container:S,codec:c.codec,initSegment:!c.isAAC&&w.mpeg?new Uint8Array(0):M.default.initSegment([c]),metadata:{channelCount:c.channelCount}},L&&(R=c.inputTimeScale,D=B=b[0].pts-Math.round(R*l))),u.sps&&u.pps&&m.length&&(u.timescale=u.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:M.default.initSegment([u]),metadata:{width:u.width,height:u.height}},L)){R=u.inputTimeScale;var W=this.getVideoStartPts(m),Y=Math.round(R*l);B=Math.min(B,t(m[0].dts,W)-Y),D=Math.min(D,W-Y)}if(Object.keys(I).length)return this.ISGenerated=!0,L&&(this._initPTS=D,this._initDTS=B),{tracks:I,initPTS:D,timescale:R}},E.remuxVideo=function(c,u,l,b){var m=c.inputTimeScale,w=c.samples,I=[],L=w.length,S=this._initPTS,D=this.nextAvcDts,B=8,R,W,Y,se=Number.POSITIVE_INFINITY,ne=Number.NEGATIVE_INFINITY,Se=0,xe=!1;if(!l||D===null){var we=u*m,Re=w[0].pts-t(w[0].dts,w[0].pts);D=we-Re}for(var Pe=0;Pe<L;Pe++){var ye=w[Pe];if(ye.pts=t(ye.pts-S,D),ye.dts=t(ye.dts-S,D),ye.dts>ye.pts){var ee=9e4*.2;Se=Math.max(Math.min(Se,ye.pts-ye.dts),-1*ee)}ye.dts<w[Pe>0?Pe-1:Pe].dts&&(xe=!0)}xe&&w.sort(function(yt,wt){var rt=yt.dts-wt.dts,Vt=yt.pts-wt.pts;return rt||Vt}),W=w[0].dts,Y=w[w.length-1].dts;var je=Math.round((Y-W)/(L-1));if(Se<0){if(Se<je*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(f.toMsFromMpegTsClock)(-je,!0)+" ms");for(var et=Se,He=0;He<L;He++)w[He].dts=et=Math.max(et,w[He].pts-je),w[He].pts=Math.max(et,w[He].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(f.toMsFromMpegTsClock)(Se,!0)+" ms to overcome this issue");for(var Ne=0;Ne<L;Ne++)w[Ne].dts=w[Ne].dts+Se}W=w[0].dts}if(l){var Ye=W-D,Ae=Ye>je,Ue=Ye<-1;if(Ae||Ue){Ae?e.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(Ye,!0)+" ms ("+Ye+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(-Ye,!0)+" ms ("+Ye+"dts) overlapping between fragments detected"),W=D;var Ve=w[0].pts-Ye;w[0].dts=W,w[0].pts=Ve,e.logger.log("Video: First PTS/DTS adjusted: "+Object(f.toMsFromMpegTsClock)(Ve,!0)+"/"+Object(f.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(f.toMsFromMpegTsClock)(Ye,!0)+" ms")}}n&&(W=Math.max(0,W));for(var Q=0,fe=0,be=0;be<L;be++){for(var Ee=w[be],ke=Ee.units,We=ke.length,Xe=0,ze=0;ze<We;ze++)Xe+=ke[ze].data.length;fe+=Xe,Q+=We,Ee.length=Xe,Ee.dts=Math.max(Ee.dts,W),Ee.pts=Math.max(Ee.pts,Ee.dts,0),se=Math.min(Ee.pts,se),ne=Math.max(Ee.pts,ne)}Y=w[L-1].dts;var qe=fe+4*Q+8,Qe;try{Qe=new Uint8Array(qe)}catch(yt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:qe,reason:"fail allocating video mdat "+qe});return}var Ze=new DataView(Qe.buffer);Ze.setUint32(0,qe),Qe.set(M.default.types.mdat,4);for(var Ge=0;Ge<L;Ge++){for(var it=w[Ge],nt=it.units,Ie=0,Me=0,pe=nt.length;Me<pe;Me++){var ue=nt[Me],ce=ue.data,X=ue.data.byteLength;Ze.setUint32(B,X),B+=4,Qe.set(ce,B),B+=X,Ie+=4+X}if(Ge<L-1)R=w[Ge+1].dts-it.dts;else{var $=this.config,te=it.dts-w[Ge>0?Ge-1:Ge].dts;if($.stretchShortVideoTrack&&this.nextAudioPts!==null){var oe=Math.floor($.maxBufferHole*m),Te=(b?se+b*m:this.nextAudioPts)-it.pts;Te>oe?(R=Te-te,R<0&&(R=te),e.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=te}else R=te}var Ce=Math.round(it.pts-it.dts);I.push(new g(it.key,R,Ie,Ce))}if(I.length&&h&&h<70){var Ke=I[0].flags;Ke.dependsOn=2,Ke.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=D=Y+R,this.isVideoContiguous=!0;var lt=M.default.moof(c.sequenceNumber++,W,p({},c,{samples:I})),gt="video",ut={data1:lt,data2:Qe,startPTS:se/m,endPTS:(ne+R)/m,startDTS:W/m,endDTS:D/m,type:gt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(Qe.length,"MDAT length must not be zero"),ut},E.remuxAudio=function(c,u,l,b,m){var w=c.inputTimeScale,I=c.samplerate?c.samplerate:w,L=w/I,S=c.isAAC?a:r,D=S*L,B=this._initPTS,R=!c.isAAC&&this.typeSupported.mpeg,W=[],Y=c.samples,se=R?0:8,ne=this.nextAudioPts||-1,Se=u*w;if(this.isAudioContiguous=l=l||Y.length&&ne>0&&(b&&Math.abs(Se-ne)<9e3||Math.abs(t(Y[0].pts-B,Se)-ne)<20*D),Y.forEach(function(ce){ce.pts=t(ce.pts-B,Se)}),!l||ne<0){if(Y=Y.filter(function(ce){return ce.pts>=0}),!Y.length)return;m===0?ne=0:b?ne=Math.max(0,Se):ne=Y[0].pts}if(c.isAAC)for(var xe=m!==void 0,we=this.config.maxAudioFramesDrift,Re=0,Pe=ne;Re<Y.length;Re++){var ye=Y[Re],ee=ye.pts,je=ee-Pe,et=Math.abs(1e3*je/w);if(je<=-we*D&&xe)Re===0&&(e.logger.warn("Audio frame @ "+(ee/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*je/w)+" ms."),this.nextAudioPts=ne=Pe=ee);else if(je>=we*D&&et<o&&xe){var He=Math.round(je/D);Pe=ee-He*D,Pe<0&&(He--,Pe+=D),Re===0&&(this.nextAudioPts=ne=Pe),e.logger.warn("[mp4-remuxer]: Injecting "+He+" audio frame @ "+(Pe/w).toFixed(3)+"s due to "+Math.round(1e3*je/w)+" ms gap.");for(var Ne=0;Ne<He;Ne++){var Ye=Math.max(Pe,0),Ae=O.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);Ae||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ae=ye.unit.subarray()),Y.splice(Re,0,{unit:Ae,pts:Ye}),Pe+=D,Re++}}ye.pts=Pe,Pe+=D}for(var Ue=null,Ve=null,Q,fe=0,be=Y.length;be--;)fe+=Y[be].unit.byteLength;for(var Ee=0,ke=Y.length;Ee<ke;Ee++){var We=Y[Ee],Xe=We.unit,ze=We.pts;if(Ve!==null){var qe=W[Ee-1];qe.duration=Math.round((ze-Ve)/L)}else if(l&&c.isAAC&&(ze=ne),Ue=ze,fe>0){fe+=se;try{Q=new Uint8Array(fe)}catch(ce){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:fe,reason:"fail allocating audio mdat "+fe});return}if(!R){var Qe=new DataView(Q.buffer);Qe.setUint32(0,fe),Q.set(M.default.types.mdat,4)}}else return;Q.set(Xe,se);var Ze=Xe.byteLength;se+=Ze,W.push(new g(!0,S,Ze,0)),Ve=ze}var Ge=W.length;if(!Ge)return;var it=W[W.length-1];this.nextAudioPts=ne=Ve+L*it.duration;var nt=R?new Uint8Array(0):M.default.moof(c.sequenceNumber++,Ue/L,p({},c,{samples:W}));c.samples=[];var Ie=Ue/w,Me=ne/w,pe="audio",ue={data1:nt,data2:Q,startPTS:Ie,endPTS:Me,startDTS:Ie,endDTS:Me,type:pe,hasAudio:!0,hasVideo:!1,nb:Ge};return this.isAudioContiguous=!0,console.assert(Q.length,"MDAT length must not be zero"),ue},E.remuxEmptyAudio=function(c,u,l,b){var m=c.inputTimeScale,w=c.samplerate?c.samplerate:m,I=m/w,L=this.nextAudioPts,S=(L!==null?L:b.startDTS*m)+this._initDTS,D=b.endDTS*m+this._initDTS,B=I*a,R=Math.ceil((D-S)/B),W=O.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],se=0;se<R;se++){var ne=S+se*B;Y.push({unit:W,pts:ne,dts:ne})}return c.samples=Y,this.remuxAudio(c,u,l,!1)},E.remuxID3=function(c,u){var l=c.samples.length;if(!l)return;for(var b=c.inputTimeScale,m=this._initPTS,w=this._initDTS,I=0;I<l;I++){var L=c.samples[I];L.pts=t(L.pts-m,u*b)/b,L.dts=t(L.dts-w,u*b)/b}var S=c.samples;return c.samples=[],{samples:S}},E.remuxText=function(c,u){var l=c.samples.length;if(!l)return;for(var b=c.inputTimeScale,m=this._initPTS,w=0;w<l;w++){var I=c.samples[w];I.pts=t(I.pts-m,u*b)/b}c.samples.sort(function(S,D){return S.pts-D.pts});var L=c.samples;return c.samples=[],{samples:L}},x}();function t(x,E){var y;if(E===null)return x;for(E<x?y=-8589934592:y=8589934592;Math.abs(x-E)>4294967296;)x+=y;return x}function _(x){for(var E=0;E<x.length;E++)if(x[E].key)return E;return-1}var g=function(E,y,c,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=c,this.cts=u,this.flags=new v(E)},v=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/polyfills/number.ts"),O=A("./src/utils/mp4-tools.ts"),M=A("./src/loader/fragment.ts"),H=A("./src/utils/logger.ts"),F=function(){function f(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var p=f.prototype;return p.destroy=function(){},p.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(a,r,h){this.audioCodec=r,this.videoCodec=h,this.generateInitSegment(a),this.emitInitSegment=!0},p.generateInitSegment=function(a){var r=this.audioCodec,h=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(O.parseInitSegment)(a);r||(r=C(s.audio,M.ElementaryStreamTypes.AUDIO)),h||(h=C(s.video,M.ElementaryStreamTypes.VIDEO));var n={};s.audio&&s.video?n.audiovideo={container:"video/mp4",codec:r+","+h,initSegment:a,id:"main"}:s.audio?n.audio={container:"audio/mp4",codec:r,initSegment:a,id:"audio"}:s.video?n.video={container:"video/mp4",codec:h,initSegment:a,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},p.remux=function(a,r,h,s,n){var i=this.initPTS,t=this.lastEndDTS,_={audio:void 0,video:void 0,text:s,id3:h,initSegment:void 0};Object(U.isFiniteNumber)(t)||(t=this.lastEndDTS=n||0);var g=r.samples;if(!g||!g.length)return _;var v={initPTS:void 0,timescale:1},x=this.initData;if((!x||!x.length)&&(this.generateInitSegment(g),x=this.initData),!x||!x.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),_;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1),Object(U.isFiniteNumber)(i)||(this.initPTS=v.initPTS=i=e(x,g,t));var E=Object(O.getDuration)(g,x),y=t,c=E+y;Object(O.offsetStartDTS)(x,g,i),E>0?this.lastEndDTS=c:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!x.audio,l=!!x.video,b="";u&&(b+="audio"),l&&(b+="video");var m={data1:g,startPTS:y,startDTS:y,endPTS:c,endDTS:c,type:b,hasAudio:u,hasVideo:l,nb:1,dropped:0};return _.audio=m.type==="audio"?m:void 0,_.video=m.type!=="audio"?m:void 0,_.text=s,_.id3=h,_.initSegment=v,_},f}(),e=function(p,o,a){return Object(O.getStartDTS)(p,o)-a};function C(f,p){var o=f==null?void 0:f.codec;return o&&o.length>4?o:o==="hvc1"?"hvc1.1.c.L120.90":o==="av01"?"av01.0.04M.08":o==="avc1"||p===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}j.default=F},"./src/task-loop.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return U});var U=function(){function O(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=O.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},O}()},"./src/types/cmcd.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"CMCDVersion",function(){return U}),A.d(j,"CMCDObjectType",function(){return O}),A.d(j,"CMCDStreamingFormat",function(){return M}),A.d(j,"CMCDStreamType",function(){return H});var U=1,O;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(O||(O={}));var M;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(M||(M={}));var H;(function(F){F.VOD="v",F.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"HlsSkip",function(){return M}),A.d(j,"getSkipValue",function(){return H}),A.d(j,"HlsUrlParameters",function(){return F}),A.d(j,"Level",function(){return e});function U(C,f){for(var p=0;p<f.length;p++){var o=f[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(C,o.key,o)}}function O(C,f,p){return f&&U(C.prototype,f),p&&U(C,p),C}var M;(function(C){C.No="",C.Yes="YES",C.v2="v2"})(M||(M={}));function H(C,f){var p=C.canSkipUntil,o=C.canSkipDateRanges,a=C.endSN,r=f!==void 0?f-a:0;return p&&r<p?o?M.v2:M.Yes:M.No}var F=function(){function C(p,o,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=o,this.skip=a}var f=C.prototype;return f.addDirectives=function(o){var a=new self.URL(o);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},C}(),e=function(){function C(f){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=[f.url],this.attrs=f.attrs,this.bitrate=f.bitrate,f.details&&(this.details=f.details),this.id=f.id||0,this.name=f.name,this.width=f.width||0,this.height=f.height||0,this.audioCodec=f.audioCodec,this.videoCodec=f.videoCodec,this.unknownCodecs=f.unknownCodecs,this.codecSet=[f.videoCodec,f.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return O(C,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var o=p%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),C}()},"./src/types/loader.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"PlaylistContextType",function(){return U}),A.d(j,"PlaylistLevelType",function(){return O});var U;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(U||(U={}));var O;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(O||(O={}))},"./src/types/transmuxer.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"ChunkMetadata",function(){return U});var U=function(H,F,e,C,f,p){C===void 0&&(C=0),f===void 0&&(f=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=O(),this.buffering={audio:O(),video:O(),audiovideo:O()},this.level=H,this.sn=F,this.id=e,this.size=C,this.part=f,this.partial=p};function O(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"AttrList",function(){return M});var U=/^(\d+)x(\d+)$/,O=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function H(e){typeof e=="string"&&(e=H.parseAttrList(e));for(var C in e)e.hasOwnProperty(C)&&(this[C]=e[C])}var F=H.prototype;return F.decimalInteger=function(C){var f=parseInt(this[C],10);return f>Number.MAX_SAFE_INTEGER?Infinity:f},F.hexadecimalInteger=function(C){if(this[C]){var f=(this[C]||"0x").slice(2);f=(f.length&1?"0":"")+f;for(var p=new Uint8Array(f.length/2),o=0;o<f.length/2;o++)p[o]=parseInt(f.slice(o*2,o*2+2),16);return p}else return null},F.hexadecimalIntegerAsNumber=function(C){var f=parseInt(this[C],16);return f>Number.MAX_SAFE_INTEGER?Infinity:f},F.decimalFloatingPoint=function(C){return parseFloat(this[C])},F.optionalFloat=function(C,f){var p=this[C];return p?parseFloat(p):f},F.enumeratedString=function(C){return this[C]},F.bool=function(C){return this[C]==="YES"},F.decimalResolution=function(C){var f=U.exec(this[C]);return f===null?void 0:{width:parseInt(f[1],10),height:parseInt(f[2],10)}},H.parseAttrList=function(C){var f,p={},o='"';for(O.lastIndex=0;(f=O.exec(C))!==null;){var a=f[2];a.indexOf(o)===0&&a.lastIndexOf(o)===a.length-1&&(a=a.slice(1,-1)),p[f[1]]=a}return p},H}()},"./src/utils/binary-search.ts":function(q,j,A){"use strict";A.r(j);var U={search:function(M,H){for(var F=0,e=M.length-1,C=null,f=null;F<=e;){C=(F+e)/2|0,f=M[C];var p=H(f);if(p>0)F=C+1;else if(p<0)e=C-1;else return f}return null}};j.default=U},"./src/utils/buffer-helper.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"BufferHelper",function(){return M});var U=A("./src/utils/logger.ts"),O={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function H(){}return H.isBuffered=function(e,C){try{if(e){for(var f=H.getBuffered(e),p=0;p<f.length;p++)if(C>=f.start(p)&&C<=f.end(p))return!0}}catch(o){}return!1},H.bufferInfo=function(e,C,f){try{if(e){var p=H.getBuffered(e),o=[],a;for(a=0;a<p.length;a++)o.push({start:p.start(a),end:p.end(a)});return this.bufferedInfo(o,C,f)}}catch(r){}return{len:0,start:C,end:C,nextStart:void 0}},H.bufferedInfo=function(e,C,f){C=Math.max(0,C),e.sort(function(v,x){var E=v.start-x.start;return E||x.end-v.end});var p=[];if(f)for(var o=0;o<e.length;o++){var a=p.length;if(a){var r=p[a-1].end;e[o].start-r<f?e[o].end>r&&(p[a-1].end=e[o].end):p.push(e[o])}else p.push(e[o])}else p=e;for(var h=0,s,n=C,i=C,t=0;t<p.length;t++){var _=p[t].start,g=p[t].end;if(C+f>=_&&C<g)n=_,i=g,h=i-C;else if(C+f<_){s=_;break}}return{len:h,start:n||0,end:i||0,nextStart:s}},H.getBuffered=function(e){try{return e.buffered}catch(C){return U.logger.log("failed to get media.buffered",C),O}},H}()},"./src/utils/cea-608-parser.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"Row",function(){return i}),A.d(j,"CaptionScreen",function(){return t});var U=A("./src/utils/logger.ts"),O={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},M=function(c){var u=c;return O.hasOwnProperty(c)&&(u=O[c]),String.fromCharCode(u)},H=15,F=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},C={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},o=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(a||(a={}));var r=function(){function y(){this.time=null,this.verboseLevel=a.ERROR}var c=y.prototype;return c.log=function(l,b){this.verboseLevel>=l&&U.logger.log(this.time+" ["+l+"] "+b)},y}(),h=function(c){for(var u=[],l=0;l<c.length;l++)u.push(c[l].toString(16));return u},s=function(){function y(u,l,b,m,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=l||!1,this.italics=b||!1,this.background=m||"black",this.flash=w||!1}var c=y.prototype;return c.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},c.setStyles=function(l){for(var b=["foreground","underline","italics","background","flash"],m=0;m<b.length;m++){var w=b[m];l.hasOwnProperty(w)&&(this[w]=l[w])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(l){return this.foreground===l.foreground&&this.underline===l.underline&&this.italics===l.italics&&this.background===l.background&&this.flash===l.flash},c.copy=function(l){this.foreground=l.foreground,this.underline=l.underline,this.italics=l.italics,this.background=l.background,this.flash=l.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),n=function(){function y(u,l,b,m,w,I){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new s(l,b,m,w,I)}var c=y.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(l,b){this.uchar=l,this.penState.copy(b)},c.setPenState=function(l){this.penState.copy(l)},c.equals=function(l){return this.uchar===l.uchar&&this.penState.equals(l.penState)},c.copy=function(l){this.uchar=l.uchar,this.penState.copy(l.penState)},c.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),i=function(){function y(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var l=0;l<F;l++)this.chars.push(new n);this.logger=u,this.pos=0,this.currPenState=new s}var c=y.prototype;return c.equals=function(l){for(var b=!0,m=0;m<F;m++)if(!this.chars[m].equals(l.chars[m])){b=!1;break}return b},c.copy=function(l){for(var b=0;b<F;b++)this.chars[b].copy(l.chars[b])},c.isEmpty=function(){for(var l=!0,b=0;b<F;b++)if(!this.chars[b].isEmpty()){l=!1;break}return l},c.setCursor=function(l){this.pos!==l&&(this.pos=l),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},c.moveCursor=function(l){var b=this.pos+l;if(l>1)for(var m=this.pos+1;m<b+1;m++)this.chars[m].setPenState(this.currPenState);this.setCursor(b)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(l){l>=144&&this.backSpace();var b=M(l);if(this.pos>=F){this.logger.log(a.ERROR,"Cannot insert "+l.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(l){var b;for(b=l;b<F;b++)this.chars[b].reset()},c.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},c.clearToEndOfRow=function(){this.clearFromPos(this.pos)},c.getTextString=function(){for(var l=[],b=!0,m=0;m<F;m++){var w=this.chars[m].uchar;w!==" "&&(b=!1),l.push(w)}return b?"":l.join("")},c.setPenStyles=function(l){this.currPenState.setStyles(l);var b=this.chars[this.pos];b.setPenState(this.currPenState)},y}(),t=function(){function y(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var l=0;l<H;l++)this.rows.push(new i(u));this.logger=u,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=y.prototype;return c.reset=function(){for(var l=0;l<H;l++)this.rows[l].clear();this.currRow=H-1},c.equals=function(l){for(var b=!0,m=0;m<H;m++)if(!this.rows[m].equals(l.rows[m])){b=!1;break}return b},c.copy=function(l){for(var b=0;b<H;b++)this.rows[b].copy(l.rows[b])},c.isEmpty=function(){for(var l=!0,b=0;b<H;b++)if(!this.rows[b].isEmpty()){l=!1;break}return l},c.backSpace=function(){var l=this.rows[this.currRow];l.backSpace()},c.clearToEndOfRow=function(){var l=this.rows[this.currRow];l.clearToEndOfRow()},c.insertChar=function(l){var b=this.rows[this.currRow];b.insertChar(l)},c.setPen=function(l){var b=this.rows[this.currRow];b.setPenStyles(l)},c.moveCursor=function(l){var b=this.rows[this.currRow];b.moveCursor(l)},c.setCursor=function(l){this.logger.log(a.INFO,"setCursor: "+l);var b=this.rows[this.currRow];b.setCursor(l)},c.setPAC=function(l){this.logger.log(a.INFO,"pacData = "+JSON.stringify(l));var b=l.row-1;if(this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==b){for(var m=0;m<H;m++)this.rows[m].clear();var w=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var L=I.rows[w].cueStartTime,S=this.logger.time;if(L&&S!==null&&L<S)for(var D=0;D<this.nrRollUpRows;D++)this.rows[b-this.nrRollUpRows+D+1].copy(I.rows[w+D])}}this.currRow=b;var B=this.rows[this.currRow];if(l.indent!==null){var R=l.indent,W=Math.max(R-1,0);B.setCursor(l.indent),l.color=B.chars[W].penState.foreground}var Y={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(Y)},c.setBkgData=function(l){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(l)),this.backSpace(),this.setPen(l),this.insertChar(32)},c.setRollUpRows=function(l){this.nrRollUpRows=l},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var l=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(l,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),this.logger.log(a.INFO,"Rolling up")},c.getDisplayText=function(l){l=l||!1;for(var b=[],m="",w=-1,I=0;I<H;I++){var L=this.rows[I].getTextString();L&&(w=I+1,l?b.push("Row "+w+": '"+L+"'"):b.push(L.trim()))}return b.length>0&&(l?m="["+b.join(" | ")+"]":m=b.join(`
|
|
`)),m},c.getTextAndFormat=function(){return this.rows},y}(),_=function(){function y(u,l,b){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=u,this.outputFilter=l,this.mode=null,this.verbose=0,this.displayedMemory=new t(b),this.nonDisplayedMemory=new t(b),this.lastOutputScreen=new t(b),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var c=y.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(l){this.outputFilter=l},c.setPAC=function(l){this.writeScreen.setPAC(l)},c.setBkgData=function(l){this.writeScreen.setBkgData(l)},c.setMode=function(l){if(l===this.mode)return;this.mode=l,this.logger.log(a.INFO,"MODE="+l),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=l},c.insertChars=function(l){for(var b=0;b<l.length;b++)this.writeScreen.insertChar(l[b]);var m=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,m+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},c.ccAOF=function(){},c.ccAON=function(){},c.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(l){this.logger.log(a.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},c.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var l=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=l,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(l){this.logger.log(a.INFO,"TO("+l+") - Tab Offset"),this.writeScreen.moveCursor(l)},c.ccMIDROW=function(l){var b={flash:!1};if(b.underline=l%2===1,b.italics=l>=46,b.italics)b.foreground="white";else{var m=Math.floor(l/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=w[m]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},c.outputDataUpdate=function(l){l===void 0&&(l=!1);var b=this.logger.time;if(b===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=b:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,b,this.lastOutputScreen),l&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:b),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(l){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,l,this.displayedMemory),this.cueStartTime=l))},y}(),g=function(){function y(u,l,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var m=new r;this.channels=[null,new _(u,l,m),new _(u+1,b,m)],this.cmdHistory=E(),this.logger=m}var c=y.prototype;return c.getHandler=function(l){return this.channels[l].getHandler()},c.setHandler=function(l,b){this.channels[l].setHandler(b)},c.addData=function(l,b){var m,w,I,L=!1;this.logger.time=l;for(var S=0;S<b.length;S+=2){if(w=b[S]&127,I=b[S+1]&127,w===0&&I===0)continue;if(this.logger.log(a.DATA,"["+h([b[S],b[S+1]])+"] -> ("+h([w,I])+")"),m=this.parseCmd(w,I),m||(m=this.parseMidrow(w,I)),m||(m=this.parsePAC(w,I)),m||(m=this.parseBackgroundAttributes(w,I)),!m&&(L=this.parseChars(w,I),L)){var D=this.currentChannel;if(D&&D>0){var B=this.channels[D];B.insertChars(L)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!m&&!L&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+h([w,I])+" orig: "+h([b[S],b[S+1]]))}},c.parseCmd=function(l,b){var m=this.cmdHistory,w=(l===20||l===28||l===21||l===29)&&b>=32&&b<=47,I=(l===23||l===31)&&b>=33&&b<=35;if(!(w||I))return!1;if(x(l,b,m))return v(null,null,m),this.logger.log(a.DEBUG,"Repeated command ("+h([l,b])+") is dropped"),!0;var L=l===20||l===21||l===23?1:2,S=this.channels[L];return l===20||l===21||l===28||l===29?b===32?S.ccRCL():b===33?S.ccBS():b===34?S.ccAOF():b===35?S.ccAON():b===36?S.ccDER():b===37?S.ccRU(2):b===38?S.ccRU(3):b===39?S.ccRU(4):b===40?S.ccFON():b===41?S.ccRDC():b===42?S.ccTR():b===43?S.ccRTD():b===44?S.ccEDM():b===45?S.ccCR():b===46?S.ccENM():b===47&&S.ccEOC():S.ccTO(b-32),v(l,b,m),this.currentChannel=L,!0},c.parseMidrow=function(l,b){var m=0;if((l===17||l===25)&&b>=32&&b<=47){if(l===17?m=1:m=2,m!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[m];return w?(w.ccMIDROW(b),this.logger.log(a.DEBUG,"MIDROW ("+h([l,b])+")"),!0):!1}return!1},c.parsePAC=function(l,b){var m,w=this.cmdHistory,I=(l>=17&&l<=23||l>=25&&l<=31)&&b>=64&&b<=127,L=(l===16||l===24)&&b>=64&&b<=95;if(!(I||L))return!1;if(x(l,b,w))return v(null,null,w),!0;var S=l<=23?1:2;b>=64&&b<=95?m=S===1?e[l]:f[l]:m=S===1?C[l]:p[l];var D=this.channels[S];return D?(D.setPAC(this.interpretPAC(m,b)),v(l,b,w),this.currentChannel=S,!0):!1},c.interpretPAC=function(l,b){var m,w={color:null,italics:!1,indent:null,underline:!1,row:l};return b>95?m=b-96:m=b-64,w.underline=(m&1)===1,m<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(m/2)]:m<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((m-16)/2)*4,w},c.parseChars=function(l,b){var m,w=null,I=null;if(l>=25?(m=2,I=l-8):(m=1,I=l),I>=17&&I<=19){var L;I===17?L=b+80:I===18?L=b+112:L=b+144,this.logger.log(a.INFO,"Special char '"+M(L)+"' in channel "+m),w=[L]}else l>=32&&l<=127&&(w=b===0?[l]:[l,b]);if(w){var S=h(w);this.logger.log(a.DEBUG,"Char codes = "+S.join(",")),v(l,b,this.cmdHistory)}return w},c.parseBackgroundAttributes=function(l,b){var m=(l===16||l===24)&&b>=32&&b<=47,w=(l===23||l===31)&&b>=45&&b<=47;if(!(m||w))return!1;var I,L={};l===16||l===24?(I=Math.floor((b-32)/2),L.background=o[I],b%2===1&&(L.background=L.background+"_semi")):b===45?L.background="transparent":(L.foreground="black",b===47&&(L.underline=!0));var S=l<=23?1:2,D=this.channels[S];return D.setBkgData(L),v(l,b,this.cmdHistory),!0},c.reset=function(){for(var l=0;l<Object.keys(this.channels).length;l++){var b=this.channels[l];b&&b.reset()}this.cmdHistory=E()},c.cueSplitAtTime=function(l){for(var b=0;b<this.channels.length;b++){var m=this.channels[b];m&&m.cueSplitAtTime(l)}},y}();function v(y,c,u){u.a=y,u.b=c}function x(y,c,u){return u.a===y&&u.b===c}function E(){return{a:null,b:null}}j.default=g},"./src/utils/codecs.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"isCodecType",function(){return O}),A.d(j,"isCodecSupportedInMp4",function(){return M});var U={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function O(H,F){var e=U[F];return!!e&&e[H.slice(0,4)]===!0}function M(H,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/utils/vttparser.ts"),O=A("./src/utils/webvtt-parser.ts"),M=A("./src/utils/texttrack-utils.ts"),H=/\s/,F={newCue:function(C,f,p,o){for(var a=[],r,h,s,n,i,t=self.VTTCue||self.TextTrackCue,_=0;_<o.rows.length;_++)if(r=o.rows[_],s=!0,n=0,i="",!r.isEmpty()){for(var g=0;g<r.chars.length;g++)H.test(r.chars[g].uchar)&&s?n++:(i+=r.chars[g].uchar,s=!1);r.cueStartTime=f,f===p&&(p+=1e-4),n>=16?n--:n++;var v=Object(U.fixLineBreaks)(i.trim()),x=Object(O.generateCueId)(f,p,v);(!C||!C.cues||!C.cues.getCueById(x))&&(h=new t(f,p,v),h.id=x,h.line=_+1,h.align="left",h.position=10+Math.min(80,Math.floor(n*8/32)*10),a.push(h))}return C&&a.length&&(a.sort(function(E,y){return E.line==="auto"||y.line==="auto"?0:E.line>8&&y.line>8?y.line-E.line:E.line-y.line}),a.forEach(function(E){return Object(M.addCueToTrack)(C,E)})),a}};j.default=F},"./src/utils/discontinuities.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"findFirstFragWithCC",function(){return H}),A.d(j,"shouldAlignOnDiscontinuities",function(){return F}),A.d(j,"findDiscontinuousReferenceFrag",function(){return e}),A.d(j,"adjustSlidingStart",function(){return f}),A.d(j,"alignStream",function(){return p}),A.d(j,"alignPDT",function(){return a}),A.d(j,"alignFragmentByPDTDelta",function(){return r}),A.d(j,"alignMediaPlaylistByPDT",function(){return h});var U=A("./src/polyfills/number.ts"),O=A("./src/utils/logger.ts"),M=A("./src/controller/level-helper.ts");function H(s,n){for(var i=null,t=0,_=s.length;t<_;t++){var g=s[t];if(g&&g.cc===n){i=g;break}}return i}function F(s,n,i){return!!(n.details&&(i.endCC>i.startCC||s&&s.cc<i.startCC))}function e(s,n){var i=s.fragments,t=n.fragments;if(!t.length||!i.length){O.logger.log("No fragments to align");return}var _=H(i,t[0].cc);if(!_||_&&!_.startPTS){O.logger.log("No frag in previous level to align on");return}return _}function C(s,n){if(s){var i=s.start+n;s.start=s.startPTS=i,s.endPTS=i+s.duration}}function f(s,n){for(var i=n.fragments,t=0,_=i.length;t<_;t++)C(i[t],s);n.fragmentHint&&C(n.fragmentHint,s),n.alignedSliding=!0}function p(s,n,i){if(!n)return;o(s,i,n),!i.alignedSliding&&n.details&&a(i,n.details),!i.alignedSliding&&n.details&&!i.skippedSegments&&Object(M.adjustSliding)(n.details,i)}function o(s,n,i){if(F(s,i,n)){var t=e(i.details,n);t&&Object(U.isFiniteNumber)(t.start)&&(O.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),f(t.start,n))}}function a(s,n){if(!n.fragments.length||!s.hasProgramDateTime||!n.hasProgramDateTime)return;var i=n.fragments[0].programDateTime,t=s.fragments[0].programDateTime,_=(t-i)/1e3+n.fragments[0].start;_&&Object(U.isFiniteNumber)(_)&&(O.logger.log("Adjusting PTS using programDateTime delta "+(t-i)+"ms, sliding:"+_.toFixed(3)+" "+s.url+" "),f(_,s))}function r(s,n){var i=s.programDateTime;if(!i)return;var t=(i-n)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function h(s,n){if(!n.fragments.length||!s.hasProgramDateTime||!n.hasProgramDateTime)return;var i=n.fragments[0].programDateTime,t=n.fragments[0].start,_=i-t*1e3;s.fragments.forEach(function(g){r(g,_)}),s.fragmentHint&&r(s.fragmentHint,_),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/utils/ewma.ts"),O=function(){function M(F,e,C){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=C,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new U.default(F),this.fast_=new U.default(e)}var H=M.prototype;return H.update=function(e,C){var f=this.slow_,p=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new U.default(e,f.getEstimate(),f.getTotalWeight())),this.fast_.halfLife!==C&&(this.fast_=new U.default(C,p.getEstimate(),p.getTotalWeight()))},H.sample=function(e,C){e=Math.max(e,this.minDelayMs_);var f=8*C,p=e/1e3,o=f/p;this.fast_.sample(p,o),this.slow_.sample(p,o)},H.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},M}();j.default=O},"./src/utils/ewma.ts":function(q,j,A){"use strict";A.r(j);var U=function(){function O(H,F,e){F===void 0&&(F=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=F,this.totalWeight_=e}var M=O.prototype;return M.sample=function(F,e){var C=Math.pow(this.alpha_,F);this.estimate_=e*(1-C)+C*this.estimate_,this.totalWeight_+=F},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},O}();j.default=U},"./src/utils/fetch-loader.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"fetchSupported",function(){return r});var U=A("./src/polyfills/number.ts"),O=A("./src/loader/load-stats.ts"),M=A("./src/demux/chunk-cache.ts");function H(t,_){t.prototype=Object.create(_.prototype),t.prototype.constructor=t,p(t,_)}function F(t){var _=typeof Map=="function"?new Map:void 0;return F=function(v){if(v===null||!f(v))return v;if(typeof v!="function")throw new TypeError("Super expression must either be null or a function");if(typeof _!="undefined"){if(_.has(v))return _.get(v);_.set(v,x)}function x(){return e(v,arguments,o(this).constructor)}return x.prototype=Object.create(v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),p(x,v)},F(t)}function e(t,_,g){return C()?e=Reflect.construct:e=function(x,E,y){var c=[null];c.push.apply(c,E);var u=Function.bind.apply(x,c),l=new u;return y&&p(l,y.prototype),l},e.apply(null,arguments)}function C(){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(t){return!1}}function f(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function p(t,_){return p=Object.setPrototypeOf||function(v,x){return v.__proto__=x,v},p(t,_)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},o(t)}function a(){return a=Object.assign||function(t){for(var _=1;_<arguments.length;_++){var g=arguments[_];for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(t[v]=g[v])}return t},a.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var h=function(){function t(g){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=g.fetchSetup||n,this.controller=new self.AbortController,this.stats=new O.LoadStats}var _=t.prototype;return _.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},_.abortInternal=function(){var v=this.response;(!v||!v.ok)&&(this.stats.aborted=!0,this.controller.abort())},_.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},_.load=function(v,x,E){var y=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var u=s(v,this.controller.signal),l=E.onProgress,b=v.responseType==="arraybuffer",m=b?"byteLength":"length";this.context=v,this.config=x,this.callbacks=E,this.request=this.fetchSetup(v,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),E.onTimeout(c,v,y.response)},x.timeout),self.fetch(this.request).then(function(w){if(y.response=y.loader=w,!w.ok){var I=w.status,L=w.statusText;throw new i(L||"fetch, bad network response",I,w)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(w.headers.get("Content-Length")||"0"),l&&Object(U.isFiniteNumber)(x.highWaterMark)?y.loadProgressively(w,c,v,x.highWaterMark,l):b?w.arrayBuffer():w.text()}).then(function(w){var I=y.response;self.clearTimeout(y.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=w[m];var L={url:I.url,data:w};l&&!Object(U.isFiniteNumber)(x.highWaterMark)&&l(c,v,w,I),E.onSuccess(L,c,v,I)}).catch(function(w){if(self.clearTimeout(y.requestTimeout),c.aborted)return;var I=w.code||0;E.onError({code:I,text:w.message},v,w.details)})},_.getCacheAge=function(){var v=null;if(this.response){var x=this.response.headers.get("age");v=x?parseFloat(x):null}return v},_.loadProgressively=function(v,x,E,y,c){y===void 0&&(y=0);var u=new M.default,l=v.body.getReader(),b=function m(){return l.read().then(function(w){if(w.done)return u.dataLength&&c(x,E,u.flush(),v),Promise.resolve(new ArrayBuffer(0));var I=w.value,L=I.length;return x.loaded+=L,L<y||u.dataLength?(u.push(I),u.dataLength>=y&&c(x,E,u.flush(),v)):c(x,E,I,v),m()}).catch(function(){return Promise.reject()})};return b()},t}();function s(t,_){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:_,headers:new self.Headers(a({},t.headers))};return t.rangeEnd&&g.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),g}function n(t,_){return new self.Request(t.url,_)}var i=function(t){H(_,t);function _(g,v,x){var E;return E=t.call(this,g)||this,E.code=void 0,E.details=void 0,E.code=v,E.details=x,E}return _}(F(Error));j.default=h},"./src/utils/imsc1-ttml-parser.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"IMSC1_CODEC",function(){return f}),A.d(j,"parseIMSC1",function(){return r});var U=A("./src/utils/mp4-tools.ts"),O=A("./src/utils/vttparser.ts"),M=A("./src/utils/vttcue.ts"),H=A("./src/demux/id3.ts"),F=A("./src/utils/timescale-conversion.ts"),e=A("./src/utils/webvtt-parser.ts");function C(){return C=Object.assign||function(y){for(var c=1;c<arguments.length;c++){var u=arguments[c];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(y[l]=u[l])}return y},C.apply(this,arguments)}var f="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(y,c,u,l,b){var m=Object(U.findBox)(new Uint8Array(y),["mdat"]);if(m.length===0){b(new Error("Could not parse IMSC1 mdat"));return}var w=m[0],I=Object(H.utf8ArrayToStr)(new Uint8Array(y,w.start,w.end-w.start)),L=Object(F.toTimescaleFromScale)(c,1,u);try{l(h(I,L))}catch(S){b(S)}}function h(y,c){var u=new DOMParser,l=u.parseFromString(y,"text/xml"),b=l.getElementsByTagName("tt")[0];if(!b)throw new Error("Invalid ttml");var m={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(m).reduce(function(B,R){return B[R]=b.getAttribute("ttp:"+R)||m[R],B},{}),I=b.getAttribute("xml:space")!=="preserve",L=n(s(b,"styling","style")),S=n(s(b,"layout","region")),D=s(b,"body","[begin]");return[].map.call(D,function(B){var R=i(B,I);if(!R||!B.hasAttribute("begin"))return null;var W=v(B.getAttribute("begin"),w),Y=v(B.getAttribute("dur"),w),se=v(B.getAttribute("end"),w);if(W===null)throw g(B);if(se===null){if(Y===null)throw g(B);se=W+Y}var ne=new M.default(W-c,se-c,R);ne.id=Object(e.generateCueId)(ne.startTime,ne.endTime,ne.text);var Se=S[B.getAttribute("region")],xe=L[B.getAttribute("style")];ne.position=10,ne.size=80;var we=t(Se,xe),Re=we.textAlign;if(Re){var Pe=a[Re];Pe&&(ne.lineAlign=Pe),ne.align=Re}return C(ne,we),ne}).filter(function(B){return B!==null})}function s(y,c,u){var l=y.getElementsByTagName(c)[0];return l?[].slice.call(l.querySelectorAll(u)):[]}function n(y){return y.reduce(function(c,u){var l=u.getAttribute("xml:id");return l&&(c[l]=u),c},{})}function i(y,c){return[].slice.call(y.childNodes).reduce(function(u,l,b){var m;return l.nodeName==="br"&&b?u+`
|
|
`:(m=l.childNodes)!==null&&m!==void 0&&m.length?i(l,c):c?u+l.textContent.trim().replace(/\s+/g," "):u+l.textContent},"")}function t(y,c){var u="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(b,m){var w=_(c,u,m)||_(y,u,m);return w&&(b[m]=w),b},{})}function _(y,c,u){return y.hasAttributeNS(c,u)?y.getAttributeNS(c,u):null}function g(y){return new Error("Could not parse ttml timestamp "+y)}function v(y,c){if(!y)return null;var u=Object(O.parseTimeStamp)(y);return u===null&&(p.test(y)?u=x(y,c):o.test(y)&&(u=E(y,c))),u}function x(y,c){var u=p.exec(y),l=(u[4]|0)+(u[5]|0)/c.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+l/c.frameRate}function E(y,c){var u=o.exec(y),l=Number(u[1]),b=u[2];switch(b){case"h":return l*3600;case"m":return l*60;case"ms":return l*1e3;case"f":return l/c.frameRate;case"t":return l/c.tickRate}return l}},"./src/utils/logger.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"enableLogs",function(){return e}),A.d(j,"logger",function(){return C});var U=function(){},O={trace:U,debug:U,log:U,warn:U,info:U,error:U},M=O;function H(f){var p=self.console[f];return p?p.bind(self.console,"["+f+"] >"):U}function F(f){for(var p=arguments.length,o=new Array(p>1?p-1:0),a=1;a<p;a++)o[a-1]=arguments[a];o.forEach(function(r){M[r]=f[r]?f[r].bind(f):H(r)})}function e(f){if(self.console&&f===!0||typeof f=="object"){F(f,"debug","log","info","warn","error");try{M.log()}catch(p){M=O}}else M=O}var C=M},"./src/utils/mediakeys-helper.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"KeySystems",function(){return U}),A.d(j,"requestMediaKeySystemAccess",function(){return O});var U;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(U||(U={}));var O=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"getMediaSource",function(){return U});function U(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"bin2str",function(){return F}),A.d(j,"readUint16",function(){return e}),A.d(j,"readUint32",function(){return C}),A.d(j,"writeUint32",function(){return f}),A.d(j,"findBox",function(){return p}),A.d(j,"parseSegmentIndex",function(){return o}),A.d(j,"parseInitSegment",function(){return a}),A.d(j,"getStartDTS",function(){return r}),A.d(j,"getDuration",function(){return h}),A.d(j,"computeRawDurationFromSamples",function(){return s}),A.d(j,"offsetStartDTS",function(){return n}),A.d(j,"segmentValidRange",function(){return i}),A.d(j,"appendUint8Array",function(){return t});var U=A("./src/utils/typed-array.ts"),O=A("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,H=[].push;function F(_){return String.fromCharCode.apply(null,_)}function e(_,g){"data"in _&&(g+=_.start,_=_.data);var v=_[g]<<8|_[g+1];return v<0?65536+v:v}function C(_,g){"data"in _&&(g+=_.start,_=_.data);var v=_[g]<<24|_[g+1]<<16|_[g+2]<<8|_[g+3];return v<0?4294967296+v:v}function f(_,g,v){"data"in _&&(g+=_.start,_=_.data),_[g]=v>>24,_[g+1]=v>>16&255,_[g+2]=v>>8&255,_[g+3]=v&255}function p(_,g){var v=[];if(!g.length)return v;var x,E,y;"data"in _?(x=_.data,E=_.start,y=_.end):(x=_,E=0,y=x.byteLength);for(var c=E;c<y;){var u=C(x,c),l=F(x.subarray(c+4,c+8)),b=u>1?c+u:y;if(l===g[0])if(g.length===1)v.push({data:x,start:c+8,end:b});else{var m=p({data:x,start:c+8,end:b},g.slice(1));m.length&&H.apply(v,m)}c=b}return v}function o(_){var g=p(_,["moov"]),v=g[0],x=v?v.end:null,E=p(_,["sidx"]);if(!E||!E[0])return null;var y=[],c=E[0],u=c.data[0],l=u===0?8:16,b=C(c,l);l+=4;var m=0,w=0;u===0?l+=8:l+=16,l+=2;var I=c.end+w,L=e(c,l);l+=2;for(var S=0;S<L;S++){var D=l,B=C(c,D);D+=4;var R=B&2147483647,W=(B&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=C(c,D);D+=4,y.push({referenceSize:R,subsegmentDuration:Y,info:{duration:Y/b,start:I,end:I+R-1}}),I+=R,D+=4,l=D}return{earliestPresentationTime:m,timescale:b,version:u,referencesCount:L,references:y,moovEndOffset:x}}function a(_){for(var g=[],v=p(_,["moov","trak"]),x=0;x<v.length;x++){var E=v[x],y=p(E,["tkhd"])[0];if(y){var c=y.data[y.start],u=c===0?12:20,l=C(y,u),b=p(E,["mdia","mdhd"])[0];if(b){c=b.data[b.start],u=c===0?12:20;var m=C(b,u),w=p(E,["mdia","hdlr"])[0];if(w){var I=F(w.data.subarray(w.start+8,w.start+12)),L={soun:O.ElementaryStreamTypes.AUDIO,vide:O.ElementaryStreamTypes.VIDEO}[I];if(L){var S=p(E,["mdia","minf","stbl","stsd"])[0],D=void 0;S&&(D=F(S.data.subarray(S.start+12,S.start+16))),g[l]={timescale:m,type:L},g[L]={timescale:m,id:l,codec:D}}}}}}var B=p(_,["moov","mvex","trex"]);return B.forEach(function(R){var W=C(R,4),Y=g[W];Y&&(Y.default={duration:C(R,12),flags:C(R,20)})}),g}function r(_,g){return p(g,["moof","traf"]).reduce(function(v,x){var E=p(x,["tfdt"])[0],y=E.data[E.start],c=p(x,["tfhd"]).reduce(function(u,l){var b=C(l,4),m=_[b];if(m){var w=C(E,4);y===1&&(w*=Math.pow(2,32),w+=C(E,8));var I=m.timescale||9e4,L=w/I;if(isFinite(L)&&(u===null||L<u))return L}return u},null);return c!==null&&isFinite(c)&&(v===null||c<v)?c:v},null)||0}function h(_,g){for(var v=0,x=0,E=0,y=p(_,["moof","traf"]),c=0;c<y.length;c++){var u=y[c],l=p(u,["tfhd"])[0],b=C(l,4),m=g[b];if(!m)continue;var w=m.default,I=C(l,0)|(w==null?void 0:w.flags),L=w==null?void 0:w.duration;I&8&&(I&2?L=C(l,12):L=C(l,8));for(var S=m.timescale||9e4,D=p(u,["trun"]),B=0;B<D.length;B++){if(L){var R=C(D[B],4);v=L*R}else v=s(D[B]);m.type===O.ElementaryStreamTypes.VIDEO?x+=v/S:m.type===O.ElementaryStreamTypes.AUDIO&&(E+=v/S)}}if(x===0&&E===0){var W=o(_);if(W!=null&&W.references)return W.references.reduce(function(Y,se){return Y+se.info.duration||0},0)}return x||E}function s(_){var g=C(_,0),v=8;g&1&&(v+=4),g&4&&(v+=4);for(var x=0,E=C(_,4),y=0;y<E;y++){if(g&256){var c=C(_,v);x+=c,v+=4}g&512&&(v+=4),g&1024&&(v+=4),g&2048&&(v+=4)}return x}function n(_,g,v){p(g,["moof","traf"]).forEach(function(x){p(x,["tfhd"]).forEach(function(E){var y=C(E,4),c=_[y];if(!c)return;var u=c.timescale||9e4;p(x,["tfdt"]).forEach(function(l){var b=l.data[l.start],m=C(l,4);if(b===0)f(l,4,m-v*u);else{m*=Math.pow(2,32),m+=C(l,8),m-=v*u,m=Math.max(m,0);var w=Math.floor(m/(M+1)),I=Math.floor(m%(M+1));f(l,4,w),f(l,8,I)}})})})}function i(_){var g={valid:null,remainder:null},v=p(_,["moof"]);if(v){if(v.length<2)return g.remainder=_,g}else return g;var x=v[v.length-1];return g.valid=Object(U.sliceUint8)(_,0,x.start-8),g.remainder=Object(U.sliceUint8)(_,x.start-8),g}function t(_,g){var v=new Uint8Array(_.length+g.length);return v.set(_),v.set(g,_.length),v}},"./src/utils/output-filter.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"default",function(){return U});var U=function(){function O(H,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=F}var M=O.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(F,e,C){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=e,this.screen=C,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},O}()},"./src/utils/texttrack-utils.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"sendAddTrackEvent",function(){return O}),A.d(j,"addCueToTrack",function(){return M}),A.d(j,"clearCurrentCues",function(){return H}),A.d(j,"removeCuesInRange",function(){return F}),A.d(j,"getCuesInRange",function(){return C});var U=A("./src/utils/logger.ts");function O(f,p){var o;try{o=new Event("addtrack")}catch(a){o=document.createEvent("Event"),o.initEvent("addtrack",!1,!1)}o.track=f,p.dispatchEvent(o)}function M(f,p){var o=f.mode;if(o==="disabled"&&(f.mode="hidden"),f.cues&&!f.cues.getCueById(p.id))try{if(f.addCue(p),!f.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(r){U.logger.debug("[texttrack-utils]: "+r);var a=new self.TextTrackCue(p.startTime,p.endTime,p.text);a.id=p.id,f.addCue(a)}o==="disabled"&&(f.mode=o)}function H(f){var p=f.mode;if(p==="disabled"&&(f.mode="hidden"),f.cues)for(var o=f.cues.length;o--;)f.removeCue(f.cues[o]);p==="disabled"&&(f.mode=p)}function F(f,p,o){var a=f.mode;if(a==="disabled"&&(f.mode="hidden"),f.cues&&f.cues.length>0)for(var r=C(f.cues,p,o),h=0;h<r.length;h++)f.removeCue(r[h]);a==="disabled"&&(f.mode=a)}function e(f,p){if(p<f[0].startTime)return 0;var o=f.length-1;if(p>f[o].endTime)return-1;for(var a=0,r=o;a<=r;){var h=Math.floor((r+a)/2);if(p<f[h].startTime)r=h-1;else if(p>f[h].startTime&&a<o)a=h+1;else return h}return f[a].startTime-p<p-f[r].startTime?a:r}function C(f,p,o){var a=[],r=e(f,p);if(r>-1)for(var h=r,s=f.length;h<s;h++){var n=f[h];if(n.startTime>=p&&n.endTime<=o)a.push(n);else if(n.startTime>o)return a}return a}},"./src/utils/time-ranges.ts":function(q,j,A){"use strict";A.r(j);var U={toString:function(M){for(var H="",F=M.length,e=0;e<F;e++)H+="["+M.start(e).toFixed(3)+","+M.end(e).toFixed(3)+"]";return H}};j.default=U},"./src/utils/timescale-conversion.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"toTimescaleFromBase",function(){return O}),A.d(j,"toTimescaleFromScale",function(){return M}),A.d(j,"toMsFromMpegTsClock",function(){return H}),A.d(j,"toMpegTsClockFromTimescale",function(){return F});var U=9e4;function O(e,C,f,p){f===void 0&&(f=1),p===void 0&&(p=!1);var o=e*C*f;return p?Math.round(o):o}function M(e,C,f,p){return f===void 0&&(f=1),p===void 0&&(p=!1),O(e,C,1/f,p)}function H(e,C){return C===void 0&&(C=!1),O(e,1e3,1/U,C)}function F(e,C){return C===void 0&&(C=1),O(e,U,1/C)}},"./src/utils/typed-array.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"sliceUint8",function(){return U});function U(O,M,H){return Uint8Array.prototype.slice?O.slice(M,H):new Uint8Array(Array.prototype.slice.call(O,M,H))}},"./src/utils/vttcue.ts":function(q,j,A){"use strict";A.r(j),j.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var U=["","lr","rl"],O=["start","middle","end","left","right"];function M(f,p){if(typeof p!="string")return!1;if(!Array.isArray(f))return!1;var o=p.toLowerCase();return~f.indexOf(o)?o:!1}function H(f){return M(U,f)}function F(f){return M(O,f)}function e(f){for(var p=arguments.length,o=new Array(p>1?p-1:0),a=1;a<p;a++)o[a-1]=arguments[a];for(var r=1;r<arguments.length;r++){var h=arguments[r];for(var s in h)f[s]=h[s]}return f}function C(f,p,o){var a=this,r={enumerable:!0};a.hasBeenReset=!1;var h="",s=!1,n=f,i=p,t=o,_=null,g="",v=!0,x="auto",E="start",y=50,c="middle",u=50,l="middle";Object.defineProperty(a,"id",e({},r,{get:function(){return h},set:function(m){h=""+m}})),Object.defineProperty(a,"pauseOnExit",e({},r,{get:function(){return s},set:function(m){s=!!m}})),Object.defineProperty(a,"startTime",e({},r,{get:function(){return n},set:function(m){if(typeof m!="number")throw new TypeError("Start time must be set to a number.");n=m,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",e({},r,{get:function(){return i},set:function(m){if(typeof m!="number")throw new TypeError("End time must be set to a number.");i=m,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},r,{get:function(){return t},set:function(m){t=""+m,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},r,{get:function(){return _},set:function(m){_=m,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},r,{get:function(){return g},set:function(m){var w=H(m);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",e({},r,{get:function(){return v},set:function(m){v=!!m,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},r,{get:function(){return x},set:function(m){if(typeof m!="number"&&m!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");x=m,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},r,{get:function(){return E},set:function(m){var w=F(m);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");E=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",e({},r,{get:function(){return y},set:function(m){if(m<0||m>100)throw new Error("Position must be between 0 and 100.");y=m,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},r,{get:function(){return c},set:function(m){var w=F(m);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");c=w,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",e({},r,{get:function(){return u},set:function(m){if(m<0||m>100)throw new Error("Size must be between 0 and 100.");u=m,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},r,{get:function(){return l},set:function(m){var w=F(m);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");l=w,this.hasBeenReset=!0}})),a.displayState=void 0}return C.prototype.getCueAsHTML=function(){var f=self.WebVTT;return f.convertCueToDOMTree(self,this.text)},C}()},"./src/utils/vttparser.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"parseTimeStamp",function(){return M}),A.d(j,"fixLineBreaks",function(){return p}),A.d(j,"VTTParser",function(){return o});var U=A("./src/utils/vttcue.ts"),O=function(){function a(){}var r=a.prototype;return r.decode=function(s,n){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function M(a){function r(s,n,i,t){return(s|0)*3600+(n|0)*60+(i|0)+parseFloat(t||0)}var h=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?r(h[2],h[3],0,h[4]):r(h[1],h[2],h[3],h[4]):null}var H=function(){function a(){this.values=Object.create(null)}var r=a.prototype;return r.set=function(s,n){!this.get(s)&&n!==""&&(this.values[s]=n)},r.get=function(s,n,i){return i?this.has(s)?this.values[s]:n[i]:this.has(s)?this.values[s]:n},r.has=function(s){return s in this.values},r.alt=function(s,n,i){for(var t=0;t<i.length;++t)if(n===i[t]){this.set(s,n);break}},r.integer=function(s,n){/^-?\d+$/.test(n)&&this.set(s,parseInt(n,10))},r.percent=function(s,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var i=parseFloat(n);if(i>=0&&i<=100)return this.set(s,i),!0}return!1},a}();function F(a,r,h,s){var n=s?a.split(s):[a];for(var i in n){if(typeof n[i]!="string")continue;var t=n[i].split(h);if(t.length!==2)continue;var _=t[0],g=t[1];r(_,g)}}var e=new U.default(0,0,""),C=e.align==="middle"?"middle":"center";function f(a,r,h){var s=a;function n(){var _=M(a);if(_===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),_}function i(_,g){var v=new H;F(_,function(y,c){var u;switch(y){case"region":for(var l=h.length-1;l>=0;l--)if(h[l].id===c){v.set(y,h[l].region);break}break;case"vertical":v.alt(y,c,["rl","lr"]);break;case"line":u=c.split(","),v.integer(y,u[0]),v.percent(y,u[0])&&v.set("snapToLines",!1),v.alt(y,u[0],["auto"]),u.length===2&&v.alt("lineAlign",u[1],["start",C,"end"]);break;case"position":u=c.split(","),v.percent(y,u[0]),u.length===2&&v.alt("positionAlign",u[1],["start",C,"end","line-left","line-right","auto"]);break;case"size":v.percent(y,c);break;case"align":v.alt(y,c,["start",C,"end","left","right"]);break}},/:/,/\s/),g.region=v.get("region",null),g.vertical=v.get("vertical","");var x=v.get("line","auto");x==="auto"&&e.line===-1&&(x=-1),g.line=x,g.lineAlign=v.get("lineAlign","start"),g.snapToLines=v.get("snapToLines",!0),g.size=v.get("size",100),g.align=v.get("align",C);var E=v.get("position","auto");E==="auto"&&e.position===50&&(E=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=E}function t(){a=a.replace(/^\s+/,"")}if(t(),r.startTime=n(),t(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),t(),r.endTime=n(),t(),i(a,r)}function p(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var o=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new O,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=a.prototype;return r.parse=function(s){var n=this;s&&(n.buffer+=n.decoder.decode(s,{stream:!0}));function i(){var E=n.buffer,y=0;for(E=p(E);y<E.length&&E[y]!=="\r"&&E[y]!==`
|
|
`;)++y;var c=E.substr(0,y);return E[y]==="\r"&&++y,E[y]===`
|
|
`&&++y,n.buffer=E.substr(y),c}function t(E){F(E,function(y,c){},/:/)}try{var _="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;_=i();var g=_.match(/^()?WEBVTT([ \t].*)?$/);if(!g||!g[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var v=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;v?v=!1:_=i();switch(n.state){case"HEADER":/:/.test(_)?t(_):_||(n.state="ID");continue;case"NOTE":_||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(_)){n.state="NOTE";break}if(!_)continue;if(n.cue=new U.default(0,0,""),n.state="CUE",_.indexOf("-->")===-1){n.cue.id=_;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{f(_,n.cue,n.regionList)}catch(E){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var x=_.indexOf("-->")!==-1;if(!_||x&&(v=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
|
|
`),n.cue.text+=_}continue;case"BADCUE":_||(n.state="ID")}}}catch(E){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
|
|
|
|
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){s.onparsingerror&&s.onparsingerror(n)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(q,j,A){"use strict";A.r(j),A.d(j,"generateCueId",function(){return o}),A.d(j,"parseWebVTT",function(){return r});var U=A("./src/polyfills/number.ts"),O=A("./src/utils/vttparser.ts"),M=A("./src/demux/id3.ts"),H=A("./src/utils/timescale-conversion.ts"),F=A("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,C=function(s,n,i){return i===void 0&&(i=0),s.substr(i,n.length)===n},f=function(s){var n=parseInt(s.substr(-3)),i=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),_=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(U.isFiniteNumber)(n)||!Object(U.isFiniteNumber)(i)||!Object(U.isFiniteNumber)(t)||!Object(U.isFiniteNumber)(_))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return n+=1e3*i,n+=60*1e3*t,n+=60*60*1e3*_,n},p=function(s){for(var n=5381,i=s.length;i;)n=n*33^s.charCodeAt(--i);return(n>>>0).toString()};function o(h,s,n){return p(h.toString())+p(s.toString())+p(n)}var a=function(s,n,i){var t=s[n],_=s[t.prevCC];if(!_||!_.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(g=_)!==null&&g!==void 0&&g.new;){var g;s.ccOffset+=t.start-_.start,t.new=!1,t=_,_=s[t.prevCC]}s.presentationOffset=i};function r(h,s,n,i,t,_,g,v){var x=new O.VTTParser,E=Object(M.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(e,`
|
|
`).split(`
|
|
`),y=[],c=Object(H.toMpegTsClockFromTimescale)(s,n),u="00:00.000",l=0,b=0,m,w=!0,I=!1;x.oncue=function(L){var S=i[t],D=i.ccOffset,B=(l-c)/9e4;if(S!=null&&S.new&&(b!==void 0?D=i.ccOffset=S.start:a(i,t,B)),B&&(D=B-i.presentationOffset),I){var R=L.endTime-L.startTime,W=Object(F.normalizePts)((L.startTime+D-b)*9e4,_*9e4)/9e4;L.startTime=W,L.endTime=W+R}var Y=L.text.trim();L.text=decodeURIComponent(encodeURIComponent(Y)),L.id||(L.id=o(L.startTime,L.endTime,Y)),L.endTime>0&&y.push(L)},x.onparsingerror=function(L){m=L},x.onflush=function(){if(m){v(m);return}g(y)},E.forEach(function(L){if(w)if(C(L,"X-TIMESTAMP-MAP=")){w=!1,I=!0,L.substr(16).split(",").forEach(function(S){C(S,"LOCAL:")?u=S.substr(6):C(S,"MPEGTS:")&&(l=parseInt(S.substr(7)))});try{b=f(u)/1e3}catch(S){I=!1,m=S}return}else L===""&&(w=!1);x.parse(L+`
|
|
`)}),x.flush()}},"./src/utils/xhr-loader.ts":function(q,j,A){"use strict";A.r(j);var U=A("./src/utils/logger.ts"),O=A("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,H=function(){function F(C){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=C?C.xhrSetup:null,this.stats=new O.LoadStats,this.retryDelay=0}var e=F.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var f=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),f&&(f.onreadystatechange=null,f.onprogress=null,f.readyState!==4&&(this.stats.aborted=!0,f.abort()))},e.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(f,p,o){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=f,this.config=p,this.callbacks=o,this.retryDelay=p.retryDelay,this.loadInternal()},e.loadInternal=function(){var f=this.config,p=this.context;if(!f)return;var o=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var r=this.xhrSetup;try{if(r)try{r(o,p.url)}catch(n){o.open("GET",p.url,!0),r(o,p.url)}o.readyState||o.open("GET",p.url,!0);var h=this.context.headers;if(h)for(var s in h)o.setRequestHeader(s,h[s])}catch(n){this.callbacks.onError({code:o.status,text:n.message},p,o);return}p.rangeEnd&&o.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout),o.send()},e.readystatechange=function(){var f=this.context,p=this.loader,o=this.stats;if(!f||!p)return;var a=p.readyState,r=this.config;if(o.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),o.loading.first===0&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),a===4){p.onreadystatechange=null,p.onprogress=null;var h=p.status;if(h>=200&&h<300){o.loading.end=Math.max(self.performance.now(),o.loading.first);var s,n;if(f.responseType==="arraybuffer"?(s=p.response,n=s.byteLength):(s=p.responseText,n=s.length),o.loaded=o.total=n,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(o,f,s,p),!this.callbacks)return;var t={url:p.responseURL,data:s};this.callbacks.onSuccess(t,o,f,p)}else o.retry>=r.maxRetry||h>=400&&h<499?(U.logger.error(h+" while loading "+f.url),this.callbacks.onError({code:h,text:p.statusText},f,p)):(U.logger.warn(h+" while loading "+f.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,r.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},e.loadtimeout=function(){U.logger.warn("timeout while loading "+this.context.url);var f=this.callbacks;f&&(this.abortInternal(),f.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(f){var p=this.stats;p.loaded=f.loaded,f.lengthComputable&&(p.total=f.total)},e.getCacheAge=function(){var f=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");f=p?parseFloat(p):null}return f},F}();j.default=H}}).default})},vHTk:function(st,ve,z){st.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|