(window.webpackJsonp=window.webpackJsonp||[]).push([[214,3,5,7,8,19],{"++UQ":function(nt,Xe,V){},"+NIl":function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";ce.defineMode("stex",function(ie,W){"use strict";function C(o,r){o.cmdState.push(r)}function D(o){return o.cmdState.length>0?o.cmdState[o.cmdState.length-1]:null}function T(o){var r=o.cmdState.pop();r&&r.closeBracket()}function A(o){for(var r=o.cmdState,l=r.length-1;l>=0;l--){var a=r[l];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function O(o,r,l){return function(){this.name=o,this.bracketNo=0,this.style=r,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var f={};f.importmodule=O("importmodule","tag",["string","builtin"]),f.documentclass=O("documentclass","tag",["","atom"]),f.usepackage=O("usepackage","tag",["atom"]),f.begin=O("begin","tag",["atom"]),f.end=O("end","tag",["atom"]),f.label=O("label","tag",["atom"]),f.ref=O("ref","tag",["atom"]),f.eqref=O("eqref","tag",["atom"]),f.cite=O("cite","tag",["atom"]),f.bibitem=O("bibitem","tag",["atom"]),f.Bibitem=O("Bibitem","tag",["atom"]),f.RBibitem=O("RBibitem","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(o,r){o.f=r}function c(o,r){var l;if(o.match(/^\\[a-zA-Z@]+/)){var a=o.current().slice(1);return l=f.hasOwnProperty(a)?f[a]:f.DEFAULT,l=new l,C(r,l),p(r,n),l.style}if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/\\]/))return"tag";if(o.match("\\["))return p(r,function(t,d){return s(t,d,"\\]")}),"keyword";if(o.match("\\("))return p(r,function(t,d){return s(t,d,"\\)")}),"keyword";if(o.match("$$"))return p(r,function(t,d){return s(t,d,"$$")}),"keyword";if(o.match("$"))return p(r,function(t,d){return s(t,d,"$")}),"keyword";var i=o.next();if(i=="%")return o.skipToEnd(),"comment";if(i=="}"||i=="]"){if(l=D(r),l)l.closeBracket(i),p(r,n);else return"error";return"bracket"}else return i=="{"||i=="["?(l=f.DEFAULT,l=new l,C(r,l),"bracket"):/\d/.test(i)?(o.eatWhile(/[\w.%]/),"atom"):(o.eatWhile(/[\w\-_]/),l=A(r),l.name=="begin"&&(l.argument=o.current()),l.styleIdentifier())}function s(o,r,l){if(o.eatSpace())return null;if(l&&o.match(l))return p(r,c),"keyword";if(o.match(/^\\[a-zA-Z@]+/))return"tag";if(o.match(/^[a-zA-Z]+/))return"variable-2";if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/]/))return"tag";if(o.match(/^[\^_&]/))return"tag";if(o.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(o.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=o.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(o.skipToEnd(),"comment"):"error"}function n(o,r){var l=o.peek(),a;return l=="{"||l=="["?(a=D(r),a.openBracket(l),o.eat(l),p(r,c),"bracket"):/[ \t\r]/.test(l)?(o.eat(l),null):(p(r,c),T(r),c(o,r))}return{startState:function(){var o=W.inMathMode?function(r,l){return s(r,l)}:c;return{cmdState:[],f:o}},copyState:function(o){return{cmdState:o.cmdState.slice(),f:o.f}},token:function(o,r){return r.f(o,r)},blankLine:function(o){o.f=c,o.cmdState.length=0},lineComment:"%"}}),ce.defineMIME("text/x-stex","stex"),ce.defineMIME("text/x-latex","stex")})},"+QRC":function(nt,Xe,V){"use strict";var ce=V("E9nw"),ie={"text/plain":"Text","text/html":"Url",default:"Text"},W="Copy to clipboard: #{key}, Enter";function C(T){var A=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return T.replace(/#{\s*key\s*}/g,A)}function D(T,A){var O,f,p,c,s,n,o=!1;A||(A={}),O=A.debug||!1;try{p=ce(),c=document.createRange(),s=document.getSelection(),n=document.createElement("span"),n.textContent=T,n.style.all="unset",n.style.position="fixed",n.style.top=0,n.style.clip="rect(0, 0, 0, 0)",n.style.whiteSpace="pre",n.style.webkitUserSelect="text",n.style.MozUserSelect="text",n.style.msUserSelect="text",n.style.userSelect="text",n.addEventListener("copy",function(l){if(l.stopPropagation(),A.format)if(l.preventDefault(),typeof l.clipboardData=="undefined"){O&&console.warn("unable to use e.clipboardData"),O&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=ie[A.format]||ie.default;window.clipboardData.setData(a,T)}else l.clipboardData.clearData(),l.clipboardData.setData(A.format,T);A.onCopy&&(l.preventDefault(),A.onCopy(l.clipboardData))}),document.body.appendChild(n),c.selectNodeContents(n),s.addRange(c);var r=document.execCommand("copy");if(!r)throw new Error("copy command was unsuccessful");o=!0}catch(l){O&&console.error("unable to copy using execCommand: ",l),O&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(A.format||"text",T),A.onCopy&&A.onCopy(window.clipboardData),o=!0}catch(a){O&&console.error("unable to copy using clipboardData: ",a),O&&console.error("falling back to prompt"),f=C("message"in A?A.message:W),window.prompt(f,T)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(c):s.removeAllRanges()),n&&document.body.removeChild(n),p()}return o}nt.exports=D},"+aKw":function(nt,Xe,V){"use strict";var ce=V("tJVT"),ie=V("cDcd"),W=V.n(ie),C=function(A){return String(A).length===1?"0".concat(A):A},D=function(A){var O=A.className,f=O===void 0?"":O,p=A.onChange,c=A.defaultValue,s=c===void 0?0:c,n=Object(ie.useState)(s),o=Object(ce.a)(n,2),r=o[0],l=o[1];Object(ie.useEffect)(function(){var d=setTimeout(function(){l(r+1e3)},1e3);return p(r+1e3),function(){clearInterval(d)}},[r]);var a=parseInt(r/(60*6e4))||"00",i=parseInt(r%(60*6e4)/6e4)||"00",t=parseInt(r%6e4/1e3)||"00";return W.a.createElement("div",{className:f},C(a),":",C(i),":",C(t))};Xe.a=D},"+ua5":function(nt,Xe,V){},"07cG":function(nt,Xe,V){nt.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(nt,Xe){var V=arguments[3],ce=arguments[4],ie=arguments[5],W=JSON.stringify;nt.exports=function(C,D){for(var T,A=Object.keys(ie),O=0,f=A.length;O")):null:E.match("--")?w(r("comment","-->")):E.match("DOCTYPE",!0,!0)?(E.eatWhile(/[\w\._\-]/),w(l(1))):null:E.eat("?")?(E.eatWhile(/[\w\._\-]/),S.tokenize=r("meta","?>"),"meta"):(p=E.eat("/")?"closeTag":"openTag",S.tokenize=n,"tag bracket");if(R=="&"){var N;return E.eat("#")?E.eat("x")?N=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";"):N=E.eatWhile(/[\d]/)&&E.eat(";"):N=E.eatWhile(/[\w\.\-:]/)&&E.eat(";"),N?"atom":"error"}else return E.eatWhile(/[^&<]/),null}s.isInText=!0;function n(E,S){var w=E.next();if(w==">"||w=="/"&&E.eat(">"))return S.tokenize=s,p=w==">"?"endTag":"selfcloseTag","tag bracket";if(w=="=")return p="equals",null;if(w=="<"){S.tokenize=s,S.state=d,S.tagName=S.tagStart=null;var R=S.tokenize(E,S);return R?R+" tag error":"tag error"}else return/[\'\"]/.test(w)?(S.tokenize=o(w),S.stringStartCol=E.column(),S.tokenize(E,S)):(E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(E){var S=function(w,R){for(;!w.eol();)if(w.next()==E){R.tokenize=n;break}return"string"};return S.isInAttribute=!0,S}function r(E,S){return function(w,R){for(;!w.eol();){if(w.match(S)){R.tokenize=s;break}w.next()}return E}}function l(E){return function(S,w){for(var R;(R=S.next())!=null;){if(R=="<")return w.tokenize=l(E+1),w.tokenize(S,w);if(R==">")if(E==1){w.tokenize=s;break}else return w.tokenize=l(E-1),w.tokenize(S,w)}return"meta"}}function a(E,S,w){this.prev=E.context,this.tagName=S,this.indent=E.indented,this.startOfLine=w,(A.doNotIndent.hasOwnProperty(S)||E.context&&E.context.noIndent)&&(this.noIndent=!0)}function i(E){E.context&&(E.context=E.context.prev)}function t(E,S){for(var w;;){if(!E.context)return;if(w=E.context.tagName,!A.contextGrabbers.hasOwnProperty(w)||!A.contextGrabbers[w].hasOwnProperty(S))return;i(E)}}function d(E,S,w){return E=="openTag"?(w.tagStart=S.column(),v):E=="closeTag"?y:d}function v(E,S,w){return E=="word"?(w.tagName=S.current(),c="tag",m):A.allowMissingTagName&&E=="endTag"?(c="tag bracket",m(E,S,w)):(c="error",v)}function y(E,S,w){if(E=="word"){var R=S.current();return w.context&&w.context.tagName!=R&&A.implicitlyClosed.hasOwnProperty(w.context.tagName)&&i(w),w.context&&w.context.tagName==R||A.matchClosing===!1?(c="tag",b):(c="tag error",g)}else return A.allowMissingTagName&&E=="endTag"?(c="tag bracket",b(E,S,w)):(c="error",g)}function b(E,S,w){return E!="endTag"?(c="error",b):(i(w),d)}function g(E,S,w){return c="error",b(E,S,w)}function m(E,S,w){if(E=="word")return c="attribute",_;if(E=="endTag"||E=="selfcloseTag"){var R=w.tagName,N=w.tagStart;return w.tagName=w.tagStart=null,E=="selfcloseTag"||A.autoSelfClosers.hasOwnProperty(R)?t(w,R):(t(w,R),w.context=new a(w,R,N==w.indented)),d}return c="error",m}function _(E,S,w){return E=="equals"?x:(A.allowMissing||(c="error"),m(E,S,w))}function x(E,S,w){return E=="string"?h:E=="word"&&A.allowUnquoted?(c="string",m):(c="error",m(E,S,w))}function h(E,S,w){return E=="string"?h:m(E,S,w)}return{startState:function(E){var S={tokenize:s,state:d,indented:E||0,tagName:null,tagStart:null,context:null};return E!=null&&(S.baseIndent=E),S},token:function(E,S){if(!S.tagName&&E.sol()&&(S.indented=E.indentation()),E.eatSpace())return null;p=null;var w=S.tokenize(E,S);return(w||p)&&w!="comment"&&(c=null,S.state=S.state(p||w,E,S),c&&(w=c=="error"?w+" error":c)),w},indent:function(E,S,w){var R=E.context;if(E.tokenize.isInAttribute)return E.tagStart==E.indented?E.stringStartCol+1:E.indented+T;if(R&&R.noIndent)return ce.Pass;if(E.tokenize!=n&&E.tokenize!=s)return w?w.match(/^(\s*)/)[0].length:0;if(E.tagName)return A.multilineTagIndentPastTag!==!1?E.tagStart+E.tagName.length+2:E.tagStart+T*(A.multilineTagIndentFactor||1);if(A.alignCDATA&&/$/,blockCommentStart:"",configuration:A.htmlMode?"html":"xml",helperType:A.htmlMode?"html":"xml",skipAttribute:function(E){E.state==x&&(E.state=m)},xmlCurrentTag:function(E){return E.tagName?{name:E.tagName,close:E.type=="closeTag"}:null},xmlCurrentContext:function(E){for(var S=[],w=E.context;w;w=w.prev)w.tagName&&S.push(w.tagName);return S.reverse()}}}),ce.defineMIME("text/xml","xml"),ce.defineMIME("application/xml","xml"),ce.mimeModes.hasOwnProperty("text/html")||ce.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(nt,Xe,V){"use strict";V.d(Xe,"d",function(){return ee}),V.d(Xe,"b",function(){return Ve}),V.d(Xe,"c",function(){return _t}),V.d(Xe,"a",function(){return Bt});var ce=V("VTBJ"),ie=V("1OyB"),W=V("vuIU"),C=V("JX7q"),D=V("Ji7U"),T=V("LK+K"),A=V("cDcd"),O=V("I8Z2"),f=V("BGR+"),p=V("wx14"),c=V("rePB"),s=V("4IlW"),n=V("2GS6"),o=V("Gytx"),r=V.n(o),l=V("TSYQ"),a=V.n(l),i=V("U8pU"),t=V("ODXe"),d=/iPhone/i,v=/iPod/i,y=/iPad/i,b=/\bAndroid(?:.+)Mobile\b/i,g=/Android/i,m=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,x=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,E=/BlackBerry/i,S=/BB10/i,w=/Opera Mini/i,R=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function F(At,pt){return At.test(pt)}function z(At){var pt=At||(typeof navigator!="undefined"?navigator.userAgent:""),gt=pt.split("[FBAN");if(typeof gt[1]!="undefined"){var rt=gt,Oe=Object(t.a)(rt,1);pt=Oe[0]}if(gt=pt.split("Twitter"),typeof gt[1]!="undefined"){var ze=gt,vt=Object(t.a)(ze,1);pt=vt[0]}var st={apple:{phone:F(d,pt)&&!F(x,pt),ipod:F(v,pt),tablet:!F(d,pt)&&F(y,pt)&&!F(x,pt),device:(F(d,pt)||F(v,pt)||F(y,pt))&&!F(x,pt)},amazon:{phone:F(m,pt),tablet:!F(m,pt)&&F(_,pt),device:F(m,pt)||F(_,pt)},android:{phone:!F(x,pt)&&F(m,pt)||!F(x,pt)&&F(b,pt),tablet:!F(x,pt)&&!F(m,pt)&&!F(b,pt)&&(F(_,pt)||F(g,pt)),device:!F(x,pt)&&(F(m,pt)||F(_,pt)||F(b,pt)||F(g,pt))||F(/\bokhttp\b/i,pt)},windows:{phone:F(x,pt),tablet:F(h,pt),device:F(x,pt)||F(h,pt)},other:{blackberry:F(E,pt),blackberry10:F(S,pt),opera:F(w,pt),firefox:F(N,pt),chrome:F(R,pt),device:F(E,pt)||F(S,pt)||F(w,pt)||F(N,pt)||F(R,pt)},any:null,phone:null,tablet:null};return st.any=st.apple.device||st.android.device||st.windows.device||st.other.device,st.phone=st.apple.phone||st.android.phone||st.windows.phone,st.tablet=st.apple.tablet||st.android.tablet||st.windows.tablet,st}var q=Object(ce.a)(Object(ce.a)({},z()),{},{isMobile:z}),B=q;function M(){}function G(At,pt,gt){var rt=pt||"";return At.key||"".concat(rt,"item_").concat(gt)}function J(At){return"".concat(At,"-menu-")}function K(At,pt){var gt=-1;A.Children.forEach(At,function(rt){gt+=1,rt&&rt.type&&rt.type.isMenuItemGroup?A.Children.forEach(rt.props.children,function(Oe){gt+=1,pt(Oe,gt)}):pt(rt,gt)})}function Z(At,pt,gt){if(!At||gt.find)return;A.Children.forEach(At,function(rt){if(rt){var Oe=rt.type;if(!Oe||!(Oe.isSubMenu||Oe.isMenuItem||Oe.isMenuItemGroup))return;pt.indexOf(rt.key)!==-1?gt.find=!0:rt.props.children&&Z(rt.props.children,pt,gt)}})}var le=["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"],de=function(pt){var gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rt=pt&&typeof pt.getBoundingClientRect=="function"&&pt.getBoundingClientRect().width;if(rt){if(gt){var Oe=getComputedStyle(pt),ze=Oe.marginLeft,vt=Oe.marginRight;rt+=+ze.replace("px","")+ +vt.replace("px","")}rt=+rt.toFixed(6)}return rt||0},Te=function(pt,gt,rt){pt&&Object(i.a)(pt.style)==="object"&&(pt.style[gt]=rt)},we=function(){return B.any},Ie=V("KQm4"),_e=V("Ff2n"),ye=V("faye"),Ke=V("bdgK"),Me=V("uciX"),Fe=V("8XRh"),Ge={adjustX:1,adjustY:1},Ee={topLeft:{points:["bl","tl"],overflow:Ge,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ge,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Ge,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Ge,offset:[4,0]}},me={topLeft:{points:["bl","tl"],overflow:Ge,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ge,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Ge,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Ge,offset:[4,0]}},We=Ee,He=0,it={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},re=function(pt,gt,rt){var Oe=J(gt),ze=pt.getState();pt.setState({defaultActiveFirst:Object(ce.a)(Object(ce.a)({},ze.defaultActiveFirst),{},Object(c.a)({},Oe,rt))})},P=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(rt){var Oe;Object(ie.a)(this,gt),Oe=pt.call(this,rt),Oe.onDestroy=function(Ze){Oe.props.onDestroy(Ze)},Oe.onKeyDown=function(Ze){var mt=Ze.keyCode,Lt=Oe.menuInstance,Mt=Oe.props,$t=Mt.isOpen,Re=Mt.store;if(mt===s.a.ENTER)return Oe.onTitleClick(Ze),re(Re,Oe.props.eventKey,!0),!0;if(mt===s.a.RIGHT)return $t?Lt.onKeyDown(Ze):(Oe.triggerOpenChange(!0),re(Re,Oe.props.eventKey,!0)),!0;if(mt===s.a.LEFT){var ve;if($t)ve=Lt.onKeyDown(Ze);else return;return ve||(Oe.triggerOpenChange(!1),ve=!0),ve}return $t&&(mt===s.a.UP||mt===s.a.DOWN)?Lt.onKeyDown(Ze):void 0},Oe.onOpenChange=function(Ze){Oe.props.onOpenChange(Ze)},Oe.onPopupVisibleChange=function(Ze){Oe.triggerOpenChange(Ze,Ze?"mouseenter":"mouseleave")},Oe.onMouseEnter=function(Ze){var mt=Oe.props,Lt=mt.eventKey,Mt=mt.onMouseEnter,$t=mt.store;re($t,Oe.props.eventKey,!1),Mt({key:Lt,domEvent:Ze})},Oe.onMouseLeave=function(Ze){var mt=Oe.props,Lt=mt.parentMenu,Mt=mt.eventKey,$t=mt.onMouseLeave;Lt.subMenuInstance=Object(C.a)(Oe),$t({key:Mt,domEvent:Ze})},Oe.onTitleMouseEnter=function(Ze){var mt=Oe.props,Lt=mt.eventKey,Mt=mt.onItemHover,$t=mt.onTitleMouseEnter;Mt({key:Lt,hover:!0}),$t({key:Lt,domEvent:Ze})},Oe.onTitleMouseLeave=function(Ze){var mt=Oe.props,Lt=mt.parentMenu,Mt=mt.eventKey,$t=mt.onItemHover,Re=mt.onTitleMouseLeave;Lt.subMenuInstance=Object(C.a)(Oe),$t({key:Mt,hover:!1}),Re({key:Mt,domEvent:Ze})},Oe.onTitleClick=function(Ze){var mt=Object(C.a)(Oe),Lt=mt.props;if(Lt.onTitleClick({key:Lt.eventKey,domEvent:Ze}),Lt.triggerSubMenuAction==="hover")return;Oe.triggerOpenChange(!Lt.isOpen,"click"),re(Lt.store,Oe.props.eventKey,!1)},Oe.onSubMenuClick=function(Ze){typeof Oe.props.onClick=="function"&&Oe.props.onClick(Oe.addKeyPath(Ze))},Oe.onSelect=function(Ze){Oe.props.onSelect(Ze)},Oe.onDeselect=function(Ze){Oe.props.onDeselect(Ze)},Oe.getPrefixCls=function(){return"".concat(Oe.props.rootPrefixCls,"-submenu")},Oe.getActiveClassName=function(){return"".concat(Oe.getPrefixCls(),"-active")},Oe.getDisabledClassName=function(){return"".concat(Oe.getPrefixCls(),"-disabled")},Oe.getSelectedClassName=function(){return"".concat(Oe.getPrefixCls(),"-selected")},Oe.getOpenClassName=function(){return"".concat(Oe.props.rootPrefixCls,"-submenu-open")},Oe.saveMenuInstance=function(Ze){Oe.menuInstance=Ze},Oe.addKeyPath=function(Ze){return Object(ce.a)(Object(ce.a)({},Ze),{},{keyPath:(Ze.keyPath||[]).concat(Oe.props.eventKey)})},Oe.triggerOpenChange=function(Ze,mt){var Lt=Oe.props.eventKey,Mt=function(){Oe.onOpenChange({key:Lt,item:Object(C.a)(Oe),trigger:mt,open:Ze})};mt==="mouseenter"?Oe.mouseenterTimeout=setTimeout(function(){Mt()},0):Mt()},Oe.isChildrenSelected=function(){var Ze={find:!1};return Z(Oe.props.children,Oe.props.selectedKeys,Ze),Ze.find},Oe.isOpen=function(){return Oe.props.openKeys.indexOf(Oe.props.eventKey)!==-1},Oe.adjustWidth=function(){if(!Oe.subMenuTitle||!Oe.menuInstance)return;var Ze=ye.findDOMNode(Oe.menuInstance);if(Ze.offsetWidth>=Oe.subMenuTitle.offsetWidth)return;Ze.style.minWidth="".concat(Oe.subMenuTitle.offsetWidth,"px")},Oe.saveSubMenuTitle=function(Ze){Oe.subMenuTitle=Ze},Oe.getBaseProps=function(){var Ze=Object(C.a)(Oe),mt=Ze.props;return{mode:mt.mode==="horizontal"?"vertical":mt.mode,visible:Oe.props.isOpen,level:mt.level+1,inlineIndent:mt.inlineIndent,focusable:!1,onClick:Oe.onSubMenuClick,onSelect:Oe.onSelect,onDeselect:Oe.onDeselect,onDestroy:Oe.onDestroy,selectedKeys:mt.selectedKeys,eventKey:"".concat(mt.eventKey,"-menu-"),openKeys:mt.openKeys,motion:mt.motion,onOpenChange:Oe.onOpenChange,subMenuOpenDelay:mt.subMenuOpenDelay,parentMenu:Object(C.a)(Oe),subMenuCloseDelay:mt.subMenuCloseDelay,forceSubMenuRender:mt.forceSubMenuRender,triggerSubMenuAction:mt.triggerSubMenuAction,builtinPlacements:mt.builtinPlacements,defaultActiveFirst:mt.store.getState().defaultActiveFirst[J(mt.eventKey)],multiple:mt.multiple,prefixCls:mt.rootPrefixCls,id:Oe.internalMenuId,manualRef:Oe.saveMenuInstance,itemIcon:mt.itemIcon,expandIcon:mt.expandIcon,direction:mt.direction}},Oe.getMotion=function(Ze,mt){var Lt=Object(C.a)(Oe),Mt=Lt.haveRendered,$t=Oe.props,Re=$t.motion,ve=$t.rootPrefixCls,X=Object(ce.a)(Object(ce.a)({},Re),{},{leavedClassName:"".concat(ve,"-hidden"),removeOnLeave:!1,motionAppear:Mt||!mt||Ze!=="inline"});return X};var ze=rt.store,vt=rt.eventKey,st=ze.getState(),It=st.defaultActiveFirst;Oe.isRootMenu=!1;var Pt=!1;return It&&(Pt=It[vt]),re(ze,vt,Pt),Oe}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Oe=this,ze=this.props,vt=ze.mode,st=ze.parentMenu,It=ze.manualRef;if(It&&It(this),vt!=="horizontal"||!st.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return Oe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Oe=this.props,ze=Oe.onDestroy,vt=Oe.eventKey;ze&&ze(vt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(Oe){var ze=this,vt=this.getBaseProps(),st=this.getMotion(vt.mode,vt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||vt.visible||vt.forceSubMenuRender,!this.haveOpened)return A.createElement("div",null);var It=vt.direction;return A.createElement(Fe.default,Object.assign({visible:vt.visible},st),function(Pt){var Ze=Pt.className,mt=Pt.style,Lt=a()("".concat(vt.prefixCls,"-sub"),Ze,Object(c.a)({},"".concat(vt.prefixCls,"-rtl"),It==="rtl"));return A.createElement(je,Object.assign({},vt,{id:ze.internalMenuId,className:Lt,style:mt}),Oe)})}},{key:"render",value:function(){var Oe,ze=Object(ce.a)({},this.props),vt=ze.isOpen,st=this.getPrefixCls(),It=ze.mode==="inline",Pt=a()(st,"".concat(st,"-").concat(ze.mode),(Oe={},Object(c.a)(Oe,ze.className,!!ze.className),Object(c.a)(Oe,this.getOpenClassName(),vt),Object(c.a)(Oe,this.getActiveClassName(),ze.active||vt&&!It),Object(c.a)(Oe,this.getDisabledClassName(),ze.disabled),Object(c.a)(Oe,this.getSelectedClassName(),this.isChildrenSelected()),Oe));this.internalMenuId||(ze.eventKey?this.internalMenuId="".concat(ze.eventKey,"$Menu"):(He+=1,this.internalMenuId="$__$".concat(He,"$Menu")));var Ze={},mt={},Lt={};ze.disabled||(Ze={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mt={onClick:this.onTitleClick},Lt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Mt={},$t=ze.direction;It&&($t==="rtl"?Mt.paddingRight=ze.inlineIndent*ze.level:Mt.paddingLeft=ze.inlineIndent*ze.level);var Re={};this.props.isOpen&&(Re={"aria-owns":this.internalMenuId});var ve=null;ze.mode!=="horizontal"&&(ve=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ve=A.createElement(this.props.expandIcon,Object(ce.a)({},this.props))));var X=A.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Mt,className:"".concat(st,"-title"),role:"button"},Lt,mt,{"aria-expanded":vt},Re,{"aria-haspopup":"true",title:typeof ze.title=="string"?ze.title:void 0}),ze.title,ve||A.createElement("i",{className:"".concat(st,"-arrow")})),ne=this.renderChildren(ze.children),oe=ze.parentMenu.isRootMenu?ze.parentMenu.props.getPopupContainer:function(hn){return hn.parentNode},he=it[ze.mode],Ae=ze.popupOffset?{offset:ze.popupOffset}:{},Qe=ze.mode==="inline"?"":ze.popupClassName;Qe+=$t==="rtl"?" ".concat(st,"-rtl"):"";var ot=ze.disabled,Rt=ze.triggerSubMenuAction,Nt=ze.subMenuOpenDelay,ht=ze.forceSubMenuRender,Dt=ze.subMenuCloseDelay,sn=ze.builtinPlacements;le.forEach(function(hn){return delete ze[hn]}),delete ze.onClick;var Ct=$t==="rtl"?Object.assign({},me,sn):Object.assign({},Ee,sn);return delete ze.direction,A.createElement("li",Object.assign({},ze,Ze,{className:Pt,role:"menuitem"}),It&&X,It&&ne,!It&&A.createElement(Me.a,{prefixCls:st,popupClassName:a()("".concat(st,"-popup"),Qe),getPopupContainer:oe,builtinPlacements:Ct,popupPlacement:he,popupVisible:vt,popupAlign:Ae,popup:ne,action:ot?[]:[Rt],mouseEnterDelay:Nt,mouseLeaveDelay:Dt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ht},X))}}]),gt}(A.Component);P.defaultProps={onMouseEnter:M,onMouseLeave:M,onTitleMouseEnter:M,onTitleMouseLeave:M,onTitleClick:M,manualRef:M,mode:"vertical",title:""};var j=Object(O.b)(function(At,pt){var gt=At.openKeys,rt=At.activeKey,Oe=At.selectedKeys,ze=pt.eventKey,vt=pt.subMenuKey;return{isOpen:gt.indexOf(ze)>-1,active:rt[vt]===ze,selectedKeys:Oe}})(P);j.isSubMenu=!0;var ee=j,$="menuitem-overflowed",Q=.5,xe=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(){var rt;return Object(ie.a)(this,gt),rt=pt.apply(this,arguments),rt.resizeObserver=null,rt.mutationObserver=null,rt.originalTotalWidth=0,rt.overflowedItems=[],rt.menuItemSizes=[],rt.cancelFrameId=null,rt.state={lastVisibleIndex:void 0},rt.getMenuItemNodes=function(){var Oe=rt.props.prefixCls,ze=ye.findDOMNode(Object(C.a)(rt));return ze?[].slice.call(ze.children).filter(function(vt){return vt.className.split(" ").indexOf("".concat(Oe,"-overflowed-submenu"))<0}):[]},rt.getOverflowedSubMenuItem=function(Oe,ze,vt){var st=rt.props,It=st.overflowedIndicator,Pt=st.level,Ze=st.mode,mt=st.prefixCls,Lt=st.theme;if(Pt!==1||Ze!=="horizontal")return null;var Mt=rt.props.children[0],$t=Mt.props,Re=$t.children,ve=$t.title,X=$t.style,ne=Object(_e.a)($t,["children","title","style"]),oe=Object(ce.a)({},X),he="".concat(Oe,"-overflowed-indicator"),Ae="".concat(Oe,"-overflowed-indicator");ze.length===0&&vt!==!0?oe=Object(ce.a)(Object(ce.a)({},oe),{},{display:"none"}):vt&&(oe=Object(ce.a)(Object(ce.a)({},oe),{},{visibility:"hidden",position:"absolute"}),he="".concat(he,"-placeholder"),Ae="".concat(Ae,"-placeholder"));var Qe=Lt?"".concat(mt,"-").concat(Lt):"",ot={};return le.forEach(function(Rt){ne[Rt]!==void 0&&(ot[Rt]=ne[Rt])}),A.createElement(ee,Object.assign({title:It,className:"".concat(mt,"-overflowed-submenu"),popupClassName:Qe},ot,{key:he,eventKey:Ae,disabled:!1,style:oe}),ze)},rt.setChildrenWidthAndResize=function(){if(rt.props.mode!=="horizontal")return;var Oe=ye.findDOMNode(Object(C.a)(rt));if(!Oe)return;var ze=Oe.children;if(!ze||ze.length===0)return;var vt=Oe.children[ze.length-1];Te(vt,"display","inline-block");var st=rt.getMenuItemNodes(),It=st.filter(function(Pt){return Pt.className.split(" ").indexOf($)>=0});It.forEach(function(Pt){Te(Pt,"display","inline-block")}),rt.menuItemSizes=st.map(function(Pt){return de(Pt,!0)}),It.forEach(function(Pt){Te(Pt,"display","none")}),rt.overflowedIndicatorWidth=de(Oe.children[Oe.children.length-1],!0),rt.originalTotalWidth=rt.menuItemSizes.reduce(function(Pt,Ze){return Pt+Ze},0),rt.handleResize(),Te(vt,"display","none")},rt.handleResize=function(){if(rt.props.mode!=="horizontal")return;var Oe=ye.findDOMNode(Object(C.a)(rt));if(!Oe)return;var ze=de(Oe);rt.overflowedItems=[];var vt=0,st;rt.originalTotalWidth>ze+Q&&(st=-1,rt.menuItemSizes.forEach(function(It){vt+=It,vt+rt.overflowedIndicatorWidth<=ze&&(st+=1)})),rt.setState({lastVisibleIndex:st})},rt}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){var Oe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ze=ye.findDOMNode(this);if(!ze)return;this.resizeObserver=new Ke.default(function(vt){vt.forEach(function(){var st=Oe.cancelFrameId;cancelAnimationFrame(st),Oe.cancelFrameId=requestAnimationFrame(Oe.setChildrenWidthAndResize)})}),[].slice.call(ze.children).concat(ze).forEach(function(vt){Oe.resizeObserver.observe(vt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Oe.resizeObserver.disconnect(),[].slice.call(ze.children).concat(ze).forEach(function(vt){Oe.resizeObserver.observe(vt)}),Oe.setChildrenWidthAndResize()}),this.mutationObserver.observe(ze,{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(Oe){var ze=this,vt=this.state.lastVisibleIndex;return(Oe||[]).reduce(function(st,It,Pt){var Ze=It;if(ze.props.mode==="horizontal"){var mt=ze.getOverflowedSubMenuItem(It.props.eventKey,[]);vt!==void 0&&ze.props.className.indexOf("".concat(ze.props.prefixCls,"-root"))!==-1&&(Pt>vt&&(Ze=A.cloneElement(It,{style:{display:"none"},eventKey:"".concat(It.props.eventKey,"-hidden"),className:"".concat($)})),Pt===vt+1&&(ze.overflowedItems=Oe.slice(vt+1).map(function(Mt){return A.cloneElement(Mt,{key:Mt.props.eventKey,mode:"vertical-left"})}),mt=ze.getOverflowedSubMenuItem(It.props.eventKey,ze.overflowedItems)));var Lt=[].concat(Object(Ie.a)(st),[mt,Ze]);return Pt===Oe.length-1&&Lt.push(ze.getOverflowedSubMenuItem(It.props.eventKey,[],!0)),Lt}return[].concat(Object(Ie.a)(st),[Ze])},[])}},{key:"render",value:function(){var Oe=this.props,ze=Oe.visible,vt=Oe.prefixCls,st=Oe.overflowedIndicator,It=Oe.mode,Pt=Oe.level,Ze=Oe.tag,mt=Oe.children,Lt=Oe.theme,Mt=Object(_e.a)(Oe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),$t=Ze;return A.createElement($t,Object.assign({},Mt),this.renderChildren(mt))}}]),gt}(A.Component);xe.defaultProps={tag:"div",className:""};var De=xe;function dt(At){return At.length?At.every(function(pt){return!!pt.props.disabled}):!0}function Ne(At,pt,gt){var rt=At.getState();At.setState({activeKey:Object(ce.a)(Object(ce.a)({},rt.activeKey),{},Object(c.a)({},pt,gt))})}function Be(At){return At.eventKey||"0-menu-"}function tt(At,pt){var gt=pt,rt=At.children,Oe=At.eventKey;if(gt){var ze;if(K(rt,function(vt,st){vt&&vt.props&&!vt.props.disabled&>===G(vt,Oe,st)&&(ze=!0)}),ze)return gt}return gt=null,At.defaultActiveFirst&&K(rt,function(vt,st){!gt&&vt&&!vt.props.disabled&&(gt=G(vt,Oe,st))}),gt}function lt(At){if(At){var pt=this.instanceArray.indexOf(At);pt!==-1?this.instanceArray[pt]=At:this.instanceArray.push(At)}}var qe=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(rt){var Oe;return Object(ie.a)(this,gt),Oe=pt.call(this,rt),Oe.onKeyDown=function(ze,vt){var st=ze.keyCode,It;if(Oe.getFlatInstanceArray().forEach(function(Ze){Ze&&Ze.props.active&&Ze.onKeyDown&&(It=Ze.onKeyDown(ze))}),It)return 1;var Pt=null;return(st===s.a.UP||st===s.a.DOWN)&&(Pt=Oe.step(st===s.a.UP?-1:1)),Pt?(ze.preventDefault(),Ne(Oe.props.store,Be(Oe.props),Pt.props.eventKey),typeof vt=="function"&&vt(Pt),1):void 0},Oe.onItemHover=function(ze){var vt=ze.key,st=ze.hover;Ne(Oe.props.store,Be(Oe.props),st?vt:null)},Oe.onDeselect=function(ze){Oe.props.onDeselect(ze)},Oe.onSelect=function(ze){Oe.props.onSelect(ze)},Oe.onClick=function(ze){Oe.props.onClick(ze)},Oe.onOpenChange=function(ze){Oe.props.onOpenChange(ze)},Oe.onDestroy=function(ze){Oe.props.onDestroy(ze)},Oe.getFlatInstanceArray=function(){return Oe.instanceArray},Oe.step=function(ze){var vt=Oe.getFlatInstanceArray(),st=Oe.props.store.getState().activeKey[Be(Oe.props)],It=vt.length;if(!It)return null;ze<0&&(vt=vt.concat().reverse());var Pt=-1;if(vt.every(function(Mt,$t){return Mt&&Mt.props.eventKey===st?(Pt=$t,!1):!0}),!Oe.props.defaultActiveFirst&&Pt!==-1&&dt(vt.slice(Pt,It-1)))return;var Ze=(Pt+1)%It,mt=Ze;do{var Lt=vt[mt];if(!Lt||Lt.props.disabled)mt=(mt+1)%It;else return Lt}while(mt!==Ze);return null},Oe.renderCommonMenuItem=function(ze,vt,st){var It=Oe.props.store.getState(),Pt=Object(C.a)(Oe),Ze=Pt.props,mt=G(ze,Ze.eventKey,vt),Lt=ze.props;if(!Lt||typeof ze.type=="string")return ze;var Mt=mt===It.activeKey,$t=Object(ce.a)(Object(ce.a)({mode:Lt.mode||Ze.mode,level:Ze.level,inlineIndent:Ze.inlineIndent,renderMenuItem:Oe.renderMenuItem,rootPrefixCls:Ze.prefixCls,index:vt,parentMenu:Ze.parentMenu,manualRef:Lt.disabled?void 0:Object(n.a)(ze.ref,lt.bind(Object(C.a)(Oe))),eventKey:mt,active:!Lt.disabled&&Mt,multiple:Ze.multiple,onClick:function(ve){(Lt.onClick||M)(ve),Oe.onClick(ve)},onItemHover:Oe.onItemHover,motion:Ze.motion,subMenuOpenDelay:Ze.subMenuOpenDelay,subMenuCloseDelay:Ze.subMenuCloseDelay,forceSubMenuRender:Ze.forceSubMenuRender,onOpenChange:Oe.onOpenChange,onDeselect:Oe.onDeselect,onSelect:Oe.onSelect,builtinPlacements:Ze.builtinPlacements,itemIcon:Lt.itemIcon||Oe.props.itemIcon,expandIcon:Lt.expandIcon||Oe.props.expandIcon},st),{},{direction:Ze.direction});return(Ze.mode==="inline"||we())&&($t.triggerSubMenuAction="click"),A.cloneElement(ze,$t)},Oe.renderMenuItem=function(ze,vt,st){if(!ze)return null;var It=Oe.props.store.getState(),Pt={openKeys:It.openKeys,selectedKeys:It.selectedKeys,triggerSubMenuAction:Oe.props.triggerSubMenuAction,subMenuKey:st};return Oe.renderCommonMenuItem(ze,vt,Pt)},rt.store.setState({activeKey:Object(ce.a)(Object(ce.a)({},rt.store.getState().activeKey),{},Object(c.a)({},rt.eventKey,tt(rt,rt.activeKey)))}),Oe.instanceArray=[],Oe}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Oe){return this.props.visible||Oe.visible||this.props.className!==Oe.className||!r()(this.props.style,Oe.style)}},{key:"componentDidUpdate",value:function(Oe){var ze=this.props,vt="activeKey"in ze?ze.activeKey:ze.store.getState().activeKey[Be(ze)],st=tt(ze,vt);if(st!==vt)Ne(ze.store,Be(ze),st);else if("activeKey"in Oe){var It=tt(Oe,Oe.activeKey);st!==It&&Ne(ze.store,Be(ze),st)}}},{key:"render",value:function(){var Oe=this,ze=Object(p.a)({},this.props);this.instanceArray=[];var vt=a()(ze.prefixCls,ze.className,"".concat(ze.prefixCls,"-").concat(ze.mode)),st={className:vt,role:ze.role||"menu"};ze.id&&(st.id=ze.id),ze.focusable&&(st.tabIndex=0,st.onKeyDown=this.onKeyDown);var It=ze.prefixCls,Pt=ze.eventKey,Ze=ze.visible,mt=ze.level,Lt=ze.mode,Mt=ze.overflowedIndicator,$t=ze.theme;return le.forEach(function(Re){return delete ze[Re]}),delete ze.onClick,A.createElement(De,Object.assign({},ze,{prefixCls:It,mode:Lt,tag:"ul",level:mt,theme:$t,visible:Ze,overflowedIndicator:Mt},st),A.Children.map(ze.children,function(Re,ve){return Oe.renderMenuItem(Re,ve,Pt||"0-menu-")}))}}]),gt}(A.Component);qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:M};var Ye=Object(O.b)()(qe),je=Ye,Ue=V("Kwbf");function ke(At,pt,gt){var rt=At.prefixCls,Oe=At.motion,ze=At.defaultMotions,vt=ze===void 0?{}:ze,st=At.openAnimation,It=At.openTransitionName,Pt=pt.switchingModeFromInline;if(Oe)return Oe;if(Object(i.a)(st)==="object"&&st)Object(Ue.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof st=="string")return{motionName:"".concat(rt,"-open-").concat(st)};if(It)return{motionName:It};var Ze=vt[gt];return Ze||(Pt?null:vt.other)}var be=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(rt){var Oe;Object(ie.a)(this,gt),Oe=pt.call(this,rt),Oe.inlineOpenKeys=[],Oe.onSelect=function(st){var It=Object(C.a)(Oe),Pt=It.props;if(Pt.selectable){var Ze=Oe.store.getState(),mt=Ze.selectedKeys,Lt=st.key;Pt.multiple?mt=mt.concat([Lt]):mt=[Lt],"selectedKeys"in Pt||Oe.store.setState({selectedKeys:mt}),Pt.onSelect(Object(ce.a)(Object(ce.a)({},st),{},{selectedKeys:mt}))}},Oe.onClick=function(st){var It=Oe.getRealMenuMode(),Pt=Object(C.a)(Oe),Ze=Pt.store,mt=Pt.props.onOpenChange;It!=="inline"&&!("openKeys"in Oe.props)&&(Ze.setState({openKeys:[]}),mt([])),Oe.props.onClick(st)},Oe.onKeyDown=function(st,It){Oe.innerMenu.getWrappedInstance().onKeyDown(st,It)},Oe.onOpenChange=function(st){var It=Object(C.a)(Oe),Pt=It.props,Ze=Oe.store.getState().openKeys.concat(),mt=!1,Lt=function($t){var Re=!1;if($t.open)Re=Ze.indexOf($t.key)===-1,Re&&Ze.push($t.key);else{var ve=Ze.indexOf($t.key);Re=ve!==-1,Re&&Ze.splice(ve,1)}mt=mt||Re};Array.isArray(st)?st.forEach(Lt):Lt(st),mt&&("openKeys"in Oe.props||Oe.store.setState({openKeys:Ze}),Pt.onOpenChange(Ze))},Oe.onDeselect=function(st){var It=Object(C.a)(Oe),Pt=It.props;if(Pt.selectable){var Ze=Oe.store.getState().selectedKeys.concat(),mt=st.key,Lt=Ze.indexOf(mt);Lt!==-1&&Ze.splice(Lt,1),"selectedKeys"in Pt||Oe.store.setState({selectedKeys:Ze}),Pt.onDeselect(Object(ce.a)(Object(ce.a)({},st),{},{selectedKeys:Ze}))}},Oe.onMouseEnter=function(st){Oe.restoreModeVerticalFromInline();var It=Oe.props.onMouseEnter;It&&It(st)},Oe.onTransitionEnd=function(st){var It=st.propertyName==="width"&&st.target===st.currentTarget,Pt=st.target.className,Ze=Object.prototype.toString.call(Pt)==="[object SVGAnimatedString]"?Pt.animVal:Pt,mt=st.propertyName==="font-size"&&Ze.indexOf("anticon")>=0;(It||mt)&&Oe.restoreModeVerticalFromInline()},Oe.setInnerMenu=function(st){Oe.innerMenu=st},Oe.isRootMenu=!0;var ze=rt.defaultSelectedKeys,vt=rt.defaultOpenKeys;return"selectedKeys"in rt&&(ze=rt.selectedKeys||[]),"openKeys"in rt&&(vt=rt.openKeys||[]),Oe.store=Object(O.c)({selectedKeys:ze,openKeys:vt,activeKey:{"0-menu-":tt(rt,rt.activeKey)}}),Oe.state={switchingModeFromInline:!1},Oe}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Oe){this.updateOpentKeysWhenSwitchMode(Oe),this.updateMiniStore();var ze=this.props,vt=ze.siderCollapsed,st=ze.inlineCollapsed,It=ze.onOpenChange;(!Oe.inlineCollapsed&&st||!Oe.siderCollapsed&&vt)&&It([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(Oe){var ze=this.props,vt=this.store,st=this.inlineOpenKeys,It=vt.getState(),Pt={};Oe.mode==="inline"&&ze.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in ze||((ze.inlineCollapsed&&!Oe.inlineCollapsed||ze.siderCollapsed&&!Oe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=It.openKeys.concat(),Pt.openKeys=[]),(!ze.inlineCollapsed&&Oe.inlineCollapsed||!ze.siderCollapsed&&Oe.siderCollapsed)&&(Pt.openKeys=st,this.inlineOpenKeys=[])),Object.keys(Pt).length&&vt.setState(Pt)}},{key:"updateMenuDisplay",value:function(){var Oe=this.props.collapsedWidth,ze=this.store,vt=this.prevOpenKeys,st=this.getInlineCollapsed()&&(Oe===0||Oe==="0"||Oe==="0px");st?(this.prevOpenKeys=ze.getState().openKeys.concat(),this.store.setState({openKeys:[]})):vt&&(this.store.setState({openKeys:vt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Oe=this.props.mode,ze=this.state.switchingModeFromInline,vt=this.getInlineCollapsed();return ze&&vt?"inline":vt?"vertical":Oe}},{key:"getInlineCollapsed",value:function(){var Oe=this.props,ze=Oe.inlineCollapsed,vt=Oe.siderCollapsed;return vt!==void 0?vt:ze}},{key:"restoreModeVerticalFromInline",value:function(){var Oe=this.state.switchingModeFromInline;Oe&&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 Oe=Object(ce.a)({},Object(f.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ze=this.getRealMenuMode();return Oe.className+=" ".concat(Oe.prefixCls,"-root"),Oe.direction==="rtl"&&(Oe.className+=" ".concat(Oe.prefixCls,"-rtl")),Oe=Object(ce.a)(Object(ce.a)({},Oe),{},{mode:ze,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ke(this.props,this.state,ze)}),delete Oe.openAnimation,delete Oe.openTransitionName,A.createElement(O.a,{store:this.store},A.createElement(je,Object.assign({},Oe,{ref:this.setInnerMenu}),this.props.children))}}]),gt}(A.Component);be.defaultProps={selectable:!0,onClick:M,onSelect:M,onOpenChange:M,onDeselect:M,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:A.createElement("span",null,"\xB7\xB7\xB7")};var Ce=be,Pe=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(){var rt;return Object(ie.a)(this,gt),rt=pt.apply(this,arguments),rt.onKeyDown=function(Oe){var ze=Oe.keyCode;return ze===s.a.ENTER?(rt.onClick(Oe),!0):void 0},rt.onMouseLeave=function(Oe){var ze=rt.props,vt=ze.eventKey,st=ze.onItemHover,It=ze.onMouseLeave;st({key:vt,hover:!1}),It({key:vt,domEvent:Oe})},rt.onMouseEnter=function(Oe){var ze=rt.props,vt=ze.eventKey,st=ze.onItemHover,It=ze.onMouseEnter;st({key:vt,hover:!0}),It({key:vt,domEvent:Oe})},rt.onClick=function(Oe){var ze=rt.props,vt=ze.eventKey,st=ze.multiple,It=ze.onClick,Pt=ze.onSelect,Ze=ze.onDeselect,mt=ze.isSelected,Lt={key:vt,keyPath:[vt],item:Object(C.a)(rt),domEvent:Oe};It(Lt),st?mt?Ze(Lt):Pt(Lt):mt||Pt(Lt)},rt.saveNode=function(Oe){rt.node=Oe},rt}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Oe=this.props;Oe.onDestroy&&Oe.onDestroy(Oe.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 Oe,ze=Object(ce.a)({},this.props),vt=a()(this.getPrefixCls(),ze.className,(Oe={},Object(c.a)(Oe,this.getActiveClassName(),!ze.disabled&&ze.active),Object(c.a)(Oe,this.getSelectedClassName(),ze.isSelected),Object(c.a)(Oe,this.getDisabledClassName(),ze.disabled),Oe)),st=Object(ce.a)(Object(ce.a)({},ze.attribute),{},{title:typeof ze.title=="string"?ze.title:void 0,className:vt,role:ze.role||"menuitem","aria-disabled":ze.disabled});ze.role==="option"?st=Object(ce.a)(Object(ce.a)({},st),{},{role:"option","aria-selected":ze.isSelected}):(ze.role===null||ze.role==="none")&&(st.role="none");var It={onClick:ze.disabled?null:this.onClick,onMouseLeave:ze.disabled?null:this.onMouseLeave,onMouseEnter:ze.disabled?null:this.onMouseEnter},Pt=Object(ce.a)({},ze.style);ze.mode==="inline"&&(ze.direction==="rtl"?Pt.paddingRight=ze.inlineIndent*ze.level:Pt.paddingLeft=ze.inlineIndent*ze.level),le.forEach(function(mt){return delete ze[mt]}),delete ze.direction;var Ze=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ze=A.createElement(this.props.itemIcon,this.props)),A.createElement("li",Object.assign({},Object(f.default)(ze,["onClick","onMouseEnter","onMouseLeave","onSelect"]),st,It,{style:Pt,ref:this.saveNode}),ze.children,Ze)}}]),gt}(A.Component);Pe.isMenuItem=!0,Pe.defaultProps={onSelect:M,onMouseEnter:M,onMouseLeave:M,manualRef:M};var Le=Object(O.b)(function(At,pt){var gt=At.activeKey,rt=At.selectedKeys,Oe=pt.eventKey,ze=pt.subMenuKey;return{active:gt[ze]===Oe,isSelected:rt.indexOf(Oe)!==-1}})(Pe),Ve=Le,at=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(){var rt;return Object(ie.a)(this,gt),rt=pt.apply(this,arguments),rt.renderInnerMenuItem=function(Oe){var ze=rt.props,vt=ze.renderMenuItem,st=ze.index;return vt(Oe,st,rt.props.subMenuKey)},rt}return Object(W.a)(gt,[{key:"render",value:function(){var Oe=Object(p.a)({},this.props),ze=Oe.className,vt=ze===void 0?"":ze,st=Oe.rootPrefixCls,It="".concat(st,"-item-group-title"),Pt="".concat(st,"-item-group-list"),Ze=Oe.title,mt=Oe.children;return le.forEach(function(Lt){return delete Oe[Lt]}),delete Oe.onClick,delete Oe.direction,A.createElement("li",Object.assign({},Oe,{className:"".concat(vt," ").concat(st,"-item-group")}),A.createElement("div",{className:It,title:typeof Ze=="string"?Ze:void 0},Ze),A.createElement("ul",{className:Pt},A.Children.map(mt,this.renderInnerMenuItem)))}}]),gt}(A.Component);at.isMenuItemGroup=!0,at.defaultProps={disabled:!0};var _t=at,kt=function(pt){var gt=pt.className,rt=pt.rootPrefixCls,Oe=pt.style;return A.createElement("li",{className:"".concat(gt," ").concat(rt,"-item-divider"),style:Oe})};kt.defaultProps={disabled:!0,className:"",style:{}};var Bt=kt,jt=Xe.e=Ce},"3tLw":function(nt,Xe,V){nt.exports=V.p+"static/a.39070d50.svg"},"4xil":function(nt,Xe,V){nt.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return t});var ce=V("Ty5D"),ie=V("dI71"),W=V("cDcd"),C=V.n(W),D=V("YS25"),T=V("17x9"),A=V.n(T),O=V("wx14"),f=V("zLVn"),p=V("9R94"),c=function(x){Object(ie.a)(h,x);function h(){for(var S,w=arguments.length,R=new Array(w),N=0;N=0||w.relatedTarget.className.indexOf("".concat(z,"-next"))>=0))return;x.setState({goInputText:""}),F(x.getValidValue())},x.go=function(w){var R=x.state.goInputText;if(R==="")return;(w.keyCode===o.ENTER||w.type==="click")&&(x.setState({goInputText:""}),x.props.quickGo(x.getValidValue()))},x}return Object(D.a)(_,[{key:"getValidValue",value:function(){var h=this.state,E=h.goInputText,S=h.current;return!E||isNaN(E)?S:Number(E)}},{key:"getPageSizeOptions",value:function(){var h=this.props,E=h.pageSize,S=h.pageSizeOptions;return S.some(function(w){return w.toString()===E.toString()})?S:S.concat([E.toString()]).sort(function(w,R){var N=isNaN(Number(w))?0:Number(w),F=isNaN(Number(R))?0:Number(R);return N-F})}},{key:"render",value:function(){var h=this,E=this.props,S=E.pageSize,w=E.locale,R=E.rootPrefixCls,N=E.changeSize,F=E.quickGo,z=E.goButton,q=E.selectComponentClass,B=E.buildOptionText,M=E.selectPrefixCls,G=E.disabled,J=this.state.goInputText,K="".concat(R,"-options"),Z=q,le=null,de=null,Te=null;if(!N&&!F)return null;var we=this.getPageSizeOptions();if(N&&Z){var Ie=we.map(function(_e,ye){return f.a.createElement(Z.Option,{key:ye,value:_e.toString()},(B||h.buildOptionText)(_e))});le=f.a.createElement(Z,{disabled:G,prefixCls:M,showSearch:!1,className:"".concat(K,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(S||we[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ye){return ye.parentNode}},Ie)}return F&&(z&&(Te=typeof z=="boolean"?f.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:G,className:"".concat(K,"-quick-jumper-button")},w.jump_to_confirm):f.a.createElement("span",{onClick:this.go,onKeyUp:this.go},z)),de=f.a.createElement("div",{className:"".concat(K,"-quick-jumper")},w.jump_to,f.a.createElement("input",{disabled:G,type:"text",value:J,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),w.page,Te)),f.a.createElement("li",{className:"".concat(K)},le,de)}}]),_}(f.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=r,a=V("N2Kk");function i(){}function t(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function d(g,m,_){return _}function v(g,m,_){var x=typeof g=="undefined"?m.pageSize:g;return Math.floor((_.total-1)/x)+1}var y=function(g){Object(T.a)(_,g);var m=Object(A.a)(_);function _(x){var h;Object(C.a)(this,_),h=m.call(this,x),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(v(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(N,F){var z=h.props.prefixCls,q=N||f.a.createElement("button",{type:"button","aria-label":F,className:"".concat(z,"-item-link")});return typeof N=="function"&&(q=f.a.createElement(N,Object(W.a)({},h.props))),q},h.savePaginationNode=function(N){h.paginationNode=N},h.isValid=function(N){return t(N)&&N!==h.state.current},h.shouldDisplayQuickJumper=function(){var N=h.props,F=N.showQuickJumper,z=N.pageSize,q=N.total;return q<=z?!1:F},h.handleKeyDown=function(N){(N.keyCode===o.ARROW_UP||N.keyCode===o.ARROW_DOWN)&&N.preventDefault()},h.handleKeyUp=function(N){var F=h.getValidValue(N),z=h.state.currentInputValue;F!==z&&h.setState({currentInputValue:F}),N.keyCode===o.ENTER?h.handleChange(F):N.keyCode===o.ARROW_UP?h.handleChange(F-1):N.keyCode===o.ARROW_DOWN&&h.handleChange(F+1)},h.changePageSize=function(N){var F=h.state.current,z=v(N,h.state,h.props);F=F>z?z:F,z===0&&(F=h.state.current),typeof N=="number"&&("pageSize"in h.props||h.setState({pageSize:N}),"current"in h.props||h.setState({current:F,currentInputValue:F})),h.props.onShowSizeChange(F,N),"onChange"in h.props&&h.props.onChange&&h.props.onChange(F,N)},h.handleChange=function(N){var F=h.props.disabled,z=N;if(h.isValid(z)&&!F){var q=v(void 0,h.state,h.props);z>q?z=q:z<1&&(z=1),"current"in h.props||h.setState({current:z,currentInputValue:z});var B=h.state.pageSize;return h.props.onChange(z,B),z}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current2?z-2:0),B=2;B=S?R=S:R=Number(E),R}},{key:"getShowSizeChanger",value:function(){var h=this.props,E=h.showSizeChanger,S=h.total,w=h.totalBoundaryShowSizeChanger;return typeof E!="undefined"?E:S>w}},{key:"renderPrev",value:function(h){var E=this.props,S=E.prevIcon,w=E.itemRender,R=w(h,"prev",this.getItemIcon(S,"prev page")),N=!this.hasPrev();return Object(O.isValidElement)(R)?Object(O.cloneElement)(R,{disabled:N}):R}},{key:"renderNext",value:function(h){var E=this.props,S=E.nextIcon,w=E.itemRender,R=w(h,"next",this.getItemIcon(S,"next page")),N=!this.hasNext();return Object(O.isValidElement)(R)?Object(O.cloneElement)(R,{disabled:N}):R}},{key:"render",value:function(){var h=this,E=this.props,S=E.prefixCls,w=E.className,R=E.style,N=E.disabled,F=E.hideOnSinglePage,z=E.total,q=E.locale,B=E.showQuickJumper,M=E.showLessItems,G=E.showTitle,J=E.showTotal,K=E.simple,Z=E.itemRender,le=E.showPrevNextJumpers,de=E.jumpPrevIcon,Te=E.jumpNextIcon,we=E.selectComponentClass,Ie=E.selectPrefixCls,_e=E.pageSizeOptions,ye=this.state,Ke=ye.current,Me=ye.pageSize,Fe=ye.currentInputValue;if(F===!0&&z<=Me)return null;var Ge=v(void 0,this.state,this.props),Ee=[],me=null,We=null,He=null,it=null,re=null,P=B&&B.goButton,j=M?1:2,ee=Ke-1>0?Ke-1:0,$=Ke+1=j*2&&Ke!==1+2&&(Ee[0]=Object(O.cloneElement)(Ee[0],{className:"".concat(S,"-item-after-jump-prev")}),Ee.unshift(me)),Ge-Ke>=j*2&&Ke!==Ge-2&&(Ee[Ee.length-1]=Object(O.cloneElement)(Ee[Ee.length-1],{className:"".concat(S,"-item-before-jump-next")}),Ee.push(We)),tt!==1&&Ee.unshift(He),lt!==Ge&&Ee.push(it)}var je=null;J&&(je=f.a.createElement("li",{className:"".concat(S,"-total-text")},J(z,[z===0?0:(Ke-1)*Me+1,Ke*Me>z?z:Ke*Me])));var Ue=!this.hasPrev()||!Ge,ke=!this.hasNext()||!Ge;return f.a.createElement("ul",Object(ce.a)({className:c()(S,w,Object(ie.a)({},"".concat(S,"-disabled"),N)),style:R,unselectable:"unselectable",ref:this.savePaginationNode},Q),je,f.a.createElement("li",{title:G?q.prev_page:null,onClick:this.prev,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(S,"-prev"),Object(ie.a)({},"".concat(S,"-disabled"),Ue)),"aria-disabled":Ue},this.renderPrev(ee)),Ee,f.a.createElement("li",{title:G?q.next_page:null,onClick:this.next,tabIndex:ke?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(S,"-next"),Object(ie.a)({},"".concat(S,"-disabled"),ke)),"aria-disabled":ke},this.renderNext($)),f.a.createElement(l,{disabled:N,locale:q,rootPrefixCls:S,selectComponentClass:we,selectPrefixCls:Ie,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ke,pageSize:Me,pageSizeOptions:_e,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:P}))}}],[{key:"getDerivedStateFromProps",value:function(h,E){var S={};if("current"in h&&(S.current=h.current,h.current!==E.current&&(S.currentInputValue=S.current)),"pageSize"in h&&h.pageSize!==E.pageSize){var w=E.current,R=v(h.pageSize,E,h);w=w>R?R:w,"current"in h||(S.current=w,S.currentInputValue=w),S.pageSize=h.pageSize}return S}}]),_}(f.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:i,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:i,locale:a.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var b=y},"6RRn":function(nt,Xe,V){"use strict";var ce=V("wCXF"),ie=V("n6Qo");V.d(Xe,"b",function(){return ie.a});var W=V("IBYe"),C=V("6eGT"),D=V("hW8S");V.d(Xe,"a",function(){return D.a}),Xe.c=ce.b},"6UM0":function(nt,Xe,V){var ce,ie;(function(){var W;(function(){"use strict";var D=[function(f,p,c){var s=c(1).Beautifier,n=c(5).Options;function o(r,l){var a=new s(r,l);return a.beautify()}f.exports=o,f.exports.defaultOptions=function(){return new n}},function(f,p,c){var s=c(2).Output,n=c(3).Token,o=c(4),r=c(5).Options,l=c(7).Tokenizer,a=c(7).line_starters,i=c(7).positionable_operators,t=c(7).TOKEN;function d(M,G){return G.indexOf(M)!==-1}function v(M){return M.replace(/^\s+/g,"")}function y(M){for(var G={},J=0;JJ&&(J=M.line_indent_level));var K={mode:G,parent:M,last_token:M?M.last_token:new n(t.START_BLOCK,""),last_word:M?M.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:J,alignment:0,line_indent_level:M?M.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return K},q.prototype._reset=function(M){var G=M.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new s(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(E.BlockStatement);var J=new l(M,this._options);return this._tokens=J.tokenize(),M},q.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M,G=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=` `,G&&o.lineBreak.test(G||"")&&(J=G.match(o.lineBreak)[0]));for(var K=this._tokens.next();K;)this.handle_token(K),this._last_last_text=this._flags.last_token.text,this._flags.last_token=K,K=this._tokens.next();return M=this._output.get_code(J),M},q.prototype.handle_token=function(M,G){M.type===t.START_EXPR?this.handle_start_expr(M):M.type===t.END_EXPR?this.handle_end_expr(M):M.type===t.START_BLOCK?this.handle_start_block(M):M.type===t.END_BLOCK?this.handle_end_block(M):M.type===t.WORD?this.handle_word(M):M.type===t.RESERVED?this.handle_word(M):M.type===t.SEMICOLON?this.handle_semicolon(M):M.type===t.STRING?this.handle_string(M):M.type===t.EQUALS?this.handle_equals(M):M.type===t.OPERATOR?this.handle_operator(M):M.type===t.COMMA?this.handle_comma(M):M.type===t.BLOCK_COMMENT?this.handle_block_comment(M,G):M.type===t.COMMENT?this.handle_comment(M,G):M.type===t.DOT?this.handle_dot(M):M.type===t.EOF?this.handle_eof(M):M.type===t.UNKNOWN?this.handle_unknown(M,G):this.handle_unknown(M,G)},q.prototype.handle_whitespace_and_comments=function(M,G){var J=M.newlines,K=this._options.keep_array_indentation&&R(this._flags.mode);if(M.comments_before)for(var Z=M.comments_before.next();Z;)this.handle_whitespace_and_comments(Z,G),this.handle_token(Z,G),Z=M.comments_before.next();if(K)for(var le=0;le0,G);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,G);for(var de=1;de0&&(!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))},q.prototype.set_mode=function(M){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,M),this._flags=this.create_flags(this._previous_flags,M),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},q.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===E.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},q.prototype.start_of_object_property=function(){return this._flags.parent.mode===E.ObjectLiteral&&this._flags.mode===E.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||g(this._flags.last_token,["get","set"]))},q.prototype.start_of_statement=function(M){var G=!1;return G=G||g(this._flags.last_token,["var","let","const"])&&M.type===t.WORD,G=G||b(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===E.ObjectLiteral&&this._flags.mode===E.Statement)&&g(this._flags.last_token,B)&&!M.newlines,G=G||b(this._flags.last_token,"else")&&!(b(M,"if")&&!M.comments_before),G=G||this._flags.last_token.type===t.END_EXPR&&(this._previous_flags.mode===E.ForInitializer||this._previous_flags.mode===E.Conditional),G=G||this._flags.last_token.type===t.WORD&&this._flags.mode===E.BlockStatement&&!this._flags.in_case&&!(M.text==="--"||M.text==="++")&&this._last_last_text!=="function"&&M.type!==t.WORD&&M.type!==t.RESERVED,G=G||this._flags.mode===E.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||g(this._flags.last_token,["get","set"])),G?(this.set_mode(E.Statement),this.indent(),this.handle_whitespace_and_comments(M,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M,g(M,["do","for","if","while"])),!0):!1},q.prototype.handle_start_expr=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M);var G=E.Expression;if(M.text==="["){if(this._flags.last_token.type===t.WORD||this._flags.last_token.text===")"){g(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(M),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=E.ArrayLiteral,R(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())),d(this._flags.last_token.type,[t.START_EXPR,t.END_EXPR,t.WORD,t.OPERATOR,t.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===t.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=E.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=E.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&M.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,a)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M);else if(this._flags.last_token.type===t.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var K=this._tokens.peek(-4);g(J,["async","function"])||J.text==="*"&&g(K,["async","function"])?this._output.space_before_token=!0:this._flags.mode===E.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(K.text==="{"||K.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(M);(this._flags.last_token.type===t.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===E.ObjectLiteral&&d(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===t.START_BLOCK?this.print_newline():(this._flags.last_token.type===t.END_EXPR||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===t.COMMA)&&this.allow_wrap_or_preserved_newline(M,M.newlines),this.print_token(M),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},q.prototype.handle_end_expr=function(M){for(;this._flags.mode===E.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(M,M.text==="]"&&R(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===t.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(M),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===E.Conditional&&(this._previous_flags.mode=E.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},q.prototype.handle_start_block=function(M){this.handle_whitespace_and_comments(M);var G=this._tokens.peek(),J=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===t.END_EXPR?(this.set_mode(E.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(E.BlockStatement):J&&(d(J.text,[":",","])&&d(G.type,[t.STRING,t.WORD,t.RESERVED])||d(G.text,["get","set","..."])&&d(J.type,[t.WORD,t.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(J.text,[":",","])?this.set_mode(E.BlockStatement):this.set_mode(E.ObjectLiteral):this._flags.last_token.type===t.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(E.BlockStatement):d(this._flags.last_token.type,[t.EQUALS,t.START_EXPR,t.COMMA,t.OPERATOR])||g(this._flags.last_token,["return","throw","import","default"])?this.set_mode(E.ObjectLiteral):this.set_mode(E.BlockStatement),this._flags.last_token&&(g(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var K=!G.comments_before&&G.text==="}",Z=K&&this._flags.last_word==="function"&&this._flags.last_token.type===t.END_EXPR;if(this._options.brace_preserve_inline){var le=0,de=null;this._flags.inline_frame=!0;do if(le+=1,de=this._tokens.peek(le-1),de.newlines){this._flags.inline_frame=!1;break}while(de.type!==t.EOF&&!(de.type===t.END_BLOCK&&de.opened===M))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==t.OPERATOR&&(Z||this._flags.last_token.type===t.EQUALS||g(this._flags.last_token,m)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(R(this._previous_flags.mode)&&(this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.COMMA)&&((this._flags.last_token.type===t.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(M),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==t.OPERATOR&&this._flags.last_token.type!==t.START_EXPR&&(this._flags.last_token.type===t.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(M),this.indent(),!K&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},q.prototype.handle_end_block=function(M){for(this.handle_whitespace_and_comments(M);this._flags.mode===E.Statement;)this.restore_mode();var G=this._flags.last_token.type===t.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(R(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(M)},q.prototype.handle_word=function(M){if(M.type===t.RESERVED){if(d(M.text,["set","get"])&&this._flags.mode!==E.ObjectLiteral)M.type=t.WORD;else if(M.text==="import"&&d(this._tokens.peek().text,["(","."]))M.type=t.WORD;else if(d(M.text,["as","from"])&&!this._flags.import_block)M.type=t.WORD;else if(this._flags.mode===E.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(M.type=t.WORD)}}if(this.start_of_statement(M)?g(this._flags.last_token,["var","let","const"])&&M.type===t.WORD&&(this._flags.declaration_statement=!0):M.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==t.EQUALS&&(this._options.preserve_newlines||!g(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(M),this.print_newline()):this.handle_whitespace_and_comments(M),this._flags.do_block&&!this._flags.do_while)if(b(M,"while")){this._output.space_before_token=!0,this.print_token(M),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&&b(M,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===E.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&g(M,["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(M),this._flags.in_case=!0;return}if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M)),b(M,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===t.OPERATOR))&&(!this._output.just_added_blankline()&&!M.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD?g(this._flags.last_token,["get","set","new","export"])||g(this._flags.last_token,B)?this._output.space_before_token=!0:b(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===t.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||R(this._flags.mode))||this.print_newline(),this.print_token(M),this._flags.last_word=M.text;return}var J="NONE";if(this._flags.last_token.type===t.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":g(M,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&this._flags.mode===E.BlockStatement?J="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&N(this._flags.mode)?J="SPACE":this._flags.last_token.type===t.STRING?J="NEWLINE":this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===E.ObjectLiteral&&d(this._last_last_text,["{",","]))?J="SPACE":this._flags.last_token.type===t.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===t.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),g(M,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),g(M,["else","catch","finally"]))if((!(this._flags.last_token.type===t.END_BLOCK&&this._previous_flags.mode===E.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var K=this._output.current_line;K.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?g(this._flags.last_token,m)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&g(M,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==t.END_EXPR?(this._flags.last_token.type!==t.START_EXPR||!g(M,["var","let","const"]))&&this._flags.last_token.text!==":"&&(b(M,"if")&&b(M.previous,"else")?this._output.space_before_token=!0:this.print_newline()):g(M,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&R(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():J==="SPACE"&&(this._output.space_before_token=!0);M.previous&&(M.previous.type===t.WORD||M.previous.type===t.RESERVED)&&(this._output.space_before_token=!0),this.print_token(M),this._flags.last_word=M.text,M.type===t.RESERVED&&(M.text==="do"?this._flags.do_block=!0:M.text==="if"?this._flags.if_block=!0:M.text==="import"?this._flags.import_block=!0:this._flags.import_block&&b(M,"from")&&(this._flags.import_block=!1))},q.prototype.handle_semicolon=function(M){this.start_of_statement(M)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(M);for(var G=this._tokens.peek();this._flags.mode===E.Statement&&!(this._flags.if_block&&b(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(M)},q.prototype.handle_string=function(M){M.text.startsWith("`")&&M.newlines===0&&M.whitespace_before===""&&(M.previous.text===")"||this._flags.last_token.type===t.WORD)||(this.start_of_statement(M)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(M),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M):M.text.startsWith("`")&&this._flags.last_token.type===t.END_EXPR&&(M.previous.text==="]"||M.previous.text===")")&&M.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(M)},q.prototype.handle_equals=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0},q.prototype.handle_comma=function(M){this.handle_whitespace_and_comments(M,!0),this.print_token(M),this._output.space_before_token=!0,this._flags.declaration_statement?(N(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(M)):this._flags.mode===E.ObjectLiteral||this._flags.mode===E.Statement&&this._flags.parent.mode===E.ObjectLiteral?(this._flags.mode===E.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(M)},q.prototype.handle_operator=function(M){var G=M.text==="*"&&(g(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[t.START_BLOCK,t.COMMA,t.END_BLOCK,t.SEMICOLON])),J=d(M.text,["-","+"])&&(d(this._flags.last_token.type,[t.START_BLOCK,t.START_EXPR,t.EQUALS,t.OPERATOR])||d(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(M)){var K=!G;this.handle_whitespace_and_comments(M,K)}if(M.text==="*"&&this._flags.last_token.type===t.DOT){this.print_token(M);return}if(M.text==="::"){this.print_token(M);return}if(this._flags.last_token.type===t.OPERATOR&&d(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(M),M.text===":"&&this._flags.in_case){this.print_token(M),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==t.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Z=!0,le=!0,de=!1;if(M.text===":"?this._flags.ternary_depth===0?Z=!1:(this._flags.ternary_depth-=1,de=!0):M.text==="?"&&(this._flags.ternary_depth+=1),!J&&!G&&this._options.preserve_newlines&&d(M.text,i)){var Te=M.text===":",we=Te&&de,Ie=Te&&!de;switch(this._options.operator_position){case x.before_newline:this._output.space_before_token=!Ie,this.print_token(M),(!Te||we)&&this.allow_wrap_or_preserved_newline(M),this._output.space_before_token=!0;return;case x.after_newline:this._output.space_before_token=!0,!Te||we?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(M):this._output.space_before_token=!1,this.print_token(M),this._output.space_before_token=!0;return;case x.preserve_newline:Ie||this.allow_wrap_or_preserved_newline(M),Z=!(this._output.just_added_newline()||Ie),this._output.space_before_token=Z,this.print_token(M),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(M),Z=!1;var _e=this._tokens.peek();le=_e&&d(_e.type,[t.WORD,t.RESERVED])}else if(M.text==="...")this.allow_wrap_or_preserved_newline(M),Z=this._flags.last_token.type===t.START_BLOCK,le=!1;else if(d(M.text,["--","++","!","~"])||J){if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR)&&this.allow_wrap_or_preserved_newline(M),Z=!1,le=!1,M.newlines&&(M.text==="--"||M.text==="++"||M.text==="~")){var ye=g(this._flags.last_token,m)&&M.newlines;ye&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ye,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(Z=!0),this._flags.last_token.type===t.RESERVED?Z=!0:this._flags.last_token.type===t.END_EXPR?Z=!(this._flags.last_token.text==="]"&&(M.text==="--"||M.text==="++")):this._flags.last_token.type===t.OPERATOR&&(Z=d(M.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(M.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(le=!0)),(this._flags.mode===E.BlockStatement&&!this._flags.inline_frame||this._flags.mode===E.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Z,this.print_token(M),this._output.space_before_token=le},q.prototype.handle_block_comment=function(M,G){if(this._output.raw){this._output.add_raw_token(M),M.directives&&M.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(M.directives){this.print_newline(!1,G),this.print_token(M),M.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!o.newline.test(M.text)&&!M.newlines){this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0;return}else this.print_block_commment(M,G)},q.prototype.print_block_commment=function(M,G){var J=w(M.text),K,Z=!1,le=!1,de=M.whitespace_before,Te=de.length;if(this.print_newline(!1,G),this.print_token_line_indentation(M),this._output.add_token(J[0]),this.print_newline(!1,G),J.length>1){for(J=J.slice(1),Z=F(J,"*"),le=z(J,de),Z&&(this._flags.alignment=1),K=0;K=0;o--)if(this.__items[o].match(n))return!0;return!1},p.prototype.set_indent=function(n,o){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=o||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 n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__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(n){this.__items.push(n);var o=n.lastIndexOf(` `);o!==-1?this.__character_count=n.length-o:this.__character_count+=n.length},p.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},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 n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function c(n,o){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),o=o||"",n.indent_level>0&&(o=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}c.prototype.get_indent_size=function(n,o){var r=this.__base_string_length;return o=o||0,n<0&&(r=0),r+=n*this.__indent_size,r+=o,r},c.prototype.get_indent_string=function(n,o){var r=this.__base_string;return o=o||0,n<0&&(n=0,r=""),o+=n*this.__indent_size,this.__ensure_cache(o),r+=this.__cache[o],r},c.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var n=this.__cache.length,o=0,r="";this.__indent_size&&n>=this.__indent_size&&(o=Math.floor(n/this.__indent_size),n-=o*this.__indent_size,r=new Array(o+1).join(this.__indent_string)),n&&(r+=new Array(n+1).join(" ")),this.__cache.push(r)};function s(n,o){this.__indent_cache=new c(n,o),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.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()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(n,o){return this.__indent_cache.get_indent_string(n,o)},s.prototype.get_indent_size=function(n,o){return this.__indent_cache.get_indent_size(n,o)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(n){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===` `&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(` `);return n!==` `&&(r=r.replace(/[\n]/g,n)),r},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(n,o){return n=n||0,o=o||0,this.next_line.set_indent(n,o),this.__lines.length>1?(this.current_line.set_indent(n,o),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(n){for(var o=0;o1&&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},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(n,o){for(var r=this.__lines.length-2;r>=0;){var l=this.__lines[r];if(l.is_empty())break;if(l.item(0).indexOf(n)!==0&&l.item(-1)!==o){this.__lines.splice(r+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},f.exports.Output=s},function(f){function p(c,s,n,o){this.type=c,this.text=s,this.comments_before=null,this.newlines=n||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=p},function(f,p){var c="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",s="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",o="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",r="(?:\\\\u[0-9a-fA-F]{4}|["+c+n+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+s+n+o+"])*";p.identifier=new RegExp(r+l,"g"),p.identifierStart=new RegExp(r),p.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+s+n+o+"])+");var a=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;p.newline=/[\n\r\u2028\u2029]/,p.lineBreak=new RegExp(`\r |`+p.newline.source),p.allLineBreaks=new RegExp(p.lineBreak.source,"g")},function(f,p,c){var s=c(6).Options,n=["before-newline","after-newline","preserve-newline"];function o(r){s.call(this,r,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="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 a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var i=0;i>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var x=new RegExp(_),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),E=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+E.join("|")+")$"),w,R=function(F,z){n.call(this,F,z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var q=new a(this._input),B=new i(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(l.identifier).matching(l.identifierMatch),number:q.matching(y),punct:q.matching(x),comment:q.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:q.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:q.matching(//),include:q.starting_with(/#include/).until_after(l.lineBreak),shebang:q.starting_with(/#!/).until_after(l.lineBreak),xml:q.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(/[`}\\]/)}};R.prototype=new n,R.prototype._is_comment=function(F){return F.type===d.COMMENT||F.type===d.BLOCK_COMMENT||F.type===d.UNKNOWN},R.prototype._is_opening=function(F){return F.type===d.START_BLOCK||F.type===d.START_EXPR},R.prototype._is_closing=function(F,z){return(F.type===d.END_BLOCK||F.type===d.END_EXPR)&&z&&(F.text==="]"&&z.text==="["||F.text===")"&&z.text==="("||F.text==="}"&&z.text==="{")},R.prototype._reset=function(){w=!1},R.prototype._get_next_token=function(F,z){var q=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(d.EOF,""):(q=q||this._read_non_javascript(B),q=q||this._read_string(B),q=q||this._read_word(F),q=q||this._read_singles(B),q=q||this._read_comment(B),q=q||this._read_regexp(B,F),q=q||this._read_xml(B,F),q=q||this._read_punctuation(),q=q||this._create_token(d.UNKNOWN,this._input.next()),q)},R.prototype._read_word=function(F){var z;if(z=this.__patterns.identifier.read(),z!=="")return z=z.replace(l.allLineBreaks,` `),!(F.type===d.DOT||F.type===d.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(z)?(z==="in"||z==="of")&&(F.type===d.WORD||F.type===d.STRING)?this._create_token(d.OPERATOR,z):this._create_token(d.RESERVED,z):this._create_token(d.WORD,z);if(z=this.__patterns.number.read(),z!=="")return this._create_token(d.WORD,z)},R.prototype._read_singles=function(F){var z=null;return F==="("||F==="["?z=this._create_token(d.START_EXPR,F):F===")"||F==="]"?z=this._create_token(d.END_EXPR,F):F==="{"?z=this._create_token(d.START_BLOCK,F):F==="}"?z=this._create_token(d.END_BLOCK,F):F===";"?z=this._create_token(d.SEMICOLON,F):F==="."&&g.test(this._input.peek(1))?z=this._create_token(d.DOT,F):F===","&&(z=this._create_token(d.COMMA,F)),z&&this._input.next(),z},R.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(d.EQUALS,F):F==="?."?this._create_token(d.DOT,F):this._create_token(d.OPERATOR,F)},R.prototype._read_non_javascript=function(F){var z="";if(F==="#"){if(this._is_first_token()&&(z=this.__patterns.shebang.read(),z))return this._create_token(d.UNKNOWN,z.trim()+` `);if(z=this.__patterns.include.read(),z)return this._create_token(d.UNKNOWN,z.trim()+` `);F=this._input.next();var q="#";if(this._input.hasNext()&&this._input.testChar(b)){do F=this._input.next(),q+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(q+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(q+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,q)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(z=this.__patterns.html_comment_start.read(),z){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)z+=this._input.next();return w=!0,this._create_token(d.COMMENT,z)}}else if(w&&F==="-"&&(z=this.__patterns.html_comment_end.read(),z))return w=!1,this._create_token(d.COMMENT,z);return null},R.prototype._read_comment=function(F){var z=null;if(F==="/"){var q="";if(this._input.peek(1)==="*"){q=this.__patterns.block_comment.read();var B=v.get_directives(q);B&&B.ignore==="start"&&(q+=v.readIgnored(this._input)),q=q.replace(l.allLineBreaks,` `),z=this._create_token(d.BLOCK_COMMENT,q),z.directives=B}else this._input.peek(1)==="/"&&(q=this.__patterns.comment.read(),z=this._create_token(d.COMMENT,q))}return z},R.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var z=this._input.next();return this.has_char_escapes=!1,F==="`"?z+=this._read_string_recursive("`",!0,"${"):z+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(z=N(z)),this._input.peek()===F&&(z+=this._input.next()),z=z.replace(l.allLineBreaks,` `),this._create_token(d.STRING,z)}return null},R.prototype._allow_regexp_or_xml=function(F){return F.type===d.RESERVED&&t(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===d.END_EXPR&&F.text===")"&&F.opened.previous.type===d.RESERVED&&t(F.opened.previous.text,["if","while","for"])||t(F.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},R.prototype._read_regexp=function(F,z){if(F==="/"&&this._allow_regexp_or_xml(z)){for(var q=this._input.next(),B=!1,M=!1;this._input.hasNext()&&(B||M||this._input.peek()!==F)&&!this._input.testChar(l.newline);)q+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?M=!0:this._input.peek()==="]"&&(M=!1)),this._input.next();return this._input.peek()===F&&(q+=this._input.next(),q+=this._input.read(l.identifier)),this._create_token(d.STRING,q)}return null},R.prototype._read_xml=function(F,z){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(z)){var q="",B=this.__patterns.xml.read_match();if(B){for(var M=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=M.indexOf("{")===0,J=0;B;){var K=!!B[1],Z=B[2],le=!!B[B.length-1]||Z.slice(0,8)==="![CDATA[";if(!le&&(Z===M||G&&Z.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(K?--J:++J),q+=B[0],J<=0)break;B=this.__patterns.xml.read_match()}return B||(q+=this._input.match(/[\s\S]*/g)[0]),q=q.replace(l.allLineBreaks,` `),this._create_token(d.STRING,q)}}return null};function N(F){for(var z="",q=0,B=new s(F),M=null;B.hasNext();)if(M=B.match(/([\s]|[^\\]|\\\\)+/g),M&&(z+=M[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")M=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")M=B.match(/u([0-9A-Fa-f]{4})/g);else{z+="\\",B.hasNext()&&(z+=B.next());continue}if(!M)return F;if(q=parseInt(M[1],16),q>126&&q<=255&&M[0].indexOf("x")===0)return F;if(q>=0&&q<32){z+="\\"+M[0];continue}else q===34||q===39||q===92?z+="\\"+String.fromCharCode(q):z+=String.fromCharCode(q)}return z}R.prototype._read_string_recursive=function(F,z,q){var B,M;F==="'"?M=this.__patterns.single_quote:F==='"'?M=this.__patterns.double_quote:F==="`"?M=this.__patterns.template_text:F==="}"&&(M=this.__patterns.template_expression);for(var G=M.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===F||!z&&l.newline.test(J)){this._input.back();break}else J==="\\"&&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(),J+=this._input.next()):q&&(q==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),q===J&&(F==="`"?J+=this._read_string_recursive("}",z,"`"):J+=this._read_string_recursive("`",z,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=M.read(),G+=J}return G},f.exports.Tokenizer=R,f.exports.TOKEN=d,f.exports.positionable_operators=m.slice(),f.exports.line_starters=h.slice()},function(f){var p=RegExp.prototype.hasOwnProperty("sticky");function c(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position=0&&s=0&&n=s.length&&this.__input.substring(n-s.length,n).toLowerCase()===s},f.exports.InputScanner=c},function(f,p,c){var s=c(8).InputScanner,n=c(3).Token,o=c(10).TokenStream,r=c(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(i,t){this._input=new s(i),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var i,t=new n(l.START,""),d=null,v=[],y=new o;t.type!==l.EOF;){for(i=this._get_next_token(t,d);this._is_comment(i);)y.add(i),i=this._get_next_token(t,d);y.isEmpty()||(i.comments_before=y,y=new o),i.parent=d,this._is_opening(i)?(v.push(d),d=i):d&&this._is_closing(i,d)&&(i.opened=d,d.closed=i,d=v.pop(),i.parent=d),i.previous=t,t.next=i,this.__tokens.add(i),t=i}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(i,t){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(l.RAW,d):this._create_token(l.EOF,"")},a.prototype._is_comment=function(i){return!1},a.prototype._is_opening=function(i){return!1},a.prototype._is_closing=function(i,t){return!1},a.prototype._create_token=function(i,t){var d=new n(i,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=a,f.exports.TOKEN=l},function(f){function p(c){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=c}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position=0&&c/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new s,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(r){var l=this._create();return l._disabled[r]=!0,l._update(),l},o.prototype.read_options=function(r){var l=this._create();for(var a in n)l._disabled[a]=r.templating.indexOf(a)===-1;return l._update(),l},o.prototype.exclude=function(r){var l=this._create();return l._excluded[r]=!0,l._update(),l},o.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 l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),r+=l,l=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},o.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("|")+")")},o.prototype._read_template=function(){var r="",l=this._input.peek();if(l==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(r=r||this.__patterns.erb.read())}else l==="{"&&(!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},f.exports.TemplatablePattern=o}],T={};function A(f){var p=T[f];if(p!==void 0)return p.exports;var c=T[f]={exports:{}};return D[f](c,c.exports,A),c.exports}var O=A(0);W=O})();var C=W;!(ce=[],ie=function(){return{js_beautify:C}}.apply(Xe,ce),ie!==void 0&&(nt.exports=ie))})()},"6eGT":function(nt,Xe,V){"use strict";function ce(ie){return null}Xe.a=ce},"7+5b":function(nt,Xe,V){nt.exports=V.p+"static/v.e7f297d6.svg"},"7Cbv":function(nt,Xe,V){"use strict";var ce=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ie=new Uint8Array(16);function W(){if(!ce)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ce(ie)}var C=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function D(n){return typeof n=="string"&&C.test(n)}for(var T=D,A=[],O=0;O<256;++O)A.push((O+256).toString(16).substr(1));function f(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(A[n[o+0]]+A[n[o+1]]+A[n[o+2]]+A[n[o+3]]+"-"+A[n[o+4]]+A[n[o+5]]+"-"+A[n[o+6]]+A[n[o+7]]+"-"+A[n[o+8]]+A[n[o+9]]+"-"+A[n[o+10]]+A[n[o+11]]+A[n[o+12]]+A[n[o+13]]+A[n[o+14]]+A[n[o+15]]).toLowerCase();if(!T(r))throw TypeError("Stringified UUID is invalid");return r}var p=f;function c(n,o,r){n=n||{};var l=n.random||(n.rng||W)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,o){r=r||0;for(var a=0;a<16;++a)o[r+a]=l[a];return o}return p(l)}var s=Xe.a=c},"7ahc":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return v});var ce=V("k1fw"),ie=V("0Owb"),W=V("+L6B"),C=V("2/Rp"),D=V("y8nQ"),T=V("Vl3Y"),A=V("tJVT"),O=V("OaEy"),f=V("2fM7"),p=V("cDcd"),c=V.n(p),s=V("VrN/"),n=V.n(s),o=V("p77/"),r=V.n(o),l=V("c5Ni"),a=V.n(l),i=f.a.Option,t={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Xe.b=function(y){var b=y.callback,g=y.onCancel,m=Object(p.useState)("python"),_=Object(A.a)(m,2),x=_[0],h=_[1];function E(w){h(d[w][1])}function S(w){b(w)}return c.a.createElement(T.a,Object(ie.a)({},t,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),c.a.createElement(T.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(f.a,{onChange:E},Object.keys(d).map(function(w){return c.a.createElement(i,{key:w,value:w},d[w][0])}))),c.a.createElement(T.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(v,{mode:x})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(C.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function v(y){var b=y.value,g=y.onChange,m=y.mode,_=y.options,x=_===void 0?{}:_,h=Object(p.useRef)(),E=Object(p.useState)(),S=Object(A.a)(E,2),w=S[0],R=S[1];return Object(p.useEffect)(function(){if(w){function N(F){var z=F.getValue();g&&g(z)}return w.on("change",N),function(){w.off("change",N)}}},[w,g]),Object(p.useEffect)(function(){w&&w.setOption("mode",m)},[w,m]),Object(p.useEffect)(function(){w&&((b!==w.getValue()||b==="")&&setTimeout(function(){w.setValue(b||" ")},300))},[w,b]),Object(p.useEffect)(function(){if(h.current&&!w){var N=n.a.fromTextArea(h.current,Object(ce.a)({mode:m,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));R(N)}},[h.current,w]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:h}))}},"7ixt":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return W});var ce={adjustX:1,adjustY:1},ie=[0,0],W={left:{points:["cr","cl"],overflow:ce,offset:[-4,0],targetOffset:ie},right:{points:["cl","cr"],overflow:ce,offset:[4,0],targetOffset:ie},top:{points:["bc","tc"],overflow:ce,offset:[0,-4],targetOffset:ie},bottom:{points:["tc","bc"],overflow:ce,offset:[0,4],targetOffset:ie},topLeft:{points:["bl","tl"],overflow:ce,offset:[0,-4],targetOffset:ie},leftTop:{points:["tr","tl"],overflow:ce,offset:[-4,0],targetOffset:ie},topRight:{points:["br","tr"],overflow:ce,offset:[0,-4],targetOffset:ie},rightTop:{points:["tl","tr"],overflow:ce,offset:[4,0],targetOffset:ie},bottomRight:{points:["tr","br"],overflow:ce,offset:[0,4],targetOffset:ie},rightBottom:{points:["bl","br"],overflow:ce,offset:[4,0],targetOffset:ie},bottomLeft:{points:["tl","bl"],overflow:ce,offset:[0,4],targetOffset:ie},leftBottom:{points:["br","bl"],overflow:ce,offset:[-4,0],targetOffset:ie}},C=W},"7qur":function(nt,Xe,V){"use strict";V.d(Xe,"m",function(){return ie}),V.d(Xe,"s",function(){return W}),V.d(Xe,"h",function(){return C}),V.d(Xe,"o",function(){return D}),V.d(Xe,"n",function(){return T}),V.d(Xe,"l",function(){return A}),V.d(Xe,"b",function(){return O}),V.d(Xe,"q",function(){return f}),V.d(Xe,"t",function(){return p}),V.d(Xe,"v",function(){return c}),V.d(Xe,"w",function(){return s}),V.d(Xe,"u",function(){return n}),V.d(Xe,"p",function(){return o}),V.d(Xe,"f",function(){return r}),V.d(Xe,"a",function(){return l}),V.d(Xe,"j",function(){return a}),V.d(Xe,"k",function(){return i}),V.d(Xe,"d",function(){return t}),V.d(Xe,"g",function(){return d}),V.d(Xe,"c",function(){return v}),V.d(Xe,"e",function(){return y}),V.d(Xe,"i",function(){return b}),V.d(Xe,"r",function(){return g});var ce=V("ErOA");function ie(m){return Object(ce.c)("mypractices/".concat(m,".json"),{hidePopLogin:!0})}function W(m,_){return Object(ce.f)("mypractices/".concat(m,"/code_submit.json"),_)}function C(m,_){return Object(ce.c)("mypractices/".concat(m,"/code_debug.json"),_)}function D(m,_){return Object(ce.c)("mypractices/".concat(m,"/submit_records.json"),_)}function T(m){return Object(ce.c)("mypractices/record_detail.json",{id:m})}function A(m,_){return Object(ce.c)("mypractices/".concat(m,"/result.json"),{mode:_})}function O(m,_){return Object(ce.f)("mypractices/".concat(m,"/add_notes.json"),_)}function f(m,_){return Object(ce.f)("mypractices/".concat(m,"/restore_initial_code.json"),_)}function p(m,_){return Object(ce.f)("mypractices/".concat(m,"/sync_code.json"),_)}function c(m,_){return Object(ce.f)("mypractices/".concat(m,"/update_code.json"),_)}function s(m){return Object(ce.f)("mypractices/".concat(m,"/initial_codes.json"))}function n(m,_){return Object(ce.f)("discusses/".concat(m,"/plus.json"),_)}function o(m){return Object(ce.c)("practices/practices_list.json",m)}function r(m,_){return Object(ce.c)("practices/".concat(m,"/question_solution_articles"),_)}function l(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles"),_)}function a(m,_){return Object(ce.g)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active),_)}function i(m,_){return Object(ce.c)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/edit"),_)}function t(m,_){return Object(ce.c)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active),_)}function d(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/set_authority_or_excellent"),_)}function v(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/praise_or_treads"),_)}function y(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/hide"))}function b(m,_){return Object(ce.b)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active),_)}function g(m,_){return Object(ce.f)("mypractices/".concat(m,"/update_practice_time_sum"),_)}},"815F":function(nt,Xe,V){"use strict";V.d(Xe,"e",function(){return A}),V.d(Xe,"c",function(){return f}),V.d(Xe,"d",function(){return p}),V.d(Xe,"a",function(){return s}),V.d(Xe,"f",function(){return n}),V.d(Xe,"b",function(){return o});var ce=V("KQm4"),ie=V("VTBJ"),W=V("Ff2n"),C=V("Zm9Q"),D=V("Kwbf"),T=V("OZM5");function A(r,l){return r!=null?r:l}function O(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function a(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(i||[]).forEach(function(d){var v=d.key,y=d.children;Object(D.a)(v!=null,"Tree node must have a certain key: [".concat(t).concat(v,"]"));var b=String(v);Object(D.a)(!l.has(b)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(b)),l.set(b,!0),a(y,"".concat(t).concat(b," > "))})}a(r)}function f(r){function l(a){var i=Object(C.a)(a);return i.map(function(t){if(!Object(T.i)(t))return Object(D.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var d=t.key,v=t.props,y=v.children,b=Object(W.a)(v,["children"]),g=Object(ie.a)({key:d},b),m=l(y);return m.length&&(g.children=m),g}).filter(function(t){return t})}return l(r)}function p(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(l===!0?[]:l),i=[];function t(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(y,b){var g=Object(T.h)(v?v.pos:"0",b),m=A(y.key,g),_=Object(ie.a)(Object(ie.a)({},y),{},{parent:v,pos:g,children:null,data:y,isStart:[].concat(Object(ce.a)(v?v.isStart:[]),[b===0]),isEnd:[].concat(Object(ce.a)(v?v.isEnd:[]),[b===d.length-1])});return i.push(_),l===!0||a.has(m)?_.children=t(y.children||[],_):_.children=[],_})}return t(r),i}function c(r,l,a){var i;a?typeof a=="string"?i=function(v){return v[a]}:typeof a=="function"&&(i=function(v){return a(v)}):i=function(v,y){return A(v.key,y)};function t(d,v,y){var b=d?d.children:r,g=d?Object(T.h)(y.pos,v):"0";if(d){var m=i(d,g),_={node:d,index:v,pos:g,key:m,parentPos:y.node?y.pos:null,level:y.level+1};l(_)}b&&b.forEach(function(x,h){t(x,h,{node:d,pos:g,level:y?y.level+1:-1})})}t(null)}function s(r){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=l.initWrapper,i=l.processEntity,t=l.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,v={},y={},b={posEntities:v,keyEntities:y};return a&&(b=a(b)||b),c(r,function(g){var m=g.node,_=g.index,x=g.pos,h=g.key,E=g.parentPos,S=g.level,w={node:m,index:_,key:h,pos:x,level:S},R=A(h,x);v[x]=w,y[R]=w,w.parent=v[E],w.parent&&(w.parent.children=w.parent.children||[],w.parent.children.push(w)),i&&i(w,b)},d),t&&t(b),b}function n(r,l){var a=l.expandedKeys,i=l.selectedKeys,t=l.loadedKeys,d=l.loadingKeys,v=l.checkedKeys,y=l.halfCheckedKeys,b=l.dragOverNodeKey,g=l.dropPosition,m=l.keyEntities,_=m[r],x={eventKey:r,expanded:a.indexOf(r)!==-1,selected:i.indexOf(r)!==-1,loaded:t.indexOf(r)!==-1,loading:d.indexOf(r)!==-1,checked:v.indexOf(r)!==-1,halfChecked:y.indexOf(r)!==-1,pos:String(_?_.pos:""),dragOver:b===r&&g===0,dragOverGapTop:b===r&&g===-1,dragOverGapBottom:b===r&&g===1};return x}function o(r){var l=r.data,a=r.expanded,i=r.selected,t=r.checked,d=r.loaded,v=r.loading,y=r.halfChecked,b=r.dragOver,g=r.dragOverGapTop,m=r.dragOverGapBottom,_=r.pos,x=r.active,h=Object(ie.a)(Object(ie.a)({},l),{},{expanded:a,selected:i,checked:t,loaded:d,loading:v,halfChecked:y,dragOver:b,dragOverGapTop:g,dragOverGapBottom:m,pos:_,active:x});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(D.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),r}}),h}},"8EBN":function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";ce.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ie=0;ie-1&&C.substring(A+1,C.length);if(O)return ce.findModeByExtension(O)},ce.findModeByName=function(C){C=C.toLowerCase();for(var D=0;D=te.length?pe.slice(te.length):pe}).join(` `)}var a=[],i=["
    "],t=new o.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){a.length=0,i=["
      "]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(ae,U,H,te){if(U>=ae.length||ae[U].level<=H)return U;var pe=ae[U];te.push("
    • "+pe.text+""),U++;var se=[];return U=b(ae,U,pe.level,se),se.length>0&&(te.push("
        "),se.forEach(function($e){te.push($e)}),te.push("
      ")),te.push("
    • "),U=b(ae,U,H,te),U}function g(){return b(a,0,0,i),i.push("
    "),i.join("")}var m={heading:function(U){var H=d.exec(U);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(U){var H=this.rules.block.fences.exec(U);if(H){var te=H[0],pe=l(te,H[3]||""),se=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=h(),yt=pe;pe=$e,E[$e]={type:"block",expression:yt}}return{type:"code",raw:te,lang:se,text:pe}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,h=function(){return"__special_katext_id_".concat(x++,"__")},E={};function S(){return E}function w(){x=0,E={}}function R(ae){return ae=ae.replace(_,function(U,H){var te=h();return E[te]={type:"inline",expression:H},te}),ae}var N=t.listitem;t.listitem=function(ae){return N(R(ae))};var F=t.paragraph;t.paragraph=function(ae){return F(R(ae))};var z=t.tablecell;t.tablecell=function(ae,U){return z(R(ae),U)},t.code=function(ae,U,H){var te=(U||"").match(/\S*/)[0];return te?["latex","katex","math"].indexOf(te)>=0?"

    ".concat(ae,"

    "):'
    ').concat(H?ae:Object(r.escape)(ae,!0),`
    `):'
    '+(H?ae:Object(r.escape)(ae,!0))+"
    "},t.heading=function(ae,U,H){var te=this.options.headerPrefix+H.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:te,level:U,text:ae}),"'+ae+""},o.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),o.a.use({tokenizer:m,renderer:t});var q=o.a,B=V("SJMd"),M=V("ulZh"),G=V.n(M),J=V("m3rI"),K=V("Oy/b"),Z=V("p5ED"),le=V("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 de=function(ae,U){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,te){H.__proto__=te}||function(H,te){for(var pe in te)Object.prototype.hasOwnProperty.call(te,pe)&&(H[pe]=te[pe])})(ae,U)};function Te(ae,U){function H(){this.constructor=ae}de(ae,U),ae.prototype=U===null?Object.create(U):(H.prototype=U.prototype,new H)}function we(ae,U,H,te){return new(H||(H=Promise))(function(pe,se){function $e(Yt){try{Ot(te.next(Yt))}catch(St){se(St)}}function yt(Yt){try{Ot(te.throw(Yt))}catch(St){se(St)}}function Ot(Yt){var St;Yt.done?pe(Yt.value):(St=Yt.value,St instanceof H?St:new H(function(Wt){Wt(St)})).then($e,yt)}Ot((te=te.apply(ae,U||[])).next())})}function Ie(ae,U){var H,te,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:yt(0),throw:yt(1),return:yt(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function yt(Ot){return function(Yt){return function(St){if(H)throw new TypeError("Generator is already executing.");for(;$e;)try{if(H=1,te&&(pe=2&St[0]?te.return:St[0]?te.throw||((pe=te.return)&&pe.call(te),0):te.next)&&!(pe=pe.call(te,St[1])).done)return pe;switch(te=0,pe&&(St=[2&St[0],pe.value]),St[0]){case 0:case 1:pe=St;break;case 4:return $e.label++,{value:St[1],done:!1};case 5:$e.label++,te=St[1],St=[0];continue;case 7:St=$e.ops.pop(),$e.trys.pop();continue;default:if(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||St[0]!==6&&St[0]!==2)){$e=0;continue}if(St[0]===3&&(!pe||St[1]>pe[0]&&St[1]',"select"),this.addActionButton(te,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(te,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(te,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(te,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(te,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(te,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(te,'',"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(se){var $e=document.createElement("div");$e.className=""+H.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",se.typeName),$e.innerHTML=se.icon,$e.addEventListener("click",function(){H.markerToolbarButtonClicked($e,se)}),H.buttons.push($e),H.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'',"render"),this.addActionButton(pe,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ae.prototype.addButtonClickListener=function(U){this.buttonClickListeners.push(U)},ae.prototype.removeButtonClickListener=function(U){this.buttonClickListeners.indexOf(U)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(U),1)},ae.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ae.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var U=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var H=0;H0&&this.buttonClickListeners.forEach(function(te){return te("marker",H)}),this.markerButtonOverflowBlock.style.display="none"},ae.prototype.actionToolbarButtonClicked=function(U,H){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(te){return te("action",H)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ae.prototype.setActiveButton=function(U){this.resetButtonStyles(),U.className=U.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),U.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ae.prototype.setActiveMarkerButton=function(U){var H=this.markerButtons.find(function(te){return te.getAttribute("data-type-name")===U});H&&this.setActiveButton(H)},ae.prototype.setCurrentMarker=function(U){var H=this;this.currentMarker=U,this.buttons.filter(function(te){return/delete|notes/.test(te.getAttribute("data-action"))}).forEach(function(te){H.currentMarker===void 0?(te.style.fillOpacity="0.4",te.style.pointerEvents="none"):(te.style.fillOpacity="1",te.style.pointerEvents="all")})},ae}(),He=function(){function ae(U,H,te,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=U,this.displayMode=H,this.uiStyleSettings=te,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ae.prototype.addStyles=function(){var U;this.toolboxStyleClass=this.styles.addClass(new me("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 me("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var H=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("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 me("toolbox-panel-row_colors",` background-color: `+((U=this.uiStyleSettings.toolboxBackgroundColor)!==null&&U!==void 0?U:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new me("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px; padding: `+H+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new me("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},ae.prototype.show=function(U){var H;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=U,this.uiContainer.className=this.toolboxStyleClass.name+" "+((H=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ae.prototype.setPanelButtons=function(U){var H,te,pe=this;this.panels=U,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((te=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&te!==void 0?te:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var $e;se.uiStyleSettings=pe.uiStyleSettings;var yt=document.createElement("div");yt.className=pe.toolboxButtonStyleClass.name+" "+(($e=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:pe.toolboxButtonStyleColorsClass.name),yt.innerHTML=se.icon,yt.title=se.title,yt.addEventListener("click",function(){pe.panelButtonClick(se)}),pe.panelButtons.push(yt),pe.buttonRow.appendChild(yt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ae.prototype.panelButtonClick=function(U){var H=this,te=-1;if(U!==this.activePanel){te=this.panels.indexOf(U),this.panelRow.innerHTML="";var pe=U.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=U}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){H.displayMode==="inline"?H.panelRow.style.display="none":H.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,$e){var yt,Ot;se.className=H.toolboxButtonStyleClass.name+" "+($e===te?""+((yt=H.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&yt!==void 0?yt:H.toolboxActiveButtonStyleColorsClass.name):""+((Ot=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:H.toolboxButtonStyleColorsClass.name))})},ae}(),it=function(ae,U){this.title=ae,this.icon=U},re=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=te,$e.currentColor=pe,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.overflow="hidden",te.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var se=H.getColorBox(pe);te.appendChild(se),H.colorBoxes.push(se)}),te},U.prototype.getColorBox=function(H){var te=this,pe=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-pe,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=se-2+"px",$e.style.height=se-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(se+2)/2+"px",$e.style.borderColor=H===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){te.setCurrentColor(H,$e)});var yt=document.createElement("div");return yt.style.display="inline-block",yt.style.width=se-2+"px",yt.style.height=se-2+"px",yt.style.backgroundColor=H,yt.style.borderRadius=se/2+"px",H==="transparent"&&(yt.style.fill=this.uiStyleSettings.toolboxAccentColor,yt.innerHTML=` `),$e.appendChild(yt),$e},U.prototype.setCurrentColor=function(H,te){var pe=this;this.currentColor=H,this.colorBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(H)},U}(it),P=function(){function ae(U,H,te){this._state="new",this._isSelected=!1,this._container=U,this._overlayContainer=H,this.globalSettings=te,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ae.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ae.prototype.ownsTarget=function(U){return!1},Object.defineProperty(ae.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ae.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ae.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ae.prototype.pointerDown=function(U,H){},ae.prototype.dblClick=function(U,H){},ae.prototype.manipulate=function(U){},ae.prototype.pointerUp=function(U){this.stateChanged()},ae.prototype.dispose=function(){},ae.prototype.addMarkerVisualToContainer=function(U){this.container.childNodes.length>0?this.container.insertBefore(U,this.container.childNodes[0]):this.container.appendChild(U)},ae.prototype.getState=function(){return{typeName:ae.typeName,state:this.state,notes:this.notes}},ae.prototype.restoreState=function(U){this._state=U.state,this.notes=U.notes},ae.prototype.scale=function(U,H){},ae.prototype.colorChanged=function(U){this.onColorChanged&&this.onColorChanged(U),this.stateChanged()},ae.prototype.fillColorChanged=function(U){this.onFillColorChanged&&this.onFillColorChanged(U),this.stateChanged()},ae.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var U=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),U.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(U)&&this.onStateChanged(this)}},ae.typeName="MarkerBase",ae}(),j=function(){function ae(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ae.prototype.findGripByVisual=function(U){return this.topLeft.ownsTarget(U)?this.topLeft:this.topCenter.ownsTarget(U)?this.topCenter:this.topRight.ownsTarget(U)?this.topRight:this.centerLeft.ownsTarget(U)?this.centerLeft:this.centerRight.ownsTarget(U)?this.centerRight:this.bottomLeft.ownsTarget(U)?this.bottomLeft:this.bottomCenter.ownsTarget(U)?this.bottomCenter:this.bottomRight.ownsTarget(U)?this.bottomRight:void 0},ae}(),ee=function(){function ae(){this.GRIP_SIZE=10,this.visual=ye.createGroup(),this.visual.appendChild(ye.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ye.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(U){return U===this.visual||U===this.visual.childNodes[0]||U===this.visual.childNodes[1]},ae}(),$=function(){function ae(){}return ae.toITransformMatrix=function(U){return{a:U.a,b:U.b,c:U.c,d:U.d,e:U.e,f:U.f}},ae.toSVGMatrix=function(U,H){return U.a=H.a,U.b=H.b,U.c=H.c,U.d=H.d,U.e=H.e,U.f=H.f,U},ae}(),Q=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(ye.createTransform()),se.setupControlBox(),se}return Te(U,ae),Object.defineProperty(U.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"visual",{get:function(){return this._visual},set:function(H){this._visual=H;var te=ye.createTransform();this._visual.transform.baseVal.appendItem(te)},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(H){return!!ae.prototype.ownsTarget.call(this,H)||!!(this.controlGrips.findGripByVisual(H)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H))},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.left=H.x,this.top=H.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var pe=this.unrotatePoint(H);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(te),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(te)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},U.prototype.pointerUp=function(H){var te=this.state;ae.prototype.pointerUp.call(this,H),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(H),this._state="select",te==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},U.prototype.moveVisual=function(H){this.visual.style.transform="translate("+H.x+"px, "+H.y+"px)"},U.prototype.manipulate=function(H){var te=this.unrotatePoint(H);this.state==="creating"?this.resize(H):this.state==="move"?(this.left=this.manipulationStartLeft+(te.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(te.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(te):this.state==="rotate"&&this.rotate(H)},U.prototype.resize=function(H){var te=this.manipulationStartLeft,pe=this.manipulationStartWidth,se=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:te=this.manipulationStartLeft+H.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-te;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=this.manipulationStartWidth+H.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+H.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+H.y-this.manipulationStartY}pe>=0?(this.left=te,this.width=pe):(this.left=te+pe,this.width=-pe),$e>=0?(this.top=se,this.height=$e):(this.top=se+$e,this.height=-$e),this.setSize()},U.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},U.prototype.rotate=function(H){if(Math.abs(H.x-this.centerX)>.1){var te=Math.sign(H.x-this.centerX);this.rotationAngle=180*Math.atan((H.y-this.centerY)/(H.x-this.centerX))/Math.PI+90*te,this.applyRotation()}},U.prototype.applyRotation=function(){var H=this.container.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(H,0)},U.prototype.rotatePoint=function(H){if(this.rotationAngle===0)return H;var te=this.container.getCTM(),pe=ye.createPoint(H.x,H.y);return{x:(pe=pe.matrixTransform(te)).x,y:pe.y}},U.prototype.unrotatePoint=function(H){if(this.rotationAngle===0)return H;var te=this.container.getCTM();te=te.inverse();var pe=ye.createPoint(H.x,H.y);return{x:(pe=pe.matrixTransform(te)).x,y:pe.y}},U.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},U.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},U.prototype.setupControlBox=function(){this.controlBox=ye.createGroup();var H=ye.createTransform();H.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(H),this.container.appendChild(this.controlBox),this.controlRect=ye.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=ye.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 j,this.addControlGrips(),this.controlBox.style.display="none"},U.prototype.adjustControlBox=function(){var H=this.controlBox.transform.baseVal.getItem(0);H.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(H,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},U.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},U.prototype.createGrip=function(){var H=new ee;return H.visual.transform.baseVal.appendItem(ye.createTransform()),this.controlBox.appendChild(H.visual),H},U.prototype.positionGrips=function(){var H=this.controlGrips.topLeft.GRIP_SIZE,te=-H/2,pe=te,se=(this.width+this.CB_DISTANCE)/2-H/2,$e=(this.height+this.CB_DISTANCE)/2-H/2,yt=this.height+this.CB_DISTANCE-H/2,Ot=this.width+this.CB_DISTANCE-H/2;this.positionGrip(this.controlGrips.topLeft.visual,te,pe),this.positionGrip(this.controlGrips.topCenter.visual,se,pe),this.positionGrip(this.controlGrips.topRight.visual,Ot,pe),this.positionGrip(this.controlGrips.centerLeft.visual,te,$e),this.positionGrip(this.controlGrips.centerRight.visual,Ot,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,te,yt),this.positionGrip(this.controlGrips.bottomCenter.visual,se,yt),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,yt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,pe-3*this.CB_DISTANCE)},U.prototype.positionGrip=function(H,te,pe){var se=H.transform.baseVal.getItem(0);se.setTranslate(te,pe),H.transform.baseVal.replaceItem(se,0)},U.prototype.hideControlBox=function(){this.controlBox.style.display="none"},U.prototype.showControlBox=function(){this.controlBox.style.display=""},U.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:$.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:$.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ae.prototype.getState.call(this))},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.left=te.left,this.top=te.top,this.width=te.width,this.height=te.height,this.rotationAngle=te.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,te.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,te.containerTransformMatrix))},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te);var pe=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:pe.x*H,y:pe.y*te});this.left=se.x,this.top=se.y,this.width=this.width*H,this.height=this.height*te,this.adjustControlBox()},U}(P),xe=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual)},U.prototype.createVisual=function(){this.visual=ye.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},U.prototype.manipulate=function(H){ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),this.setSize()},U.prototype.setSize=function(){ae.prototype.setSize.call(this),ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(H){ae.prototype.pointerUp.call(this,H),this.setSize()},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&ye.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},U.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&ye.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&ye.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&ye.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},U.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this))},U.prototype.restoreState=function(H){var te=H;this.fillColor=te.fillColor,this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.opacity=te.opacity,this.createVisual(),ae.prototype.restoreState.call(this,H),this.setSize()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setSize()},U.title="Rectangle marker",U}(Q),De=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=te,$e.currentWidth=pe,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2",this.widths.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=pe===H.currentWidth?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentWidth(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.innerText=pe.toString(),$e.style.marginRight="5px",se.appendChild($e);var yt=document.createElement("div");yt.style.minHeight="20px",yt.style.flexGrow="2",yt.style.display="flex",yt.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=pe+"px solid "+H.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",yt.appendChild(Ot),se.appendChild(yt),H.widthBoxes.push(se)}),te},U.prototype.setCurrentWidth=function(H,te){var pe=this;this.currentWidth=H,this.widthBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},U}(it),dt=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=te,$e.currentStyle=pe,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2",this.styles.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/H.styles.length-5+"%",se.style.borderColor=pe===H.currentStyle?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentStyle(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var yt=` `;$e.innerHTML=yt,se.appendChild($e),H.styleBoxes.push(se)}),te},U.prototype.setCurrentStyle=function(H,te){var pe=this;this.currentStyle=H,this.styleBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},U}(it),Ne=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(U,ae),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="FrameMarker",U.title="Frame marker",U.icon='',U}(xe),Be=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},tt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!!ae.prototype.ownsTarget.call(this,H)||!(!this.grip1.ownsTarget(H)&&!this.grip2.ownsTarget(H))},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.manipulationStartX=H.x,this.manipulationStartY=H.y,this.state==="new"&&(this.x1=H.x,this.y1=H.y,this.x2=H.x,this.y2=H.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(te)?this.activeGrip=this.grip1:this.grip2.ownsTarget(te)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},U.prototype.pointerUp=function(H){var te=this.state;ae.prototype.pointerUp.call(this,H),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(H),this._state="select",te==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},U.prototype.adjustVisual=function(){},U.prototype.manipulate=function(H){this.state==="creating"?this.resize(H):this.state==="move"?(this.x1=this.manipulationStartX1+H.x-this.manipulationStartX,this.y1=this.manipulationStartY1+H.y-this.manipulationStartY,this.x2=this.manipulationStartX2+H.x-this.manipulationStartX,this.y2=this.manipulationStartY2+H.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(H)},U.prototype.resize=function(H){switch(this.activeGrip){case this.grip1:this.x1=H.x,this.y1=H.y;break;case this.grip2:case void 0:this.x2=H.x,this.y2=H.y}this.adjustVisual(),this.adjustControlBox()},U.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},U.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},U.prototype.setupControlBox=function(){this.controlBox=ye.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},U.prototype.adjustControlBox=function(){this.positionGrips()},U.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},U.prototype.createGrip=function(){var H=new ee;return H.visual.transform.baseVal.appendItem(ye.createTransform()),this.controlBox.appendChild(H.visual),H},U.prototype.positionGrips=function(){var H=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-H/2,this.y1-H/2),this.positionGrip(this.grip2.visual,this.x2-H/2,this.y2-H/2)},U.prototype.positionGrip=function(H,te,pe){var se=H.transform.baseVal.getItem(0);se.setTranslate(te,pe),H.transform.baseVal.replaceItem(se,0)},U.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ae.prototype.getState.call(this))},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.x1=te.x1,this.y1=te.y1,this.x2=te.x2,this.y2=te.y2},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.x1=this.x1*H,this.y1=this.y1*te,this.x2=this.x2*H,this.y2=this.y2*te,this.adjustVisual(),this.adjustControlBox()},U}(P),lt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorLine&&H!==this.visibleLine)},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.selectorLine=ye.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ye.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},U.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ye.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ye.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.createVisual(),this.adjustVisual()},U.typeName="LineMarker",U.title="Line marker",U.icon='',U}(tt),qe=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=te,$e.currentFont=pe,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.overflow="hidden",te.style.flexGrow="2",this.fonts.forEach(function(pe){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/H.fonts.length-5+"%",se.style.borderColor=pe===H.currentFont?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentFont(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=pe,$e.style.overflow="hidden";var yt=document.createElement("div");yt.style.whiteSpace="nowrap",yt.style.overflow="hidden",yt.style.textOverflow="ellipsis",yt.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(yt),se.appendChild($e),H.fontBoxes.push(se)}),te},U.prototype.setCurrentFont=function(H,te){var pe=this;this.currentFont=H,this.fontBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},U}(it),Ye=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=pe.defaultColor,se.fontFamily=pe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new re("Color",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Te(U,ae),U.prototype.ownsTarget=function(H){if(ae.prototype.ownsTarget.call(this,H)||H===this.visual||H===this.textElement||H===this.bgRectangle)return!0;var te=!1;return this.textElement.childNodes.forEach(function(pe){pe===H&&(te=!0)}),te},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.bgRectangle=ye.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ye.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ye.createTransform()),this.textElement.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.isMoved=!1,this.pointerDownPoint=H,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},U.prototype.renderText=function(){var H=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(te){H.textElement.appendChild(ye.createTSpan(te.trim()===""?" ":te.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},U.prototype.getTextScale=function(){var H=this.textElement.getBBox(),te=1;if(H.width>0&&H.height>0){var pe=(1*this.width-this.width*this.padding*2/100)/H.width,se=(1*this.height-this.height*this.padding*2/100)/H.height;te=Math.min(pe,se)}return te},U.prototype.getTextPosition=function(H){var te=this.textElement.getBBox(),pe=0,se=0;return te.width>0&&te.height>0&&(pe=(this.width-te.width*H)/2,se=this.height/2-te.height*H/2),{x:pe,y:se}},U.prototype.sizeText=function(){var H=this.textElement.getBBox(),te=this.getTextScale(),pe=this.getTextPosition(te);pe.y-=H.y*te,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+te+", "+te+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(te,te))},U.prototype.manipulate=function(H){ae.prototype.manipulate.call(this,H),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(H.x-this.pointerDownPoint.x)>5||Math.abs(H.y-this.pointerDownPoint.y)>5)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),this.isMoved=!0,this.setSize(),this.sizeText()},U.prototype.setSize=function(){ae.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},U.prototype.pointerUp=function(H){var te=this.state;te==="creating"&&(this._suppressMarkerCreateEvent=!0),ae.prototype.pointerUp.call(this,H),this.setSize(),(te==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},U.prototype.showTextEditor=function(){var H=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(te){te.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var te=Number.parseFloat(H.textEditor.style.fontSize);H.textEditor.clientWidth>=Number.parseInt(H.textEditor.style.maxWidth)&&te>.9;)te-=.1,H.textEditor.style.fontSize=Math.max(te,.9)+"em"}),this.textEditor.addEventListener("keyup",function(te){te.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(te){if(te.clipboardData){var pe=te.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(pe)),te.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){H.textEditDivClicked(H.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},U.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var H=this.getTextScale(),te=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),pe=this.textElement.getBBox(),se={x:pe.width*H,y:pe.height*H};te.x-=se.x/2,te.y-=se.y/2,this.textEditor.style.top=te.y+"px",this.textEditor.style.left=te.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-te.x+"px",this.textEditor.style.fontSize=Math.max(16*H,12)+"px",this.textElement.style.display="none"}},U.prototype.textEditDivClicked=function(H){this.text=H.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},U.prototype.select=function(){ae.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},U.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ae.prototype.deselect.call(this)},U.prototype.dblClick=function(H,te){ae.prototype.dblClick.call(this,H,te),this.showTextEditor()},U.prototype.setColor=function(H){this.textElement&&ye.setAttributes(this.textElement,[["fill",H]]),this.color=H,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(H)},U.prototype.setFont=function(H){this.textElement&&ye.setAttributes(this.textElement,[["font-family",H]]),this.fontFamily=H,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},U.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},U.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){var te=H;this.color=te.color,this.fontFamily=te.fontFamily,this.padding=te.padding,this.text=te.text,this.createVisual(),ae.prototype.restoreState.call(this,H),this.setSize()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setSize(),this.sizeText(),this.positionTextEditor()},U.typeName="TextMarker",U.title="Text marker",U.icon='',U}(Q),je=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=pe.defaultColor,se.lineWidth=pe.defaultStrokeWidth,se.pixelRatio=pe.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new re("Color",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.drawingImage)},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.drawingImage=ye.createImage(),this.visual.appendChild(this.drawingImage);var H=ye.createTransform();this.visual.transform.baseVal.appendItem(H),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){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(H.x,H.y),this.drawing=!0):ae.prototype.pointerDown.call(this,H,te)},U.prototype.manipulate=function(H){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(H.x,H.y),this.canvasContext.stroke()):ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(H){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ae.prototype.pointerUp.call(this,H)},U.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},U.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.select.call(this)},U.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.deselect.call(this)},U.prototype.finishCreation=function(){for(var H=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),te=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=te[0],se=te[1],$e=te[2],yt=te[3],Ot=!1,Yt=0;Yt0&&(Ot=!0,Ytyt&&(yt=Yt),St>$e&&($e=St));if(Ot){this.left=pe/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-pe)/this.pixelRatio,this.height=(yt-se)/this.pixelRatio;var Wt=document.createElement("canvas");Wt.width=$e-pe,Wt.height=yt-se,Wt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,se,$e-pe,yt-se),0,0),this.drawingImgUrl=Wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},U.prototype.setDrawingImage=function(){ye.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},U.prototype.setColor=function(H){this.color=H,this.colorChanged(H)},U.prototype.setLineWidth=function(H){this.lineWidth=H},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({drawingImgUrl:this.drawingImgUrl},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){this.createVisual(),ae.prototype.restoreState.call(this,H),this.drawingImgUrl=H.drawingImgUrl,this.setDrawingImage()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setDrawingImage()},U.typeName="FreehandMarker",U.title="Freehand marker",U.icon='',U}(Q),Ue=function(ae){function U(H,te,pe){var se=ae.call(this,H,pe||'')||this;return se.typeBoxes=[],se.currentType=te,se.setCurrentType=se.setCurrentType.bind(se),se}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2";for(var pe=function(yt){var Ot="both";switch(yt){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var Yt=document.createElement("div");if(Yt.style.display="flex",Yt.style.flexGrow="2",Yt.style.alignItems="center",Yt.style.justifyContent="space-between",Yt.style.padding="5px",Yt.style.borderWidth="2px",Yt.style.borderStyle="solid",Yt.style.borderColor=Ot===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Yt.addEventListener("click",function(){H.setCurrentType(Ot,Yt)}),te.appendChild(Yt),Ot==="both"||Ot==="start"){var St=document.createElement("div");St.style.display="flex",St.style.alignItems="center",St.style.minHeight="20px",St.innerHTML=` `,St.style.marginLeft="5px",Yt.appendChild(St)}var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.style.flexGrow="2";var ln=document.createElement("hr");if(ln.style.minWidth="20px",ln.style.border="0px",ln.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),ln.style.flexGrow="2",Wt.appendChild(ln),Yt.appendChild(Wt),Ot==="both"||Ot==="end"){var Bn=document.createElement("div");Bn.style.display="flex",Bn.style.alignItems="center",Bn.style.minHeight="20px",Bn.innerHTML=` `,Bn.style.marginRight="5px",Yt.appendChild(Bn)}se.typeBoxes.push(Yt)},se=this,$e=0;$e<4;$e++)pe($e);return te},U.prototype.setCurrentType=function(H,te){var pe=this;this.currentType=H,this.typeBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},U}(it),ke=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Ue("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.arrow1&&H!==this.arrow2)},U.prototype.getArrowPoints=function(H,te){var pe=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return H-pe/2+","+(te+se/2)+" "+H+","+(te-se/2)+" "+(H+pe/2)+","+(te+se/2)},U.prototype.createTips=function(){this.arrow1=ye.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ye.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.arrow2)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="creating"&&this.createTips()},U.prototype.adjustVisual=function(){if(ae.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",ye.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ye.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),te=this.arrow1.transform.baseVal.getItem(0);te.setRotate(H,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(te,0);var pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(H+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,0)}},U.prototype.setArrowType=function(H){this.arrowType=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({arrowType:this.arrowType},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.arrowType=te.arrowType,this.createTips(),this.adjustVisual()},U.typeName="ArrowMarker",U.title="Arrow marker",U.icon='',U}(lt),be=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.fillColor=pe.defaultFillColor,se.strokeWidth=0,se.fillPanel=new re("Color",pe.defaultColorSet,pe.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Te(U,ae),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="CoverMarker",U.title="Cover marker",U.icon='',U}(xe),Ce=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=te,$e.currentOpacity=pe,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2",te.style.justifyContent="space-between",this.opacities.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=pe===H.currentOpacity?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentOpacity(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.innerText=100*pe+"%",se.appendChild($e),H.opacityBoxes.push(se)}),te},U.prototype.setCurrentOpacity=function(H,te){var pe=this;this.currentOpacity=H,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},U}(it),Pe=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=pe.defaultHighlightColor,se.strokeWidth=0,se.opacity=pe.defaultHighlightOpacity,se.fillPanel=new re("Color",pe.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ce("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Te(U,ae),U.prototype.setOpacity=function(H){this.opacity=H,this.visual&&ye.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="HighlightMarker",U.title="Highlight marker",U.icon='',U}(be),Le='',Ve=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=pe.defaultStrokeColor,se.bgColor=pe.defaultFillColor,se.fontFamily=pe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new re("Text color",pe.defaultColorSet,se.color,''),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new re("Fill color",pe.defaultColorSet,se.bgColor,Le),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new ee,se.tipGrip.visual.transform.baseVal.appendItem(ye.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Te(U,ae),U.prototype.ownsTarget=function(H){return ae.prototype.ownsTarget.call(this,H)||this.tipGrip.ownsTarget(H)||this.tip===H},U.prototype.createTip=function(){ye.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ye.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},U.prototype.pointerDown=function(H,te){this.state==="new"&&ae.prototype.pointerDown.call(this,H,te),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(te)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ae.prototype.pointerDown.call(this,H,te)},U.prototype.pointerUp=function(H){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ae.prototype.pointerUp.call(this,H);else{var te=this.state==="creating";ae.prototype.pointerUp.call(this,H),this.setTipPoints(te),this.positionTip()}},U.prototype.manipulate=function(H){if(this.tipMoving){var te=this.unrotatePoint(H);this.tipPosition={x:te.x-this.manipulationStartLeft,y:te.y-this.manipulationStartTop},this.positionTip()}else ae.prototype.manipulate.call(this,H)},U.prototype.setBgColor=function(H){this.bgRectangle&&this.tip&&(ye.setAttributes(this.bgRectangle,[["fill",H]]),ye.setAttributes(this.tip,[["fill",H]])),this.bgColor=H,this.fillColorChanged(H)},U.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},U.prototype.setTipPoints=function(H){H===void 0&&(H=!1);var te=Math.min(this.height/2,15),pe=this.height/5;H&&(this.tipPosition={x:te+pe/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?se.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),te=this.tip1.transform.baseVal.getItem(0);te.setRotate(H,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(te,0);var pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(H+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,0)}},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H),this.createTips(),this.adjustVisual()},U.typeName="MeasurementMarker",U.title="Measurement marker",U.icon='',U}(lt),kt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokePanel.colors=pe.defaultColorSet,se.fillColor="transparent",se}return Te(U,ae),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="EllipseFrameMarker",U.title="Ellipse frame marker",U.icon='',U}(at),Bt=function(){function ae(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ae.prototype.addUndoStep=function(U){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(U)||(this.undoStack.push(U),JSON.stringify(this.lastRedoStep)!==JSON.stringify(U)&&this.redoStack.splice(0,this.redoStack.length))},ae.prototype.replaceLastUndoStep=function(U){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=U)},ae.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ae.prototype.undo=function(){if(this.undoStack.length>1){var U=this.undoStack.pop();return U!==void 0&&this.redoStack.push(U),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ae.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ae}(),jt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorCurve&&H!==this.visibleCurve&&!this.curveGrip.ownsTarget(H))},U.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.selectorCurve=ye.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ye.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=H.x,this.curveY=H.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(te)&&(this.activeGrip=this.curveGrip,this._state="resize")},U.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ye.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ye.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setupControlBox=function(){ae.prototype.setupControlBox.call(this),this.curveControlLine1=ye.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ye.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},U.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ae.prototype.addControlGrips.call(this)},U.prototype.positionGrips=function(){ae.prototype.positionGrips.call(this);var H=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-H/2,this.curveY-H/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},U.prototype.manipulate=function(H){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+H.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+H.y-this.manipulationStartY),ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){this.activeGrip===this.curveGrip&&(this.curveX=H.x,this.curveY=H.y),ae.prototype.resize.call(this,H),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual()},U.prototype.scale=function(H,te){this.curveX=this.curveX*H,this.curveY=this.curveY*te,ae.prototype.scale.call(this,H,te)},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.curveX=te.curveX,this.curveY=te.curveY,this.createVisual(),this.adjustVisual()},U.typeName="CurveMarker",U.title="Curve marker",U.icon='',U}(tt),At=function(){function ae(U,H){H===void 0&&(H=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=U,this.cancelable=H}return Object.defineProperty(ae.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ae.prototype.preventDefault=function(){this._defaultPrevented=!0},ae}(),pt=function(ae){function U(H,te,pe){var se=ae.call(this,H,!1)||this;return se.dataUrl=te,se.state=pe,se}return Te(U,ae),U}(At),gt=function(ae){function U(H,te,pe){pe===void 0&&(pe=!1);var se=ae.call(this,H,pe)||this;return se.marker=te,se}return Te(U,ae),U}(At),rt=function(){function ae(){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 ae.prototype.addEventListener=function(U,H){this[U].push(H)},ae.prototype.removeEventListener=function(U,H){var te=this[U].indexOf(H);te>-1&&this[U].splice(te,1)},ae}(),Oe=function(){function ae(U){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new Bt,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 rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ae.instanceCounter++,this.styles=new Ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=U,this.targetRoot=document.body,this.width=U.clientWidth,this.height=U.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ae.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ne,je,ke,Ye,kt,at,Pe,Ve,_t,be,lt,jt]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,je,ke,Ye,at,Pe,Ve]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,je,ke,Ye,Pe]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(U){var H=this;this._availableMarkerTypes.splice(0),U.forEach(function(te){if(typeof te=="string"){var pe=H.ALL_MARKER_TYPES.find(function(se){return se.typeName===te});pe!==void 0&&H._availableMarkerTypes.push(pe)}else H._availableMarkerTypes.push(te)})},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(U){this._zoomLevel=U,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ae.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ae.prototype.show=function(){var U=this;this.styles.styleSheetRoot===void 0&&Fe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Fe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(H){return H(new At(U))})},ae.prototype.render=function(){return we(this,void 0,void 0,function(){var U;return Ie(this,function(H){switch(H.label){case 0:return this.setCurrentMarker(),(U=new Me).naturalSize=this.renderAtNaturalSize,U.imageType=this.renderImageType,U.imageQuality=this.renderImageQuality,U.markersOnly=this.renderMarkersOnly,U.width=this.renderWidth,U.height=this.renderHeight,[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return H.sent(),[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,H.sent()]}})})},ae.prototype.close=function(U){var H=this;if(U===void 0&&(U=!1),this.isOpen){var te=!1;U||this.eventListeners.beforeclose.forEach(function(pe){var se=new At(H,!0);pe(se),se.defaultPrevented&&(te=!0)}),te||(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(pe){return pe(new At(H))}),this.detachEvents(),this._isOpen=!1)}},ae.prototype.addMarkersToToolbar=function(){for(var U,H=[],te=0;tethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*U:this.editorCanvas.clientWidth,te=H',U.title="Powered by marker.js",U.style.display="grid",U.style.alignItems="center",U.style.justifyItems="center",U.style.padding="3px",U.style.width="20px",U.style.height="20px",this.logoUI.appendChild(U),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ae.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")},ae.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"},ae.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ae.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var U=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new We(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-1&&this.markers.splice(this.markers.indexOf(U),1),U.dispose()},ae.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())},ae.prototype.toolbarButtonClicked=function(U,H){if(U==="marker"&&H!==void 0)this.createNewMarker(H);else if(U==="action")switch(H){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()}},ae.prototype.deleteSelectedMarker=function(){var U=this;if(this._currentMarker!==void 0){var H=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var se=new gt(U,U._currentMarker,!0);pe(se),se.defaultPrevented&&(H=!0)}),!H){var te=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(pe){return pe(new gt(U,te))})}}},ae.prototype.clear=function(){var U=this,H=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var yt=new gt(U,void 0,!0);$e(yt),yt.defaultPrevented&&(H=!0)}),!H)){this.setCurrentMarker();for(var te=function($e){var yt=pe.markers[$e];pe.setCurrentMarker(pe.markers[$e]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(Ot){return Ot(new gt(U,yt))})},pe=this,se=this.markers.length-1;se>=0;se--)te(se);this.addUndoStep()}},Object.defineProperty(ae.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ae.prototype.showNotesEditor=function(){var U;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(U=this._currentMarker.notes)!==null&&U!==void 0?U:"",this.overlayContainer.appendChild(this.notesArea))},ae.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)},ae.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ae.prototype.addUndoStep=function(){var U=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var H=this.getState(),te=this.undoRedoManager.getLastUndoStep();if(!te||te.width===H.width&&te.height===H.height){var pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(H),pe1&&this.panTo({x:U.clientX,y:U.clientY}))},ae.prototype.onPointerUp=function(U){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(U.clientX,U.clientY)),this.isDragging=!1,this.addUndoStep()},ae.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ae.prototype.onKeyUp=function(U){this._currentMarker===void 0||this.notesArea!==void 0||U.key!=="Delete"&&U.key!=="Backspace"||this.deleteSelectedMarker()},ae.prototype.clientToLocalCoordinates=function(U,H){var te=this.markerImage.getBoundingClientRect();return{x:(U-te.left)/this.zoomLevel,y:(H-te.top)/this.zoomLevel}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var U=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ae.prototype.addLicenseKey=function(U){Ke.addKey(U)},ae.prototype.addEventListener=function(U,H){this.eventListeners.addEventListener(U,H)},ae.prototype.removeEventListener=function(U,H){this.eventListeners.removeEventListener(U,H)},ae.prototype.renderState=function(U){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(U),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ae.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ae.prototype.focus=function(){var U=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(H){return H(new At(U))}))},ae.prototype.blur=function(){var U=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(H){return H(new At(U))}))},ae.instanceCounter=0,ae}();/* ********************************** 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 ze=function(ae,U){return(ze=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,te){H.__proto__=te}||function(H,te){for(var pe in te)Object.prototype.hasOwnProperty.call(te,pe)&&(H[pe]=te[pe])})(ae,U)};function vt(ae,U){if(typeof U!="function"&&U!==null)throw new TypeError("Class extends value "+String(U)+" is not a constructor or null");function H(){this.constructor=ae}ze(ae,U),ae.prototype=U===null?Object.create(U):(H.prototype=U.prototype,new H)}function st(ae,U,H,te){return new(H||(H=Promise))(function(pe,se){function $e(Yt){try{Ot(te.next(Yt))}catch(St){se(St)}}function yt(Yt){try{Ot(te.throw(Yt))}catch(St){se(St)}}function Ot(Yt){var St;Yt.done?pe(Yt.value):(St=Yt.value,St instanceof H?St:new H(function(Wt){Wt(St)})).then($e,yt)}Ot((te=te.apply(ae,U||[])).next())})}function It(ae,U){var H,te,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:yt(0),throw:yt(1),return:yt(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function yt(Ot){return function(Yt){return function(St){if(H)throw new TypeError("Generator is already executing.");for(;$e;)try{if(H=1,te&&(pe=2&St[0]?te.return:St[0]?te.throw||((pe=te.return)&&pe.call(te),0):te.next)&&!(pe=pe.call(te,St[1])).done)return pe;switch(te=0,pe&&(St=[2&St[0],pe.value]),St[0]){case 0:case 1:pe=St;break;case 4:return $e.label++,{value:St[1],done:!1};case 5:$e.label++,te=St[1],St=[0];continue;case 7:St=$e.ops.pop(),$e.trys.pop();continue;default:if(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||St[0]!==6&&St[0]!==2)){$e=0;continue}if(St[0]===3&&(!pe||St[1]>pe[0]&&St[1]0&&H>0){var te=new oe(U,H),pe=te.ratio>=1?20:te.getHorizontalLength(20),se=te.ratio<1?20:te.getVerticalLength(20),$e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("xmlns","http://www.w3.org/2000/svg"),$e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($e);var yt=Ze.createDefs();$e.appendChild(yt);var Ot=Ze.createElement("clipPath",[["id","text-bg-clip"]]);yt.appendChild(Ot);var Yt=Ze.createPath(Ze.getHollowRectanglePath((24-pe)/2,(24-se)/2,pe,se,(24-pe)/2+2,(24-se)/2+2,pe-4,se-4));$e.appendChild(Yt);var St=Ze.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);St.appendChild(Ze.createTSpan(U+":"+H)),$e.appendChild(St);var Wt=St.getBBox();Ze.setAttributes(St,[["x",((24-Wt.width)/2).toString()],["y",((24-Wt.height)/2-Wt.y).toString()]]);var ln=Ze.createPath(Ze.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Wt.width))/2,(24-Math.ceil(Wt.height))/2,Math.ceil(Wt.width),Math.ceil(Wt.height)));return Ot.appendChild(ln),Ze.setAttributes(Yt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($e),$e.outerHTML}return''},ae}(),Ae=function(ae){function U(H,te,pe){var se=ae.call(this,H,te)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=pe,se}return vt(U,ae),U.prototype.setupDropdown=function(){var H=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(te){te.className=H.className,te.colorsClassName=H.colorsClassName,H.dropdownBlock.appendChild(te.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},U.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},U.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},U.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},U.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},U.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},U}(X),Qe=function(){function ae(U,H){this.GRIP_SIZE=10,this.color=U,this.fillColor=H,this.visual=Ze.createGroup(),this.visual.appendChild(Ze.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ze.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(U){return U===this.visual||U===this.visual.childNodes[0]||U===this.visual.childNodes[1]},ae.prototype.setCenter=function(U,H){this.visual.childNodes.forEach(function(te){return Ze.setAttributes(te,[["cx",U.toString()],["cy",H.toString()]])})},ae}(),ot=function(){function ae(U,H,te,pe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=U,this.canvasHeight=H,this.margin=te,this.container=pe,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(ae.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(U){this._aspectRatio=U,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(U){this._isGridVisible=U,this.gridContainer&&Ze.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(U){this._zoomFactor=U,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ae.prototype.open=function(){var U=this;this.cropShadeElement=Ze.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ze.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var H=0;Hthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-H.height/2),Ze.setAttributes(this.cropRectElement,[["x",H.x.toString()],["y",H.y.toString()],["width",H.width.toString()],["height",H.height.toString()]]);var te=H.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var yt=H.y+te*($e+1);Ze.setAttributes(se,[["x1",""+H.x],["y1",""+yt],["x2",""+(H.x+H.width)],["y2",""+yt]])});var pe=H.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var yt=H.x+pe*($e+1);Ze.setAttributes(se,[["x1",""+yt],["y1",""+H.y],["x2",""+yt],["y2",""+(H.y+H.height)]])}),Ze.setAttributes(this.cropShadeElement,[["d",Ze.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,H.x,H.y,H.width,H.height)]]),this.topLeftGrip.setCenter(H.x,H.y),this.topRightGrip.setCenter(H.x+H.width,H.y),this.bottomLeftGrip.setCenter(H.x,H.y+H.height),this.bottomRightGrip.setCenter(H.x+H.width,H.y+H.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ae.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)},ae.prototype.clientToLocalCoordinates=function(U,H){var te=this.container.getBoundingClientRect();return{x:U-te.left+this.margin,y:H-te.top+this.margin}},ae.prototype.onPointerDown=function(U){this.container.setPointerCapture(U.pointerId),this.previousPoint=this.clientToLocalCoordinates(U.clientX,U.clientY),this.cropRectElement===U.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(U.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(U.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(U.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(U.target)&&(this.activeGrip=this.bottomRightGrip)},ae.prototype.onPointerMove=function(U){if(this.isMoving)this.move(this.clientToLocalCoordinates(U.clientX,U.clientY));else if(this.activeGrip){var H=this.clientToLocalCoordinates(U.clientX,U.clientY);this.resize(H)}U.preventDefault()},ae.prototype.onPointerUp=function(U){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(U.pointerId)},ae.prototype.move=function(U){var H=U.x-this.previousPoint.x,te=U.y-this.previousPoint.y;this.zoomFactor!==1&&(H=-H/this.zoomFactor,te=-te/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+H),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+te),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=U},ae.prototype.resize=function(U){var H=Object.assign({},this.cropRect),te=U.x-this.previousPoint.x,pe=U.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:H.x+tethis.canvasWidth*this.zoomFactor&&(te=this.canvasWidth*this.zoomFactor-H.width),H.width+=te}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(H.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(te),H.height=this.aspectRatio.getVerticalLength(H.width)):(H.y+=pe,H.height=this.cropRect.y+this.cropRect.height-H.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?H.height=this.aspectRatio.getVerticalLength(H.width):H.height+=pe}H.width<10&&(H.x=this.cropRect.x,H.width=10),H.height<10&&(H.y=this.cropRect.y,H.height=10),this.previousPoint=U,H.x>=this.margin&&H.y>=this.margin&&H.x-this.margin+H.width<=this.canvasWidth&&H.y-this.margin+H.height<=this.canvasHeight&&(this.cropRect=H,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ae.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var U=this.cropRect.x+this.cropRect.width/2,H=this.cropRect.y+this.cropRect.height/2,te=this.aspectRatio.getHorizontalLength(this.cropRect.height),pe=this.aspectRatio.getVerticalLength(this.cropRect.width);te/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=U-this.cropRect.width/2,this.cropRect.y=H-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)}},ae.prototype.getRescaledRect=function(U,H,te,pe,se,$e){var yt=te/U,Ot=pe/H;return{x:(se.x-$e)*yt+$e,y:(se.y-$e)*Ot+$e,width:se.width*yt,height:se.height*Ot}},ae.prototype.scaleCanvas=function(U,H){var te=this.getRescaledRect(this.canvasWidth,this.canvasHeight,U,H,this.cropRect,this.margin);this.canvasWidth=U,this.canvasHeight=H,this.onCropChange&&this.onCropChange(te),this.setCropRectangle(te)},ae}(),Rt=function(){function ae(U){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=U,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ae.prototype,"angle",{get:function(){return this._angle},set:function(U){this._angle=U,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ae.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},ae.prototype.onPointerDown=function(U){this.controlContainer.setPointerCapture(U.pointerId),this.isDragging=!0,this.previousPoint={x:U.clientX,y:U.clientY}},ae.prototype.onPointerMove=function(U){this.isDragging&&(this.onAngleChange&&this.onAngleChange((U.clientX-this.previousPoint.x)/5),this.previousPoint.x=U.clientX)},ae.prototype.onPointerUp=function(U){this.isDragging&&this.onAngleChange&&this.onAngleChange((U.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(U.pointerId)},ae.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var U=this.angleLabelText.getBBox();Ze.setAttributes(this.angleLabelElement,[["x",((this.width-U.width)/2).toString()],["y",(this.height/2).toString()]])}},ae.prototype.positionScaleShape=function(){if(this.scaleShape){var U=this.scaleShape.transform.baseVal.getItem(0);U.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(U,0)}},ae.prototype.getVisual=function(){var U=document.createElementNS("http://www.w3.org/2000/svg","svg");U.setAttribute("xmlns","http://www.w3.org/2000/svg"),U.setAttribute("width",this.width+"px"),U.setAttribute("height",this.height+"px"),U.setAttribute("viewBox","0 0 "+this.width+" "+this.height),U.style.flexShrink="0",document.body.appendChild(U);for(var H="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,te=1;te<=this.width/5+10;te++){var pe=te%5==0?this.height/3:this.height/6;H+="h4v"+-pe+"h1v"+pe}H+="v1H0Z",this.scaleShape=Ze.createPath(H);var se=Ze.createTransform();this.scaleShape.transform.baseVal.appendItem(se),U.appendChild(this.scaleShape),this.angleLabelElement=Ze.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ze.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $e=Ze.createTSpan("");return $e.innerHTML="°",this.angleLabelElement.appendChild($e),U.appendChild(this.angleLabelElement),document.body.removeChild(U),U},ae}(),Nt=function(){function ae(){this.naturalSize=!1,this.imageType="image/png"}return ae.prototype.rasterize=function(U,H,te,pe,se,$e,yt){var Ot=this;return new Promise(function(Yt){var St=document.createElement("canvas");St.width=U.width.baseVal.value-2*pe,St.height=U.height.baseVal.value-2*pe;var Wt=1,ln=1;Ot.naturalSize===!0?(Wt=H.naturalWidth/(U.width.baseVal.value-2*pe)/$e,ln=H.naturalHeight/(U.height.baseVal.value-2*pe)/yt,St.width=H.naturalWidth/$e,St.height=H.naturalHeight/yt):Ot.width!==void 0&&Ot.height!==void 0&&(Wt=Ot.width/te.width,ln=Ot.height/te.height,St.width*=Wt,St.height*=ln);var Bn=St.getContext("2d");Bn.translate(St.width/2,St.height/2),Bn.rotate(se*Math.PI/180),Bn.scale($e,yt),Bn.translate(-St.width/2,-St.height/2),Bn.drawImage(H,0,0,St.width,St.height);var Oi=document.createElement("canvas");Oi.width=te.width*Wt,Oi.height=te.height*ln,Oi.getContext("2d").putImageData(Bn.getImageData((te.x-pe)*Wt,(te.y-pe)*ln,te.width*Wt,te.height*ln),0,0),Yt(Oi.toDataURL(Ot.imageType,Ot.imageQuality))})},ae}(),ht=function(){function ae(U){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ae.instanceCounter++,this.styles=new mt(this.instanceNo),this.target=U,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(U){this._zoomToCropEnabled=U,U?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(U){this._isGridVisible=U,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"gridLines",{get:function(){return this._gridLines},set:function(U){this._gridLines=U,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(U){this._rotationAngle=U,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"aspectRatio",{get:function(){var U;return(U=this._aspectRatio)!==null&&U!==void 0?U:this.aspectRatios[0]},set:function(U){this._aspectRatio=U},enumerable:!1,configurable:!0}),ae.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},ae.prototype.show=function(){this.showUI(),this.open()},ae.prototype.close=function(U){U===void 0&&(U=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),U||this.closeEventListeners.forEach(function(H){return H()}),this._isOpen=!1)},ae.prototype.addRenderEventListener=function(U){this.renderEventListeners.push(U)},ae.prototype.removeRenderEventListener=function(U){this.renderEventListeners.indexOf(U)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(U),1)},ae.prototype.addCloseEventListener=function(U){this.closeEventListeners.push(U)},ae.prototype.removeCloseEventListener=function(U){this.closeEventListeners.indexOf(U)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(U),1)},ae.prototype.setupResizeObserver=function(){var U=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){U.resize(U.target.clientWidth,U.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ae.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var U=1*this.target.clientWidth/this.target.clientHeight,H=this.contentDiv.clientWidth/U>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*U:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,te=H+2*this.CANVAS_MARGINU+this.CANVAS_MARGIN?this.target.offsetTop-(U+this.CANVAS_MARGIN):0;this.coverDiv.style.top=H+"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},ae.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ae.prototype.addTopToolbar=function(){var U=this;this.topToolbar=new $t,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 H=new ve;H.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(H);var te=[];this.aspectRatios.forEach(function(ln){var Bn=new X(he.getIcon(ln.horizontal,ln.vertical),ln.horizontal===0&&ln.vertical===0?"FREE":ln.horizontal+":"+ln.vertical);Bn.onClick=function(){return U.ratioButtonClicked(ln)},te.push(Bn)}),this.aspectRatioButton=new Ae(he.getIcon(0,0),"Aspect ratio",te),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,H.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var pe=new X('',"Toggle grid");pe.isActive=this.isGridVisible,pe.onClick=function(){U.isGridVisible=!U.isGridVisible,pe.isActive=U.isGridVisible},H.addButton(pe);var se=new X('',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){U.zoomToCropEnabled=!U.zoomToCropEnabled,se.isActive=U.zoomToCropEnabled},H.addButton(se),!Pt.isLicensed){var $e=new ne;this.topToolbar.addElementBlock($e);var yt=document.createElement("div");yt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ot=document.createElement("a");Ot.style.color="currentColor",Ot.href="https://markerjs.com/products/cropro",Ot.target="_blank",Ot.innerHTML='',yt.appendChild(Ot),$e.addElement(yt)}var Yt=new ve;Yt.minWidth=3*this.toolbarHeight+"px",Yt.contentAlign="end",this.topToolbar.addButtonBlock(Yt);var St=new X('',"OK");St.onClick=this.startRenderAndClose,Yt.addButton(St),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(St.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Wt=new X('',"Close");Wt.onClick=this.close,Yt.addButton(Wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ae.prototype.addBottomToolbar=function(){var U=this;this.bottomToolbar=new $t,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 H=new ve;H.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(H);var te=new X('',"Rotate left");te.onClick=this.rotateLeftButtonClicked,H.addButton(te);var pe=new X('',"Rotate right");pe.onClick=this.rotateRightButtonClicked,H.addButton(pe);var se=new ne;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new Rt("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(Yt){U.rotateBy(Yt),U.straightener.angle=U.rotationAngle},se.addElement(this.straightener.getUI());var $e=new ve;$e.minWidth=2*this.toolbarHeight+"px",$e.contentAlign="end",this.bottomToolbar.addButtonBlock($e);var yt=new X('',"Flip horizontal");yt.onClick=this.flipHorizontallyButtonClicked,$e.addButton(yt);var Ot=new X('',"Flip vertical");Ot.onClick=this.flipVerticallyButtonClicked,$e.addButton(Ot)},ae.prototype.ratioButtonClicked=function(U){this.aspectRatio=U,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ae.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=he.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ae.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ae.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ae.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ae.prototype.restoreState=function(U){if(U){var H=this.cropLayer.getRescaledRect(U.width,U.height,this.imageWidth,this.imageHeight,U.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(H),this.cropRectChanged(H),this.flippedHorizontally=U.flippedHorizontally,this.flippedVertically=U.flippedVertically,this.applyFlip(),this.rotationAngle=U.rotationAngle,this.applyRotation()}},ae.prototype.clientToLocalCoordinates=function(U,H){var te=this.cropImage.getBoundingClientRect();return{x:U-te.left,y:H-te.top}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var U=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ae.prototype.rotateLeftButtonClicked=function(){var U=this.rotationAngle-90;this.rotationAngle%90!=0&&(U+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(U)},ae.prototype.rotateRightButtonClicked=function(){var U=this.rotationAngle+90;this.rotationAngle%90!=0&&(U-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(U)},ae.prototype.rotateTo=function(U){U=(U=U>180?U-360:U)<=-180?U+360:U,this.rotationAngle=U,this.applyRotation()},ae.prototype.rotateBy=function(U){this.rotateTo((this.rotationAngle+U)%360)},ae.prototype.applyRotation=function(){var U=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var H=this.editingTargetRotationContainer.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(H,0);var te=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/te.width,this.imageHeight/te.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=U},ae.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ae.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ae.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ae.prototype.startRenderAndClose=function(){return st(this,void 0,void 0,function(){var U,H;return It(this,function(te){switch(te.label){case 0:return[4,this.render()];case 1:return U=te.sent(),H=this.getState(),this.renderEventListeners.forEach(function(pe){return pe(U,H)}),this.close(!0),[2]}})})},ae.prototype.render=function(){return st(this,void 0,void 0,function(){var U;return It(this,function(H){switch(H.label){case 0:return(U=new Nt).naturalSize=this.renderAtNaturalSize,U.imageType=this.renderImageType,U.imageQuality=this.renderImageQuality,U.width=this.renderWidth,U.height=this.renderHeight,this.unzoomFromCrop(),Ze.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,U.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return H.sent(),[4,U.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,H.sent()]}})})},ae.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new Mt("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var U=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Mt("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*U)+`px; height: `+(this.toolbarHeight-2*U)+`px; padding: `+U+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new Lt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new Lt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*U)+`px; padding: `+U+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Mt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},ae.instanceCounter=0,ae}(),Dt=V("8hTe"),sn=V.n(Dt),Ct=/]*>/g;function hn(ae){var U=document.createElement("div");return U.innerHTML=ae,U.childNodes.length===0?"":U.childNodes[0].nodeValue}var rn=Xe.a=function(ae){var U=ae.value,H=U===void 0?"":U,te=ae.edit,pe=te===void 0?!1:te,se=ae.className,$e=ae.showTextOnly,yt=ae.showLines,Ot=ae.replaces,Yt=ae.zoomImg,St=ae.hasMask,Wt=ae.style,ln=Wt===void 0?{}:Wt,Bn=ae.stylesPrev,Oi=Bn===void 0?{}:Bn,mi=String(H),Wn=Object(p.useRef)(),di=Object(p.useRef)(),hr=Object(p.useState)(""),vi=Object(A.a)(hr,2),gi=vi[0],xi=vi[1],Bi=Object(p.useState)("office"),Ai=Object(A.a)(Bi,2),sr=Ai[0],Di=Ai[1],fr=function(){var wn=new ht(di.current);wn.displayMode="popup",wn.addRenderEventListener(function(){var wi=Object(T.a)(f.a.mark(function Mn(Ri){var oi;return f.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:return Wn.current.style.display="none",Ni.next=3,Object(le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ri}});case 3:oi=Ni.sent,oi!=null&&oi.id&&Ot(di.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(oi==null?void 0:oi.id,"?type=").concat(oi.content_type));case 5:case"end":return Ni.stop()}},Mn)}));return function(Mn){return wi.apply(this,arguments)}}()),wn.show()},lr=function(){var wn=new Oe(di.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var wi=Object(T.a)(f.a.mark(function Mn(Ri){var oi;return f.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:if(Wn.current.style.display="none",!di.current){Ni.next=6;break}return Ni.next=4,Object(le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ri.dataUrl}});case 4:oi=Ni.sent,oi!=null&&oi.id&&Ot(di.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(oi==null?void 0:oi.id,"?type=").concat(oi.content_type));case 6:case"end":return Ni.stop()}},Mn)}));return function(Mn){return wi.apply(this,arguments)}}()),wn.show(),window.markerArea=wn},Wi=Object(p.useMemo)(function(){Wn.current&&(Wn.current.style.zIndex=-1);try{var Hn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,wi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;mi=mi.replace(Hn,"("+J.a.API_SERVER+"/api/attachments/").replace(wn,'"'+J.a.API_SERVER+"/api/attachments/").replace(wi,'"'+J.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(Lr){}var Mn=q(mi),Ri=S();if(mi.match(/\[TOC\]/)&&(Mn=Mn.replace("

    [TOC]

    ",g()),v()),Mn=Mn.replace(/(__special_katext_id_\d+__)/g,function(Lr,Ni){var Qi=Ri[Ni],Br=Qi.type,qi=Qi.expression;return Object(K.renderToString)(hn(qi)||"",{displayMode:Br==="block",throwOnError:!1,output:"html"})}),Mn=Mn.replace(/▁/g,"\u2581\u2581\u2581"),w(),$e){var oi=document.createElement("div");return oi.innerHTML=Mn,oi.innerText}return setTimeout(function(){return Rr()},500),Mn},[mi]),Gi=Object(p.useRef)();y.WebkitLineClamp=yt,yt&&(ln=Object(D.a)(Object(D.a)({},ln),y));function vr(Hn){var wn=Hn.target;if(wn.tagName.toUpperCase()==="IMG"){if(Yt){var wi=wn.getAttribute("src");xi(wi),Di("image")}}else if(wn.tagName.toUpperCase()==="A"){var Mn=wn.getAttribute("href");if(Mn.indexOf("office")>-1)Hn.preventDefault(),xi(Mn),Di("office");else if(Mn.indexOf("application/pdf")>-1)Hn.preventDefault(),xi(Mn),Di("pdf");else if(Mn.indexOf("text/html")>-1)Hn.preventDefault(),xi(Mn),Di("html");else if(Mn.startsWith("#")){Hn.preventDefault();var Ri=document.getElementById(Mn.replace("#",""));Ri&&Ri.scrollIntoView(!0)}}}var Rr=function(){var wn,wi=(wn=Gi.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");wi==null||wi.forEach(function(Mn){if(Mn.oncontextmenu=function(){return!1},Mn.src.indexOf(".m3u8")>-1&&!Mn.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var Ri=new G.a;Ri.loadSource(Mn.src),Ri.attachMedia(Mn)}}})};Object(p.useEffect)(function(){if(Gi.current&&Wi&&(Wi.match(Ct)&&window.PR.prettyPrint()),Gi.current)return Gi.current.addEventListener("click",vr),function(){Gi.current.removeEventListener("click",vr),w(),v()}},[Wi,Gi.current,vr]);var ur=function(wn){if(!pe)return;wn.target.nodeName==="IMG"?(Wn.current.style.zIndex=1,Wn.current.style.display="flex",Wn.current.style.width=wn.target.clientWidth+"px",Wn.current.style.height=wn.target.clientHeight+"px",Wn.current.style.top=wn.target.offsetTop+"px",Wn.current.style.left=wn.target.offsetLeft+"px",di.current.src=wn.target.getAttribute("src")):Wn.current.style.display="none"};return c.a.createElement("div",{style:{position:"relative"}},c.a.createElement("div",{ref:Gi,style:Object(D.a)({},ln),className:"".concat(se||""," markdown-body ").concat(sn.a.mdBody),onMouseOver:ur,dangerouslySetInnerHTML:{__html:Wi}}),c.a.createElement("div",{ref:Wn,className:sn.a.button},c.a.createElement(ie.a,null,c.a.createElement(C.a,{onClick:function(){return fr()}},"\u88C1\u526A"),c.a.createElement(C.a,{onClick:function(){return lr()}},"\u7F16\u8F91"))),c.a.createElement("img",{ref:di,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),c.a.createElement(Z.a,{close:!0,data:gi,type:gi!=null&&gi.length?sr:"",style:Object(D.a)({},Oi),onClose:function(){return xi("")}}))}},"9VGf":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return W});var ce=V("cDcd"),ie=V.n(ce);function W(C,D){var T=Object(ce.useRef)();Object(ce.useEffect)(function(){T.current=C}),Object(ce.useEffect)(function(){function A(){T.current()}if(D!==null){var O=setInterval(A,D);return function(){return clearInterval(O)}}},[D])}},AMnG:function(nt,Xe,V){"use strict";var ce=V("miYZ"),ie=V("tsqr"),W=V("tJVT"),C=V("cDcd"),D=V.n(C),T=V("nWbc"),A=V.n(T),O=V("Ot1p");Xe.a=function(f){var p=f.id,c=f.activeDiscussIndex,s=f.onReplyDiscuss,n=Object(C.useState)(""),o=Object(W.a)(n,2),r=o[0],l=o[1];function a(t){l(t)}function i(){if(!r){ie.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}s(p,r),l("")}return D.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:c===p?"block":"none",width:"100%"}},D.a.createElement(O.a,{miniToolbar:!0,startInit:c===p,defaultValue:r,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:a}),D.a.createElement("a",{onClick:i,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return f});var ce=V("ErOA"),ie=V("ppsT"),W=V.n(ie),C="",D,T="";function A(p){O(p)}function O(p){D=new W.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(s){console.log("addFileSuccess: "+s.file.name),p.addFileSuccess&&p.addFileSuccess(s),D.startUpload()},onUploadstarted:function(s){var n=s.file.name;if(s.videoId){var l="/api/users/".concat(C,"/video_auths.json");Object(ce.a)(l,{method:"put",body:{video_id:s.videoId,title:n,file_name:n,virtual_classroom_id:T}}).then(function(a){if(a.status==-1){p.onUploadError&&p.onUploadError(s);return}var i=a.data,t=i.UploadAuth,d=i.UploadAddress,v=i.VideoId;D.setUploadAuthAndAddress(s,t,d)}).catch(function(a){D.deleteFile(D._curIndex),D.nextUpload(),console.log(a)})}else{var o="/api/users/".concat(C,"/video_auths.json"),r="";Object(ce.a)(o,{method:"Post",body:{title:r+n,file_name:r+n,virtual_classroom_id:T}}).then(function(a){if(a){var i=a.data,t=i.UploadAuth,d=i.UploadAddress,v=i.VideoId;D.setUploadAuthAndAddress(s,t,d,v)}}).catch(function(a){D.deleteFile(D._curIndex),D.nextUpload(),console.log(a)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(s){p.onUploadSucceed&&p.onUploadSucceed(s),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(s,n,o){p.onUploadFailed&&p.onUploadFailed(s),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(s,n,o){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(s,n,o){p.onUploadProgress&&p.onUploadProgress(s,n,o);var r=Math.ceil(o*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(s){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var n="/api/users/".concat(C,"/video_auths.json");Object(ce.a)(n,{method:"put",body:{video_id:s.videoId}}).then(function(o){var r=o.data,l=r.UploadAuth;D.resumeUploadWithAuth(l)}).catch(function(o){console.log(o)})},onUploadEnd:function(s){p.onUploadEnd&&p.onUploadEnd(s),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(D)}function f(p,c,s){p&&(C=p),c&&(T=c),A(s)}},BU3w:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return T});var ce=V("MNnm"),ie="rc-util-key";function W(A){if(A.attachTo)return A.attachTo;var O=document.querySelector("head");return O||document.body}function C(A){var O,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ce.a)())return null;var p=document.createElement("style");if((O=f.csp)===null||O===void 0?void 0:O.nonce){var c;p.nonce=(c=f.csp)===null||c===void 0?void 0:c.nonce}p.innerHTML=A;var s=W(f),n=s.firstChild;return f.prepend&&s.prepend?s.prepend(p):f.prepend&&n?s.insertBefore(p,n):s.appendChild(p),p}var D=new Map;function T(A,O){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=W(f);if(!D.has(p)){var c=C("",f),s=c.parentNode;D.set(p,s),s.removeChild(c)}var n=Array.from(D.get(p).children).find(function(i){return i.tagName==="STYLE"&&i[ie]===O});if(n){var o,r;if(((o=f.csp)===null||o===void 0?void 0:o.nonce)&&n.nonce!==((r=f.csp)===null||r===void 0?void 0:r.nonce)){var l;n.nonce=(l=f.csp)===null||l===void 0?void 0:l.nonce}return n.innerHTML!==A&&(n.innerHTML=A),n}var a=C(A,f);return a[ie]=O,a}},Bd2K:function(nt,Xe,V){(function(ce){ce(V("VrN/"),V("osHv"))})(function(ce){ce.defineOption("autoCloseTags",!1,function(f,p,c){if(c!=ce.Init&&c&&f.removeKeyMap("autoCloseTags"),!p)return;var s={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(s["'/'"]=function(n){return T(n)}),(typeof p!="object"||p.whenOpening!==!1)&&(s["'>'"]=function(n){return C(n)}),f.addKeyMap(s)});var ie=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],W=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function C(f){if(f.getOption("disableInput"))return ce.Pass;for(var p=f.listSelections(),c=[],s=f.getOption("autoCloseTags"),n=0;no.ch&&(t=t.slice(0,t.length-r.end+o.ch));var b=t.toLowerCase();if(!t||r.type=="string"&&(r.end!=o.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&i.close||r.string.indexOf("/")==o.ch-r.start-1||v&&A(v,b)>-1||O(f,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(a)||[],t,o,!0))return ce.Pass;var g=typeof s=="object"&&s.emptyTags;if(g&&A(g,t)>-1){c[n]={text:"/>",newPos:ce.Pos(o.line,o.ch+2)};continue}var m=y&&A(y,b)>-1;c[n]={indent:m,text:">"+(m?` `:"")+"",newPos:m?ce.Pos(o.line+1,0):ce.Pos(o.line,o.ch+1)}}for(var _=typeof s=="object"&&s.dontIndentOnAutoClose,n=p.length-1;n>=0;n--){var x=c[n];f.replaceRange(x.text,p[n].head,p[n].anchor,"+insert");var h=f.listSelections().slice(0);h[n]={head:x.newPos,anchor:x.newPos},f.setSelections(h),!_&&x.indent&&(f.indentLine(x.newPos.line,null,!0),f.indentLine(x.newPos.line+1,null,!0))}}function D(f,p){for(var c=f.listSelections(),s=[],n=p?"/":""&&(v+=">"),s[l]=v}if(f.replaceSelections(s),c=f.listSelections(),!r)for(var l=0;l=0&&p[a]==c;a--)++l;s=r.to;for(var a=1;a0){for(var p=0;p1&&arguments[1]!==void 0?arguments[1]:"",p=[],c=0;c=0;p--){var c=W().key(p);f(C(c),c)}}function A(f){return W().removeItem(f)}function O(){return W().clear()}},DlQD:function(nt,Xe,V){(function(ce,ie){nt.exports=ie()})(this,function(){"use strict";function ce(je,Ue){for(var ke=0;keje.length)&&(Ue=je.length);for(var ke=0,be=new Array(Ue);ke=je.length?{done:!0}:{done:!1,value:je[be++]}}}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 ke=je[Symbol.iterator](),ke.next.bind(ke)}function T(je,Ue){return Ue={exports:{}},je(Ue,Ue.exports),Ue.exports}var A=T(function(je){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 ke(be){je.exports.defaults=be}je.exports={defaults:Ue(),getDefaults:Ue,changeDefaults:ke}}),O=A.defaults,f=A.getDefaults,p=A.changeDefaults,c=/[&<>"']/,s=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},l=function(Ue){return r[Ue]};function a(je,Ue){if(Ue){if(c.test(je))return je.replace(s,l)}else if(n.test(je))return je.replace(o,l);return je}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(je){return je.replace(i,function(Ue,ke){return ke=ke.toLowerCase(),ke==="colon"?":":ke.charAt(0)==="#"?ke.charAt(1)==="x"?String.fromCharCode(parseInt(ke.substring(2),16)):String.fromCharCode(+ke.substring(1)):""})}var d=/(^|[^\[])\^/g;function v(je,Ue){je=je.source||je,Ue=Ue||"";var ke={replace:function(Ce,Pe){return Pe=Pe.source||Pe,Pe=Pe.replace(d,"$1"),je=je.replace(Ce,Pe),ke},getRegex:function(){return new RegExp(je,Ue)}};return ke}var y=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(je,Ue,ke){if(je){var be;try{be=decodeURIComponent(t(ke)).replace(y,"").toLowerCase()}catch(Ce){return null}if(be.indexOf("javascript:")===0||be.indexOf("vbscript:")===0||be.indexOf("data:")===0)return null}Ue&&!b.test(ke)&&(ke=E(Ue,ke));try{ke=encodeURI(ke).replace(/%25/g,"%")}catch(Ce){return null}return ke}var m={},_=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function E(je,Ue){m[" "+je]||(_.test(je)?m[" "+je]=je+"/":m[" "+je]=N(je,"/",!0)),je=m[" "+je];var ke=je.indexOf(":")===-1;return Ue.substring(0,2)==="//"?ke?Ue:je.replace(x,"$1")+Ue:Ue.charAt(0)==="/"?ke?Ue:je.replace(h,"$1")+Ue:je+Ue}var S={exec:function(){}};function w(je){for(var Ue=1,ke,be;Ue=0&&Ve[_t]==="\\";)at=!at;return at?"|":" |"}),be=ke.split(/ \|/),Ce=0;if(be.length>Ue)be.splice(Ue);else for(;be.length=be.length?Ce.slice(be.length):Ce}).join(` `)}var de=function(){function je(ke){this.options=ke||B}var Ue=je.prototype;return Ue.space=function(be){var Ce=this.rules.block.newline.exec(be);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:` `}},Ue.code=function(be,Ce){var Pe=this.rules.block.code.exec(be);if(Pe){var Le=Ce[Ce.length-1];if(Le&&Le.type==="paragraph")return{raw:Pe[0],text:Pe[0].trimRight()};var Ve=Pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:Pe[0],codeBlockStyle:"indented",text:this.options.pedantic?Ve:M(Ve,` `)}}},Ue.fences=function(be){var Ce=this.rules.block.fences.exec(be);if(Ce){var Pe=Ce[0],Le=le(Pe,Ce[3]||"");return{type:"code",raw:Pe,lang:Ce[2]?Ce[2].trim():Ce[2],text:Le}}},Ue.heading=function(be){var Ce=this.rules.block.heading.exec(be);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},Ue.nptable=function(be){var Ce=this.rules.block.nptable.exec(be);if(Ce){var Pe={type:"table",header:G(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(` `):[],raw:Ce[0]};if(Pe.header.length===Pe.align.length){var Le=Pe.align.length,Ve;for(Ve=0;Ve ?/gm,"");return{type:"blockquote",raw:Ce[0],text:Pe}}},Ue.list=function(be){var Ce=this.rules.block.list.exec(be);if(Ce){for(var Pe=Ce[0],Le=Ce[2],Ve=Le.length>1,at=Le[Le.length-1]===")",_t={type:"list",raw:Pe,ordered:Ve,start:Ve?+Le.slice(0,-1):"",loose:!1,items:[]},kt=Ce[0].match(this.rules.block.item),Bt=!1,jt,At,pt,gt,rt,Oe,ze,vt=kt.length,st=0;st1||this.options.smartLists&&pt!==Le)&&(gt=kt.slice(st+1).join(` `),_t.raw=_t.raw.substring(0,_t.raw.length-gt.length),st=vt-1)),rt=Bt||/\n\n(?!\s*$)/.test(jt),st!==vt-1&&(Bt=jt.charAt(jt.length-1)===` `,rt||(rt=Bt)),rt&&(_t.loose=!0),Oe=/^\[[ xX]\] /.test(jt),ze=void 0,Oe&&(ze=jt[1]!==" ",jt=jt.replace(/^\[[ xX]\] +/,"")),_t.items.push({type:"list_item",raw:Pe,task:Oe,checked:ze,loose:rt,text:jt});return _t}},Ue.html=function(be){var Ce=this.rules.block.html.exec(be);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):J(Ce[0]):Ce[0]}},Ue.def=function(be){var Ce=this.rules.block.def.exec(be);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var Pe=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Pe,raw:Ce[0],href:Ce[2],title:Ce[3]}}},Ue.table=function(be){var Ce=this.rules.block.table.exec(be);if(Ce){var Pe={type:"table",header:G(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(` `):[]};if(Pe.header.length===Pe.align.length){Pe.raw=Ce[0];var Le=Pe.align.length,Ve;for(Ve=0;Ve/i.test(Le[0])&&(Ce=!1),!Pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(Le[0])?Pe=!0:Pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Le[0])&&(Pe=!1),{type:this.options.sanitize?"text":"html",raw:Le[0],inLink:Ce,inRawBlock:Pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Le[0]):J(Le[0]):Le[0]}},Ue.link=function(be){var Ce=this.rules.inline.link.exec(be);if(Ce){var Pe=K(Ce[2],"()");if(Pe>-1){var Le=Ce[0].indexOf("!")===0?5:4,Ve=Le+Ce[1].length+Pe;Ce[2]=Ce[2].substring(0,Pe),Ce[0]=Ce[0].substring(0,Ve).trim(),Ce[3]=""}var at=Ce[2],_t="";if(this.options.pedantic){var kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(at);kt?(at=kt[1],_t=kt[3]):_t=""}else _t=Ce[3]?Ce[3].slice(1,-1):"";at=at.trim().replace(/^<([\s\S]*)>$/,"$1");var Bt=Z(Ce,{href:at&&at.replace(this.rules.inline._escapes,"$1"),title:_t&&_t.replace(this.rules.inline._escapes,"$1")},Ce[0]);return Bt}},Ue.reflink=function(be,Ce){var Pe;if((Pe=this.rules.inline.reflink.exec(be))||(Pe=this.rules.inline.nolink.exec(be))){var Le=(Pe[2]||Pe[1]).replace(/\s+/g," ");if(Le=Ce[Le.toLowerCase()],!Le||!Le.href){var Ve=Pe[0].charAt(0);return{type:"text",raw:Ve,text:Ve}}var at=Z(Pe,Le,Pe[0]);return at}},Ue.strong=function(be,Ce,Pe){Pe===void 0&&(Pe="");var Le=this.rules.inline.strong.start.exec(be);if(Le&&(!Le[1]||Le[1]&&(Pe===""||this.rules.inline.punctuation.exec(Pe)))){Ce=Ce.slice(-1*be.length);var Ve=Le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ve.lastIndex=0;for(var at;(Le=Ve.exec(Ce))!=null;)if(at=this.rules.inline.strong.middle.exec(Ce.slice(0,Le.index+3)),at)return{type:"strong",raw:be.slice(0,at[0].length),text:be.slice(2,at[0].length-2)}}},Ue.em=function(be,Ce,Pe){Pe===void 0&&(Pe="");var Le=this.rules.inline.em.start.exec(be);if(Le&&(!Le[1]||Le[1]&&(Pe===""||this.rules.inline.punctuation.exec(Pe)))){Ce=Ce.slice(-1*be.length);var Ve=Le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ve.lastIndex=0;for(var at;(Le=Ve.exec(Ce))!=null;)if(at=this.rules.inline.em.middle.exec(Ce.slice(0,Le.index+2)),at)return{type:"em",raw:be.slice(0,at[0].length),text:be.slice(1,at[0].length-1)}}},Ue.codespan=function(be){var Ce=this.rules.inline.code.exec(be);if(Ce){var Pe=Ce[2].replace(/\n/g," "),Le=/[^ ]/.test(Pe),Ve=Pe.startsWith(" ")&&Pe.endsWith(" ");return Le&&Ve&&(Pe=Pe.substring(1,Pe.length-1)),Pe=J(Pe,!0),{type:"codespan",raw:Ce[0],text:Pe}}},Ue.br=function(be){var Ce=this.rules.inline.br.exec(be);if(Ce)return{type:"br",raw:Ce[0]}},Ue.del=function(be){var Ce=this.rules.inline.del.exec(be);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},Ue.autolink=function(be,Ce){var Pe=this.rules.inline.autolink.exec(be);if(Pe){var Le,Ve;return Pe[2]==="@"?(Le=J(this.options.mangle?Ce(Pe[1]):Pe[1]),Ve="mailto:"+Le):(Le=J(Pe[1]),Ve=Le),{type:"link",raw:Pe[0],text:Le,href:Ve,tokens:[{type:"text",raw:Le,text:Le}]}}},Ue.url=function(be,Ce){var Pe;if(Pe=this.rules.inline.url.exec(be)){var Le,Ve;if(Pe[2]==="@")Le=J(this.options.mangle?Ce(Pe[0]):Pe[0]),Ve="mailto:"+Le;else{var at;do at=Pe[0],Pe[0]=this.rules.inline._backpedal.exec(Pe[0])[0];while(at!==Pe[0]);Le=J(Pe[0]),Pe[1]==="www."?Ve="http://"+Le:Ve=Le}return{type:"link",raw:Pe[0],text:Le,href:Ve,tokens:[{type:"text",raw:Le,text:Le}]}}},Ue.inlineText=function(be,Ce,Pe){var Le=this.rules.inline.text.exec(be);if(Le){var Ve;return Ce?Ve=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Le[0]):J(Le[0]):Le[0]:Ve=J(this.options.smartypants?Pe(Le[0]):Le[0]),{type:"text",raw:Le[0],text:Ve}}},je}(),Te=q.noopTest,we=q.edit,Ie=q.merge,_e={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_e.def=we(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex(),_e.bullet=/(?:[*+-]|\d{1,9}[.)])/,_e.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,_e.item=we(_e.item,"gm").replace(/bull/g,_e.bullet).getRegex(),_e.list=we(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex(),_e._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",_e._comment=//,_e.html=we(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e.paragraph=we(_e._paragraph).replace("hr",_e.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",")|<(?:script|pre|style|!--)").replace("tag",_e._tag).getRegex(),_e.blockquote=we(_e.blockquote).replace("paragraph",_e.paragraph).getRegex(),_e.normal=Ie({},_e),_e.gfm=Ie({},_e.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*|$)"}),_e.gfm.nptable=we(_e.gfm.nptable).replace("hr",_e.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",")|<(?:script|pre|style|!--)").replace("tag",_e._tag).getRegex(),_e.gfm.table=we(_e.gfm.table).replace("hr",_e.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",")|<(?:script|pre|style|!--)").replace("tag",_e._tag).getRegex(),_e.pedantic=Ie({},_e.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Te,paragraph:we(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ye.punctuation=we(ye.punctuation).replace(/punctuation/g,ye._punctuation).getRegex(),ye._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ye._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ye.em.start=we(ye.em.start).replace(/punctuation/g,ye._punctuation).getRegex(),ye.em.middle=we(ye.em.middle).replace(/punctuation/g,ye._punctuation).replace(/overlapSkip/g,ye._overlapSkip).getRegex(),ye.em.endAst=we(ye.em.endAst,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.em.endUnd=we(ye.em.endUnd,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.start=we(ye.strong.start).replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.middle=we(ye.strong.middle).replace(/punctuation/g,ye._punctuation).replace(/blockSkip/g,ye._blockSkip).getRegex(),ye.strong.endAst=we(ye.strong.endAst,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.endUnd=we(ye.strong.endUnd,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.blockSkip=we(ye._blockSkip,"g").getRegex(),ye.overlapSkip=we(ye._overlapSkip,"g").getRegex(),ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ye._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])?)+(?![-_])/,ye.autolink=we(ye.autolink).replace("scheme",ye._scheme).replace("email",ye._email).getRegex(),ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ye.tag=we(ye.tag).replace("comment",_e._comment).replace("attribute",ye._attribute).getRegex(),ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ye._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ye.link=we(ye.link).replace("label",ye._label).replace("href",ye._href).replace("title",ye._title).getRegex(),ye.reflink=we(ye.reflink).replace("label",ye._label).getRegex(),ye.reflinkSearch=we(ye.reflinkSearch,"g").replace("reflink",ye.reflink).replace("nolink",ye.nolink).getRegex(),ye.normal=Ie({},ye),ye.pedantic=Ie({},ye.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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",ye._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ye._label).getRegex()}),ye.gfm=Ie({},ye.normal,{escape:we(ye.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]*?(?:(?=[\\.5&&(be="x"+be.toString(16)),Ue+="&#"+be+";";return Ue}var We=function(){function je(ke){this.tokens=[],this.tokens.links=Object.create(null),this.options=ke||Me,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var be={block:Fe.normal,inline:Ge.normal};this.options.pedantic?(be.block=Fe.pedantic,be.inline=Ge.pedantic):this.options.gfm&&(be.block=Fe.gfm,this.options.breaks?be.inline=Ge.breaks:be.inline=Ge.gfm),this.tokenizer.rules=be}je.lex=function(be,Ce){var Pe=new je(Ce);return Pe.lex(be)};var Ue=je.prototype;return Ue.lex=function(be){return be=be.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(be,this.tokens,!0),this.inline(this.tokens),this.tokens},Ue.blockTokens=function(be,Ce,Pe){Ce===void 0&&(Ce=[]),Pe===void 0&&(Pe=!0),be=be.replace(/^ +$/gm,"");for(var Le,Ve,at,_t;be;){if(Le=this.tokenizer.space(be)){be=be.substring(Le.raw.length),Le.type&&Ce.push(Le);continue}if(Le=this.tokenizer.code(be,Ce)){be=be.substring(Le.raw.length),Le.type?Ce.push(Le):(_t=Ce[Ce.length-1],_t.raw+=` `+Le.raw,_t.text+=` `+Le.text);continue}if(Le=this.tokenizer.fences(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.heading(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.nptable(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.hr(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.blockquote(be)){be=be.substring(Le.raw.length),Le.tokens=this.blockTokens(Le.text,[],Pe),Ce.push(Le);continue}if(Le=this.tokenizer.list(be)){for(be=be.substring(Le.raw.length),at=Le.items.length,Ve=0;Ve0)for(;(kt=this.tokenizer.rules.inline.reflinkSearch.exec(_t))!=null;)Bt.includes(kt[0].slice(kt[0].lastIndexOf("[")+1,-1))&&(_t=_t.slice(0,kt.index)+"["+"a".repeat(kt[0].length-2)+"]"+_t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(kt=this.tokenizer.rules.inline.blockSkip.exec(_t))!=null;)_t=_t.slice(0,kt.index)+"["+"a".repeat(kt[0].length-2)+"]"+_t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;be;){if(at=this.tokenizer.escape(be)){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.tag(be,Pe,Le)){be=be.substring(at.raw.length),Pe=at.inLink,Le=at.inRawBlock,Ce.push(at);continue}if(at=this.tokenizer.link(be)){be=be.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,Le)),Ce.push(at);continue}if(at=this.tokenizer.reflink(be,this.tokens.links)){be=be.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,Le)),Ce.push(at);continue}if(at=this.tokenizer.strong(be,_t,Ve)){be=be.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],Pe,Le),Ce.push(at);continue}if(at=this.tokenizer.em(be,_t,Ve)){be=be.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],Pe,Le),Ce.push(at);continue}if(at=this.tokenizer.codespan(be)){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.br(be)){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.del(be)){be=be.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],Pe,Le),Ce.push(at);continue}if(at=this.tokenizer.autolink(be,me)){be=be.substring(at.raw.length),Ce.push(at);continue}if(!Pe&&(at=this.tokenizer.url(be,me))){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.inlineText(be,Le,Ee)){be=be.substring(at.raw.length),Ve=at.raw.slice(-1),Ce.push(at);continue}if(be){var jt="Infinite loop on byte: "+be.charCodeAt(0);if(this.options.silent){console.error(jt);break}else throw new Error(jt)}}return Ce},ie(je,null,[{key:"rules",get:function(){return{block:Fe,inline:Ge}}}]),je}(),He=A.defaults,it=q.cleanUrl,re=q.escape,P=function(){function je(ke){this.options=ke||He}var Ue=je.prototype;return Ue.code=function(be,Ce,Pe){var Le=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var Ve=this.options.highlight(be,Le);Ve!=null&&Ve!==be&&(Pe=!0,be=Ve)}return Le?'
    '+(Pe?be:re(be,!0))+`
    `:"
    "+(Pe?be:re(be,!0))+`
    `},Ue.blockquote=function(be){return`
    `+be+`
    `},Ue.html=function(be){return be},Ue.heading=function(be,Ce,Pe,Le){return this.options.headerIds?"'+be+" `:""+be+" `},Ue.hr=function(){return this.options.xhtml?`
    `:`
    `},Ue.list=function(be,Ce,Pe){var Le=Ce?"ol":"ul",Ve=Ce&&Pe!==1?' start="'+Pe+'"':"";return"<"+Le+Ve+`> `+be+" `},Ue.listitem=function(be){return"
  • "+be+`
  • `},Ue.checkbox=function(be){return" "},Ue.paragraph=function(be){return"

    "+be+`

    `},Ue.table=function(be,Ce){return Ce&&(Ce=""+Ce+""),` `+be+` `+Ce+`
    `},Ue.tablerow=function(be){return` `+be+` `},Ue.tablecell=function(be,Ce){var Pe=Ce.header?"th":"td",Le=Ce.align?"<"+Pe+' align="'+Ce.align+'">':"<"+Pe+">";return Le+be+" `},Ue.strong=function(be){return""+be+""},Ue.em=function(be){return""+be+""},Ue.codespan=function(be){return""+be+""},Ue.br=function(){return this.options.xhtml?"
    ":"
    "},Ue.del=function(be){return""+be+""},Ue.link=function(be,Ce,Pe){if(be=it(this.options.sanitize,this.options.baseUrl,be),be===null)return Pe;var Le='",Le},Ue.image=function(be,Ce,Pe){if(be=it(this.options.sanitize,this.options.baseUrl,be),be===null)return Pe;var Le=''+Pe+'":">",Le},Ue.text=function(be){return be},je}(),j=function(){function je(){}var Ue=je.prototype;return Ue.strong=function(be){return be},Ue.em=function(be){return be},Ue.codespan=function(be){return be},Ue.del=function(be){return be},Ue.html=function(be){return be},Ue.text=function(be){return be},Ue.link=function(be,Ce,Pe){return""+Pe},Ue.image=function(be,Ce,Pe){return""+Pe},Ue.br=function(){return""},je}(),ee=function(){function je(){this.seen={}}var Ue=je.prototype;return Ue.slug=function(be){var Ce=be.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var Pe=Ce;do this.seen[Pe]++,Ce=Pe+"-"+this.seen[Pe];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},je}(),$=A.defaults,Q=q.unescape,xe=function(){function je(ke){this.options=ke||$,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new j,this.slugger=new ee}je.parse=function(be,Ce){var Pe=new je(Ce);return Pe.parse(be)};var Ue=je.prototype;return Ue.parse=function(be,Ce){Ce===void 0&&(Ce=!0);var Pe="",Le,Ve,at,_t,kt,Bt,jt,At,pt,gt,rt,Oe,ze,vt,st,It,Pt,Ze,mt=be.length;for(Le=0;Le0&&st.tokens[0].type==="text"?(st.tokens[0].text=Ze+" "+st.tokens[0].text,st.tokens[0].tokens&&st.tokens[0].tokens.length>0&&st.tokens[0].tokens[0].type==="text"&&(st.tokens[0].tokens[0].text=Ze+" "+st.tokens[0].tokens[0].text)):st.tokens.unshift({type:"text",text:Ze}):vt+=Ze),vt+=this.parse(st.tokens,ze),pt+=this.renderer.listitem(vt,Pt,It);Pe+=this.renderer.list(pt,rt,Oe);continue}case"html":{Pe+=this.renderer.html(gt.text);continue}case"paragraph":{Pe+=this.renderer.paragraph(this.parseInline(gt.tokens));continue}case"text":{for(pt=gt.tokens?this.parseInline(gt.tokens):gt.text;Le+1An error occurred:

    "+Ne(at.message+"",!0)+"
    ";throw at}}qe.options=qe.setOptions=function(je){return De(qe.defaults,je),tt(qe.defaults),qe},qe.getDefaults=Be,qe.defaults=lt,qe.use=function(je){var Ue=De({},je);if(je.renderer&&function(){var be=qe.defaults.renderer||new P,Ce=function(Ve){var at=be[Ve];be[Ve]=function(){for(var _t=arguments.length,kt=new Array(_t),Bt=0;Bt<_t;Bt++)kt[Bt]=arguments[Bt];var jt=je.renderer[Ve].apply(be,kt);return jt===!1&&(jt=at.apply(be,kt)),jt}};for(var Pe in je.renderer)Ce(Pe);Ue.renderer=be}(),je.tokenizer&&function(){var be=qe.defaults.tokenizer||new de,Ce=function(Ve){var at=be[Ve];be[Ve]=function(){for(var _t=arguments.length,kt=new Array(_t),Bt=0;Bt<_t;Bt++)kt[Bt]=arguments[Bt];var jt=je.tokenizer[Ve].apply(be,kt);return jt===!1&&(jt=at.apply(be,kt)),jt}};for(var Pe in je.tokenizer)Ce(Pe);Ue.tokenizer=be}(),je.walkTokens){var ke=qe.defaults.walkTokens;Ue.walkTokens=function(be){je.walkTokens(be),ke&&ke(be)}}qe.setOptions(Ue)},qe.walkTokens=function(je,Ue){for(var ke=D(je),be;!(be=ke()).done;){var Ce=be.value;Ue(Ce);switch(Ce.type){case"table":{for(var Pe=D(Ce.tokens.header),Le;!(Le=Pe()).done;){var Ve=Le.value;qe.walkTokens(Ve,Ue)}for(var at=D(Ce.tokens.cells),_t;!(_t=at()).done;)for(var kt=_t.value,Bt=D(kt),jt;!(jt=Bt()).done;){var At=jt.value;qe.walkTokens(At,Ue)}break}case"list":{qe.walkTokens(Ce.items,Ue);break}default:Ce.tokens&&qe.walkTokens(Ce.tokens,Ue)}}},qe.Parser=xe,qe.parser=xe.parse,qe.Renderer=P,qe.TextRenderer=j,qe.Lexer=We,qe.lexer=We.lex,qe.Tokenizer=de,qe.Slugger=ee,qe.parse=qe;var Ye=qe;return Ye})},"DlR+":function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global,W=ce.trim;nt.exports={name:"cookieStorage",read:D,write:A,each:T,remove:O,clearAll:f};var C=ie.document;function D(c){if(!c||!p(c))return null;var s="(?:^|.*;\\s*)"+escape(c).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(C.cookie.replace(new RegExp(s),"$1"))}function T(c){for(var s=C.cookie.split(/; ?/g),n=s.length-1;n>=0;n--){if(!W(s[n]))continue;var o=s[n].split("="),r=unescape(o[0]),l=unescape(o[1]);c(l,r)}}function A(c,s){if(!c)return;C.cookie=escape(c)+"="+escape(s)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function O(c){if(!c||!p(c))return;C.cookie=escape(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function f(){T(function(c,s){O(s)})}function p(c){return new RegExp("(?:^|;\\s*)"+escape(c).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(C.cookie)}},E2g8:function(nt,Xe,V){(function(ce,ie){/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */(function(W,C){nt.exports=C()})(this,function(){"use strict";function W(P){var j=typeof P;return P!==null&&(j==="object"||j==="function")}function C(P){return typeof P=="function"}var D=void 0;Array.isArray?D=Array.isArray:D=function(P){return Object.prototype.toString.call(P)==="[object Array]"};var T=D,A=0,O=void 0,f=void 0,p=function(j,ee){b[A]=j,b[A+1]=ee,A+=2,A===2&&(f?f(g):_())};function c(P){f=P}function s(P){p=P}var n=typeof window!="undefined"?window:void 0,o=n||{},r=o.MutationObserver||o.WebKitMutationObserver,l=typeof self=="undefined"&&typeof ce!="undefined"&&{}.toString.call(ce)==="[object process]",a=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function i(){return function(){return ce.nextTick(g)}}function t(){return typeof O!="undefined"?function(){O(g)}:y()}function d(){var P=0,j=new r(g),ee=document.createTextNode("");return j.observe(ee,{characterData:!0}),function(){ee.data=P=++P%2}}function v(){var P=new MessageChannel;return P.port1.onmessage=g,function(){return P.port2.postMessage(0)}}function y(){var P=setTimeout;return function(){return P(g,1)}}var b=new Array(1e3);function g(){for(var P=0;P`,triples:"",explode:"[]{}"},W=ce.Pos;ce.defineOption("autoCloseBrackets",!1,function(r,l,a){a&&a!=ce.Init&&(r.removeKeyMap(D),r.state.closeBrackets=null),l&&(T(C(l,"pairs")),r.state.closeBrackets=l,r.addKeyMap(D))});function C(r,l){return l=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[l]!=null?r[l]:ie[l]}var D={Backspace:f,Enter:p};function T(r){for(var l=0;l=0;t--){var v=i[t].head;r.replaceRange("",W(v.line,v.ch-1),W(v.line,v.ch+1),"+delete")}}function p(r){var l=O(r),a=l&&C(l,"explode");if(!a||r.getOption("disableInput"))return ce.Pass;for(var i=r.listSelections(),t=0;t0;return{anchor:new W(r.anchor.line,r.anchor.ch+(l?-1:1)),head:new W(r.head.line,r.head.ch+(l?1:-1))}}function s(r,l){var a=O(r);if(!a||r.getOption("disableInput"))return ce.Pass;var i=C(a,"pairs"),t=i.indexOf(l);if(t==-1)return ce.Pass;for(var d=C(a,"closeBefore"),v=C(a,"triples"),y=i.charAt(t+1)==l,b=r.listSelections(),g=t%2==0,m,_=0;_=0&&r.getRange(h,W(h.line,h.ch+3))==l+l+l?E="skipThree":E="skip";else if(y&&h.ch>1&&v.indexOf(l)>=0&&r.getRange(W(h.line,h.ch-2),h)==l+l){if(h.ch>2&&/\bstring/.test(r.getTokenTypeAt(W(h.line,h.ch-2))))return ce.Pass;E="addFour"}else if(y){var w=h.ch==0?" ":r.getRange(W(h.line,h.ch-1),h);if(!ce.isWordChar(S)&&w!=l&&!ce.isWordChar(w))E="both";else return ce.Pass}else if(g&&(S.length===0||/\s/.test(S)||d.indexOf(S)>-1))E="both";else return ce.Pass;if(!m)m=E;else if(m!=E)return ce.Pass}var R=t%2?i.charAt(t-1):l,N=t%2?l:i.charAt(t+1);r.operation(function(){if(m=="skip")r.execCommand("goCharRight");else if(m=="skipThree")for(var F=0;F<3;F++)r.execCommand("goCharRight");else if(m=="surround"){for(var z=r.getSelections(),F=0;F ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","error",oe),!Re.ENABLE_ERROR)return;console.error?console.error(oe):console.warn?console.warn(oe):console.log(oe)}},{key:"i",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","info",oe),!Re.ENABLE_INFO)return;console.info?console.info(oe):console.log(oe)}},{key:"w",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","warn",oe),!Re.ENABLE_WARN)return;console.warn?console.warn(oe):console.log(oe)}},{key:"d",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","debug",oe),!Re.ENABLE_DEBUG)return;console.debug?console.debug(oe):console.log(oe)}},{key:"v",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","verbose",oe),!Re.ENABLE_VERBOSE)return;console.log(oe)}}]),Re}();A.GLOBAL_TAG="flv.js",A.FORCE_GLOBAL_TAG=!1,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A.ENABLE_CALLBACK=!1,A.emitter=new T.a;var O=A,f=function(){function Re(){Object(ce.a)(this,Re),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(ie.a)(Re,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(X){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=X,this._totalBytes+=X):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=X,this._totalBytes+=X):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=X,this._totalBytes+=X,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var X=(this._now()-this._lastCheckpoint)/1e3;return X==0&&(X=1),this._intervalBytes/X/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var X=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/X/1024}}]),Re}(),p=f,c=V("yKVA"),s=V("879j"),n=function(){function Re(ve){Object(ce.a)(this,Re),this._message=ve}return Object(ie.a)(Re,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Re}(),o=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne){return Object(ce.a)(this,X),ve.call(this,ne)}return Object(ie.a)(X,[{key:"name",get:function(){return"IllegalStateException"}}]),X}(n),r=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne){return Object(ce.a)(this,X),ve.call(this,ne)}return Object(ie.a)(X,[{key:"name",get:function(){return"InvalidArgumentException"}}]),X}(n),l=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne){return Object(ce.a)(this,X),ve.call(this,ne)}return Object(ie.a)(X,[{key:"name",get:function(){return"NotImplementedException"}}]),X}(n),a={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},i={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},t=function(){function Re(ve){Object(ce.a)(this,Re),this._type=ve||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===a.kConnecting||this._status===a.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(X){this._onContentLengthKnown=X}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(X){this._onURLRedirect=X}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(X){this._onDataArrival=X}},{key:"onError",get:function(){return this._onError},set:function(X){this._onError=X}},{key:"onComplete",get:function(){return this._onComplete},set:function(X){this._onComplete=X}},{key:"open",value:function(X,ne){throw new l("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new l("Unimplemented abstract function!")}}]),Re}(),d=V("oZsa");function v(Re,ve){for(;!Object.prototype.hasOwnProperty.call(Re,ve)&&!(Re=Object(d.a)(Re),Re===null););return Re}function y(Re,ve,X){return typeof Reflect!="undefined"&&Reflect.get?y=Reflect.get:y=function(oe,he,Ae){var Qe=v(oe,he);if(!Qe)return;var ot=Object.getOwnPropertyDescriptor(Qe,he);return ot.get?ot.get.call(Ae):ot.value},y(Re,ve,X||Re)}var b={};function g(){var Re=self.navigator.userAgent.toLowerCase(),ve=/(edge)\/([\w.]+)/.exec(Re)||/(opr)[\/]([\w.]+)/.exec(Re)||/(chrome)[ \/]([\w.]+)/.exec(Re)||/(iemobile)[\/]([\w.]+)/.exec(Re)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+)/.exec(Re)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Re)||/(msie) ([\w.]+)/.exec(Re)||Re.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Re)||Re.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Re)||[],X=/(ipad)/.exec(Re)||/(ipod)/.exec(Re)||/(windows phone)/.exec(Re)||/(iphone)/.exec(Re)||/(kindle)/.exec(Re)||/(android)/.exec(Re)||/(windows)/.exec(Re)||/(mac)/.exec(Re)||/(linux)/.exec(Re)||/(cros)/.exec(Re)||[],ne={browser:ve[5]||ve[3]||ve[1]||"",version:ve[2]||ve[4]||"0",majorVersion:ve[4]||ve[2]||"0",platform:X[0]||""},oe={};if(ne.browser){oe[ne.browser]=!0;var he=ne.majorVersion.split(".");oe.version={major:parseInt(ne.majorVersion,10),string:ne.version},he.length>1&&(oe.version.minor=parseInt(he[1],10)),he.length>2&&(oe.version.build=parseInt(he[2],10))}if(ne.platform&&(oe[ne.platform]=!0),(oe.chrome||oe.opr||oe.safari)&&(oe.webkit=!0),oe.rv||oe.iemobile){oe.rv&&delete oe.rv;var Ae="msie";ne.browser=Ae,oe[Ae]=!0}if(oe.edge){delete oe.edge;var Qe="msedge";ne.browser=Qe,oe[Qe]=!0}if(oe.opr){var ot="opera";ne.browser=ot,oe[ot]=!0}if(oe.safari&&oe.android){var Rt="android";ne.browser=Rt,oe[Rt]=!0}oe.name=ne.browser,oe.platform=ne.platform;for(var Nt in b)b.hasOwnProperty(Nt)&&delete b[Nt];Object.assign(b,oe)}g();var m=b,_=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne,oe){var he;return Object(ce.a)(this,X),he=ve.call(this,"fetch-stream-loader"),he.TAG="FetchStreamLoader",he._seekHandler=ne,he._config=oe,he._needStash=!0,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(ie.a)(X,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){var Ae=this;this._dataSource=oe,this._range=he;var Qe=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Qe=oe.redirectedURL);var ot=this._seekHandler.getConfig(Qe,he),Rt=new self.Headers;if(typeof ot.headers=="object"){var Nt=ot.headers;for(var ht in Nt)Nt.hasOwnProperty(ht)&&Rt.append(ht,Nt[ht])}var Dt={method:"GET",headers:Rt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var sn in this._config.headers)Rt.append(sn,this._config.headers[sn]);oe.cors===!1&&(Dt.mode="same-origin"),oe.withCredentials&&(Dt.credentials="include"),oe.referrerPolicy&&(Dt.referrerPolicy=oe.referrerPolicy),this._status=a.kConnecting,self.fetch(ot.url,Dt).then(function(Ct){if(Ae._requestAbort){Ae._requestAbort=!1,Ae._status=a.kIdle;return}if(Ct.ok&&Ct.status>=200&&Ct.status<=299){if(Ct.url!==ot.url&&Ae._onURLRedirect){var hn=Ae._seekHandler.removeURLParameters(Ct.url);Ae._onURLRedirect(hn)}var rn=Ct.headers.get("Content-Length");return rn!=null&&(Ae._contentLength=parseInt(rn),Ae._contentLength!==0&&(Ae._onContentLengthKnown&&Ae._onContentLengthKnown(Ae._contentLength))),Ae._pump.call(Ae,Ct.body.getReader())}else if(Ae._status=a.kError,Ae._onError)Ae._onError(i.HTTP_STATUS_CODE_INVALID,{code:Ct.status,msg:Ct.statusText});else throw new n("FetchStreamLoader: Http code invalid, "+Ct.status+" "+Ct.statusText)}).catch(function(Ct){if(Ae._status=a.kError,Ae._onError)Ae._onError(i.EXCEPTION,{code:-1,msg:Ct.message});else throw Ct})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(oe){var he=this;return oe.read().then(function(Ae){if(Ae.done)if(he._contentLength!==null&&he._receivedLength=15048,he=m.msedge?oe:!0;return self.fetch&&self.ReadableStream&&he}catch(Ae){return!1}}}]),X}(t),x=_,h=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne,oe){var he;return Object(ce.a)(this,X),he=ve.call(this,"xhr-moz-chunked-loader"),he.TAG="MozChunkedLoader",he._seekHandler=ne,he._config=oe,he._needStash=!0,he._xhr=null,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(ie.a)(X,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){this._dataSource=oe,this._range=he;var Ae=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Ae=oe.redirectedURL);var Qe=this._seekHandler.getConfig(Ae,he);this._requestURL=Qe.url;var ot=this._xhr=new XMLHttpRequest;if(ot.open("GET",Qe.url,!0),ot.responseType="moz-chunked-arraybuffer",ot.onreadystatechange=this._onReadyStateChange.bind(this),ot.onprogress=this._onProgress.bind(this),ot.onloadend=this._onLoadEnd.bind(this),ot.onerror=this._onXhrError.bind(this),oe.withCredentials&&(ot.withCredentials=!0),typeof Qe.headers=="object"){var Rt=Qe.headers;for(var Nt in Rt)Rt.hasOwnProperty(Nt)&&ot.setRequestHeader(Nt,Rt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Dt in ht)ht.hasOwnProperty(Dt)&&ot.setRequestHeader(Dt,ht[Dt])}this._status=a.kConnecting,ot.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.kComplete}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null&&he.responseURL!==this._requestURL&&this._onURLRedirect){var Ae=this._seekHandler.removeURLParameters(he.responseURL);this._onURLRedirect(Ae)}if(he.status!==0&&(he.status<200||he.status>299))if(this._status=a.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new n("MozChunkedLoader: Http code invalid, "+he.status+" "+he.statusText);else this._status=a.kBuffering}}},{key:"_onProgress",value:function(oe){if(this._status===a.kError)return;this._contentLength===null&&(oe.total!==null&&oe.total!==0&&(this._contentLength=oe.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var he=oe.target.response,Ae=this._range.from+this._receivedLength;this._receivedLength+=he.byteLength,this._onDataArrival&&this._onDataArrival(he,Ae,this._receivedLength)}},{key:"_onLoadEnd",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===a.kError)return;this._status=a.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(oe){this._status=a.kError;var he=0,Ae=null;if(this._contentLength&&oe.loaded=200&&he.status<=299){if(this._status=a.kBuffering,he.responseURL!=null){var Ae=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Ae!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ae,this._onURLRedirect&&this._onURLRedirect(Ae))}var Qe=he.getResponseHeader("Content-Length");if(Qe!=null&&this._contentLength==null){var ot=parseInt(Qe);ot>0&&(this._contentLength=ot,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=a.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new n("MSStreamLoader: Http code invalid, "+he.status+" "+he.statusText);else if(he.readyState===3&&(he.status>=200&&he.status<=299)){this._status=a.kBuffering;var Rt=he.response;this._reader.readAsArrayBuffer(Rt)}}},{key:"_xhrOnError",value:function(oe){this._status=a.kError;var he=i.EXCEPTION,Ae={code:-1,msg:oe.constructor.name+" "+oe.type};if(this._onError)this._onError(he,Ae);else throw new n(Ae.msg)}},{key:"_msrOnProgress",value:function(oe){var he=oe.target,Ae=he.result;if(Ae==null){this._doReconnectIfNeeded();return}var Qe=Ae.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Ae.byteLength;var ot=this._totalRange.from+this._receivedLength;this._receivedLength+=Qe.byteLength,this._onDataArrival&&this._onDataArrival(Qe,ot,this._receivedLength),Ae.byteLength>=this._bufferLimit&&(O.v(this.TAG,"MSStream buffer exceeded max size near ".concat(ot+Qe.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(Ae=this._range.from+this._contentLength-1)),this._currentRequestRange={from:he,to:Ae},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(oe,he){this._lastTimeLoaded=0;var Ae=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ae=this._currentRedirectedURL:oe.redirectedURL!=null&&(Ae=oe.redirectedURL));var Qe=this._seekHandler.getConfig(Ae,he);this._currentRequestURL=Qe.url;var ot=this._xhr=new XMLHttpRequest;if(ot.open("GET",Qe.url,!0),ot.responseType="arraybuffer",ot.onreadystatechange=this._onReadyStateChange.bind(this),ot.onprogress=this._onProgress.bind(this),ot.onload=this._onLoad.bind(this),ot.onerror=this._onXhrError.bind(this),oe.withCredentials&&(ot.withCredentials=!0),typeof Qe.headers=="object"){var Rt=Qe.headers;for(var Nt in Rt)Rt.hasOwnProperty(Nt)&&ot.setRequestHeader(Nt,Rt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Dt in ht)ht.hasOwnProperty(Dt)&&ot.setRequestHeader(Dt,ht[Dt])}ot.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=a.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null){var Ae=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Ae!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ae,this._onURLRedirect&&this._onURLRedirect(Ae))}if(he.status>=200&&he.status<=299){if(this._waitForTotalLength)return;this._status=a.kBuffering}else if(this._status=a.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new n("RangeLoader: Http code invalid, "+he.status+" "+he.statusText)}}},{key:"_onProgress",value:function(oe){if(this._status===a.kError)return;if(this._contentLength===null){var he=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,he=!0;var Ae=oe.total;this._internalAbort(),Ae!=null&Ae!==0&&(this._totalLength=Ae)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,he){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Qe=oe.loaded-this._lastTimeLoaded;this._lastTimeLoaded=oe.loaded,this._speedSampler.addBytes(Qe)}},{key:"_normalizeSpeed",value:function(oe){var he=this._chunkSizeKBList,Ae=he.length-1,Qe=0,ot=0,Rt=Ae;if(oe=he[Qe]&&oe=3&&(he=this._speedSampler.currentKBps)),he!==0){var Ae=this._normalizeSpeed(he);this._currentSpeedNormalized!==Ae&&(this._currentSpeedNormalized=Ae,this._currentChunkSizeKB=Ae)}var Qe=oe.target.response,ot=this._range.from+this._receivedLength;this._receivedLength+=Qe.byteLength;var Rt=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var Qe=oe.split("&"),ot=0;ot0;Rt[0]!==this._startName&&Rt[0]!==this._endName&&(Nt&&(Ae+="&"),Ae+=Qe[ot])}return Ae.length===0?ne:ne+"?"+Ae}}]),Re}(),G=M,J=function(){function Re(ve,X,ne){Object(ce.a)(this,Re),this.TAG="IOController",this._config=X,this._extraData=ne,this._stashInitialSize=1024*384,X.stashInitialSize!=null&&X.stashInitialSize>0&&(this._stashInitialSize=X.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,X.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ve,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ve.url),this._refTotalLength=ve.filesize?ve.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new p,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(X){this._extraData=X}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(X){this._onDataArrival=X}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(X){this._onSeeked=X}},{key:"onError",get:function(){return this._onError},set:function(X){this._onError=X}},{key:"onComplete",get:function(){return this._onComplete},set:function(X){this._onComplete=X}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(X){this._onRedirect=X}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(X){this._onRecoveredEarlyEof=X}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===N?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var X=this._config;if(X.seekType==="range")this._seekHandler=new B(this._config.rangeLoadZeroStart);else if(X.seekType==="param"){var ne=X.seekParamStart||"bstart",oe=X.seekParamEnd||"bend";this._seekHandler=new G(ne,oe)}else if(X.seekType==="custom"){if(typeof X.customSeekHandler!="function")throw new r("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new X.customSeekHandler}else throw new r("Invalid seekType in config: ".concat(X.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=z;else if(x.isSupported())this._loaderClass=x;else if(E.isSupported())this._loaderClass=E;else if(N.isSupported())this._loaderClass=N;else throw new n("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(X){this._currentRange={from:0,to:-1},X&&(this._currentRange.from=X),this._speedSampler.reset(),X||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var X=this._resumeFrom;this._resumeFrom=0,this._internalSeek(X,!0)}}},{key:"seek",value:function(X){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(X,!0)}},{key:"_internalSeek",value:function(X,ne){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(ne),this._loader.destroy(),this._loader=null;var oe={from:X,to:-1};this._currentRange={from:oe.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,oe),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(X){if(!X||typeof X!="string"||X.length===0)throw new r("Url must be a non-empty string!");this._dataSource.url=X}},{key:"_expandBuffer",value:function(X){for(var ne=this._stashSize;ne+1024*1024*10){var he=new Uint8Array(this._stashBuffer,0,this._stashUsed),Ae=new Uint8Array(oe,0,ne);Ae.set(he,0)}this._stashBuffer=oe,this._bufferSize=ne}},{key:"_normalizeSpeed",value:function(X){var ne=this._speedNormalizeList,oe=ne.length-1,he=0,Ae=0,Qe=oe;if(X=ne[he]&&X=512&&X<=1024?ne=Math.floor(X*1.5):ne=X*2,ne>8192&&(ne=8192);var oe=ne*1024+1024*1024*1;this._bufferSize0){var hn=this._stashBuffer.slice(0,this._stashUsed),rn=this._dispatchChunks(hn,this._stashByteStart);if(rn0){var ae=new Uint8Array(hn,rn);Ct.set(ae,0),this._stashUsed=ae.byteLength,this._stashByteStart+=rn}}else this._stashUsed=0,this._stashByteStart+=rn;this._stashUsed+X.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+X.byteLength),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(X),this._stashUsed),this._stashUsed+=X.byteLength}else{var U=this._dispatchChunks(X,ne);if(Uthis._bufferSize&&(this._expandBuffer(H),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(X,U),0),this._stashUsed+=H,this._stashByteStart=ne+U}}}else if(this._stashUsed===0){var Qe=this._dispatchChunks(X,ne);if(Qethis._bufferSize&&this._expandBuffer(ot);var Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Rt.set(new Uint8Array(X,Qe),0),this._stashUsed+=ot,this._stashByteStart=ne+Qe}}else{this._stashUsed+X.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+X.byteLength);var Nt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Nt.set(new Uint8Array(X),this._stashUsed),this._stashUsed+=X.byteLength;var ht=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ht0){var Dt=new Uint8Array(this._stashBuffer,ht);Nt.set(Dt,0)}this._stashUsed-=ht,this._stashByteStart+=ht}}},{key:"_flushStashBuffer",value:function(X){if(this._stashUsed>0){var ne=this._stashBuffer.slice(0,this._stashUsed),oe=this._dispatchChunks(ne,this._stashByteStart),he=ne.byteLength-oe;if(oe0){var Ae=new Uint8Array(this._stashBuffer,0,this._bufferSize),Qe=new Uint8Array(ne,oe);Ae.set(Qe,0),this._stashUsed=Qe.byteLength,this._stashByteStart+=oe}return 0}return this._stashUsed=0,this._stashByteStart=0,he}return 0}},{key:"_onLoaderComplete",value:function(X,ne){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(X,ne){O.e(this.TAG,"Loader error, code = ".concat(ne.code,", msg = ").concat(ne.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,X=i.UNRECOVERABLE_EARLY_EOF);switch(X){case i.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var oe=this._currentRange.to+1;oe0){var ne=Re.getConfig();X.emit("change",ne)}}},{key:"registerListener",value:function(X){Re.emitter.addListener("change",X)}},{key:"removeListener",value:function(X){Re.emitter.removeListener("change",X)}},{key:"addLogListener",value:function(X){O.emitter.addListener("log",X),O.emitter.listenerCount("log")>0&&(O.ENABLE_CALLBACK=!0,Re._notifyChange())}},{key:"removeLogListener",value:function(X){O.emitter.removeListener("log",X),O.emitter.listenerCount("log")===0&&(O.ENABLE_CALLBACK=!1,Re._notifyChange())}}]),Re}();_e.emitter=new T.a;var ye=_e,Ke=function(){function Re(){Object(ce.a)(this,Re),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(ie.a)(Re,[{key:"isComplete",value:function(){var X=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,ne=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&X&&ne}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(X){if(this.keyframesIndex==null)return null;var ne=this.keyframesIndex,oe=this._search(ne.times,X);return{index:oe,milliseconds:ne.times[oe],fileposition:ne.filepositions[oe]}}},{key:"_search",value:function(X,ne){var oe=0,he=X.length-1,Ae=0,Qe=0,ot=he;for(ne=X[Ae]&&ne=128){ve.push(String.fromCharCode(he&65535)),ne+=2;continue}}}else if(X[ne]<240){if(Fe(X,ne,2)){var Ae=(X[ne]&15)<<12|(X[ne+1]&63)<<6|X[ne+2]&63;if(Ae>=2048&&(Ae&63488)!==55296){ve.push(String.fromCharCode(Ae&65535)),ne+=3;continue}}}else if(X[ne]<248&&Fe(X,ne,3)){var Qe=(X[ne]&7)<<18|(X[ne+1]&63)<<12|(X[ne+2]&63)<<6|X[ne+3]&63;if(Qe>65536&&Qe<1114112){Qe-=65536,ve.push(String.fromCharCode(Qe>>>10|55296)),ve.push(String.fromCharCode(Qe&1023|56320)),ne+=4;continue}}}ve.push(String.fromCharCode(65533)),++ne}return ve.join("")}var Ee=Ge,me=function(){var Re=new ArrayBuffer(2);return new DataView(Re).setInt16(0,256,!0),new Int16Array(Re)[0]===256}(),We=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"parseScriptData",value:function(X,ne,oe){var he={};try{var Ae=Re.parseValue(X,ne,oe),Qe=Re.parseValue(X,ne+Ae.size,oe-Ae.size);he[Ae.data]=Qe.data}catch(ot){O.e("AMF",ot.toString())}return he}},{key:"parseObject",value:function(X,ne,oe){if(oe<3)throw new o("Data not enough when parse ScriptDataObject");var he=Re.parseString(X,ne,oe),Ae=Re.parseValue(X,ne+he.size,oe-he.size),Qe=Ae.objectEnd;return{data:{name:he.data,value:Ae.data},size:he.size+Ae.size,objectEnd:Qe}}},{key:"parseVariable",value:function(X,ne,oe){return Re.parseObject(X,ne,oe)}},{key:"parseString",value:function(X,ne,oe){if(oe<2)throw new o("Data not enough when parse String");var he=new DataView(X,ne,oe),Ae=he.getUint16(0,!me),Qe;return Ae>0?Qe=Ee(new Uint8Array(X,ne+2,Ae)):Qe="",{data:Qe,size:2+Ae}}},{key:"parseLongString",value:function(X,ne,oe){if(oe<4)throw new o("Data not enough when parse LongString");var he=new DataView(X,ne,oe),Ae=he.getUint32(0,!me),Qe;return Ae>0?Qe=Ee(new Uint8Array(X,ne+4,Ae)):Qe="",{data:Qe,size:4+Ae}}},{key:"parseDate",value:function(X,ne,oe){if(oe<10)throw new o("Data size invalid when parse Date");var he=new DataView(X,ne,oe),Ae=he.getFloat64(0,!me),Qe=he.getInt16(8,!me);return Ae+=Qe*60*1e3,{data:new Date(Ae),size:8+2}}},{key:"parseValue",value:function(X,ne,oe){if(oe<1)throw new o("Data not enough when parse Value");var he=new DataView(X,ne,oe),Ae=1,Qe=he.getUint8(0),ot,Rt=!1;try{switch(Qe){case 0:ot=he.getFloat64(1,!me),Ae+=8;break;case 1:{var Nt=he.getUint8(1);ot=!!Nt,Ae+=1;break}case 2:{var ht=Re.parseString(X,ne+1,oe-1);ot=ht.data,Ae+=ht.size;break}case 3:{ot={};var Dt=0;for((he.getUint32(oe-4,!me)&16777215)===9&&(Dt=3);Ae32)throw new r("ExpGolomb: readBits() bits exceeded max 32bits!");if(X<=this._current_word_bits_left){var ne=this._current_word>>>32-X;return this._current_word<<=X,this._current_word_bits_left-=X,ne}var oe=this._current_word_bits_left?this._current_word:0;oe=oe>>>32-this._current_word_bits_left;var he=X-this._current_word_bits_left;this._fillCurrentWord();var Ae=Math.min(he,this._current_word_bits_left),Qe=this._current_word>>>32-Ae;return this._current_word<<=Ae,this._current_word_bits_left-=Ae,oe=oe<>>X)!==0)return this._current_word<<=X,this._current_word_bits_left-=X,X;return this._fillCurrentWord(),X+this._skipLeadingZero()}},{key:"readUEG",value:function(){var X=this._skipLeadingZero();return this.readBits(X+1)-1}},{key:"readSEG",value:function(){var X=this.readUEG();return X&1?X+1>>>1:-1*(X>>>1)}}]),Re}(),re=it,P=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"_ebsp2rbsp",value:function(X){for(var ne=X,oe=ne.byteLength,he=new Uint8Array(oe),Ae=0,Qe=0;Qe=2&&(ne[Qe]===3&&ne[Qe-1]===0&&ne[Qe-2]===0))continue;he[Ae]=ne[Qe],Ae++}return new Uint8Array(he.buffer,0,Ae)}},{key:"parseSPS",value:function(X){var ne=Re._ebsp2rbsp(X),oe=new re(ne);oe.readByte();var he=oe.readByte();oe.readByte();var Ae=oe.readByte();oe.readUEG();var Qe=Re.getProfileString(he),ot=Re.getLevelString(Ae),Rt=1,Nt=420,ht=[0,420,422,444],Dt=8;if((he===100||he===110||he===122||he===244||he===44||he===83||he===86||he===118||he===128||he===138||he===144)&&(Rt=oe.readUEG(),Rt===3&&oe.readBits(1),Rt<=3&&(Nt=ht[Rt]),Dt=oe.readUEG()+8,oe.readUEG(),oe.readBits(1),oe.readBool()))for(var sn=Rt!==3?8:12,Ct=0;Ct0&&di<16?(St=hr[di-1],Wt=vi[di-1]):di===255&&(St=oe.readByte()<<8|oe.readByte(),Wt=oe.readByte()<<8|oe.readByte())}if(oe.readBool()&&oe.readBool(),oe.readBool()&&(oe.readBits(4),oe.readBool()&&oe.readBits(24)),oe.readBool()&&(oe.readUEG(),oe.readUEG()),oe.readBool()){var gi=oe.readBits(32),xi=oe.readBits(32);Bn=oe.readBool(),Oi=xi,mi=gi*2,ln=Oi/mi}}var Bi=1;(St!==1||Wt!==1)&&(Bi=St/Wt);var Ai=0,sr=0;if(Rt===0)Ai=1,sr=2-pe;else{var Di=Rt===3?1:2,fr=Rt===1?2:1;Ai=Di,sr=fr*(2-pe)}var lr=(H+1)*16,Wi=(2-pe)*((te+1)*16);lr-=(se+$e)*Ai,Wi-=(yt+Ot)*sr;var Gi=Math.ceil(lr*Bi);return oe.destroy(),oe=null,{profile_string:Qe,level_string:ot,bit_depth:Dt,ref_frames:U,chroma_format:Nt,chroma_format_string:Re.getChromaFormatString(Nt),frame_rate:{fixed:Bn,fps:ln,fps_den:mi,fps_num:Oi},sar_ratio:{width:St,height:Wt},codec_size:{width:lr,height:Wi},present_size:{width:Gi,height:Wi}}}},{key:"_skipScalingList",value:function(X,ne){for(var oe=8,he=8,Ae=0,Qe=0;Qe>>8&255|(Re&255)<<8}function xe(Re){return(Re&4278190080)>>>24|(Re&16711680)>>>8|(Re&65280)<<8|(Re&255)<<24}function De(Re,ve){return Re[ve]<<24|Re[ve+1]<<16|Re[ve+2]<<8|Re[ve+3]}var dt=function(){function Re(ve,X){Object(ce.a)(this,Re),this.TAG="FLVDemuxer",this._config=X,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ve.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ve.hasAudioTrack,this._hasVideo=ve.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Me,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var ne=new ArrayBuffer(2);return new DataView(ne).setInt16(0,256,!0),new Int16Array(ne)[0]===256}()}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(X){return X.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(X){this._onTrackMetadata=X}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(X){this._onMediaInfo=X}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(X){this._onMetaDataArrived=X}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(X){this._onScriptDataArrived=X}},{key:"onError",get:function(){return this._onError},set:function(X){this._onError=X}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(X){this._onDataAvailable=X}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(X){this._timestampBase=X}},{key:"overridedDuration",get:function(){return this._duration},set:function(X){this._durationOverrided=!0,this._duration=X,this._mediaInfo.duration=X}},{key:"overridedHasAudio",set:function(X){this._hasAudioFlagOverrided=!0,this._hasAudio=X,this._mediaInfo.hasAudio=X}},{key:"overridedHasVideo",set:function(X){this._hasVideoFlagOverrided=!0,this._hasVideo=X,this._mediaInfo.hasVideo=X}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new Me}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(X,ne){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new o("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var oe=0,he=this._littleEndian;if(ne===0)if(X.byteLength>13){var Ae=Re.probe(X);oe=Ae.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,ne+oe!==this._dataOffset&&O.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Qe=new DataView(X,oe),ot=Qe.getUint32(0,!he);ot!==0&&O.w(this.TAG,"PrevTagSize0 !== 0 !!!"),oe+=4}for(;oeX.byteLength)break;var Nt=Rt.getUint8(0),ht=Rt.getUint32(0,!he)&16777215;if(oe+11+ht+4>X.byteLength)break;if(Nt!==8&&Nt!==9&&Nt!==18){O.w(this.TAG,"Unsupported tag type ".concat(Nt,", skipped")),oe+=11+ht+4;continue}var Dt=Rt.getUint8(4),sn=Rt.getUint8(5),Ct=Rt.getUint8(6),hn=Rt.getUint8(7),rn=Ct|sn<<8|Dt<<16|hn<<24,ae=Rt.getUint32(7,!he)&16777215;ae!==0&&O.w(this.TAG,"Meet tag which has StreamID != 0!");var U=oe+11;switch(Nt){case 8:this._parseAudioData(X,U,ht,rn);break;case 9:this._parseVideoData(X,U,ht,rn,ne+oe);break;case 18:this._parseScriptData(X,U,ht);break}var H=Rt.getUint32(11+ht,!he);H!==11+ht&&O.w(this.TAG,"Invalid PrevTagSize ".concat(H)),oe+=11+ht+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),oe}},{key:"_parseScriptData",value:function(X,ne,oe){var he=He.parseScriptData(X,ne,oe);if(he.hasOwnProperty("onMetaData")){if(he.onMetaData==null||typeof he.onMetaData!="object"){O.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&O.w(this.TAG,"Found another onMetaData tag!"),this._metadata=he;var Ae=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Ae)),typeof Ae.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Ae.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Ae.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Ae.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Ae.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Ae.audiodatarate),typeof Ae.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Ae.videodatarate),typeof Ae.width=="number"&&(this._mediaInfo.width=Ae.width),typeof Ae.height=="number"&&(this._mediaInfo.height=Ae.height),typeof Ae.duration=="number"){if(!this._durationOverrided){var Qe=Math.floor(Ae.duration*this._timescale);this._duration=Qe,this._mediaInfo.duration=Qe}}else this._mediaInfo.duration=0;if(typeof Ae.framerate=="number"){var ot=Math.floor(Ae.framerate*1e3);if(ot>0){var Rt=ot/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Rt,this._referenceFrameRate.fps_num=ot,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Rt}}if(typeof Ae.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Nt=Ae.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Nt),Ae.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Ae,O.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(he).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},he)))}},{key:"_parseKeyframesIndex",value:function(X){for(var ne=[],oe=[],he=1;he>>4;if(Rt!==2&&Rt!==10){this._onError($.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Rt);return}var Nt=0,ht=(ot&12)>>>2;if(ht>=0&&ht<=4)Nt=this._flvSoundRateTable[ht];else{this._onError($.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ht);return}var Dt=(ot&2)>>>1,sn=ot&1,Ct=this._audioMetadata,hn=this._audioTrack;if(Ct||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ct=this._audioMetadata={},Ct.type="audio",Ct.id=hn.id,Ct.timescale=this._timescale,Ct.duration=this._duration,Ct.audioSampleRate=Nt,Ct.channelCount=sn===0?1:2),Rt===10){var rn=this._parseAACAudioData(X,ne+1,oe-1);if(rn==null)return;if(rn.packetType===0){Ct.config&&O.w(this.TAG,"Found another AudioSpecificConfig!");var ae=rn.data;Ct.audioSampleRate=ae.samplingRate,Ct.channelCount=ae.channelCount,Ct.codec=ae.codec,Ct.originalCodec=ae.originalCodec,Ct.config=ae.config,Ct.refSampleDuration=1024/Ct.audioSampleRate*Ct.timescale,O.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Ct);var U=this._mediaInfo;U.audioCodec=Ct.originalCodec,U.audioSampleRate=Ct.audioSampleRate,U.audioChannelCount=Ct.channelCount,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}else if(rn.packetType===1){var H=this._timestampBase+he,te={unit:rn.data,length:rn.data.byteLength,dts:H,pts:H};hn.samples.push(te),hn.length+=rn.data.length}else O.e(this.TAG,"Flv: Unsupported AAC data type ".concat(rn.packetType))}else if(Rt===2){if(!Ct.codec){var pe=this._parseMP3AudioData(X,ne+1,oe-1,!0);if(pe==null)return;Ct.audioSampleRate=pe.samplingRate,Ct.channelCount=pe.channelCount,Ct.codec=pe.codec,Ct.originalCodec=pe.originalCodec,Ct.refSampleDuration=1152/Ct.audioSampleRate*Ct.timescale,O.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ct);var se=this._mediaInfo;se.audioCodec=Ct.codec,se.audioSampleRate=Ct.audioSampleRate,se.audioChannelCount=Ct.channelCount,se.audioDataRate=pe.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var $e=this._parseMP3AudioData(X,ne+1,oe-1,!1);if($e==null)return;var yt=this._timestampBase+he,Ot={unit:$e,length:$e.byteLength,dts:yt,pts:yt};hn.samples.push(Ot),hn.length+=$e.length}}},{key:"_parseAACAudioData",value:function(X,ne,oe){if(oe<=1){O.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var he={},Ae=new Uint8Array(X,ne,oe);return he.packetType=Ae[0],Ae[0]===0?he.data=this._parseAACAudioSpecificConfig(X,ne+1,oe-1):he.data=Ae.subarray(1),he}},{key:"_parseAACAudioSpecificConfig",value:function(X,ne,oe){var he=new Uint8Array(X,ne,oe),Ae=null,Qe=0,ot=0,Rt=null,Nt=0,ht=null;if(Qe=ot=he[0]>>>3,Nt=(he[0]&7)<<1|he[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError($.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Dt=this._mpegSamplingRates[Nt],sn=(he[1]&120)>>>3;if(sn<0||sn>=8){this._onError($.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Qe===5&&(ht=(he[1]&7)<<1|he[2]>>>7,Rt=(he[2]&124)>>>2);var Ct=self.navigator.userAgent.toLowerCase();return Ct.indexOf("firefox")!==-1?Nt>=6?(Qe=5,Ae=new Array(4),ht=Nt-3):(Qe=2,Ae=new Array(2),ht=Nt):Ct.indexOf("android")!==-1?(Qe=2,Ae=new Array(2),ht=Nt):(Qe=5,ht=Nt,Ae=new Array(4),Nt>=6?ht=Nt-3:sn===1&&(Qe=2,Ae=new Array(2),ht=Nt)),Ae[0]=Qe<<3,Ae[0]|=(Nt&15)>>>1,Ae[1]=(Nt&15)<<7,Ae[1]|=(sn&15)<<3,Qe===5&&(Ae[1]|=(ht&15)>>>1,Ae[2]=(ht&1)<<7,Ae[2]|=2<<2,Ae[3]=0),{config:Ae,samplingRate:Dt,channelCount:sn,codec:"mp4a.40."+Qe,originalCodec:"mp4a.40."+ot}}},{key:"_parseMP3AudioData",value:function(X,ne,oe,he){if(oe<4){O.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Ae=this._littleEndian,Qe=new Uint8Array(X,ne,oe),ot=null;if(he){if(Qe[0]!==255)return;var Rt=Qe[1]>>>3&3,Nt=(Qe[1]&6)>>1,ht=(Qe[2]&240)>>>4,Dt=(Qe[2]&12)>>>2,sn=Qe[3]>>>6&3,Ct=sn!==3?2:1,hn=0,rn=0,ae=34,U="mp3";switch(Rt){case 0:hn=this._mpegAudioV25SampleRateTable[Dt];break;case 2:hn=this._mpegAudioV20SampleRateTable[Dt];break;case 3:hn=this._mpegAudioV10SampleRateTable[Dt];break}switch(Nt){case 1:ae=34,ht>>4,Rt=Qe&15;if(Rt!==7){this._onError($.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Rt));return}this._parseAVCVideoPacket(X,ne+1,oe-1,he,Ae,ot)}},{key:"_parseAVCVideoPacket",value:function(X,ne,oe,he,Ae,Qe){if(oe<4){O.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var ot=this._littleEndian,Rt=new DataView(X,ne,oe),Nt=Rt.getUint8(0),ht=Rt.getUint32(0,!ot)&16777215,Dt=ht<<8>>8;if(Nt===0)this._parseAVCDecoderConfigurationRecord(X,ne+4,oe-4);else if(Nt===1)this._parseAVCVideoData(X,ne+4,oe-4,he,Ae,Qe,Dt);else if(!(Nt===2)){this._onError($.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Nt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(X,ne,oe){if(oe<7){O.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var he=this._videoMetadata,Ae=this._videoTrack,Qe=this._littleEndian,ot=new DataView(X,ne,oe);he?typeof he.avcc!="undefined"&&O.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),he=this._videoMetadata={},he.type="video",he.id=Ae.id,he.timescale=this._timescale,he.duration=this._duration);var Rt=ot.getUint8(0),Nt=ot.getUint8(1),ht=ot.getUint8(2),Dt=ot.getUint8(3);if(Rt!==1||Nt===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(ot.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError($.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var sn=ot.getUint8(5)&31;if(sn===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else sn>1&&O.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(sn));for(var Ct=6,hn=0;hn1&&O.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Yt));Ct++;for(var St=0;St=oe){O.w(this.TAG,"Malformed Nalu near timestamp ".concat(hn,", offset = ").concat(sn,", dataSize = ").concat(oe));break}var ae=Nt.getUint32(sn,!Rt);if(Ct===3&&(ae>>>=8),ae>oe-Ct){O.w(this.TAG,"Malformed Nalus near timestamp ".concat(hn,", NaluSize > DataSize!"));return}var U=Nt.getUint8(sn+Ct)&31;U===5&&(rn=!0);var H=new Uint8Array(X,ne+sn,Ct+ae),te={type:U,data:H};ht.push(te),Dt+=H.byteLength,sn+=Ct+ae}if(ht.length){var pe=this._videoTrack,se={units:ht,length:Dt,isKeyframe:rn,dts:hn,cts:ot,pts:hn+ot};rn&&(se.fileposition=Ae),pe.samples.push(se),pe.length+=Dt}}}],[{key:"probe",value:function(X){var ne=new Uint8Array(X),oe={match:!1};if(ne[0]!==70||ne[1]!==76||ne[2]!==86||ne[3]!==1)return oe;var he=(ne[4]&4)>>>2!==0,Ae=(ne[4]&1)!==0,Qe=De(ne,5);return Qe<9?oe:{match:!0,consumed:Qe,dataOffset:Qe,hasAudioTrack:he,hasVideoTrack:Ae}}}]),Re}(),Ne=dt,Be=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"init",value:function(){Re.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var X in Re.types)Re.types.hasOwnProperty(X)&&(Re.types[X]=[X.charCodeAt(0),X.charCodeAt(1),X.charCodeAt(2),X.charCodeAt(3)]);var ne=Re.constants={};ne.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),ne.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),ne.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),ne.STSC=ne.STCO=ne.STTS,ne.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ne.HDLR_VIDEO=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]),ne.HDLR_AUDIO=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]),ne.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ne.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ne.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(X){for(var ne=8,oe=null,he=Array.prototype.slice.call(arguments,1),Ae=he.length,Qe=0;Qe>>24&255,oe[1]=ne>>>16&255,oe[2]=ne>>>8&255,oe[3]=ne&255,oe.set(X,4);for(var ot=8,Rt=0;Rt>>24&255,X>>>16&255,X>>>8&255,X&255,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&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]))}},{key:"trak",value:function(X){return Re.box(Re.types.trak,Re.tkhd(X),Re.mdia(X))}},{key:"tkhd",value:function(X){var ne=X.id,oe=X.duration,he=X.presentWidth,Ae=X.presentHeight;return Re.box(Re.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&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,he>>>8&255,he&255,0,0,Ae>>>8&255,Ae&255,0,0]))}},{key:"mdia",value:function(X){return Re.box(Re.types.mdia,Re.mdhd(X),Re.hdlr(X),Re.minf(X))}},{key:"mdhd",value:function(X){var ne=X.timescale,oe=X.duration;return Re.box(Re.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,85,196,0,0]))}},{key:"hdlr",value:function(X){var ne=null;return X.type==="audio"?ne=Re.constants.HDLR_AUDIO:ne=Re.constants.HDLR_VIDEO,Re.box(Re.types.hdlr,ne)}},{key:"minf",value:function(X){var ne=null;return X.type==="audio"?ne=Re.box(Re.types.smhd,Re.constants.SMHD):ne=Re.box(Re.types.vmhd,Re.constants.VMHD),Re.box(Re.types.minf,ne,Re.dinf(),Re.stbl(X))}},{key:"dinf",value:function(){var X=Re.box(Re.types.dinf,Re.box(Re.types.dref,Re.constants.DREF));return X}},{key:"stbl",value:function(X){var ne=Re.box(Re.types.stbl,Re.stsd(X),Re.box(Re.types.stts,Re.constants.STTS),Re.box(Re.types.stsc,Re.constants.STSC),Re.box(Re.types.stsz,Re.constants.STSZ),Re.box(Re.types.stco,Re.constants.STCO));return ne}},{key:"stsd",value:function(X){return X.type==="audio"?X.codec==="mp3"?Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp3(X)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp4a(X)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.avc1(X))}},{key:"mp3",value:function(X){var ne=X.channelCount,oe=X.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,ne,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types[".mp3"],he)}},{key:"mp4a",value:function(X){var ne=X.channelCount,oe=X.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,ne,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types.mp4a,he,Re.esds(X))}},{key:"esds",value:function(X){var ne=X.config||[],oe=ne.length,he=new Uint8Array([0,0,0,0,3,23+oe,0,1,0,4,15+oe,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([oe]).concat(ne).concat([6,1,2]));return Re.box(Re.types.esds,he)}},{key:"avc1",value:function(X){var ne=X.avcc,oe=X.codecWidth,he=X.codecHeight,Ae=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,oe>>>8&255,oe&255,he>>>8&255,he&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return Re.box(Re.types.avc1,Ae,Re.box(Re.types.avcC,ne))}},{key:"mvex",value:function(X){return Re.box(Re.types.mvex,Re.trex(X))}},{key:"trex",value:function(X){var ne=X.id,oe=new Uint8Array([0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Re.box(Re.types.trex,oe)}},{key:"moof",value:function(X,ne){return Re.box(Re.types.moof,Re.mfhd(X.sequenceNumber),Re.traf(X,ne))}},{key:"mfhd",value:function(X){var ne=new Uint8Array([0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&255]);return Re.box(Re.types.mfhd,ne)}},{key:"traf",value:function(X,ne){var oe=X.id,he=Re.box(Re.types.tfhd,new Uint8Array([0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255])),Ae=Re.box(Re.types.tfdt,new Uint8Array([0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255])),Qe=Re.sdtp(X),ot=Re.trun(X,Qe.byteLength+16+16+8+16+8+8);return Re.box(Re.types.traf,he,Ae,ot,Qe)}},{key:"sdtp",value:function(X){for(var ne=X.samples||[],oe=ne.length,he=new Uint8Array(4+oe),Ae=0;Ae>>24&255,he>>>16&255,he>>>8&255,he&255,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255],0);for(var ot=0;ot>>24&255,Rt>>>16&255,Rt>>>8&255,Rt&255,Nt>>>24&255,Nt>>>16&255,Nt>>>8&255,Nt&255,ht.isLeading<<2|ht.dependsOn,ht.isDependedOn<<6|ht.hasRedundancy<<4|ht.isNonSync,0,0,Dt>>>24&255,Dt>>>16&255,Dt>>>8&255,Dt&255],12+16*ot)}return Re.box(Re.types.trun,Qe)}},{key:"mdat",value:function(X){return Re.box(Re.types.mdat,X)}}]),Re}();Be.init();var tt=Be,lt=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"getSilentFrame",value:function(X,ne){if(X==="mp4a.40.2"){if(ne===1)return new Uint8Array([0,200,0,128,35,128]);if(ne===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(ne===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(ne===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(ne===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(ne===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])}else{if(ne===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(ne===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(ne===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])}return null}}]),Re}(),qe=lt,Ye=function Re(ve,X,ne,oe,he){Object(ce.a)(this,Re),this.dts=ve,this.pts=X,this.duration=ne,this.originalDts=oe,this.isSyncPoint=he,this.fileposition=null},je=function(){function Re(){Object(ce.a)(this,Re),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(ie.a)(Re,[{key:"appendSyncPoint",value:function(X){X.isSyncPoint=!0,this.syncPoints.push(X)}}]),Re}(),Ue=function(){function Re(){Object(ce.a)(this,Re),this._list=[]}return Object(ie.a)(Re,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(X){var ne=this._list;if(X.length===0)return;ne.length>0&&X[0].originalDts=ne[Ae].dts&&Xne[he].lastSample.originalDts&&X=ne[he].lastSample.originalDts&&(he===ne.length-1||he0&&(Ae=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Ae,this._list.splice(Ae,0,oe)}},{key:"getLastSegmentBefore",value:function(X){var ne=this._searchNearestSegmentBefore(X);return ne>=0?this._list[ne]:null}},{key:"getLastSampleBefore",value:function(X){var ne=this.getLastSegmentBefore(X);return ne!=null?ne.lastSample:null}},{key:"getLastSyncPointBefore",value:function(X){for(var ne=this._searchNearestSegmentBefore(X),oe=this._list[ne].syncPoints;oe.length===0&&ne>0;)ne--,oe=this._list[ne].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Re}(),be=function(){function Re(ve){Object(ce.a)(this,Re),this.TAG="MP4Remuxer",this._config=ve,this._isLive=ve.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new ke("audio"),this._videoSegmentInfoList=new ke("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661)),this._fillSilentAfterSeek=m.msedge||m.msie,this._mp3UseMpegAudio=!m.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(X){return X.onDataAvailable=this.remux.bind(this),X.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(X){this._onInitSegment=X}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(X){this._onMediaSegment=X}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(X){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(X,ne){if(!this._onMediaSegment)throw new o("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(X,ne),this._remuxVideo(ne),this._remuxAudio(X)}},{key:"_onTrackMetadataReceived",value:function(X,ne){var oe=null,he="mp4",Ae=ne.codec;if(X==="audio")this._audioMeta=ne,ne.codec==="mp3"&&this._mp3UseMpegAudio?(he="mpeg",Ae="",oe=new Uint8Array):oe=tt.generateInitSegment(ne);else if(X==="video")this._videoMeta=ne,oe=tt.generateInitSegment(ne);else return;if(!this._onInitSegment)throw new o("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(X,{type:X,data:oe.buffer,codec:Ae,container:"".concat(X,"/").concat(he),mediaDuration:ne.duration})}},{key:"_calculateDtsBase",value:function(X,ne){if(this._dtsBaseInited)return;X.samples&&X.samples.length&&(this._audioDtsBase=X.samples[0].dts),ne.samples&&ne.samples.length&&(this._videoDtsBase=ne.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var X=this._videoStashedLastSample,ne=this._audioStashedLastSample,oe={type:"video",id:1,sequenceNumber:0,samples:[],length:0};X!=null&&(oe.samples.push(X),oe.length=X.length);var he={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};ne!=null&&(he.samples.push(ne),he.length=ne.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(oe,!0),this._remuxAudio(he,!0)}},{key:"_remuxAudio",value:function(X,ne){if(this._audioMeta==null)return;var oe=X,he=oe.samples,Ae=void 0,Qe=-1,ot=-1,Rt=-1,Nt=this._audioMeta.refSampleDuration,ht=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Dt=this._dtsBaseInited&&this._audioNextDts===void 0,sn=!1;if(!he||he.length===0)return;if(he.length===1&&!ne)return;var Ct=0,hn=null,rn=0;ht?(Ct=0,rn=oe.length):(Ct=8,rn=8+oe.length);var ae=null;if(he.length>1&&(ae=he.pop(),rn-=ae.length),this._audioStashedLastSample!=null){var U=this._audioStashedLastSample;this._audioStashedLastSample=null,he.unshift(U),rn+=U.length}ae!=null&&(this._audioStashedLastSample=ae);var H=he[0].dts-this._dtsBase;if(this._audioNextDts)Ae=H-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Ae=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(sn=!0));else{var te=this._audioSegmentInfoList.getLastSampleBefore(H);if(te!=null){var pe=H-(te.originalDts+te.duration);pe<=3&&(pe=0);var se=te.dts+te.duration+pe;Ae=H-se}else Ae=0}if(sn){var $e=H-Ae,yt=this._videoSegmentInfoList.getLastSegmentBefore(H);if(yt!=null&&yt.beginDts<$e){var Ot=qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Ot){var Yt=yt.beginDts,St=$e-yt.beginDts;O.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Yt,", duration: ").concat(St)),he.unshift({unit:Ot,dts:Yt,pts:Yt}),rn+=Ot.byteLength}}else sn=!1}for(var Wt=[],ln=0;ln=1?di=Wt[Wt.length-1].duration:di=Math.floor(Nt);var gi=!1,xi=null;if(di>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!m.safari){gi=!0;var Bi=Math.abs(di-Nt),Ai=Math.ceil(Bi/Nt),sr=Wn+Nt;O.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. `+"dts: ".concat(Wn+di," ms, expected: ").concat(Wn+Math.round(Nt)," ms, ")+"delta: ".concat(Math.round(Bi)," ms, generate: ").concat(Ai," frames"));var Di=qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Di==null&&(O.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Di=Oi),xi=[];for(var fr=0;fr0){var Wi=xi[xi.length-1];Wi.duration=lr-Wi.dts}var Gi={dts:lr,pts:lr,cts:0,unit:Di,size:Di.byteLength,duration:0,originalDts:mi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};xi.push(Gi),rn+=Gi.size,sr+=Nt}var vr=xi[xi.length-1];vr.duration=Wn+di-vr.dts,di=Math.round(Nt)}Wt.push({dts:Wn,pts:Wn,cts:0,unit:Bn.unit,size:Bn.unit.byteLength,duration:di,originalDts:mi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),gi&&Wt.push.apply(Wt,xi)}ht?hn=new Uint8Array(rn):(hn=new Uint8Array(rn),hn[0]=rn>>>24&255,hn[1]=rn>>>16&255,hn[2]=rn>>>8&255,hn[3]=rn&255,hn.set(tt.types.mdat,4));for(var Rr=0;Rr1&&(Ct=he.pop(),sn-=Ct.length),this._videoStashedLastSample!=null){var hn=this._videoStashedLastSample;this._videoStashedLastSample=null,he.unshift(hn),sn+=hn.length}Ct!=null&&(this._videoStashedLastSample=Ct);var rn=he[0].dts-this._dtsBase;if(this._videoNextDts)Ae=rn-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Ae=0;else{var ae=this._videoSegmentInfoList.getLastSampleBefore(rn);if(ae!=null){var U=rn-(ae.originalDts+ae.duration);U<=3&&(U=0);var H=ae.dts+ae.duration+U;Ae=rn-H}else Ae=0}for(var te=new je,pe=[],se=0;se=1?ln=pe[pe.length-1].duration:ln=Math.floor(this._videoMeta.refSampleDuration);if(Ot){var mi=new Ye(Yt,Wt,ln,$e.dts,!0);mi.fileposition=$e.fileposition,te.appendSyncPoint(mi)}pe.push({dts:Yt,pts:Wt,cts:St,units:$e.units,size:$e.length,isKeyframe:Ot,duration:ln,originalDts:yt,flags:{isLeading:0,dependsOn:Ot?2:1,isDependedOn:Ot?1:0,hasRedundancy:0,isNonSync:Ot?0:1}})}Dt=new Uint8Array(sn),Dt[0]=sn>>>24&255,Dt[1]=sn>>>16&255,Dt[2]=sn>>>8&255,Dt[3]=sn&255,Dt.set(tt.types.mdat,4);for(var Wn=0;Wn0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Ae=this._demuxer.parseChunks(X,ne);else if((he=Ne.probe(X)).match){this._demuxer=new Ne(he,this._config),this._remuxer||(this._remuxer=new Ce(this._config));var Qe=this._mediaDataSource;Qe.duration!=null&&!isNaN(Qe.duration)&&(this._demuxer.overridedDuration=Qe.duration),typeof Qe.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Qe.hasAudio),typeof Qe.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Qe.hasVideo),this._demuxer.timestampBase=Qe.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),Ae=this._demuxer.parseChunks(X,ne)}else he=null,O.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){oe._internalAbort()}),this._emitter.emit(Le.DEMUX_ERROR,$.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Ae=0;return Ae}},{key:"_onMediaInfo",value:function(X){var ne=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},X),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Me.prototype));var oe=Object.assign({},X);Object.setPrototypeOf(oe,Me.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=oe,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var he=ne._pendingSeekTime;ne._pendingSeekTime=null,ne.seek(he)})}},{key:"_onMetaDataArrived",value:function(X){this._emitter.emit(Le.METADATA_ARRIVED,X)}},{key:"_onScriptDataArrived",value:function(X){this._emitter.emit(Le.SCRIPTDATA_ARRIVED,X)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(X){var ne=X,oe=ne+1;oe0&&oe[0].originalDts===he&&(he=oe[0].pts),this._emitter.emit(Le.RECOMMEND_SEEKPOINT,he)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(X){var ne=this._mediaInfo.segments[X],oe=Object.assign({},ne);oe.duration=this._mediaInfo.duration,oe.segmentCount=this._mediaInfo.segmentCount,delete oe.segments,delete oe.keyframesIndex,this._emitter.emit(Le.MEDIA_INFO,oe)}},{key:"_reportStatisticsInfo",value:function(){var X={};X.url=this._ioctl.currentURL,X.hasRedirect=this._ioctl.hasRedirect,X.hasRedirect&&(X.redirectedURL=this._ioctl.currentRedirectedURL),X.speed=this._ioctl.currentSpeed,X.loaderType=this._ioctl.loaderType,X.currentSegmentIndex=this._currentSegmentIndex,X.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Le.STATISTICS_INFO,X)}}]),Re}(),at=Ve,_t=function(ve){var X="TransmuxingWorker",ne=null,oe=rn.bind(this);C.install(),ve.addEventListener("message",function(ae){switch(ae.data.cmd){case"init":ne=new at(ae.data.param[0],ae.data.param[1]),ne.on(Le.IO_ERROR,sn.bind(this)),ne.on(Le.DEMUX_ERROR,Ct.bind(this)),ne.on(Le.INIT_SEGMENT,he.bind(this)),ne.on(Le.MEDIA_SEGMENT,Ae.bind(this)),ne.on(Le.LOADING_COMPLETE,Qe.bind(this)),ne.on(Le.RECOVERED_EARLY_EOF,ot.bind(this)),ne.on(Le.MEDIA_INFO,Rt.bind(this)),ne.on(Le.METADATA_ARRIVED,Nt.bind(this)),ne.on(Le.SCRIPTDATA_ARRIVED,ht.bind(this)),ne.on(Le.STATISTICS_INFO,Dt.bind(this)),ne.on(Le.RECOMMEND_SEEKPOINT,hn.bind(this));break;case"destroy":ne&&(ne.destroy(),ne=null),ve.postMessage({msg:"destroyed"});break;case"start":ne.start();break;case"stop":ne.stop();break;case"seek":ne.seek(ae.data.param);break;case"pause":ne.pause();break;case"resume":ne.resume();break;case"logging_config":{var U=ae.data.param;ye.applyConfig(U),U.enableCallback===!0?ye.addLogListener(oe):ye.removeLogListener(oe);break}}});function he(ae,U){var H={msg:Le.INIT_SEGMENT,data:{type:ae,data:U}};ve.postMessage(H,[U.data])}function Ae(ae,U){var H={msg:Le.MEDIA_SEGMENT,data:{type:ae,data:U}};ve.postMessage(H,[U.data])}function Qe(){var ae={msg:Le.LOADING_COMPLETE};ve.postMessage(ae)}function ot(){var ae={msg:Le.RECOVERED_EARLY_EOF};ve.postMessage(ae)}function Rt(ae){var U={msg:Le.MEDIA_INFO,data:ae};ve.postMessage(U)}function Nt(ae){var U={msg:Le.METADATA_ARRIVED,data:ae};ve.postMessage(U)}function ht(ae){var U={msg:Le.SCRIPTDATA_ARRIVED,data:ae};ve.postMessage(U)}function Dt(ae){var U={msg:Le.STATISTICS_INFO,data:ae};ve.postMessage(U)}function sn(ae,U){ve.postMessage({msg:Le.IO_ERROR,data:{type:ae,info:U}})}function Ct(ae,U){ve.postMessage({msg:Le.DEMUX_ERROR,data:{type:ae,info:U}})}function hn(ae){ve.postMessage({msg:Le.RECOMMEND_SEEKPOINT,data:ae})}function rn(ae,U){ve.postMessage({msg:"logcat_callback",data:{type:ae,logcat:U}})}},kt=_t,Bt=function(){function Re(ve,X){if(Object(ce.a)(this,Re),this.TAG="Transmuxer",this._emitter=new T.a,X.enableWorker&&typeof Worker!="undefined")try{var ne=V("0r65");this._worker=ne(kt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ve,X]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ye.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ye.getConfig()})}catch(he){O.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new at(ve,X)}else this._controller=new at(ve,X);if(this._controller){var oe=this._controller;oe.on(Le.IO_ERROR,this._onIOError.bind(this)),oe.on(Le.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(Le.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(Le.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(Le.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(Le.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(Le.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(Le.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(Le.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(Le.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(Le.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ye.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(X){this._worker?this._worker.postMessage({cmd:"seek",param:X}):this._controller.seek(X)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.INIT_SEGMENT,X,ne)})}},{key:"_onMediaSegment",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.MEDIA_SEGMENT,X,ne)})}},{key:"_onLoadingComplete",value:function(){var X=this;Promise.resolve().then(function(){X._emitter.emit(Le.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var X=this;Promise.resolve().then(function(){X._emitter.emit(Le.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.MEDIA_INFO,X)})}},{key:"_onMetaDataArrived",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.METADATA_ARRIVED,X)})}},{key:"_onScriptDataArrived",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.SCRIPTDATA_ARRIVED,X)})}},{key:"_onStatisticsInfo",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.STATISTICS_INFO,X)})}},{key:"_onIOError",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.IO_ERROR,X,ne)})}},{key:"_onDemuxError",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.DEMUX_ERROR,X,ne)})}},{key:"_onRecommendSeekpoint",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.RECOMMEND_SEEKPOINT,X)})}},{key:"_onLoggingConfigChanged",value:function(X){this._worker&&this._worker.postMessage({cmd:"logging_config",param:X})}},{key:"_onWorkerMessage",value:function(X){var ne=X.data,oe=ne.data;if(ne.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(ne.msg){case Le.INIT_SEGMENT:case Le.MEDIA_SEGMENT:this._emitter.emit(ne.msg,oe.type,oe.data);break;case Le.LOADING_COMPLETE:case Le.RECOVERED_EARLY_EOF:this._emitter.emit(ne.msg);break;case Le.MEDIA_INFO:Object.setPrototypeOf(oe,Me.prototype),this._emitter.emit(ne.msg,oe);break;case Le.METADATA_ARRIVED:case Le.SCRIPTDATA_ARRIVED:case Le.STATISTICS_INFO:this._emitter.emit(ne.msg,oe);break;case Le.IO_ERROR:case Le.DEMUX_ERROR:this._emitter.emit(ne.msg,oe.type,oe.info);break;case Le.RECOMMEND_SEEKPOINT:this._emitter.emit(ne.msg,oe);break;case"logcat_callback":O.emitter.emit("log",oe.type,oe.logcat);break;default:break}}}]),Re}(),jt=Bt,At={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},pt=At,gt=function(){function Re(ve){Object(ce.a)(this,Re),this.TAG="MSEController",this._config=ve,this._emitter=new T.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Ue}return Object(ie.a)(Re,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"attachMediaElement",value:function(X){if(this._mediaSource)throw new o("MediaSource has been attached to an HTMLMediaElement!");var ne=this._mediaSource=new window.MediaSource;ne.addEventListener("sourceopen",this.e.onSourceOpen),ne.addEventListener("sourceended",this.e.onSourceEnded),ne.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=X,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),X.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var X=this._mediaSource;for(var ne in this._sourceBuffers){var oe=this._pendingSegments[ne];oe.splice(0,oe.length),this._pendingSegments[ne]=null,this._pendingRemoveRanges[ne]=null,this._lastInitSegments[ne]=null;var he=this._sourceBuffers[ne];if(he){if(X.readyState!=="closed"){try{X.removeSourceBuffer(he)}catch(Ae){O.e(this.TAG,Ae.message)}he.removeEventListener("error",this.e.onSourceBufferError),he.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[ne]=null,this._sourceBuffers[ne]=null}}if(X.readyState==="open")try{X.endOfStream()}catch(Ae){O.e(this.TAG,Ae.message)}X.removeEventListener("sourceopen",this.e.onSourceOpen),X.removeEventListener("sourceended",this.e.onSourceEnded),X.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(X,ne){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(X),this._pendingSegments[X.type].push(X);return}var oe=X,he="".concat(oe.container);oe.codec&&oe.codec.length>0&&(he+=";codecs=".concat(oe.codec));var Ae=!1;if(O.v(this.TAG,"Received Initialization Segment, mimeType: "+he),this._lastInitSegments[oe.type]=oe,he!==this._mimeTypes[oe.type]){if(this._mimeTypes[oe.type])O.v(this.TAG,"Notice: ".concat(oe.type," mimeType changed, origin: ").concat(this._mimeTypes[oe.type],", target: ").concat(he));else{Ae=!0;try{var Qe=this._sourceBuffers[oe.type]=this._mediaSource.addSourceBuffer(he);Qe.addEventListener("error",this.e.onSourceBufferError),Qe.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(ot){O.e(this.TAG,ot.message),this._emitter.emit(pt.ERROR,{code:ot.code,msg:ot.message});return}}this._mimeTypes[oe.type]=he}ne||this._pendingSegments[oe.type].push(oe),Ae||this._sourceBuffers[oe.type]&&!this._sourceBuffers[oe.type].updating&&this._doAppendSegments(),m.safari&&oe.container==="audio/mpeg"&&oe.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=oe.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(X){var ne=X;this._pendingSegments[ne.type].push(ne),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var oe=this._sourceBuffers[ne.type];oe&&!oe.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(X){for(var ne in this._sourceBuffers){if(!this._sourceBuffers[ne])continue;var oe=this._sourceBuffers[ne];if(this._mediaSource.readyState==="open")try{oe.abort()}catch(Nt){O.e(this.TAG,Nt.message)}this._idrList.clear();var he=this._pendingSegments[ne];if(he.splice(0,he.length),this._mediaSource.readyState==="closed")continue;for(var Ae=0;Ae=1&&X-he.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var X=this._mediaElement.currentTime;for(var ne in this._sourceBuffers){var oe=this._sourceBuffers[ne];if(oe){for(var he=oe.buffered,Ae=!1,Qe=0;Qe=this._config.autoCleanupMaxBackwardDuration){Ae=!0;var Nt=X-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[ne].push({start:ot,end:Nt})}}else Rt0&&(isNaN(ne)||oe>ne)&&(O.v(this.TAG,"Update MediaSource duration from ".concat(ne," to ").concat(oe)),this._mediaSource.duration=oe),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var X in this._pendingRemoveRanges){if(!this._sourceBuffers[X]||this._sourceBuffers[X].updating)continue;for(var ne=this._sourceBuffers[X],oe=this._pendingRemoveRanges[X];oe.length&&!ne.updating;){var he=oe.shift();ne.remove(he.start,he.end)}}}},{key:"_doAppendSegments",value:function(){var X=this._pendingSegments;for(var ne in X){if(!this._sourceBuffers[ne]||this._sourceBuffers[ne].updating)continue;if(X[ne].length>0){var oe=X[ne].shift();if(oe.timestampOffset){var he=this._sourceBuffers[ne].timestampOffset,Ae=oe.timestampOffset/1e3,Qe=Math.abs(he-Ae);Qe>.1&&(O.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(he," to ").concat(Ae)),this._sourceBuffers[ne].timestampOffset=Ae),delete oe.timestampOffset}if(!oe.data||oe.data.byteLength===0)continue;try{this._sourceBuffers[ne].appendBuffer(oe.data),this._isBufferFull=!1,ne==="video"&&oe.hasOwnProperty("info")&&this._idrList.appendArray(oe.info.syncPoints)}catch(ot){this._pendingSegments[ne].unshift(oe),ot.code===22?(this._isBufferFull||this._emitter.emit(pt.BUFFER_FULL),this._isBufferFull=!0):(O.e(this.TAG,ot.message),this._emitter.emit(pt.ERROR,{code:ot.code,msg:ot.message}))}}}}},{key:"_onSourceOpen",value:function(){if(O.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var X=this._pendingSourceBufferInit;X.length;){var ne=X.shift();this.appendInitSegment(ne,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(pt.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){O.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){O.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var X=this._pendingSegments;return X.video.length>0||X.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var X=this._pendingRemoveRanges;return X.video.length>0||X.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(pt.UPDATE_END)}},{key:"_onSourceBufferError",value:function(X){O.e(this.TAG,"SourceBuffer Error: ".concat(X))}}]),Re}(),rt=gt,Oe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},ze={NETWORK_EXCEPTION:i.EXCEPTION,NETWORK_STATUS_CODE_INVALID:i.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:i.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:i.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:$.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:$.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:$.CODEC_UNSUPPORTED},vt=function(){function Re(ve,X){if(Object(ce.a)(this,Re),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new T.a,this._config=le(),typeof X=="object"&&Object.assign(this._config,X),ve.type.toLowerCase()!=="flv")throw new r("FlvPlayer requires an flv MediaDataSource input!");ve.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=ve,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var ne=m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661);this._alwaysSeekKeyframe=!!(ne||m.msedge||m.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){var oe=this;X===Ie.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Ie.MEDIA_INFO,oe.mediaInfo)}):X===Ie.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Ie.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"attachMediaElement",value:function(X){var ne=this;if(this._mediaElement=X,X.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),X.addEventListener("seeking",this.e.onvSeeking),X.addEventListener("canplay",this.e.onvCanPlay),X.addEventListener("stalled",this.e.onvStalled),X.addEventListener("progress",this.e.onvProgress),this._msectl=new rt(this._config),this._msectl.on(pt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(pt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(pt.SOURCE_OPEN,function(){ne._mseSourceOpened=!0,ne._hasPendingLoad&&(ne._hasPendingLoad=!1,ne.load())}),this._msectl.on(pt.ERROR,function(oe){ne._emitter.emit(Ie.ERROR,Oe.MEDIA_ERROR,ze.MEDIA_MSE_ERROR,oe)}),this._msectl.attachMediaElement(X),this._pendingSeekTime!=null)try{X.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(oe){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var X=this;if(!this._mediaElement)throw new o("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new o("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new jt(this._mediaDataSource,this._config),this._transmuxer.on(Le.INIT_SEGMENT,function(ne,oe){X._msectl.appendInitSegment(oe)}),this._transmuxer.on(Le.MEDIA_SEGMENT,function(ne,oe){if(X._msectl.appendMediaSegment(oe),X._config.lazyLoad&&!X._config.isLive){var he=X._mediaElement.currentTime;oe.info.endDts>=(he+X._config.lazyLoadMaxDuration)*1e3&&(X._progressChecker==null&&(O.v(X.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),X._suspendTransmuxer()))}}),this._transmuxer.on(Le.LOADING_COMPLETE,function(){X._msectl.endOfStream(),X._emitter.emit(Ie.LOADING_COMPLETE)}),this._transmuxer.on(Le.RECOVERED_EARLY_EOF,function(){X._emitter.emit(Ie.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Le.IO_ERROR,function(ne,oe){X._emitter.emit(Ie.ERROR,Oe.NETWORK_ERROR,ne,oe)}),this._transmuxer.on(Le.DEMUX_ERROR,function(ne,oe){X._emitter.emit(Ie.ERROR,Oe.MEDIA_ERROR,ne,{code:-1,msg:oe})}),this._transmuxer.on(Le.MEDIA_INFO,function(ne){X._mediaInfo=ne,X._emitter.emit(Ie.MEDIA_INFO,Object.assign({},ne))}),this._transmuxer.on(Le.METADATA_ARRIVED,function(ne){X._emitter.emit(Ie.METADATA_ARRIVED,ne)}),this._transmuxer.on(Le.SCRIPTDATA_ARRIVED,function(ne){X._emitter.emit(Ie.SCRIPTDATA_ARRIVED,ne)}),this._transmuxer.on(Le.STATISTICS_INFO,function(ne){X._statisticsInfo=X._fillStatisticsInfo(ne),X._emitter.emit(Ie.STATISTICS_INFO,Object.assign({},X._statisticsInfo))}),this._transmuxer.on(Le.RECOMMEND_SEEKPOINT,function(ne){X._mediaElement&&!X._config.accurateSeek&&(X._requestSetTime=!0,X._mediaElement.currentTime=ne/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(X){this._mediaElement.volume=X}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(X){this._mediaElement.muted=X}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(X){this._mediaElement?this._internalSeek(X):this._pendingSeekTime=X}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(X){if(X.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return X;var ne=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Ae=this._mediaElement.getVideoPlaybackQuality();oe=Ae.totalVideoFrames,he=Ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):ne=!1;return ne&&(X.decodedFrames=oe,X.droppedFrames=he),X}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var X=this._mediaElement.buffered,ne=this._mediaElement.currentTime,oe=0,he=0,Ae=0;Ae=ne+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(O.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){O.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var X=this._mediaElement.currentTime,ne=this._mediaElement.buffered,oe=!1,he=0;he=Ae&&X=Qe-this._config.lazyLoadRecoverDuration&&(oe=!0);break}}oe&&(window.clearInterval(this._progressChecker),this._progressChecker=null,oe&&(O.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(X){for(var ne=this._mediaElement.buffered,oe=0;oe=he&&X0){var Ae=this._mediaElement.buffered.start(0);(Ae<1&&X0&&ne.currentTime0){var he=oe.start(0);if(he<1&&ne0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(X){this._mediaElement.volume=X}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(X){this._mediaElement.muted=X}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(X){this._mediaElement?this._mediaElement.currentTime=X:this._pendingSeekTime=X}},{key:"mediaInfo",get:function(){var X=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",ne={mimeType:X+this._mediaDataSource.type};return this._mediaElement&&(ne.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(ne.width=this._mediaElement.videoWidth,ne.height=this._mediaElement.videoHeight)),ne}},{key:"statisticsInfo",get:function(){var X={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return X;var ne=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Ae=this._mediaElement.getVideoPlaybackQuality();oe=Ae.totalVideoFrames,he=Ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):ne=!1;return ne&&(X.decodedFrames=oe,X.droppedFrames=he),X}},{key:"_onvLoadedMetadata",value:function(X){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Ie.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Ie.STATISTICS_INFO,this.statisticsInfo)}}]),Re}(),Pt=It;C.install();function Ze(Re,ve){var X=Re;if(X==null||typeof X!="object")throw new r("MediaDataSource must be an javascript object!");if(!X.hasOwnProperty("type"))throw new r("MediaDataSource must has type field to indicate video file type!");switch(X.type){case"flv":return new st(X,ve);default:return new Pt(X,ve)}}function mt(){return Te.supportMSEH264Playback()}function Lt(){return Te.getFeatureList()}var Mt={};Mt.createPlayer=Ze,Mt.isSupported=mt,Mt.getFeatureList=Lt,Mt.BaseLoader=t,Mt.LoaderStatus=a,Mt.LoaderErrors=i,Mt.Events=Ie,Mt.ErrorTypes=Oe,Mt.ErrorDetails=ze,Mt.FlvPlayer=st,Mt.NativePlayer=Pt,Mt.LoggingControl=ye,Object.defineProperty(Mt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var $t=Xe.a=Mt},GgEA:function(nt,Xe,V){},Gytx:function(nt,Xe){nt.exports=function(ce,ie,W,C){var D=W?W.call(C,ce,ie):void 0;if(D!==void 0)return!!D;if(ce===ie)return!0;if(typeof ce!="object"||!ce||typeof ie!="object"||!ie)return!1;var T=Object.keys(ce),A=Object.keys(ie);if(T.length!==A.length)return!1;for(var O=Object.prototype.hasOwnProperty.bind(ie),f=0;f>>6)+f(128|N&63):f(224|N>>>12&15)+f(128|N>>>6&63)+f(128|N&63)}else{var N=65536+(R.charCodeAt(0)-55296)*1024+(R.charCodeAt(1)-56320);return f(240|N>>>18&7)+f(128|N>>>12&63)+f(128|N>>>6&63)+f(128|N&63)}},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(R){return R.replace(c,p)},n=function(R){var N=[0,2,1][R.length%3],F=R.charCodeAt(0)<<16|(R.length>1?R.charCodeAt(1):0)<<8|(R.length>2?R.charCodeAt(2):0),z=[A.charAt(F>>>18),A.charAt(F>>>12&63),N>=2?"=":A.charAt(F>>>6&63),N>=1?"=":A.charAt(F&63)];return z.join("")},o=C.btoa&&typeof C.btoa=="function"?function(R){return C.btoa(R)}:function(R){if(R.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return R.replace(/[\s\S]{1,3}/g,n)},r=function(R){return o(s(String(R)))},l=function(R){return R.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},a=function(R,N){return N?l(r(R)):r(R)},i=function(R){return a(R,!0)},t;C.Uint8Array&&(t=function(R,N){for(var F="",z=0,q=R.length;z>>18)+A.charAt(J>>>12&63)+(typeof M!="undefined"?A.charAt(J>>>6&63):"=")+(typeof G!="undefined"?A.charAt(J&63):"=")}return N?l(F):F});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(R){switch(R.length){case 4:var N=(7&R.charCodeAt(0))<<18|(63&R.charCodeAt(1))<<12|(63&R.charCodeAt(2))<<6|63&R.charCodeAt(3),F=N-65536;return f((F>>>10)+55296)+f((F&1023)+56320);case 3:return f((15&R.charCodeAt(0))<<12|(63&R.charCodeAt(1))<<6|63&R.charCodeAt(2));default:return f((31&R.charCodeAt(0))<<6|63&R.charCodeAt(1))}},y=function(R){return R.replace(d,v)},b=function(R){var N=R.length,F=N%4,z=(N>0?O[R.charAt(0)]<<18:0)|(N>1?O[R.charAt(1)]<<12:0)|(N>2?O[R.charAt(2)]<<6:0)|(N>3?O[R.charAt(3)]:0),q=[f(z>>>16),f(z>>>8&255),f(z&255)];return q.length-=[0,0,2,1][F],q.join("")},g=C.atob&&typeof C.atob=="function"?function(R){return C.atob(R)}:function(R){return R.replace(/\S{1,4}/g,b)},m=function(R){return g(String(R).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(R){return y(g(R))},x=function(R){return String(R).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(R){return _(x(R))},E;C.Uint8Array&&(E=function(R){return Uint8Array.from(m(x(R)),function(N){return N.charCodeAt(0)})});var S=function(){var R=C.Base64;return C.Base64=D,R};if(C.Base64={VERSION:T,atob:m,btoa:o,fromBase64:h,toBase64:a,utob:s,encode:a,encodeURI:i,btou:y,decode:h,noConflict:S,fromUint8Array:t,toUint8Array:E},typeof Object.defineProperty=="function"){var w=function(R){return{value:R,enumerable:!1,writable:!0,configurable:!0}};C.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",w(function(){return h(this)})),Object.defineProperty(String.prototype,"toBase64",w(function(R){return a(this,R)})),Object.defineProperty(String.prototype,"toBase64URI",w(function(){return a(this,!0)}))}}return C.Meteor&&(Base64=C.Base64),nt.exports?nt.exports.Base64=C.Base64:!(ie=[],W=function(){return C.Base64}.apply(Xe,ie),W!==void 0&&(nt.exports=W)),{Base64:C.Base64}})}).call(this,V("IyRk"))},JOrW:function(nt,Xe,V){nt.exports=V.p+"static/gf.09d89ab3.svg"},LdHM:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return d}),V.d(Xe,"a",function(){return y});var ce=V("1OyB"),ie=V("vuIU"),W=V("Ji7U"),C=V("LK+K"),D=V("cDcd"),T=V("rePB"),A=V("Ff2n"),O=V("ODXe"),f=V("4IlW"),p=V("bX4T"),c=V("YrtM"),s=V("TSYQ"),n=V.n(s),o=V("+nKL"),r=V("8OUc"),l=function(G,J){var K=G.prefixCls,Z=G.id,le=G.flattenOptions,de=G.childrenAsData,Te=G.values,we=G.searchValue,Ie=G.multiple,_e=G.defaultActiveFirstOption,ye=G.height,Ke=G.itemHeight,Me=G.notFoundContent,Fe=G.open,Ge=G.menuItemSelectedIcon,Ee=G.virtual,me=G.onSelect,We=G.onToggleOpen,He=G.onActiveValue,it=G.onScroll,re=G.onMouseEnter,P="".concat(K,"-item"),j=Object(c.a)(function(){return le},[Fe,le],function(Ye,je){return je[0]&&Ye[1]!==je[1]}),ee=D.useRef(null),$=function(je){je.preventDefault()},Q=function(je){ee.current&&ee.current.scrollTo({index:je})},xe=function(je){for(var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ke=j.length,be=0;be1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(M).map(function(J,K){if(!D.isValidElement(J)||!J.type)return null;var Z=J.type.isSelectOptGroup,le=J.key,de=J.props,Te=de.children,we=Object(A.a)(de,["children"]);return G||!Z?m(J):Object(b.a)(Object(b.a)({key:"__RC_SELECT_GRP__".concat(le===null?K:le,"__"),label:le},we),{},{options:_(Te)})}).filter(function(J){return J})}var x=V("2Qr1"),h=V("qNPg"),E=V("U8pU"),S=V("Kwbf"),w=V("WKfj");function R(M){var G=M.mode,J=M.options,K=M.children,Z=M.backfill,le=M.allowClear,de=M.placeholder,Te=M.getInputElement,we=M.showSearch,Ie=M.onSearch,_e=M.defaultOpen,ye=M.autoFocus,Ke=M.labelInValue,Me=M.value,Fe=M.inputValue,Ge=M.optionLabelProp,Ee=G==="multiple"||G==="tags",me=we!==void 0?we:Ee||G==="combobox",We=J||_(K);if(Object(S.a)(G!=="tags"||We.every(function(P){return!P.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var He=We.some(function(P){return P.options?P.options.some(function(j){return typeof("value"in j?j.value:j.key)=="number"}):typeof("value"in P?P.value:P.key)=="number"});Object(S.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(G!=="combobox"||!Ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(G==="combobox"||!Z,"`backfill` only works with `combobox` mode."),Object(S.a)(G==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(S.b)(G!=="combobox"||!Te||!le||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ie&&!me&&G!=="combobox"&&G!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!_e||ye,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Me!=null){var it=Object(w.d)(Me);Object(S.a)(!Ke||it.every(function(P){return Object(E.a)(P)==="object"&&("key"in P||"value"in P)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ee||Array.isArray(Me),"`value` should be array when `mode` is `multiple` or `tags`")}if(K){var re=null;Object(g.a)(K).some(function(P){if(!D.isValidElement(P)||!P.type)return!1;var j=P.type;if(j.isSelectOption)return!1;if(j.isSelectOptGroup){var ee=Object(g.a)(P.props.children).every(function($){return!D.isValidElement($)||!P.type||$.type.isSelectOption?!0:(re=$.type,!1)});return!ee}return re=j,!0}),re&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(re.displayName||re.name||re,"`.")),Object(S.a)(Fe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=R,F=Object(h.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:_,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:N,fillOptionsWithMissingValue:x.a}),z=function(M){Object(W.a)(J,M);var G=Object(C.a)(J);function J(){var K;return Object(ce.a)(this,J),K=G.apply(this,arguments),K.selectRef=D.createRef(),K.focus=function(){K.selectRef.current.focus()},K.blur=function(){K.selectRef.current.blur()},K}return Object(ie.a)(J,[{key:"render",value:function(){return D.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),J}(D.Component);z.Option=d,z.OptGroup=y;var q=z,B=Xe.c=q},M8RZ:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return f});var ce=V("fWQN"),ie=V("mtLc"),W=V("yKVA"),C=V("879j"),D=V("cDcd"),T=V.n(D),A=V("faye"),O=V.n(A),f=function(p){Object(W.a)(s,p);var c=Object(C.a)(s);function s(n){var o;Object(ce.a)(this,s),o=c.call(this,n);var r=window.document;return o.node=r.createElement("div"),r.body.appendChild(o.node),o}return Object(ie.a)(s,[{key:"render",value:function(){var o=this.props.children;return Object(A.createPortal)(o,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),s}(T.a.Component)},MFOe:function(nt,Xe,V){(function(ce){var ie=T(),W=A(),C=O(),D=typeof window!="undefined"?window:ce;nt.exports={assign:ie,create:W,trim:C,bind:f,slice:p,each:c,map:s,pluck:n,isList:o,isFunction:r,isObject:l,Global:D};function T(){return Object.assign?Object.assign:function(i,t,d,v){for(var y=1;y=0;l-=1){var a=O.get(l)||new Set;a.forEach(function(i){var t=i.parent,d=i.node;if(p(d)||!i.parent||r.has(i.parent.key))return;if(p(i.parent.node)){r.add(t.key);return}var v=!0,y=!1;(t.children||[]).filter(function(b){return!p(b.node)}).forEach(function(b){var g=b.key,m=c.has(g);v&&!m&&(v=!1),!y&&(m||s.has(g))&&(y=!0)}),v&&c.add(t.key),y&&s.add(t.key),r.add(t.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(ie(s,c))}}function D(A,O,f,p,c){for(var s=new Set(A),n=new Set(O),o=0;o<=p;o+=1){var r=f.get(o)||new Set;r.forEach(function(t){var d=t.key,v=t.node,y=t.children,b=y===void 0?[]:y;!s.has(d)&&!n.has(d)&&!c(v)&&b.filter(function(g){return!c(g.node)}).forEach(function(g){s.delete(g.key)})})}n=new Set;for(var l=new Set,a=p;a>=0;a-=1){var i=f.get(a)||new Set;i.forEach(function(t){var d=t.parent,v=t.node;if(c(v)||!t.parent||l.has(t.parent.key))return;if(c(t.parent.node)){l.add(d.key);return}var y=!0,b=!1;(d.children||[]).filter(function(g){return!c(g.node)}).forEach(function(g){var m=g.key,_=s.has(m);y&&!_&&(y=!1),!b&&(_||n.has(m))&&(b=!0)}),y||s.delete(d.key),b&&n.add(d.key),l.add(d.key)})}return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(ie(n,s))}}function T(A,O,f,p){var c=[],s;p?s=p:s=W;var n=new Set(A.filter(function(a){var i=!!f[a];return i||c.push(a),i})),o=new Map,r=0;Object.keys(f).forEach(function(a){var i=f[a],t=i.level,d=o.get(t);d||(d=new Set,o.set(t,d)),d.add(i),r=Math.max(r,t)}),Object(ce.a)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var l;return O===!0?l=C(n,o,r,s):l=D(n,O.halfCheckedKeys,o,r,s),l}},OLES:function(nt,Xe,V){"use strict";var ce=V("U8pU"),ie=V("VTBJ"),W=V("Ff2n"),C=V("cDcd"),D=V("uciX"),T=V("7ixt"),A=function(n){var o=n.overlay,r=n.prefixCls,l=n.id,a=n.overlayInnerStyle;return C.createElement("div",{className:"".concat(r,"-inner"),id:l,role:"tooltip",style:a},typeof o=="function"?o():o)},O=A,f=function(n,o){var r=n.overlayClassName,l=n.trigger,a=l===void 0?["hover"]:l,i=n.mouseEnterDelay,t=i===void 0?0:i,d=n.mouseLeaveDelay,v=d===void 0?.1:d,y=n.overlayStyle,b=n.prefixCls,g=b===void 0?"rc-tooltip":b,m=n.children,_=n.onVisibleChange,x=n.afterVisibleChange,h=n.transitionName,E=n.animation,S=n.placement,w=S===void 0?"right":S,R=n.align,N=R===void 0?{}:R,F=n.destroyTooltipOnHide,z=F===void 0?!1:F,q=n.defaultVisible,B=n.getTooltipContainer,M=n.overlayInnerStyle,G=Object(W.a)(n,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),J=Object(C.useRef)(null);Object(C.useImperativeHandle)(o,function(){return J.current});var K=Object(ie.a)({},G);"visible"in n&&(K.popupVisible=n.visible);var Z=function(){var Ie=n.arrowContent,_e=Ie===void 0?null:Ie,ye=n.overlay,Ke=n.id;return[C.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},_e),C.createElement(O,{key:"content",prefixCls:g,id:Ke,overlay:ye,overlayInnerStyle:M})]},le=!1,de=!1;if(typeof z=="boolean")le=z;else if(z&&Object(ce.a)(z)==="object"){var Te=z.keepParent;le=Te===!0,de=Te===!1}return C.createElement(D.a,Object.assign({popupClassName:r,prefixCls:g,popup:Z,action:a,builtinPlacements:T.a,popupPlacement:w,ref:J,popupAlign:N,getPopupContainer:B,onPopupVisibleChange:_,afterPopupVisibleChange:x,popupTransitionName:h,popupAnimation:E,defaultPopupVisible:q,destroyPopupOnHide:le,autoDestroy:de,mouseLeaveDelay:v,popupStyle:y,mouseEnterDelay:t},K),m)},p=Object(C.forwardRef)(f),c=Xe.a=p},OZM5:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return p}),V.d(Xe,"a",function(){return c}),V.d(Xe,"k",function(){return s}),V.d(Xe,"h",function(){return n}),V.d(Xe,"i",function(){return o}),V.d(Xe,"g",function(){return r}),V.d(Xe,"c",function(){return l}),V.d(Xe,"d",function(){return a}),V.d(Xe,"j",function(){return d}),V.d(Xe,"e",function(){return v}),V.d(Xe,"f",function(){return y});var ce=V("KQm4"),ie=V("U8pU"),W=V("Ff2n"),C=V("cDcd"),D=V.n(C),T=V("Kwbf"),A=V("WaYH"),O=.25,f=2;function p(b,g){var m=b.slice(),_=m.indexOf(g);return _>=0&&m.splice(_,1),m}function c(b,g){var m=b.slice();return m.indexOf(g)===-1&&m.push(g),m}function s(b){return b.split("-")}function n(b,g){return"".concat(b,"-").concat(g)}function o(b){return b&&b.type&&b.type.isTreeNode}function r(b,g){var m=[b],_=g[b];function x(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(E){var S=E.key,w=E.children;m.push(S),x(w)})}return x(_.children),m}function l(b,g){var m=b.clientY,_=g.selectHandle.getBoundingClientRect(),x=_.top,h=_.bottom,E=_.height,S=Math.max(E*O,f);return m<=x+S?-1:m>=h-S?1:0}function a(b,g){if(!b)return;var m=g.multiple;return m?b.slice():b.length?[b[0]]:b}var i=function(g){return g};function t(b,g){if(!b)return[];var m=g||{},_=m.processProps,x=_===void 0?i:_,h=Array.isArray(b)?b:[b];return h.map(function(E){var S=E.children,w=Object(W.a)(E,["children"]),R=t(S,g);return D.a.createElement(A.a,Object.assign({},x(w)),R)})}function d(b){if(!b)return null;var g;if(Array.isArray(b))g={checkedKeys:b,halfCheckedKeys:void 0};else if(Object(ie.a)(b)==="object")g={checkedKeys:b.checked||void 0,halfCheckedKeys:b.halfChecked||void 0};else return Object(T.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function v(b,g){var m=new Set;function _(x){if(m.has(x))return;var h=g[x];if(!h)return;m.add(x);var E=h.parent,S=h.node;if(S.disabled)return;E&&_(E.key)}return(b||[]).forEach(function(x){_(x)}),Object(ce.a)(m)}function y(b){var g={};return Object.keys(b).forEach(function(m){(m.startsWith("data-")||m.startsWith("aria-"))&&(g[m]=b[m])}),g}},"OkW/":function(nt,Xe,V){},Ot1p:function(nt,Xe,V){"use strict";var ce=V("2qtc"),ie=V("kLXV"),W=V("rAM+"),C=V("miYZ"),D=V("tsqr"),T=V("9og8"),A=V("tJVT"),O=V("jrin"),f=V("WmNS"),p=V.n(f),c=V("cDcd"),s=V.n(c),n=V("VrN/"),o=V.n(n),r=V("bdgK"),l=V("p77/"),a=V("Bd2K"),i=V("ELLl"),t=V("19Vz"),d=V("lZu9"),v=V("+NIl"),y=V("kSUc"),b=V("9Bee"),g=function(Ve){var at=Ve.value,_t=at===void 0?"":at,kt=Ve.className,Bt=Ve.showTextOnly,jt=Ve.showLines,At=Ve.style,pt=At===void 0?{}:At,gt=Object(c.useMemo)(function(){return""},[_t]);return s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{dangerouslySetInnerHTML:{__html:gt}}))},m=V("0Owb"),_=V("dejd"),x=V("C+DQ"),h=V("1vsH"),E=V("m3rI"),S=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function w(Ve){var at=Ve.onActionCallback,_t=Ve.title,kt=Ve.icon,Bt=Ve.actionName,jt=Ve.className,At=jt===void 0?"":jt,pt=Ve.children;function gt(){at(Bt)}return s.a.createElement("a",{title:_t,className:At,onClick:gt},s.a.createElement("i",{className:"md-iconfont ".concat(kt)}),pt)}var R=function(Ve){var at=Ve.watch,_t=Ve.showNullButton,kt=Ve.onActionCallback,Bt=Ve.fullScreen,jt=Ve.insertTemp,At=Ve.hidetoolBar,pt=Ve.uuid,gt=Ve.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.G)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(E.a.PROXY_SERVER)));var rt=[].concat(S,[{title:"".concat(at?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(at?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return s.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&rt.map(function(Oe,ze){return s.a.createElement("li",{key:ze},Oe.actionName?s.a.createElement(w,Object(m.a)({},Oe,{onActionCallback:kt})):s.a.createElement("span",{className:"v-line"}))}),_t?s.a.createElement("li",null,s.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:kt},s.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,jt&&s.a.createElement("li",null,s.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(jt),onActionCallback:kt},s.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),s.a.createElement("li",{className:"btn-full-screen"},s.a.createElement(w,{icon:"".concat(Bt?"icon-shrink":"icon-enlarge"),title:Bt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:kt})))},N=V("M8RZ"),F=V("+L6B"),z=V("2/Rp"),q=V("y8nQ"),B=V("Vl3Y"),M=V("5NDa"),G=V("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},K=function(Ve){var at=Ve.callback,_t=Ve.onCancel;function kt(Bt){at(Bt)}return s.a.createElement(B.a,Object(m.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:kt}),s.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},s.a.createElement(G.a,null)),s.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},s.a.createElement(G.a,null)),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(z.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},Z=V("7ahc"),le=V("HmJG"),de=V("BjJ7"),Te=B.a.useForm,we={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},_e=function(Ve){var at=Ve.callback,_t=Ve.onCancel,kt=Te(),Bt=Object(A.a)(kt,1),jt=Bt[0];function At(rt){at(rt)}function pt(rt,Oe){if(rt.status===-1){D.b.error(rt.message);return}jt.setFieldsValue({src:"/api/attachments/".concat(rt.id),type:Oe.type})}function gt(rt){var Oe=rt.target.files[0];Ke(Oe,pt)}return s.a.createElement(B.a,Object(m.a)({form:jt},Ie,{className:"upload-image-panel",onFinish:At}),s.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},s.a.createElement("div",{className:"flex-container"},s.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},s.a.createElement(G.a,{style:we})),s.a.createElement(ye,{onFileChange:gt}))),s.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},s.a.createElement(G.a,{style:{width:264}})),s.a.createElement(B.a.Item,{style:{textAlign:"right"}},s.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(z.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))};function ye(Ve){var at=Ve.onFileChange;return s.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",s.a.createElement("input",{type:"file",onChange:at}))}function Ke(Ve,at){if(!Ve)throw new String("\u6CA1\u6709\u6587\u4EF6");var _t=new FormData;_t.append("editormd-image-file",Ve),_t.append("file_param_name","editormd-image-file"),_t.append("byxhr","true");var kt=new window.XMLHttpRequest;kt.withCredentials=!0,kt.addEventListener("load",function(Bt){at(JSON.parse(Bt.target.responseText),Ve)},!1),kt.addEventListener("error",function(Bt){console.error(Bt)},!1),kt.open("POST","".concat(de.a,"/api/attachments.json")),kt.send(_t)}var Me=V("giR+"),Fe=V("fyUT"),Ge=V("7Kak"),Ee=V("9yH6"),me=Ee.a.Group,We={margin:"0 8px"},He=function(Ve){var at=Ve.callback,_t=Ve.onCancel;function kt(Bt){at(Bt)}return s.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:kt},s.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},s.a.createElement("span",{style:We},"\u5355\u5143\u683C\u6570\uFF1A"),s.a.createElement("span",{style:We},"\u884C\u6570"),s.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},s.a.createElement(Fe.a,null)),s.a.createElement("span",{style:We},"\u5217\u6570"),s.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},s.a.createElement(Fe.a,null))),s.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},s.a.createElement("span",{style:We},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),s.a.createElement(B.a.Item,{name:"align"},s.a.createElement(me,null,s.a.createElement(Ee.a,{value:"default"},s.a.createElement("i",{className:"fa fa-align-justify"})),s.a.createElement(Ee.a,{value:"left"},s.a.createElement("i",{className:"fa fa-align-left"})),s.a.createElement(Ee.a,{value:"center"},s.a.createElement("i",{className:"fa fa-align-center"})),s.a.createElement(Ee.a,{value:"right"},s.a.createElement("i",{className:"fa fa-align-right"}))))),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(z.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},it=V("ErOA"),re=V("7Cbv"),P="link",j="upload-image",ee="code-block",$="add-table",Q="------------",xe={default:Q,left:":".concat(Q),center:":".concat(Q,":"),right:"".concat(Q,":")},De=V("9VGf"),dt,Ne;function Be(){}var tt=0,lt=1e4,qe="\u2581",Ye=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function je(Ve){return/^\d+$/.test(Ve)?"".concat(Ve,"px"):Ve}var Ue=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=Ue?"Cmd":"Ctrl",be=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ce=(dt={},Object(O.a)(dt,ke+"-B","bold"),Object(O.a)(dt,ke+"-I","italic"),dt),Pe=(Ne={},Object(O.a)(Ne,P,"\u6DFB\u52A0\u94FE\u63A5"),Object(O.a)(Ne,ee,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(O.a)(Ne,j,"\u6DFB\u52A0\u6587\u4EF6"),Object(O.a)(Ne,$,"\u6DFB\u52A0\u8868\u683C"),Ne),Le=Xe.a=function(Ve){var at=Ve.defaultValue,_t=at===void 0?"":at,kt=Ve.onChange,Bt=Ve.width,jt=Bt===void 0?"100%":Bt,At=Ve.height,pt=At===void 0?400:At,gt=Ve.miniToolbar,rt=gt===void 0?!1:gt,Oe=Ve.isFocus,ze=Oe===void 0?!1:Oe,vt=Ve.watch,st=Ve.insertTemp,It=Ve.mode,Pt=It===void 0?"markdown":It,Ze=Ve.id,mt=Ze===void 0?"markdown-editor-id":Ze,Lt=Ve.showResizeBar,Mt=Lt===void 0?!1:Lt,$t=Ve.noStorage,Re=$t===void 0?!1:$t,ve=Ve.showNullButton,X=ve===void 0?!1:ve,ne=Ve.hidetoolBar,oe=ne===void 0?!1:ne,he=Ve.fullScreen,Ae=he===void 0?!1:he,Qe=Ve.onBlur,ot=Ve.onCMBeforeChange,Rt=Ve.onFullScreen,Nt=Ve.className,ht=Nt===void 0?"":Nt,Dt=Ve.disablePaste,sn=Dt===void 0?!1:Dt,Ct=Ve.placeholder,hn=Ct===void 0?"":Ct,rn=Ve.values,ae=rn===void 0?"":rn,U=Object(c.useState)(null),H=Object(A.a)(U,2),te=H[0],pe=H[1],se=Object(c.useState)(_t),$e=Object(A.a)(se,2),yt=$e[0],Ot=$e[1],Yt=Object(c.useState)(vt),St=Object(A.a)(Yt,2),Wt=St[0],ln=St[1],Bn=Object(c.useState)(Ae),Oi=Object(A.a)(Bn,2),mi=Oi[0],Wn=Oi[1],di=Object(c.useState)(""),hr=Object(A.a)(di,2),vi=hr[0],gi=hr[1],xi=Object(c.useState)(0),Bi=Object(A.a)(xi,2),Ai=Bi[0],sr=Bi[1],Di=Object(c.useState)(pt),fr=Object(A.a)(Di,2),lr=fr[0],Wi=fr[1],Gi=Object(c.useState)(!1),vr=Object(A.a)(Gi,2),Rr=vr[0],ur=vr[1],Hn=Object(c.useRef)(Object(re.a)()),wn=Object(c.useRef)(!1),wi=Object(c.useRef)(),Mn=Object(c.useRef)(),Ri=Object(c.useRef)(),oi=Object(c.useRef)(),Lr=Object(c.useRef)(),Ni=function(){var fn=Object(T.a)(p.a.mark(function Cn(){var mn,Un;return p.a.wrap(function(_i){for(;;)switch(_i.prev=_i.next){case 0:return _i.next=2,Object(it.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Hn.current}});case 2:Un=_i.sent,Un!=null&&(mn=Un.attachments)!==null&&mn!==void 0&&mn.length&&(console.log("cm:",te,Mn),Un.attachments.map(function(nn){nn.content_type.indexOf("image")>-1?te.replaceSelection("![,](/api/attachments/".concat(nn.id,"?type=").concat(nn.content_type,")")):nn.content_type.indexOf("video")>-1?te.replaceSelection('')):nn.content_type.indexOf("pdf")>-1?te.replaceSelection('
    ').concat(nn.name,"")):te.replaceSelection("[".concat(nn.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(nn.id,"?type=").concat(nn.content_type,")"))}));case 4:case"end":return _i.stop()}},Cn)}));return function(){return fn.apply(this,arguments)}}();Object(c.useEffect)(function(){Ot(ae),te==null||te.setValue(ae)},[ae]),Object(c.useEffect)(function(){Rt==null||Rt(mi)},[mi]),Object(c.useEffect)(function(){if(Mn.current){var fn=o.a.fromTextArea(Mn.current,{mode:Pt,lineNumbers:!rt,lineWrapping:!0,value:_t,autoCloseTags:!0,autoCloseBrackets:!0});ze&&fn.focus();function Cn(mn,Un){if(sn){Un.preventDefault();return}var ni=Un.clipboardData;if(ni){var _i=ni.types.toString(),nn=ni.items;if(_i==="Files"||ni.types.indexOf("Files")>-1){if(Un.preventDefault(),Pt=="stex")return;try{var Li,Zi=nn[1];((Li=nn[0])===null||Li===void 0?void 0:Li.kind)==="file"&&(Zi=nn[0]);var zn=Zi.getAsFile(),Dr=zn.name.split(".").pop();Ke(zn,function(hi){if(hi.id){var Vi,ct,xt;(zn==null||((Vi=zn.type)===null||Vi===void 0)?void 0:Vi.indexOf("image"))>-1?fn.replaceSelection("![,](/api/attachments/".concat(hi.id,"?type=").concat(hi.content_type,")")):(zn==null||((ct=zn.type)===null||ct===void 0)?void 0:ct.indexOf("video"))>-1?fn.replaceSelection('')):(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("pdf"))>-1?fn.replaceSelection('').concat(zn.name,"")):be.includes(Dr)?fn.replaceSelection('').concat(zn.name,"")):fn.replaceSelection("[".concat(zn.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,"?type=").concat(hi.content_type,")"))}else(hi==null?void 0:hi.status)===401&&(document.location.href="/user/login")})}catch(hi){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return fn.on("paste",Cn),fn.on("dragleave",function(mn,Un){Ri.current.classList.remove("mouse-hover-md")}),fn.on("dragover",function(mn,Un){Ri.current.classList.add("mouse-hover-md")}),fn.on("drop",function(mn,Un){Ri.current.classList.add("mouse-hover-md");var ni;if(ni=Un.dataTransfer.files,ni.length>0){Un.preventDefault(),Un.stopPropagation();for(var _i=function(Zi){var zn=ni[Zi],Dr=zn.name.split(".").pop();Ke(zn,function(hi){if(hi.id){var Vi,ct,xt;(zn==null||((Vi=zn.type)===null||Vi===void 0)?void 0:Vi.indexOf("image"))>-1?fn.replaceSelection("![,](/api/attachments/".concat(hi.id,"?type=").concat(hi.content_type,")")):(zn==null||((ct=zn.type)===null||ct===void 0)?void 0:ct.indexOf("video"))>-1?fn.replaceSelection('')):(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("pdf"))>-1?fn.replaceSelection('').concat(zn.name,"")):be.includes(Dr)?fn.replaceSelection('').concat(zn.name,"")):fn.replaceSelection("[".concat(zn.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,"?type=").concat(hi.content_type,")"))}else(hi==null?void 0:hi.status)===401&&(document.location.href="/user/login")})},nn=0;nn0||nn.target.offsetWidth>0)&&(Qi(),te.setSize("100%","100%"),te.refresh())}}catch(Li){ni.e(Li)}finally{ni.f()}});return mn.observe(Mn.current.parentElement),mn}if(te){var Cn=fn();return function(){Cn.unobserve(Mn.current.parentElement)}}},[te,Qi]),Object(c.useEffect)(function(){if(te){for(var fn=[],Cn=function(){var nn=Un[mn];ni=Object(A.a)(nn,2);var Li=ni[0],Zi=ni[1],zn=Object(O.a)({},Li,function(){Br(Zi)});fn.push(zn),te.addKeyMap(zn)},mn=0,Un=Object.entries(Ce);mn0){var fn=new Date().getTime(),Cn=window.sessionStorage.getItem(mt);fn>=Ai+lt&&(!Cn||Cn!==yt)&&(window.sessionStorage.setItem(mt,yt),ur(!0))}},lt),Object(c.useEffect)(function(){ln(vt)},[te,vt]),Object(c.useEffect)(function(){te&&(ze&&te.focus())},[te,ze]),Object(c.useEffect)(function(){if(Wt&&te){var fn=te.getScrollerElement();function Cn(mn){var Un=mn.target;if(Lr.current){var ni=Un.scrollTop/Un.scrollHeight;Lr.current.scrollTop=Lr.current.scrollHeight*ni}}return fn.addEventListener("scroll",Cn),function(){fn.removeEventListener("scroll",Cn)}}},[te,Wt]),Object(c.useEffect)(function(){if(te&&ot){function fn(Cn,mn){ot(Cn,mn)}return te.on("beforeChange",fn),function(){te.off("beforeChange",fn)}}},[te,ot]),Object(c.useEffect)(function(){if(te&&Qe){function fn(){Qe(te.getValue())}return te.on("blur",fn),function(){te.off("blur",fn)}}},[te,Qe]),Object(c.useEffect)(function(){if(te){function fn(Cn){var mn=Cn.getValue();Ot(mn),sr(new Date().getTime()),Cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),kt&&kt(mn)}return te.on("change",fn),function(){te.off("change",fn)}}},[te,kt]),Object(c.useEffect)(function(){te&&(_t==null?(te.setValue(""),Ot("")):_t!==te.getValue()&&(te.setValue(_t),Ot(_t),te.setCursor(te.lineCount(),0)))},[te,_t]);var Br=Object(c.useCallback)(function(fn){var Cn=te.getCursor(),mn=te.getSelection(),Un=mn.split(` `);switch(fn){case"bold":return te.replaceSelection("**"+mn+"**"),mn===""&&te.setCursor(Cn.line,Cn.ch+2),te.focus();case"italic":return te.replaceSelection("*"+mn+"*"),mn===""&&te.setCursor(Cn.line,Cn.ch+1),te.focus();case"code":return te.replaceSelection("`"+mn+"`"),mn===""&&te.setCursor(Cn.line,Cn.ch+1),te.focus();case"inline-latex":return te.replaceSelection("`$$"+mn+"$$`"),mn===""&&te.setCursor(Cn.line,Cn.ch+3),te.focus();case"latex":return te.replaceSelection("```latex\n"+mn+"\n```"),te.setCursor(Cn.line+1,mn.length+1),te.focus();case"line-break":return te.replaceSelection(`
    `),te.focus();case"list-ul":return mn===""?te.replaceSelection("- "+mn):te.replaceSelection(Un.map(function(ni){return ni===""?"":"- ".concat(ni)}).join(` `)),te.focus();case"list-ol":return mn===""?te.replaceSelection("1. "+mn):te.replaceSelection(Un.map(function(ni,_i){return ni===""?"":"".concat(_i+1,". ").concat(ni)}).join(` `)),te.focus();case"add-null-ch":return mn===""&&te.setCursor(Cn.line,Cn.ch+1),te.replaceSelection(qe),te.focus();case"inster-template-1":return mn===""&&te.setCursor(Cn.line,Cn.ch),te.replaceSelection(Ye),te.focus();case"eraser":return te.setValue(""),te.focus();case"trigger-watch":return ln(!Wt),te.focus();case"trigger-full-screen":return Wn(!mi),te.focus();case P:gi(P);return;case ee:gi(ee);return;case j:gi(j);return;case $:gi($);return;default:throw new Error}},[te,Wt,mi]),qi=Object(c.useCallback)(function(fn){gi("");switch(vi){case P:var Cn=fn.title,mn=fn.link;return te.replaceSelection("[".concat(Cn,"](").concat(mn,")")),te.focus();case ee:var Un=fn.language,ni=fn.content;return te.replaceSelection(["```"+Un,ni,"```"].join(` `)),te.focus();case j:var _i=fn.src,nn=fn.alt;return nn?te.replaceSelection("![ ".concat(nn," ]( ").concat(_i,' "').concat(nn,'" )')):te.replaceSelection("![,](".concat(_i,")")),te.focus();case $:for(var Li=fn.row,Zi=fn.col,zn=fn.align,Dr=` `,hi=0;hi300&&(Li=300);var Zi=pt+Li+"px";Wi(Zi)}}return fn.addEventListener("mousedown",Un),document.addEventListener("mousemove",_i),document.addEventListener("mouseup",ni),function(){fn.removeEventListener("mousedown",Un),document.removeEventListener("mousemove",_i),document.removeEventListener("mouseup",ni)}}},[te,oi]),Object(c.useEffect)(function(){Wi(pt)},[pt]);var Ir=je(jt),Jr=je(lr),xr={width:Ir,height:Jr},Qr=Object(c.useMemo)(function(){if(Ai){var fn=new Date(Ai),Cn=fn.getHours(),mn=fn.getMinutes(),Un=fn.getSeconds();return Cn=Cn<10?"0"+Cn:Cn,mn=mn<10?"0"+mn:mn,Un=Un<10?"0"+Un:Un,"".concat(Cn,":").concat(mn,":").concat(Un)}return 0},[Ai]);function qr(){window.sessionStorage.removeItem(mt),ur(!1),sr(0)}function _r(){ur(!1),sr(0),te.setValue(window.sessionStorage.getItem(mt))}function ea(fn,Cn){var mn=te.getValue();mn=mn.replace(fn,Cn),Ot(mn),te==null||te.setValue(mn)}return s.a.createElement(c.Fragment,null,s.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ri},s.a.createElement("div",{className:"markdown-editor-container ".concat(ht," ").concat(Wt?"on-preview":""," ").concat(rt?"mini":""," ").concat(mi?"full-screen":""),style:xr},s.a.createElement(R,{insertTemp:st,watch:Wt,fullScreen:mi,showNullButton:X,onActionCallback:Br,hidetoolBar:oe,uuid:Hn.current,setOpenPhones:function(){wn.current=!0}}),s.a.createElement("div",{className:"markdown-editor-body"},s.a.createElement("div",{className:"codemirror-container"},s.a.createElement("textarea",{ref:Mn,placeholder:hn})),Wt?s.a.createElement("div",{ref:Lr,className:"preview-container"},Pt==="stex"&&s.a.createElement(g,{value:yt}),Pt!=="stex"&&s.a.createElement(b.a,{edit:!0,value:yt,replaces:ea})):null))),Mt?s.a.createElement("a",{ref:oi,className:"editor-resize"}):null,s.a.createElement(N.a,null,Pe[vi]?s.a.createElement(ie.a,{centered:!0,title:Pe[vi],visible:!0,onCancel:Nr,footer:null,className:"markdown-popup-form"},Kr):null))}},P5Jw:function(nt,Xe,V){"use strict";var ce=V("rHrb"),ie=ce.CopyToClipboard;ie.CopyToClipboard=ie,nt.exports=ie},PD8m:function(nt,Xe){nt.exports={name:"memoryStorage",read:ce,write:ie,each:W,remove:C,clearAll:D};var V={};function ce(T){return V[T]}function ie(T,A){V[T]=A}function W(T){for(var A in V)V.hasOwnProperty(A)&&T(V[A],A)}function C(T){delete V[T]}function D(T){V={}}},RELg:function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global;nt.exports={name:"oldIE-userDataStorage",write:A,read:O,each:f,remove:p,clearAll:c};var W="storejs",C=ie.document,D=o(),T=(ie.navigator?ie.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function A(r,l){if(T)return;var a=n(r);D(function(i){i.setAttribute(a,l),i.save(W)})}function O(r){if(T)return;var l=n(r),a=null;return D(function(i){a=i.getAttribute(l)}),a}function f(r){D(function(l){for(var a=l.XMLDocument.documentElement.attributes,i=a.length-1;i>=0;i--){var t=a[i];r(l.getAttribute(t.name),t.name)}})}function p(r){var l=n(r);D(function(a){a.removeAttribute(l),a.save(W)})}function c(){D(function(r){var l=r.XMLDocument.documentElement.attributes;r.load(W);for(var a=l.length-1;a>=0;a--)r.removeAttribute(l[a].name);r.save(W)})}var s=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function n(r){return r.replace(/^\d/,"___$&").replace(s,"___")}function o(){if(!C||!C.documentElement||!C.documentElement.addBehavior)return null;var r="script",l,a,i;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+r+">document.w=window'),a.close(),l=a.w.frames[0].document,i=l.createElement("div")}catch(t){i=C.createElement("div"),l=C.body}return function(t){var d=[].slice.call(arguments,0);d.unshift(i),l.appendChild(i),i.addBehavior("#default#userData"),i.load(W),t.apply(this,d),l.removeChild(i);return}}},RpDr:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return b}),V.d(Xe,"c",function(){return _});var ce=V("+L6B"),ie=V("2/Rp"),W=V("tJVT"),C=V("k1fw"),D=V("jrin"),T=V("5NDa"),A=V("5rEg"),O=V("cDcd"),f=V.n(O),p=V("8Skl"),c=V("y3Kf"),s=V("bdLU"),n=V("J66h"),o=V.n(n),r=V("++UQ"),l=V.n(r),a=V("IxHN"),i=V("9Bee"),t=V("1vsH"),d,v=A.a.TextArea,y={visible:!1,tabIndex:"0"},b=(d={},Object(D.a)(d,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(D.a)(d,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(D.a)(d,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(D.a)(d,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(D.a)(d,4,"\u7F16\u8BD1\u5931\u8D25"),Object(D.a)(d,5,"\u6267\u884C\u5931\u8D25"),d),g;(function(h){h[h.SET_VISIBLE=0]="SET_VISIBLE",h[h.SET_TABINDEX=1]="SET_TABINDEX"})(g||(g={}));function m(h,E){switch(E.type){case g.SET_VISIBLE:return Object(C.a)(Object(C.a)({},h),{},{visible:E.payload});case g.SET_TABINDEX:return Object(C.a)(Object(C.a)({},h),{},{tabIndex:E.payload});default:throw new Error}}function _(h){var E=h.status,S=h.error_msg,w=h.output,R=h.input,N=h.expected_output,F=h.is_file,z=h.input_file_url,q=h.output_file_url,B=h.expected_output_file_url,M=null,G={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(E){case s.a.NOMATCH:M=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!F&&f.a.createElement(i.a,{value:R,style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(z,R)}},R)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!F&&f.a.createElement(i.a,{value:w&&n.Base64.decode(w)||"",style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(q,w)}},w)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!F&&f.a.createElement(i.a,{value:N&&n.Base64.decode(N)||"",style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(B,N)}},N)));break;case s.a.EXECUTEFAILURE:M=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&f.a.createElement(i.a,{value:R,style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(z,R)}},R)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.COMPILEFAILURE:M=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&f.a.createElement(i.a,{value:R,style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(z,R)}},R)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.PODFAILURE:M=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:M=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",M," ")}function x(h){var E=h.status,S=h.error_msg,w=h.execute_time,R=h.output,N=h.input,F=h.expected_output,z=h.is_file,q=h.input_file_url,B=h.output_file_url,M=h.expected_output_file_url,G=null;switch(E){case s.a.OK:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",w),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,n.Base64.decode(R)));break;case s.a.NOMATCH:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,N)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",R&&n.Base64.decode(R)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",F&&n.Base64.decode(F)));break;case s.a.EXECUTEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,N)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.COMPILEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,N)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.PODFAILURE:G=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:G=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",G," ")}Xe.b=function(h){var E=h.id,S=h.input,w=h.debuging,R=h.submitting,N=h.executingMessage,F=h.debugResult,z=h.onChangeInput,q=h.onDebugCode,B=h.onSubmitCode,M=Object(O.useReducer)(m,y),G=Object(W.a)(M,2),J=G[0],K=G[1],Z=J.visible,le=J.tabIndex;Object(O.useEffect)(function(){K({type:g.SET_VISIBLE,payload:!1})},[E]);function de(_e){var ye=_e.target.id;K({type:g.SET_TABINDEX,payload:ye})}function Te(){K({type:g.SET_VISIBLE,payload:!Z})}var we=Object(O.useMemo)(function(){if(F){var _e=F.status;return f.a.createElement(f.a.Fragment,null,x(F))}return null},[F]);function Ie(){K({type:g.SET_VISIBLE,payload:!0}),K({type:g.SET_TABINDEX,payload:"1"}),q()}return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(Z?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:le==="0"?"active":"",id:"0",onClick:de},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:le==="1"?"active":"",id:"1",onClick:de},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(le==="0"?"":"hide")},f.a.createElement(v,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:S,onChange:z})),f.a.createElement("div",{className:"tab-panel-body ".concat(le==="1"?"":"hide")},w?f.a.createElement(a.a,{message:N}):F?f.a.createElement("section",{style:{height:200}}," ",we," "):f.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),f.a.createElement("a",{className:"btn-collapse ".concat(Z?"up":""),onClick:Te},Z?f.a.createElement(p.a,null):f.a.createElement(c.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},f.a.createElement(ie.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),f.a.createElement(ie.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(ie.a,{className:"btn-green",type:"ghost",loading:w,onClick:Ie},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(ie.a,{type:"primary",loading:R,disabled:R,onClick:function(){K({type:g.SET_VISIBLE,payload:!1}),B()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(nt,Xe,V){nt.exports=V.p+"static/time.a3dc82f3.svg"},"SA+Z":function(nt,Xe,V){var ce=V("wTVA"),ie=V("EbDI"),W=V("ZhPi"),C=V("wkBT");function D(T){return ce(T)||ie(T)||W(T)||C()}nt.exports=D,nt.exports.__esModule=!0,nt.exports.default=nt.exports},SJMd:function(nt,Xe){/** * @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 V,ce,ie,W=!1,C,D;window.PR_SHOULD_USE_CONTINUATION=!0;var T,A;(function(){var O=window,f=["break,continue,do,else,for,if,return,while"],p=[f,"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"],c=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],s=[c,"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"],n=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[c,"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",l=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",i=[f,"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"],t=[f,"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"],d=[f,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[s,o,n,l,a,i,t,d],y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,b="str",g="kwd",m="com",_="typ",x="lit",h="pun",E="pln",S="tag",w="dec",R="src",N="atn",F="atv",z="nocode",q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(me){for(var We=0,He=!1,it=!1,re=0,P=me.length;re122||(be<65||ke>90||tt.push([Math.max(65,ke)|32,Math.min(be,90)|32]),be<97||ke>122||tt.push([Math.max(97,ke)&~32,Math.min(be,122)&~32]))}}tt.sort(function(Ve,at){return Ve[0]-at[0]||at[1]-Ve[1]});for(var Ce=[],Pe=[],Ye=0;YeLe[0]&&(Le[1]+1>Le[0]&&qe.push("-"),qe.push(Q(Le[1])))}return qe.push("]"),qe.join("")}function De(Ne){for(var Be=Ne.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),tt=Be.length,lt=[],qe=0,Ye=0;qe=2&&ke==="["?Be[qe]=xe(je):ke!=="\\"&&(Be[qe]=je.replace(/[a-zA-Z]/g,function(Pe){var Le=Pe.charCodeAt(0);return"["+String.fromCharCode(Le&~32,Le|32)+"]"}))}return Be.join("")}for(var dt=[],re=0,P=me.length;re=0;)He[dt.charAt(Ne)]=De;var Be=De[1],tt=""+Be;$.hasOwnProperty(tt)||(ee.push(Be),$[tt]=null)}ee.push(/[\0-\uffff]/),it=B(ee)})();var re=We.length,P=function(j){for(var ee=j.sourceCode,$=j.basePos,Q=j.sourceNode,xe=[$,E],De=0,dt=ee.match(it)||[],Ne={},Be=0,tt=dt.length;Be=5&&qe.substring(0,5)==="lang-",je&&!(Ye&&typeof Ye[1]=="string")&&(je=!1,qe=R),je||(Ne[lt]=qe)}var be=De;if(De+=lt.length,!je)xe.push($+be,qe);else{var Ce=Ye[1],Pe=lt.indexOf(Ce),Le=Pe+Ce.length;Ye[2]&&(Le=lt.length-Ye[2].length,Pe=Le-Ce.length);var Ve=qe.substring(5);G(Q,$+be,lt.substring(0,Pe),P,xe),G(Q,$+be+Pe,Ce,ye(Ve,Ce),xe),G(Q,$+be+Le,lt.substring(Le),P,xe)}}j.decorations=xe};return P}function le(me){var We=[],He=[];me.tripleQuotedStrings?We.push([b,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?We.push([b,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([b,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&He.push([b,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var it=me.hashComments;it&&(me.cStyleComments?(it>1?We.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([b,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([m,/^#[^\r\n]*/,null,"#"])),me.cStyleComments&&(He.push([m,/^\/\/[^\r\n]*/,null]),He.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var re=me.regexLiterals;if(re){var P=re>1?"":` \r`,j=P?".":"[\\S\\s]",ee="/(?=[^/*"+P+"])(?:[^/\\x5B\\x5C"+P+"]|\\x5C"+j+"|\\x5B(?:[^\\x5C\\x5D"+P+"]|\\x5C"+j+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+q+"("+ee+")")])}var $=me.types;$&&He.push([_,$]);var Q=(""+me.keywords).replace(/^ | $/g,"");Q.length&&He.push([g,new RegExp("^(?:"+Q.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([E,/^\s+/,null,` \r \xA0`]);var xe="^.[^\\s\\w.$@'\"`/\\\\]*";return me.regexLiterals&&(xe+="(?!s*/)"),He.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[E,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[E,/^\\[\s\S]?/,null],[h,new RegExp(xe),null]),Z(We,He)}var de=le({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(me,We,He){for(var it=/(?:^|\s)nocode(?:\s|$)/,re=/\r\n?|\n/,P=me.ownerDocument,j=P.createElement("li");me.firstChild;)j.appendChild(me.firstChild);var ee=[j];function $(Be){var tt=Be.nodeType;if(tt==1&&!it.test(Be.className))if(Be.nodeName==="br")Q(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var lt=Be.firstChild;lt;lt=lt.nextSibling)$(lt);else if((tt==3||tt==4)&&He){var qe=Be.nodeValue,Ye=qe.match(re);if(Ye){var je=qe.substring(0,Ye.index);Be.nodeValue=je;var Ue=qe.substring(Ye.index+Ye[0].length);if(Ue){var ke=Be.parentNode;ke.insertBefore(P.createTextNode(Ue),Be.nextSibling)}Q(Be),je||Be.parentNode.removeChild(Be)}}}function Q(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function tt(Ye,je){var Ue=je?Ye.cloneNode(!1):Ye,ke=Ye.parentNode;if(ke){var be=tt(ke,1),Ce=Ye.nextSibling;be.appendChild(Ue);for(var Pe=Ce;Pe;Pe=Ce)Ce=Pe.nextSibling,be.appendChild(Pe)}return Ue}for(var lt=tt(Be.nextSibling,0),qe;(qe=lt.parentNode)&&qe.nodeType===1;)lt=qe;ee.push(lt)}for(var xe=0;xe=ke&&($+=2),P>=be&&(De+=2)}}finally{qe&&(qe.style.display=Ye)}}var Ie={};function _e(me,We){for(var He=We.length;--He>=0;){var it=We[He];Ie.hasOwnProperty(it)?O.console&&console.warn("cannot override language handler %s",it):Ie[it]=me}}function ye(me,We){return me&&Ie.hasOwnProperty(me)||(me=/^\s*]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),_e(Z([[E,/^[\s]+/,null,` \r `],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["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"]),_e(Z([],[[F,/^[\s\S]+/]]),["uq.val"]),_e(le({keywords:s,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),_e(le({keywords:"null,true,false"}),["json"]),_e(le({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),_e(le({keywords:n,cStyleComments:!0}),["java"]),_e(le({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),_e(le({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),_e(le({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),_e(le({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),_e(le({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),_e(le({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),_e(Z([],[[b,/^[\s\S]+/]]),["regex"]);function Ke(me){var We=me.langExtension;try{var He=M(me.sourceNode,me.pre),it=He.sourceCode;me.sourceCode=it,me.spans=He.spans,me.basePos=0,ye(We,it)(me),we(me)}catch(re){O.console&&console.log(re&&re.stack||re)}}function Me(me,We,He){var it=He||!1,re=We||null,P=document.createElement("div");P.innerHTML="
    "+me+"
    ",P=P.firstChild,it&&Te(P,it,!0);var j={langExtension:re,numberLines:it,sourceNode:P,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ke(j),P.innerHTML}function Fe(me,We){var He=We||document.body,it=He.ownerDocument||document;function re(Ue){return He.getElementsByTagName(Ue)}for(var P=[re("pre"),re("code"),re("xmp")],j=[],ee=0;ee=0;o--)if(this.__items[o].match(n))return!0;return!1},p.prototype.set_indent=function(n,o){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=o||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 n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__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(n){this.__items.push(n);var o=n.lastIndexOf(` `);o!==-1?this.__character_count=n.length-o:this.__character_count+=n.length},p.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},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 n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function c(n,o){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),o=o||"",n.indent_level>0&&(o=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}c.prototype.get_indent_size=function(n,o){var r=this.__base_string_length;return o=o||0,n<0&&(r=0),r+=n*this.__indent_size,r+=o,r},c.prototype.get_indent_string=function(n,o){var r=this.__base_string;return o=o||0,n<0&&(n=0,r=""),o+=n*this.__indent_size,this.__ensure_cache(o),r+=this.__cache[o],r},c.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var n=this.__cache.length,o=0,r="";this.__indent_size&&n>=this.__indent_size&&(o=Math.floor(n/this.__indent_size),n-=o*this.__indent_size,r=new Array(o+1).join(this.__indent_string)),n&&(r+=new Array(n+1).join(" ")),this.__cache.push(r)};function s(n,o){this.__indent_cache=new c(n,o),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.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()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(n,o){return this.__indent_cache.get_indent_string(n,o)},s.prototype.get_indent_size=function(n,o){return this.__indent_cache.get_indent_size(n,o)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(n){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===` `&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(` `);return n!==` `&&(r=r.replace(/[\n]/g,n)),r},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(n,o){return n=n||0,o=o||0,this.next_line.set_indent(n,o),this.__lines.length>1?(this.current_line.set_indent(n,o),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(n){for(var o=0;o1&&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},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(n,o){for(var r=this.__lines.length-2;r>=0;){var l=this.__lines[r];if(l.is_empty())break;if(l.item(0).indexOf(n)!==0&&l.item(-1)!==o){this.__lines.splice(r+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},f.exports.Output=s},,,,function(f){function p(n,o){this.raw_options=c(n,o),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(n,o){var r=this.raw_options[n],l=o||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(l=r.concat()):typeof r=="string"&&(l=r.split(/[^a-zA-Z0-9_\/\-]+/)),l},p.prototype._get_boolean=function(n,o){var r=this.raw_options[n],l=r===void 0?!!o:!!r;return l},p.prototype._get_characters=function(n,o){var r=this.raw_options[n],l=o||"";return typeof r=="string"&&(l=r.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),l},p.prototype._get_number=function(n,o){var r=this.raw_options[n];o=parseInt(o,10),isNaN(o)&&(o=0);var l=parseInt(r,10);return isNaN(l)&&(l=o),l},p.prototype._get_selection=function(n,o,r){var l=this._get_selection_list(n,o,r);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values: `+o+` You passed in: '`+this.raw_options[n]+"'");return l[0]},p.prototype._get_selection_list=function(n,o,r){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[o[0]],!this._is_valid_selection(r,o))throw new Error("Invalid Default Value!");var l=this._get_array(n,r);if(!this._is_valid_selection(l,o))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values: `+o+` You passed in: '`+this.raw_options[n]+"'");return l},p.prototype._is_valid_selection=function(n,o){return n.length&&o.length&&!n.some(function(r){return o.indexOf(r)===-1})};function c(n,o){var r={};n=s(n);var l;for(l in n)l!==o&&(r[l]=n[l]);if(o&&n[o])for(l in n[o])r[l]=n[o][l];return r}function s(n){var o={},r;for(r in n){var l=r.replace(/-/g,"_");o[l]=n[r]}return o}f.exports.Options=p,f.exports.normalizeOpts=s,f.exports.mergeOpts=c},,function(f){var p=RegExp.prototype.hasOwnProperty("sticky");function c(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position=0&&s=0&&n=s.length&&this.__input.substring(n-s.length,n).toLowerCase()===s},f.exports.InputScanner=c},,,,,function(f){function p(c,s){c=typeof c=="string"?c:c.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(c+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(c+/\sbeautify\signore:end\s/.source+s,"g")}p.prototype.get_directives=function(c){if(!c.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(c);n;)s[n[1]]=n[2],n=this.__directive_pattern.exec(c);return s},p.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=p},,function(f,p,c){var s=c(16).Beautifier,n=c(17).Options;function o(r,l){var a=new s(r,l);return a.beautify()}f.exports=o,f.exports.defaultOptions=function(){return new n}},function(f,p,c){var s=c(17).Options,n=c(2).Output,o=c(8).InputScanner,r=c(13).Directives,l=new r(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=/\s/,d=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,y=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function b(g,m){this._source_text=g||"",this._options=new s(m),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}b.prototype.eatString=function(g){var m="";for(this._ch=this._input.next();this._ch;){if(m+=this._ch,this._ch==="\\")m+=this._input.next();else if(g.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return m},b.prototype.eatWhitespace=function(g){for(var m=t.test(this._input.peek()),_=0;t.test(this._input.peek());)this._ch=this._input.next(),g&&this._ch===` `&&((_===0||_0&&this._indentLevel--},b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g=this._source_text,m=this._options.eol;m==="auto"&&(m=` `,g&&a.test(g||"")&&(m=g.match(a)[0])),g=g.replace(i,` `);var _=g.match(/^[\t ]*/)[0];this._output=new n(this._options,_),this._input=new o(g),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var x=0,h=!1,E=!1,S=!1,w=!1,R=!1,N=!1,F=this._ch,z=!1,q,B,M;q=this._input.read(d),B=q!=="",M=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var G=this._input.read(v),J=l.get_directives(G);J&&J.ignore==="start"&&(G+=l.readIgnored(this._input)),this.print_string(G),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(y)),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 K=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);K.match(/[ :]$/)&&(K=this.eatString(": ").replace(/\s$/,""),this.print_string(K),this._output.space_before_token=!0),K=K.replace(/\s$/,""),K==="extend"?w=!0:K==="import"&&(R=!0),K in this.NESTED_AT_RULE?(this._nestedLevel+=1,K in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!h&&x===0&&K.indexOf(":")!==-1&&(E=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")E&&(E=!1,this.outdent()),S?(S=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(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)):(M==="("?this._output.space_before_token=!1:M!==","&&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(),M==="{"&&this._output.trim(!0),R=!1,w=!1,E&&(this.outdent(),E=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Z=0;Z"||this._ch==="+"||this._ch==="~")&&!E&&x===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&&t.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("="),t.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 Te=M==='"'||M==="'";this.preserveSingleSpace(Te||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&z&&this._output.add_new_line()}var we=this._output.get_code(m);return we},f.exports.Beautifier=b},function(f,p,c){var s=c(6).Options;function n(o){s.call(this,o,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a=15&&(s=!1,f=!0);var b=t&&(p||s&&(y==null||y<12.11)),g=W||A&&O>=9;function m(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,u){var I=e.className,L=m(u).exec(I);if(L){var k=I.slice(L.index+L[0].length);e.className=I.slice(0,L.index)+(k?L[1]+k:"")}};function x(e){for(var u=e.childNodes.length;u>0;--u)e.removeChild(e.firstChild);return e}function h(e,u){return x(e).appendChild(u)}function E(e,u,I,L){var k=document.createElement(e);if(I&&(k.className=I),L&&(k.style.cssText=L),typeof u=="string")k.appendChild(document.createTextNode(u));else if(u)for(var Y=0;Y=u)return ue+(u-Y);ue+=fe-Y,ue+=I-ue%I,Y=fe+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.prototype.set=function(e,u){this.f=u;var I=+new Date+e;(!this.id||I=u)return L+Math.min(ue,u-k);if(k+=Y-L,k+=I-k%I,L=Y+1,k>=u)return L}}var _e=[""];function ye(e){for(;_e.length<=e;)_e.push(Ke(_e)+" ");return _e[e]}function Ke(e){return e[e.length-1]}function Me(e,u){for(var I=[],L=0;L"\x80"&&(e.toUpperCase()!=e.toLowerCase()||me.test(e))}function He(e,u){return u?u.source.indexOf("\\w")>-1&&We(e)?!0:u.test(e):We(e)}function it(e){for(var u in e)if(e.hasOwnProperty(u)&&e[u])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function P(e){return e.charCodeAt(0)>=768&&re.test(e)}function j(e,u,I){for(;(I<0?u>0:uI?-1:1;;){if(u==I)return u;var k=(u+I)/2,Y=L<0?Math.ceil(k):Math.floor(k);if(Y==u)return e(Y)?u:I;e(Y)?I=Y:u=Y+L}}function $(e,u,I,L){if(!e)return L(u,I,"ltr",0);for(var k=!1,Y=0;Yu||u==I&&ue.to==u)&&(L(Math.max(ue.from,u),Math.min(ue.to,I),ue.level==1?"rtl":"ltr",Y),k=!0)}k||L(u,I,"ltr")}var Q=null;function xe(e,u,I){var L;Q=null;for(var k=0;ku)return k;Y.to==u&&(Y.from!=Y.to&&I=="before"?L=k:Q=k),Y.from==u&&(Y.from!=Y.to&&I!="before"?L=k:Q=k)}return L!=null?L:Q}var De=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",u="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function I(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?u.charAt(Se-1536):1774<=Se&&Se<=2220?"r":8192<=Se&&Se<=8203?"w":Se==8204?"b":"L"}var L=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,k=/[stwN]/,Y=/[LRr]/,ue=/[Lb1n]/,fe=/[1n]/;function ge(Se,Je,et){this.level=Se,this.from=Je,this.to=et}return function(Se,Je){var et=Je=="ltr"?"L":"R";if(Se.length==0||Je=="ltr"&&!L.test(Se))return!1;for(var ft=Se.length,ut=[],Tt=0;Tt-1&&(L[u]=k.slice(0,Y).concat(k.slice(Y+1)))}}}function qe(e,u){var I=tt(e,u);if(!I.length)return;for(var L=Array.prototype.slice.call(arguments,2),k=0;k0}function ke(e){e.prototype.on=function(u,I){Be(this,u,I)},e.prototype.off=function(u,I){lt(this,u,I)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Le(e){be(e),Ce(e)}function Ve(e){return e.target||e.srcElement}function at(e){var u=e.which;return u==null&&(e.button&1?u=1:e.button&2?u=3:e.button&4&&(u=2)),t&&e.ctrlKey&&u==1&&(u=3),u}var _t=function(){if(A&&O<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}(),kt;function Bt(e){if(kt==null){var u=E("span","\u200B");h(e,E("span",[u,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(kt=u.offsetWidth<=1&&u.offsetHeight>2&&!(A&&O<8))}var I=kt?E("span","\u200B"):E("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return I.setAttribute("cm-text",""),I}var jt;function At(e){if(jt!=null)return jt;var u=h(e,document.createTextNode("A\u062EA")),I=w(u,0,1).getBoundingClientRect(),L=w(u,1,2).getBoundingClientRect();return x(e),!I||I.left==I.right?!1:jt=L.right-I.right<3}var pt=` b`.split(/\n/).length!=3?function(e){for(var u=0,I=[],L=e.length;u<=L;){var k=e.indexOf(` `,u);k==-1&&(k=e.length);var Y=e.slice(u,e.charAt(k-1)=="\r"?k-1:k),ue=Y.indexOf("\r");ue!=-1?(I.push(Y.slice(0,ue)),u+=ue+1):(I.push(Y),u=k+1)}return I}:function(e){return e.split(/\r\n?|\n/)},gt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(u){return!1}}:function(e){var u;try{u=e.ownerDocument.selection.createRange()}catch(I){}return!u||u.parentElement()!=e?!1:u.compareEndPoints("StartToEnd",u)!=0},rt=function(){var e=E("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Oe=null;function ze(e){if(Oe!=null)return Oe;var u=h(e,E("span","x")),I=u.getBoundingClientRect(),L=w(u,0,1).getBoundingClientRect();return Oe=Math.abs(I.left-L.left)>1}var vt={},st={};function It(e,u){arguments.length>2&&(u.dependencies=Array.prototype.slice.call(arguments,2)),vt[e]=u}function Pt(e,u){st[e]=u}function Ze(e){if(typeof e=="string"&&st.hasOwnProperty(e))e=st[e];else if(e&&typeof e.name=="string"&&st.hasOwnProperty(e.name)){var u=st[e.name];typeof u=="string"&&(u={name:u}),e=Ee(u,e),e.name=u.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ze("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ze("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function mt(e,u){u=Ze(u);var I=vt[u.name];if(!I)return mt(e,"text/plain");var L=I(e,u);if(Lt.hasOwnProperty(u.name)){var k=Lt[u.name];for(var Y in k){if(!k.hasOwnProperty(Y))continue;L.hasOwnProperty(Y)&&(L["_"+Y]=L[Y]),L[Y]=k[Y]}}if(L.name=u.name,u.helperType&&(L.helperType=u.helperType),u.modeProps)for(var ue in u.modeProps)L[ue]=u.modeProps[ue];return L}var Lt={};function Mt(e,u){var I=Lt.hasOwnProperty(e)?Lt[e]:Lt[e]={};M(u,I)}function $t(e,u){if(u===!0)return u;if(e.copyState)return e.copyState(u);var I={};for(var L in u){var k=u[L];k instanceof Array&&(k=k.concat([])),I[L]=k}return I}function Re(e,u){for(var I;e.innerMode&&!(I=e.innerMode(u),!I||I.mode==e);)u=I.state,e=I.mode;return I||{mode:e,state:u}}function ve(e,u,I){return e.startState?e.startState(u,I):!0}var X=function(e,u,I){this.pos=this.start=0,this.string=e,this.tabSize=u||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=I};X.prototype.eol=function(){return this.pos>=this.string.length},X.prototype.sol=function(){return this.pos==this.lineStart},X.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},X.prototype.next=function(){if(this.posu},X.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},X.prototype.skipToEnd=function(){this.pos=this.string.length},X.prototype.skipTo=function(e){var u=this.string.indexOf(e,this.pos);if(u>-1)return this.pos=u,!0},X.prototype.backUp=function(e){this.pos-=e},X.prototype.column=function(){return this.lastColumnPos0?null:(Y&&u!==!1&&(this.pos+=Y[0].length),Y)}},X.prototype.current=function(){return this.string.slice(this.start,this.pos)},X.prototype.hideFirstChars=function(e,u){this.lineStart+=e;try{return u()}finally{this.lineStart-=e}},X.prototype.lookAhead=function(e){var u=this.lineOracle;return u&&u.lookAhead(e)},X.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ne(e,u){if(u-=e.first,u<0||u>=e.size)throw new Error("There is no line "+(u+e.first)+" in the document.");for(var I=e;!I.lines;)for(var L=0;;++L){var k=I.children[L],Y=k.chunkSize();if(u=e.first&&uI?ht(I,ne(e,I).text.length):H(u,ne(e,u.line).text.length)}function H(e,u){var I=e.ch;return I==null||I>u?ht(e.line,u):I<0?ht(e.line,0):e}function te(e,u){for(var I=[],L=0;Lthis.maxLookAhead&&(this.maxLookAhead=e),u},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var u=this.baseTokens[this.baseTokenPos+1];return{type:u&&u.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,u,I){return u instanceof pe?new se(e,$t(e.mode,u.state),I,u.lookAhead):new se(e,$t(e.mode,u),I)},se.prototype.save=function(e){var u=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pe(u,this.maxLookAhead):u};function $e(e,u,I,L){var k=[e.state.modeGen],Y={};mi(e,u.text,e.doc.mode,I,function(Se,Je){return k.push(Se,Je)},Y,L);for(var ue=I.state,fe=function(Se){I.baseTokens=k;var Je=e.state.overlays[Se],et=1,ft=0;I.state=!0,mi(e,u.text,Je.mode,I,function(ut,Tt){for(var Ut=et;ftut&&k.splice(et,1,ut,k[et+1],Kt),et+=2,ft=Math.min(ut,Kt)}if(!Tt)return;if(Je.opaque)k.splice(Ut,et-Ut,ut,"overlay "+Tt),et=Ut+2;else for(;Ute.options.maxHighlightLength&&$t(e.doc.mode,L.state),Y=$e(e,u,L);k&&(L.state=k),u.stateAfter=L.save(!k),u.styles=Y.styles,Y.classes?u.styleClasses=Y.classes:u.styleClasses&&(u.styleClasses=null),I===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return u.styles}function Ot(e,u,I){var L=e.doc,k=e.display;if(!L.mode.startState)return new se(L,!0,u);var Y=Wn(e,u,I),ue=Y>L.first&&ne(L,Y-1).stateAfter,fe=ue?se.fromSaved(L,ue,Y):new se(L,ve(L.mode),Y);return L.iter(Y,u,function(ge){Yt(e,ge.text,fe);var Se=fe.line;ge.stateAfter=Se==u-1||Se%5==0||Se>=k.viewFrom&&Seu.start)return Y}throw new Error("Mode "+e.name+" failed to advance stream.")}var ln=function(e,u,I){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=u||null,this.state=I};function Bn(e,u,I,L){var k=e.doc,Y=k.mode,ue;u=U(k,u);var fe=ne(k,u.line),ge=Ot(e,u.line,I),Se=new X(fe.text,e.options.tabSize,ge),Je;for(L&&(Je=[]);(L||Se.pose.options.maxHighlightLength?(fe=!1,ue&&Yt(e,u,L,Je.pos),Je.pos=u.length,et=null):et=Oi(Wt(I,Je,L.state,ft),Y),ft){var ut=ft[0].name;ut&&(et="m-"+(et?ut+" "+et:ut))}if(!fe||Se!=et){for(;geue;--fe){if(fe<=Y.first)return Y.first;var ge=ne(Y,fe-1),Se=ge.stateAfter;if(Se&&(!I||fe+(Se instanceof pe?Se.lookAhead:0)<=Y.modeFrontier))return fe;var Je=G(ge.text,null,e.options.tabSize);(k==null||L>Je)&&(k=fe-1,L=Je)}return k}function di(e,u){if(e.modeFrontier=Math.min(e.modeFrontier,u),e.highlightFrontierI;L--){var k=ne(e,L).stateAfter;if(k&&(!(k instanceof pe)||L+k.lookAhead=u:Y.to>u);(L||(L=[])).push(new Bi(ue,Y.from,ge?null:Y.to))}}return L}function lr(e,u,I){var L;if(e)for(var k=0;k=u:Y.to>u);if(fe||Y.from==u&&ue.type=="bookmark"&&(!I||Y.marker.insertLeft)){var ge=Y.from==null||(ue.inclusiveLeft?Y.from<=u:Y.from0&&fe)for(var dn=0;dn0)continue;var Je=[ge,1],et=Dt(Se.from,fe.from),ft=Dt(Se.to,fe.to);(et<0||!ue.inclusiveLeft&&!et)&&Je.push({from:Se.from,to:fe.from}),(ft>0||!ue.inclusiveRight&&!ft)&&Je.push({from:fe.to,to:Se.to}),k.splice.apply(k,Je),ge+=Je.length-3}return k}function Rr(e){var u=e.markedSpans;if(!u)return;for(var I=0;Iu)&&(!L||wi(L,Y.marker)<0)&&(L=Y.marker)}return L}function Ni(e,u,I,L,k){var Y=ne(e,u),ue=vi&&Y.markedSpans;if(ue)for(var fe=0;fe=0&&et<=0||Je<=0&&et>=0)continue;if(Je<=0&&(ge.marker.inclusiveRight&&k.inclusiveLeft?Dt(Se.to,I)>=0:Dt(Se.to,I)>0)||Je>=0&&(ge.marker.inclusiveRight&&k.inclusiveLeft?Dt(Se.from,L)<=0:Dt(Se.from,L)<0))return!0}}function Qi(e){for(var u;u=Ri(e);)e=u.find(-1,!0).line;return e}function Br(e){for(var u;u=oi(e);)e=u.find(1,!0).line;return e}function qi(e){for(var u,I;u=oi(e);)e=u.find(1,!0).line,(I||(I=[])).push(e);return I}function Kr(e,u){var I=ne(e,u),L=Qi(I);return I==L?u:Qe(L)}function Nr(e,u){if(u>e.lastLine())return u;var I=ne(e,u),L;if(!Ir(e,I))return u;for(;L=oi(I);)I=L.find(1,!0).line;return Qe(I)+1}function Ir(e,u){var I=vi&&u.markedSpans;if(I)for(var L=void 0,k=0;ku.maxLineLength&&(u.maxLineLength=k,u.maxLine=L)})}var _r=function(e,u,I){this.text=e,ur(this,u),this.height=I?I(this):1};_r.prototype.lineNo=function(){return Qe(this)},ke(_r);function ea(e,u,I,L){e.text=u,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Rr(e),ur(e,I);var k=L?L(e):1;k!=e.height&&Ae(e,k)}function fn(e){e.parent=null,Rr(e)}var Cn={},mn={};function Un(e,u){if(!e||/^\s*$/.test(e))return null;var I=u.addModeClass?mn:Cn;return I[e]||(I[e]=e.replace(/\S+/g,"cm-$&"))}function ni(e,u){var I=S("span",null,null,f?"padding-right: .1px":null),L={pre:S("pre",[I],"CodeMirror-line"),content:I,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};u.measure={};for(var k=0;k<=(u.rest?u.rest.length:0);k++){var Y=k?u.rest[k-1]:u.line,ue=void 0;L.pos=0,L.addToken=nn,At(e.display.measure)&&(ue=dt(Y,e.doc.direction))&&(L.addToken=Zi(L.addToken,ue)),L.map=[];var fe=u!=e.display.externalMeasured&&Qe(Y);Dr(Y,L,yt(e,Y,fe)),Y.styleClasses&&(Y.styleClasses.bgClass&&(L.bgClass=z(Y.styleClasses.bgClass,L.bgClass||"")),Y.styleClasses.textClass&&(L.textClass=z(Y.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Bt(e.display.measure))),k==0?(u.measure.map=L.map,u.measure.cache={}):((u.measure.maps||(u.measure.maps=[])).push(L.map),(u.measure.caches||(u.measure.caches=[])).push({}))}if(f){var ge=L.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return qe(e,"renderLine",e,u.line,L.pre),L.pre.className&&(L.textClass=z(L.pre.className,L.textClass||"")),L}function _i(e){var u=E("span","\u2022","cm-invalidchar");return u.title="\\u"+e.charCodeAt(0).toString(16),u.setAttribute("aria-label",u.title),u}function nn(e,u,I,L,k,Y,ue){if(!u)return;var fe=e.splitSpaces?Li(u,e.trailingSpace):u,ge=e.cm.state.specialChars,Se=!1,Je;if(!ge.test(u))e.col+=u.length,Je=document.createTextNode(fe),e.map.push(e.pos,e.pos+u.length,Je),A&&O<9&&(Se=!0),e.pos+=u.length;else{Je=document.createDocumentFragment();for(var et=0;;){ge.lastIndex=et;var ft=ge.exec(u),ut=ft?ft.index-et:u.length-et;if(ut){var Tt=document.createTextNode(fe.slice(et,et+ut));A&&O<9?Je.appendChild(E("span",[Tt])):Je.appendChild(Tt),e.map.push(e.pos,e.pos+ut,Tt),e.col+=ut,e.pos+=ut}if(!ft)break;et+=ut+1;var Ut=void 0;if(ft[0]==" "){var Kt=e.cm.options.tabSize,qt=Kt-e.col%Kt;Ut=Je.appendChild(E("span",ye(qt),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=qt}else ft[0]=="\r"||ft[0]==` `?(Ut=Je.appendChild(E("span",ft[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",ft[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(ft[0]),Ut.setAttribute("cm-text",ft[0]),A&&O<9?Je.appendChild(E("span",[Ut])):Je.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=fe.charCodeAt(u.length-1)==32,I||L||k||Se||Y||ue){var on=I||"";L&&(on+=L),k&&(on+=k);var Zt=E("span",[Je],on,Y);if(ue)for(var dn in ue)ue.hasOwnProperty(dn)&&dn!="style"&&dn!="class"&&Zt.setAttribute(dn,ue[dn]);return e.content.appendChild(Zt)}e.content.appendChild(Je)}function Li(e,u){if(e.length>1&&!/ /.test(e))return e;for(var I=u,L="",k=0;kSe&&et.from<=Se);ft++);if(et.to>=Je)return e(I,L,k,Y,ue,fe,ge);e(I,L.slice(0,et.to-Se),k,Y,null,fe,ge),Y=null,L=L.slice(et.to-Se),Se=et.to}}}function zn(e,u,I,L){var k=!L&&I.widgetNode;k&&e.map.push(e.pos,e.pos+u,k),!L&&e.cm.display.input.needsContentAttribute&&(k||(k=e.content.appendChild(document.createElement("span"))),k.setAttribute("cm-marker",I.id)),k&&(e.cm.display.input.setUneditable(k),e.content.appendChild(k)),e.pos+=u,e.trailingSpace=!1}function Dr(e,u,I){var L=e.markedSpans,k=e.text,Y=0;if(!L){for(var ue=1;uege||ei.collapsed&&yn.to==ge&&yn.from==ge)){if(yn.to!=null&&yn.to!=ge&&ut>yn.to&&(ut=yn.to,Ut=""),ei.className&&(Tt+=" "+ei.className),ei.css&&(ft=(ft?ft+";":"")+ei.css),ei.startStyle&&yn.from==ge&&(Kt+=" "+ei.startStyle),ei.endStyle&&yn.to==ut&&(dn||(dn=[])).push(ei.endStyle,yn.to),ei.title&&((on||(on={})).title=ei.title),ei.attributes)for(var Ii in ei.attributes)(on||(on={}))[Ii]=ei.attributes[Ii];ei.collapsed&&(!qt||wi(qt.marker,ei)<0)&&(qt=yn)}else yn.from>ge&&ut>yn.from&&(ut=yn.from)}if(dn)for(var ar=0;ar=fe)break;for(var Mr=Math.min(fe,ut);;){if(Je){var Cr=ge+Je.length;if(!qt){var $i=Cr>Mr?Je.slice(0,Mr-ge):Je;u.addToken(u,$i,et?et+Tt:Tt,Kt,ge+$i.length==ut?Ut:"",ft,on)}if(Cr>=Mr){Je=Je.slice(Mr-ge),ge=Mr;break}ge=Cr,Kt=""}Je=k.slice(Y,Y=I[Se++]),et=Un(I[Se++],u.cm.options)}}}function hi(e,u,I){this.line=u,this.rest=qi(u),this.size=this.rest?Qe(Ke(this.rest))-I+1:1,this.node=this.text=null,this.hidden=Ir(e,u)}function Vi(e,u,I){for(var L=[],k,Y=u;Y2&&Y.push((ge.bottom+Se.top)/2-I.top)}}Y.push(I.bottom-I.top)}}function Vt(e,u,I){if(e.line==u)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;LI)return{map:e.measure.maps[k],cache:e.measure.caches[k],before:!0}}function _n(e,u){u=Qi(u);var I=Qe(u),L=e.display.externalMeasured=new hi(e.doc,u,I);L.lineN=I;var k=L.built=ni(e,L);return L.text=k.pre,h(e.display.lineMeasure,k.pre),L}function ci(e,u,I,L){return Dn(e,li(e,u),I,L)}function yi(e,u){if(u>=e.display.viewFrom&&u=I.lineN&&uu)&&(Y=ge-fe,k=Y-1,u>=ge&&(ue="right")),k!=null){if(L=e[Se+2],fe==ge&&I==(L.insertLeft?"left":"right")&&(ue=I),I=="left"&&k==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)L=e[(Se-=3)+2],ue="left";if(I=="right"&&k==ge-fe)for(;Se=0&&!((I=e[k]).left!=I.right);k--);return I}function Gt(e,u,I,L){var k=gn(u.map,I,L),Y=k.node,ue=k.start,fe=k.end,ge=k.collapse,Se;if(Y.nodeType==3){for(var Je=0;Je<4;Je++){for(;ue&&P(u.line.text.charAt(k.coverStart+ue));)--ue;for(;k.coverStart+fe0&&(ge=L="right");var et;e.options.lineWrapping&&(et=Y.getClientRects()).length>1?Se=et[L=="right"?et.length-1:0]:Se=Y.getBoundingClientRect()}if(A&&O<9&&!ue&&(!Se||!Se.left&&!Se.right)){var ft=Y.parentNode.getClientRects()[0];ft?Se={left:ft.left,right:ft.left+Xn(e.display),top:ft.top,bottom:ft.bottom}:Se=Jn}for(var ut=Se.top-u.rect.top,Tt=Se.bottom-u.rect.top,Ut=(ut+Tt)/2,Kt=u.view.measure.heights,qt=0;qt=L.text.length?(ge=L.text.length,Se="before"):ge<=0&&(ge=0,Se="after"),!fe)return ue(Se=="before"?ge-1:ge,Se=="before");function Je(Tt,Ut,Kt){var qt=fe[Ut],on=qt.level==1;return ue(Kt?Tt-1:Tt,on!=Kt)}var et=xe(fe,ge,Se),ft=Q,ut=Je(ge,et,Se=="before");return ft!=null&&(ut.other=Je(ge,ft,Se!="before")),ut}function ki(e,u){var I=0;u=U(e.doc,u),e.options.lineWrapping||(I=Xn(e.display)*u.ch);var L=ne(e.doc,u.line),k=xr(L)+ti(e.display);return{left:I,right:I,top:k,bottom:k+L.height}}function Xi(e,u,I,L,k){var Y=ht(e,u,I);return Y.xRel=k,L&&(Y.outside=L),Y}function kr(e,u,I){var L=e.doc;if(I+=e.display.viewOffset,I<0)return Xi(L.first,0,null,-1,-1);var k=ot(L,I),Y=L.first+L.size-1;if(k>Y)return Xi(L.first+L.size-1,ne(L,Y).text.length,null,1,1);u<0&&(u=0);for(var ue=ne(L,k);;){var fe=Vr(e,ue,k,u,I),ge=Lr(ue,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!ge)return fe;var Se=ge.find(1);if(Se.line==k)return Se;ue=ne(L,k=Se.line)}}function er(e,u,I,L){L-=kn(u);var k=u.text.length,Y=ee(function(ue){return Dn(e,I,ue-1).bottom<=L},k,0);return k=ee(function(ue){return Dn(e,I,ue).top>L},Y,k),{begin:Y,end:k}}function Ur(e,u,I,L){I||(I=li(e,u));var k=Tn(e,u,Dn(e,I,L),"line").top;return er(e,u,I,k)}function Gr(e,u,I,L){return e.bottom<=I?!1:e.top>I?!0:(L?e.left:e.right)>u}function Vr(e,u,I,L,k){k-=xr(u);var Y=li(e,u),ue=kn(u),fe=0,ge=u.text.length,Se=!0,Je=dt(u,e.doc.direction);if(Je){var et=(e.options.lineWrapping?ba:Wr)(e,u,I,Y,Je,L,k);Se=et.level!=1,fe=Se?et.from:et.to-1,ge=Se?et.to:et.from-1}var ft=null,ut=null,Tt=ee(function(On){var yn=Dn(e,Y,On);return yn.top+=ue,yn.bottom+=ue,Gr(yn,L,k,!1)?(yn.top<=k&&yn.left<=L&&(ft=On,ut=yn),!0):!1},fe,ge),Ut,Kt,qt=!1;if(ut){var on=L-ut.left=dn.bottom?1:0}return Tt=j(u.text,Tt,1),Xi(I,Tt,Kt,qt,L-Ut)}function Wr(e,u,I,L,k,Y,ue){var fe=ee(function(et){var ft=k[et],ut=ft.level!=1;return Gr(ri(e,ht(I,ut?ft.to:ft.from,ut?"before":"after"),"line",u,L),Y,ue,!0)},0,k.length-1),ge=k[fe];if(fe>0){var Se=ge.level!=1,Je=ri(e,ht(I,Se?ge.from:ge.to,Se?"after":"before"),"line",u,L);Gr(Je,Y,ue,!0)&&Je.top>ue&&(ge=k[fe-1])}return ge}function ba(e,u,I,L,k,Y,ue){var fe=er(e,u,L,ue),ge=fe.begin,Se=fe.end;/\s/.test(u.text.charAt(Se-1))&&Se--;for(var Je=null,et=null,ft=0;ft=Se||ut.to<=ge)continue;var Tt=ut.level!=1,Ut=Dn(e,L,Tt?Math.min(Se,ut.to)-1:Math.max(ge,ut.from)).right,Kt=UtKt)&&(Je=ut,et=Kt)}return Je||(Je=k[k.length-1]),Je.fromSe&&(Je={from:Je.from,to:Se,level:Je.level}),Je}var Vn;function xn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Vn==null){Vn=E("pre",null,"CodeMirror-line-like");for(var u=0;u<49;++u)Vn.appendChild(document.createTextNode("x")),Vn.appendChild(E("br"));Vn.appendChild(document.createTextNode("x"))}h(e.measure,Vn);var I=Vn.offsetHeight/50;return I>3&&(e.cachedTextHeight=I),x(e.measure),I||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var u=E("span","xxxxxxxxxx"),I=E("pre",[u],"CodeMirror-line-like");h(e.measure,I);var L=u.getBoundingClientRect(),k=(L.right-L.left)/10;return k>2&&(e.cachedCharWidth=k),k||10}function ai(e){for(var u=e.display,I={},L={},k=u.gutters.clientLeft,Y=u.gutters.firstChild,ue=0;Y;Y=Y.nextSibling,++ue){var fe=e.display.gutterSpecs[ue].className;I[fe]=Y.offsetLeft+Y.clientLeft+k,L[fe]=Y.clientWidth}return{fixedPos:Ui(u),gutterTotalWidth:u.gutters.offsetWidth,gutterLeft:I,gutterWidth:L,wrapperWidth:u.wrapper.clientWidth}}function Ui(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qn(e){var u=xn(e.display),I=e.options.lineWrapping,L=I&&Math.max(5,e.display.scroller.clientWidth/Xn(e.display)-3);return function(k){if(Ir(e.doc,k))return 0;var Y=0;if(k.widgets)for(var ue=0;ue0&&(Se=ne(e.doc,ge.line).text).length==ge.ch){var Je=G(Se,Se.length,e.options.tabSize)-Se.length;ge=ht(ge.line,Math.max(0,Math.round((Y-Ci(e.display).left)/Xn(e.display))-Je))}return ge}function tr(e,u){if(u>=e.display.viewTo)return null;if(u-=e.display.viewFrom,u<0)return null;for(var I=e.display.view,L=0;Lu)&&(k.updateLineNumbers=u),e.curOp.viewChanged=!0,u>=k.viewTo)vi&&Kr(e.doc,u)k.viewFrom?cr(e):(k.viewFrom+=L,k.viewTo+=L);else if(u<=k.viewFrom&&I>=k.viewTo)cr(e);else if(u<=k.viewFrom){var Y=Nn(e,I,I+L,1);Y?(k.view=k.view.slice(Y.index),k.viewFrom=Y.lineN,k.viewTo+=L):cr(e)}else if(I>=k.viewTo){var ue=Nn(e,u,u,-1);ue?(k.view=k.view.slice(0,ue.index),k.viewTo=ue.lineN):cr(e)}else{var fe=Nn(e,u,u,-1),ge=Nn(e,I,I+L,1);fe&&ge?(k.view=k.view.slice(0,fe.index).concat(Vi(e,fe.lineN,ge.lineN)).concat(k.view.slice(ge.index)),k.viewTo+=L):cr(e)}var Se=k.externalMeasured;Se&&(I=k.lineN&&u=L.viewTo)return;var Y=L.view[tr(e,u)];if(Y.node==null)return;var ue=Y.changes||(Y.changes=[]);K(ue,I)==-1&&ue.push(I)}function cr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Nn(e,u,I,L){var k=tr(e,u),Y,ue=e.display.view;if(!vi||I==e.doc.first+e.doc.size)return{index:k,lineN:I};for(var fe=e.display.viewFrom,ge=0;ge0){if(k==ue.length-1)return null;Y=fe+ue[k].size-u,k++}else Y=fe-u;u+=Y,I+=Y}for(;Kr(e.doc,I)!=I;){if(k==(L<0?0:ue.length-1))return null;I+=L*ue[k-(L<0?1:0)].size,k+=L}return{index:k,lineN:I}}function Rn(e,u,I){var L=e.display,k=L.view;k.length==0||u>=L.viewTo||I<=L.viewFrom?(L.view=Vi(e,u,I),L.viewFrom=u):(L.viewFrom>u?L.view=Vi(e,u,L.viewFrom).concat(L.view):L.viewFromI&&(L.view=L.view.slice(0,tr(e,I)))),L.viewTo=I}function qn(e){for(var u=e.display.view,I=0,L=0;L=e.display.viewTo||fe.to().line0?u.blinker=setInterval(function(){e.hasFocus()||Sr(e),u.cursorDiv.style.visibility=(I=!I)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(u.cursorDiv.style.visibility="hidden")}function vn(e){e.state.focused||(e.display.input.focus(),fa(e))}function ra(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Sr(e))},100)}function fa(e,u){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(qe(e,"focus",e,u),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),f&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ia(e)}function Sr(e,u){if(e.state.delayingBlurEvent)return;e.state.focused&&(qe(e,"blur",e,u),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Hr(e){for(var u=e.display,I=u.lineDiv.offsetTop,L=0;L.005||Je<-.005)&&(Ae(k.line,ue),zr(k.line),k.rest))for(var et=0;ete.display.sizerWidth){var ft=Math.ceil(fe/Xn(e.display));ft>e.display.maxLineLength&&(e.display.maxLineLength=ft,e.display.maxLine=k.line,e.display.maxLineChanged=!0)}}}function zr(e){if(e.widgets)for(var u=0;u=ue&&(Y=ot(u,xr(ne(u,ge))-e.wrapper.clientHeight),ue=ge)}return{from:Y,to:Math.max(ue,Y+1)}}function aa(e,u){if(Ye(e,"scrollCursorIntoView"))return;var I=e.display,L=I.sizer.getBoundingClientRect(),k=null;if(u.top+L.top<0?k=!0:u.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(k=!1),k!=null&&!r){var Y=E("div","\u200B",null,`position: absolute; top: `+(u.top-I.viewOffset-ti(e.display))+`px; height: `+(u.bottom-u.top+ui(e)+I.barHeight)+`px; left: `+u.left+"px; width: "+Math.max(2,u.right-u.left)+"px;");e.display.lineSpace.appendChild(Y),Y.scrollIntoView(k),e.display.lineSpace.removeChild(Y)}}function oa(e,u,I,L){L==null&&(L=0);var k;!e.options.lineWrapping&&u==I&&(u=u.ch?ht(u.line,u.sticky=="before"?u.ch-1:u.ch,"after"):u,I=u.sticky=="before"?ht(u.line,u.ch+1,"before"):u);for(var Y=0;Y<5;Y++){var ue=!1,fe=ri(e,u),ge=!I||I==u?fe:ri(e,I);k={left:Math.min(fe.left,ge.left),top:Math.min(fe.top,ge.top)-L,right:Math.max(fe.left,ge.left),bottom:Math.max(fe.bottom,ge.bottom)+L};var Se=zi(e,k),Je=e.doc.scrollTop,et=e.doc.scrollLeft;if(Se.scrollTop!=null&&(Ma(e,Se.scrollTop),Math.abs(e.doc.scrollTop-Je)>1&&(ue=!0)),Se.scrollLeft!=null&&(pa(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-et)>1&&(ue=!0)),!ue)break}return k}function vo(e,u){var I=zi(e,u);I.scrollTop!=null&&Ma(e,I.scrollTop),I.scrollLeft!=null&&pa(e,I.scrollLeft)}function zi(e,u){var I=e.display,L=xn(e.display);u.top<0&&(u.top=0);var k=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:I.scroller.scrollTop,Y=si(e),ue={};u.bottom-u.top>Y&&(u.bottom=u.top+Y);var fe=e.doc.height+Ei(I),ge=u.topfe-L;if(u.topk+Y){var Je=Math.min(u.top,(Se?fe:u.bottom)-Y);Je!=k&&(ue.scrollTop=Je)}var et=e.options.fixedGutter?0:I.gutters.offsetWidth,ft=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:I.scroller.scrollLeft-et,ut=jn(e)-I.gutters.offsetWidth,Tt=u.right-u.left>ut;return Tt&&(u.right=u.left+ut),u.left<10?ue.scrollLeft=0:u.leftut+ft-3&&(ue.scrollLeft=u.right+(Tt?0:10)-ut),ue}function _o(e,u){if(u==null)return;eo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+u}function Ea(e){eo(e);var u=e.getCursor();e.curOp.scrollToPos={from:u,to:u,margin:e.options.cursorScrollMargin}}function Pa(e,u,I){(u!=null||I!=null)&&eo(e),u!=null&&(e.curOp.scrollLeft=u),I!=null&&(e.curOp.scrollTop=I)}function Qs(e,u){eo(e),e.curOp.scrollToPos=u}function eo(e){var u=e.curOp.scrollToPos;if(u){e.curOp.scrollToPos=null;var I=ki(e,u.from),L=ki(e,u.to);Wo(e,I,L,u.margin)}}function Wo(e,u,I,L){var k=zi(e,{left:Math.min(u.left,I.left),top:Math.min(u.top,I.top)-L,right:Math.max(u.right,I.right),bottom:Math.max(u.bottom,I.bottom)+L});Pa(e,k.scrollLeft,k.scrollTop)}function Ma(e,u){if(Math.abs(e.doc.scrollTop-u)<2)return;W||bo(e,{top:u}),Ho(e,u,!0),W&&bo(e),ja(e,100)}function Ho(e,u,I){if(u=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,u)),e.display.scroller.scrollTop==u&&!I)return;e.doc.scrollTop=u,e.display.scrollbars.setScrollTop(u),e.display.scroller.scrollTop!=u&&(e.display.scroller.scrollTop=u)}function pa(e,u,I,L){if(u=Math.max(0,Math.min(u,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(I?u==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-u)<2)&&!L)return;e.doc.scrollLeft=u,Xo(e),e.display.scroller.scrollLeft!=u&&(e.display.scroller.scrollLeft=u),e.display.scrollbars.setScrollLeft(u)}function Na(e){var u=e.display,I=u.gutters.offsetWidth,L=Math.round(e.doc.height+Ei(e.display));return{clientHeight:u.scroller.clientHeight,viewHeight:u.wrapper.clientHeight,scrollWidth:u.scroller.scrollWidth,clientWidth:u.scroller.clientWidth,viewWidth:u.wrapper.clientWidth,barLeft:e.options.fixedGutter?I:0,docHeight:L,scrollHeight:L+ui(e)+u.barHeight,nativeBarWidth:u.nativeBarWidth,gutterWidth:I}}var ma=function(e,u,I){this.cm=I;var L=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),k=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=k.tabIndex=-1,e(L),e(k),Be(L,"scroll",function(){L.clientHeight&&u(L.scrollTop,"vertical")}),Be(k,"scroll",function(){k.clientWidth&&u(k.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,A&&O<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ma.prototype.update=function(e){var u=e.scrollWidth>e.clientWidth+1,I=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(I){this.vert.style.display="block",this.vert.style.bottom=u?L+"px":"0";var k=e.viewHeight-(u?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+k)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(u){this.horiz.style.display="block",this.horiz.style.right=I?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var Y=e.viewWidth-e.barLeft-(I?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+Y)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(L==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:I?L:0,bottom:u?L:0}},ma.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ma.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ma.prototype.zeroWidthHack=function(){var e=t&&!o?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new J,this.disableVert=new J},ma.prototype.enableZeroWidthBar=function(e,u,I){e.style.pointerEvents="auto";function L(){var k=e.getBoundingClientRect(),Y=I=="vert"?document.elementFromPoint(k.right-1,(k.top+k.bottom)/2):document.elementFromPoint((k.right+k.left)/2,k.bottom-1);Y!=e?e.style.pointerEvents="none":u.set(1e3,L)}u.set(1e3,L)},ma.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ua=function(){};Ua.prototype.update=function(){return{bottom:0,right:0}},Ua.prototype.setScrollLeft=function(){},Ua.prototype.setScrollTop=function(){},Ua.prototype.clear=function(){};function xa(e,u){u||(u=Na(e));var I=e.display.barWidth,L=e.display.barHeight;zo(e,u);for(var k=0;k<4&&I!=e.display.barWidth||L!=e.display.barHeight;k++)I!=e.display.barWidth&&e.options.lineWrapping&&Hr(e),zo(e,Na(e)),I=e.display.barWidth,L=e.display.barHeight}function zo(e,u){var I=e.display,L=I.scrollbars.update(u);I.sizer.style.paddingRight=(I.barWidth=L.right)+"px",I.sizer.style.paddingBottom=(I.barHeight=L.bottom)+"px",I.heightForcer.style.borderBottom=L.bottom+"px solid transparent",L.right&&L.bottom?(I.scrollbarFiller.style.display="block",I.scrollbarFiller.style.height=L.bottom+"px",I.scrollbarFiller.style.width=L.right+"px"):I.scrollbarFiller.style.display="",L.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(I.gutterFiller.style.display="block",I.gutterFiller.style.height=L.bottom+"px",I.gutterFiller.style.width=u.gutterWidth+"px"):I.gutterFiller.style.display=""}var Ko={native:ma,null:Ua};function Go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ko[e.options.scrollbarStyle](function(u){e.display.wrapper.insertBefore(u,e.display.scrollbarFiller),Be(u,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),u.setAttribute("cm-not-content","true")},function(u,I){I=="horizontal"?pa(e,u):Ma(e,u)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function ga(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zs},xt(e.curOp)}function va(e){var u=e.curOp;u&&Ht(u,function(I){for(var L=0;L=I.viewTo)||I.maxLineChanged&&u.options.lineWrapping,e.update=e.mustUpdate&&new to(u,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nl(e){e.updatedDisplay=e.mustUpdate&&yo(e.cm,e.update)}function il(e){var u=e.cm,I=u.display;e.updatedDisplay&&Hr(u),e.barMeasure=Na(u),I.maxLineChanged&&!u.options.lineWrapping&&(e.adjustWidthTo=ci(u,I.maxLine,I.maxLine.text.length).left+3,u.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(I.scroller.clientWidth,I.sizer.offsetLeft+e.adjustWidthTo+ui(u)+u.display.barWidth),e.maxScrollLeft=Math.max(0,I.sizer.offsetLeft+e.adjustWidthTo-jn(u))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=I.input.prepareSelection())}function rl(e){var u=e.cm;e.adjustWidthTo!=null&&(u.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var I=+new Date+e.options.workTime,L=Ot(e,u.highlightFrontier),k=[];u.iter(L.line,Math.min(u.first+u.size,e.display.viewTo+500),function(Y){if(L.line>=e.display.viewFrom){var ue=Y.styles,fe=Y.text.length>e.options.maxHighlightLength?$t(u.mode,L.state):null,ge=$e(e,Y,L,!0);fe&&(L.state=fe),Y.styles=ge.styles;var Se=Y.styleClasses,Je=ge.classes;Je?Y.styleClasses=Je:Se&&(Y.styleClasses=null);for(var et=!ue||ue.length!=Y.styles.length||Se!=Je&&(!Se||!Je||Se.bgClass!=Je.bgClass||Se.textClass!=Je.textClass),ft=0;!et&&ftI)return ja(e,e.options.workDelay),!0}),u.highlightFrontier=L.line,u.modeFrontier=Math.max(u.modeFrontier,L.line),k.length&&Pr(e,function(){for(var Y=0;Y=I.viewFrom&&u.visible.to<=I.viewTo&&(I.updateLineNumbers==null||I.updateLineNumbers>=I.viewTo)&&I.renderedView==I.view&&qn(e)==0)return!1;Yo(e)&&(cr(e),u.dims=ai(e));var k=L.first+L.size,Y=Math.max(u.visible.from-e.options.viewportMargin,L.first),ue=Math.min(k,u.visible.to+e.options.viewportMargin);I.viewFromue&&I.viewTo-ue<20&&(ue=Math.min(k,I.viewTo)),vi&&(Y=Kr(e.doc,Y),ue=Nr(e.doc,ue));var fe=Y!=I.viewFrom||ue!=I.viewTo||I.lastWrapHeight!=u.wrapperHeight||I.lastWrapWidth!=u.wrapperWidth;Rn(e,Y,ue),I.viewOffset=xr(ne(e.doc,I.viewFrom)),e.display.mover.style.top=I.viewOffset+"px";var ge=qn(e);if(!fe&&ge==0&&!u.force&&I.renderedView==I.view&&(I.updateLineNumbers==null||I.updateLineNumbers>=I.viewTo))return!1;var Se=ll(e);return ge>4&&(I.lineDiv.style.display="none"),cl(e,I.updateLineNumbers,u.dims),ge>4&&(I.lineDiv.style.display=""),I.renderedView=I.view,ul(Se),x(I.cursorDiv),x(I.selectionDiv),I.gutters.style.height=I.sizer.style.minHeight=0,fe&&(I.lastWrapHeight=u.wrapperHeight,I.lastWrapWidth=u.wrapperWidth,ja(e,400)),I.updateLineNumbers=null,!0}function Vo(e,u){for(var I=u.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||u.oldDisplayWidth==jn(e)){if(I&&I.top!=null&&(I={top:Math.min(e.doc.height+Ei(e.display)-si(e),I.top)}),u.visible=Xr(e.display,e.doc,I),u.visible.from>=e.display.viewFrom&&u.visible.to<=e.display.viewTo)break}else L&&(u.visible=Xr(e.display,e.doc,I));if(!yo(e,u))break;Hr(e);var k=Na(e);tn(e),xa(e,k),xo(e,k),u.force=!1}u.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(u.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function bo(e,u){var I=new to(e,u);if(yo(e,I)){Hr(e),Vo(e,I);var L=Na(e);tn(e),xa(e,L),xo(e,L),I.finish()}}function cl(e,u,I){var L=e.display,k=e.options.lineNumbers,Y=L.lineDiv,ue=Y.firstChild;function fe(Tt){var Ut=Tt.nextSibling;return f&&t&&e.display.currentWheelTarget==Tt?Tt.style.display="none":Tt.parentNode.removeChild(Tt),Ut}for(var ge=L.view,Se=L.viewFrom,Je=0;Je-1&&(ut=!1),bt(e,et,Se,I)),ut&&(x(et.lineNumber),et.lineNumber.appendChild(document.createTextNode(Nt(e.options,Se)))),ue=et.node.nextSibling}Se+=et.size}for(;ue;)ue=fe(ue)}function Eo(e){var u=e.gutters.offsetWidth;e.sizer.style.marginLeft=u+"px"}function xo(e,u){e.display.sizer.style.minHeight=u.docHeight+"px",e.display.heightForcer.style.top=u.docHeight+"px",e.display.gutters.style.height=u.docHeight+e.display.barHeight+ui(e)+"px"}function Xo(e){var u=e.display,I=u.view;if(!u.alignWidgets&&(!u.gutters.firstChild||!e.options.fixedGutter))return;for(var L=Ui(u)-u.scroller.scrollLeft+e.doc.scrollLeft,k=u.gutters.offsetWidth,Y=L+"px",ue=0;ueue.clientWidth,ge=ue.scrollHeight>ue.clientHeight;if(!(L&&fe||k&&ge))return;if(k&&t&&f){e:for(var Se=u.target,Je=Y.view;Se!=ue;Se=Se.parentNode)for(var et=0;et=0&&Dt(e,L.to())<=0)return I}return-1};var bi=function(e,u){this.anchor=e,this.head=u};bi.prototype.from=function(){return rn(this.anchor,this.head)},bi.prototype.to=function(){return hn(this.anchor,this.head)},bi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yr(e,u,I){var L=e&&e.options.selectionsMayTouch,k=u[I];u.sort(function(ft,ut){return Dt(ft.from(),ut.from())}),I=K(u,k);for(var Y=1;Y0:ge>=0){var Se=rn(fe.from(),ue.from()),Je=hn(fe.to(),ue.to()),et=fe.empty()?ue.from()==ue.head:fe.from()==fe.head;Y<=I&&--I,u.splice(--Y,2,new bi(et?Je:Se,et?Se:Je))}}return new Fr(u,I)}function sa(e,u){return new Fr([new bi(e,u||e)],0)}function la(e){return e.text?ht(e.from.line+e.text.length-1,Ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,u){if(Dt(e,u.from)<0)return e;if(Dt(e,u.to)<=0)return la(u);var I=e.line+u.text.length-(u.to.line-u.from.line)-1,L=e.ch;return e.line==u.to.line&&(L+=la(u).ch-u.to.ch),ht(I,L)}function So(e,u){for(var I=[],L=0;L1&&e.remove(fe.line+1,Tt-1),e.insert(fe.line+1,qt)}Xt(e,"change",e,u)}function ua(e,u,I){function L(k,Y,ue){if(k.linked)for(var fe=0;fe1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ke(e.done)}function rs(e,u,I,L){var k=e.history;k.undone.length=0;var Y=+new Date,ue,fe;if((k.lastOp==L||k.lastOrigin==u.origin&&u.origin&&(u.origin.charAt(0)=="+"&&k.lastModTime>Y-(e.cm?e.cm.options.historyEventDelay:500)||u.origin.charAt(0)=="*"))&&(ue=ml(k,k.lastOp==L)))fe=Ke(ue.changes),Dt(u.from,u.to)==0&&Dt(u.from,fe.to)==0?fe.to=la(u):ue.changes.push(Oo(e,u));else{var ge=Ke(k.done);for((!ge||!ge.ranges)&&ro(e.sel,k.done),ue={changes:[Oo(e,u)],generation:k.generation},k.done.push(ue);k.done.length>k.undoDepth;)k.done.shift(),k.done[0].ranges||k.done.shift()}k.done.push(I),k.generation=++k.maxGeneration,k.lastModTime=k.lastSelTime=Y,k.lastOp=k.lastSelOp=L,k.lastOrigin=k.lastSelOrigin=u.origin,fe||qe(e,"historyAdded")}function gl(e,u,I,L){var k=u.charAt(0);return k=="*"||k=="+"&&I.ranges.length==L.ranges.length&&I.somethingSelected()==L.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,u,I,L){var k=e.history,Y=L&&L.origin;I==k.lastSelOp||Y&&k.lastSelOrigin==Y&&(k.lastModTime==k.lastSelTime&&k.lastOrigin==Y||gl(e,Y,Ke(k.done),u))?k.done[k.done.length-1]=u:ro(u,k.done),k.lastSelTime=+new Date,k.lastSelOrigin=Y,k.lastSelOp=I,L&&L.clearRedo!==!1&&is(k.undone)}function ro(e,u){var I=Ke(u);I&&I.ranges&&I.equals(e)||u.push(e)}function as(e,u,I,L){var k=u["spans_"+e.id],Y=0;e.iter(Math.max(e.first,I),Math.min(e.first+e.size,L),function(ue){ue.markedSpans&&((k||(k=u["spans_"+e.id]={}))[Y]=ue.markedSpans),++Y})}function _l(e){if(!e)return null;for(var u,I=0;I-1&&(Ke(fe)[et]=Se[et],delete Se[et]))}}return L}function Ao(e,u,I,L){if(L){var k=e.anchor;if(I){var Y=Dt(u,k)<0;Y!=Dt(I,k)<0?(k=u,u=I):Y!=Dt(u,I)<0&&(u=I)}return new bi(k,u)}else return new bi(I||u,u)}function ao(e,u,I,L,k){k==null&&(k=e.cm&&(e.cm.display.shift||e.extend)),mr(e,new Fr([Ao(e.sel.primary(),u,I,k)],0),L)}function ss(e,u,I){for(var L=[],k=e.cm&&(e.cm.display.shift||e.extend),Y=0;Y=u.ch:fe.to>u.ch))){if(k&&(qe(ge,"beforeCursorEnter"),ge.explicitlyCleared))if(Y.markedSpans){--ue;continue}else break;if(!ge.atomic)continue;if(I){var et=ge.find(L<0?1:-1),ft=void 0;if((L<0?Je:Se)&&(et=fs(e,et,-L,et&&et.line==u.line?Y:null)),et&&et.line==u.line&&(ft=Dt(et,I))&&(L<0?ft<0:ft>0))return Sa(e,et,u,L,k)}var ut=ge.find(L<0?-1:1);return(L<0?Se:Je)&&(ut=fs(e,ut,L,ut.line==u.line?Y:null)),ut?Sa(e,ut,u,L,k):null}}return u}function so(e,u,I,L,k){var Y=L||1,ue=Sa(e,u,I,Y,k)||!k&&Sa(e,u,I,Y,!0)||Sa(e,u,I,-Y,k)||!k&&Sa(e,u,I,-Y,!0);return ue||(e.cantEdit=!0,ht(e.first,0))}function fs(e,u,I,L){return I<0&&u.ch==0?u.line>e.first?U(e,ht(u.line-1)):null:I>0&&u.ch==(L||ne(e,u.line)).text.length?u.line=0;--k)gs(e,{from:L[k].from,to:L[k].to,text:k?[""]:u.text,origin:u.origin});else gs(e,u)}function gs(e,u){if(u.text.length==1&&u.text[0]==""&&Dt(u.from,u.to)==0)return;var I=So(e,u);rs(e,u,I,e.cm?e.cm.curOp.id:NaN),Wa(e,u,I,Wi(e,u));var L=[];ua(e,function(k,Y){!Y&&K(L,k.history)==-1&&(bs(k.history,u),L.push(k.history)),Wa(k,u,null,Wi(k,u))})}function lo(e,u,I){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!I)return;for(var k=e.history,Y,ue=e.sel,fe=u=="undo"?k.done:k.undone,ge=u=="undo"?k.undone:k.done,Se=0;Se=0;--ut){var Tt=ft(ut);if(Tt)return Tt.v}}function vs(e,u){if(u==0)return;if(e.first+=u,e.sel=new Fr(Me(e.sel.ranges,function(k){return new bi(ht(k.anchor.line+u,k.anchor.ch),ht(k.head.line+u,k.head.ch))}),e.sel.primIndex),e.cm){Hi(e.cm,e.first,e.first-u,u);for(var I=e.cm.display,L=I.viewFrom;Le.lastLine())return;if(u.from.lineY&&(u={from:u.from,to:ht(Y,ne(e,Y).text.length),text:[u.text[0]],origin:u.origin}),u.removed=oe(e,u.from,u.to),I||(I=So(e,u)),e.cm?El(e.cm,u,L):Co(e,u,L),oo(e,I,de),e.cantEdit&&so(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,u,I){var L=e.doc,k=e.display,Y=u.from,ue=u.to,fe=!1,ge=Y.line;e.options.lineWrapping||(ge=Qe(Qi(ne(L,Y.line))),L.iter(ge,ue.line+1,function(ut){if(ut==k.maxLine)return fe=!0,!0})),L.sel.contains(u.from,u.to)>-1&&je(e),Co(L,u,I,Qn(e)),e.options.lineWrapping||(L.iter(ge,Y.line+u.text.length,function(ut){var Tt=Qr(ut);Tt>k.maxLineLength&&(k.maxLine=ut,k.maxLineLength=Tt,k.maxLineChanged=!0,fe=!1)}),fe&&(e.curOp.updateMaxLine=!0)),di(L,Y.line),ja(e,400);var Se=u.text.length-(ue.line-Y.line)-1;u.full?Hi(e):Y.line==ue.line&&u.text.length==1&&!es(e.doc,u)?pr(e,Y.line,"text"):Hi(e,Y.line,ue.line+1,Se);var Je=Ue(e,"changes"),et=Ue(e,"change");if(et||Je){var ft={from:Y,to:ue,text:u.text,removed:u.removed,origin:u.origin};et&&Xt(e,"change",e,ft),Je&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ft)}e.display.selForContextMenu=null}function Ca(e,u,I,L,k){var Y;L||(L=I),Dt(L,I)<0&&(Y=[L,I],I=Y[0],L=Y[1]),typeof u=="string"&&(u=e.splitLines(u)),Ta(e,{from:I,to:L,text:u,origin:k})}function _s(e,u,I,L){I1||!(this.children[0]instanceof za))){var fe=[];this.collapse(fe),this.children=[new za(fe)],this.children[0].parent=this}},collapse:function(e){for(var u=0;u50){for(var ue=k.lines.length%25+25,fe=ue;fe10);e.parent.maybeSpill()},iterN:function(e,u,I){for(var L=0;Le.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=Je,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&Hi(e,L,k+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&Xt(e,"markerCleared",e,this,L,k),u&&va(e),this.parent&&this.parent.clear()},ca.prototype.find=function(e,u){e==null&&this.type=="bookmark"&&(e=1);for(var I,L,k=0;k0||ue==0&&Y.clearWhenEmpty!==!1)return Y;if(Y.replacedWith&&(Y.collapsed=!0,Y.widgetNode=S("span",[Y.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||Y.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(Y.widgetNode.insertLeft=!0)),Y.collapsed){if(Ni(e,u.line,u,I,Y)||u.line!=I.line&&Ni(e,I.line,u,I,Y))throw new Error("Inserting collapsed marker partially overlapping an existing one");xi()}Y.addToHistory&&rs(e,{from:u,to:I,origin:"markText"},e.sel,NaN);var fe=u.line,ge=e.cm,Se;if(e.iter(fe,I.line+1,function(et){ge&&Y.collapsed&&!ge.options.lineWrapping&&Qi(et)==ge.display.maxLine&&(Se=!0),Y.collapsed&&fe!=u.line&&Ae(et,0),Di(et,new Bi(Y,fe==u.line?u.ch:null,fe==I.line?I.ch:null)),++fe}),Y.collapsed&&e.iter(u.line,I.line+1,function(et){Ir(e,et)&&Ae(et,0)}),Y.clearOnEnter&&Be(Y,"beforeCursorEnter",function(){return Y.clear()}),Y.readOnly&&(gi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),Y.collapsed&&(Y.id=++xs,Y.atomic=!0),ge){if(Se&&(ge.curOp.updateMaxLine=!0),Y.collapsed)Hi(ge,u.line,I.line+1);else if(Y.className||Y.startStyle||Y.endStyle||Y.css||Y.attributes||Y.title)for(var Je=u.line;Je<=I.line;Je++)pr(ge,Je,"text");Y.atomic&&ds(ge.doc),Xt(ge,"markerAdded",ge,Y)}return Y}var Va=function(e,u){this.markers=e,this.primary=u;for(var I=0;I=0;ge--)Ta(this,L[ge]);fe?us(this,fe):this.cm&&Ea(this.cm)}),undo:rr(function(){lo(this,"undo")}),redo:rr(function(){lo(this,"redo")}),undoSelection:rr(function(){lo(this,"undo",!0)}),redoSelection:rr(function(){lo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,u=0,I=0,L=0;L=e.ch)&&u.push(k.marker.parent||k.marker)}return u},findMarks:function(e,u,I){e=U(this,e),u=U(this,u);var L=[],k=e.line;return this.iter(e.line,u.line+1,function(Y){var ue=Y.markedSpans;if(ue)for(var fe=0;fe=ge.to||ge.from==null&&k!=e.line||ge.from!=null&&k==u.line&&ge.from>=u.ch)&&(!I||I(ge.marker))&&L.push(ge.marker.parent||ge.marker)}++k}),L},getAllMarks:function(){var e=[];return this.iter(function(u){var I=u.markedSpans;if(I)for(var L=0;Le)return u=e,!0;e-=Y,++I}),U(this,ht(I,u))},indexFromPos:function(e){e=U(this,e);var u=e.ch;if(e.lineu&&(u=e.from),e.to!=null&&e.to-1){u.state.draggingText(e),setTimeout(function(){return u.display.input.focus()},20);return}try{var Je=e.dataTransfer.getData("Text");if(Je){var et;if(u.state.draggingText&&!u.state.draggingText.copy&&(et=u.listSelections()),oo(u.doc,sa(I,I)),et)for(var ft=0;ft=0;fe--)Ca(e.doc,"",L[fe].from,L[fe].to,"+delete");Ea(e)})}function Lo(e,u,I){var L=j(e.text,u+I,I);return L<0||L>e.text.length?null:L}function Io(e,u,I){var L=Lo(e,u.ch,I);return L==null?null:new ht(u.line,L,I<0?"after":"before")}function Do(e,u,I,L,k){if(e){u.doc.direction=="rtl"&&(k=-k);var Y=dt(I,u.doc.direction);if(Y){var ue=k<0?Ke(Y):Y[0],fe=k<0==(ue.level==1),ge=fe?"after":"before",Se;if(ue.level>0||u.doc.direction=="rtl"){var Je=li(u,I);Se=k<0?I.text.length-1:0;var et=Dn(u,Je,Se).top;Se=ee(function(ft){return Dn(u,Je,ft).top==et},k<0==(ue.level==1)?ue.from:ue.to-1,Se),ge=="before"&&(Se=Lo(I,Se,1))}else Se=k<0?ue.to:ue.from;return new ht(L,Se,ge)}}return new ht(L,k<0?I.text.length:0,k<0?"before":"after")}function Ml(e,u,I,L){var k=dt(u,e.doc.direction);if(!k)return Io(u,I,L);I.ch>=u.text.length?(I.ch=u.text.length,I.sticky="before"):I.ch<=0&&(I.ch=0,I.sticky="after");var Y=xe(k,I.ch,I.sticky),ue=k[Y];if(e.doc.direction=="ltr"&&ue.level%2==0&&(L>0?ue.to>I.ch:ue.from=ue.from&&ft>=Je.begin)){var ut=et?"before":"after";return new ht(I.line,ft,ut)}}var Tt=function(qt,on,Zt){for(var dn=function(Ii,ar){return ar?new ht(I.line,fe(Ii,1),"before"):new ht(I.line,Ii,"after")};qt>=0&&qt0==(On.level!=1),ei=yn?Zt.begin:fe(Zt.end,-1);if(On.from<=ei&&ei0?Je.end:fe(Je.begin,-1);return Kt!=null&&!(L>0&&Kt==u.text.length)&&(Ut=Tt(L>0?0:k.length-1,L,Se(Kt)),Ut)?Ut:null}var $a={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Ra(e,function(u){if(u.empty()){var I=ne(e.doc,u.head.line).text.length;return u.head.ch==I&&u.head.line0)k=new ht(k.line,k.ch+1),e.replaceRange(Y.charAt(k.ch-1)+Y.charAt(k.ch-2),ht(k.line,k.ch-2),k,"+transpose");else if(k.line>e.doc.first){var ue=ne(e.doc,k.line-1).text;ue&&(k=new ht(k.line,1),e.replaceRange(Y.charAt(0)+e.doc.lineSeparator()+ue.charAt(ue.length-1),ht(k.line-1,ue.length-1),k,"+transpose"))}}I.push(new bi(k,k))}e.setSelections(I)})},newlineAndIndent:function(e){return Pr(e,function(){for(var u=e.listSelections(),I=u.length-1;I>=0;I--)e.replaceRange(e.doc.lineSeparator(),u[I].anchor,u[I].head,"+input");u=e.listSelections();for(var L=0;Le&&Dt(u,this.pos)==0&&I==this.button};var Qa,qa;function Hl(e,u){var I=+new Date;return qa&&qa.compare(I,e,u)?(Qa=qa=null,"triple"):Qa&&Qa.compare(I,e,u)?(qa=new Po(I,e,u),Qa=null,"double"):(Qa=new Po(I,e,u),qa=null,"single")}function js(e){var u=this,I=u.display;if(Ye(u,e)||I.activeTouch&&I.input.supportsTouch())return;if(I.input.ensurePolled(),I.shift=e.shiftKey,fi(I,e)){f||(I.scroller.draggable=!1,setTimeout(function(){return I.scroller.draggable=!0},100));return}if(Mo(u,e))return;var L=yr(u,e),k=at(e),Y=L?Hl(L,k):"single";if(window.focus(),k==1&&u.state.selectingText&&u.state.selectingText(e),L&&zl(u,k,L,Y,e))return;k==1?L?Gl(u,L,Y,e):Ve(e)==I.scroller&&be(e):k==2?(L&&ao(u.doc,L),setTimeout(function(){return I.input.focus()},20)):k==3&&(g?u.display.input.onContextMenu(e):ra(u))}function zl(e,u,I,L,k){var Y="Click";return L=="double"?Y="Double"+Y:L=="triple"&&(Y="Triple"+Y),Y=(u==1?"Left":u==2?"Middle":"Right")+Y,Ja(e,Rs(Y,k),k,function(ue){if(typeof ue=="string"&&(ue=$a[ue]),!ue)return!1;var fe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),fe=ue(e,I)!=le}finally{e.state.suppressEdits=!1}return fe})}function Kl(e,u,I){var L=e.getOption("configureMouse"),k=L?L(e,u,I):{};if(k.unit==null){var Y=d?I.shiftKey&&I.metaKey:I.altKey;k.unit=Y?"rectangle":u=="single"?"char":u=="double"?"word":"line"}return(k.extend==null||e.doc.extend)&&(k.extend=e.doc.extend||I.shiftKey),k.addNew==null&&(k.addNew=t?I.metaKey:I.ctrlKey),k.moveOnDrag==null&&(k.moveOnDrag=!(t?I.altKey:I.ctrlKey)),k}function Gl(e,u,I,L){A?setTimeout(B(vn,e),0):e.curOp.focus=N();var k=Kl(e,I,L),Y=e.doc.sel,ue;e.options.dragDrop&&_t&&!e.isReadOnly()&&I=="single"&&(ue=Y.contains(u))>-1&&(Dt((ue=Y.ranges[ue]).from(),u)<0||u.xRel>0)&&(Dt(ue.to(),u)>0||u.xRel<0)?Vl(e,L,u,k):Xl(e,L,u,k)}function Vl(e,u,I,L){var k=e.display,Y=!1,ue=ir(e,function(Se){f&&(k.scroller.draggable=!1),e.state.draggingText=!1,lt(k.wrapper.ownerDocument,"mouseup",ue),lt(k.wrapper.ownerDocument,"mousemove",fe),lt(k.scroller,"dragstart",ge),lt(k.scroller,"drop",ue),Y||(be(Se),L.addNew||ao(e.doc,I,null,null,L.extend),f&&!n||A&&O==9?setTimeout(function(){k.wrapper.ownerDocument.body.focus({preventScroll:!0}),k.input.focus()},20):k.input.focus())}),fe=function(Se){Y=Y||Math.abs(u.clientX-Se.clientX)+Math.abs(u.clientY-Se.clientY)>=10},ge=function(){return Y=!0};f&&(k.scroller.draggable=!0),e.state.draggingText=ue,ue.copy=!L.moveOnDrag,k.scroller.dragDrop&&k.scroller.dragDrop(),Be(k.wrapper.ownerDocument,"mouseup",ue),Be(k.wrapper.ownerDocument,"mousemove",fe),Be(k.scroller,"dragstart",ge),Be(k.scroller,"drop",ue),ra(e),setTimeout(function(){return k.input.focus()},20)}function Fs(e,u,I){if(I=="char")return new bi(u,u);if(I=="word")return e.findWordAt(u);if(I=="line")return new bi(ht(u.line,0),U(e.doc,ht(u.line+1,0)));var L=I(e,u);return new bi(L.from,L.to)}function Xl(e,u,I,L){var k=e.display,Y=e.doc;be(u);var ue,fe,ge=Y.sel,Se=ge.ranges;if(L.addNew&&!L.extend?(fe=Y.sel.contains(I),fe>-1?ue=Se[fe]:ue=new bi(I,I)):(ue=Y.sel.primary(),fe=Y.sel.primIndex),L.unit=="rectangle")L.addNew||(ue=new bi(I,I)),I=yr(e,u,!0,!0),fe=-1;else{var Je=Fs(e,I,L.unit);L.extend?ue=Ao(ue,Je.anchor,Je.head,L.extend):ue=Je}L.addNew?fe==-1?(fe=Se.length,mr(Y,Yr(e,Se.concat([ue]),fe),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[fe].empty()&&L.unit=="char"&&!L.extend?(mr(Y,Yr(e,Se.slice(0,fe).concat(Se.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),ge=Y.sel):Ro(Y,fe,ue,Te):(fe=0,mr(Y,new Fr([ue],0),Te),ge=Y.sel);var et=I;function ft(Zt){if(Dt(et,Zt)==0)return;if(et=Zt,L.unit=="rectangle"){for(var dn=[],On=e.options.tabSize,yn=G(ne(Y,I.line).text,I.ch,On),ei=G(ne(Y,Zt.line).text,Zt.ch,On),Ii=Math.min(yn,ei),ar=Math.max(yn,ei),Mi=Math.min(I.line,Zt.line),Mr=Math.min(e.lastLine(),Math.max(I.line,Zt.line));Mi<=Mr;Mi++){var Cr=ne(Y,Mi).text,$i=Ie(Cr,Ii,On);Ii==ar?dn.push(new bi(ht(Mi,$i),ht(Mi,$i))):Cr.length>$i&&dn.push(new bi(ht(Mi,$i),ht(Mi,Ie(Cr,ar,On))))}dn.length||dn.push(new bi(I,I)),mr(Y,Yr(e,ge.ranges.slice(0,fe).concat(dn),fe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Zt)}else{var Or=ue,dr=Fs(e,Zt,L.unit),nr=Or.anchor,Ji;Dt(dr.anchor,nr)>0?(Ji=dr.head,nr=rn(Or.from(),dr.anchor)):(Ji=dr.anchor,nr=hn(Or.to(),dr.head));var Fi=ge.ranges.slice(0);Fi[fe]=Yl(e,new bi(U(Y,nr),Ji)),mr(Y,Yr(e,Fi,fe),Te)}}var ut=k.wrapper.getBoundingClientRect(),Tt=0;function Ut(Zt){var dn=++Tt,On=yr(e,Zt,!0,L.unit=="rectangle");if(!On)return;if(Dt(On,et)!=0){e.curOp.focus=N(),ft(On);var yn=Xr(k,Y);(On.line>=yn.to||On.lineut.bottom?20:0;ei&&setTimeout(ir(e,function(){if(Tt!=dn)return;k.scroller.scrollTop+=ei,Ut(Zt)}),50)}}function Kt(Zt){e.state.selectingText=!1,Tt=Infinity,Zt&&(be(Zt),k.input.focus()),lt(k.wrapper.ownerDocument,"mousemove",qt),lt(k.wrapper.ownerDocument,"mouseup",on),Y.history.lastSelOrigin=null}var qt=ir(e,function(Zt){Zt.buttons===0||!at(Zt)?Kt(Zt):Ut(Zt)}),on=ir(e,Kt);e.state.selectingText=on,Be(k.wrapper.ownerDocument,"mousemove",qt),Be(k.wrapper.ownerDocument,"mouseup",on)}function Yl(e,u){var I=u.anchor,L=u.head,k=ne(e.doc,I.line);if(Dt(I,L)==0&&I.sticky==L.sticky)return u;var Y=dt(k);if(!Y)return u;var ue=xe(Y,I.ch,I.sticky),fe=Y[ue];if(fe.from!=I.ch&&fe.to!=I.ch)return u;var ge=ue+(fe.from==I.ch==(fe.level!=1)?0:1);if(ge==0||ge==Y.length)return u;var Se;if(L.line!=I.line)Se=(L.line-I.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Je=xe(Y,L.ch,L.sticky),et=Je-ue||(L.ch-I.ch)*(fe.level==1?-1:1);Je==ge-1||Je==ge?Se=et<0:Se=et>0}var ft=Y[ge+(Se?-1:0)],ut=Se==(ft.level==1),Tt=ut?ft.from:ft.to,Ut=ut?"after":"before";return I.ch==Tt&&I.sticky==Ut?u:new bi(new ht(I.line,Tt,Ut),L)}function Bs(e,u,I,L){var k,Y;if(u.touches)k=u.touches[0].clientX,Y=u.touches[0].clientY;else try{k=u.clientX,Y=u.clientY}catch(ft){return!1}if(k>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&be(u);var ue=e.display,fe=ue.lineDiv.getBoundingClientRect();if(Y>fe.bottom||!Ue(e,I))return Pe(u);Y-=fe.top-ue.viewOffset;for(var ge=0;ge=k){var Je=ot(e.doc,Y),et=e.display.gutterSpecs[ge];return qe(e,I,e,Je,et.className,u),Pe(u)}}}function Mo(e,u){return Bs(e,u,"gutterClick",!0)}function Ws(e,u){if(fi(e.display,u)||$l(e,u))return;if(Ye(e,u,"contextmenu"))return;g||e.display.input.onContextMenu(u)}function $l(e,u){return Ue(e,"gutterContextMenu")?Bs(e,u,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}var La={toString:function(){return"CodeMirror.Init"}},zs={},fo={};function Jl(e){var u=e.optionHandlers;function I(L,k,Y,ue){e.defaults[L]=k,Y&&(u[L]=ue?function(fe,ge,Se){Se!=La&&Y(fe,ge,Se)}:Y)}e.defineOption=I,e.Init=La,I("value","",function(L,k){return L.setValue(k)},!0),I("mode",null,function(L,k){L.doc.modeOption=k,To(L)},!0),I("indentUnit",2,To,!0),I("indentWithTabs",!1),I("smartIndent",!0),I("tabSize",4,function(L){Ba(L),un(L),Hi(L)},!0),I("lineSeparator",null,function(L,k){if(L.doc.lineSep=k,!k)return;var Y=[],ue=L.doc.first;L.doc.iter(function(ge){for(var Se=0;;){var Je=ge.text.indexOf(k,Se);if(Je==-1)break;Se=Je+k.length,Y.push(ht(ue,Je))}ue++});for(var fe=Y.length-1;fe>=0;fe--)Ca(L.doc,k,Y[fe],ht(Y[fe].line,Y[fe].ch+k.length))}),I("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,k,Y){L.state.specialChars=new RegExp(k.source+(k.test(" ")?"":"| "),"g"),Y!=La&&L.refresh()}),I("specialCharPlaceholder",_i,function(L){return L.refresh()},!0),I("electricChars",!0),I("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),I("spellcheck",!1,function(L,k){return L.getInputField().spellcheck=k},!0),I("autocorrect",!1,function(L,k){return L.getInputField().autocorrect=k},!0),I("autocapitalize",!1,function(L,k){return L.getInputField().autocapitalize=k},!0),I("rtlMoveVisually",!v),I("wholeLineUpdateBefore",!0),I("theme","default",function(L){Hs(L),Fa(L)},!0),I("keyMap","default",function(L,k,Y){var ue=co(k),fe=Y!=La&&co(Y);fe&&fe.detach&&fe.detach(L,ue),ue.attach&&ue.attach(L,fe||null)}),I("extraKeys",null),I("configureMouse",null),I("lineWrapping",!1,ql,!0),I("gutters",[],function(L,k){L.display.gutterSpecs=wo(k,L.options.lineNumbers),Fa(L)},!0),I("fixedGutter",!0,function(L,k){L.display.gutters.style.left=k?Ui(L.display)+"px":"0",L.refresh()},!0),I("coverGutterNextToScrollbar",!1,function(L){return xa(L)},!0),I("scrollbarStyle","native",function(L){Go(L),xa(L),L.display.scrollbars.setScrollTop(L.doc.scrollTop),L.display.scrollbars.setScrollLeft(L.doc.scrollLeft)},!0),I("lineNumbers",!1,function(L,k){L.display.gutterSpecs=wo(L.options.gutters,k),Fa(L)},!0),I("firstLineNumber",1,Fa,!0),I("lineNumberFormatter",function(L){return L},Fa,!0),I("showCursorWhenSelecting",!1,tn,!0),I("resetSelectionOnContextMenu",!0),I("lineWiseCopyCut",!0),I("pasteLinesPerSelection",!0),I("selectionsMayTouch",!1),I("readOnly",!1,function(L,k){k=="nocursor"&&(Sr(L),L.display.input.blur()),L.display.input.readOnlyChanged(k)}),I("screenReaderLabel",null,function(L,k){k=k===""?null:k,L.display.input.screenReaderLabelChanged(k)}),I("disableInput",!1,function(L,k){k||L.display.input.reset()},!0),I("dragDrop",!0,Ql),I("allowDropFileTypes",null),I("cursorBlinkRate",530),I("cursorScrollMargin",0),I("cursorHeight",1,tn,!0),I("singleCursorHeightPerLine",!0,tn,!0),I("workTime",100),I("workDelay",100),I("flattenSpans",!0,Ba,!0),I("addModeClass",!1,Ba,!0),I("pollInterval",100),I("undoDepth",200,function(L,k){return L.doc.history.undoDepth=k}),I("historyEventDelay",1250),I("viewportMargin",10,function(L){return L.refresh()},!0),I("maxHighlightLength",1e4,Ba,!0),I("moveInputWithCursor",!0,function(L,k){k||L.display.input.resetPosition()}),I("tabindex",null,function(L,k){return L.display.input.getField().tabIndex=k||""}),I("autofocus",null),I("direction","ltr",function(L,k){return L.doc.setDirection(k)},!0),I("phrases",null)}function Ql(e,u,I){var L=I&&I!=La;if(!u!=!L){var k=e.display.dragFunctions,Y=u?Be:lt;Y(e.display.scroller,"dragstart",k.start),Y(e.display.scroller,"dragenter",k.enter),Y(e.display.scroller,"dragover",k.over),Y(e.display.scroller,"dragleave",k.leave),Y(e.display.scroller,"drop",k.drop)}}function ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),qr(e)),wr(e),Hi(e),un(e),setTimeout(function(){return xa(e)},100)}function Pi(e,u){var I=this;if(!(this instanceof Pi))return new Pi(e,u);this.options=u=u?M(u):{},M(zs,u,!1);var L=u.value;typeof L=="string"?L=new Tr(L,u.mode,null,u.lineSeparator,u.direction):u.mode&&(L.modeOption=u.mode),this.doc=L;var k=new Pi.inputStyles[u.inputStyle](this),Y=this.display=new dl(e,L,k,u);Y.wrapper.CodeMirror=this,Hs(this),u.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Go(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new J,keySeq:null,specialChars:null},u.autofocus&&!i&&Y.input.focus(),A&&O<11&&setTimeout(function(){return I.display.input.reset(!0)},20),Zl(this),Ll(),ga(this),this.curOp.forceUpdate=!0,ts(this,L),u.autofocus&&!i||this.hasFocus()?setTimeout(function(){I.hasFocus()&&!I.state.focused&&fa(I)},20):Sr(this);for(var ue in fo)fo.hasOwnProperty(ue)&&fo[ue](this,u[ue],La);Yo(this),u.finishInit&&u.finishInit(this);for(var fe=0;fe20*20}Be(u.scroller,"touchstart",function(ge){if(!Ye(e,ge)&&!Y(ge)&&!Mo(e,ge)){u.input.ensurePolled(),clearTimeout(I);var Se=+new Date;u.activeTouch={start:Se,moved:!1,prev:Se-L.end<=300?L:null},ge.touches.length==1&&(u.activeTouch.left=ge.touches[0].pageX,u.activeTouch.top=ge.touches[0].pageY)}}),Be(u.scroller,"touchmove",function(){u.activeTouch&&(u.activeTouch.moved=!0)}),Be(u.scroller,"touchend",function(ge){var Se=u.activeTouch;if(Se&&!fi(u,ge)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var Je=e.coordsChar(u.activeTouch,"page"),et;!Se.prev||ue(Se,Se.prev)?et=new bi(Je,Je):!Se.prev.prev||ue(Se,Se.prev.prev)?et=e.findWordAt(Je):et=new bi(ht(Je.line,0),U(e.doc,ht(Je.line+1,0))),e.setSelection(et.anchor,et.head),e.focus(),be(ge)}k()}),Be(u.scroller,"touchcancel",k),Be(u.scroller,"scroll",function(){u.scroller.clientHeight&&(Ma(e,u.scroller.scrollTop),pa(e,u.scroller.scrollLeft,!0),qe(e,"scroll",e))}),Be(u.scroller,"mousewheel",function(ge){return Qo(e,ge)}),Be(u.scroller,"DOMMouseScroll",function(ge){return Qo(e,ge)}),Be(u.wrapper,"scroll",function(){return u.wrapper.scrollTop=u.wrapper.scrollLeft=0}),u.dragFunctions={enter:function(ge){Ye(e,ge)||Le(ge)},over:function(ge){Ye(e,ge)||(Rl(e,ge),Le(ge))},start:function(ge){return Al(e,ge)},drop:ir(e,Ol),leave:function(ge){Ye(e,ge)||Ts(e)}};var fe=u.input.getField();Be(fe,"keyup",function(ge){return Ns.call(e,ge)}),Be(fe,"keydown",ir(e,Ms)),Be(fe,"keypress",ir(e,Us)),Be(fe,"focus",function(ge){return fa(e,ge)}),Be(fe,"blur",function(ge){return Sr(e,ge)})}var No=[];Pi.defineInitHook=function(e){return No.push(e)};function Za(e,u,I,L){var k=e.doc,Y;I==null&&(I="add"),I=="smart"&&(k.mode.indent?Y=Ot(e,u).state:I="prev");var ue=e.options.tabSize,fe=ne(k,u),ge=G(fe.text,null,ue);fe.stateAfter&&(fe.stateAfter=null);var Se=fe.text.match(/^\s*/)[0],Je;if(!L&&!/\S/.test(fe.text))Je=0,I="not";else if(I=="smart"&&(Je=k.mode.indent(Y,fe.text.slice(Se.length),fe.text),Je==le||Je>150)){if(!L)return;I="prev"}I=="prev"?u>k.first?Je=G(ne(k,u-1).text,null,ue):Je=0:I=="add"?Je=ge+e.options.indentUnit:I=="subtract"?Je=ge-e.options.indentUnit:typeof I=="number"&&(Je=ge+I),Je=Math.max(0,Je);var et="",ft=0;if(e.options.indentWithTabs)for(var ut=Math.floor(Je/ue);ut;--ut)ft+=ue,et+=" ";if(ftue,ge=pt(u),Se=null;if(fe&&L.ranges.length>1)if($r&&$r.text.join(` `)==u){if(L.ranges.length%$r.text.length==0){Se=[];for(var Je=0;Je<$r.text.length;Je++)Se.push(Y.splitLines($r.text[Je]))}}else ge.length==L.ranges.length&&e.options.pasteLinesPerSelection&&(Se=Me(ge,function(qt){return[qt]}));for(var et=e.curOp.updateInput,ft=L.ranges.length-1;ft>=0;ft--){var ut=L.ranges[ft],Tt=ut.from(),Ut=ut.to();ut.empty()&&(I&&I>0?Tt=ht(Tt.line,Tt.ch-I):e.state.overwrite&&!fe?Ut=ht(Ut.line,Math.min(ne(Y,Ut.line).text.length,Ut.ch+Ke(ge).length)):fe&&$r&&$r.lineWise&&$r.text.join(` `)==ge.join(` `)&&(Tt=Ut=ht(Tt.line,0)));var Kt={from:Tt,to:Ut,text:Se?Se[ft%Se.length]:ge,origin:k||(fe?"paste":e.state.cutIncoming>ue?"cut":"+input")};Ta(e.doc,Kt),Xt(e,"inputRead",e,Kt)}u&&!fe&&Gs(e,u),Ea(e),e.curOp.updateInput<2&&(e.curOp.updateInput=et),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ks(e,u){var I=e.clipboardData&&e.clipboardData.getData("Text");if(I)return e.preventDefault(),!u.isReadOnly()&&!u.options.disableInput&&Pr(u,function(){return Uo(u,I,0,null,"paste")}),!0}function Gs(e,u){if(!e.options.electricChars||!e.options.smartIndent)return;for(var I=e.doc.sel,L=I.ranges.length-1;L>=0;L--){var k=I.ranges[L];if(k.head.ch>100||L&&I.ranges[L-1].head.line==k.head.line)continue;var Y=e.getModeAt(k.head),ue=!1;if(Y.electricChars){for(var fe=0;fe-1){ue=Za(e,k.head.line,"smart");break}}else Y.electricInput&&(Y.electricInput.test(ne(e.doc,k.head.line).text.slice(0,k.head.ch))&&(ue=Za(e,k.head.line,"smart")));ue&&Xt(e,"electricInput",e,k.head.line)}}function Vs(e){for(var u=[],I=[],L=0;LY&&(Za(this,fe.head.line,L,!0),Y=fe.head.line,ue==this.doc.sel.primIndex&&Ea(this));else{var ge=fe.from(),Se=fe.to(),Je=Math.max(Y,ge.line);Y=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var et=Je;et0&&Ro(this.doc,ue,new bi(ge,ft[ue].to()),de)}}}),getTokenAt:function(L,k){return Bn(this,L,k)},getLineTokens:function(L,k){return Bn(this,ht(L),k,!0)},getTokenTypeAt:function(L){L=U(this.doc,L);var k=yt(this,ne(this.doc,L.line)),Y=0,ue=(k.length-1)/2,fe=L.ch,ge;if(fe==0)ge=k[2];else for(;;){var Se=Y+ue>>1;if((Se?k[Se*2-1]:0)>=fe)ue=Se;else if(k[Se*2+1]ge&&(L=ge,ue=!0),fe=ne(this.doc,L)}else fe=L;return Tn(this,fe,{top:0,left:0},k||"page",Y||ue).top+(ue?this.doc.height-xr(fe):0)},defaultTextHeight:function(){return xn(this.display)},defaultCharWidth:function(){return Xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(L,k,Y,ue,fe){var ge=this.display;L=ri(this,U(this.doc,L));var Se=L.bottom,Je=L.left;if(k.style.position="absolute",k.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(k),ge.sizer.appendChild(k),ue=="over")Se=L.top;else if(ue=="above"||ue=="near"){var et=Math.max(ge.wrapper.clientHeight,this.doc.height),ft=Math.max(ge.sizer.clientWidth,ge.lineSpace.clientWidth);(ue=="above"||L.bottom+k.offsetHeight>et)&&L.top>k.offsetHeight?Se=L.top-k.offsetHeight:L.bottom+k.offsetHeight<=et&&(Se=L.bottom),Je+k.offsetWidth>ft&&(Je=ft-k.offsetWidth)}k.style.top=Se+"px",k.style.left=k.style.right="",fe=="right"?(Je=ge.sizer.clientWidth-k.offsetWidth,k.style.right="0px"):(fe=="left"?Je=0:fe=="middle"&&(Je=(ge.sizer.clientWidth-k.offsetWidth)/2),k.style.left=Je+"px"),Y&&vo(this,{left:Je,top:Se,right:Je+k.offsetWidth,bottom:Se+k.offsetHeight})},triggerOnKeyDown:br(Ms),triggerOnKeyPress:br(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:br(js),execCommand:function(L){if($a.hasOwnProperty(L))return $a[L].call(null,this)},triggerElectric:br(function(L){Gs(this,L)}),findPosH:function(L,k,Y,ue){var fe=1;k<0&&(fe=-1,k=-k);for(var ge=U(this.doc,L),Se=0;Se0&&Je(Y.charAt(ue-1));)--ue;for(;fe.5||this.options.lineWrapping)&&wr(this),qe(this,"refresh",this)}),swapDoc:br(function(L){var k=this.doc;return k.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),un(this),this.display.input.reset(),Pa(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,Xt(this,"swapDoc",this,k),k}),phrase:function(L){var k=this.options.phrases;return k&&Object.prototype.hasOwnProperty.call(k,L)?k[L]:L},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ke(e),e.registerHelper=function(L,k,Y){I.hasOwnProperty(L)||(I[L]=e[L]={_global:[]}),I[L][k]=Y},e.registerGlobalHelper=function(L,k,Y,ue){e.registerHelper(L,k,ue),I[L]._global.push({pred:Y,val:ue})}}function jo(e,u,I,L,k){var Y=u,ue=I,fe=ne(e,u.line),ge=k&&e.direction=="rtl"?-I:I;function Se(){var on=u.line+ge;return on=e.first+e.size?!1:(u=new ht(on,u.ch,u.sticky),fe=ne(e,on))}function Je(on){var Zt;if(L=="codepoint"){var dn=fe.text.charCodeAt(u.ch+(L>0?0:-1));isNaN(dn)?Zt=null:Zt=new ht(u.line,Math.max(0,Math.min(fe.text.length,u.ch+I*(dn>=55296&&dn<56320?2:1))),-I)}else k?Zt=Ml(e.cm,fe,u,I):Zt=Io(fe,u,I);if(Zt==null)if(!on&&Se())u=Do(k,e.cm,fe,u.line,ge);else return!1;else u=Zt;return!0}if(L=="char"||L=="codepoint")Je();else if(L=="column")Je(!0);else if(L=="word"||L=="group")for(var et=null,ft=L=="group",ut=e.cm&&e.cm.getHelper(u,"wordChars"),Tt=!0;!(I<0&&!Je(!Tt));Tt=!1){var Ut=fe.text.charAt(u.ch)||` `,Kt=He(Ut,ut)?"w":ft&&Ut==` `?"n":!ft||/\s/.test(Ut)?null:"p";if(ft&&!Tt&&!Kt&&(Kt="s"),et&&et!=Kt){I<0&&(I=1,Je(),u.sticky="after");break}if(Kt&&(et=Kt),I>0&&!Je(!Tt))break}var qt=so(e,u,Y,ue,!0);return sn(Y,qt)&&(qt.hitSide=!0),qt}function $s(e,u,I,L){var k=e.doc,Y=u.left,ue;if(L=="page"){var fe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ge=Math.max(fe-.5*xn(e.display),3);ue=(I>0?u.bottom:u.top)+I*ge}else L=="line"&&(ue=I>0?u.bottom+3:u.top-3);for(var Se;!(Se=kr(e,Y,ue),!Se.outside);){if(I<0?ue<=0:ue>=k.height){Se.hitSide=!0;break}ue+=I*5}return Se}var Ti=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ti.prototype.init=function(e){var u=this,I=this,L=I.cm,k=I.div=e.lineDiv;Xs(k,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function Y(fe){for(var ge=fe.target;ge;ge=ge.parentNode){if(ge==k)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ge.className))break}return!1}Be(k,"paste",function(fe){if(!Y(fe)||Ye(L,fe)||Ks(fe,L))return;O<=11&&setTimeout(ir(L,function(){return u.updateFromDOM()}),20)}),Be(k,"compositionstart",function(fe){u.composing={data:fe.data,done:!1}}),Be(k,"compositionupdate",function(fe){u.composing||(u.composing={data:fe.data,done:!1})}),Be(k,"compositionend",function(fe){u.composing&&(fe.data!=u.composing.data&&u.readFromDOMSoon(),u.composing.done=!0)}),Be(k,"touchstart",function(){return I.forceCompositionEnd()}),Be(k,"input",function(){u.composing||u.readFromDOMSoon()});function ue(fe){if(!Y(fe)||Ye(L,fe))return;if(L.somethingSelected())po({lineWise:!1,text:L.getSelections()}),fe.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ge=Vs(L);po({lineWise:!0,text:ge.text}),fe.type=="cut"&&L.operation(function(){L.setSelections(ge.ranges,0,de),L.replaceSelection("",null,"cut")})}else return;if(fe.clipboardData){fe.clipboardData.clearData();var Se=$r.text.join(` `);if(fe.clipboardData.setData("Text",Se),fe.clipboardData.getData("Text")==Se){fe.preventDefault();return}}var Je=Ys(),et=Je.firstChild;L.display.lineSpace.insertBefore(Je,L.display.lineSpace.firstChild),et.value=$r.text.join(` `);var ft=document.activeElement;q(et),setTimeout(function(){L.display.lineSpace.removeChild(Je),ft.focus(),ft==k&&I.showPrimarySelection()},50)}Be(k,"copy",ue),Be(k,"cut",ue)},Ti.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ti.prototype.prepareSelection=function(){var e=Pn(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ti.prototype.showSelection=function(e,u){if(!e||!this.cm.display.view.length)return;(e.focus||u)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ti.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ti.prototype.showPrimarySelection=function(){var e=this.getSelection(),u=this.cm,I=u.doc.sel.primary(),L=I.from(),k=I.to();if(u.display.viewTo==u.display.viewFrom||L.line>=u.display.viewTo||k.line=u.display.viewFrom&&Js(u,L)||{node:fe[0].measure.map[2],offset:0},Se=k.linee.firstLine()&&(L=ht(L.line-1,ne(e.doc,L.line-1).length)),k.ch==ne(e.doc,k.line).text.length&&k.lineu.viewTo-1)return!1;var Y,ue,fe;L.line==u.viewFrom||(Y=tr(e,L.line))==0?(ue=Qe(u.view[0].line),fe=u.view[0].node):(ue=Qe(u.view[Y].line),fe=u.view[Y-1].node.nextSibling);var ge=tr(e,k.line),Se,Je;if(ge==u.view.length-1?(Se=u.viewTo-1,Je=u.lineDiv.lastChild):(Se=Qe(u.view[ge+1].line)-1,Je=u.view[ge+1].node.previousSibling),!fe)return!1;for(var et=e.doc.splitLines(nu(e,fe,Je,ue,Se)),ft=oe(e.doc,ht(ue,0),ht(Se,ne(e.doc,Se).text.length));et.length>1&&ft.length>1;)if(Ke(et)==Ke(ft))et.pop(),ft.pop(),Se--;else if(et[0]==ft[0])et.shift(),ft.shift(),ue++;else break;for(var ut=0,Tt=0,Ut=et[0],Kt=ft[0],qt=Math.min(Ut.length,Kt.length);utL.ch&&on.charCodeAt(on.length-Tt-1)==Zt.charCodeAt(Zt.length-Tt-1);)ut--,Tt++;et[et.length-1]=on.slice(0,on.length-Tt).replace(/^\u200b+/,""),et[0]=et[0].slice(ut).replace(/\u200b+$/,"");var On=ht(ue,ut),yn=ht(Se,ft.length?Ke(ft).length-Tt:0);if(et.length>1||et[0]||Dt(On,yn))return Ca(e.doc,et,On,yn,"+input"),!0},Ti.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ti.prototype.reset=function(){this.forceCompositionEnd()},Ti.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ti.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Ti.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pr(this.cm,function(){return Hi(e.cm)})},Ti.prototype.setUneditable=function(e){e.contentEditable="false"},Ti.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ir(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ti.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ti.prototype.onContextMenu=function(){},Ti.prototype.resetPosition=function(){},Ti.prototype.needsContentAttribute=!0;function Js(e,u){var I=yi(e,u.line);if(!I||I.hidden)return null;var L=ne(e.doc,u.line),k=Vt(I,L,u.line),Y=dt(L,e.doc.direction),ue="left";if(Y){var fe=xe(Y,u.ch);ue=fe%2?"right":"left"}var ge=gn(k.map,u.ch,ue);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var u=e;u;u=u.parentNode)if(/CodeMirror-gutter-wrapper/.test(u.className))return!0;return!1}function Ia(e,u){return u&&(e.bad=!0),e}function nu(e,u,I,L,k){var Y="",ue=!1,fe=e.doc.lineSeparator(),ge=!1;function Se(ut){return function(Tt){return Tt.id==ut}}function Je(){ue&&(Y+=fe,ge&&(Y+=fe),ue=ge=!1)}function et(ut){ut&&(Je(),Y+=ut)}function ft(ut){if(ut.nodeType==1){var Tt=ut.getAttribute("cm-text");if(Tt){et(Tt);return}var Ut=ut.getAttribute("cm-marker"),Kt;if(Ut){var qt=e.findMarks(ht(L,0),ht(k+1,0),Se(+Ut));qt.length&&(Kt=qt[0].find(0))&&et(oe(e.doc,Kt.from,Kt.to).join(fe));return}if(ut.getAttribute("contenteditable")=="false")return;var on=/^(pre|div|p|li|table|br)$/i.test(ut.nodeName);if(!/^br$/i.test(ut.nodeName)&&ut.textContent.length==0)return;on&&Je();for(var Zt=0;Zt=9&&u.hasSelection&&(u.hasSelection=null),I.poll()}),Be(k,"paste",function(ue){if(Ye(L,ue)||Ks(ue,L))return;L.state.pasteIncoming=+new Date,I.fastPoll()});function Y(ue){if(Ye(L,ue))return;if(L.somethingSelected())po({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var fe=Vs(L);po({lineWise:!0,text:fe.text}),ue.type=="cut"?L.setSelections(fe.ranges,null,de):(I.prevInput="",k.value=fe.text.join(` `),q(k))}else return;ue.type=="cut"&&(L.state.cutIncoming=+new Date)}Be(k,"cut",Y),Be(k,"copy",Y),Be(e.scroller,"paste",function(ue){if(fi(e,ue)||Ye(L,ue))return;if(!k.dispatchEvent){L.state.pasteIncoming=+new Date,I.focus();return}var fe=new Event("paste");fe.clipboardData=ue.clipboardData,k.dispatchEvent(fe)}),Be(e.lineSpace,"selectstart",function(ue){fi(e,ue)||be(ue)}),Be(k,"compositionstart",function(){var ue=L.getCursor("from");I.composing&&I.composing.range.clear(),I.composing={start:ue,range:L.markText(ue,L.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(k,"compositionend",function(){I.composing&&(I.poll(),I.composing.range.clear(),I.composing=null)})},Ki.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Ki.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ki.prototype.prepareSelection=function(){var e=this.cm,u=e.display,I=e.doc,L=Pn(e);if(e.options.moveInputWithCursor){var k=ri(e,I.sel.primary().head,"div"),Y=u.wrapper.getBoundingClientRect(),ue=u.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(u.wrapper.clientHeight-10,k.top+ue.top-Y.top)),L.teLeft=Math.max(0,Math.min(u.wrapper.clientWidth-10,k.left+ue.left-Y.left))}return L},Ki.prototype.showSelection=function(e){var u=this.cm,I=u.display;h(I.cursorDiv,e.cursors),h(I.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ki.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var u=this.cm;if(u.somethingSelected()){this.prevInput="";var I=u.getSelection();this.textarea.value=I,u.state.focused&&q(this.textarea),A&&O>=9&&(this.hasSelection=I)}else e||(this.prevInput=this.textarea.value="",A&&O>=9&&(this.hasSelection=null))},Ki.prototype.getField=function(){return this.textarea},Ki.prototype.supportsTouch=function(){return!1},Ki.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ki.prototype.blur=function(){this.textarea.blur()},Ki.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ki.prototype.receivedFocus=function(){this.slowPoll()},Ki.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ki.prototype.fastPoll=function(){var e=!1,u=this;u.pollingFast=!0;function I(){var L=u.poll();!L&&!e?(e=!0,u.polling.set(60,I)):(u.pollingFast=!1,u.slowPoll())}u.polling.set(20,I)},Ki.prototype.poll=function(){var e=this,u=this.cm,I=this.textarea,L=this.prevInput;if(this.contextMenuPending||!u.state.focused||gt(I)&&!L&&!this.composing||u.isReadOnly()||u.options.disableInput||u.state.keySeq)return!1;var k=I.value;if(k==L&&!u.somethingSelected())return!1;if(A&&O>=9&&this.hasSelection===k||t&&/[\uf700-\uf7ff]/.test(k))return u.display.input.reset(),!1;if(u.doc.sel==u.display.selForContextMenu){var Y=k.charCodeAt(0);if(Y==8203&&!L&&(L="\u200B"),Y==8666)return this.reset(),this.cm.execCommand("undo")}for(var ue=0,fe=Math.min(L.length,k.length);ue1e3||k.indexOf(` `)>-1?I.value=e.prevInput="":e.prevInput=k,e.composing&&(e.composing.range.clear(),e.composing.range=u.markText(e.composing.start,u.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ki.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ki.prototype.onKeyPress=function(){A&&O>=9&&(this.hasSelection=null),this.fastPoll()},Ki.prototype.onContextMenu=function(e){var u=this,I=u.cm,L=I.display,k=u.textarea;u.contextMenuPending&&u.contextMenuPending();var Y=yr(I,e),ue=L.scroller.scrollTop;if(!Y||s)return;var fe=I.options.resetSelectionOnContextMenu;fe&&I.doc.sel.contains(Y)==-1&&ir(I,mr)(I.doc,sa(Y),de);var ge=k.style.cssText,Se=u.wrapper.style.cssText,Je=u.wrapper.offsetParent.getBoundingClientRect();u.wrapper.style.cssText="position: static",k.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Je.top-5)+"px; left: "+(e.clientX-Je.left-5)+`px; z-index: 1000; background: `+(A?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var et;f&&(et=window.scrollY),L.input.focus(),f&&window.scrollTo(null,et),L.input.reset(),I.somethingSelected()||(k.value=u.prevInput=" "),u.contextMenuPending=ut,L.selForContextMenu=I.doc.sel,clearTimeout(L.detectingSelectAll);function ft(){if(k.selectionStart!=null){var Ut=I.somethingSelected(),Kt="\u200B"+(Ut?k.value:"");k.value="\u21DA",k.value=Kt,u.prevInput=Ut?"":"\u200B",k.selectionStart=1,k.selectionEnd=Kt.length,L.selForContextMenu=I.doc.sel}}function ut(){if(u.contextMenuPending!=ut)return;if(u.contextMenuPending=!1,u.wrapper.style.cssText=Se,k.style.cssText=ge,A&&O<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=ue),k.selectionStart!=null){(!A||A&&O<9)&&ft();var Ut=0,Kt=function(){L.selForContextMenu==I.doc.sel&&k.selectionStart==0&&k.selectionEnd>0&&u.prevInput=="\u200B"?ir(I,ps)(I):Ut++<10?L.detectingSelectAll=setTimeout(Kt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(Kt,200)}}if(A&&O>=9&&ft(),g){Le(e);var Tt=function(){lt(window,"mouseup",Tt),setTimeout(ut,20)};Be(window,"mouseup",Tt)}else setTimeout(ut,50)},Ki.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ki.prototype.setUneditable=function(){},Ki.prototype.needsContentAttribute=!1;function ru(e,u){if(u=u?M(u):{},u.value=e.value,!u.tabindex&&e.tabIndex&&(u.tabindex=e.tabIndex),!u.placeholder&&e.placeholder&&(u.placeholder=e.placeholder),u.autofocus==null){var I=N();u.autofocus=I==e||e.getAttribute("autofocus")!=null&&I==document.body}function L(){e.value=fe.getValue()}var k;if(e.form&&(Be(e.form,"submit",L),!u.leaveSubmitMethodAlone)){var Y=e.form;k=Y.submit;try{var ue=Y.submit=function(){L(),Y.submit=k,Y.submit(),Y.submit=ue}}catch(ge){}}u.finishInit=function(ge){ge.save=L,ge.getTextArea=function(){return e},ge.toTextArea=function(){ge.toTextArea=isNaN,L(),e.parentNode.removeChild(ge.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",L),!u.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=k))}},e.style.display="none";var fe=Pi(function(ge){return e.parentNode.insertBefore(ge,e.nextSibling)},u);return fe}function au(e){e.off=lt,e.on=Be,e.wheelEventPixels=hl,e.Doc=Tr,e.splitLines=pt,e.countColumn=G,e.findColumn=Ie,e.isWordChar=We,e.Pass=le,e.signal=qe,e.Line=_r,e.changeEnd=la,e.scrollbarModel=Ko,e.Pos=ht,e.cmpPos=Dt,e.modes=vt,e.mimeModes=st,e.resolveMode=Ze,e.getMode=mt,e.modeExtensions=Lt,e.extendMode=Mt,e.copyState=$t,e.startState=ve,e.innerMode=Re,e.commands=$a,e.keyMap=ta,e.keyName=Ls,e.isModifierKey=As,e.lookupKey=Aa,e.normalizeKeyMap=Pl,e.StringStream=X,e.SharedTextMarker=Va,e.TextMarker=ca,e.LineWidget=Ga,e.e_preventDefault=be,e.e_stopPropagation=Ce,e.e_stop=Le,e.addClass=F,e.contains=R,e.rmClass=_,e.keyNames=da}Jl(Pi),eu(Pi);var ou="iter insert remove copy getEditor constructor".split(" ");for(var go in Tr.prototype)Tr.prototype.hasOwnProperty(go)&&K(ou,go)<0&&(Pi.prototype[go]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tr.prototype[go]));return ke(Tr),Pi.inputStyles={textarea:Ki,contenteditable:Ti},Pi.defineMode=function(e){!Pi.defaults.mode&&e!="null"&&(Pi.defaults.mode=e),It.apply(this,arguments)},Pi.defineMIME=Pt,Pi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pi.defineMIME("text/plain","null"),Pi.defineExtension=function(e,u){Pi.prototype[e]=u},Pi.defineDocExtension=function(e,u){Tr.prototype[e]=u},Pi.fromTextArea=ru,au(Pi),Pi.version="5.58.2",Pi})},W7jJ:function(nt,Xe,V){"use strict";V.r(Xe);var ce=V("0Owb"),ie=V("PpiC"),W=V("OaEy"),C=V("2fM7"),D=V("T2oS"),T=V("W9HT"),A=V("miYZ"),O=V("tsqr"),f=V("2qtc"),p=V("kLXV"),c=V("9og8"),s=V("tJVT"),n=V("k1fw"),o=V("aHsQ"),r=V("sGsY"),l=V("WmNS"),a=V.n(l),i=V("cDcd"),t=V.n(i),d=V("Fvcw"),v=V("GIiI"),y=V("Ty5D"),b=V("9kvl"),g=V("55Ip"),m=V("7qur"),_=V("cDPC"),x=V("m3rI"),h=V("RCxd"),E=V("EHPI"),S=V("J66h"),w=V("uMZB"),R=V.n(w),N=V("sNtx"),F=V("RpDr"),z=V("+L6B"),q=V("2/Rp"),B=V("y8nQ"),M=V("Vl3Y"),G=V("5NDa"),J=V("5rEg"),K=J.a.TextArea,Z=5e3,le=function(ct){var xt=ct.callback,zt=ct.onCancel,Ht=ct.notes;function en(Xt){xt(Xt)}return t.a.createElement(M.a,{className:"note-form-panel",onFinish:en,initialValues:{notes:Ht}},t.a.createElement(M.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:Z,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(Z)}]},t.a.createElement(K,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),t.a.createElement(M.a.Item,{style:{textAlign:"right"}},t.a.createElement(q.a,{type:"ghost",onClick:zt,style:{marginRight:10}}," \u53D6\u6D88 "),t.a.createElement(q.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},de=V("ZsLC"),Te=V.n(de),we=V("DjyN"),Ie=V("NUBc"),_e=V("g9YV"),ye=V("wCAj"),Ke=V("Hw79"),Me=V.n(Ke),Fe=V("ye1Q"),Ge=V("lfch"),Ee=V("bdLU"),me=V("1vsH"),We=V("wd/R"),He=V.n(We),it=ye.a.Column,re=function(ct){var xt=ct.submitResult,zt=ct.submitting,Ht=ct.submitRecords,en=ct.page,Xt=ct.onPageChange,Et=ct.topicId,bt=xt||{},Jt=bt.status,wt=bt.id,cn=bt.input,Ft=bt.output,pn=bt.expected_output,Yn=bt.is_file,Ln=bt.input_file_url,Sn=bt.output_file_url,Zn=bt.expected_output_file_url,In=bt.error_msg,$n=Ht||{},Kn=$n.records,fi=$n.records_count,ti=Object(y.i)();function Ei(){Yn?navigator.clipboard.writeText(S.Base64.decode(In)).then(function(){O.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(S.Base64.decode(Ft)).then(function(){O.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return t.a.createElement(T.a,{spinning:zt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:t.a.createElement(Fe.a,{style:{fontSize:24},spin:!0})},wt?t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:Me.a.info},t.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",t.a.createElement("span",{className:Jt===Ee.a.OK?"c-green":"c-red"},F.a[Jt])),t.a.createElement("li",{className:Me.a.error},t.a.createElement("a",{onClick:Ei},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",t.a.createElement(Ge.a,null)," ")),t.a.createElement("li",null,t.a.createElement(g.a,{to:"/problems/".concat(Et,"/record-detail/").concat(wt,"?backId=").concat(ti==null?void 0:ti.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Jt!==Ee.a.OK?t.a.createElement(t.a.Fragment,null,t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),t.a.createElement("pre",null,!Yn&&cn,Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.y)(Ln,cn)}},cn)),t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,(Jt===4||Jt===5)&&S.Base64.decode(In),Jt!=4&&Jt!=5&&(Yn?t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.y)(Sn,Ft)}},Ft):S.Base64.decode(Ft))),t.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,!Yn&&S.Base64.decode(pn),Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.y)(Zn,pn)}},pn))):null):null,(Kn==null?void 0:Kn.length)>0?t.a.createElement(ye.a,{dataSource:Kn,rowKey:"id",pagination:!1},t.a.createElement(it,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(ui,jn){return t.a.createElement("span",null," ",He()(ui).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(it,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(ui,jn){var si;return t.a.createElement(g.a,{className:ui===0?"c-green":"c-red",to:"/problems/".concat(Et,"/record-detail/").concat(jn.id,"?backId=").concat(ti==null?void 0:ti.save_identifier)},(si=F.a[ui])===null||si===void 0?void 0:si.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),t.a.createElement(it,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),t.a.createElement(it,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),t.a.createElement(it,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,fi>15?t.a.createElement(Ie.a,{className:Me.a.pagination,current:en,pageSize:15,total:fi,onChange:Xt}):null)},P=V("BdwD"),j=V("DYRE"),ee=V("zeV3"),$=V("+BJd"),Q=V("mr32"),xe=V("TcMa"),De=V.n(xe),dt=V("9Bee"),Ne={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Be=function(ct){var xt=ct.hack,zt=ct.onTriggerPraise,Ht=ct.toDiscuss,en=xt.language,Xt=xt.difficulty,Et=xt.time_limit,bt=xt.username,Jt=xt.user_path,wt=xt.user_praise,cn=xt.comments_count,Ft=xt.praises_count,pn=xt.description,Yn=xt.pass_count,Ln=xt.submit_count,Sn=Object(y.h)();console.log(xt.language,"language");var Zn=Ne[Xt];return t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:De.a.info},t.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",t.a.createElement(Q.a,{color:Zn.color},Zn.name)),t.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",t.a.createElement("b",null,Et,"\u79D2"))),t.a.createElement(dt.a,{value:pn,className:De.a.desc}),t.a.createElement("ul",{className:De.a["commit-info"]},t.a.createElement("li",null,t.a.createElement(ee.a,{size:4},t.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",t.a.createElement("b",null,Yn))),t.a.createElement("li",null,t.a.createElement(ee.a,{size:4},t.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",t.a.createElement("b",null,Ln))," "),t.a.createElement("li",{style:{flex:"1 0 0"}}),t.a.createElement("li",null,t.a.createElement(ee.a,{size:4},t.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ht})," ",t.a.createElement("b",null,cn))," ")))},tt=V("dhSg"),lt=V("ps8w"),qe=V.n(lt),Ye=V("oBTY"),je=V("M8RZ"),Ue=V("OkW/"),ke=V("ErOA");function be(ct){return Object(ke.c)("comments.json",ct)}function Ce(ct){return Object(ke.f)("/discusses/".concat(ct,"/plus.json"),{container_type:"Discuss",type:1})}function Pe(ct){return Object(ke.f)("comments/reply.json",ct)}function Le(ct){return Object(ke.f)("comments.json",ct)}function Ve(ct){return Object(ke.f)("comments/".concat(ct==null?void 0:ct.id,"/hidden.json"),ct)}function at(ct){return Object(ke.b)("comments/".concat(ct==null?void 0:ct.id,".json"))}var _t=V("GgEA"),kt=V("AMnG"),Bt=V("xKgJ");function jt(ct){var xt=ct.author;return t.a.createElement("a",{href:"/users/".concat(xt.login),target:"_blank"},t.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(x.a.IMG_SERVER,"/images/").concat(xt.image_url),width:"50"}))}function At(ct){var xt=ct.data,zt=ct.index,Ht=ct.parentDiscussIndex,en=ct.user,Xt=ct.onSetActionType,Et=xt.author,bt=xt.can_delete,Jt=xt.content,wt=xt.id,cn=xt.time;function Ft(){Xt({id:wt,index:zt,type:"delete-discuss",parentDiscussIndex:Ht,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var pn=en.admin||bt||Et.user_id===en.user_id;return t.a.createElement("div",{className:"discuss-item-container second-discuss "},t.a.createElement(jt,{author:Et}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Et.login),target:"_blank"},Et.name),t.a.createElement("span",{className:"grey"},cn),t.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},pn?t.a.createElement("a",{onClick:Ft,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),t.a.createElement(dt.a,{className:"discuss-content",value:Jt})))}var pt=function(ct){var xt=ct.user,zt=ct.data,Ht=ct.index,en=ct.onPlusDiscuss,Xt=ct.onSetActionType,Et=ct.activeDiscussIndex,bt=ct.onReplyDiscuss,Jt=ct.onSetActiveDiscussIndex,wt=zt.content,cn=zt.children,Ft=zt.hidden,pn=zt.id,Yn=zt.praise_count,Ln=zt.time,Sn=zt.user_praise,Zn=zt.can_delete,In=zt.author;console.log(Zn&&(!cn||cn.length==0),"children22");function $n(){Jt(pn)}function Kn(){en(pn,!Sn,Ht)}function fi(){Xt({id:pn,index:Ht,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function ti(){Xt({id:pn,index:Ht,params:{hidden:Ft?"0":"1"},type:"hidden-discuss",message:Ft?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var Ei=xt.admin||xt.user_id===In.user_id;return t.a.createElement("div",{className:"discuss-item-container",key:pn},t.a.createElement(jt,{author:In}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(In.login),target:"_blank"}," ",In.name," "),t.a.createElement("span",{className:"grey"},Ln)),t.a.createElement(dt.a,{className:"discuss-content",value:wt}),cn&&cn.length>0?t.a.createElement("div",{className:"reply-discuss-container"},cn.map(function(Ci,ui){return t.a.createElement(At,{key:Ci.id,data:Ci,index:ui,user:xt,onSetActionType:Xt,parentDiscussIndex:Ht})})):null,t.a.createElement("div",{className:"btn-group"},Object(Bt.v)()?t.a.createElement("a",{onClick:ti,title:Ft?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},t.a.createElement("i",{className:Ft?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Zn&&(!cn||cn.length==0)?t.a.createElement("a",{onClick:fi,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null,t.a.createElement("a",{onClick:$n,title:"\u56DE\u590D"}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," "),t.a.createElement("a",{onClick:Kn,className:Sn?"c-orange":""},t.a.createElement("i",{className:Sn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),t.a.createElement("span",null,Yn||""))),t.a.createElement(kt.a,{id:pn,activeDiscussIndex:Et,onReplyDiscuss:bt})))},gt=V("kaH+"),rt=V("Wx9E"),Oe=V("Ot1p"),ze=function(ct){var xt=ct.user_praise,zt=ct.praise_count,Ht=ct.praisePlus,en=ct.onCreateDiscuss,Xt=ct.discuss_count,Et=Object(i.useState)(!1),bt=Object(s.a)(Et,2),Jt=bt[0],wt=bt[1],cn=Object(i.useState)(""),Ft=Object(s.a)(cn,2),pn=Ft[0],Yn=Ft[1];function Ln(Kn){Yn(Kn)}function Sn(){wt(!0)}function Zn(){wt(!1)}function In(){return $n.apply(this,arguments)}function $n(){return $n=Object(c.a)(a.a.mark(function Kn(){return a.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:en(pn),Yn(""),wt(!1);case 3:case"end":return ti.stop()}},Kn)})),$n.apply(this,arguments)}return t.a.createElement("div",{className:"dis-input-editor-container ".concat(Jt?"active":""," ")},t.a.createElement("div",{className:Jt?"text-area hide":"text-area"},t.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Sn}),t.a.createElement("a",{style:{alignItems:"center"}}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Xt," "),t.a.createElement("a",{className:"c-light-black",onClick:Ht,style:{alignItems:"center"},title:xt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},t.a.createElement("i",{className:"mr3 ".concat(xt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),zt?t.a.createElement("span",null,zt):"")),Jt?t.a.createElement("div",{className:"input-mask",onClick:Zn}):null,t.a.createElement("div",{className:Jt?"md-container":"md-container hide"},t.a.createElement(Oe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:pn,height:240,onChange:Ln}),t.a.createElement("div",{className:"tip-container",onClick:Zn},t.a.createElement("a",{className:"btn-send",onClick:In}," \u53D1\u9001 "))))},vt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},st;(function(ct){ct[ct.GET_DISCUSSES=0]="GET_DISCUSSES",ct[ct.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",ct[ct.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",ct[ct.PLUS_DISCUSS=3]="PLUS_DISCUSS",ct[ct.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",ct[ct.SET_PAGE=5]="SET_PAGE",ct[ct.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(st||(st={}));function It(ct,xt){switch(xt.type){case st.SHOW_DISCUSSES_LOADING:return Object(n.a)(Object(n.a)({},ct),{},{loading:!0});case st.GET_DISCUSSES:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.TOP_OR_DOWN_DISCUSS:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.SET_ACTION_TYPE:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.PLUS_DISCUSS:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.SET_PAGE:return Object(n.a)(Object(n.a)({},ct),{},{page:xt.payload});case st.ACTIVE_DISCUSS_INDEX:return Object(n.a)(Object(n.a)({},ct),xt.payload);default:throw new Error}}var Pt=function(ct){var xt=ct.user,zt=ct.identifier,Ht=ct.hack,en=ct.onTriggerPraise,Xt=ct.setDiscussTotal,Et=Object(i.useReducer)(It,vt),bt=Object(s.a)(Et,2),Jt=bt[0],wt=bt[1],cn=Jt.loading,Ft=Jt.page,pn=Jt.data,Yn=Jt.count,Ln=Jt.actionType,Sn=Jt.activeDiscussIndex,Zn=Object(i.useCallback)(Object(c.a)(a.a.mark(function _n(){var ci,yi,li;return a.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return wt({type:st.SHOW_DISCUSSES_LOADING}),Jn.next=3,be({container_type:"Practice",container_identifier:zt,limit:10,page:Ft});case 3:ci=Jn.sent,yi=ci.comments,li=ci.disscuss_count,wt({type:st.GET_DISCUSSES,payload:{data:yi,count:li,loading:!1}}),Xt(li);case 7:case"end":return Jn.stop()}},_n)})),[Ft,zt]);Object(i.useEffect)(function(){Zn()},[zt,Ft]);function In(_n){wt({type:st.SET_PAGE,page:_n})}function $n(_n){wt({type:st.SET_ACTION_TYPE,payload:{actionType:_n}})}function Kn(_n){Sn===_n?wt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):wt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:_n}})}function fi(_n,ci,yi){return ti.apply(this,arguments)}function ti(){return ti=Object(c.a)(a.a.mark(function _n(ci,yi,li){var Dn;return a.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.prev=0,gn.next=3,Ce(ci);case 3:Dn=gn.sent,pn[li].user_praise=yi,pn[li].praise_count=Dn.praise_count,wt({type:st.PLUS_DISCUSS,payload:{data:Object(Ye.a)(pn)}}),gn.next=12;break;case 9:gn.prev=9,gn.t0=gn.catch(0),console.log(gn.t0);case 12:case"end":return gn.stop()}},_n,null,[[0,9]])})),ti.apply(this,arguments)}function Ei(){return Ci.apply(this,arguments)}function Ci(){return Ci=Object(c.a)(a.a.mark(function _n(){var ci,yi,li,Dn,Jn;return a.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if(ci=Ln.id,yi=Ln.params,li=Ln.type,Dn=Ln.index,Jn=Ln.parentDiscussIndex,!(li==="hidden-discuss")){An.next=7;break}return console.log(yi,"params"),An.next=5,Ve(Object(n.a)({id:ci,container_type:"Practice",container_identifier:zt},yi));case 5:Jn?pn[Jn].children[Dn].hidden=yi.hidden==1:pn[Dn].hidden=yi.hidden==1,wt({type:st.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Ye.a)(pn)}});case 7:if(!(li==="delete-discuss")){An.next=13;break}return An.next=10,at({id:ci,container_type:"Practice",container_identifier:zt});case 10:return wt({type:st.SET_ACTION_TYPE,payload:{actionType:null}}),An.next=13,Zn();case 13:case"end":return An.stop()}},_n)})),Ci.apply(this,arguments)}function ui(){wt({type:st.SET_ACTION_TYPE,payload:{actionType:null}})}function jn(_n,ci){return si.apply(this,arguments)}function si(){return si=Object(c.a)(a.a.mark(function _n(ci,yi){return a.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return Dn.prev=0,Dn.next=3,Pe({container_type:"Practice",container_identifier:zt,comments:{content:yi,parent_id:ci}});case 3:Zn(),Dn.next=9;break;case 6:Dn.prev=6,Dn.t0=Dn.catch(0),console.log(Dn.t0);case 9:case"end":return Dn.stop()}},_n,null,[[0,6]])})),si.apply(this,arguments)}function Fn(_n){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(c.a)(a.a.mark(function _n(ci){return a.a.wrap(function(li){for(;;)switch(li.prev=li.next){case 0:return wt({type:st.SHOW_DISCUSSES_LOADING}),li.next=3,Le({comments:{content:ci},container_type:"Practice",container_identifier:zt});case 3:Zn();case 4:case"end":return li.stop()}},_n)})),Vt.apply(this,arguments)}return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:"discuss-panel"},pn.length===0?t.a.createElement(P.a,null):pn.map(function(_n,ci){return t.a.createElement(pt,{onReplyDiscuss:jn,onPlusDiscuss:fi,onSetActiveDiscussIndex:Kn,onSetActionType:$n,data:_n,index:ci,user:xt,activeDiscussIndex:Sn})}),Yn>10?t.a.createElement("div",{className:"pagination-container"},t.a.createElement(Ie.a,{showQuickJumper:!0,onChange:In,current:Ft,total:Yn})):null),t.a.createElement(ze,{user_praise:Ht.user_praise,praise_count:Ht.praises_count,praisePlus:en,discuss_count:Ht.comments_count,onCreateDiscuss:Fn}),t.a.createElement(je.a,null,t.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Ln,onOk:Ei,onCancel:ui},t.a.createElement("p",null,Ln?Ln.message:"")),t.a.createElement(gt.a,null)))},Ze=V("1FX+"),mt=V.n(Ze),Lt=V("pYxM"),Mt=V.n(Lt),$t=V("sB/4"),Re=V.n($t),ve=V("Wtmd"),X=V.n(ve),ne=V("CNDd"),oe=V.n(ne),he=V("nCk5"),Ae=V.n(he),Qe=V("kovY"),ot=V.n(Qe),Rt=function(xt){var zt=xt.style,Ht=zt===void 0?{}:zt,en=xt.onClick,Xt=xt.onAssist,Et=xt.onHide,bt=xt.data,Jt=xt.active,wt=xt.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:Jt===(bt==null?void 0:bt.id)?"".concat(Mt.a.list," ").concat(Mt.a.active):Mt.a.list,style:Ht,onClick:function(){return en(bt)}},(bt==null?void 0:bt.video)&&t.a.createElement("div",{className:Mt.a.left},t.a.createElement("img",{src:bt==null?void 0:bt.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Re.a}),t.a.createElement("span",null,bt==null?void 0:bt.video_duration)),t.a.createElement("div",{className:Mt.a.mask})),t.a.createElement("div",{className:Mt.a.right},t.a.createElement("div",{className:Mt.a.name},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(bt==null?void 0:bt.image_url),width:30,height:30}),t.a.createElement("div",{title:bt==null?void 0:bt.name,className:Mt.a.title},bt==null?void 0:bt.name),(bt==null?void 0:bt.is_authority)&&t.a.createElement("div",{className:Mt.a.b},"\u5B98\u65B9"),(bt==null?void 0:bt.is_excellent)&&t.a.createElement("div",{className:Mt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Mt.a.des},t.a.createElement(dt.a,{showLines:2,showTextOnly:!0,value:(bt==null?void 0:bt.content)||"\u6682\u65E0\u5185\u5BB9"})),t.a.createElement("div",{className:Mt.a.tag},t.a.createElement("span",{className:"current",onClick:function(Ft){Ft.stopPropagation(),Xt(bt)}},t.a.createElement("img",{src:bt!=null&&bt.user_liker?oe.a:X.a}),t.a.createElement("span",{style:{color:bt!=null&&bt.user_liker?"#0152d9":"#656f87"}},bt==null?void 0:bt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ae.a}),t.a.createElement("span",null,bt==null?void 0:bt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:ot.a}),t.a.createElement("span",null,bt==null?void 0:bt.viewed_count)),Object(Bt.v)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Ft){Ft.stopPropagation(),Et(bt)}},bt!=null&&bt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),wt&&t.a.createElement("div",{className:Mt.a.line}))},Nt=Rt,ht=V("5Dmo"),Dt=V("3S7+"),sn=V("Z8dc"),Ct=V.n(sn),hn=V("Aky1"),rn=V("7+5b"),ae=V.n(rn),U=V("twBr"),H=V.n(U),te=V("oE5q"),pe=V.n(te),se=function(xt,zt){var Ht,en,Xt,Et=zt.payload.uploadInfo,bt=Et===void 0?{}:Et;switch(zt.type){case"addVideo":return{videoList:[].concat(Object(Ye.a)(xt.videoList),[{name:bt.file.name,size:bt.file.size,type:bt.file.type,fileHash:bt.fileHash,state:bt.state,video_id:bt.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:xt.videoList.filter(function(Jt){return Jt.name!==zt.payload.name})};case"replaceVideo":return{videoList:zt.payload};case"removeAll":return[];case"updateProgress":return{videoList:xt.videoList.map(function(Jt){return Jt.name===zt.payload.uploadInfo.file.name?Object(n.a)(Object(n.a)({},Jt),{loaded:zt.payload.progressPercent,video_id:bt.videoId,fileHash:bt.fileHash}):Jt})};case"updateTitle":return{videoList:(Ht=xt.videoList)===null||Ht===void 0?void 0:Ht.map(function(Jt){return Jt.name===zt.payload.item.name?Object(n.a)(Object(n.a)({},Jt),{title:zt.payload.title}):Jt})};case"updateImg":return{videoList:(en=xt.videoList)===null||en===void 0?void 0:en.map(function(Jt){return Jt.name===zt.payload.item.name?Object(n.a)(Object(n.a)({},Jt),{attachment_id:zt.payload.attachment_id}):Jt})};case"updateImg":return{videoList:(Xt=xt.videoList)===null||Xt===void 0?void 0:Xt.map(function(Jt){return Jt.name===zt.payload.item.name?Object(n.a)(Object(n.a)({},Jt),{attachment_id:zt.payload.attachment_id}):Jt})};default:return[]}},$e=function(xt){var zt,Ht,en=xt.onClose,Xt=xt.onOk,Et=xt.identifier,bt=xt.active,Jt=M.a.useForm(),wt=Object(s.a)(Jt,1),cn=wt[0],Ft=Object(i.useState)({}),pn=Object(s.a)(Ft,2),Yn=pn[0],Ln=pn[1],Sn=Object(i.useState)(!1),Zn=Object(s.a)(Sn,2),In=Zn[0],$n=Zn[1],Kn=Object(i.useState)(!1),fi=Object(s.a)(Kn,2),ti=fi[0],Ei=fi[1],Ci=Object(i.useReducer)(se,{videoList:[]}),ui=Object(s.a)(Ci,2),jn=ui[0],si=ui[1],Fn=Object(Bt.x)(),Vt=Object(y.i)(),_n=Object(i.useRef)();Object(i.useEffect)(function(){bt&&ci()},[bt]);var ci=function(){var En=Object(c.a)(a.a.mark(function kn(){var Tn,pi,ii,ri,ki,Xi,kr,er,Ur,Gr,Vr,Wr;return a.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(m.k)(Et,{active:bt});case 2:Tn=Vn.sent,(Tn==null?void 0:Tn.status)===0&&(Xi={name:Tn==null||((pi=Tn.data)===null||pi===void 0)?void 0:pi.name,content:Tn==null||((ii=Tn.data)===null||ii===void 0)?void 0:ii.content},cn.setFieldsValue(Xi),Ln(Xi),Tn!=null&&(ri=Tn.data)!==null&&ri!==void 0&&(ki=ri.videos)!==null&&ki!==void 0&&ki[0]&&si({type:"replaceVideo",payload:[{video_id:Tn==null||((kr=Tn.data)===null||kr===void 0||((er=kr.videos)===null||er===void 0||((Ur=er[0])===null||Ur===void 0)))?void 0:Ur.video_id,name:Tn==null||((Gr=Tn.data)===null||Gr===void 0||((Vr=Gr.videos)===null||Vr===void 0||((Wr=Vr[0])===null||Wr===void 0)))?void 0:Wr.title,loaded:100}]}));case 4:case"end":return Vn.stop()}},kn)}));return function(){return En.apply(this,arguments)}}(),yi=function(kn,Tn){Ln(Object(n.a)({},Tn))},li=function(){var En=Object(c.a)(a.a.mark(function kn(Tn){var pi,ii,ri,ki,Xi;return a.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:if(ii={videos:jn.videoList,articles:Tn},Ei(!0),!bt){er.next=9;break}return ii.active=bt,er.next=6,Object(m.j)(Et,ii);case 6:ri=er.sent,er.next=12;break;case 9:return er.next=11,Object(m.a)(Et,ii);case 11:ri=er.sent;case 12:((pi=ri)===null||pi===void 0?void 0:pi.status)===0&&(console.log(bt||((ki=ri)===null||ki===void 0?void 0:ki.id),44),Xt(bt||((Xi=ri)===null||Xi===void 0?void 0:Xi.id))),Ei(!1);case 14:case"end":return er.stop()}},kn)}));return function(Tn){return En.apply(this,arguments)}}(),Dn=function(){var kn=document.getElementById("fileUpload");kn.value=""},Jn=function(kn){var Tn='{"Vod":{}}';if($n(!0),_n.current){_n.current.addFile(kn,null,null,null,Tn);return}Object(hn.a)(Fn==null?void 0:Fn.login,"",{create:!_n,addFileSuccess:function(ii){si({type:"addVideo",payload:{uploadInfo:ii}})},onUploadProgress:function(ii,ri,ki){var Xi=Math.ceil(ki*100);si({type:"updateProgress",payload:{uploadInfo:ii,progressPercent:Xi}}),Dn()},onUploadFailed:function(ii){O.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(ii){$n(!1)},onUploadSucceed:function(ii){$n(!1)},onUploadError:function(ii){$n(!1)},gotUploader:function(ii){ii.addFile(kn,null,null,null,Tn),_n.current=ii}})},gn=function(kn){var Tn,pi=1024,ii=kn.target.files[0];if(!ii){Dn();return}var ri=ii.name.toLowerCase();if(ri&&ri.indexOf(".avi")==-1&&ri.indexOf(".flv")==-1&&ri.indexOf(".f4v")==-1&&ri.indexOf(".m4v")==-1&&ri.indexOf(".mov")==-1&&ri.indexOf(".mp4")==-1&&ri.indexOf(".rmvb")==-1&&ri.indexOf(".swf")==-1&&ri.indexOf(".webm")==-1&&ri.indexOf(".wmv")==-1){O.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Dn();return}if(ii.size>pi*1024*1024){O.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(pi,"M")),Dn();return}if((Tn=jn.videoList)!==null&&Tn!==void 0&&Tn.find(function(ki){return ki.name===ii.name})){O.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),Dn();return}Jn(ii)},An=function(kn,Tn){p.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Tn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Dn(),si({type:"removeVideo",payload:{name:kn}})}})},Gt=function(){return t.a.createElement("label",{htmlFor:"fileUpload",className:Ct.a.main},t.a.createElement("img",{src:ae.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},Qt=function(kn){return t.a.createElement("div",{className:Ct.a.mainLoading},t.a.createElement("div",{className:Ct.a.proWarp},t.a.createElement("div",{className:Ct.a.pro},t.a.createElement("div",{style:{width:kn}})),t.a.createElement("span",null,kn||0,"%")),t.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),t.a.createElement("div",{className:Ct.a.tip},t.a.createElement(Dt.a,{getPopupContainer:function(pi){return pi.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:pe.a,alt:""}))))},an=function(kn){return t.a.createElement("div",{className:Ct.a.mainSucceed},t.a.createElement("img",{src:H.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),t.a.createElement("div",{className:Ct.a.tip},t.a.createElement(Dt.a,{getPopupContainer:function(pi){return pi.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:pe.a,alt:""}))),t.a.createElement("div",{className:Ct.a.del,onClick:function(){return An(kn.name,kn.loaded==100)}},t.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},bn=function(){var kn;return t.a.createElement(t.a.Fragment,null,(kn=jn.videoList)===null||kn===void 0?void 0:kn.map(function(Tn,pi){return t.a.createElement(t.a.Fragment,{key:pi},Tn.loaded==100?an(Tn):Qt(Tn.loaded))}))},un=function(){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:en})},Gn=(zt=jn.videoList)===null||zt===void 0?void 0:zt.length;return t.a.createElement("div",{className:Ct.a.listForm},t.a.createElement("header",null,bt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),t.a.createElement("section",{className:Ct.a.scroll,id:"sss"},t.a.createElement("div",{className:Ct.a.formWrap}," ",t.a.createElement(M.a,{form:cn,scrollToFirstError:!0,layout:"vertical",onValuesChange:yi,onFinish:li},t.a.createElement(M.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},t.a.createElement(J.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ht=Yn.name)===null||Ht===void 0?void 0:Ht.length)||0,"/60")})),t.a.createElement(M.a.Item,{name:"content",label:"\u5185\u5BB9:"},t.a.createElement(Oe.a,{defaultValue:Yn.content||"",watch:!0})))),t.a.createElement("div",{className:Ct.a.upload},Gn?bn():Gt(),t.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:gn,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}))),t.a.createElement("div",{className:Ct.a.btns},t.a.createElement(q.a,{onClick:un,type:"primary",ghost:!0},"\u5173\u95ED"),t.a.createElement(q.a,{loading:ti,disabled:In,onClick:function(){return cn.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},yt=$e,Ot=V("cWXX"),Yt=V("/ezw"),St=V("CaVn"),Wt=V.n(St),ln=V("s8/Y"),Bn=V.n(ln),Oi=V("JOrW"),mi=V.n(Oi),Wn=V("gqXR"),di=V.n(Wn),hr=V("14J3"),vi=V("BMrR"),gi=V("jCWc"),xi=V("kPKH"),Bi=V("wW8i"),Ai=V.n(Bi),sr=V("MVJL"),Di=V.n(sr),fr=function(xt){var zt=xt.id,Ht=xt.cb,en=Object(i.useState)(""),Xt=Object(s.a)(en,2),Et=Xt[0],bt=Xt[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(Oe.a,{defaultValue:Et,id:"writeForumsReviewId",onChange:function(wt){bt(wt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(vi.a,null,t.a.createElement(xi.a,{flex:"1"}),t.a.createElement(xi.a,null,t.a.createElement(q.a,{type:"primary",size:"large",onClick:Object(c.a)(a.a.mark(function Jt(){return a.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:Et===""?O.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):Ht(zt,Et);case 1:case"end":return cn.stop()}},Jt)}))},"\u53D1\u9001"))))},lr=function(xt){var zt,Ht=xt.data;return t.a.createElement("div",{className:Di.a.thirdlyLevelDiscuss},t.a.createElement("span",{className:"c-grey-333"},t.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null||((zt=Ht.author)===null||zt===void 0)?void 0:zt.name),"@",t.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null?void 0:Ht.parent_name),":"),t.a.createElement(dt.a,{value:Ht==null?void 0:Ht.content}))},Wi=function(xt){var zt,Ht,en,Xt,Et=xt.data,bt=xt.onReplyDiscuss,Jt=xt.thirdlyReply,wt=xt.setThirdlyReply,cn=Object(Bt.x)();return console.log(cn,"user"),t.a.createElement("div",{className:Di.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Et==null||((zt=Et.author)===null||zt===void 0)?void 0:zt.image_url)}),t.a.createElement("div",{className:Di.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333"},Et==null||((Ht=Et.author)===null||Ht===void 0)?void 0:Ht.name),(cn==null?void 0:cn.login)!==(Et==null||((en=Et.author)===null||en===void 0)?void 0:en.login)&&t.a.createElement("span",{onClick:function(){return wt(Et==null?void 0:Et.id)},className:"c-grey-999 current",style:{float:"right"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),t.a.createElement("span",null,"\u56DE\u590D"))),t.a.createElement(dt.a,{value:Et==null?void 0:Et.content}),Et==null||((Xt=Et.children)===null||Xt===void 0)?void 0:Xt.map(function(Ft){return t.a.createElement(lr,{key:Ft.id,data:Ft})}),Jt===(Et==null?void 0:Et.id)&&t.a.createElement("div",null,t.a.createElement(fr,{id:Et==null?void 0:Et.id,cb:bt}),t.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return wt(null)},className:"c-light-primary current"},t.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),t.a.createElement("div",{className:Di.a.line})))},Gi=function(xt){var zt,Ht,en,Xt,Et=xt.data,bt=xt.onReplyDiscuss,Jt=xt.secondReply,wt=xt.setSecondReply,cn=xt.thirdlyReply,Ft=xt.setThirdlyReply,pn=xt.onPlusDiscuss,Yn=Object(i.useState)(!1),Ln=Object(s.a)(Yn,2),Sn=Ln[0],Zn=Ln[1];return console.log(Et,"data"),t.a.createElement("div",{className:Di.a.discussItem},t.a.createElement("div",{className:Di.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Et==null||((zt=Et.author)===null||zt===void 0)?void 0:zt.image_url)}),t.a.createElement("div",{className:Di.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333 mr30"},Et==null||((Ht=Et.author)===null||Ht===void 0)?void 0:Ht.name),t.a.createElement("span",{className:"c-grey-999"},Et==null?void 0:Et.time)),t.a.createElement(dt.a,{value:Et==null?void 0:Et.content}),t.a.createElement("div",{className:Di.a.btns},t.a.createElement("div",{onClick:function(){return pn(Et==null?void 0:Et.id)},className:Et!=null&&Et.user_praise?"c-light-primary":"c-grey-999"},t.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),t.a.createElement("span",null,Et==null?void 0:Et.praise_count)),t.a.createElement("div",{onClick:function(){var $n;if((Et==null||(($n=Et.children)===null||$n===void 0)?void 0:$n.length)===0)return;wt(null),Zn(!Sn)},style:{color:Sn?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,Sn?"\u6536\u8D77\u8BC4\u8BBA":Et==null||((en=Et.children)===null||en===void 0)?void 0:en.length)),t.a.createElement("div",{onClick:function(){Zn(!1),wt(Jt===(Et==null?void 0:Et.id)?null:Et==null?void 0:Et.id)},style:{color:Jt===(Et==null?void 0:Et.id)?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),t.a.createElement("span",null,Jt===(Et==null?void 0:Et.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Jt===(Et==null?void 0:Et.id)&&t.a.createElement(fr,{id:Et==null?void 0:Et.id,cb:function($n,Kn){bt($n,Kn),Zn(!0)}}),Sn&&t.a.createElement("div",{className:Di.a.secondLevelDiscuss},Et==null||((Xt=Et.children)===null||Xt===void 0)?void 0:Xt.map(function(In){return t.a.createElement(Wi,{thirdlyReply:cn,setThirdlyReply:Ft,key:In.id,data:In,onReplyDiscuss:bt})})))))},vr=Gi,Rr=function(xt){var zt=xt.identifier,Ht=xt.active,en=xt.onOk,Xt=Object(i.useState)(""),Et=Object(s.a)(Xt,2),bt=Et[0],Jt=Et[1],wt=Object(i.useState)(1),cn=Object(s.a)(wt,2),Ft=cn[0],pn=cn[1],Yn=Object(i.useState)([]),Ln=Object(s.a)(Yn,2),Sn=Ln[0],Zn=Ln[1],In=Object(i.useState)(0),$n=Object(s.a)(In,2),Kn=$n[0],fi=$n[1],ti=Object(i.useState)(null),Ei=Object(s.a)(ti,2),Ci=Ei[0],ui=Ei[1],jn=Object(i.useState)(null),si=Object(s.a)(jn,2),Fn=si[0],Vt=si[1];Object(i.useEffect)(function(){_n(1),pn(1)},[Ht]);var _n=function(){var Jn=Object(c.a)(a.a.mark(function gn(An){var Gt;return a.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,be({container_type:"QuestionSolutionArticle",container_identifier:Ht,limit:5,page:An});case 2:Gt=an.sent,Gt!=null&&Gt.comments&&(Zn((Gt==null?void 0:Gt.comments)||[]),pn(An),fi(Gt==null?void 0:Gt.disscuss_count));case 4:case"end":return an.stop()}},gn)}));return function(An){return Jn.apply(this,arguments)}}(),ci=function(){var Jn=Object(c.a)(a.a.mark(function gn(){var An;return a.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(!(bt==="")){Qt.next=3;break}return O.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Qt.abrupt("return");case 3:return Qt.next=5,Le({comments:{content:bt},container_type:"QuestionSolutionArticle",container_identifier:Ht});case 5:An=Qt.sent,An!=null&&An.discuss&&(Jt(""),_n(Ft),en());case 7:case"end":return Qt.stop()}},gn)}));return function(){return Jn.apply(this,arguments)}}(),yi=function(){var Jn=Object(c.a)(a.a.mark(function gn(An,Gt,Qt){var an;return a.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Pe({container_type:"QuestionSolutionArticle",container_identifier:Ht,comments:{content:Gt,parent_id:An}});case 2:an=un.sent,ui(null),Vt(null),_n(Ft);case 6:case"end":return un.stop()}},gn)}));return function(An,Gt,Qt){return Jn.apply(this,arguments)}}(),li=function(){var Jn=Object(c.a)(a.a.mark(function gn(An){var Gt;return a.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Ce(An);case 2:Gt=an.sent,_n(Ft);case 4:case"end":return an.stop()}},gn)}));return function(An){return Jn.apply(this,arguments)}}(),Dn=function(gn){pn(gn),_n(gn)};return t.a.createElement("div",{className:Ai.a.discuss},t.a.createElement("aside",{className:Ai.a.reply,style:{borderWidth:Kn?1:0}},t.a.createElement(Oe.a,{defaultValue:bt,id:"writeForumsReviewId",onChange:function(gn){Jt(gn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(vi.a,null,t.a.createElement(xi.a,{flex:"1"}),t.a.createElement(xi.a,null,t.a.createElement(q.a,{type:"primary",size:"large",onClick:function(){return ci()}},"\u53D1\u9001")))),Sn==null?void 0:Sn.map(function(Jn){return t.a.createElement(vr,{secondReply:Ci,setSecondReply:ui,thirdlyReply:Fn,setThirdlyReply:Vt,key:Jn.id,data:Jn,onReplyDiscuss:yi,onPlusDiscuss:li})}),t.a.createElement(Ie.a,{className:Ai.a.pagination,showTotal:function(gn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},gn),"\u6761\u6570\u636E")},current:Ft,onChange:Dn,total:Kn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},ur=Rr,Hn=V("hgre"),wn=function(xt){var zt,Ht,en,Xt,Et,bt,Jt,wt,cn,Ft,pn=xt.active,Yn=xt.identifier,Ln=xt.onAssist,Sn=xt.onEdit,Zn=xt.onArticlesSkip,In=xt.onClose,$n=xt.onOk,Kn=xt.onDelete,fi=xt.detailsIndex,ti=xt.btnShowStatus,Ei=Object(i.useState)(!0),Ci=Object(s.a)(Ei,2),ui=Ci[0],jn=Ci[1],si=Object(i.useState)({}),Fn=Object(s.a)(si,2),Vt=Fn[0],_n=Fn[1];Object(i.useEffect)(function(){pn&&ci()},[pn,fi]);var ci=function(){var gn=Object(c.a)(a.a.mark(function An(){var Gt,Qt,an=arguments;return a.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return Gt=an.length>0&&an[0]!==void 0?an[0]:!0,Gt&&jn(!0),un.next=4,Object(m.d)(Yn,{active:pn});case 4:Qt=un.sent,(Qt==null?void 0:Qt.status)===0&&_n((Qt==null?void 0:Qt.data)||{}),jn(!1);case 7:case"end":return un.stop()}},An)}));return function(){return gn.apply(this,arguments)}}(),yi=function(){var gn=Object(c.a)(a.a.mark(function An(Gt){var Qt;return a.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(m.g)(Yn,Object(n.a)({active:pn},Gt));case 2:Qt=bn.sent,(Qt==null?void 0:Qt.status)===0&&(ci(!1),$n());case 4:case"end":return bn.stop()}},An)}));return function(Gt){return gn.apply(this,arguments)}}(),li=function(){var gn=Object(c.a)(a.a.mark(function An(Gt){var Qt;return a.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(m.c)(Yn,{active:Gt==null?void 0:Gt.id});case 2:Qt=bn.sent,Qt.status===0&&(ci(!1),$n());case 4:case"end":return bn.stop()}},An)}));return function(Gt){return gn.apply(this,arguments)}}(),Dn=function(An){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return Kn(An)}})},Jn=function(){ci(!1),$n()};return t.a.createElement("div",{className:Wt.a.listDetails},t.a.createElement(Yt.a,{className:"pt20 pl20 pr20",loading:ui,active:!0,paragraph:{rows:5}},t.a.createElement("div",{className:Wt.a.head},t.a.createElement("div",{className:Wt.a.name},t.a.createElement("div",{title:Vt==null?void 0:Vt.name,className:Wt.a.title},Vt==null?void 0:Vt.name),(Vt==null?void 0:Vt.is_authority)&&t.a.createElement("div",{className:Wt.a.b},"\u5B98\u65B9"),(Vt==null?void 0:Vt.is_excellent)&&t.a.createElement("div",{className:Wt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Wt.a.tag},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Vt==null?void 0:Vt.image_url)}),t.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Vt==null?void 0:Vt.username),t.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",He()(Vt==null?void 0:Vt.created_at).format("YYYY-MM-DD")),t.a.createElement("span",null,t.a.createElement("img",{src:X.a}),t.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ae.a}),t.a.createElement("span",null,Vt==null?void 0:Vt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:ot.a}),t.a.createElement("span",null,Vt==null?void 0:Vt.viewed_count)),t.a.createElement("div",{className:Wt.a.btn},(Object(Bt.v)()||(Vt==null?void 0:Vt.is_self))&&t.a.createElement(t.a.Fragment,null,t.a.createElement(q.a,{onClick:function(){return Dn(Vt)},type:"primary",ghost:!0},"\u5220\u9664"),t.a.createElement(q.a,{onClick:function(){return Sn(Vt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Bt.v)()&&t.a.createElement(q.a,{onClick:function(){return yi({is_authority:!(Vt!=null&&Vt.is_authority)})},type:"primary"},t.a.createElement("img",{src:mi.a}),Vt!=null&&Vt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Bt.v)()&&t.a.createElement(q.a,{onClick:function(){return yi({is_excellent:!(Vt!=null&&Vt.is_excellent)})},type:"primary"},t.a.createElement("img",{src:Bn.a}),Vt!=null&&Vt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),t.a.createElement("div",{className:Wt.a.scroll},(Vt==null||((zt=Vt.videos)===null||zt===void 0||((Ht=zt[0])===null||Ht===void 0))?void 0:Ht.id)&&t.a.createElement("div",{className:Wt.a.video},t.a.createElement(T.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Vt!=null&&(en=Vt.videos)!==null&&en!==void 0&&(Xt=en[0])!==null&&Xt!==void 0&&Xt.transcoded)},t.a.createElement(Hn.a,{poster:Vt==null||((Et=Vt.videos)===null||Et===void 0||((bt=Et[0])===null||bt===void 0))?void 0:bt.cover_url,src:(Vt==null||((Jt=Vt.videos)===null||Jt===void 0||((wt=Jt[0])===null||wt===void 0))?void 0:wt.play_url)||"",videoId:Vt==null||((cn=Vt.videos)===null||cn===void 0||((Ft=cn[0])===null||Ft===void 0))?void 0:Ft.id,logWatchHistory:function(){}}))),t.a.createElement(dt.a,{className:Wt.a.html,value:(Vt==null?void 0:Vt.content)||""}),t.a.createElement("div",{onClick:function(){return li(Vt)},className:Wt.a.g},t.a.createElement("img",{className:"mr10",src:(Vt!=null&&Vt.user_liker,di.a)}),t.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),t.a.createElement(ur,{onOk:Jn,active:pn,identifier:Yn})),t.a.createElement("div",{className:Wt.a.btns},t.a.createElement(q.a,{onClick:function(){return In()},type:"primary",ghost:!0},"\u5173\u95ED"),ti[0]&&t.a.createElement(q.a,{onClick:function(An){return Zn(An,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),ti[1]&&t.a.createElement(q.a,{onClick:function(An){return Zn(An,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},wi=wn,Mn=V("3tLw"),Ri=V.n(Mn),oi=V("ek7X"),Lr=V("0NbB"),Ni=function(xt){var zt=xt.identifier,Ht=xt.tabStatus,en=xt.setFilterListTotal,Xt=xt.setListStatus,Et={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},bt=Object(i.useState)(Object(n.a)({},Et)),Jt=Object(s.a)(bt,2),wt=Jt[0],cn=Jt[1],Ft=Object(i.useState)(!1),pn=Object(s.a)(Ft,2),Yn=pn[0],Ln=pn[1],Sn=Object(i.useState)(0),Zn=Object(s.a)(Sn,2),In=Zn[0],$n=Zn[1],Kn=Object(i.useState)(1),fi=Object(s.a)(Kn,2),ti=fi[0],Ei=fi[1],Ci=Object(i.useState)(null),ui=Object(s.a)(Ci,2),jn=ui[0],si=ui[1],Fn=Object(i.useState)([]),Vt=Object(s.a)(Fn,2),_n=Vt[0],ci=Vt[1],yi=Object(i.useState)([!0,!0]),li=Object(s.a)(yi,2),Dn=li[0],Jn=li[1],gn=Object(i.useState)(0),An=Object(s.a)(gn,2),Gt=An[0],Qt=An[1],an=Object(i.useRef)(null);Object(i.useEffect)(function(){ki()},[Ht]),Object(i.useEffect)(function(){bn()},[jn]),Object(i.useEffect)(function(){Gn(Object(n.a)({},Et)),ki()},[zt]),Object(i.useEffect)(function(){return window.addEventListener("resize",un),Xt(Gt),function(){window.removeEventListener("resize",un)}},[Gt]);var bn=function(){var Vn=Object(c.a)(a.a.mark(function xn(){var Xn,ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:if(jn){Qn.next=3;break}return Jn([!0,!0]),Qn.abrupt("return");case 3:Xn=[!0,!0],ai=_n==null?void 0:_n.findIndex(function(wr){return wr.id===jn}),ai===0&&wt.page===1&&(Xn[0]=!1),(wt.page-1)*wt.limit+(ai+1)===wt.total&&(Xn[1]=!1),Jn(Xn);case 8:case"end":return Qn.stop()}},xn)}));return function(){return Vn.apply(this,arguments)}}(),un=function(){if(Gt){var xn,Xn=window.innerWidth-((xn=an.current)===null||xn===void 0?void 0:xn.clientWidth);$n(Xn)}},Gn=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai,Ui,Qn,wr;return a.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return Ln(!0),tr.next=3,Object(m.f)(zt,Xn);case 3:return ai=tr.sent,(ai==null?void 0:ai.status)===0&&(ci((ai==null||((Ui=ai.data)===null||Ui===void 0)?void 0:Ui.articles)||[]),cn(Object(n.a)(Object(n.a)({},Xn),{},{total:ai==null||((Qn=ai.data)===null||Qn===void 0)?void 0:Qn.articles_count})),en(ai==null||((wr=ai.data)===null||wr===void 0)?void 0:wr.articles_count)),Ln(!1),tr.abrupt("return",ai);case 7:case"end":return tr.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),En=function(){(wt==null?void 0:wt.sort_direction)===null?wt.sort_direction="asc":(wt==null?void 0:wt.sort_direction)==="asc"?wt.sort_direction="desc":(wt==null?void 0:wt.sort_direction)==="desc"&&(wt.sort_direction=null),wt.page=1,ki(),cn(Object(n.a)({},wt)),Gn(wt)},kn=function(){wt.page=1,wt.search=wt==null?void 0:wt.save_search,ki(),cn(Object(n.a)({},wt)),Gn(wt)},Tn=function(){var xn,Xn=document.getElementsByClassName("btn-resize");Xn[0].style.visibility="hidden";var ai=window.innerWidth-((xn=an.current)===null||xn===void 0?void 0:xn.clientWidth);$n(ai)},pi=function(){Tn(),Qt(1)},ii=function(xn){Tn(),si(xn==null?void 0:xn.id),Qt(3)},ri=function(xn){Tn(),si(xn==null?void 0:xn.id),Qt(2)},ki=function(){var xn=document.getElementsByClassName("btn-resize");xn[0].style.visibility="visible",$n(0),Qt(0),si(null)},Xi=function(xn){Qt(3),si(xn),wt.page=1,cn(Object(n.a)({},wt)),Gn(wt)},kr=function(xn){Qt(3),si(xn),cn(Object(n.a)({},wt)),Gn(wt)},er=function(xn){cn(Object(n.a)({},wt)),Gn(wt)},Ur=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(m.c)(zt,{active:Xn==null?void 0:Xn.id});case 2:ai=Qn.sent,ai.status===0&&(Gn(wt),Ei(ti+1));case 4:case"end":return Qn.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),Gr=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(m.e)(zt,{active:Xn==null?void 0:Xn.id});case 2:ai=Qn.sent,ai.status===0&&(Gn(wt),Ei(ti+1));case 4:case"end":return Qn.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),Vr=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(m.i)(zt,{active:Xn==null?void 0:Xn.id});case 2:ai=Qn.sent,ai.status===0&&(ki(),Gn(wt));case 4:case"end":return Qn.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),Wr=function(xn){wt.page=xn,cn(Object(n.a)({},wt)),Gn(wt)},ba=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn,ai){var Ui,Qn,wr,yr,tr,Hi,pr,cr,Nn,Rn,qn;return a.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Ui=_n==null?void 0:_n.findIndex(function(Si){return Si.id===jn}),console.log(Ui,ai,22),!(ai==="prev")){Pn.next=21;break}if(!(Ui===void 0)){Pn.next=6;break}return O.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 6:if(!(Ui===0)){Pn.next=19;break}if(!(wt.page===1)){Pn.next=10;break}return O.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 10:if(!(wt.page!==1)){Pn.next=17;break}return wt.page=wt.page-1,cn(Object(n.a)({},wt)),Pn.next=15,Gn(wt);case 15:Qn=Pn.sent,(Qn==null?void 0:Qn.status)===0&&(Hi=Qn==null||((wr=Qn.data)===null||wr===void 0)?void 0:wr.articles[(Qn==null||((yr=Qn.data)===null||yr===void 0||((tr=yr.articles)===null||tr===void 0))?void 0:tr.length)-1],si(Hi==null?void 0:Hi.id),console.log(Xn.target,555));case 17:Pn.next=21;break;case 19:pr=_n[Ui-1],si(pr==null?void 0:pr.id);case 21:if(!(ai==="next")){Pn.next=39;break}if(!(Ui===void 0)){Pn.next=25;break}return O.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 25:if(!((wt.page-1)*wt.limit+(Ui+1)===wt.total)){Pn.next=28;break}return O.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 28:if(!(Ui+1===wt.limit)){Pn.next=37;break}return wt.page=wt.page+1,cn(Object(n.a)({},wt)),Pn.next=33,Gn(wt);case 33:cr=Pn.sent,(cr==null?void 0:cr.status)===0&&(Rn=cr==null||((Nn=cr.data)===null||Nn===void 0)?void 0:Nn.articles[0],si(Rn==null?void 0:Rn.id)),Pn.next=39;break;case 37:qn=_n[Ui+1],si(qn==null?void 0:qn.id);case 39:case"end":return Pn.stop()}},xn)}));return function(Xn,ai){return Vn.apply(this,arguments)}}();return t.a.createElement("div",{className:mt.a.wrap,ref:an},t.a.createElement("div",{className:mt.a.head},t.a.createElement("div",{className:mt.a.sort,onClick:En},t.a.createElement("span",null,"\u6700\u65B0"),t.a.createElement("aside",null,t.a.createElement(oi.a,{style:{color:(wt==null?void 0:wt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),t.a.createElement(Lr.a,{style:{color:(wt==null?void 0:wt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),t.a.createElement(J.a.Search,{value:wt.save_search,className:mt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(xn){wt.save_search=xn.target.value,cn(Object(n.a)({},wt))},onSearch:kn}),t.a.createElement("div",{onClick:pi,className:mt.a.btn},t.a.createElement("img",{src:Ri.a}),"\u5199\u9898\u89E3")),t.a.createElement("div",{className:mt.a.listWarp},t.a.createElement(T.a,{spinning:Yn,className:"mt20"},_n==null?void 0:_n.map(function(Vn,xn){var Xn=!0;return xn+1===_n.length&&xn!==0&&(Xn=!1),t.a.createElement(Nt,{active:jn,key:Vn.id,data:Vn,showLine:Xn,onClick:ii,onAssist:Ur,onHide:Gr})}),(_n==null?void 0:_n.length)===0&&t.a.createElement(P.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),t.a.createElement(Ie.a,{className:mt.a.pagination,showTotal:function(xn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},xn),"\u6761\u6570\u636E")},total:wt.total,showSizeChanger:!1,current:wt==null?void 0:wt.page,onChange:Wr,hideOnSinglePage:!0,showQuickJumper:!0}),Gt>0&&t.a.createElement("div",{className:mt.a.fixedRight,style:{width:In}},Gt===1&&t.a.createElement(yt,{identifier:zt,onClose:ki,onOk:Xi}),Gt===2&&t.a.createElement(yt,{active:jn,identifier:zt,onClose:ki,onOk:kr}),Gt===3&&t.a.createElement(wi,{btnShowStatus:Dn,onArticlesSkip:ba,detailsIndex:ti,active:jn,identifier:zt,onClose:ki,onOk:er,onEdit:ri,onAssist:Ur,onDelete:Vr})))},Qi=Ni,Br=V("VEzc"),qi=V.n(Br),Kr=function(xt){var zt,Ht=xt.visible,en=xt.onVisible,Xt=xt.value,Et=xt.onChange,bt=xt.setIndex,Jt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},wt=Object(i.useState)(Jt),cn=Object(s.a)(wt,2),Ft=cn[0],pn=cn[1],Yn=Object(i.useState)([]),Ln=Object(s.a)(Yn,2),Sn=Ln[0],Zn=Ln[1],In=Object(i.useState)([]),$n=Object(s.a)(In,2),Kn=$n[0],fi=$n[1],ti=Object(i.useState)(!1),Ei=Object(s.a)(ti,2),Ci=Ei[0],ui=Ei[1],jn=Object(i.useRef)([]),si=Object(i.useRef)(null),Fn=Object(y.i)();Object(i.useEffect)(function(){return Fn!=null&&Fn.id&&(si.current=setInterval(function(){Vt(30)},3e4)),function(){clearInterval(si.current)}},[]);var Vt=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an){var bn;return a.a.wrap(function(Gn){for(;;)switch(Gn.prev=Gn.next){case 0:return Gn.next=2,Object(m.r)(Fn==null?void 0:Fn.id,{practice_time:an});case 2:bn=Gn.sent;case 3:case"end":return Gn.stop()}},Qt)}));return function(an){return Gt.apply(this,arguments)}}();Object(i.useEffect)(function(){Jn(Ft),li()},[]),Object(i.useEffect)(function(){return window.addEventListener("click",ci),function(){window.removeEventListener("click",ci)}},[Fn==null?void 0:Fn.save_identifier,Ht]),Object(i.useEffect)(function(){var Gt=jn.current.findIndex(function(Gn){return Gn.identifier===(Fn==null?void 0:Fn.save_identifier)}),Qt=jn.current[Gt-1],an=jn.current[Gt+1],bn=document.getElementById("oj-prev"),un=document.getElementById("oj-next");Qt?bn.style.display="block":bn.style.display="none",an?un.style.display="block":un.style.display="none"},[Fn==null?void 0:Fn.save_identifier,jn.current]);var _n=function(Qt,an){if(Qt.id===an)return Qt;for(var bn=0,un=Qt;un=un.parentNode;bn++){if(un.id===an)return un;if(un==document.documentElement)return!1}},ci=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an){var bn,un,Gn;return a.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(!_n(an.target,"oj-drawer")&&Ht&&en(!1),bn=jn.current.findIndex(function(Tn){return Tn.identifier===(Fn==null?void 0:Fn.save_identifier)}),un=jn.current[bn-1],Gn=jn.current[bn+1],!(an.target.id==="oj-prev")){kn.next=14;break}if(!(!un||bn===-1)){kn.next=8;break}return O.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),kn.abrupt("return");case 8:return an.target.style.pointerEvents="none",an.target.style.cursor="not-allowed",kn.next=12,gn(un==null?void 0:un.identifier);case 12:bt("0"),setTimeout(function(){an.target.style.pointerEvents="auto",an.target.style.cursor="pointer"},400);case 14:if(!(an.target.id==="oj-next"||an.target.id==="oj-modal-next")){kn.next=24;break}if(!(!Gn||bn===-1)){kn.next=18;break}return O.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),kn.abrupt("return");case 18:return an.target.style.pointerEvents="none",an.target.style.cursor="not-allowed",kn.next=22,gn(Gn==null?void 0:Gn.identifier);case 22:bt("0"),setTimeout(function(){an.target.style.pointerEvents="auto",an.target.style.cursor="pointer"},400);case 24:case"end":return kn.stop()}},Qt)}));return function(an){return Gt.apply(this,arguments)}}();Object(i.useEffect)(function(){Et(Fn==null?void 0:Fn.save_identifier);var Gt=Kn.findIndex(function(Qt){return Qt.some(function(an){return an.identifier===(Fn==null?void 0:Fn.save_identifier)})});Gt===-1?pn(Object(n.a)(Object(n.a)({},Ft),{},{page:1})):pn(Object(n.a)(Object(n.a)({},Ft),{},{page:Gt+1}))},[Fn==null?void 0:Fn.save_identifier,Kn]);var yi=function(Qt){Ft.page=1,Ft.tag_discipline_id=Qt,pn(Object(n.a)({},Ft)),Jn(Ft)},li=function(){var Gt=Object(c.a)(a.a.mark(function Qt(){var an;return a.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(ke.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:an=un.sent,Zn(an.tag_disciplines||[]);case 4:case"end":return un.stop()}},Qt)}));return function(){return Gt.apply(this,arguments)}}(),Dn=function(Qt){Ft.page=1,Ft.difficulty=typeof Qt=="number"?Qt:null,pn(Object(n.a)({},Ft)),Jn(Ft)},Jn=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an){var bn,un,Gn,En,kn,Tn;return a.a.wrap(function(ii){for(;;)switch(ii.prev=ii.next){case 0:return ui(!0),ii.next=3,Object(m.p)(an);case 3:if(bn=ii.sent,bn!=null&&bn.practices_list){for(Gn=bn==null||((un=bn.practices_list)===null||un===void 0)?void 0:un.length,En=[],kn=0;kn(Pn+3)*1e3,Hr!==0&&!aa&&setTimeout(ji,1e3),!aa){zi.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),bt({type:nn.SET_SUBMITING,payload:!1}),zi.abrupt("return");case 12:if(!(Hr===0)){zi.next=19;break}return zr.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),zi.next=16,Object(m.o)(wt,{limit:15,page:Kn});case 16:oa=zi.sent,bt({type:nn.SET_SUBMIT_RESULT,payload:Object(n.a)(Object(n.a)({},Et),{},{submitResult:zr,submitting:!1,submitRecords:oa})}),(zr==null?void 0:zr.status)===0&&an(!0);case 19:case"end":return zi.stop()}},fa)})),Yi.apply(this,arguments)},ji=function(){return Yi.apply(this,arguments)},qn={},vn.next=14,Object(m.s)(wt,qn);case 14:if(tn=vn.sent,!(tn.status===-1)){vn.next=18;break}return window.parent.location.href="/classrooms/".concat(Ft.query.coursesId,"/exercise/").concat(Ft.query.exercisesId,"/detail"),vn.abrupt("return");case 18:Pn=En.time_limit,Si=Li(),ji();case 21:vn.next=26;break;case 23:vn.prev=23,vn.t0=vn.catch(3),bt({type:nn.SET_SUBMITING,payload:!1});case 26:case"end":return vn.stop()}},Nn,null,[[3,23]])})),Ur.apply(this,arguments)}function Gr(){return Vr.apply(this,arguments)}function Vr(){return Vr=Object(c.a)(a.a.mark(function Nn(){var Rn,qn,tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Et.debuging=!0,bt({type:nn.SET_DEBUGING,payload:!0}),vn.prev=2,vn.next=5,Xi();case 5:if(Rn=vn.sent,!(Rn.status===0)){vn.next=21;break}return Yi=function(){return Yi=Object(c.a)(a.a.mark(function fa(){var Sr,Hr,zr,Xr,aa,oa;return a.a.wrap(function(zi){for(;;)switch(zi.prev=zi.next){case 0:return zi.next=2,Object(m.l)(wt,"debug");case 2:if(Sr=zi.sent,Hr=Sr.status,zr=Sr.message,Xr=Sr.data,aa=Li(),oa=aa-Si>(qn+3)*1e3,Hr!==0&&!oa&&(bt({type:nn.SET_EXECUTE_MESSAGE,payload:zr}),setTimeout(ji,1e3)),!oa){zi.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),bt({type:nn.SET_DEBUGING,payload:!1}),zi.abrupt("return");case 13:Hr===0&&(bt({type:nn.SET_DEBUGING,payload:!1}),Xr.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),bt({type:nn.SET_EXECUTE_RESULT,payload:Object(n.a)(Object(n.a)({},Et),{},{debugResult:Xr,debuging:!1})}));case 14:case"end":return zi.stop()}},fa)})),Yi.apply(this,arguments)},ji=function(){return Yi.apply(this,arguments)},qn=En.time_limit,tn={input:encodeURIComponent(Sn.test_case.input)},vn.next=13,Object(m.h)(wt,tn);case 13:if(Pn=vn.sent,!(Pn.status===-1)){vn.next=17;break}return window.parent.location.href="/classrooms/".concat(Ft.query.coursesId,"/exercise/").concat(Ft.query.exercisesId,"/detail"),vn.abrupt("return");case 17:Si=Li(),ji(),vn.next=22;break;case 21:bt({type:nn.SET_DEBUGING,payload:!1});case 22:vn.next=27;break;case 24:vn.prev=24,vn.t0=vn.catch(2),console.log(vn.t0);case 27:return vn.prev=27,vn.finish(27);case 29:case"end":return vn.stop()}},Nn,null,[[2,24,27,29]])})),Vr.apply(this,arguments)}function Wr(Nn){var Rn;clearTimeout(bn.current),bn.current=setTimeout(function(){var qn;Xi({code:S.Base64.encode(Nn),language:un==null||((qn=un.current)===null||qn===void 0)?void 0:qn.language})},2e3),bt({type:nn.SET_DATA,payload:Object(n.a)(Object(n.a)({},un==null?void 0:un.current),{},{hack:Object(n.a)(Object(n.a)({},un==null||((Rn=un.current)===null||Rn===void 0)?void 0:Rn.hack),{},{code:Nn})})})}function ba(Nn){var Rn=Nn.target.value;bt({type:nn.SET_DATA,payload:Object(n.a)(Object(n.a)({},Sn),{},{test_case:{input:Rn}})})}var Vn=function(){var Nn=Object(c.a)(a.a.mark(function Rn(qn){var tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return bt({type:nn.SET_LOADING,payload:!0}),vn.next=3,Xi();case 3:if(tn=vn.sent,!(tn.status===0)){vn.next=14;break}return bt({type:nn.SET_SUBMIT_RESULT,payload:{languageValue:qn}}),un.current.language=qn,Pn="".concat(Gn==null?void 0:Gn.login,"-language"),localStorage.setItem(Pn,qn),vn.next=11,Object(m.w)(wt);case 11:Si=vn.sent,Si.status===0&&(Yi=Si==null||((ji=Si.data)===null||ji===void 0)?void 0:ji.find(function(ra){return ra.language===qn}),Wr(S.Base64.decode(Yi.code))),setTimeout(function(){bt({type:nn.SET_LOADING,payload:!1})},300);case 14:case"end":return vn.stop()}},Rn)}));return function(qn){return Nn.apply(this,arguments)}}();function xn(){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(c.a)(a.a.mark(function Nn(){var Rn;return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.prev=0,tn.next=3,Object(m.q)(wt,{language:pn});case 3:Rn=tn.sent,Rn.status===401?cn.replace("/login",{from:Ft.pathname}):(Wr(S.Base64.decode(Rn.code)),ii()),tn.next=10;break;case 7:tn.prev=7,tn.t0=tn.catch(0),console.log(tn.t0);case 10:case"end":return tn.stop()}},Nn,null,[[0,7]])})),Xn.apply(this,arguments)}function ai(){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:t.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",t.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(c.a)(a.a.mark(function Rn(){var qn;return a.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(m.t)(wt,{language:pn});case 2:qn=Pn.sent,qn.status===401?cn.replace("/login",{from:Ft.pathname}):Wr(S.Base64.decode(qn.code));case 4:case"end":return Pn.stop()}},Rn)}))()}})}function Ui(){bt({type:nn.SET_SHOW_NOTE,payload:!0})}function Qn(){bt({type:nn.SET_SHOW_NOTE,payload:!1})}function wr(Nn){return yr.apply(this,arguments)}function yr(){return yr=Object(c.a)(a.a.mark(function Nn(Rn){return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(m.b)(wt,Rn);case 2:bt({type:nn.GET_DATA,payload:{showNote:!1,data:Object(n.a)(Object(n.a)({},Sn),{},{hack:Object(n.a)(Object(n.a)({},En),{},{notes:Rn.notes})})}});case 3:case"end":return tn.stop()}},Nn)})),yr.apply(this,arguments)}var tr={input:Sn==null||((xt=Sn.test_case)===null||xt===void 0)?void 0:xt.input,language:En==null?void 0:En.language,code:En==null?void 0:En.code,title:"main."+_i[En==null?void 0:En.language],modify_code:En==null?void 0:En.modify_code,notes:En==null?void 0:En.notes,debugResult:Zn,debuging:ti,submitting:Ei,executingMessage:Ci,id:wt,languageValue:pn,languageList:Yn,onChangeLanguage:Vn,onCancelNote:Qn,onAddNote:wr,showNote:fi,onShowNote:Ui,onSubmitCode:er,onChangeCode:Wr,onChangeInput:ba,onDebugCode:Gr,onResetCode:xn,onSyncCode:ai,onUpdateCode:Xi};function Hi(){return pr.apply(this,arguments)}function pr(){return pr=Object(c.a)(a.a.mark(function Nn(){var Rn,qn,tn;return a.a.wrap(function(Si){for(;;)switch(Si.prev=Si.next){case 0:return Si.next=2,Object(m.u)(En.id,{container_type:"Hack",type:1});case 2:Rn=Si.sent,qn=Rn.praise_count,tn=Object(n.a)(Object(n.a)({},Sn),{},{hack:Object(n.a)(Object(n.a)({},En),{},{praises_count:qn,user_praise:!En.user_praise})}),bt({type:nn.SET_DATA,payload:tn});case 6:case"end":return Si.stop()}},Nn)})),pr.apply(this,arguments)}var cr={topicId:wt,submitResult:In,submitRecords:$n,submitting:Ei,page:Kn,onPageChange:ki,hack:En,user:Sn==null?void 0:Sn.user,onTriggerPraise:Hi};return console.log(Sn,un==null?void 0:un.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(T.a,{className:"oj-custom-large-spin",size:"large",spinning:Ln},Sn?t.a.createElement("div",{className:"oj-custom-warp"},t.a.createElement("header",{className:R.a.header,style:{minWidth:1200}},t.a.createElement("div",null,t.a.createElement("img",{src:"".concat(x.a.IMG_SERVER,"/images/").concat(Gn.image_url),alt:"user",width:30}),t.a.createElement("span",null,Gn.name)),t.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},t.a.createElement("div",null,En.name),t.a.createElement(Jr.a,{onChange:function(Rn){},className:"font12 c-grey-999"})),t.a.createElement(Un.CopyToClipboard,{text:"".concat((zt=window.location)===null||zt===void 0?void 0:zt.origin,"/problems/").concat(En.identifier,"/share"),onCopy:function(){return O.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},t.a.createElement("span",{className:R.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",t.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),En.edit_privilege?t.a.createElement(g.a,{className:R.a.btn_back,to:"/problems/".concat(En.identifier,"/ojedit"),style:{marginRight:10}}," ",t.a.createElement(d.a,null)," \u7F16\u8F91"):null,t.a.createElement(g.a,{className:R.a.btn_back,onClick:function(){},to:"/problems"}," ",t.a.createElement(v.a,null),"\u9000\u51FA")),t.a.createElement(_.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:t.a.createElement(Ir,cr),rightChild:t.a.createElement(Vi,tr)})):null),t.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:Qt,className:"oj-modal"},t.a.createElement("section",{className:"oj-modal-content"},t.a.createElement("div",{className:"oj-modal-head"},t.a.createElement("img",{src:Qr.a,alt:""}),t.a.createElement("i",{onClick:function(){return an(!1)},className:"iconfont icon-guanbi1"})),t.a.createElement("aside",null,t.a.createElement("img",{className:"mr30",src:fn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",t.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},In==null?void 0:In.execute_time,"s"),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(In==null?void 0:In.time_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("aside",{className:"mb50"},t.a.createElement("img",{src:_r.a,className:"mr30"}),t.a.createElement("span",{className:"oj-modal-tt"},t.a.createElement("span",null,t.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),t.a.createElement("span",{className:"c-light-primary"},In==null?void 0:In.execute_memory,"mb")),t.a.createElement("span",null,t.a.createElement("span",null))),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(In==null?void 0:In.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function hi(ct){var xt=ct.languageValue,zt=ct.languageList,Ht=ct.onChangeLanguage,en=ct.title,Xt=ct.modify_code,Et=ct.onSyncCode,bt=ct.onShowCodeSetting,Jt=ct.onResetCode,wt=Object(y.h)(),cn=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:t.a.createElement(h.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Jt})};return t.a.createElement("div",{className:"action-bar"},t.a.createElement(C.a,{className:"oj-select",value:xt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ht},zt==null?void 0:zt.map(function(Ft){return t.a.createElement(C.a.Option,{key:Ft.language,value:Ft.language},Ft.language)})),t.a.createElement("span",null),t.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:cn},t.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),t.a.createElement("a",{onClick:bt},t.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Vi(ct){var xt=ct.id,zt=ct.input,Ht=ct.showNote,en=ct.onShowNote,Xt=ct.notes,Et=ct.onCancelNote,bt=ct.onAddNote,Jt=ct.debugResult,wt=ct.language,cn=ct.debuging,Ft=ct.submitting,pn=ct.executingMessage,Yn=ct.code,Ln=ct.onSubmitCode,Sn=ct.onDebugCode,Zn=ct.onChangeCode,In=ct.onChangeInput,$n=ct.onUpdateCode,Kn=Object(ie.a)(ct,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function fi(Ei){return t.a.createElement(hi,Object(ce.a)({},Kn,{onShowCodeSetting:Ei}))}var ti={id:xt,input:zt,debugResult:Jt,debuging:cn,submitting:Ft,executingMessage:pn,onDebugCode:Sn,onChangeCode:Zn,onSubmitCode:Ln,onChangeInput:In};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(E.a,{language:wt,value:Yn,onChange:Zn,ActionBarRender:fi}),t.a.createElement("div",{className:"note-form-area ".concat(Ht?"active":"")},t.a.createElement(le,{onCancel:Et,notes:Xt,callback:bt})),t.a.createElement(F.b,ti))}},WaYH:function(nt,Xe,V){"use strict";var ce=V("rePB"),ie=V("Ff2n"),W=V("VTBJ"),C=V("1OyB"),D=V("vuIU"),T=V("JX7q"),A=V("Ji7U"),O=V("LK+K"),f=V("cDcd"),p=V("TSYQ"),c=V.n(p),s=V("sboe"),n=V("OZM5"),o=function(g){var m=g.prefixCls,_=g.level,x=g.isStart,h=g.isEnd;if(!_)return null;for(var E="".concat(m,"-indent-unit"),S=[],w=0;w<_;w+=1){var R;S.push(f.createElement("span",{key:w,className:c()(E,(R={},Object(ce.a)(R,"".concat(E,"-start"),x[w+1]),Object(ce.a)(R,"".concat(E,"-end"),h[w+1]),Object(ce.a)(R,"".concat(E,"-end-first-level"),!w&&h[0]),R))}))}return f.createElement("span",{"aria-hidden":"true",className:"".concat(m,"-indent")},S)},r=o,l=V("815F"),a="open",i="close",t="---",d=function(b){Object(A.a)(m,b);var g=Object(O.a)(m);function m(){var _;return Object(C.a)(this,m),_=g.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(x){var h=_.props.context.onNodeClick;h(x,Object(l.b)(_.props)),_.isSelectable()?_.onSelect(x):_.onCheck(x)},_.onSelectorDoubleClick=function(x){var h=_.props.context.onNodeDoubleClick;h(x,Object(l.b)(_.props))},_.onSelect=function(x){if(_.isDisabled())return;var h=_.props.context.onNodeSelect;x.preventDefault(),h(x,Object(l.b)(_.props))},_.onCheck=function(x){if(_.isDisabled())return;var h=_.props,E=h.disableCheckbox,S=h.checked,w=_.props.context.onNodeCheck;if(!_.isCheckable()||E)return;x.preventDefault();var R=!S;w(x,Object(l.b)(_.props),R)},_.onMouseEnter=function(x){var h=_.props.context.onNodeMouseEnter;h(x,Object(l.b)(_.props))},_.onMouseLeave=function(x){var h=_.props.context.onNodeMouseLeave;h(x,Object(l.b)(_.props))},_.onContextMenu=function(x){var h=_.props.context.onNodeContextMenu;h(x,Object(l.b)(_.props))},_.onDragStart=function(x){var h=_.props.context.onNodeDragStart;x.stopPropagation(),_.setState({dragNodeHighlight:!0}),h(x,Object(T.a)(_));try{x.dataTransfer.setData("text/plain","")}catch(E){}},_.onDragEnter=function(x){var h=_.props.context.onNodeDragEnter;x.preventDefault(),x.stopPropagation(),h(x,Object(T.a)(_))},_.onDragOver=function(x){var h=_.props.context.onNodeDragOver;x.preventDefault(),x.stopPropagation(),h(x,Object(T.a)(_))},_.onDragLeave=function(x){var h=_.props.context.onNodeDragLeave;x.stopPropagation(),h(x,Object(T.a)(_))},_.onDragEnd=function(x){var h=_.props.context.onNodeDragEnd;x.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(x,Object(T.a)(_))},_.onDrop=function(x){var h=_.props.context.onNodeDrop;x.preventDefault(),x.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(x,Object(T.a)(_))},_.onExpand=function(x){var h=_.props.context.onNodeExpand;h(x,Object(l.b)(_.props))},_.setSelectHandle=function(x){_.selectHandle=x},_.getNodeState=function(){var x=_.props.expanded;return _.isLeaf()?null:x?a:i},_.hasChildren=function(){var x=_.props.eventKey,h=_.props.context.keyEntities,E=h[x]||{},S=E.children;return!!(S||[]).length},_.isLeaf=function(){var x=_.props,h=x.isLeaf,E=x.loaded,S=_.props.context.loadData,w=_.hasChildren();return h===!1?!1:h||!S&&!w||S&&E&&!w},_.isDisabled=function(){var x=_.props.disabled,h=_.props.context.disabled;return!!(h||x)},_.isCheckable=function(){var x=_.props.checkable,h=_.props.context.checkable;return!h||x===!1?!1:h},_.syncLoadData=function(x){var h=x.expanded,E=x.loading,S=x.loaded,w=_.props.context,R=w.loadData,N=w.onNodeLoad;if(E)return;R&&h&&!_.isLeaf()&&(!_.hasChildren()&&!S&&N(Object(l.b)(_.props)))},_.renderSwitcher=function(){var x=_.props,h=x.expanded,E=x.switcherIcon,S=_.props.context,w=S.prefixCls,R=S.switcherIcon,N=E||R;if(_.isLeaf())return f.createElement("span",{className:c()("".concat(w,"-switcher"),"".concat(w,"-switcher-noop"))},typeof N=="function"?N(Object(W.a)(Object(W.a)({},_.props),{},{isLeaf:!0})):N);var F=c()("".concat(w,"-switcher"),"".concat(w,"-switcher_").concat(h?a:i));return f.createElement("span",{onClick:_.onExpand,className:F},typeof N=="function"?N(Object(W.a)(Object(W.a)({},_.props),{},{isLeaf:!1})):N)},_.renderCheckbox=function(){var x=_.props,h=x.checked,E=x.halfChecked,S=x.disableCheckbox,w=_.props.context.prefixCls,R=_.isDisabled(),N=_.isCheckable();if(!N)return null;var F=typeof N!="boolean"?N:null;return f.createElement("span",{className:c()("".concat(w,"-checkbox"),h&&"".concat(w,"-checkbox-checked"),!h&&E&&"".concat(w,"-checkbox-indeterminate"),(R||S)&&"".concat(w,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var x=_.props.loading,h=_.props.context.prefixCls;return f.createElement("span",{className:c()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(_.getNodeState()||"docu"),x&&"".concat(h,"-icon_loading"))})},_.renderSelector=function(){var x=_.state.dragNodeHighlight,h=_.props,E=h.title,S=h.selected,w=h.icon,R=h.loading,N=h.data,F=_.props.context,z=F.prefixCls,q=F.showIcon,B=F.icon,M=F.draggable,G=F.loadData,J=F.titleRender,K=_.isDisabled(),Z="".concat(z,"-node-content-wrapper"),le;if(q){var de=w||B;le=de?f.createElement("span",{className:c()("".concat(z,"-iconEle"),"".concat(z,"-icon__customize"))},typeof de=="function"?de(_.props):de):_.renderIcon()}else G&&R&&(le=_.renderIcon());var Te;typeof E=="function"?Te=E(N):J?Te=J(N):Te=E;var we=f.createElement("span",{className:"".concat(z,"-title")},Te);return f.createElement("span",{ref:_.setSelectHandle,title:typeof E=="string"?E:"",className:c()("".concat(Z),"".concat(Z,"-").concat(_.getNodeState()||"normal"),!K&&(S||x)&&"".concat(z,"-node-selected"),!K&&M&&"draggable"),draggable:!K&&M||void 0,"aria-grabbed":!K&&M||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:M?_.onDragStart:void 0},le,we)},_}return Object(D.a)(m,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var x=this.props.selectable,h=this.props.context.selectable;return typeof x=="boolean"?x:h}},{key:"render",value:function(){var x,h=this.props,E=h.eventKey,S=h.className,w=h.style,R=h.dragOver,N=h.dragOverGapTop,F=h.dragOverGapBottom,z=h.isLeaf,q=h.isStart,B=h.isEnd,M=h.expanded,G=h.selected,J=h.checked,K=h.halfChecked,Z=h.loading,le=h.domRef,de=h.active,Te=h.onMouseMove,we=Object(ie.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ie=this.props.context,_e=Ie.prefixCls,ye=Ie.filterTreeNode,Ke=Ie.draggable,Me=Ie.keyEntities,Fe=this.isDisabled(),Ge=Object(n.f)(we),Ee=Me[E]||{},me=Ee.level,We=B[B.length-1];return f.createElement("div",Object.assign({ref:le,className:c()(S,"".concat(_e,"-treenode"),(x={},Object(ce.a)(x,"".concat(_e,"-treenode-disabled"),Fe),Object(ce.a)(x,"".concat(_e,"-treenode-switcher-").concat(M?"open":"close"),!z),Object(ce.a)(x,"".concat(_e,"-treenode-checkbox-checked"),J),Object(ce.a)(x,"".concat(_e,"-treenode-checkbox-indeterminate"),K),Object(ce.a)(x,"".concat(_e,"-treenode-selected"),G),Object(ce.a)(x,"".concat(_e,"-treenode-loading"),Z),Object(ce.a)(x,"".concat(_e,"-treenode-active"),de),Object(ce.a)(x,"".concat(_e,"-treenode-leaf-last"),We),Object(ce.a)(x,"drag-over",!Fe&&R),Object(ce.a)(x,"drag-over-gap-top",!Fe&&N),Object(ce.a)(x,"drag-over-gap-bottom",!Fe&&F),Object(ce.a)(x,"filter-node",ye&&ye(Object(l.b)(this.props))),x)),style:w,onDragEnter:Ke?this.onDragEnter:void 0,onDragOver:Ke?this.onDragOver:void 0,onDragLeave:Ke?this.onDragLeave:void 0,onDrop:Ke?this.onDrop:void 0,onDragEnd:Ke?this.onDragEnd:void 0,onMouseMove:Te},Ge),f.createElement(r,{prefixCls:_e,level:me,isStart:q,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),m}(f.Component),v=function(g){return f.createElement(s.a.Consumer,null,function(m){return f.createElement(d,Object.assign({},g,{context:m}))})};v.displayName="TreeNode",v.defaultProps={title:t},v.isTreeNode=1;var y=Xe.a=v},Wtmd:function(nt,Xe,V){nt.exports=V.p+"static/c.03ba6fd6.svg"},Wx9E:function(nt,Xe,V){},XIdC:function(nt,Xe,V){"use strict";var ce=V("rePB"),ie=V("ODXe"),W=V("Ff2n"),C=V("cDcd"),D=V.n(C),T=V("TSYQ"),A=V.n(T),O=V("6cGi"),f=V("4IlW"),p=C.forwardRef(function(c,s){var n,o=c.prefixCls,r=o===void 0?"rc-switch":o,l=c.className,a=c.checked,i=c.defaultChecked,t=c.disabled,d=c.loadingIcon,v=c.checkedChildren,y=c.unCheckedChildren,b=c.onClick,g=c.onChange,m=c.onKeyDown,_=Object(W.a)(c,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),x=Object(O.a)(!1,{value:a,defaultValue:i}),h=Object(ie.a)(x,2),E=h[0],S=h[1];function w(z,q){var B=E;return t||(B=z,S(B),g==null||g(B,q)),B}function R(z){z.which===f.a.LEFT?w(!1,z):z.which===f.a.RIGHT&&w(!0,z),m==null||m(z)}function N(z){var q=w(!E,z);b==null||b(q,z)}var F=A()(r,l,(n={},Object(ce.a)(n,"".concat(r,"-checked"),E),Object(ce.a)(n,"".concat(r,"-disabled"),t),n));return C.createElement("button",Object.assign({},_,{type:"button",role:"switch","aria-checked":E,disabled:t,className:F,ref:s,onKeyDown:R,onClick:N}),d,C.createElement("span",{className:"".concat(r,"-inner")},E?v:y))});p.displayName="Switch",Xe.a=p},Y1PL:function(nt,Xe,V){"use strict";V.r(Xe),V.d(Xe,"ResizableTextArea",function(){return K});var ce=V("wx14"),ie=V("1OyB"),W=V("vuIU"),C=V("Ji7U"),D=V("LK+K"),T=V("cDcd"),A=V("VTBJ"),O=V("rePB"),f=V("Zm9Q"),p=V("Kwbf"),c=V("c+Xe"),s=V("m+aA"),n=V("bdgK"),o=new Map;function r(de){de.forEach(function(Te){var we,Ie=Te.target;(we=o.get(Ie))===null||we===void 0||we.forEach(function(_e){return _e(Ie)})})}var l=new n.default(r),a=null,i=null;function t(de,Te){o.has(de)||(o.set(de,new Set),l.observe(de)),o.get(de).add(Te)}function d(de,Te){o.has(de)&&(o.get(de).delete(Te),o.get(de).size||(l.unobserve(de),o.delete(de)))}var v=function(de){Object(C.a)(we,de);var Te=Object(D.a)(we);function we(){return Object(ie.a)(this,we),Te.apply(this,arguments)}return Object(W.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(T.Component),y=T.createContext(null);function b(de){var Te=de.children,we=de.onBatchResize,Ie=T.useRef(0),_e=T.useRef([]),ye=T.useContext(y),Ke=T.useCallback(function(Me,Fe,Ge){Ie.current+=1;var Ee=Ie.current;_e.current.push({size:Me,element:Fe,data:Ge}),Promise.resolve().then(function(){Ee===Ie.current&&(we==null||we(_e.current),_e.current=[])}),ye==null||ye(Me,Fe,Ge)},[we,ye]);return T.createElement(y.Provider,{value:Ke},Te)}function g(de){var Te=de.children,we=de.disabled,Ie=T.useRef(null),_e=T.useRef(null),ye=T.useContext(y),Ke=T.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Me=T.isValidElement(Te)&&Object(c.c)(Te),Fe=Me?Te.ref:null,Ge=T.useMemo(function(){return Object(c.a)(Fe,Ie)},[Fe,Ie]),Ee=T.useRef(de);Ee.current=de;var me=T.useCallback(function(We){var He=Ee.current,it=He.onResize,re=He.data,P=We.getBoundingClientRect(),j=P.width,ee=P.height,$=We.offsetWidth,Q=We.offsetHeight,xe=Math.floor(j),De=Math.floor(ee);if(Ke.current.width!==xe||Ke.current.height!==De||Ke.current.offsetWidth!==$||Ke.current.offsetHeight!==Q){var dt={width:xe,height:De,offsetWidth:$,offsetHeight:Q};Ke.current=dt;var Ne=$===Math.round(j)?j:$,Be=Q===Math.round(ee)?ee:Q,tt=Object(A.a)(Object(A.a)({},dt),{},{offsetWidth:Ne,offsetHeight:Be});ye==null||ye(tt,We,re),it&&Promise.resolve().then(function(){it(tt,We)})}},[]);return T.useEffect(function(){var We=Object(s.a)(Ie.current)||Object(s.a)(_e.current);return We&&!we&&t(We,me),function(){return d(We,me)}},[Ie.current,we]),T.createElement(v,{ref:_e},Me?T.cloneElement(Te,{ref:Ge}):Te)}var m="rc-observer-key";function _(de){var Te=de.children,we=Object(f.a)(Te);return we.map(function(Ie,_e){var ye=(Ie==null?void 0:Ie.key)||"".concat(m,"-").concat(_e);return T.createElement(g,Object(ce.a)({},de,{key:ye}),Ie)})}_.Collection=b;var x=_,h=V("bT9E"),E=V("TSYQ"),S=V.n(E),w=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,R=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},F;function z(de){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(Te&&N[we])return N[we];var Ie=window.getComputedStyle(de),_e=Ie.getPropertyValue("box-sizing")||Ie.getPropertyValue("-moz-box-sizing")||Ie.getPropertyValue("-webkit-box-sizing"),ye=parseFloat(Ie.getPropertyValue("padding-bottom"))+parseFloat(Ie.getPropertyValue("padding-top")),Ke=parseFloat(Ie.getPropertyValue("border-bottom-width"))+parseFloat(Ie.getPropertyValue("border-top-width")),Me=R.map(function(Ge){return"".concat(Ge,":").concat(Ie.getPropertyValue(Ge))}).join(";"),Fe={sizingStyle:Me,paddingSize:ye,borderSize:Ke,boxSizing:_e};return Te&&we&&(N[we]=Fe),Fe}function q(de){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),de.getAttribute("wrap")?F.setAttribute("wrap",de.getAttribute("wrap")):F.removeAttribute("wrap");var _e=z(de,Te),ye=_e.paddingSize,Ke=_e.borderSize,Me=_e.boxSizing,Fe=_e.sizingStyle;F.setAttribute("style","".concat(Fe,";").concat(w)),F.value=de.value||de.placeholder||"";var Ge=Number.MIN_SAFE_INTEGER,Ee=Number.MAX_SAFE_INTEGER,me=F.scrollHeight,We;if(Me==="border-box"?me+=Ke:Me==="content-box"&&(me-=ye),we!==null||Ie!==null){F.value=" ";var He=F.scrollHeight-ye;we!==null&&(Ge=He*we,Me==="border-box"&&(Ge=Ge+ye+Ke),me=Math.max(Ge,me)),Ie!==null&&(Ee=He*Ie,Me==="border-box"&&(Ee=Ee+ye+Ke),We=me>Ee?"":"hidden",me=Math.min(Ee,me))}return{height:me,minHeight:Ge,maxHeight:Ee,overflowY:We,resize:"none"}}var B=V("Gytx"),M=V.n(B),G;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(G||(G={}));var J=function(de){Object(C.a)(we,de);var Te=Object(D.a)(we);function we(Ie){var _e;return Object(ie.a)(this,we),_e=Te.call(this,Ie),_e.nextFrameActionId=void 0,_e.resizeFrameId=void 0,_e.textArea=void 0,_e.saveTextArea=function(ye){_e.textArea=ye},_e.handleResize=function(ye){var Ke=_e.state.resizeStatus,Me=_e.props,Fe=Me.autoSize,Ge=Me.onResize;if(Ke!==G.NONE)return;typeof Ge=="function"&&Ge(ye),Fe&&_e.resizeOnNextFrame()},_e.resizeOnNextFrame=function(){cancelAnimationFrame(_e.nextFrameActionId),_e.nextFrameActionId=requestAnimationFrame(_e.resizeTextarea)},_e.resizeTextarea=function(){var ye=_e.props.autoSize;if(!ye||!_e.textArea)return;var Ke=ye.minRows,Me=ye.maxRows,Fe=q(_e.textArea,!1,Ke,Me);_e.setState({textareaStyles:Fe,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(_e.resizeFrameId),_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:G.RESIZED},function(){_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:G.NONE}),_e.fixFirefoxAutoScroll()})})})})},_e.renderTextArea=function(){var ye=_e.props,Ke=ye.prefixCls,Me=Ke===void 0?"rc-textarea":Ke,Fe=ye.autoSize,Ge=ye.onResize,Ee=ye.className,me=ye.disabled,We=_e.state,He=We.textareaStyles,it=We.resizeStatus,re=Object(h.a)(_e.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),P=S()(Me,Ee,Object(O.a)({},"".concat(Me,"-disabled"),me));"value"in re&&(re.value=re.value||"");var j=Object(A.a)(Object(A.a)(Object(A.a)({},_e.props.style),He),it===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return T.createElement(x,{onResize:_e.handleResize,disabled:!(Fe||Ge)},T.createElement("textarea",Object(ce.a)({},re,{className:P,style:j,ref:_e.saveTextArea})))},_e.state={textareaStyles:{},resizeStatus:G.NONE},_e}return Object(W.a)(we,[{key:"componentDidUpdate",value:function(_e){(_e.value!==this.props.value||!M()(_e.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var _e=this.textArea.selectionStart,ye=this.textArea.selectionEnd;this.textArea.setSelectionRange(_e,ye)}}catch(Ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(T.Component),K=J,Z=function(de){Object(C.a)(we,de);var Te=Object(D.a)(we);function we(Ie){var _e;Object(ie.a)(this,we),_e=Te.call(this,Ie),_e.resizableTextArea=void 0,_e.focus=function(){_e.resizableTextArea.textArea.focus()},_e.saveTextArea=function(Ke){_e.resizableTextArea=Ke},_e.handleChange=function(Ke){var Me=_e.props.onChange;_e.setValue(Ke.target.value,function(){_e.resizableTextArea.resizeTextarea()}),Me&&Me(Ke)},_e.handleKeyDown=function(Ke){var Me=_e.props,Fe=Me.onPressEnter,Ge=Me.onKeyDown;Ke.keyCode===13&&Fe&&Fe(Ke),Ge&&Ge(Ke)};var ye=typeof Ie.value=="undefined"||Ie.value===null?Ie.defaultValue:Ie.value;return _e.state={value:ye},_e}return Object(W.a)(we,[{key:"setValue",value:function(_e,ye){"value"in this.props||this.setState({value:_e},ye)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return T.createElement(K,Object(ce.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(_e){return"value"in _e?{value:_e.value}:null}}]),we}(T.Component),le=Xe.default=Z},Z8dc:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(nt,Xe,V){"use strict";var ce=V("BoS7"),ie=V("Sdc0"),W=V("OaEy"),C=V("2fM7"),D=V("cDcd"),T=V.n(D),A=V("lOMy"),O=V.n(A),f=C.a.Option;Xe.a=function(p){var c=p.onFontSizeChange,s=p.cmFontSize,n=p.cmCodeMode,o=p.onCodeModeChange,r=p.onTabToSpace,l=p.className,a=l===void 0?"":l,i=p.tabToSpace,t=p.children;return T.a.createElement("div",{className:"tpi-code-setting ".concat(a)},T.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),T.a.createElement("section",null,T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),T.a.createElement(C.a,{bordered:!1,size:"small",value:n,onChange:o},T.a.createElement(f,{value:"vs"},"\u767D\u8272\u80CC\u666F"),T.a.createElement(f,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),T.a.createElement(C.a,{bordered:!1,size:"small",value:s,onChange:c},T.a.createElement(f,{value:12},"12px"),T.a.createElement(f,{value:14},"14px"),T.a.createElement(f,{value:16},"16px"),T.a.createElement(f,{value:18},"18px"),T.a.createElement(f,{value:20},"20px"),T.a.createElement(f,{value:22},"22px"))),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"Tab\u8F6C\u6362"),T.a.createElement(ie.a,{checked:i,onChange:r}))),T.a.createElement("h3",null,"\u5FEB\u6377\u952E"),T.a.createElement("section",null,T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),T.a.createElement("span",null,"Ctrl + S")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),T.a.createElement("span",null,"F1 / Alt + F1")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),T.a.createElement("span",null,"Ctrl + ]/[")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),T.a.createElement("span",null,"Ctrl + Shift + \\")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),T.a.createElement("span",null,"Home")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),T.a.createElement("span",null,"End"))),t)}},ZW9T:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return q});var ce=V("k1fw"),ie=V("miYZ"),W=V("tsqr"),C=V("rAM+"),D=V("tJVT"),T=V("PpiC"),A=V("cDcd"),O=V.n(A),f=V("bdgK"),p=V("oBTY"),c=V("9og8"),s=V("WmNS"),n=V.n(s),o={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},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"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"for",content:["for( ; ; ){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)}]},a={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(` `)}]},i=V("5VLF"),t=V.n(i),d={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"]}},v=function(M,G){return G.map(function(J){return{label:J,kind:M.languages.CompletionItemKind.Keyword,insertText:J}})},y=function(M){return Object.keys(d.tables).map(function(G){return{label:G,kind:M.languages.CompletionItemKind.Variable,insertText:G}})},b=function(M,G){var J=d.tables[M];return J?J.map(function(K){return{label:K,kind:G.languages.CompletionItemKind.Field,insertText:K}}):[]};function g(B,M,G,J,K){var Z=M.getWordUntilPosition(G),le={startLineNumber:G.lineNumber,endLineNumber:G.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn},de=J.map(function(Te){return{label:Te,kind:B.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}});return K.map(function(Te){de.push(Object(ce.a)(Object(ce.a)({},Te),{},{range:le}))}),de}var m=function(B){d.languages.map(function(K){return B.languages.registerDocumentFormattingEditProvider(K,{provideDocumentFormattingEdits:function(le,de,Te){return Object(c.a)(n.a.mark(function we(){var Ie;return n.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return Ie=t()(le.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}),ye.abrupt("return",[{range:le.getFullModelRange(),text:Ie}]);case 2:case"end":return ye.stop()}},we)}))()}}),K});var M=l.quickKey.map(function(K){return{label:K.label,kind:B.languages.CompletionItemKind.Method,insertText:K.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),G=a.quickKey.map(function(K){return{label:K.label,kind:B.languages.CompletionItemKind.Method,insertText:K.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=r.quickKey.map(function(K){return{label:K.label,kind:B.languages.CompletionItemKind.Method,insertText:K.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(p.a)(l.keywords),Object(p.a)(l.quickKey.map(function(K){return K.label}))),provideCompletionItems:function(Z,le){var de=Z.getValueInRange({startLineNumber:le.lineNumber,startColumn:1,endLineNumber:le.lineNumber,endColumn:le.column}),Te=de.match(/cu/gim);console.log("match:",Te,le,de,Z);var we=[],Ie=le.lineNumber,_e=le.column,ye=Z.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:_e}),Ke=ye.trim().split(/\s+/),Me=Ke[Ke.length-1];if(Me.endsWith(".")){var Fe=Me.slice(0,Me.length-1);Object.keys(d.tables).includes(Fe)&&(we=Object(p.a)(b(Fe,B)))}else Me==="."?we=[]:we=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,l.keywords)),Object(p.a)(M));return{suggestions:we}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(p.a)(o.keywords)),provideCompletionItems:function(Z,le){var de=Z.getValueInRange({startLineNumber:le.lineNumber,startColumn:1,endLineNumber:le.lineNumber,endColumn:le.column}),Te=de.match(/cu/gim);console.log("match:",Te,le,de,Z);var we=[],Ie=le.lineNumber,_e=le.column,ye=Z.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:_e}),Ke=ye.trim().split(/\s+/),Me=Ke[Ke.length-1];if(Me.endsWith(".")){var Fe=Me.slice(0,Me.length-1);Object.keys(d.tables).includes(Fe)&&(we=Object(p.a)(b(Fe,B)))}else Me==="."?we=[]:we=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,o.keywords)));return{suggestions:we}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(p.a)(r.keywords)),provideCompletionItems:function(Z,le){var de=[],Te=le.lineNumber,we=le.column,Ie=Z.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:we}),_e=Ie.trim().split(/\s+/),ye=_e[_e.length-1];if(ye.endsWith(".")){var Ke=ye.slice(0,ye.length-1);Object.keys(d.tables).includes(Ke)&&(de=Object(p.a)(b(Ke,B)))}else ye==="."?de=[]:de=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,r.keywords)),Object(p.a)(J));return{suggestions:de}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(p.a)(a.keywords)),provideCompletionItems:function(Z,le){var de=[],Te=le.lineNumber,we=le.column,Ie=Z.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:we}),_e=Ie.trim().split(/\s+/),ye=_e[_e.length-1];if(ye.endsWith(".")){var Ke=ye.slice(0,ye.length-1);Object.keys(d.tables).includes(Ke)&&(de=Object(p.a)(b(Ke,B)))}else ye==="."?de=[]:de=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,a.keywords)),Object(p.a)(G));return{suggestions:de}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",x=V("LvDl"),h=V("+ua5");function E(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function S(){}var w=!1,R={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function N(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=B;if(Array.isArray(B)){for(var G=0;G0||$t.target.offsetWidth>0)&&qe.current.instance.layout()}}catch(Re){Lt.e(Re)}finally{Lt.f()}}),Ze.observe(lt.current)),Ze}function Ve(){W.b.warn(decodeURIComponent(_))}var at=function(){var mt=qe.current.instance;if(Z!=null&&mt&&Ce){var Lt=mt.getModel();Lt&&Z!==Lt.getValue()&&(w=!0,Lt.setValue(Z),mt.layout(),w=!1)}};Object(A.useEffect)(function(){Ye.current&&clearTimeout(Ye.current),Ye.current=setTimeout(function(){at()},500)},[Z,Ce,qe.current]),Object(A.useEffect)(function(){if(dt&&qe.current&&qe.current.instance){var Ze=qe.current.instance;Ze.changeViewZones(function(Lt){var Mt=document.createElement("div");Mt.style.padding="10px 20px",Mt.style.width="calc(100% - 20px)",Mt.className="my-error-line-wrp",Mt.innerHTML=Be,Lt.addZone({afterLineNumber:dt||11,heightInLines:3,domNode:Mt})});var mt={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}};Ze.addOverlayWidget(mt),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[dt,qe.current,Ce]);function _t(){var Ze=qe.current.instance;if(Ze){var mt=Ze.getSelection(),Lt=qe.current.pastePos||{},Mt=new F.Range(Lt.startLineNumber||mt.endLineNumber,Lt.startColumn||mt.endColumn,Lt.endLineNumber||mt.endLineNumber,Lt.endColumn||mt.endColumn);setTimeout(function(){Ze.executeEdits("",[{range:Mt,text:""}])},300)}}function kt(Ze){(window.navigator.platform.match("Mac")?Ze.metaKey:Ze.ctrlKey)&&Ze.keyCode==83&&(Ze.preventDefault(),Ee())}var Bt=function(){if(We&&qe.current.instance){var mt=qe.current.instance.getContentHeight();It(mt0||j.target.offsetWidth>0)&&We.layout()}}catch(ee){re.e(ee)}finally{re.f()}}),He.observe(Ie.current)),He}Object(A.useEffect)(function(){Ie.current&&V.e(27).then(V.t.bind(null,"M/lh",7)).then(function(We){F=We;var He=F.editor.createDiffEditor(Ie.current,Object(ce.a)(Object(ce.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},we),{},{wordWrap:!0}));Me(He);var it=Fe(He);return function(){He.dispose();var re=He.getModel();re&&re.dispose(),it.unobserve(Ie.current)}})},[]),Object(A.useEffect)(function(){Ke&&Ke.setModel({original:F.editor.createModel(Z,de),modified:F.editor.createModel(le,de)})},[Z,le,de,Ke]);var Ge=E(G),Ee=E(K),me={width:Ge,height:Ee};return O.a.createElement("div",{className:"my-diff-editor",ref:Ie,style:me})}},ZpRC:function(nt,Xe,V){"use strict";function ce(c){return typeof c=="object"&&c!=null&&c.nodeType===1}function ie(c,s){return(!s||c!=="hidden")&&c!=="visible"&&c!=="clip"}function W(c,s){if(c.clientHeights||l>c&&a=s&&i>=n?l-c-o:a>s&&in?a-s+r:0}var D=function(c,s){var n=window,o=s.scrollMode,r=s.block,l=s.inline,a=s.boundary,i=s.skipOverflowHiddenElements,t=typeof a=="function"?a:function(He){return He!==a};if(!ce(c))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,v=[],y=c;ce(y)&&t(y);){if((y=y.parentElement)===d){v.push(y);break}y!=null&&y===document.body&&W(y)&&!W(document.documentElement)||y!=null&&W(y,i)&&v.push(y)}for(var b=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,x=c.getBoundingClientRect(),h=x.height,E=x.width,S=x.top,w=x.right,R=x.bottom,N=x.left,F=r==="start"||r==="nearest"?S:r==="end"?R:S+h/2,z=l==="center"?N+E/2:l==="end"?w:N,q=[],B=0;B=0&&N>=0&&R<=g&&w<=b&&S>=Z&&R<=de&&N>=Te&&w<=le)return q;var we=getComputedStyle(M),Ie=parseInt(we.borderLeftWidth,10),_e=parseInt(we.borderTopWidth,10),ye=parseInt(we.borderRightWidth,10),Ke=parseInt(we.borderBottomWidth,10),Me=0,Fe=0,Ge="offsetWidth"in M?M.offsetWidth-M.clientWidth-Ie-ye:0,Ee="offsetHeight"in M?M.offsetHeight-M.clientHeight-_e-Ke:0;if(d===M)Me=r==="start"?F:r==="end"?F-g:r==="nearest"?C(_,_+g,g,_e,Ke,_+F,_+F+h,h):F-g/2,Fe=l==="start"?z:l==="center"?z-b/2:l==="end"?z-b:C(m,m+b,b,Ie,ye,m+z,m+z+E,E),Me=Math.max(0,Me+_),Fe=Math.max(0,Fe+m);else{Me=r==="start"?F-Z-_e:r==="end"?F-de+Ke+Ee:r==="nearest"?C(Z,de,J,_e,Ke+Ee,F,F+h,h):F-(Z+J/2)+Ee/2,Fe=l==="start"?z-Te-Ie:l==="center"?z-(Te+K/2)+Ge/2:l==="end"?z-le+ye+Ge:C(Te,le,K,Ie,ye+Ge,z,z+E,E);var me=M.scrollLeft,We=M.scrollTop;F+=We-(Me=Math.max(0,Math.min(We+Me,M.scrollHeight-J+Ee))),z+=me-(Fe=Math.max(0,Math.min(me+Fe,M.scrollWidth-K+Ge)))}q.push({el:M,top:Me,left:Fe})}return q};function T(c){return c===Object(c)&&Object.keys(c).length!==0}function A(c,s){s===void 0&&(s="auto");var n="scrollBehavior"in document.body.style;c.forEach(function(o){var r=o.el,l=o.top,a=o.left;r.scroll&&n?r.scroll({top:l,left:a,behavior:s}):(r.scrollTop=l,r.scrollLeft=a)})}function O(c){return c===!1?{block:"end",inline:"nearest"}:T(c)?c:{block:"start",inline:"nearest"}}function f(c,s){var n=!c.ownerDocument.documentElement.contains(c);if(T(s)&&typeof s.behavior=="function")return s.behavior(n?[]:D(c,s));if(n)return;var o=O(s);return A(D(c,o),o.behavior)}var p=Xe.a=f},ZsLC:function(nt,Xe,V){nt.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return C}),V.d(Xe,"a",function(){return D});var ce=V("je13"),ie=V.n(ce),W=!1;function C(T,A){var O=ie.a.get("__ec");O||(O={}),O[T]=A,ie.a.set("__ec",O)}function D(T,A){var O=ie.a.get("__ec");return O?O[T]===void 0?A:O[T]:A}},bT9E:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return ie});var ce=V("VTBJ");function ie(W,C){var D=Object(ce.a)({},W);return Array.isArray(C)&&C.forEach(function(T){delete D[T]}),D}},bdLU:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return ce});var ce;(function(ie){ie[ie.NOMATCH=-1]="NOMATCH",ie[ie.OK=0]="OK",ie[ie.TIMEOUT=2]="TIMEOUT",ie[ie.PODFAILURE=3]="PODFAILURE",ie[ie.COMPILEFAILURE=4]="COMPILEFAILURE",ie[ie.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ce||(ce={}))},biw7:function(nt,Xe,V){"use strict";var ce=V("cDcd"),ie=V.n(ce),W=ce.createContext(null);Xe.a=W},c5Ni:function(nt,Xe,V){},cDPC:function(nt,Xe,V){"use strict";var ce=V("tJVT"),ie=V("cDcd"),W=V.n(ie),C=V("i3hx"),D=V.n(C);Xe.a=function(T){var A=T.defaultX,O=A===void 0?"40%":A,f=T.leftChild,p=T.rightChild,c=T.className,s=T.hideResize,n=s===void 0?!1:s,o=Object(ie.useState)(O),r=Object(ce.a)(o,2),l=r[0],a=r[1],i=Object(ie.useRef)();function t(){i.current=!0}Object(ie.useEffect)(function(){function y(g){i.current&&a(g.pageX)}function b(){i.current=!1}return window.addEventListener("mousemove",y),window.addEventListener("mouseup",b),function(){window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",b)}},[]);var d=typeof l=="number"&&l!==.01?"".concat(l,"px"):O,v="calc(100% - ".concat(n?"0px":"4px"," - ").concat(d,")");return W.a.createElement("div",{className:"split-panel-container ".concat(c)},W.a.createElement("section",{style:{width:d,display:l===.01?"none":""}},f),W.a.createElement("section",{className:"resize-x-bar",onMouseDown:t},W.a.createElement("a",{className:"btn-resize"},W.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},W.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),W.a.createElement("section",{style:{width:v}},p))}},dejd:function(nt,Xe,V){},dmUQ:function(nt,Xe,V){"use strict";var ce=V("Ff2n"),ie=V("rePB"),W=V("1OyB"),C=V("vuIU"),D=V("Ji7U"),T=V("md7G"),A=V("foSv"),O=V("cDcd"),f=V.n(O),p=V("TSYQ"),c=V.n(p),s=V("4IlW");function n(h,E){var S=Object.keys(h);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);E&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(h,R).enumerable})),S.push.apply(S,w)}return S}function o(h){for(var E=1;E1?K-1:0),le=1;le1?B-1:0),G=1;G=0)return parseInt(q.slice(q.indexOf("e-")+2),10);var B=0;return q.indexOf(".")>=0&&(B=q.length-q.indexOf(".")-1),B},R.getInputDisplayValue=function(z){var q=z||R.state,B=q.focused,M=q.inputValue,G=q.value,J;B?J=M:J=R.toPrecisionAsStep(G),J==null&&(J="");var K=R.formatWrapper(J);return b(R.props.decimalSeparator)&&(K=K.toString().replace(".",R.props.decimalSeparator)),K},R.recordCursorPosition=function(){try{R.cursorStart=R.input.selectionStart,R.cursorEnd=R.input.selectionEnd,R.currentValue=R.input.value,R.cursorBefore=R.input.value.substring(0,R.cursorStart),R.cursorAfter=R.input.value.substring(R.cursorEnd)}catch(z){}},R.restoreByAfter=function(z){if(z===void 0)return!1;var q=R.input.value,B=q.lastIndexOf(z);if(B===-1)return!1;var M=R.cursorBefore.length;return R.lastKeyCode===s.a.DELETE&&R.cursorBefore.charAt(M-1)===z[0]?(R.fixCaret(M,M),!0):B+z.length===q.length?(R.fixCaret(B,B),!0):!1},R.partRestoreByAfter=function(z){return z===void 0?!1:Array.prototype.some.call(z,function(q,B){var M=z.substring(B);return R.restoreByAfter(M)})},R.isNotCompleteNumber=function(z){return isNaN(z)||z===""||z===null||z&&z.toString().indexOf(".")===z.toString().length-1},R.stop=function(){R.autoStepTimer&&clearTimeout(R.autoStepTimer)},R.down=function(z,q,B){R.pressingUpOrDown=!0,R.step("down",z,q,B)},R.up=function(z,q,B){R.pressingUpOrDown=!0,R.step("up",z,q,B)},R.saveInput=function(z){R.input=z};var N=w.value;N===void 0&&(N=w.defaultValue),R.state={focused:w.autoFocus};var F=R.getValidValue(R.toNumber(N));return R.state=o(o({},R.state),{},{inputValue:R.toPrecisionAsStep(F),value:F}),R}return Object(C.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(R){var N=this.props,F=N.value,z=N.onChange,q=N.max,B=N.min,M=this.state.focused;if(R){if(!g(R.value,F)||!g(R.max,q)||!g(R.min,B)){var G=M?F:this.getValidValue(F),J;this.pressingUpOrDown?J=G:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:J})}var K="value"in this.props?F:this.state.value;"max"in this.props&&R.max!==q&&typeof K=="number"&&K>q&&z&&z(q),"min"in this.props&&R.min!==B&&typeof K=="number"&&K1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,z=parseFloat(R);return isNaN(z)?R:(zF&&(z=F),z)}},{key:"setValue",value:function(R,N){var F=this.props.precision,z=this.isNotCompleteNumber(parseFloat(R))?null:parseFloat(R),q=this.state.value,B=q===void 0?null:q,M=this.state.inputValue,G=M===void 0?null:M,J=typeof z=="number"?z.toFixed(F):"".concat(z),K=z!==B||J!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},N)):this.setState({value:z,inputValue:this.toPrecisionAsStep(R)},N),K&&this.props.onChange(z),z}},{key:"getMaxPrecision",value:function(R){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,z=F.precision,q=F.step;if(b(z))return z;var B=this.getPrecision(N),M=this.getPrecision(q),G=this.getPrecision(R);return R?Math.max(G,B+M):B+M}},{key:"getPrecisionFactor",value:function(R){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(R,N);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(R){return this.props.formatter?this.props.formatter(R):R}},{key:"toPrecisionAsStep",value:function(R){if(this.isNotCompleteNumber(R)||R==="")return R;var N=Math.abs(this.getMaxPrecision(R));return isNaN(N)?R.toString():Number(R).toFixed(N)}},{key:"toNumber",value:function(R){var N=this.props.precision,F=this.state.focused,z=R&&R.length>16&&F;return this.isNotCompleteNumber(R)||z?R:b(N)?Math.round(R*Math.pow(10,N))/Math.pow(10,N):Number(R)}},{key:"upStep",value:function(R,N){var F=this.props.step,z=this.getPrecisionFactor(R,N),q=Math.abs(this.getMaxPrecision(R,N)),B=((z*R+z*F*N)/z).toFixed(q);return this.toNumber(B)}},{key:"downStep",value:function(R,N){var F=this.props.step,z=this.getPrecisionFactor(R,N),q=Math.abs(this.getMaxPrecision(R,N)),B=((z*R-z*F*N)/z).toFixed(q);return this.toNumber(B)}},{key:"step",value:function(R,N){var F=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,q=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var B=this.props;if(B.disabled)return;var M=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(M))return;var G=this["".concat(R,"Step")](M,z),J=G>B.max||GB.max?G=B.max:G=Z),Ye=(De||De===0)&&(isNaN(De)||Number(De)<=le),je=qe||z||q,Ue=Ye||z||q,ke=c()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(ie.a)({},"".concat(F,"-handler-up-disabled"),je)),be=c()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(ie.a)({},"".concat(F,"-handler-down-disabled"),Ue)),Ce=B?{onTouchStart:je?a:this.up,onTouchEnd:this.stop}:{onMouseDown:je?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Pe=B?{onTouchStart:Ue?a:this.down,onTouchEnd:this.stop}:{onMouseDown:Ue?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return f.a.createElement("div",{className:Ne,style:de,title:Te,onMouseEnter:we,onMouseLeave:Ie,onMouseOver:_e,onMouseOut:ye,onFocus:function(){return null},onBlur:function(){return null}},f.a.createElement("div",{className:"".concat(F,"-handler-wrap")},f.a.createElement("span",Object.assign({unselectable:"on"},Ce,{role:"button","aria-label":"Increase Value","aria-disabled":je,className:ke}),G||f.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:i})),f.a.createElement("span",Object.assign({unselectable:"on"},Pe,{role:"button","aria-label":"Decrease Value","aria-disabled":Ue,className:be}),J||f.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:i}))),f.a.createElement("div",{className:"".concat(F,"-input-wrap")},f.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":le,"aria-valuemax":Z,"aria-valuenow":De,required:Ke,type:Ge,placeholder:Ee,onPaste:ee,onClick:Me,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Fe,autoComplete:M,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:a,onKeyUp:tt?this.onKeyUp:a,autoFocus:P,maxLength:re,readOnly:q,disabled:z,max:Z,min:le,step:it,name:j,title:Te,id:me,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:He,inputMode:We,onInput:$},Be))))}}]),S}(f.a.Component);m.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:y,min:-y,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:t,required:!1,autoComplete:"off"};var _=m,x=Xe.a=_},fcSX:function(nt,Xe,V){"use strict";var ce=V("Ff2n"),ie=V("1OyB"),W=V("vuIU"),C=V("Ji7U"),D=V("md7G"),T=V("foSv"),A=V("1W/9"),O=V("cDcd"),f=V("rePB"),p=V("JX7q"),c=V("TSYQ"),s=V.n(c),n=V("qx4F"),o=V("4IlW");function r(z){return Array.isArray(z)?z:[z]}var l={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},a=Object.keys(l).filter(function(z){if(typeof document=="undefined")return!1;var q=document.getElementsByTagName("html")[0];return z in(q?q.style:{})})[0],i=l[a];function t(z,q,B,M){z.addEventListener?z.addEventListener(q,B,M):z.attachEvent&&z.attachEvent("on".concat(q),B)}function d(z,q,B,M){z.removeEventListener?z.removeEventListener(q,B,M):z.attachEvent&&z.detachEvent("on".concat(q),B)}function v(z,q){var B=typeof z=="function"?z(q):z;return Array.isArray(B)?B.length===2?B:[B[0],B[1]]:[B]}var y=function(q){return!isNaN(parseFloat(q))&&isFinite(q)},b=!(typeof window!="undefined"&&window.document&&window.document.createElement),g=function z(q,B,M,G){if(!B||B===document||B instanceof Document)return!1;if(B===q.parentNode)return!0;var J=Math.max(Math.abs(M),Math.abs(G))===Math.abs(G),K=Math.max(Math.abs(M),Math.abs(G))===Math.abs(M),Z=B.scrollHeight-B.clientHeight,le=B.scrollWidth-B.clientWidth,de=document.defaultView.getComputedStyle(B),Te=de.overflowY==="auto"||de.overflowY==="scroll",we=de.overflowX==="auto"||de.overflowX==="scroll",Ie=Z&&Te,_e=le&&we;return J&&(!Ie||Ie&&(B.scrollTop>=Z&&G<0||B.scrollTop<=0&&G>0))||K&&(!_e||_e&&(B.scrollLeft>=le&&M<0||B.scrollLeft<=0&&M>0))?z(q,B.parentNode,M,G):!1};function m(z){var q=_();return function(){var M=Object(T.a)(z),G;if(q){var J=Object(T.a)(this).constructor;G=Reflect.construct(M,arguments,J)}else G=M.apply(this,arguments);return Object(D.a)(this,G)}}function _(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(z){return!1}}var x={},h=function(z){Object(C.a)(B,z);var q=m(B);function B(M){var G;return Object(ie.a)(this,B),G=q.call(this,M),G.domFocus=function(){G.dom&&G.dom.focus()},G.removeStartHandler=function(J){if(J.touches.length>1)return;G.startPos={x:J.touches[0].clientX,y:J.touches[0].clientY}},G.removeMoveHandler=function(J){if(J.changedTouches.length>1)return;var K=J.currentTarget,Z=J.changedTouches[0].clientX-G.startPos.x,le=J.changedTouches[0].clientY-G.startPos.y;(K===G.maskDom||K===G.handlerDom||K===G.contentDom&&g(K,J.target,Z,le))&&J.cancelable&&J.preventDefault()},G.transitionEnd=function(J){var K=J.target;d(K,i,G.transitionEnd),K.style.transition=""},G.onKeyDown=function(J){if(J.keyCode===o.a.ESC){var K=G.props.onClose;J.stopPropagation(),K&&K(J)}},G.onWrapperTransitionEnd=function(J){var K=G.props,Z=K.open,le=K.afterVisibleChange;J.target===G.contentWrapper&&J.propertyName.match(/transform$/)&&(G.dom.style.transition="",!Z&&G.getCurrentDrawerSome()&&(document.body.style.overflowX="",G.maskDom&&(G.maskDom.style.left="",G.maskDom.style.width="")),le&&le(!!Z))},G.openLevelTransition=function(){var J=G.props,K=J.open,Z=J.width,le=J.height,de=G.getHorizontalBoolAndPlacementName(),Te=de.isHorizontal,we=de.placementName,Ie=G.contentDom?G.contentDom.getBoundingClientRect()[Te?"width":"height"]:0,_e=(Te?Z:le)||Ie;G.setLevelAndScrolling(K,we,_e)},G.setLevelTransform=function(J,K,Z,le){var de=G.props,Te=de.placement,we=de.levelMove,Ie=de.duration,_e=de.ease,ye=de.showMask;G.levelDom.forEach(function(Ke){Ke.style.transition="transform ".concat(Ie," ").concat(_e),t(Ke,i,G.transitionEnd);var Me=J?Z:0;if(we){var Fe=v(we,{target:Ke,open:J});Me=J?Fe[0]:Fe[1]||0}var Ge=typeof Me=="number"?"".concat(Me,"px"):Me,Ee=Te==="left"||Te==="top"?Ge:"-".concat(Ge);Ee=ye&&Te==="right"&&le?"calc(".concat(Ee," + ").concat(le,"px)"):Ee,Ke.style.transform=Me?"".concat(K,"(").concat(Ee,")"):""})},G.setLevelAndScrolling=function(J,K,Z){var le=G.props.onChange;if(!b){var de=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(n.a)(!0):0;G.setLevelTransform(J,K,Z,de),G.toggleScrollingToDrawerAndBody(de)}le&&le(J)},G.toggleScrollingToDrawerAndBody=function(J){var K=G.props,Z=K.getOpenCount,le=K.getContainer,de=K.showMask,Te=K.open,we=le&&le(),Ie=Z&&Z();if(we&&we.parentNode===document.body&&de){var _e=["touchstart"],ye=[document.body,G.maskDom,G.handlerDom,G.contentDom];Te&&document.body.style.overflow!=="hidden"?(J&&G.addScrollingEffect(J),Ie===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ye.forEach(function(Ke,Me){if(!Ke)return;t(Ke,_e[Me]||"touchmove",Me?G.removeMoveHandler:G.removeStartHandler,G.passive)})):G.getCurrentDrawerSome()&&(Ie||(document.body.style.overflow=""),document.body.style.touchAction="",J&&G.remScrollingEffect(J),ye.forEach(function(Ke,Me){if(!Ke)return;d(Ke,_e[Me]||"touchmove",Me?G.removeMoveHandler:G.removeStartHandler,G.passive)}))}},G.addScrollingEffect=function(J){var K=G.props,Z=K.placement,le=K.duration,de=K.ease,Te=K.getOpenCount,we=K.switchScrollingEffect,Ie=Te&&Te();Ie===1&&we();var _e="width ".concat(le," ").concat(de),ye="transform ".concat(le," ").concat(de);G.dom.style.transition="none";switch(Z){case"right":G.dom.style.transform="translateX(-".concat(J,"px)");break;case"top":case"bottom":G.dom.style.width="calc(100% - ".concat(J,"px)"),G.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(ye,",").concat(_e),G.dom.style.width="",G.dom.style.transform="")})},G.remScrollingEffect=function(J){var K=G.props,Z=K.placement,le=K.duration,de=K.ease,Te=K.getOpenCount,we=K.switchScrollingEffect,Ie=Te&&Te();Ie||we(!0),a&&(document.body.style.overflowX="hidden"),G.dom.style.transition="none";var _e,ye="width ".concat(le," ").concat(de),Ke="transform ".concat(le," ").concat(de);switch(Z){case"left":{G.dom.style.width="100%",ye="width 0s ".concat(de," ").concat(le);break}case"right":{G.dom.style.transform="translateX(".concat(J,"px)"),G.dom.style.width="100%",ye="width 0s ".concat(de," ").concat(le),G.maskDom&&(G.maskDom.style.left="-".concat(J,"px"),G.maskDom.style.width="calc(100% + ".concat(J,"px)"));break}case"top":case"bottom":{G.dom.style.width="calc(100% + ".concat(J,"px)"),G.dom.style.height="100%",G.dom.style.transform="translateZ(0)",_e="height 0s ".concat(de," ").concat(le);break}default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(Ke,",").concat(_e?"".concat(_e,","):"").concat(ye),G.dom.style.transform="",G.dom.style.width="",G.dom.style.height="")})},G.getCurrentDrawerSome=function(){return!Object.keys(x).some(function(J){return x[J]})},G.getLevelDom=function(J){var K=J.level,Z=J.getContainer;if(b)return;var le=Z&&Z(),de=le?le.parentNode:null;if(G.levelDom=[],K==="all"){var Te=de?Array.prototype.slice.call(de.children):[];Te.forEach(function(we){we.nodeName!=="SCRIPT"&&we.nodeName!=="STYLE"&&we.nodeName!=="LINK"&&we!==le&&G.levelDom.push(we)})}else K&&r(K).forEach(function(we){document.querySelectorAll(we).forEach(function(Ie){G.levelDom.push(Ie)})})},G.getHorizontalBoolAndPlacementName=function(){var J=G.props.placement,K=J==="left"||J==="right",Z="translate".concat(K?"X":"Y");return{isHorizontal:K,placementName:Z}},G.state={_self:Object(p.a)(G)},G}return Object(W.a)(B,[{key:"componentDidMount",value:function(){var G=this;if(!b){var J=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return J=!0,null}}))}catch(Te){}this.passive=J?{passive:!1}:!1}var K=this.props,Z=K.open,le=K.getContainer,de=le&&le();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),Z&&(de&&de.parentNode===document.body&&(x[this.drawerId]=Z),this.openLevelTransition(),this.forceUpdate(function(){G.domFocus()}))}},{key:"componentDidUpdate",value:function(G){var J=this.props,K=J.open,Z=J.getContainer,le=Z&&Z();K!==G.open&&(K&&this.domFocus(),le&&le.parentNode===document.body&&(x[this.drawerId]=!!K),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var G=this.props,J=G.getOpenCount,K=G.open,Z=G.switchScrollingEffect,le=typeof J=="function"&&J();delete x[this.drawerId],K&&(this.setLevelTransform(!1),document.body.style.touchAction=""),le||(document.body.style.overflow="",Z(!0))}},{key:"render",value:function(){var G,J=this,K=this.props,Z=K.className,le=K.children,de=K.style,Te=K.width,we=K.height,Ie=K.defaultOpen,_e=K.open,ye=K.prefixCls,Ke=K.placement,Me=K.level,Fe=K.levelMove,Ge=K.ease,Ee=K.duration,me=K.getContainer,We=K.handler,He=K.onChange,it=K.afterVisibleChange,re=K.showMask,P=K.maskClosable,j=K.maskStyle,ee=K.onClose,$=K.onHandleClick,Q=K.keyboard,xe=K.getOpenCount,De=K.switchScrollingEffect,dt=Object(ce.a)(K,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ne=this.dom?_e:!1,Be=s()(ye,(G={},Object(f.a)(G,"".concat(ye,"-").concat(Ke),!0),Object(f.a)(G,"".concat(ye,"-open"),Ne),Object(f.a)(G,Z||"",!!Z),Object(f.a)(G,"no-mask",!re),G)),tt=this.getHorizontalBoolAndPlacementName(),lt=tt.placementName,qe=Ke==="left"||Ke==="top"?"-100%":"100%",Ye=Ne?"":"".concat(lt,"(").concat(qe,")"),je=We&&O.cloneElement(We,{onClick:function(ke){We.props.onClick&&We.props.onClick(),$&&$(ke)},ref:function(ke){J.handlerDom=ke}});return O.createElement("div",Object.assign({},dt,{tabIndex:-1,className:Be,style:de,ref:function(ke){J.dom=ke},onKeyDown:Ne&&Q?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),re&&O.createElement("div",{className:"".concat(ye,"-mask"),onClick:P?ee:void 0,style:j,ref:function(ke){J.maskDom=ke}}),O.createElement("div",{className:"".concat(ye,"-content-wrapper"),style:{transform:Ye,msTransform:Ye,width:y(Te)?"".concat(Te,"px"):Te,height:y(we)?"".concat(we,"px"):we},ref:function(ke){J.contentWrapper=ke}},O.createElement("div",{className:"".concat(ye,"-content"),ref:function(ke){J.contentDom=ke},onTouchStart:Ne&&re?this.removeStartHandler:void 0,onTouchMove:Ne&&re?this.removeMoveHandler:void 0},le),je))}}],[{key:"getDerivedStateFromProps",value:function(G,J){var K=J.prevProps,Z=J._self,le={prevProps:G};if(K!==void 0){var de=G.placement,Te=G.level;de!==K.placement&&(Z.contentDom=null),Te!==K.level&&Z.getLevelDom(G)}return le}}]),B}(O.Component);h.defaultProps={switchScrollingEffect:function(){}};var E=h;function S(z){var q=w();return function(){var M=Object(T.a)(z),G;if(q){var J=Object(T.a)(this).constructor;G=Reflect.construct(M,arguments,J)}else G=M.apply(this,arguments);return Object(D.a)(this,G)}}function w(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(z){return!1}}var R=function(z){Object(C.a)(B,z);var q=S(B);function B(M){var G;Object(ie.a)(this,B),G=q.call(this,M),G.onHandleClick=function(K){var Z=G.props,le=Z.onHandleClick,de=Z.open;if(le&&le(K),typeof de=="undefined"){var Te=G.state.open;G.setState({open:!Te})}},G.onClose=function(K){var Z=G.props,le=Z.onClose,de=Z.open;le&&le(K),typeof de=="undefined"&&G.setState({open:!1})};var J=typeof M.open!="undefined"?M.open:!!M.defaultOpen;return G.state={open:J},"onMaskClick"in M&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),G}return Object(W.a)(B,[{key:"render",value:function(){var G=this,J=this.props,K=J.defaultOpen,Z=J.getContainer,le=J.wrapperClassName,de=J.forceRender,Te=J.handler,we=Object(ce.a)(J,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Ie=this.state.open;if(!Z)return O.createElement("div",{className:le,ref:function(Ke){G.dom=Ke}},O.createElement(E,Object.assign({},we,{open:Ie,handler:Te,getContainer:function(){return G.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var _e=!!Te||de;return O.createElement(A.a,{visible:Ie,forceRender:_e,getContainer:Z,wrapperClassName:le},function(ye){var Ke=ye.visible,Me=ye.afterClose,Fe=Object(ce.a)(ye,["visible","afterClose"]);return O.createElement(E,Object.assign({},we,Fe,{open:Ke!==void 0?Ke:Ie,afterVisibleChange:Me!==void 0?Me:we.afterVisibleChange,handler:Te,onClose:G.onClose,onHandleClick:G.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(G,J){var K=J.prevProps,Z={prevProps:G};return typeof K!="undefined"&&G.open!==K.open&&(Z.open=G.open),Z}}]),B}(O.Component);R.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:O.createElement("div",{className:"drawer-handle"},O.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=R,F=Xe.a=N},fcyK:function(nt,Xe,V){},fyJ8:function(nt,Xe,V){"use strict";var ce=V("rePB"),ie=V("VTBJ"),W=V("Ff2n"),C=V("U8pU"),D=V("cDcd"),T=V.n(D),A=V("TSYQ"),O=V.n(A),f=V("c+Xe"),p=V("sR1s");function c(l){return l&&Object(C.a)(l)==="object"&&!Array.isArray(l)&&!D.isValidElement(l)}function s(l){return typeof l=="string"?!0:Object(f.c)(l)}function n(l,a){var i,t=l.prefixCls,d=l.className,v=l.record,y=l.index,b=l.dataIndex,g=l.render,m=l.children,_=l.component,x=_===void 0?"td":_,h=l.colSpan,E=l.rowSpan,S=l.fixLeft,w=l.fixRight,R=l.firstFixLeft,N=l.lastFixLeft,F=l.firstFixRight,z=l.lastFixRight,q=l.appendNode,B=l.additionalProps,M=B===void 0?{}:B,G=l.ellipsis,J=l.align,K=l.rowType,Z=l.isSticky,le="".concat(t,"-cell"),de,Te;if(m)Te=m;else{var we=Object(p.b)(v,b);if(Te=we,g){var Ie=g(we,v,y);c(Ie)?(Te=Ie.children,de=Ie.props):Te=Ie}}Object(C.a)(Te)==="object"&&!Array.isArray(Te)&&!D.isValidElement(Te)&&(Te=null),G&&(N||F)&&(Te=D.createElement("span",{className:"".concat(le,"-content")},Te));var _e=de||{},ye=_e.colSpan,Ke=_e.rowSpan,Me=_e.style,Fe=_e.className,Ge=Object(W.a)(_e,["colSpan","rowSpan","style","className"]),Ee=ye!==void 0?ye:h,me=Ke!==void 0?Ke:E;if(Ee===0||me===0)return null;var We={},He=typeof S=="number",it=typeof w=="number";He&&(We.position="sticky",We.left=S),it&&(We.position="sticky",We.right=w);var re={};J&&(re.textAlign=J);var P,j=G===!0?{showTitle:!0}:G;j&&(j.showTitle||K==="header")&&(typeof Te=="string"||typeof Te=="number"?P=Te.toString():D.isValidElement(Te)&&typeof Te.props.children=="string"&&(P=Te.props.children));var ee=Object(ie.a)(Object(ie.a)(Object(ie.a)({title:P},Ge),M),{},{colSpan:Ee&&Ee!==1?Ee:null,rowSpan:me&&me!==1?me:null,className:O()(le,d,(i={},Object(ce.a)(i,"".concat(le,"-fix-left"),He),Object(ce.a)(i,"".concat(le,"-fix-left-first"),R),Object(ce.a)(i,"".concat(le,"-fix-left-last"),N),Object(ce.a)(i,"".concat(le,"-fix-right"),it),Object(ce.a)(i,"".concat(le,"-fix-right-first"),F),Object(ce.a)(i,"".concat(le,"-fix-right-last"),z),Object(ce.a)(i,"".concat(le,"-ellipsis"),G),Object(ce.a)(i,"".concat(le,"-with-append"),q),Object(ce.a)(i,"".concat(le,"-fix-sticky"),(He||it)&&Z),i),M.className,Fe),style:Object(ie.a)(Object(ie.a)(Object(ie.a)(Object(ie.a)({},M.style),re),We),Me),ref:s(x)?a:null});return D.createElement(x,Object.assign({},ee),q,Te)}var o=D.forwardRef(n);o.displayName="Cell";var r=D.memo(o,function(l,a){return a.shouldCellUpdate?!a.shouldCellUpdate(a.record,l.record):!1});Xe.a=r},gRFJ:function(nt,Xe,V){nt.exports=[V("rdUC"),V("ynwM"),V("RELg"),V("DlR+"),V("CrYA"),V("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(nt){return nt<10?"0"+nt:nt}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(nt){return rx_escapable.lastIndex=0,rx_escapable.test(nt)?'"'+nt.replace(rx_escapable,function(Xe){var V=meta[Xe];return typeof V=="string"?V:"\\u"+("0000"+Xe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+nt+'"'}function str(nt,Xe){var V,ce,ie,W,C=gap,D,T=Xe[nt];T&&typeof T=="object"&&typeof T.toJSON=="function"&&(T=T.toJSON(nt)),typeof rep=="function"&&(T=rep.call(Xe,nt,T));switch(typeof T){case"string":return quote(T);case"number":return isFinite(T)?String(T):"null";case"boolean":case"null":return String(T);case"object":if(!T)return"null";if(gap+=indent,D=[],Object.prototype.toString.apply(T)==="[object Array]"){for(W=T.length,V=0;V0&&!this.paused&&!this.ended&&this.readyState>2}});function i(v,y){return v-y}function t(v){v.sort(i);for(var y=0,b=0;b1&&arguments[1]!==void 0?arguments[1]:!1,ke={point:K.current.currentTime};ee?(ke.log_id=ee,ke.watch_duration=t(Ne),ke.total_duration=P):(E?(ke.video_id=parseInt(_,10),ke.course_id=E):ke.video_id=_,ke.duration=re,ke.device=We),Ue&&(ke.ed="1");function be(){return Ce.apply(this,arguments)}function Ce(){return Ce=Object(W.a)(D.a.mark(function Pe(){var Le;return D.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return De=!0,at.next=3,x(ke);case 3:Le=at.sent,ee=Le,De=!1,je&&je();case 7:case"end":return at.stop()}},Pe)})),Ce.apply(this,arguments)}be()},[_,E]);Object(T.useEffect)(function(){ie.b.destroy();var je=null;return O.a.isSupported&&J&&g&&(g==null?void 0:g.indexOf(".m3u8"))<0?(je=O.a.createPlayer({type:"flv",volume:.8,cors:!0,url:g,muted:!1}),K.current&&(je.attachMediaElement(K.current),je.load())):K.current.setAttribute("src",g),lt(),function(){je&&(je.unload(),je.pause(),je.destroy(),je=null)}},[K,J,g]);function tt(){K.current.paused?(de.current.style.display="none",Te.current.style.display="block"):(de.current.style.display="block",Te.current.style.display="none")}function lt(){Me.current.style.display="none",Ge.current.style.display="none",Fe.current.style.display="none",K.current.muted||K.current.volume===0?Me.current.style.display="block":K.current.volume>0&&K.current.volume<=.5?Ge.current.style.display="block":Fe.current.style.display="block"}Object(T.useEffect)(function(){var je=document.getElementById("play"),Ue=document.querySelectorAll(".playback-icons use");function ke(){F(),S&&!He.current&&(K.current.currentTime=S),He.current=!0,Ne.push(K.current.currentTime),$||($=!0,m&&Be())}function be(){return Ce.apply(this,arguments)}function Ce(){return Ce=Object(W.a)(D.a.mark(function rt(){return D.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:tt(),Ne.push(K.current.currentTime),m&&Be(function(){ee=null,j=0,$=!1,De=!1,dt=!1,Ne=[],P=0,xe=1},!0);case 3:case"end":return ze.stop()}},rt)})),Ce.apply(this,arguments)}function Pe(){we.current.value=Math.round(K.current.currentTime),Ie.current.value=Math.round(K.current.currentTime)}function Le(){var rt=a(Math.round(K.current.currentTime));ye.current.innerText="".concat(rt.hour>0?rt.hour+":":"").concat(rt.minutes,":").concat(rt.seconds),ye.current.setAttribute("datetime","".concat(rt.hour>0?" "+rt.hour+" ":"").concat(rt.minutes,"m ").concat(rt.seconds,"s"))}function Ve(){var rt=Math.round(K.current.duration);we.current.setAttribute("max",rt),Ie.current.setAttribute("max",rt);var Oe=a(rt);_e.current.innerText="".concat(Oe.hour>0?Oe.hour+":":"").concat(Oe.minutes,":").concat(Oe.seconds),_e.current.setAttribute("datetime","".concat(Oe.hour>0?" "+Oe.hour+" ":"").concat(Oe.minutes,"m ").concat(Oe.seconds,"s"))}function at(){var rt=Math.round(K.current.duration);we.current.setAttribute("max",rt),Ie.current.setAttribute("max",rt);var Oe=a(rt);_e.current.innerText="".concat(Oe.hour>0?Oe.hour+":":"").concat(Oe.minutes,":").concat(Oe.seconds),_e.current.setAttribute("datetime","".concat(Oe.hour>0?" "+Oe.hour+" ":"").concat(Oe.minutes,"m ").concat(Oe.seconds,"s")),Pe(),Le();var ze=Z.current.getBoundingClientRect(),vt=ze.width,st=ze.height,It=ze.x,Pt=ze.y;if(It<0||Pt<0||!vt)return;if(!dt){var Ze=K.current.currentTime,mt=Ze-j;Math.abs(mt)<10?(P+=Math.abs(mt),j=Ze,De||P-xe*Q>=0&&(xe++,Ne.push(j),m&&Be())):(j=Ze,m&&Be())}}function _t(){dt=!0}function kt(){K.current.playing&&Ne.push(K.current.currentTime,j),j=K.current.currentTime,dt=!1}function Bt(){re=K.current.duration,re<=20&&(Q=re/3),K.current.addEventListener("play",ke)}function jt(rt){rt.preventDefault(),Object(o.a)()?(K.current.style.width="100%",K.current.style.height="100%"):K.current.style.cssText=""}function At(){R()}function pt(rt){var Oe=rt.target.dataset.seek?rt.target.dataset.seek:rt.target.value;K.current.currentTime=Oe,Ie.current.value=Oe,we.current.value=Oe}function gt(rt){var Oe=Math.round(rt.offsetX/rt.target.clientWidth*parseInt(rt.target.getAttribute("max"),10));we.current.setAttribute("data-seek",Oe);var ze=a(Oe);Ke.current.textContent="".concat(ze.hour>0?ze.hour+":":"").concat(ze.minutes,":").concat(ze.seconds);var vt=K.current.getBoundingClientRect();Ke.current.style.left="".concat(rt.pageX-vt.left,"px")}return le.current.addEventListener(Object(o.c)(),jt),K.current.addEventListener("canplay",Bt),K.current.addEventListener("ended",be),K.current.addEventListener("seeking",_t),K.current.addEventListener("seeked",kt),K.current.addEventListener("loadedmetadata",Ve),we.current.addEventListener("mousemove",gt),we.current.addEventListener("input",pt),K.current.addEventListener("timeupdate",at),K.current.addEventListener("pause",At),K.current.addEventListener("volumechange",lt),function(){K.current.removeEventListener("canplay",Bt),K.current.removeEventListener("play",ke),K.current.removeEventListener("ended",be),K.current.removeEventListener("seeking",_t),K.current.removeEventListener("seeked",kt),we.current.removeEventListener("mousemove",gt),we.current.removeEventListener("input",pt),K.current.removeEventListener("timeupdate",at),K.current.removeEventListener("pause",At),K.current.removeEventListener("loadedmetadata",Ve),K.current.removeEventListener("volumechange",lt),K.current.playing&&(Ne.push(j,K.current.currentTime),m&&Be())}},[K,g]),Object(T.useEffect)(function(){if(K.current.onended=function(){q(K)},K.current.oncontextmenu=function(){return!1},(g==null?void 0:g.indexOf(".m3u8"))>-1){if(K.current.canPlayType("application/vnd.apple.mpegurl"))K.current.src=g;else if(p.a.isSupported()){var je=new p.a;je.loadSource(g),je.attachMedia(K.current)}}},[g]),Object(T.useEffect)(function(){K.current.playbackRate=M},[M]);var qe=function(){K.current.paused||K.current.ended?K.current.play():K.current.pause(),tt()};function Ye(){K.current.muted=!K.current.muted,K.current.muted?(Ee.current.setAttribute("data-volume",volume.value),Ee.current.value=0):Ee.current.value=Ee.current.dataset.volume}return A.a.createElement("div",{style:{position:"relative"},ref:le},A.a.createElement("div",{ref:Z,className:"".concat(l.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(l.a.animate__loop)},it?it.login:" "),A.a.createElement("div",{className:l.a.container},A.a.createElement("div",{className:l.a["video-container"],id:"video-container"},A.a.createElement("div",{className:l.a["playback-animation"],id:"playback-animation"},A.a.createElement("svg",{className:l.a["playback-icons"]},A.a.createElement("use",{className:"hidden",href:"#play-icon"}),A.a.createElement("use",{href:"#pause"}))),A.a.createElement("video",{className:l.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:K,autoPlay:!1}),A.a.createElement("div",{className:"".concat(l.a["video-controls"]," "),id:"video-controls"},A.a.createElement("div",{className:l.a["bottom-controls"]},A.a.createElement("div",{className:l.a["left-controls"]},A.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:qe},A.a.createElement("svg",{className:l.a["playback-icons"]},A.a.createElement("use",{ref:Te,href:"#play-icon"}),A.a.createElement("use",{ref:de,style:{display:"none"},href:"#pause"}))),A.a.createElement("div",{className:l.a.time},A.a.createElement("time",{id:"time-elapsed",ref:ye},"00:00"),A.a.createElement("span",null," / "),A.a.createElement("time",{id:"duration",ref:_e},"00:00"))),A.a.createElement("div",{className:l.a["right-controls"]},A.a.createElement(s.CopyToClipboard,{text:g,onCopy:function(){return ie.b.success("\u590D\u5236\u6210\u529F")}},A.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},A.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),A.a.createElement("div",{className:l.a["volume-controls"]},A.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l.a["volume-button"],id:"volume-button",onClick:Ye},A.a.createElement("i",{ref:Me,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:Ge,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:Fe,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),A.a.createElement("input",{className:l.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Ee,style:{display:"none"},onClick:lt})),A.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l.a["fullscreen-button"],onClick:function(){Object(o.a)()?Object(o.b)():Object(o.d)(le.current)}},A.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),A.a.createElement("div",{className:l.a["video-progress"]},A.a.createElement("progress",{ref:Ie,value:"0",min:"0"}),A.a.createElement("input",{className:l.a.seek,ref:we,value:"0",min:"0",type:"range",step:"1"}),A.a.createElement("div",{className:l.a["seek-tooltip"],ref:Ke,id:"seek-tooltip"},"00:00"))))),A.a.createElement("svg",{style:{display:"none"}},A.a.createElement("defs",null,A.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),A.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),A.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),A.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),A.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),A.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),A.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),A.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(nt,Xe,V){},je13:function(nt,Xe,V){var ce=V("5nXd"),ie=V("gRFJ"),W=[V("uQRt")];nt.exports=ce.createStore(ie,W)},kSUc:function(nt,Xe,V){},"kaH+":function(nt,Xe,V){"use strict";var ce=V("+L6B"),ie=V("2/Rp"),W=V("tJVT"),C=V("cDcd"),D=V.n(C),T=V("UZu5"),A=V.n(T),O=V("dhSg"),f=V("rLCj"),p=V("dF/Y"),c=V("4i/N");Xe.a=function(){var s=Object(C.useState)(""),n=Object(W.a)(s,2),o=n[0],r=n[1],l=Object(C.useState)(0),a=Object(W.a)(l,2),i=a[0],t=a[1],d=Object(C.useRef)("");Object(C.useEffect)(function(){var x=O.a.subscribe("preview-image",function(h){r(h),document.body.style.overflow="hidden"});return x},[]),Object(C.useEffect)(function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}},[]),Object(C.useEffect)(function(){d.current=o},[o]);function v(x){x.keyCode==27&&d.current&&y()}function y(){document.body.style.overflow="auto",r("")}function b(){t(i+90)}var g=Object(C.useRef)(),m=Object(C.useRef)(),_=function(h){(h.nativeEvent.target===g.current||h.nativeEvent.target===m.current)&&y()};return D.a.createElement(C.Fragment,null,o?D.a.createElement("div",{className:"image-preview-container",ref:g,onClick:_},D.a.createElement("div",{className:"button-group"},D.a.createElement(ie.a,{onClick:b},"\u65CB\u8F6C",D.a.createElement(f.a,null)),D.a.createElement(ie.a,{href:o},"\u4E0B\u8F7D",D.a.createElement(p.a,null)),D.a.createElement(ie.a,{onClick:y},"\u5173\u95ED",D.a.createElement(c.a,null))),D.a.createElement("div",{className:"preview-wrp-group",ref:m},D.a.createElement("img",{className:"image-preview",src:o,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(i,"deg)")}}))):null)}},kovY:function(nt,Xe,V){nt.exports=V.p+"static/e.eabfa286.svg"},lOMy:function(nt,Xe,V){},lZu9:function(nt,Xe,V){(function(ce){ce(V("VrN/"),V("1eCo"),V("8EBN"))})(function(ce){"use strict";ce.defineMode("markdown",function(ie,W){var C=ce.getMode(ie,"text/html"),D=C.name=="null";function T(B){if(ce.findModeByName){var M=ce.findModeByName(B);M&&(B=M.mime||M.mimes[0])}var G=ce.getMode(ie,B);return G.name=="null"?null:G}W.highlightFormatting===void 0&&(W.highlightFormatting=!1),W.maxBlockquoteDepth===void 0&&(W.maxBlockquoteDepth=0),W.taskLists===void 0&&(W.taskLists=!1),W.strikethrough===void 0&&(W.strikethrough=!1),W.emoji===void 0&&(W.emoji=!1),W.fencedCodeBlockHighlighting===void 0&&(W.fencedCodeBlockHighlighting=!0),W.fencedCodeBlockDefaultMode===void 0&&(W.fencedCodeBlockDefaultMode="text/plain"),W.xml===void 0&&(W.xml=!0),W.tokenTypeOverrides===void 0&&(W.tokenTypeOverrides={});var A={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var O in A)A.hasOwnProperty(O)&&W.tokenTypeOverrides[O]&&(A[O]=W.tokenTypeOverrides[O]);var f=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,s=W.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,n=/^ {0,3}(?:\={1,}|-{2,})\s*$/,o=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,i=" ";function t(B,M,G){return M.f=M.inline=G,G(B,M)}function d(B,M,G){return M.f=M.block=G,G(B,M)}function v(B){return!B||!/\S/.test(B.string)}function y(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==g){var M=D;if(!M){var G=ce.innerMode(C,B.htmlState);M=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}M&&(B.f=h,B.block=b,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function b(B,M){var G=B.column()===M.indentation,J=v(M.prevLine.stream),K=M.indentedCode,Z=M.prevLine.hr,le=M.list!==!1,de=(M.listStack[M.listStack.length-1]||0)+3;M.indentedCode=!1;var Te=M.indentation;if(M.indentationDiff===null&&(M.indentationDiff=M.indentation,le)){for(M.list=null;Te=4&&(K||M.prevLine.fencedCodeEnd||M.prevLine.header||J))return B.skipToEnd(),M.indentedCode=!0,A.code;if(B.eatSpace())return null;if(G&&M.indentation<=de&&(_e=B.match(s))&&_e[1].length<=6)return M.quote=0,M.header=_e[1].length,M.thisLine.header=!0,W.highlightFormatting&&(M.formatting="header"),M.f=M.inline,_(M);if(M.indentation<=de&&B.eat(">"))return M.quote=G?1:M.quote+1,W.highlightFormatting&&(M.formatting="quote"),B.eatSpace(),_(M);if(!Ie&&!M.setext&&G&&M.indentation<=de&&(_e=B.match(p))){var ye=_e[1]?"ol":"ul";return M.indentation=Te+B.current().length,M.list=!0,M.quote=0,M.listStack.push(M.indentation),M.em=!1,M.strong=!1,M.code=!1,M.strikethrough=!1,W.taskLists&&B.match(c,!1)&&(M.taskList=!0),M.f=M.inline,W.highlightFormatting&&(M.formatting=["list","list-"+ye]),_(M)}else{if(G&&M.indentation<=de&&(_e=B.match(r,!0)))return M.quote=0,M.fencedEndRE=new RegExp(_e[1]+"+ *$"),M.localMode=W.fencedCodeBlockHighlighting&&T(_e[2]||W.fencedCodeBlockDefaultMode),M.localMode&&(M.localState=ce.startState(M.localMode)),M.f=M.block=m,W.highlightFormatting&&(M.formatting="code-block"),M.code=-1,_(M);if(M.setext||(!we||!le)&&!M.quote&&M.list===!1&&!M.code&&!Ie&&!l.test(B.string)&&(_e=B.lookAhead(1))&&(_e=_e.match(n)))return M.setext?(M.header=M.setext,M.setext=0,B.skipToEnd(),W.highlightFormatting&&(M.formatting="header")):(M.header=_e[0].charAt(0)=="="?1:2,M.setext=M.header),M.thisLine.header=!0,M.f=M.inline,_(M);if(Ie)return B.skipToEnd(),M.hr=!0,M.thisLine.hr=!0,A.hr;if(B.peek()==="[")return t(B,M,N)}return t(B,M,M.inline)}function g(B,M){var G=C.token(B,M.htmlState);if(!D){var J=ce.innerMode(C,M.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||M.md_inside&&B.current().indexOf(">")>-1)&&(M.f=h,M.block=b,M.htmlState=null)}return G}function m(B,M){var G=M.listStack[M.listStack.length-1]||0,J=M.indentation=B.quote?M.push(A.formatting+"-"+B.formatting[G]+"-"+B.quote):M.push("error"))}if(B.taskOpen)return M.push("meta"),M.length?M.join(" "):null;if(B.taskClosed)return M.push("property"),M.length?M.join(" "):null;if(B.linkHref?M.push(A.linkHref,"url"):(B.strong&&M.push(A.strong),B.em&&M.push(A.em),B.strikethrough&&M.push(A.strikethrough),B.emoji&&M.push(A.emoji),B.linkText&&M.push(A.linkText),B.code&&M.push(A.code),B.image&&M.push(A.image),B.imageAltText&&M.push(A.imageAltText,"link"),B.imageMarker&&M.push(A.imageMarker)),B.header&&M.push(A.header,A.header+"-"+B.header),B.quote&&(M.push(A.quote),!W.maxBlockquoteDepth||W.maxBlockquoteDepth>=B.quote?M.push(A.quote+"-"+B.quote):M.push(A.quote+"-"+W.maxBlockquoteDepth)),B.list!==!1){var J=(B.listStack.length-1)%3;J?J===1?M.push(A.list2):M.push(A.list3):M.push(A.list1)}return B.trailingSpaceNewLine?M.push("trailing-space-new-line"):B.trailingSpace&&M.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),M.length?M.join(" "):null}function x(B,M){return B.match(o,!0)?_(M):void 0}function h(B,M){var G=M.text(B,M);if(typeof G!="undefined")return G;if(M.list)return M.list=null,_(M);if(M.taskList){var J=B.match(c,!0)[1]===" ";return J?M.taskOpen=!0:M.taskClosed=!0,W.highlightFormatting&&(M.formatting="task"),M.taskList=!1,_(M)}if(M.taskOpen=!1,M.taskClosed=!1,M.header&&B.match(/^#+$/,!0))return W.highlightFormatting&&(M.formatting="header"),_(M);var K=B.next();if(M.linkTitle){M.linkTitle=!1;var Z=K;K==="("&&(Z=")"),Z=(Z+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var le="^\\s*(?:[^"+Z+"\\\\]+|\\\\\\\\|\\\\.)"+Z;if(B.match(new RegExp(le),!0))return A.linkHref}if(K==="`"){var de=M.formatting;W.highlightFormatting&&(M.formatting="code"),B.eatWhile("`");var Te=B.current().length;if(M.code==0&&(!M.quote||Te==1))return M.code=Te,_(M);if(Te==M.code){var we=_(M);return M.code=0,we}else return M.formatting=de,_(M)}else if(M.code)return _(M);if(K==="\\"&&(B.next(),W.highlightFormatting)){var Ie=_(M),_e=A.formatting+"-escape";return Ie?Ie+" "+_e:_e}if(K==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return M.imageMarker=!0,M.image=!0,W.highlightFormatting&&(M.formatting="image"),_(M);if(K==="["&&M.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return M.imageMarker=!1,M.imageAltText=!0,W.highlightFormatting&&(M.formatting="image"),_(M);if(K==="]"&&M.imageAltText){W.highlightFormatting&&(M.formatting="image");var Ie=_(M);return M.imageAltText=!1,M.image=!1,M.inline=M.f=S,Ie}if(K==="["&&!M.image)return M.linkText&&B.match(/^.*?\]/)||(M.linkText=!0,W.highlightFormatting&&(M.formatting="link")),_(M);if(K==="]"&&M.linkText){W.highlightFormatting&&(M.formatting="link");var Ie=_(M);return M.linkText=!1,M.inline=M.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?S:h,Ie}if(K==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){M.f=M.inline=E,W.highlightFormatting&&(M.formatting="link");var Ie=_(M);return Ie?Ie+=" ":Ie="",Ie+A.linkInline}if(K==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){M.f=M.inline=E,W.highlightFormatting&&(M.formatting="link");var Ie=_(M);return Ie?Ie+=" ":Ie="",Ie+A.linkEmail}if(W.xml&&K==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ye=B.string.indexOf(">",B.pos);if(ye!=-1){var Ke=B.string.substring(B.start,ye);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ke)&&(M.md_inside=!0)}return B.backUp(1),M.htmlState=ce.startState(C),d(B,M,g)}if(W.xml&&K==="<"&&B.match(/^\/\w*?>/))return M.md_inside=!1,"tag";if(K==="*"||K==="_"){for(var Me=1,Fe=B.pos==1?" ":B.string.charAt(B.pos-2);Me<3&&B.eat(K);)Me++;var Ge=B.peek()||" ",Ee=!/\s/.test(Ge)&&(!a.test(Ge)||/\s/.test(Fe)||a.test(Fe)),me=!/\s/.test(Fe)&&(!a.test(Fe)||/\s/.test(Ge)||a.test(Ge)),We=null,He=null;if(Me%2&&(!M.em&&Ee&&(K==="*"||!me||a.test(Fe))?We=!0:M.em==K&&me&&(K==="*"||!Ee||a.test(Ge))&&(We=!1)),Me>1&&(!M.strong&&Ee&&(K==="*"||!me||a.test(Fe))?He=!0:M.strong==K&&me&&(K==="*"||!Ee||a.test(Ge))&&(He=!1)),He!=null||We!=null){W.highlightFormatting&&(M.formatting=We==null?"strong":He==null?"em":"strong em"),We===!0&&(M.em=K),He===!0&&(M.strong=K);var we=_(M);return We===!1&&(M.em=!1),He===!1&&(M.strong=!1),we}}else if(K===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return _(M);B.backUp(1)}if(W.strikethrough){if(K==="~"&&B.eatWhile(K)){if(M.strikethrough){W.highlightFormatting&&(M.formatting="strikethrough");var we=_(M);return M.strikethrough=!1,we}else if(B.match(/^[^\s]/,!1))return M.strikethrough=!0,W.highlightFormatting&&(M.formatting="strikethrough"),_(M)}else if(K===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return _(M);B.backUp(2)}}if(W.emoji&&K===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){M.emoji=!0,W.highlightFormatting&&(M.formatting="emoji");var it=_(M);return M.emoji=!1,it}return K===" "&&(B.match(/^ +$/,!1)?M.trailingSpace++:M.trailingSpace&&(M.trailingSpaceNewLine=!0)),_(M)}function E(B,M){var G=B.next();if(G===">"){M.f=M.inline=h,W.highlightFormatting&&(M.formatting="link");var J=_(M);return J?J+=" ":J="",J+A.linkInline}return B.match(/^[^>]+/,!0),A.linkInline}function S(B,M){if(B.eatSpace())return null;var G=B.next();return G==="("||G==="["?(M.f=M.inline=R(G==="("?")":"]"),W.highlightFormatting&&(M.formatting="link-string"),M.linkHref=!0,_(M)):"error"}var w={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function R(B){return function(M,G){var J=M.next();if(J===B){G.f=G.inline=h,W.highlightFormatting&&(G.formatting="link-string");var K=_(G);return G.linkHref=!1,K}return M.match(w[B]),G.linkHref=!0,_(G)}}function N(B,M){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(M.f=F,B.next(),W.highlightFormatting&&(M.formatting="link"),M.linkText=!0,_(M)):t(B,M,h)}function F(B,M){if(B.match(/^\]:/,!0)){M.f=M.inline=z,W.highlightFormatting&&(M.formatting="link");var G=_(M);return M.linkText=!1,G}return B.match(/^([^\]\\]|\\.)+/,!0),A.linkText}function z(B,M){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?M.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),M.f=M.inline=h,A.linkHref+" url")}var q={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:h,text:x,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&ce.copyState(C,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?ce.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,M){if(M.formatting=!1,B!=M.thisLine.stream){if(M.header=0,M.hr=!1,B.match(/^\s*$/,!0))return y(M),null;if(M.prevLine=M.thisLine,M.thisLine={stream:B},M.taskList=!1,M.trailingSpace=0,M.trailingSpaceNewLine=!1,!M.localState&&(M.f=M.block,M.f!=g)){var G=B.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(M.indentation=G,M.indentationDiff=null,G>0)return null}}return M.f(B,M)},innerMode:function(B){return B.block==g?{state:B.htmlState,mode:C}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:q}},indent:function(B,M,G){return B.block==g&&C.indent?C.indent(B.htmlState,M,G):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,M,G):ce.Pass},blankLine:y,getType:_,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return q},"xml"),ce.defineMIME("text/markdown","markdown"),ce.defineMIME("text/x-markdown","markdown")})},n6Qo:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return O});var ce=V("cDcd"),ie=V("biw7"),W=V("fyJ8");function C(f){var p=f.className,c=f.index,s=f.children,n=f.colSpan,o=f.rowSpan,r=ce.useContext(ie.a),l=r.prefixCls,a=r.fixedInfoList,i=a[c];return ce.createElement(W.a,Object.assign({className:p,index:c,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:s,props:{colSpan:n,rowSpan:o}}}},i))}function D(f){return ce.createElement("tr",Object.assign({},f))}function T(f){var p=f.children,c=ce.useContext(ie.a),s=c.prefixCls;return ce.createElement("tfoot",{className:"".concat(s,"-summary")},p)}var A=Xe.b=T,O={Cell:C,Row:D}},nCk5:function(nt,Xe,V){nt.exports=V.p+"static/d.53bf6ae3.svg"},nWbc:function(nt,Xe,V){},oE5q:function(nt,Xe,V){nt.exports=V.p+"static/t.0b94c5c3.svg"},oFv4:function(nt,Xe,V){nt.exports=V.p+"static/internal.da228387.png"},osHv:function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";var ie=ce.Pos;function W(a,i){return a.line-i.line||a.ch-i.ch}var C="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",D=C+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",T=new RegExp("<(/?)(["+C+"]["+D+"]*)","g");function A(a,i,t,d){this.line=i,this.ch=t,this.cm=a,this.text=a.getLine(i),this.min=d?Math.max(d.from,a.firstLine()):a.firstLine(),this.max=d?Math.min(d.to-1,a.lastLine()):a.lastLine()}function O(a,i){var t=a.cm.getTokenTypeAt(ie(a.line,i));return t&&/\btag\b/.test(t)}function f(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function p(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function c(a){for(;;){var i=a.text.indexOf(">",a.ch);if(i==-1){if(f(a))continue;return}if(!O(a,i+1)){a.ch=i+1;continue}var t=a.text.lastIndexOf("/",i),d=t>-1&&!/\S/.test(a.text.slice(t+1,i));return a.ch=i+1,d?"selfClose":"regular"}}function s(a){for(;;){var i=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(i==-1){if(p(a))continue;return}if(!O(a,i+1)){a.ch=i;continue}T.lastIndex=i,a.ch=i;var t=T.exec(a.text);if(t&&t.index==i)return t}}function n(a){for(;;){T.lastIndex=a.ch;var i=T.exec(a.text);if(!i){if(f(a))continue;return}if(!O(a,i.index+1)){a.ch=i.index+1;continue}return a.ch=i.index+i[0].length,i}}function o(a){for(;;){var i=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(i==-1){if(p(a))continue;return}if(!O(a,i+1)){a.ch=i;continue}var t=a.text.lastIndexOf("/",i),d=t>-1&&!/\S/.test(a.text.slice(t+1,i));return a.ch=i+1,d?"selfClose":"regular"}}function r(a,i){for(var t=[];;){var d=n(a),v,y=a.line,b=a.ch-(d?d[0].length:0);if(!d||!(v=c(a)))return;if(v=="selfClose")continue;if(d[1]){for(var g=t.length-1;g>=0;--g)if(t[g]==d[2]){t.length=g;break}if(g<0&&(!i||i==d[2]))return{tag:d[2],from:ie(y,b),to:ie(a.line,a.ch)}}else t.push(d[2])}}function l(a,i){for(var t=[];;){var d=o(a);if(!d)return;if(d=="selfClose"){s(a);continue}var v=a.line,y=a.ch,b=s(a);if(!b)return;if(b[1])t.push(b[2]);else{for(var g=t.length-1;g>=0;--g)if(t[g]==b[2]){t.length=g;break}if(g<0&&(!i||i==b[2]))return{tag:b[2],from:ie(a.line,a.ch),to:ie(v,y)}}}}ce.registerHelper("fold","xml",function(a,i){for(var t=new A(a,i.line,0);;){var d=n(t);if(!d||t.line!=i.line)return;var v=c(t);if(!v)return;if(!d[1]&&v!="selfClose"){var y=ie(t.line,t.ch),b=r(t,d[2]);return b&&W(b.from,y)>0?{from:y,to:b.from}:null}}}),ce.findMatchingTag=function(a,i,t){var d=new A(a,i.line,i.ch,t);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var v=c(d),y=v&&ie(d.line,d.ch),b=v&&s(d);if(!v||!b||W(d,i)>0)return;var g={from:ie(d.line,d.ch),to:y,tag:b[2]};return v=="selfClose"?{open:g,close:null,at:"open"}:b[1]?{open:l(d,b[2]),close:g,at:"close"}:(d=new A(a,y.line,y.ch,t),{open:g,close:r(d,b[2]),at:"open"})},ce.findEnclosingTag=function(a,i,t,d){for(var v=new A(a,i.line,i.ch,t);;){var y=l(v,d);if(!y)break;var b=new A(a,i.line,i.ch,t),g=r(b,y.tag);if(g)return{open:y,close:g}}},ce.scanForClosingTag=function(a,i,t,d){var v=new A(a,i.line,i.ch,d?{from:0,to:d}:null);return r(v,t)}})},p5ED:function(nt,Xe,V){"use strict";var ce=V("+L6B"),ie=V("2/Rp"),W=V("5Dmo"),C=V("3S7+"),D=V("k1fw"),T=V("tJVT"),A=V("cDcd"),O=V.n(A),f=V("vHTk"),p=V.n(f),c=V("yEEn"),s=V("ZW9T"),n=V("1vsH");Xe.a=function(o){var r=o.name,l=o.data,a=o.theme,i=o.type,t=o.filename,d=o.monacoEditor,v=o.className,y=o.style,b=o.close,g=o.onClose,m=o.hasMask,_=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),x=Object(T.a)(_,2),h=x[0],E=x[1],S=Object(A.useState)(""),w=Object(T.a)(S,2),R=w[0],N=w[1],F,z=1024*1024,q=10*z,B=Object(A.useRef)();i==="office"&&(F=Object(n.V)(l).filesize,F>q&&(i="other")),t&&(d.filename=t),Object(A.useEffect)(function(){var J,K,Z=(J=document.cookie)===null||J===void 0||((K=J.replace(/\s/g,""))===null||K===void 0)?void 0:K.split(";");Z==null||Z.map(function(le){var de=le.split("=");de[0]==="_educoder_session"&&N(de[1])})},[]);var M=function(){if(l.startsWith("http")||l.startsWith("/")){G();return}Object(n.z)(t||"educoder",l,t)},G=function(){Object(n.x)(t||r,l)};return console.log("data:",l,"fileanme:",t," name:",r),O.a.createElement("div",{style:Object(D.a)({},y||{}),className:"".concat(m&&p.a.bgBlack," ").concat(i?p.a.wrp:"hide")},b&&O.a.createElement("div",{className:p.a.close,ref:B},O.a.createElement(C.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},O.a.createElement("span",{onClick:G},O.a.createElement("i",{className:"icon-quxiaozhiding"}))),O.a.createElement(C.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},O.a.createElement("span",{className:"",onClick:g},O.a.createElement("i",{className:"icon-guanbi1"})))),O.a.createElement("div",{className:"".concat(p.a[v]," ").concat(v," ").concat(p.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&O.a.createElement(s.b,d)),i==="audio"&&O.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),i==="video"&&O.a.createElement(O.a.Fragment,null,l!=null&&l.startsWith("/")?O.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):O.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),i==="html"&&O.a.createElement("iframe",{src:l+"&disposition=inline"}),i==="pdf"&&O.a.createElement("embed",{className:p.a.embed,src:l}),i==="image"&&O.a.createElement(O.a.Fragment,null,O.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),i==="other"&&O.a.createElement("div",null,O.a.createElement(ie.a,{type:"primary",size:"large",onClick:M},O.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&O.a.createElement(ie.a,{type:"primary",size:"large",onClick:M},O.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,Xe,V){},pYxM:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ppsT:function(nt,Xe,V){(function(ce){var ie,ie;!function(W){if(!0)window.OSS=W(),nt.exports=W();else var C}(function(){var W;return function(){function C(D,T,A){function O(c,s){if(!T[c]){if(!D[c]){var n=typeof ie=="function"&&ie;if(!s&&n)return ie(c,!0);if(f)return f(c,!0);var o=new Error("Cannot find module '"+c+"'");throw o.code="MODULE_NOT_FOUND",o}var r=T[c]={exports:{}};D[c][0].call(r.exports,function(l){return O(D[c][1][l]||l)},r,r.exports,C,D,T,A)}return T[c].exports}for(var f=typeof ie=="function"&&ie,p=0;p0?K["Content-Type"]=J.mime:K["Content-Type"]=b.getType(J.mime||v.extname(J.object||""))||"application/octet-stream"),J.content&&(K["Content-Md5"]=d.createHash("md5").update(new O(J.content,"utf8")).digest("base64"),K["Content-Length"]||(K["Content-Length"]=J.content.length));var Z=this._getResource(J);K.authorization=this.authorization(J.method,Z,J.subres,K);var le=this._getReqUrl(J);t("request %s %s, with headers %j, !!stream: %s",J.method,le,K,!!J.stream);var de=J.timeout||this.options.timeout;return{url:le,params:{agent:this.agent,method:J.method,content:J.content,stream:J.stream,headers:K,timeout:de,writeStream:J.writeStream,customResponse:J.customResponse,ctx:J.ctx||this.ctx}}},G.request=l.default.mark(function J(K){var Z,le,de,Te;return l.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return Z=this.createRequest(K),le=void 0,de=void 0,we.prev=3,we.next=6,this.urllib.request(Z.url,Z.params);case 6:le=we.sent,t("response %s %s, got %s, headers: %j",K.method,Z.url,le.status,le.headers),we.next=13;break;case 10:we.prev=10,we.t0=we.catch(3),de=we.t0;case 13:if(Te=void 0,!le||!K.successStatuses||K.successStatuses.indexOf(le.status)!==-1){we.next=26;break}return we.next=17,this.requestError(le);case 17:if(Te=we.sent,Te.code!=="RequestTimeTooSkewed"){we.next=23;break}return this.options.amendTimeSkewed=+new Date(Te.serverTime)-new Date,we.next=22,this.request(K);case 22:return we.abrupt("return",we.sent);case 23:Te.params=K,we.next=30;break;case 26:if(!de){we.next=30;break}return we.next=29,this.requestError(de);case 29:Te=we.sent;case 30:if(!Te){we.next=32;break}throw Te;case 32:if(!K.xmlResponse){we.next=36;break}return we.next=35,this.parseXML(le.data);case 35:le.data=we.sent;case 36:return we.abrupt("return",le);case 37:case"end":return we.stop()}},J,this,[[3,10]])}),G._getResource=function(J){var K="/";return J.bucket&&(K+=J.bucket+"/"),J.object&&(K+=J.object),K},G._isIP=function(J){return B._isIP(J)},G._escape=function(J){return w.encodeURIComponent(J).replace(/%2F/g,"/")},G._getReqUrl=function(J){var K={};y(this.options.endpoint).to(K);var Z=this._isIP(K.hostname),le=this.options.cname;!J.bucket||le||Z||(K.host=J.bucket+"."+K.host);var de="/";J.bucket&&Z&&(de+=J.bucket+"/"),J.object&&(de+=this._escape(J.object).replace(/\+/g,"%2B")),K.pathname=de;var Te={};if(J.query&&x(Te,J.query),J.subres){var we={};E.string(J.subres)?we[J.subres]="":E.array(J.subres)?J.subres.forEach(function(Ie){we[Ie]=""}):we=J.subres,x(Te,we)}return K.query=Te,h.format(K)},G._getUserAgent=function(){var J=A&&A.browser?"js":"nodejs",K="aliyun-sdk-"+J+"/"+N.version,Z=S.description;return!Z&&A&&(Z="Node.js "+A.version.slice(1)+" on "+A.platform+" "+A.arch),this._checkUserAgent(K+" "+Z)},G._checkUserAgent=function(J){return J.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},G.checkBrowserAndVersion=function(J,K){return z.name===J&&z.version.split(".")[0]===K},G.parseXML=function(J){return function(K){O.isBuffer(J)&&(J=J.toString()),g.parseString(J,{explicitRoot:!1,explicitArray:!1},K)}},G.requestError=l.default.mark(function J(K){var Z,le,de,Te;return l.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(Z=null,K.data&&K.data.length){we.next=5;break}K.status===-1||K.status===-2?(Z=new Error(K.message),Z.name=K.name,Z.status=K.status,Z.code=K.name):(K.status===404?(Z=new Error("Object not exists"),Z.name="NoSuchKeyError",Z.status=404,Z.code="NoSuchKey"):K.status===412?(Z=new Error("Pre condition failed"),Z.name="PreconditionFailedError",Z.status=412,Z.code="PreconditionFailed"):(Z=new Error("Unknow error, status: "+K.status),Z.name="UnknowError",Z.status=K.status),Z.requestId=K.headers["x-oss-request-id"],Z.host=""),we.next=30;break;case 5:return le=String(K.data),t("request response error data: %s",le),de=void 0,we.prev=8,we.next=11,this.parseXML(le)||{};case 11:de=we.sent,we.next=21;break;case 14:return we.prev=14,we.t0=we.catch(8),t(le),we.t0.message+=` raw xml: `+le,we.t0.status=K.status,we.t0.requestId=K.headers["x-oss-request-id"],we.abrupt("return",we.t0);case 21:Te=de.Message||"unknow request error, status: "+K.status,de.Condition&&(Te+=" (condition: "+de.Condition+")"),Z=new Error(Te),Z.name=de.Code?de.Code+"Error":"UnknowError",Z.status=K.status,Z.code=de.Code,Z.requestId=de.RequestId,Z.hostId=de.HostId,Z.serverTime=de.ServerTime;case 30:return t("generate error %j",Z),we.abrupt("return",Z);case 32:case"end":return we.stop()}},J,this,[[8,14]])})}).call(this,C("_process"),C("buffer").Buffer)},{"../common/multipart":8,"../common/signUtils":9,"../common/thunkpool.js":10,"../common/utils":11,"./../../shims/crypto/crypto.js":237,"./managed_upload":3,"./object":4,"./version":5,"./wrapper":6,_process:173,agentkeepalive:12,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,bowser:35,buffer:38,"copy-to":43,dateformat:154,debug:155,"humanize-ms":160,"is-type-of":165,"merge-descriptors":168,mime:242,path:170,platform:171,url:203,urllib:244,utility:243,xml2js:213}],3:[function(C,D,T){(function(A){"use strict";function O(y){return y&&y.__esModule?y:{default:y}}function f(y,b){if(!(this instanceof f))return new f(y,b);v.call(this,b),this.file=y,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=C("babel-runtime/core-js/array/from"),c=O(p),s=C("babel-runtime/regenerator"),n=O(s),o=C("is-type-of"),r=C("util"),l=C("path"),a=C("mime"),i=C("copy-to"),t=T;t.multipartUpload=n.default.mark(function y(b,g,m){var _,x,h,E,S,w,R,N,F;return n.default.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(this.resetCancelFlag(),m=m||{},!m.checkpoint||!m.checkpoint.uploadId){z.next=6;break}return z.next=5,this._resumeMultipart(m.checkpoint,m);case 5:return z.abrupt("return",z.sent);case 6:return _=102400,m.mime||(o.file(g)?m.mime=a.getType(l.extname(g.name)):o.blob(g)?m.mime=g.type:m.mime=a.getType(l.extname(g))),m.headers=m.headers||{},this._convertMetaToHeaders(m.meta,m.headers),z.next=12,this._getFileSize(g);case 12:if(!((x=z.sent)<_)){z.next=25;break}return h=this._createStream(g,0,x),m.contentLength=x,z.next=18,this.putStream(b,h,m);case 18:if(E=z.sent,!m||!m.progress){z.next=22;break}return z.next=22,m.progress(1);case 22:return S={res:E.res,bucket:this.options.bucket,name:b,etag:E.res.headers.etag},(m.headers&&m.headers["x-oss-callback"]||m.callback)&&(S.data=E.data),z.abrupt("return",S);case 25:if(!(m.partSize&&m.partSize<_)){z.next=27;break}throw new Error("partSize must not be smaller than "+_);case 27:return z.next=29,this.initMultipartUpload(b,m);case 29:if(w=z.sent,R=w.uploadId,N=this._getPartSize(x,m.partSize),F={file:g,name:b,fileSize:x,partSize:N,uploadId:R,doneParts:[]},!m||!m.progress){z.next=36;break}return z.next=36,m.progress(0,F,w.res);case 36:return z.next=38,this._resumeMultipart(F,m);case 38:return z.abrupt("return",z.sent);case 39:case"end":return z.stop()}},y,this)}),t._resumeMultipart=n.default.mark(function y(b,g){var m,_,x,h,E,S,w,R,N,F,z,q,B,M,G,J,K,Z,le,de,Te;return n.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(!this.isCancel()){we.next=2;break}throw this._makeCancelEvent();case 2:if(m=b.file,_=b.fileSize,x=b.partSize,h=b.uploadId,E=b.doneParts,S=b.name,w=[],E.length>0&&i(E).to(w),R=this._divideParts(_,x),N=R.length,F=!1,z=n.default.mark(function Ie(_e,ye){var Ke,Me,Fe;return n.default.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:if(_e.isCancel()){Ge.next=21;break}return Ge.prev=1,Ke=R[ye-1],Me={stream:_e._createStream(m,Ke.start,Ke.end),size:Ke.end-Ke.start},Ge.next=6,_e._uploadPart(S,h,ye,Me);case 6:if(Fe=Ge.sent,_e.isCancel()||F){Ge.next=13;break}if(b.doneParts.push({number:ye,etag:Fe.res.headers.etag}),w.push({number:ye,etag:Fe.res.headers.etag}),!g||!g.progress){Ge.next=13;break}return Ge.next=13,g.progress(E.length/N,b,Fe.res);case 13:Ge.next=21;break;case 15:if(Ge.prev=15,Ge.t0=Ge.catch(1),_e.isCancel()){Ge.next=21;break}throw _e.cancel(),Ge.t0.partNum=ye,Ge.t0;case 21:case"end":return Ge.stop()}},Ie,this,[[1,15]])}),q=(0,c.default)(new Array(N),function(Ie,_e){return _e+1}),B=w.map(function(Ie){return Ie.number}),M=q.filter(function(Ie){return B.indexOf(Ie)<0}),G=5,J=g.parallel||G,!this.checkBrowserAndVersion("Internet Explorer","10")&&J!==1){we.next=26;break}K=0;case 16:if(!(K0)){we.next=37;break}throw this.resetCancelFlag(),Te=de[0],Te.message="Failed to upload some parts with error: "+Te.toString()+" part_num: "+Te.partNum,Te;case 37:if(!this.isCancel()){we.next=40;break}throw Z=null,this._makeCancelEvent();case 40:return we.next=42,this.completeMultipartUpload(S,h,w,g);case 42:return we.abrupt("return",we.sent);case 43:case"end":return we.stop()}},y,this)}),o.file=function(y){return typeof File!="undefined"&&y instanceof File},o.blob=function(y){return typeof Blob!="undefined"&&y instanceof Blob},t._getFileSize=n.default.mark(function y(b){var g;return n.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!o.buffer(b)){m.next=4;break}return m.abrupt("return",b.length);case 4:if(!o.blob(b)&&!o.file(b)){m.next=6;break}return m.abrupt("return",b.size);case 6:if(!o.string(b)){m.next=11;break}return m.next=9,this._statFile(b);case 9:return g=m.sent,m.abrupt("return",g.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return m.stop()}},y,this)});var d=C("stream"),v=d.Readable;r.inherits(f,v),f.prototype.readFileAndPush=function(y){if(this.fileBuffer)for(var b=!0;b&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:m,this.start=m,b=this.push(this.fileBuffer.slice(g,m))}},f.prototype._read=function(y){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);y=y||16384;var b=this;this.reader.onload=function(g){b.fileBuffer=new A(new Uint8Array(g.target.result)),b.file=null,b.readFileAndPush(y)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(y)},t._createStream=function(y,b,g){if(o.blob(y)||o.file(y))return new f(y.slice(b,g));throw new Error("_createStream requires File/String.")},t._getPartSize=function(y,b){return b?Math.max(Math.ceil(y/1e4),b):1048576},t._divideParts=function(y,b){for(var g=Math.ceil(y/b),m=[],_=0;_ `,m.quiet?_+=` true `:_+=` false `,x=0;x"+n.escape(this._objectName(g[x]))+` `;return _+="",s("delete multi objects: %s",_),m.subres="delete",h=this._objectRequestParams("POST","",m),h.mime="xml",h.content=_,h.xmlResponse=!0,h.successStatuses=[200],R.next=14,this.request(h);case 14:return E=R.sent,S=E.data,w=S&&S.Deleted||null,w&&(Array.isArray(w)||(w=[w]),w=w.map(function(N){return N.Key})),R.abrupt("return",{res:E.res,deleted:w});case 19:case"end":return R.stop()}},b,this)}),y.copy=c.default.mark(function b(g,m,_){var x,h,E;return c.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return _=_||{},_.headers=_.headers||{},(0,f.default)(_.headers).forEach(function(w){_.headers["x-oss-copy-source-"+w.toLowerCase()]=_.headers[w]}),_.meta&&(_.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(_.meta,_.headers),m=m[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(m):"/"+encodeURIComponent(m.slice(1)),_.headers["x-oss-copy-source"]=m,x=this._objectRequestParams("PUT",g,_),x.xmlResponse=!0,x.successStatuses=[200,304],S.next=12,this.request(x);case 12:return h=S.sent,E=h.data,E&&(E={etag:E.ETag,lastModified:E.LastModified}),S.abrupt("return",{data:E,res:h.res});case 16:case"end":return S.stop()}},b,this)}),y.putMeta=c.default.mark(function b(g,m,_){return c.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,this.copy(g,g,{meta:m||{},timeout:_&&_.timeout,ctx:_&&_.ctx});case 2:return x.abrupt("return",x.sent);case 3:case"end":return x.stop()}},b,this)}),y.list=c.default.mark(function b(g,m){var _,x,h,E,S;return c.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return _=this._objectRequestParams("GET","",m),_.query=g,_.xmlResponse=!0,_.successStatuses=[200],w.next=6,this.request(_);case 6:return x=w.sent,h=x.data.Contents,E=this,h&&(Array.isArray(h)||(h=[h]),h=h.map(function(R){return{name:R.Key,url:E._objectUrl(R.Key),lastModified:R.LastModified,etag:R.ETag,type:R.Type,size:Number(R.Size),storageClass:R.StorageClass,owner:{id:R.Owner.ID,displayName:R.Owner.DisplayName}}})),S=x.data.CommonPrefixes||null,S&&(Array.isArray(S)||(S=[S]),S=S.map(function(R){return R.Prefix})),w.abrupt("return",{res:x.res,objects:h,prefixes:S,nextMarker:x.data.NextMarker||null,isTruncated:x.data.IsTruncated==="true"});case 13:case"end":return w.stop()}},b,this)}),y.putACL=c.default.mark(function b(g,m,_){var x,h;return c.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return _=_||{},_.subres="acl",_.headers=_.headers||{},_.headers["x-oss-object-acl"]=m,g=this._objectName(g),x=this._objectRequestParams("PUT",g,_),x.successStatuses=[200],E.next=9,this.request(x);case 9:return h=E.sent,E.abrupt("return",{res:h.res});case 11:case"end":return E.stop()}},b,this)}),y.getACL=c.default.mark(function b(g,m){var _,x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return m=m||{},m.subres="acl",g=this._objectName(g),_=this._objectRequestParams("GET",g,m),_.successStatuses=[200],_.xmlResponse=!0,h.next=8,this.request(_);case 8:return x=h.sent,h.abrupt("return",{acl:x.data.AccessControlList.Grant,owner:{id:x.data.Owner.ID,displayName:x.data.Owner.DisplayName},res:x.res});case 10:case"end":return h.stop()}},b,this)}),y.restore=c.default.mark(function b(g,m){var _,x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return m=m||{},m.subres="restore",_=this._objectRequestParams("POST",g,m),_.successStatuses=[202],h.next=6,this.request(_);case 6:return x=h.sent,h.abrupt("return",{res:x.res});case 8:case"end":return h.stop()}},b,this)}),y.signatureUrl=function(b,g){g=g||{},b=this._objectName(b),g.method=g.method||"GET";var m=n.timestamp()+(g.expires||1800),_={bucket:this.options.bucket,object:b},x=this._getResource(_);this.options.stsToken&&(g["security-token"]=this.options.stsToken);var h=v._signatureForURL(this.options.accessKeySecret,g,x,m),E=l.parse(this._getReqUrl(_));return E.query={OSSAccessKeyId:this.options.accessKeyId,Expires:m,Signature:h.Signature},a(h.subResource).to(E.query),E.format()},y.getObjectUrl=function(b,g){return g?g[g.length-1]!=="/"&&(g+="/"):g=this.options.endpoint.format(),g+this._escape(this._objectName(b))},y._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},y.generateObjectUrl=function(b,g){if(g)g[g.length-1]!=="/"&&(g+="/");else{g=this.options.endpoint.format();var m=l.parse(g),_=this.options.bucket;m.hostname=_+"."+m.hostname,m.host=_+"."+m.host,g=m.format()}return g+this._escape(this._objectName(b))},y._objectRequestParams=function(b,g,m){if(!this.options.bucket)throw new Error("Please create a bucket first");m=m||{},g=this._objectName(g);var _={object:g,bucket:this.options.bucket,method:b,subres:m&&m.subres,timeout:m&&m.timeout,ctx:m&&m.ctx};return m.headers&&(_.headers={},a(m.headers).to(_.headers)),_},y._objectName=function(b){return b.replace(/^\/+/,"")},y._statFile=function(b){return function(g){o.stat(b,g)}},y._convertMetaToHeaders=function(b,g){b&&(0,f.default)(b).forEach(function(m){g["x-oss-meta-"+m]=b[m]})},y._deleteFileSafe=function(b){return function(g){o.exists(b,function(m){m?o.unlink(b,function(_){_&&s("unlink %j error: %s",b,_),g()}):g()})}}},{"../common/callback":7,"../common/signUtils":9,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,"copy-to":43,debug:155,fs:36,"is-type-of":165,mime:242,path:170,url:203,utility:243}],5:[function(C,D,T){"use strict";T.version="5.3.1"},{}],6:[function(C,D,T){"use strict";function A(i){return i&&i.__esModule?i:{default:i}}function O(i){return i&&typeof i.next=="function"&&typeof i.throw=="function"}function f(i){if(!i)return!1;var t=i.constructor;return!!t&&(t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction"||O(t.prototype)||O(i.prototype))}function p(i,t){var d=new i(t),v=(0,r.default)(d),y=(0,r.default)((0,n.default)(d));v.concat(y).forEach(function(b){f(d[b])?this[b]=l.wrap(d[b]).bind(d):this[b]=d[b]},this)}function c(i){if(!(this instanceof c))return new c(i);p.call(this,a,i)}var s=C("babel-runtime/core-js/object/get-prototype-of"),n=A(s),o=C("babel-runtime/core-js/object/keys"),r=A(o),l=C("co"),a=C("./client");D.exports=c,c.STS=function i(t){if(!(this instanceof i))return new i(t);p.call(this,a.STS,t)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(C,D,T){(function(A){"use strict";function O(n){return n&&n.__esModule?n:{default:n}}var f=C("babel-runtime/core-js/object/keys"),p=O(f),c=C("babel-runtime/core-js/json/stringify"),s=O(c);T.encodeCallback=function(n,o){if(n.headers=n.headers||{},!Object.prototype.hasOwnProperty.call(n.headers,"x-oss-callback")&&o.callback){var r={callbackUrl:encodeURI(o.callback.url),callbackBody:o.callback.body};o.callback.host&&(r.callbackHost=o.callback.host),o.callback.contentType&&(r.callbackBodyType=o.callback.contentType);var l=new A((0,s.default)(r)).toString("base64");if(n.headers["x-oss-callback"]=l,o.callback.customValue){var a={};(0,p.default)(o.callback.customValue).forEach(function(i){a["x:"+i]=o.callback.customValue[i]}),n.headers["x-oss-callback-var"]=new A((0,s.default)(a)).toString("base64")}}}}).call(this,C("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(C,D,T){"use strict";var A=C("babel-runtime/regenerator"),O=function(s){return s&&s.__esModule?s:{default:s}}(A),f=C("copy-to"),p=C("./callback"),c=T;c.listUploads=O.default.mark(function s(n,o){var r,l,a,i;return O.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=o||{},r={},f(o).to(r),r.subres="uploads",l=this._objectRequestParams("GET","",r),l.query=n,l.xmlResponse=!0,l.successStatuses=[200],t.next=10,this.request(l);case 10:return a=t.sent,i=a.data.Upload||[],Array.isArray(i)||(i=[i]),i=i.map(function(d){return{name:d.Key,uploadId:d.UploadId,initiated:d.Initiated}}),t.abrupt("return",{res:a.res,uploads:i,bucket:a.data.Bucket,nextKeyMarker:a.data.NextKeyMarker,nextUploadIdMarker:a.data.NextUploadIdMarker,isTruncated:a.data.IsTruncated==="true"});case 15:case"end":return t.stop()}},s,this)}),c.listParts=O.default.mark(function s(n,o,r,l){var a,i,t;return O.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return l=l||{},a={},f(l).to(a),a.subres={uploadId:o},i=this._objectRequestParams("GET",n,a),i.query=r,i.xmlResponse=!0,i.successStatuses=[200],d.next=10,this.request(i);case 10:return t=d.sent,d.abrupt("return",{res:t.res,uploadId:t.data.UploadId,bucket:t.data.Bucket,name:t.data.Key,partNumberMarker:t.data.PartNumberMarker,nextPartNumberMarker:t.data.NextPartNumberMarker,maxParts:t.data.MaxParts,isTruncated:t.data.IsTruncated,parts:t.data.Part||[]});case 12:case"end":return d.stop()}},s,this)}),c.abortMultipartUpload=O.default.mark(function s(n,o,r){var l,a,i;return O.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancel(),r=r||{},l={},f(r).to(l),l.subres={uploadId:o},a=this._objectRequestParams("DELETE",n,l),a.successStatuses=[204],t.next=9,this.request(a);case 9:return i=t.sent,t.abrupt("return",{res:i.res});case 11:case"end":return t.stop()}},s,this)}),c.initMultipartUpload=O.default.mark(function s(n,o){var r,l,a;return O.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=o||{},r={},f(o).to(r),r.headers=r.headers||{},this._convertMetaToHeaders(o.meta,r.headers),r.subres="uploads",l=this._objectRequestParams("POST",n,r),l.mime=o.mime,l.xmlResponse=!0,l.successStatuses=[200],i.next=12,this.request(l);case 12:return a=i.sent,i.abrupt("return",{res:a.res,bucket:a.data.Bucket,name:a.data.Key,uploadId:a.data.UploadId});case 14:case"end":return i.stop()}},s,this)}),c.uploadPart=O.default.mark(function s(n,o,r,l,a,i,t){var d;return O.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return d={stream:this._createStream(l,a,i),size:i-a},v.next=3,this._uploadPart(n,o,r,d,t);case 3:return v.abrupt("return",v.sent);case 4:case"end":return v.stop()}},s,this)}),c.completeMultipartUpload=O.default.mark(function s(n,o,r,l){var a,i,t,d,v,y,b,g;return O.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:for(a=r.concat().sort(function(_,x){return _.number-x.number}).filter(function(_,x,h){return!x||_.number!==h[x-1].number}),i=` `,t=0;t `,i+=""+d.number+` `,i+=""+d.etag+` `,i+=` `;return i+="",l=l||{},v={},f(l).to(v),v.subres={uploadId:o},y=this._objectRequestParams("POST",n,v),p.encodeCallback(y,v),y.mime="xml",y.content=i,y.headers&&y.headers["x-oss-callback"]||(y.xmlResponse=!0),y.successStatuses=[200],m.next=16,this.request(y);case 16:return b=m.sent,g={res:b.res,bucket:y.bucket,name:n,etag:b.res.headers.etag},y.headers&&y.headers["x-oss-callback"]&&(g.data=JSON.parse(b.data.toString())),m.abrupt("return",g);case 20:case"end":return m.stop()}},s,this)}),c._uploadPart=O.default.mark(function s(n,o,r,l,a){var i,t,d;return O.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=a||{},i={},f(a).to(i),i.headers={"Content-Length":l.size},i.subres={partNumber:r,uploadId:o},t=this._objectRequestParams("PUT",n,i),t.mime=i.mime,t.stream=l.stream,t.successStatuses=[200],v.next=11,this.request(t);case 11:return d=v.sent,l.stream=null,t.stream=null,v.abrupt("return",{name:n,etag:d.res.headers.etag,res:d.res});case 15:case"end":return v.stop()}},s,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(C,D,T){(function(A){"use strict";function O(r){return r&&r.__esModule?r:{default:r}}var f=C("babel-runtime/core-js/json/stringify"),p=O(f),c=C("babel-runtime/core-js/object/keys"),s=O(c),n=C("./../../shims/crypto/crypto.js"),o=C("is-type-of");T.buildCanonicalizedResource=function(r,l){var a=""+r,i="?";if(o.string(l)&&l.trim()!=="")a+=i+l;else if(o.array(l))l.sort(),a+=i+l.join("&");else if(l){var t=function(v,y){return v[0]>y[0]?1:v[0]0)throw new Error("Invalid string. Length must be a multiple of 4");var y=d.indexOf("=");return y===-1&&(y=v),[y,y===v?0:4-y%4]}function O(d){var v=A(d),y=v[0],b=v[1];return 3*(y+b)/4-b}function f(d,v,y){return 3*(v+y)/4-y}function p(d){for(var v,y=A(d),b=y[0],g=y[1],m=new l(f(d,b,g)),_=0,x=g>0?b-4:b,h=0;h>16&255,m[_++]=v>>8&255,m[_++]=255&v;return g===2&&(v=r[d.charCodeAt(h)]<<2|r[d.charCodeAt(h+1)]>>4,m[_++]=255&v),g===1&&(v=r[d.charCodeAt(h)]<<10|r[d.charCodeAt(h+1)]<<4|r[d.charCodeAt(h+2)]>>2,m[_++]=v>>8&255,m[_++]=255&v),m}function c(d){return o[d>>18&63]+o[d>>12&63]+o[d>>6&63]+o[63&d]}function s(d,v,y){for(var b,g=[],m=v;m_?_:m+16383));return b===1?(v=d[y-1],g.push(o[v>>2]+o[v<<4&63]+"==")):b===2&&(v=(d[y-2]<<8)+d[y-1],g.push(o[v>>10]+o[v>>4&63]+o[v<<2&63]+"=")),g.join("")}T.byteLength=O,T.toByteArray=p,T.fromByteArray=n;for(var o=[],r=[],l=typeof Uint8Array!="undefined"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,t=a.length;i1&&K[1]||""}function a(J){var K=r.match(J);return K&&K.length>1&&K[2]||""}var i,t=l(/(ipod|iphone|ipad)/i).toLowerCase(),d=/like android/i.test(r),v=!d&&/android/i.test(r),y=/nexus\s*[0-6]\s*/i.test(r),b=!y&&/nexus\s*[0-9]+/i.test(r),g=/CrOS/.test(r),m=/silk/i.test(r),_=/sailfish/i.test(r),x=/tizen/i.test(r),h=/(web|hpw)os/i.test(r),E=/windows phone/i.test(r),S=(/SamsungBrowser/i.test(r),!E&&/windows/i.test(r)),w=!t&&!m&&/macintosh/i.test(r),R=!v&&!_&&!x&&!h&&/linux/i.test(r),N=a(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),F=l(/version\/(\d+(\.\d+)?)/i),z=/tablet/i.test(r)&&!/tablet pc/i.test(r),q=!z&&/[^-]mobi/i.test(r),B=/xbox/i.test(r);/opera/i.test(r)?i={name:"Opera",opera:n,version:F||l(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(r)?i={name:"Opera",opera:n,version:l(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||F}:/SamsungBrowser/i.test(r)?i={name:"Samsung Internet for Android",samsungBrowser:n,version:F||l(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(r)?i={name:"Opera Coast",coast:n,version:F||l(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(r)?i={name:"Yandex Browser",yandexbrowser:n,version:F||l(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(r)?i={name:"UC Browser",ucbrowser:n,version:l(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(r)?i={name:"Maxthon",maxthon:n,version:l(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(r)?i={name:"Epiphany",epiphany:n,version:l(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(r)?i={name:"Puffin",puffin:n,version:l(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(r)?i={name:"Sleipnir",sleipnir:n,version:l(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(r)?i={name:"K-Meleon",kMeleon:n,version:l(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:E?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:n},N?(i.msedge=n,i.version=N):(i.msie=n,i.version=l(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(r)?i={name:"Internet Explorer",msie:n,version:l(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:g?i={name:"Chrome",osname:"Chrome OS",chromeos:n,chromeBook:n,chrome:n,version:l(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(r)?i={name:"Microsoft Edge",msedge:n,version:N}:/vivaldi/i.test(r)?i={name:"Vivaldi",vivaldi:n,version:l(/vivaldi\/(\d+(\.\d+)?)/i)||F}:_?i={name:"Sailfish",osname:"Sailfish OS",sailfish:n,version:l(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(r)?i={name:"SeaMonkey",seamonkey:n,version:l(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(r)?(i={name:"Firefox",firefox:n,version:l(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(r)&&(i.firefoxos=n,i.osname="Firefox OS")):m?i={name:"Amazon Silk",silk:n,version:l(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(r)?i={name:"PhantomJS",phantom:n,version:l(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(r)?i={name:"SlimerJS",slimer:n,version:l(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(r)||/rim\stablet/i.test(r)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:n,version:F||l(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:h?(i={name:"WebOS",osname:"WebOS",webos:n,version:F||l(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(r)&&(i.touchpad=n)):/bada/i.test(r)?i={name:"Bada",osname:"Bada",bada:n,version:l(/dolfin\/(\d+(\.\d+)?)/i)}:x?i={name:"Tizen",osname:"Tizen",tizen:n,version:l(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||F}:/qupzilla/i.test(r)?i={name:"QupZilla",qupzilla:n,version:l(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||F}:/chromium/i.test(r)?i={name:"Chromium",chromium:n,version:l(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||F}:/chrome|crios|crmo/i.test(r)?i={name:"Chrome",chrome:n,version:l(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:v?i={name:"Android",version:F}:/safari|applewebkit/i.test(r)?(i={name:"Safari",safari:n},F&&(i.version=F)):t?(i={name:t=="iphone"?"iPhone":t=="ipad"?"iPad":"iPod"},F&&(i.version=F)):i=/googlebot/i.test(r)?{name:"Googlebot",googlebot:n,version:l(/googlebot\/(\d+(\.\d+))/i)||F}:{name:l(/^(.*)\/(.*) /),version:a(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(r)?(/(apple)?webkit\/537\.36/i.test(r)?(i.name=i.name||"Blink",i.blink=n):(i.name=i.name||"Webkit",i.webkit=n),!i.version&&F&&(i.version=F)):!i.opera&&/gecko\//i.test(r)&&(i.name=i.name||"Gecko",i.gecko=n,i.version=i.version||l(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!v&&!i.silk?!i.windowsphone&&t?(i[t]=n,i.ios=n,i.osname="iOS"):w?(i.mac=n,i.osname="macOS"):B?(i.xbox=n,i.osname="Xbox"):S?(i.windows=n,i.osname="Windows"):R&&(i.linux=n,i.osname="Linux"):(i.android=n,i.osname="Android");var M="";i.windows?M=function(J){switch(J){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(l(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?M=l(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(M=l(/Mac OS X (\d+([_\.\s]\d+)*)/i),M=M.replace(/[_\s]/g,".")):t?(M=l(/os (\d+([_\s]\d+)*) like mac os x/i),M=M.replace(/[_\s]/g,".")):v?M=l(/android[ \/-](\d+(\.\d+)*)/i):i.webos?M=l(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?M=l(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?M=l(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(M=l(/tizen[\/\s](\d+(\.\d+)*)/i)),M&&(i.osversion=M);var G=!i.windows&&M.split(".")[0];return z||b||t=="ipad"||v&&(G==3||G>=4&&!q)||i.silk?i.tablet=n:(q||t=="iphone"||t=="ipod"||v||y||i.blackberry||i.webos||i.bada)&&(i.mobile=n),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=n:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=n:i.x=n,i}function O(r){return r.split(".").length}function f(r,l){var a,i=[];if(Array.prototype.map)return Array.prototype.map.call(r,l);for(a=0;a=0;){if(a[0][l]>a[1][l])return 1;if(a[0][l]!==a[1][l])return-1;if(l===0)return 0}}function c(r,l,a){var i=o;typeof l=="string"&&(a=l,l=void 0),l===void 0&&(l=!1),a&&(i=A(a));var t=""+i.version;for(var d in r)if(r.hasOwnProperty(d)&&i[d]){if(typeof r[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(r));return p([t,r[d]])<0}return l}function s(r,l,a){return!c(r,l,a)}var n=!0,o=A(typeof navigator!="undefined"&&navigator.userAgent||"");return o.test=function(r){for(var l=0;l=this.charLength-this.charReceived?this.charLength-this.charReceived:o.length;if(o.copy(this.charBuffer,this.charReceived,0,l),this.charReceived+=l,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,o.length===0)return r;break}this.charLength+=this.surrogateSize,r=""}this.detectIncompleteChar(o);var a=o.length;this.charLength&&(o.copy(this.charBuffer,0,o.length-this.charReceived,a),a-=this.charReceived),r+=o.toString(this.encoding,0,a);var a=r.length-1,i=r.charCodeAt(a);if(i>=55296&&i<=56319){var t=this.surrogateSize;return this.charLength+=t,this.charReceived+=t,this.charBuffer.copy(this.charBuffer,t,0,t),o.copy(this.charBuffer,0,0,t),r.substring(0,a)}return r},n.prototype.detectIncompleteChar=function(o){for(var r=o.length>=3?3:o.length;r>0;r--){var l=o[o.length-r];if(r==1&&l>>5==6){this.charLength=2;break}if(r<=2&&l>>4==14){this.charLength=3;break}if(r<=3&&l>>3==30){this.charLength=4;break}}this.charReceived=r},n.prototype.end=function(o){var r="";if(o&&o.length&&(r=this.write(o)),this.charReceived){var l=this.charReceived,a=this.charBuffer,i=this.encoding;r+=a.slice(0,l).toString(i)}return r}},{buffer:38}],38:[function(C,D,T){(function(A){"use strict";function O(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(P,j){if(O()=O())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O().toString(16)+" bytes");return 0|P}function d(P){return+P!=P&&(P=0),p.alloc(+P)}function v(P,j){if(p.isBuffer(P))return P.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(P)||P instanceof ArrayBuffer))return P.byteLength;typeof P!="string"&&(P=""+P);var ee=P.length;if(ee===0)return 0;for(var $=!1;;)switch(j){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":case void 0:return ye(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*ee;case"hex":return ee>>>1;case"base64":return Fe(P).length;default:if($)return ye(P).length;j=(""+j).toLowerCase(),$=!0}}function y(P,j,ee){var $=!1;if((j===void 0||j<0)&&(j=0),j>this.length)return"";if((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)return"";if(ee>>>=0,j>>>=0,ee<=j)return"";for(P||(P="utf8");;)switch(P){case"hex":return B(this,j,ee);case"utf8":case"utf-8":return N(this,j,ee);case"ascii":return z(this,j,ee);case"latin1":case"binary":return q(this,j,ee);case"base64":return R(this,j,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,j,ee);default:if($)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),$=!0}}function b(P,j,ee){var $=P[j];P[j]=P[ee],P[ee]=$}function g(P,j,ee,$,Q){if(P.length===0)return-1;if(typeof ee=="string"?($=ee,ee=0):ee>2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,isNaN(ee)&&(ee=Q?0:P.length-1),ee<0&&(ee=P.length+ee),ee>=P.length){if(Q)return-1;ee=P.length-1}else if(ee<0){if(!Q)return-1;ee=0}if(typeof j=="string"&&(j=p.from(j,$)),p.isBuffer(j))return j.length===0?-1:m(P,j,ee,$,Q);if(typeof j=="number")return j&=255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(P,j,ee):Uint8Array.prototype.lastIndexOf.call(P,j,ee):m(P,[j],ee,$,Q);throw new TypeError("val must be string, number or Buffer")}function m(P,j,ee,$,Q){function xe(Ye,je){return De===1?Ye[je]:Ye.readUInt16BE(je*De)}var De=1,dt=P.length,Ne=j.length;if($!==void 0&&(($=String($).toLowerCase())==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(P.length<2||j.length<2)return-1;De=2,dt/=2,Ne/=2,ee/=2}var Be;if(Q){var tt=-1;for(Be=ee;Bedt&&(ee=dt-Ne),Be=ee;Be>=0;Be--){for(var lt=!0,qe=0;qeQ&&($=Q):$=Q;var xe=j.length;if(xe%2!=0)throw new TypeError("Invalid hex string");$>xe/2&&($=xe/2);for(var De=0;De<$;++De){var dt=parseInt(j.substr(2*De,2),16);if(isNaN(dt))return De;P[ee+De]=dt}return De}function x(P,j,ee,$){return Ge(ye(j,P.length-ee),P,ee,$)}function h(P,j,ee,$){return Ge(Ke(j),P,ee,$)}function E(P,j,ee,$){return h(P,j,ee,$)}function S(P,j,ee,$){return Ge(Fe(j),P,ee,$)}function w(P,j,ee,$){return Ge(Me(j,P.length-ee),P,ee,$)}function R(P,j,ee){return j===0&&ee===P.length?me.fromByteArray(P):me.fromByteArray(P.slice(j,ee))}function N(P,j,ee){ee=Math.min(P.length,ee);for(var $=[],Q=j;Q239?4:xe>223?3:xe>191?2:1;if(Q+dt<=ee){var Ne,Be,tt,lt;switch(dt){case 1:xe<128&&(De=xe);break;case 2:Ne=P[Q+1],(192&Ne)==128&&(lt=(31&xe)<<6|63&Ne)>127&&(De=lt);break;case 3:Ne=P[Q+1],Be=P[Q+2],(192&Ne)==128&&(192&Be)==128&&(lt=(15&xe)<<12|(63&Ne)<<6|63&Be)>2047&&(lt<55296||lt>57343)&&(De=lt);break;case 4:Ne=P[Q+1],Be=P[Q+2],tt=P[Q+3],(192&Ne)==128&&(192&Be)==128&&(192&tt)==128&&(lt=(15&xe)<<18|(63&Ne)<<12|(63&Be)<<6|63&tt)>65535&<<1114112&&(De=lt)}}De===null?(De=65533,dt=1):De>65535&&(De-=65536,$.push(De>>>10&1023|55296),De=56320|1023&De),$.push(De),Q+=dt}return F($)}function F(P){var j=P.length;if(j<=it)return String.fromCharCode.apply(String,P);for(var ee="",$=0;$$)&&(ee=$);for(var Q="",xe=j;xeee)throw new RangeError("Trying to access beyond buffer length")}function J(P,j,ee,$,Q,xe){if(!p.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>Q||jP.length)throw new RangeError("Index out of range")}function K(P,j,ee,$){j<0&&(j=65535+j+1);for(var Q=0,xe=Math.min(P.length-ee,2);Q>>8*($?Q:1-Q)}function Z(P,j,ee,$){j<0&&(j=4294967295+j+1);for(var Q=0,xe=Math.min(P.length-ee,4);Q>>8*($?Q:3-Q)&255}function le(P,j,ee,$,Q,xe){if(ee+$>P.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function de(P,j,ee,$,Q){return Q||le(P,j,ee,4,34028234663852886e22,-34028234663852886e22),We.write(P,j,ee,$,23,4),ee+4}function Te(P,j,ee,$,Q){return Q||le(P,j,ee,8,17976931348623157e292,-17976931348623157e292),We.write(P,j,ee,$,52,8),ee+8}function we(P){if(P=Ie(P).replace(re,""),P.length<2)return"";for(;P.length%4!=0;)P+="=";return P}function Ie(P){return P.trim?P.trim():P.replace(/^\s+|\s+$/g,"")}function _e(P){return P<16?"0"+P.toString(16):P.toString(16)}function ye(P,j){j=j||1/0;for(var ee,$=P.length,Q=null,xe=[],De=0;De<$;++De){if((ee=P.charCodeAt(De))>55295&&ee<57344){if(!Q){if(ee>56319){(j-=3)>-1&&xe.push(239,191,189);continue}if(De+1===$){(j-=3)>-1&&xe.push(239,191,189);continue}Q=ee;continue}if(ee<56320){(j-=3)>-1&&xe.push(239,191,189),Q=ee;continue}ee=65536+(Q-55296<<10|ee-56320)}else Q&&(j-=3)>-1&&xe.push(239,191,189);if(Q=null,ee<128){if((j-=1)<0)break;xe.push(ee)}else if(ee<2048){if((j-=2)<0)break;xe.push(ee>>6|192,63&ee|128)}else if(ee<65536){if((j-=3)<0)break;xe.push(ee>>12|224,ee>>6&63|128,63&ee|128)}else{if(!(ee<1114112))throw new Error("Invalid code point");if((j-=4)<0)break;xe.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,63&ee|128)}}return xe}function Ke(P){for(var j=[],ee=0;ee>8,Q=ee%256,xe.push(Q),xe.push($);return xe}function Fe(P){return me.toByteArray(we(P))}function Ge(P,j,ee,$){for(var Q=0;Q<$&&!(Q+ee>=j.length||Q>=P.length);++Q)j[Q+ee]=P[Q];return Q}function Ee(P){return P!==P}var me=C("base64-js"),We=C("ieee754"),He=C("isarray");T.Buffer=p,T.SlowBuffer=d,T.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=A.TYPED_ARRAY_SUPPORT!==void 0?A.TYPED_ARRAY_SUPPORT:function(){try{var P=new Uint8Array(1);return P.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},P.foo()===42&&typeof P.subarray=="function"&&P.subarray(1,1).byteLength===0}catch(j){return!1}}(),T.kMaxLength=O(),p.poolSize=8192,p._augment=function(P){return P.__proto__=p.prototype,P},p.from=function(P,j,ee){return c(null,P,j,ee)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0})),p.alloc=function(P,j,ee){return n(null,P,j,ee)},p.allocUnsafe=function(P){return o(null,P)},p.allocUnsafeSlow=function(P){return o(null,P)},p.isBuffer=function(P){return!(P==null||!P._isBuffer)},p.compare=function(P,j){if(!p.isBuffer(P)||!p.isBuffer(j))throw new TypeError("Arguments must be Buffers");if(P===j)return 0;for(var ee=P.length,$=j.length,Q=0,xe=Math.min(ee,$);Q0&&(P=this.toString("hex",0,j).match(/.{2}/g).join(" "),this.length>j&&(P+=" ... ")),""},p.prototype.compare=function(P,j,ee,$,Q){if(!p.isBuffer(P))throw new TypeError("Argument must be a Buffer");if(j===void 0&&(j=0),ee===void 0&&(ee=P?P.length:0),$===void 0&&($=0),Q===void 0&&(Q=this.length),j<0||ee>P.length||$<0||Q>this.length)throw new RangeError("out of range index");if($>=Q&&j>=ee)return 0;if($>=Q)return-1;if(j>=ee)return 1;if(j>>>=0,ee>>>=0,$>>>=0,Q>>>=0,this===P)return 0;for(var xe=Q-$,De=ee-j,dt=Math.min(xe,De),Ne=this.slice($,Q),Be=P.slice(j,ee),tt=0;ttQ)&&(ee=Q),P.length>0&&(ee<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");for(var xe=!1;;)switch($){case"hex":return _(this,P,j,ee);case"utf8":case"utf-8":return x(this,P,j,ee);case"ascii":return h(this,P,j,ee);case"latin1":case"binary":return E(this,P,j,ee);case"base64":return S(this,P,j,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,P,j,ee);default:if(xe)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),xe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var it=4096;p.prototype.slice=function(P,j){var ee=this.length;P=~~P,j=j===void 0?ee:~~j,P<0?(P+=ee)<0&&(P=0):P>ee&&(P=ee),j<0?(j+=ee)<0&&(j=0):j>ee&&(j=ee),j0&&(Q*=256);)$+=this[P+--j]*Q;return $},p.prototype.readUInt8=function(P,j){return j||G(P,1,this.length),this[P]},p.prototype.readUInt16LE=function(P,j){return j||G(P,2,this.length),this[P]|this[P+1]<<8},p.prototype.readUInt16BE=function(P,j){return j||G(P,2,this.length),this[P]<<8|this[P+1]},p.prototype.readUInt32LE=function(P,j){return j||G(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+16777216*this[P+3]},p.prototype.readUInt32BE=function(P,j){return j||G(P,4,this.length),16777216*this[P]+(this[P+1]<<16|this[P+2]<<8|this[P+3])},p.prototype.readIntLE=function(P,j,ee){P|=0,j|=0,ee||G(P,j,this.length);for(var $=this[P],Q=1,xe=0;++xe=Q&&($-=Math.pow(2,8*j)),$},p.prototype.readIntBE=function(P,j,ee){P|=0,j|=0,ee||G(P,j,this.length);for(var $=j,Q=1,xe=this[P+--$];$>0&&(Q*=256);)xe+=this[P+--$]*Q;return Q*=128,xe>=Q&&(xe-=Math.pow(2,8*j)),xe},p.prototype.readInt8=function(P,j){return j||G(P,1,this.length),128&this[P]?-1*(255-this[P]+1):this[P]},p.prototype.readInt16LE=function(P,j){j||G(P,2,this.length);var ee=this[P]|this[P+1]<<8;return 32768&ee?4294901760|ee:ee},p.prototype.readInt16BE=function(P,j){j||G(P,2,this.length);var ee=this[P+1]|this[P]<<8;return 32768&ee?4294901760|ee:ee},p.prototype.readInt32LE=function(P,j){return j||G(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},p.prototype.readInt32BE=function(P,j){return j||G(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},p.prototype.readFloatLE=function(P,j){return j||G(P,4,this.length),We.read(this,P,!0,23,4)},p.prototype.readFloatBE=function(P,j){return j||G(P,4,this.length),We.read(this,P,!1,23,4)},p.prototype.readDoubleLE=function(P,j){return j||G(P,8,this.length),We.read(this,P,!0,52,8)},p.prototype.readDoubleBE=function(P,j){return j||G(P,8,this.length),We.read(this,P,!1,52,8)},p.prototype.writeUIntLE=function(P,j,ee,$){(P=+P,j|=0,ee|=0,!$)&&J(this,P,j,ee,Math.pow(2,8*ee)-1,0);var Q=1,xe=0;for(this[j]=255&P;++xe=0&&(xe*=256);)this[j+Q]=P/xe&255;return j+ee},p.prototype.writeUInt8=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,1,255,0),p.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),this[j]=255&P,j+1},p.prototype.writeUInt16LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):K(this,P,j,!0),j+2},p.prototype.writeUInt16BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):K(this,P,j,!1),j+2},p.prototype.writeUInt32LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[j+3]=P>>>24,this[j+2]=P>>>16,this[j+1]=P>>>8,this[j]=255&P):Z(this,P,j,!0),j+4},p.prototype.writeUInt32BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):Z(this,P,j,!1),j+4},p.prototype.writeIntLE=function(P,j,ee,$){if(P=+P,j|=0,!$){var Q=Math.pow(2,8*ee-1);J(this,P,j,ee,Q-1,-Q)}var xe=0,De=1,dt=0;for(this[j]=255&P;++xe>0)-dt&255;return j+ee},p.prototype.writeIntBE=function(P,j,ee,$){if(P=+P,j|=0,!$){var Q=Math.pow(2,8*ee-1);J(this,P,j,ee,Q-1,-Q)}var xe=ee-1,De=1,dt=0;for(this[j+xe]=255&P;--xe>=0&&(De*=256);)P<0&&dt===0&&this[j+xe+1]!==0&&(dt=1),this[j+xe]=(P/De>>0)-dt&255;return j+ee},p.prototype.writeInt8=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,1,127,-128),p.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),P<0&&(P=255+P+1),this[j]=255&P,j+1},p.prototype.writeInt16LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):K(this,P,j,!0),j+2},p.prototype.writeInt16BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):K(this,P,j,!1),j+2},p.prototype.writeInt32LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8,this[j+2]=P>>>16,this[j+3]=P>>>24):Z(this,P,j,!0),j+4},p.prototype.writeInt32BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):Z(this,P,j,!1),j+4},p.prototype.writeFloatLE=function(P,j,ee){return de(this,P,j,!0,ee)},p.prototype.writeFloatBE=function(P,j,ee){return de(this,P,j,!1,ee)},p.prototype.writeDoubleLE=function(P,j,ee){return Te(this,P,j,!0,ee)},p.prototype.writeDoubleBE=function(P,j,ee){return Te(this,P,j,!1,ee)},p.prototype.copy=function(P,j,ee,$){if(ee||(ee=0),$||$===0||($=this.length),j>=P.length&&(j=P.length),j||(j=0),$>0&&$=this.length)throw new RangeError("sourceStart out of bounds");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),P.length-j<$-ee&&($=P.length-j+ee);var Q,xe=$-ee;if(this===P&&ee=0;--Q)P[Q+j]=this[Q+ee];else if(xe<1e3||!p.TYPED_ARRAY_SUPPORT)for(Q=0;Q>>=0,ee=ee===void 0?this.length:ee>>>0,P||(P=0);var xe;if(typeof P=="number")for(xe=j;xe>>1;c(f[o])2&&(y=l.call(arguments,1)),t(y)})})}function p(a){return Promise.all(a.map(O,this))}function c(a){for(var i=new a.constructor,t=Object.keys(a),d=[],v=0;va;)if((o=r[a++])!=o)return!0}else for(;l>a;a++)if((p||a in r)&&r[a]===s)return p||a||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(C,D,T){var A=C("./_cof"),O=C("./_wks")("toStringTag"),f=A(function(){return arguments}())=="Arguments",p=function(c,s){try{return c[s]}catch(n){}};D.exports=function(c){var s,n,o;return c===void 0?"Undefined":c===null?"Null":typeof(n=p(s=Object(c),O))=="string"?n:f?A(s):(o=A(s))=="Object"&&typeof s.callee=="function"?"Arguments":o}},{"./_cof":64,"./_wks":131}],64:[function(C,D,T){var A={}.toString;D.exports=function(O){return A.call(O).slice(8,-1)}},{}],65:[function(C,D,T){var A=D.exports={version:"2.5.7"};typeof __e=="number"&&(__e=A)},{}],66:[function(C,D,T){"use strict";var A=C("./_object-dp"),O=C("./_property-desc");D.exports=function(f,p,c){p in f?A.f(f,p,O(0,c)):f[p]=c}},{"./_object-dp":98,"./_property-desc":111}],67:[function(C,D,T){var A=C("./_a-function");D.exports=function(O,f,p){if(A(O),f===void 0)return O;switch(p){case 1:return function(c){return O.call(f,c)};case 2:return function(c,s){return O.call(f,c,s)};case 3:return function(c,s,n){return O.call(f,c,s,n)}}return function(){return O.apply(f,arguments)}}},{"./_a-function":58}],68:[function(C,D,T){D.exports=function(A){if(A==null)throw TypeError("Can't call method on "+A);return A}},{}],69:[function(C,D,T){D.exports=!C("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(C,D,T){var A=C("./_is-object"),O=C("./_global").document,f=A(O)&&A(O.createElement);D.exports=function(p){return f?O.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(C,D,T){D.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(C,D,T){var A=C("./_object-keys"),O=C("./_object-gops"),f=C("./_object-pie");D.exports=function(p){var c=A(p),s=O.f;if(s)for(var n,o=s(p),r=f.f,l=0;o.length>l;)r.call(p,n=o[l++])&&c.push(n);return c}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(C,D,T){var A=C("./_global"),O=C("./_core"),f=C("./_ctx"),p=C("./_hide"),c=C("./_has"),s=function(n,o,r){var l,a,i,t=n&s.F,d=n&s.G,v=n&s.S,y=n&s.P,b=n&s.B,g=n&s.W,m=d?O:O[o]||(O[o]={}),_=m.prototype,x=d?A:v?A[o]:(A[o]||{}).prototype;d&&(r=o);for(l in r)(a=!t&&x&&x[l]!==void 0)&&c(m,l)||(i=a?x[l]:r[l],m[l]=d&&typeof x[l]!="function"?r[l]:b&&a?f(i,A):g&&x[l]==i?function(h){var E=function(S,w,R){if(this instanceof h){switch(arguments.length){case 0:return new h;case 1:return new h(S);case 2:return new h(S,w)}return new h(S,w,R)}return h.apply(this,arguments)};return E.prototype=h.prototype,E}(i):y&&typeof i=="function"?f(Function.call,i):i,y&&((m.virtual||(m.virtual={}))[l]=i,n&s.R&&_&&!_[l]&&p(_,l,i)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,D.exports=s},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(C,D,T){D.exports=function(A){try{return!!A()}catch(O){return!0}}},{}],75:[function(C,D,T){var A=C("./_ctx"),O=C("./_iter-call"),f=C("./_is-array-iter"),p=C("./_an-object"),c=C("./_to-length"),s=C("./core.get-iterator-method"),n={},o={},T=D.exports=function(r,l,a,i,t){var d,v,y,b,g=t?function(){return r}:s(r),m=A(a,i,l?2:1),_=0;if(typeof g!="function")throw TypeError(r+" is not iterable!");if(f(g)){for(d=c(r.length);d>_;_++)if((b=l?m(p(v=r[_])[0],v[1]):m(r[_]))===n||b===o)return b}else for(y=g.call(r);!(v=y.next()).done;)if((b=O(y,m,v.value,l))===n||b===o)return b};T.BREAK=n,T.RETURN=o},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(C,D,T){var A=D.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=A)},{}],77:[function(C,D,T){var A={}.hasOwnProperty;D.exports=function(O,f){return A.call(O,f)}},{}],78:[function(C,D,T){var A=C("./_object-dp"),O=C("./_property-desc");D.exports=C("./_descriptors")?function(f,p,c){return A.f(f,p,O(1,c))}:function(f,p,c){return f[p]=c,f}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(C,D,T){var A=C("./_global").document;D.exports=A&&A.documentElement},{"./_global":76}],80:[function(C,D,T){D.exports=!C("./_descriptors")&&!C("./_fails")(function(){return Object.defineProperty(C("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(C,D,T){D.exports=function(A,O,f){var p=f===void 0;switch(O.length){case 0:return p?A():A.call(f);case 1:return p?A(O[0]):A.call(f,O[0]);case 2:return p?A(O[0],O[1]):A.call(f,O[0],O[1]);case 3:return p?A(O[0],O[1],O[2]):A.call(f,O[0],O[1],O[2]);case 4:return p?A(O[0],O[1],O[2],O[3]):A.call(f,O[0],O[1],O[2],O[3])}return A.apply(f,O)}},{}],82:[function(C,D,T){var A=C("./_cof");D.exports=Object("z").propertyIsEnumerable(0)?Object:function(O){return A(O)=="String"?O.split(""):Object(O)}},{"./_cof":64}],83:[function(C,D,T){var A=C("./_iterators"),O=C("./_wks")("iterator"),f=Array.prototype;D.exports=function(p){return p!==void 0&&(A.Array===p||f[O]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(C,D,T){var A=C("./_cof");D.exports=Array.isArray||function(O){return A(O)=="Array"}},{"./_cof":64}],85:[function(C,D,T){D.exports=function(A){return typeof A=="object"?A!==null:typeof A=="function"}},{}],86:[function(C,D,T){var A=C("./_an-object");D.exports=function(O,f,p,c){try{return c?f(A(p)[0],p[1]):f(p)}catch(n){var s=O.return;throw s!==void 0&&A(s.call(O)),n}}},{"./_an-object":61}],87:[function(C,D,T){"use strict";var A=C("./_object-create"),O=C("./_property-desc"),f=C("./_set-to-string-tag"),p={};C("./_hide")(p,C("./_wks")("iterator"),function(){return this}),D.exports=function(c,s,n){c.prototype=A(p,{next:O(1,n)}),f(c,s+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(C,D,T){"use strict";var A=C("./_library"),O=C("./_export"),f=C("./_redefine"),p=C("./_hide"),c=C("./_iterators"),s=C("./_iter-create"),n=C("./_set-to-string-tag"),o=C("./_object-gpo"),r=C("./_wks")("iterator"),l=!([].keys&&"next"in[].keys()),a=function(){return this};D.exports=function(i,t,d,v,y,b,g){s(d,t,v);var m,_,x,h=function(B){if(!l&&B in R)return R[B];switch(B){case"keys":case"values":return function(){return new d(this,B)}}return function(){return new d(this,B)}},E=t+" Iterator",S=y=="values",w=!1,R=i.prototype,N=R[r]||R["@@iterator"]||y&&R[y],F=N||h(y),z=y?S?h("entries"):F:void 0,q=t=="Array"&&R.entries||N;if(q&&(x=o(q.call(new i)))!==Object.prototype&&x.next&&(n(x,E,!0),A||typeof x[r]=="function"||p(x,r,a)),S&&N&&N.name!=="values"&&(w=!0,F=function(){return N.call(this)}),A&&!g||!l&&!w&&R[r]||p(R,r,F),c[t]=F,c[E]=a,y)if(m={values:S?F:h("values"),keys:b?F:h("keys"),entries:z},g)for(_ in m)_ in R||f(R,_,m[_]);else O(O.P+O.F*(l||w),t,m);return m}},{"./_export":73,"./_hide":78,"./_iter-create":87,"./_iterators":91,"./_library":92,"./_object-gpo":104,"./_redefine":113,"./_set-to-string-tag":115,"./_wks":131}],89:[function(C,D,T){var A=C("./_wks")("iterator"),O=!1;try{var f=[7][A]();f.return=function(){O=!0},Array.from(f,function(){throw 2})}catch(p){}D.exports=function(p,c){if(!c&&!O)return!1;var s=!1;try{var n=[7],o=n[A]();o.next=function(){return{done:s=!0}},n[A]=function(){return o},p(n)}catch(r){}return s}},{"./_wks":131}],90:[function(C,D,T){D.exports=function(A,O){return{value:O,done:!!A}}},{}],91:[function(C,D,T){D.exports={}},{}],92:[function(C,D,T){D.exports=!0},{}],93:[function(C,D,T){var A=C("./_uid")("meta"),O=C("./_is-object"),f=C("./_has"),p=C("./_object-dp").f,c=0,s=Object.isExtensible||function(){return!0},n=!C("./_fails")(function(){return s(Object.preventExtensions({}))}),o=function(t){p(t,A,{value:{i:"O"+ ++c,w:{}}})},r=function(t,d){if(!O(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!f(t,A)){if(!s(t))return"F";if(!d)return"E";o(t)}return t[A].i},l=function(t,d){if(!f(t,A)){if(!s(t))return!0;if(!d)return!1;o(t)}return t[A].w},a=function(t){return n&&i.NEED&&s(t)&&!f(t,A)&&o(t),t},i=D.exports={KEY:A,NEED:!1,fastKey:r,getWeak:l,onFreeze:a}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(C,D,T){var A=C("./_global"),O=C("./_task").set,f=A.MutationObserver||A.WebKitMutationObserver,p=A.process,c=A.Promise,s=C("./_cof")(p)=="process";D.exports=function(){var n,o,r,l=function(){var d,v;for(s&&(d=p.domain)&&d.exit();n;){v=n.fn,n=n.next;try{v()}catch(y){throw n?r():o=void 0,y}}o=void 0,d&&d.enter()};if(s)r=function(){p.nextTick(l)};else if(!f||A.navigator&&A.navigator.standalone)if(c&&c.resolve){var a=c.resolve(void 0);r=function(){a.then(l)}}else r=function(){O.call(A,l)};else{var i=!0,t=document.createTextNode("");new f(l).observe(t,{characterData:!0}),r=function(){t.data=i=!i}}return function(d){var v={fn:d,next:void 0};o&&(o.next=v),n||(n=v,r()),o=v}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(C,D,T){"use strict";function A(f){var p,c;this.promise=new f(function(s,n){if(p!==void 0||c!==void 0)throw TypeError("Bad Promise constructor");p=s,c=n}),this.resolve=O(p),this.reject=O(c)}var O=C("./_a-function");D.exports.f=function(f){return new A(f)}},{"./_a-function":58}],96:[function(C,D,T){"use strict";var A=C("./_object-keys"),O=C("./_object-gops"),f=C("./_object-pie"),p=C("./_to-object"),c=C("./_iobject"),s=Object.assign;D.exports=!s||C("./_fails")(function(){var n={},o={},r=Symbol(),l="abcdefghijklmnopqrst";return n[r]=7,l.split("").forEach(function(a){o[a]=a}),s({},n)[r]!=7||Object.keys(s({},o)).join("")!=l})?function(n,o){for(var r=p(n),l=arguments.length,a=1,i=O.f,t=f.f;l>a;)for(var d,v=c(arguments[a++]),y=i?A(v).concat(i(v)):A(v),b=y.length,g=0;b>g;)t.call(v,d=y[g++])&&(r[d]=v[d]);return r}:s},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(C,D,T){var A=C("./_an-object"),O=C("./_object-dps"),f=C("./_enum-bug-keys"),p=C("./_shared-key")("IE_PROTO"),c=function(){},s=function(){var n,o=C("./_dom-create")("iframe"),r=f.length;for(o.style.display="none",C("./_html").appendChild(o),o.src="javascript:",n=o.contentWindow.document,n.open(),n.write(""),n.close(),s=n.F;r--;)delete s.prototype[f[r]];return s()};D.exports=Object.create||function(n,o){var r;return n!==null?(c.prototype=A(n),r=new c,c.prototype=null,r[p]=n):r=s(),o===void 0?r:O(r,o)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(C,D,T){var A=C("./_an-object"),O=C("./_ie8-dom-define"),f=C("./_to-primitive"),p=Object.defineProperty;T.f=C("./_descriptors")?Object.defineProperty:function(c,s,n){if(A(c),s=f(s,!0),A(n),O)try{return p(c,s,n)}catch(o){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(c[s]=n.value),c}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(C,D,T){var A=C("./_object-dp"),O=C("./_an-object"),f=C("./_object-keys");D.exports=C("./_descriptors")?Object.defineProperties:function(p,c){O(p);for(var s,n=f(c),o=n.length,r=0;o>r;)A.f(p,s=n[r++],c[s]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(C,D,T){var A=C("./_object-pie"),O=C("./_property-desc"),f=C("./_to-iobject"),p=C("./_to-primitive"),c=C("./_has"),s=C("./_ie8-dom-define"),n=Object.getOwnPropertyDescriptor;T.f=C("./_descriptors")?n:function(o,r){if(o=f(o),r=p(r,!0),s)try{return n(o,r)}catch(l){}if(c(o,r))return O(!A.f.call(o,r),o[r])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(C,D,T){var A=C("./_to-iobject"),O=C("./_object-gopn").f,f={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(s){try{return O(s)}catch(n){return p.slice()}};D.exports.f=function(s){return p&&f.call(s)=="[object Window]"?c(s):O(A(s))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(C,D,T){var A=C("./_object-keys-internal"),O=C("./_enum-bug-keys").concat("length","prototype");T.f=Object.getOwnPropertyNames||function(f){return A(f,O)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(C,D,T){T.f=Object.getOwnPropertySymbols},{}],104:[function(C,D,T){var A=C("./_has"),O=C("./_to-object"),f=C("./_shared-key")("IE_PROTO"),p=Object.prototype;D.exports=Object.getPrototypeOf||function(c){return c=O(c),A(c,f)?c[f]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(C,D,T){var A=C("./_has"),O=C("./_to-iobject"),f=C("./_array-includes")(!1),p=C("./_shared-key")("IE_PROTO");D.exports=function(c,s){var n,o=O(c),r=0,l=[];for(n in o)n!=p&&A(o,n)&&l.push(n);for(;s.length>r;)A(o,n=s[r++])&&(~f(l,n)||l.push(n));return l}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(C,D,T){var A=C("./_object-keys-internal"),O=C("./_enum-bug-keys");D.exports=Object.keys||function(f){return A(f,O)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(C,D,T){T.f={}.propertyIsEnumerable},{}],108:[function(C,D,T){var A=C("./_export"),O=C("./_core"),f=C("./_fails");D.exports=function(p,c){var s=(O.Object||{})[p]||Object[p],n={};n[p]=c(s),A(A.S+A.F*f(function(){s(1)}),"Object",n)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(C,D,T){D.exports=function(A){try{return{e:!1,v:A()}}catch(O){return{e:!0,v:O}}}},{}],110:[function(C,D,T){var A=C("./_an-object"),O=C("./_is-object"),f=C("./_new-promise-capability");D.exports=function(p,c){if(A(p),O(c)&&c.constructor===p)return c;var s=f.f(p);return(0,s.resolve)(c),s.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(C,D,T){D.exports=function(A,O){return{enumerable:!(1&A),configurable:!(2&A),writable:!(4&A),value:O}}},{}],112:[function(C,D,T){var A=C("./_hide");D.exports=function(O,f,p){for(var c in f)p&&O[c]?O[c]=f[c]:A(O,c,f[c]);return O}},{"./_hide":78}],113:[function(C,D,T){D.exports=C("./_hide")},{"./_hide":78}],114:[function(C,D,T){"use strict";var A=C("./_global"),O=C("./_core"),f=C("./_object-dp"),p=C("./_descriptors"),c=C("./_wks")("species");D.exports=function(s){var n=typeof O[s]=="function"?O[s]:A[s];p&&n&&!n[c]&&f.f(n,c,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(C,D,T){var A=C("./_object-dp").f,O=C("./_has"),f=C("./_wks")("toStringTag");D.exports=function(p,c,s){p&&!O(p=s?p:p.prototype,f)&&A(p,f,{configurable:!0,value:c})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(C,D,T){var A=C("./_shared")("keys"),O=C("./_uid");D.exports=function(f){return A[f]||(A[f]=O(f))}},{"./_shared":117,"./_uid":127}],117:[function(C,D,T){var A=C("./_core"),O=C("./_global"),f=O["__core-js_shared__"]||(O["__core-js_shared__"]={});(D.exports=function(p,c){return f[p]||(f[p]=c!==void 0?c:{})})("versions",[]).push({version:A.version,mode:C("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(C,D,T){var A=C("./_an-object"),O=C("./_a-function"),f=C("./_wks")("species");D.exports=function(p,c){var s,n=A(p).constructor;return n===void 0||(s=A(n)[f])==null?c:O(s)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(C,D,T){var A=C("./_to-integer"),O=C("./_defined");D.exports=function(f){return function(p,c){var s,n,o=String(O(p)),r=A(c),l=o.length;return r<0||r>=l?f?"":void 0:(s=o.charCodeAt(r),s<55296||s>56319||r+1===l||(n=o.charCodeAt(r+1))<56320||n>57343?f?o.charAt(r):s:f?o.slice(r,r+2):n-56320+(s-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(C,D,T){var A,O,f,p=C("./_ctx"),c=C("./_invoke"),s=C("./_html"),n=C("./_dom-create"),o=C("./_global"),r=o.process,l=o.setImmediate,a=o.clearImmediate,i=o.MessageChannel,t=o.Dispatch,d=0,v={},y=function(){var g=+this;if(v.hasOwnProperty(g)){var m=v[g];delete v[g],m()}},b=function(g){y.call(g.data)};l&&a||(l=function(g){for(var m=[],_=1;arguments.length>_;)m.push(arguments[_++]);return v[++d]=function(){c(typeof g=="function"?g:Function(g),m)},A(d),d},a=function(g){delete v[g]},C("./_cof")(r)=="process"?A=function(g){r.nextTick(p(y,g,1))}:t&&t.now?A=function(g){t.now(p(y,g,1))}:i?(O=new i,f=O.port2,O.port1.onmessage=b,A=p(f.postMessage,f,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(A=function(g){o.postMessage(g+"","*")},o.addEventListener("message",b,!1)):A="onreadystatechange"in n("script")?function(g){s.appendChild(n("script")).onreadystatechange=function(){s.removeChild(this),y.call(g)}}:function(g){setTimeout(p(y,g,1),0)}),D.exports={set:l,clear:a}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(C,D,T){var A=C("./_to-integer"),O=Math.max,f=Math.min;D.exports=function(p,c){return p=A(p),p<0?O(p+c,0):f(p,c)}},{"./_to-integer":122}],122:[function(C,D,T){var A=Math.ceil,O=Math.floor;D.exports=function(f){return isNaN(f=+f)?0:(f>0?O:A)(f)}},{}],123:[function(C,D,T){var A=C("./_iobject"),O=C("./_defined");D.exports=function(f){return A(O(f))}},{"./_defined":68,"./_iobject":82}],124:[function(C,D,T){var A=C("./_to-integer"),O=Math.min;D.exports=function(f){return f>0?O(A(f),9007199254740991):0}},{"./_to-integer":122}],125:[function(C,D,T){var A=C("./_defined");D.exports=function(O){return Object(A(O))}},{"./_defined":68}],126:[function(C,D,T){var A=C("./_is-object");D.exports=function(O,f){if(!A(O))return O;var p,c;if(f&&typeof(p=O.toString)=="function"&&!A(c=p.call(O)))return c;if(typeof(p=O.valueOf)=="function"&&!A(c=p.call(O)))return c;if(!f&&typeof(p=O.toString)=="function"&&!A(c=p.call(O)))return c;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(C,D,T){var A=0,O=Math.random();D.exports=function(f){return"Symbol(".concat(f===void 0?"":f,")_",(++A+O).toString(36))}},{}],128:[function(C,D,T){var A=C("./_global"),O=A.navigator;D.exports=O&&O.userAgent||""},{"./_global":76}],129:[function(C,D,T){var A=C("./_global"),O=C("./_core"),f=C("./_library"),p=C("./_wks-ext"),c=C("./_object-dp").f;D.exports=function(s){var n=O.Symbol||(O.Symbol=f?{}:A.Symbol||{});s.charAt(0)=="_"||s in n||c(n,s,{value:p.f(s)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(C,D,T){T.f=C("./_wks")},{"./_wks":131}],131:[function(C,D,T){var A=C("./_shared")("wks"),O=C("./_uid"),f=C("./_global").Symbol,p=typeof f=="function";(D.exports=function(c){return A[c]||(A[c]=p&&f[c]||(p?f:O)("Symbol."+c))}).store=A},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(C,D,T){var A=C("./_classof"),O=C("./_wks")("iterator"),f=C("./_iterators");D.exports=C("./_core").getIteratorMethod=function(p){if(p!=null)return p[O]||p["@@iterator"]||f[A(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(C,D,T){"use strict";var A=C("./_ctx"),O=C("./_export"),f=C("./_to-object"),p=C("./_iter-call"),c=C("./_is-array-iter"),s=C("./_to-length"),n=C("./_create-property"),o=C("./core.get-iterator-method");O(O.S+O.F*!C("./_iter-detect")(function(r){Array.from(r)}),"Array",{from:function(r){var l,a,i,t,d=f(r),v=typeof this=="function"?this:Array,y=arguments.length,b=y>1?arguments[1]:void 0,g=b!==void 0,m=0,_=o(d);if(g&&(b=A(b,y>2?arguments[2]:void 0,2)),_==null||v==Array&&c(_))for(l=s(d.length),a=new v(l);l>m;m++)n(a,m,g?b(d[m],m):d[m]);else for(t=_.call(d),a=new v;!(i=t.next()).done;m++)n(a,m,g?p(t,b,[i.value,m],!0):i.value);return a.length=m,a}})},{"./_create-property":66,"./_ctx":67,"./_export":73,"./_is-array-iter":83,"./_iter-call":86,"./_iter-detect":89,"./_to-length":124,"./_to-object":125,"./core.get-iterator-method":132}],134:[function(C,D,T){"use strict";var A=C("./_add-to-unscopables"),O=C("./_iter-step"),f=C("./_iterators"),p=C("./_to-iobject");D.exports=C("./_iter-define")(Array,"Array",function(c,s){this._t=p(c),this._i=0,this._k=s},function(){var c=this._t,s=this._k,n=this._i++;return!c||n>=c.length?(this._t=void 0,O(1)):s=="keys"?O(0,n):s=="values"?O(0,c[n]):O(0,[n,c[n]])},"values"),f.Arguments=f.Array,A("keys"),A("values"),A("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(C,D,T){"use strict";var A=C("./_is-object"),O=C("./_object-gpo"),f=C("./_wks")("hasInstance"),p=Function.prototype;f in p||C("./_object-dp").f(p,f,{value:function(c){if(typeof this!="function"||!A(c))return!1;if(!A(this.prototype))return c instanceof this;for(;c=O(c);)if(this.prototype===c)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(C,D,T){var A=C("./_export");A(A.S+A.F,"Object",{assign:C("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(C,D,T){var A=C("./_export");A(A.S,"Object",{create:C("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(C,D,T){var A=C("./_export");A(A.S+A.F*!C("./_descriptors"),"Object",{defineProperty:C("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(C,D,T){C("./_object-sap")("getOwnPropertyNames",function(){return C("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(C,D,T){var A=C("./_to-object"),O=C("./_object-gpo");C("./_object-sap")("getPrototypeOf",function(){return function(f){return O(A(f))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(C,D,T){var A=C("./_to-object"),O=C("./_object-keys");C("./_object-sap")("keys",function(){return function(f){return O(A(f))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(C,D,T){arguments[4][36][0].apply(T,arguments)},{dup:36}],143:[function(C,D,T){"use strict";var A,O,f,p,c=C("./_library"),s=C("./_global"),n=C("./_ctx"),o=C("./_classof"),r=C("./_export"),l=C("./_is-object"),a=C("./_a-function"),i=C("./_an-instance"),t=C("./_for-of"),d=C("./_species-constructor"),v=C("./_task").set,y=C("./_microtask")(),b=C("./_new-promise-capability"),g=C("./_perform"),m=C("./_user-agent"),_=C("./_promise-resolve"),x=s.TypeError,h=s.process,E=h&&h.versions,S=E&&E.v8||"",w=s.Promise,R=o(h)=="process",N=function(){},F=O=b.f,z=!!function(){try{var le=w.resolve(1),de=(le.constructor={})[C("./_wks")("species")]=function(Te){Te(N,N)};return(R||typeof PromiseRejectionEvent=="function")&&le.then(N)instanceof de&&S.indexOf("6.6")!==0&&m.indexOf("Chrome/66")===-1}catch(Te){}}(),q=function(le){var de;return!(!l(le)||typeof(de=le.then)!="function")&&de},B=function(le,de){if(!le._n){le._n=!0;var Te=le._c;y(function(){for(var we=le._v,Ie=le._s==1,_e=0;Te.length>_e;)!function(ye){var Ke,Me,Fe,Ge=Ie?ye.ok:ye.fail,Ee=ye.resolve,me=ye.reject,We=ye.domain;try{Ge?(Ie||(le._h==2&&J(le),le._h=1),Ge===!0?Ke=we:(We&&We.enter(),Ke=Ge(we),We&&(We.exit(),Fe=!0)),Ke===ye.promise?me(x("Promise-chain cycle")):(Me=q(Ke))?Me.call(Ke,Ee,me):Ee(Ke)):me(we)}catch(He){We&&!Fe&&We.exit(),me(He)}}(Te[_e++]);le._c=[],le._n=!1,de&&!le._h&&M(le)})}},M=function(le){v.call(s,function(){var de,Te,we,Ie=le._v,_e=G(le);if(_e&&(de=g(function(){R?h.emit("unhandledRejection",Ie,le):(Te=s.onunhandledrejection)?Te({promise:le,reason:Ie}):(we=s.console)&&we.error&&we.error("Unhandled promise rejection",Ie)}),le._h=R||G(le)?2:1),le._a=void 0,_e&&de.e)throw de.v})},G=function(le){return le._h!==1&&(le._a||le._c).length===0},J=function(le){v.call(s,function(){var de;R?h.emit("rejectionHandled",le):(de=s.onrejectionhandled)&&de({promise:le,reason:le._v})})},K=function(le){var de=this;de._d||(de._d=!0,de=de._w||de,de._v=le,de._s=2,de._a||(de._a=de._c.slice()),B(de,!0))},Z=function(le){var de,Te=this;if(!Te._d){Te._d=!0,Te=Te._w||Te;try{if(Te===le)throw x("Promise can't be resolved itself");(de=q(le))?y(function(){var we={_w:Te,_d:!1};try{de.call(le,n(Z,we,1),n(K,we,1))}catch(Ie){K.call(we,Ie)}}):(Te._v=le,Te._s=1,B(Te,!1))}catch(we){K.call({_w:Te,_d:!1},we)}}};z||(w=function(le){i(this,w,"Promise","_h"),a(le),A.call(this);try{le(n(Z,this,1),n(K,this,1))}catch(de){K.call(this,de)}},A=function(le){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},A.prototype=C("./_redefine-all")(w.prototype,{then:function(le,de){var Te=F(d(this,w));return Te.ok=typeof le!="function"||le,Te.fail=typeof de=="function"&&de,Te.domain=R?h.domain:void 0,this._c.push(Te),this._a&&this._a.push(Te),this._s&&B(this,!1),Te.promise},catch:function(le){return this.then(void 0,le)}}),f=function(){var le=new A;this.promise=le,this.resolve=n(Z,le,1),this.reject=n(K,le,1)},b.f=F=function(le){return le===w||le===p?new f(le):O(le)}),r(r.G+r.W+r.F*!z,{Promise:w}),C("./_set-to-string-tag")(w,"Promise"),C("./_set-species")("Promise"),p=C("./_core").Promise,r(r.S+r.F*!z,"Promise",{reject:function(le){var de=F(this);return(0,de.reject)(le),de.promise}}),r(r.S+r.F*(c||!z),"Promise",{resolve:function(le){return _(c&&this===p?w:this,le)}}),r(r.S+r.F*!(z&&C("./_iter-detect")(function(le){w.all(le).catch(N)})),"Promise",{all:function(le){var de=this,Te=F(de),we=Te.resolve,Ie=Te.reject,_e=g(function(){var ye=[],Ke=0,Me=1;t(le,!1,function(Fe){var Ge=Ke++,Ee=!1;ye.push(void 0),Me++,de.resolve(Fe).then(function(me){Ee||(Ee=!0,ye[Ge]=me,--Me||we(ye))},Ie)}),--Me||we(ye)});return _e.e&&Ie(_e.v),Te.promise},race:function(le){var de=this,Te=F(de),we=Te.reject,Ie=g(function(){t(le,!1,function(_e){de.resolve(_e).then(Te.resolve,we)})});return Ie.e&&we(Ie.v),Te.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(C,D,T){var A=C("./_export"),O=C("./_to-absolute-index"),f=String.fromCharCode,p=String.fromCodePoint;A(A.S+A.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(c){for(var s,n=[],o=arguments.length,r=0;o>r;){if(s=+arguments[r++],O(s,1114111)!==s)throw RangeError(s+" is not a valid code point");n.push(s<65536?f(s):f(55296+((s-=65536)>>10),s%1024+56320))}return n.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(C,D,T){"use strict";var A=C("./_string-at")(!0);C("./_iter-define")(String,"String",function(O){this._t=String(O),this._i=0},function(){var O,f=this._t,p=this._i;return p>=f.length?{value:void 0,done:!0}:(O=A(f,p),this._i+=O.length,{value:O,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(C,D,T){"use strict";var A=C("./_global"),O=C("./_has"),f=C("./_descriptors"),p=C("./_export"),c=C("./_redefine"),s=C("./_meta").KEY,n=C("./_fails"),o=C("./_shared"),r=C("./_set-to-string-tag"),l=C("./_uid"),a=C("./_wks"),i=C("./_wks-ext"),t=C("./_wks-define"),d=C("./_enum-keys"),v=C("./_is-array"),y=C("./_an-object"),b=C("./_is-object"),g=C("./_to-iobject"),m=C("./_to-primitive"),_=C("./_property-desc"),x=C("./_object-create"),h=C("./_object-gopn-ext"),E=C("./_object-gopd"),S=C("./_object-dp"),w=C("./_object-keys"),R=E.f,N=S.f,F=h.f,z=A.Symbol,q=A.JSON,B=q&&q.stringify,M=a("_hidden"),G=a("toPrimitive"),J={}.propertyIsEnumerable,K=o("symbol-registry"),Z=o("symbols"),le=o("op-symbols"),de=Object.prototype,Te=typeof z=="function",we=A.QObject,Ie=!we||!we.prototype||!we.prototype.findChild,_e=f&&n(function(){return x(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a!=7})?function(ee,$,Q){var xe=R(de,$);xe&&delete de[$],N(ee,$,Q),xe&&ee!==de&&N(de,$,xe)}:N,ye=function(ee){var $=Z[ee]=x(z.prototype);return $._k=ee,$},Ke=Te&&typeof z.iterator=="symbol"?function(ee){return typeof ee=="symbol"}:function(ee){return ee instanceof z},Me=function(ee,$,Q){return ee===de&&Me(le,$,Q),y(ee),$=m($,!0),y(Q),O(Z,$)?(Q.enumerable?(O(ee,M)&&ee[M][$]&&(ee[M][$]=!1),Q=x(Q,{enumerable:_(0,!1)})):(O(ee,M)||N(ee,M,_(1,{})),ee[M][$]=!0),_e(ee,$,Q)):N(ee,$,Q)},Fe=function(ee,$){y(ee);for(var Q,xe=d($=g($)),De=0,dt=xe.length;dt>De;)Me(ee,Q=xe[De++],$[Q]);return ee},Ge=function(ee,$){return $===void 0?x(ee):Fe(x(ee),$)},Ee=function(ee){var $=J.call(this,ee=m(ee,!0));return!(this===de&&O(Z,ee)&&!O(le,ee))&&(!($||!O(this,ee)||!O(Z,ee)||O(this,M)&&this[M][ee])||$)},me=function(ee,$){if(ee=g(ee),$=m($,!0),ee!==de||!O(Z,$)||O(le,$)){var Q=R(ee,$);return!Q||!O(Z,$)||O(ee,M)&&ee[M][$]||(Q.enumerable=!0),Q}},We=function(ee){for(var $,Q=F(g(ee)),xe=[],De=0;Q.length>De;)O(Z,$=Q[De++])||$==M||$==s||xe.push($);return xe},He=function(ee){for(var $,Q=ee===de,xe=F(Q?le:g(ee)),De=[],dt=0;xe.length>dt;)!O(Z,$=xe[dt++])||Q&&!O(de,$)||De.push(Z[$]);return De};Te||(z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var ee=l(arguments.length>0?arguments[0]:void 0),$=function(Q){this===de&&$.call(le,Q),O(this,M)&&O(this[M],ee)&&(this[M][ee]=!1),_e(this,ee,_(1,Q))};return f&&Ie&&_e(de,ee,{configurable:!0,set:$}),ye(ee)},c(z.prototype,"toString",function(){return this._k}),E.f=me,S.f=Me,C("./_object-gopn").f=h.f=We,C("./_object-pie").f=Ee,C("./_object-gops").f=He,f&&!C("./_library")&&c(de,"propertyIsEnumerable",Ee,!0),i.f=function(ee){return ye(a(ee))}),p(p.G+p.W+p.F*!Te,{Symbol:z});for(var it="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;it.length>re;)a(it[re++]);for(var P=w(a.store),j=0;P.length>j;)t(P[j++]);p(p.S+p.F*!Te,"Symbol",{for:function(ee){return O(K,ee+="")?K[ee]:K[ee]=z(ee)},keyFor:function(ee){if(!Ke(ee))throw TypeError(ee+" is not a symbol!");for(var $ in K)if(K[$]===ee)return $},useSetter:function(){Ie=!0},useSimple:function(){Ie=!1}}),p(p.S+p.F*!Te,"Object",{create:Ge,defineProperty:Me,defineProperties:Fe,getOwnPropertyDescriptor:me,getOwnPropertyNames:We,getOwnPropertySymbols:He}),q&&p(p.S+p.F*(!Te||n(function(){var ee=z();return B([ee])!="[null]"||B({a:ee})!="{}"||B(Object(ee))!="{}"})),"JSON",{stringify:function(ee){for(var $,Q,xe=[ee],De=1;arguments.length>De;)xe.push(arguments[De++]);if(Q=$=xe[1],(b($)||ee!==void 0)&&!Ke(ee))return v($)||($=function(dt,Ne){if(typeof Q=="function"&&(Ne=Q.call(this,dt,Ne)),!Ke(Ne))return Ne}),xe[1]=$,B.apply(q,xe)}}),z.prototype[G]||C("./_hide")(z.prototype,G,z.prototype.valueOf),r(z,"Symbol"),r(Math,"Math",!0),r(A.JSON,"JSON",!0)},{"./_an-object":61,"./_descriptors":69,"./_enum-keys":72,"./_export":73,"./_fails":74,"./_global":76,"./_has":77,"./_hide":78,"./_is-array":84,"./_is-object":85,"./_library":92,"./_meta":93,"./_object-create":97,"./_object-dp":98,"./_object-gopd":100,"./_object-gopn":102,"./_object-gopn-ext":101,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_property-desc":111,"./_redefine":113,"./_set-to-string-tag":115,"./_shared":117,"./_to-iobject":123,"./_to-primitive":126,"./_uid":127,"./_wks":131,"./_wks-define":129,"./_wks-ext":130}],147:[function(C,D,T){"use strict";var A=C("./_export"),O=C("./_core"),f=C("./_global"),p=C("./_species-constructor"),c=C("./_promise-resolve");A(A.P+A.R,"Promise",{finally:function(s){var n=p(this,O.Promise||f.Promise),o=typeof s=="function";return this.then(o?function(r){return c(n,s()).then(function(){return r})}:s,o?function(r){return c(n,s()).then(function(){throw r})}:s)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(C,D,T){"use strict";var A=C("./_export"),O=C("./_new-promise-capability"),f=C("./_perform");A(A.S,"Promise",{try:function(p){var c=O.f(this),s=f(p);return(s.e?c.reject:c.resolve)(s.v),c.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(C,D,T){C("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(C,D,T){C("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(C,D,T){C("./es6.array.iterator");for(var A=C("./_global"),O=C("./_hide"),f=C("./_iterators"),p=C("./_wks")("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s0?"-":"+")+p(100*Math.floor(Math.abs(R)/60)+Math.abs(R)%60,4),S:["th","st","nd","rd"][g%10>3?0:(g%100-g%10!=10)*g%10],W:N,N:F};return t.replace(r,function(q){return q in z?z[q]:q.slice(1,q.length-1)})}}();o.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},o.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},typeof W=="function"&&W.amd?W(function(){return o}):(T===void 0?"undefined":(0,O.default)(T))==="object"?D.exports=o:f.dateFormat=o}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(C,D,T){(function(A){function O(){return!(typeof window=="undefined"||!window.process||window.process.type!=="renderer")||typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(n){var o=this.useColors;if(n[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+n[0]+(o?"%c ":" ")+"+"+T.humanize(this.diff),o){var r="color: "+this.color;n.splice(1,0,r,"color: inherit");var l=0,a=0;n[0].replace(/%[a-zA-Z%]/g,function(i){i!=="%%"&&(l++,i==="%c"&&(a=l))}),n.splice(a,0,r)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function c(n){try{n==null?T.storage.removeItem("debug"):T.storage.debug=n}catch(o){}}function s(){var n;try{n=T.storage.debug}catch(o){}return!n&&A!==void 0&&"env"in A&&(n=A.env.DEBUG),n}T=D.exports=C("./debug"),T.log=p,T.formatArgs=f,T.save=c,T.load=s,T.useColors=O,T.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(n){}}(),T.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],T.formatters.j=function(n){try{return JSON.stringify(n)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}},T.enable(s())}).call(this,C("_process"))},{"./debug":156,_process:173}],156:[function(C,D,T){function A(o){var r,l=0;for(r in o)l=(l<<5)-l+o.charCodeAt(r),l|=0;return T.colors[Math.abs(l)%T.colors.length]}function O(o){function r(){if(r.enabled){var l=r,a=+new Date,i=a-(n||a);l.diff=i,l.prev=n,l.curr=a,n=a;for(var t=new Array(arguments.length),d=0;d]/;D.exports=A},{}],158:[function(C,D,T){function A(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function O(s){return typeof s=="function"}function f(s){return typeof s=="number"}function p(s){return typeof s=="object"&&s!==null}function c(s){return s===void 0}D.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._maxListeners=void 0,A.defaultMaxListeners=10,A.prototype.setMaxListeners=function(s){if(!f(s)||s<0||isNaN(s))throw TypeError("n must be a positive number");return this._maxListeners=s,this},A.prototype.emit=function(s){var n,o,r,l,a,i;if(this._events||(this._events={}),s==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var t=new Error('Uncaught, unspecified "error" event. ('+n+")");throw t.context=n,t}if(o=this._events[s],c(o))return!1;if(O(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:l=Array.prototype.slice.call(arguments,1),o.apply(this,l)}else if(p(o))for(l=Array.prototype.slice.call(arguments,1),i=o.slice(),r=i.length,a=0;a0&&this._events[s].length>o&&(this._events[s].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[s].length),typeof console.trace=="function"&&console.trace()),this},A.prototype.on=A.prototype.addListener,A.prototype.once=function(s,n){function o(){this.removeListener(s,o),r||(r=!0,n.apply(this,arguments))}if(!O(n))throw TypeError("listener must be a function");var r=!1;return o.listener=n,this.on(s,o),this},A.prototype.removeListener=function(s,n){var o,r,l,a;if(!O(n))throw TypeError("listener must be a function");if(!this._events||!this._events[s])return this;if(o=this._events[s],l=o.length,r=-1,o===n||O(o.listener)&&o.listener===n)delete this._events[s],this._events.removeListener&&this.emit("removeListener",s,n);else if(p(o)){for(a=l;a-- >0;)if(o[a]===n||o[a].listener&&o[a].listener===n){r=a;break}if(r<0)return this;o.length===1?(o.length=0,delete this._events[s]):o.splice(r,1),this._events.removeListener&&this.emit("removeListener",s,n)}return this},A.prototype.removeAllListeners=function(s){var n,o;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[s]&&delete this._events[s],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[s],O(o))this.removeListener(s,o);else if(o)for(;o.length;)this.removeListener(s,o[o.length-1]);return delete this._events[s],this},A.prototype.listeners=function(s){return this._events&&this._events[s]?O(this._events[s])?[this._events[s]]:this._events[s].slice():[]},A.prototype.listenerCount=function(s){if(this._events){var n=this._events[s];if(O(n))return 1;if(n)return n.length}return 0},A.listenerCount=function(s,n){return s.listenerCount(n)}},{}],159:[function(C,D,T){var A=C("http"),O=D.exports;for(var f in A)A.hasOwnProperty(f)&&(O[f]=A[f]);O.request=function(p,c){return p||(p={}),p.scheme="https",p.protocol="https:",A.request.call(this,p,c)}},{http:196}],160:[function(C,D,T){"use strict";var A=C("util"),O=C("ms");D.exports=function(f){if(typeof f=="number")return f;var p=O(f);if(p===void 0){var c=new Error(A.format("humanize-ms(%j) result undefined",f));console.warn(c.stack)}return p}},{ms:169,util:207}],161:[function(C,D,T){T.read=function(A,O,f,p,c){var s,n,o=8*c-p-1,r=(1<>1,a=-7,i=f?c-1:0,t=f?-1:1,d=A[O+i];for(i+=t,s=d&(1<<-a)-1,d>>=-a,a+=o;a>0;s=256*s+A[O+i],i+=t,a-=8);for(n=s&(1<<-a)-1,s>>=-a,a+=p;a>0;n=256*n+A[O+i],i+=t,a-=8);if(s===0)s=1-l;else{if(s===r)return n?NaN:1/0*(d?-1:1);n+=Math.pow(2,p),s-=l}return(d?-1:1)*n*Math.pow(2,s-p)},T.write=function(A,O,f,p,c,s){var n,o,r,l=8*s-c-1,a=(1<>1,t=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=p?0:s-1,v=p?1:-1,y=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(o=isNaN(O)?1:0,n=a):(n=Math.floor(Math.log(O)/Math.LN2),O*(r=Math.pow(2,-n))<1&&(n--,r*=2),O+=n+i>=1?t/r:t*Math.pow(2,1-i),O*r>=2&&(n++,r/=2),n+i>=a?(o=0,n=a):n+i>=1?(o=(O*r-1)*Math.pow(2,c),n+=i):(o=O*Math.pow(2,i-1)*Math.pow(2,c),n=0));c>=8;A[f+d]=255&o,d+=v,o/=256,c-=8);for(n=n<0;A[f+d]=255&n,d+=v,n/=256,l-=8);A[f+d-v]|=128*y}},{}],162:[function(C,D,T){typeof Object.create=="function"?D.exports=function(A,O){A.super_=O,A.prototype=Object.create(O.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}})}:D.exports=function(A,O){A.super_=O;var f=function(){};f.prototype=O.prototype,A.prototype=new f,A.prototype.constructor=A}},{}],163:[function(C,D,T){function A(f){return!!f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function O(f){return typeof f.readFloatLE=="function"&&typeof f.slice=="function"&&A(f.slice(0,0))}D.exports=function(f){return f!=null&&(A(f)||O(f)||!!f._isBuffer)}},{}],164:[function(C,D,T){!function(A){function O(c){return p.call(c).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function f(c){return typeof c=="function"&&(/^class(\s|\{\}$)/.test(p.call(c))||/^.*classCallCheck\(/.test(O(c)))}var p=Function.prototype.toString;T!==void 0?(D!==void 0&&D.exports&&(T=D.exports=f),T.isClass=f):typeof W=="function"&&W.amd?W([],function(){return f}):A.isClass=f}(this)},{}],165:[function(C,D,T){"use strict";function A(s){var n=s.slice(2);return n=n[0].toLowerCase()+n.slice(1)}var O=C("core-util-is"),f=C("isstream"),p=C("is-class");Object.keys(O).map(function(s){T[A(s)]=O[s]}),T.stream=f,T.readableStream=f.isReadable,T.writableStream=f.isWritable,T.duplexStream=f.isDuplex,T.class=p,T.finite=function(s){return Number.isFinite(s)},T.NaN=function(s){return Number.isNaN(s)},T.generator=function(s){return s&&typeof s.next=="function"&&typeof s.throw=="function"},T.generatorFunction=function(s){return s&&s.constructor&&s.constructor.name==="GeneratorFunction"},T.asyncFunction=function(s){return s&&s.constructor&&s.constructor.name==="AsyncFunction"},T.promise=function(s){return s&&typeof s.then=="function"};var c=Math.pow(2,31);T.int=function(s){return O.isNumber(s)&&s%1==0},T.int32=function(s){return T.int(s)&&s=-c},T.long=function(s){return T.int(s)&&(s>=c||s<-c)},T.Long=function(s){return T.object(s)&&T.number(s.high)&&T.number(s.low)},T.double=function(s){return O.isNumber(s)&&!isNaN(s)&&s%1!=0},T.date=function(s){return s instanceof Date},T.regExp=function(s){return s instanceof RegExp},T.regexp=T.regExp,T.error=function(s){return s instanceof Error},T.array=function(s){return Array.isArray(s)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(C,D,T){var A={}.toString;D.exports=Array.isArray||function(O){return A.call(O)=="[object Array]"}},{}],167:[function(C,D,T){function A(s){return s instanceof c.Stream}function O(s){return A(s)&&typeof s._read=="function"&&typeof s._readableState=="object"}function f(s){return A(s)&&typeof s._write=="function"&&typeof s._writableState=="object"}function p(s){return O(s)&&f(s)}var c=C("stream");D.exports=A,D.exports.isReadable=O,D.exports.isWritable=f,D.exports.isDuplex=p},{stream:195}],168:[function(C,D,T){"use strict";function A(f,p,c){if(!f)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return c===void 0&&(c=!0),Object.getOwnPropertyNames(p).forEach(function(s){if(c||!O.call(f,s)){var n=Object.getOwnPropertyDescriptor(p,s);Object.defineProperty(f,s,n)}}),f}D.exports=A;var O=Object.prototype.hasOwnProperty},{}],169:[function(C,D,T){function A(l){if(l=String(l),!(l.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(l);if(a){var i=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*r;case"days":case"day":case"d":return i*o;case"hours":case"hour":case"hrs":case"hr":case"h":return i*n;case"minutes":case"minute":case"mins":case"min":case"m":return i*s;case"seconds":case"second":case"secs":case"sec":case"s":return i*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function O(l){return l>=o?Math.round(l/o)+"d":l>=n?Math.round(l/n)+"h":l>=s?Math.round(l/s)+"m":l>=c?Math.round(l/c)+"s":l+"ms"}function f(l){return p(l,o,"day")||p(l,n,"hour")||p(l,s,"minute")||p(l,c,"second")||l+" ms"}function p(l,a,i){if(!(l0)return A(l);if(i==="number"&&isNaN(l)===!1)return a.long?f(l):O(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))}},{}],170:[function(C,D,T){(function(A){function O(s,n){for(var o=0,r=s.length-1;r>=0;r--){var l=s[r];l==="."?s.splice(r,1):l===".."?(s.splice(r,1),o++):o&&(s.splice(r,1),o--)}if(n)for(;o--;o)s.unshift("..");return s}function f(s){typeof s!="string"&&(s+="");var n,o=0,r=-1,l=!0;for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!l){o=n+1;break}}else r===-1&&(l=!1,r=n+1);return r===-1?"":s.slice(o,r)}function p(s,n){if(s.filter)return s.filter(n);for(var o=[],r=0;r=-1&&!n;o--){var r=o>=0?arguments[o]:A.cwd();if(typeof r!="string")throw new TypeError("Arguments to path.resolve must be strings");r&&(s=r+"/"+s,n=r.charAt(0)==="/")}return s=O(p(s.split("/"),function(l){return!!l}),!n).join("/"),(n?"/":"")+s||"."},T.normalize=function(s){var n=T.isAbsolute(s),o=c(s,-1)==="/";return s=O(p(s.split("/"),function(r){return!!r}),!n).join("/"),s||n||(s="."),s&&o&&(s+="/"),(n?"/":"")+s},T.isAbsolute=function(s){return s.charAt(0)==="/"},T.join=function(){var s=Array.prototype.slice.call(arguments,0);return T.normalize(p(s,function(n,o){if(typeof n!="string")throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))},T.relative=function(s,n){function o(v){for(var y=0;y=0&&v[b]==="";b--);return y>b?[]:v.slice(y,b-y+1)}s=T.resolve(s).substr(1),n=T.resolve(n).substr(1);for(var r=o(s.split("/")),l=o(n.split("/")),a=Math.min(r.length,l.length),i=a,t=0;t=1;--a)if((n=s.charCodeAt(a))===47){if(!l){r=a;break}}else l=!1;return r===-1?o?"/":".":o&&r===1?"/":s.slice(0,r)},T.basename=function(s,n){var o=f(s);return n&&o.substr(-1*n.length)===n&&(o=o.substr(0,o.length-n.length)),o},T.extname=function(s){typeof s!="string"&&(s+="");for(var n=-1,o=0,r=-1,l=!0,a=0,i=s.length-1;i>=0;--i){var t=s.charCodeAt(i);if(t!==47)r===-1&&(l=!1,r=i+1),t===46?n===-1?n=i:a!==1&&(a=1):n!==-1&&(a=-1);else if(!l){o=i+1;break}}return n===-1||r===-1||a===0||a===1&&n===r-1&&n===o+1?"":s.slice(n,r)};var c="ab".substr(-1)==="b"?function(s,n,o){return s.substr(n,o)}:function(s,n,o){return n<0&&(n=s.length+n),s.substr(n,o)}}).call(this,C("_process"))},{_process:173}],171:[function(C,D,T){(function(A){(function(){"use strict";function O(S){return S=String(S),S.charAt(0).toUpperCase()+S.slice(1)}function f(S,w,R){var N={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return w&&R&&/^Win/i.test(S)&&!/^Windows Phone /i.test(S)&&(N=N[/[\d.]+$/.exec(S)])&&(S="Windows "+N),S=String(S),w&&R&&(S=S.replace(RegExp(w,"i"),R)),S=c(S.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}function p(S,w){var R=-1,N=S?S.length:0;if(typeof N=="number"&&N>-1&&N<=g)for(;++R3&&"WebKit"||/\bOpera\b/.test(He)&&(/\bOPR\b/.test(S)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(S)&&!/^(?:Trident|EdgeHTML)$/.test(We)&&"WebKit"||!We&&/\bMSIE\b/i.test(S)&&(P=="Mac OS"?"Tasman":"Trident")||We=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(He)&&"NetFront")&&(We=[B]),He=="IE"&&(B=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(S)||0)[1])?(He+=" Mobile",P="Windows Phone "+(/\+$/.test(B)?B:B+".x"),Fe.unshift("desktop mode")):/\bWPDesktop\b/i.test(S)?(He="IE Mobile",P="Windows Phone 8.x",Fe.unshift("desktop mode"),me||(me=(/\brv:([\d.]+)/.exec(S)||0)[1])):He!="IE"&&We=="Trident"&&(B=/\brv:([\d.]+)/.exec(S))&&(He&&Fe.push("identifying as "+He+(me?" "+me:"")),He="IE",me=B[1]),Ee){if(o(N,"global"))if(de&&(B=de.lang.System,Me=B.getProperty("os.arch"),P=P||B.getProperty("os.name")+" "+B.getProperty("os.version")),Te){try{me=N.require("ringo/engine").version.join("."),He="RingoJS"}catch(ee){(B=N.system)&&B.global.system==N.system&&(He="Narwhal",P||(P=B[0].os||null))}He||(He="Rhino")}else typeof N.process=="object"&&!N.process.browser&&(B=N.process)&&(typeof B.versions=="object"&&(typeof B.versions.electron=="string"?(Fe.push("Node "+B.versions.node),He="Electron",me=B.versions.electron):typeof B.versions.nw=="string"&&(Fe.push("Chromium "+me,"Node "+B.versions.node),He="NW.js",me=B.versions.nw)),He||(He="Node.js",Me=B.arch,P=B.platform,me=/[\d.]+/.exec(B.version),me=me?me[0]:null));else n(B=N.runtime)==J?(He="Adobe AIR",P=B.flash.system.Capabilities.os):n(B=N.phantom)==le?(He="PhantomJS",me=(B=B.version||null)&&B.major+"."+B.minor+"."+B.patch):typeof _e.documentMode=="number"&&(B=/\bTrident\/(\d+)/i.exec(S))?(me=[me,_e.documentMode],(B=+B[1]+4)!=me[1]&&(Fe.push("IE "+me[1]+" mode"),We&&(We[1]=""),me[1]=B),me=He=="IE"?String(me[1].toFixed(1)):me[0]):typeof _e.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(He)&&(Fe.push("masking as "+He+" "+me),He="IE",me="11.0",We=["Trident"],P="Windows");P=P&&c(P)}if(me&&(B=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(me)||/(?:alpha|beta)(?: ?\d)?/i.exec(S+";"+(Ee&&z.appMinorVersion))||/\bMinefield\b/i.test(S)&&"a")&&(Ge=/b/i.test(B)?"beta":"alpha",me=me.replace(RegExp(B+"\\+?$"),"")+(Ge=="beta"?Ie:we)+(/\d+\+?/.exec(B)||"")),He=="Fennec"||He=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(P))He="Firefox Mobile";else if(He=="Maxthon"&&me)me=me.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(it))it=="Xbox 360"&&(P=null),it=="Xbox 360"&&/\bIEMobile\b/.test(S)&&Fe.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(He)&&(!He||it||/Browser|Mobi/.test(He))||P!="Windows CE"&&!/Mobi/i.test(S))if(He=="IE"&&Ee)try{N.external===null&&Fe.unshift("platform preview")}catch(ee){Fe.unshift("embedded")}else(/\bBlackBerry\b/.test(it)||/\bBB10\b/.test(S))&&(B=(RegExp(it.replace(/ +/g," *")+"/([.\\d]+)","i").exec(S)||0)[1]||me)?(B=[B,/BB10/.test(S)],P=(B[1]?(it=null,re="BlackBerry"):"Device Software")+" "+B[0],me=null):this!=s&&it!="Wii"&&(Ee&&ye||/Opera/.test(He)&&/\b(?:MSIE|Firefox)\b/i.test(S)||He=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(P)||He=="IE"&&(P&&!/^Win/.test(P)&&me>5.5||/\bWindows XP\b/.test(P)&&me>8||me==8&&!/\bTrident\b/.test(S)))&&!m.test(B=i.call(s,S.replace(m,"")+";"))&&B.name&&(B="ing as "+B.name+((B=B.version)?" "+B:""),m.test(He)?(/\bIE\b/.test(B)&&P=="Mac OS"&&(P=null),B="identify"+B):(B="mask"+B,He=Ke?c(Ke.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(B)&&(P=null),Ee||(me=null)),We=["Presto"],Fe.push(B));else He+=" Mobile";(B=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(S)||0)[1])&&(B=[parseFloat(B.replace(/\.(\d)$/,".0$1")),B],He=="Safari"&&B[1].slice(-1)=="+"?(He="WebKit Nightly",Ge="alpha",me=B[1].slice(0,-1)):me!=B[1]&&me!=(B[2]=(/\bSafari\/([\d.]+\+?)/i.exec(S)||0)[1])||(me=null),B[1]=(/\bChrome\/([\d.]+)/i.exec(S)||0)[1],B[0]==537.36&&B[2]==537.36&&parseFloat(B[1])>=28&&We=="WebKit"&&(We=["Blink"]),Ee&&(G||B[1])?(We&&(We[1]="like Chrome"),B=B[1]||(B=B[0],B<530?1:B<532?2:B<532.05?3:B<533?4:B<534.03?5:B<534.07?6:B<534.1?7:B<534.13?8:B<534.16?9:B<534.24?10:B<534.3?11:B<535.01?12:B<535.02?"13+":B<535.07?15:B<535.11?16:B<535.19?17:B<536.05?18:B<536.1?19:B<537.01?20:B<537.11?"21+":B<537.13?23:B<537.18?24:B<537.24?25:B<537.36?26:We!="Blink"?"27":"28")):(We&&(We[1]="like Safari"),B=B[0],B=B<400?1:B<500?2:B<526?3:B<533?4:B<534?"4+":B<535?5:B<537?6:B<538?7:B<601?8:"8"),We&&(We[1]+=" "+(B+=typeof B=="number"?".x":/[.+]/.test(B)?"":"+")),He=="Safari"&&(!me||parseInt(me)>45)&&(me=B)),He=="Opera"&&(B=/\bzbov|zvav$/.exec(P))?(He+=" ",Fe.unshift("desktop mode"),B=="zvav"?(He+="Mini",me=null):He+="Mobile",P=P.replace(RegExp(" *"+B+"$"),"")):He=="Safari"&&/\bChrome\b/.exec(We&&We[1])&&(Fe.unshift("desktop mode"),He="Chrome Mobile",me=null,/\bOS X\b/.test(P)?(re="Apple",P="iOS 4.3+"):P=null),me&&me.indexOf(B=/[\d.]+$/.exec(P))==0&&S.indexOf("/"+B+"-")>-1&&(P=a(P.replace(B,""))),We&&!/\b(?:Avant|Nook)\b/.test(He)&&(/Browser|Lunascape|Maxthon/.test(He)||He!="Safari"&&/^iOS/.test(P)&&/\bSafari\b/.test(We[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(He)&&We[1])&&(B=We[We.length-1])&&Fe.push(B),Fe.length&&(Fe=["("+Fe.join("; ")+")"]),re&&it&&it.indexOf(re)<0&&Fe.push("on "+re),it&&Fe.push((/^on /.test(Fe[Fe.length-1])?"":"on ")+it),P&&(B=/ ([\d.+]+)$/.exec(P),M=B&&P.charAt(P.length-B[0].length-1)=="/",P={architecture:32,family:B&&!M?P.replace(B[0],""):P,version:B?B[1]:null,toString:function(){var ee=this.version;return this.family+(ee&&!M?" "+ee:"")+(this.architecture==64?" 64-bit":"")}}),(B=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Me))&&!/\bi686\b/i.test(Me)?(P&&(P.architecture=64,P.family=P.family.replace(RegExp(" *"+B),"")),He&&(/\bWOW64\b/i.test(S)||Ee&&/\w(?:86|32)$/.test(z.cpuClass||z.platform)&&!/\bWin64; x64\b/i.test(S))&&Fe.unshift("32-bit")):P&&/^OS X/.test(P.family)&&He=="Chrome"&&parseFloat(me)>=39&&(P.architecture=64),S||(S=null);var j={};return j.description=S,j.layout=We&&We[0],j.manufacturer=re,j.name=He,j.prerelease=Ge,j.product=it,j.ua=S,j.version=He&&me,j.os=P||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=i,j.toString=R,j.version&&Fe.unshift(me),j.name&&Fe.unshift(He),P&&He&&(P!=String(P).split(" ")[0]||P!=He.split(" ")[0]&&!it)&&Fe.push(it?"("+P+")":"on "+P),Fe.length&&(j.description=Fe.join(" ")),j}var t={function:!0,object:!0},d=t[typeof window]&&window||this,v=t[typeof T]&&T,y=t[typeof D]&&D&&!D.nodeType&&D,b=v&&y&&typeof A=="object"&&A;!b||b.global!==b&&b.window!==b&&b.self!==b||(d=b);var g=Math.pow(2,53)-1,m=/\bOpera/,_=Object.prototype,x=_.hasOwnProperty,h=_.toString,E=i();typeof W=="function"&&typeof W.amd=="object"&&W.amd?(d.platform=E,W(function(){return E})):v&&y?s(E,function(S,w){v[w]=S}):d.platform=E}).call(this)}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(C,D,T){(function(A){"use strict";function O(f,p,c,s){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var n,o,r=arguments.length;switch(r){case 0:case 1:return A.nextTick(f);case 2:return A.nextTick(function(){f.call(null,p)});case 3:return A.nextTick(function(){f.call(null,p,c)});case 4:return A.nextTick(function(){f.call(null,p,c,s)});default:for(n=new Array(r-1),o=0;o1)for(var g=1;g1&&(Te=de[0]+"@",Z=de[1]),Z=Z.replace(B,"."),Te+p(Z.split("."),le).join(".")}function s(Z){for(var le,de,Te=[],we=0,Ie=Z.length;we=55296&&le<=56319&&we65535&&(le-=65536,de+=K(le>>>10&1023|55296),le=56320|1023&le),de+=K(le)}).join("")}function o(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:x}function r(Z,le){return Z+22+75*(Z<26)-((le!=0)<<5)}function l(Z,le,de){var Te=0;for(Z=de?J(Z/w):Z>>1,Z+=J(Z/le);Z>G*E>>1;Te+=x)Z=J(Z/G);return J(Te+(G+1)*Z/(Z+S))}function a(Z){var le,de,Te,we,Ie,_e,ye,Ke,Me,Fe,Ge=[],Ee=Z.length,me=0,We=N,He=R;for(de=Z.lastIndexOf(F),de<0&&(de=0),Te=0;Te=128&&f("not-basic"),Ge.push(Z.charCodeAt(Te));for(we=de>0?de+1:0;we=Ee&&f("invalid-input"),Ke=o(Z.charCodeAt(we++)),(Ke>=x||Ke>J((_-me)/_e))&&f("overflow"),me+=Ke*_e,Me=ye<=He?h:ye>=He+E?E:ye-He,!(KeJ(_/Fe)&&f("overflow"),_e*=Fe;le=Ge.length+1,He=l(me-Ie,le,Ie==0),J(me/le)>_-We&&f("overflow"),We+=J(me/le),me%=le,Ge.splice(me++,0,We)}return n(Ge)}function i(Z){var le,de,Te,we,Ie,_e,ye,Ke,Me,Fe,Ge,Ee,me,We,He,it=[];for(Z=s(Z),Ee=Z.length,le=N,de=0,Ie=R,_e=0;_e=le&&GeJ((_-de)/me)&&f("overflow"),de+=(ye-le)*me,le=ye,_e=0;_e_&&f("overflow"),Ge==le){for(Ke=de,Me=x;Fe=Me<=Ie?h:Me>=Ie+E?E:Me-Ie,!(Ke= 0x80 (not a basic code point)","invalid-input":"Invalid input"},G=x-h,J=Math.floor,K=String.fromCharCode;if(g={version:"1.4.1",ucs2:{decode:s,encode:n},decode:a,encode:i,toASCII:d,toUnicode:t},typeof W=="function"&&typeof W.amd=="object"&&W.amd)W("punycode",function(){return g});else if(v&&y)if(D.exports==v)y.exports=g;else for(m in g)g.hasOwnProperty(m)&&(v[m]=g[m]);else O.punycode=g}(this)}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(C,D,T){"use strict";function A(f,p){return Object.prototype.hasOwnProperty.call(f,p)}D.exports=function(f,p,c,s){p=p||"&",c=c||"=";var n={};if(typeof f!="string"||f.length===0)return n;var o=/\+/g;f=f.split(p);var r=1e3;s&&typeof s.maxKeys=="number"&&(r=s.maxKeys);var l=f.length;r>0&&l>r&&(l=r);for(var a=0;a=0?(i=y.substr(0,b),t=y.substr(b+1)):(i=y,t=""),d=decodeURIComponent(i),v=decodeURIComponent(t),A(n,d)?O(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n};var O=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"}},{}],176:[function(C,D,T){"use strict";function A(c,s){if(c.map)return c.map(s);for(var n=[],o=0;o0?(typeof me=="string"||re.objectMode||(0,M.default)(me)===de.prototype||(me=f(me)),He?re.endEmitted?Ee.emit("error",new Error("stream.unshift() after end event")):r(Ee,re,me,!0):re.ended?Ee.emit("error",new Error("stream.push() after EOF")):(re.reading=!1,re.decoder&&!We?(me=re.decoder.write(me),re.objectMode||me.length!==0?r(Ee,re,me,!1):b(Ee,re)):r(Ee,re,me,!1))):He||(re.reading=!1)}return a(re)}function r(Ee,me,We,He){me.flowing&&me.length===0&&!me.sync?(Ee.emit("data",We),Ee.read(0)):(me.length+=me.objectMode?1:We.length,He?me.buffer.unshift(We):me.buffer.push(We),me.needReadable&&v(Ee)),b(Ee,me)}function l(Ee,me){var We;return p(me)||typeof me=="string"||me===void 0||Ee.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We}function a(Ee){return!Ee.ended&&(Ee.needReadable||Ee.length=Ge?Ee=Ge:(Ee--,Ee|=Ee>>>1,Ee|=Ee>>>2,Ee|=Ee>>>4,Ee|=Ee>>>8,Ee|=Ee>>>16,Ee++),Ee}function t(Ee,me){return Ee<=0||me.length===0&&me.ended?0:me.objectMode?1:Ee!==Ee?me.flowing&&me.length?me.buffer.head.data.length:me.length:(Ee>me.highWaterMark&&(me.highWaterMark=i(Ee)),Ee<=me.length?Ee:me.ended?me.length:(me.needReadable=!0,0))}function d(Ee,me){if(!me.ended){if(me.decoder){var We=me.decoder.end();We&&We.length&&(me.buffer.push(We),me.length+=me.objectMode?1:We.length)}me.ended=!0,v(Ee)}}function v(Ee){var me=Ee._readableState;me.needReadable=!1,me.emittedReadable||(_e("emitReadable",me.flowing),me.emittedReadable=!0,me.sync?G.nextTick(y,Ee):y(Ee))}function y(Ee){_e("emit readable"),Ee.emit("readable"),E(Ee)}function b(Ee,me){me.readingMore||(me.readingMore=!0,G.nextTick(g,Ee,me))}function g(Ee,me){for(var We=me.length;!me.reading&&!me.flowing&&!me.ended&&me.length=me.length?(We=me.decoder?me.buffer.join(""):me.buffer.length===1?me.buffer.head.data:me.buffer.concat(me.length),me.buffer.clear()):We=w(Ee,me.buffer,me.decoder),We}function w(Ee,me,We){var He;return Eere.length?re.length:Ee;if(P===re.length?it+=re:it+=re.slice(0,Ee),(Ee-=P)===0){P===re.length?(++He,We.next?me.head=We.next:me.head=me.tail=null):(me.head=We,We.data=re.slice(P));break}++He}return me.length-=He,it}function N(Ee,me){var We=de.allocUnsafe(Ee),He=me.head,it=1;for(He.data.copy(We),Ee-=He.data.length;He=He.next;){var re=He.data,P=Ee>re.length?re.length:Ee;if(re.copy(We,We.length-Ee,0,P),(Ee-=P)===0){P===re.length?(++it,He.next?me.head=He.next:me.head=me.tail=null):(me.head=He,He.data=re.slice(P));break}++it}return me.length-=it,We}function F(Ee){var me=Ee._readableState;if(me.length>0)throw new Error('"endReadable()" called on non-empty stream');me.endEmitted||(me.ended=!0,G.nextTick(z,me,Ee))}function z(Ee,me){Ee.endEmitted||Ee.length!==0||(Ee.endEmitted=!0,me.readable=!1,me.emit("end"))}function q(Ee,me){for(var We=0,He=Ee.length;We=me.highWaterMark||me.ended))return _e("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?F(this):v(this),null;if((Ee=t(Ee,me))===0&&me.ended)return me.length===0&&F(this),null;var He=me.needReadable;_e("need readable",He),(me.length===0||me.length-Ee0?S(Ee,me):null,it===null?(me.needReadable=!0,Ee=0):me.length-=Ee,me.length===0&&(me.ended||(me.needReadable=!0),We!==Ee&&me.ended&&F(this)),it!==null&&this.emit("data",it),it},n.prototype._read=function(Ee){this.emit("error",new Error("_read() is not implemented"))},n.prototype.pipe=function(Ee,me){function We(lt,qe){_e("onunpipe"),lt===Q&&qe&&qe.hasUnpiped===!1&&(qe.hasUnpiped=!0,it())}function He(){_e("onend"),Ee.end()}function it(){_e("cleanup"),Ee.removeListener("close",j),Ee.removeListener("finish",ee),Ee.removeListener("drain",Ne),Ee.removeListener("error",P),Ee.removeListener("unpipe",We),Q.removeListener("end",He),Q.removeListener("end",$),Q.removeListener("data",re),Be=!0,!xe.awaitDrain||Ee._writableState&&!Ee._writableState.needDrain||Ne()}function re(lt){_e("ondata"),tt=!1,Ee.write(lt)!==!1||tt||((xe.pipesCount===1&&xe.pipes===Ee||xe.pipesCount>1&&q(xe.pipes,Ee)!==-1)&&!Be&&(_e("false write response, pause",Q._readableState.awaitDrain),Q._readableState.awaitDrain++,tt=!0),Q.pause())}function P(lt){_e("onerror",lt),$(),Ee.removeListener("error",P),Z(Ee,"error")===0&&Ee.emit("error",lt)}function j(){Ee.removeListener("finish",ee),$()}function ee(){_e("onfinish"),Ee.removeListener("close",j),$()}function $(){_e("unpipe"),Q.unpipe(Ee)}var Q=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=Ee;break;case 1:xe.pipes=[xe.pipes,Ee];break;default:xe.pipes.push(Ee)}xe.pipesCount+=1,_e("pipe count=%d opts=%j",xe.pipesCount,me);var De=(!me||me.end!==!1)&&Ee!==A.stdout&&Ee!==A.stderr,dt=De?He:$;xe.endEmitted?G.nextTick(dt):Q.once("end",dt),Ee.on("unpipe",We);var Ne=m(Q);Ee.on("drain",Ne);var Be=!1,tt=!1;return Q.on("data",re),c(Ee,"error",P),Ee.once("close",j),Ee.once("finish",ee),Ee.emit("pipe",Q),xe.flowing||(_e("pipe resume"),Q.resume()),Ee},n.prototype.unpipe=function(Ee){var me=this._readableState,We={hasUnpiped:!1};if(me.pipesCount===0)return this;if(me.pipesCount===1)return Ee&&Ee!==me.pipes?this:(Ee||(Ee=me.pipes),me.pipes=null,me.pipesCount=0,me.flowing=!1,Ee&&Ee.emit("unpipe",this,We),this);if(!Ee){var He=me.pipes,it=me.pipesCount;me.pipes=null,me.pipesCount=0,me.flowing=!1;for(var re=0;re-1?J.default:K.nextTick;r.WritableState=o;var de=C("core-util-is");de.inherits=C("inherits");var Te={deprecate:C("util-deprecate")},we=C("./internal/streams/stream"),Ie=C("safe-buffer").Buffer,_e=O.Uint8Array||function(){},ye=C("./internal/streams/destroy");de.inherits(r,we),o.prototype.getBuffer=function(){for(var Me=this.bufferedRequest,Fe=[];Me;)Fe.push(Me),Me=Me.next;return Fe},function(){try{Object.defineProperty(o.prototype,"buffer",{get:Te.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Me){}}();var Ke;typeof M.default=="function"&&q.default&&typeof Function.prototype[q.default]=="function"?(Ke=Function.prototype[q.default],(0,F.default)(r,q.default,{value:function(Me){return!!Ke.call(this,Me)||this===r&&Me&&Me._writableState instanceof o}})):Ke=function(Me){return Me instanceof this},r.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},r.prototype.write=function(Me,Fe,Ge){var Ee=this._writableState,me=!1,We=!Ee.objectMode&&s(Me);return We&&!Ie.isBuffer(Me)&&(Me=c(Me)),typeof Fe=="function"&&(Ge=Fe,Fe=null),We?Fe="buffer":Fe||(Fe=Ee.defaultEncoding),typeof Ge!="function"&&(Ge=n),Ee.ended?l(this,Ge):(We||a(this,Ee,Me,Ge))&&(Ee.pendingcb++,me=t(this,Ee,We,Me,Fe,Ge)),me},r.prototype.cork=function(){this._writableState.corked++},r.prototype.uncork=function(){var Me=this._writableState;Me.corked&&(Me.corked--,Me.writing||Me.corked||Me.finished||Me.bufferProcessing||!Me.bufferedRequest||_(this,Me))},r.prototype.setDefaultEncoding=function(Me){if(typeof Me=="string"&&(Me=Me.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Me+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Me);return this._writableState.defaultEncoding=Me,this},Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),r.prototype._write=function(Me,Fe,Ge){Ge(new Error("_write() is not implemented"))},r.prototype._writev=null,r.prototype.end=function(Me,Fe,Ge){var Ee=this._writableState;typeof Me=="function"?(Ge=Me,Me=null,Fe=null):typeof Fe=="function"&&(Ge=Fe,Fe=null),Me!=null&&this.write(Me,Fe),Ee.corked&&(Ee.corked=1,this.uncork()),Ee.ending||Ee.finished||w(this,Ee,Ge)},Object.defineProperty(r.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Me){this._writableState&&(this._writableState.destroyed=Me)}}),r.prototype.destroy=ye.destroy,r.prototype._undestroy=ye.undestroy,r.prototype._destroy=function(Me,Fe){this.end(),Fe(Me)}}).call(this,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/set-immediate":25,"babel-runtime/core-js/symbol":27,"babel-runtime/core-js/symbol/has-instance":28,"core-util-is":153,inherits:162,"process-nextick-args":172,"safe-buffer":193,"util-deprecate":205}],184:[function(C,D,T){"use strict";function A(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function O(c,s,n){c.copy(s,n)}var f=C("safe-buffer").Buffer,p=C("util");D.exports=function(){function c(){A(this,c),this.head=null,this.tail=null,this.length=0}return c.prototype.push=function(s){var n={data:s,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},c.prototype.unshift=function(s){var n={data:s,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},c.prototype.shift=function(){if(this.length!==0){var s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}},c.prototype.clear=function(){this.head=this.tail=null,this.length=0},c.prototype.join=function(s){if(this.length===0)return"";for(var n=this.head,o=""+n.data;n=n.next;)o+=s+n.data;return o},c.prototype.concat=function(s){if(this.length===0)return f.alloc(0);if(this.length===1)return this.head.data;for(var n=f.allocUnsafe(s>>>0),o=this.head,r=0;o;)O(o.data,n,r),r+=o.data.length,o=o.next;return n},c}(),p&&p.inspect&&p.inspect.custom&&(D.exports.prototype[p.inspect.custom]=function(){var c=p.inspect({length:this.length});return this.constructor.name+" "+c})},{"safe-buffer":193,util:36}],185:[function(C,D,T){"use strict";function A(c,s){var n=this,o=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return o||r?(s?s(c):!c||this._writableState&&this._writableState.errorEmitted||p.nextTick(f,this,c),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(l){!s&&l?(p.nextTick(f,n,l),n._writableState&&(n._writableState.errorEmitted=!0)):s&&s(l)}),this)}function O(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function f(c,s){c.emit("error",s)}var p=C("process-nextick-args");D.exports={destroy:A,undestroy:O}},{"process-nextick-args":172}],186:[function(C,D,T){"use strict";D.exports=C("events").EventEmitter},{events:158}],187:[function(C,D,T){D.exports=C("./readable").PassThrough},{"./readable":188}],188:[function(C,D,T){T=D.exports=C("./lib/_stream_readable.js"),T.Stream=T,T.Readable=T,T.Writable=C("./lib/_stream_writable.js"),T.Duplex=C("./lib/_stream_duplex.js"),T.Transform=C("./lib/_stream_transform.js"),T.PassThrough=C("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],189:[function(C,D,T){D.exports=C("./readable").Transform},{"./readable":188}],190:[function(C,D,T){D.exports=C("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(C,D,T){var A=function(){return this}()||Function("return this")(),O=A.regeneratorRuntime&&Object.getOwnPropertyNames(A).indexOf("regeneratorRuntime")>=0,f=O&&A.regeneratorRuntime;if(A.regeneratorRuntime=void 0,D.exports=C("./runtime"),O)A.regeneratorRuntime=f;else try{delete A.regeneratorRuntime}catch(p){A.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(C,D,T){!function(A){"use strict";function O(J,K,Z,le){var de=K&&K.prototype instanceof p?K:p,Te=Object.create(de.prototype),we=new t(le||[]);return Te._invoke=r(J,Z,we),Te}function f(J,K,Z){try{return{type:"normal",arg:J.call(K,Z)}}catch(le){return{type:"throw",arg:le}}}function p(){}function c(){}function s(){}function n(J){["next","throw","return"].forEach(function(K){J[K]=function(Z){return this._invoke(K,Z)}})}function o(J){function K(de,Te,we,Ie){var _e=f(J[de],J,Te);if(_e.type!=="throw"){var ye=_e.arg,Ke=ye.value;return Ke&&typeof Ke=="object"&&g.call(Ke,"__await")?Promise.resolve(Ke.__await).then(function(Me){K("next",Me,we,Ie)},function(Me){K("throw",Me,we,Ie)}):Promise.resolve(Ke).then(function(Me){ye.value=Me,we(ye)},Ie)}Ie(_e.arg)}function Z(de,Te){function we(){return new Promise(function(Ie,_e){K(de,Te,Ie,_e)})}return le=le?le.then(we,we):we()}var le;this._invoke=Z}function r(J,K,Z){var le=w;return function(de,Te){if(le===N)throw new Error("Generator is already running");if(le===F){if(de==="throw")throw Te;return v()}for(Z.method=de,Z.arg=Te;;){var we=Z.delegate;if(we){var Ie=l(we,Z);if(Ie){if(Ie===z)continue;return Ie}}if(Z.method==="next")Z.sent=Z._sent=Z.arg;else if(Z.method==="throw"){if(le===w)throw le=F,Z.arg;Z.dispatchException(Z.arg)}else Z.method==="return"&&Z.abrupt("return",Z.arg);le=N;var _e=f(J,K,Z);if(_e.type==="normal"){if(le=Z.done?F:R,_e.arg===z)continue;return{value:_e.arg,done:Z.done}}_e.type==="throw"&&(le=F,Z.method="throw",Z.arg=_e.arg)}}}function l(J,K){var Z=J.iterator[K.method];if(Z===y){if(K.delegate=null,K.method==="throw"){if(J.iterator.return&&(K.method="return",K.arg=y,l(J,K),K.method==="throw"))return z;K.method="throw",K.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var le=f(Z,J.iterator,K.arg);if(le.type==="throw")return K.method="throw",K.arg=le.arg,K.delegate=null,z;var de=le.arg;return de?de.done?(K[J.resultName]=de.value,K.next=J.nextLoc,K.method!=="return"&&(K.method="next",K.arg=y),K.delegate=null,z):de:(K.method="throw",K.arg=new TypeError("iterator result is not an object"),K.delegate=null,z)}function a(J){var K={tryLoc:J[0]};1 in J&&(K.catchLoc=J[1]),2 in J&&(K.finallyLoc=J[2],K.afterLoc=J[3]),this.tryEntries.push(K)}function i(J){var K=J.completion||{};K.type="normal",delete K.arg,J.completion=K}function t(J){this.tryEntries=[{tryLoc:"root"}],J.forEach(a,this),this.reset(!0)}function d(J){if(J){var K=J[_];if(K)return K.call(J);if(typeof J.next=="function")return J;if(!isNaN(J.length)){var Z=-1,le=function de(){for(;++Z=0;--le){var de=this.tryEntries[le],Te=de.completion;if(de.tryLoc==="root")return K("end");if(de.tryLoc<=this.prev){var we=g.call(de,"catchLoc"),Ie=g.call(de,"finallyLoc");if(we&&Ie){if(this.prev=0;--Z){var le=this.tryEntries[Z];if(le.tryLoc<=this.prev&&g.call(le,"finallyLoc")&&this.prev=0;--K){var Z=this.tryEntries[K];if(Z.finallyLoc===J)return this.complete(Z.completion,Z.afterLoc),i(Z),z}},catch:function(J){for(var K=this.tryEntries.length-1;K>=0;--K){var Z=this.tryEntries[K];if(Z.tryLoc===J){var le=Z.completion;if(le.type==="throw"){var de=le.arg;i(Z)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(J,K,Z){return this.delegate={iterator:d(J),resultName:K,nextLoc:Z},this.method==="next"&&(this.arg=y),z}}}(function(){return this}()||Function("return this")())},{}],193:[function(C,D,T){function A(c,s){for(var n in c)s[n]=c[n]}function O(c,s,n){return p(c,s,n)}var f=C("buffer"),p=f.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?D.exports=f:(A(f,T),T.Buffer=O),A(p,O),O.from=function(c,s,n){if(typeof c=="number")throw new TypeError("Argument must not be a number");return p(c,s,n)},O.alloc=function(c,s,n){if(typeof c!="number")throw new TypeError("Argument must be a number");var o=p(c);return s!==void 0?typeof n=="string"?o.fill(s,n):o.fill(s):o.fill(0),o},O.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return p(c)},O.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(c)}},{buffer:38}],194:[function(C,D,T){(function(A){"use strict";function O(v){return v&&v.__esModule?v:{default:v}}var f=C("babel-runtime/core-js/string/from-code-point"),p=O(f),c=C("babel-runtime/core-js/json/stringify"),s=O(c),n=C("babel-runtime/helpers/typeof"),o=O(n),r=C("babel-runtime/core-js/object/define-property"),l=O(r),a=C("babel-runtime/core-js/object/keys"),i=O(a),t=C("babel-runtime/core-js/object/create"),d=O(t);!function(v){function y($,Q){if(!(this instanceof y))return new y($,Q);var xe=this;g(xe),xe.q=xe.c="",xe.bufferCheckPosition=v.MAX_BUFFER_LENGTH,xe.opt=Q||{},xe.opt.lowercase=xe.opt.lowercase||xe.opt.lowercasetags,xe.looseCase=xe.opt.lowercase?"toLowerCase":"toUpperCase",xe.tags=[],xe.closed=xe.closedRoot=xe.sawRoot=!1,xe.tag=xe.error=null,xe.strict=!!$,xe.noscript=!(!$&&!xe.opt.noscript),xe.state=j.BEGIN,xe.strictEntities=xe.opt.strictEntities,xe.ENTITIES=xe.strictEntities?(0,d.default)(v.XML_ENTITIES):(0,d.default)(v.ENTITIES),xe.attribList=[],xe.opt.xmlns&&(xe.ns=(0,d.default)(We)),xe.trackPosition=xe.opt.position!==!1,xe.trackPosition&&(xe.position=xe.line=xe.column=0),N(xe,"onready")}function b($){for(var Q=Math.max(v.MAX_BUFFER_LENGTH,10),xe=0,De=0,dt=ye.length;DeQ)switch(ye[De]){case"textNode":z($);break;case"cdata":F($,"oncdata",$.cdata),$.cdata="";break;case"script":F($,"onscript",$.script),$.script="";break;default:B($,"Max buffer length exceeded: "+ye[De])}xe=Math.max(xe,Ne)}var Be=v.MAX_BUFFER_LENGTH-xe;$.bufferCheckPosition=Be+$.position}function g($){for(var Q=0,xe=ye.length;Q"||h($)}function w($,Q){return $.test(Q)}function R($,Q){return!w($,Q)}function N($,Q,xe){$[Q]&&$[Q](xe)}function F($,Q,xe){$.textNode&&z($),N($,Q,xe)}function z($){$.textNode=q($.opt,$.textNode),$.textNode&&N($,"ontext",$.textNode),$.textNode=""}function q($,Q){return $.trim&&(Q=Q.trim()),$.normalize&&(Q=Q.replace(/\s+/g," ")),Q}function B($,Q){return z($),$.trackPosition&&(Q+=` Line: `+$.line+` Column: `+$.column+` Char: `+$.c),Q=new Error(Q),$.error=Q,N($,"onerror",Q),$}function M($){return $.sawRoot&&!$.closedRoot&&G($,"Unclosed root tag"),$.state!==j.BEGIN&&$.state!==j.BEGIN_WHITESPACE&&$.state!==j.TEXT&&B($,"Unexpected end"),z($),$.c="",$.closed=!0,N($,"onend"),y.call($,$.strict,$.opt),$}function G($,Q){if(($===void 0?"undefined":(0,o.default)($))!=="object"||!($ instanceof y))throw new Error("bad call to strictFail");$.strict&&B($,Q)}function J($){$.strict||($.tagName=$.tagName[$.looseCase]());var Q=$.tags[$.tags.length-1]||$,xe=$.tag={name:$.tagName,attributes:{}};$.opt.xmlns&&(xe.ns=Q.ns),$.attribList.length=0,F($,"onopentagstart",xe)}function K($,Q){var xe=$.indexOf(":"),De=xe<0?["",$]:$.split(":"),dt=De[0],Ne=De[1];return Q&&$==="xmlns"&&(dt="xmlns",Ne=""),{prefix:dt,local:Ne}}function Z($){if($.strict||($.attribName=$.attribName[$.looseCase]()),$.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName))return void($.attribName=$.attribValue="");if($.opt.xmlns){var Q=K($.attribName,!0),xe=Q.prefix,De=Q.local;if(xe==="xmlns")if(De==="xml"&&$.attribValue!==Ee)G($,"xml: prefix must be bound to "+Ee+` Actual: `+$.attribValue);else if(De==="xmlns"&&$.attribValue!==me)G($,"xmlns: prefix must be bound to "+me+` Actual: `+$.attribValue);else{var dt=$.tag,Ne=$.tags[$.tags.length-1]||$;dt.ns===Ne.ns&&(dt.ns=(0,d.default)(Ne.ns)),dt.ns[De]=$.attribValue}$.attribList.push([$.attribName,$.attribValue])}else $.tag.attributes[$.attribName]=$.attribValue,F($,"onattribute",{name:$.attribName,value:$.attribValue});$.attribName=$.attribValue=""}function le($,Q){if($.opt.xmlns){var xe=$.tag,De=K($.tagName);xe.prefix=De.prefix,xe.local=De.local,xe.uri=xe.ns[De.prefix]||"",xe.prefix&&!xe.uri&&(G($,"Unbound namespace prefix: "+(0,s.default)($.tagName)),xe.uri=De.prefix);var dt=$.tags[$.tags.length-1]||$;xe.ns&&dt.ns!==xe.ns&&(0,i.default)(xe.ns).forEach(function(Ce){F($,"onopennamespace",{prefix:Ce,uri:xe.ns[Ce]})});for(var Ne=0,Be=$.attribList.length;Ne",$.tagName="",void($.state=j.SCRIPT);F($,"onscript",$.script),$.script=""}var Q=$.tags.length,xe=$.tagName;$.strict||(xe=xe[$.looseCase]());for(var De=xe;Q--&&!($.tags[Q].name===De);)G($,"Unexpected close tag");if(Q<0)return G($,"Unmatched closing tag: "+$.tagName),$.textNode+="",void($.state=j.TEXT);$.tagName=xe;for(var dt=$.tags.length;dt-- >Q;){var Ne=$.tag=$.tags.pop();$.tagName=$.tag.name,F($,"onclosetag",$.tagName);var Be={};for(var tt in Ne.ns)Be[tt]=Ne.ns[tt];var lt=$.tags[$.tags.length-1]||$;$.opt.xmlns&&Ne.ns!==lt.ns&&(0,i.default)(Ne.ns).forEach(function(qe){var Ye=Ne.ns[qe];F($,"onclosenamespace",{prefix:qe,uri:Ye})})}Q===0&&($.closedRoot=!0),$.tagName=$.attribValue=$.attribName="",$.attribList.length=0,$.state=j.TEXT}function Te($){var Q,xe=$.entity,De=xe.toLowerCase(),dt="";return $.ENTITIES[xe]?$.ENTITIES[xe]:$.ENTITIES[De]?$.ENTITIES[De]:(xe=De,xe.charAt(0)==="#"&&(xe.charAt(1)==="x"?(xe=xe.slice(2),Q=parseInt(xe,16),dt=Q.toString(16)):(xe=xe.slice(1),Q=parseInt(xe,10),dt=Q.toString(10))),xe=xe.replace(/^0+/,""),isNaN(Q)||dt.toLowerCase()!==xe?(G($,"Invalid character entity"),"&"+$.entity+";"):(0,p.default)(Q))}function we($,Q){Q==="<"?($.state=j.OPEN_WAKA,$.startTagPosition=$.position):h(Q)||(G($,"Non-whitespace before first tag."),$.textNode=Q,$.state=j.TEXT)}function Ie($,Q){var xe="";return Q<$.length&&(xe=$.charAt(Q)),xe}function _e($){var Q=this;if(this.error)throw this.error;if(Q.closed)return B(Q,"Cannot write after close. Assign an onready handler.");if($===null)return M(Q);($===void 0?"undefined":(0,o.default)($))==="object"&&($=$.toString());for(var xe=0,De="";!(De=Ie($,xe++),Q.c=De,!De);)switch(Q.trackPosition&&(Q.position++,De===` `?(Q.line++,Q.column=0):Q.column++),Q.state){case j.BEGIN:if(Q.state=j.BEGIN_WHITESPACE,De==="\uFEFF")continue;we(Q,De);continue;case j.BEGIN_WHITESPACE:we(Q,De);continue;case j.TEXT:if(Q.sawRoot&&!Q.closedRoot){for(var dt=xe-1;De&&De!=="<"&&De!=="&";)(De=Ie($,xe++))&&Q.trackPosition&&(Q.position++,De===` `?(Q.line++,Q.column=0):Q.column++);Q.textNode+=$.substring(dt,xe-1)}De!=="<"||Q.sawRoot&&Q.closedRoot&&!Q.strict?(h(De)||Q.sawRoot&&!Q.closedRoot||G(Q,"Text data outside of root node."),De==="&"?Q.state=j.TEXT_ENTITY:Q.textNode+=De):(Q.state=j.OPEN_WAKA,Q.startTagPosition=Q.position);continue;case j.SCRIPT:De==="<"?Q.state=j.SCRIPT_ENDING:Q.script+=De;continue;case j.SCRIPT_ENDING:De==="/"?Q.state=j.CLOSE_TAG:(Q.script+="<"+De,Q.state=j.SCRIPT);continue;case j.OPEN_WAKA:if(De==="!")Q.state=j.SGML_DECL,Q.sgmlDecl="";else if(!h(De))if(w(He,De))Q.state=j.OPEN_TAG,Q.tagName=De;else if(De==="/")Q.state=j.CLOSE_TAG,Q.tagName="";else if(De==="?")Q.state=j.PROC_INST,Q.procInstName=Q.procInstBody="";else{if(G(Q,"Unencoded <"),Q.startTagPosition+1"?(F(Q,"onsgmldeclaration",Q.sgmlDecl),Q.sgmlDecl="",Q.state=j.TEXT):(E(De)&&(Q.state=j.SGML_DECL_QUOTED),Q.sgmlDecl+=De);continue;case j.SGML_DECL_QUOTED:De===Q.q&&(Q.state=j.SGML_DECL,Q.q=""),Q.sgmlDecl+=De;continue;case j.DOCTYPE:De===">"?(Q.state=j.TEXT,F(Q,"ondoctype",Q.doctype),Q.doctype=!0):(Q.doctype+=De,De==="["?Q.state=j.DOCTYPE_DTD:E(De)&&(Q.state=j.DOCTYPE_QUOTED,Q.q=De));continue;case j.DOCTYPE_QUOTED:Q.doctype+=De,De===Q.q&&(Q.q="",Q.state=j.DOCTYPE);continue;case j.DOCTYPE_DTD:Q.doctype+=De,De==="]"?Q.state=j.DOCTYPE:E(De)&&(Q.state=j.DOCTYPE_DTD_QUOTED,Q.q=De);continue;case j.DOCTYPE_DTD_QUOTED:Q.doctype+=De,De===Q.q&&(Q.state=j.DOCTYPE_DTD,Q.q="");continue;case j.COMMENT:De==="-"?Q.state=j.COMMENT_ENDING:Q.comment+=De;continue;case j.COMMENT_ENDING:De==="-"?(Q.state=j.COMMENT_ENDED,Q.comment=q(Q.opt,Q.comment),Q.comment&&F(Q,"oncomment",Q.comment),Q.comment=""):(Q.comment+="-"+De,Q.state=j.COMMENT);continue;case j.COMMENT_ENDED:De!==">"?(G(Q,"Malformed comment"),Q.comment+="--"+De,Q.state=j.COMMENT):Q.state=j.TEXT;continue;case j.CDATA:De==="]"?Q.state=j.CDATA_ENDING:Q.cdata+=De;continue;case j.CDATA_ENDING:De==="]"?Q.state=j.CDATA_ENDING_2:(Q.cdata+="]"+De,Q.state=j.CDATA);continue;case j.CDATA_ENDING_2:De===">"?(Q.cdata&&F(Q,"oncdata",Q.cdata),F(Q,"onclosecdata"),Q.cdata="",Q.state=j.TEXT):De==="]"?Q.cdata+="]":(Q.cdata+="]]"+De,Q.state=j.CDATA);continue;case j.PROC_INST:De==="?"?Q.state=j.PROC_INST_ENDING:h(De)?Q.state=j.PROC_INST_BODY:Q.procInstName+=De;continue;case j.PROC_INST_BODY:if(!Q.procInstBody&&h(De))continue;De==="?"?Q.state=j.PROC_INST_ENDING:Q.procInstBody+=De;continue;case j.PROC_INST_ENDING:De===">"?(F(Q,"onprocessinginstruction",{name:Q.procInstName,body:Q.procInstBody}),Q.procInstName=Q.procInstBody="",Q.state=j.TEXT):(Q.procInstBody+="?"+De,Q.state=j.PROC_INST_BODY);continue;case j.OPEN_TAG:w(it,De)?Q.tagName+=De:(J(Q),De===">"?le(Q):De==="/"?Q.state=j.OPEN_TAG_SLASH:(h(De)||G(Q,"Invalid character in tag name"),Q.state=j.ATTRIB));continue;case j.OPEN_TAG_SLASH:De===">"?(le(Q,!0),de(Q)):(G(Q,"Forward-slash in opening tag not followed by >"),Q.state=j.ATTRIB);continue;case j.ATTRIB:if(h(De))continue;De===">"?le(Q):De==="/"?Q.state=j.OPEN_TAG_SLASH:w(He,De)?(Q.attribName=De,Q.attribValue="",Q.state=j.ATTRIB_NAME):G(Q,"Invalid attribute name");continue;case j.ATTRIB_NAME:De==="="?Q.state=j.ATTRIB_VALUE:De===">"?(G(Q,"Attribute without value"),Q.attribValue=Q.attribName,Z(Q),le(Q)):h(De)?Q.state=j.ATTRIB_NAME_SAW_WHITE:w(it,De)?Q.attribName+=De:G(Q,"Invalid attribute name");continue;case j.ATTRIB_NAME_SAW_WHITE:if(De==="=")Q.state=j.ATTRIB_VALUE;else{if(h(De))continue;G(Q,"Attribute without value"),Q.tag.attributes[Q.attribName]="",Q.attribValue="",F(Q,"onattribute",{name:Q.attribName,value:""}),Q.attribName="",De===">"?le(Q):w(He,De)?(Q.attribName=De,Q.state=j.ATTRIB_NAME):(G(Q,"Invalid attribute name"),Q.state=j.ATTRIB)}continue;case j.ATTRIB_VALUE:if(h(De))continue;E(De)?(Q.q=De,Q.state=j.ATTRIB_VALUE_QUOTED):(G(Q,"Unquoted attribute value"),Q.state=j.ATTRIB_VALUE_UNQUOTED,Q.attribValue=De);continue;case j.ATTRIB_VALUE_QUOTED:if(De!==Q.q){De==="&"?Q.state=j.ATTRIB_VALUE_ENTITY_Q:Q.attribValue+=De;continue}Z(Q),Q.q="",Q.state=j.ATTRIB_VALUE_CLOSED;continue;case j.ATTRIB_VALUE_CLOSED:h(De)?Q.state=j.ATTRIB:De===">"?le(Q):De==="/"?Q.state=j.OPEN_TAG_SLASH:w(He,De)?(G(Q,"No whitespace between attributes"),Q.attribName=De,Q.attribValue="",Q.state=j.ATTRIB_NAME):G(Q,"Invalid attribute name");continue;case j.ATTRIB_VALUE_UNQUOTED:if(!S(De)){De==="&"?Q.state=j.ATTRIB_VALUE_ENTITY_U:Q.attribValue+=De;continue}Z(Q),De===">"?le(Q):Q.state=j.ATTRIB;continue;case j.CLOSE_TAG:if(Q.tagName)De===">"?de(Q):w(it,De)?Q.tagName+=De:Q.script?(Q.script+=""?de(Q):G(Q,"Invalid characters in closing tag");continue;case j.TEXT_ENTITY:case j.ATTRIB_VALUE_ENTITY_Q:case j.ATTRIB_VALUE_ENTITY_U:var Be,tt;switch(Q.state){case j.TEXT_ENTITY:Be=j.TEXT,tt="textNode";break;case j.ATTRIB_VALUE_ENTITY_Q:Be=j.ATTRIB_VALUE_QUOTED,tt="attribValue";break;case j.ATTRIB_VALUE_ENTITY_U:Be=j.ATTRIB_VALUE_UNQUOTED,tt="attribValue"}De===";"?(Q[tt]+=Te(Q),Q.entity="",Q.state=Be):w(Q.entity.length?P:re,De)?Q.entity+=De:(G(Q,"Invalid character in entity name"),Q[tt]+="&"+Q.entity+De,Q.entity="",Q.state=Be);continue;default:throw new Error(Q,"Unknown state: "+Q.state)}return Q.position>=Q.bufferCheckPosition&&b(Q),Q}v.parser=function($,Q){return new y($,Q)},v.SAXParser=y,v.SAXStream=x,v.createStream=_,v.MAX_BUFFER_LENGTH=65536;var ye=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];v.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],d.default||(Object.create=function($){function Q(){}return Q.prototype=$,new Q}),i.default||(Object.keys=function($){var Q=[];for(var xe in $)$.hasOwnProperty(xe)&&Q.push(xe);return Q}),y.prototype={end:function(){M(this)},write:_e,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){m(this)}};var Ke;try{Ke=C("stream").Stream}catch($){Ke=function(){}}var Me=v.EVENTS.filter(function($){return $!=="error"&&$!=="end"});x.prototype=(0,d.default)(Ke.prototype,{constructor:{value:x}}),x.prototype.write=function($){if(typeof A=="function"&&typeof A.isBuffer=="function"&&A.isBuffer($)){if(!this._decoder){var Q=C("string_decoder").StringDecoder;this._decoder=new Q("utf8")}$=this._decoder.write($)}return this._parser.write($.toString()),this.emit("data",$),!0},x.prototype.end=function($){return $&&$.length&&this.write($),this._parser.end(),!0},x.prototype.on=function($,Q){var xe=this;return xe._parser["on"+$]||Me.indexOf($)===-1||(xe._parser["on"+$]=function(){var De=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);De.splice(0,0,$),xe.emit.apply(xe,De)}),Ke.prototype.on.call(xe,$,Q)};var Fe="[CDATA[",Ge="DOCTYPE",Ee="http://www.w3.org/XML/1998/namespace",me="http://www.w3.org/2000/xmlns/",We={xml:Ee,xmlns:me},He=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,it=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,re=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,P=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,j=0;v.STATE={BEGIN:j++,BEGIN_WHITESPACE:j++,TEXT:j++,TEXT_ENTITY:j++,OPEN_WAKA:j++,SGML_DECL:j++,SGML_DECL_QUOTED:j++,DOCTYPE:j++,DOCTYPE_QUOTED:j++,DOCTYPE_DTD:j++,DOCTYPE_DTD_QUOTED:j++,COMMENT_STARTING:j++,COMMENT:j++,COMMENT_ENDING:j++,COMMENT_ENDED:j++,CDATA:j++,CDATA_ENDING:j++,CDATA_ENDING_2:j++,PROC_INST:j++,PROC_INST_BODY:j++,PROC_INST_ENDING:j++,OPEN_TAG:j++,OPEN_TAG_SLASH:j++,ATTRIB:j++,ATTRIB_NAME:j++,ATTRIB_NAME_SAW_WHITE:j++,ATTRIB_VALUE:j++,ATTRIB_VALUE_QUOTED:j++,ATTRIB_VALUE_CLOSED:j++,ATTRIB_VALUE_UNQUOTED:j++,ATTRIB_VALUE_ENTITY_Q:j++,ATTRIB_VALUE_ENTITY_U:j++,CLOSE_TAG:j++,CLOSE_TAG_SAW_WHITE:j++,SCRIPT:j++,SCRIPT_ENDING:j++},v.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,i.default)(v.ENTITIES).forEach(function($){var Q=v.ENTITIES[$],xe=typeof Q=="number"?String.fromCharCode(Q):Q;v.ENTITIES[$]=xe});for(var ee in v.STATE)v.STATE[v.STATE[ee]]=ee;j=v.STATE,p.default||function(){var $=String.fromCharCode,Q=Math.floor,xe=function(){var De,dt,Ne=[],Be=-1,tt=arguments.length;if(!tt)return"";for(var lt="";++Be1114111||Q(qe)!==qe)throw RangeError("Invalid code point: "+qe);qe<=65535?Ne.push(qe):(qe-=65536,De=55296+(qe>>10),dt=qe%1024+56320,Ne.push(De,dt)),(Be+1===tt||Ne.length>16384)&&(lt+=$.apply(null,Ne),Ne.length=0)}return lt};l.default?Object.defineProperty(String,"fromCodePoint",{value:xe,configurable:!0,writable:!0}):String.fromCodePoint=xe}()}(T===void 0?(void 0).sax={}:T)}).call(this,C("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/create":19,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/string/from-code-point":26,"babel-runtime/helpers/typeof":32,buffer:38,stream:195,string_decoder:37}],195:[function(C,D,T){function A(){O.call(this)}D.exports=A;var O=C("events").EventEmitter;C("inherits")(A,O),A.Readable=C("readable-stream/readable.js"),A.Writable=C("readable-stream/writable.js"),A.Duplex=C("readable-stream/duplex.js"),A.Transform=C("readable-stream/transform.js"),A.PassThrough=C("readable-stream/passthrough.js"),A.Stream=A,A.prototype.pipe=function(f,p){function c(t){f.writable&&f.write(t)===!1&&a.pause&&a.pause()}function s(){a.readable&&a.resume&&a.resume()}function n(){i||(i=!0,f.end())}function o(){i||(i=!0,typeof f.destroy=="function"&&f.destroy())}function r(t){if(l(),O.listenerCount(this,"error")===0)throw t}function l(){a.removeListener("data",c),f.removeListener("drain",s),a.removeListener("end",n),a.removeListener("close",o),a.removeListener("error",r),f.removeListener("error",r),a.removeListener("end",l),a.removeListener("close",l),f.removeListener("close",l)}var a=this;a.on("data",c),f.on("drain",s),f._isStdio||p&&p.end===!1||(a.on("end",n),a.on("close",o));var i=!1;return a.on("error",r),f.on("error",r),a.on("end",l),a.on("close",l),f.on("close",l),f.emit("pipe",a),f}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(C,D,T){(function(A){var O=C("./lib/request"),f=C("./lib/response"),p=C("xtend"),c=C("builtin-status-codes"),s=C("url"),n=T;n.request=function(o,r){o=typeof o=="string"?s.parse(o):p(o);var l=A.location.protocol.search(/^https?:$/)===-1?"http:":"",a=o.protocol||l,i=o.hostname||o.host,t=o.port,d=o.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),o.url=(i?a+"//"+i:"")+(t?":"+t:"")+d,o.method=(o.method||"GET").toUpperCase(),o.headers=o.headers||{};var v=new O(o);return r&&v.on("response",r),v},n.get=function(o,r){var l=n.request(o,r);return l.end(),l},n.ClientRequest=O,n.IncomingMessage=f.IncomingMessage,n.Agent=function(){},n.Agent.defaultMaxSockets=4,n.globalAgent=new n.Agent,n.STATUS_CODES=c,n.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(C,D,T){(function(A){"use strict";function O(){if(c!==void 0)return c;if(A.XMLHttpRequest){c=new A.XMLHttpRequest;try{c.open("GET",A.XDomainRequest?"/":"https://example.com")}catch(o){c=null}}else c=null;return c}function f(o){var r=O();if(!r)return!1;try{return r.responseType=o,r.responseType===o}catch(l){}return!1}function p(o){return typeof o=="function"}T.fetch=p(A.fetch)&&p(A.ReadableStream),T.writableStream=p(A.WritableStream),T.abortController=p(A.AbortController),T.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),T.blobConstructor=!0}catch(o){}var c,s=A.ArrayBuffer!==void 0,n=s&&p(A.ArrayBuffer.prototype.slice);T.arraybuffer=T.fetch||s&&f("arraybuffer"),T.msstream=!T.fetch&&n&&f("ms-stream"),T.mozchunkedarraybuffer=!T.fetch&&s&&f("moz-chunked-arraybuffer"),T.overrideMimeType=T.fetch||!!O()&&p(O().overrideMimeType),T.vbArray=p(A.VBArray),c=null}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(C,D,T){(function(A,O,f){"use strict";function p(b,g){return o.fetch&&g?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&b?"arraybuffer":o.vbArray&&b?"text:vbarray":"text"}function c(b){try{var g=b.status;return g!==null&&g!==0}catch(m){return!1}}var s=C("babel-runtime/core-js/object/keys"),n=function(b){return b&&b.__esModule?b:{default:b}}(s),o=C("./capability"),r=C("inherits"),l=C("./response"),a=C("readable-stream"),i=C("to-arraybuffer"),t=l.IncomingMessage,d=l.readyStates,v=D.exports=function(b){var g=this;a.Writable.call(g),g._opts=b,g._body=[],g._headers={},b.auth&&g.setHeader("Authorization","Basic "+new f(b.auth).toString("base64")),(0,n.default)(b.headers).forEach(function(x){g.setHeader(x,b.headers[x])});var m,_=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!o.abortController)_=!1,m=!0;else if(b.mode==="prefer-streaming")m=!1;else if(b.mode==="allow-wrong-content-type")m=!o.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");m=!0}g._mode=p(m,_),g._fetchTimer=null,g.on("finish",function(){g._onFinish()})};r(v,a.Writable),v.prototype.setHeader=function(b,g){var m=this,_=b.toLowerCase();y.indexOf(_)===-1&&(m._headers[_]={name:b,value:g})},v.prototype.getHeader=function(b){var g=this._headers[b.toLowerCase()];return g?g.value:null},v.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},v.prototype._onFinish=function(){var b=this;if(!b._destroyed){var g=b._opts,m=b._headers,_=null;g.method!=="GET"&&g.method!=="HEAD"&&(_=o.arraybuffer?i(f.concat(b._body)):o.blobConstructor?new O.Blob(b._body.map(function(w){return i(w)}),{type:(m["content-type"]||{}).value||""}):f.concat(b._body).toString());var x=[];if((0,n.default)(m).forEach(function(w){var R=m[w].name,N=m[w].value;Array.isArray(N)?N.forEach(function(F){x.push([R,F])}):x.push([R,N])}),b._mode==="fetch"){var h=null;if(o.abortController){var E=new AbortController;h=E.signal,b._fetchAbortController=E,"requestTimeout"in g&&g.requestTimeout!==0&&(b._fetchTimer=O.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},g.requestTimeout))}O.fetch(b._opts.url,{method:b._opts.method,headers:x,body:_||void 0,mode:"cors",credentials:g.withCredentials?"include":"same-origin",signal:h}).then(function(w){b._fetchResponse=w,b._connect()},function(w){O.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",w)})}else{var S=b._xhr=new O.XMLHttpRequest;try{S.open(b._opts.method,b._opts.url,!0)}catch(w){return void A.nextTick(function(){b.emit("error",w)})}"responseType"in S&&(S.responseType=b._mode.split(":")[0]),"withCredentials"in S&&(S.withCredentials=!!g.withCredentials),b._mode==="text"&&"overrideMimeType"in S&&S.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in g&&(S.timeout=g.requestTimeout,S.ontimeout=function(){b.emit("requestTimeout")}),x.forEach(function(w){S.setRequestHeader(w[0],w[1])}),b._response=null,S.onreadystatechange=function(){switch(S.readyState){case d.LOADING:case d.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(S.onprogress=function(){b._onXHRProgress()}),S.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{S.send(_)}catch(w){return void A.nextTick(function(){b.emit("error",w)})}}}},v.prototype._onXHRProgress=function(){var b=this;c(b._xhr)&&!b._destroyed&&(b._response||b._connect(),b._response._onXHRProgress())},v.prototype._connect=function(){var b=this;b._destroyed||(b._response=new t(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(g){b.emit("error",g)}),b.emit("response",b._response))},v.prototype._write=function(b,g,m){this._body.push(b),m()},v.prototype.abort=v.prototype.destroy=function(){var b=this;b._destroyed=!0,O.clearTimeout(b._fetchTimer),b._response&&(b._response._destroyed=!0),b._xhr?b._xhr.abort():b._fetchAbortController&&b._fetchAbortController.abort()},v.prototype.end=function(b,g,m){var _=this;typeof b=="function"&&(m=b,b=void 0),a.Writable.prototype.end.call(_,b,g,m)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{},C("buffer").Buffer)},{"./capability":197,"./response":199,_process:173,"babel-runtime/core-js/object/keys":23,buffer:38,inherits:162,"readable-stream":188,"to-arraybuffer":202}],199:[function(C,D,T){(function(A,O,f){"use strict";var p=C("babel-runtime/core-js/promise"),c=function(a){return a&&a.__esModule?a:{default:a}}(p),s=C("./capability"),n=C("inherits"),o=C("readable-stream"),r=T.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=T.IncomingMessage=function(a,i,t,d){var v=this;if(o.Readable.call(v),v._mode=t,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){A.nextTick(function(){v.emit("close")})}),t==="fetch"){if(v._fetchResponse=i,v.url=i.url,v.statusCode=i.status,v.statusMessage=i.statusText,i.headers.forEach(function(_,x){v.headers[x.toLowerCase()]=_,v.rawHeaders.push(x,_)}),s.writableStream){var y=new WritableStream({write:function(_){return new c.default(function(x,h){v._destroyed?h():v.push(new f(_))?x():v._resumeFetch=x})},close:function(){O.clearTimeout(d),v._destroyed||v.push(null)},abort:function(_){v._destroyed||v.emit("error",_)}});try{return void i.body.pipeTo(y).catch(function(_){O.clearTimeout(d),v._destroyed||v.emit("error",_)})}catch(_){}}var b=i.body.getReader();!function _(){b.read().then(function(x){if(!v._destroyed){if(x.done)return O.clearTimeout(d),void v.push(null);v.push(new f(x.value)),_()}}).catch(function(x){O.clearTimeout(d),v._destroyed||v.emit("error",x)})}()}else if(v._xhr=a,v._pos=0,v.url=a.responseURL,v.statusCode=a.status,v.statusMessage=a.statusText,a.getAllResponseHeaders().split(/\r?\n/).forEach(function(_){var x=_.match(/^([^:]+):\s*(.*)/);if(x){var h=x[1].toLowerCase();h==="set-cookie"?(v.headers[h]===void 0&&(v.headers[h]=[]),v.headers[h].push(x[2])):v.headers[h]!==void 0?v.headers[h]+=", "+x[2]:v.headers[h]=x[2],v.rawHeaders.push(x[1],x[2])}}),v._charset="x-user-defined",!s.overrideMimeType){var g=v.rawHeaders["mime-type"];if(g){var m=g.match(/;\s*charset=([^;])(;|$)/);m&&(v._charset=m[1].toLowerCase())}v._charset||(v._charset="utf-8")}};n(l,o.Readable),l.prototype._read=function(){var a=this,i=a._resumeFetch;i&&(a._resumeFetch=null,i())},l.prototype._onXHRProgress=function(){var a=this,i=a._xhr,t=null;switch(a._mode){case"text:vbarray":if(i.readyState!==r.DONE)break;try{t=new O.VBArray(i.responseBody).toArray()}catch(g){}if(t!==null){a.push(new f(t));break}case"text":try{t=i.responseText}catch(g){a._mode="text:vbarray";break}if(t.length>a._pos){var d=t.substr(a._pos);if(a._charset==="x-user-defined"){for(var v=new f(d.length),y=0;ya._pos&&(a.push(new f(new Uint8Array(b.result.slice(a._pos)))),a._pos=b.result.byteLength)},b.onload=function(){a.push(null)},b.readAsArrayBuffer(t)}a._xhr.readyState===r.DONE&&a._mode!=="ms-stream"&&a.push(null)}}).call(this,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{},C("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(C,D,T){"use strict";function A(g){if(!g)return"utf8";for(var m;;)switch(g){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return g;default:if(m)return;g=(""+g).toLowerCase(),m=!0}}function O(g){var m=A(g);if(typeof m!="string"&&(y.isEncoding===b||!b(g)))throw new Error("Unknown encoding: "+g);return m||g}function f(g){this.encoding=O(g);var m;switch(this.encoding){case"utf16le":this.text=l,this.end=a,m=4;break;case"utf8":this.fillLast=n,m=4;break;case"base64":this.text=i,this.end=t,m=3;break;default:return this.write=d,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(m)}function p(g){return g<=127?0:g>>5==6?2:g>>4==14?3:g>>3==30?4:g>>6==2?-1:-2}function c(g,m,_){var x=m.length-1;if(x<_)return 0;var h=p(m[x]);return h>=0?(h>0&&(g.lastNeed=h-1),h):--x<_||h===-2?0:(h=p(m[x]))>=0?(h>0&&(g.lastNeed=h-2),h):--x<_||h===-2?0:(h=p(m[x]),h>=0?(h>0&&(h===2?h=0:g.lastNeed=h-3),h):0)}function s(g,m,_){if((192&m[0])!=128)return g.lastNeed=0,"\u951F\uFFFD";if(g.lastNeed>1&&m.length>1){if((192&m[1])!=128)return g.lastNeed=1,"\u951F\uFFFD";if(g.lastNeed>2&&m.length>2&&(192&m[2])!=128)return g.lastNeed=2,"\u951F\uFFFD"}}function n(g){var m=this.lastTotal-this.lastNeed,_=s(this,g,m);return _!==void 0?_:this.lastNeed<=g.length?(g.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(g.copy(this.lastChar,m,0,g.length),void(this.lastNeed-=g.length))}function o(g,m){var _=c(this,g,m);if(!this.lastNeed)return g.toString("utf8",m);this.lastTotal=_;var x=g.length-(_-this.lastNeed);return g.copy(this.lastChar,0,x),g.toString("utf8",m,x)}function r(g){var m=g&&g.length?this.write(g):"";return this.lastNeed?m+"\u951F\uFFFD":m}function l(g,m){if((g.length-m)%2==0){var _=g.toString("utf16le",m);if(_){var x=_.charCodeAt(_.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",m,g.length-1)}function a(g){var m=g&&g.length?this.write(g):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,_)}return m}function i(g,m){var _=(g.length-m)%3;return _===0?g.toString("base64",m):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",m,g.length-_))}function t(g){var m=g&&g.length?this.write(g):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function d(g){return g.toString(this.encoding)}function v(g){return g&&g.length?this.write(g):""}var y=C("safe-buffer").Buffer,b=y.isEncoding||function(g){switch((g=""+g)&&g.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};T.StringDecoder=f,f.prototype.write=function(g){if(g.length===0)return"";var m,_;if(this.lastNeed){if((m=this.fillLast(g))===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _=0&&(r._idleTimeoutId=setTimeout(function(){r._onTimeout&&r._onTimeout()},l))},T.setImmediate=typeof A=="function"?A:function(r){var l=o++,a=!(arguments.length<2)&&s.call(arguments,1);return n[l]=!0,p(function(){n[l]&&(a?r.apply(null,a):r.call(null),T.clearImmediate(l))}),l},T.clearImmediate=typeof O=="function"?O:function(r){delete n[r]}}).call(this,C("timers").setImmediate,C("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(C,D,T){var A=C("buffer").Buffer;D.exports=function(O){if(O instanceof Uint8Array){if(O.byteOffset===0&&O.byteLength===O.buffer.byteLength)return O.buffer;if(typeof O.buffer.slice=="function")return O.buffer.slice(O.byteOffset,O.byteOffset+O.byteLength)}if(A.isBuffer(O)){for(var f=new Uint8Array(O.length),p=O.length,c=0;c",'"',"`"," ","\r",` `," "],i=["{","}","|","\\","^","`"].concat(a),t=["'"].concat(i),d=["%","/","?",";","#"].concat(t),v=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=C("querystring");A.prototype.parse=function(h,E,S){if(!n.isString(h))throw new TypeError("Parameter 'url' must be a string, not "+typeof h);var w=h.indexOf("?"),R=w!==-1&&w127?ye+="x":ye+=_e[Ke];if(!ye.match(y)){var Fe=we.slice(0,K),Ge=we.slice(K+1),Ee=_e.match(b);Ee&&(Fe.push(Ee[1]),Ge.unshift(Ee[2])),Ge.length&&(z="/"+Ge.join(".")+z),this.hostname=Fe.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Te||(this.hostname=s.toASCII(this.hostname));var me=this.port?":"+this.port:"",We=this.hostname||"";this.host=We+me,this.href+=this.host,Te&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),z[0]!=="/"&&(z="/"+z))}if(!g[M])for(var K=0,Ie=t.length;K0)&&S.host.split("@");ye&&(S.auth=ye.shift(),S.host=S.hostname=ye.shift())}return S.search=h.search,S.query=h.query,n.isNull(S.pathname)&&n.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!we.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var Ke=we.slice(-1)[0],Me=(S.host||h.host||we.length>1)&&(Ke==="."||Ke==="..")||Ke==="",Fe=0,Ge=we.length;Ge>=0;Ge--)Ke=we[Ge],Ke==="."?we.splice(Ge,1):Ke===".."?(we.splice(Ge,1),Fe++):Fe&&(we.splice(Ge,1),Fe--);if(!de&&!Te)for(;Fe--;Fe)we.unshift("..");!de||we[0]===""||we[0]&&we[0].charAt(0)==="/"||we.unshift(""),Me&&we.join("/").substr(-1)!=="/"&&we.push("");var Ee=we[0]===""||we[0]&&we[0].charAt(0)==="/";if(_e){S.hostname=S.host=Ee?"":we.length?we.shift():"";var ye=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ye&&(S.auth=ye.shift(),S.host=S.hostname=ye.shift())}return de=de||S.host&&we.length,de&&!Ee&&we.unshift(""),we.length?S.pathname=we.join("/"):(S.pathname=null,S.path=null),n.isNull(S.pathname)&&n.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=h.auth||S.auth,S.slashes=S.slashes||h.slashes,S.href=S.format(),S},A.prototype.parseHost=function(){var h=this.host,E=r.exec(h);E&&(E=E[0],E!==":"&&(this.port=E.substr(1)),h=h.substr(0,h.length-E.length)),h&&(this.hostname=h)}},{"./util":204,punycode:174,querystring:177}],204:[function(C,D,T){"use strict";D.exports={isString:function(A){return typeof A=="string"},isObject:function(A){return typeof A=="object"&&A!==null},isNull:function(A){return A===null},isNullOrUndefined:function(A){return A==null}}},{}],205:[function(C,D,T){(function(A){function O(p,c){function s(){if(!n){if(f("throwDeprecation"))throw new Error(c);f("traceDeprecation")?console.trace(c):console.warn(c),n=!0}return p.apply(this,arguments)}if(f("noDeprecation"))return p;var n=!1;return s}function f(p){try{if(!A.localStorage)return!1}catch(s){return!1}var c=A.localStorage[p];return c!=null&&String(c).toLowerCase()==="true"}D.exports=O}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(C,D,T){D.exports=function(A){return A&&typeof A=="object"&&typeof A.copy=="function"&&typeof A.fill=="function"&&typeof A.readUInt8=="function"}},{}],207:[function(C,D,T){(function(A,O){function f(K,Z){var le={seen:[],stylize:c};return arguments.length>=3&&(le.depth=arguments[2]),arguments.length>=4&&(le.colors=arguments[3]),d(Z)?le.showHidden=Z:Z&&T._extend(le,Z),_(le.showHidden)&&(le.showHidden=!1),_(le.depth)&&(le.depth=2),_(le.colors)&&(le.colors=!1),_(le.customInspect)&&(le.customInspect=!0),le.colors&&(le.stylize=p),n(le,K,le.depth)}function p(K,Z){var le=f.styles[Z];return le?"["+f.colors[le][0]+"m"+K+"["+f.colors[le][1]+"m":K}function c(K,Z){return K}function s(K){var Z={};return K.forEach(function(le,de){Z[le]=!0}),Z}function n(K,Z,le){if(K.customInspect&&Z&&w(Z.inspect)&&Z.inspect!==T.inspect&&(!Z.constructor||Z.constructor.prototype!==Z)){var de=Z.inspect(le,K);return g(de)||(de=n(K,de,le)),de}var Te=o(K,Z);if(Te)return Te;var we=Object.keys(Z),Ie=s(we);if(K.showHidden&&(we=Object.getOwnPropertyNames(Z)),S(Z)&&(we.indexOf("message")>=0||we.indexOf("description")>=0))return r(Z);if(we.length===0){if(w(Z)){var _e=Z.name?": "+Z.name:"";return K.stylize("[Function"+_e+"]","special")}if(x(Z))return K.stylize(RegExp.prototype.toString.call(Z),"regexp");if(E(Z))return K.stylize(Date.prototype.toString.call(Z),"date");if(S(Z))return r(Z)}var ye="",Ke=!1,Me=["{","}"];if((t(Z)&&(Ke=!0,Me=["[","]"]),w(Z))&&(ye=" [Function"+(Z.name?": "+Z.name:"")+"]"),x(Z)&&(ye=" "+RegExp.prototype.toString.call(Z)),E(Z)&&(ye=" "+Date.prototype.toUTCString.call(Z)),S(Z)&&(ye=" "+r(Z)),we.length===0&&(!Ke||Z.length==0))return Me[0]+ye+Me[1];if(le<0)return x(Z)?K.stylize(RegExp.prototype.toString.call(Z),"regexp"):K.stylize("[Object]","special");K.seen.push(Z);var Fe;return Fe=Ke?l(K,Z,le,Ie,we):we.map(function(Ge){return a(K,Z,le,Ie,Ge,Ke)}),K.seen.pop(),i(Fe,ye,Me)}function o(K,Z){if(_(Z))return K.stylize("undefined","undefined");if(g(Z)){var le="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return K.stylize(le,"string")}return b(Z)?K.stylize(""+Z,"number"):d(Z)?K.stylize(""+Z,"boolean"):v(Z)?K.stylize("null","null"):void 0}function r(K){return"["+Error.prototype.toString.call(K)+"]"}function l(K,Z,le,de,Te){for(var we=[],Ie=0,_e=Z.length;Ie<_e;++Ie)q(Z,String(Ie))?we.push(a(K,Z,le,de,String(Ie),!0)):we.push("");return Te.forEach(function(ye){ye.match(/^\d+$/)||we.push(a(K,Z,le,de,ye,!0))}),we}function a(K,Z,le,de,Te,we){var Ie,_e,ye;if(ye=Object.getOwnPropertyDescriptor(Z,Te)||{value:Z[Te]},ye.get?_e=ye.set?K.stylize("[Getter/Setter]","special"):K.stylize("[Getter]","special"):ye.set&&(_e=K.stylize("[Setter]","special")),q(de,Te)||(Ie="["+Te+"]"),_e||(K.seen.indexOf(ye.value)<0?(_e=v(le)?n(K,ye.value,null):n(K,ye.value,le-1),_e.indexOf(` `)>-1&&(_e=we?_e.split(` `).map(function(Ke){return" "+Ke}).join(` `).substr(2):` `+_e.split(` `).map(function(Ke){return" "+Ke}).join(` `))):_e=K.stylize("[Circular]","special")),_(Ie)){if(we&&Te.match(/^\d+$/))return _e;Ie=JSON.stringify(""+Te),Ie.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Ie=Ie.substr(1,Ie.length-2),Ie=K.stylize(Ie,"name")):(Ie=Ie.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Ie=K.stylize(Ie,"string"))}return Ie+": "+_e}function i(K,Z,le){var de=0;return K.reduce(function(Te,we){return de++,we.indexOf(` `)>=0&&de++,Te+we.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?le[0]+(Z===""?"":Z+` `)+" "+K.join(`, `)+" "+le[1]:le[0]+Z+" "+K.join(", ")+" "+le[1]}function t(K){return Array.isArray(K)}function d(K){return typeof K=="boolean"}function v(K){return K===null}function y(K){return K==null}function b(K){return typeof K=="number"}function g(K){return typeof K=="string"}function m(K){return typeof K=="symbol"}function _(K){return K===void 0}function x(K){return h(K)&&N(K)==="[object RegExp]"}function h(K){return typeof K=="object"&&K!==null}function E(K){return h(K)&&N(K)==="[object Date]"}function S(K){return h(K)&&(N(K)==="[object Error]"||K instanceof Error)}function w(K){return typeof K=="function"}function R(K){return K===null||typeof K=="boolean"||typeof K=="number"||typeof K=="string"||typeof K=="symbol"||K===void 0}function N(K){return Object.prototype.toString.call(K)}function F(K){return K<10?"0"+K.toString(10):K.toString(10)}function z(){var K=new Date,Z=[F(K.getHours()),F(K.getMinutes()),F(K.getSeconds())].join(":");return[K.getDate(),J[K.getMonth()],Z].join(" ")}function q(K,Z){return Object.prototype.hasOwnProperty.call(K,Z)}var B=/%[sdj%]/g;T.format=function(K){if(!g(K)){for(var Z=[],le=0;le=Te)return ye;switch(ye){case"%s":return String(de[le++]);case"%d":return Number(de[le++]);case"%j":try{return JSON.stringify(de[le++])}catch(Ke){return"[Circular]"}default:return ye}}),Ie=de[le];le=0||i.indexOf(">")>=0||i.indexOf("<")>=0)},l=function(i){return""},o=function(i){return i.replace("]]>","]]]]>")},T.Builder=function(){function i(t){var d,v,y;this.options={},v=n[.2];for(d in v)a.call(v,d)&&(y=v[d],this.options[d]=y);for(d in t)a.call(t,d)&&(y=t[d],this.options[d]=y)}return i.prototype.buildObject=function(t){var d,v,y,b,g;return d=this.options.attrkey,v=this.options.charkey,(0,c.default)(t).length===1&&this.options.rootName===n[.2].rootName?(g=(0,c.default)(t)[0],t=t[g]):g=this.options.rootName,y=function(m){return function(_,x){var h,E,S,w,R,N;if((x===void 0?"undefined":(0,f.default)(x))!=="object")m.options.cdata&&r(x)?_.raw(l(x)):_.txt(x);else if(Array.isArray(x)){for(w in x)if(a.call(x,w)){E=x[w];for(R in E)S=E[R],_=y(_.ele(R),S).up()}}else for(R in x)if(a.call(x,R))if(E=x[R],R===d){if((E===void 0?"undefined":(0,f.default)(E))==="object")for(h in E)N=E[h],_=_.att(h,N)}else if(R===v)_=m.options.cdata&&r(E)?_.raw(l(E)):_.txt(E);else if(Array.isArray(E))for(w in E)a.call(E,w)&&(S=E[w],_=typeof S=="string"?m.options.cdata&&r(S)?_.ele(R).raw(l(S)).up():_.ele(R,S).up():y(_.ele(R),S).up());else(E===void 0?"undefined":(0,f.default)(E))==="object"?_=y(_.ele(R),E).up():typeof E=="string"&&m.options.cdata&&r(E)?_=_.ele(R).raw(l(E)).up():(E==null&&(E=""),_=_.ele(R,E.toString()).up());return _}}(this),b=s.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(b,t).end(this.options.renderOpts)},i}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(C,D,T){"use strict";(function(){T.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:` `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],211:[function(C,D,T){"use strict";function A(o){return o&&o.__esModule?o:{default:o}}var O=C("babel-runtime/core-js/object/get-own-property-names"),f=A(O),p=C("babel-runtime/core-js/object/keys"),c=A(p),s=C("babel-runtime/helpers/typeof"),n=A(s);(function(){var o,r,l,a,i,t,d,v,y=function(m,_){return function(){return m.apply(_,arguments)}},b=function(m,_){function x(){this.constructor=m}for(var h in _)g.call(_,h)&&(m[h]=_[h]);return x.prototype=_.prototype,m.prototype=new x,m.__super__=_.prototype,m},g={}.hasOwnProperty;d=C("sax"),l=C("events"),o=C("./bom"),t=C("./processors"),v=C("timers").setImmediate,r=C("./defaults").defaults,a=function(m){return(m===void 0?"undefined":(0,n.default)(m))==="object"&&m!=null&&(0,c.default)(m).length===0},i=function(m,_,x){var h,E,S;for(h=0,E=m.length;h0&&(z[w.options.childkey]=B),B=z;return S.length>0?w.assignOrPush(J,q,B):(w.options.explicitRoot&&(G=B,B={},B[q]=G),w.resultObject=B,w.saxParser.ended=!0,w.emit("end",w.resultObject))}}(this),E=function(w){return function(R){var N,F;if(F=S[S.length-1])return F[h]+=R,w.options.explicitChildren&&w.options.preserveChildrenOrder&&w.options.charsAsChildren&&(w.options.includeWhiteChars||R.replace(/\\n/g,"").trim()!=="")&&(F[w.options.childkey]=F[w.options.childkey]||[],N={"#name":"__text__"},N[h]=R,w.options.normalize&&(N[h]=N[h].replace(/\s{2,}/g," ").trim()),F[w.options.childkey].push(N)),F}}(this),this.saxParser.ontext=E,this.saxParser.oncdata=function(w){return function(R){var N;if(N=E(R))return N.cdata=!0}}()},_.prototype.parseString=function(x,h){var E;h!=null&&typeof h=="function"&&(this.on("end",function(S){return this.reset(),h(null,S)}),this.on("error",function(S){return this.reset(),h(S)}));try{return x=x.toString(),x.trim()===""?(this.emit("end",null),!0):(x=o.stripBOM(x),this.options.async?(this.remaining=x,v(this.processAsync),this.saxParser):this.saxParser.write(x).close())}catch(S){if(E=S,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",E),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw E}},_}(l.EventEmitter),T.parseString=function(m,_,x){var h,E,S;return x!=null?(typeof x=="function"&&(h=x),(_===void 0?"undefined":(0,n.default)(_))==="object"&&(E=_)):(typeof _=="function"&&(h=_),E={}),S=new T.Parser(E),S.parseString(m,h)}}).call(void 0)},{"./bom":208,"./defaults":210,"./processors":212,"babel-runtime/core-js/object/get-own-property-names":21,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,events:158,sax:194,timers:201}],212:[function(C,D,T){"use strict";(function(){var A;A=new RegExp(/(?!xmlns)^.*:/),T.normalize=function(O){return O.toLowerCase()},T.firstCharLowerCase=function(O){return O.charAt(0).toLowerCase()+O.slice(1)},T.stripPrefix=function(O){return O.replace(A,"")},T.parseNumbers=function(O){return isNaN(O)||(O=O%1==0?parseInt(O,10):parseFloat(O)),O},T.parseBooleans=function(O){return/^(?:true|false)$/i.test(O)&&(O=O.toLowerCase()==="true"),O}}).call(void 0)},{}],213:[function(C,D,T){"use strict";(function(){var A,O,f,p,c=function(n,o){function r(){this.constructor=n}for(var l in o)s.call(o,l)&&(n[l]=o[l]);return r.prototype=o.prototype,n.prototype=new r,n.__super__=o.prototype,n},s={}.hasOwnProperty;O=C("./defaults"),A=C("./builder"),f=C("./parser"),p=C("./processors"),T.defaults=O.defaults,T.processors=p,T.ValidationError=function(n){function o(r){this.message=r}return c(o,n),o}(Error),T.Builder=A.Builder,T.Parser=f.Parser,T.parseString=f.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(C,D,T){"use strict";function A(o){return o&&o.__esModule?o:{default:o}}var O=C("babel-runtime/core-js/object/get-prototype-of"),f=A(O),p=C("babel-runtime/helpers/typeof"),c=A(p),s=C("babel-runtime/core-js/object/assign"),n=A(s);(function(){var o,r,l,a,i,t,d=[].slice,v={}.hasOwnProperty;o=function(){var y,b,g,m,_,x;if(x=arguments[0],_=2<=arguments.length?d.call(arguments,1):[],a(n.default))n.default.apply(null,arguments);else for(y=0,g=_.length;y=0;)this.up();return this.onEnd()},x.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},x.prototype.openNode=function(h){if(!h.isOpen)return!this.root&&this.currentLevel===0&&h instanceof l&&(this.root=h),this.onData(this.writer.openNode(h,this.currentLevel)),h.isOpen=!0},x.prototype.closeNode=function(h){if(!h.isClosed)return this.onData(this.writer.closeNode(h,this.currentLevel)),h.isClosed=!0},x.prototype.onData=function(h){return this.documentStarted=!0,this.onDataCallback(h)},x.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},x.prototype.ele=function(){return this.element.apply(this,arguments)},x.prototype.nod=function(h,E,S){return this.node(h,E,S)},x.prototype.txt=function(h){return this.text(h)},x.prototype.dat=function(h){return this.cdata(h)},x.prototype.com=function(h){return this.comment(h)},x.prototype.ins=function(h,E){return this.instruction(h,E)},x.prototype.dec=function(h,E,S){return this.declaration(h,E,S)},x.prototype.dtd=function(h,E,S){return this.doctype(h,E,S)},x.prototype.e=function(h,E,S){return this.element(h,E,S)},x.prototype.n=function(h,E,S){return this.node(h,E,S)},x.prototype.t=function(h){return this.text(h)},x.prototype.d=function(h){return this.cdata(h)},x.prototype.c=function(h){return this.comment(h)},x.prototype.r=function(h){return this.raw(h)},x.prototype.i=function(h,E){return this.instruction(h,E)},x.prototype.att=function(){return this.currentNode&&this.currentNode instanceof r?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.a=function(){return this.currentNode&&this.currentNode instanceof r?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.ent=function(h,E){return this.entity(h,E)},x.prototype.pent=function(h,E){return this.pEntity(h,E)},x.prototype.not=function(h,E){return this.notation(h,E)},x}()}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLStringWriter":231,"./XMLStringifier":232,"./XMLText":233}],226:[function(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p,c,s,n,o=function(l,a){function i(){this.constructor=l}for(var t in a)r.call(a,t)&&(l[t]=a[t]);return i.prototype=a.prototype,l.prototype=new i,l.__super__=a.prototype,l},r={}.hasOwnProperty;n=C("./Utility"),s=n.isObject,c=n.isFunction,p=C("./XMLNode"),f=C("./XMLAttribute"),D.exports=function(l){function a(i,t,d){if(a.__super__.constructor.call(this,i),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},d!=null&&this.attribute(d),i.isDocument&&(this.isRoot=!0,this.documentObject=i,i.rootObject=this)}return o(a,l),a.prototype.clone=function(){var i,t,d,v;d=(0,O.default)(this),d.isRoot&&(d.documentObject=null),d.attributes={},v=this.attributes;for(t in v)r.call(v,t)&&(i=v[t],d.attributes[t]=i.clone());return d.children=[],this.children.forEach(function(y){var b;return b=y.clone(),b.parent=d,d.children.push(b)}),d},a.prototype.attribute=function(i,t){var d,v;if(i!=null&&(i=i.valueOf()),s(i))for(d in i)r.call(i,d)&&(v=i[d],this.attribute(d,v));else c(t)&&(t=t.apply()),this.options.skipNullAttributes&&t==null||(this.attributes[i]=new f(this,i,t));return this},a.prototype.removeAttribute=function(i){var t,d,v;if(i==null)throw new Error("Missing attribute name");if(i=i.valueOf(),Array.isArray(i))for(d=0,v=i.length;d"+this.endline(g))},b.prototype.comment=function(g,m){return this.stream.write(this.space(m)+""+this.endline(g))},b.prototype.declaration=function(g,m){return this.stream.write(this.space(m)),this.stream.write('"),this.stream.write(this.endline(g))},b.prototype.docType=function(g,m){var _,x,h,E;if(m||(m=0),this.stream.write(this.space(m)),this.stream.write("0){for(this.stream.write(" ["),this.stream.write(this.endline(g)),E=g.children,x=0,h=E.length;x"),this.stream.write(this.endline(g))},b.prototype.element=function(g,m){var _,x,h,E,S,w,R,N;m||(m=0),N=this.space(m),this.stream.write(N+"<"+g.name),w=g.attributes;for(S in w)v.call(w,S)&&(_=w[S],this.attribute(_));if(g.children.length===0||g.children.every(function(F){return F.value===""}))this.allowEmpty?this.stream.write(">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&g.children.length===1&&g.children[0].value!=null)this.stream.write(">"),this.stream.write(g.children[0].value),this.stream.write("");else{for(this.stream.write(">"+this.newline),R=g.children,h=0,E=R.length;h")}return this.stream.write(this.endline(g))},b.prototype.processingInstruction=function(g,m){return this.stream.write(this.space(m)+""+this.endline(g))},b.prototype.raw=function(g,m){return this.stream.write(this.space(m)+g.value+this.endline(g))},b.prototype.text=function(g,m){return this.stream.write(this.space(m)+g.value+this.endline(g))},b.prototype.dtdAttList=function(g,m){return this.stream.write(this.space(m)+""+this.endline(g))},b.prototype.dtdElement=function(g,m){return this.stream.write(this.space(m)+""+this.endline(g))},b.prototype.dtdEntity=function(g,m){return this.stream.write(this.space(m)+""+this.endline(g))},b.prototype.dtdNotation=function(g,m){return this.stream.write(this.space(m)+""+this.endline(g))},b.prototype.endline=function(g){return g.isLastRootNode?"":this.newline},b}(t)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],231:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n,o,r,l,a,i,t,d=function(y,b){function g(){this.constructor=y}for(var m in b)v.call(b,m)&&(y[m]=b[m]);return g.prototype=b.prototype,y.prototype=new g,y.__super__=b.prototype,y},v={}.hasOwnProperty;n=C("./XMLDeclaration"),o=C("./XMLDocType"),A=C("./XMLCData"),O=C("./XMLComment"),r=C("./XMLElement"),a=C("./XMLRaw"),i=C("./XMLText"),l=C("./XMLProcessingInstruction"),f=C("./XMLDTDAttList"),p=C("./XMLDTDElement"),c=C("./XMLDTDEntity"),s=C("./XMLDTDNotation"),t=C("./XMLWriterBase"),D.exports=function(y){function b(g){b.__super__.constructor.call(this,g)}return d(b,y),b.prototype.document=function(g){var m,_,x,h,E;for(this.textispresent=!1,h="",E=g.children,_=0,x=E.length;_"+this.newline},b.prototype.comment=function(g,m){return this.space(m)+""+this.newline},b.prototype.declaration=function(g,m){var _;return _=this.space(m),_+='",_+=this.newline},b.prototype.docType=function(g,m){var _,x,h,E,S;if(m||(m=0),E=this.space(m),E+="0){for(E+=" [",E+=this.newline,S=g.children,x=0,h=S.length;x",E+=this.newline},b.prototype.element=function(g,m){var _,x,h,E,S,w,R,N,F,z,q,B,M;m||(m=0),M=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),B=this.space(m),N="",N+=B+"<"+g.name,F=g.attributes;for(R in F)v.call(F,R)&&(_=F[R],N+=this.attribute(_));if(g.children.length===0||g.children.every(function(G){return G.value===""}))this.allowEmpty?N+=">"+this.newline:N+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&g.children.length===1&&g.children[0].value!=null)N+=">",N+=g.children[0].value,N+=""+this.newline;else{if(this.dontprettytextnodes){for(z=g.children,h=0,S=z.length;h"+this.newline,q=g.children,E=0,w=q.length;E"+this.newline}return N},b.prototype.processingInstruction=function(g,m){var _;return _=this.space(m)+""+this.newline},b.prototype.raw=function(g,m){return this.space(m)+g.value+this.newline},b.prototype.text=function(g,m){return this.space(m)+g.value+this.newline},b.prototype.dtdAttList=function(g,m){var _;return _=this.space(m)+""+this.newline},b.prototype.dtdElement=function(g,m){return this.space(m)+""+this.newline},b.prototype.dtdEntity=function(g,m){var _;return _=this.space(m)+""+this.newline},b.prototype.dtdNotation=function(g,m){var _;return _=this.space(m)+""+this.newline},b.prototype.openNode=function(g,m){var _,x,h,E;if(m||(m=0),g instanceof r){h=this.space(m)+"<"+g.name,E=g.attributes;for(x in E)v.call(E,x)&&(_=E[x],h+=this.attribute(_));return h+=(g.children?">":"/>")+this.newline}return h=this.space(m)+"")+this.newline},b.prototype.closeNode=function(g,m){switch(m||(m=0),!1){case!(g instanceof r):return this.space(m)+""+this.newline;case!(g instanceof o):return this.space(m)+"]>"+this.newline}},b}(t)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],232:[function(C,D,T){"use strict";(function(){var A=function(f,p){return function(){return f.apply(p,arguments)}},O={}.hasOwnProperty;D.exports=function(){function f(p){this.assertLegalChar=A(this.assertLegalChar,this);var c,s,n;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,s=p.stringify||{};for(c in s)O.call(s,c)&&(n=s[c],this[c]=n)}return f.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},f.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},f.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]>"),this.assertLegalChar(p)},f.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},f.prototype.raw=function(p){return""+p||""},f.prototype.attName=function(p){return p=""+p||""},f.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},f.prototype.insTarget=function(p){return""+p||""},f.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},f.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},f.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},f.prototype.xmlStandalone=function(p){return p?"yes":"no"},f.prototype.dtdPubID=function(p){return""+p||""},f.prototype.dtdSysID=function(p){return""+p||""},f.prototype.dtdElementValue=function(p){return""+p||""},f.prototype.dtdAttType=function(p){return""+p||""},f.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},f.prototype.dtdEntityValue=function(p){return""+p||""},f.prototype.dtdNData=function(p){return""+p||""},f.prototype.convertAttKey="@",f.prototype.convertPIKey="?",f.prototype.convertTextKey="#text",f.prototype.convertCDataKey="#cdata",f.prototype.convertCommentKey="#comment",f.prototype.convertRawKey="#raw",f.prototype.assertLegalChar=function(p){var c;if(c=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+c.index);return p},f.prototype.elEscape=function(p){var c;return c=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(c,"&").replace(//g,">").replace(/\r/g," ")},f.prototype.attEscape=function(p){var c;return c=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(c,"&").replace(/0?new Array(p).join(this.indent):""):""},O}()}).call(void 0)},{}],235:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n;n=C("./Utility"),c=n.assign,s=n.isFunction,A=C("./XMLDocument"),O=C("./XMLDocumentCB"),p=C("./XMLStringWriter"),f=C("./XMLStreamWriter"),D.exports.create=function(o,r,l,a){var i,t;if(o==null)throw new Error("Root element needs a name");return a=c({},r,l,a),i=new A(a),t=i.element(o),a.headless||(i.declaration(a),a.pubID==null&&a.sysID==null||i.doctype(a)),t},D.exports.begin=function(o,r,l){var a;return s(o)&&(a=[o,r],r=a[0],l=a[1],o={}),r?new O(o,r,l):new A(o)},D.exports.stringWriter=function(o){return new p(o)},D.exports.streamWriter=function(o,r){return new f(o,r)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(C,D,T){function A(){for(var f={},p=0;pr?i=a(i):i.length>5]|=128<>>9<<4)]=a;for(var i=1732584193,t=-271733879,d=-1732584194,v=271733878,y=0;y>16)+(a>>16)+(i>>16)<<16|65535&i}function o(l,a){return l<>>32-a}var r=C("./helpers");D.exports=function(l){return r.hash(l,A,16)}},{"./helpers":238}],240:[function(C,D,T){"use strict";function A(n,o){n[o>>5]|=128<<24-o%32,n[15+(o+64>>9<<4)]=o;for(var r=Array(80),l=1732584193,a=-271733879,i=-1732584194,t=271733878,d=-1009589776,v=0;v>16)+(o>>16)+(r>>16)<<16|65535&r}function c(n,o){return n<>>32-o}var s=C("./helpers");D.exports=function(n){return s.hash(n,A,20,!0)}},{"./helpers":238}],241:[function(C,D,T){"use strict";var A=C("./helpers"),O=function(i,t){var d=(65535&i)+(65535&t);return(i>>16)+(t>>16)+(d>>16)<<16|65535&d},f=function(i,t){return i>>>t|i<<32-t},p=function(i,t){return i>>>t},c=function(i,t,d){return i&t^~i&d},s=function(i,t,d){return i&t^i&d^t&d},n=function(i){return f(i,2)^f(i,13)^f(i,22)},o=function(i){return f(i,6)^f(i,11)^f(i,25)},r=function(i){return f(i,7)^f(i,18)^p(i,3)},l=function(i){return f(i,17)^f(i,19)^p(i,10)},a=function(i,t){var d,v,y,b,g,m,_,x,h,E,S,w,R=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),N=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),F=new Array(64);i[t>>5]|=128<<24-t%32,i[15+(t+64>>9<<4)]=t;for(var h=0;h=0)return v("Request#%d %s: got digest auth header WWW-Authenticate: %s",G,x,Ce),h.headers=h.headers||{},h.headers.Authorization=digestAuthHeader(_e.method,_e.path,Ce,h.digestAuth),v("Request#%d %s: auth with digest header: %s",G,x,h.headers.Authorization),Ue.headers["set-cookie"]&&(h.headers.Cookie=Ue.headers["set-cookie"].join(";")),T.requestWithCallback(x,h,ke)}var Pe=Date.now()-Z;Ne&&(Ne.contentDownload=Pe),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Pe,$,Q,_e.method,_e.host,_e.path,ee,Ne);var Le={status:Q,statusCode:Q,headers:be,size:$,aborted:xe,rt:Pe,keepAliveSocket:ee,data:je,requestUrls:h.requestUrls,timing:Ne,remoteAddress:De,remotePort:dt};if(Ye){var Ve="";we&&typeof we.getCurrentStatus=="function"&&(Ve=", agent status: "+(0,o.default)(we.getCurrentStatus())),Ye.message+=", "+_e.method+" "+x+" "+Q+" (connected: "+j+", keepalive socket: "+ee+Ve+`) headers: `+(0,o.default)(be),Ye.data=je,Ye.path=_e.path,Ye.status=Q,Ye.headers=be,Ye.res=Le}ke(Ye,je,h.streaming?Ue:Le),h.emitter&&(J.url=x,J.socket=qe&&qe.connection,J.options=_e,J.size=We,h.emitter.emit("response",{requestId:G,error:Ye,ctx:h.ctx,req:J,res:Le}))}function N(Ye){var je=null;if(h.followRedirect&&statuses.redirect[Ye.statusCode]){h._followRedirectCount=(h._followRedirectCount||0)+1;var Ue=Ye.headers.location;if(Ue){if(!(h._followRedirectCount>h.maxRedirects)){var ke=h.formatRedirectUrl?h.formatRedirectUrl(x,Ue):i.resolve(x,Ue);v("Request#%d %s: `redirected` from %s to %s",G,_e.path,x,ke),w(),h.headers&&h.headers.Host&&m.test(Ue)&&(h.headers.Host=null);var be=E;return E=null,T.requestWithCallback(ke,h,be),{redirect:!0,error:null}}je=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+x),je.name="MaxRedirectError"}else je=new Error("Got statusCode "+Ye.statusCode+" but cannot resolve next location from headers"),je.name="FollowRedirectError"}return{redirect:!1,error:je}}function F(Ye,je,Ue){return Ue(null,je,Ye.headers["content-encoding"])}function z(Ye){if(Ne&&(Ne.waiting=Date.now()-Z),v("Request#%d %s `req response` event emit: status %d, headers: %j",G,x,Ye.statusCode,Ye.headers),h.streaming){var je=N(Ye);return je.redirect?void Ye.resume():je.error?(Ye.resume(),R(je.error,null,Ye)):R(null,null,Ye)}if(Ye.on("close",function(){v("Request#%d %s: `res close` event emit, total size %d",G,x,$)}),Ye.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",G,x,$)}),Ye.on("aborted",function(){xe=!0,v("Request#%d %s: `res aborted` event emit, total size %d",G,x,$)}),Be){var je=N(Ye);return je.redirect?void Ye.resume():je.error?(Ye.resume(),Be.end(),R(je.error,null,Ye)):(h.consumeWriteStream===!1?Ye.on("end",R.bind(null,null,null,Ye)):isNode010||isNode012?first([[Be,"close"],[Ye,"aborted"]],function(be,Ce,Pe){v("Request#%d %s: writeStream or res %s event emitted",G,x,Pe),R(P||null,null,Ye)}):Be.on("close",function(){v("Request#%d %s: writeStream close event emitted",G,x),R(P||null,null,Ye)}),Ye.pipe(Be))}var Ue=[];Ye.on("data",function(ke){v("Request#%d %s: `res data` event emit, size %d",G,x,ke.length),$+=ke.length,Ue.push(ke)}),Ye.on("end",function(){var ke=O.concat(Ue,$);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",G,x,$,Ye._dumped),P)return R(P,ke,Ye);var be=N(Ye);if(be.error)return R(be.error,ke,Ye);be.redirect||F(Ye,ke,function(Ce,Pe,Le){if(Ce)return R(Ce,ke,Ye);if(!Le&&_.indexOf(h.dataType)>=0){try{Pe=decodeBodyByCharset(Pe,Ye)}catch(at){return v("decodeBodyByCharset error: %s",at),R(null,Pe,Ye)}if(h.dataType==="json")if($===0)Pe=null;else{var Ve=parseJSON(Pe,Ie);Ve.error?Ce=Ve.error:Pe=Ve.data}}xe&&v("Request#%d %s: Remote socket was terminated before `response.end()` was called",G,x),R(Ce,Pe,Ye)})})}function q(){v("Response timer ticking, timeout: %d",lt),re=setTimeout(function(){re=null;var Ye="Response timeout for "+lt+"ms";P=new Error(Ye),P.name="ResponseTimeoutError",P.requestId=G,v("ResponseTimeout: Request#%d %s %s: %s, connected: %s",G,x,P.name,Ye,j),B()},lt)}function B(){v("Request#%d %s abort, connected: %s",G,x,j),qe.socket||(P.noSocket=!0,R(P)),qe.abort()}if(!x||typeof x!="string"&&(x===void 0?"undefined":(0,l.default)(x))!=="object"){var M=a.format("expect request url to be a string or a http request options, but got %j",x);throw new Error(M)}arguments.length===2&&typeof h=="function"&&(E=h,h=null),h=h||{},b>=g&&(b=0);var G=++b;h.requestUrls=h.requestUrls||[];var J={requestId:G,url:x,args:h,ctx:h.ctx};h.emitter&&h.emitter.emit("request",J),h.timeout=h.timeout||T.TIMEOUTS,h.maxRedirects=h.maxRedirects||10,h.streaming=h.streaming||h.customResponse;var K,Z=Date.now();typeof x=="string"?(m.test(x)||(x="http://"+x),K=i.parse(x)):K=x;var le=(h.type||h.method||K.method||"GET").toUpperCase(),de=K.port||80,Te=t,we=p(h.agent,T.agent),Ie=h.fixJSONCtlChars;K.protocol==="https:"&&(Te=d,we=p(h.httpsAgent,T.httpsAgent),K.port||(de=443));var _e={host:K.hostname||K.host||"localhost",path:K.path||"/",method:le,port:de,agent:we,headers:h.headers||{},lookup:h.lookup};Array.isArray(h.timeout)?_e.requestTimeout=h.timeout[h.timeout.length-1]:h.timeout!==void 0&&(_e.requestTimeout=h.timeout);for(var ye=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ke=0;Ke>>2]>>>24-m%4*8&255;v[b+m>>>2]|=_<<24-(b+m)%4*8}else for(var m=0;m>>2]=y[m>>>2];return this.sigBytes+=g,this},clamp:function(){var d=this.words,v=this.sigBytes;d[v>>>2]&=4294967295<<32-v%4*8,d.length=A.ceil(v/4)},clone:function(){var d=s.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var v,y=[],b=0;b>16)&x,m=18e3*(65535&m)+(m>>16)&x;var h=(_<<16)+m&x;return h/=4294967296,(h+=.5)*(A.random()>.5?1:-1)}}(4294967296*(v||A.random()));v=987654071*g(),y.push(4294967296*g()|0)}return new n.init(y,d)}}),o=p.enc={},r=o.Hex={stringify:function(d){for(var v=d.words,y=d.sigBytes,b=[],g=0;g>>2]>>>24-g%4*8&255;b.push((m>>>4).toString(16)),b.push((15&m).toString(16))}return b.join("")},parse:function(d){for(var v=d.length,y=[],b=0;b>>3]|=parseInt(d.substr(b,2),16)<<24-b%8*4;return new n.init(y,v/2)}},l=o.Latin1={stringify:function(d){for(var v=d.words,y=d.sigBytes,b=[],g=0;g>>2]>>>24-g%4*8&255;b.push(String.fromCharCode(m))}return b.join("")},parse:function(d){for(var v=d.length,y=[],b=0;b>>2]|=(255&d.charCodeAt(b))<<24-b%4*8;return new n.init(y,v)}},a=o.Utf8={stringify:function(d){try{return decodeURIComponent(escape(l.stringify(d)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(d){return l.parse(unescape(encodeURIComponent(d)))}},i=c.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new n.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=a.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var v=this._data,y=v.words,b=v.sigBytes,g=this.blockSize,m=4*g,_=b/m;_=d?A.ceil(_):A.max((0|_)-this._minBufferSize,0);var x=_*g,h=A.min(4*x,b);if(x){for(var E=0;E",s[0];)p++;return p>4&&p}},{key:"extend",value:function(p,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&c[s]&&(p[s]=c[s])}},{key:"isArray",value:function(p){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(p){return p=p.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(p)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(p)?"audio":/.bmp|.jpg|.jpeg|.png/.test(p)?"img":"other"}},{key:"isImage",value:function(p){return p=p.toLowerCase(),!!/.jpg|.jpeg|.png/.test(p)}},{key:"ISODateString",value:function(p){function c(s){return s<10?"0"+s:s}return p.getUTCFullYear()+"-"+c(p.getUTCMonth()+1)+"-"+c(p.getUTCDate())+"T"+c(p.getUTCHours())+":"+c(p.getUTCMinutes())+":"+c(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),f}();C.default=O},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return function(A){function O(t,d,v,y,b,g,m){var _=t+(d&v|~d&y)+b+m;return(_<>>32-g)+d}function f(t,d,v,y,b,g,m){var _=t+(d&y|v&~y)+b+m;return(_<>>32-g)+d}function p(t,d,v,y,b,g,m){var _=t+(d^v^y)+b+m;return(_<>>32-g)+d}function c(t,d,v,y,b,g,m){var _=t+(v^(d|~y))+b+m;return(_<>>32-g)+d}var s=T,n=s.lib,o=n.WordArray,r=n.Hasher,l=s.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*A.abs(A.sin(t+1))|0}();var i=l.MD5=r.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,d){for(var v=0;v<16;v++){var y=d+v,b=t[y];t[y]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8)}var g=this._hash.words,m=t[d+0],_=t[d+1],x=t[d+2],h=t[d+3],E=t[d+4],S=t[d+5],w=t[d+6],R=t[d+7],N=t[d+8],F=t[d+9],z=t[d+10],q=t[d+11],B=t[d+12],M=t[d+13],G=t[d+14],J=t[d+15],K=g[0],Z=g[1],le=g[2],de=g[3];K=O(K,Z,le,de,m,7,a[0]),de=O(de,K,Z,le,_,12,a[1]),le=O(le,de,K,Z,x,17,a[2]),Z=O(Z,le,de,K,h,22,a[3]),K=O(K,Z,le,de,E,7,a[4]),de=O(de,K,Z,le,S,12,a[5]),le=O(le,de,K,Z,w,17,a[6]),Z=O(Z,le,de,K,R,22,a[7]),K=O(K,Z,le,de,N,7,a[8]),de=O(de,K,Z,le,F,12,a[9]),le=O(le,de,K,Z,z,17,a[10]),Z=O(Z,le,de,K,q,22,a[11]),K=O(K,Z,le,de,B,7,a[12]),de=O(de,K,Z,le,M,12,a[13]),le=O(le,de,K,Z,G,17,a[14]),Z=O(Z,le,de,K,J,22,a[15]),K=f(K,Z,le,de,_,5,a[16]),de=f(de,K,Z,le,w,9,a[17]),le=f(le,de,K,Z,q,14,a[18]),Z=f(Z,le,de,K,m,20,a[19]),K=f(K,Z,le,de,S,5,a[20]),de=f(de,K,Z,le,z,9,a[21]),le=f(le,de,K,Z,J,14,a[22]),Z=f(Z,le,de,K,E,20,a[23]),K=f(K,Z,le,de,F,5,a[24]),de=f(de,K,Z,le,G,9,a[25]),le=f(le,de,K,Z,h,14,a[26]),Z=f(Z,le,de,K,N,20,a[27]),K=f(K,Z,le,de,M,5,a[28]),de=f(de,K,Z,le,x,9,a[29]),le=f(le,de,K,Z,R,14,a[30]),Z=f(Z,le,de,K,B,20,a[31]),K=p(K,Z,le,de,S,4,a[32]),de=p(de,K,Z,le,N,11,a[33]),le=p(le,de,K,Z,q,16,a[34]),Z=p(Z,le,de,K,G,23,a[35]),K=p(K,Z,le,de,_,4,a[36]),de=p(de,K,Z,le,E,11,a[37]),le=p(le,de,K,Z,R,16,a[38]),Z=p(Z,le,de,K,z,23,a[39]),K=p(K,Z,le,de,M,4,a[40]),de=p(de,K,Z,le,m,11,a[41]),le=p(le,de,K,Z,h,16,a[42]),Z=p(Z,le,de,K,w,23,a[43]),K=p(K,Z,le,de,F,4,a[44]),de=p(de,K,Z,le,B,11,a[45]),le=p(le,de,K,Z,J,16,a[46]),Z=p(Z,le,de,K,x,23,a[47]),K=c(K,Z,le,de,m,6,a[48]),de=c(de,K,Z,le,R,10,a[49]),le=c(le,de,K,Z,G,15,a[50]),Z=c(Z,le,de,K,S,21,a[51]),K=c(K,Z,le,de,B,6,a[52]),de=c(de,K,Z,le,h,10,a[53]),le=c(le,de,K,Z,z,15,a[54]),Z=c(Z,le,de,K,_,21,a[55]),K=c(K,Z,le,de,N,6,a[56]),de=c(de,K,Z,le,J,10,a[57]),le=c(le,de,K,Z,w,15,a[58]),Z=c(Z,le,de,K,M,21,a[59]),K=c(K,Z,le,de,E,6,a[60]),de=c(de,K,Z,le,q,10,a[61]),le=c(le,de,K,Z,x,15,a[62]),Z=c(Z,le,de,K,F,21,a[63]),g[0]=g[0]+K|0,g[1]=g[1]+Z|0,g[2]=g[2]+le|0,g[3]=g[3]+de|0},_doFinalize:function(){var t=this._data,d=t.words,v=8*this._nDataBytes,y=8*t.sigBytes;d[y>>>5]|=128<<24-y%32;var b=A.floor(v/4294967296),g=v;d[15+(y+64>>>9<<4)]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),d[14+(y+64>>>9<<4)]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),t.sigBytes=4*(d.length+1),this._process();for(var m=this._hash,_=m.words,x=0;x<4;x++){var h=_[x];_[x]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return m},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});s.MD5=r._createHelper(i),s.HmacMD5=r._createHmacHelper(i)}(Math),T.MD5})},function(W,C,D){"use strict";Object.defineProperty(C,"__esModule",{value:!0}),C.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},C.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},C.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(W,C,D){"use strict";function T(i){return i&&i.__esModule?i:{default:i}}function A(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function i(t,d){for(var v=0;v-1)return"Baiduspider";if(o.indexOf("PlayStation")>-1)return"PS4";var l=navigator.platform=="Win32"||navigator.platform=="Windows"||o.indexOf("Windows")>-1,a=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return a&&(r="macOS"),navigator.platform=="X11"&&!l&&!a&&(r="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(r="Linux"),l?"windows":r},f=function(){var n=navigator.userAgent,o="";return(n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1)&&(o="2000"),(n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1)&&(o="XP"),(n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1)&&(o="2003"),(n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1)&&(o="Vista"),(n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1)&&(o="7"),(n.indexOf("Windows NT 6.2")>-1||n.indexOf("Windows 8")>-1)&&(o="8"),(n.indexOf("Windows NT 6.3")>-1||n.indexOf("Windows 8.1")>-1)&&(o="8.1"),(n.indexOf("Windows NT 10")>-1||n.indexOf("Windows 10")>-1)&&(o="10"),o},p=function(n){var o=navigator.userAgent.toLowerCase();return n.chrome?"Chrome":n.firefox?"Firefox":n.safari?"Safari":n.webview?"webview":n.ie?/edge/.test(o)?"Edge":"IE":/baiduspider/.test(o)?"Baiduspider":/ucweb/.test(o)||/UCBrowser/.test(o)?"UC":/opera/.test(o)?"Opera":/ucweb/.test(o)?"UC":/360se/.test(o)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(o)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(o)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(o)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(o)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(o)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(o)?"PS4\u6D4F\u89C8\u5668":void 0},c=function(){var n={},o={},r=navigator.userAgent,l=navigator.platform,a=r.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=r.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!r.match(/\(Macintosh\; Intel /),d=r.match(/(iPad).*OS\s([\d_]+)/),v=r.match(/(iPod)(.*OS\s([\d_]+))?/),y=!d&&r.match(/(iPhone\sOS)\s([\d_]+)/),b=r.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),g=/Win\d{2}|Windows/.test(l),m=r.match(/Windows Phone ([\d.]+)/),_=b&&r.match(/TouchPad/),x=r.match(/Kindle\/([\d.]+)/),h=r.match(/Silk\/([\d._]+)/),E=r.match(/(BlackBerry).*Version\/([\d.]+)/),S=r.match(/(BB10).*Version\/([\d.]+)/),w=r.match(/(RIM\sTablet\sOS)\s([\d.]+)/),R=r.match(/PlayBook/),N=r.match(/Chrome\/([\d.]+)/)||r.match(/CriOS\/([\d.]+)/),F=r.match(/Firefox\/([\d.]+)/),z=r.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),q=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),B=!N&&r.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),M=B||r.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((o.webkit=!!a)&&(o.version=a[1]),i&&(n.android=!0,n.version=i[2]),y&&!v&&(n.ios=n.iphone=!0,n.version=y[2].replace(/_/g,".")),d&&(n.ios=n.ipad=!0,n.version=d[2].replace(/_/g,".")),v&&(n.ios=n.ipod=!0,n.version=v[3]?v[3].replace(/_/g,"."):null),m&&(n.wp=!0,n.version=m[1]),b&&(n.webos=!0,n.version=b[2]),_&&(n.touchpad=!0),E&&(n.blackberry=!0,n.version=E[2]),S&&(n.bb10=!0,n.version=S[2]),w&&(n.rimtabletos=!0,n.version=w[2]),R&&(o.playbook=!0),x&&(n.kindle=!0,n.version=x[1]),h&&(o.silk=!0,o.version=h[1]),!h&&n.android&&r.match(/Kindle Fire/)&&(o.silk=!0),N&&(o.chrome=!0,o.version=N[1]),F&&(o.firefox=!0,o.version=F[1]),z&&(n.firefoxos=!0,n.version=z[1]),q&&(o.ie=!0,o.version=q[1]),M&&(t||n.ios||g||i)&&(o.safari=!0,n.ios||(o.version=M[1])),B&&(o.webview=!0),t){var G=r.match(/[\d]*_[\d]*_[\d]*/);G&&G.length>0&&G[0]&&(n.version=G[0].replace(/_/g,"."))}return n.tablet=!!(d||R||i&&!r.match(/Mobile/)||F&&r.match(/Tablet/)||q&&!r.match(/Phone/)&&r.match(/Touch/)),n.phone=!(n.tablet||n.ipod||!(i||y||b||E||S||N&&r.match(/Android/)||N&&r.match(/CriOS\/([\d.]+)/)||F&&r.match(/Mobile/)||q&&r.match(/Touch/))),n.pc=!n.tablet&&!n.phone,t?n.name="macOS":g?(n.name="windows",n.version=f()):n.name=O(n),o.name=p(o),{os:n,browser:o}}(),s=function(){function n(){T(this,n)}return A(n,null,[{key:"getHost",value:function(o){var r="";if(o===void 0||o==null||o=="")return"";var l=o.indexOf("//"),a=o;l>-1&&(a=o.substring(l+2));var r=a,i=a.split("/");return i&&i.length>0&&(r=i[0]),i=r.split(":"),i&&i.length>0&&(r=i[0]),r}},{key:"os",get:function(){return c.os}},{key:"browser",get:function(){var o=c.browser;return o.name||(o.name=p()),o}}]),n}();C.default=s},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s0){G._invalidUserId=!0;var le=Z.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(le)}}catch(de){console.log(de)}})})}z&&(M.videoInfo=z?JSON.parse(z).Vod:{},M.userData=o.default.encode(z)),M.ri=y.default.create(),this._uploadList.push(M),this._reportLog("20001",M,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(M)}catch(J){console.log(J)}return!0}},{key:"deleteFile",value:function(w){return!!this.cancelFile(w)&&(this._uploadList.splice(w,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(w){if(this.options,w<0||w>=this._uploadList.length)return!1;var R=this._uploadList[w];if(w==this._curIndex&&R.state==f.UPLOADSTATE.UPLOADING){R.state=f.UPLOADSTATE.CANCELED;var N=this._getCheckoutpoint(R);N&&N.checkpoint&&(N=N.checkpoint),N&&this._ossUpload.abort(R),this._removeCheckoutpoint(R),this.nextUpload()}else R.state!=f.UPLOADSTATE.SUCCESS&&(R.state=f.UPLOADSTATE.CANCELED);return this._reportLog("20008",R),!0}},{key:"resumeFile",value:function(w){if(this.options,w<0||w>=this._uploadList.length)return!1;var R=this._uploadList[w];return R.state==f.UPLOADSTATE.CANCELED&&(R.state=f.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(w){return this._getCheckoutpoint({file:w})}},{key:"startUpload",value:function(w){if(this._retryCount=0,this.options,this._state==f.VODSTATE.START||this._state==f.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=f.VODSTATE.END);var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R),this._state=f.VODSTATE.START}},{key:"nextUpload",value:function(){var w=this.options;if(this._state==f.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R)}else{this._state=f.VODSTATE.END;try{w.onUploadEnd&&w.onUploadEnd(R)}catch(N){console.log(N)}}}},{key:"clear",value:function(w){for(var R=this.options,N=0,F=0;Fthis._curIndex&&(z=this._uploadList[this._curIndex]),z&&(this.init(w,R,N,F),this._state=f.VODSTATE.START,this._ossUpload=null,this._uploadCore(z,z.retry),z.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(w,R,N){if(this._curIndex==-1)return!1;if(this._state!=f.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var F=this._uploadList[this._curIndex];F.object?this._refreshSTSTokenUpload(F,w,R,N):this.setSTSToken(F,w,R,N)}}},{key:"setSTSTokenDirectlyUpload",value:function(w,R,N,F,z){if(!(R&&N&&F&&z))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var q=w;this.init(R,N,F,z),q.endpoint=q._endpoint,q.bucket=q._bucket,q.object=q._object,this._ossUpload=null,this._uploadCore(q,w.retry),w.retry=!1}},{key:"setSTSToken",value:function(w,R,N,F){if(!R||!N||!F)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var z=w.videoInfo,q={accessKeyId:R,securityToken:F,accessKeySecret:N,fileName:w.file.name,title:z.Title,requestId:w.ri,region:this.options.region};z.ImageType&&(q.imageType=z.ImageType),z.ImageExt&&(q.imageExt=z.ImageExt),z.FileSize&&(q.fileSize=z.FileSize),z.Description&&(q.description=z.Description),z.CateId&&(q.cateId=z.CateId),z.Tags&&(q.tags=z.Tags),z.TemplateGroupId&&(q.templateGroupId=z.TemplateGroupId),z.StorageLocation&&(q.storageLocation=z.StorageLocation),z.CoverURL&&(q.coverUrl=z.CoverURL),z.TransCodeMode&&(q.transCodeMode=z.TransCodeMode),z.UserData&&(q.userData=z.UserData);var B=this,M="getUploadAuth";w.videoId?(q.videoId=w.videoId,M="refreshUploadAuth"):w.isImage&&(M="getImageUploadAuth"),g.default[M](q,function(G){w.videoId=G.VideoId?G.VideoId:w.videoId,B.setUploadAuthAndAddress(w,G.UploadAuth,G.UploadAddress),B._state=f.VODSTATE.START},function(G){B._error(w,{name:G.Code,code:G.Code,message:G.Message,requestId:G.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(w,R,N,F){if(!w||!R||!N)return!1;var z=JSON.parse(o.default.decode(R));if(!(z.AccessKeyId&&z.AccessKeySecret&&z.SecurityToken&&z.Expiration))return console.error("uploadauth is invalid"),!1;var q={},B=w;if(N){if(q=JSON.parse(o.default.decode(N)),!q.Endpoint||!q.Bucket||!q.FileName)return console.error("uploadAddress is invalid"),!1}else q.Endpoint=B.endpoint,q.Bucket=B.bucket,q.FileName=B.object;this._ut="vod",this._uploadWay="vod",this.options.region=z.Region||this.options.region,this.init(z.AccessKeyId,z.AccessKeySecret,z.SecurityToken,z.Expiration),B.endpoint=B._endpoint?B._endpoint:q.Endpoint,B.bucket=B._bucket?B._bucket:q.Bucket,B.object=B._object?B._object:q.FileName,B.region=this.options.region,F&&(B.videoId=F),this._ossUpload=null,this._uploadCore(B,w.retry),w.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(w,R,N,F){if(!R||!N||!F)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var z={accessKeyId:R,securityToken:F,accessKeySecret:N,videoId:w.object,requestId:w.ri,region:this.options.region},q=this,B="refreshUploadAuth";w.isImage&&(B="getImageUploadAuth"),g.default[B](z,function(M){q.setUploadAuthAndAddress(w,M.UploadAuth,UploadAddress),q._state=f.VODSTATE.START},function(M){q._error(w,{name:M.Code,code:M.Code,message:M.Message,requestId:M.RequestId})})}},{key:"_upload",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0&&arguments[1],N=this.options;if(w.retry=R,N.onUploadstarted&&!R)try{var F=this._getCheckoutpoint(w);F&&F.state!=f.UPLOADSTATE.UPLOADING&&(w.checkpoint=F,w.videoId=F.videoId),N.onUploadstarted(w)}catch(z){console.log(z)}}},{key:"_uploadCore",value:function(w){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1],!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId\u3001AccessKeySecret\u3001securityToken should not be null");if(w.state=f.UPLOADSTATE.UPLOADING,!this._ossUpload){w.endpoint=w.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var R=this;this._ossUpload=new s.default({bucket:w.bucket,endpoint:w.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(G,J){R._error.call(R,G,J)},oncomplete:function(G,J){R._complete.call(R,G,J)},onprogress:function(G,J,K){R._progress.call(R,G,J,K)}})}var N=d.default.getFileType(w.file.name),F=this._getCheckoutpoint(w),z="",q="";F&&F.checkpoint&&(q=F.state,z=F.videoId,F=F.checkpoint),F&&z==w.videoId&&q!=f.UPLOADSTATE.UPLOADING&&(F.file=w.file,w.checkpoint=F,F.uploadId);var B=this._adjustPartSize(w);this._reportLog("20002",w,{ft:N,fs:w.file.size,bu:w.bucket,ok:w.object,vid:w.videoId||"",fn:w.file.name,fw:null,fh:null,ps:B});var M={headers:{"x-oss-notification":w.userData?w.userData:""},partSize:B,parallel:this.options.parallel};this._ossUpload.upload(w,M)}},{key:"_findUploadIndex",value:function(){for(var w=-1,R=0;R0||R.name=="SignatureDoesNotMatchError"||R.code=="SecurityTokenExpired"||R.code=="InvalidSecurityToken.Expired"||R.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=f.VODSTATE.EXPIRE,w.state=f.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(w,R)}catch(F){console.log(F)}}return}if((R.name=="RequestTimeoutError"||R.name=="ConnectionTimeout"||R.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var N=this;return setTimeout(function(){N._uploadCore(w,!0)},1e3*N._retryDuration),void this._retryCount++}R.name=="NoSuchUploadError"&&this._removeCheckoutpoint(w),this._handleError(w,R)}}},{key:"_handleError",value:function(w,R){var N=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],F=f.UPLOADSTATE.FAIlURE;if(w.state!=f.UPLOADSTATE.CANCELED&&(w.state=f.UPLOADSTATE.FAIlURE,this._state=f.VODSTATE.FAILURE,this.options.onUploadFailed&&R&&R.code&&R.message))try{this.options.onUploadFailed(w,R.code,R.message)}catch(q){console.log(q)}if(N&&this._changeState(w,F),this._reportLog("20006",w,{code:R.name,message:R.message,requestId:R.requestId,fs:w.file.size,bu:w.bucket,ok:w.object,fn:w.file.name}),this._reportLog("20004",w,{requestId:R.requestId,fs:w.file.size,bu:w.bucket,ok:w.object,fn:w.file.name}),w.ri=y.default.create(),this._findUploadIndex()!=-1){var z=this;this._state=f.VODSTATE.START,setTimeout(function(){z.nextUpload()},100)}}},{key:"_complete",value:function(w,R){if(w.state=f.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(w)}catch(z){console.log(z)}var N=0;R&&R.res&&R.res.headers&&(N=R.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(w);var F=this;setTimeout(function(){F.nextUpload()},100),this._retryCount=0,this._reportLog("20003",w,{requestId:N})}},{key:"_progress",value:function(w,R,N){if(this.options.onUploadProgress)try{w.loaded=R.loaded,this.options.onUploadProgress(w,R.total,R.loaded)}catch(J){console.log(J)}var F=R.checkpoint,z=0;F&&(w.checkpoint=F,this._saveCheckoutpoint(w,F,f.UPLOADSTATE.UPLOADING),z=F.uploadId),this._retryCount=0;var q=this._getPortNumber(F),B=0;if(N&&N.headers&&(B=N.headers["x-oss-request-id"]),R.loaded!=0&&this._reportLog("20007",w,{pn:q,requestId:B}),R.loaded!=1&&this._reportLog("20005",w,{UploadId:z,pn:q+1,pr:w.retry?1:0,fs:w.file.size,bu:w.bucket,ok:w.object,fn:w.file.name}),!this._invalidUserId&&!w.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var M={file:w.file,checkpoint:R,userId:this.options.userId,videoId:w.videoId,region:this.options.region,fileHash:w.fileHash};try{var G=this;_.default.upload(M,function(){},function(J){if((J=JSON.parse(J))&&J.Code=="InvalidParameter"&&J.Message.indexOf("UserId")>0){G._invalidUserId=!0;var K=J.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(K)}})}catch(J){console.log(J)}}}},{key:"_getPortNumber",value:function(w){if(w){var R=w.doneParts;if(R&&R.length>0)return R[R.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(w){var R=this._getCheckoutpointKey(w);l.default.remove(R)}},{key:"_getCheckoutpoint",value:function(w){var R=this._getCheckoutpointKey(w),N=l.default.get(R);if(N)try{return JSON.parse(N)}catch(F){}return""}},{key:"_saveCheckoutpoint",value:function(w,R,N){if(R){var F=this._getCheckoutpointKey(w),z=w.file,q={fileName:z.name,lastModified:z.lastModified,size:z.size,object:w.object,videoId:w.videoId,bucket:w.bucket,endpoint:w.endpoint,checkpoint:R,loaded:w.loaded,state:N};l.default.set(F,JSON.stringify(q))}}},{key:"_changeState",value:function(w,R){var N=this._getCheckoutpoint(w);N&&((this._onbeforeunload=!0)&&(R=f.UPLOADSTATE.STOPED),this._saveCheckoutpoint(w,N.checkpoint,R))}},{key:"_getCheckoutpointKey",value:function(w){return"upload_"+w.file.lastModified+"_"+w.file.name+"_"+w.file.size}},{key:"_getCheckoutpointFromCloud",value:function(w,R,N){var F={userId:this.options.userId,uploadInfoList:[{FileName:w.file.name,FileSize:w.file.size,FileCreateTime:w.file.lastModified,FileHash:w.fileHash}],region:this.options.region};_.default.get(F,function(z){R(z)},N)}},{key:"_reportLog",value:function(w,R,N){N||(N={}),N.ri=R.ri,this._ut&&(N.ut=this._ut),this._log.log(w,N)}},{key:"_initEvent",value:function(){var w=this;window&&(window.onbeforeunload=function(R){if(w._onbeforeunload=!0,w._curIndex!=-1&&w._uploadList.length>w._curIndex){var N=w._uploadList[w._curIndex];w._changeState(N,f.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var w=0;w1e4?w.file.size/9999:this.options.partSize}}]),S}());C.default=E},function(W,C,D){"use strict";Object.defineProperty(C,"__esModule",{value:!0}),C.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},C.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(W,C,D){"use strict";function T(n){return n&&n.__esModule?n:{default:n}}function A(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function n(o,r){for(var l=0;l=A())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A().toString(16)+" bytes");return 0|re}function t(re){return+re!=re&&(re=0),f.alloc(+re)}function d(re,P){if(f.isBuffer(re))return re.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(re)||re instanceof ArrayBuffer))return re.byteLength;typeof re!="string"&&(re=""+re);var j=re.length;if(j===0)return 0;for(var ee=!1;;)switch(P){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":case void 0:return _e(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*j;case"hex":return j>>>1;case"base64":return Me(re).length;default:if(ee)return _e(re).length;P=(""+P).toLowerCase(),ee=!0}}function v(re,P,j){var ee=!1;if((P===void 0||P<0)&&(P=0),P>this.length)return"";if((j===void 0||j>this.length)&&(j=this.length),j<=0)return"";if(j>>>=0,P>>>=0,j<=P)return"";for(re||(re="utf8");;)switch(re){case"hex":return q(this,P,j);case"utf8":case"utf-8":return R(this,P,j);case"ascii":return F(this,P,j);case"latin1":case"binary":return z(this,P,j);case"base64":return w(this,P,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,P,j);default:if(ee)throw new TypeError("Unknown encoding: "+re);re=(re+"").toLowerCase(),ee=!0}}function y(re,P,j){var ee=re[P];re[P]=re[j],re[j]=ee}function b(re,P,j,ee,$){if(re.length===0)return-1;if(typeof j=="string"?(ee=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,isNaN(j)&&(j=$?0:re.length-1),j<0&&(j=re.length+j),j>=re.length){if($)return-1;j=re.length-1}else if(j<0){if(!$)return-1;j=0}if(typeof P=="string"&&(P=f.from(P,ee)),f.isBuffer(P))return P.length===0?-1:g(re,P,j,ee,$);if(typeof P=="number")return P&=255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(re,P,j):Uint8Array.prototype.lastIndexOf.call(re,P,j):g(re,[P],j,ee,$);throw new TypeError("val must be string, number or Buffer")}function g(re,P,j,ee,$){function Q(qe,Ye){return xe===1?qe[Ye]:qe.readUInt16BE(Ye*xe)}var xe=1,De=re.length,dt=P.length;if(ee!==void 0&&((ee=String(ee).toLowerCase())==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(re.length<2||P.length<2)return-1;xe=2,De/=2,dt/=2,j/=2}var Ne;if($){var Be=-1;for(Ne=j;NeDe&&(j=De-dt),Ne=j;Ne>=0;Ne--){for(var tt=!0,lt=0;lt$&&(ee=$):ee=$;var Q=P.length;if(Q%2!=0)throw new TypeError("Invalid hex string");ee>Q/2&&(ee=Q/2);for(var xe=0;xe239?4:Q>223?3:Q>191?2:1;if($+De<=j){var dt,Ne,Be,tt;switch(De){case 1:Q<128&&(xe=Q);break;case 2:dt=re[$+1],(192&dt)==128&&(tt=(31&Q)<<6|63&dt)>127&&(xe=tt);break;case 3:dt=re[$+1],Ne=re[$+2],(192&dt)==128&&(192&Ne)==128&&(tt=(15&Q)<<12|(63&dt)<<6|63&Ne)>2047&&(tt<55296||tt>57343)&&(xe=tt);break;case 4:dt=re[$+1],Ne=re[$+2],Be=re[$+3],(192&dt)==128&&(192&Ne)==128&&(192&Be)==128&&(tt=(15&Q)<<18|(63&dt)<<12|(63&Ne)<<6|63&Be)>65535&&tt<1114112&&(xe=tt)}}xe===null?(xe=65533,De=1):xe>65535&&(xe-=65536,ee.push(xe>>>10&1023|55296),xe=56320|1023&xe),ee.push(xe),$+=De}return N(ee)}function N(re){var P=re.length;if(P<=He)return String.fromCharCode.apply(String,re);for(var j="",ee=0;eeee)&&(j=ee);for(var $="",Q=P;Qj)throw new RangeError("Trying to access beyond buffer length")}function G(re,P,j,ee,$,Q){if(!f.isBuffer(re))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>$||Pre.length)throw new RangeError("Index out of range")}function J(re,P,j,ee){P<0&&(P=65535+P+1);for(var $=0,Q=Math.min(re.length-j,2);$>>8*(ee?$:1-$)}function K(re,P,j,ee){P<0&&(P=4294967295+P+1);for(var $=0,Q=Math.min(re.length-j,4);$>>8*(ee?$:3-$)&255}function Z(re,P,j,ee,$,Q){if(j+ee>re.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function le(re,P,j,ee,$){return $||Z(re,P,j,4,34028234663852886e22,-34028234663852886e22),me.write(re,P,j,ee,23,4),j+4}function de(re,P,j,ee,$){return $||Z(re,P,j,8,17976931348623157e292,-17976931348623157e292),me.write(re,P,j,ee,52,8),j+8}function Te(re){if(re=we(re).replace(it,""),re.length<2)return"";for(;re.length%4!=0;)re+="=";return re}function we(re){return re.trim?re.trim():re.replace(/^\s+|\s+$/g,"")}function Ie(re){return re<16?"0"+re.toString(16):re.toString(16)}function _e(re,P){P=P||1/0;for(var j,ee=re.length,$=null,Q=[],xe=0;xe55295&&j<57344){if(!$){if(j>56319){(P-=3)>-1&&Q.push(239,191,189);continue}if(xe+1===ee){(P-=3)>-1&&Q.push(239,191,189);continue}$=j;continue}if(j<56320){(P-=3)>-1&&Q.push(239,191,189),$=j;continue}j=65536+($-55296<<10|j-56320)}else $&&(P-=3)>-1&&Q.push(239,191,189);if($=null,j<128){if((P-=1)<0)break;Q.push(j)}else if(j<2048){if((P-=2)<0)break;Q.push(j>>6|192,63&j|128)}else if(j<65536){if((P-=3)<0)break;Q.push(j>>12|224,j>>6&63|128,63&j|128)}else{if(!(j<1114112))throw new Error("Invalid code point");if((P-=4)<0)break;Q.push(j>>18|240,j>>12&63|128,j>>6&63|128,63&j|128)}}return Q}function ye(re){for(var P=[],j=0;j>8,$=j%256,Q.push($),Q.push(ee);return Q}function Me(re){return Ee.toByteArray(Te(re))}function Fe(re,P,j,ee){for(var $=0;$=P.length||$>=re.length);++$)P[$+j]=re[$];return $}function Ge(re){return re!==re}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var Ee=D(21),me=D(22),We=D(23);C.Buffer=f,C.SlowBuffer=t,C.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=T.TYPED_ARRAY_SUPPORT!==void 0?T.TYPED_ARRAY_SUPPORT:function(){try{var re=new Uint8Array(1);return re.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},re.foo()===42&&typeof re.subarray=="function"&&re.subarray(1,1).byteLength===0}catch(P){return!1}}(),C.kMaxLength=A(),f.poolSize=8192,f._augment=function(re){return re.__proto__=f.prototype,re},f.from=function(re,P,j){return p(null,re,P,j)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(re,P,j){return s(null,re,P,j)},f.allocUnsafe=function(re){return n(null,re)},f.allocUnsafeSlow=function(re){return n(null,re)},f.isBuffer=function(re){return!(re==null||!re._isBuffer)},f.compare=function(re,P){if(!f.isBuffer(re)||!f.isBuffer(P))throw new TypeError("Arguments must be Buffers");if(re===P)return 0;for(var j=re.length,ee=P.length,$=0,Q=Math.min(j,ee);$0&&(re=this.toString("hex",0,P).match(/.{2}/g).join(" "),this.length>P&&(re+=" ... ")),""},f.prototype.compare=function(re,P,j,ee,$){if(!f.isBuffer(re))throw new TypeError("Argument must be a Buffer");if(P===void 0&&(P=0),j===void 0&&(j=re?re.length:0),ee===void 0&&(ee=0),$===void 0&&($=this.length),P<0||j>re.length||ee<0||$>this.length)throw new RangeError("out of range index");if(ee>=$&&P>=j)return 0;if(ee>=$)return-1;if(P>=j)return 1;if(P>>>=0,j>>>=0,ee>>>=0,$>>>=0,this===re)return 0;for(var Q=$-ee,xe=j-P,De=Math.min(Q,xe),dt=this.slice(ee,$),Ne=re.slice(P,j),Be=0;Be$)&&(j=$),re.length>0&&(j<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");for(var Q=!1;;)switch(ee){case"hex":return m(this,re,P,j);case"utf8":case"utf-8":return _(this,re,P,j);case"ascii":return x(this,re,P,j);case"latin1":case"binary":return h(this,re,P,j);case"base64":return E(this,re,P,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,re,P,j);default:if(Q)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),Q=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var He=4096;f.prototype.slice=function(re,P){var j=this.length;re=~~re,P=P===void 0?j:~~P,re<0?(re+=j)<0&&(re=0):re>j&&(re=j),P<0?(P+=j)<0&&(P=0):P>j&&(P=j),P0&&($*=256);)ee+=this[re+--P]*$;return ee},f.prototype.readUInt8=function(re,P){return P||M(re,1,this.length),this[re]},f.prototype.readUInt16LE=function(re,P){return P||M(re,2,this.length),this[re]|this[re+1]<<8},f.prototype.readUInt16BE=function(re,P){return P||M(re,2,this.length),this[re]<<8|this[re+1]},f.prototype.readUInt32LE=function(re,P){return P||M(re,4,this.length),(this[re]|this[re+1]<<8|this[re+2]<<16)+16777216*this[re+3]},f.prototype.readUInt32BE=function(re,P){return P||M(re,4,this.length),16777216*this[re]+(this[re+1]<<16|this[re+2]<<8|this[re+3])},f.prototype.readIntLE=function(re,P,j){re|=0,P|=0,j||M(re,P,this.length);for(var ee=this[re],$=1,Q=0;++Q=$&&(ee-=Math.pow(2,8*P)),ee},f.prototype.readIntBE=function(re,P,j){re|=0,P|=0,j||M(re,P,this.length);for(var ee=P,$=1,Q=this[re+--ee];ee>0&&($*=256);)Q+=this[re+--ee]*$;return $*=128,Q>=$&&(Q-=Math.pow(2,8*P)),Q},f.prototype.readInt8=function(re,P){return P||M(re,1,this.length),128&this[re]?-1*(255-this[re]+1):this[re]},f.prototype.readInt16LE=function(re,P){P||M(re,2,this.length);var j=this[re]|this[re+1]<<8;return 32768&j?4294901760|j:j},f.prototype.readInt16BE=function(re,P){P||M(re,2,this.length);var j=this[re+1]|this[re]<<8;return 32768&j?4294901760|j:j},f.prototype.readInt32LE=function(re,P){return P||M(re,4,this.length),this[re]|this[re+1]<<8|this[re+2]<<16|this[re+3]<<24},f.prototype.readInt32BE=function(re,P){return P||M(re,4,this.length),this[re]<<24|this[re+1]<<16|this[re+2]<<8|this[re+3]},f.prototype.readFloatLE=function(re,P){return P||M(re,4,this.length),me.read(this,re,!0,23,4)},f.prototype.readFloatBE=function(re,P){return P||M(re,4,this.length),me.read(this,re,!1,23,4)},f.prototype.readDoubleLE=function(re,P){return P||M(re,8,this.length),me.read(this,re,!0,52,8)},f.prototype.readDoubleBE=function(re,P){return P||M(re,8,this.length),me.read(this,re,!1,52,8)},f.prototype.writeUIntLE=function(re,P,j,ee){(re=+re,P|=0,j|=0,!ee)&&G(this,re,P,j,Math.pow(2,8*j)-1,0);var $=1,Q=0;for(this[P]=255&re;++Q=0&&(Q*=256);)this[P+$]=re/Q&255;return P+j},f.prototype.writeUInt8=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,1,255,0),f.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),this[P]=255&re,P+1},f.prototype.writeUInt16LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[P]=255&re,this[P+1]=re>>>8):J(this,re,P,!0),P+2},f.prototype.writeUInt16BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>8,this[P+1]=255&re):J(this,re,P,!1),P+2},f.prototype.writeUInt32LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[P+3]=re>>>24,this[P+2]=re>>>16,this[P+1]=re>>>8,this[P]=255&re):K(this,re,P,!0),P+4},f.prototype.writeUInt32BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>24,this[P+1]=re>>>16,this[P+2]=re>>>8,this[P+3]=255&re):K(this,re,P,!1),P+4},f.prototype.writeIntLE=function(re,P,j,ee){if(re=+re,P|=0,!ee){var $=Math.pow(2,8*j-1);G(this,re,P,j,$-1,-$)}var Q=0,xe=1,De=0;for(this[P]=255&re;++Q>0)-De&255;return P+j},f.prototype.writeIntBE=function(re,P,j,ee){if(re=+re,P|=0,!ee){var $=Math.pow(2,8*j-1);G(this,re,P,j,$-1,-$)}var Q=j-1,xe=1,De=0;for(this[P+Q]=255&re;--Q>=0&&(xe*=256);)re<0&&De===0&&this[P+Q+1]!==0&&(De=1),this[P+Q]=(re/xe>>0)-De&255;return P+j},f.prototype.writeInt8=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,1,127,-128),f.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),re<0&&(re=255+re+1),this[P]=255&re,P+1},f.prototype.writeInt16LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[P]=255&re,this[P+1]=re>>>8):J(this,re,P,!0),P+2},f.prototype.writeInt16BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>8,this[P+1]=255&re):J(this,re,P,!1),P+2},f.prototype.writeInt32LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[P]=255&re,this[P+1]=re>>>8,this[P+2]=re>>>16,this[P+3]=re>>>24):K(this,re,P,!0),P+4},f.prototype.writeInt32BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,2147483647,-2147483648),re<0&&(re=4294967295+re+1),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>24,this[P+1]=re>>>16,this[P+2]=re>>>8,this[P+3]=255&re):K(this,re,P,!1),P+4},f.prototype.writeFloatLE=function(re,P,j){return le(this,re,P,!0,j)},f.prototype.writeFloatBE=function(re,P,j){return le(this,re,P,!1,j)},f.prototype.writeDoubleLE=function(re,P,j){return de(this,re,P,!0,j)},f.prototype.writeDoubleBE=function(re,P,j){return de(this,re,P,!1,j)},f.prototype.copy=function(re,P,j,ee){if(j||(j=0),ee||ee===0||(ee=this.length),P>=re.length&&(P=re.length),P||(P=0),ee>0&&ee=this.length)throw new RangeError("sourceStart out of bounds");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),re.length-P=0;--$)re[$+P]=this[$+j];else if(Q<1e3||!f.TYPED_ARRAY_SUPPORT)for($=0;$>>=0,j=j===void 0?this.length:j>>>0,re||(re=0);var Q;if(typeof re=="number")for(Q=P;Q0)throw new Error("Invalid string. Length must be a multiple of 4");return i[t-2]==="="?2:i[t-1]==="="?1:0}function A(i){return 3*i.length/4-T(i)}function O(i){var t,d,v,y,b,g=i.length;y=T(i),b=new o(3*g/4-y),d=y>0?g-4:g;var m=0;for(t=0;t>16&255,b[m++]=v>>8&255,b[m++]=255&v;return y===2?(v=n[i.charCodeAt(t)]<<2|n[i.charCodeAt(t+1)]>>4,b[m++]=255&v):y===1&&(v=n[i.charCodeAt(t)]<<10|n[i.charCodeAt(t+1)]<<4|n[i.charCodeAt(t+2)]>>2,b[m++]=v>>8&255,b[m++]=255&v),b}function f(i){return s[i>>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]}function p(i,t,d){for(var v,y=[],b=t;bm?m:g+16383));return v===1?(t=i[d-1],y+=s[t>>2],y+=s[t<<4&63],y+="=="):v===2&&(t=(i[d-2]<<8)+i[d-1],y+=s[t>>10],y+=s[t>>4&63],y+=s[t<<2&63],y+="="),b.push(y),b.join("")}C.byteLength=A,C.toByteArray=O,C.fromByteArray=c;for(var s=[],n=[],o=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,a=r.length;l>1,r=-7,l=A?f-1:0,a=A?-1:1,i=D[T+l];for(l+=a,p=i&(1<<-r)-1,i>>=-r,r+=s;r>0;p=256*p+D[T+l],l+=a,r-=8);for(c=p&(1<<-r)-1,p>>=-r,r+=O;r>0;c=256*c+D[T+l],l+=a,r-=8);if(p===0)p=1-o;else{if(p===n)return c?NaN:1/0*(i?-1:1);c+=Math.pow(2,O),p-=o}return(i?-1:1)*c*Math.pow(2,p-O)},C.write=function(D,T,A,O,f,p){var c,s,n,o=8*p-f-1,r=(1<>1,a=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=O?0:p-1,t=O?1:-1,d=T<0||T===0&&1/T<0?1:0;for(T=Math.abs(T),isNaN(T)||T===1/0?(s=isNaN(T)?1:0,c=r):(c=Math.floor(Math.log(T)/Math.LN2),T*(n=Math.pow(2,-c))<1&&(c--,n*=2),T+=c+l>=1?a/n:a*Math.pow(2,1-l),T*n>=2&&(c++,n/=2),c+l>=r?(s=0,c=r):c+l>=1?(s=(T*n-1)*Math.pow(2,f),c+=l):(s=T*Math.pow(2,l-1)*Math.pow(2,f),c=0));f>=8;D[A+i]=255&s,i+=t,s/=256,f-=8);for(c=c<0;D[A+i]=255&c,i+=t,c/=256,o-=8);D[A+i-t]|=128*d}},function(W,C){var D={}.toString;W.exports=Array.isArray||function(T){return D.call(T)=="[object Array]"}},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s>>31}var g=(a<<5|a>>>27)+v+s[y];g+=y<20?1518500249+(i&t|~i&d):y<40?1859775393+(i^t^d):y<60?(i&t|i&d|t&d)-1894007588:(i^t^d)-899497514,v=d,d=t,t=i<<30|i>>>2,i=a,a=g}l[0]=l[0]+a|0,l[1]=l[1]+i|0,l[2]=l[2]+t|0,l[3]=l[3]+d|0,l[4]=l[4]+v|0},_doFinalize:function(){var o=this._data,r=o.words,l=8*this._nDataBytes,a=8*o.sigBytes;return r[a>>>5]|=128<<24-a%32,r[14+(a+64>>>9<<4)]=Math.floor(l/4294967296),r[15+(a+64>>>9<<4)]=l,o.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var o=p.clone.call(this);return o._hash=this._hash.clone(),o}});A.SHA1=p._createHelper(n),A.HmacSHA1=p._createHmacHelper(n)}(),T.SHA1})},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){!function(){var A=T,O=A.lib,f=O.Base,p=A.enc,c=p.Utf8,s=A.algo;s.HMAC=f.extend({init:function(n,o){n=this._hasher=new n.init,typeof o=="string"&&(o=c.parse(o));var r=n.blockSize,l=4*r;o.sigBytes>l&&(o=n.finalize(o)),o.clamp();for(var a=this._oKey=o.clone(),i=this._iKey=o.clone(),t=a.words,d=i.words,v=0;v>>6-a%4*2;r[l>>>2]|=(i|t)<<24-l%4*8,l++}return p.create(r,l)}var O=T,f=O.lib,p=f.WordArray,c=O.enc;c.Base64={stringify:function(s){var n=s.words,o=s.sigBytes,r=this._map;s.clamp();for(var l=[],a=0;a>>2]>>>24-a%4*8&255,t=n[a+1>>>2]>>>24-(a+1)%4*8&255,d=n[a+2>>>2]>>>24-(a+2)%4*8&255,v=i<<16|t<<8|d,y=0;y<4&&a+.75*y>>6*(3-y)&63));var b=r.charAt(64);if(b)for(;l.length%4;)l.push(b);return l.join("")},parse:function(s){var n=s.length,o=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var l=0;l0&&(M=B.UploadProgress.UploadProgressList[0],G=M.ClientId),o.default.setClientId(G),x&&x(M)},function(B){B&&(h(B),console.log(B))})}}]),m}();C.default=g},function(W,C,D){"use strict";function T(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function c(s,n){for(var o=0;o=0;l--)if(this.__items[l].match(r))return!0;return!1},s.prototype.set_indent=function(r,l){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.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)},s.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},s.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},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(r){this.__items.push(r);var l=r.lastIndexOf(` `);l!==-1?this.__character_count=r.length-l:this.__character_count+=r.length},s.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.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 n(r,l){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)),l=l||"",r.indent_level>0&&(l=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}n.prototype.get_indent_size=function(r,l){var a=this.__base_string_length;return l=l||0,r<0&&(a=0),a+=r*this.__indent_size,a+=l,a},n.prototype.get_indent_string=function(r,l){var a=this.__base_string;return l=l||0,r<0&&(r=0,a=""),l+=r*this.__indent_size,this.__ensure_cache(l),a+=this.__cache[l],a},n.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var r=this.__cache.length,l=0,a="";this.__indent_size&&r>=this.__indent_size&&(l=Math.floor(r/this.__indent_size),r-=l*this.__indent_size,a=new Array(l+1).join(this.__indent_string)),r&&(a+=new Array(r+1).join(" ")),this.__cache.push(a)};function o(r,l){this.__indent_cache=new n(r,l),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 s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(r,l){return this.__indent_cache.get_indent_string(r,l)},o.prototype.get_indent_size=function(r,l){return this.__indent_cache.get_indent_size(r,l)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(r){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===` `&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(` `);return r!==` `&&(a=a.replace(/[\n]/g,r)),a},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(r,l){return r=r||0,l=l||0,this.next_line.set_indent(r,l),this.__lines.length>1?(this.current_line.set_indent(r,l),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(r){for(var l=0;l1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(r,l){for(var a=this.__lines.length-2;a>=0;){var i=this.__lines[a];if(i.is_empty())break;if(i.item(0).indexOf(r)!==0&&i.item(-1)!==l){this.__lines.splice(a+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},c.exports.Output=o},function(c){function s(n,o,r,l){this.type=n,this.text=o,this.comments_before=null,this.newlines=r||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}c.exports.Token=s},,,function(c){function s(r,l){this.raw_options=n(r,l),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"])}s.prototype._get_array=function(r,l){var a=this.raw_options[r],i=l||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(i=a.concat()):typeof a=="string"&&(i=a.split(/[^a-zA-Z0-9_\/\-]+/)),i},s.prototype._get_boolean=function(r,l){var a=this.raw_options[r],i=a===void 0?!!l:!!a;return i},s.prototype._get_characters=function(r,l){var a=this.raw_options[r],i=l||"";return typeof a=="string"&&(i=a.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),i},s.prototype._get_number=function(r,l){var a=this.raw_options[r];l=parseInt(l,10),isNaN(l)&&(l=0);var i=parseInt(a,10);return isNaN(i)&&(i=l),i},s.prototype._get_selection=function(r,l,a){var i=this._get_selection_list(r,l,a);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values: `+l+` You passed in: '`+this.raw_options[r]+"'");return i[0]},s.prototype._get_selection_list=function(r,l,a){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[l[0]],!this._is_valid_selection(a,l))throw new Error("Invalid Default Value!");var i=this._get_array(r,a);if(!this._is_valid_selection(i,l))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values: `+l+` You passed in: '`+this.raw_options[r]+"'");return i},s.prototype._is_valid_selection=function(r,l){return r.length&&l.length&&!r.some(function(a){return l.indexOf(a)===-1})};function n(r,l){var a={};r=o(r);var i;for(i in r)i!==l&&(a[i]=r[i]);if(l&&r[l])for(i in r[l])a[i]=r[l][i];return a}function o(r){var l={},a;for(a in r){var i=a.replace(/-/g,"_");l[i]=r[a]}return l}c.exports.Options=s,c.exports.normalizeOpts=o,c.exports.mergeOpts=n},,function(c){var s=RegExp.prototype.hasOwnProperty("sticky");function n(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&o=0&&r=o.length&&this.__input.substring(r-o.length,r).toLowerCase()===o},c.exports.InputScanner=n},function(c,s,n){var o=n(8).InputScanner,r=n(3).Token,l=n(10).TokenStream,a=n(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},t=function(d,v){this._input=new o(d),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};t.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var d,v=new r(i.START,""),y=null,b=[],g=new l;v.type!==i.EOF;){for(d=this._get_next_token(v,y);this._is_comment(d);)g.add(d),d=this._get_next_token(v,y);g.isEmpty()||(d.comments_before=g,g=new l),d.parent=y,this._is_opening(d)?(b.push(y),y=d):y&&this._is_closing(d,y)&&(d.opened=y,y.closed=d,y=b.pop(),d.parent=y),d.previous=v,v.next=d,this.__tokens.add(d),v=d}return this.__tokens},t.prototype._is_first_token=function(){return this.__tokens.isEmpty()},t.prototype._reset=function(){},t.prototype._get_next_token=function(d,v){this._readWhitespace();var y=this._input.read(/.+/g);return y?this._create_token(i.RAW,y):this._create_token(i.EOF,"")},t.prototype._is_comment=function(d){return!1},t.prototype._is_opening=function(d){return!1},t.prototype._is_closing=function(d,v){return!1},t.prototype._create_token=function(d,v){var y=new r(d,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return y},t.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},c.exports.Tokenizer=t,c.exports.TOKEN=i},function(c){function s(n){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=n}s.prototype.restart=function(){this.__position=0},s.prototype.isEmpty=function(){return this.__tokens_length===0},s.prototype.hasNext=function(){return this.__position=0&&n/),erb:t.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:t.starting_with(/{%/).until_after(/%}/),django_value:t.starting_with(/{{/).until_after(/}}/),django_comment:t.starting_with(/{#/).until_after(/#}/),smarty:t.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:t.starting_with(/{\*/).until_after(/\*}/),smarty_literal:t.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new o,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(a){var i=this._create();return i._disabled[a]=!0,i._update(),i},l.prototype.read_options=function(a){var i=this._create();for(var t in r)i._disabled[t]=a.templating.indexOf(t)===-1;return i._update(),i},l.prototype.exclude=function(a){var i=this._create();return i._excluded[a]=!0,i._update(),i},l.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),a+=i,i=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},l.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},l.prototype._read_template=function(){var a="",i=this._input.peek();if(i==="<"){var t=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&t==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&t==="%"&&(a=a||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},c.exports.TemplatablePattern=l},,,,function(c,s,n){var o=n(19).Beautifier,r=n(20).Options;function l(a,i,t,d){var v=new o(a,i,t,d);return v.beautify()}c.exports=l,c.exports.defaultOptions=function(){return new r}},function(c,s,n){var o=n(20).Options,r=n(2).Output,l=n(21).Tokenizer,a=n(21).TOKEN,i=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,d=function(S,w){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new r(S,w)};d.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},d.prototype.set_space_before_token=function(S,w){this._output.space_before_token=S,this._output.non_breaking_space=w},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(S){this._output.add_raw_token(S)},d.prototype.print_preserved_newlines=function(S){var w=0;S.type!==a.TEXT&&S.previous.type!==a.TEXT&&(w=S.newlines?1:0),this.preserve_newlines&&(w=S.newlines0);return w!==0},d.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(S){this._output.add_new_line(S)},d.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var v=function(S){for(var w=null,R=S.next;R.type!==a.EOF&&S.closed!==R;){if(R.type===a.ATTRIBUTE&&R.text==="type"){R.next&&R.next.type===a.EQUALS&&R.next.next&&R.next.next.type===a.VALUE&&(w=R.next.next.text);break}R=R.next}return w},y=function(S,w){var R=null,N=null;return w.closed?(S==="script"?R="text/javascript":S==="style"&&(R="text/css"),R=v(w)||R,R.search("text/css")>-1?N="css":R.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":R.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":R.search(/test\/null/)>-1&&(N="null"),N):null};function b(S,w){return w.indexOf(S)!==-1}function g(S,w,R){this.parent=S||null,this.tag=w?w.tag_name:"",this.indent_level=R||0,this.parser_token=w||null}function m(S){this._printer=S,this._current_frame=null}m.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},m.prototype.record_tag=function(S){var w=new g(this._current_frame,S,this._printer.indent_level);this._current_frame=w},m.prototype._try_pop_frame=function(S){var w=null;return S&&(w=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),w},m.prototype._get_frame=function(S,w){for(var R=this._current_frame;R&&!(S.indexOf(R.tag)!==-1);){if(w&&w.indexOf(R.tag)!==-1){R=null;break}R=R.parent}return R},m.prototype.try_pop=function(S,w){var R=this._get_frame([S],w);return this._try_pop_frame(R)},m.prototype.indent_to_tag=function(S){var w=this._get_frame(S);w&&(this._printer.indent_level=w.indent_level)};function _(S,w,R,N){this._source_text=S||"",w=w||{},this._js_beautify=R,this._css_beautify=N,this._tag_stack=null;var F=new o(w,"html");this._options=F,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"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,w=this._options.eol;this._options.eol==="auto"&&(w=` `,S&&i.test(S)&&(w=S.match(i)[0])),S=S.replace(t,` `);var R=S.match(/^[\t ]*/)[0],N={text:"",type:""},F=new x,z=new d(this._options,R),q=new l(S,this._options).tokenize();this._tag_stack=new m(z);for(var B=null,M=q.next();M.type!==a.EOF;)M.type===a.TAG_OPEN||M.type===a.COMMENT?(B=this._handle_tag_open(z,M,F,N),F=B):M.type===a.ATTRIBUTE||M.type===a.EQUALS||M.type===a.VALUE||M.type===a.TEXT&&!F.tag_complete?B=this._handle_inside_tag(z,M,F,q):M.type===a.TAG_CLOSE?B=this._handle_tag_close(z,M,F):M.type===a.TEXT?B=this._handle_text(z,M,F):z.add_raw_token(M),N=B,M=q.next();var G=z._output.get_code(w);return G},_.prototype._handle_tag_close=function(S,w,R){var N={text:w.text,type:w.type};return S.alignment_size=0,R.tag_complete=!0,S.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),R.is_unformatted?S.add_raw_token(w):(R.tag_start_char==="<"&&(S.set_space_before_token(w.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&R.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(w)),R.indent_content&&!(R.is_unformatted||R.is_content_unformatted)&&(S.indent(),R.indent_content=!1),!R.is_inline_element&&!(R.is_unformatted||R.is_content_unformatted)&&S.set_wrap_point(),N},_.prototype._handle_inside_tag=function(S,w,R,N){var F=R.has_wrapped_attrs,z={text:w.text,type:w.type};if(S.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),R.is_unformatted)S.add_raw_token(w);else if(R.tag_start_char==="{"&&w.type===a.TEXT)S.print_preserved_newlines(w)?(w.newlines=0,S.add_raw_token(w)):S.print_token(w);else{if(w.type===a.ATTRIBUTE?(S.set_space_before_token(!0),R.attr_count+=1):(w.type===a.EQUALS||w.type===a.VALUE&&w.previous.type===a.EQUALS)&&S.set_space_before_token(!1),w.type===a.ATTRIBUTE&&R.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(w),F=F||w.newlines!==0),this._is_wrap_attributes_force)){var q=R.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&R.attr_count===1){var B=!0,M=0,G;do{if(G=N.peek(M),G.type===a.ATTRIBUTE){B=!1;break}M+=1}while(M<4&&G.type!==a.EOF&&G.type!==a.TAG_CLOSE);q=!B}q&&(S.print_newline(!1),F=!0)}S.print_token(w),F=F||S.previous_token_wrapped(),R.has_wrapped_attrs=F}return z},_.prototype._handle_text=function(S,w,R){var N={text:w.text,type:"TK_CONTENT"};return R.custom_beautifier_name?this._print_custom_beatifier_text(S,w,R):R.is_unformatted||R.is_content_unformatted?S.add_raw_token(w):(S.traverse_whitespace(w),S.print_token(w)),N},_.prototype._print_custom_beatifier_text=function(S,w,R){var N=this;if(w.text!==""){var F=w.text,z,q=1,B="",M="";R.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?z=this._js_beautify:R.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?z=this._css_beautify:R.custom_beautifier_name==="html"&&(z=function(de,Te){var we=new _(de,Te,N._js_beautify,N._css_beautify);return we.beautify()}),this._options.indent_scripts==="keep"?q=0:this._options.indent_scripts==="separate"&&(q=-S.indent_level);var G=S.get_full_indent(q);if(F=F.replace(/\n[ \t]*$/,""),R.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(|]]>)$/.exec(F);if(!J){S.add_raw_token(w);return}B=G+J[1]+` `,F=J[4],J[5]&&(M=G+J[5]),F=F.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(` `)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(w.whitespace_before=J[0]))}if(F)if(z){var K=function(){this.eol=` `};K.prototype=this._options.raw_options;var Z=new K;F=z(G+F,Z)}else{var le=w.whitespace_before;le&&(F=F.replace(new RegExp(` (`+le+")?","g"),` `)),F=G+F.replace(/\n/g,` `+G)}B&&(F?F=B+F+` `+M:F=B+M),S.print_newline(!1),F&&(w.text=F,w.whitespace_before="",w.newlines=0,S.add_raw_token(w),S.print_newline(!0))}},_.prototype._handle_tag_open=function(S,w,R,N){var F=this._get_tag_open_token(w);return(R.is_unformatted||R.is_content_unformatted)&&!R.is_empty_element&&w.type===a.TAG_OPEN&&w.text.indexOf("]*)/),this.tag_check=R?R[1]:""):(R=w.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=R?R[1]:"",(w.text.startsWith("{{#>")||w.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&w.next!==null?this.tag_check=w.next.text.split(" ")[0]:this.tag_check=w.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),w.type===a.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||w.closed&&w.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};_.prototype._get_tag_open_token=function(S){var w=new x(this._tag_stack.get_parser_token(),S);return w.alignment_size=this._options.wrap_attributes_indent_size,w.is_end_tag=w.is_end_tag||b(w.tag_check,this._options.void_elements),w.is_empty_element=w.tag_complete||w.is_start_tag&&w.is_end_tag,w.is_unformatted=!w.tag_complete&&b(w.tag_check,this._options.unformatted),w.is_content_unformatted=!w.is_empty_element&&b(w.tag_check,this._options.content_unformatted),w.is_inline_element=b(w.tag_name,this._options.inline)||w.tag_name.includes("-")||w.tag_start_char==="{",w},_.prototype._set_tag_position=function(S,w,R,N,F){if(R.is_empty_element||(R.is_end_tag?R.start_tag_token=this._tag_stack.try_pop(R.tag_name):(this._do_optional_end_element(R)&&(R.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(R),(R.tag_name==="script"||R.tag_name==="style")&&!(R.is_unformatted||R.is_content_unformatted)&&(R.custom_beautifier_name=y(R.tag_check,w)))),b(R.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),R.is_empty_element){if(R.tag_start_char==="{"&&R.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),R.indent_content=!0;var z=S.current_line_has_match(/{{#if/);z||S.print_newline(!1)}R.tag_name==="!--"&&F.type===a.TAG_CLOSE&&N.is_end_tag&&R.text.indexOf(` `)===-1||(R.is_inline_element||R.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,R))}else if(R.is_end_tag){var q=!1;q=R.start_tag_token&&R.start_tag_token.multiline_content,q=q||!R.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===a.TAG_CLOSE&&R.start_tag_token===N)&&F.type!=="TK_CONTENT",(R.is_content_unformatted||R.is_unformatted)&&(q=!1),q&&S.print_newline(!1)}else R.indent_content=!R.custom_beautifier_name,R.tag_start_char==="<"&&(R.tag_name==="html"?R.indent_content=this._options.indent_inner_html:R.tag_name==="head"?R.indent_content=this._options.indent_head_inner_html:R.tag_name==="body"&&(R.indent_content=this._options.indent_body_inner_html)),!(R.is_inline_element||R.is_unformatted)&&(F.type!=="TK_CONTENT"||R.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,R)},_.prototype._calcluate_parent_multiline=function(S,w){w.parent&&S._output.just_added_newline()&&!((w.is_inline_element||w.is_unformatted)&&w.parent.is_inline_element)&&(w.parent.multiline_content=!0)};var h=["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"],E=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(S){var w=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")w=w||this._tag_stack.try_pop("head");else if(S.tag_name==="li")w=w||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")w=w||this._tag_stack.try_pop("dt",["dl"]),w=w||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&h.indexOf(S.tag_name)!==-1){var R=S.parent.parent;(!R||E.indexOf(R.tag_name)===-1)&&(w=w||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(w=w||this._tag_stack.try_pop("rt",["ruby","rtc"]),w=w||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?w=w||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?w=w||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?w=w||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.tag_name==="tfoot"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("thead",["table"]),w=w||this._tag_stack.try_pop("tbody",["table"])):S.tag_name==="tr"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(S.tag_name==="th"||S.tag_name==="td")&&(w=w||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),w=w||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return S.parent=this._tag_stack.get_parser_token(),w},c.exports.Beautifier=_},function(c,s,n){var o=n(6).Options;function r(l){o.call(this,l,"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 o,c.exports.Options=r},function(c,s,n){var o=n(9).Tokenizer,r=n(9).TOKEN,l=n(13).Directives,a=n(14).TemplatablePattern,i=n(12).Pattern,t={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},d=new l(/<\!--/,/-->/),v=function(y,b){o.call(this,y,b),this._current_tag_name="";var g=new a(this._input).read_options(this._options),m=new i(this._input);if(this.__patterns={word:g.until(/[\n\r\t <]/),single_quote:g.until_after(/'/),double_quote:g.until_after(/"/),attribute:g.until(/[\n\r\t =>]|\/>/),element_name:g.until(/[\n\r\t >\/]/),handlebars_comment:m.starting_with(/{{!--/).until_after(/--}}/),handlebars:m.starting_with(/{{/).until_after(/}}/),handlebars_open:m.until(/[\n\r\t }]/),handlebars_raw_close:m.until(/}}/),comment:m.starting_with(//),cdata:m.starting_with(//),conditional_comment:m.starting_with(//),processing:m.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 _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=m.matching(_).until_after(_)}};v.prototype=new o,v.prototype._is_comment=function(y){return!1},v.prototype._is_opening=function(y){return y.type===t.TAG_OPEN},v.prototype._is_closing=function(y,b){return y.type===t.TAG_CLOSE&&b&&((y.text===">"||y.text==="/>")&&b.text[0]==="<"||y.text==="}}"&&b.text[0]==="{"&&b.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(y,b){var g=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(t.EOF,""):(g=g||this._read_open_handlebars(m,b),g=g||this._read_attribute(m,y,b),g=g||this._read_close(m,b),g=g||this._read_raw_content(m,y,b),g=g||this._read_content_word(m),g=g||this._read_comment_or_cdata(m),g=g||this._read_processing(m),g=g||this._read_open(m,b),g=g||this._create_token(t.UNKNOWN,this._input.next()),g)},v.prototype._read_comment_or_cdata=function(y){var b=null,g=null,m=null;if(y==="<"){var _=this._input.peek(1);_==="!"&&(g=this.__patterns.comment.read(),g?(m=d.get_directives(g),m&&m.ignore==="start"&&(g+=d.readIgnored(this._input))):g=this.__patterns.cdata.read()),g&&(b=this._create_token(t.COMMENT,g),b.directives=m)}return b},v.prototype._read_processing=function(y){var b=null,g=null,m=null;if(y==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(g=this.__patterns.conditional_comment.read(),g=g||this.__patterns.processing.read()),g&&(b=this._create_token(t.COMMENT,g),b.directives=m)}return b},v.prototype._read_open=function(y,b){var g=null,m=null;return b||y==="<"&&(g=this._input.next(),this._input.peek()==="/"&&(g+=this._input.next()),g+=this.__patterns.element_name.read(),m=this._create_token(t.TAG_OPEN,g)),m},v.prototype._read_open_handlebars=function(y,b){var g=null,m=null;return b||this._options.indent_handlebars&&y==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(g=this.__patterns.handlebars_comment.read(),g=g||this.__patterns.handlebars.read(),m=this._create_token(t.COMMENT,g)):(g=this.__patterns.handlebars_open.read(),m=this._create_token(t.TAG_OPEN,g))),m},v.prototype._read_close=function(y,b){var g=null,m=null;return b&&(b.text[0]==="<"&&(y===">"||y==="/"&&this._input.peek(1)===">")?(g=this._input.next(),y==="/"&&(g+=this._input.next()),m=this._create_token(t.TAG_CLOSE,g)):b.text[0]==="{"&&y==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),m=this._create_token(t.TAG_CLOSE,"}}"))),m},v.prototype._read_attribute=function(y,b,g){var m=null,_="";if(g&&g.text[0]==="<")if(y==="=")m=this._create_token(t.EQUALS,this._input.next());else if(y==='"'||y==="'"){var x=this._input.next();y==='"'?x+=this.__patterns.double_quote.read():x+=this.__patterns.single_quote.read(),m=this._create_token(t.VALUE,x)}else _=this.__patterns.attribute.read(),_&&(b.type===t.EQUALS?m=this._create_token(t.VALUE,_):m=this._create_token(t.ATTRIBUTE,_));return m},v.prototype._is_content_unformatted=function(y){return this._options.void_elements.indexOf(y)===-1&&(this._options.content_unformatted.indexOf(y)!==-1||this._options.unformatted.indexOf(y)!==-1)},v.prototype._read_raw_content=function(y,b,g){var m="";if(g&&g.text[0]==="{")m=this.__patterns.handlebars_raw_close.read();else if(b.type===t.TAG_CLOSE&&b.opened.text[0]==="<"&&b.text[0]!=="/"){var _=b.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var x=this._read_comment_or_cdata(y);if(x)return x.type=t.TEXT,x;m=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(_)&&(m=this._input.readUntil(new RegExp("","ig")))}return m?this._create_token(t.TEXT,m):null},v.prototype._read_content_word=function(y){var b="";if(this._options.unformatted_content_delimiter&&(y===this._options.unformatted_content_delimiter[0]&&(b=this.__patterns.unformatted_content_delimiter.read())),b||(b=this.__patterns.word.read()),b)return this._create_token(t.TEXT,b)},c.exports.Tokenizer=v,c.exports.TOKEN=t}],O={};function f(c){var s=O[c];if(s!==void 0)return s.exports;var n=O[c]={exports:{}};return A[c](n,n.exports,f),n.exports}var p=f(18);W=p})();var C=W;if(!0)!(ce=[V,V("6UM0"),V("TXwP")],ie=function(A){var O=V("6UM0"),f=V("TXwP");return{html_beautify:function(p,c){return C(p,c,O.js_beautify,f.css_beautify)}}}.apply(Xe,ce),ie!==void 0&&(nt.exports=ie));else var D,T})()},"rAM+":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return ie});var ce=V("Qw5x");function ie(W,C){var D;if(typeof Symbol=="undefined"||W[Symbol.iterator]==null){if(Array.isArray(W)||(D=Object(ce.a)(W))||C&&W&&typeof W.length=="number"){D&&(W=D);var T=0,A=function(){};return{s:A,n:function(){return T>=W.length?{done:!0}:{done:!1,value:W[T++]}},e:function(s){throw s},f:A}}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 O=!0,f=!1,p;return{s:function(){D=W[Symbol.iterator]()},n:function(){var s=D.next();return O=s.done,s},e:function(s){f=!0,p=s},f:function(){try{!O&&D.return!=null&&D.return()}finally{if(f)throw p}}}}},rHrb:function(nt,Xe,V){"use strict";Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.CopyToClipboard=void 0;var ce=W(V("cDcd")),ie=W(V("+QRC"));function W(t){return t&&t.__esModule?t:{default:t}}function C(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(v){return typeof v}:C=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},C(t)}function D(t,d){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(t);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(t,b).enumerable})),v.push.apply(v,y)}return v}function T(t){for(var d=1;d=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,y))continue;v[y]=t[y]}}return v}function O(t,d){if(t==null)return{};var v={},y=Object.keys(t),b,g;for(g=0;g=0)continue;v[b]=t[b]}return v}function f(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function p(t,d){for(var v=0;v"']/,ce=/[&<>"']/g,ie=/[<>"']|&(?!#?\w+;)/,W=/[<>"']|&(?!#?\w+;)/g,C={"&":"&","<":"<",">":">",'"':""","'":"'"},D=m=>C[m];function T(m,_){if(_){if(V.test(m))return m.replace(ce,D)}else if(ie.test(m))return m.replace(W,D);return m}const A=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function O(m){return m.replace(A,(_,x)=>(x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""))}const f=/(^|[^\[])\^/g;function p(m,_){m=m.source||m,_=_||"";const x={replace:(h,E)=>(E=E.source||E,E=E.replace(f,"$1"),m=m.replace(h,E),x),getRegex:()=>new RegExp(m,_)};return x}const c=/[^\w:]/g,s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function n(m,_,x){if(m){let h;try{h=decodeURIComponent(O(x)).replace(c,"").toLowerCase()}catch(E){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}_&&!s.test(x)&&(x=i(_,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(h){return null}return x}const o={},r=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(m,_){o[" "+m]||(r.test(m)?o[" "+m]=m+"/":o[" "+m]=y(m,"/",!0)),m=o[" "+m];const x=m.indexOf(":")===-1;return _.substring(0,2)==="//"?x?_:m.replace(l,"$1")+_:_.charAt(0)==="/"?x?_:m.replace(a,"$1")+_:m+_}const t={exec:function(){}};function d(m){let _=1,x,h;for(;_{let N=!1,F=w;for(;--F>=0&&R[F]==="\\";)N=!N;return N?"|":" |"}),h=x.split(/ \|/);let E=0;if(h.length>_)h.splice(_);else for(;h.length<_;)h.push("");for(;E=0;p--){var c=W().key(p);f(C(c),c)}}function A(f){return W().removeItem(f)}function O(){return W().clear()}},"s8/Y":function(nt,Xe,V){nt.exports=V.p+"static/jx.6713fc81.svg"},"sB/4":function(nt,Xe,V){nt.exports=V.p+"static/b.7405990c.svg"},sNtx:function(nt,Xe,V){},sR1s:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return C}),V.d(Xe,"a",function(){return D}),V.d(Xe,"c",function(){return T}),V.d(Xe,"d",function(){return A});var ce=V("U8pU"),ie="RC_TABLE_KEY";function W(O){return O==null?[]:Array.isArray(O)?O:[O]}function C(O,f){if(!f&&typeof f!="number")return O;for(var p=W(f),c=O,s=0;s1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=d[0];if(T.isValidElement(v)&&Object(c.c)(v)){var y=v.ref;d[0]=T.cloneElement(v,{ref:Object(c.a)(y,this.setChildNode)})}return d.length===1?d[0]:d.map(function(b,g){return!T.isValidElement(b)||"key"in b&&b.key!==null?b:T.cloneElement(b,{key:"".concat(n,"-").concat(g)})})}}]),a}(T.Component);o.displayName="ResizeObserver",Xe.a=o},twBr:function(nt,Xe,V){nt.exports=V.p+"static/s.1f286590.svg"},uMZB:function(nt,Xe,V){nt.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(nt,Xe,V){nt.exports=ce;function ce(){return V("gaXo"),{}}},ulZh:function(nt,Xe,V){typeof window!="undefined"&&function(ie,W){nt.exports=W()}(this,function(){return function(ce){var ie={};function W(C){if(ie[C])return ie[C].exports;var D=ie[C]={i:C,l:!1,exports:{}};return ce[C].call(D.exports,D,D.exports,W),D.l=!0,D.exports}return W.m=ce,W.c=ie,W.d=function(C,D,T){W.o(C,D)||Object.defineProperty(C,D,{enumerable:!0,get:T})},W.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})},W.t=function(C,D){if(D&1&&(C=W(C)),D&8)return C;if(D&4&&typeof C=="object"&&C&&C.__esModule)return C;var T=Object.create(null);if(W.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:C}),D&2&&typeof C!="string")for(var A in C)W.d(T,A,function(O){return C[O]}.bind(null,A));return T},W.n=function(C){var D=C&&C.__esModule?function(){return C.default}:function(){return C};return W.d(D,"a",D),D},W.o=function(C,D){return Object.prototype.hasOwnProperty.call(C,D)},W.p="/dist/",W(W.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ce,ie,W){"use strict";var C=Object.prototype.hasOwnProperty,D="~";function T(){}Object.create&&(T.prototype=Object.create(null),new T().__proto__||(D=!1));function A(c,s,n){this.fn=c,this.context=s,this.once=n||!1}function O(c,s,n,o,r){if(typeof n!="function")throw new TypeError("The listener must be a function");var l=new A(n,o||c,r),a=D?D+s:s;return c._events[a]?c._events[a].fn?c._events[a]=[c._events[a],l]:c._events[a].push(l):(c._events[a]=l,c._eventsCount++),c}function f(c,s){--c._eventsCount===0?c._events=new T:delete c._events[s]}function p(){this._events=new T,this._eventsCount=0}p.prototype.eventNames=function(){var s=[],n,o;if(this._eventsCount===0)return s;for(o in n=this._events)C.call(n,o)&&s.push(D?o.slice(1):o);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(n)):s},p.prototype.listeners=function(s){var n=D?D+s:s,o=this._events[n];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,l=o.length,a=new Array(l);r0},!1)}function c(s,n){for(var o={main:[n]},r={main:[]},l={main:{}};p(o);)for(var a=Object.keys(o),i=0;i=2*g/_||R<=F)return;var z=Number.POSITIVE_INFINITY,q;for(q=a.level-1;q>h;q--){var B=x[q].maxBitrate;if(z=g*B/(8*.8*w),z=R)return;var M=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+a.sn+(i?" part "+i.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+q+` Current BW estimate: `+(Object(C.isFiniteNumber)(M)?(M/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+R.toFixed(3)+` s Estimated load time for the next fragment: `+z.toFixed(3)+` s Time to underbuffer: `+F.toFixed(3)+" s"),t.nextLoadLevel=q,this.bwEstimator.sample(m,b.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),t.trigger(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:i,stats:b})},r.onFragLoaded=function(a,i){var t=i.frag,d=i.part;if(t.type===f.PlaylistLevelType.MAIN&&Object(C.isFiniteNumber)(t.sn)){var v=d?d.stats:t.stats,y=d?d.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[t.level],g=(b.loaded?b.loaded.bytes:0)+v.loaded,m=(b.loaded?b.loaded.duration:0)+y;b.loaded={bytes:g,duration:m},b.realBitrate=Math.round(8*g/m)}if(t.bitrateTest){var _={stats:v,frag:t,part:d,id:t.type};this.onFragBuffered(T.Events.FRAG_BUFFERED,_),t.bitrateTest=!1}}},r.onFragBuffered=function(a,i){var t=i.frag,d=i.part,v=d?d.stats:t.stats;if(v.aborted)return;if(t.type!==f.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var y=v.parsing.end-v.loading.start;this.bwEstimator.sample(y,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=y/1e3:this.bitrateTestDelay=0},r.onError=function(a,i){switch(i.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var a=this.fragCurrent,i=this.partCurrent,t=this.hls,d=t.maxAutoLevel,v=t.config,y=t.minAutoLevel,b=t.media,g=i?i.duration:a?a.duration:0,m=b?b.currentTime:0,_=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,h=(A.BufferHelper.bufferInfo(b,m,v.maxBufferHole).end-m)/_,E=this.findBestLevel(x,y,d,h,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(E>=0)return E;p.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=g?Math.min(g,v.maxStarvationDelay):v.maxStarvationDelay,w=v.abrBandWidthFactor,R=v.abrBandWidthUpFactor;if(!h){var N=this.bitrateTestDelay;if(N){var F=g?Math.min(g,v.maxLoadingDelay):v.maxLoadingDelay;S=F-N,p.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),w=R=1}}return E=this.findBestLevel(x,y,d,h+S,w,R),Math.max(E,0)},r.findBestLevel=function(a,i,t,d,v,y){for(var b,g=this.fragCurrent,m=this.partCurrent,_=this.lastLoadedFragLevel,x=this.hls.levels,h=x[_],E=!!(h!=null&&(b=h.details)!==null&&b!==void 0&&b.live),S=h==null?void 0:h.codecSet,w=m?m.duration:g?g.duration:0,R=t;R>=i;R--){var N=x[R];if(!N||S&&N.codecSet!==S)continue;var F=N.details,z=(m?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||w,q=void 0;R<=_?q=v*a:q=y*a;var B=x[R].maxBitrate,M=B*z/q;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+R+"/"+Math.round(q)+"/"+B+"/"+z+"/"+d+"/"+M),q>B&&(!M||E&&!this.bitrateTestDelay||M0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+E.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},_.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var h,E=this.levels,S=this.trackId,w=E==null||((h=E[S])===null||h===void 0)?void 0:h.details;if(w){if(this.waitForCdnTuneIn(w))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var R,N=performance.now(),F=this.retryDate;(!F||N>=F||(R=this.media)!==null&&R!==void 0&&R.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var z=this.waitingData;if(z){var q=z.frag,B=z.part,M=z.cache,G=z.complete;if(this.initPTS[q.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var J=M.flush(),K={frag:q,part:B,payload:J,networkDetails:null};this._handleFragmentLoadProgress(K),G&&g.prototype._handleFragmentLoadComplete.call(this,K)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+q.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Z=this.getLoadPosition(),le=A.BufferHelper.bufferInfo(this.mediaBuffer,Z,this.config.maxBufferHole),de=Object(r.fragmentWithinToleranceTest)(le.end,this.config.maxFragLookUpTolerance,q);de<0&&(i.logger.log("Waiting fragment cc ("+q.cc+") @ "+q.start+" cancelled because another fragment at "+le.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},_.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var E=this.mediaBuffer?this.mediaBuffer:h,S=E.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},_.doTickIdle=function(){var h,E,S=this.hls,w=this.levels,R=this.media,N=this.trackId,F=S.config;if(!w||!w[N])return;if(!R&&(this.startFragRequested||!F.startFragPrefetch))return;var z=w[N],q=z.details;if(!q||q.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(q)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(B===null)return;var M=B.len,G=this.getMaxBufferLength(),J=this.audioSwitch;if(M>=G&&!J)return;if(!J&&this._streamEnded(B,q)){S.trigger(T.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var K=q.fragments,Z=K[0].start,le=B.end;if(J){var de=this.getLoadPosition();le=de,q.PTSKnown&&deZ||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),R.currentTime=Z+.05))}var Te=this.getNextFragment(le,q);if(!Te){this.bufferFlushed=!0;return}((h=Te.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((E=Te.decryptdata)!==null&&E!==void 0&&E.key)?this.loadKey(Te,q):this.loadFragment(Te,q,le)},_.getMaxBufferLength=function(){var h=g.prototype.getMaxBufferLength.call(this),E=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return E===null?h:Math.max(h,E.len)},_.onMediaDetaching=function(){this.videoBuffer=null,g.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(h,E){var S=E.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(w){return new f.Level(w)})},_.onAudioTrackSwitching=function(h,E){var S=!!E.url;this.trackId=E.id;var w=this.fragCurrent;w!=null&&w.loader&&w.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(y):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(h,E){this.mainDetails=E.details},_.onAudioTrackLoaded=function(h,E){var S,w=this.levels,R=E.details,N=E.id;if(!w){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+R.startSN+","+R.endSN+"],duration:"+R.totalduration);var F=w[N],z=0;if(R.live||(S=F.details)!==null&&S!==void 0&&S.live){var q=this.mainDetails;if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed||!q)return;!F.details&&R.hasProgramDateTime&&q.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(R,q),z=R.fragments[0].start):z=this.alignPlaylists(R,F.details)}F.details=R,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!R.live)&&this.setStartPosition(F.details,z),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(R)&&(this.state=D.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(h){var E,S=h.frag,w=h.part,R=h.payload,N=this.config,F=this.trackId,z=this.levels;if(!z){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var q=z[F];console.assert(q,"Audio track is defined on fragment load progress");var B=q.details;console.assert(B,"Audio track details are defined on fragment load progress");var M=N.defaultAudioCodec||q.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new n.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[S.cc],K=(E=S.initSegment)===null||E===void 0?void 0:E.data;if(J!==void 0){var Z=!1,le=w?w.index:-1,de=le!==-1,Te=new o.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,R.byteLength,le,de);G.push(R,K,M,"",S,w,B.totalduration,Z,Te,J)}else{i.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+F);var we=this.waitingData=this.waitingData||{frag:S,part:w,cache:new s.default,complete:!1},Ie=we.cache;Ie.push(new Uint8Array(R)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}g.prototype._handleFragmentLoadComplete.call(this,h)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(h,E){var S=E.tracks.audio;S&&(this.mediaBuffer=S.buffer),E.tracks.video&&(this.videoBuffer=E.tracks.video.buffer)},_.onFragBuffered=function(h,E){var S=E.frag,w=E.part;if(S.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(w?" p: "+w.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,w)},_.onError=function(h,E){switch(E.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,E);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=E.fatal?D.State.ERROR:D.State.IDLE,this.warn(E.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(E.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var S=!0,w=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);w&&w.len>.5&&(S=!this.reduceMaxBufferLength(w.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,g.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(h,E){var S=E.type;S===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(h){var E,S="audio",w=this.hls,R=h.remuxResult,N=h.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var z=F.frag,q=F.part,B=R.audio,M=R.text,G=R.id3,J=R.initSegment;if(this.fragContextChanged(z))return;if(this.state=D.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,z,N),w.trigger(T.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:S,tracks:J.tracks})),B){var K=B.startPTS,Z=B.endPTS,le=B.startDTS,de=B.endDTS;q&&(q.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:K,endPTS:Z,startDTS:le,endDTS:de}),z.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,K,Z,le,de),this.bufferFragmentData(B,z,q,N)}if(G!=null&&(E=G.samples)!==null&&E!==void 0&&E.length){var Te=t({frag:z,id:S},G);w.trigger(T.Events.FRAG_PARSING_METADATA,Te)}if(M){var we=t({frag:z,id:S},M);w.trigger(T.Events.FRAG_PARSING_USERDATA,we)}},_._bufferInitSegment=function(h,E,S){if(this.state!==D.State.PARSING)return;h.video&&delete h.video;var w=h.audio;if(!w)return;w.levelCodec=w.codec,w.id="audio",this.log("Init audio buffer, container:"+w.container+", codecs[parsed]=["+w.codec+"]"),this.hls.trigger(T.Events.BUFFER_CODECS,h);var R=w.initSegment;if(R!=null&&R.byteLength){var N={type:"audio",frag:E,part:null,chunkMeta:S,parent:E.type,data:R};this.hls.trigger(T.Events.BUFFER_APPENDING,N)}this.tick()},_.loadFragment=function(h,E,S){var w=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||w===O.FragmentState.NOT_LOADED||w===O.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):E.live&&!Object(C.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,h,E,S)))},_.completeAudioSwitch=function(){var h=this.hls,E=this.media,S=this.trackId;E&&(this.log("Switching audio track : flushing all audio"),g.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:S})},m}(D.default);ie.default=b},"./src/controller/audio-track-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/controller/base-playlist-controller.ts"),A=W("./src/types/loader.ts");function O(n,o){for(var r=0;r=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=i[this.trackId];this.log("Now switching to audio-track index "+a);var d=i[a],v=d.id,y=d.groupId,b=y===void 0?"":y,g=d.name,m=d.type,_=d.url;if(this.trackId=a,this.trackName=g,this.selectDefaultTrack=!1,this.hls.trigger(C.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:b,name:g,type:m,url:_}),d.details&&!d.details.live)return;var x=this.switchParams(d.url,t==null?void 0:t.details);this.loadPlaylist(x)},r.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,t=this.findTrackId(i)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(a){for(var i=this.tracksInGroup,t=0;to.partTarget&&(d+=1)}if(Object(C.isFiniteNumber)(t))return new D.HlsUrlParameters(t,Object(C.isFiniteNumber)(d)?d:void 0,D.HlsSkip.No)}}},c.loadPlaylist=function(n){},c.shouldLoadTrack=function(n){return this.canLoad&&n&&!!n.url&&(!n.details||n.details.live)},c.playlistLoaded=function(n,o,r){var l=this,a=o.details,i=o.stats,t=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(a.advancedDateTime=Date.now()-t,a.live||r!=null&&r.live){if(a.reloaded(r),r&&this.log("live playlist "+n+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),r&&a.fragments.length>0&&Object(T.mergeDetails)(r,a),!this.canLoad||!a.live)return;var d,v=void 0,y=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var b=this.hls.config.lowLatencyMode,g=a.lastPartSn,m=a.endSN,_=a.lastPartIndex,x=_!==-1,h=g===m,E=b?0:_;x?(v=h?m+1:g,y=h?E:_+1):v=m+1;var S=a.age,w=S+a.ageHeader,R=Math.min(w-a.partTarget,a.targetduration*1.5);if(R>0){if(r&&R>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+R+" with playlist age: "+a.age),R=0;else{var N=Math.floor(R/a.targetduration);if(v+=N,y!==void 0){var F=Math.round(R%a.targetduration/a.partTarget);y+=F}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+R+" skip sn "+N+" to part "+y)}a.tuneInGoal=R}if(d=this.getDeliveryDirectives(a,o.deliveryDirectives,v,y),b||!h){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(a,o.deliveryDirectives,v,y);var z=Object(T.computeReloadInterval)(a,i);v!==void 0&&a.canBlockReload&&(z-=a.partTarget||1),this.log("reload live playlist "+n+" in "+Math.round(z)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(d)},z)}else this.clearTimer()},c.getDeliveryDirectives=function(n,o,r,l){var a=Object(D.getSkipValue)(n,r);return o!=null&&o.skip&&n.deltaUpdateFailed&&(r=o.msn,l=o.part,a=D.HlsSkip.No),new D.HlsUrlParameters(r,l,a)},c.retryLoadingOrFail=function(n){var o=this,r=this.hls.config,l=this.retryCount-1&&(a=n.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+n.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return o.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+n.details+'"')}}else this.warn('cannot recover from error "'+n.details+'"'),this.clearTimer(),n.fatal=!0;return l},p}()},"./src/controller/base-stream-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"State",function(){return m}),W.d(ie,"default",function(){return _});var C=W("./src/polyfills/number.ts"),D=W("./src/task-loop.ts"),T=W("./src/controller/fragment-tracker.ts"),A=W("./src/utils/buffer-helper.ts"),O=W("./src/utils/logger.ts"),f=W("./src/events.ts"),p=W("./src/errors.ts"),c=W("./src/types/transmuxer.ts"),s=W("./src/utils/mp4-tools.ts"),n=W("./src/utils/discontinuities.ts"),o=W("./src/controller/fragment-finders.ts"),r=W("./src/controller/level-helper.ts"),l=W("./src/loader/fragment-loader.ts"),a=W("./src/crypt/decrypter.ts"),i=W("./src/utils/time-ranges.ts"),t=W("./src/types/loader.ts");function d(x,h){for(var E=0;EJ;(q0&&q&&q.key&&q.iv&&q.method==="AES-128"){var B=self.performance.now();return R.decrypter.webCryptoDecrypt(new Uint8Array(z),q.key.buffer,q.iv.buffer).then(function(M){var G=self.performance.now();return F.trigger(f.Events.FRAG_DECRYPTED,{frag:w,payload:M,stats:{tstart:B,tdecrypt:G}}),N.payload=M,N})}return N}).then(function(N){var F=R.fragCurrent,z=R.hls,q=R.levels;if(!q)throw new Error("init load aborted, missing levels");var B=q[w.level].details;console.assert(B,"Level details are defined when init segment is loaded");var M=w.stats;R.state=m.IDLE,R.fragLoadError=0,w.data=new Uint8Array(N.payload),M.parsing.start=M.buffering.start=self.performance.now(),M.parsing.end=M.buffering.end=self.performance.now(),N.frag===F&&z.trigger(f.Events.FRAG_BUFFERED,{stats:M,frag:F,part:null,id:w.type}),R.tick()}).catch(function(N){R.warn(N),R.resetFragmentLoading(w)})},E.fragContextChanged=function(w){var R=this.fragCurrent;return!w||!R||w.level!==R.level||w.sn!==R.sn||w.urlId!==R.urlId},E.fragBufferedComplete=function(w,R){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+w.type+" sn: "+w.sn+(R?" part: "+R.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level+" "+i.default.toString(A.BufferHelper.getBuffered(N))),this.state=m.IDLE,this.tick()},E._handleFragmentLoadComplete=function(w){var R=this.transmuxer;if(!R)return;var N=w.frag,F=w.part,z=w.partsLoaded,q=!z||z.length===0||z.some(function(M){return!M}),B=new c.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!q);R.flush(B)},E._handleFragmentLoadProgress=function(w){},E._doFragLoad=function(w,R,N,F){var z=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(w.start,N||0),this.config.lowLatencyMode&&R){var q=R.partList;if(q&&F){N>w.end&&R.fragmentHint&&(w=R.fragmentHint);var B=this.getNextPart(q,w,N);if(B>-1){var M=q[B];return this.log("Loading part sn: "+w.sn+" p: "+M.index+" cc: "+w.cc+" of playlist ["+R.startSN+"-"+R.endSN+"] parts [0-"+B+"-"+(q.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=M.start+M.duration,this.state=m.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:w,part:q[B],targetBufferTime:N}),this.doFragPartsLoad(w,q,B,F).catch(function(G){return z.handleFragLoadError(G)})}else if(!w.url||this.loadedEndOfParts(q,N))return Promise.resolve(null)}}return this.log("Loading fragment "+w.sn+" cc: "+w.cc+" "+(R?"of ["+R.startSN+"-"+R.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(N.toFixed(3))),Object(C.isFiniteNumber)(w.sn)&&!this.bitrateTest&&(this.nextLoadPosition=w.start+w.duration),this.state=m.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:w,targetBufferTime:N}),this.fragmentLoader.load(w,F).catch(function(G){return z.handleFragLoadError(G)})},E.doFragPartsLoad=function(w,R,N,F){var z=this;return new Promise(function(q,B){var M=[],G=function J(K){var Z=R[K];z.fragmentLoader.loadPart(w,Z,F).then(function(le){M[Z.index]=le;var de=le.part;z.hls.trigger(f.Events.FRAG_LOADED,le);var Te=R[K+1];if(Te&&Te.fragment===w)J(K+1);else return q({frag:w,part:de,partsLoaded:M})}).catch(B)};G(N)})},E.handleFragLoadError=function(w){var R=w.data;return R&&R.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(R.frag,R.part):this.hls.trigger(f.Events.ERROR,R),null},E._handleTransmuxerFlush=function(w){var R=this.getCurrentContext(w);if(!R||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var N=R.frag,F=R.part,z=R.level,q=self.performance.now();N.stats.parsing.end=q,F&&(F.stats.parsing.end=q),this.updateLevelTiming(N,F,z,w.partial)},E.getCurrentContext=function(w){var R=this.levels,N=w.level,F=w.sn,z=w.part;if(!R||!R[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var q=R[N],B=z>-1?Object(r.getPartWith)(q,F,z):null,M=B?B.fragment:Object(r.getFragmentWithSN)(q,F,this.fragCurrent);return M?{frag:M,part:B,level:q}:null},E.bufferFragmentData=function(w,R,N,F){if(!w||this.state!==m.PARSING)return;var z=w.data1,q=w.data2,B=z;if(z&&q&&(B=Object(s.appendUint8Array)(z,q)),!B||!B.length)return;var M={type:w.type,frag:R,part:N,chunkMeta:F,parent:R.type,data:B};this.hls.trigger(f.Events.BUFFER_APPENDING,M),w.dropped&&w.independent&&!N&&this.flushBufferGap(R)},E.flushBufferGap=function(w){var R=this.media;if(!R)return;if(!A.BufferHelper.isBuffered(R,R.currentTime)){this.flushMainBuffer(0,w.start);return}var N=R.currentTime,F=A.BufferHelper.bufferInfo(R,N,0),z=w.duration,q=Math.min(this.config.maxFragLookUpTolerance*2,z*.25),B=Math.max(Math.min(w.start-q,F.end-q),N+q);w.start-B>q&&this.flushMainBuffer(B,w.start)},E.getFwdBufferInfo=function(w,R){var N=this.config,F=this.getLoadPosition();if(!Object(C.isFiniteNumber)(F))return null;var z=A.BufferHelper.bufferInfo(w,F,N.maxBufferHole);if(z.len===0&&z.nextStart!==void 0){var q=this.fragmentTracker.getBufferedFrag(F,R);if(q&&z.nextStart=N?(R.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+R.maxMaxBufferLength+"s"),!0):!1},E.getNextFragment=function(w,R){var N,F,z=R.fragments,q=z.length;if(!q)return null;var B=this.config,M=z[0].start,G;if(R.live){var J=B.initialLiveManifestSize;if(q-1&&NN.start&&N.loaded},E.getInitialLiveFragment=function(w,R){var N=this.fragPrevious,F=null;if(N){if(w.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(o.findFragmentByPDT)(R,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var z=N.sn+1;if(z>=w.startSN&&z<=w.endSN){var q=R[z-w.startSN];N.cc===q.cc&&(F=q,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(o.findFragWithCC)(R,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(F=this.getFragmentAtPosition(B,this.bitrateTest?w.fragmentEnd:w.edge,w))}return F},E.getFragmentAtPosition=function(w,R,N){var F=this.config,z=this.fragPrevious,q=N.fragments,B=N.endSN,M=N.fragmentHint,G=F.maxFragLookUpTolerance,J=!!(F.lowLatencyMode&&N.partList&&M);J&&M&&!this.bitrateTest&&(q=q.concat(M),B=M.sn);var K;if(wR-G?0:G;K=Object(o.findFragmentByPTS)(z,q,w,Z)}else K=q[q.length-1];if(K){var le=K.sn-N.startSN,de=z&&K.level===z.level,Te=q[le+1],we=this.fragmentTracker.getState(K);if(we===T.FragmentState.BACKTRACKED){K=null;for(var Ie=le;q[Ie]&&this.fragmentTracker.getState(q[Ie])===T.FragmentState.BACKTRACKED;)z?K=q[Ie--]:K=q[--Ie];K||(K=Te)}else z&&K.sn===z.sn&&!J&&(de&&(K.sn=q-R.maxFragLookUpTolerance&&z<=B;if(F!==null&&N.duration>F&&(z"+w.startSN+" prev-sn: "+(z?z.sn:"na")+" fragments: "+B),K}return M},E.waitForCdnTuneIn=function(w){var R=3;return w.live&&w.canBlockReload&&w.tuneInGoal>Math.max(w.partHoldBack,w.partTarget*R)},E.setStartPosition=function(w,R){var N=this.startPosition;if(N"+w))}}]),h}(D.default)},"./src/controller/buffer-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o});var C=W("./src/polyfills/number.ts"),D=W("./src/events.ts"),T=W("./src/utils/logger.ts"),A=W("./src/errors.ts"),O=W("./src/utils/buffer-helper.ts"),f=W("./src/utils/mediasource-helper.ts"),p=W("./src/loader/fragment.ts"),c=W("./src/controller/buffer-operation-queue.ts"),s=Object(f.getMediaSource)(),n=/([ha]vc.)(?:\.[^.,]+)+/,o=function(){function r(a){var i=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 t=i.hls,d=i.media,v=i.mediaSource;T.logger.log("[buffer-controller]: Media source opened"),d&&(i.updateMediaElementDuration(),t.trigger(D.Events.MEDIA_ATTACHED,{media:d})),v&&v.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){T.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){T.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var l=r.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var i=this.hls;i.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(D.Events.BUFFER_RESET,this.onBufferReset,this),i.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(D.Events.BUFFER_EOS,this.onBufferEos,this),i.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(D.Events.FRAG_PARSED,this.onFragParsed,this),i.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var i=this.hls;i.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(D.Events.BUFFER_RESET,this.onBufferReset,this),i.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(D.Events.BUFFER_EOS,this.onBufferEos,this),i.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(D.Events.FRAG_PARSED,this.onFragParsed,this),i.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(i,t){var d=2;(t.audio&&!t.video||!t.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,T.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(i,t){var d=this.media=t.media;if(d&&s){var v=this.mediaSource=new s;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(v),this._objectUrl=d.src}},l.onMediaDetaching=function(){var i=this.media,t=this.mediaSource,d=this._objectUrl;if(t){if(T.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){T.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(d&&self.URL.revokeObjectURL(d),i.src===d?(i.removeAttribute("src"),i.load()):T.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(D.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(t){var d=i.sourceBuffer[t];try{d&&(i.removeBufferListeners(t),i.mediaSource&&i.mediaSource.removeSourceBuffer(d),i.sourceBuffer[t]=void 0)}catch(v){T.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},l.onBufferCodecs=function(i,t){var d=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(y){if(v){var b=d.tracks[y];if(b&&typeof b.buffer.changeType=="function"){var g=t[y],m=g.codec,_=g.levelCodec,x=g.container,h=(b.levelCodec||b.codec).replace(n,"$1"),E=(_||m).replace(n,"$1");if(h!==E){var S=x+";codecs="+(_||m);d.appendChangeType(y,S)}}}else d.pendingTracks[y]=t[y]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(i,t){var d=this,v=this.operationQueue,y={execute:function(){var g=d.sourceBuffer[i];g&&(T.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+t),g.changeType(t)),v.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(g){T.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",g)}};v.append(y,i)},l.onBufferAppending=function(i,t){var d=this,v=this.hls,y=this.operationQueue,b=this.tracks,g=t.data,m=t.type,_=t.frag,x=t.part,h=t.chunkMeta,E=h.buffering[m],S=self.performance.now();E.start=S;var w=_.stats.buffering,R=x?x.stats.buffering:null;w.start===0&&(w.start=S),R&&R.start===0&&(R.start=S);var N=b.audio,F=m==="audio"&&h.id===1&&(N==null?void 0:N.container)==="audio/mpeg",z={execute:function(){if(E.executeStart=self.performance.now(),F){var B=d.sourceBuffer[m];if(B){var M=_.start-B.timestampOffset;Math.abs(M)>=.1&&(T.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+M+") sn: "+_.sn+")"),B.timestampOffset=_.start)}}d.appendExecutor(g,m)},onStart:function(){},onComplete:function(){var B=self.performance.now();E.executeEnd=E.end=B,w.first===0&&(w.first=B),R&&R.first===0&&(R.first=B);var M=d.sourceBuffer,G={};for(var J in M)G[J]=O.BufferHelper.getBuffered(M[J]);d.appendError=0,d.hls.trigger(D.Events.BUFFER_APPENDED,{type:m,frag:_,part:x,chunkMeta:h,parent:_.type,timeRanges:G})},onError:function(B){T.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",B);var M={type:A.ErrorTypes.MEDIA_ERROR,parent:_.type,details:A.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?M.details=A.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,M.details=A.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>v.config.appendErrorMaxRetry&&(T.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),M.fatal=!0)),v.trigger(D.Events.ERROR,M)}};y.append(z,m)},l.onBufferFlushing=function(i,t){var d=this,v=this.operationQueue,y=function(g){return{execute:d.removeExecutor.bind(d,g,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(D.Events.BUFFER_FLUSHED,{type:g})},onError:function(_){T.logger.warn("[buffer-controller]: Failed to remove from "+g+" SourceBuffer",_)}}};t.type?v.append(y(t.type),t.type):this.getSourceBufferTypes().forEach(function(b){v.append(y(b),b)})},l.onFragParsed=function(i,t){var d=this,v=t.frag,y=t.part,b=[],g=y?y.elementaryStreams:v.elementaryStreams;g[p.ElementaryStreamTypes.AUDIOVIDEO]?b.push("audiovideo"):(g[p.ElementaryStreamTypes.AUDIO]&&b.push("audio"),g[p.ElementaryStreamTypes.VIDEO]&&b.push("video"));var m=function(){var x=self.performance.now();v.stats.buffering.end=x,y&&(y.stats.buffering.end=x);var h=y?y.stats:v.stats;d.hls.trigger(D.Events.FRAG_BUFFERED,{frag:v,part:y,stats:h,id:v.type})};b.length===0&&T.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(m,b)},l.onFragChanged=function(i,t){this.flushBackBuffer()},l.onBufferEos=function(i,t){var d=this,v=this.getSourceBufferTypes().reduce(function(y,b){var g=d.sourceBuffer[b];return(!t.type||t.type===b)&&(g&&!g.ended&&(g.ended=!0,T.logger.log("[buffer-controller]: "+b+" sourceBuffer now EOS"))),y&&!!(!g||g.ended)},!0);v&&this.blockBuffers(function(){var y=d.mediaSource;if(!y||y.readyState!=="open")return;y.endOfStream()})},l.onLevelUpdated=function(i,t){var d=t.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var i=this.hls,t=this.details,d=this.media,v=this.sourceBuffer;if(!d||t===null)return;var y=this.getSourceBufferTypes();if(!y.length)return;var b=t.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(C.isFiniteNumber)(b)||b<0)return;var g=d.currentTime,m=t.levelTargetDuration,_=Math.max(b,m),x=Math.floor(g/m)*m-_;y.forEach(function(h){var E=v[h];if(E){var S=O.BufferHelper.getBuffered(E);S.length>0&&x>S.start(0)&&(i.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:x}),t.live&&i.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:x}),i.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:x,type:h}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,t=this.hls,d=this.media,v=this.mediaSource,y=i.fragments[0].start+i.totalduration,b=d.duration,g=Object(C.isFiniteNumber)(v.duration)?v.duration:0;i.live&&t.config.liveDurationInfinity?(T.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(i)):(y>g&&y>b||!Object(C.isFiniteNumber)(b))&&(T.logger.log("[buffer-controller]: Updating Media Source duration to "+y.toFixed(3)),v.duration=y)},l.updateSeekableRange=function(i){var t=this.mediaSource,d=i.fragments,v=d.length;if(v&&i.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var y=Math.max(0,d[0].start),b=Math.max(y,y+i.totalduration);t.setLiveSeekableRange(y,b)}},l.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,t=this.operationQueue,d=this.pendingTracks,v=Object.keys(d).length;if(v&&!i||v===2){this.createSourceBuffers(d),this.pendingTracks={};var y=this.getSourceBufferTypes();if(y.length===0){this.hls.trigger(D.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}y.forEach(function(b){t.executeNext(b)})}},l.createSourceBuffers=function(i){var t=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var y in i)if(!t[y]){var b=i[y];if(!b)throw Error("source buffer exists for track "+y+", however track does not");var g=b.levelCodec||b.codec,m=b.container+";codecs="+g;T.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var _=t[y]=d.addSourceBuffer(m),x=y;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[y]={buffer:_,codec:g,container:b.container,levelCodec:b.levelCodec,id:b.id},v++}catch(h){T.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(D.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:m})}}v&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(i){var t=this.operationQueue,d=t.current(i);d.onStart()},l._onSBUpdateEnd=function(i){var t=this.operationQueue,d=t.current(i);d.onComplete(),t.shiftAndExecuteNext(i)},l._onSBUpdateError=function(i,t){T.logger.error("[buffer-controller]: "+i+" SourceBuffer error",t),this.hls.trigger(D.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(i);d&&d.onError(t)},l.removeExecutor=function(i,t,d){var v=this.media,y=this.mediaSource,b=this.operationQueue,g=this.sourceBuffer,m=g[i];if(!v||!y||!m){T.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),b.shiftAndExecuteNext(i);return}var _=Object(C.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Object(C.isFiniteNumber)(y.duration)?y.duration:Infinity,h=Math.max(0,t),E=Math.min(d,_,x);E>h?(T.logger.log("[buffer-controller]: Removing ["+h+","+E+"] from the "+i+" SourceBuffer"),console.assert(!m.updating,i+" sourceBuffer must not be updating"),m.remove(h,E)):b.shiftAndExecuteNext(i)},l.appendExecutor=function(i,t){var d=this.operationQueue,v=this.sourceBuffer,y=v[t];if(!y){T.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(t);return}y.ended=!1,console.assert(!y.updating,t+" sourceBuffer must not be updating"),y.appendBuffer(i)},l.blockBuffers=function(i,t){var d=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){T.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var v=this.operationQueue,y=t.map(function(b){return v.appendBlocker(b)});Promise.all(y).then(function(){i(),t.forEach(function(b){var g=d.sourceBuffer[b];(!g||!g.updating)&&v.shiftAndExecuteNext(b)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(i,t,d){var v=this.sourceBuffer[i];if(!v)return;var y=d.bind(this,i);this.listeners[i].push({event:t,listener:y}),v.addEventListener(t,y)},l.removeBufferListeners=function(i){var t=this.sourceBuffer[i];if(!t)return;this.listeners[i].forEach(function(d){t.removeEventListener(d.event,d.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return D});var C=W("./src/utils/logger.ts"),D=function(){function T(O){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=O}var A=T.prototype;return A.append=function(f,p){var c=this.queues[p];c.push(f),c.length===1&&this.buffers[p]&&this.executeNext(p)},A.insertAbort=function(f,p){var c=this.queues[p];c.unshift(f),this.executeNext(p)},A.appendBlocker=function(f){var p,c=new Promise(function(n){p=n}),s={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(s,f),c},A.executeNext=function(f){var p=this.buffers,c=this.queues,s=p[f],n=c[f];if(n.length){var o=n[0];try{o.execute()}catch(r){C.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(r),(!s||!s.updating)&&(n.shift(),this.executeNext(f))}}},A.shiftAndExecuteNext=function(f){this.queues[f].shift(),this.executeNext(f)},A.current=function(f){return this.queues[f][0]},T}()},"./src/controller/cap-level-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts");function D(O,f){for(var p=0;p0&&this.mediaWidth>0){var c=this.hls.levels;if(c.length){var s=this.hls;s.autoLevelCapping=this.getMaxLevel(c.length-1),s.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=s.autoLevelCapping}}},f.getMaxLevel=function(c){var s=this,n=this.hls.levels;if(!n.length)return-1;var o=n.filter(function(r,l){return O.isLevelAllowed(l,s.restrictedLevels)&&l<=c});return this.clientRect=null,O.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},f.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()},f.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},f.getDimensions=function(){if(this.clientRect)return this.clientRect;var c=this.media,s={width:0,height:0};if(c){var n=c.getBoundingClientRect();s.width=n.width,s.height=n.height,!s.width&&!s.height&&(s.width=n.right-n.left||c.width||0,s.height=n.bottom-n.top||c.height||0)}return this.clientRect=s,s},O.isLevelAllowed=function(c,s){return s===void 0&&(s=[]),s.indexOf(c)===-1},O.getMaxLevelByMediaSize=function(c,s,n){if(!c||!c.length)return-1;for(var o=function(t,d){return d?t.width!==d.width||t.height!==d.height:!0},r=c.length-1,l=0;l=s||a.height>=n)&&o(a,c[l+1])){r=l;break}}return r},T(O,[{key:"mediaWidth",get:function(){return this.getDimensions().width*O.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*O.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var c=1;try{c=self.devicePixelRatio}catch(s){}return c}}]),O}();ie.default=A},"./src/controller/cmcd-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o});var C=W("./src/events.ts"),D=W("./src/types/cmcd.ts"),T=W("./src/utils/buffer-helper.ts"),A=W("./src/utils/logger.ts");function O(r,l){for(var a=0;a=r.length?{done:!0}:{done:!1,value:r[i++]}}}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 c(r,l){if(!r)return;if(typeof r=="string")return s(r,l);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return s(r,l)}function s(r,l){(l==null||l>r.length)&&(l=r.length);for(var a=0,i=new Array(l);at&&(t=b.bitrate)}return t>0?t:NaN},l.getBufferLength=function(i){var t=this.hls.media,d=i===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!t)return NaN;var v=T.BufferHelper.bufferInfo(d,t.currentTime,this.config.maxBufferHole);return v.len*1e3},l.createPlaylistLoader=function(){var i=this.config.pLoader,t=this.applyPlaylistData,d=i||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new d(b)}var y=v.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(g,m,_){t(g),this.loader.load(g,m,_)},f(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},l.createFragmentLoader=function(){var i=this.config.fLoader,t=this.applyFragmentData,d=i||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new d(b)}var y=v.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(g,m,_){t(g),this.loader.load(g,m,_)},f(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},r.uuid=function(){var i=URL.createObjectURL(new Blob),t=i.toString();return URL.revokeObjectURL(i),t.substr(t.lastIndexOf("/")+1)},r.serialize=function(i){for(var t=[],d=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},v=function(F){return Math.round(F)},y=function(F){return v(F/100)*100},b=function(F){return encodeURIComponent(F)},g={br:v,d:v,bl:y,dl:y,mtp:y,nor:b,rtp:y,tb:v},m=Object.keys(i||{}).sort(),_=p(m),x;!(x=_()).done;){var h=x.value,E=i[h];if(!d(E))continue;if(h==="v"&&E===1)continue;if(h=="pr"&&E===1)continue;var S=g[h];S&&(E=S(E));var w=typeof E,R=void 0;h==="ot"||h==="sf"||h==="st"?R=h+"="+E:w==="boolean"?R=h:w==="number"?R=h+"="+E:R=h+"="+JSON.stringify(E),t.push(R)}return t.join(",")},r.toHeaders=function(i){for(var t=Object.keys(i),d={},v=["Object","Request","Session","Status"],y=[{},{},{},{}],b={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},g=0,m=t;gp){this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var b=p-this._requestLicenseFailureCount+1;T.logger.warn("Retrying license request, "+b+" attempts left"),this._requestLicense(t,d)}break}},r._generateLicenseRequestChallenge=function(a,i){switch(a.mediaKeySystemDomain){case A.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},r._requestLicense=function(a,i){T.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){T.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(d,a,i);T.logger.log("Sending license request to URL: "+d);var y=this._generateLicenseRequestChallenge(t,a);v.send(y)}catch(b){T.logger.error("Failure requesting DRM license: "+b),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(a,i){if(!this._emeEnabled)return;var t=i.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var a=this._media,i=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(a,i){if(!this._emeEnabled)return;var t=i.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),d=i.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(A.KeySystems.WIDEVINE,t,d)},f(o,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),o}();ie.default=n},"./src/controller/fps-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/utils/logger.ts"),T=function(){function A(f){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=f,this.registerListeners()}var O=A.prototype;return O.setStreamController=function(p){this.streamController=p},O.registerListeners=function(){this.hls.on(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},O.unregisterListeners=function(){this.hls.off(C.Events.MEDIA_ATTACHING,this.onMediaAttaching)},O.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},O.onMediaAttaching=function(p,c){var s=this.hls.config;if(s.capLevelOnFPSDrop){var n=c.media instanceof self.HTMLVideoElement?c.media:null;this.media=n,n&&typeof n.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}},O.checkFPS=function(p,c,s){var n=performance.now();if(c){if(this.lastTime){var o=n-this.lastTime,r=s-this.lastDroppedFrames,l=c-this.lastDecodedFrames,a=1e3*r/o,i=this.hls;if(i.trigger(C.Events.FPS_DROP,{currentDropped:r,currentDecoded:l,totalDroppedFrames:s}),a>0&&r>i.config.fpsDroppedMonitoringThreshold*l){var t=i.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=t)&&(t=t-1,i.trigger(C.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:i.currentLevel}),i.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=s,this.lastDecodedFrames=c}},O.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var c=p.getVideoPlaybackQuality();this.checkFPS(p,c.totalVideoFrames,c.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},A}();ie.default=T},"./src/controller/fragment-finders.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"findFragmentByPDT",function(){return T}),W.d(ie,"findFragmentByPTS",function(){return A}),W.d(ie,"fragmentWithinToleranceTest",function(){return O}),W.d(ie,"pdtWithinToleranceTest",function(){return f}),W.d(ie,"findFragWithCC",function(){return p});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/binary-search.ts");function T(c,s,n){if(s===null||!Array.isArray(c)||!c.length||!Object(C.isFiniteNumber)(s))return null;var o=c[0].programDateTime;if(s<(o||0))return null;var r=c[c.length-1].endProgramDateTime;if(s>=(r||0))return null;n=n||0;for(var l=0;lc&&n.start?-1:0}function f(c,s,n){var o=Math.min(s,n.duration+(n.deltaPTS?n.deltaPTS:0))*1e3,r=n.endProgramDateTime||0;return r-o>c}function p(c,s){return D.default.search(c,function(n){return n.ccs?-1:0})}},"./src/controller/fragment-tracker.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"FragmentState",function(){return T}),W.d(ie,"FragmentTracker",function(){return A});var C=W("./src/events.ts"),D=W("./src/types/loader.ts"),T;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(T||(T={}));var A=function(){function p(s){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=s,this._registerListeners()}var c=p.prototype;return c._registerListeners=function(){var n=this.hls;n.on(C.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.on(C.Events.FRAG_LOADED,this.onFragLoaded,this)},c._unregisterListeners=function(){var n=this.hls;n.off(C.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.off(C.Events.FRAG_LOADED,this.onFragLoaded,this)},c.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},c.getAppendedFrag=function(n,o){if(o===D.PlaylistLevelType.MAIN){var r=this.activeFragment,l=this.activeParts;if(!r)return null;if(l)for(var a=l.length;a--;){var i=l[a],t=i?i.end:r.appendedPTS;if(i.start<=n&&t!==void 0&&n<=t)return a>9&&(this.activeParts=l.slice(a-9)),i}else if(r.start<=n&&r.appendedPTS!==void 0&&n<=r.appendedPTS)return r}return this.getBufferedFrag(n,o)},c.getBufferedFrag=function(n,o){for(var r=this.fragments,l=Object.keys(r),a=l.length;a--;){var i=r[l[a]];if((i==null?void 0:i.body.type)===o&&i.buffered){var t=i.body;if(t.start<=n&&n<=t.end)return t}}return null},c.detectEvictedFragments=function(n,o,r){var l=this;Object.keys(this.fragments).forEach(function(a){var i=l.fragments[a];if(!i)return;if(!i.buffered){i.body.type===r&&l.removeFragment(i.body);return}var t=i.range[n];if(!t)return;t.time.some(function(d){var v=!l.isTimeBuffered(d.startPTS,d.endPTS,o);return v&&l.removeFragment(i.body),v})})},c.detectPartialFragments=function(n){var o=this,r=this.timeRanges,l=n.frag,a=n.part;if(!r||l.sn==="initSegment")return;var i=f(l),t=this.fragments[i];if(!t)return;Object.keys(r).forEach(function(d){var v=l.elementaryStreams[d];if(!v)return;var y=r[d],b=a!==null||v.partial===!0;t.range[d]=o.getBufferedTimes(l,a,b,y)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},c.fragBuffered=function(n){var o=f(n),r=this.fragments[o];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},c.getBufferedTimes=function(n,o,r,l){for(var a={time:[],partial:r},i=o?o.start:n.start,t=o?o.end:n.end,d=n.minEndPTS||t,v=n.maxStartPTS||i,y=0;y=b&&d<=g){a.time.push({startPTS:Math.max(i,l.start(y)),endPTS:Math.min(t,l.end(y))});break}else if(ib)a.partial=!0,a.time.push({startPTS:Math.max(i,l.start(y)),endPTS:Math.min(t,l.end(y))});else if(t<=b)break}return a},c.getPartialFragment=function(n){var o=null,r,l,a,i=0,t=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(v){var y=d[v];if(!y)return;O(y)&&(l=y.body.start-t,a=y.body.end+t,n>=l&&n<=a&&(r=Math.min(n-l,a-n),i<=r&&(o=y.body,i=r)))}),o},c.getState=function(n){var o=f(n),r=this.fragments[o];return r?r.buffered?O(r)?T.PARTIAL:T.OK:r.backtrack?T.BACKTRACKED:T.APPENDING:T.NOT_LOADED},c.backtrack=function(n,o){var r=f(n),l=this.fragments[r];if(!l||l.backtrack)return null;var a=l.backtrack=o||l.loaded;return l.loaded=null,a},c.getBacktrackData=function(n){var o=f(n),r=this.fragments[o];if(r){var l,a=r.backtrack;if(a!=null&&(l=a.payload)!==null&&l!==void 0&&l.byteLength)return a;this.removeFragment(n)}return null},c.isTimeBuffered=function(n,o,r){for(var l,a,i=0;i=l&&o<=a)return!0;if(o<=l)return!1}return!1},c.onFragLoaded=function(n,o){var r=o.frag,l=o.part;if(r.sn==="initSegment"||r.bitrateTest||l)return;var a=f(r);this.fragments[a]={body:r,loaded:o,backtrack:null,buffered:!1,range:Object.create(null)}},c.onBufferAppended=function(n,o){var r=this,l=o.frag,a=o.part,i=o.timeRanges;if(l.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=l,a){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(a)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(d){var v=i[d];if(r.detectEvictedFragments(d,v),!a)for(var y=0;yn&&l.removeFragment(t)}})},c.removeFragment=function(n){var o=f(n);n.stats.loaded=0,n.clearElementaryStreamInfo(),delete this.fragments[o]},c.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function O(p){var c,s;return p.buffered&&(((c=p.range.video)===null||c===void 0?void 0:c.partial)||((s=p.range.audio)===null||s===void 0?void 0:s.partial))}function f(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"STALL_MINIMUM_DURATION_MS",function(){return O}),W.d(ie,"MAX_START_GAP_JUMP",function(){return f}),W.d(ie,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),W.d(ie,"SKIP_BUFFER_RANGE_START",function(){return c}),W.d(ie,"default",function(){return s});var C=W("./src/utils/buffer-helper.ts"),D=W("./src/errors.ts"),T=W("./src/events.ts"),A=W("./src/utils/logger.ts"),O=250,f=2,p=.1,c=.05,s=function(){function n(r,l,a,i){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=l,this.fragmentTracker=a,this.hls=i}var o=n.prototype;return o.destroy=function(){this.hls=this.fragmentTracker=this.media=null},o.poll=function(l){var a=this.config,i=this.media,t=this.stalled,d=i.currentTime,v=i.seeking,y=this.seeking&&!v,b=!this.seeking&&v;if(this.seeking=v,d!==l){if(this.moved=!0,t!==null){if(this.stallReported){var g=self.performance.now()-t;A.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(g)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((b||y)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!C.BufferHelper.getBuffered(i).length)return;var m=C.BufferHelper.bufferInfo(i,d,0),_=m.len>0,x=m.nextStart||0;if(!_&&!x)return;if(v){var h=m.len>f,E=!x||x-d>f&&!this.fragmentTracker.getPartialFragment(d);if(h||E)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,w=Math.max(x,m.start||0)-d,R=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=R==null||((S=R.details)===null||S===void 0)?void 0:S.live,F=N?R.details.targetduration*2:f;if(w>0&&w<=F){this._trySkipBufferHole(null);return}}var z=self.performance.now();if(t===null){this.stalled=z;return}var q=z-t;!v&&q>=O&&this._reportStall(m.len);var B=C.BufferHelper.bufferInfo(i,d,a.maxBufferHole);this._tryFixBufferStall(B,q)},o._tryFixBufferStall=function(l,a){var i=this.config,t=this.fragmentTracker,d=this.media,v=d.currentTime,y=t.getPartialFragment(v);if(y){var b=this._trySkipBufferHole(y);if(b)return}l.len>i.maxBufferHole&&a>i.highBufferWatchdogPeriod*1e3&&(A.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},o._reportStall=function(l){var a=this.hls,i=this.media,t=this.stallReported;t||(this.stallReported=!0,A.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+l+")"),a.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},o._trySkipBufferHole=function(l){for(var a=this.config,i=this.hls,t=this.media,d=t.currentTime,v=0,y=C.BufferHelper.getBuffered(t),b=0;b=v&&d.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,i)),g=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;n.playbackRate=Math.min(b,Math.max(1,g))}else n.playbackRate!==1&&n.playbackRate!==0&&(n.playbackRate=1)},c.estimateLiveEdge=function(){var n=this.levelDetails;return n===null?null:n.edge+n.age},c.computeLatency=function(){var n=this.estimateLiveEdge();return n===null?null:n-this.currentTime},O(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var n=this.config,o=this.levelDetails;return n.liveMaxLatencyDuration!==void 0?n.liveMaxLatencyDuration:o?n.liveMaxLatencyDurationCount*o.targetduration:0}},{key:"targetLatency",get:function(){var n=this.levelDetails;if(n===null)return null;var o=n.holdBack,r=n.partHoldBack,l=n.targetduration,a=this.config,i=a.liveSyncDuration,t=a.liveSyncDurationCount,d=a.lowLatencyMode,v=this.hls.userConfig,y=d&&r||o;(v.liveSyncDuration||v.liveSyncDurationCount||y===0)&&(y=i!==void 0?i:t*l);var b=l,g=1;return y+Math.min(this.stallCount*g,b)}},{key:"liveSyncPosition",get:function(){var n=this.estimateLiveEdge(),o=this.targetLatency,r=this.levelDetails;if(n===null||o===null||r===null)return null;var l=r.edge,a=n-o-this.edgeStalled,i=l-r.totalduration,t=l-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(i,a),t)}},{key:"drift",get:function(){var n=this.levelDetails;return n===null?1:n.drift}},{key:"edgeStalled",get:function(){var n=this.levelDetails;if(n===null)return 0;var o=(this.config.lowLatencyMode&&n.partTarget||n.targetduration)*3;return Math.max(n.age-o,0)}},{key:"forwardBufferLength",get:function(){var n=this.media,o=this.levelDetails;if(!n||!o)return 0;var r=n.buffered.length;return r?n.buffered.end(r-1):o.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return a});var C=W("./src/types/level.ts"),D=W("./src/events.ts"),T=W("./src/errors.ts"),A=W("./src/utils/codecs.ts"),O=W("./src/controller/level-helper.ts"),f=W("./src/controller/base-playlist-controller.ts"),p=W("./src/types/loader.ts");function c(){return c=Object.assign||function(i){for(var t=1;t0){x=g[0].bitrate,g.sort(function(q,B){return q.bitrate-B.bitrate}),this._levels=g;for(var N=0;Nthis.hls.config.fragLoadingMaxRetry&&(h=b.frag.level)):h=b.frag.level}break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:g&&(g.deliveryDirectives&&(x=!1),h=g.level),_=!0;break;case T.ErrorDetails.REMUX_ALLOC_ERROR:h=b.level,_=!0;break}h!==void 0&&this.recoverLevel(b,h,_,x)},d.recoverLevel=function(y,b,g,m){var _=y.details,x=this._levels[b];if(x.loadError++,g){var h=this.retryLoadingOrFail(y);if(h)y.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var E=x.url.length;if(E>1&&x.loadError1){var m=(b.urlId+1)%g;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(_){_.urlId=m}),this.level=y}},d.onFragLoaded=function(y,b){var g=b.frag;if(g!==void 0&&g.type===p.PlaylistLevelType.MAIN){var m=this._levels[g.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},d.onLevelLoaded=function(y,b){var g,m=b.level,_=b.details,x=this._levels[m];if(!x){var h;this.warn("Invalid level index "+m),(h=b.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(_.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(x.fragmentError===0&&(x.loadError=0,this.retryCount=0),this.playlistLoaded(m,b,x.details)):(g=b.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(_.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(y,b){var g=this.hls.levels[this.currentLevelIndex];if(!g)return;if(g.audioGroupIds){for(var m=-1,_=this.hls.audioTracks[b.id].groupId,x=0;x0){var m=g.urlId,_=g.url[m];if(y)try{_=y.addDirectives(_)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Attempt loading level index "+b+(y?" at sn "+y.msn+" part "+y.part:"")+" with URL-id "+m+" "+_),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:_,level:b,id:m,deliveryDirectives:y||null})}},d.removeLevel=function(y,b){var g=function(x,h){return h!==b},m=this._levels.filter(function(_,x){return x!==y?!0:_.url.length>1&&b!==void 0?(_.url=_.url.filter(g),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(g)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(g)),_.urlId=0,!0):!1}).map(function(_,x){var h=_.details;return h!=null&&h.fragments&&h.fragments.forEach(function(E){E.level=x}),_});this._levels=m,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:m})},n(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(y){var b,g=this._levels;if(g.length===0)return;if(this.currentLevelIndex===y&&(b=g[y])!==null&&b!==void 0&&b.details)return;if(y<0||y>=g.length){var m=y<0;if(this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.OTHER_ERROR,details:T.ErrorDetails.LEVEL_SWITCH_ERROR,level:y,fatal:m,reason:"invalid level idx"}),m)return;y=Math.min(y,g.length-1)}this.clearTimer();var _=this.currentLevelIndex,x=g[_],h=g[y];this.log("switching to level "+y+" from "+_),this.currentLevelIndex=y;var E=c({},h,{level:y,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete E._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,E);var S=h.details;if(!S||S.live){var w=this.switchParams(h.uri,x==null?void 0:x.details);this.loadPlaylist(w)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(y){this.manualLevelIndex=y,this._startLevel===void 0&&(this._startLevel=y),y!==-1&&(this.level=y)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(y){this._firstLevel=y}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var y=this.hls.config.startLevel;return y!==void 0?y:this._firstLevel}else return this._startLevel},set:function(y){this._startLevel=y}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(y){this.level=y,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=y)}}]),t}(f.default)},"./src/controller/level-helper.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"addGroupId",function(){return T}),W.d(ie,"assignTrackIdsByGroup",function(){return A}),W.d(ie,"updatePTS",function(){return O}),W.d(ie,"updateFragPTSDTS",function(){return p}),W.d(ie,"mergeDetails",function(){return c}),W.d(ie,"mapPartIntersection",function(){return s}),W.d(ie,"mapFragmentIntersection",function(){return n}),W.d(ie,"adjustSliding",function(){return o}),W.d(ie,"addSliding",function(){return r}),W.d(ie,"computeReloadInterval",function(){return l}),W.d(ie,"getFragmentWithSN",function(){return a}),W.d(ie,"getPartWith",function(){return i});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/logger.ts");function T(t,d,v){switch(d){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(v);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(v);break}}function A(t){var d={};t.forEach(function(v){var y=v.groupId||"";v.id=d[y]=d[y]||0,d[y]++})}function O(t,d,v){var y=t[d],b=t[v];f(y,b)}function f(t,d){var v=d.startPTS;if(Object(C.isFiniteNumber)(v)){var y=0,b;d.sn>t.sn?(y=v-t.start,b=t):(y=t.start-v,b=d),b.duration!==y&&(b.duration=y)}else if(d.sn>t.sn){var g=t.cc===d.cc;g&&t.minEndPTS?d.start=t.start+(t.minEndPTS-t.start):d.start=t.start+t.duration}else d.start=Math.max(t.start-d.duration,0)}function p(t,d,v,y,b,g){var m=y-v;m<=0&&(D.logger.warn("Fragment should have a positive duration",d),y=v+d.duration,g=b+d.duration);var _=v,x=y,h=d.startPTS,E=d.endPTS;if(Object(C.isFiniteNumber)(h)){var S=Math.abs(h-v);Object(C.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(S,d.deltaPTS):d.deltaPTS=S,_=Math.max(v,h),v=Math.min(v,h),b=Math.min(b,d.startDTS),x=Math.min(y,E),y=Math.max(y,E),g=Math.max(g,d.endDTS)}d.duration=y-v;var w=v-d.start;d.appendedPTS=y,d.start=d.startPTS=v,d.maxStartPTS=_,d.startDTS=b,d.endPTS=y,d.minEndPTS=x,d.endDTS=g;var R=d.sn;if(!t||Rt.endSN)return 0;var N,F=R-t.startSN,z=t.fragments;for(z[F]=d,N=F;N>0;N--)f(z[N],z[N-1]);for(N=F;N=0;b--){var g=y[b].initSegment;if(g){v=g;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var m=0,_;if(n(t,d,function(N,F){N.relurl&&(m=N.cc-F.cc),Object(C.isFiniteNumber)(N.startPTS)&&Object(C.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(_=F),d.PTSKnown=d.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,v=N.initSegment)}),v){var x=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;x.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=v)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=v)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(N){return!N}),d.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=d.skippedSegments;h--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var E=d.fragments;if(m){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S=y.length)return;r(d,y[v].start)}function r(t,d){if(d){for(var v=t.fragments,y=t.skippedSegments;y0&&b0&&x===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),x=h),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,b.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var x,h=this.levels,E=this.level,S=h==null||((x=h[E])===null||x===void 0)?void 0:x.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var w,R=self.performance.now(),N=this.retryDate;(!N||R>=N||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){b.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var x,h,E=this.hls,S=this.levelLastLoaded,w=this.levels,R=this.media,N=E.config,F=E.nextLoadLevel;if(S===null||!R&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!w||!w[F])return;var z=w[F];this.level=E.nextLoadLevel=F;var q=z.details;if(!q||this.state===D.State.WAITING_LEVEL||q.live&&this.levelLastLoaded!==F){this.state=D.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:R,p.PlaylistLevelType.MAIN);if(B===null)return;var M=B.len,G=this.getMaxBufferLength(z.maxBitrate);if(M>=G)return;if(this._streamEnded(B,q)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(A.Events.BUFFER_EOS,J),this.state=D.State.ENDED;return}var K=B.end,Z=this.getNextFragment(K,q);if(this.couldBacktrack&&!this.fragPrevious&&Z&&Z.sn!=="initSegment"){var le=Z.sn-q.startSN;le>1&&(Z=q.fragments[le-1],this.fragmentTracker.removeFragment(Z))}if(Z&&this.fragmentTracker.getState(Z)===f.FragmentState.OK&&this.nextLoadPosition>K){var de=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(R,de,p.PlaylistLevelType.MAIN),Z=this.getNextFragment(this.nextLoadPosition,q)}if(!Z)return;Z.initSegment&&!Z.initSegment.data&&!this.bitrateTest&&(Z=Z.initSegment),((x=Z.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((h=Z.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(Z,q):this.loadFragment(Z,q,K)},m.loadFragment=function(x,h,E){var S,w=this.fragmentTracker.getState(x);if(this.fragCurrent=x,w===f.FragmentState.BACKTRACKED){var R=this.fragmentTracker.getBacktrackData(x);if(R){this._handleFragmentLoadProgress(R),this._handleFragmentLoadComplete(R);return}else w=f.FragmentState.NOT_LOADED}w===f.FragmentState.NOT_LOADED||w===f.FragmentState.PARTIAL?x.sn==="initSegment"?this._loadInitSegment(x):this.bitrateTest?(x.bitrateTest=!0,this.log("Fragment "+x.sn+" of level "+x.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(x)):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,x,h,E)):w===f.FragmentState.APPENDING?this.reduceMaxBufferLength(x.duration)&&this.fragmentTracker.removeFragment(x):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(x){var h=this.fragmentTracker.getAppendedFrag(x,p.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},m.getBufferedFrag=function(x){return this.fragmentTracker.getBufferedFrag(x,p.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(x){return x?this.getBufferedFrag(x.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var x=this.levels,h=this.media;if(h!=null&&h.readyState){var E,S=this.getAppendedFrag(h.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!h.paused&&x){var w=this.hls.nextLoadLevel,R=x[w],N=this.fragLastKbps;N&&this.fragCurrent?E=this.fragCurrent.duration*R.maxBitrate/(1e3*N)+1:E=0}else E=0;var F=this.getBufferedFrag(h.currentTime+E);if(F){var z=this.followingBufferedFrag(F);if(z){this.abortCurrentFrag();var q=z.maxStartPTS?z.maxStartPTS:z.start,B=z.duration,M=Math.max(F.end,q+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(M,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var x=this.fragCurrent;this.fragCurrent=null,x!=null&&x.loader&&x.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(x,h){b.prototype.flushMainBuffer.call(this,x,h,this.altAudio?"video":null)},m.onMediaAttached=function(x,h){b.prototype.onMediaAttached.call(this,x,h);var E=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),E.addEventListener("playing",this.onvplaying),E.addEventListener("seeked",this.onvseeked),this.gapController=new o.default(this.config,E,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var x=this.media;x&&(x.removeEventListener("playing",this.onvplaying),x.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),b.prototype.onMediaDetaching.call(this)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var x=this.media,h=x?x.currentTime:null;Object(C.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(A.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},m.onManifestParsed=function(x,h){var E=!1,S=!1,w;h.levels.forEach(function(R){w=R.audioCodec,w&&(w.indexOf("mp4a.40.2")!==-1&&(E=!0),w.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=E&&S&&!Object(T.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},m.onLevelLoading=function(x,h){var E=this.levels;if(!E||this.state!==D.State.IDLE)return;var S=E[h.level];(!S.details||S.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(S.details))&&(this.state=D.State.WAITING_LEVEL)},m.onLevelLoaded=function(x,h){var E,S=this.levels,w=h.level,R=h.details,N=R.totalduration;if(!S){this.warn("Levels were reset while loading level "+w);return}this.log("Level "+w+" loaded ["+R.startSN+","+R.endSN+"], cc ["+R.startCC+", "+R.endCC+"] duration:"+N);var F=this.fragCurrent;F&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==h.level&&F.loader&&(this.state=D.State.IDLE,F.loader.abort()));var z=S[w],q=0;if(R.live||(E=z.details)!==null&&E!==void 0&&E.live){if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed)return;q=this.alignPlaylists(R,z.details)}if(z.details=R,this.levelLastLoaded=w,this.hls.trigger(A.Events.LEVEL_UPDATED,{details:R,level:w}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(R))return;this.state=D.State.IDLE}this.startFragRequested?R.live&&this.synchronizeToLiveEdge(R):this.setStartPosition(R,q),this.tick()},m._handleFragmentLoadProgress=function(x){var h,E=x.frag,S=x.part,w=x.payload,R=this.levels;if(!R){this.warn("Levels were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var N=R[E.level],F=N.details;if(!F){this.warn("Dropping fragment "+E.sn+" of level "+E.level+" after level details were reset");return}var z=N.videoCodec,q=F.PTSKnown||!F.live,B=(h=E.initSegment)===null||h===void 0?void 0:h.data,M=this._getAudioCodec(N),G=this.transmuxer=this.transmuxer||new s.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=S?S.index:-1,K=J!==-1,Z=new n.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,w.byteLength,J,K),le=this.initPTS[E.cc];G.push(w,B,M,z,E,S,F.totalduration,q,Z,le)},m.onAudioTrackSwitching=function(x,h){var E=this.altAudio,S=!!h.url,w=h.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var R=this.fragCurrent;R!=null&&R.loader&&(this.log("Switching to main audio track, cancel main fragment load"),R.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;E&&N.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:w})}},m.onAudioTrackSwitched=function(x,h){var E=h.id,S=!!this.hls.audioTracks[E].url;if(S){var w=this.videoBuffer;w&&this.mediaBuffer!==w&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=w)}this.altAudio=S,this.tick()},m.onBufferCreated=function(x,h){var E=h.tracks,S,w,R=!1;for(var N in E){var F=E[N];if(F.id==="main"){if(w=N,S=F,N==="video"){var z=E[N];z&&(this.videoBuffer=z.buffer)}}else R=!0}R&&S?(this.log("Alternate track found, use "+w+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(x,h){var E=h.frag,S=h.part;if(E&&E.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(S?" p: "+S.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var w=S?S.stats:E.stats;this.fragLastKbps=Math.round(8*w.total/(w.buffering.end-w.loading.first)),E.sn!=="initSegment"&&(this.fragPrevious=E),this.fragBufferedComplete(E,S)},m.onError=function(x,h){switch(h.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(p.PlaylistLevelType.MAIN,h);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=D.State.ERROR):!h.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var E=!0,S=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);S&&S.len>.5&&(E=!this.reduceMaxBufferLength(S.len)),E&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var x=this.media,h=this.gapController;if(!x||!h||!x.readyState)return;var E=O.BufferHelper.getBuffered(x);!this.loadedmetadata&&E.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=x.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(x,h){var E=h.type;if(E!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(E===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,E,p.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(x,h){this.levels=h.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var x=this.media,h=x.currentTime,E=this.startPosition;if(E>=0&&h0&&(R1&&x.seeking===!1){var E=x.currentTime;if(O.BufferHelper.isBuffered(x,E)?h=this.getAppendedFrag(E):O.BufferHelper.isBuffered(x,E+.1)&&(h=this.getAppendedFrag(E+.1)),h){var S=this.fragPlaying,w=h.level;(!S||h.sn!==S.sn||S.level!==w||h.urlId!==S.urlId)&&(this.hls.trigger(A.Events.FRAG_CHANGED,{frag:h}),(!S||S.level!==w)&&this.hls.trigger(A.Events.LEVEL_SWITCHED,{level:w}),this.fragPlaying=h)}}},i(g,[{key:"nextLevel",get:function(){var x=this.nextBufferedFrag;return x?x.level:-1}},{key:"currentLevel",get:function(){var x=this.media;if(x){var h=this.getAppendedFrag(x.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var x=this.media;if(x){var h=this.getAppendedFrag(x.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),g}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"SubtitleStreamController",function(){return t});var C=W("./src/events.ts"),D=W("./src/utils/logger.ts"),T=W("./src/utils/buffer-helper.ts"),A=W("./src/controller/fragment-finders.ts"),O=W("./src/utils/discontinuities.ts"),f=W("./src/controller/level-helper.ts"),p=W("./src/controller/fragment-tracker.ts"),c=W("./src/controller/base-stream-controller.ts"),s=W("./src/types/loader.ts"),n=W("./src/types/level.ts");function o(d,v){for(var y=0;y=h[w].start&&S<=h[w].end){E=h[w];break}var R=_.start+_.duration;E?E.end=R:(E={start:S,end:R},h.push(E)),this.fragmentTracker.fragBuffered(_)},y.onBufferFlushing=function(g,m){var _=m.startOffset,x=m.endOffset;if(_===0&&x!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,E=this.levels;if(!E.length||!E[h]||!E[h].details)return;var S=E[h].details,w=S.targetduration,R=x-w;if(R<=0)return;m.endOffsetSubtitles=Math.max(0,R),this.tracksBuffered.forEach(function(N){for(var F=0;F=S.length||h!==E||!w)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,x.live||(_=w.details)!==null&&_!==void 0&&_.live){var R=this.mainDetails;if(x.deltaUpdateFailed||!R)return;var N=R.fragments[0];if(!w.details)x.hasProgramDateTime&&R.hasProgramDateTime?Object(O.alignMediaPlaylistByPDT)(x,R):N&&Object(f.addSliding)(x,N.start);else{var F=this.alignPlaylists(x,w.details);F===0&&N&&Object(f.addSliding)(x,N.start)}}if(w.details=x,this.levelLastLoaded=h,this.tick(),x.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE){var z=Object(A.findFragmentByPTS)(null,x.fragments,this.media.currentTime,0);z||(this.warn("Subtitle playlist not aligned with playback"),w.details=void 0)}},y._handleFragmentLoadComplete=function(g){var m=g.frag,_=g.payload,x=m.decryptdata,h=this.hls;if(this.fragContextChanged(m))return;if(_&&_.byteLength>0&&x&&x.key&&x.iv&&x.method==="AES-128"){var E=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),x.key.buffer,x.iv.buffer).then(function(S){var w=performance.now();h.trigger(C.Events.FRAG_DECRYPTED,{frag:m,payload:S,stats:{tstart:E,tdecrypt:w}})})}},y.doTick=function(){if(!this.media){this.state=c.State.IDLE;return}if(this.state===c.State.IDLE){var g,m=this.currentTrackId,_=this.levels;if(!_.length||!_[m]||!_[m].details)return;var x=_[m].details,h=x.targetduration,E=this.config,S=this.media,w=T.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-h,E.maxBufferHole),R=w.end,N=w.len,F=this.getMaxBufferLength()+h;if(N>F)return;console.assert(x,"Subtitle track details are defined on idle subtitle stream controller tick");var z=x.fragments,q=z.length,B=x.edge,M,G=this.fragPrevious;if(R-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)},l.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},l.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 i=n(this.media.textTracks);i.forEach(function(t){Object(D.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(i,t){this.tracks=t.subtitleTracks},l.onSubtitleTrackLoaded=function(i,t){var d=t.id,v=t.details,y=this.trackId,b=this.tracksInGroup[y];if(!b){this.warn("Invalid subtitle track id "+d);return}var g=b.details;b.details=t.details,this.log("subtitle track "+d+" loaded ["+v.startSN+"-"+v.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,t,g))},l.onLevelLoading=function(i,t){this.switchLevel(t.level)},l.onLevelSwitching=function(i,t){this.switchLevel(t.level)},l.switchLevel=function(i){var t=this.hls.levels[i];if(!(t!=null&&t.textGroupIds))return;var d=t.textGroupIds[t.urlId];if(this.groupId!==d){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,y=this.tracks.filter(function(m){return!d||m.groupId===d});this.tracksInGroup=y;var b=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=d;var g={subtitleTracks:y};this.log("Updating subtitle tracks, "+y.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(C.Events.SUBTITLE_TRACKS_UPDATED,g),b!==-1&&this.setSubtitleTrack(b,v)}},l.findTrackId=function(i){for(var t=this.tracksInGroup,d=0;d=v.length)return;this.clearTimer();var y=v[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,y){var b=y.id,g=y.groupId,m=g===void 0?"":g,_=y.name,x=y.type,h=y.url;this.hls.trigger(C.Events.SUBTITLE_TRACK_SWITCH,{id:b,groupId:m,name:_,type:x,url:h});var E=this.switchParams(y.url,t==null?void 0:t.details);this.loadPlaylist(E)}else this.hls.trigger(C.Events.SUBTITLE_TRACK_SWITCH,{id:i})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,t=n(this.media.textTracks),d=0;d=0&&(x[0]=Math.min(x[0],v),x[1]=Math.max(x[1],y),m=!0,h/(y-v)>.5))return}if(m||g.push([v,y]),this.config.renderTextTracksNatively){var E=this.captionsTracks[d];this.Cues.newCue(E,v,y,b)}else{var S=this.Cues.newCue(null,v,y,b);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:S,track:d})}},i.onInitPtsFound=function(d,v){var y=this,b=v.frag,g=v.id,m=v.initPTS,_=v.timescale,x=this.unparsedVttFrags;g==="main"&&(this.initPTS[b.cc]=m,this.timescale[b.cc]=_),x.length&&(this.unparsedVttFrags=[],x.forEach(function(h){y.onFragLoaded(D.Events.FRAG_LOADED,h)}))},i.getExistingTrack=function(d){var v=this.media;if(v)for(var y=0;y>>8^_&255^99,p[b]=_,c[_]=b;var x=y[b],h=y[x],E=y[h],S=y[_]*257^_*16843008;n[b]=S<<24|S>>>8,o[b]=S<<16|S>>>16,r[b]=S<<8|S>>>24,l[b]=S,S=E*16843009^h*65537^x*257^b*16843008,i[_]=S<<24|S>>>8,t[_]=S<<16|S>>>16,d[_]=S<<8|S>>>24,v[_]=S,b?(b=x^y[y[y[E^x]]],g^=y[y[g]]):b=g=1}},O.expandKey=function(p){for(var c=this.uint8ArrayToUint32Array_(p),s=!0,n=0;n>>6)+1;var S=(d[v+2]&60)>>>2;if(S>E.length-1){t.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return m=(d[v+2]&1)<<2,m|=(d[v+3]&192)>>>6,C.logger.log("manifest codec:"+y+", ADTS type:"+b+", samplingIndex:"+S),/firefox/i.test(x)?S>=6?(b=5,_=new Array(4),g=S-3):(b=2,_=new Array(2),g=S):x.indexOf("android")!==-1?(b=2,_=new Array(2),g=S):(b=5,_=new Array(4),y&&(y.indexOf("mp4a.40.29")!==-1||y.indexOf("mp4a.40.5")!==-1)||!y&&S>=6?g=S-3:((y&&y.indexOf("mp4a.40.2")!==-1&&(S>=6&&m===1||/vivaldi/i.test(x))||!y&&m===1)&&(b=2,_=new Array(2)),g=S)),_[0]=b<<3,_[0]|=(S&14)>>1,_[1]|=(S&1)<<7,_[1]|=m<<3,b===5&&(_[1]|=(g&14)>>1,_[2]=(g&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:E[S],channelCount:m,codec:"mp4a.40."+b,manifestCodec:h}}function O(t,d){return t[d]===255&&(t[d+1]&246)===240}function f(t,d){return t[d+1]&1?7:9}function p(t,d){return(t[d+3]&3)<<11|t[d+4]<<3|(t[d+5]&224)>>>5}function c(t,d){return d+5=t.length)return!1;var y=p(t,d);if(y<=v)return!1;var b=d+y;return b===t.length||s(t,b)}return!1}function r(t,d,v,y,b){if(!t.samplerate){var g=A(d,v,y,b);if(!g)return;t.config=g.config,t.samplerate=g.samplerate,t.channelCount=g.channelCount,t.codec=g.codec,t.manifestCodec=g.manifestCodec,C.logger.log("parsed codec:"+t.codec+", rate:"+g.samplerate+", channels:"+g.channelCount)}}function l(t){return 1024*9e4/t}function a(t,d,v,y,b){var g=f(t,d),m=p(t,d);if(m-=g,m>0){var _=v+y*b;return{headerLength:g,frameLength:m,stamp:_}}}function i(t,d,v,y,b){var g=l(t.samplerate),m=a(d,v,y,b,g);if(m){var _=m.frameLength,x=m.headerLength,h=m.stamp,E=x+_,S=Math.max(0,v+E-d.length),w;S?(w=new Uint8Array(E-x),w.set(d.subarray(v+x,d.length),0)):w=d.subarray(v+x,v+E);var R={unit:w,pts:h};return S||t.samples.push(R),{sample:R,length:E,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"initPTSFn",function(){return p});var C=W("./src/polyfills/number.ts"),D=W("./src/demux/id3.ts"),T=W("./src/demux/dummy-demuxed-track.ts"),A=W("./src/utils/mp4-tools.ts"),O=W("./src/utils/typed-array.ts"),f=function(){function c(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var s=c.prototype;return s.resetInitSegment=function(o,r,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},s.resetTimeStamp=function(){},s.resetContiguity=function(){},s.canParse=function(o,r){return!1},s.appendFrame=function(o,r,l){},s.demux=function(o,r){this.cachedData&&(o=Object(A.appendUint8Array)(this.cachedData,o),this.cachedData=null);var l=D.getID3Data(o,0),a=l?l.length:0,i,t,d=this._audioTrack,v=this._id3Track,y=l?D.getTimeStamp(l):void 0,b=o.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(y,r)),l&&l.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),t=this.initPTS;af?(this.word<<=f,this.bitsAvailable-=f):(f-=this.bitsAvailable,p=f>>3,f-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=f,this.bitsAvailable-=f)},A.readBits=function(f){var p=Math.min(this.bitsAvailable,f),c=this.word>>>32-p;return f>32&&C.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0?this.word<<=p:this.bytesAvailable>0&&this.loadWord(),p=f-p,p>0&&this.bitsAvailable?c<>>f)!==0)return this.word<<=f,this.bitsAvailable-=f,f;return this.loadWord(),f+this.skipLZ()},A.skipUEG=function(){this.skipBits(1+this.skipLZ())},A.skipEG=function(){this.skipBits(1+this.skipLZ())},A.readUEG=function(){var f=this.skipLZ();return this.readBits(f+1)-1},A.readEG=function(){var f=this.readUEG();return 1&f?1+f>>>1:-1*(f>>>1)},A.readBoolean=function(){return this.readBits(1)===1},A.readUByte=function(){return this.readBits(8)},A.readUShort=function(){return this.readBits(16)},A.readUInt=function(){return this.readBits(32)},A.skipScalingList=function(f){for(var p=8,c=8,s,n=0;n0?b.subarray(m,m+_):void 0},A=function(b,g){var m=0;return m=(b[g]&127)<<21,m|=(b[g+1]&127)<<14,m|=(b[g+2]&127)<<7,m|=b[g+3]&127,m},O=function(b,g){return C(b,g)&&A(b,g+6)+10<=b.length-g},f=function(b){for(var g=s(b),m=0;m>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:R+=String.fromCharCode(E);break;case 12:case 13:S=b[N++],R+=String.fromCharCode((E&31)<<6|S&63);break;case 14:S=b[N++],w=b[N++],R+=String.fromCharCode((E&15)<<12|(S&63)<<6|(w&63)<<0);break;default:}}return R},t={decodeTextFrame:r},d;function v(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/demux/base-audio-demuxer.ts"),D=W("./src/demux/id3.ts"),T=W("./src/utils/logger.ts"),A=W("./src/demux/mpegaudio.ts");function O(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,f(c,s)}function f(c,s){return f=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},f(c,s)}var p=function(c){O(s,c);function s(){return c.apply(this,arguments)||this}var n=s.prototype;return n.resetInitSegment=function(r,l,a){c.prototype.resetInitSegment.call(this,r,l,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:a,inputTimeScale:9e4,dropped:0}},s.probe=function(r){if(!r)return!1;for(var l=D.getID3Data(r,0)||[],a=l.length,i=r.length;a0},O.demux=function(p){var c=p,s=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(c=Object(C.appendUint8Array)(this.remainderData,p));var n=Object(C.segmentValidRange)(c);this.remainderData=n.remainder,s.samples=n.valid||new Uint8Array}else s.samples=c;return{audioTrack:Object(D.dummyTrack)(),avcTrack:s,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},O.flush=function(){var p=Object(D.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:p,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},O.demuxSampleAes=function(p,c,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},O.destroy=function(){},A}();T.minProbeByteLength=1024,ie.default=T},"./src/demux/mpegaudio.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"appendFrame",function(){return f}),W.d(ie,"parseHeader",function(){return p}),W.d(ie,"isHeaderPattern",function(){return c}),W.d(ie,"isHeader",function(){return s}),W.d(ie,"canParse",function(){return n}),W.d(ie,"probe",function(){return o});var C=null,D=[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],T=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],A=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],O=[0,1,1,4];function f(r,l,a,i,t){if(a+24>l.length)return;var d=p(l,a);if(d&&a+d.frameLength<=l.length){var v=d.samplesPerFrame*9e4/d.sampleRate,y=i+t*v,b={unit:l.subarray(a,a+d.frameLength),pts:y,dts:y};return r.config=[],r.channelCount=d.channelCount,r.samplerate=d.sampleRate,r.samples.push(b),{sample:b,length:d.frameLength,missing:0}}}function p(r,l){var a=r[l+1]>>3&3,i=r[l+1]>>1&3,t=r[l+2]>>4&15,d=r[l+2]>>2&3;if(a!==1&&t!==0&&t!==15&&d!==3){var v=r[l+2]>>1&1,y=r[l+3]>>6,b=a===3?3-i:i===3?3:4,g=D[b*14+t-1]*1e3,m=a===3?0:a===2?1:2,_=T[m*3+d],x=y===3?1:2,h=A[a][i],E=O[i],S=h*8*E,w=Math.floor(h*g/_+v)*E;if(C===null){var R=navigator.userAgent||"",N=R.match(/Chrome\/(\d+)/i);C=N?parseInt(N[1]):0}var F=!!C&&C<=87;return F&&i===2&&g>=224e3&&y===0&&(r[l+3]=r[l+3]|128),{sampleRate:_,channelCount:x,frameLength:w,samplesPerFrame:S}}}function c(r,l){return r[l]===255&&(r[l+1]&224)===224&&(r[l+1]&6)!==0}function s(r,l){return l+1=p.length){s();return}if(p[c].unit.length<32)continue;var n=this.decrypter.isSync();if(this.decryptAacSample(p,c,s,n),!n)return}},O.getAvcEncryptedData=function(p){for(var c=Math.floor((p.length-48)/160)*16+16,s=new Int8Array(c),n=0,o=32;o<=p.length-16;o+=160,n+=16)s.set(p.subarray(o,o+16),n);return s},O.getAvcDecryptedUnit=function(p,c){for(var s=new Uint8Array(c),n=0,o=32;o<=p.length-16;o+=160,n+=16)p.set(s.subarray(n,n+16),o);return p},O.decryptAvcSample=function(p,c,s,n,o,r){var l=Object(D.discardEPB)(o.data),a=this.getAvcEncryptedData(l),i=this;this.decryptBuffer(a.buffer,function(t){o.data=i.getAvcDecryptedUnit(l,t),r||i.decryptAvcSamples(p,c,s+1,n)})},O.decryptAvcSamples=function(p,c,s,n){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;c++,s=0){if(c>=p.length){n();return}for(var o=p[c].units;!(s>=o.length);s++){var r=o[s];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(p,c,s,n,r,l),!l)return}}},A}();ie.default=T},"./src/demux/transmuxer-interface.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o});var C=W("./node_modules/webworkify-webpack/index.js"),D=W.n(C),T=W("./src/events.ts"),A=W("./src/demux/transmuxer.ts"),O=W("./src/utils/logger.ts"),f=W("./src/errors.ts"),p=W("./src/utils/mediasource-helper.ts"),c=W("./node_modules/eventemitter3/index.js"),s=W.n(c),n=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},o=function(){function r(a,i,t,d){var v=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=a,this.id=i,this.onTransmuxComplete=t,this.onFlush=d;var y=a.config,b=function(h,E){E=E||{},E.frag=v.frag,E.id=v.id,a.trigger(h,E)};this.observer=new c.EventEmitter,this.observer.on(T.Events.FRAG_DECRYPTED,b),this.observer.on(T.Events.ERROR,b);var g={mp4:n.isTypeSupported("video/mp4"),mpeg:n.isTypeSupported("audio/mpeg"),mp3:n.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(y.enableWorker&&typeof Worker!="undefined"){O.logger.log("demuxing in webworker");var _;try{_=this.worker=C("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(x){a.trigger(T.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(x.message+" ("+x.filename+":"+x.lineno+")")})},_.postMessage({cmd:"init",typeSupported:g,vendor:m,id:i,config:JSON.stringify(y)})}catch(x){O.logger.warn("Error in worker:",x),O.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new A.default(this.observer,g,y,m,i),this.worker=null}}else this.transmuxer=new A.default(this.observer,g,y,m,i)}var l=r.prototype;return l.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},l.push=function(i,t,d,v,y,b,g,m,_,x){var h=this;_.transmuxing.start=self.performance.now();var E=this.transmuxer,S=this.worker,w=b?b.start:y.start,R=y.decryptdata,N=this.frag,F=!(N&&y.cc===N.cc),z=!(N&&_.level===N.level),q=N?_.sn-N.sn:-1,B=this.part?_.part-this.part.index:1,M=!z&&(q===1||q===0&&B===1),G=self.performance.now();(z||q||y.stats.parsing.start===0)&&(y.stats.parsing.start=G),b&&(B||!M)&&(b.stats.parsing.start=G);var J=new A.TransmuxState(F,M,m,z,w);if(!M||F){O.logger.log("[transmuxer-interface, "+y.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+` discontinuity: `+F+` trackSwitch: `+z+` contiguous: `+M+` accurateTimeOffset: `+m+` timeOffset: `+w);var K=new A.TransmuxConfig(d,v,t,g,x);this.configureTransmuxer(K)}if(this.frag=y,this.part=b,S)S.postMessage({cmd:"demux",data:i,decryptdata:R,chunkMeta:_,state:J},i instanceof ArrayBuffer?[i]:[]);else if(E){var Z=E.push(i,R,_,J);Object(A.isPromise)(Z)?Z.then(function(le){h.handleTransmuxComplete(le)}):this.handleTransmuxComplete(Z)}},l.flush=function(i){var t=this;i.transmuxing.start=self.performance.now();var d=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:i});else if(d){var y=d.flush(i);Object(A.isPromise)(y)?y.then(function(b){t.handleFlushResult(b,i)}):this.handleFlushResult(y,i)}},l.handleFlushResult=function(i,t){var d=this;i.forEach(function(v){d.handleTransmuxComplete(v)}),this.onFlush(t)},l.onWorkerMessage=function(i){var t=i.data,d=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,d.trigger(t.event,t.data);break}}},l.configureTransmuxer=function(i){var t=this.worker,d=this.transmuxer;t?t.postMessage({cmd:"configure",config:i}):d&&d.configure(i)},l.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},r}()},"./src/demux/transmuxer-worker.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return f});var C=W("./src/demux/transmuxer.ts"),D=W("./src/events.ts"),T=W("./src/utils/logger.ts"),A=W("./node_modules/eventemitter3/index.js"),O=W.n(A);function f(o){var r=new A.EventEmitter,l=function(i,t){o.postMessage({event:i,data:t})};r.on(D.Events.FRAG_DECRYPTED,l),r.on(D.Events.ERROR,l),o.addEventListener("message",function(a){var i=a.data;switch(i.cmd){case"init":{var t=JSON.parse(i.config);o.transmuxer=new C.default(r,i.typeSupported,t,i.vendor,i.id),Object(T.enableLogs)(t.debug),l("init",null);break}case"configure":{o.transmuxer.configure(i.config);break}case"demux":{var d=o.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(C.isPromise)(d)?d.then(function(b){p(o,b)}):p(o,d);break}case"flush":{var v=i.chunkMeta,y=o.transmuxer.flush(v);Object(C.isPromise)(y)?y.then(function(b){s(o,b,v)}):s(o,y,v);break}default:break}})}function p(o,r){if(n(r.remuxResult))return;var l=[],a=r.remuxResult,i=a.audio,t=a.video;i&&c(l,i),t&&c(l,t),o.postMessage({event:"transmuxComplete",data:r},l)}function c(o,r){r.data1&&o.push(r.data1.buffer),r.data2&&o.push(r.data2.buffer)}function s(o,r,l){r.forEach(function(a){p(o,a)}),o.postMessage({event:"flush",data:l})}function n(o){return!o.audio&&!o.video&&!o.text&&!o.id3&&!o.initSegment}},"./src/demux/transmuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return t}),W.d(ie,"isPromise",function(){return y}),W.d(ie,"TransmuxConfig",function(){return b}),W.d(ie,"TransmuxState",function(){return g});var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/crypt/decrypter.ts"),A=W("./src/demux/aacdemuxer.ts"),O=W("./src/demux/mp4demuxer.ts"),f=W("./src/demux/tsdemuxer.ts"),p=W("./src/demux/mp3demuxer.ts"),c=W("./src/remux/mp4-remuxer.ts"),s=W("./src/remux/passthrough-remuxer.ts"),n=W("./src/demux/chunk-cache.ts"),o=W("./src/utils/mp4-tools.ts"),r=W("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(m){r.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var a=[{demux:f.default,remux:c.default},{demux:O.default,remux:s.default},{demux:A.default,remux:c.default},{demux:p.default,remux:c.default}],i=1024;a.forEach(function(m){var _=m.demux;i=Math.max(i,_.minProbeByteLength)});var t=function(){function m(x,h,E,S,w){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 n.default,this.observer=x,this.typeSupported=h,this.config=E,this.vendor=S,this.id=w}var _=m.prototype;return _.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},_.push=function(h,E,S,w){var R=this,N=S.transmuxing;N.executeStart=l();var F=new Uint8Array(h),z=this.cache,q=this.config,B=this.currentTransmuxState,M=this.transmuxConfig;w&&(this.currentTransmuxState=w);var G=d(F,E);if(G&&G.method==="AES-128"){var J=this.getDecrypter();if(q.enableSoftwareAES){var K=J.softwareDecrypt(F,G.key.buffer,G.iv.buffer);if(!K)return N.executeEnd=l(),v(S);F=new Uint8Array(K)}else return this.decryptionPromise=J.webCryptoDecrypt(F,G.key.buffer,G.iv.buffer).then(function(We){var He=R.push(We,null,S);return R.decryptionPromise=null,He}),this.decryptionPromise}var Z=w||B,le=Z.contiguous,de=Z.discontinuity,Te=Z.trackSwitch,we=Z.accurateTimeOffset,Ie=Z.timeOffset,_e=M.audioCodec,ye=M.videoCodec,Ke=M.defaultInitPts,Me=M.duration,Fe=M.initSegmentData;if((de||Te)&&this.resetInitSegment(Fe,_e,ye,Me),de&&this.resetInitialTimestamp(Ke),le||this.resetContiguity(),this.needsProbing(F,de,Te)){if(z.dataLength){var Ge=z.flush();F=Object(o.appendUint8Array)(Ge,F)}this.configureTransmuxer(F,M)}var Ee=this.transmux(F,G,Ie,we,S),me=this.currentTransmuxState;return me.contiguous=!0,me.discontinuity=!1,me.trackSwitch=!1,N.executeEnd=l(),Ee},_.flush=function(h){var E=this,S=h.transmuxing;S.executeStart=l();var w=this.decrypter,R=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return E.flush(h)});var z=[],q=N.timeOffset;if(w){var B=w.flush();B&&z.push(this.push(B,null,h))}var M=R.dataLength;R.reset();var G=this.demuxer,J=this.remuxer;if(!G||!J)return M>=i&&this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=l(),[v(h)];var K=G.flush(q);return y(K)?K.then(function(Z){return E.flushRemux(z,Z,h),z}):(this.flushRemux(z,K,h),z)},_.flushRemux=function(h,E,S){var w=E.audioTrack,R=E.avcTrack,N=E.id3Track,F=E.textTrack,z=this.currentTransmuxState,q=z.accurateTimeOffset,B=z.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var M=this.remuxer.remux(w,R,N,F,B,q,!0,this.id);h.push({remuxResult:M,chunkMeta:S}),S.transmuxing.executeEnd=l()},_.resetInitialTimestamp=function(h){var E=this.demuxer,S=this.remuxer;if(!E||!S)return;E.resetTimeStamp(h),S.resetTimeStamp(h)},_.resetContiguity=function(){var h=this.demuxer,E=this.remuxer;if(!h||!E)return;h.resetContiguity(),E.resetNextTimestamp()},_.resetInitSegment=function(h,E,S,w){var R=this.demuxer,N=this.remuxer;if(!R||!N)return;R.resetInitSegment(E,S,w),N.resetInitSegment(h,E,S)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(h,E,S,w,R){var N;return E&&E.method==="SAMPLE-AES"?N=this.transmuxSampleAes(h,E,S,w,R):N=this.transmuxUnencrypted(h,S,w,R),N},_.transmuxUnencrypted=function(h,E,S,w){var R=this.demuxer.demux(h,E,!1,!this.config.progressive),N=R.audioTrack,F=R.avcTrack,z=R.id3Track,q=R.textTrack,B=this.remuxer.remux(N,F,z,q,E,S,!1,this.id);return{remuxResult:B,chunkMeta:w}},_.transmuxSampleAes=function(h,E,S,w,R){var N=this;return this.demuxer.demuxSampleAes(h,E,S).then(function(F){var z=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,S,w,!1,N.id);return{remuxResult:z,chunkMeta:R}})},_.configureTransmuxer=function(h,E){for(var S=this.config,w=this.observer,R=this.typeSupported,N=this.vendor,F=E.audioCodec,z=E.defaultInitPts,q=E.duration,B=E.initSegmentData,M=E.videoCodec,G,J=0,K=a.length;J0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(x=_),x}var v=function(_){return{remuxResult:{},chunkMeta:_}};function y(m){return"then"in m&&m.then instanceof Function}var b=function(_,x,h,E,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=x,this.initSegmentData=h,this.duration=E,this.defaultInitPts=S},g=function(_,x,h,E,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=x,this.accurateTimeOffset=h,this.trackSwitch=E,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"discardEPB",function(){return v});var C=W("./src/demux/adts.ts"),D=W("./src/demux/mpegaudio.ts"),T=W("./src/demux/exp-golomb.ts"),A=W("./src/demux/id3.ts"),O=W("./src/demux/sample-aes.ts"),f=W("./src/events.ts"),p=W("./src/utils/mp4-tools.ts"),c=W("./src/utils/logger.ts"),s=W("./src/errors.ts"),n={video:1,audio:2,id3:3,text:4},o=function(){function y(g,m,_){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=g,this.config=m,this.typeSupported=_}y.probe=function(m){var _=y.syncOffset(m);return _<0?!1:(_&&c.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},y.syncOffset=function(m){for(var _=Math.min(1e3,m.length-3*188),x=0;x<_;){if(m[x]===71&&m[x+188]===71&&m[x+2*188]===71)return x;x++}return-1},y.createTrack=function(m,_){return{container:m==="video"||m==="audio"?"video/mp2t":void 0,type:m,id:n[m],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:m==="audio"?_:void 0}};var b=y.prototype;return b.resetInitSegment=function(m,_,x){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=y.createTrack("video",x),this._audioTrack=y.createTrack("audio",x),this._id3Track=y.createTrack("id3",x),this._txtTrack=y.createTrack("text",x),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=m,this.videoCodec=_,this._duration=x},b.resetTimeStamp=function(){},b.resetContiguity=function(){var m=this._audioTrack,_=this._avcTrack,x=this._id3Track;m&&(m.pesData=null),_&&(_.pesData=null),x&&(x.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},b.demux=function(m,_,x,h){x===void 0&&(x=!1),h===void 0&&(h=!1),x||(this.sampleAes=null);var E,S=this._avcTrack,w=this._audioTrack,R=this._id3Track,N=S.pid,F=S.pesData,z=w.pid,q=R.pid,B=w.pesData,M=R.pesData,G=!1,J=this.pmtParsed,K=this._pmtId,Z=m.length;if(this.remainderData&&(m=Object(p.appendUint8Array)(this.remainderData,m),Z=m.length,this.remainderData=null),Z<188&&!h)return this.remainderData=m,{audioTrack:w,avcTrack:S,id3Track:R,textTrack:this._txtTrack};var le=Math.max(0,y.syncOffset(m));Z-=(Z+le)%188,Z>4,_e=void 0;if(Ie>1){if(_e=de+5+m[de+4],_e===de+188)continue}else _e=de+4;switch(we){case N:Te&&(F&&(E=i(F))&&this.parseAVCPES(E,!1),F={data:[],size:0}),F&&(F.data.push(m.subarray(_e,de+188)),F.size+=de+188-_e);break;case z:Te&&(B&&(E=i(B))&&(w.isAAC?this.parseAACPES(E):this.parseMPEGPES(E)),B={data:[],size:0}),B&&(B.data.push(m.subarray(_e,de+188)),B.size+=de+188-_e);break;case q:Te&&(M&&(E=i(M))&&this.parseID3PES(E),M={data:[],size:0}),M&&(M.data.push(m.subarray(_e,de+188)),M.size+=de+188-_e);break;case 0:Te&&(_e+=m[_e]+1),K=this._pmtId=l(m,_e);break;case K:{Te&&(_e+=m[_e]+1);var ye=a(m,_e,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);N=ye.avc,N>0&&(S.pid=N),z=ye.audio,z>0&&(w.pid=z,w.isAAC=ye.isAAC),q=ye.id3,q>0&&(R.pid=q),G&&!J&&(c.logger.log("reparse from beginning"),G=!1,de=le-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(f.Events.ERROR,f.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=F,w.pesData=B,R.pesData=M;var Ke={audioTrack:w,avcTrack:S,id3Track:R,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(Ke),Ke},b.flush=function(){var m=this.remainderData;this.remainderData=null;var _;return m?_=this.demux(m,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},b.extractRemainingSamples=function(m){var _=m.audioTrack,x=m.avcTrack,h=m.id3Track,E=x.pesData,S=_.pesData,w=h.pesData,R;E&&(R=i(E))?(this.parseAVCPES(R,!0),x.pesData=null):x.pesData=E,S&&(R=i(S))?(_.isAAC?this.parseAACPES(R):this.parseMPEGPES(R),_.pesData=null):(S!=null&&S.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=S),w&&(R=i(w))?(this.parseID3PES(R),h.pesData=null):h.pesData=w},b.demuxSampleAes=function(m,_,x){var h=this.demux(m,x,!0,!this.config.progressive),E=this.sampleAes=new O.default(this.observer,this.config,_);return this.decrypt(h,E)},b.decrypt=function(m,_){return new Promise(function(x){var h=m.audioTrack,E=m.avcTrack;h.samples&&h.isAAC?_.decryptAacSamples(h.samples,0,function(){E.samples?_.decryptAvcSamples(E.samples,0,0,function(){x(m)}):x(m)}):E.samples&&_.decryptAvcSamples(E.samples,0,0,function(){x(m)})})},b.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},b.parseAVCPES=function(m,_){var x=this,h=this._avcTrack,E=this.parseAVCNALu(m.data),S=!1,w=this.avcSample,R,N=!1;m.data=null,w&&E.length&&!h.audFound&&(t(w,h),w=this.avcSample=r(!1,m.pts,m.dts,"")),E.forEach(function(F){switch(F.type){case 1:{R=!0,w||(w=x.avcSample=r(!0,m.pts,m.dts,"")),S&&(w.debug+="NDR "),w.frame=!0;var z=F.data;if(N&&z.length>4){var q=new T.default(z).readSliceType();(q===2||q===4||q===7||q===9)&&(w.key=!0)}break}case 5:R=!0,w||(w=x.avcSample=r(!0,m.pts,m.dts,"")),S&&(w.debug+="IDR "),w.key=!0,w.frame=!0;break;case 6:{R=!0,S&&w&&(w.debug+="SEI ");var B=new T.default(v(F.data));B.readUByte();for(var M=0,G=0,J=!1,K=0;!J&&B.bytesAvailable>1;){M=0;do K=B.readUByte(),M+=K;while(K===255);G=0;do K=B.readUByte(),G+=K;while(K===255);if(M===4&&B.bytesAvailable!==0){J=!0;var Z=B.readUByte();if(Z===181){var le=B.readUShort();if(le===49){var de=B.readUInt();if(de===1195456820){var Te=B.readUByte();if(Te===3){for(var we=B.readUByte(),Ie=B.readUByte(),_e=31&we,ye=[we,Ie],Ke=0;Ke<_e;Ke++)ye.push(B.readUByte()),ye.push(B.readUByte()),ye.push(B.readUByte());d(x._txtTrack.samples,{type:3,pts:m.pts,bytes:ye})}}}}}else if(M===5&&B.bytesAvailable!==0){if(J=!0,G>16){for(var Me=[],Fe=0;Fe<16;Fe++)Me.push(B.readUByte().toString(16)),(Fe===3||Fe===5||Fe===7||Fe===9)&&Me.push("-");for(var Ge=G-16,Ee=new Uint8Array(Ge),me=0;me=0){var B={data:m.subarray(z,w-h-1),type:q};S.push(B)}else{var M=this.getLastNalUnit();if(M&&(E&&w<=4-E&&(M.state&&(M.data=M.data.subarray(0,M.data.byteLength-E))),N=w-h-1,N>0)){var G=new Uint8Array(M.data.byteLength+N);G.set(M.data,0),G.set(m.subarray(0,N),M.data.byteLength),M.data=G,M.state=0}}w<_?(F=m[w]&31,z=w,q=F,h=0):h=-1}else h=0}if(z>=0&&h>=0){var J={data:m.subarray(z,_),type:q,state:h};S.push(J)}if(S.length===0){var K=this.getLastNalUnit();if(K){var Z=new Uint8Array(K.data.byteLength+m.byteLength);Z.set(K.data,0),Z.set(m,K.data.byteLength),K.data=Z}}return x.naluState=h,S},b.parseAACPES=function(m){var _=0,x=this._audioTrack,h=this.aacOverFlow,E=m.data;if(h){this.aacOverFlow=null;var S=h.sample.unit.byteLength,w=Math.min(h.missing,S),R=S-w;h.sample.unit.set(E.subarray(0,w),R),x.samples.push(h.sample),_=h.missing}var N,F;for(N=_,F=E.length;N1;){var S=new Uint8Array(E[0].length+E[1].length);S.set(E[0]),S.set(E[1],E[0].length),E[0]=S,E.splice(1,1)}g=E[0];var w=(g[0]<<16)+(g[1]<<8)+g[2];if(w===1){if(m=(g[4]<<8)+g[5],m&&m>y.size-6)return null;var R=g[7];R&192&&(x=(g[9]&14)*536870912+(g[10]&255)*4194304+(g[11]&254)*16384+(g[12]&255)*128+(g[13]&254)/2,R&64?(h=(g[14]&14)*536870912+(g[15]&255)*4194304+(g[16]&254)*16384+(g[17]&255)*128+(g[18]&254)/2,x-h>60*9e4&&(c.logger.warn(Math.round((x-h)/9e4)+"s delta between PTS and DTS, align them"),x=h)):h=x),_=g[8];var N=_+9;if(y.size<=N)return null;y.size-=N;for(var F=new Uint8Array(y.size),z=0,q=E.length;zB){N-=B;continue}else g=g.subarray(N),B-=N,N=0;F.set(g,b),b+=B}return m&&(m-=_+3),{data:F,pts:x,dts:h,len:m}}return null}function t(y,b){if(y.units.length&&y.frame){if(y.pts===void 0){var g=b.samples,m=g.length;if(m){var _=g[m-1];y.pts=_.pts,y.dts=_.dts}else{b.dropped++;return}}b.samples.push(y)}y.debug.length&&c.logger.log(y.pts+"/"+y.dts+":"+y.debug)}function d(y,b){var g=y.length;if(g>0){if(b.pts>=y[g-1].pts)y.push(b);else for(var m=g-1;m>=0;m--)if(b.ptsx)return E;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,x=this.autoLevelCapping,h;return x===-1&&_&&_.length?h=_.length-1:h=x,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var x=this.audioTrackController;x&&(x.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var x=this.subtitleTrackController;x&&(x.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var x=this.subtitleTrackController;x&&(x.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 i.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return b.defaultConfig?b.defaultConfig:r.hlsDefaultConfig},set:function(_){b.defaultConfig=_}}]),b}();y.defaultConfig=void 0},"./src/is-supported.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"isSupported",function(){return T}),W.d(ie,"changeTypeSupported",function(){return A});var C=W("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function T(){var O=Object(C.getMediaSource)();if(!O)return!1;var f=D(),p=O&&typeof O.isTypeSupported=="function"&&O.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),c=!f||f.prototype&&typeof f.prototype.appendBuffer=="function"&&typeof f.prototype.remove=="function";return!!p&&!!c}function A(){var O,f=D();return typeof(f==null||((O=f.prototype)===null||O===void 0)?void 0:O.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o}),W.d(ie,"LoadError",function(){return l});var C=W("./src/polyfills/number.ts"),D=W("./src/errors.ts");function T(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,c(a,i)}function A(a){var i=typeof Map=="function"?new Map:void 0;return A=function(d){if(d===null||!p(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(d))return i.get(d);i.set(d,v)}function v(){return O(d,arguments,s(this).constructor)}return v.prototype=Object.create(d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),c(v,d)},A(a)}function O(a,i,t){return f()?O=Reflect.construct:O=function(v,y,b){var g=[null];g.push.apply(g,y);var m=Function.bind.apply(v,g),_=new m;return b&&c(_,b.prototype),_},O.apply(null,arguments)}function f(){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(a){return!1}}function p(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function c(a,i){return c=Object.setPrototypeOf||function(d,v){return d.__proto__=v,d},c(a,i)}function s(a){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},s(a)}var n=Math.pow(2,17),o=function(){function a(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var i=a.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(d,v){var y=this,b=d.url;if(!b)return Promise.reject(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(b?"part list":"url")));this.abort();var g=this.config,m=g.fLoader,_=g.loader;return new Promise(function(x,h){y.loader&&y.loader.destroy();var E=y.loader=d.loader=m?new m(g):new _(g),S=r(d),w={timeout:g.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:g.fragLoadingMaxRetryTimeout,highWaterMark:n};d.stats=E.stats,E.load(S,w,{onSuccess:function(N,F,z,q){y.resetLoader(d,E),x({frag:d,part:null,payload:N.data,networkDetails:q})},onError:function(N,F,z){y.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:N,networkDetails:z}))},onAbort:function(N,F,z){y.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:z}))},onTimeout:function(N,F,z){y.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:z}))},onProgress:function(N,F,z,q){v&&v({frag:d,part:null,payload:z,networkDetails:q})}})})},i.loadPart=function(d,v,y){var b=this;this.abort();var g=this.config,m=g.fLoader,_=g.loader;return new Promise(function(x,h){b.loader&&b.loader.destroy();var E=b.loader=d.loader=m?new m(g):new _(g),S=r(d,v),w={timeout:g.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:g.fragLoadingMaxRetryTimeout,highWaterMark:n};v.stats=E.stats,E.load(S,w,{onSuccess:function(N,F,z,q){b.resetLoader(d,E),b.updateStatsFromPart(d,v);var B={frag:d,part:v,payload:N.data,networkDetails:q};y(B),x(B)},onError:function(N,F,z){b.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:v,response:N,networkDetails:z}))},onAbort:function(N,F,z){d.stats.aborted=v.stats.aborted,b.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:v,networkDetails:z}))},onTimeout:function(N,F,z){b.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:v,networkDetails:z}))}})})},i.updateStatsFromPart=function(d,v){var y=d.stats,b=v.stats,g=b.total;if(y.loaded+=b.loaded,g){var m=Math.round(d.duration/v.duration),_=Math.min(Math.round(y.loaded/g),m),x=m-_,h=x*Math.round(y.loaded/_);y.total=y.loaded+h}else y.total=Math.max(y.loaded,y.total);var E=y.loading,S=b.loading;E.start?E.first+=S.first-S.start:(E.start=S.start,E.first=S.first),E.end=S.end},i.resetLoader=function(d,v){d.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},a}();function r(a,i){i===void 0&&(i=null);var t=i||a,d={frag:a,part:i,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},v=t.byteRangeStartOffset,y=t.byteRangeEndOffset;return Object(C.isFiniteNumber)(v)&&Object(C.isFiniteNumber)(y)&&(d.rangeStart=v,d.rangeEnd=y),d}var l=function(a){T(i,a);function i(t){for(var d,v=arguments.length,y=new Array(v>1?v-1:0),b=1;b>8*(15-g)&255;return b},d.setDecryptDataFromLevelKey=function(y,b){var g=y;return(y==null?void 0:y.method)==="AES-128"&&y.uri&&!y.iv&&(g=O.LevelKey.fromURI(y.uri),g.method=y.method,g.iv=this.createInitializationVector(b),g.keyFormat="identity"),g},d.setElementaryStreamInfo=function(y,b,g,m,_,x){x===void 0&&(x=!1);var h=this.elementaryStreams,E=h[y];if(!E){h[y]={startPTS:b,endPTS:g,startDTS:m,endDTS:_,partial:x};return}E.startPTS=Math.min(E.startPTS,b),E.endPTS=Math.max(E.endPTS,g),E.startDTS=Math.min(E.startDTS,m),E.endDTS=Math.max(E.endDTS,_)},d.clearElementaryStreamInfo=function(){var y=this.elementaryStreams;y[o.AUDIO]=null,y[o.VIDEO]=null,y[o.AUDIOVIDEO]=null},n(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var y=this.sn;typeof y!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&A.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),y=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,y)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(C.isFiniteNumber)(this.programDateTime))return null;var y=Object(C.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+y*1e3}},{key:"encrypted",get:function(){var y;return!!((y=this.decryptdata)!==null&&y!==void 0&&y.keyFormat&&this.decryptdata.uri)}}]),t}(r),a=function(i){p(t,i);function t(d,v,y,b,g){var m;m=i.call(this,y)||this,m.fragOffset=0,m.duration=0,m.gap=!1,m.independent=!1,m.relurl=void 0,m.fragment=void 0,m.index=void 0,m.stats=new f.LoadStats,m.duration=d.decimalFloatingPoint("DURATION"),m.gap=d.bool("GAP"),m.independent=d.bool("INDEPENDENT"),m.relurl=d.enumeratedString("URI"),m.fragment=v,m.index=b;var _=d.enumeratedString("BYTERANGE");return _&&m.setByteRange(_,g),g&&(m.fragOffset=g.fragOffset+g.duration),m}return n(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),t}(r)},"./src/loader/key-loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return A});var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/utils/logger.ts"),A=function(){function O(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var f=O.prototype;return f._registerListeners=function(){this.hls.on(C.Events.KEY_LOADING,this.onKeyLoading,this)},f._unregisterListeners=function(){this.hls.off(C.Events.KEY_LOADING,this.onKeyLoading)},f.destroy=function(){this._unregisterListeners();for(var c in this.loaders){var s=this.loaders[c];s&&s.destroy()}this.loaders={}},f.onKeyLoading=function(c,s){var n=s.frag,o=n.type,r=this.loaders[o];if(!n.decryptdata){T.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=n.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(r&&(T.logger.warn("abort previous key loader for type:"+o),r.abort()),!l){T.logger.warn("key uri is falsy");return}var i=a.loader,t=n.loader=this.loaders[o]=new i(a);this.decrypturl=l,this.decryptkey=null;var d={url:l,frag:n,responseType:"arraybuffer"},v={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(d,v,y)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(C.Events.KEY_LOADED,{frag:n}))},f.loadsuccess=function(c,s,n){var o=n.frag;if(!o.decryptdata){T.logger.error("after key load, decryptdata unset");return}this.decryptkey=o.decryptdata.key=new Uint8Array(c.data),o.loader=null,delete this.loaders[o.type],this.hls.trigger(C.Events.KEY_LOADED,{frag:o})},f.loaderror=function(c,s){var n=s.frag,o=n.loader;o&&o.abort(),delete this.loaders[n.type],this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:c})},f.loadtimeout=function(c,s){var n=s.frag,o=n.loader;o&&o.abort(),delete this.loaders[n.type],this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},O}()},"./src/loader/level-details.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"LevelDetails",function(){return O});var C=W("./src/polyfills/number.ts");function D(f,p){for(var c=0;cs.endSN||n>0||n===0&&o>0,this.updated||this.advanced?this.misses=Math.floor(s.misses*.6):this.misses=s.misses+1,this.availabilityDelay=s.availabilityDelay},T(f,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(C.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||A}},{key:"drift",get:function(){var s=this.driftEndTime-this.driftStartTime;if(s>0){var n=this.driftEnd-this.driftStart;return n*1e3/s}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var s;return(s=this.fragments)!==null&&s!==void 0&&s.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 s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),f}()},"./src/loader/level-key.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"LevelKey",function(){return O});var C=W("./node_modules/url-toolkit/src/url-toolkit.js"),D=W.n(C);function T(f,p){for(var c=0;c2){var h=x.shift()+".";return h+=parseInt(x.shift()).toString(16),h+=("000"+parseInt(x.shift()).toString(16)).substr(-4),h}return _},g.resolve=function(_,x){return D.buildAbsoluteURL(x,_,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(_,x){var h=[],E={},S=!1;n.lastIndex=0;for(var w;(w=n.exec(_))!=null;)if(w[1]){var R=new p.AttrList(w[1]),N={attrs:R,bitrate:R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),name:R.NAME,url:g.resolve(w[2],x)},F=R.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),d((R.CODECS||"").split(/[ ,]+/).filter(function(q){return q}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=g.convertAVC1ToAVCOTI(N.videoCodec)),h.push(N)}else if(w[3]){var z=new p.AttrList(w[3]);z["DATA-ID"]&&(S=!0,E[z["DATA-ID"]]=z)}return{levels:h,sessionData:S?E:null}},g.parseMasterPlaylistMedia=function(_,x,h,E){E===void 0&&(E=[]);var S,w=[],R=0;for(o.lastIndex=0;(S=o.exec(_))!==null;){var N=new p.AttrList(S[1]);if(N.TYPE===h){var F={attrs:N,bitrate:0,id:R++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:h,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?g.resolve(N.URI,x):""};if(E.length){var z=g.findGroup(E,F.groupId)||E[0];v(F,z,"audioCodec"),v(F,z,"textCodec")}w.push(F)}}return w},g.parseLevelPlaylist=function(_,x,h,E,S){var w=new O.LevelDetails(x),R=w.fragments,N=null,F=0,z=0,q=0,B=0,M=null,G=new A.Fragment(E,x),J,K,Z,le=-1,de=!1;for(r.lastIndex=0,w.m3u8=_;(J=r.exec(_))!==null;){de&&(de=!1,G=new A.Fragment(E,x),G.start=q,G.sn=F,G.cc=B,G.level=h,N&&(G.initSegment=N,G.rawProgramDateTime=N.rawProgramDateTime));var Te=J[1];if(Te){G.duration=parseFloat(Te);var we=(" "+J[2]).slice(1);G.title=we||null,G.tagList.push(we?["INF",Te,we]:["INF",Te])}else if(J[3])Object(C.isFiniteNumber)(G.duration)&&(G.start=q,Z&&(G.levelkey=Z),G.sn=F,G.level=h,G.cc=B,G.urlId=S,R.push(G),G.relurl=(" "+J[3]).slice(1),b(G,M),M=G,q+=G.duration,F++,z=0,de=!0);else if(J[4]){var Ie=(" "+J[4]).slice(1);M?G.setByteRange(Ie,M):G.setByteRange(Ie)}else if(J[5])G.rawProgramDateTime=(" "+J[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),le===-1&&(le=R.length);else{if(J=J[0].match(l),!J){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(K=1;K-1){c.logger.warn("Keyformat "+ee+" is not supported from the manifest");continue}else if(ee!=="identity")continue;He&&(Z=f.LevelKey.fromURL(x,it),it&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(He)>=0&&(Z.method=He,Z.keyFormat=ee,j&&(Z.keyID=j),P&&(Z.keyFormatVersions=P),Z.iv=re));break}case"START":{var Q=new p.AttrList(ye),xe=Q.decimalFloatingPoint("TIME-OFFSET");Object(C.isFiniteNumber)(xe)&&(w.startTimeOffset=xe);break}case"MAP":{var De=new p.AttrList(ye);G.relurl=De.URI,De.BYTERANGE&&G.setByteRange(De.BYTERANGE),G.level=h,G.sn="initSegment",Z&&(G.levelkey=Z),G.initSegment=null,N=G,de=!0;break}case"SERVER-CONTROL":{var dt=new p.AttrList(ye);w.canBlockReload=dt.bool("CAN-BLOCK-RELOAD"),w.canSkipUntil=dt.optionalFloat("CAN-SKIP-UNTIL",0),w.canSkipDateRanges=w.canSkipUntil>0&&dt.bool("CAN-SKIP-DATERANGES"),w.partHoldBack=dt.optionalFloat("PART-HOLD-BACK",0),w.holdBack=dt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new p.AttrList(ye);w.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=w.partList;Be||(Be=w.partList=[]);var tt=z>0?Be[Be.length-1]:void 0,lt=z++,qe=new A.Part(new p.AttrList(ye),G,x,lt,tt);Be.push(qe),G.duration+=qe.duration;break}case"PRELOAD-HINT":{var Ye=new p.AttrList(ye);w.preloadHint=Ye;break}case"RENDITION-REPORT":{var je=new p.AttrList(ye);w.renditionReports=w.renditionReports||[],w.renditionReports.push(je);break}default:c.logger.warn("line parsed but not handled: "+J);break}}}M&&!M.relurl?(R.pop(),q-=M.duration,w.partList&&(w.fragmentHint=M)):w.partList&&(b(G,M),G.cc=B,w.fragmentHint=G);var Ue=R.length,ke=R[0],be=R[Ue-1];if(q+=w.skippedSegments*w.targetduration,q>0&&Ue&&be){w.averagetargetduration=q/Ue;var Ce=be.sn;w.endSN=Ce!=="initSegment"?Ce:0,ke&&(w.startCC=ke.cc,ke.initSegment||w.fragments.every(function(Pe){return Pe.relurl&&i(Pe.relurl)})&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new A.Fragment(E,x),G.relurl=be.relurl,G.level=h,G.sn="initSegment",ke.initSegment=G,w.needSidxRanges=!0))}else w.endSN=0,w.startCC=0;return w.fragmentHint&&(q+=w.fragmentHint.duration),w.totalduration=q,w.endCC=B,le>0&&y(R,le),w},g}();function d(g,m){["video","audio","text"].forEach(function(_){var x=g.filter(function(E){return Object(s.isCodecType)(E,_)});if(x.length){var h=x.filter(function(E){return E.lastIndexOf("avc1",0)===0||E.lastIndexOf("mp4a",0)===0});m[_+"Codec"]=h.length>0?h[0]:x[0],g=g.filter(function(E){return x.indexOf(E)===-1})}}),m.unknownCodecs=g}function v(g,m,_){var x=m[_];x&&(g[_]=x)}function y(g,m){for(var _=g[m],x=m;x--;){var h=g[x];if(!h)return;h.programDateTime=_.programDateTime-h.duration*1e3,_=h}}function b(g,m){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):m!=null&&m.programDateTime&&(g.programDateTime=m.endProgramDateTime),Object(C.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/polyfills/number.ts"),D=W("./src/events.ts"),T=W("./src/errors.ts"),A=W("./src/utils/logger.ts"),O=W("./src/utils/mp4-tools.ts"),f=W("./src/loader/m3u8-parser.ts"),p=W("./src/types/loader.ts"),c=W("./src/utils/attr-list.ts");function s(r){var l=r.type;switch(l){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function n(r,l){var a=r.url;return(a===void 0||a.indexOf("data:")===0)&&(a=l.url),a}var o=function(){function r(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var l=r.prototype;return l.registerListeners=function(){var i=this.hls;i.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var i=this.hls;i.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(i){var t=this.hls.config,d=t.pLoader,v=t.loader,y=d||v,b=new y(t);return i.loader=b,this.loaders[i.type]=b,b},l.getInternalLoader=function(i){return this.loaders[i.type]},l.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},l.destroyInternalLoaders=function(){for(var i in this.loaders){var t=this.loaders[i];t&&t.destroy(),this.resetInternalLoader(i)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(i,t){var d=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},l.onLevelLoading=function(i,t){var d=t.id,v=t.level,y=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:y,deliveryDirectives:b})},l.onAudioTrackLoading=function(i,t){var d=t.id,v=t.groupId,y=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:y,deliveryDirectives:b})},l.onSubtitleTrackLoading=function(i,t){var d=t.id,v=t.groupId,y=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:y,deliveryDirectives:b})},l.load=function(i){var t,d=this.hls.config,v=this.getInternalLoader(i);if(v){var y=v.context;if(y&&y.url===i.url){A.logger.trace("[playlist-loader]: playlist request ongoing");return}A.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),v.abort()}var b,g,m,_;switch(i.type){case p.PlaylistContextType.MANIFEST:b=d.manifestLoadingMaxRetry,g=d.manifestLoadingTimeOut,m=d.manifestLoadingRetryDelay,_=d.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:b=0,g=d.levelLoadingTimeOut;break;default:b=d.levelLoadingMaxRetry,g=d.levelLoadingTimeOut,m=d.levelLoadingRetryDelay,_=d.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(i),(t=i.deliveryDirectives)!==null&&t!==void 0&&t.part){var x;if(i.type===p.PlaylistContextType.LEVEL&&i.level!==null?x=this.hls.levels[i.level].details:i.type===p.PlaylistContextType.AUDIO_TRACK&&i.id!==null?x=this.hls.audioTracks[i.id].details:i.type===p.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(x=this.hls.subtitleTracks[i.id].details),x){var h=x.partTarget,E=x.targetduration;h&&E&&(g=Math.min(Math.max(h*3,E*.8)*1e3,g))}}var S={timeout:g,maxRetry:b,retryDelay:m,maxRetryDelay:_,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(i,S,w)},l.loadsuccess=function(i,t,d,v){if(v===void 0&&(v=null),d.isSidxRequest){this.handleSidxRequest(i,d),this.handlePlaylistLoaded(i,t,d,v);return}this.resetInternalLoader(d.type);var y=i.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,d,"no EXTM3U delimiter",v);return}t.parsing.start=performance.now(),y.indexOf("#EXTINF:")>0||y.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,t,d,v):this.handleMasterPlaylist(i,t,d,v)},l.loaderror=function(i,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!1,i)},l.loadtimeout=function(i,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!0)},l.handleMasterPlaylist=function(i,t,d,v){var y=this.hls,b=i.data,g=n(i,d),m=f.default.parseMasterPlaylist(b,g),_=m.levels,x=m.sessionData;if(!_.length){this.handleManifestParsingError(i,d,"no level found in manifest",v);return}var h=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),E=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),S=f.default.parseMasterPlaylistMedia(b,g,"AUDIO",h),w=f.default.parseMasterPlaylistMedia(b,g,"SUBTITLES",E),R=f.default.parseMasterPlaylistMedia(b,g,"CLOSED-CAPTIONS");if(S.length){var N=S.some(function(F){return!F.url});!N&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(A.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))}y.trigger(D.Events.MANIFEST_LOADED,{levels:_,audioTracks:S,subtitles:w,captions:R,url:g,stats:t,networkDetails:v,sessionData:x})},l.handleTrackOrLevelPlaylist=function(i,t,d,v){var y=this.hls,b=d.id,g=d.level,m=d.type,_=n(i,d),x=Object(C.isFiniteNumber)(b)?b:0,h=Object(C.isFiniteNumber)(g)?g:x,E=s(d),S=f.default.parseLevelPlaylist(i.data,_,h,E,x);if(!S.fragments.length){y.trigger(D.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(m===p.PlaylistContextType.MANIFEST){var w={attrs:new c.AttrList({}),bitrate:0,details:S,name:"",url:_};y.trigger(D.Events.MANIFEST_LOADED,{levels:[w],audioTracks:[],url:_,stats:t,networkDetails:v,sessionData:null})}if(t.parsing.end=performance.now(),S.needSidxRanges){var R,N=(R=S.fragments[0].initSegment)===null||R===void 0?void 0:R.url;this.load({url:N,isSidxRequest:!0,type:m,level:g,levelDetails:S,id:b,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=S,this.handlePlaylistLoaded(i,t,d,v)},l.handleSidxRequest=function(i,t){var d=Object(O.parseSegmentIndex)(new Uint8Array(i.data));if(!d)return;var v=d.references,y=t.levelDetails;v.forEach(function(b,g){var m=b.info,_=y.fragments[g];_.byteRange.length===0&&_.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),_.initSegment&&_.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(i,t,d,v){this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===p.PlaylistContextType.MANIFEST,url:i.url,reason:d,response:i,context:t,networkDetails:v})},l.handleNetworkError=function(i,t,d,v){d===void 0&&(d=!1),A.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var y=T.ErrorDetails.UNKNOWN,b=!1,g=this.getInternalLoader(i);switch(i.type){case p.PlaylistContextType.MANIFEST:y=d?T.ErrorDetails.MANIFEST_LOAD_TIMEOUT:T.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case p.PlaylistContextType.LEVEL:y=d?T.ErrorDetails.LEVEL_LOAD_TIMEOUT:T.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.AUDIO_TRACK:y=d?T.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:y=d?T.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:T.ErrorDetails.SUBTITLE_LOAD_ERROR,b=!1;break}g&&this.resetInternalLoader(i.type);var m={type:T.ErrorTypes.NETWORK_ERROR,details:y,fatal:b,url:i.url,loader:g,context:i,networkDetails:t};v&&(m.response=v),this.hls.trigger(D.Events.ERROR,m)},l.handlePlaylistLoaded=function(i,t,d,v){var y=d.type,b=d.level,g=d.id,m=d.groupId,_=d.loader,x=d.levelDetails,h=d.deliveryDirectives;if(!(x!=null&&x.targetduration)){this.handleManifestParsingError(i,d,"invalid target duration",v);return}if(!_)return;x.live&&(_.getCacheAge&&(x.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(x.ageHeader))&&(x.ageHeader=0));switch(y){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:x,level:b||0,id:g||0,stats:t,networkDetails:v,deliveryDirectives:h});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:x,id:g||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:h});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:x,id:g||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:h});break}},r}();ie.default=o},"./src/polyfills/number.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"isFiniteNumber",function(){return C}),W.d(ie,"MAX_SAFE_INTEGER",function(){return D});var C=Number.isFinite||function(T){return typeof T=="number"&&isFinite(T)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ce,ie,W){"use strict";W.r(ie);var C=function(){function D(){}return D.getSilentFrame=function(A,O){switch(A){case"mp4a.40.2":if(O===1)return new Uint8Array([0,200,0,128,35,128]);if(O===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(O===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(O===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(O===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(O===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(O===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(O===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(O===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},D}();ie.default=C},"./src/remux/mp4-generator.ts":function(ce,ie,W){"use strict";W.r(ie);var C=Math.pow(2,32)-1,D=function(){function T(){}return T.init=function(){T.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 O;for(O in T.types)T.types.hasOwnProperty(O)&&(T.types[O]=[O.charCodeAt(0),O.charCodeAt(1),O.charCodeAt(2),O.charCodeAt(3)]);var f=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),p=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);T.HDLR_TYPES={video:f,audio:p};var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);T.STTS=T.STSC=T.STCO=s,T.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),T.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),T.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),T.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var n=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);T.FTYP=T.box(T.types.ftyp,n,r,n,o),T.DINF=T.box(T.types.dinf,T.box(T.types.dref,c))},T.box=function(O){for(var f=8,p=arguments.length,c=new Array(p>1?p-1:0),s=1;s>24&255,r[1]=f>>16&255,r[2]=f>>8&255,r[3]=f&255,r.set(O,4),n=0,f=8;n>24&255,O>>16&255,O>>8&255,O&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&255,85,196,0,0]))},T.mdia=function(O){return T.box(T.types.mdia,T.mdhd(O.timescale,O.duration),T.hdlr(O.type),T.minf(O))},T.mfhd=function(O){return T.box(T.types.mfhd,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255]))},T.minf=function(O){return O.type==="audio"?T.box(T.types.minf,T.box(T.types.smhd,T.SMHD),T.DINF,T.stbl(O)):T.box(T.types.minf,T.box(T.types.vmhd,T.VMHD),T.DINF,T.stbl(O))},T.moof=function(O,f,p){return T.box(T.types.moof,T.mfhd(O),T.traf(p,f))},T.moov=function(O){for(var f=O.length,p=[];f--;)p[f]=T.trak(O[f]);return T.box.apply(null,[T.types.moov,T.mvhd(O[0].timescale,O[0].duration)].concat(p).concat(T.mvex(O)))},T.mvex=function(O){for(var f=O.length,p=[];f--;)p[f]=T.trex(O[f]);return T.box.apply(null,[T.types.mvex].concat(p))},T.mvhd=function(O,f){f*=O;var p=Math.floor(f/(C+1)),c=Math.floor(f%(C+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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 T.box(T.types.mvhd,s)},T.sdtp=function(O){var f=O.samples||[],p=new Uint8Array(4+f.length),c,s;for(c=0;c>>8&255),f.push(n&255),f=f.concat(Array.prototype.slice.call(s));for(c=0;c>>8&255),p.push(n&255),p=p.concat(Array.prototype.slice.call(s));var o=T.box(T.types.avcC,new Uint8Array([1,f[3],f[4],f[5],252|3,224|O.sps.length].concat(f).concat([O.pps.length]).concat(p))),r=O.width,l=O.height,a=O.pixelRatio[0],i=O.pixelRatio[1];return T.box(T.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,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,T.box(T.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),T.box(T.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,i>>24,i>>16&255,i>>8&255,i&255])))},T.esds=function(O){var f=O.config.length;return new Uint8Array([0,0,0,0,3,23+f,0,1,0,4,15+f,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([f]).concat(O.config).concat([6,1,2]))},T.mp4a=function(O){var f=O.samplerate;return T.box(T.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,O.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]),T.box(T.types.esds,T.esds(O)))},T.mp3=function(O){var f=O.samplerate;return T.box(T.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,O.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]))},T.stsd=function(O){return O.type==="audio"?!O.isAAC&&O.codec==="mp3"?T.box(T.types.stsd,T.STSD,T.mp3(O)):T.box(T.types.stsd,T.STSD,T.mp4a(O)):T.box(T.types.stsd,T.STSD,T.avc1(O))},T.tkhd=function(O){var f=O.id,p=O.duration*O.timescale,c=O.width,s=O.height,n=Math.floor(p/(C+1)),o=Math.floor(p%(C+1));return T.box(T.types.tkhd,new Uint8Array([1,0,0,7,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,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,c>>8&255,c&255,0,0,s>>8&255,s&255,0,0]))},T.traf=function(O,f){var p=T.sdtp(O),c=O.id,s=Math.floor(f/(C+1)),n=Math.floor(f%(C+1));return T.box(T.types.traf,T.box(T.types.tfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255])),T.box(T.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,n>>24,n>>16&255,n>>8&255,n&255])),T.trun(O,p.length+16+20+8+16+8+8),p)},T.trak=function(O){return O.duration=O.duration||4294967295,T.box(T.types.trak,T.tkhd(O),T.mdia(O))},T.trex=function(O){var f=O.id;return T.box(T.types.trex,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},T.trun=function(O,f){var p=O.samples||[],c=p.length,s=12+16*c,n=new Uint8Array(s),o,r,l,a,i,t;for(f+=8+s,n.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,c&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255],0),o=0;o>>24&255,l>>>16&255,l>>>8&255,l&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*o);return T.box(T.types.trun,n)},T.initSegment=function(O){T.types||T.init();var f=T.moov(O),p=new Uint8Array(T.FTYP.byteLength+f.byteLength);return p.set(T.FTYP),p.set(f,T.FTYP.byteLength),p},T}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,ie.default=D},"./src/remux/mp4-remuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return t}),W.d(ie,"normalizePts",function(){return d});var C=W("./src/polyfills/number.ts"),D=W("./src/remux/aac-helper.ts"),T=W("./src/remux/mp4-generator.ts"),A=W("./src/events.ts"),O=W("./src/errors.ts"),f=W("./src/utils/logger.ts"),p=W("./src/types/loader.ts"),c=W("./src/utils/timescale-conversion.ts");function s(){return s=Object.assign||function(g){for(var m=1;m0?S:w.pts},x[0].pts);return h&&f.logger.debug("PTS rollover detected"),E},m.remux=function(x,h,E,S,w,R,N,F){var z,q,B,M,G,J,K=w,Z=w,le=x.pid>-1,de=h.pid>-1,Te=h.samples.length,we=x.samples.length>0,Ie=Te>1,_e=(!le||we)&&(!de||Ie)||this.ISGenerated||N;if(_e){this.ISGenerated||(B=this.generateIS(x,h,w));var ye=this.isVideoContiguous,Ke=-1;if(Ie&&(Ke=v(h.samples),!ye&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,Ke>0){f.logger.warn("[mp4-remuxer]: Dropped "+Ke+" out of "+Te+" video samples due to a missing keyframe");var Me=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(Ke),h.dropped+=Ke,Z+=(h.samples[0].pts-Me)/(h.timescale||9e4)}else Ke===-1&&(f.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),J=!1);if(this.ISGenerated){if(we&&Ie){var Fe=this.getVideoStartPts(h.samples),Ge=d(x.samples[0].pts,Fe)-Fe,Ee=Ge/h.inputTimeScale;K+=Math.max(0,Ee),Z+=Math.max(0,-Ee)}if(we){if(x.samplerate||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(x,h,w)),q=this.remuxAudio(x,K,this.isAudioContiguous,R,de||Ie||F===p.PlaylistLevelType.AUDIO?Z:void 0),Ie){var me=q?q.endPTS-q.startPTS:0;h.inputTimeScale||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(x,h,w)),z=this.remuxVideo(h,Z,ye,me)}}else Ie&&(z=this.remuxVideo(h,Z,ye,0));z&&(z.firstKeyFrame=Ke,z.independent=Ke!==-1)}}return this.ISGenerated&&(E.samples.length&&(G=this.remuxID3(E,w)),S.samples.length&&(M=this.remuxText(S,w))),{audio:q,video:z,initSegment:B,independent:J,text:M,id3:G}},m.generateIS=function(x,h,E){var S=x.samples,w=h.samples,R=this.typeSupported,N={},F=!Object(C.isFiniteNumber)(this._initPTS),z="audio/mp4",q,B,M;if(F&&(q=B=Infinity),x.config&&S.length&&(x.timescale=x.samplerate,x.isAAC||(R.mpeg?(z="audio/mpeg",x.codec=""):R.mp3&&(x.codec="mp3")),N.audio={id:"audio",container:z,codec:x.codec,initSegment:!x.isAAC&&R.mpeg?new Uint8Array(0):T.default.initSegment([x]),metadata:{channelCount:x.channelCount}},F&&(M=x.inputTimeScale,q=B=S[0].pts-Math.round(M*E))),h.sps&&h.pps&&w.length&&(h.timescale=h.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:T.default.initSegment([h]),metadata:{width:h.width,height:h.height}},F)){M=h.inputTimeScale;var G=this.getVideoStartPts(w),J=Math.round(M*E);B=Math.min(B,d(w[0].dts,G)-J),q=Math.min(q,G-J)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=q,this._initDTS=B),{tracks:N,initPTS:q,timescale:M}},m.remuxVideo=function(x,h,E,S){var w=x.inputTimeScale,R=x.samples,N=[],F=R.length,z=this._initPTS,q=this.nextAvcDts,B=8,M,G,J,K=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,le=0,de=!1;if(!E||q===null){var Te=h*w,we=R[0].pts-d(R[0].dts,R[0].pts);q=Te-we}for(var Ie=0;Ie_e.pts){var ye=9e4*.2;le=Math.max(Math.min(le,_e.pts-_e.dts),-1*ye)}_e.dts0?Ie-1:Ie].dts&&(de=!0)}de&&R.sort(function(At,pt){var gt=At.dts-pt.dts,rt=At.pts-pt.pts;return gt||rt}),G=R[0].dts,J=R[R.length-1].dts;var Ke=Math.round((J-G)/(F-1));if(le<0){if(leKe,We=Ee<-1;if(me||We){me?f.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(Ee,!0)+" ms ("+Ee+"dts) hole between fragments detected, filling it"):f.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-Ee,!0)+" ms ("+Ee+"dts) overlapping between fragments detected"),G=q;var He=R[0].pts-Ee;R[0].dts=G,R[0].pts=He,f.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(He,!0)+"/"+Object(c.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(Ee,!0)+" ms")}}i&&(G=Math.max(0,G));for(var it=0,re=0,P=0;P0?Be-1:Be].dts;if(Ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Le=Math.floor(Ce.maxBufferHole*w),Ve=(S?K+S*w:this.nextAudioPts)-tt.pts;Ve>Le?(M=Ve-Pe,M<0&&(M=Pe),f.logger.log("[mp4-remuxer]: It is approximately "+Ve/90+" ms to the next segment; using duration "+M/90+" ms for the last video frame.")):M=Pe}else M=Pe}var at=Math.round(tt.pts-tt.dts);N.push(new y(tt.key,M,qe,at))}if(N.length&&l&&l<70){var _t=N[0].flags;_t.dependsOn=2,_t.isNonSync=0}console.assert(M!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=q=J+M,this.isVideoContiguous=!0;var kt=T.default.moof(x.sequenceNumber++,G,s({},x,{samples:N})),Bt="video",jt={data1:kt,data2:dt,startPTS:K/w,endPTS:(Z+M)/w,startDTS:G/w,endDTS:q/w,type:Bt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:x.dropped};return x.samples=[],x.dropped=0,console.assert(dt.length,"MDAT length must not be zero"),jt},m.remuxAudio=function(x,h,E,S,w){var R=x.inputTimeScale,N=x.samplerate?x.samplerate:R,F=R/N,z=x.isAAC?o:r,q=z*F,B=this._initPTS,M=!x.isAAC&&this.typeSupported.mpeg,G=[],J=x.samples,K=M?0:8,Z=this.nextAudioPts||-1,le=h*R;if(this.isAudioContiguous=E=E||J.length&&Z>0&&(S&&Math.abs(le-Z)<9e3||Math.abs(d(J[0].pts-B,le)-Z)<20*q),J.forEach(function(ke){ke.pts=d(ke.pts-B,le)}),!E||Z<0){if(J=J.filter(function(ke){return ke.pts>=0}),!J.length)return;w===0?Z=0:S?Z=Math.max(0,le):Z=J[0].pts}if(x.isAAC)for(var de=w!==void 0,Te=this.config.maxAudioFramesDrift,we=0,Ie=Z;we=Te*q&&Me0){re+=K;try{it=new Uint8Array(re)}catch(ke){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:O.ErrorTypes.MUX_ERROR,details:O.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:re,reason:"fail allocating audio mdat "+re});return}if(!M){var dt=new DataView(it.buffer);dt.setUint32(0,re),it.set(T.default.types.mdat,4)}}else return;it.set(Q,K);var Ne=Q.byteLength;K+=Ne,G.push(new y(!0,z,Ne,0)),He=xe}var Be=G.length;if(!Be)return;var tt=G[G.length-1];this.nextAudioPts=Z=He+F*tt.duration;var lt=M?new Uint8Array(0):T.default.moof(x.sequenceNumber++,We/F,s({},x,{samples:G}));x.samples=[];var qe=We/R,Ye=Z/R,je="audio",Ue={data1:lt,data2:it,startPTS:qe,endPTS:Ye,startDTS:qe,endDTS:Ye,type:je,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(it.length,"MDAT length must not be zero"),Ue},m.remuxEmptyAudio=function(x,h,E,S){var w=x.inputTimeScale,R=x.samplerate?x.samplerate:w,N=w/R,F=this.nextAudioPts,z=(F!==null?F:S.startDTS*w)+this._initDTS,q=S.endDTS*w+this._initDTS,B=N*o,M=Math.ceil((q-z)/B),G=D.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);if(f.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){f.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],K=0;K4294967296;)g+=_;return g}function v(g){for(var m=0;m0?this.lastEndDTS=x:(A.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!g.audio,E=!!g.video,S="";h&&(S+="audio"),E&&(S+="video");var w={data1:y,startPTS:_,startDTS:_,endPTS:x,endDTS:x,type:S,hasAudio:h,hasVideo:E,nb:1,dropped:0};return v.audio=w.type==="audio"?w:void 0,v.video=w.type!=="audio"?w:void 0,v.text=a,v.id3=l,v.initSegment=b,v},c}(),f=function(s,n,o){return Object(D.getStartDTS)(s,n)-o};function p(c,s){var n=c==null?void 0:c.codec;return n&&n.length>4?n:n==="hvc1"?"hvc1.1.c.L120.90":n==="av01"?"av01.0.04M.08":n==="avc1"||s===T.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}ie.default=O},"./src/task-loop.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return C});var C=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var T=D.prototype;return T.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},T.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},T.onHandlerDestroyed=function(){},T.hasInterval=function(){return!!this._tickInterval},T.hasNextTick=function(){return!!this._tickTimer},T.setInterval=function(O){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,O),!0)},T.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},T.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},T.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},T.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},T.doTick=function(){},D}()},"./src/types/cmcd.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"CMCDVersion",function(){return C}),W.d(ie,"CMCDObjectType",function(){return D}),W.d(ie,"CMCDStreamingFormat",function(){return T}),W.d(ie,"CMCDStreamType",function(){return A});var C=1,D;(function(O){O.MANIFEST="m",O.AUDIO="a",O.VIDEO="v",O.MUXED="av",O.INIT="i",O.CAPTION="c",O.TIMED_TEXT="tt",O.KEY="k",O.OTHER="o"})(D||(D={}));var T;(function(O){O.DASH="d",O.HLS="h",O.SMOOTH="s",O.OTHER="o"})(T||(T={}));var A;(function(O){O.VOD="v",O.LIVE="l"})(A||(A={}))},"./src/types/level.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"HlsSkip",function(){return T}),W.d(ie,"getSkipValue",function(){return A}),W.d(ie,"HlsUrlParameters",function(){return O}),W.d(ie,"Level",function(){return f});function C(p,c){for(var s=0;sNumber.MAX_SAFE_INTEGER?Infinity:c},O.hexadecimalInteger=function(p){if(this[p]){var c=(this[p]||"0x").slice(2);c=(c.length&1?"0":"")+c;for(var s=new Uint8Array(c.length/2),n=0;nNumber.MAX_SAFE_INTEGER?Infinity:c},O.decimalFloatingPoint=function(p){return parseFloat(this[p])},O.optionalFloat=function(p,c){var s=this[p];return s?parseFloat(s):c},O.enumeratedString=function(p){return this[p]},O.bool=function(p){return this[p]==="YES"},O.decimalResolution=function(p){var c=C.exec(this[p]);return c===null?void 0:{width:parseInt(c[1],10),height:parseInt(c[2],10)}},A.parseAttrList=function(p){var c,s={},n='"';for(D.lastIndex=0;(c=D.exec(p))!==null;){var o=c[2];o.indexOf(n)===0&&o.lastIndexOf(n)===o.length-1&&(o=o.slice(1,-1)),s[c[1]]=o}return s},A}()},"./src/utils/binary-search.ts":function(ce,ie,W){"use strict";W.r(ie);var C={search:function(T,A){for(var O=0,f=T.length-1,p=null,c=null;O<=f;){p=(O+f)/2|0,c=T[p];var s=A(c);if(s>0)O=p+1;else if(s<0)f=p-1;else return c}return null}};ie.default=C},"./src/utils/buffer-helper.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"BufferHelper",function(){return T});var C=W("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},T=function(){function A(){}return A.isBuffered=function(f,p){try{if(f){for(var c=A.getBuffered(f),s=0;s=c.start(s)&&p<=c.end(s))return!0}}catch(n){}return!1},A.bufferInfo=function(f,p,c){try{if(f){var s=A.getBuffered(f),n=[],o;for(o=0;or&&(s[o-1].end=f[n].end):s.push(f[n])}else s.push(f[n])}else s=f;for(var l=0,a,i=p,t=p,d=0;d=v&&p=E&&C.logger.log(this.time+" ["+E+"] "+S)},_}(),l=function(x){for(var h=[],E=0;EO&&(this.logger.log(o.DEBUG,"Too large cursor position "+this.pos),this.pos=O)},x.moveCursor=function(E){var S=this.pos+E;if(E>1)for(var w=this.pos+1;w=144&&this.backSpace();var S=T(E);if(this.pos>=O){this.logger.log(o.ERROR,"Cannot insert "+E.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},x.clearFromPos=function(E){var S;for(S=E;S0&&(E?w="["+S.join(" | ")+"]":w=S.join(` `)),w},x.getTextAndFormat=function(){return this.rows},_}(),v=function(){function _(h,E,S){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=h,this.outputFilter=E,this.mode=null,this.verbose=0,this.displayedMemory=new d(S),this.nonDisplayedMemory=new d(S),this.lastOutputScreen=new d(S),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var x=_.prototype;return x.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},x.getHandler=function(){return this.outputFilter},x.setHandler=function(E){this.outputFilter=E},x.setPAC=function(E){this.writeScreen.setPAC(E)},x.setBkgData=function(E){this.writeScreen.setBkgData(E)},x.setMode=function(E){if(E===this.mode)return;this.mode=E,this.logger.log(o.INFO,"MODE="+E),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=E},x.insertChars=function(E){for(var S=0;S=46,S.italics)S.foreground="white";else{var w=Math.floor(E/2)-16,R=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=R[w]}this.logger.log(o.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},x.outputDataUpdate=function(E){E===void 0&&(E=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),E&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},x.cueSplitAtTime=function(E){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,E,this.displayedMemory),this.cueStartTime=E))},_}(),y=function(){function _(h,E,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var w=new r;this.channels=[null,new v(h,E,w),new v(h+1,S,w)],this.cmdHistory=m(),this.logger=w}var x=_.prototype;return x.getHandler=function(E){return this.channels[E].getHandler()},x.setHandler=function(E,S){this.channels[E].setHandler(S)},x.addData=function(E,S){var w,R,N,F=!1;this.logger.time=E;for(var z=0;z ("+l([R,N])+")"),w=this.parseCmd(R,N),w||(w=this.parseMidrow(R,N)),w||(w=this.parsePAC(R,N)),w||(w=this.parseBackgroundAttributes(R,N)),!w&&(F=this.parseChars(R,N),F)){var q=this.currentChannel;if(q&&q>0){var B=this.channels[q];B.insertChars(F)}else this.logger.log(o.WARNING,"No channel found yet. TEXT-MODE?")}!w&&!F&&this.logger.log(o.WARNING,"Couldn't parse cleaned data "+l([R,N])+" orig: "+l([S[z],S[z+1]]))}},x.parseCmd=function(E,S){var w=this.cmdHistory,R=(E===20||E===28||E===21||E===29)&&S>=32&&S<=47,N=(E===23||E===31)&&S>=33&&S<=35;if(!(R||N))return!1;if(g(E,S,w))return b(null,null,w),this.logger.log(o.DEBUG,"Repeated command ("+l([E,S])+") is dropped"),!0;var F=E===20||E===21||E===23?1:2,z=this.channels[F];return E===20||E===21||E===28||E===29?S===32?z.ccRCL():S===33?z.ccBS():S===34?z.ccAOF():S===35?z.ccAON():S===36?z.ccDER():S===37?z.ccRU(2):S===38?z.ccRU(3):S===39?z.ccRU(4):S===40?z.ccFON():S===41?z.ccRDC():S===42?z.ccTR():S===43?z.ccRTD():S===44?z.ccEDM():S===45?z.ccCR():S===46?z.ccENM():S===47&&z.ccEOC():z.ccTO(S-32),b(E,S,w),this.currentChannel=F,!0},x.parseMidrow=function(E,S){var w=0;if((E===17||E===25)&&S>=32&&S<=47){if(E===17?w=1:w=2,w!==this.currentChannel)return this.logger.log(o.ERROR,"Mismatch channel in midrow parsing"),!1;var R=this.channels[w];return R?(R.ccMIDROW(S),this.logger.log(o.DEBUG,"MIDROW ("+l([E,S])+")"),!0):!1}return!1},x.parsePAC=function(E,S){var w,R=this.cmdHistory,N=(E>=17&&E<=23||E>=25&&E<=31)&&S>=64&&S<=127,F=(E===16||E===24)&&S>=64&&S<=95;if(!(N||F))return!1;if(g(E,S,R))return b(null,null,R),!0;var z=E<=23?1:2;S>=64&&S<=95?w=z===1?f[E]:c[E]:w=z===1?p[E]:s[E];var q=this.channels[z];return q?(q.setPAC(this.interpretPAC(w,S)),b(E,S,R),this.currentChannel=z,!0):!1},x.interpretPAC=function(E,S){var w,R={color:null,italics:!1,indent:null,underline:!1,row:E};return S>95?w=S-96:w=S-64,R.underline=(w&1)===1,w<=13?R.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(w/2)]:w<=15?(R.italics=!0,R.color="white"):R.indent=Math.floor((w-16)/2)*4,R},x.parseChars=function(E,S){var w,R=null,N=null;if(E>=25?(w=2,N=E-8):(w=1,N=E),N>=17&&N<=19){var F;N===17?F=S+80:N===18?F=S+112:F=S+144,this.logger.log(o.INFO,"Special char '"+T(F)+"' in channel "+w),R=[F]}else E>=32&&E<=127&&(R=S===0?[E]:[E,S]);if(R){var z=l(R);this.logger.log(o.DEBUG,"Char codes = "+z.join(",")),b(E,S,this.cmdHistory)}return R},x.parseBackgroundAttributes=function(E,S){var w=(E===16||E===24)&&S>=32&&S<=47,R=(E===23||E===31)&&S>=45&&S<=47;if(!(w||R))return!1;var N,F={};E===16||E===24?(N=Math.floor((S-32)/2),F.background=n[N],S%2===1&&(F.background=F.background+"_semi")):S===45?F.background="transparent":(F.foreground="black",S===47&&(F.underline=!0));var z=E<=23?1:2,q=this.channels[z];return q.setBkgData(F),b(E,S,this.cmdHistory),!0},x.reset=function(){for(var E=0;E=16?i--:i++;var b=Object(C.fixLineBreaks)(t.trim()),g=Object(D.generateCueId)(c,s,b);(!p||!p.cues||!p.cues.getCueById(g))&&(l=new d(c,s,b),l.id=g,l.line=v+1,l.align="left",l.position=10+Math.min(80,Math.floor(i*8/32)*10),o.push(l))}return p&&o.length&&(o.sort(function(m,_){return m.line==="auto"||_.line==="auto"?0:m.line>8&&_.line>8?_.line-m.line:m.line-_.line}),o.forEach(function(m){return Object(T.addCueToTrack)(p,m)})),o}};ie.default=O},"./src/utils/discontinuities.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"findFirstFragWithCC",function(){return A}),W.d(ie,"shouldAlignOnDiscontinuities",function(){return O}),W.d(ie,"findDiscontinuousReferenceFrag",function(){return f}),W.d(ie,"adjustSlidingStart",function(){return c}),W.d(ie,"alignStream",function(){return s}),W.d(ie,"alignPDT",function(){return o}),W.d(ie,"alignFragmentByPDTDelta",function(){return r}),W.d(ie,"alignMediaPlaylistByPDT",function(){return l});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/logger.ts"),T=W("./src/controller/level-helper.ts");function A(a,i){for(var t=null,d=0,v=a.length;dt.startCC||a&&a.cc=this.minWeight_},A.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},A.destroy=function(){},T}();ie.default=D},"./src/utils/ewma.ts":function(ce,ie,W){"use strict";W.r(ie);var C=function(){function D(A,O,f){O===void 0&&(O=0),f===void 0&&(f=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=A,this.alpha_=A?Math.exp(Math.log(.5)/A):0,this.estimate_=O,this.totalWeight_=f}var T=D.prototype;return T.sample=function(O,f){var p=Math.pow(this.alpha_,O);this.estimate_=f*(1-p)+p*this.estimate_,this.totalWeight_+=O},T.getTotalWeight=function(){return this.totalWeight_},T.getEstimate=function(){if(this.alpha_){var O=1-Math.pow(this.alpha_,this.totalWeight_);if(O)return this.estimate_/O}return this.estimate_},D}();ie.default=C},"./src/utils/fetch-loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"fetchSupported",function(){return r});var C=W("./src/polyfills/number.ts"),D=W("./src/loader/load-stats.ts"),T=W("./src/demux/chunk-cache.ts");function A(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,s(d,v)}function O(d){var v=typeof Map=="function"?new Map:void 0;return O=function(b){if(b===null||!c(b))return b;if(typeof b!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(b))return v.get(b);v.set(b,g)}function g(){return f(b,arguments,n(this).constructor)}return g.prototype=Object.create(b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),s(g,b)},O(d)}function f(d,v,y){return p()?f=Reflect.construct:f=function(g,m,_){var x=[null];x.push.apply(x,m);var h=Function.bind.apply(g,x),E=new h;return _&&s(E,_.prototype),E},f.apply(null,arguments)}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function c(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function s(d,v){return s=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},s(d,v)}function n(d){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},n(d)}function o(){return o=Object.assign||function(d){for(var v=1;v=_&&x(g,m,h.flush(),b)):x(g,m,N,b),w()}).catch(function(){return Promise.reject()})};return S()},d}();function a(d,v){var y={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(o({},d.headers))};return d.rangeEnd&&y.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),y}function i(d,v){return new self.Request(d.url,v)}var t=function(d){A(v,d);function v(y,b,g){var m;return m=d.call(this,y)||this,m.code=void 0,m.details=void 0,m.code=b,m.details=g,m}return v}(O(Error));ie.default=l},"./src/utils/imsc1-ttml-parser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"IMSC1_CODEC",function(){return c}),W.d(ie,"parseIMSC1",function(){return r});var C=W("./src/utils/mp4-tools.ts"),D=W("./src/utils/vttparser.ts"),T=W("./src/utils/vttcue.ts"),A=W("./src/demux/id3.ts"),O=W("./src/utils/timescale-conversion.ts"),f=W("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(_){for(var x=1;x"):C}function O(c){for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;o>24,v[y+1]=b>>16&255,v[y+2]=b>>8&255,v[y+3]=b&255}function s(v,y){var b=[];if(!y.length)return b;var g,m,_;"data"in v?(g=v.data,m=v.start,_=v.end):(g=v,m=0,_=g.byteLength);for(var x=m;x<_;){var h=p(g,x),E=O(g.subarray(x+4,x+8)),S=h>1?x+h:_;if(E===y[0])if(y.length===1)b.push({data:g,start:x+8,end:S});else{var w=s({data:g,start:x+8,end:S},y.slice(1));w.length&&A.apply(b,w)}x=S}return b}function n(v){var y=s(v,["moov"]),b=y[0],g=b?b.end:null,m=s(v,["sidx"]);if(!m||!m[0])return null;var _=[],x=m[0],h=x.data[0],E=h===0?8:16,S=p(x,E);E+=4;var w=0,R=0;h===0?E+=8:E+=16,E+=2;var N=x.end+R,F=f(x,E);E+=2;for(var z=0;z>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=p(x,q);q+=4,_.push({referenceSize:M,subsegmentDuration:J,info:{duration:J/S,start:N,end:N+M-1}}),N+=M,q+=4,E=q}return{earliestPresentationTime:w,timescale:S,version:h,referencesCount:F,references:_,moovEndOffset:g}}function o(v){for(var y=[],b=s(v,["moov","trak"]),g=0;gO)&&(this.startTime=O),this.endTime=f,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},T.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"sendAddTrackEvent",function(){return D}),W.d(ie,"addCueToTrack",function(){return T}),W.d(ie,"clearCurrentCues",function(){return A}),W.d(ie,"removeCuesInRange",function(){return O}),W.d(ie,"getCuesInRange",function(){return p});var C=W("./src/utils/logger.ts");function D(c,s){var n;try{n=new Event("addtrack")}catch(o){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=c,s.dispatchEvent(n)}function T(c,s){var n=c.mode;if(n==="disabled"&&(c.mode="hidden"),c.cues&&!c.cues.getCueById(s.id))try{if(c.addCue(s),!c.cues.getCueById(s.id))throw new Error("addCue is failed for: "+s)}catch(r){C.logger.debug("[texttrack-utils]: "+r);var o=new self.TextTrackCue(s.startTime,s.endTime,s.text);o.id=s.id,c.addCue(o)}n==="disabled"&&(c.mode=n)}function A(c){var s=c.mode;if(s==="disabled"&&(c.mode="hidden"),c.cues)for(var n=c.cues.length;n--;)c.removeCue(c.cues[n]);s==="disabled"&&(c.mode=s)}function O(c,s,n){var o=c.mode;if(o==="disabled"&&(c.mode="hidden"),c.cues&&c.cues.length>0)for(var r=p(c.cues,s,n),l=0;lc[n].endTime)return-1;for(var o=0,r=n;o<=r;){var l=Math.floor((r+o)/2);if(sc[l].startTime&&o-1)for(var l=r,a=c.length;l=s&&i.endTime<=n)o.push(i);else if(i.startTime>n)return o}return o}},"./src/utils/time-ranges.ts":function(ce,ie,W){"use strict";W.r(ie);var C={toString:function(T){for(var A="",O=T.length,f=0;f1?s-1:0),o=1;o100)throw new Error("Position must be between 0 and 100.");_=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",f({},r,{get:function(){return x},set:function(w){var R=O(w);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");x=R,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",f({},r,{get:function(){return h},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");h=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",f({},r,{get:function(){return E},set:function(w){var R=O(w);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");E=R,this.hasBeenReset=!0}})),o.displayState=void 0}return p.prototype.getCueAsHTML=function(){var c=self.WebVTT;return c.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"parseTimeStamp",function(){return T}),W.d(ie,"fixLineBreaks",function(){return s}),W.d(ie,"VTTParser",function(){return n});var C=W("./src/utils/vttcue.ts"),D=function(){function o(){}var r=o.prototype;return r.decode=function(a,i){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},o}();function T(o){function r(a,i,t,d){return(a|0)*3600+(i|0)*60+(t|0)+parseFloat(d||0)}var l=o.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?r(l[2],l[3],0,l[4]):r(l[1],l[2],l[3],l[4]):null}var A=function(){function o(){this.values=Object.create(null)}var r=o.prototype;return r.set=function(a,i){!this.get(a)&&i!==""&&(this.values[a]=i)},r.get=function(a,i,t){return t?this.has(a)?this.values[a]:i[t]:this.has(a)?this.values[a]:i},r.has=function(a){return a in this.values},r.alt=function(a,i,t){for(var d=0;d=0&&t<=100)return this.set(a,t),!0}return!1},o}();function O(o,r,l,a){var i=a?o.split(a):[o];for(var t in i){if(typeof i[t]!="string")continue;var d=i[t].split(l);if(d.length!==2)continue;var v=d[0],y=d[1];r(v,y)}}var f=new C.default(0,0,""),p=f.align==="middle"?"middle":"center";function c(o,r,l){var a=o;function i(){var v=T(o);if(v===null)throw new Error("Malformed timestamp: "+a);return o=o.replace(/^[^\sa-zA-Z-]+/,""),v}function t(v,y){var b=new A;O(v,function(_,x){var h;switch(_){case"region":for(var E=l.length-1;E>=0;E--)if(l[E].id===x){b.set(_,l[E].region);break}break;case"vertical":b.alt(_,x,["rl","lr"]);break;case"line":h=x.split(","),b.integer(_,h[0]),b.percent(_,h[0])&&b.set("snapToLines",!1),b.alt(_,h[0],["auto"]),h.length===2&&b.alt("lineAlign",h[1],["start",p,"end"]);break;case"position":h=x.split(","),b.percent(_,h[0]),h.length===2&&b.alt("positionAlign",h[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":b.percent(_,x);break;case"align":b.alt(_,x,["start",p,"end","left","right"]);break}},/:/,/\s/),y.region=b.get("region",null),y.vertical=b.get("vertical","");var g=b.get("line","auto");g==="auto"&&f.line===-1&&(g=-1),y.line=g,y.lineAlign=b.get("lineAlign","start"),y.snapToLines=b.get("snapToLines",!0),y.size=b.get("size",100),y.align=b.get("align",p);var m=b.get("position","auto");m==="auto"&&f.position===50&&(m=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=m}function d(){o=o.replace(/^\s+/,"")}if(d(),r.startTime=i(),d(),o.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);o=o.substr(3),d(),r.endTime=i(),d(),t(o,r)}function s(o){return o.replace(//gi,` `)}var n=function(){function o(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=o.prototype;return r.parse=function(a){var i=this;a&&(i.buffer+=i.decoder.decode(a,{stream:!0}));function t(){var m=i.buffer,_=0;for(m=s(m);_")===-1){i.cue.id=v;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{c(v,i.cue,i.regionList)}catch(m){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var g=v.indexOf("-->")!==-1;if(!v||g&&(b=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=` `),i.cue.text+=v}continue;case"BADCUE":v||(i.state="ID")}}}catch(m){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=` `,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){a.onparsingerror&&a.onparsingerror(i)}return a.onflush&&a.onflush(),this},o}()},"./src/utils/webvtt-parser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"generateCueId",function(){return n}),W.d(ie,"parseWebVTT",function(){return r});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/vttparser.ts"),T=W("./src/demux/id3.ts"),A=W("./src/utils/timescale-conversion.ts"),O=W("./src/remux/mp4-remuxer.ts"),f=/\r\n|\n\r|\n|\r/g,p=function(a,i,t){return t===void 0&&(t=0),a.substr(t,i.length)===i},c=function(a){var i=parseInt(a.substr(-3)),t=parseInt(a.substr(-6,2)),d=parseInt(a.substr(-9,2)),v=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(C.isFiniteNumber)(i)||!Object(C.isFiniteNumber)(t)||!Object(C.isFiniteNumber)(d)||!Object(C.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return i+=1e3*t,i+=60*1e3*d,i+=60*60*1e3*v,i},s=function(a){for(var i=5381,t=a.length;t;)i=i*33^a.charCodeAt(--t);return(i>>>0).toString()};function n(l,a,i){return s(l.toString())+s(a.toString())+s(i)}var o=function(a,i,t){var d=a[i],v=a[d.prevCC];if(!v||!v.new&&d.new){a.ccOffset=a.presentationOffset=d.start,d.new=!1;return}for(;(y=v)!==null&&y!==void 0&&y.new;){var y;a.ccOffset+=d.start-v.start,d.new=!1,d=v,v=a[d.prevCC]}a.presentationOffset=t};function r(l,a,i,t,d,v,y,b){var g=new D.VTTParser,m=Object(T.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(f,` `).split(` `),_=[],x=Object(A.toMpegTsClockFromTimescale)(a,i),h="00:00.000",E=0,S=0,w,R=!0,N=!1;g.oncue=function(F){var z=t[d],q=t.ccOffset,B=(E-x)/9e4;if(z!=null&&z.new&&(S!==void 0?q=t.ccOffset=z.start:o(t,d,B)),B&&(q=B-t.presentationOffset),N){var M=F.endTime-F.startTime,G=Object(O.normalizePts)((F.startTime+q-S)*9e4,v*9e4)/9e4;F.startTime=G,F.endTime=G+M}var J=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(J)),F.id||(F.id=n(F.startTime,F.endTime,J)),F.endTime>0&&_.push(F)},g.onparsingerror=function(F){w=F},g.onflush=function(){if(w){b(w);return}y(_)},m.forEach(function(F){if(R)if(p(F,"X-TIMESTAMP-MAP=")){R=!1,N=!0,F.substr(16).split(",").forEach(function(z){p(z,"LOCAL:")?h=z.substr(6):p(z,"MPEGTS:")&&(E=parseInt(z.substr(7)))});try{S=c(h)/1e3}catch(z){N=!1,w=z}return}else F===""&&(R=!1);g.parse(F+` `)}),g.flush()}},"./src/utils/xhr-loader.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/utils/logger.ts"),D=W("./src/loader/load-stats.ts"),T=/^age:\s*[\d.]+\s*$/m,A=function(){function O(p){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=p?p.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var f=O.prototype;return f.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},f.abortInternal=function(){var c=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),c&&(c.onreadystatechange=null,c.onprogress=null,c.readyState!==4&&(this.stats.aborted=!0,c.abort()))},f.abort=function(){var c;this.abortInternal(),(c=this.callbacks)!==null&&c!==void 0&&c.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},f.load=function(c,s,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=c,this.config=s,this.callbacks=n,this.retryDelay=s.retryDelay,this.loadInternal()},f.loadInternal=function(){var c=this.config,s=this.context;if(!c)return;var n=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0;var r=this.xhrSetup;try{if(r)try{r(n,s.url)}catch(i){n.open("GET",s.url,!0),r(n,s.url)}n.readyState||n.open("GET",s.url,!0);var l=this.context.headers;if(l)for(var a in l)n.setRequestHeader(a,l[a])}catch(i){this.callbacks.onError({code:n.status,text:i.message},s,n);return}s.rangeEnd&&n.setRequestHeader("Range","bytes="+s.rangeStart+"-"+(s.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=s.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout),n.send()},f.readystatechange=function(){var c=this.context,s=this.loader,n=this.stats;if(!c||!s)return;var o=s.readyState,r=this.config;if(n.aborted)return;if(o>=2)if(self.clearTimeout(this.requestTimeout),n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),o===4){s.onreadystatechange=null,s.onprogress=null;var l=s.status;if(l>=200&&l<300){n.loading.end=Math.max(self.performance.now(),n.loading.first);var a,i;if(c.responseType==="arraybuffer"?(a=s.response,i=a.byteLength):(a=s.responseText,i=a.length),n.loaded=n.total=i,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(n,c,a,s),!this.callbacks)return;var d={url:s.responseURL,data:a};this.callbacks.onSuccess(d,n,c,s)}else n.retry>=r.maxRetry||l>=400&&l<499?(C.logger.error(l+" while loading "+c.url),this.callbacks.onError({code:l,text:s.statusText},c,s)):(C.logger.warn(l+" while loading "+c.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),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},f.loadtimeout=function(){C.logger.warn("timeout while loading "+this.context.url);var c=this.callbacks;c&&(this.abortInternal(),c.onTimeout(this.stats,this.context,this.loader))},f.loadprogress=function(c){var s=this.stats;s.loaded=c.loaded,c.lengthComputable&&(s.total=c.total)},f.getCacheAge=function(){var c=null;if(this.loader&&T.test(this.loader.getAllResponseHeaders())){var s=this.loader.getResponseHeader("age");c=s?parseFloat(s):null}return c},O}();ie.default=A}}).default})},vHTk:function(nt,Xe,V){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return Q});var ce=V("rePB"),ie=V("VTBJ"),W=V("KQm4"),C=V("U8pU"),D=V("ODXe"),T=V("cDcd"),A=V("TSYQ"),O=V.n(A),f=V("Gytx"),p=V.n(f),c=V("Kwbf"),s=V("t23M"),n=V("qx4F"),o=V("6eGT"),r=V("IBYe"),l=V("Ff2n"),a=V("c+Xe"),i=V("fyJ8"),t=V("biw7");function d(Ne,Be,tt,lt,qe){var Ye=tt[Ne]||{},je=tt[Be]||{},Ue,ke;Ye.fixed==="left"?Ue=lt.left[Ne]:je.fixed==="right"&&(ke=lt.right[Be]);var be=!1,Ce=!1,Pe=!1,Le=!1,Ve=tt[Be+1],at=tt[Ne-1];if(qe==="rtl"){if(Ue!==void 0){var _t=at&&at.fixed==="left";Le=!_t}else if(ke!==void 0){var kt=Ve&&Ve.fixed==="right";Pe=!kt}}else if(Ue!==void 0){var Bt=Ve&&Ve.fixed==="left";be=!Bt}else if(ke!==void 0){var jt=at&&at.fixed==="right";Ce=!jt}return{fixLeft:Ue,fixRight:ke,lastFixLeft:be,firstFixRight:Ce,lastFixRight:Pe,firstFixLeft:Le,isSticky:lt.isSticky}}var v=V("sR1s");function y(Ne){var Be=Ne.cells,tt=Ne.stickyOffsets,lt=Ne.flattenColumns,qe=Ne.rowComponent,Ye=Ne.cellComponent,je=Ne.onHeaderRow,Ue=Ne.index,ke=T.useContext(t.a),be=ke.prefixCls,Ce=ke.direction,Pe;je&&(Pe=je(Be.map(function(Ve){return Ve.column}),Ue));var Le=Object(v.a)(Be.map(function(Ve){return Ve.column}));return T.createElement(qe,Object.assign({},Pe),Be.map(function(Ve,at){var _t=Ve.column,kt=d(Ve.colStart,Ve.colEnd,lt,tt,Ce),Bt;return _t&&_t.onHeaderCell&&(Bt=Ve.column.onHeaderCell(_t)),T.createElement(i.a,Object.assign({},Ve,{ellipsis:_t.ellipsis,align:_t.align,component:Ye,prefixCls:be,key:Le[at]},kt,{additionalProps:Bt,rowType:"header"}))}))}y.displayName="HeaderRow";var b=y;function g(Ne){var Be=[];function tt(je,Ue){var ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Be[ke]=Be[ke]||[];var be=Ue,Ce=je.filter(Boolean).map(function(Pe){var Le={key:Pe.key,className:Pe.className||"",children:Pe.title,column:Pe,colStart:be},Ve=1,at=Pe.children;return at&&at.length>0&&(Ve=tt(at,be,ke+1).reduce(function(_t,kt){return _t+kt},0),Le.hasSubColumns=!0),"colSpan"in Pe&&(Ve=Pe.colSpan),"rowSpan"in Pe&&(Le.rowSpan=Pe.rowSpan),Le.colSpan=Ve,Le.colEnd=Le.colStart+Ve-1,Be[ke].push(Le),be+=Ve,Ve});return Ce}tt(Ne,0);for(var lt=Be.length,qe=function(Ue){Be[Ue].forEach(function(ke){!("rowSpan"in ke)&&!ke.hasSubColumns&&(ke.rowSpan=lt-Ue)})},Ye=0;Ye=0;Ue-=1){var ke=Be[Ue],be=tt&&tt[Ue],Ce=be&&be[x.a];(ke||Ce||je)&&(qe.unshift(T.createElement("col",Object.assign({key:Ue,style:{width:ke,minWidth:ke}},Ce))),je=!0)}return T.createElement("colgroup",null,qe)}var E=h;function S(Ne,Be){return Object(T.useMemo)(function(){for(var tt=[],lt=0;lt1?te-1:0),se=1;se=Pe&&($t=Pe-Le),je({scrollLeft:$t/Pe*(Ce+2)}),jt.current.x=Ze.pageX},st=function(){var Ze=Object(it.b)(Ye.current).top,mt=Ze+Ye.current.offsetHeight,Lt=document.documentElement.scrollTop+window.innerHeight;mt-Object(n.a)()<=Lt||Ze>=Lt-Ue?Bt(function(Mt){return Object(ie.a)(Object(ie.a)({},Mt),{},{isHiddenScrollBar:!0})}):Bt(function(Mt){return Object(ie.a)(Object(ie.a)({},Mt),{},{isHiddenScrollBar:!1})})},It=function(Ze){Bt(function(mt){return Object(ie.a)(Object(ie.a)({},mt),{},{scrollLeft:Ze/Ce*Pe||0})})};return T.useImperativeHandle(tt,function(){return{setScrollLeft:It}}),T.useEffect(function(){var Pt=Object(He.a)(document.body,"mouseup",Oe,!1),Ze=Object(He.a)(document.body,"mousemove",vt,!1);return st(),function(){Pt.remove(),Ze.remove()}},[Le,gt]),T.useEffect(function(){var Pt=Object(He.a)(window,"scroll",st,!1),Ze=Object(He.a)(window,"resize",st,!1);return function(){Pt.remove(),Ze.remove()}},[]),T.useEffect(function(){kt.isHiddenScrollBar||Bt(function(Pt){var Ze,mt;return Object(ie.a)(Object(ie.a)({},Pt),{},{scrollLeft:Ye.current.scrollLeft/((Ze=Ye.current)===null||Ze===void 0?void 0:Ze.scrollWidth)*((mt=Ye.current)===null||mt===void 0?void 0:mt.clientWidth)})})},[kt.isHiddenScrollBar]),Ce<=Pe||!Le||kt.isHiddenScrollBar?null:T.createElement("div",{style:{height:Object(n.a)(),width:Pe,bottom:Ue},className:"".concat(be,"-sticky-scroll")},T.createElement("div",{onMouseDown:ze,ref:Ve,className:O()("".concat(be,"-sticky-scroll-bar"),Object(ce.a)({},"".concat(be,"-sticky-scroll-bar-active"),gt)),style:{width:"".concat(Le,"px"),transform:"translate3d(".concat(kt.scrollLeft,"px, 0, 0)")}}))},P=T.forwardRef(re);function j(Ne,Be){return T.useMemo(function(){var tt=!!Ne;return{isSticky:tt,stickyClassName:tt?"".concat(Be,"-sticky-header"):"",offsetHeader:Object(C.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(C.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,Be])}var ee=[],$={},Q="rc-table-internal-hook",xe=T.memo(function(Ne){var Be=Ne.children;return Be},function(Ne,Be){return p()(Ne.props,Be.props)?Ne.pingLeft!==Be.pingLeft||Ne.pingRight!==Be.pingRight:!1});function De(Ne){var Be,tt=Ne.prefixCls,lt=Ne.className,qe=Ne.rowClassName,Ye=Ne.style,je=Ne.data,Ue=Ne.rowKey,ke=Ne.scroll,be=Ne.tableLayout,Ce=Ne.direction,Pe=Ne.title,Le=Ne.footer,Ve=Ne.summary,at=Ne.id,_t=Ne.showHeader,kt=Ne.components,Bt=Ne.emptyText,jt=Ne.onRow,At=Ne.onHeaderRow,pt=Ne.internalHooks,gt=Ne.transformColumns,rt=Ne.internalRefs,Oe=Ne.sticky,ze=je||ee,vt=!!ze.length,st=T.useState(0),It=Object(D.a)(st,2),Pt=It[0],Ze=It[1];T.useEffect(function(){Ze(Object(n.a)())});var mt=T.useMemo(function(){return Object(v.c)(kt,{})},[kt]),Lt=T.useCallback(function(Ht,en){return Object(v.b)(mt,Ht)||en},[mt]),Mt=T.useMemo(function(){return typeof Ue=="function"?Ue:function(Ht){var en=Ht&&Ht[Ue];return en}},[Ue]),$t=Object(x.c)(Ne),Re=$t.expandIcon,ve=$t.expandedRowKeys,X=$t.defaultExpandedRowKeys,ne=$t.defaultExpandAllRows,oe=$t.expandedRowRender,he=$t.onExpand,Ae=$t.onExpandedRowsChange,Qe=$t.expandRowByClick,ot=$t.rowExpandable,Rt=$t.expandIconColumnIndex,Nt=$t.expandedRowClassName,ht=$t.childrenColumnName,Dt=$t.indentSize,sn=Re||me,Ct=ht||"children",hn=T.useMemo(function(){return oe?"row":Ne.expandable&&pt===Q&&Ne.expandable.__PARENT_RENDER_ICON__||ze.some(function(Ht){return Ht&&Object(C.a)(Ht)==="object"&&Ht[Ct]})?"nest":!1},[!!oe,ze]),rn=T.useState(function(){return X||(ne?We(ze,Mt,Ct):[])}),ae=Object(D.a)(rn,2),U=ae[0],H=ae[1],te=T.useMemo(function(){return new Set(ve||U||[])},[ve,U]),pe=T.useCallback(function(Ht){var en=Mt(Ht,ze.indexOf(Ht)),Xt,Et=te.has(en);Et?(te.delete(en),Xt=Object(W.a)(te)):Xt=[].concat(Object(W.a)(te),[en]),H(Xt),he&&he(!Et,Ht),Ae&&Ae(Xt)},[Mt,te,ze,he,Ae]),se=T.useState(0),$e=Object(D.a)(se,2),yt=$e[0],Ot=$e[1],Yt=Object(Te.b)(Object(ie.a)(Object(ie.a)(Object(ie.a)({},Ne),$t),{},{expandable:!!oe,expandedKeys:te,getRowKey:Mt,onTriggerExpand:pe,expandIcon:sn,expandIconColumnIndex:Rt,direction:Ce}),pt===Q?gt:null),St=Object(D.a)(Yt,2),Wt=St[0],ln=St[1],Bn=T.useMemo(function(){return{columns:Wt,flattenColumns:ln}},[Wt,ln]),Oi=T.useRef(),mi=T.useRef(),Wn=T.useRef(),di=T.useState(!1),hr=Object(D.a)(di,2),vi=hr[0],gi=hr[1],xi=T.useState(!1),Bi=Object(D.a)(xi,2),Ai=Bi[0],sr=Bi[1],Di=_e(new Map),fr=Object(D.a)(Di,2),lr=fr[0],Wi=fr[1],Gi=Object(v.a)(ln),vr=Gi.map(function(Ht){return lr.get(Ht)}),Rr=T.useMemo(function(){return vr},[vr.join("_")]),ur=Me(Rr,ln.length,Ce),Hn=ke&&Object(v.d)(ke.y),wn=ke&&Object(v.d)(ke.x),wi=wn&&ln.some(function(Ht){var en=Ht.fixed;return en}),Mn=T.useRef(),Ri=j(Oe,tt),oi=Ri.isSticky,Lr=Ri.offsetHeader,Ni=Ri.offsetScroll,Qi=Ri.stickyClassName,Br,qi,Kr;Hn&&(qi={overflowY:"scroll",maxHeight:ke.y}),wn&&(Br={overflowX:"auto"},Hn||(qi={overflowY:"hidden"}),Kr={width:ke.x===!0?"auto":ke.x,minWidth:"100%"});var Nr=T.useCallback(function(Ht,en){Wi(function(Xt){var Et=new Map(Xt);return Et.set(Ht,en),Et})},[]),Ir=ye(null),Jr=Object(D.a)(Ir,2),xr=Jr[0],Qr=Jr[1];function qr(Ht,en){if(!en)return;typeof en=="function"?en(Ht):en.scrollLeft!==Ht&&(en.scrollLeft=Ht)}var _r=function(en){var Xt=en.currentTarget,Et=en.scrollLeft,bt=typeof Et=="number"?Et:Xt.scrollLeft,Jt=Xt||$;if(!Qr()||Qr()===Jt){var wt;xr(Jt),qr(bt,mi.current),qr(bt,Wn.current),qr(bt,(wt=Mn.current)===null||wt===void 0?void 0:wt.setScrollLeft)}if(Xt){var cn=Xt.scrollWidth,Ft=Xt.clientWidth;gi(bt>0),sr(bt0?[].concat(Object(ie.a)(l),Object(ie.a)(c(d).map(function(v){return Object(W.a)({fixed:t},v)}))):[].concat(Object(ie.a)(l),[Object(W.a)(Object(W.a)({},a),{},{fixed:t})])},[])}function s(r){for(var l=!0,a=0;a=0;d-=1){var v=r[d];if(t&&v.fixed!=="right")t=!1;else if(!t&&v.fixed==="right"){Object(A.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function n(r){return r.map(function(l){var a=l.fixed,i=Object(C.a)(l,["fixed"]),t=a;return a==="left"?t="right":a==="right"&&(t="left"),Object(W.a)({fixed:t},i)})}function o(r,l){var a=r.prefixCls,i=r.columns,t=r.children,d=r.expandable,v=r.expandedKeys,y=r.getRowKey,b=r.onTriggerExpand,g=r.expandIcon,m=r.rowExpandable,_=r.expandIconColumnIndex,x=r.direction,h=r.expandRowByClick,E=D.useMemo(function(){return i||p(t)},[i,t]),S=D.useMemo(function(){if(d){var N,F=_||0,z=E[F],q=(N={},Object(ce.a)(N,f.a,{className:"".concat(a,"-expand-icon-col")}),Object(ce.a)(N,"title",""),Object(ce.a)(N,"fixed",z?z.fixed:null),Object(ce.a)(N,"className","".concat(a,"-row-expand-icon-cell")),Object(ce.a)(N,"render",function(G,J,K){var Z=y(J,K),le=v.has(Z),de=m?m(J):!0,Te=g({prefixCls:a,expanded:le,expandable:de,record:J,onExpand:b});return h?D.createElement("span",{onClick:function(Ie){return Ie.stopPropagation()}},Te):Te}),N),B=E.slice();return F>=0&&B.splice(F,0,q),B}return E},[d,E,y,v,g,x]),w=D.useMemo(function(){var N=S;return l&&(N=l(N)),N.length||(N=[{render:function(){return null}}]),N},[l,S,x]),R=D.useMemo(function(){return x==="rtl"?n(c(w)):c(w)},[w,x]);return[w,R]}Xe.b=o},wW8i:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return c}),V.d(Xe,"b",function(){return n});var ce=/margin|padding|width|height|max|min|offset/,ie={left:!0,top:!0},W={cssFloat:1,styleFloat:1,float:1};function C(o){return o.nodeType===1?o.ownerDocument.defaultView.getComputedStyle(o,null):{}}function D(o,r,l){if(r=r.toLowerCase(),l==="auto"){if(r==="height")return o.offsetHeight;if(r==="width")return o.offsetWidth}return r in ie||(ie[r]=ce.test(r)),ie[r]?parseFloat(l)||0:l}function T(o,r){var l=arguments.length,a=C(o);return r=W[r]?"cssFloat"in o.style?"cssFloat":"styleFloat":r,l===1?a:D(o,r,a[r]||o.style[r])}function A(o,r,l){var a=arguments.length;if(r=W[r]?"cssFloat"in o.style?"cssFloat":"styleFloat":r,a===3)return typeof l=="number"&&ce.test(r)&&(l="".concat(l,"px")),o.style[r]=l,l;for(var i in r)r.hasOwnProperty(i)&&A(o,i,r[i]);return C(o)}function O(o){return o===document.body?document.documentElement.clientWidth:o.offsetWidth}function f(o){return o===document.body?window.innerHeight||document.documentElement.clientHeight:o.offsetHeight}function p(){var o=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:o,height:r}}function c(){var o=document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight;return{width:o,height:r}}function s(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function n(o){var r=o.getBoundingClientRect(),l=document.documentElement;return{left:r.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:r.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},ynwM:function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global;nt.exports={name:"oldFF-globalStorage",read:C,write:D,each:T,remove:A,clearAll:O};var W=ie.globalStorage;function C(f){return W[f]}function D(f,p){W[f]=p}function T(f){for(var p=W.length-1;p>=0;p--){var c=W.key(p);f(W[c],c)}}function A(f){return W.removeItem(f)}function O(){T(function(f,p){delete W[f]})}}}]);