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

1274 lines
1.1 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[179,3,5,7,8,17,20],{"+NIl":
/*!***************************************************!*\
!*** ./node_modules/codemirror/mode/stex/stex.js ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";t.defineMode("stex",(function(t,e){function n(t,e){t.cmdState.push(e)}function r(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function i(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};function o(t,e){t.f=e}function s(t,e){var i;if(t.match(/^\\[a-zA-Z@]+/)){var s=t.current().slice(1);return n(e,i=new(i=a.hasOwnProperty(s)?a[s]:a.DEFAULT)),o(e,c),i.style}if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/\\]/))return"tag";if(t.match("\\["))return o(e,(function(t,e){return l(t,e,"\\]")})),"keyword";if(t.match("\\("))return o(e,(function(t,e){return l(t,e,"\\)")})),"keyword";if(t.match("$$"))return o(e,(function(t,e){return l(t,e,"$$")})),"keyword";if(t.match("$"))return o(e,(function(t,e){return l(t,e,"$")})),"keyword";var u=t.next();return"%"==u?(t.skipToEnd(),"comment"):"}"==u||"]"==u?(i=r(e))?(i.closeBracket(u),o(e,c),"bracket"):"error":"{"==u||"["==u?(n(e,i=new(i=a.DEFAULT)),"bracket"):/\d/.test(u)?(t.eatWhile(/[\w.%]/),"atom"):(t.eatWhile(/[\w\-_]/),"begin"==(i=function(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var r=e[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}(e)).name&&(i.argument=t.current()),i.styleIdentifier())}function l(t,e,n){if(t.eatSpace())return null;if(n&&t.match(n))return o(e,s),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=t.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(t.skipToEnd(),"comment"):"error"}function c(t,e){var n=t.peek();return"{"==n||"["==n?(r(e).openBracket(n),t.eat(n),o(e,s),"bracket"):/[ \t\r]/.test(n)?(t.eat(n),null):(o(e,s),function(t){var e=t.cmdState.pop();e&&e.closeBracket()}(e),s(t,e))}return a.importmodule=i("importmodule","tag",["string","builtin"]),a.documentclass=i("documentclass","tag",["","atom"]),a.usepackage=i("usepackage","tag",["atom"]),a.begin=i("begin","tag",["atom"]),a.end=i("end","tag",["atom"]),a.label=i("label","tag",["atom"]),a.ref=i("ref","tag",["atom"]),a.eqref=i("eqref","tag",["atom"]),a.cite=i("cite","tag",["atom"]),a.bibitem=i("bibitem","tag",["atom"]),a.Bibitem=i("Bibitem","tag",["atom"]),a.RBibitem=i("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:e.inMathMode?function(t,e){return l(t,e)}:s}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=s,t.cmdState.length=0},lineComment:"%"}})),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}(n(/*! ../../lib/codemirror */"VrN/"))},"+k/U":
/*!*********************************************************************!*\
!*** ./src/pages/MyProblem/LeftPanel/SubmitList/index.less?modules ***!
\*********************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"07cG":
/*!***************************************************!*\
!*** ./src/components/Spinner/index.less?modules ***!
\***************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":
/*!**************************************************************!*\
!*** ./node_modules/codemirror/addon/display/placeholder.js ***!
\**************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){function e(t){t.state.placeholder&&(t.state.placeholder.parentNode.removeChild(t.state.placeholder),t.state.placeholder=null)}function n(t){e(t);var n=t.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=t.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var r=t.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),t.display.lineSpace.insertBefore(n,t.display.lineSpace.firstChild)}function r(t){a(t)&&n(t)}function i(t){var r=t.getWrapperElement(),i=a(t);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(t):e(t)}function a(t){return 1===t.lineCount()&&""===t.getLine(0)}t.defineOption("placeholder","",(function(a,o,s){var l=s&&s!=t.Init;if(o&&!l)a.on("blur",r),a.on("change",i),a.on("swapDoc",i),t.on(a.getInputField(),"compositionupdate",a.state.placeholderCompose=function(){!function(t){setTimeout((function(){var r=!1,i=t.getInputField();"TEXTAREA"==i.nodeName?r=!i.value:1==t.lineCount()&&(r=!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)),r?n(t):e(t)}),20)}(a)}),i(a);else if(!o&&l){a.off("blur",r),a.off("change",i),a.off("swapDoc",i),t.off(a.getInputField(),"compositionupdate",a.state.placeholderCompose),e(a);var c=a.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}o&&!a.hasFocus()&&r(a)}))}(n(/*! ../../lib/codemirror */"VrN/"))},"1eCo":
/*!*************************************************!*\
!*** ./node_modules/codemirror/mode/xml/xml.js ***!
\*************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(r,i){var a,o,s=r.indentUnit,l={},c=i.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function h(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(f("atom","]]>")):null:t.match("--")?n(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(function t(e){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=t(e+1),r.tokenize(n,r);if(">"==i){if(1==e){r.tokenize=h;break}return r.tokenize=t(e-1),r.tokenize(n,r)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(a=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function d(t,e){var n,r,i=t.next();if(">"==i||"/"==i&&t.eat(">"))return e.tokenize=h,a=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return a="equals",null;if("<"==i){e.tokenize=h,e.state=v,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(i)?(e.tokenize=(n=i,(r=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=d;break}return"string"}).isInAttribute=!0,r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=h;break}n.next()}return t}}function p(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function g(t){t.context&&(t.context=t.context.prev)}function m(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;g(t)}}function v(t,e,n){return"openTag"==t?(n.tagStart=e.column(),y):"closeTag"==t?b:v}function y(t,e,n){return"word"==t?(n.tagName=e.current(),o="tag",C):l.allowMissingTagName&&"endTag"==t?(o="tag bracket",C(t,0,n)):(o="error",y)}function b(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(o="tag",x):(o="tag error",S)}return l.allowMissingTagName&&"endTag"==t?(o="tag bracket",x(t,0,n)):(o="error",S)}function x(t,e,n){return"endTag"!=t?(o="error",x):(g(n),v)}function S(t,e,n){return o="error",x(t,0,n)}function C(t,e,n){if("word"==t)return o="attribute",E;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(r)?m(n,r):(m(n,r),n.context=new p(n,r,i==n.indented)),v}return o="error",C}function E(t,e,n){return"equals"==t?w:(l.allowMissing||(o="error"),C(t,0,n))}function w(t,e,n){return"string"==t?k:"word"==t&&l.allowUnquoted?(o="string",C):(o="error",C(t,0,n))}function k(t,e,n){return"string"==t?k:C(t,0,n)}return h.isInText=!0,{startState:function(t){var e={tokenize:h,state:v,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;a=null;var n=e.tokenize(t,e);return(n||a)&&"comment"!=n&&(o=null,e.state=e.state(a||n,t,e),o&&(n="error"==o?n+" error":o)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=d&&e.tokenize!=h)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;i;){if(i.tagName==a[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(a)for(;i;){var o=l.contextGrabbers[i.tagName];if(!o||!o.hasOwnProperty(a[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==w&&(t.state=C)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)n.tagName&&e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(/*! ../../lib/codemirror */"VrN/"))},"1j5w":
/*!*******************************************************!*\
!*** ./node_modules/rc-menu/es/index.js + 11 modules ***!
\*******************************************************/
/*! exports provided: SubMenu, Item, MenuItem, MenuItemGroup, ItemGroup, Divider, default */
/*! exports used: Divider, Item, ItemGroup, SubMenu, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/mini-store/esm/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/omit.js/es/index.js (<- Module is referenced from these modules with unsupported syntax: ./node_modules/antd/lib/button/button.js (referenced with cjs require), ./node_modules/antd/lib/input/Input.js (referenced with cjs require), ./node_modules/antd/lib/input/Password.js (referenced with cjs require), ./node_modules/antd/lib/input/TextArea.js (referenced with cjs require)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-motion/es/index.js (<- Module is referenced from these modules with unsupported syntax: ./node_modules/antd/lib/button/LoadingIcon.js (referenced with cjs require)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/createChainedFunction.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-dom/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"d",(function(){return ot})),n.d(e,"b",(function(){return xt})),n.d(e,"c",(function(){return Ct})),n.d(e,"a",(function(){return wt}));var r=n("VTBJ"),i=n("1OyB"),a=n("vuIU"),o=n("JX7q"),s=n("Ji7U"),l=n("LK+K"),c=n("q1tI"),u=n("I8Z2"),h=n("BGR+"),d=n("wx14"),f=n("rePB"),p=n("4IlW"),g=n("2GS6"),m=n("Gytx"),v=n.n(m),y=n("TSYQ"),b=n.n(y),x=n("U8pU"),S=n("ODXe"),C=/iPhone/i,E=/iPod/i,w=/iPad/i,k=/\bAndroid(?:.+)Mobile\b/i,T=/Android/i,O=/\bAndroid(?:.+)SD4930UR\b/i,A=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,L=/Windows Phone/i,D=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,I=/BB10/i,_=/Opera Mini/i,M=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function P(t,e){return t.test(e)}function F(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),n=e.split("[FBAN");if(void 0!==n[1]){var r=n;e=Object(S.a)(r,1)[0]}if(void 0!==(n=e.split("Twitter"))[1]){var i=n;e=Object(S.a)(i,1)[0]}var a={apple:{phone:P(C,e)&&!P(L,e),ipod:P(E,e),tablet:!P(C,e)&&P(w,e)&&!P(L,e),device:(P(C,e)||P(E,e)||P(w,e))&&!P(L,e)},amazon:{phone:P(O,e),tablet:!P(O,e)&&P(A,e),device:P(O,e)||P(A,e)},android:{phone:!P(L,e)&&P(O,e)||!P(L,e)&&P(k,e),tablet:!P(L,e)&&!P(O,e)&&!P(k,e)&&(P(A,e)||P(T,e)),device:!P(L,e)&&(P(O,e)||P(A,e)||P(k,e)||P(T,e))||P(/\bokhttp\b/i,e)},windows:{phone:P(L,e),tablet:P(D,e),device:P(L,e)||P(D,e)},other:{blackberry:P(R,e),blackberry10:P(I,e),opera:P(_,e),firefox:P(N,e),chrome:P(M,e),device:P(R,e)||P(I,e)||P(_,e)||P(N,e)||P(M,e)},any:null,phone:null,tablet:null};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var j=Object(r.a)(Object(r.a)({},F()),{},{isMobile:F});function B(){}function U(t,e,n){var r=e||"";return t.key||"".concat(r,"item_").concat(n)}function H(t){return"".concat(t,"-menu-")}function G(t,e){var n=-1;c.Children.forEach(t,(function(t){n+=1,t&&t.type&&t.type.isMenuItemGroup?c.Children.forEach(t.props.children,(function(t){e(t,n+=1)})):e(t,n)}))}var z=["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"],W=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t&&"function"==typeof t.getBoundingClientRect&&t.getBoundingClientRect().width;if(n){if(e){var r=getComputedStyle(t),i=r.marginLeft,a=r.marginRight;n+=+i.replace("px","")+ +a.replace("px","")}n=+n.toFixed(6)}return n||0},V=function(t,e,n){t&&"object"===Object(x.a)(t.style)&&(t.style[e]=n)},K=n("KQm4"),q=n("Ff2n"),Y=n("i8i4"),X=n("bdgK"),$=n("uciX"),J=n("8XRh"),Z={adjustX:1,adjustY:1},Q={topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0]}},tt={topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Z,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Z,offset:[4,0]}},et=0,nt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},rt=function(t,e,n){var i=H(e),a=t.getState();t.setState({defaultActiveFirst:Object(r.a)(Object(r.a)({},a.defaultActiveFirst),{},Object(f.a)({},i,n))})},it=function(t){Object(s.a)(n,t);var e=Object(l.a)(n);function n(t){var a;Object(i.a)(this,n),(a=e.call(this,t)).onDestroy=function(t){a.props.onDestroy(t)},a.onKeyDown=function(t){var e=t.keyCode,n=a.menuInstance,r=a.props,i=r.isOpen,o=r.store;if(e===p.a.ENTER)return a.onTitleClick(t),rt(o,a.props.eventKey,!0),!0;if(e===p.a.RIGHT)return i?n.onKeyDown(t):(a.triggerOpenChange(!0),rt(o,a.props.eventKey,!0)),!0;if(e===p.a.LEFT){var s;if(!i)return;return(s=n.onKeyDown(t))||(a.triggerOpenChange(!1),s=!0),s}return!i||e!==p.a.UP&&e!==p.a.DOWN?void 0:n.onKeyDown(t)},a.onOpenChange=function(t){a.props.onOpenChange(t)},a.onPopupVisibleChange=function(t){a.triggerOpenChange(t,t?"mouseenter":"mouseleave")},a.onMouseEnter=function(t){var e=a.props,n=e.eventKey,r=e.onMouseEnter,i=e.store;rt(i,a.props.eventKey,!1),r({key:n,domEvent:t})},a.onMouseLeave=function(t){var e=a.props,n=e.parentMenu,r=e.eventKey,i=e.onMouseLeave;n.subMenuInstance=Object(o.a)(a),i({key:r,domEvent:t})},a.onTitleMouseEnter=function(t){var e=a.props,n=e.eventKey,r=e.onItemHover,i=e.onTitleMouseEnter;r({key:n,hover:!0}),i({key:n,domEvent:t})},a.onTitleMouseLeave=function(t){var e=a.props,n=e.parentMenu,r=e.eventKey,i=e.onItemHover,s=e.onTitleMouseLeave;n.subMenuInstance=Object(o.a)(a),i({key:r,hover:!1}),s({key:r,domEvent:t})},a.onTitleClick=function(t){var e=Object(o.a)(a).props;e.onTitleClick({key:e.eventKey,domEvent:t}),"hover"!==e.triggerSubMenuAction&&(a.triggerOpenChange(!e.isOpen,"click"),rt(e.store,a.props.eventKey,!1))},a.onSubMenuClick=function(t){"function"==typeof a.props.onClick&&a.props.onClick(a.addKeyPath(t))},a.onSelect=function(t){a.props.onSelect(t)},a.onDeselect=function(t){a.props.onDeselect(t)},a.getPrefixCls=function(){return"".concat(a.props.rootPrefixCls,"-submenu")},a.getActiveClassName=function(){return"".concat(a.getPrefixCls(),"-active")},a.getDisabledClassName=function(){return"".concat(a.getPrefixCls(),"-disabled")},a.getSelectedClassName=function(){return"".concat(a.getPrefixCls(),"-selected")},a.getOpenClassName=function(){return"".concat(a.props.rootPrefixCls,"-submenu-open")},a.saveMenuInstance=function(t){a.menuInstance=t},a.addKeyPath=function(t){return Object(r.a)(Object(r.a)({},t),{},{keyPath:(t.keyPath||[]).concat(a.props.eventKey)})},a.triggerOpenChange=function(t,e){var n=a.props.eventKey,r=function(){a.onOpenChange({key:n,item:Object(o.a)(a),trigger:e,open:t})};"mouseenter"===e?a.mouseenterTimeout=setTimeout((function(){r()}),0):r()},a.isChildrenSelected=function(){var t={find:!1};return function t(e,n,r){e&&!r.find&&c.Children.forEach(e,(function(e){if(e){var i=e.type;if(!i||!(i.isSubMenu||i.isMenuItem||i.isMenuItemGroup))return;-1!==n.indexOf(e.key)?r.find=!0:e.props.children&&t(e.props.children,n,r)}}))}(a.props.children,a.props.selectedKeys,t),t.find},a.isOpen=function(){return-1!==a.props.openKeys.indexOf(a.props.eventKey)},a.adjustWidth=function(){if(a.subMenuTitle&&a.menuInstance){var t=Y.findDOMNode(a.menuInstance);t.offsetWidth>=a.subMenuTitle.offsetWidth||(t.style.minWidth="".concat(a.subMenuTitle.offsetWidth,"px"))}},a.saveSubMenuTitle=function(t){a.subMenuTitle=t},a.getBaseProps=function(){var t=Object(o.a)(a).props;return{mode:"horizontal"===t.mode?"vertical":t.mode,visible:a.props.isOpen,level:t.level+1,inlineIndent:t.inlineIndent,focusable:!1,onClick:a.onSubMenuClick,onSelect:a.onSelect,onDeselect:a.onDeselect,onDestroy:a.onDestroy,selectedKeys:t.selectedKeys,eventKey:"".concat(t.eventKey,"-menu-"),openKeys:t.openKeys,motion:t.motion,onOpenChange:a.onOpenChange,subMenuOpenDelay:t.subMenuOpenDelay,parentMenu:Object(o.a)(a),subMenuCloseDelay:t.subMenuCloseDelay,forceSubMenuRender:t.forceSubMenuRender,triggerSubMenuAction:t.triggerSubMenuAction,builtinPlacements:t.builtinPlacements,defaultActiveFirst:t.store.getState().defaultActiveFirst[H(t.eventKey)],multiple:t.multiple,prefixCls:t.rootPrefixCls,id:a.internalMenuId,manualRef:a.saveMenuInstance,itemIcon:t.itemIcon,expandIcon:t.expandIcon,direction:t.direction}},a.getMotion=function(t,e){var n=Object(o.a)(a).haveRendered,i=a.props,s=i.motion,l=i.rootPrefixCls;return Object(r.a)(Object(r.a)({},s),{},{leavedClassName:"".concat(l,"-hidden"),removeOnLeave:!1,motionAppear:n||!e||"inline"!==t})};var s=t.store,l=t.eventKey,u=s.getState().defaultActiveFirst;a.isRootMenu=!1;var h=!1;return u&&(h=u[l]),rt(s,l,h),a}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var t=this,e=this.props,n=e.mode,r=e.parentMenu,i=e.manualRef;i&&i(this),"horizontal"===n&&r.isRootMenu&&this.props.isOpen&&(this.minWidthTimeout=setTimeout((function(){return t.adjustWidth()}),0))}},{key:"componentWillUnmount",value:function(){var t=this.props,e=t.onDestroy,n=t.eventKey;e&&e(n),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(t){var e=this,n=this.getBaseProps(),r=this.getMotion(n.mode,n.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||n.visible||n.forceSubMenuRender,!this.haveOpened)return c.createElement("div",null);var i=n.direction;return c.createElement(J.default,Object.assign({visible:n.visible},r),(function(r){var a=r.className,o=r.style,s=b()("".concat(n.prefixCls,"-sub"),a,Object(f.a)({},"".concat(n.prefixCls,"-rtl"),"rtl"===i));return c.createElement(pt,Object.assign({},n,{id:e.internalMenuId,className:s,style:o}),t)}))}},{key:"render",value:function(){var t,e=Object(r.a)({},this.props),n=e.isOpen,i=this.getPrefixCls(),a="inline"===e.mode,o=b()(i,"".concat(i,"-").concat(e.mode),(t={},Object(f.a)(t,e.className,!!e.className),Object(f.a)(t,this.getOpenClassName(),n),Object(f.a)(t,this.getActiveClassName(),e.active||n&&!a),Object(f.a)(t,this.getDisabledClassName(),e.disabled),Object(f.a)(t,this.getSelectedClassName(),this.isChildrenSelected()),t));this.internalMenuId||(e.eventKey?this.internalMenuId="".concat(e.eventKey,"$Menu"):(et+=1,this.internalMenuId="$__$".concat(et,"$Menu")));var s={},l={},u={};e.disabled||(s={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},l={onClick:this.onTitleClick},u={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var h={},d=e.direction;a&&("rtl"===d?h.paddingRight=e.inlineIndent*e.level:h.paddingLeft=e.inlineIndent*e.level);var p={};this.props.isOpen&&(p={"aria-owns":this.internalMenuId});var g=null;"horizontal"!==e.mode&&(g=this.props.expandIcon,"function"==typeof this.props.expandIcon&&(g=c.createElement(this.props.expandIcon,Object(r.a)({},this.props))));var m=c.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:h,className:"".concat(i,"-title"),role:"button"},u,l,{"aria-expanded":n},p,{"aria-haspopup":"true",title:"string"==typeof e.title?e.title:void 0}),e.title,g||c.createElement("i",{className:"".concat(i,"-arrow")})),v=this.renderChildren(e.children),y=e.parentMenu.isRootMenu?e.parentMenu.props.getPopupContainer:function(t){return t.parentNode},x=nt[e.mode],S=e.popupOffset?{offset:e.popupOffset}:{},C="inline"===e.mode?"":e.popupClassName;C+="rtl"===d?" ".concat(i,"-rtl"):"";var E=e.disabled,w=e.triggerSubMenuAction,k=e.subMenuOpenDelay,T=e.forceSubMenuRender,O=e.subMenuCloseDelay,A=e.builtinPlacements;z.forEach((function(t){return delete e[t]})),delete e.onClick;var L="rtl"===d?Object.assign({},tt,A):Object.assign({},Q,A);return delete e.direction,c.createElement("li",Object.assign({},e,s,{className:o,role:"menuitem"}),a&&m,a&&v,!a&&c.createElement($.a,{prefixCls:i,popupClassName:b()("".concat(i,"-popup"),C),getPopupContainer:y,builtinPlacements:L,popupPlacement:x,popupVisible:n,popupAlign:S,popup:v,action:E?[]:[w],mouseEnterDelay:k,mouseLeaveDelay:O,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:T},m))}}]),n}(c.Component);it.defaultProps={onMouseEnter:B,onMouseLeave:B,onTitleMouseEnter:B,onTitleMouseLeave:B,onTitleClick:B,manualRef:B,mode:"vertical",title:""};var at=Object(u.b)((function(t,e){var n=t.openKeys,r=t.activeKey,i=t.selectedKeys,a=e.eventKey,o=e.subMenuKey;return{isOpen:n.indexOf(a)>-1,active:r[o]===a,selectedKeys:i}}))(it);at.isSubMenu=!0;var ot=at,st=function(t){Object(s.a)(n,t);var e=Object(l.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.apply(this,arguments)).resizeObserver=null,t.mutationObserver=null,t.originalTotalWidth=0,t.overflowedItems=[],t.menuItemSizes=[],t.cancelFrameId=null,t.state={lastVisibleIndex:void 0},t.getMenuItemNodes=function(){var e=t.props.prefixCls,n=Y.findDOMNode(Object(o.a)(t));return n?[].slice.call(n.children).filter((function(t){return t.className.split(" ").indexOf("".concat(e,"-overflowed-submenu"))<0})):[]},t.getOverflowedSubMenuItem=function(e,n,i){var a=t.props,o=a.overflowedIndicator,s=a.level,l=a.mode,u=a.prefixCls,h=a.theme;if(1!==s||"horizontal"!==l)return null;var d=t.props.children[0].props,f=(d.children,d.title,d.style),p=Object(q.a)(d,["children","title","style"]),g=Object(r.a)({},f),m="".concat(e,"-overflowed-indicator"),v="".concat(e,"-overflowed-indicator");0===n.length&&!0!==i?g=Object(r.a)(Object(r.a)({},g),{},{display:"none"}):i&&(g=Object(r.a)(Object(r.a)({},g),{},{visibility:"hidden",position:"absolute"}),m="".concat(m,"-placeholder"),v="".concat(v,"-placeholder"));var y=h?"".concat(u,"-").concat(h):"",b={};return z.forEach((function(t){void 0!==p[t]&&(b[t]=p[t])})),c.createElement(ot,Object.assign({title:o,className:"".concat(u,"-overflowed-submenu"),popupClassName:y},b,{key:m,eventKey:v,disabled:!1,style:g}),n)},t.setChildrenWidthAndResize=function(){if("horizontal"===t.props.mode){var e=Y.findDOMNode(Object(o.a)(t));if(e){var n=e.children;if(n&&0!==n.length){var r=e.children[n.length-1];V(r,"display","inline-block");var i=t.getMenuItemNodes(),a=i.filter((function(t){return t.className.split(" ").indexOf("menuitem-overflowed")>=0}));a.forEach((function(t){V(t,"display","inline-block")})),t.menuItemSizes=i.map((function(t){return W(t,!0)})),a.forEach((function(t){V(t,"display","none")})),t.overflowedIndicatorWidth=W(e.children[e.children.length-1],!0),t.originalTotalWidth=t.menuItemSizes.reduce((function(t,e){return t+e}),0),t.handleResize(),V(r,"display","none")}}}},t.handleResize=function(){if("horizontal"===t.props.mode){var e=Y.findDOMNode(Object(o.a)(t));if(e){var n=W(e);t.overflowedItems=[];var r,i=0;t.originalTotalWidth>n+.5&&(r=-1,t.menuItemSizes.forEach((function(e){(i+=e)+t.overflowedIndicatorWidth<=n&&(r+=1)}))),t.setState({lastVisibleIndex:r})}}},t}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var t=this;if(this.setChildrenWidthAndResize(),1===this.props.level&&"horizontal"===this.props.mode){var e=Y.findDOMNode(this);if(!e)return;this.resizeObserver=new X.default((function(e){e.forEach((function(){var e=t.cancelFrameId;cancelAnimationFrame(e),t.cancelFrameId=requestAnimationFrame(t.setChildrenWidthAndResize)}))})),[].slice.call(e.children).concat(e).forEach((function(e){t.resizeObserver.observe(e)})),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((function(){t.resizeObserver.disconnect(),[].slice.call(e.children).concat(e).forEach((function(e){t.resizeObserver.observe(e)})),t.setChildrenWidthAndResize()})),this.mutationObserver.observe(e,{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(t){var e=this,n=this.state.lastVisibleIndex;return(t||[]).reduce((function(r,i,a){var o=i;if("horizontal"===e.props.mode){var s=e.getOverflowedSubMenuItem(i.props.eventKey,[]);void 0!==n&&-1!==e.props.className.indexOf("".concat(e.props.prefixCls,"-root"))&&(a>n&&(o=c.cloneElement(i,{style:{display:"none"},eventKey:"".concat(i.props.eventKey,"-hidden"),className:"".concat("menuitem-overflowed")})),a===n+1&&(e.overflowedItems=t.slice(n+1).map((function(t){return c.cloneElement(t,{key:t.props.eventKey,mode:"vertical-left"})})),s=e.getOverflowedSubMenuItem(i.props.eventKey,e.overflowedItems)));var l=[].concat(Object(K.a)(r),[s,o]);return a===t.length-1&&l.push(e.getOverflowedSubMenuItem(i.props.eventKey,[],!0)),l}return[].concat(Object(K.a)(r),[o])}),[])}},{key:"render",value:function(){var t=this.props,e=(t.visible,t.prefixCls,t.overflowedIndicator,t.mode,t.level,t.tag),n=t.children,r=(t.theme,Object(q.a)(t,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"])),i=e;return c.createElement(i,Object.assign({},r),this.renderChildren(n))}}]),n}(c.Component);st.defaultProps={tag:"div",className:""};var lt=st;function ct(t,e,n){var i=t.getState();t.setState({activeKey:Object(r.a)(Object(r.a)({},i.activeKey),{},Object(f.a)({},e,n))})}function ut(t){return t.eventKey||"0-menu-"}function ht(t,e){var n,r=e,i=t.children,a=t.eventKey;if(r&&(G(i,(function(t,e){t&&t.props&&!t.props.disabled&&r===U(t,a,e)&&(n=!0)})),n))return r;return r=null,t.defaultActiveFirst?(G(i,(function(t,e){r||!t||t.props.disabled||(r=U(t,a,e))})),r):r}function dt(t){if(t){var e=this.instanceArray.indexOf(t);-1!==e?this.instanceArray[e]=t:this.instanceArray.push(t)}}var ft=function(t){Object(s.a)(n,t);var e=Object(l.a)(n);function n(t){var a;return Object(i.a)(this,n),(a=e.call(this,t)).onKeyDown=function(t,e){var n,r=t.keyCode;if(a.getFlatInstanceArray().forEach((function(e){e&&e.props.active&&e.onKeyDown&&(n=e.onKeyDown(t))})),n)return 1;var i=null;return r!==p.a.UP&&r!==p.a.DOWN||(i=a.step(r===p.a.UP?-1:1)),i?(t.preventDefault(),ct(a.props.store,ut(a.props),i.props.eventKey),"function"==typeof e&&e(i),1):void 0},a.onItemHover=function(t){var e=t.key,n=t.hover;ct(a.props.store,ut(a.props),n?e:null)},a.onDeselect=function(t){a.props.onDeselect(t)},a.onSelect=function(t){a.props.onSelect(t)},a.onClick=function(t){a.props.onClick(t)},a.onOpenChange=function(t){a.props.onOpenChange(t)},a.onDestroy=function(t){a.props.onDestroy(t)},a.getFlatInstanceArray=function(){return a.instanceArray},a.step=function(t){var e=a.getFlatInstanceArray(),n=a.props.store.getState().activeKey[ut(a.props)],r=e.length;if(!r)return null;t<0&&(e=e.concat().reverse());var i=-1;if(e.every((function(t,e){return!t||t.props.eventKey!==n||(i=e,!1)})),a.props.defaultActiveFirst||-1===i||(o=e.slice(i,r-1)).length&&!o.every((function(t){return!!t.props.disabled}))){var o,s=(i+1)%r,l=s;do{var c=e[l];if(c&&!c.props.disabled)return c;l=(l+1)%r}while(l!==s);return null}},a.renderCommonMenuItem=function(t,e,n){var i=a.props.store.getState(),s=Object(o.a)(a).props,l=U(t,s.eventKey,e),u=t.props;if(!u||"string"==typeof t.type)return t;var h=l===i.activeKey,d=Object(r.a)(Object(r.a)({mode:u.mode||s.mode,level:s.level,inlineIndent:s.inlineIndent,renderMenuItem:a.renderMenuItem,rootPrefixCls:s.prefixCls,index:e,parentMenu:s.parentMenu,manualRef:u.disabled?void 0:Object(g.a)(t.ref,dt.bind(Object(o.a)(a))),eventKey:l,active:!u.disabled&&h,multiple:s.multiple,onClick:function(t){(u.onClick||B)(t),a.onClick(t)},onItemHover:a.onItemHover,motion:s.motion,subMenuOpenDelay:s.subMenuOpenDelay,subMenuCloseDelay:s.subMenuCloseDelay,forceSubMenuRender:s.forceSubMenuRender,onOpenChange:a.onOpenChange,onDeselect:a.onDeselect,onSelect:a.onSelect,builtinPlacements:s.builtinPlacements,itemIcon:u.itemIcon||a.props.itemIcon,expandIcon:u.expandIcon||a.props.expandIcon},n),{},{direction:s.direction});return("inline"===s.mode||j.any)&&(d.triggerSubMenuAction="click"),c.cloneElement(t,d)},a.renderMenuItem=function(t,e,n){if(!t)return null;var r=a.props.store.getState(),i={openKeys:r.openKeys,selectedKeys:r.selectedKeys,triggerSubMenuAction:a.props.triggerSubMenuAction,subMenuKey:n};return a.renderCommonMenuItem(t,e,i)},t.store.setState({activeKey:Object(r.a)(Object(r.a)({},t.store.getState().activeKey),{},Object(f.a)({},t.eventKey,ht(t,t.activeKey)))}),a.instanceArray=[],a}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(t){return this.props.visible||t.visible||this.props.className!==t.className||!v()(this.props.style,t.style)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n="activeKey"in e?e.activeKey:e.store.getState().activeKey[ut(e)],r=ht(e,n);if(r!==n)ct(e.store,ut(e),r);else if("activeKey"in t){r!==ht(t,t.activeKey)&&ct(e.store,ut(e),r)}}},{key:"render",value:function(){var t=this,e=Object(d.a)({},this.props);this.instanceArray=[];var n={className:b()(e.prefixCls,e.className,"".concat(e.prefixCls,"-").concat(e.mode)),role:e.role||"menu"};e.id&&(n.id=e.id),e.focusable&&(n.tabIndex=0,n.onKeyDown=this.onKeyDown);var r=e.prefixCls,i=e.eventKey,a=e.visible,o=e.level,s=e.mode,l=e.overflowedIndicator,u=e.theme;return z.forEach((function(t){return delete e[t]})),delete e.onClick,c.createElement(lt,Object.assign({},e,{prefixCls:r,mode:s,tag:"ul",level:o,theme:u,visible:a,overflowedIndicator:l},n),c.Children.map(e.children,(function(e,n){return t.renderMenuItem(e,n,i||"0-menu-")})))}}]),n}(c.Component);ft.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:B};var pt=Object(u.b)()(ft),gt=n("Kwbf");function mt(t,e,n){var r=t.prefixCls,i=t.motion,a=t.defaultMotions,o=void 0===a?{}:a,s=t.openAnimation,l=t.openTransitionName,c=e.switchingModeFromInline;if(i)return i;if("object"===Object(x.a)(s)&&s)Object(gt.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if("string"==typeof s)return{motionName:"".concat(r,"-open-").concat(s)};if(l)return{motionName:l};var u=o[n];return u||(c?null:o.other)}var vt=function(t){Object(s.a)(n,t);var e=Object(l.a)(n);function n(t){var a;Object(i.a)(this,n),(a=e.call(this,t)).inlineOpenKeys=[],a.onSelect=function(t){var e=Object(o.a)(a).props;if(e.selectable){var n=a.store.getState().selectedKeys,i=t.key;n=e.multiple?n.concat([i]):[i],"selectedKeys"in e||a.store.setState({selectedKeys:n}),e.onSelect(Object(r.a)(Object(r.a)({},t),{},{selectedKeys:n}))}},a.onClick=function(t){var e=a.getRealMenuMode(),n=Object(o.a)(a),r=n.store,i=n.props.onOpenChange;"inline"===e||"openKeys"in a.props||(r.setState({openKeys:[]}),i([])),a.props.onClick(t)},a.onKeyDown=function(t,e){a.innerMenu.getWrappedInstance().onKeyDown(t,e)},a.onOpenChange=function(t){var e=Object(o.a)(a).props,n=a.store.getState().openKeys.concat(),r=!1,i=function(t){var e=!1;if(t.open)(e=-1===n.indexOf(t.key))&&n.push(t.key);else{var i=n.indexOf(t.key);(e=-1!==i)&&n.splice(i,1)}r=r||e};Array.isArray(t)?t.forEach(i):i(t),r&&("openKeys"in a.props||a.store.setState({openKeys:n}),e.onOpenChange(n))},a.onDeselect=function(t){var e=Object(o.a)(a).props;if(e.selectable){var n=a.store.getState().selectedKeys.concat(),i=t.key,s=n.indexOf(i);-1!==s&&n.splice(s,1),"selectedKeys"in e||a.store.setState({selectedKeys:n}),e.onDeselect(Object(r.a)(Object(r.a)({},t),{},{selectedKeys:n}))}},a.onMouseEnter=function(t){a.restoreModeVerticalFromInline();var e=a.props.onMouseEnter;e&&e(t)},a.onTransitionEnd=function(t){var e="width"===t.propertyName&&t.target===t.currentTarget,n=t.target.className,r="[object SVGAnimatedString]"===Object.prototype.toString.call(n)?n.animVal:n,i="font-size"===t.propertyName&&r.indexOf("anticon")>=0;(e||i)&&a.restoreModeVerticalFromInline()},a.setInnerMenu=function(t){a.innerMenu=t},a.isRootMenu=!0;var s=t.defaultSelectedKeys,l=t.defaultOpenKeys;return"selectedKeys"in t&&(s=t.selectedKeys||[]),"openKeys"in t&&(l=t.openKeys||[]),a.store=Object(u.c)({selectedKeys:s,openKeys:l,activeKey:{"0-menu-":ht(t,t.activeKey)}}),a.state={switchingModeFromInline:!1},a}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(t){this.updateOpentKeysWhenSwitchMode(t),this.updateMiniStore();var e=this.props,n=e.siderCollapsed,r=e.inlineCollapsed,i=e.onOpenChange;(!t.inlineCollapsed&&r||!t.siderCollapsed&&n)&&i([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(t){var e=this.props,n=this.store,r=this.inlineOpenKeys,i=n.getState(),a={};"inline"===t.mode&&"inline"!==e.mode&&this.setState({switchingModeFromInline:!0}),"openKeys"in e||((e.inlineCollapsed&&!t.inlineCollapsed||e.siderCollapsed&&!t.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=i.openKeys.concat(),a.openKeys=[]),(!e.inlineCollapsed&&t.inlineCollapsed||!e.siderCollapsed&&t.siderCollapsed)&&(a.openKeys=r,this.inlineOpenKeys=[])),Object.keys(a).length&&n.setState(a)}},{key:"updateMenuDisplay",value:function(){var t=this.props.collapsedWidth,e=this.store,n=this.prevOpenKeys;this.getInlineCollapsed()&&(0===t||"0"===t||"0px"===t)?(this.prevOpenKeys=e.getState().openKeys.concat(),this.store.setState({openKeys:[]})):n&&(this.store.setState({openKeys:n}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var t=this.props.mode,e=this.state.switchingModeFromInline,n=this.getInlineCollapsed();return e&&n?"inline":n?"vertical":t}},{key:"getInlineCollapsed",value:function(){var t=this.props,e=t.inlineCollapsed,n=t.siderCollapsed;return void 0!==n?n:e}},{key:"restoreModeVerticalFromInline",value:function(){this.state.switchingModeFromInline&&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 t=Object(r.a)({},Object(h.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),e=this.getRealMenuMode();return t.className+=" ".concat(t.prefixCls,"-root"),"rtl"===t.direction&&(t.className+=" ".concat(t.prefixCls,"-rtl")),delete(t=Object(r.a)(Object(r.a)({},t),{},{mode:e,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:mt(this.props,this.state,e)})).openAnimation,delete t.openTransitionName,c.createElement(u.a,{store:this.store},c.createElement(pt,Object.assign({},t,{ref:this.setInnerMenu}),this.props.children))}}]),n}(c.Component);vt.defaultProps={selectable:!0,onClick:B,onSelect:B,onOpenChange:B,onDeselect:B,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:c.createElement("span",null,"···")};var yt=vt,bt=function(t){Object(s.a)(n,t);var e=Object(l.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.apply(this,arguments)).onKeyDown=function(e){if(e.keyCode===p.a.ENTER)return t.onClick(e),!0},t.onMouseLeave=function(e){var n=t.props,r=n.eventKey,i=n.onItemHover,a=n.onMouseLeave;i({key:r,hover:!1}),a({key:r,domEvent:e})},t.onMouseEnter=function(e){var n=t.props,r=n.eventKey,i=n.onItemHover,a=n.onMouseEnter;i({key:r,hover:!0}),a({key:r,domEvent:e})},t.onClick=function(e){var n=t.props,r=n.eventKey,i=n.multiple,a=n.onClick,s=n.onSelect,l=n.onDeselect,c=n.isSelected,u={key:r,keyPath:[r],item:Object(o.a)(t),domEvent:e};a(u),i?c?l(u):s(u):c||s(u)},t.saveNode=function(e){t.node=e},t}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var t=this.props;t.onDestroy&&t.onDestroy(t.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 t,e=Object(r.a)({},this.props),n=b()(this.getPrefixCls(),e.className,(t={},Object(f.a)(t,this.getActiveClassName(),!e.disabled&&e.active),Object(f.a)(t,this.getSelectedClassName(),e.isSelected),Object(f.a)(t,this.getDisabledClassName(),e.disabled),t)),i=Object(r.a)(Object(r.a)({},e.attribute),{},{title:"string"==typeof e.title?e.title:void 0,className:n,role:e.role||"menuitem","aria-disabled":e.disabled});"option"===e.role?i=Object(r.a)(Object(r.a)({},i),{},{role:"option","aria-selected":e.isSelected}):null!==e.role&&"none"!==e.role||(i.role="none");var a={onClick:e.disabled?null:this.onClick,onMouseLeave:e.disabled?null:this.onMouseLeave,onMouseEnter:e.disabled?null:this.onMouseEnter},o=Object(r.a)({},e.style);"inline"===e.mode&&("rtl"===e.direction?o.paddingRight=e.inlineIndent*e.level:o.paddingLeft=e.inlineIndent*e.level),z.forEach((function(t){return delete e[t]})),delete e.direction;var s=this.props.itemIcon;return"function"==typeof this.props.itemIcon&&(s=c.createElement(this.props.itemIcon,this.props)),c.createElement("li",Object.assign({},Object(h.default)(e,["onClick","onMouseEnter","onMouseLeave","onSelect"]),i,a,{style:o,ref:this.saveNode}),e.children,s)}}]),n}(c.Component);bt.isMenuItem=!0,bt.defaultProps={onSelect:B,onMouseEnter:B,onMouseLeave:B,manualRef:B};var xt=Object(u.b)((function(t,e){var n=t.activeKey,r=t.selectedKeys,i=e.eventKey;return{active:n[e.subMenuKey]===i,isSelected:-1!==r.indexOf(i)}}))(bt),St=function(t){Object(s.a)(n,t);var e=Object(l.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.apply(this,arguments)).renderInnerMenuItem=function(e){var n=t.props;return(0,n.renderMenuItem)(e,n.index,t.props.subMenuKey)},t}return Object(a.a)(n,[{key:"render",value:function(){var t=Object(d.a)({},this.props),e=t.className,n=void 0===e?"":e,r=t.rootPrefixCls,i="".concat(r,"-item-group-title"),a="".concat(r,"-item-group-list"),o=t.title,s=t.children;return z.forEach((function(e){return delete t[e]})),delete t.onClick,delete t.direction,c.createElement("li",Object.assign({},t,{className:"".concat(n," ").concat(r,"-item-group")}),c.createElement("div",{className:i,title:"string"==typeof o?o:void 0},o),c.createElement("ul",{className:a},c.Children.map(s,this.renderInnerMenuItem)))}}]),n}(c.Component);St.isMenuItemGroup=!0,St.defaultProps={disabled:!0};var Ct=St,Et=function(t){var e=t.className,n=t.rootPrefixCls,r=t.style;return c.createElement("li",{className:"".concat(e," ").concat(n,"-item-divider"),style:r})};Et.defaultProps={disabled:!0,className:"",style:{}};var wt=Et;e.e=yt},"55Ip":
/*!***************************************************************!*\
!*** ./node_modules/react-router-dom/esm/react-router-dom.js ***!
\***************************************************************/
/*! exports provided: MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter, BrowserRouter, HashRouter, Link, NavLink */
/*! exports used: Link, NavLink */function(t,e,n){"use strict";n.d(e,"a",(function(){return m})),n.d(e,"b",(function(){return b}));var r=n(/*! react-router */"Ty5D"),i=n(/*! @babel/runtime/helpers/esm/inheritsLoose */"dI71"),a=n(/*! react */"q1tI"),o=n.n(a),s=n(/*! history */"YS25"),l=(n(/*! prop-types */"17x9"),n(/*! @babel/runtime/helpers/esm/extends */"wx14")),c=n(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */"zLVn"),u=n(/*! tiny-invariant */"9R94");o.a.Component;o.a.Component;var h=function(t,e){return"function"==typeof t?t(e):t},d=function(t,e){return"string"==typeof t?Object(s.c)(t,null,null,e):t},f=function(t){return t},p=o.a.forwardRef;void 0===p&&(p=f);var g=p((function(t,e){var n=t.innerRef,r=t.navigate,i=t.onClick,a=Object(c.a)(t,["innerRef","navigate","onClick"]),s=a.target,u=Object(l.a)({},a,{onClick:function(t){try{i&&i(t)}catch(e){throw t.preventDefault(),e}t.defaultPrevented||0!==t.button||s&&"_self"!==s||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||(t.preventDefault(),r())}});return u.ref=f!==p&&e||n,o.a.createElement("a",u)}));var m=p((function(t,e){var n=t.component,i=void 0===n?g:n,a=t.replace,s=t.to,m=t.innerRef,v=Object(c.a)(t,["component","replace","to","innerRef"]);return o.a.createElement(r.e.Consumer,null,(function(t){t||Object(u.a)(!1);var n=t.history,r=d(h(s,t.location),t.location),c=r?n.createHref(r):"",g=Object(l.a)({},v,{href:c,navigate:function(){var e=h(s,t.location);(a?n.replace:n.push)(e)}});return f!==p?g.ref=e||m:g.innerRef=m,o.a.createElement(i,g)}))})),v=function(t){return t},y=o.a.forwardRef;void 0===y&&(y=v);var b=y((function(t,e){var n=t["aria-current"],i=void 0===n?"page":n,a=t.activeClassName,s=void 0===a?"active":a,f=t.activeStyle,p=t.className,g=t.exact,b=t.isActive,x=t.location,S=t.sensitive,C=t.strict,E=t.style,w=t.to,k=t.innerRef,T=Object(c.a)(t,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return o.a.createElement(r.e.Consumer,null,(function(t){t||Object(u.a)(!1);var n=x||t.location,a=d(h(w,n),n),c=a.pathname,O=c&&c.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),A=O?Object(r.f)(n.pathname,{path:O,exact:g,sensitive:S,strict:C}):null,L=!!(b?b(A,n):A),D=L?function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((function(t){return t})).join(" ")}(p,s):p,R=L?Object(l.a)({},E,{},f):E,I=Object(l.a)({"aria-current":L&&i||null,className:D,style:R,to:a},T);return v!==y?I.ref=e||k:I.innerRef=k,o.a.createElement(m,I)}))}))},"5nXd":
/*!************************************************!*\
!*** ./node_modules/store/src/store-engine.js ***!
\************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./util */"MFOe"),i=r.slice,a=r.pluck,o=r.each,s=r.bind,l=r.create,c=r.isList,u=r.isFunction,h=r.isObject;t.exports={createStore:f};var d={version:"2.0.12",enabled:!1,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){return void 0===e?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each((function(n,r){t.call(e,e._deserialize(n),(r||"").replace(e._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return f(this.storage,this.plugins,t)}};function f(t,e,n){n||(n=""),t&&!c(t)&&(t=[t]),e&&!c(e)&&(e=[e]);var r=n?"__storejs_"+n+"_":"",f=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var p=l({_namespacePrefix:r,_namespaceRegexp:f,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;return t.remove(e),n}catch(t){return!1}},_assignPluginFnProp:function(t,e){var n=this[e];this[e]=function(){var e=i(arguments,0),r=this;function a(){if(n)return o(arguments,(function(t,n){e[n]=t})),n.apply(r,e)}var s=[a].concat(e);return t.apply(r,s)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,e){if(!t)return e;var n="";try{n=JSON.parse(t)}catch(e){n=t}return void 0!==n?n:e},_addStorage:function(t){this.enabled||this._testStorage(t)&&(this.storage=t,this.enabled=!0)},_addPlugin:function(t){var e=this;if(c(t))o(t,(function(t){e._addPlugin(t)}));else if(!a(this.plugins,(function(e){return t===e}))){if(this.plugins.push(t),!u(t))throw new Error("Plugins must be function values that return objects");var n=t.call(this);if(!h(n))throw new Error("Plugins must return an object of function properties");o(n,(function(n,r){if(!u(n))throw new Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.");e._assignPluginFnProp(n,r)}))}},addStorage:function(t){!function(){var t="undefined"==typeof console?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(t)}},d,{plugins:[]});return p.raw={},o(p,(function(t,e){u(t)&&(p.raw[e]=s(p,t))})),o(t,(function(t){p._addStorage(t)})),o(e,(function(t){p._addPlugin(t)})),p}},"6+eU":
/*!************************************************************!*\
!*** ./node_modules/rc-pagination/es/index.js + 4 modules ***!
\************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-pagination/es/locale/zh_CN.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n("wx14"),i=n("rePB"),a=n("VTBJ"),o=n("1OyB"),s=n("vuIU"),l=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),f=n.n(d),p=function(t){var e,n="".concat(t.rootPrefixCls,"-item"),r=f()(n,"".concat(n,"-").concat(t.page),(e={},Object(i.a)(e,"".concat(n,"-active"),t.active),Object(i.a)(e,t.className,!!t.className),Object(i.a)(e,"".concat(n,"-disabled"),!t.page),e));return h.a.createElement("li",{title:t.showTitle?t.page:null,className:r,onClick:function(){t.onClick(t.page)},onKeyPress:function(e){t.onKeyPress(e,t.onClick,t.page)},tabIndex:"0"},t.itemRender(t.page,"page",h.a.createElement("a",{rel:"nofollow"},t.page)))},g=13,m=38,v=40,y=function(t){Object(l.a)(n,t);var e=Object(c.a)(n);function n(){var t;Object(o.a)(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).state={goInputText:""},t.buildOptionText=function(e){return"".concat(e," ").concat(t.props.locale.items_per_page)},t.changeSize=function(e){t.props.changeSize(Number(e))},t.handleChange=function(e){t.setState({goInputText:e.target.value})},t.handleBlur=function(e){var n=t.props,r=n.goButton,i=n.quickGo,a=n.rootPrefixCls,o=t.state.goInputText;r||""===o||e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(a,"-prev"))>=0||e.relatedTarget.className.indexOf("".concat(a,"-next"))>=0)||(t.setState({goInputText:""}),i(t.getValidValue()))},t.go=function(e){""!==t.state.goInputText&&(e.keyCode!==g&&"click"!==e.type||(t.setState({goInputText:""}),t.props.quickGo(t.getValidValue())))},t}return Object(s.a)(n,[{key:"getValidValue",value:function(){var t=this.state,e=t.goInputText,n=t.current;return!e||isNaN(e)?n:Number(e)}},{key:"getPageSizeOptions",value:function(){var t=this.props,e=t.pageSize,n=t.pageSizeOptions;return n.some((function(t){return t.toString()===e.toString()}))?n:n.concat([e.toString()]).sort((function(t,e){return(isNaN(Number(t))?0:Number(t))-(isNaN(Number(e))?0:Number(e))}))}},{key:"render",value:function(){var t=this,e=this.props,n=e.pageSize,r=e.locale,i=e.rootPrefixCls,a=e.changeSize,o=e.quickGo,s=e.goButton,l=e.selectComponentClass,c=e.buildOptionText,u=e.selectPrefixCls,d=e.disabled,f=this.state.goInputText,p="".concat(i,"-options"),g=l,m=null,v=null,y=null;if(!a&&!o)return null;var b=this.getPageSizeOptions();if(a&&g){var x=b.map((function(e,n){return h.a.createElement(g.Option,{key:n,value:e.toString()},(c||t.buildOptionText)(e))}));m=h.a.createElement(g,{disabled:d,prefixCls:u,showSearch:!1,className:"".concat(p,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||b[0]).toString(),onChange:this.changeSize,getPopupContainer:function(t){return t.parentNode}},x)}return o&&(s&&(y="boolean"==typeof s?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:d,className:"".concat(p,"-quick-jumper-button")},r.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},s)),v=h.a.createElement("div",{className:"".concat(p,"-quick-jumper")},r.jump_to,h.a.createElement("input",{disabled:d,type:"text",value:f,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),r.page,y)),h.a.createElement("li",{className:"".concat(p)},m,v)}}]),n}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,x=n("N2Kk");function S(){}function C(t,e,n){var r=void 0===t?e.pageSize:t;return Math.floor((n.total-1)/r)+1}var E=function(t){Object(l.a)(n,t);var e=Object(c.a)(n);function n(t){var r;Object(o.a)(this,n),(r=e.call(this,t)).getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(C(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(t,e){var n=r.props.prefixCls,i=t||h.a.createElement("button",{type:"button","aria-label":e,className:"".concat(n,"-item-link")});return"function"==typeof t&&(i=h.a.createElement(t,Object(a.a)({},r.props))),i},r.savePaginationNode=function(t){r.paginationNode=t},r.isValid=function(t){return"number"==typeof(e=t)&&isFinite(e)&&Math.floor(e)===e&&t!==r.state.current;var e},r.shouldDisplayQuickJumper=function(){var t=r.props,e=t.showQuickJumper,n=t.pageSize;return!(t.total<=n)&&e},r.handleKeyDown=function(t){t.keyCode!==m&&t.keyCode!==v||t.preventDefault()},r.handleKeyUp=function(t){var e=r.getValidValue(t);e!==r.state.currentInputValue&&r.setState({currentInputValue:e}),t.keyCode===g?r.handleChange(e):t.keyCode===m?r.handleChange(e-1):t.keyCode===v&&r.handleChange(e+1)},r.changePageSize=function(t){var e=r.state.current,n=C(t,r.state,r.props);e=e>n?n:e,0===n&&(e=r.state.current),"number"==typeof t&&("pageSize"in r.props||r.setState({pageSize:t}),"current"in r.props||r.setState({current:e,currentInputValue:e})),r.props.onShowSizeChange(e,t),"onChange"in r.props&&r.props.onChange&&r.props.onChange(e,t)},r.handleChange=function(t){var e=r.props.disabled,n=t;if(r.isValid(n)&&!e){var i=C(void 0,r.state,r.props);n>i?n=i:n<1&&(n=1),"current"in r.props||r.setState({current:n,currentInputValue:n});var a=r.state.pageSize;return r.props.onChange(n,a),n}return r.state.current},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current<C(void 0,r.state,r.props)},r.runIfEnter=function(t,e){if("Enter"===t.key||13===t.charCode){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];e.apply(void 0,r)}},r.runIfEnterPrev=function(t){r.runIfEnter(t,r.prev)},r.runIfEnterNext=function(t){r.runIfEnter(t,r.next)},r.runIfEnterJumpPrev=function(t){r.runIfEnter(t,r.jumpPrev)},r.runIfEnterJumpNext=function(t){r.runIfEnter(t,r.jumpNext)},r.handleGoTO=function(t){t.keyCode!==g&&"click"!==t.type||r.handleChange(r.state.currentInputValue)};var i=t.onChange!==S;"current"in t&&!i&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var s=t.defaultCurrent;"current"in t&&(s=t.current);var l=t.defaultPageSize;return"pageSize"in t&&(l=t.pageSize),s=Math.min(s,C(l,void 0,t)),r.state={current:s,currentInputValue:s,pageSize:l},r}return Object(s.a)(n,[{key:"componentDidUpdate",value:function(t,e){var n=this.props.prefixCls;if(e.current!==this.state.current&&this.paginationNode){var r=this.paginationNode.querySelector(".".concat(n,"-item-").concat(e.current));r&&document.activeElement===r&&r.blur()}}},{key:"getValidValue",value:function(t){var e=t.target.value,n=C(void 0,this.state,this.props),r=this.state.currentInputValue;return""===e?e:isNaN(Number(e))?r:e>=n?n:Number(e)}},{key:"getShowSizeChanger",value:function(){var t=this.props,e=t.showSizeChanger,n=t.total,r=t.totalBoundaryShowSizeChanger;return void 0!==e?e:n>r}},{key:"renderPrev",value:function(t){var e=this.props,n=e.prevIcon,r=(0,e.itemRender)(t,"prev",this.getItemIcon(n,"prev page")),i=!this.hasPrev();return Object(u.isValidElement)(r)?Object(u.cloneElement)(r,{disabled:i}):r}},{key:"renderNext",value:function(t){var e=this.props,n=e.nextIcon,r=(0,e.itemRender)(t,"next",this.getItemIcon(n,"next page")),i=!this.hasNext();return Object(u.isValidElement)(r)?Object(u.cloneElement)(r,{disabled:i}):r}},{key:"render",value:function(){var t=this,e=this.props,n=e.prefixCls,a=e.className,o=e.style,s=e.disabled,l=e.hideOnSinglePage,c=e.total,d=e.locale,g=e.showQuickJumper,m=e.showLessItems,v=e.showTitle,y=e.showTotal,x=e.simple,S=e.itemRender,E=e.showPrevNextJumpers,w=e.jumpPrevIcon,k=e.jumpNextIcon,T=e.selectComponentClass,O=e.selectPrefixCls,A=e.pageSizeOptions,L=this.state,D=L.current,R=L.pageSize,I=L.currentInputValue;if(!0===l&&c<=R)return null;var _=C(void 0,this.state,this.props),M=[],N=null,P=null,F=null,j=null,B=null,U=g&&g.goButton,H=m?1:2,G=D-1>0?D-1:0,z=D+1<_?D+1:_,W=Object.keys(this.props).reduce((function(e,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)&&"role"!==n||(e[n]=t.props[n]),e}),{});if(x)return U&&(B="boolean"==typeof U?h.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},d.jump_to_confirm):h.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},U),B=h.a.createElement("li",{title:v?"".concat(d.jump_to).concat(D,"/").concat(_):null,className:"".concat(n,"-simple-pager")},B)),h.a.createElement("ul",Object(r.a)({className:f()(n,"".concat(n,"-simple"),Object(i.a)({},"".concat(n,"-disabled"),s),a),style:o,ref:this.savePaginationNode},W),h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:f()("".concat(n,"-prev"),Object(i.a)({},"".concat(n,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(G)),h.a.createElement("li",{title:v?"".concat(D,"/").concat(_):null,className:"".concat(n,"-simple-pager")},h.a.createElement("input",{type:"text",value:I,disabled:s,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),h.a.createElement("span",{className:"".concat(n,"-slash")},"/"),_),h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:f()("".concat(n,"-next"),Object(i.a)({},"".concat(n,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(z)),B);if(_<=3+2*H){var V={locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:v,itemRender:S};_||M.push(h.a.createElement(p,Object(r.a)({},V,{key:"noPager",page:_,className:"".concat(n,"-disabled")})));for(var K=1;K<=_;K+=1){var q=D===K;M.push(h.a.createElement(p,Object(r.a)({},V,{key:K,page:K,active:q})))}}else{var Y=m?d.prev_3:d.prev_5,X=m?d.next_3:d.next_5;E&&(N=h.a.createElement("li",{title:v?Y:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:f()("".concat(n,"-jump-prev"),Object(i.a)({},"".concat(n,"-jump-prev-custom-icon"),!!w))},S(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(w,"prev page"))),P=h.a.createElement("li",{title:v?X:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:f()("".concat(n,"-jump-next"),Object(i.a)({},"".concat(n,"-jump-next-custom-icon"),!!k))},S(this.getJumpNextPage(),"jump-next",this.getItemIcon(k,"next page")))),j=h.a.createElement(p,{locale:d,last:!0,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:_,page:_,active:!1,showTitle:v,itemRender:S}),F=h.a.createElement(p,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:v,itemRender:S});var $=Math.max(1,D-H),J=Math.min(D+H,_);D-1<=H&&(J=1+2*H),_-D<=H&&($=_-2*H);for(var Z=$;Z<=J;Z+=1){var Q=D===Z;M.push(h.a.createElement(p,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Z,page:Z,active:Q,showTitle:v,itemRender:S}))}D-1>=2*H&&3!==D&&(M[0]=Object(u.cloneElement)(M[0],{className:"".concat(n,"-item-after-jump-prev")}),M.unshift(N)),_-D>=2*H&&D!==_-2&&(M[M.length-1]=Object(u.cloneElement)(M[M.length-1],{className:"".concat(n,"-item-before-jump-next")}),M.push(P)),1!==$&&M.unshift(F),J!==_&&M.push(j)}var tt=null;y&&(tt=h.a.createElement("li",{className:"".concat(n,"-total-text")},y(c,[0===c?0:(D-1)*R+1,D*R>c?c:D*R])));var et=!this.hasPrev()||!_,nt=!this.hasNext()||!_;return h.a.createElement("ul",Object(r.a)({className:f()(n,a,Object(i.a)({},"".concat(n,"-disabled"),s)),style:o,unselectable:"unselectable",ref:this.savePaginationNode},W),tt,h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:et?null:0,onKeyPress:this.runIfEnterPrev,className:f()("".concat(n,"-prev"),Object(i.a)({},"".concat(n,"-disabled"),et)),"aria-disabled":et},this.renderPrev(G)),M,h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:nt?null:0,onKeyPress:this.runIfEnterNext,className:f()("".concat(n,"-next"),Object(i.a)({},"".concat(n,"-disabled"),nt)),"aria-disabled":nt},this.renderNext(z)),h.a.createElement(b,{disabled:s,locale:d,rootPrefixCls:n,selectComponentClass:T,selectPrefixCls:O,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:D,pageSize:R,pageSizeOptions:A,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:U}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n={};if("current"in t&&(n.current=t.current,t.current!==e.current&&(n.currentInputValue=n.current)),"pageSize"in t&&t.pageSize!==e.pageSize){var r=e.current,i=C(t.pageSize,e,t);r=r>i?i:r,"current"in t||(n.current=r,n.currentInputValue=r),n.pageSize=t.pageSize}return n}}]),n}(h.a.Component);E.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:S,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:S,locale:x.a,style:{},itemRender:function(t,e,n){return n},totalBoundaryShowSizeChanger:50};var w=E},"6RRn":
/*!*******************************************!*\
!*** ./node_modules/rc-table/es/index.js ***!
\*******************************************/
/*! exports provided: Summary, Column, ColumnGroup, INTERNAL_COL_DEFINE, default */
/*! exports used: INTERNAL_COL_DEFINE, Summary, default */function(t,e,n){"use strict";var r=n(/*! ./Table */"wCXF"),i=n(/*! ./Footer */"n6Qo");n.d(e,"b",(function(){return i.a}));n(/*! ./sugar/Column */"IBYe"),n(/*! ./sugar/ColumnGroup */"6eGT");var a=n(/*! ./utils/legacyUtil */"hW8S");n.d(e,"a",(function(){return a.a})),e.c=r.b},"6eGT":
/*!*******************************************************!*\
!*** ./node_modules/rc-table/es/sugar/ColumnGroup.js ***!
\*******************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";e.a=function(t){return null}},"7Cbv":
/*!**************************************************************!*\
!*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),i=new Uint8Array(16);function a(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}var o=/^(?:[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;for(var s=function(t){return"string"==typeof t&&o.test(t)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};e.a=function(t,e,n){var r=(t=t||{}).random||(t.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return u(r)}},"7ahc":
/*!*************************************************************!*\
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
\*************************************************************/
/*! exports provided: default, MyCodeMirror */
/*! exports used: MyCodeMirror, default */function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),a=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),o=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! codemirror */"VrN/"),d=n.n(h),f=(n(/*! codemirror/lib/codemirror.css */"p77/"),n(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),p={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};function m(t){var e=t.value,n=t.onChange,i=t.mode,a=t.options,o=void 0===a?{}:a,l=Object(c.useRef)(),h=Object(c.useState)(),f=Object(s.a)(h,2),p=f[0],g=f[1];return Object(c.useEffect)((function(){if(p){function t(t){var e=t.getValue();n&&n(e)}return p.on("change",t),function(){p.off("change",t)}}}),[p,n]),Object(c.useEffect)((function(){p&&p.setOption("mode",i)}),[p,i]),Object(c.useEffect)((function(){p&&(e===p.getValue()&&""!==e||setTimeout((function(){p.setValue(e||" ")}),300))}),[p,e]),Object(c.useEffect)((function(){if(l.current&&!p){var t=d.a.fromTextArea(l.current,Object(r.a)({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},o));g(t)}}),[l.current,p]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}e.b=function(t){var e=t.callback,n=t.onCancel,r=Object(c.useState)("python"),h=Object(s.a)(r,2),d=h[0],v=h[1];return u.a.createElement(o.a,Object(i.a)({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(t){e(t)}}),u.a.createElement(o.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(t){v(g[t][1])}},Object.keys(g).map((function(t){return u.a.createElement(f,{key:t,value:t},g[t][0])})))),u.a.createElement(o.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(m,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(a.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(a.a,{type:"ghost",onClick:n},"取消")))}},"7ixt":
/*!**************************************************!*\
!*** ./node_modules/rc-tooltip/es/placements.js ***!
\**************************************************/
/*! exports provided: placements, default */
/*! exports used: placements */function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r={adjustX:1,adjustY:1},i=[0,0],a={left:{points:["cr","cl"],overflow:r,offset:[-4,0],targetOffset:i},right:{points:["cl","cr"],overflow:r,offset:[4,0],targetOffset:i},top:{points:["bc","tc"],overflow:r,offset:[0,-4],targetOffset:i},bottom:{points:["tc","bc"],overflow:r,offset:[0,4],targetOffset:i},topLeft:{points:["bl","tl"],overflow:r,offset:[0,-4],targetOffset:i},leftTop:{points:["tr","tl"],overflow:r,offset:[-4,0],targetOffset:i},topRight:{points:["br","tr"],overflow:r,offset:[0,-4],targetOffset:i},rightTop:{points:["tl","tr"],overflow:r,offset:[4,0],targetOffset:i},bottomRight:{points:["tr","br"],overflow:r,offset:[0,4],targetOffset:i},rightBottom:{points:["bl","br"],overflow:r,offset:[4,0],targetOffset:i},bottomLeft:{points:["tl","bl"],overflow:r,offset:[0,4],targetOffset:i},leftBottom:{points:["br","bl"],overflow:r,offset:[-4,0],targetOffset:i}}},"815F":
/*!***************************************************!*\
!*** ./node_modules/rc-tree/es/utils/treeUtil.js ***!
\***************************************************/
/*! exports provided: getKey, warningWithoutKey, convertTreeToData, flattenTreeData, traverseDataNodes, convertDataToEntities, getTreeNodeProps, convertNodePropsToEventData */
/*! exports used: convertDataToEntities, convertNodePropsToEventData, convertTreeToData, flattenTreeData, getKey, getTreeNodeProps */function(t,e,n){"use strict";n.d(e,"e",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return h})),n.d(e,"a",(function(){return f})),n.d(e,"f",(function(){return p})),n.d(e,"b",(function(){return g}));var r=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),a=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),o=n(/*! rc-util/es/Children/toArray */"Zm9Q"),s=n(/*! rc-util/es/warning */"Kwbf"),l=n(/*! ../util */"OZM5");function c(t,e){return null!=t?t:e}function u(t){return function t(e){return Object(o.a)(e).map((function(e){if(!Object(l.i)(e))return Object(s.a)(!e,"Tree/TreeNode can only accept TreeNode as children."),null;var n=e.key,r=e.props,o=r.children,c=Object(a.a)(r,["children"]),u=Object(i.a)({key:n},c),h=t(o);return h.length&&(u.children=h),u})).filter((function(t){return t}))}(t)}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(!0===e?[]:e),a=[];function o(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.map((function(u,h){var d=Object(l.h)(s?s.pos:"0",h),f=c(u.key,d),p=Object(i.a)(Object(i.a)({},u),{},{parent:s,pos:d,children:null,data:u,isStart:[].concat(Object(r.a)(s?s.isStart:[]),[0===h]),isEnd:[].concat(Object(r.a)(s?s.isEnd:[]),[h===t.length-1])});return a.push(p),!0===e||n.has(f)?p.children=o(u.children||[],p):p.children=[],p}))}return o(t),a}function d(t,e,n){var r;n?"string"==typeof n?r=function(t){return t[n]}:"function"==typeof n&&(r=function(t){return n(t)}):r=function(t,e){return c(t.key,e)},function n(i,a,o){var s=i?i.children:t,c=i?Object(l.h)(o.pos,a):"0";if(i){var u=r(i,c),h={node:i,index:a,pos:c,key:u,parentPos:o.node?o.pos:null,level:o.level+1};e(h)}s&&s.forEach((function(t,e){n(t,e,{node:i,pos:c,level:o?o.level+1:-1})}))}(null)}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.initWrapper,r=e.processEntity,i=e.onProcessFinished,a=arguments.length>2?arguments[2]:void 0,o={},s={},l={posEntities:o,keyEntities:s};return n&&(l=n(l)||l),d(t,(function(t){var e=t.node,n=t.index,i=t.pos,a=t.key,u=t.parentPos,h={node:e,index:n,key:a,pos:i,level:t.level},d=c(a,i);o[i]=h,s[d]=h,h.parent=o[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),r&&r(h,l)}),a),i&&i(l),l}function p(t,e){var n=e.expandedKeys,r=e.selectedKeys,i=e.loadedKeys,a=e.loadingKeys,o=e.checkedKeys,s=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities[t];return{eventKey:t,expanded:-1!==n.indexOf(t),selected:-1!==r.indexOf(t),loaded:-1!==i.indexOf(t),loading:-1!==a.indexOf(t),checked:-1!==o.indexOf(t),halfChecked:-1!==s.indexOf(t),pos:String(u?u.pos:""),dragOver:l===t&&0===c,dragOverGapTop:l===t&&-1===c,dragOverGapBottom:l===t&&1===c}}function g(t){var e=t.data,n=t.expanded,r=t.selected,a=t.checked,o=t.loaded,l=t.loading,c=t.halfChecked,u=t.dragOver,h=t.dragOverGapTop,d=t.dragOverGapBottom,f=t.pos,p=t.active,g=Object(i.a)(Object(i.a)({},e),{},{expanded:n,selected:r,checked:a,loaded:o,loading:l,halfChecked:c,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:f,active:p});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(s.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),t}}),g}},"8EBN":
/*!**********************************************!*\
!*** ./node_modules/codemirror/mode/meta.js ***!
\**********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";t.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 e=0;e<t.modeInfo.length;e++){var n=t.modeInfo[e];n.mimes&&(n.mime=n.mimes[0])}t.findModeByMIME=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var r=t.modeInfo[n];if(r.mime==e)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==e)return r}return/\+xml$/.test(e)?t.findModeByMIME("application/xml"):/\+json$/.test(e)?t.findModeByMIME("application/json"):void 0},t.findModeByExtension=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var r=t.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==e)return r}},t.findModeByFileName=function(e){for(var n=0;n<t.modeInfo.length;n++){var r=t.modeInfo[n];if(r.file&&r.file.test(e))return r}var i=e.lastIndexOf("."),a=i>-1&&e.substring(i+1,e.length);if(a)return t.findModeByExtension(a)},t.findModeByName=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var r=t.modeInfo[n];if(r.name.toLowerCase()==e)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==e)return r}}}(n(/*! ../lib/codemirror */"VrN/"))},"8hTe":
/*!******************************************************!*\
!*** ./src/components/RenderHtml/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={button:"button___1wy9m"}},"9Bee":
/*!*********************************************************!*\
!*** ./src/components/RenderHtml/index.tsx + 3 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/PreviewAll/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hls.js/dist/hls.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/katex/dist/katex.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/lib/marked.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/src/helpers.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n("DYRE");var r=n("zeV3"),i=(n("+L6B"),n("2/Rp")),a=n("k1fw"),o=n("9og8"),s=n("tJVT"),l=n("WmNS"),c=n.n(l),u=n("q1tI"),h=n.n(u),d=(n("vg9a"),n("DlQD")),f=n.n(d),p=n("rUJ1");var g=[],m=["<ul>"],v=new f.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){g.length=0,m=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(){return function t(e,n,r,i){if(n>=e.length||e[n].level<=r)return n;var a=e[n];i.push("<li><a href='#"+a.anchor+"'>"+a.text+"</a>");var o=[];return n=t(e,++n,a.level,o),o.length>0&&(i.push("<ul>"),o.forEach((function(t){i.push(t)})),i.push("</ul>")),i.push("</li>"),n=t(e,n,r,i)}(g,0,0,m),m.push("</ul>"),m.join("")}var C={heading:function(t){var e=y.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},fences:function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],r=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var r=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:Object(s.a)(e,1)[0].length>=r.length?t.slice(r.length):t})).join("\n")}(n,e[3]||""),i=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(i)>=0){var a=k(),o=r;r=a,T[a]={type:"block",expression:o}}return{type:"code",raw:n,lang:i,text:r}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,k=function(){return"__special_katext_id_".concat(w++,"__")},T={};function O(){w=0,T={}}function A(t){return t=t.replace(E,(function(t,e){var n=k();return T[n]={type:"inline",expression:e},n}))}var L=v.listitem;v.listitem=function(t){return L(A(t))};var D=v.paragraph;v.paragraph=function(t){return D(A(t))};var R=v.tablecell;v.tablecell=function(t,e){return R(A(t),e)},v.code=function(t,e,n){var r=(e||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(t,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(e,'">').concat(n?t:Object(p.escape)(t,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?t:Object(p.escape)(t,!0))+"</code></pre>"},v.heading=function(t,e,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return g.push({anchor:r,level:e,text:t}),"<h"+e+' id="'+r+'">'+t+"</h"+e+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:C,renderer:v});var I=f.a,_=(n("SJMd"),n("ulZh")),M=n.n(_),N=n("m3rI"),P=n("Oy/b"),F=n("p5ED"),j=n("ErOA"),B=function(t,e){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function U(t,e){function n(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function H(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((r=r.apply(t,e||[])).next())}))}function G(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function z(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}var W=function(){function t(){}return t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.setAttributes=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n],a=i[0],o=i[1];t.setAttribute(a,o)}},t.createRect=function(e,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","rect");return i.setAttribute("width",e.toString()),i.setAttribute("height",n.toString()),r&&t.setAttributes(i,r),i},t.createLine=function(e,n,r,i,a){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",e.toString()),o.setAttribute("y1",n.toString()),o.setAttribute("x2",r.toString()),o.setAttribute("y2",i.toString()),a&&t.setAttributes(o,a),o},t.createPolygon=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points",e),n&&t.setAttributes(r,n),r},t.createCircle=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("cx",(e/2).toString()),r.setAttribute("cy",(e/2).toString()),r.setAttribute("r",e.toString()),n&&t.setAttributes(r,n),r},t.createEllipse=function(e,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return i.setAttribute("cx",(e/2).toString()),i.setAttribute("cy",(n/2).toString()),i.setAttribute("rx",(e/2).toString()),i.setAttribute("ry",(n/2).toString()),r&&t.setAttributes(i,r),i},t.createGroup=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(n,e),n},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createMarker=function(e,n,r,i,a,o,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(l,[["id",e],["orient",n],["markerWidth",r.toString()],["markerHeight",i.toString()],["refX",a.toString()],["refY",o.toString()]]),l.appendChild(s),l},t.createText=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),e&&t.setAttributes(n,e),n},t.createTSpan=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");return r.textContent=e,n&&t.setAttributes(r,n),r},t.createImage=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return e&&t.setAttributes(n,e),n},t.createPoint=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=t,n.y=e,n},t.createPath=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),n&&t.setAttributes(r,n),r},t}(),V=function(){function t(){}return t.addKey=function(e){t.key=e},Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(t.key)},enumerable:!1,configurable:!0}),t}(),K=function(){function t(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return t.prototype.rasterize=function(t,e,n){var r=this;return new Promise((function(i){var a=void 0!==n?n:document.createElement("canvas");null===t&&(r.markersOnly=!0,r.naturalSize=!1);var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",e.width.baseVal.valueAsString),o.setAttribute("height",e.height.baseVal.valueAsString),o.setAttribute("viewBox","0 0 "+e.viewBox.baseVal.width.toString()+" "+e.viewBox.baseVal.height.toString()),o.innerHTML=e.innerHTML,!0===r.naturalSize?(o.width.baseVal.value=t.naturalWidth,o.height.baseVal.value=t.naturalHeight):void 0!==r.width&&void 0!==r.height&&(o.width.baseVal.value=r.width,o.height.baseVal.value=r.height),a.width=o.width.baseVal.value,a.height=o.height.baseVal.value;var s=o.outerHTML,l=a.getContext("2d");!0!==r.markersOnly&&l.drawImage(t,0,0,a.width,a.height);var c=window.URL,u=new Image(a.width,a.height);u.setAttribute("crossOrigin","anonymous");var h=new Blob([s],{type:"image/svg+xml"}),d=c.createObjectURL(h);u.onload=function(){l.drawImage(u,0,0),c.revokeObjectURL(d);var t=a.toDataURL(r.imageType,r.imageQuality);i(t)},u.src=d}))},t}(),q=function(){},Y=function(){function t(t){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+t+"_"}return Object.defineProperty(t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),t.prototype.addClass=function(t){return void 0===this.styleSheet&&this.addStyleSheet(),t.name=""+this.classNamePrefix+t.localName,this.classes.push(t),this.styleSheet.sheet.insertRule("."+t.name+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length),t},t.prototype.addRule=function(t){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(t),this.styleSheet.sheet.insertRule(t.selector+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length)},t.prototype.addStyleSheet=function(){var t;this.styleSheet=document.createElement("style"),(null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).appendChild(this.styleSheet),this.addRule(new X("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new X("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new X("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new $("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new $("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},t.prototype.removeStyleSheet=function(){var t;this.styleSheet&&((null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},t}(),X=function(t,e){this.selector=t,this.style=e},$=function(t,e){this.localName=t,this.style=e},J=function(){function t(t,e,n,r,i){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=t,this.displayMode=e,this.markerItems=n,this.uiStyleSettings=r,this.styles=i,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return t.prototype.show=function(t){var e=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",this.uiContainer.appendChild(n),this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach((function(t){var n=document.createElement("div");n.className=""+e.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",t.typeName),n.innerHTML=t.icon,n.addEventListener("click",(function(){e.markerToolbarButtonClicked(n,t)})),e.buttons.push(n),e.markerButtons.push(n)})),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var r=document.createElement("div");r.className=this.toolbarBlockStyleClass.name,r.style.whiteSpace="nowrap",r.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(r),this.addActionButton(r,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(r,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},t.prototype.addButtonClickListener=function(t){this.buttonClickListeners.push(t)},t.prototype.removeButtonClickListener=function(t){this.buttonClickListeners.indexOf(t)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(t),1)},t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var t=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var e=0;e<this.markerButtons.length;e++)e<t||e===t&&this.markerButtons.length-1===t?this.markerButtonBlock.appendChild(this.markerButtons[e]):(e===t&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[e]))}},t.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},t.prototype.resetButtonStyles=function(){var t=this;this.buttons.forEach((function(e){e.className=e.className.replace(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name,"").trim(),e.className=e.className.replace(t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:t.toolbarActiveButtonStyleColorsClass.name,"").trim(),e.className+=" "+(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name)}))},t.prototype.addActionButton=function(t,e,n){var r=this,i=document.createElement("div");switch(i.className=""+this.toolbarButtonStyleClass.name,i.innerHTML=e,i.setAttribute("data-action",n),i.addEventListener("click",(function(){r.actionToolbarButtonClicked(i,n)})),n){case"select":i.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":i.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":i.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":i.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":i.style.fill=this.uiStyleSettings.closeButtonColor}t.appendChild(i),this.buttons.push(i)},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new $("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new $("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new $("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new $("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new $("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new X("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new X("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},t.prototype.markerToolbarButtonClicked=function(t,e){this.setActiveButton(t),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("marker",e)})),this.markerButtonOverflowBlock.style.display="none"},t.prototype.actionToolbarButtonClicked=function(t,e){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("action",e)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},t.prototype.setActiveButton=function(t){this.resetButtonStyles(),t.className=t.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),t.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},t.prototype.setActiveMarkerButton=function(t){var e=this.markerButtons.find((function(e){return e.getAttribute("data-type-name")===t}));e&&this.setActiveButton(e)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker=t,this.buttons.filter((function(t){return/delete|notes/.test(t.getAttribute("data-action"))})).forEach((function(t){void 0===e.currentMarker?(t.style.fillOpacity="0.4",t.style.pointerEvents="none"):(t.style.fillOpacity="1",t.style.pointerEvents="all")}))},t}(),Z=function(){function t(t,e,n,r){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=n,this.styles=r,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=this.styles.addClass(new $("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new $("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new $("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new $("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new $("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new $("toolbox-panel-row_colors","\n background-color: "+(null!==(t=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==t?t:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new $("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new $("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},t.prototype.show=function(t){var e;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==e?e:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},t.prototype.setPanelButtons=function(t){var e,n,r=this;this.panels=t,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==e?e:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(t){var e;t.uiStyleSettings=r.uiStyleSettings;var n=document.createElement("div");n.className=r.toolboxButtonStyleClass.name+" "+(null!==(e=r.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:r.toolboxButtonStyleColorsClass.name),n.innerHTML=t.icon,n.title=t.title,n.addEventListener("click",(function(){r.panelButtonClick(t)})),r.panelButtons.push(n),r.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,n=-1;if(t!==this.activePanel){n=this.panels.indexOf(t),this.panelRow.innerHTML="";var r=t.getUi();r.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(r),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=t}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===e.displayMode?e.panelRow.style.display="none":e.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(t,r){var i,a;t.className=e.toolboxButtonStyleClass.name+" "+(r===n?""+(null!==(i=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==i?i:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(a=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==a?a:e.toolboxButtonStyleColorsClass.name))}))},t}(),Q=function(t,e){this.title=t,this.icon=e},tt=function(t){function e(e,n,r,i){var a=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return a.colors=[],a.addTransparent=!1,a.colorBoxes=[],a.colors=n,a.currentColor=r,a.setCurrentColor=a.setCurrentColor.bind(a),a.getColorBox=a.getColorBox.bind(a),a}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.whiteSpace="nowrap",this.colors.forEach((function(n){var r=t.getColorBox(n);e.appendChild(r),t.colorBoxes.push(r)})),e},e.prototype.getColorBox=function(t){var e=this,n=this.uiStyleSettings.toolbarHeight/4,r=this.uiStyleSettings.toolbarHeight-n,i=document.createElement("div");i.style.display="inline-block",i.style.boxSizing="content-box",i.style.width=r-2+"px",i.style.height=r-2+"px",i.style.padding="1px",i.style.marginRight="2px",i.style.marginBottom="2px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderRadius=(r+2)/2+"px",i.style.borderColor=t===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentColor(t,i)}));var a=document.createElement("div");return a.style.display="inline-block",a.style.width=r-2+"px",a.style.height=r-2+"px",a.style.backgroundColor=t,a.style.borderRadius=r/2+"px","transparent"===t&&(a.style.fill=this.uiStyleSettings.toolboxAccentColor,a.innerHTML='<svg viewBox="0 0 24 24">\n <path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />\n </svg>'),i.appendChild(a),i},e.prototype.setCurrentColor=function(t,e){var n=this;this.currentColor=t,this.colorBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(t)},e}(Q),et=function(){function t(t,e,n){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!1},Object.defineProperty(t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},t.prototype.pointerDown=function(t,e){},t.prototype.dblClick=function(t,e){},t.prototype.manipulate=function(t){},t.prototype.pointerUp=function(t){this.stateChanged()},t.prototype.dispose=function(){},t.prototype.addMarkerVisualToContainer=function(t){this.container.childNodes.length>0?this.container.insertBefore(t,this.container.childNodes[0]):this.container.appendChild(t)},t.prototype.getState=function(){return{typeName:t.typeName,state:this.state,notes:this.notes}},t.prototype.restoreState=function(t){this._state=t.state,this.notes=t.notes},t.prototype.scale=function(t,e){},t.prototype.colorChanged=function(t){this.onColorChanged&&this.onColorChanged(t),this.stateChanged()},t.prototype.fillColorChanged=function(t){this.onFillColorChanged&&this.onFillColorChanged(t),this.stateChanged()},t.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var t=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),t.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(t)&&this.onStateChanged(this)}},t.typeName="MarkerBase",t}(),nt=function(){function t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return t.prototype.findGripByVisual=function(t){return this.topLeft.ownsTarget(t)?this.topLeft:this.topCenter.ownsTarget(t)?this.topCenter:this.topRight.ownsTarget(t)?this.topRight:this.centerLeft.ownsTarget(t)?this.centerLeft:this.centerRight.ownsTarget(t)?this.centerRight:this.bottomLeft.ownsTarget(t)?this.bottomLeft:this.bottomCenter.ownsTarget(t)?this.bottomCenter:this.bottomRight.ownsTarget(t)?this.bottomRight:void 0},t}(),rt=function(){function t(){this.GRIP_SIZE=10,this.visual=W.createGroup(),this.visual.appendChild(W.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(W.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t}(),it=function(){function t(){}return t.toITransformMatrix=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:t.e,f:t.f}},t.toSVGMatrix=function(t,e){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},t}(),at=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.left=0,i.top=0,i.width=0,i.height=0,i.defaultSize={x:50,y:20},i.offsetX=0,i.offsetY=0,i.rotationAngle=0,i.CB_DISTANCE=10,i._suppressMarkerCreateEvent=!1,i.container.transform.baseVal.appendItem(W.createTransform()),i.setupControlBox(),i}return U(e,t),Object.defineProperty(e.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visual",{get:function(){return this._visual},set:function(t){this._visual=t;var e=W.createTransform();this._visual.transform.baseVal.appendItem(e)},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!!(void 0!==this.controlGrips.findGripByVisual(e)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.left=e.x,this.top=e.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var r=this.unrotatePoint(e);if(this.manipulationStartX=r.x,this.manipulationStartY=r.y,this.offsetX=r.x-this.left,this.offsetY=r.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var i=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=i.x-this.width/2,this.top=i.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(e),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},e.prototype.moveVisual=function(t){this.visual.style.transform="translate("+t.x+"px, "+t.y+"px)"},e.prototype.manipulate=function(t){var e=this.unrotatePoint(t);"creating"===this.state?this.resize(t):"move"===this.state?(this.left=this.manipulationStartLeft+(e.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(e.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(e):"rotate"===this.state&&this.rotate(t)},e.prototype.resize=function(t){var e=this.manipulationStartLeft,n=this.manipulationStartWidth,r=this.manipulationStartTop,i=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:r=this.manipulationStartTop+t.y-this.manipulationStartY,i=this.manipulationStartHeight+this.manipulationStartTop-r;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:i=this.manipulationStartHeight+t.y-this.manipulationStartY}n>=0?(this.left=e,this.width=n):(this.left=e+n,this.width=-n),i>=0?(this.top=r,this.height=i):(this.top=r+i,this.height=-i),this.setSize()},e.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},e.prototype.rotate=function(t){if(Math.abs(t.x-this.centerX)>.1){var e=Math.sign(t.x-this.centerX);this.rotationAngle=180*Math.atan((t.y-this.centerY)/(t.x-this.centerX))/Math.PI+90*e,this.applyRotation()}},e.prototype.applyRotation=function(){var t=this.container.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(t,0)},e.prototype.rotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM(),n=W.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var n=W.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=W.createGroup();var t=W.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=W.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=W.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 nt,this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){var t=this.controlBox.transform.baseVal.getItem(0);t.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(t,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},e.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},e.prototype.createGrip=function(){var t=new rt;return t.visual.transform.baseVal.appendItem(W.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,n=e,r=(this.width+this.CB_DISTANCE)/2-t/2,i=(this.height+this.CB_DISTANCE)/2-t/2,a=this.height+this.CB_DISTANCE-t/2,o=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,n),this.positionGrip(this.controlGrips.topCenter.visual,r,n),this.positionGrip(this.controlGrips.topRight.visual,o,n),this.positionGrip(this.controlGrips.centerLeft.visual,e,i),this.positionGrip(this.controlGrips.centerRight.visual,o,i),this.positionGrip(this.controlGrips.bottomLeft.visual,e,a),this.positionGrip(this.controlGrips.bottomCenter.visual,r,a),this.positionGrip(this.controlGrips.bottomRight.visual,o,a),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,r,n-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,n){var r=t.transform.baseVal.getItem(0);r.setTranslate(e,n),t.transform.baseVal.replaceItem(r,0)},e.prototype.hideControlBox=function(){this.controlBox.style.display="none"},e.prototype.showControlBox=function(){this.controlBox.style.display=""},e.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:it.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:it.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n);var r=this.rotatePoint({x:this.left,y:this.top}),i=this.unrotatePoint({x:r.x*e,y:r.y*n});this.left=i.x,this.top=i.y,this.width=this.width*e,this.height=this.height*n,this.adjustControlBox()},e}(et),ot=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.fillColor="transparent",i.strokeColor="transparent",i.strokeWidth=0,i.strokeDasharray="",i.opacity=1,i.setStrokeColor=i.setStrokeColor.bind(i),i.setFillColor=i.setFillColor.bind(i),i.setStrokeWidth=i.setStrokeWidth.bind(i),i.setStrokeDasharray=i.setStrokeDasharray.bind(i),i.createVisual=i.createVisual.bind(i),i}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=W.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&W.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&W.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&W.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&W.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.title="Rectangle marker",e}(at),st=function(t){function e(e,n,r,i){var a=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return a.widths=[],a.widthBoxes=[],a.widths=n,a.currentWidth=r,a.setCurrentWidth=a.setCurrentWidth.bind(a),a}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.widths.forEach((function(n){var r=document.createElement("div");r.style.display="flex",r.style.flexGrow="2",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=n===t.currentWidth?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentWidth(n,r)})),e.appendChild(r);var i=document.createElement("div");i.innerText=n.toString(),i.style.marginRight="5px",r.appendChild(i);var a=document.createElement("div");a.style.minHeight="20px",a.style.flexGrow="2",a.style.display="flex",a.style.alignItems="center";var o=document.createElement("hr");o.style.minWidth="20px",o.style.border="0px",o.style.borderTop=n+"px solid "+t.uiStyleSettings.toolboxColor,o.style.flexGrow="2",a.appendChild(o),r.appendChild(a),t.widthBoxes.push(r)})),e},e.prototype.setCurrentWidth=function(t,e){var n=this;this.currentWidth=t,this.widthBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(Q),lt=function(t){function e(e,n,r,i){var a=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return a.styles=[],a.styleBoxes=[],a.styles=n,a.currentStyle=r,a.setCurrentStyle=a.setCurrentStyle.bind(a),a}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.styles.forEach((function(n){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.overflow="hidden",r.style.maxWidth=100/t.styles.length-5+"%",r.style.borderColor=n===t.currentStyle?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentStyle(n,r)})),e.appendChild(r);var i=document.createElement("div");i.style.minHeight="20px",i.style.flexGrow="2",i.style.overflow="hidden";var a='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+t.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";i.innerHTML=a,r.appendChild(i),t.styleBoxes.push(r)})),e},e.prototype.setCurrentStyle=function(t,e){var n=this;this.currentStyle=t,this.styleBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(Q),ct=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.strokeColor=r.defaultColor,i.strokeWidth=r.defaultStrokeWidth,i.strokeDasharray=r.defaultStrokeDasharray,i.strokePanel=new tt("Line color",r.defaultColorSet,r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.strokeWidthPanel=new st("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="FrameMarker",e.title="Frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',e}(ot),ut=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},ht=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.x1=0,i.y1=0,i.x2=0,i.y2=0,i.defaultLength=50,i.manipulationStartX=0,i.manipulationStartY=0,i.manipulationStartX1=0,i.manipulationStartY1=0,i.manipulationStartX2=0,i.manipulationStartY2=0,i.setupControlBox(),i}return U(e,t),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(!this.grip1.ownsTarget(e)&&!this.grip2.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartX=e.x,this.manipulationStartY=e.y,"new"===this.state&&(this.x1=e.x,this.y1=e.y,this.x2=e.x,this.y2=e.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&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(e),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.adjustVisual=function(){},e.prototype.manipulate=function(t){"creating"===this.state?this.resize(t):"move"===this.state?(this.x1=this.manipulationStartX1+t.x-this.manipulationStartX,this.y1=this.manipulationStartY1+t.y-this.manipulationStartY,this.x2=this.manipulationStartX2+t.x-this.manipulationStartX,this.y2=this.manipulationStartY2+t.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(t)},e.prototype.resize=function(t){switch(this.activeGrip){case this.grip1:this.x1=t.x,this.y1=t.y;break;case this.grip2:case void 0:this.x2=t.x,this.y2=t.y}this.adjustVisual(),this.adjustControlBox()},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=W.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){this.positionGrips()},e.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new rt;return t.visual.transform.baseVal.appendItem(W.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-t/2,this.y1-t/2),this.positionGrip(this.grip2.visual,this.x2-t/2,this.y2-t/2)},e.prototype.positionGrip=function(t,e,n){var r=t.transform.baseVal.getItem(0);r.setTranslate(e,n),t.transform.baseVal.replaceItem(r,0)},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.x1=this.x1*e,this.y1=this.y1*n,this.x2=this.x2*e,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},e}(et),dt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.strokeColor="transparent",i.strokeWidth=0,i.strokeDasharray="",i.setStrokeColor=i.setStrokeColor.bind(i),i.setStrokeWidth=i.setStrokeWidth.bind(i),i.setStrokeDasharray=i.setStrokeDasharray.bind(i),i.strokeColor=r.defaultColor,i.strokeWidth=r.defaultStrokeWidth,i.strokeDasharray=r.defaultStrokeDasharray,i.strokePanel=new tt("Line color",r.defaultColorSet,r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.strokeWidthPanel=new st("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorLine&&e!==this.visibleLine)},e.prototype.createVisual=function(){this.visual=W.createGroup(),this.selectorLine=W.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=W.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},e.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()),W.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),W.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',e}(ht),ft=function(t){function e(e,n,r,i){var a=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return a.fonts=[],a.fontBoxes=[],a.fonts=n,a.currentFont=r,a.setCurrentFont=a.setCurrentFont.bind(a),a}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.flexGrow="2",this.fonts.forEach((function(n){var r=document.createElement("div");r.style.display="inline-block",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.overflow="hidden",r.style.maxWidth=100/t.fonts.length-5+"%",r.style.borderColor=n===t.currentFont?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentFont(n,r)})),e.appendChild(r);var i=document.createElement("div");i.style.display="flex",i.style.minHeight="20px",i.style.flexGrow="2",i.style.fontFamily=n,i.style.overflow="hidden";var a=document.createElement("div");a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.innerHTML="The quick brown fox jumps over the lazy dog",i.appendChild(a),r.appendChild(i),t.fontBoxes.push(r)})),e},e.prototype.setCurrentFont=function(t,e){var n=this;this.currentFont=t,this.fontBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(Q),pt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.color="transparent",i.padding=5,i.DEFAULT_TEXT="your text here",i.text=i.DEFAULT_TEXT,i.isMoved=!1,i.color=r.defaultColor,i.fontFamily=r.defaultFontFamily,i.defaultSize={x:100,y:30},i.setColor=i.setColor.bind(i),i.setFont=i.setFont.bind(i),i.renderText=i.renderText.bind(i),i.sizeText=i.sizeText.bind(i),i.textEditDivClicked=i.textEditDivClicked.bind(i),i.showTextEditor=i.showTextEditor.bind(i),i.setSize=i.setSize.bind(i),i.positionTextEditor=i.positionTextEditor.bind(i),i.colorPanel=new tt("Color",r.defaultColorSet,r.defaultColor),i.colorPanel.onColorChanged=i.setColor,i.fontFamilyPanel=new ft("Font",r.defaultFontFamilies,r.defaultFontFamily),i.fontFamilyPanel.onFontChanged=i.setFont,i}return U(e,t),e.prototype.ownsTarget=function(e){if(t.prototype.ownsTarget.call(this,e)||e===this.visual||e===this.textElement||e===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(t){t===e&&(n=!0)})),n},e.prototype.createVisual=function(){this.visual=W.createGroup(),this.bgRectangle=W.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=W.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(W.createTransform()),this.textElement.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.renderText=function(){var t=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach((function(e){t.textElement.appendChild(W.createTSpan(""===e.trim()?" ":e.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},e.prototype.getTextScale=function(){var t=this.textElement.getBBox(),e=1;if(t.width>0&&t.height>0){var n=(1*this.width-this.width*this.padding*2/100)/t.width,r=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(n,r)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),n=0,r=0;return e.width>0&&e.height>0&&(n=(this.width-e.width*t)/2,r=this.height/2-e.height*t/2),{x:n,y:r}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),n=this.getTextPosition(e);n.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(e,e))},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.isMoved=!0,this.setSize(),this.sizeText()},e.prototype.setSize=function(){t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),W.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.showTextEditor=function(){var t=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",(function(t){t.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var e=Number.parseFloat(t.textEditor.style.fontSize);t.textEditor.clientWidth>=Number.parseInt(t.textEditor.style.maxWidth)&&e>.9;)e-=.1,t.textEditor.style.fontSize=Math.max(e,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(t){t.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(t){if(t.clipboardData){var e=t.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(e)),t.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){t.textEditDivClicked(t.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},e.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var t=this.getTextScale(),e=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),r={x:n.width*t,y:n.height*t};e.x-=r.x/2,e.y-=r.y/2,this.textEditor.style.top=e.y+"px",this.textEditor.style.left=e.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-e.x+"px",this.textEditor.style.fontSize=Math.max(16*t,12)+"px",this.textElement.style.display="none"}},e.prototype.textEditDivClicked=function(t){this.text=t.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},e.prototype.select=function(){t.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},e.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),t.prototype.deselect.call(this)},e.prototype.dblClick=function(e,n){t.prototype.dblClick.call(this,e,n),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&W.setAttributes(this.textElement,[["fill",t]]),this.color=t,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(t)},e.prototype.setFont=function(t){this.textElement&&W.setAttributes(this.textElement,[["font-family",t]]),this.fontFamily=t,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},e.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},e.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',e}(at),gt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.color="transparent",i.lineWidth=3,i.drawing=!1,i.pixelRatio=1,i.color=r.defaultColor,i.lineWidth=r.defaultStrokeWidth,i.pixelRatio=r.freehandPixelRatio,i.setColor=i.setColor.bind(i),i.addCanvas=i.addCanvas.bind(i),i.finishCreation=i.finishCreation.bind(i),i.setLineWidth=i.setLineWidth.bind(i),i.colorPanel=new tt("Color",r.defaultColorSet,r.defaultColor),i.colorPanel.onColorChanged=i.setColor,i.lineWidthPanel=new st("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.lineWidthPanel.onWidthChanged=i.setLineWidth,i}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.drawingImage)},e.prototype.createVisual=function(){this.visual=W.createGroup(),this.drawingImage=W.createImage(),this.visual.appendChild(this.drawingImage);var t=W.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(e.x,e.y),this.drawing=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.manipulate=function(e){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(e.x,e.y),this.canvasContext.stroke()):t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),W.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):t.prototype.pointerUp.call(this,e)},e.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)},e.prototype.select=function(){"creating"===this.state&&this.finishCreation(),t.prototype.select.call(this)},e.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),t.prototype.deselect.call(this)},e.prototype.finishCreation=function(){for(var t=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),e=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=e[0],r=e[1],i=e[2],a=e[3],o=!1,s=0;s<this.canvasElement.height;s++)for(var l=0;l<this.canvasElement.width;l++)t.data[s*this.canvasElement.width*4+4*l+3]>0&&(o=!0,s<r&&(r=s),l<n&&(n=l),s>a&&(a=s),l>i&&(i=l));if(o){this.left=n/this.pixelRatio,this.top=r/this.pixelRatio,this.width=(i-n)/this.pixelRatio,this.height=(a-r)/this.pixelRatio;var c=document.createElement("canvas");c.width=i-n,c.height=a-r,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,r,i-n,a-r),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},e.prototype.setDrawingImage=function(){W.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),W.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},e.prototype.setColor=function(t){this.color=t,this.colorChanged(t)},e.prototype.setLineWidth=function(t){this.lineWidth=t},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',e}(at),mt=function(t){function e(e,n,r){var i=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return i.typeBoxes=[],i.currentType=n,i.setCurrentType=i.setCurrentType.bind(i),i}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2";for(var n=function(n){var i="both";switch(n){case 0:i="both";break;case 1:i="start";break;case 2:i="end";break;case 3:i="none"}var a=document.createElement("div");if(a.style.display="flex",a.style.flexGrow="2",a.style.alignItems="center",a.style.justifyContent="space-between",a.style.padding="5px",a.style.borderWidth="2px",a.style.borderStyle="solid",a.style.borderColor=i===r.currentType?r.uiStyleSettings.toolboxAccentColor:"transparent",a.addEventListener("click",(function(){t.setCurrentType(i,a)})),e.appendChild(a),"both"===i||"start"===i){var o=document.createElement("div");o.style.display="flex",o.style.alignItems="center",o.style.minHeight="20px",o.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',o.style.marginLeft="5px",a.appendChild(o)}var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",s.appendChild(l),a.appendChild(s),"both"===i||"end"===i){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",a.appendChild(c)}r.typeBoxes.push(a)},r=this,i=0;i<4;i++)n(i);return e},e.prototype.setCurrentType=function(t,e){var n=this;this.currentType=t,this.typeBoxes.forEach((function(t){t.style.borderColor=t===e?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(Q),vt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.arrowType="end",i.arrowBaseHeight=10,i.arrowBaseWidth=10,i.getArrowPoints=i.getArrowPoints.bind(i),i.setArrowType=i.setArrowType.bind(i),i.arrowTypePanel=new mt("Arrow type","end"),i.arrowTypePanel.onArrowTypeChanged=i.setArrowType,i}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.arrow1&&e!==this.arrow2)},e.prototype.getArrowPoints=function(t,e){var n=this.arrowBaseWidth+2*this.strokeWidth,r=this.arrowBaseHeight+2*this.strokeWidth;return t-n/2+","+(e+r/2)+" "+t+","+(e-r/2)+" "+(t+n/2)+","+(e+r/2)},e.prototype.createTips=function(){this.arrow1=W.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=W.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",W.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),W.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var r=this.arrow2.transform.baseVal.getItem(0);r.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(r,0)}},e.prototype.setArrowType=function(t){this.arrowType=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',e}(dt),yt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.fillColor=r.defaultFillColor,i.strokeWidth=0,i.fillPanel=new tt("Color",r.defaultColorSet,r.defaultFillColor),i.fillPanel.onColorChanged=i.setFillColor,i}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="CoverMarker",e.title="Cover marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',e}(ot),bt=function(t){function e(e,n,r,i){var a=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return a.opacities=[],a.opacityBoxes=[],a.opacities=n,a.currentOpacity=r,a.setCurrentOpacity=a.setCurrentOpacity.bind(a),a}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",e.style.justifyContent="space-between",this.opacities.forEach((function(n){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=n===t.currentOpacity?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentOpacity(n,r)})),e.appendChild(r);var i=document.createElement("div");i.innerText=100*n+"%",r.appendChild(i),t.opacityBoxes.push(r)})),e},e.prototype.setCurrentOpacity=function(t,e){var n=this;this.currentOpacity=t,this.opacityBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(Q),xt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.setOpacity=i.setOpacity.bind(i),i.fillColor=r.defaultHighlightColor,i.strokeWidth=0,i.opacity=r.defaultHighlightOpacity,i.fillPanel=new tt("Color",r.defaultColorSet,i.fillColor),i.fillPanel.onColorChanged=i.setFillColor,i.opacityPanel=new bt("Opacity",r.defaultOpacitySteps,i.opacity),i.opacityPanel.onOpacityChanged=i.setOpacity,i}return U(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&W.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="HighlightMarker",e.title="Highlight marker",e.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',e}(yt),St='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ct=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.bgColor="transparent",i.tipPosition={x:0,y:0},i.tipBase1Position={x:0,y:0},i.tipBase2Position={x:0,y:0},i.tipMoving=!1,i.color=r.defaultStrokeColor,i.bgColor=r.defaultFillColor,i.fontFamily=r.defaultFontFamily,i.defaultSize={x:100,y:30},i.setBgColor=i.setBgColor.bind(i),i.getTipPoints=i.getTipPoints.bind(i),i.positionTip=i.positionTip.bind(i),i.setTipPoints=i.setTipPoints.bind(i),i.colorPanel=new tt("Text color",r.defaultColorSet,i.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),i.colorPanel.onColorChanged=i.setColor,i.bgColorPanel=new tt("Fill color",r.defaultColorSet,i.bgColor,St),i.bgColorPanel.onColorChanged=i.setBgColor,i.fontFamilyPanel=new ft("Font",r.defaultFontFamilies,r.defaultFontFamily),i.fontFamilyPanel.onFontChanged=i.setFont,i.tipGrip=new rt,i.tipGrip.visual.transform.baseVal.appendItem(W.createTransform()),i.controlBox.appendChild(i.tipGrip.visual),i}return U(e,t),e.prototype.ownsTarget=function(e){return t.prototype.ownsTarget.call(this,e)||this.tipGrip.ownsTarget(e)||this.tip===e},e.prototype.createTip=function(){W.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=W.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,n){"new"===this.state&&t.prototype.pointerDown.call(this,e,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,t.prototype.pointerUp.call(this,e);else{var n="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(n),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var n=this.unrotatePoint(e);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(W.setAttributes(this.bgRectangle,[["fill",t]]),W.setAttributes(this.tip,[["fill",t]])),this.bgColor=t,this.fillColorChanged(t)},e.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},e.prototype.setTipPoints=function(t){void 0===t&&(t=!1);var e=Math.min(this.height/2,15),n=this.height/5;t&&(this.tipPosition={x:e+n/2,y:this.height+20});var r=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?r<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:0},this.tipBase2Position={x:e+n,y:0}):(this.tipBase1Position={x:0,y:e},this.tipBase2Position={x:0,y:e+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?r<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-n,y:0},this.tipBase2Position={x:this.width-e,y:0}):(this.tipBase1Position={x:this.width,y:e},this.tipBase2Position={x:this.width,y:e+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?r<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-n,y:this.height},this.tipBase2Position={x:this.width-e,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-e-n},this.tipBase2Position={x:this.width,y:this.height-e}):r<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:this.height},this.tipBase2Position={x:e+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-e},this.tipBase2Position={x:0,y:this.height-e-n})},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.positionTip()},e.prototype.positionTip=function(){W.setAttributes(this.tip,[["points",this.getTipPoints()]]);var t=this.tipGrip.visual.transform.baseVal.getItem(0);t.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(t,0)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.positionTip(),t.prototype.select.call(this)},e.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,t.prototype.restoreState.call(this,e),this.createTip(),this.setTipPoints()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.tipPosition={x:this.tipPosition.x*e,y:this.tipPosition.y*n},this.positionTip()},e.typeName="CalloutMarker",e.title="Callout marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',e}(pt),Et=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.fillColor="transparent",i.strokeColor="transparent",i.strokeWidth=0,i.strokeDasharray="",i.opacity=1,i.strokeColor=r.defaultColor,i.strokeWidth=r.defaultStrokeWidth,i.strokeDasharray=r.defaultStrokeDasharray,i.fillColor=r.defaultFillColor,i.setStrokeColor=i.setStrokeColor.bind(i),i.setFillColor=i.setFillColor.bind(i),i.setStrokeWidth=i.setStrokeWidth.bind(i),i.setStrokeDasharray=i.setStrokeDasharray.bind(i),i.setOpacity=i.setOpacity.bind(i),i.createVisual=i.createVisual.bind(i),i.strokePanel=new tt("Line color",z(r.defaultColorSet,["transparent"]),r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.fillPanel=new tt("Fill color",z(r.defaultColorSet,["transparent"]),i.fillColor,St),i.fillPanel.onColorChanged=i.setFillColor,i.strokeWidthPanel=new st("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i.opacityPanel=new bt("Opacity",r.defaultOpacitySteps,i.opacity),i.opacityPanel.onOpacityChanged=i.setOpacity,i}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=W.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),W.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&W.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&W.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(t),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&W.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&W.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&W.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.typeName="EllipseMarker",e.title="Ellipse marker",e.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',e}(at),wt=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return U(e,t),Object.defineProperty(e.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.tip1&&e!==this.tip2)},e.prototype.createTips=function(){this.tip1=W.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.tip1),this.tip2=W.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.tip2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(W.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var r=this.tip2.transform.baseVal.getItem(0);r.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(r,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e),this.createTips(),this.adjustVisual()},e.typeName="MeasurementMarker",e.title="Measurement marker",e.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',e}(dt),kt=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.strokePanel.colors=r.defaultColorSet,i.fillColor="transparent",i}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="EllipseFrameMarker",e.title="Ellipse frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',e}(Et),Tt=function(){function t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),t.prototype.addUndoStep=function(t){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(t)||(this.undoStack.push(t),JSON.stringify(this.lastRedoStep)!==JSON.stringify(t)&&this.redoStack.splice(0,this.redoStack.length))},t.prototype.replaceLastUndoStep=function(t){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=t)},t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},t.prototype.undo=function(){if(this.undoStack.length>1){var t=this.undoStack.pop();return void 0!==t&&this.redoStack.push(t),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},t}(),Ot=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.strokeColor="transparent",i.strokeWidth=0,i.strokeDasharray="",i.curveX=0,i.curveY=0,i.manipulationStartCurveX=0,i.manipulationStartCurveY=0,i.setStrokeColor=i.setStrokeColor.bind(i),i.setStrokeWidth=i.setStrokeWidth.bind(i),i.setStrokeDasharray=i.setStrokeDasharray.bind(i),i.positionGrips=i.positionGrips.bind(i),i.addControlGrips=i.addControlGrips.bind(i),i.adjustVisual=i.adjustVisual.bind(i),i.setupControlBox=i.setupControlBox.bind(i),i.resize=i.resize.bind(i),i.strokeColor=r.defaultColor,i.strokeWidth=r.defaultStrokeWidth,i.strokeDasharray=r.defaultStrokeDasharray,i.strokePanel=new tt("Line color",r.defaultColorSet,r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.strokeWidthPanel=new st("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorCurve&&e!==this.visibleCurve&&!this.curveGrip.ownsTarget(e))},e.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},e.prototype.createVisual=function(){this.visual=W.createGroup(),this.selectorCurve=W.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=W.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=e.x,this.curveY=e.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},e.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),W.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),W.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=W.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=W.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)},e.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,t.prototype.addControlGrips.call(this)},e.prototype.positionGrips=function(){t.prototype.positionGrips.call(this);var e=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-e/2,this.curveY-e/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()))},e.prototype.manipulate=function(e){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+e.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+e.y-this.manipulationStartY),t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){this.activeGrip===this.curveGrip&&(this.curveX=e.x,this.curveY=e.y),t.prototype.resize.call(this,e),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},e.prototype.scale=function(e,n){this.curveX=this.curveX*e,this.curveY=this.curveY*n,t.prototype.scale.call(this,e,n)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',e}(ht),At=function(){function t(t,e){void 0===e&&(e=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=t,this.cancelable=e}return Object.defineProperty(t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this._defaultPrevented=!0},t}(),Lt=function(t){function e(e,n,r){var i=t.call(this,e,!1)||this;return i.dataUrl=n,i.state=r,i}return U(e,t),e}(At),Dt=function(t){function e(e,n,r){void 0===r&&(r=!1);var i=t.call(this,e,r)||this;return i.marker=n,i}return U(e,t),e}(At),Rt=function(){function t(){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 t.prototype.addEventListener=function(t,e){this[t].push(e)},t.prototype.removeEventListener=function(t,e){var n=this[t].indexOf(e);n>-1&&this[t].splice(n,1)},t}(),It=function(){function t(e){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ut,this._isOpen=!1,this.undoRedoManager=new Tt,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=t.instanceCounter++,this.styles=new Y(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=e,this.targetRoot=document.body,this.width=e.clientWidth,this.height=e.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(t.prototype,"ALL_MARKER_TYPES",{get:function(){return[ct,gt,vt,pt,kt,Et,xt,Ct,wt,yt,dt,Ot]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ct,gt,vt,pt,Et,xt,Ct]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ct,gt,vt,pt,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(t){var e=this;this._availableMarkerTypes.splice(0),t.forEach((function(t){if("string"==typeof t){var n=e.ALL_MARKER_TYPES.find((function(e){return e.typeName===t}));void 0!==n&&e._availableMarkerTypes.push(n)}else e._availableMarkerTypes.push(t)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),V.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;void 0===this.styles.styleSheetRoot&&void 0!==q.styleSheetRoot&&(this.styles.styleSheetRoot=q.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(e){return e(new At(t))}))},t.prototype.render=function(){return H(this,void 0,void 0,(function(){var t;return G(this,(function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new K).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.markersOnly=this.renderMarkersOnly,t.width=this.renderWidth,t.height=this.renderHeight,[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return e.sent(),[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,e.sent()]}}))}))},t.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isOpen){var n=!1;t||this.eventListeners.beforeclose.forEach((function(t){var r=new At(e,!0);t(r),r.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(t){return t(new At(e))})),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(t=this._availableMarkerTypes).push.apply(t,e)},t.prototype.addRenderEventListener=function(t){this.addEventListener("render",(function(e){t(e.dataUrl,e.state)}))},t.prototype.removeRenderEventListener=function(t){},t.prototype.addCloseEventListener=function(t){this.addEventListener("close",(function(){t()}))},t.prototype.removeCloseEventListener=function(t){},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return t.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupTargetResize=function(){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.editorCanvas.clientWidth/t>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,n=e<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/t;this.resize(e,n)},t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},t.prototype.resize=function(t,e){this._isResizing=!0;var n=t/this.imageWidth,r=e/this.imageHeight;this.imageWidth=Math.round(t),this.imageHeight=Math.round(e),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(n,r),this._isResizing=!1},t.prototype.scaleMarkers=function(t,e){var n,r=this;this._currentMarker&&this._currentMarker instanceof pt?this._currentMarker.scale(t,e):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==r._currentMarker&&n.scale(t,e)})),void 0!==n&&this.setCurrentMarker(n)},t.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},t.prototype.setTopLeft=function(){var t=this.editingTarget.getBoundingClientRect(),e=this.editorCanvas.getBoundingClientRect();this.left=t.left-e.left,this.top=t.top-e.top},t.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},t.prototype.addDefs=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.defs=W.createDefs(),this.addDefsToImage(),(t=this.defs).append.apply(t,e)},t.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},t.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},t.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},t.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},t.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},t.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},t.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},t.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var t=document.createElement("a");t.href="https://markerjs.com/",t.target="_blank",t.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',t.title="Powered by marker.js",t.style.display="grid",t.style.alignItems="center",t.style.justifyItems="center",t.style.padding="3px",t.style.width="20px",t.style.height="20px",this.logoUI.appendChild(t),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},t.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},t.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"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new J(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Z(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},t.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.removeMarker=function(t){this.markerImage.removeChild(t.container),this.markers.indexOf(t)>-1&&this.markers.splice(this.markers.indexOf(t),1),t.dispose()},t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},t.prototype.toolbarButtonClicked=function(t,e){if("marker"===t&&void 0!==e)this.createNewMarker(e);else if("action"===t)switch(e){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},t.prototype.deleteSelectedMarker=function(){var t=this;if(void 0!==this._currentMarker){var e=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var r=new Dt(t,t._currentMarker,!0);n(r),r.defaultPrevented&&(e=!0)})),!e){var n=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach((function(e){return e(new Dt(t,n))}))}}},t.prototype.clear=function(){var t=this,e=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var r=new Dt(t,void 0,!0);n(r),r.defaultPrevented&&(e=!0)})),!e)){this.setCurrentMarker();for(var n=function(e){var n=r.markers[e];r.setCurrentMarker(r.markers[e]),r._currentMarker.dispose(),r.markerImage.removeChild(r._currentMarker.container),r.markers.splice(r.markers.indexOf(r._currentMarker),1),r.eventListeners.markerdelete.forEach((function(e){return e(new Dt(t,n))}))},r=this,i=this.markers.length-1;i>=0;i--)n(i);this.addUndoStep()}},Object.defineProperty(t.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),t.prototype.showNotesEditor=function(){var t;void 0!==this._currentMarker&&(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=null!==(t=this._currentMarker.notes)&&void 0!==t?t:"",this.overlayContainer.appendChild(this.notesArea))},t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},t.prototype.addUndoStep=function(){var t=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var e=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===e.width&&n.height===e.height){var r=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(e),r<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(e){return e(new At(t))}))}else this.undoRedoManager.replaceLastUndoStep(e),this.eventListeners.statechange.forEach((function(e){return e(new At(t))}))}},t.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},t.prototype.undoStep=function(){var t=this,e=this.undoRedoManager.undo();void 0!==e&&(this.restoreState(e),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(e){return e(new At(t))})))},t.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},t.prototype.redoStep=function(){var t=this,e=this.undoRedoManager.redo();void 0!==e&&(this.restoreState(e),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(e){return e(new At(t))})))},t.prototype.stepZoom=function(){var t=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=t<this.zoomSteps.length-1?this.zoomSteps[t+1]:this.zoomSteps[0]},t.prototype.panTo=function(t){this.contentDiv.scrollBy({left:this.prevPanPoint.x-t.x,top:this.prevPanPoint.y-t.y}),this.prevPanPoint=t},t.prototype.startRenderAndClose=function(){return H(this,void 0,void 0,(function(){var t,e,n=this;return G(this,(function(r){switch(r.label){case 0:return[4,this.render()];case 1:return t=r.sent(),e=this.getState(),this.eventListeners.render.forEach((function(r){return r(new Lt(n,t,e))})),this.close(!0),[2]}}))}))},t.prototype.getState=function(t){!0===t&&this.setCurrentMarker();var e={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(t){return e.markers.push(t.getState())})),e},t.prototype.restoreState=function(t){var e=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);t.markers.forEach((function(t){var n=e._availableMarkerTypes.find((function(e){return e.typeName===t.typeName}));if(void 0!==n){var r=e.addNewMarker(n);r.restoreState(t),e.markers.push(r)}})),t.width&&t.height&&(t.width!==this.imageWidth||t.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/t.width,this.imageHeight/t.height),this.eventListeners.restorestate.forEach((function(t){return t(new At(e))}))},t.prototype.addNewMarker=function(t){var e=W.createGroup();return this.markerImage.appendChild(e),new t(e,this.overlayContainer,this.settings)},t.prototype.createNewMarker=function(t){var e,n=this;(e="string"==typeof t?this._availableMarkerTypes.find((function(e){return e.typeName===t})):t)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(e),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(e.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(t){return t(new Dt(n,n._currentMarker))})))},t.prototype.markerCreated=function(t){var e=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(t),this.setCurrentMarker(t),t instanceof gt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(gt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(t){return t(new Dt(e,e._currentMarker))}))},t.prototype.colorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=t,this.settings.defaultStrokeColor=t)},t.prototype.fillColorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=t)},t.prototype.markerStateChanged=function(t){var e=this;this.eventListeners.markerchange.forEach((function(n){return n(new Dt(e,t))}))},t.prototype.setCurrentMarker=function(t){var e=this;this._currentMarker!==t&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(t){return t(new Dt(e,e._currentMarker))}))),this._currentMarker=t,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(t){return t(new Dt(e,e._currentMarker))})))},t.prototype.onPointerDown=function(t){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==t.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var e=this.markers.find((function(e){return e.ownsTarget(t.target)}));void 0!==e?(this.setCurrentMarker(e),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:t.clientX,y:t.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY))},t.prototype.onDblClick=function(t){if(this._isFocused||this.focus(),"select"===this.mode){var e=this.markers.find((function(e){return e.ownsTarget(t.target)}));void 0!==e&&e!==this._currentMarker&&this.setCurrentMarker(e),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target):this.setCurrentMarker()}},t.prototype.onPointerMove=function(t){1!==this.touchPoints&&"touch"===t.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||t.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(t.clientX,t.clientY)):this.zoomLevel>1&&this.panTo({x:t.clientX,y:t.clientY}))},t.prototype.onPointerUp=function(t){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(t.clientX,t.clientY)),this.isDragging=!1,this.addUndoStep()},t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},t.prototype.onKeyUp=function(t){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==t.key&&"Backspace"!==t.key||this.deleteSelectedMarker()},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.markerImage.getBoundingClientRect();return{x:(t-n.left)/this.zoomLevel,y:(e-n.top)/this.zoomLevel}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.addLicenseKey=function(t){V.addKey(t)},t.prototype.addEventListener=function(t,e){this.eventListeners.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventListeners.removeEventListener(t,e)},t.prototype.renderState=function(t){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(t),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(e){return e(new At(t))})))},t.prototype.blur=function(){var t=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(e){return e(new At(t))})))},t.instanceCounter=0,t}(),_t=function(t,e){return(_t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};
/* **********************************
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.
***************************************************************************** */function Mt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_t(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Nt(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((r=r.apply(t,e||[])).next())}))}function Pt(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var Ft=function(){function t(){}return t.addKey=function(e){t.key=e},Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(t.key)},enumerable:!1,configurable:!0}),t}(),jt=function(){function t(){}return t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.setAttributes=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n],a=i[0],o=i[1];t.setAttribute(a,o)}},t.createRect=function(e,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","rect");return i.setAttribute("width",e.toString()),i.setAttribute("height",n.toString()),r&&t.setAttributes(i,r),i},t.createLine=function(e,n,r,i,a){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",e.toString()),o.setAttribute("y1",n.toString()),o.setAttribute("x2",r.toString()),o.setAttribute("y2",i.toString()),a&&t.setAttributes(o,a),o},t.createPolygon=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points",e),n&&t.setAttributes(r,n),r},t.createCircle=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("cx",(e/2).toString()),r.setAttribute("cy",(e/2).toString()),r.setAttribute("r",e.toString()),n&&t.setAttributes(r,n),r},t.createEllipse=function(e,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return i.setAttribute("cx",(e/2).toString()),i.setAttribute("cy",(n/2).toString()),i.setAttribute("rx",(e/2).toString()),i.setAttribute("ry",(n/2).toString()),r&&t.setAttributes(i,r),i},t.createGroup=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(n,e),n},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createMarker=function(e,n,r,i,a,o,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(l,[["id",e],["orient",n],["markerWidth",r.toString()],["markerHeight",i.toString()],["refX",a.toString()],["refY",o.toString()]]),l.appendChild(s),l},t.createText=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),e&&t.setAttributes(n,e),n},t.createTSpan=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");return r.textContent=e,n&&t.setAttributes(r,n),r},t.createImage=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return e&&t.setAttributes(n,e),n},t.createPoint=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=t,n.y=e,n},t.createPath=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),n&&t.setAttributes(r,n),r},t.createElement=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg",e);return n&&t.setAttributes(r,n),r},t.getHollowRectanglePath=function(t,e,n,r,i,a,o,s){return"M"+t+","+e+"V"+(e+r)+"H"+(t+n)+"V"+e+"H"+i+"V"+a+"H"+(i+o)+"V"+(a+s)+"H"+i+"V"+e+"Z"},t}(),Bt=function(){function t(t){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+t+"_"}return Object.defineProperty(t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),t.prototype.addClass=function(t){return void 0===this.styleSheet&&this.addStyleSheet(),t.name=""+this.classNamePrefix+t.localName,this.classes.push(t),this.styleSheet.sheet.insertRule("."+t.name+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length),t},t.prototype.addRule=function(t){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(t),this.styleSheet.sheet.insertRule(t.selector+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length)},t.prototype.addStyleSheet=function(){var t;this.styleSheet=document.createElement("style"),(null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).appendChild(this.styleSheet),this.addRule(new Ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new Ht("_fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new Ht("_fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},t.prototype.removeStyleSheet=function(){var t;this.styleSheet&&((null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},t}(),Ut=function(t,e){this.selector=t,this.style=e},Ht=function(t,e){this.localName=t,this.style=e},Gt=function(){function t(){this.blocks=[],this.display=""}return t.prototype.addButtonBlock=function(t){t.className=this.blockClassName,t.buttonClassName=this.buttonClassName,t.buttonColorsClassName=this.buttonColorsClassName,t.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(t)},t.prototype.addElementBlock=function(t){void 0===t.className&&(t.className=this.blockClassName),this.blocks.push(t)},t.prototype.getUI=function(){var t=document.createElement("div");return t.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,t.style.display=this.display,this.blocks.forEach((function(e){return t.appendChild(e.getUI())})),t},t}(),zt=function(){function t(){}return t.prototype.getUI=function(){var t=document.createElement("div");if(t.className=this.className,void 0!==this.minWidth&&(t.style.minWidth=this.minWidth),void 0!==this.contentAlign)switch(this.contentAlign){case"start":t.style.justifyContent="flex-start";break;case"center":t.style.justifyContent="center";break;case"end":t.style.justifyContent="flex-end"}return t.style.whiteSpace="nowrap",t},t}(),Wt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.buttons=[],e}return Mt(e,t),e.prototype.addButton=function(t){t.className=this.buttonClassName,t.colorsClassName=this.buttonColorsClassName,t.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(t)},e.prototype.getUI=function(){var e=t.prototype.getUI.call(this);return this.buttons.forEach((function(t){return e.appendChild(t.getUI())})),e},e}(zt),Vt=function(){function t(t,e){this._isActive=!1,this._isHidden=!1,this._icon=t,this.title=e,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},set:function(t){this._icon=t,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},set:function(t){this._isActive=t,this.adjustClassName()},enumerable:!1,configurable:!0}),t.prototype.getUI=function(){var t=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",(function(){return t.onClick()})),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},t.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},t.prototype.hide=function(){this._isHidden=!0},t}(),Kt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.elements=[],e}return Mt(e,t),e.prototype.addElement=function(t){this.elements.push(t)},e.prototype.getUI=function(){var e=t.prototype.getUI.call(this);return this.elements.forEach((function(t){return e.appendChild(t)})),e},e}(zt),qt=function(){function t(t,e){this.horizontal=t,this.vertical=e}return Object.defineProperty(t.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),t.prototype.getVerticalLength=function(t){return t/this.ratio},t.prototype.getHorizontalLength=function(t){return t*this.ratio},t}(),Yt=function(){function t(){}return t.getIcon=function(t,e){if(t>0&&e>0){var n=new qt(t,e),r=n.ratio>=1?20:n.getHorizontalLength(20),i=n.ratio<1?20:n.getVerticalLength(20),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(a);var o=jt.createDefs();a.appendChild(o);var s=jt.createElement("clipPath",[["id","text-bg-clip"]]);o.appendChild(s);var l=jt.createPath(jt.getHollowRectanglePath((24-r)/2,(24-i)/2,r,i,(24-r)/2+2,(24-i)/2+2,r-4,i-4));a.appendChild(l);var c=jt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(jt.createTSpan(t+":"+e)),a.appendChild(c);var u=c.getBBox();jt.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=jt.createPath(jt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(u.width))/2,(24-Math.ceil(u.height))/2,Math.ceil(u.width),Math.ceil(u.height)));return s.appendChild(h),jt.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(a),a.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},t}(),Xt=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.isDropdownOpen=!1,i.onClick=i.dropdownButtonClicked,i.dropdownButtons=r,i}return Mt(e,t),e.prototype.setupDropdown=function(){var t=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(e){e.className=t.className,e.colorsClassName=t.colorsClassName,t.dropdownBlock.appendChild(e.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},e.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},e.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},e.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},e.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},e.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},e}(Vt),$t=function(){function t(t,e){this.GRIP_SIZE=10,this.color=t,this.fillColor=e,this.visual=jt.createGroup(),this.visual.appendChild(jt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(jt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t.prototype.setCenter=function(t,e){this.visual.childNodes.forEach((function(n){return jt.setAttributes(n,[["cx",t.toString()],["cy",e.toString()]])}))},t}(),Jt=function(){function t(t,e,n,r){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=t,this.canvasHeight=e,this.margin=n,this.container=r,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(t.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(t){this._aspectRatio=t,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.gridContainer&&jt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(t){this._zoomFactor=t,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),t.prototype.open=function(){var t=this;this.cropShadeElement=jt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=jt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var e=0;e<this.numberOfGridLines;e++)this.horizontalGridLines.push(jt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(jt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach((function(e){return t.gridContainer.appendChild(e)})),this.verticalGridLines.forEach((function(e){return t.gridContainer.appendChild(e)})),this.cropRectElement=jt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},t.prototype.setCropRectangle=function(t){this.cropRect=t;var e=Object.assign({},this.cropRect);1!==this.zoomFactor&&(e.width=this.cropRect.width*this.zoomFactor,e.height=this.cropRect.height*this.zoomFactor,e.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-e.width/2,e.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-e.height/2),jt.setAttributes(this.cropRectElement,[["x",e.x.toString()],["y",e.y.toString()],["width",e.width.toString()],["height",e.height.toString()]]);var n=e.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(t,r){var i=e.y+n*(r+1);jt.setAttributes(t,[["x1",""+e.x],["y1",""+i],["x2",""+(e.x+e.width)],["y2",""+i]])}));var r=e.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(t,n){var i=e.x+r*(n+1);jt.setAttributes(t,[["x1",""+i],["y1",""+e.y],["x2",""+i],["y2",""+(e.y+e.height)]])})),jt.setAttributes(this.cropShadeElement,[["d",jt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,e.x,e.y,e.width,e.height)]]),this.topLeftGrip.setCenter(e.x,e.y),this.topRightGrip.setCenter(e.x+e.width,e.y),this.bottomLeftGrip.setCenter(e.x,e.y+e.height),this.bottomRightGrip.setCenter(e.x+e.width,e.y+e.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},t.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)},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.container.getBoundingClientRect();return{x:t-n.left+this.margin,y:e-n.top+this.margin}},t.prototype.onPointerDown=function(t){this.container.setPointerCapture(t.pointerId),this.previousPoint=this.clientToLocalCoordinates(t.clientX,t.clientY),this.cropRectElement===t.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(t.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(t.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(t.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(t.target)&&(this.activeGrip=this.bottomRightGrip)},t.prototype.onPointerMove=function(t){if(this.isMoving)this.move(this.clientToLocalCoordinates(t.clientX,t.clientY));else if(this.activeGrip){var e=this.clientToLocalCoordinates(t.clientX,t.clientY);this.resize(e)}t.preventDefault()},t.prototype.onPointerUp=function(t){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(t.pointerId)},t.prototype.move=function(t){var e=t.x-this.previousPoint.x,n=t.y-this.previousPoint.y;1!==this.zoomFactor&&(e=-e/this.zoomFactor,n=-n/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+e),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+n),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=t},t.prototype.resize=function(t){var e=Object.assign({},this.cropRect),n=t.x-this.previousPoint.x,r=t.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:e.x+n<this.margin&&(n=this.margin-e.x),e.x+=n,e.width=this.cropRect.x+this.cropRect.width-e.x;break;case this.bottomRightGrip:case this.topRightGrip:e.width+n>this.canvasWidth*this.zoomFactor&&(n=this.canvasWidth*this.zoomFactor-e.width),e.width+=n}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(e.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(n),e.height=this.aspectRatio.getVerticalLength(e.width)):(e.y+=r,e.height=this.cropRect.y+this.cropRect.height-e.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?e.height=this.aspectRatio.getVerticalLength(e.width):e.height+=r}e.width<10&&(e.x=this.cropRect.x,e.width=10),e.height<10&&(e.y=this.cropRect.y,e.height=10),this.previousPoint=t,e.x>=this.margin&&e.y>=this.margin&&e.x-this.margin+e.width<=this.canvasWidth&&e.y-this.margin+e.height<=this.canvasHeight&&(this.cropRect=e,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},t.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var t=this.cropRect.x+this.cropRect.width/2,e=this.cropRect.y+this.cropRect.height/2,n=this.aspectRatio.getHorizontalLength(this.cropRect.height),r=this.aspectRatio.getVerticalLength(this.cropRect.width);n/this.canvasWidth<r/this.canvasHeight?this.cropRect.width=n:this.cropRect.height=r,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=t-this.cropRect.width/2,this.cropRect.y=e-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)}},t.prototype.getRescaledRect=function(t,e,n,r,i,a){var o=n/t,s=r/e;return{x:(i.x-a)*o+a,y:(i.y-a)*s+a,width:i.width*o,height:i.height*s}},t.prototype.scaleCanvas=function(t,e){var n=this.getRescaledRect(this.canvasWidth,this.canvasHeight,t,e,this.cropRect,this.margin);this.canvasWidth=t,this.canvasHeight=e,this.onCropChange&&this.onCropChange(n),this.setCropRectangle(n)},t}(),Zt=function(){function t(t){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=t,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(t.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),t.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},t.prototype.onPointerDown=function(t){this.controlContainer.setPointerCapture(t.pointerId),this.isDragging=!0,this.previousPoint={x:t.clientX,y:t.clientY}},t.prototype.onPointerMove=function(t){this.isDragging&&(this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.previousPoint.x=t.clientX)},t.prototype.onPointerUp=function(t){this.isDragging&&this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(t.pointerId)},t.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var t=this.angleLabelText.getBBox();jt.setAttributes(this.angleLabelElement,[["x",((this.width-t.width)/2).toString()],["y",(this.height/2).toString()]])}},t.prototype.positionScaleShape=function(){if(this.scaleShape){var t=this.scaleShape.transform.baseVal.getItem(0);t.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(t,0)}},t.prototype.getVisual=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width",this.width+"px"),t.setAttribute("height",this.height+"px"),t.setAttribute("viewBox","0 0 "+this.width+" "+this.height),t.style.flexShrink="0",document.body.appendChild(t);for(var e="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,n=1;n<=this.width/5+10;n++){var r=n%5==0?this.height/3:this.height/6;e+="h4v"+-r+"h1v"+r}e+="v1H0Z",this.scaleShape=jt.createPath(e);var i=jt.createTransform();this.scaleShape.transform.baseVal.appendItem(i),t.appendChild(this.scaleShape),this.angleLabelElement=jt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=jt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var a=jt.createTSpan("");return a.innerHTML="&deg;",this.angleLabelElement.appendChild(a),t.appendChild(this.angleLabelElement),document.body.removeChild(t),t},t}(),Qt=function(){function t(){this.naturalSize=!1,this.imageType="image/png"}return t.prototype.rasterize=function(t,e,n,r,i,a,o){var s=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=t.width.baseVal.value-2*r,c.height=t.height.baseVal.value-2*r;var u=1,h=1;!0===s.naturalSize?(u=e.naturalWidth/(t.width.baseVal.value-2*r)/a,h=e.naturalHeight/(t.height.baseVal.value-2*r)/o,c.width=e.naturalWidth/a,c.height=e.naturalHeight/o):void 0!==s.width&&void 0!==s.height&&(u=s.width/n.width,h=s.height/n.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(i*Math.PI/180),d.scale(a,o),d.translate(-c.width/2,-c.height/2),d.drawImage(e,0,0,c.width,c.height);var f=document.createElement("canvas");f.width=n.width*u,f.height=n.height*h,f.getContext("2d").putImageData(d.getImageData((n.x-r)*u,(n.y-r)*h,n.width*u,n.height*h),0,0),l(f.toDataURL(s.imageType,s.imageQuality))}))},t}(),te=function(){function t(e){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=t.instanceCounter++,this.styles=new Bt(this.instanceNo),this.target=e,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(t){this._zoomToCropEnabled=t,t?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gridLines",{get:function(){return this._gridLines},set:function(t){this._gridLines=t,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(t){this._rotationAngle=t,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){var t;return null!==(t=this._aspectRatio)&&void 0!==t?t:this.aspectRatios[0]},set:function(t){this._aspectRatio=t},enumerable:!1,configurable:!0}),t.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(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},t.prototype.show=function(){this.showUI(),this.open()},t.prototype.close=function(t){void 0===t&&(t=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),t||this.closeEventListeners.forEach((function(t){return t()})),this._isOpen=!1)},t.prototype.addRenderEventListener=function(t){this.renderEventListeners.push(t)},t.prototype.removeRenderEventListener=function(t){this.renderEventListeners.indexOf(t)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(t),1)},t.prototype.addCloseEventListener=function(t){this.closeEventListeners.push(t)},t.prototype.removeCloseEventListener=function(t){this.closeEventListeners.indexOf(t)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(t),1)},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.contentDiv.clientWidth/t>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*t:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,n=e+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/t;this.resize(e,n)}},t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},t.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",jt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},t.prototype.resize=function(t,e){this.imageWidth=Math.round(t),this.imageHeight=Math.round(e),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px","popup"!==this.displayMode?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},t.prototype.setEditingTarget=function(){var t=document.createElement("canvas");t.width=this.target.naturalWidth,t.height=this.target.naturalHeight,t.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var e=t.toDataURL();jt.setAttributes(this.editingTarget,[["href",e]]),this.setEditingTargetSize()},t.prototype.setTopLeft=function(){var t=this.target.getBoundingClientRect(),e=this.editorCanvas.getBoundingClientRect();this.left=t.left-e.left-this.CANVAS_MARGIN,this.top=t.top-e.top-this.CANVAS_MARGIN},t.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=jt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=jt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=jt.createGroup(),this.editingTargetRotationScaleContainer=jt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var t=jt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(t);var e=jt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(e),this.editingTargetContainer=jt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},t.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},t.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=jt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Jt(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},t.prototype.zoomToCrop=function(){if(this.cropRect){var t=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,e=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=t+"px "+e+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-t+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-e+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},t.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},t.prototype.cropRectChanged=function(t){this.cropRect=t,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},t.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},t.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"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch(this.addStyles(),"popup"===this.displayMode&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var t=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,e=this.target.offsetTop>t+this.CANVAS_MARGIN?this.target.offsetTop-(t+this.CANVAS_MARGIN):0;this.coverDiv.style.top=e+"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=void 0!==this.styles.settings.zIndex?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=void 0!==this.styles.settings.zIndex?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="popup"===this.displayMode?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,"popup"===this.displayMode&&(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","popup"===this.displayMode&&(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},t.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},t.prototype.addTopToolbar=function(){var t=this;this.topToolbar=new Gt,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 e=new Wt;e.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(e);var n=[];this.aspectRatios.forEach((function(e){var r=new Vt(Yt.getIcon(e.horizontal,e.vertical),0===e.horizontal&&0===e.vertical?"FREE":e.horizontal+":"+e.vertical);r.onClick=function(){return t.ratioButtonClicked(e)},n.push(r)})),this.aspectRatioButton=new Xt(Yt.getIcon(0,0),"Aspect ratio",n),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,e.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var r=new Vt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");r.isActive=this.isGridVisible,r.onClick=function(){t.isGridVisible=!t.isGridVisible,r.isActive=t.isGridVisible},e.addButton(r);var i=new Vt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(i.isActive=this.zoomToCropEnabled,i.onClick=function(){t.zoomToCropEnabled=!t.zoomToCropEnabled,i.isActive=t.zoomToCropEnabled},e.addButton(i),!Ft.isLicensed){var a=new Kt;this.topToolbar.addElementBlock(a);var o=document.createElement("div");o.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var s=document.createElement("a");s.style.color="currentColor",s.href="https://markerjs.com/products/cropro",s.target="_blank",s.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',o.appendChild(s),a.addElement(o)}var l=new Wt;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Vt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new Vt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");u.onClick=this.close,l.addButton(u),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(u.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},t.prototype.addBottomToolbar=function(){var t=this;this.bottomToolbar=new Gt,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 e=new Wt;e.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(e);var n=new Vt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");n.onClick=this.rotateLeftButtonClicked,e.addButton(n);var r=new Vt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");r.onClick=this.rotateRightButtonClicked,e.addButton(r);var i=new Kt;i.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(i),this.straightener=new Zt("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(e){t.rotateBy(e),t.straightener.angle=t.rotationAngle},i.addElement(this.straightener.getUI());var a=new Wt;a.minWidth=2*this.toolbarHeight+"px",a.contentAlign="end",this.bottomToolbar.addButtonBlock(a);var o=new Vt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");o.onClick=this.flipHorizontallyButtonClicked,a.addButton(o);var s=new Vt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");s.onClick=this.flipVerticallyButtonClicked,a.addButton(s)},t.prototype.ratioButtonClicked=function(t){this.aspectRatio=t,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},t.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Yt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},t.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new qt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},t.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},t.prototype.restoreState=function(t){if(t){var e=this.cropLayer.getRescaledRect(t.width,t.height,this.imageWidth,this.imageHeight,t.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(e),this.cropRectChanged(e),this.flippedHorizontally=t.flippedHorizontally,this.flippedVertically=t.flippedVertically,this.applyFlip(),this.rotationAngle=t.rotationAngle,this.applyRotation()}},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.cropImage.getBoundingClientRect();return{x:t-n.left,y:e-n.top}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var t=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.rotateLeftButtonClicked=function(){var t=this.rotationAngle-90;this.rotationAngle%90!=0&&(t+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateRightButtonClicked=function(){var t=this.rotationAngle+90;this.rotationAngle%90!=0&&(t-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateTo=function(t){t=(t=t>180?t-360:t)<=-180?t+360:t,this.rotationAngle=t,this.applyRotation()},t.prototype.rotateBy=function(t){this.rotateTo((this.rotationAngle+t)%360)},t.prototype.applyRotation=function(){var t=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var e=this.editingTargetRotationContainer.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(e,0);var n=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/n.width,this.imageHeight/n.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=t},t.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},t.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},t.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},t.prototype.startRenderAndClose=function(){return Nt(this,void 0,void 0,(function(){var t,e;return Pt(this,(function(n){switch(n.label){case 0:return[4,this.render()];case 1:return t=n.sent(),e=this.getState(),this.renderEventListeners.forEach((function(n){return n(t,e)})),this.close(!0),[2]}}))}))},t.prototype.render=function(){return Nt(this,void 0,void 0,(function(){var t;return Pt(this,(function(e){switch(e.label){case 0:return(t=new Qt).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.width=this.renderWidth,t.height=this.renderHeight,this.unzoomFromCrop(),jt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,t.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 e.sent(),[4,t.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,e.sent()]}}))}))},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ht("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new Ht("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Ht("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var t=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ht("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*t)+"px;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Ut("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Ut("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Ht("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ht("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ht("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -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%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ht("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ht("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},t.instanceCounter=0,t}(),ee=n("8hTe"),ne=n.n(ee),re=/<pre[^>]*>/g;e.a=function(t){var e=t.value,n=void 0===e?"":e,l=t.edit,d=void 0!==l&&l,f=t.className,p=t.showTextOnly,g=t.showLines,m=t.replaces,v=t.zoomImg,y=t.hasMask,C=t.style,E=void 0===C?{}:C,w=t.stylesPrev,k=void 0===w?{}:w,A=String(n),L=Object(u.useRef)(),D=Object(u.useRef)(),R=Object(u.useState)(""),_=Object(s.a)(R,2),B=_[0],U=_[1],H=Object(u.useState)("office"),G=Object(s.a)(H,2),z=G[0],W=G[1],V=Object(u.useMemo)((function(){try{A=(A=A.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+N.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+N.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+N.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,"\n")).replace(new RegExp("(?<!\\n)\\n(?!\\n)","g")," \n")}catch(t){}var t=I(A),e=T;if(A.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",S()),b()),t=(t=t.replace(/(__special_katext_id_\d+__)/g,(function(t,n){var r=e[n],i=r.type,a=r.expression;return Object(P.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(a)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),O(),p){var n=document.createElement("div");return n.innerHTML=t,n.innerText}return setTimeout((function(){return Y()}),500),t}),[A]),K=Object(u.useRef)();function q(t){var e=t.target;if("IMG"===e.tagName.toUpperCase()){if(v){var n=e.getAttribute("src");U(n),W("image")}}else if("A"===e.tagName.toUpperCase()){var r=e.getAttribute("href");if(r.indexOf("office")>-1)t.preventDefault(),U(r),W("office");else if(r.indexOf("application/pdf")>-1)t.preventDefault(),U(r),W("pdf");else if(r.indexOf("type=text")>-1)t.preventDefault(),U(r),W("html");else if(r.startsWith("#")){t.preventDefault();var i=document.getElementById(r.replace("#",""));i&&i.scrollIntoView(!0)}}}x.WebkitLineClamp=g,g&&(E=Object(a.a)(Object(a.a)({},E),x));var Y=function(){var t,e=null===(t=K.current)||void 0===t?void 0:t.querySelectorAll("video");null==e||e.forEach((function(t){if(t.oncontextmenu=function(){return!1},t.src.indexOf(".m3u8")>-1)if(t.canPlayType("application/vnd.apple.mpegurl"));else if(M.a.isSupported()){var e=new M.a;e.loadSource(t.src),e.attachMedia(t)}}))};Object(u.useEffect)((function(){if(K.current&&V&&V.match(re)&&window.PR.prettyPrint(),K.current)return K.current.addEventListener("click",q),function(){K.current.removeEventListener("click",q),O(),b()}}),[V,K.current,q]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:K,style:Object(a.a)({},E),className:"".concat(f||""," markdown-body ").concat(ne.a.mdBody),onMouseOver:function(t){d&&("IMG"===t.target.nodeName?(L.current.style.display="flex",L.current.style.width=t.target.clientWidth+"px",L.current.style.height=t.target.clientHeight+"px",L.current.style.top=t.target.offsetTop+"px",L.current.style.left=t.target.offsetLeft+"px",D.current.src=t.target.getAttribute("src")):L.current.style.display="none")},dangerouslySetInnerHTML:{__html:V}}),h.a.createElement("div",{ref:L,className:ne.a.button},h.a.createElement(r.a,null,h.a.createElement(i.a,{onClick:function(){return(t=new te(D.current)).displayMode="popup",t.addRenderEventListener(function(){var t=Object(o.a)(c.a.mark((function t(e){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L.current.style.display="none",t.next=3,Object(j.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e}});case 3:null!=(n=t.sent)&&n.id&&m(D.current.getAttribute("src").replace(N.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),void t.show();var t}},"裁剪"),h.a.createElement(i.a,{onClick:function(){return(t=new It(D.current)).settings.displayMode="popup",t.addEventListener("render",function(){var t=Object(o.a)(c.a.mark((function t(e){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(L.current.style.display="none",!D.current){t.next=6;break}return t.next=4,Object(j.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e.dataUrl}});case 4:null!=(n=t.sent)&&n.id&&m(D.current.getAttribute("src").replace(N.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.show(),void(window.markerArea=t);var t}},"编辑"))),h.a.createElement("img",{ref:D,src:"https://ali-cdn.educoder.net/images/avatars/PortalImage/170?t=1659681136",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),h.a.createElement(F.a,{close:!0,data:B,hasMask:y,type:null!=B&&B.length?z:"",style:Object(a.a)({},k),onClose:function(){return U("")}}))}},"9VGf":
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(/*! react */"q1tI");function i(t,e){var n=Object(r.useRef)();Object(r.useEffect)((function(){n.current=t})),Object(r.useEffect)((function(){if(null!==e){var t=setInterval((function(){n.current()}),e);return function(){return clearInterval(t)}}}),[e])}},AMnG:
/*!*********************************************************************!*\
!*** ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx ***!
\*********************************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/message/style */"miYZ");var r=n(/*! antd/es/message */"tsqr"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),a=n(/*! react */"q1tI"),o=n.n(a),s=(n(/*! ./index.less */"nWbc"),n(/*! @/components/markdown-editor */"Ot1p"));e.a=function(t){var e=t.id,n=t.activeDiscussIndex,l=t.onReplyDiscuss,c=Object(a.useState)(""),u=Object(i.a)(c,2),h=u[0],d=u[1];return o.a.createElement("div",{key:e,className:"discuss-item-editor",style:{display:n===e?"block":"none",width:"100%"}},o.a.createElement(s.a,{miniToolbar:!0,startInit:n===e,defaultValue:h,id:e,noStorage:!0,watch:!1,height:155,placeholder:"我要回复",showResizeBar:!0,onChange:function(t){d(t)}}),o.a.createElement("a",{onClick:function(){h?(l(e,h),d("")):r.b.info("回复内容不能为空!")},className:"btn-send"},"发送"))}},BU3w:
/*!***************************************************!*\
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
\***************************************************/
/*! exports provided: injectCSS, updateCSS */
/*! exports used: updateCSS */function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(/*! ./canUseDom */"MNnm");function i(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(r.a)())return null;var a,o=document.createElement("style");(null===(e=n.csp)||void 0===e?void 0:e.nonce)&&(o.nonce=null===(a=n.csp)||void 0===a?void 0:a.nonce);o.innerHTML=t;var s=i(n),l=s.firstChild;return n.prepend&&s.prepend?s.prepend(o):n.prepend&&l?s.insertBefore(o,l):s.appendChild(o),o}var o=new Map;function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i(n);if(!o.has(r)){var s=a("",n),l=s.parentNode;o.set(r,l),l.removeChild(s)}var c=Array.from(o.get(r).children).find((function(t){return"STYLE"===t.tagName&&t["rc-util-key"]===e}));if(c){var u,h,d;if((null===(u=n.csp)||void 0===u?void 0:u.nonce)&&c.nonce!==(null===(h=n.csp)||void 0===h?void 0:h.nonce))c.nonce=null===(d=n.csp)||void 0===d?void 0:d.nonce;return c.innerHTML!==t&&(c.innerHTML=t),c}var f=a(t,n);return f["rc-util-key"]=e,f}},Bd2K:
/*!********************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closetag.js ***!
\********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){t.defineOption("autoCloseTags",!1,(function(o,s,l){if(l!=t.Init&&l&&o.removeKeyMap("autoCloseTags"),s){var c={name:"autoCloseTags"};"object"==typeof s&&!1===s.whenClosing||(c["'/'"]=function(e){return function(e){return e.getOption("disableInput")?t.Pass:r(e,!0)}(e)}),"object"==typeof s&&!1===s.whenOpening||(c["'>'"]=function(r){return function(r){if(r.getOption("disableInput"))return t.Pass;for(var o=r.listSelections(),s=[],l=r.getOption("autoCloseTags"),c=0;c<o.length;c++){if(!o[c].empty())return t.Pass;var u=o[c].head,h=r.getTokenAt(u),d=t.innerMode(r.getMode(),h.state),f=d.state,p=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(f),g=p&&p.name;if(!g)return t.Pass;var m="html"==d.mode.configuration,v="object"==typeof l&&l.dontCloseTags||m&&e,y="object"==typeof l&&l.indentTags||m&&n;h.end>u.ch&&(g=g.slice(0,g.length-h.end+u.ch));var b=g.toLowerCase();if(!g||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&p.close||h.string.indexOf("/")==u.ch-h.start-1||v&&i(v,b)>-1||a(r,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f)||[],g,u,!0))return t.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&i(x,g)>-1)s[c]={text:"/>",newPos:t.Pos(u.line,u.ch+2)};else{var S=y&&i(y,b)>-1;s[c]={indent:S,text:">"+(S?"\n\n":"")+"</"+g+">",newPos:S?t.Pos(u.line+1,0):t.Pos(u.line,u.ch+1)}}}var C="object"==typeof l&&l.dontIndentOnAutoClose;for(c=o.length-1;c>=0;c--){var E=s[c];r.replaceRange(E.text,o[c].head,o[c].anchor,"+insert");var w=r.listSelections().slice(0);w[c]={head:E.newPos,anchor:E.newPos},r.setSelections(w),!C&&E.indent&&(r.indentLine(E.newPos.line,null,!0),r.indentLine(E.newPos.line+1,null,!0))}}(r)}),o.addKeyMap(c)}}));var e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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 r(e,n){for(var r=e.listSelections(),i=[],o=n?"/":"</",s=e.getOption("autoCloseTags"),l="object"==typeof s&&s.dontIndentOnSlash,c=0;c<r.length;c++){if(!r[c].empty())return t.Pass;var u=r[c].head,h=e.getTokenAt(u),d=t.innerMode(e.getMode(),h.state),f=d.state;if(n&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return t.Pass;var p,g="xml"!=d.mode.name&&"htmlmixed"==e.getMode().name;if(g&&"javascript"==d.mode.name)p=o+"script";else if(g&&"css"==d.mode.name)p=o+"style";else{var m=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f);if(!m||m.length&&a(e,m,m[m.length-1],u))return t.Pass;p=o+m[m.length-1]}">"!=e.getLine(u.line).charAt(h.end)&&(p+=">"),i[c]=p}if(e.replaceSelections(i),r=e.listSelections(),!l)for(c=0;c<r.length;c++)(c==r.length-1||r[c].head.line<r[c+1].head.line)&&e.indentLine(r[c].head.line)}function i(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;++n)if(t[n]==e)return n;return-1}function a(e,n,r,i,a){if(!t.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,i.line+500),s=t.scanForClosingTag(e,i,null,o);if(!s||s.tag!=r)return!1;for(var l=a?1:0,c=n.length-1;c>=0&&n[c]==r;c--)++l;for(i=s.to,c=1;c<l;c++){var u=t.scanForClosingTag(e,i,null,o);if(!u||u.tag!=r)return!1;i=u.to}return!0}t.commands.closeTag=function(t){return r(t)}}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../fold/xml-fold */"osHv"))},BdwD:
/*!*****************************************!*\
!*** ./src/components/NoData/index.tsx ***!
\*****************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/button/style */"+L6B");var r=n(/*! antd/es/button */"2/Rp"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),o=n(/*! react */"q1tI"),s=n.n(o),l=n(/*! @/assets/images/icons/nodata.png */"FOrL"),c=n.n(l);e.a=function(t){var e=t.buttonProps,n=void 0===e?{}:e,o=t.styles,l=void 0===o?{}:o,u=t.customText,h=t.ButtonText,d=t.ButtonClick,f=t.Buttonclass,p=t.ButtonTwo;return s.a.createElement("section",{className:"tc animated fadeIn",style:Object(a.a)(Object(a.a)({},{color:"#999",margin:"200px auto"}),l)},s.a.createElement("img",{src:c.a}),s.a.createElement("p",{className:"mt20 font14"},u||"暂时还没有相关数据哦!"),h&&s.a.createElement(r.a,Object(i.a)({className:f,onClick:d},n),h),p&&p)}},BjJ7:
/*!*********************************!*\
!*** ./src/pages/tasks/util.js ***!
\*********************************/
/*! exports provided: isCompileOk, getTreeData, processTreeData, debounce, isProd, apiPref */
/*! exports used: apiPref, debounce, getTreeData, isCompileOk, processTreeData */function(t,e,n){"use strict";function r(t){var e=!0;if(t.length>0){for(var n=0;n<t.length;n++)if(0==t[n].compile_success||!t[n].compile_success){e=!1;break}}else e=!1;return e}function i(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],r=0;r<t.length;r++){var i=t[r],a=e?"".concat(e,"/").concat(i.name):"".concat(i.name);n.push({title:i.name,isLeaf:"tree"!==i.type,key:a})}return n}function a(t,e,n){for(var r=0;r<t.length;r++){var i=t[r];if(i.key===e){i.children=n;break}i.children&&a(i.children,e,n)}return t}function o(t,e,n){var r;return function(){var i=this,a=arguments,o=function(){r=null,n||t.apply(i,a)},s=n&&!r;clearTimeout(r),r=setTimeout(o,e),s&&t.apply(i,a)}}n.d(e,"d",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var s=n(/*! @/utils/env */"m3rI").a.API_SERVER},"C+DQ":
/*!*********************************************************!*\
!*** ./src/components/markdown-editor/css/iconfont.css ***!
\*********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},CrYA:
/*!*******************************************************!*\
!*** ./node_modules/store/storages/sessionStorage.js ***!
\*******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ../src/util */"MFOe").Global;function i(){return r.sessionStorage}function a(t){return i().getItem(t)}t.exports={name:"sessionStorage",read:a,write:function(t,e){return i().setItem(t,e)},each:function(t){for(var e=i().length-1;e>=0;e--){var n=i().key(e);t(a(n),n)}},remove:function(t){return i().removeItem(t)},clearAll:function(){return i().clear()}}},D1Df:
/*!************************************************!*\
!*** ./node_modules/qrcode.react/lib/index.js ***!
\************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),t}function h(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?f(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var v=n(/*! react */"q1tI"),y=(n(/*! prop-types */"17x9"),n(/*! qr.js/lib/QRCode */"H38U")),b=n(/*! qr.js/lib/ErrorCorrectLevel */"aRTE");function x(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e+=String.fromCharCode(r):r<2048?(e+=String.fromCharCode(192|r>>6),e+=String.fromCharCode(128|63&r)):r<55296||r>=57344?(e+=String.fromCharCode(224|r>>12),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|63&r)):(n++,r=65536+((1023&r)<<10|1023&t.charCodeAt(n)),e+=String.fromCharCode(240|r>>18),e+=String.fromCharCode(128|r>>12&63),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|63&r))}return e}var S={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function C(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return t.forEach((function(t,r){var i=null;t.forEach((function(a,o){if(!a&&null!==i)return n.push("M".concat(i+e," ").concat(r+e,"h").concat(o-i,"v1H").concat(i+e,"z")),void(i=null);if(o!==t.length-1)a&&null===i&&(i=o);else{if(!a)return;null===i?n.push("M".concat(o+e,",").concat(r+e," h1v1H").concat(o+e,"z")):n.push("M".concat(i+e,",").concat(r+e," h").concat(o+1-i,"v1H").concat(i+e,"z"))}}))})),n.join("")}function E(t,e){return t.slice().map((function(t,n){return n<e.y||n>=e.y+e.h?t:t.map((function(t,n){return(n<e.x||n>=e.x+e.w)&&t}))}))}function w(t,e){var n=t.imageSettings,r=t.size,i=t.includeMargin;if(null==n)return null;var a=i?4:0,o=e.length+2*a,s=Math.floor(.1*r),l=o/r,c=(n.width||s)*l,u=(n.height||s)*l,h=null==n.x?e.length/2-c/2:n.x*l,d=null==n.y?e.length/2-u/2:n.y*l,f=null;if(n.excavate){var p=Math.floor(h),g=Math.floor(d);f={x:p,y:g,w:Math.ceil(c+h-p),h:Math.ceil(u+d-g)}}return{x:h,y:d,h:u,w:c,excavation:f}}var k=function(){try{(new Path2D).addPath(new Path2D)}catch(t){return!1}return!0}(),T=function(t){function e(){var t,n;l(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return m(f(n=h(this,(t=d(e)).call.apply(t,[this].concat(i)))),"_canvas",void 0),m(f(n),"_image",void 0),m(f(n),"state",{imgLoaded:!1}),m(f(n),"handleImageLoad",(function(){n.setState({imgLoaded:!0})})),n}return p(e,t),u(e,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var t=this.props,e=t.value,n=t.size,r=t.level,i=t.bgColor,a=t.fgColor,o=t.includeMargin,s=t.imageSettings,l=new y(-1,b[r]);if(l.addData(x(e)),l.make(),null!=this._canvas){var c=this._canvas,u=c.getContext("2d");if(!u)return;var h=l.modules;if(null===h)return;var d=o?4:0,f=h.length+2*d,p=w(this.props,h);null!=s&&null!=p&&null!=p.excavation&&(h=E(h,p.excavation));var g=window.devicePixelRatio||1;c.height=c.width=n*g;var m=n/f*g;u.scale(m,m),u.fillStyle=i,u.fillRect(0,0,f,f),u.fillStyle=a,k?u.fill(new Path2D(C(h,d))):h.forEach((function(t,e){t.forEach((function(t,n){t&&u.fillRect(n+d,e+d,1,1)}))})),this.state.imgLoaded&&this._image&&null!=p&&u.drawImage(this._image,p.x+d,p.y+d,p.w,p.h)}}},{key:"render",value:function(){var t=this,e=this.props,n=(e.value,e.size),r=(e.level,e.bgColor,e.fgColor,e.style),a=(e.includeMargin,e.imageSettings),l=s(e,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),c=o({height:n,width:n},r),u=null,h=a&&a.src;return null!=a&&null!=h&&(u=v.createElement("img",{src:h,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(e){return t._image=e}})),v.createElement(v.Fragment,null,v.createElement("canvas",i({style:c,height:n,width:n,ref:function(e){return t._canvas=e}},l)),u)}}]),e}(v.PureComponent);m(T,"defaultProps",S);var O=function(t){function e(){return l(this,e),h(this,d(e).apply(this,arguments))}return p(e,t),u(e,[{key:"render",value:function(){var t=this.props,e=t.value,n=t.size,r=t.level,a=t.bgColor,o=t.fgColor,l=t.includeMargin,c=t.imageSettings,u=s(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),h=new y(-1,b[r]);h.addData(x(e)),h.make();var d=h.modules;if(null===d)return null;var f=l?4:0,p=d.length+2*f,g=w(this.props,d),m=null;null!=c&&null!=g&&(null!=g.excavation&&(d=E(d,g.excavation)),m=v.createElement("image",{xlinkHref:c.src,height:g.h,width:g.w,x:g.x+f,y:g.y+f,preserveAspectRatio:"none"}));var S=C(d,f);return v.createElement("svg",i({shapeRendering:"crispEdges",height:n,width:n,viewBox:"0 0 ".concat(p," ").concat(p)},u),v.createElement("path",{fill:a,d:"M0,0 h".concat(p,"v").concat(p,"H0z")}),v.createElement("path",{fill:o,d:S}),m)}}]),e}(v.PureComponent);m(O,"defaultProps",S);var A=function(t){var e=t.renderAs,n=s(t,["renderAs"]),r="svg"===e?O:T;return v.createElement(r,n)};A.defaultProps=o({renderAs:"canvas"},S),t.exports=A},DlQD:
/*!*******************************************!*\
!*** ./node_modules/marked/lib/marked.js ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function n(t,n){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}var r=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){function e(){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}}t.exports={defaults:{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},getDefaults:e,changeDefaults:function(e){t.exports.defaults=e}}})),i=(r.defaults,r.getDefaults,r.changeDefaults,/[&<>"']/),a=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=function(t){return l[t]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(t){return t.replace(u,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var d=/(^|[^\[])\^/g,f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,g={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(t,e){g[" "+t]||(m.test(t)?g[" "+t]=t+"/":g[" "+t]=x(t,"/",!0));var n=-1===(t=g[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(v,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(y,"$1")+e:t+e}function x(t,e,n){var r=t.length;if(0===r)return"";for(var i=0;i<r;){var a=t.charAt(r-i-1);if(a!==e||n){if(a===e||!n)break;i++}else i++}return t.substr(0,r-i)}var S=function(t,e){if(e){if(i.test(t))return t.replace(a,c)}else if(o.test(t))return t.replace(s,c);return t},C=h,E=function(t,e){t=t.source||t,e=e||"";var n={replace:function(e,r){return r=(r=r.source||r).replace(d,"$1"),t=t.replace(e,r),n},getRegex:function(){return new RegExp(t,e)}};return n},w=function(t,e,n){if(t){var r;try{r=decodeURIComponent(h(n)).replace(f,"").toLowerCase()}catch(t){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}e&&!p.test(n)&&(n=b(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},k={exec:function(){}},T=function(t){for(var e,n,r=1;r<arguments.length;r++)for(n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},O=function(t,e){var n=t.replace(/\|/g,(function(t,e,n){for(var r=!1,i=e;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},A=x,L=function(t,e){if(-1===t.indexOf(e[1]))return-1;for(var n=t.length,r=0,i=0;i<n;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&--r<0)return i;return-1},D=function(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},R=r.defaults,I=A,_=O,M=S,N=L;function P(t,e,n){var r=e.href,i=e.title?M(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");return"!"!==t[0].charAt(0)?{type:"link",raw:n,href:r,title:i,text:a}:{type:"image",raw:n,href:r,title:i,text:M(a)}}var F=function(){function t(t){this.options=t||R}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var n=this.rules.block.code.exec(t);if(n){var r=e[e.length-1];if(r&&"paragraph"===r.type)return{raw:n[0],text:n[0].trimRight()};var i=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:I(i,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],r=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var r=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=r.length?t.slice(r.length):t})).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:r}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:_(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=_(n.cells[r],n.header.length);return n}}},e.hr=function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}},e.blockquote=function(t){var e=this.rules.block.blockquote.exec(t);if(e){var n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){for(var n,r,i,a,o,s,l,c=e[0],u=e[2],h=u.length>1,d=")"===u[u.length-1],f={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},p=e[0].match(this.rules.block.item),g=!1,m=p.length,v=0;v<m;v++)c=n=p[v],r=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) */,"")).indexOf("\n ")&&(r-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+r+"}","gm"),"")),v!==m-1&&(i=this.rules.block.bullet.exec(p[v+1])[0],(h?1===i.length||!d&&")"===i[i.length-1]:i.length>1||this.options.smartLists&&i!==u)&&(a=p.slice(v+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-a.length),v=m-1)),o=g||/\n\n(?!\s*$)/.test(n),v!==m-1&&(g="\n"===n.charAt(n.length-1),o||(o=g)),o&&(f.loose=!0),l=void 0,(s=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:c,task:s,checked:l,loose:o,text:n});return f}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):M(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:_(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=_(n.cells[r].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},e.lheading=function(t){var e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1]}},e.paragraph=function(t){var e=this.rules.block.paragraph.exec(t);if(e)return{type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1]}},e.text=function(t,e){var n=this.rules.block.text.exec(t);if(n){var r=e[e.length-1];return r&&"text"===r.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}},e.escape=function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:M(e[1])}},e.tag=function(t,e,n){var r=this.rules.inline.tag.exec(t);if(r)return!e&&/^<a /i.test(r[0])?e=!0:e&&/^<\/a>/i.test(r[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):M(r[0]):r[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=N(e[2],"()");if(n>-1){var r=(0===e[0].indexOf("!")?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,r).trim(),e[3]=""}var i=e[2],a="";if(this.options.pedantic){var o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);o?(i=o[1],a=o[3]):a=""}else a=e[3]?e[3].slice(1,-1):"";return P(e,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:a?a.replace(this.rules.inline._escapes,"$1"):a},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=e[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return P(n,r,n[0])}},e.strong=function(t,e,n){void 0===n&&(n="");var r=this.rules.inline.strong.start.exec(t);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var i,a="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(a.lastIndex=0;null!=(r=a.exec(e));)if(i=this.rules.inline.strong.middle.exec(e.slice(0,r.index+3)))return{type:"strong",raw:t.slice(0,i[0].length),text:t.slice(2,i[0].length-2)}}},e.em=function(t,e,n){void 0===n&&(n="");var r=this.rules.inline.em.start.exec(t);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var i,a="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(a.lastIndex=0;null!=(r=a.exec(e));)if(i=this.rules.inline.em.middle.exec(e.slice(0,r.index+2)))return{type:"em",raw:t.slice(0,i[0].length),text:t.slice(1,i[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=n.startsWith(" ")&&n.endsWith(" ");return r&&i&&(n=n.substring(1,n.length-1)),n=M(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[1]}},e.autolink=function(t,e){var n,r,i=this.rules.inline.autolink.exec(t);if(i)return r="@"===i[2]?"mailto:"+(n=M(this.options.mangle?e(i[1]):i[1])):n=M(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var r,i;if("@"===n[2])i="mailto:"+(r=M(this.options.mangle?e(n[0]):n[0]));else{var a;do{a=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(a!==n[0]);r=M(n[0]),i="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}},e.inlineText=function(t,e,n){var r,i=this.rules.inline.text.exec(t);if(i)return r=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):M(i[0]):i[0]:M(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}},t}(),j=k,B=E,U=T,H={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=B(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=B(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=B(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._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",H._comment=/<!--(?!-?>)[\s\S]*?-->/,H.html=B(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=B(H._paragraph).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=B(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=U({},H),H.gfm=U({},H.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*|$)"}),H.gfm.nptable=B(H.gfm.nptable).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=B(H.gfm.table).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=U({},H.normal,{html:B("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:j,paragraph:B(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var G={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};G.punctuation=B(G.punctuation).replace(/punctuation/g,G._punctuation).getRegex(),G._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",G._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",G.em.start=B(G.em.start).replace(/punctuation/g,G._punctuation).getRegex(),G.em.middle=B(G.em.middle).replace(/punctuation/g,G._punctuation).replace(/overlapSkip/g,G._overlapSkip).getRegex(),G.em.endAst=B(G.em.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.em.endUnd=B(G.em.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.start=B(G.strong.start).replace(/punctuation/g,G._punctuation).getRegex(),G.strong.middle=B(G.strong.middle).replace(/punctuation/g,G._punctuation).replace(/blockSkip/g,G._blockSkip).getRegex(),G.strong.endAst=B(G.strong.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.endUnd=B(G.strong.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.blockSkip=B(G._blockSkip,"g").getRegex(),G.overlapSkip=B(G._overlapSkip,"g").getRegex(),G._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,G._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,G._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])?)+(?![-_])/,G.autolink=B(G.autolink).replace("scheme",G._scheme).replace("email",G._email).getRegex(),G._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,G.tag=B(G.tag).replace("comment",H._comment).replace("attribute",G._attribute).getRegex(),G._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,G._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,G.link=B(G.link).replace("label",G._label).replace("href",G._href).replace("title",G._title).getRegex(),G.reflink=B(G.reflink).replace("label",G._label).getRegex(),G.reflinkSearch=B(G.reflinkSearch,"g").replace("reflink",G.reflink).replace("nolink",G.nolink).getRegex(),G.normal=U({},G),G.pedantic=U({},G.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:B(/^!?\[(label)\]\((.*?)\)/).replace("label",G._label).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",G._label).getRegex()}),G.gfm=U({},G.normal,{escape:B(G.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),G.gfm.url=B(G.gfm.url,"i").replace("email",G.gfm._extended_email).getRegex(),G.breaks=U({},G.gfm,{br:B(G.br).replace("{2,}","*").getRegex(),text:B(G.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var z={block:H,inline:G},W=r.defaults,V=z.block,K=z.inline;function q(t){return t.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Y(t){var e,n,r="",i=t.length;for(e=0;e<i;e++)n=t.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var X=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||W,this.options.tokenizer=this.options.tokenizer||new F,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:V.normal,inline:K.normal};this.options.pedantic?(e.block=V.pedantic,e.inline=K.pedantic):this.options.gfm&&(e.block=V.gfm,this.options.breaks?e.inline=K.breaks:e.inline=K.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)};var n,r,i,a=e.prototype;return a.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},a.blockTokens=function(t,e,n){var r,i,a,o;for(void 0===e&&(e=[]),void 0===n&&(n=!0),t=t.replace(/^ +$/gm,"");t;)if(r=this.tokenizer.space(t))t=t.substring(r.raw.length),r.type&&e.push(r);else if(r=this.tokenizer.code(t,e))t=t.substring(r.raw.length),r.type?e.push(r):((o=e[e.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(r=this.tokenizer.fences(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.heading(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.nptable(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.hr(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.blockquote(t))t=t.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),e.push(r);else if(r=this.tokenizer.list(t)){for(t=t.substring(r.raw.length),a=r.items.length,i=0;i<a;i++)r.items[i].tokens=this.blockTokens(r.items[i].text,[],!1);e.push(r)}else if(r=this.tokenizer.html(t))t=t.substring(r.raw.length),e.push(r);else if(n&&(r=this.tokenizer.def(t)))t=t.substring(r.raw.length),this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});else if(r=this.tokenizer.table(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.lheading(t))t=t.substring(r.raw.length),e.push(r);else if(n&&(r=this.tokenizer.paragraph(t)))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.text(t,e))t=t.substring(r.raw.length),r.type?e.push(r):((o=e[e.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(t){var s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return e},a.inline=function(t){var e,n,r,i,a,o,s=t.length;for(e=0;e<s;e++)switch((o=t[e]).type){case"paragraph":case"text":case"heading":o.tokens=[],this.inlineTokens(o.text,o.tokens);break;case"table":for(o.tokens={header:[],cells:[]},i=o.header.length,n=0;n<i;n++)o.tokens.header[n]=[],this.inlineTokens(o.header[n],o.tokens.header[n]);for(i=o.cells.length,n=0;n<i;n++)for(a=o.cells[n],o.tokens.cells[n]=[],r=0;r<a.length;r++)o.tokens.cells[n][r]=[],this.inlineTokens(a[r],o.tokens.cells[n][r]);break;case"blockquote":this.inline(o.tokens);break;case"list":for(i=o.items.length,n=0;n<i;n++)this.inline(o.items[n].tokens)}return t},a.inlineTokens=function(t,e,n,r,i){var a;void 0===e&&(e=[]),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i="");var o,s=t;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(s));)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(a=this.tokenizer.escape(t))t=t.substring(a.raw.length),e.push(a);else if(a=this.tokenizer.tag(t,n,r))t=t.substring(a.raw.length),n=a.inLink,r=a.inRawBlock,e.push(a);else if(a=this.tokenizer.link(t))t=t.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),e.push(a);else if(a=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),e.push(a);else if(a=this.tokenizer.strong(t,s,i))t=t.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),e.push(a);else if(a=this.tokenizer.em(t,s,i))t=t.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),e.push(a);else if(a=this.tokenizer.codespan(t))t=t.substring(a.raw.length),e.push(a);else if(a=this.tokenizer.br(t))t=t.substring(a.raw.length),e.push(a);else if(a=this.tokenizer.del(t))t=t.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),e.push(a);else if(a=this.tokenizer.autolink(t,Y))t=t.substring(a.raw.length),e.push(a);else if(n||!(a=this.tokenizer.url(t,Y))){if(a=this.tokenizer.inlineText(t,r,q))t=t.substring(a.raw.length),i=a.raw.slice(-1),e.push(a);else if(t){var c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else t=t.substring(a.raw.length),e.push(a);return e},n=e,i=[{key:"rules",get:function(){return{block:V,inline:K}}}],(r=null)&&t(n.prototype,r),i&&t(n,i),e}(),$=r.defaults,J=w,Z=S,Q=function(){function t(t){this.options=t||$}var e=t.prototype;return e.code=function(t,e,n){var r=(e||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(t,r);null!=i&&i!==t&&(n=!0,t=i)}return r?'<pre><code class="'+this.options.langPrefix+Z(r,!0)+'">'+(n?t:Z(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:Z(t,!0))+"</code></pre>\n"},e.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},e.html=function(t){return t},e.heading=function(t,e,n,r){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+r.slug(n)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},e.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.list=function(t,e,n){var r=e?"ol":"ul";return"<"+r+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+r+">\n"},e.listitem=function(t){return"<li>"+t+"</li>\n"},e.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},e.paragraph=function(t){return"<p>"+t+"</p>\n"},e.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},e.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"},e.strong=function(t){return"<strong>"+t+"</strong>"},e.em=function(t){return"<em>"+t+"</em>"},e.codespan=function(t){return"<code>"+t+"</code>"},e.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.del=function(t){return"<del>"+t+"</del>"},e.link=function(t,e,n){if(null===(t=J(this.options.sanitize,this.options.baseUrl,t)))return n;var r='<a href="'+Z(t)+'"';return e&&(r+=' title="'+e+'"'),r+=">"+n+"</a>"},e.image=function(t,e,n){if(null===(t=J(this.options.sanitize,this.options.baseUrl,t)))return n;var r='<img src="'+t+'" alt="'+n+'"';return e&&(r+=' title="'+e+'"'),r+=this.options.xhtml?"/>":">"},e.text=function(t){return t},t}(),tt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),et=function(){function t(){this.seen={}}return t.prototype.slug=function(t){var e=t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var n=e;do{this.seen[n]++,e=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},t}(),nt=r.defaults,rt=C,it=function(){function t(t){this.options=t||nt,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new et}t.parse=function(e,n){return new t(n).parse(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,r,i,a,o,s,l,c,u,h,d,f,p,g,m,v,y,b,x="",S=t.length;for(n=0;n<S;n++)switch((h=t[n]).type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(h.tokens),h.depth,rt(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(c="",l="",a=h.header.length,r=0;r<a;r++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[r]),{header:!0,align:h.align[r]});for(c+=this.renderer.tablerow(l),u="",a=h.cells.length,r=0;r<a;r++){for(l="",o=(s=h.tokens.cells[r]).length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(s[i]),{header:!1,align:h.align[i]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(h.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,a=h.items.length,u="",r=0;r<a;r++)v=(m=h.items[r]).checked,y=m.task,g="",m.task&&(b=this.renderer.checkbox(v),p?m.tokens.length>0&&"text"===m.tokens[0].type?(m.tokens[0].text=b+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=b+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:b}):g+=b),g+=this.parse(m.tokens,p),u+=this.renderer.listitem(g,y,v);x+=this.renderer.list(u,d,f);continue;case"html":x+=this.renderer.html(h.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1<S&&"text"===t[n+1].type;)u+="\n"+((h=t[++n]).tokens?this.parseInline(h.tokens):h.text);x+=e?this.renderer.paragraph(u):u;continue;default:var C='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(C);throw new Error(C)}return x},e.parseInline=function(t,e){e=e||this.renderer;var n,r,i="",a=t.length;for(n=0;n<a;n++)switch((r=t[n]).type){case"escape":i+=e.text(r.text);break;case"html":i+=e.html(r.text);break;case"link":i+=e.link(r.href,r.title,this.parseInline(r.tokens,e));break;case"image":i+=e.image(r.href,r.title,r.text);break;case"strong":i+=e.strong(this.parseInline(r.tokens,e));break;case"em":i+=e.em(this.parseInline(r.tokens,e));break;case"codespan":i+=e.codespan(r.text);break;case"br":i+=e.br();break;case"del":i+=e.del(this.parseInline(r.tokens,e));break;case"text":i+=e.text(r.text);break;default:var o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(o);throw new Error(o)}return i},t}(),at=T,ot=D,st=S,lt=r.getDefaults,ct=r.changeDefaults,ut=r.defaults;function ht(t,e,n){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(n=e,e=null),e=at({},ht.defaults,e||{}),ot(e),n){var r,i=e.highlight;try{r=X.lex(t,e)}catch(t){return n(t)}var a=function(t){var a;if(!t)try{a=it.parse(r,e)}catch(e){t=e}return e.highlight=i,t?n(t):n(null,a)};if(!i||i.length<3)return a();if(delete e.highlight,!r.length)return a();var o=0;return ht.walkTokens(r,(function(t){"code"===t.type&&(o++,setTimeout((function(){i(t.text,t.lang,(function(e,n){if(e)return a(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),0==--o&&a()}))}),0))})),void(0===o&&a())}try{var s=X.lex(t,e);return e.walkTokens&&ht.walkTokens(s,e.walkTokens),it.parse(s,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+st(t.message+"",!0)+"</pre>";throw t}}return ht.options=ht.setOptions=function(t){return at(ht.defaults,t),ct(ht.defaults),ht},ht.getDefaults=lt,ht.defaults=ut,ht.use=function(t){var e=at({},t);if(t.renderer&&function(){var n=ht.defaults.renderer||new Q,r=function(e){var r=n[e];n[e]=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=t.renderer[e].apply(n,a);return!1===s&&(s=r.apply(n,a)),s}};for(var i in t.renderer)r(i);e.renderer=n}(),t.tokenizer&&function(){var n=ht.defaults.tokenizer||new F,r=function(e){var r=n[e];n[e]=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=t.tokenizer[e].apply(n,a);return!1===s&&(s=r.apply(n,a)),s}};for(var i in t.tokenizer)r(i);e.tokenizer=n}(),t.walkTokens){var n=ht.defaults.walkTokens;e.walkTokens=function(e){t.walkTokens(e),n&&n(e)}}ht.setOptions(e)},ht.walkTokens=function(t,e){for(var r,i=n(t);!(r=i()).done;){var a=r.value;switch(e(a),a.type){case"table":for(var o,s=n(a.tokens.header);!(o=s()).done;){var l=o.value;ht.walkTokens(l,e)}for(var c,u=n(a.tokens.cells);!(c=u()).done;)for(var h,d=n(c.value);!(h=d()).done;){var f=h.value;ht.walkTokens(f,e)}break;case"list":ht.walkTokens(a.items,e);break;default:a.tokens&&ht.walkTokens(a.tokens,e)}}},ht.Parser=it,ht.parser=it.parse,ht.Renderer=Q,ht.TextRenderer=tt,ht.Lexer=X,ht.lexer=X.lex,ht.Tokenizer=F,ht.Slugger=et,ht.parse=ht,ht}()},"DlR+":
/*!******************************************************!*\
!*** ./node_modules/store/storages/cookieStorage.js ***!
\******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ../src/util */"MFOe"),i=r.Global,a=r.trim;t.exports={name:"cookieStorage",read:function(t){if(!t||!c(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(o.cookie.replace(new RegExp(e),"$1"))},write:function(t,e){if(!t)return;o.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"},each:s,remove:l,clearAll:function(){s((function(t,e){l(e)}))}};var o=i.document;function s(t){for(var e=o.cookie.split(/; ?/g),n=e.length-1;n>=0;n--)if(a(e[n])){var r=e[n].split("="),i=unescape(r[0]);t(unescape(r[1]),i)}}function l(t){t&&c(t)&&(o.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function c(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(o.cookie)}},EHPI:
/*!*******************************************************!*\
!*** ./src/pages/Problems/OjForm/CodePanel/index.tsx ***!
\*******************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/drawer/style */"bbsP");var r,i=n(/*! antd/es/drawer */"/wGt"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! @/components/monaco-editor */"ZW9T"),u=n(/*! @/components/tpi-code-setting/CodeSetting */"ZD9Y"),h=n(/*! @/components/modal */"M8RZ"),d=n(/*! @/utils/urlTool */"bCnd"),f=(n(/*! ./index.less */"fcyK"),{theme:Object(d.a)("cmCodeMode","vs-dark"),fontSize:Object(d.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(d.a)("cmTabToSpace",!0)});function p(t,e){switch(e.type){case r.set_show_editor_setting:return Object(o.a)(Object(o.a)({},t),{},{showEditorSetting:e.payload});case r.set_theme:return Object(o.a)(Object(o.a)({},t),{},{theme:e.payload});case r.set_font_size:return Object(o.a)(Object(o.a)({},t),{},{fontSize:e.payload});case r.on_tab_to_space:return Object(o.a)(Object(o.a)({},t),{},{tabToSpace:e.payload});default:throw new Error}}function g(t){var e=t.onShowCodeSetting;return l.a.createElement("div",{className:"action-bar"},l.a.createElement("span",null,"学员初始代码文件"),l.a.createElement("a",{onClick:e},l.a.createElement("i",{className:"iconfont icon-shezhi"})))}!function(t){t[t.set_font_size=0]="set_font_size",t[t.set_theme=1]="set_theme",t[t.on_tab_to_space=2]="on_tab_to_space",t[t.set_show_editor_setting=3]="set_show_editor_setting"}(r||(r={})),e.a=function(t){var e=t.value,n=t.onChange,o=t.language,m=t.ActionBarRender,v=void 0===m?function(t){return l.a.createElement(g,{onShowCodeSetting:t})}:m,y=Object(s.useReducer)(p,f),b=Object(a.a)(y,2),x=b[0],S=b[1],C=x.theme,E=x.fontSize,w=x.showEditorSetting,k=x.tabToSpace,T={onFontSizeChange:function(t){S({type:r.set_font_size,payload:t}),Object(d.b)("cmFontSize",t)},tabToSpace:k,cmFontSize:E,className:"oj",cmCodeMode:C,onTabToSpace:function(t){S({type:r.on_tab_to_space,payload:t}),Object(d.b)("cmTabToSpace",t)},onCodeModeChange:function(t){S({type:r.set_theme,payload:t}),Object(d.b)("cmCodeMode",t)}};var O={value:e,language:o,onChange:n,theme:C,height:"calc(100% - 56px)",options:{fontSize:E,insertSpaces:k}};return l.a.createElement(s.Fragment,null,l.a.createElement("div",{className:"code-panel-container"},v((function(){S({type:r.set_show_editor_setting,payload:!0})})),l.a.createElement(c.b,O)),l.a.createElement(h.a,null,l.a.createElement(i.a,{className:"oj",title:null,placement:"right",closable:!1,visible:w,onClose:function(){S({type:r.set_show_editor_setting,payload:!1})}},l.a.createElement(u.a,T))))}},ELLl:
/*!*************************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closebrackets.js ***!
\*************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){var e={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=t.Pos;function r(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,o){o&&o!=t.Init&&(e.removeKeyMap(i),e.state.closeBrackets=null),n&&(a(r(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(i))}));var i={Backspace:function(e){var i=s(e);if(!i||e.getOption("disableInput"))return t.Pass;for(var a=r(i,"pairs"),o=e.listSelections(),c=0;c<o.length;c++){if(!o[c].empty())return t.Pass;var u=l(e,o[c].head);if(!u||a.indexOf(u)%2!=0)return t.Pass}for(c=o.length-1;c>=0;c--){var h=o[c].head;e.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(e){var n=s(e),i=n&&r(n,"explode");if(!i||e.getOption("disableInput"))return t.Pass;for(var a=e.listSelections(),o=0;o<a.length;o++){if(!a[o].empty())return t.Pass;var c=l(e,a[o].head);if(!c||i.indexOf(c)%2!=0)return t.Pass}e.operation((function(){var t=e.lineSeparator()||"\n";e.replaceSelection(t+t,null),e.execCommand("goCharLeft"),a=e.listSelections();for(var n=0;n<a.length;n++){var r=a[n].head.line;e.indentLine(r,null,!0),e.indentLine(r+1,null,!0)}}))}};function a(t){for(var e=0;e<t.length;e++){var n=t.charAt(e),r="'"+n+"'";i[r]||(i[r]=o(n))}}function o(e){return function(i){return function(e,i){var a=s(e);if(!a||e.getOption("disableInput"))return t.Pass;var o=r(a,"pairs"),l=o.indexOf(i);if(-1==l)return t.Pass;for(var u,h=r(a,"closeBefore"),d=r(a,"triples"),f=o.charAt(l+1)==i,p=e.listSelections(),g=l%2==0,m=0;m<p.length;m++){var v,y=p[m],b=y.head,x=e.getRange(b,n(b.line,b.ch+1));if(g&&!y.empty())v="surround";else if(!f&&g||x!=i)if(f&&b.ch>1&&d.indexOf(i)>=0&&e.getRange(n(b.line,b.ch-2),b)==i+i){if(b.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(b.line,b.ch-2))))return t.Pass;v="addFour"}else if(f){var S=0==b.ch?" ":e.getRange(n(b.line,b.ch-1),b);if(t.isWordChar(x)||S==i||t.isWordChar(S))return t.Pass;v="both"}else{if(!g||!(0===x.length||/\s/.test(x)||h.indexOf(x)>-1))return t.Pass;v="both"}else v=f&&c(e,b)?"both":d.indexOf(i)>=0&&e.getRange(b,n(b.line,b.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=v)return t.Pass}else u=v}var C=l%2?o.charAt(l-1):i,E=l%2?i:o.charAt(l+1);e.operation((function(){if("skip"==u)e.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)e.execCommand("goCharRight");else if("surround"==u){var i=e.getSelections();for(r=0;r<i.length;r++)i[r]=C+i[r]+E;for(e.replaceSelections(i,"around"),i=e.listSelections().slice(),r=0;r<i.length;r++)i[r]=(a=i[r],o=void 0,o=t.cmpPos(a.anchor,a.head)>0,{anchor:new n(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new n(a.head.line,a.head.ch+(o?1:-1))});e.setSelections(i)}else"both"==u?(e.replaceSelection(C+E,null),e.triggerElectric(C+E),e.execCommand("goCharLeft")):"addFour"==u&&(e.replaceSelection(C+C+C+C,"before"),e.execCommand("goCharRight"));var a,o}))}(i,e)}}function s(t){var e=t.state.closeBrackets;return!e||e.override?e:t.getModeAt(t.getCursor()).closeBrackets||e}function l(t,e){var r=t.getRange(n(e.line,e.ch-1),n(e.line,e.ch+1));return 2==r.length?r:null}function c(t,e){var r=t.getTokenAt(n(e.line,e.ch+1));return/\bstring/.test(r.type)&&r.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}a(e.pairs+"`")}(n(/*! ../../lib/codemirror */"VrN/"))},FOrL:
/*!********************************************!*\
!*** ./src/assets/images/icons/nodata.png ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/nodata.a6b3f948.png"},Gytx:
/*!********************************************!*\
!*** ./node_modules/shallowequal/index.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports=function(t,e,n,r){var i=n?n.call(r,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var a=Object.keys(t),o=Object.keys(e);if(a.length!==o.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<a.length;l++){var c=a[l];if(!s(c))return!1;var u=t[c],h=e[c];if(!1===(i=n?n.call(r,u,h,c):void 0)||void 0===i&&u!==h)return!1}return!0}},H2Ag:
/*!**********************************************************!*\
!*** ./src/pages/MyProblem/LeftPanel/index.less?modules ***!
\**********************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={"left-panel":"left-panel___19pOi","tab-panel-body":"tab-panel-body___1Wa4B","s-navs":"s-navs___Rtxdn","bg-white":"bg-white___3Or1a",active:"active___x-fRG"}},H38U:
/*!******************************************!*\
!*** ./node_modules/qr.js/lib/QRCode.js ***!
\******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./8BitByte */"f4xo"),i=n(/*! ./RSBlock */"rcnY"),a=n(/*! ./BitBuffer */"wU8J"),o=n(/*! ./util */"Iq15"),s=n(/*! ./Polynomial */"dWSS");function l(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var c=l.prototype;c.addData=function(t){var e=new r(t);this.dataList.push(e),this.dataCache=null},c.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},c.getModuleCount=function(){return this.moduleCount},c.make=function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=i.getRSBlocks(t,this.errorCorrectLevel),n=new a,r=0,s=0;s<e.length;s++)r+=e[s].dataCount;for(s=0;s<this.dataList.length;s++){var l=this.dataList[s];n.put(l.mode,4),n.put(l.getLength(),o.getLengthInBits(l.mode,t)),l.write(n)}if(n.getLengthInBits()<=8*r)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())},c.makeImpl=function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},c.setupPositionProbePattern=function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},c.getBestMaskPattern=function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=o.getLostPoint(this);(0==n||t>r)&&(t=r,e=n)}return e},c.createMovieClip=function(t,e,n){var r=t.createEmptyMovieClip(e,n);this.make();for(var i=0;i<this.modules.length;i++)for(var a=1*i,o=0;o<this.modules[i].length;o++){var s=1*o;this.modules[i][o]&&(r.beginFill(0,100),r.moveTo(s,a),r.lineTo(s+1,a),r.lineTo(s+1,a+1),r.lineTo(s,a+1),r.endFill())}return r},c.setupTimingPattern=function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},c.setupPositionAdjustPattern=function(){for(var t=o.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var r=t[e],i=t[n];if(null==this.modules[r][i])for(var a=-2;a<=2;a++)for(var s=-2;s<=2;s++)this.modules[r+a][i+s]=-2==a||2==a||-2==s||2==s||0==a&&0==s}},c.setupTypeNumber=function(t){for(var e=o.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!t&&1==(e>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!t&&1==(e>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},c.setupTypeInfo=function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=o.getBCHTypeInfo(n),i=0;i<15;i++){var a=!t&&1==(r>>i&1);i<6?this.modules[i][8]=a:i<8?this.modules[i+1][8]=a:this.modules[this.moduleCount-15+i][8]=a}for(i=0;i<15;i++){a=!t&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=a:i<9?this.modules[8][15-i-1+1]=a:this.modules[8][15-i-1]=a}this.modules[this.moduleCount-8][8]=!t},c.mapData=function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,a=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var l=0;l<2;l++)if(null==this.modules[r][s-l]){var c=!1;a<t.length&&(c=1==(t[a]>>>i&1)),o.getMask(e,r,s-l)&&(c=!c),this.modules[r][s-l]=c,-1==--i&&(a++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(t,e,n){for(var r=i.getRSBlocks(t,e),s=new a,c=0;c<n.length;c++){var u=n[c];s.put(u.mode,4),s.put(u.getLength(),o.getLengthInBits(u.mode,t)),u.write(s)}var h=0;for(c=0;c<r.length;c++)h+=r[c].dataCount;if(s.getLengthInBits()>8*h)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*h+")");for(s.getLengthInBits()+4<=8*h&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*h||(s.put(l.PAD0,8),s.getLengthInBits()>=8*h));)s.put(l.PAD1,8);return l.createBytes(s,r)},l.createBytes=function(t,e){for(var n=0,r=0,i=0,a=new Array(e.length),l=new Array(e.length),c=0;c<e.length;c++){var u=e[c].dataCount,h=e[c].totalCount-u;r=Math.max(r,u),i=Math.max(i,h),a[c]=new Array(u);for(var d=0;d<a[c].length;d++)a[c][d]=255&t.buffer[d+n];n+=u;var f=o.getErrorCorrectPolynomial(h),p=new s(a[c],f.getLength()-1).mod(f);l[c]=new Array(f.getLength()-1);for(d=0;d<l[c].length;d++){var g=d+p.getLength()-l[c].length;l[c][d]=g>=0?p.get(g):0}}var m=0;for(d=0;d<e.length;d++)m+=e[d].totalCount;var v=new Array(m),y=0;for(d=0;d<r;d++)for(c=0;c<e.length;c++)d<a[c].length&&(v[y++]=a[c][d]);for(d=0;d<i;d++)for(c=0;c<e.length;c++)d<l[c].length&&(v[y++]=l[c][d]);return v},t.exports=l},HmJG:
/*!****************************************************************!*\
!*** ./src/components/markdown-editor/upload-image/index.less ***!
\****************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},I8Z2:
/*!**********************************************************!*\
!*** ./node_modules/mini-store/esm/index.js + 3 modules ***!
\**********************************************************/
/*! exports provided: Provider, connect, create */
/*! exports used: Provider, connect, create */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return v}));var r,i=n("q1tI"),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=i.createContext(null),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.render=function(){return i.createElement(o.Provider,{value:this.props.store},this.props.children)},e}(i.Component),l=n("Gytx"),c=n.n(l),u=n("2mql"),h=n.n(u),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var p=function(){return{}};function g(t,e){void 0===e&&(e={});var n=!!t,r=t||p;return function(a){var s=function(e){function s(t,n){var i=e.call(this,t,n)||this;return i.unsubscribe=null,i.handleChange=function(){if(i.unsubscribe){var t=r(i.store.getState(),i.props);i.setState({subscribed:t})}},i.store=i.context,i.state={subscribed:r(i.store.getState(),t),store:i.store,props:t},i}return d(s,e),s.getDerivedStateFromProps=function(e,n){return t&&2===t.length&&e!==n.props?{subscribed:r(n.store.getState(),e),props:e}:{props:e}},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},s.prototype.shouldComponentUpdate=function(t,e){return!c()(this.props,t)||!c()(this.state.subscribed,e.subscribed)},s.prototype.trySubscribe=function(){n&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},s.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},s.prototype.render=function(){var t=f(f(f({},this.props),this.state.subscribed),{store:this.store});return i.createElement(a,f({},t,{ref:this.props.miniStoreForwardedRef}))},s.displayName="Connect("+function(t){return t.displayName||t.name||"Component"}(a)+")",s.contextType=o,s}(i.Component);if(e.forwardRef){var l=i.forwardRef((function(t,e){return i.createElement(s,f({},t,{miniStoreForwardedRef:e}))}));return h()(l,a)}return h()(s,a)}}var m=function(){return(m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function v(t){var e=t,n=[];return{setState:function(t){e=m(m({},e),t);for(var r=0;r<n.length;r++)n[r]()},getState:function(){return e},subscribe:function(t){return n.push(t),function(){var e=n.indexOf(t);n.splice(e,1)}}}}},IBYe:
/*!**************************************************!*\
!*** ./node_modules/rc-table/es/sugar/Column.js ***!
\**************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";e.a=function(t){return null}},Iq15:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/util.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./mode */"nVVt"),i=n(/*! ./Polynomial */"dWSS"),a=n(/*! ./math */"dQei"),o=0,s=1,l=2,c=3,u=4,h=5,d=6,f=7,p={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;p.getBCHDigit(e)-p.getBCHDigit(p.G15)>=0;)e^=p.G15<<p.getBCHDigit(e)-p.getBCHDigit(p.G15);return(t<<10|e)^p.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;p.getBCHDigit(e)-p.getBCHDigit(p.G18)>=0;)e^=p.G18<<p.getBCHDigit(e)-p.getBCHDigit(p.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return p.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case o:return(e+n)%2==0;case s:return e%2==0;case l:return n%3==0;case c:return(e+n)%3==0;case u:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case h:return e*n%2+e*n%3==0;case d:return(e*n%2+e*n%3)%2==0;case f:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new i([1],0),n=0;n<t;n++)e=e.multiply(new i([1,a.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:case r.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var a=0,o=t.isDark(r,i),s=-1;s<=1;s++)if(!(r+s<0||e<=r+s))for(var l=-1;l<=1;l++)i+l<0||e<=i+l||0==s&&0==l||o==t.isDark(r+s,i+l)&&a++;a>5&&(n+=3+a-5)}for(r=0;r<e-1;r++)for(i=0;i<e-1;i++){var c=0;t.isDark(r,i)&&c++,t.isDark(r+1,i)&&c++,t.isDark(r,i+1)&&c++,t.isDark(r+1,i+1)&&c++,0!=c&&4!=c||(n+=3)}for(r=0;r<e;r++)for(i=0;i<e-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(i=0;i<e;i++)for(r=0;r<e-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);var u=0;for(i=0;i<e;i++)for(r=0;r<e;r++)t.isDark(r,i)&&u++;return n+=10*(Math.abs(100*u/e/e-50)/5)}};t.exports=p},IxHN:
/*!******************************************!*\
!*** ./src/components/Spinner/index.tsx ***!
\******************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r=n(/*! react */"q1tI"),i=n.n(r),a=n(/*! ./index.less?modules */"07cG"),o=n.n(a);e.a=function(t){var e=t.message,n=t.className,r=t.children,a=t.style,s=void 0===a?{}:a;return i.a.createElement("div",{className:"".concat(o.a.idsRingWrapper," ").concat(n)},i.a.createElement("div",{className:o.a.ldsRing},i.a.createElement("div",null),i.a.createElement("div",null),i.a.createElement("div",null),i.a.createElement("div",null)),e?i.a.createElement("p",{style:s},e):null,r)}},J66h:
/*!******************************************!*\
!*** ./node_modules/js-base64/base64.js ***!
\******************************************/
/*! no static exports found */
/*! exports used: Base64 */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){(function(n){var r;!function(n,i){t.exports=function(n){"use strict";var i,a=(n=n||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=function(t){for(var e={},n=0,r=t.length;n<r;n++)e[t.charAt(n)]=n;return e}(o),l=String.fromCharCode,c=function(t){if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?l(192|e>>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(t){return t.replace(u,c)},d=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[o.charAt(n>>>18),o.charAt(n>>>12&63),e>=2?"=":o.charAt(n>>>6&63),e>=1?"=":o.charAt(63&n)].join("")},f=n.btoa&&"function"==typeof n.btoa?function(t){return n.btoa(t)}:function(t){if(t.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return t.replace(/[\s\S]{1,3}/g,d)},p=function(t){return f(h(String(t)))},g=function(t){return t.replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"})).replace(/=/g,"")},m=function(t,e){return e?g(p(t)):p(t)};n.Uint8Array&&(i=function(t,e){for(var n="",r=0,i=t.length;r<i;r+=3){var a=t[r],s=t[r+1],l=t[r+2],c=a<<16|s<<8|l;n+=o.charAt(c>>>18)+o.charAt(c>>>12&63)+(void 0!==s?o.charAt(c>>>6&63):"=")+(void 0!==l?o.charAt(63&c):"=")}return e?g(n):n});var v,y=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,b=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return l(55296+(e>>>10))+l(56320+(1023&e));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},x=function(t){return t.replace(y,b)},S=function(t){var e=t.length,n=e%4,r=(e>0?s[t.charAt(0)]<<18:0)|(e>1?s[t.charAt(1)]<<12:0)|(e>2?s[t.charAt(2)]<<6:0)|(e>3?s[t.charAt(3)]:0),i=[l(r>>>16),l(r>>>8&255),l(255&r)];return i.length-=[0,0,2,1][n],i.join("")},C=n.atob&&"function"==typeof n.atob?function(t){return n.atob(t)}:function(t){return t.replace(/\S{1,4}/g,S)},E=function(t){return C(String(t).replace(/[^A-Za-z0-9\+\/]/g,""))},w=function(t){return String(t).replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},k=function(t){return function(t){return x(C(t))}(w(t))};n.Uint8Array&&(v=function(t){return Uint8Array.from(E(w(t)),(function(t){return t.charCodeAt(0)}))});var T=function(){var t=n.Base64;return n.Base64=a,t};if(n.Base64={VERSION:"2.6.4",atob:E,btoa:f,fromBase64:k,toBase64:m,utob:h,encode:m,encodeURI:function(t){return m(t,!0)},btou:x,decode:k,noConflict:T,fromUint8Array:i,toUint8Array:v},"function"==typeof Object.defineProperty){var O=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",O((function(){return k(this)}))),Object.defineProperty(String.prototype,"toBase64",O((function(t){return m(this,t)}))),Object.defineProperty(String.prototype,"toBase64URI",O((function(){return m(this,!0)})))}}n.Meteor&&(Base64=n.Base64);t.exports?t.exports.Base64=n.Base64:void 0===(r=function(){return n.Base64}.apply(e,[]))||(t.exports=r);return{Base64:n.Base64}}(n)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:this)}).call(this,n(/*! ./../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},JB8y:
/*!******************************************!*\
!*** ./src/pages/MyProblem/interface.ts ***!
\******************************************/
/*! exports provided: ExecuteStatus */
/*! exports used: ExecuteStatus */function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.NOMATCH=-1]="NOMATCH",t[t.OK=0]="OK",t[t.TIMEOUT=2]="TIMEOUT",t[t.PODFAILURE=3]="PODFAILURE",t[t.COMPILEFAILURE=4]="COMPILEFAILURE",t[t.EXECUTEFAILURE=5]="EXECUTEFAILURE"}(r||(r={}))},JPnl:
/*!*****************************************************!*\
!*** ./src/pages/MyProblem/TestCasePanel/index.tsx ***!
\*****************************************************/
/*! exports provided: ExecuteDict, getDetailCommitOut, getCommitOut, default */
/*! exports used: ExecuteDict, default, getDetailCommitOut */function(t,e,n){"use strict";n.d(e,"a",(function(){return S})),n.d(e,"c",(function(){return E}));n(/*! antd/es/button/style */"+L6B");var r,i,a=n(/*! antd/es/button */"2/Rp"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),l=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty */"jrin"),c=(n(/*! antd/es/input/style */"5NDa"),n(/*! antd/es/input */"5rEg")),u=n(/*! react */"q1tI"),h=n.n(u),d=n(/*! @ant-design/icons */"8Skl"),f=n(/*! @ant-design/icons */"y3Kf"),p=n(/*! ../interface */"JB8y"),g=n(/*! js-base64 */"J66h"),m=(n(/*! ./index.less */"a4uL"),n(/*! @/components/Spinner */"IxHN")),v=n(/*! @/components/RenderHtml */"9Bee"),y=n(/*! @/utils/util */"1vsH"),b=c.a.TextArea,x={visible:!1,tabIndex:"0"},S=(r={},Object(l.a)(r,p.a.NOMATCH,"测试用例结果不匹配"),Object(l.a)(r,p.a.OK,"调试通过"),Object(l.a)(r,2,"调试超时"),Object(l.a)(r,3,"调试pod失败"),Object(l.a)(r,4,"编译失败"),Object(l.a)(r,5,"执行失败"),r);function C(t,e){switch(e.type){case i.SET_VISIBLE:return Object(s.a)(Object(s.a)({},t),{},{visible:e.payload});case i.SET_TABINDEX:return Object(s.a)(Object(s.a)({},t),{},{tabIndex:e.payload});default:throw new Error}}function E(t){var e=t.status,n=t.error_msg,r=t.output,i=t.input,a=t.expected_output,o=t.is_file,s=t.input_file_url,l=t.output_file_url,c=t.expected_output_file_url,u=null,d={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(e){case p.a.NOMATCH:u=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",{className:"c-red"},"实际输入:"),!o&&h.a.createElement(v.a,{value:i,style:d}),o&&h.a.createElement("div",{style:d},h.a.createElement("a",{onClick:function(){return Object(y.w)(s,i)}},i)),h.a.createElement("p",{className:"c-red"},"实际输出:"),!o&&h.a.createElement(v.a,{value:r&&g.Base64.decode(r)||"",style:d}),o&&h.a.createElement("div",{style:d},h.a.createElement("a",{onClick:function(){return Object(y.w)(l,r)}},r)),h.a.createElement("p",{className:"c-red"},"预期输出:"),!o&&h.a.createElement(v.a,{value:a&&g.Base64.decode(a)||"",style:d}),o&&h.a.createElement("div",{style:d},h.a.createElement("a",{onClick:function(){return Object(y.w)(c,a)}},a)));break;case p.a.EXECUTEFAILURE:case p.a.COMPILEFAILURE:u=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"最后执行的输入:"),!o&&h.a.createElement(v.a,{value:i,style:d}),o&&h.a.createElement("div",{style:d},h.a.createElement("a",{onClick:function(){return Object(y.w)(s,i)}},i)),h.a.createElement("p",null,"执行出错信息:"),h.a.createElement("pre",{className:"error"},g.Base64.decode(n)));break;case p.a.PODFAILURE:u=h.a.createElement("p",null,"创建pod失败请稍后重试");break;case p.a.TIMEOUT:u=h.a.createElement("p",null,"评测超时,请稍后重试")}return h.a.createElement(h.a.Fragment,null," ",u," ")}!function(t){t[t.SET_VISIBLE=0]="SET_VISIBLE",t[t.SET_TABINDEX=1]="SET_TABINDEX"}(i||(i={})),e.b=function(t){var e=t.input,n=t.debuging,r=t.submitting,s=t.executingMessage,l=t.debugResult,c=t.onChangeInput,v=t.onDebugCode,y=t.onSubmitCode,S=Object(u.useReducer)(C,x),E=Object(o.a)(S,2),w=E[0],k=E[1],T=w.visible,O=w.tabIndex;function A(t){var e=t.target.id;k({type:i.SET_TABINDEX,payload:e})}var L=Object(u.useMemo)((function(){if(l){l.status;return h.a.createElement(h.a.Fragment,null,function(t){var e=t.status,n=t.error_msg,r=t.execute_time,i=t.output,a=t.input,o=t.expected_output,s=(t.is_file,t.input_file_url,t.output_file_url,t.expected_output_file_url,null);switch(e){case p.a.OK:s=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"执行用时:",r),h.a.createElement("p",null,"执行结果:"),h.a.createElement("pre",null,g.Base64.decode(i)));break;case p.a.NOMATCH:s=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"输入:",h.a.createElement("pre",null,a)),h.a.createElement("p",null,"输出:",i&&g.Base64.decode(i)),h.a.createElement("p",null,"预期输出:",o&&g.Base64.decode(o)));break;case p.a.EXECUTEFAILURE:case p.a.COMPILEFAILURE:s=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"最后执行的输入:",h.a.createElement("pre",null,a)),h.a.createElement("p",null,"执行出错信息:"),h.a.createElement("pre",{className:"error"},g.Base64.decode(n)));break;case p.a.PODFAILURE:s=h.a.createElement("p",null,"创建pod失败请稍后重试");break;case p.a.TIMEOUT:s=h.a.createElement("p",null,"评测超时,请稍后重试")}return h.a.createElement(h.a.Fragment,null," ",s," ")}(l))}return null}),[l]);return h.a.createElement("div",{className:"test-case-panel"},h.a.createElement("div",{className:"test-case-panel-body ".concat(T?"active":"")},h.a.createElement("ul",{className:"s-navs"},h.a.createElement("li",null,h.a.createElement("a",{className:"0"===O?"active":"",id:"0",onClick:A},"自定义测试用例")),h.a.createElement("li",null,h.a.createElement("a",{className:"1"===O?"active":"",id:"1",onClick:A},"代码执行结果"))),h.a.createElement("div",{className:"tab-panel-body ".concat("0"===O?"":"hide")},h.a.createElement(b,{placeholder:"请填写测试用例的输入值,点击“调试代码”",value:e,onChange:c})),h.a.createElement("div",{className:"tab-panel-body ".concat("1"===O?"":"hide")},n?h.a.createElement(m.a,{message:s}):l?h.a.createElement("section",{style:{height:200}}," ",L," "):h.a.createElement("p",{className:"tip"},"请填写测试用例的输入值,点击“调试代码”"))),h.a.createElement("a",{className:"btn-collapse ".concat(T?"up":""),onClick:function(){k({type:i.SET_VISIBLE,payload:!T})}},T?h.a.createElement(d.a,null):h.a.createElement(f.a,null)),h.a.createElement("footer",{className:"footer"},h.a.createElement("span",null,"控制台"),h.a.createElement("div",{className:"flex-container"},h.a.createElement(a.a,{className:"btn-green",type:"ghost",loading:n,onClick:function(){k({type:i.SET_VISIBLE,payload:!0}),k({type:i.SET_TABINDEX,payload:"1"}),v()}},"调试代码"),h.a.createElement(a.a,{type:"primary",loading:r,disabled:r,onClick:function(){k({type:i.SET_VISIBLE,payload:!1}),y()}},"评测并提交"))))}},LdHM:
/*!********************************************************!*\
!*** ./node_modules/rc-select/es/index.js + 6 modules ***!
\********************************************************/
/*! exports provided: Option, OptGroup, default */
/*! exports used: OptGroup, Option, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/TransBtn.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/generate.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/commonUtil.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/valueUtil.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMemo.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/pickAttrs.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"b",(function(){return S})),n.d(e,"a",(function(){return E}));var r=n("1OyB"),i=n("vuIU"),a=n("Ji7U"),o=n("LK+K"),s=n("q1tI"),l=n("rePB"),c=n("Ff2n"),u=n("ODXe"),h=n("4IlW"),d=n("bX4T"),f=n("YrtM"),p=n("TSYQ"),g=n.n(p),m=n("+nKL"),v=n("8OUc"),y=s.forwardRef((function(t,e){var n=t.prefixCls,r=t.id,i=t.flattenOptions,a=t.childrenAsData,o=t.values,p=t.searchValue,y=t.multiple,b=t.defaultActiveFirstOption,x=t.height,S=t.itemHeight,C=t.notFoundContent,E=t.open,w=t.menuItemSelectedIcon,k=t.virtual,T=t.onSelect,O=t.onToggleOpen,A=t.onActiveValue,L=t.onScroll,D=t.onMouseEnter,R="".concat(n,"-item"),I=Object(f.a)((function(){return i}),[E,i],(function(t,e){return e[0]&&t[1]!==e[1]})),_=s.useRef(null),M=function(t){t.preventDefault()},N=function(t){_.current&&_.current.scrollTo({index:t})},P=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=I.length,r=0;r<n;r+=1){var i=(t+r*e+n)%n,a=I[i],o=a.group,s=a.data;if(!o&&!s.disabled)return i}return-1},F=s.useState((function(){return P(0)})),j=Object(u.a)(F,2),B=j[0],U=j[1],H=function(t){U(t);var e=I[t];e?A(e.data.value,t):A(null,-1)};s.useEffect((function(){H(!1!==b?P(0):-1)}),[I.length,p]),s.useEffect((function(){var t=setTimeout((function(){if(!y&&E&&1===o.size){var t=Array.from(o)[0],e=I.findIndex((function(e){return e.data.value===t}));H(e),N(e)}}));return function(){return clearTimeout(t)}}),[E]);var G=function(t){void 0!==t&&T(t,{selected:!o.has(t)}),y||O(!1)};if(s.useImperativeHandle(e,(function(){return{onKeyDown:function(t){var e=t.which;switch(e){case h.a.UP:case h.a.DOWN:var n=0;if(e===h.a.UP?n=-1:e===h.a.DOWN&&(n=1),0!==n){var r=P(B+n,n);N(r),H(r)}break;case h.a.ENTER:var i=I[B];i&&!i.data.disabled?G(i.data.value):G(void 0),E&&t.preventDefault();break;case h.a.ESC:O(!1)}},onKeyUp:function(){},scrollTo:function(t){N(t)}}})),0===I.length)return s.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(R,"-empty"),onMouseDown:M},C);function z(t){var e=I[t];if(!e)return null;var n=e.data||{},i=n.value,l=n.label,c=n.children,u=Object(d.a)(n,!0),h=a?c:l;return e?s.createElement("div",Object.assign({"aria-label":"string"==typeof h?h:null},u,{key:t,role:"option",id:"".concat(r,"_list_").concat(t),"aria-selected":o.has(i)}),i):null}return s.createElement(s.Fragment,null,s.createElement("div",{role:"listbox",id:"".concat(r,"_list"),style:{height:0,width:0,overflow:"hidden"}},z(B-1),z(B),z(B+1)),s.createElement(m.a,{itemKey:"key",ref:_,data:I,height:x,itemHeight:S,fullHeight:!1,onMouseDown:M,onScroll:L,virtual:k,onMouseEnter:D},(function(t,e){var n,r=t.group,i=t.groupOption,u=t.data,h=u.label,d=u.key;if(r)return s.createElement("div",{className:g()(R,"".concat(R,"-group"))},void 0!==h?h:d);var f=u.disabled,p=u.value,m=u.title,y=u.children,b=u.style,x=u.className,S=Object(c.a)(u,["disabled","value","title","children","style","className"]),C=o.has(p),E="".concat(R,"-option"),k=g()(R,E,x,(n={},Object(l.a)(n,"".concat(E,"-grouped"),i),Object(l.a)(n,"".concat(E,"-active"),B===e&&!f),Object(l.a)(n,"".concat(E,"-disabled"),f),Object(l.a)(n,"".concat(E,"-selected"),C),n)),T=a?y:h,O=!w||"function"==typeof w||C;return s.createElement("div",Object.assign({},S,{"aria-selected":C,className:k,title:m,onMouseMove:function(){B===e||f||H(e)},onClick:function(){f||G(p)},style:b}),s.createElement("div",{className:"".concat(E,"-content")},T||p),s.isValidElement(w)||C,O&&s.createElement(v.a,{className:"".concat(R,"-option-state"),customizeIcon:w,customizeIconProps:{isSelected:C}},C?"✓":null))})))}));y.displayName="OptionList";var b=y,x=function(){return null};x.isSelectOption=!0;var S=x,C=function(){return null};C.isSelectOptGroup=!0;var E=C,w=n("VTBJ"),k=n("Zm9Q");function T(t){var e=t.key,n=t.props,r=n.children,i=n.value,a=Object(c.a)(n,["children","value"]);return Object(w.a)({key:e,value:void 0!==i?i:e,children:r},a)}function O(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(k.a)(t).map((function(t,n){if(!s.isValidElement(t)||!t.type)return null;var r=t.type.isSelectOptGroup,i=t.key,a=t.props,o=a.children,l=Object(c.a)(a,["children"]);return e||!r?T(t):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(null===i?n:i,"__"),label:i},l),{},{options:O(o)})})).filter((function(t){return t}))}var A=n("2Qr1"),L=n("qNPg"),D=n("U8pU"),R=n("Kwbf"),I=n("WKfj");var _=function(t){var e=t.mode,n=t.options,r=t.children,i=t.backfill,a=t.allowClear,o=t.placeholder,l=t.getInputElement,c=t.showSearch,u=t.onSearch,h=t.defaultOpen,d=t.autoFocus,f=t.labelInValue,p=t.value,g=t.inputValue,m=t.optionLabelProp,v="multiple"===e||"tags"===e,y=void 0!==c?c:v||"combobox"===e,b=n||O(r);if(Object(R.a)("tags"!==e||b.every((function(t){return!t.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===e||"combobox"===e){var x=b.some((function(t){return t.options?t.options.some((function(t){return"number"==typeof("value"in t?t.value:t.key)})):"number"==typeof("value"in t?t.value:t.key)}));Object(R.a)(!x,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(R.a)("combobox"!==e||!m,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(R.a)("combobox"===e||!i,"`backfill` only works with `combobox` mode."),Object(R.a)("combobox"===e||!l,"`getInputElement` only work with `combobox` mode."),Object(R.b)("combobox"!==e||!l||!a||!o,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==e&&"tags"!==e&&Object(R.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(R.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=p){var S=Object(I.d)(p);Object(R.a)(!f||S.every((function(t){return"object"===Object(D.a)(t)&&("key"in t||"value"in t)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(R.a)(!v||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var C=null;Object(k.a)(r).some((function(t){if(!s.isValidElement(t)||!t.type)return!1;var e=t.type;return!e.isSelectOption&&(e.isSelectOptGroup?!Object(k.a)(t.props.children).every((function(e){return!(s.isValidElement(e)&&t.type&&!e.type.isSelectOption)||(C=e.type,!1)})):(C=e,!0))})),C&&Object(R.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(C.displayName||C.name||C,"`.")),Object(R.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},M=Object(L.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:A.d,getLabeledValue:A.e,filterOptions:A.b,isValueDisabled:A.g,findValueOption:A.c,warningProps:_,fillOptionsWithMissingValue:A.a}),N=function(t){Object(a.a)(n,t);var e=Object(o.a)(n);function n(){var t;return Object(r.a)(this,n),(t=e.apply(this,arguments)).selectRef=s.createRef(),t.focus=function(){t.selectRef.current.focus()},t.blur=function(){t.selectRef.current.blur()},t}return Object(i.a)(n,[{key:"render",value:function(){return s.createElement(M,Object.assign({ref:this.selectRef},this.props))}}]),n}(s.Component);N.Option=S,N.OptGroup=E;var P=N;e.c=P},M8RZ:
/*!**********************************!*\
!*** ./src/components/modal.tsx ***!
\**********************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! react-dom */"i8i4"),u=function(t){Object(a.a)(n,t);var e=Object(o.a)(n);function n(t){var i;Object(r.a)(this,n),i=e.call(this,t);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return Object(i.a)(n,[{key:"render",value:function(){var t=this.props.children;return Object(c.createPortal)(t,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(l.a.Component)},MFOe:
/*!****************************************!*\
!*** ./node_modules/store/src/util.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){(function(e){var n=Object.assign?Object.assign:function(t,e,n,r){for(var i=1;i<arguments.length;i++)s(Object(arguments[i]),(function(e,n){t[n]=e}));return t},r=function(){if(Object.create)return function(t,e,r,i){var a=o(arguments,1);return n.apply(this,[Object.create(t)].concat(a))};{function t(){}return function(e,r,i,a){var s=o(arguments,1);return t.prototype=e,n.apply(this,[new t].concat(s))}}}(),i=String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},a="undefined"!=typeof window?window:e;function o(t,e){return Array.prototype.slice.call(t,e||0)}function s(t,e){l(t,(function(t,n){return e(t,n),!1}))}function l(t,e){if(c(t)){for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function c(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length}t.exports={assign:n,create:r,trim:i,bind:function(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}},slice:o,each:s,map:function(t,e){var n=c(t)?[]:{};return l(t,(function(t,r){return n[r]=e(t,r),!1})),n},pluck:l,isList:c,isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)},isObject:function(t){return t&&"[object Object]"==={}.toString.call(t)},Global:a}}).call(this,n(/*! ./../../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},NvD2:
/*!******************************************************!*\
!*** ./node_modules/rc-tree/es/utils/conductUtil.js ***!
\******************************************************/
/*! exports provided: isCheckDisabled, conductCheck */
/*! exports used: conductCheck */function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(/*! rc-util/es/warning */"Kwbf");function i(t,e){var n=new Set;return t.forEach((function(t){e.has(t)||n.add(t)})),n}function a(t){var e=t||{},n=e.disabled,r=e.disableCheckbox,i=e.checkable;return!(!n&&!r)||!1===i}function o(t,e,n,o){var s,l=[];s=o||a;var c=new Set(t.filter((function(t){var e=!!n[t];return e||l.push(t),e}))),u=new Map,h=0;return Object.keys(n).forEach((function(t){var e=n[t],r=e.level,i=u.get(r);i||(i=new Set,u.set(r,i)),i.add(e),h=Math.max(h,r)})),Object(r.a)(!l.length,"Tree missing follow keys: ".concat(l.slice(0,100).map((function(t){return"'".concat(t,"'")})).join(", "))),!0===e?function(t,e,n,r){for(var a=new Set(t),o=new Set,s=0;s<=n;s+=1){(e.get(s)||new Set).forEach((function(t){var e=t.key,n=t.node,i=t.children,o=void 0===i?[]:i;a.has(e)&&!r(n)&&o.filter((function(t){return!r(t.node)})).forEach((function(t){a.add(t.key)}))}))}for(var l=new Set,c=n;c>=0;c-=1){(e.get(c)||new Set).forEach((function(t){var e=t.parent,n=t.node;if(!r(n)&&t.parent&&!l.has(t.parent.key))if(r(t.parent.node))l.add(e.key);else{var i=!0,s=!1;(e.children||[]).filter((function(t){return!r(t.node)})).forEach((function(t){var e=t.key,n=a.has(e);i&&!n&&(i=!1),s||!n&&!o.has(e)||(s=!0)})),i&&a.add(e.key),s&&o.add(e.key),l.add(e.key)}}))}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(i(o,a))}}(c,u,h,s):function(t,e,n,r,a){for(var o=new Set(t),s=new Set(e),l=0;l<=r;l+=1){(n.get(l)||new Set).forEach((function(t){var e=t.key,n=t.node,r=t.children,i=void 0===r?[]:r;o.has(e)||s.has(e)||a(n)||i.filter((function(t){return!a(t.node)})).forEach((function(t){o.delete(t.key)}))}))}s=new Set;for(var c=new Set,u=r;u>=0;u-=1){(n.get(u)||new Set).forEach((function(t){var e=t.parent,n=t.node;if(!a(n)&&t.parent&&!c.has(t.parent.key))if(a(t.parent.node))c.add(e.key);else{var r=!0,i=!1;(e.children||[]).filter((function(t){return!a(t.node)})).forEach((function(t){var e=t.key,n=o.has(e);r&&!n&&(r=!1),i||!n&&!s.has(e)||(i=!0)})),r||o.delete(e.key),i&&s.add(e.key),c.add(e.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(i(s,o))}}(c,e.halfCheckedKeys,u,h,s)}},OJz4:
/*!****************************************!*\
!*** ./src/pages/MyProblem/service.ts ***!
\****************************************/
/*! exports provided: getProgrammingTopic, sumbitCode, debugCode, getSubmitRecords, getRecordDetail, getOperationResult, addNotes, resetCode, syncCode, updateCode, updateCostTime, triggerPlus */
/*! exports used: addNotes, debugCode, getOperationResult, getProgrammingTopic, getRecordDetail, getSubmitRecords, resetCode, sumbitCode, syncCode, triggerPlus, updateCode, updateCostTime */function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"h",(function(){return a})),n.d(e,"b",(function(){return o})),n.d(e,"f",(function(){return s})),n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return u})),n.d(e,"g",(function(){return h})),n.d(e,"i",(function(){return d})),n.d(e,"k",(function(){return f})),n.d(e,"l",(function(){return p})),n.d(e,"j",(function(){return g}));var r=n(/*! @/utils/fetch.ts */"ErOA");function i(t){return Object(r.c)("myproblems/".concat(t,".json"),{hidePopLogin:!0})}function a(t,e){return Object(r.f)("myproblems/".concat(t,"/code_submit.json"),e)}function o(t,e){return Object(r.c)("myproblems/".concat(t,"/code_debug.json"),e)}function s(t,e){return Object(r.c)("myproblems/".concat(t,"/submit_records.json"),e)}function l(t){return Object(r.c)("myproblems/record_detail.json",{id:t})}function c(t,e){return Object(r.c)("myproblems/".concat(t,"/result.json"),{mode:e})}function u(t,e){return Object(r.f)("myproblems/".concat(t,"/add_notes.json"),e)}function h(t){return Object(r.f)("myproblems/".concat(t,"/restore_initial_code.json"))}function d(t){return Object(r.f)("myproblems/".concat(t,"/sync_code.json"))}function f(t,e){return Object(r.f)("myproblems/".concat(t,"/update_code.json"),e)}function p(t){return Object(r.f)("myproblems/".concat(t,"/cost_time.json"))}function g(t,e){return Object(r.f)("discusses/".concat(t,"/plus.json"),e)}},OLES:
/*!*********************************************************!*\
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";var r=n("U8pU"),i=n("VTBJ"),a=n("Ff2n"),o=n("q1tI"),s=n("uciX"),l=n("7ixt"),c=function(t){var e=t.overlay,n=t.prefixCls,r=t.id,i=t.overlayInnerStyle;return o.createElement("div",{className:"".concat(n,"-inner"),id:r,role:"tooltip",style:i},"function"==typeof e?e():e)},u=Object(o.forwardRef)((function(t,e){var n=t.overlayClassName,u=t.trigger,h=void 0===u?["hover"]:u,d=t.mouseEnterDelay,f=void 0===d?0:d,p=t.mouseLeaveDelay,g=void 0===p?.1:p,m=t.overlayStyle,v=t.prefixCls,y=void 0===v?"rc-tooltip":v,b=t.children,x=t.onVisibleChange,S=t.afterVisibleChange,C=t.transitionName,E=t.animation,w=t.placement,k=void 0===w?"right":w,T=t.align,O=void 0===T?{}:T,A=t.destroyTooltipOnHide,L=void 0!==A&&A,D=t.defaultVisible,R=t.getTooltipContainer,I=t.overlayInnerStyle,_=Object(a.a)(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),M=Object(o.useRef)(null);Object(o.useImperativeHandle)(e,(function(){return M.current}));var N=Object(i.a)({},_);"visible"in t&&(N.popupVisible=t.visible);var P=!1,F=!1;if("boolean"==typeof L)P=L;else if(L&&"object"===Object(r.a)(L)){var j=L.keepParent;P=!0===j,F=!1===j}return o.createElement(s.a,Object.assign({popupClassName:n,prefixCls:y,popup:function(){var e=t.arrowContent,n=void 0===e?null:e,r=t.overlay,i=t.id;return[o.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},n),o.createElement(c,{key:"content",prefixCls:y,id:i,overlay:r,overlayInnerStyle:I})]},action:h,builtinPlacements:l.a,popupPlacement:k,ref:M,popupAlign:O,getPopupContainer:R,onPopupVisibleChange:x,afterPopupVisibleChange:S,popupTransitionName:C,popupAnimation:E,defaultPopupVisible:D,destroyPopupOnHide:P,autoDestroy:F,mouseLeaveDelay:g,popupStyle:m,mouseEnterDelay:f},N),b)}));e.a=u},OZM5:
/*!*****************************************!*\
!*** ./node_modules/rc-tree/es/util.js ***!
\*****************************************/
/*! exports provided: arrDel, arrAdd, posToArr, getPosition, isTreeNode, getDragNodesKeys, calcDropPosition, calcSelectedKeys, convertDataToTree, parseCheckedKeys, conductExpandParent, getDataAndAria */
/*! exports used: arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDataAndAria, getDragNodesKeys, getPosition, isTreeNode, parseCheckedKeys, posToArr */function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"k",(function(){return l})),n.d(e,"h",(function(){return c})),n.d(e,"i",(function(){return u})),n.d(e,"g",(function(){return h})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return f})),n.d(e,"j",(function(){return p})),n.d(e,"e",(function(){return g})),n.d(e,"f",(function(){return m}));var r=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),i=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),a=(n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),n(/*! react */"q1tI"),n(/*! rc-util/es/warning */"Kwbf"));n(/*! ./TreeNode */"WaYH");function o(t,e){var n=t.slice(),r=n.indexOf(e);return r>=0&&n.splice(r,1),n}function s(t,e){var n=t.slice();return-1===n.indexOf(e)&&n.push(e),n}function l(t){return t.split("-")}function c(t,e){return"".concat(t,"-").concat(e)}function u(t){return t&&t.type&&t.type.isTreeNode}function h(t,e){var n=[t];return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){var r=e.key,i=e.children;n.push(r),t(i)}))}(e[t].children),n}function d(t,e){var n=t.clientY,r=e.selectHandle.getBoundingClientRect(),i=r.top,a=r.bottom,o=r.height,s=Math.max(.25*o,2);return n<=i+s?-1:n>=a-s?1:0}function f(t,e){if(t)return e.multiple?t.slice():t.length?[t[0]]:t}function p(t){if(!t)return null;var e;if(Array.isArray(t))e={checkedKeys:t,halfCheckedKeys:void 0};else{if("object"!==Object(i.a)(t))return Object(a.a)(!1,"`checkedKeys` is not an array or an object"),null;e={checkedKeys:t.checked||void 0,halfCheckedKeys:t.halfChecked||void 0}}return e}function g(t,e){var n=new Set;return(t||[]).forEach((function(t){!function t(r){if(!n.has(r)){var i=e[r];if(i){n.add(r);var a=i.parent;i.node.disabled||a&&t(a.key)}}}(t)})),Object(r.a)(n)}function m(t){var e={};return Object.keys(t).forEach((function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(e[n]=t[n])})),e}},Ot1p:
/*!**************************************************************!*\
!*** ./src/components/markdown-editor/index.tsx + 6 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/qrcode.react/lib/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/uuid/dist/esm-browser/v4.js */function(t,e,n){"use strict";n("2qtc");var r=n("kLXV"),i=n("rAM+"),a=(n("miYZ"),n("tsqr")),o=n("9og8"),s=n("tJVT"),l=n("jrin"),c=n("WmNS"),u=n.n(c),h=n("q1tI"),d=n.n(h),f=n("VrN/"),p=n.n(f),g=n("bdgK"),m=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("+NIl"),n("kSUc"),n("9Bee")),v=function(t){var e=t.value,n=void 0===e?"":e,r=(t.className,t.showTextOnly,t.showLines,t.style,Object(h.useMemo)((function(){return""}),[n]));return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))},y=(n("Q9mQ"),n("diRs")),b=n("0Owb"),x=(n("dejd"),n("C+DQ"),n("D1Df")),S=n.n(x),C=n("1vsH"),E=n("m3rI"),w=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function k(t){var e=t.onActionCallback,n=t.title,r=t.icon,i=t.actionName,a=t.className,o=void 0===a?"":a,s=t.children;return d.a.createElement("a",{title:n,className:o,onClick:function(){e(i)}},d.a.createElement("i",{className:"md-iconfont ".concat(r)}),s)}var T=function(t){var e=t.watch,n=t.showNullButton,r=t.onActionCallback,i=t.fullScreen,a=t.insertTemp,o=t.hidetoolBar,s=t.uuid,l=t.setOpenPhones,c=Object(C.E)("_educoder_session_login"),u=Object(C.E)("_educoder_session"),h=[].concat(w,[{title:"".concat(e?"关闭实时预览":"开启实时预览"),icon:"".concat(e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!o&&h.map((function(t,e){return d.a.createElement("li",{key:e},t.actionName?d.a.createElement(k,Object(b.a)({},t,{onActionCallback:r})):d.a.createElement("span",{className:"v-line"}))})),n?d.a.createElement("li",null,d.a.createElement(k,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r},d.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,a&&d.a.createElement("li",null,d.a.createElement(k,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r},d.a.createElement("span",{className:"fill-tip"},"插入模板"))),d.a.createElement("li",null,d.a.createElement(y.a,{title:"打开手机扫一扫",content:d.a.createElement("div",null,d.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(E.a.API_SERVER)),d.a.createElement(S.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(E.a.API_SERVER)}))},d.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return l(!0)}},"手机上传文件"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(k,{icon:"".concat(i?"icon-shrink":"icon-enlarge"),title:i?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})))},O=n("M8RZ"),A=(n("+L6B"),n("2/Rp")),L=(n("y8nQ"),n("Vl3Y")),D=(n("5NDa"),n("5rEg")),R={labelCol:{span:4},wrapperCol:{span:20}},I=function(t){var e=t.callback,n=t.onCancel;return d.a.createElement(L.a,Object(b.a)({},R,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(t){e(t)}}),d.a.createElement(L.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},d.a.createElement(D.a,null)),d.a.createElement(L.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},d.a.createElement(D.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(A.a,{type:"ghost",onClick:n},"取消")))},_=n("7ahc"),M=n("k1fw"),N=(n("HmJG"),n("BjJ7")),P=L.a.useForm,F={width:280,marginRight:10},j={labelCol:{span:5},wrapperCol:{span:19}},B=function(t){var e=t.callback,n=t.onCancel,r=P(),i=Object(s.a)(r,1)[0],a=Object(h.useRef)();function o(t,e){i.setFieldsValue({src:"/api/attachments/".concat(t.id,"?type=").concat(t.content_type),type:e.type})}return d.a.createElement(L.a,Object(b.a)({form:i},j,{className:"upload-image-panel",onFinish:function(t){e(Object(M.a)(Object(M.a)({},t),{},{name:a.current}))}}),d.a.createElement(L.a.Item,{label:"文件地址",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(L.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},d.a.createElement(D.a,{style:F})),d.a.createElement(U,{onFileChange:function(t){var e=t.target.files[0];a.current=e.name,H(e,o)}}))),d.a.createElement(L.a.Item,{label:"文件描述",name:"alt"},d.a.createElement(D.a,{style:{width:264}})),d.a.createElement(L.a.Item,{style:{textAlign:"right"}},d.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(A.a,{type:"ghost",onClick:n},"取消")))};function U(t){var e=t.onFileChange;return d.a.createElement("a",{className:"upload-button"},"本地上传",d.a.createElement("input",{type:"file",onChange:e}))}function H(t,e){if(!t)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",t),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var r=new window.XMLHttpRequest;r.withCredentials=!0,r.addEventListener("load",(function(n){e(JSON.parse(n.target.responseText),t)}),!1),r.addEventListener("error",(function(t){console.error(t)}),!1),r.open("POST","".concat(N.a,"/api/attachments.json")),r.send(n)}n("giR+");var G,z,W=n("fyUT"),V=(n("7Kak"),n("9yH6")),K=V.a.Group,q={margin:"0 8px"},Y=function(t){var e=t.callback,n=t.onCancel;return d.a.createElement(L.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(t){e(t)}},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:q},"单元格数:"),d.a.createElement("span",{style:q},"行数"),d.a.createElement(L.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},d.a.createElement(W.a,null)),d.a.createElement("span",{style:q},"列数"),d.a.createElement(L.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},d.a.createElement(W.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:q},"对齐方式:"),d.a.createElement(L.a.Item,{name:"align"},d.a.createElement(K,null,d.a.createElement(V.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(V.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(V.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(V.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(A.a,{type:"ghost",onClick:n},"取消")))},X=n("ErOA"),$=n("7Cbv"),J="------------",Z={default:J,left:":".concat(J),center:":".concat(J,":"),right:"".concat(J,":")},Q=n("9VGf");function tt(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}var et=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",nt=["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"],rt=(G={},Object(l.a)(G,et+"-B","bold"),Object(l.a)(G,et+"-I","italic"),G),it=(z={},Object(l.a)(z,"link","添加链接"),Object(l.a)(z,"code-block","添加代码块"),Object(l.a)(z,"upload-image","添加文件"),Object(l.a)(z,"add-table","添加表格"),z);e.a=function(t){var e=t.defaultValue,n=void 0===e?"":e,c=t.onChange,f=t.width,y=void 0===f?"100%":f,b=t.height,x=void 0===b?400:b,S=t.miniToolbar,C=void 0!==S&&S,w=t.isFocus,k=void 0!==w&&w,A=t.watch,L=t.insertTemp,D=t.mode,R=void 0===D?"markdown":D,M=t.id,N=void 0===M?"markdown-editor-id":M,P=t.showResizeBar,F=void 0!==P&&P,j=t.noStorage,U=void 0!==j&&j,G=t.showNullButton,z=void 0!==G&&G,W=t.hidetoolBar,V=void 0!==W&&W,K=t.fullScreen,q=void 0!==K&&K,J=t.onBlur,et=t.onCMBeforeChange,at=t.onFullScreen,ot=t.className,st=void 0===ot?"":ot,lt=t.disablePaste,ct=void 0!==lt&&lt,ut=t.placeholder,ht=void 0===ut?"":ut,dt=t.values,ft=void 0===dt?"":dt,pt=Object(h.useState)(null),gt=Object(s.a)(pt,2),mt=gt[0],vt=gt[1],yt=Object(h.useState)(n),bt=Object(s.a)(yt,2),xt=bt[0],St=bt[1],Ct=Object(h.useState)(A),Et=Object(s.a)(Ct,2),wt=Et[0],kt=Et[1],Tt=Object(h.useState)(q),Ot=Object(s.a)(Tt,2),At=Ot[0],Lt=Ot[1],Dt=Object(h.useState)(""),Rt=Object(s.a)(Dt,2),It=Rt[0],_t=Rt[1],Mt=Object(h.useState)(0),Nt=Object(s.a)(Mt,2),Pt=Nt[0],Ft=Nt[1],jt=Object(h.useState)(x),Bt=Object(s.a)(jt,2),Ut=Bt[0],Ht=Bt[1],Gt=Object(h.useState)(!1),zt=Object(s.a)(Gt,2),Wt=(zt[0],zt[1]),Vt=Object(h.useRef)(Object($.a)()),Kt=Object(h.useRef)(!1),qt=Object(h.useRef)(),Yt=Object(h.useRef)(),Xt=Object(h.useRef)(),$t=Object(h.useRef)(),Jt=Object(h.useRef)(),Zt=function(){var t=Object(o.a)(u.a.mark((function t(){var e,n;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(X.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Vt.current}});case 2:null!=(n=t.sent)&&null!==(e=n.attachments)&&void 0!==e&&e.length&&(console.log("cm:",mt,Yt),n.attachments.map((function(t){t.content_type.indexOf("image")>-1?mt.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):t.content_type.indexOf("video")>-1?mt.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):t.content_type.indexOf("pdf")>-1?mt.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,'&disposition=inline" target="_blank">').concat(t.name,"</a>")):mt.replaceSelection("[".concat(t.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")"))})));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(h.useEffect)((function(){St(ft),null==mt||mt.setValue(ft)}),[ft]),Object(h.useEffect)((function(){null==at||at(At)}),[At]),Object(h.useEffect)((function(){if(Yt.current){var t=p.a.fromTextArea(Yt.current,{mode:R,lineNumbers:!C,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});function e(e,n){if(!ct){var r=n.clipboardData;if(r){var i=r.types.toString(),o=r.items;if("Files"===i||r.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==R)return;try{var s,l=o[1];"file"===(null===(s=o[0])||void 0===s?void 0:s.kind)&&(l=o[0]);var c=l.getAsFile(),u=c.name.split(".").pop();H(c,(function(e){var n,r,i;e.id?(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("video"))>-1?t.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("pdf"))>-1?t.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(c.type,'&disposition=inline" target="_blank">').concat(c.name,"</a>")):nt.includes(u)?t.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(c.name,"</a>")):t.replaceSelection("[".concat(c.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){a.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()}return k&&t.focus(),t.on("paste",e),t.on("dragleave",(function(t,e){Xt.current.classList.remove("mouse-hover-md")})),t.on("dragover",(function(t,e){Xt.current.classList.add("mouse-hover-md")})),t.on("drop",(function(e,n){var r;if(Xt.current.classList.add("mouse-hover-md"),(r=n.dataTransfer.files).length>0){n.preventDefault(),n.stopPropagation();for(var i=function(e){var n=r[e],i=n.name.split(".").pop();H(n,(function(e){var r,a,o;e.id?(null==n||null===(r=n.type)||void 0===r?void 0:r.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==n||null===(a=n.type)||void 0===a?void 0:a.indexOf("video"))>-1?t.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==n||null===(o=n.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?t.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(n.type,'&disposition=inline" target="_blank">').concat(n.name,"</a>")):nt.includes(i)?t.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(n.name,"</a>")):t.replaceSelection("[".concat(n.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))},a=0;a<r.length;a++)i(a)}})),vt(t),function(){t.off("paste",e)}}}),[]);var Qt=Object(h.useCallback)((function(){Xt.current}),[Ut,Xt,At]);Object(h.useEffect)((function(){if(mt){var t=function(){var t=new g.default((function(t){var e,n=Object(i.a)(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&(Qt(),mt.setSize("100%","100%"),mt.refresh())}}catch(t){n.e(t)}finally{n.f()}}));return t.observe(Yt.current.parentElement),t}();return function(){t.unobserve(Yt.current.parentElement)}}}),[mt,Qt]),Object(h.useEffect)((function(){if(mt){for(var t=[],e=function(){var e=r[n],i=(a=Object(s.a)(e,2))[0],o=a[1],c=Object(l.a)({},i,(function(){te(o)}));t.push(c),mt.addKeyMap(c)},n=0,r=Object.entries(rt);n<r.length;n++){var a;e()}return qt.current=setInterval((function(){Kt.current&&Zt()}),4e3),function(){clearInterval(qt.current);var e,n=Object(i.a)(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;mt.removeKeyMap(r)}}catch(t){n.e(t)}finally{n.f()}}}}),[mt]),Object(h.useEffect)((function(){q!==At&&Lt(q)}),[q]),Object(Q.a)((function(){if(!U&&Pt>0){var t=(new Date).getTime(),e=window.sessionStorage.getItem(N);t>=Pt+1e4&&(!e||e!==xt)&&(window.sessionStorage.setItem(N,xt),Wt(!0))}}),1e4),Object(h.useEffect)((function(){kt(A)}),[mt,A]),Object(h.useEffect)((function(){mt&&k&&mt.focus()}),[mt,k]),Object(h.useEffect)((function(){if(wt&&mt){var t=mt.getScrollerElement();function e(t){var e=t.target;if(Jt.current){var n=e.scrollTop/e.scrollHeight;Jt.current.scrollTop=Jt.current.scrollHeight*n}}return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[mt,wt]),Object(h.useEffect)((function(){if(mt&&et){function t(t,e){et(t,e)}return mt.on("beforeChange",t),function(){mt.off("beforeChange",t)}}}),[mt,et]),Object(h.useEffect)((function(){if(mt&&J){function t(){J(mt.getValue())}return mt.on("blur",t),function(){mt.off("blur",t)}}}),[mt,J]),Object(h.useEffect)((function(){if(mt){function t(t){var e=t.getValue();St(e),Ft((new Date).getTime()),t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(e)}return mt.on("change",t),function(){mt.off("change",t)}}}),[mt,c]),Object(h.useEffect)((function(){mt&&(null==n?(mt.setValue(""),St("")):n!==mt.getValue()&&(mt.setValue(n),St(n),mt.setCursor(mt.lineCount(),0)))}),[mt,n]);var te=Object(h.useCallback)((function(t){var e=mt.getCursor(),n=mt.getSelection(),r=n.split("\n");switch(t){case"bold":return mt.replaceSelection("**"+n+"**"),""===n&&mt.setCursor(e.line,e.ch+2),mt.focus();case"italic":return mt.replaceSelection("*"+n+"*"),""===n&&mt.setCursor(e.line,e.ch+1),mt.focus();case"code":return mt.replaceSelection("`"+n+"`"),""===n&&mt.setCursor(e.line,e.ch+1),mt.focus();case"inline-latex":return mt.replaceSelection("`$$"+n+"$$`"),""===n&&mt.setCursor(e.line,e.ch+3),mt.focus();case"latex":return mt.replaceSelection("```latex\n"+n+"\n```"),mt.setCursor(e.line+1,n.length+1),mt.focus();case"line-break":return mt.replaceSelection("<br/>\n"),mt.focus();case"list-ul":return""===n?mt.replaceSelection("- "+n):mt.replaceSelection(r.map((function(t){return""===t?"":"- ".concat(t)})).join("\n")),mt.focus();case"list-ol":return""===n?mt.replaceSelection("1. "+n):mt.replaceSelection(r.map((function(t,e){return""===t?"":"".concat(e+1,". ").concat(t)})).join("\n")),mt.focus();case"add-null-ch":return""===n&&mt.setCursor(e.line,e.ch+1),mt.replaceSelection("▁"),mt.focus();case"inster-template-1":return""===n&&mt.setCursor(e.line,e.ch),mt.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),mt.focus();case"eraser":return mt.setValue(""),mt.focus();case"trigger-watch":return kt(!wt),mt.focus();case"trigger-full-screen":return Lt(!At),mt.focus();case"link":return void _t("link");case"code-block":return void _t("code-block");case"upload-image":return void _t("upload-image");case"add-table":return void _t("add-table");default:throw new Error}}),[mt,wt,At]),ee=Object(h.useCallback)((function(t){switch(_t(""),It){case"link":var e=t.title,n=t.link;return mt.replaceSelection("[".concat(e,"](").concat(n,")")),mt.focus();case"code-block":var r=t.language,i=t.content;return mt.replaceSelection(["```"+r,i,"```"].join("\n")),mt.focus();case"upload-image":var a=t.src,o=t.alt,s=t.name;return a.indexOf("type=image")>-1?mt.replaceSelection("![ ".concat(o||""," ]( ").concat(a,' "').concat(o||"",'" )')):a.indexOf("type=application/pdf")>-1?mt.replaceSelection('<a href="'.concat(a,'&disposition=inline" target="_blank">').concat(s,"</a>")):mt.replaceSelection('<a href="'.concat(a,'" target="_blank">').concat(s,"</a>")),mt.focus();case"add-table":for(var l=t.row,c=t.col,u=t.align,h="\n",d=0;d<l;d++){for(var f=[],p=[],g=0;g<c;g++)1===d&&p.push(Z[u]),f.push(" ");1===d&&(h+="| ".concat(p.join(" | ")," |\n")),h+="| ".concat(f.join(1===c?"":" | ")," |\n")}return mt.replaceSelection(h+"\n"),mt.focus();default:throw new Error}}),[mt,It]),ne=Object(h.useMemo)((function(){switch(It){case"link":return d.a.createElement(I,{callback:ee,onCancel:re});case"code-block":return d.a.createElement(_.b,{callback:ee,onCancel:re});case"upload-image":return d.a.createElement(B,{callback:ee,onCancel:re});case"add-table":return d.a.createElement(Y,{callback:ee,onCancel:re});default:return null}}),[It]);function re(){_t("")}Object(h.useEffect)((function(){if($t.current){var t=$t.current,e=!1,n=0;function r(t){e=!0,n=t.pageY}function i(){e=!1}function a(t){if(e){var r=t.pageY-n;r<0&&(r=0),r>300&&(r=300),Ht(x+r+"px")}}return t.addEventListener("mousedown",r),document.addEventListener("mousemove",a),document.addEventListener("mouseup",i),function(){t.removeEventListener("mousedown",r),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)}}}),[mt,$t]),Object(h.useEffect)((function(){Ht(x)}),[x]);var ie={width:tt(y),height:tt(Ut)};Object(h.useMemo)((function(){if(Pt){var t=new Date(Pt),e=t.getHours(),n=t.getMinutes(),r=t.getSeconds();return n=n<10?"0"+n:n,r=r<10?"0"+r:r,"".concat(e=e<10?"0"+e:e,":").concat(n,":").concat(r)}return 0}),[Pt]);return d.a.createElement(h.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xt},d.a.createElement("div",{className:"markdown-editor-container ".concat(st," ").concat(wt?"on-preview":""," ").concat(C?"mini":""," ").concat(At?"full-screen":""),style:ie},d.a.createElement(T,{insertTemp:L,watch:wt,fullScreen:At,showNullButton:z,onActionCallback:te,hidetoolBar:V,uuid:Vt.current,setOpenPhones:function(){Kt.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:Yt,placeholder:ht})),wt?d.a.createElement("div",{ref:Jt,className:"preview-container"},"stex"===R&&d.a.createElement(v,{value:xt}),"stex"!==R&&d.a.createElement(m.a,{edit:!0,value:xt,replaces:function(t,e){var n=mt.getValue();n=n.replace(t,e),St(n),null==mt||mt.setValue(n)}})):null))),F?d.a.createElement("a",{ref:$t,className:"editor-resize"}):null,d.a.createElement(O.a,null,it[It]?d.a.createElement(r.a,{centered:!0,title:it[It],visible:!0,onCancel:re,footer:null},ne):null))}},PD8m:
/*!******************************************************!*\
!*** ./node_modules/store/storages/memoryStorage.js ***!
\******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports={name:"memoryStorage",read:function(t){return n[t]},write:function(t,e){n[t]=e},each:function(t){for(var e in n)n.hasOwnProperty(e)&&t(n[e],e)},remove:function(t){delete n[t]},clearAll:function(t){n={}}};var n={}},QUZ3:
/*!***************************************************!*\
!*** ./src/pages/MyProblem/index.tsx + 9 modules ***!
\***************************************************/
/*! exports provided: default */
/*! all exports used */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/CopyOutlined.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/FormOutlined.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/PoweroffOutlined.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/LeftPanel/Description/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/LeftPanel/Discuss/discuss-input-editor/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/LeftPanel/SubmitList/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/LeftPanel/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Problems/OjForm/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/NoData/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/SplitContainer/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/image-preview/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/mediator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/TestCasePanel/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/interface.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/MyProblem/service.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Problems/OjForm/CodePanel/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/service/exercise.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fullscreen.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/code-repository/action-bar/notice.gif (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/pagination/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/pagination/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/spin/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/spin/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/statistic/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/statistic/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/table/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/table/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tag/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tag/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/js-base64/base64.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/moment/moment.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router-dom/esm/react-router-dom.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.r(e);var r=n("0Owb"),i=n("PpiC"),a=(n("T2oS"),n("W9HT")),o=(n("+L6B"),n("2/Rp")),s=(n("2qtc"),n("kLXV")),l=n("9og8"),c=n("tJVT"),u=n("k1fw"),h=(n("aHsQ"),n("sGsY")),d=n("WmNS"),f=n.n(d),p=n("q1tI"),g=n.n(p),m=n("Fvcw"),v=n("GIiI"),y=n("Ty5D"),b=n("55Ip"),x=n("OJz4"),S=n("V0Rq"),C=n("bntm"),E=n("cDPC"),w=n("m3rI"),k=n("RCxd"),T=n("EHPI"),O=n("S+dL"),A=n.n(O),L=n("J66h"),D=n("uMZB"),R=n.n(D),I=(n("p/48"),n("JPnl")),_=(n("y8nQ"),n("Vl3Y")),M=(n("5NDa"),n("5rEg").a.TextArea),N=function(t){var e=t.callback,n=t.onCancel,r=t.notes;return g.a.createElement(_.a,{className:"note-form-panel",onFinish:function(t){e(t)},initialValues:{notes:r}},g.a.createElement(_.a.Item,{name:"notes",rules:[{required:!0,message:"请输入笔记内容"},{max:5e3,message:"笔记最大字数为".concat(5e3)}]},g.a.createElement(M,{placeholder:"请输入笔记内容",rows:5})),g.a.createElement(_.a.Item,{style:{textAlign:"right"}},g.a.createElement(o.a,{type:"ghost",onClick:n,style:{marginRight:10}}," 取消 "),g.a.createElement(o.a,{type:"primary",htmlType:"submit"}," 提交 ")))},P=n("H2Ag"),F=n.n(P),j=(n("DjyN"),n("NUBc")),B=(n("miYZ"),n("tsqr")),U=(n("g9YV"),n("wCAj")),H=n("+k/U"),G=n.n(H),z=n("ye1Q"),W=n("lfch"),V=n("JB8y"),K=n("1vsH"),q=n("wd/R"),Y=n.n(q),X=U.a.Column,$=function(t){var e=t.submitResult,n=t.submitting,r=t.submitRecords,i=t.page,o=t.onPageChange,s=t.topicId,l=e||{},c=l.status,u=l.id,h=l.input,d=l.output,f=l.expected_output,p=l.is_file,m=l.input_file_url,v=l.output_file_url,y=l.expected_output_file_url,x=l.error_msg,S=r||{},C=S.records,E=S.records_count;return g.a.createElement(a.a,{spinning:n,tip:"评测中...",indicator:g.a.createElement(z.a,{style:{fontSize:24},spin:!0})},u?g.a.createElement(g.a.Fragment,null,g.a.createElement("ul",{className:G.a.info},g.a.createElement("li",null,"执行结果:",g.a.createElement("span",{className:c===V.a.OK?"c-green":"c-red"},I.a[c])),g.a.createElement("li",{className:G.a.error},g.a.createElement("a",{onClick:function(){p?navigator.clipboard.writeText(L.Base64.decode(x)).then((function(){B.b.success("复制错误信息成功")})):navigator.clipboard.writeText(L.Base64.decode(d)).then((function(){B.b.success("复制错误信息成功")}))}},"复制错误信息 ",g.a.createElement(W.a,null)," ")),g.a.createElement("li",null,g.a.createElement(b.a,{to:"/myproblems/".concat(s,"/record-detail/").concat(u)},"显示详情 >"," "))),c!==V.a.OK?g.a.createElement(g.a.Fragment,null,g.a.createElement("p",{className:"c-red"},"实际输入:"),g.a.createElement("pre",null,!p&&h,p&&g.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(K.w)(m,h)}},h)),g.a.createElement("p",{className:"c-red"},"实际输出:"),g.a.createElement("pre",null,(4===c||5===c)&&L.Base64.decode(x),4!=c&&5!=c&&(p?g.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(K.w)(v,d)}},d):L.Base64.decode(d))),g.a.createElement("p",{className:"c-red"},"预期输出:"),g.a.createElement("pre",null,!p&&L.Base64.decode(f),p&&g.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(K.w)(y,f)}},f))):null):null,(null==C?void 0:C.length)>0?g.a.createElement(U.a,{dataSource:C,rowKey:"id",pagination:!1},g.a.createElement(X,{title:"提交时间",dataIndex:"created_at",key:"created_at",render:function(t,e){return g.a.createElement("span",null," ",Y()(t).format("YYYY-MM-DD HH:mm:ss"))}}),g.a.createElement(X,{title:"提交结果",dataIndex:"status",key:"status",render:function(t,e){var n;return g.a.createElement(b.a,{className:0===t?"c-green":"c-red",to:"/myproblems/".concat(s,"/record-detail/").concat(e.id)},null===(n=I.a[t])||void 0===n?void 0:n.replace("调试","评测"))}}),g.a.createElement(X,{title:"执行用时 (S)",dataIndex:"execute_time",key:"execute_time"}),g.a.createElement(X,{title:"内存消耗MB",dataIndex:"execute_memory",key:"execute_memory"}),g.a.createElement(X,{title:"语言",dataIndex:"language",key:"language"}),g.a.createElement(X,{title:"操作",dataIndex:"status",key:"status",render:function(t,e){return g.a.createElement(b.a,{className:"c-light-primary",to:"/myproblems/".concat(s,"/record-detail/").concat(e.id)},"查看")}})):g.a.createElement("div",{style:{height:300,width:"100%"}}),E>15?g.a.createElement(j.a,{className:G.a.pagination,current:i,pageSize:15,total:E,onChange:o}):null)},J=n("BdwD"),Z=(n("DYRE"),n("zeV3")),Q=(n("+BJd"),n("mr32")),tt=n("pPuO"),et=n.n(tt),nt=n("9Bee"),rt={1:{name:"简单",color:"#52c41a"},2:{name:"中等",color:"#faad14"},3:{name:"困难",color:"#f5222d"}},it=function(t){var e=t.hack,n=(t.onTriggerPraise,t.toDiscuss),r=e.language,i=e.difficult,a=e.time_limit,o=(e.username,e.user_path,e.user_praise,e.comments_count),s=(e.praises_count,e.description),l=e.pass_count,c=e.submit_count,u=Object(y.h)(),h=rt[i];return g.a.createElement(g.a.Fragment,null,g.a.createElement("ul",{className:et.a.info},g.a.createElement("li",null,"编程语:",g.a.createElement("b",null,r)),g.a.createElement("li",null,"难度:",g.a.createElement(Q.a,{color:h.color},h.name)),g.a.createElement("li",null,"评测时长限制:",g.a.createElement("b",null,a,"秒"))),g.a.createElement(nt.a,{value:s,className:et.a.desc}),g.a.createElement("ul",{className:et.a["commit-info"]},g.a.createElement("li",null,g.a.createElement(Z.a,{size:4},g.a.createElement("span",null,"通过次数")," ",g.a.createElement("b",null,l))),g.a.createElement("li",null,g.a.createElement(Z.a,{size:4},g.a.createElement("span",null,"提交次数")," ",g.a.createElement("b",null,c))," "),g.a.createElement("li",{style:{flex:"1 0 0"}}),"exercises"!==u.query.type&&g.a.createElement("li",null,g.a.createElement(Z.a,{size:4},g.a.createElement("i",{className:"iconfont icon-huifu1",onClick:n})," ",g.a.createElement("b",null,o))," ")))},at=n("dhSg"),ot=n("oBTY"),st=n("M8RZ"),lt=(n("qJ4+"),n("ErOA"));function ct(t,e){return Object(lt.c)("/problems/".concat(t,"/comments.json?page=").concat(e,"&limit=10"))}function ut(t){return Object(lt.f)("/discusses/".concat(t,"/plus.json"),{container_type:"Discuss",type:1})}function ht(t,e,n){return Object(lt.f)("/problems/".concat(t,"/comments/reply.json"),{comments:{content:n,parent_id:e}})}function dt(t,e){return Object(lt.f)("/problems/".concat(t,"/comments.json"),{comments:{content:e}})}function ft(t,e,n){return Object(lt.f)("/problems/".concat(t,"/comments/").concat(e,"/hidden.json"),n)}function pt(t,e){return Object(lt.b)("/problems/".concat(t,"/comments/").concat(e))}n("U7T7");var gt=n("AMnG");function mt(t){var e=t.author;return g.a.createElement("a",{href:"/users/".concat(e.login),target:"_blank"},g.a.createElement("img",{alt:"用户头像",height:"50",style:{borderRadius:"50%"},src:"".concat(w.a.IMG_SERVER,"/images/").concat(e.image_url),width:"50"}))}function vt(t){var e=t.data,n=t.index,r=t.parentDiscussIndex,i=t.user,a=t.onSetActionType,o=e.author,s=e.can_delete,l=e.content,c=e.id,u=e.time;var h=i.admin||s||o.user_id===i.user_id;return g.a.createElement("div",{className:"discuss-item-container second-discuss "},g.a.createElement(mt,{author:o}),g.a.createElement("section",null,g.a.createElement("div",{className:"discuss-info"},g.a.createElement("a",{href:"/users/".concat(o.login),target:"_blank"},o.name),g.a.createElement("span",{className:"grey"},u),g.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},h?g.a.createElement("a",{onClick:function(){a({id:c,index:n,type:"delete-discuss",parentDiscussIndex:r,message:"确定要删除该条回复吗"})},title:"删除"},g.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),g.a.createElement(nt.a,{className:"discuss-content",value:l})))}var yt,bt=function(t){var e=t.user,n=t.data,r=t.index,i=t.onPlusDiscuss,a=t.onSetActionType,o=t.activeDiscussIndex,s=t.onReplyDiscuss,l=t.onSetActiveDiscussIndex,c=n.content,u=n.children,h=n.hidden,d=n.id,f=n.praise_count,p=n.time,m=n.user_praise,v=n.can_delete,y=n.author;var b=e.admin||e.user_id===y.user_id;return g.a.createElement("div",{className:"discuss-item-container",key:d},g.a.createElement(mt,{author:y}),g.a.createElement("section",null,g.a.createElement("div",{className:"discuss-info"},g.a.createElement("a",{href:"/users/".concat(y.login),target:"_blank"}," ",y.name," "),g.a.createElement("span",{className:"grey"},p)),g.a.createElement(nt.a,{className:"discuss-content",value:c}),u&&u.length>0?g.a.createElement("div",{className:"reply-discuss-container"},u.map((function(t,n){return g.a.createElement(vt,{key:t.id,data:t,index:n,user:e,onSetActionType:a,parentDiscussIndex:r})}))):null,g.a.createElement("div",{className:"btn-group"},b?g.a.createElement("a",{onClick:function(){a({id:d,index:r,params:{hidden:h?"0":"1"},type:"hidden-discuss",message:h?"确定要取消隐藏该条回复吗":"确定要隐藏该条回复吗"})},title:h?"取消隐藏":"隐藏评论"},g.a.createElement("i",{className:h?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,!v||u&&0!=u.length?null:g.a.createElement("a",{onClick:function(){a({id:d,index:r,type:"delete-discuss",message:"确定要删除该条回复吗"})},title:"删除"},g.a.createElement("i",{className:"iconfont icon-shanchu"})),g.a.createElement("a",{onClick:function(){l(d)},title:"回复"}," ",g.a.createElement("i",{className:"iconfont icon-huifu1"})," "),g.a.createElement("a",{onClick:function(){i(d,!m,r)},className:m?"c-orange":""},g.a.createElement("i",{className:m?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),g.a.createElement("span",null,f||""))),g.a.createElement(gt.a,{id:d,activeDiscussIndex:o,onReplyDiscuss:s})))},xt=n("kaH+"),St=n("uD2n"),Ct=n.n(St),Et=n("Ot1p"),wt=function(t){var e=t.user_praise,n=t.praise_count,r=t.praisePlus,i=t.onCreateDiscuss,a=t.discuss_count,o=Object(p.useState)(!1),s=Object(c.a)(o,2),u=s[0],h=s[1],d=Object(p.useState)(""),m=Object(c.a)(d,2),v=m[0],y=m[1];function b(){h(!1)}function x(){return(x=Object(l.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i(v),y(""),h(!1);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return g.a.createElement("div",{className:"".concat(Ct.a["dis-input-editor-container"]," ").concat(u?Ct.a.active:""," ")},g.a.createElement("div",{className:u?"hide ".concat(Ct.a["text-area"]):Ct.a["text-area"]},g.a.createElement("input",{placeholder:"说点什么",onClick:function(){h(!0)}}),g.a.createElement("a",null," ",g.a.createElement("i",{className:"iconfont icon-huifu1"}),"    ",a," "),g.a.createElement("a",{className:"c-light-black",onClick:r,title:e?"取消点赞":"点赞"},g.a.createElement("i",{className:"mr3 ".concat(e?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),n?g.a.createElement("span",null,n):"")),u?g.a.createElement("div",{className:Ct.a["input-mask"],onClick:b}):null,g.a.createElement("div",{className:u?Ct.a["md-container"]:"".concat(Ct.a["md-container"]," hide")},g.a.createElement(Et.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:v,height:240,onChange:function(t){y(t)}}),g.a.createElement("div",{className:Ct.a["tip-container"],onClick:b},g.a.createElement("a",{className:Ct.a["btn-send"],onClick:function(){return x.apply(this,arguments)}}," 发送 "))))},kt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null};function Tt(t,e){switch(e.type){case yt.SHOW_DISCUSSES_LOADING:return Object(u.a)(Object(u.a)({},t),{},{loading:!0});case yt.GET_DISCUSSES:case yt.TOP_OR_DOWN_DISCUSS:case yt.SET_ACTION_TYPE:case yt.PLUS_DISCUSS:return Object(u.a)(Object(u.a)({},t),e.payload);case yt.SET_PAGE:return Object(u.a)(Object(u.a)({},t),{},{page:e.payload});case yt.ACTIVE_DISCUSS_INDEX:return Object(u.a)(Object(u.a)({},t),e.payload);default:throw new Error}}!function(t){t[t.GET_DISCUSSES=0]="GET_DISCUSSES",t[t.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",t[t.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",t[t.PLUS_DISCUSS=3]="PLUS_DISCUSS",t[t.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",t[t.SET_PAGE=5]="SET_PAGE",t[t.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"}(yt||(yt={}));var Ot,At=function(t){var e=t.user,n=t.identifier,r=t.hack,i=t.onTriggerPraise,a=Object(p.useReducer)(Tt,kt),o=Object(c.a)(a,2),u=o[0],h=o[1],d=(u.loading,u.page),m=u.data,v=u.count,y=u.actionType,b=u.activeDiscussIndex,x=Object(p.useCallback)(Object(l.a)(f.a.mark((function t(){var e,r,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h({type:yt.SHOW_DISCUSSES_LOADING}),t.next=3,ct(n,d);case 3:e=t.sent,r=e.comments,i=e.disscuss_count,h({type:yt.GET_DISCUSSES,payload:{data:r,count:i,loading:!1}});case 6:case"end":return t.stop()}}),t)}))),[d,n]);function S(t){h({type:yt.SET_ACTION_TYPE,payload:{actionType:t}})}function C(t){h(b===t?{type:yt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}:{type:yt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:t}})}function E(t,e,n){return w.apply(this,arguments)}function w(){return(w=Object(l.a)(f.a.mark((function t(e,n,r){var i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ut(e);case 3:i=t.sent,m[r].user_praise=n,m[r].praise_count=i.praise_count,h({type:yt.PLUS_DISCUSS,payload:{data:Object(ot.a)(m)}}),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])})))).apply(this,arguments)}function k(){return(k=Object(l.a)(f.a.mark((function t(){var e,r,i,a,o,s,l,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y.id,r=y.params,i=y.type,a=y.index,o=y.parentDiscussIndex,"hidden-discuss"!==i){t.next=6;break}return t.next=4,ft(n,e,r);case 4:o?m[o].children[a].hidden=1==r.hidden:m[a].hidden=1==r.hidden,h({type:yt.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ot.a)(m)}});case 6:if("delete-discuss"!==i){t.next=31;break}return t.next=9,pt(n,e);case 9:if(!o&&0!==o){t.next=22;break}s=m[o].children,l=s.length-1;case 12:if(!(l>=0)){t.next=19;break}if(s[l].id!==e){t.next=16;break}return s.splice(l,1),t.abrupt("break",19);case 16:l--,t.next=12;break;case 19:m[o].children=s,t.next=30;break;case 22:c=m.length-1;case 23:if(!(c>=0)){t.next=30;break}if(m[c].id!==e){t.next=27;break}return m.splice(c,1),t.abrupt("break",30);case 27:c--,t.next=23;break;case 30:h({type:yt.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ot.a)(m)}});case 31:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(t,e){return O.apply(this,arguments)}function O(){return(O=Object(l.a)(f.a.mark((function t(e,r){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ht(n,e,r);case 3:x(),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log(t.t0);case 9:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}function A(){return(A=Object(l.a)(f.a.mark((function t(e){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h({type:yt.SHOW_DISCUSSES_LOADING}),t.next=3,dt(n,e);case 3:x();case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return Object(p.useEffect)((function(){x()}),[n,d]),g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{className:"discuss-panel"},0===m.length?g.a.createElement(J.a,null):m.map((function(t,n){return g.a.createElement(bt,{onReplyDiscuss:T,onPlusDiscuss:E,onSetActiveDiscussIndex:C,onSetActionType:S,data:t,index:n,user:e,activeDiscussIndex:b})})),v>10?g.a.createElement("div",{className:"pagination-container"},g.a.createElement(j.a,{showQuickJumper:!0,onChange:function(t){h({type:yt.SET_PAGE,page:t})},current:d,total:v})):null),g.a.createElement(wt,{user_praise:r.user_praise,praise_count:r.praises_count,praisePlus:i,discuss_count:r.comments_count,onCreateDiscuss:function(t){return A.apply(this,arguments)}}),g.a.createElement(st.a,null,g.a.createElement(s.a,{centered:!0,title:"提示",visible:!!y,onOk:function(){return k.apply(this,arguments)},onCancel:function(){h({type:yt.SET_ACTION_TYPE,payload:{actionType:null}})}},g.a.createElement("p",null,y?y.message:"")),g.a.createElement(xt.a,null)))},Lt=function(t){var e=t.hack;return g.a.createElement("div",{style:{padding:20}},g.a.createElement("div",{className:"font16 c-grey-333"},"样例代码:"),g.a.createElement(nt.a,{hasMask:!0,value:null==e?void 0:e.standard_answer,zoomImg:!0}))},Dt=function(t){var e=t.hack,n=t.onTriggerPraise,r=t.topicId,i=t.page,a=t.onPageChange,o=t.user,s=t.submitRecords,l=t.submitting,u=t.submitResult,h=Object(p.useState)("0"),d=Object(c.a)(h,2),f=d[0],m=d[1],v=Object(y.h)();function b(t){var e=t.target.id;m(e)}return Object(p.useEffect)((function(){return at.a.subscribe("to-commit-info",(function(){m("1")}))}),[]),console.log(s,"submitRecords"),g.a.createElement("div",{className:F.a["left-panel"]},g.a.createElement("ul",{className:"".concat(F.a["s-navs"],' "bg-white"')},g.a.createElement("li",null,g.a.createElement("a",{className:"0"===f?F.a.active:"",id:"0",onClick:b},"任务描述")),g.a.createElement("li",null,g.a.createElement("a",{className:"1"===f?F.a.active:"",id:"1",onClick:b},"提交记录")),"exercises"!==v.query.type&&g.a.createElement("li",null,g.a.createElement("a",{className:"2"===f?F.a.active:"",id:"2",onClick:b},"评论")),g.a.createElement("li",null,g.a.createElement("a",{className:"3"===f?F.a.active:"",id:"3",onClick:b},"样例代码"))),g.a.createElement("div",{className:"".concat(F.a["tab-panel-body"]," ").concat("0"===f?"":"hide")},g.a.createElement(it,{hack:e,onTriggerPraise:n,toDiscuss:function(){m("2")}})),g.a.createElement("div",{className:"".concat(F.a["tab-panel-body"]," ").concat("1"===f?"":"hide")},null!=s&&s.records_count||l?g.a.createElement($,{page:i,onPageChange:a,topicId:r,submitting:l,submitRecords:s,submitResult:u}):g.a.createElement(J.a,null)),g.a.createElement("div",{className:"".concat(F.a["tab-panel-body"]," ").concat("2"===f?"":"hide"),style:{padding:0}},g.a.createElement(At,{user:o,identifier:e.identifier,hack:e,onTriggerPraise:n})),g.a.createElement("div",{className:"".concat(F.a["tab-panel-body"]," ").concat("3"===f?"":"hide"),style:{padding:0}},g.a.createElement(Lt,{hack:e})))},Rt=h.a.Countdown,It={Java:"java",C:"c",Python:"py","C++":"c"};function _t(){return(new Date).getTime()}!function(t){t[t.SET_LOADING=0]="SET_LOADING",t[t.GET_DATA=1]="GET_DATA",t[t.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",t[t.SET_DATA=3]="SET_DATA",t[t.SET_DEBUGING=4]="SET_DEBUGING",t[t.SET_SUBMITING=5]="SET_SUBMITING",t[t.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",t[t.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",t[t.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",t[t.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",t[t.SET_PAGE=10]="SET_PAGE"}(Ot||(Ot={}));var Mt={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function Nt(t,e){switch(e.type){case Ot.GET_DATA:return Object(u.a)(Object(u.a)({},t),e.payload);case Ot.SET_DATA:return Object(u.a)(Object(u.a)({},t),{},{data:e.payload});case Ot.SET_LOADING:return Object(u.a)(Object(u.a)({},t),{},{loading:e.payload});case Ot.SET_SHOW_NOTE:return Object(u.a)(Object(u.a)({},t),{},{showNote:e.payload});case Ot.SET_DEBUGING:return Object(u.a)(Object(u.a)({},t),{},{debuging:e.payload});case Ot.SET_SUBMITING:return Object(u.a)(Object(u.a)({},t),{},{submitting:e.payload});case Ot.GET_SUBMIT_RECORDS:return Object(u.a)(Object(u.a)({},t),{},{submitRecords:e.payload});case Ot.SET_PAGE:return Object(u.a)(Object(u.a)({},t),{},{submitRecordPage:e.payload});case Ot.SET_EXECUTE_MESSAGE:return Object(u.a)(Object(u.a)({},t),{},{executingMessage:e.payload});case Ot.SET_EXECUTE_RESULT:case Ot.SET_SUBMIT_RESULT:return Object(u.a)(Object(u.a)({},t),e.payload);default:throw new Error}}e.default=function(t){t.children;var e,n,r,i=Object(p.useReducer)(Nt,Mt),h=Object(c.a)(i,2),d=h[0],k=h[1],T=Object(y.i)().id,O=Object(y.g)(),A=Object(y.h)(),D=d.loading,I=d.data,_=d.debugResult,M=d.submitResult,N=d.submitRecords,P=d.submitRecordPage,F=d.showNote,j=d.debuging,B=d.submitting,U=d.executingMessage,H=Object(p.useState)("#FFF"),G=Object(c.a)(H,2),z=G[0],W=G[1],V=Object(p.useState)(null),K=Object(c.a)(V,2),q=K[0],Y=K[1],X=Object(p.useState)({}),$=Object(c.a)(X,2),J=$[0],Z=$[1],Q=Object(p.useState)(!0),tt=Object(c.a)(Q,2),et=tt[0],nt=tt[1],rt=null==I?void 0:I.user,it=null==I?void 0:I.hack;Object(p.useEffect)((function(){function t(){return(t=Object(l.a)(f.a.mark((function t(){var e,n,r,i,a,o,s,l,c,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return nt(!0),t.next=3,Object(x.d)(T);case 3:if(e=t.sent,setTimeout((function(){nt(!1)}),800),401===e.status?document.location.href="/user/login":(e.hack.code=L.Base64.decode(e.hack.code),k({type:Ot.GET_DATA,payload:{loading:!1,data:e}})),"exercises"!==A.query.type){t.next=18;break}if("coursesId"!=A.query.coursesId){t.next=13;break}return t.next=10,Object(S.X)({categoryId:A.query.exercisesId,login:A.query.login});case 10:a=t.sent,t.next=16;break;case 13:return t.next=15,Object(S.y)({categoryId:A.query.exercisesId,login:A.query.login});case 15:a=t.sent;case 16:Z(Object(u.a)({},a)),null!==(n=a)&&void 0!==n&&n.left_banner_id&&null!==(r=a)&&void 0!==r&&null!==(i=r.exercise)&&void 0!==i&&i.left_time&&(Y(Date.now()+1e3*(null===(o=a)||void 0===o||null===(s=o.exercise)||void 0===s?void 0:s.left_time)),setTimeout((function(){W("red")}),1e3*((null===(l=a)||void 0===l||null===(c=l.exercise)||void 0===c?void 0:c.left_time)-300>0?(null===(h=a)||void 0===h||null===(d=h.exercise)||void 0===d?void 0:d.left_time)-300:0)));case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}T&&function(){t.apply(this,arguments)}()}),[T]),Object(p.useEffect)((function(){return function(){st.apply(this,arguments)}(),"exercises"===A.query.type&&(document.addEventListener(Object(C.c)(),ot),window.focus(),window.onblur=function(){Object(C.a)()&&Object(C.b)()}),function(){document.removeEventListener(Object(C.c)(),ot)}}),[T,P]);var ot=function(){window.parent.postMessage("backExercise","*")};function st(){return(st=Object(l.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(x.f)(T,{limit:15,page:P});case 3:e=t.sent,k({type:Ot.GET_SUBMIT_RECORDS,payload:e}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}function lt(){return ct.apply(this,arguments)}function ct(){return(ct=Object(l.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.k)(T,{code:L.Base64.encode(it.code)});case 2:return e=t.sent,t.abrupt("return",e);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ut(){return(ut=Object(l.a)(f.a.mark((function t(){var e,n,r,i,a,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!B){t.next=2;break}return t.abrupt("return");case 2:return k({type:Ot.SET_SUBMITING,payload:!0}),t.prev=3,t.next=6,Object(x.l)(T);case 6:return at.a.publish("to-commit-info"),t.next=9,lt();case 9:if(e=t.sent,console.log(e,1),0!==e.status){t.next=25;break}return o=function(){return(o=Object(l.a)(f.a.mark((function t(){var e,n,o,l,c,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.c)(T,"submit");case 2:if(e=t.sent,n=e.status,o=e.data,l=_t(),c=l-i>1e3*(r+3),0===n||c||setTimeout(a,1e3),!c){t.next=12;break}return s.a.error({centered:!0,okText:"知道啦",content:"评测代码超时"}),k({type:Ot.SET_SUBMITING,payload:!1}),t.abrupt("return");case 12:if(0!==n){t.next=18;break}return 2===o.status&&s.a.error({centered:!0,okText:"知道啦",content:"评测代码超时"}),t.next=16,Object(x.f)(T,{limit:15,page:P});case 16:h=t.sent,k({type:Ot.SET_SUBMIT_RESULT,payload:Object(u.a)(Object(u.a)({},d),{},{submitResult:o,submitting:!1,submitRecords:h})});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)},a=function(){return o.apply(this,arguments)},n={},"exercises"===A.query.type&&(n.extras={exercise_id:A.query.exercisesId,question_id:A.query.questionId}),t.next=18,Object(x.h)(T,n);case 18:if(-1!==t.sent.status){t.next=22;break}return window.parent.location.href="/classrooms/".concat(A.query.coursesId,"/exercise/").concat(A.query.exercisesId,"/detail"),t.abrupt("return");case 22:r=it.time_limit,i=_t(),a();case 25:t.next=31;break;case 27:t.prev=27,t.t0=t.catch(3),console.log(t.t0),k({type:Ot.SET_SUBMITING,payload:!1});case 31:case"end":return t.stop()}}),t,null,[[3,27]])})))).apply(this,arguments)}function ht(){return(ht=Object(l.a)(f.a.mark((function t(){var e,n,r,i,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d.debuging=!0,k({type:Ot.SET_DEBUGING,payload:!0}),t.prev=2,t.next=5,lt();case 5:if(0!==t.sent.status){t.next=22;break}return a=function(){return(a=Object(l.a)(f.a.mark((function t(){var n,a,o,l,c,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.c)(T,"debug");case 2:if(n=t.sent,a=n.status,o=n.message,l=n.data,c=_t(),h=c-r>1e3*(e+3),0===a||h||(k({type:Ot.SET_EXECUTE_MESSAGE,payload:o}),setTimeout(i,1e3)),!h){t.next=13;break}return s.a.error({centered:!0,okText:"知道啦",content:"调试代码超时"}),k({type:Ot.SET_DEBUGING,payload:!1}),t.abrupt("return");case 13:0===a&&(k({type:Ot.SET_DEBUGING,payload:!1}),2===l.status&&s.a.error({centered:!0,okText:"知道啦",content:"调试代码超时"}),2===l.status&&s.a.error({centered:!0,okText:"知道啦",content:"调试代码超时"}),k({type:Ot.SET_EXECUTE_RESULT,payload:Object(u.a)(Object(u.a)({},d),{},{debugResult:l,debuging:!1})}));case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)},i=function(){return a.apply(this,arguments)},e=it.time_limit,n={input:encodeURIComponent(I.test_case.input)},"exercises"===A.query.type&&(n.exercise_id=A.query.exercisesId),t.next=14,Object(x.b)(T,n);case 14:if(-1!==t.sent.status){t.next=18;break}return window.parent.location.href="/classrooms/".concat(A.query.coursesId,"/exercise/").concat(A.query.exercisesId,"/detail"),t.abrupt("return");case 18:r=_t(),i(),t.next=23;break;case 22:k({type:Ot.SET_DEBUGING,payload:!1});case 23:t.next=28;break;case 25:t.prev=25,t.t0=t.catch(2),console.log(t.t0);case 28:return t.prev=28,t.finish(28);case 30:case"end":return t.stop()}}),t,null,[[2,25,28,30]])})))).apply(this,arguments)}function dt(t){k({type:Ot.SET_DATA,payload:Object(u.a)(Object(u.a)({},I),{},{hack:Object(u.a)(Object(u.a)({},it),{},{code:t})})})}function ft(){return(ft=Object(l.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(x.g)(T);case 3:401===(e=t.sent).status?O.replace("/login",{from:A.pathname}):dt(L.Base64.decode(e.code)),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}function pt(){return(pt=Object(l.a)(f.a.mark((function t(e){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.a)(T,e);case 2:k({type:Ot.GET_DATA,payload:{showNote:!1,data:Object(u.a)(Object(u.a)({},I),{},{hack:Object(u.a)(Object(u.a)({},it),{},{notes:e.notes})})}});case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var gt={input:null==I||null===(e=I.test_case)||void 0===e?void 0:e.input,language:null==it?void 0:it.language,code:null==it?void 0:it.code,title:"main."+It[null==it?void 0:it.language],modify_code:null==it?void 0:it.modify_code,notes:null==it?void 0:it.notes,debugResult:_,debuging:j,submitting:B,executingMessage:U,onCancelNote:function(){k({type:Ot.SET_SHOW_NOTE,payload:!1})},onAddNote:function(t){return pt.apply(this,arguments)},showNote:F,onShowNote:function(){k({type:Ot.SET_SHOW_NOTE,payload:!0})},onSubmitCode:function(){return ut.apply(this,arguments)},onChangeCode:dt,onChangeInput:function(t){var e=t.target.value;k({type:Ot.SET_DATA,payload:Object(u.a)(Object(u.a)({},I),{},{test_case:{input:e}})})},onDebugCode:function(){return ht.apply(this,arguments)},onResetCode:function(){return ft.apply(this,arguments)},onSyncCode:function(){s.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:g.a.createElement("p",null,"初始代码有修改,更新后将覆盖现有代码哦~ ",g.a.createElement("br",null),"请将您编辑的代码保存至本地,以防丢失"),onOk:function(){return Object(l.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.i)(T);case 2:401===(e=t.sent).status?O.replace("/login",{from:A.pathname}):dt(L.Base64.decode(e.code));case 4:case"end":return t.stop()}}),t)})))()}})},onUpdateCode:lt};function mt(){return(mt=Object(l.a)(f.a.mark((function t(){var e,n,r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.j)(it.id,{container_type:"Hack",type:1});case 2:e=t.sent,n=e.praise_count,r=Object(u.a)(Object(u.a)({},I),{},{hack:Object(u.a)(Object(u.a)({},it),{},{praises_count:n,user_praise:!it.user_praise})}),k({type:Ot.SET_DATA,payload:r});case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vt={topicId:T,submitResult:M,submitRecords:N,submitting:B,page:P,onPageChange:function(t){k({type:Ot.SET_PAGE,payload:t})},hack:it,user:null==I?void 0:I.user,onTriggerPraise:function(){return mt.apply(this,arguments)}};return g.a.createElement(g.a.Fragment,null,g.a.createElement(a.a,{spinning:D,delay:500},I?g.a.createElement(g.a.Fragment,null,g.a.createElement("header",{className:R.a.header},"exercises"!==A.query.type&&g.a.createElement("div",null,g.a.createElement("img",{src:"".concat(w.a.IMG_SERVER,"/images/").concat(rt.image_url),alt:"user",width:30}),g.a.createElement("span",null,rt.name)),g.a.createElement("h2",null," ",it.name," "),rt.hack_manager?g.a.createElement(b.a,{className:R.a.btn_back,to:"/problems/".concat(it.identifier,"/edit"),style:{marginRight:10}}," ",g.a.createElement(m.a,null)," 编辑"):null,(null==J||null===(n=J.exercise)||void 0===n?void 0:n.left_time)&&g.a.createElement(g.a.Fragment,null,g.a.createElement("span",{style:{color:z},className:"iconfont icon-kaoshishichang mr5"}),g.a.createElement("span",{className:"c-white mr20"},g.a.createElement(Rt,{valueStyle:{color:z,fontSize:16,fontWeight:"normal"},title:g.a.createElement("span",{style:{color:z,fontSize:16}},"剩余时间:"),value:q,onFinish:Object(l.a)(f.a.mark((function t(){var e,n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(S.Y)({categoryId:A.query.exercisesId,commit_method:2});case 2:0===(null==(e=t.sent)?void 0:e.status)&&(lt(),s.a.info({width:530,title:"提示",centered:!0,okText:"确定",content:g.a.createElement("div",{className:"tc font16"},"答题结束了,系统已自动提交试卷",g.a.createElement("br",null),"不能再修改答题"),onOk:function(){var t=Object(l.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.parent.location.href="/classrooms/".concat(A.query.coursesId,"/exercise/").concat(A.query.exercisesId,"/detail");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()})),-3===(null==e?void 0:e.status)&&(n=parseInt(null==e?void 0:e.message),Y(Date.now()+1e3*n));case 5:case"end":return t.stop()}}),t)})))}))),"exercises"===(null==A||null===(r=A.query)||void 0===r?void 0:r.type)?g.a.createElement(o.a,{type:"primary",onClick:function(){var t;lt(),s.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:g.a.createElement("div",{className:"tc"},"请确认你的答题内容已经提交?"),onOk:(t=Object(l.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(x.l)(T);case 2:ot();case 3:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})})}},g.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," 返回试卷"):g.a.createElement(b.a,{className:R.a.btn_back,to:"/problemset"}," ",g.a.createElement(v.a,null),"退出")),g.a.createElement(a.a,{size:"large",spinning:et},g.a.createElement(E.a,{className:"my-problems",leftChild:g.a.createElement(Dt,vt),rightChild:g.a.createElement(Ft,gt)}))):null))};function Pt(t){t.title;var e=t.modify_code,n=t.onSyncCode,r=t.onShowCodeSetting,i=t.onResetCode;return g.a.createElement("div",{className:"action-bar"},g.a.createElement("span",null),e?g.a.createElement("a",{title:"更新通知",onClick:n},g.a.createElement("img",{src:A.a,alt:"notice"})):null,g.a.createElement("a",{title:"恢复初始代码",onClick:function(){s.a.confirm({title:"恢复初始代码",icon:g.a.createElement(k.a,null),content:"你在本文件中修改的内容将丢失,是否确定重新加载初始代码?",centered:!0,okText:"确定",cancelText:"取消",onOk:i})}},g.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),g.a.createElement("a",{onClick:r},g.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Ft(t){var e=t.input,n=t.showNote,a=(t.onShowNote,t.notes),o=t.onCancelNote,s=t.onAddNote,l=t.debugResult,c=t.language,u=t.debuging,h=t.submitting,d=t.executingMessage,f=t.code,p=t.onSubmitCode,m=t.onDebugCode,v=t.onChangeCode,y=t.onChangeInput,b=(t.onUpdateCode,Object(i.a)(t,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]));var x={input:e,debugResult:l,debuging:u,submitting:h,executingMessage:d,onDebugCode:m,onChangeCode:v,onSubmitCode:p,onChangeInput:y};return g.a.createElement("div",{className:"right-panel"},g.a.createElement(T.a,{language:c,value:f,onChange:v,ActionBarRender:function(t){return g.a.createElement(Pt,Object(r.a)({},b,{onShowCodeSetting:t}))}}),g.a.createElement("div",{className:"note-form-area ".concat(n?"active":"")},g.a.createElement(N,{onCancel:o,notes:a,callback:s})),g.a.createElement(I.b,x))}},RELg:
/*!**************************************************************!*\
!*** ./node_modules/store/storages/oldIE-userDataStorage.js ***!
\**************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ../src/util */"MFOe").Global;t.exports={name:"oldIE-userDataStorage",write:function(t,e){if(o)return;var n=l(t);a((function(t){t.setAttribute(n,e),t.save("storejs")}))},read:function(t){if(o)return;var e=l(t),n=null;return a((function(t){n=t.getAttribute(e)})),n},each:function(t){a((function(e){for(var n=e.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var i=n[r];t(e.getAttribute(i.name),i.name)}}))},remove:function(t){var e=l(t);a((function(t){t.removeAttribute(e),t.save("storejs")}))},clearAll:function(){a((function(t){var e=t.XMLDocument.documentElement.attributes;t.load("storejs");for(var n=e.length-1;n>=0;n--)t.removeAttribute(e[n].name);t.save("storejs")}))}};var i=r.document,a=function(){if(!i||!i.documentElement||!i.documentElement.addBehavior)return null;var t,e,n;try{(e=new ActiveXObject("htmlfile")).open(),e.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),e.close(),t=e.w.frames[0].document,n=t.createElement("div")}catch(e){n=i.createElement("div"),t=i.body}return function(e){var r=[].slice.call(arguments,0);r.unshift(n),t.appendChild(n),n.addBehavior("#default#userData"),n.load("storejs"),e.apply(this,r),t.removeChild(n)}}(),o=(r.navigator?r.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var s=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function l(t){return t.replace(/^\d/,"___$&").replace(s,"___")}},"S+dL":
/*!***************************************************************!*\
!*** ./src/pages/tasks/code-repository/action-bar/notice.gif ***!
\***************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"SA+Z":
/*!********************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/toArray.js ***!
\********************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./arrayWithHoles.js */"wTVA"),i=n(/*! ./iterableToArray.js */"EbDI"),a=n(/*! ./unsupportedIterableToArray.js */"ZhPi"),o=n(/*! ./nonIterableRest.js */"wkBT");t.exports=function(t){return r(t)||i(t)||a(t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},SJMd:
/*!****************************************************!*\
!*** ./node_modules/code-prettify/src/prettify.js ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var t=window,e=["break,continue,do,else,for,if,return,while"],n=[[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],r=[n,"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"],i=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[n,"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"],o=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[e,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[e,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(t,e,n,r,i){if(n){var a={sourceNode:t,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:e,decorations:null};r(a),i.push.apply(i,a.decorations)}}var f=/\S/;function p(t){for(var e=void 0,n=t.firstChild;n;n=n.nextSibling){var r=n.nodeType;e=1===r?e?t:n:3===r&&f.test(n.nodeValue)?t:e}return e===t?void 0:e}function g(t,e){var n,r={};!function(){for(var i=t.concat(e),a=[],o={},s=0,l=i.length;s<l;++s){var c=i[s],u=c[3];if(u)for(var h=u.length;--h>=0;)r[u.charAt(h)]=c;var d=c[1],f=""+d;o.hasOwnProperty(f)||(a.push(d),o[f]=null)}a.push(/[\0-\uffff]/),n=function(t){for(var e=0,n=!1,r=!1,i=0,a=t.length;i<a;++i){if((d=t[i]).ignoreCase)r=!0;else if(/[a-z]/i.test(d.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0,r=!1;break}}var o={b:8,t:9,n:10,v:11,f:12,r:13};function s(t){var e=t.charCodeAt(0);if(92!==e)return e;var n=t.charAt(1);return(e=o[n])||("0"<=n&&n<="7"?parseInt(t.substring(1),8):"u"===n||"x"===n?parseInt(t.substring(2),16):t.charCodeAt(1))}function l(t){if(t<32)return(t<16?"\\x0":"\\x")+t.toString(16);var e=String.fromCharCode(t);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function c(t){var e=t.substring(1,t.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),n=[],r="^"===e[0],i=["["];r&&i.push("^");for(var a=r?1:0,o=e.length;a<o;++a){var c=e[a];if(/\\[bdsw]/i.test(c))i.push(c);else{var u,h=s(c);a+2<o&&"-"===e[a+1]?(u=s(e[a+2]),a+=2):u=h,n.push([h,u]),u<65||h>122||(u<65||h>90||n.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||n.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}n.sort((function(t,e){return t[0]-e[0]||e[1]-t[1]}));var d=[],f=[];for(a=0;a<n.length;++a){(p=n[a])[0]<=f[1]+1?f[1]=Math.max(f[1],p[1]):d.push(f=p)}for(a=0;a<d.length;++a){var p=d[a];i.push(l(p[0])),p[1]>p[0]&&(p[1]+1>p[0]&&i.push("-"),i.push(l(p[1])))}return i.push("]"),i.join("")}function u(t){for(var r=t.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")),i=r.length,a=[],o=0,s=0;o<i;++o){if("("===(h=r[o]))++s;else if("\\"===h.charAt(0)){(u=+h.substring(1))&&(u<=s?a[u]=-1:r[o]=l(u))}}for(o=1;o<a.length;++o)-1===a[o]&&(a[o]=++e);for(o=0,s=0;o<i;++o){if("("===(h=r[o]))a[++s]||(r[o]="(?:");else if("\\"===h.charAt(0)){var u;(u=+h.substring(1))&&u<=s&&(r[o]="\\"+a[u])}}for(o=0;o<i;++o)"^"===r[o]&&"^"!==r[o+1]&&(r[o]="");if(t.ignoreCase&&n)for(o=0;o<i;++o){var h,d=(h=r[o]).charAt(0);h.length>=2&&"["===d?r[o]=c(h):"\\"!==d&&(r[o]=h.replace(/[a-zA-Z]/g,(function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"})))}return r.join("")}var h=[];for(i=0,a=t.length;i<a;++i){var d;if((d=t[i]).global||d.multiline)throw new Error(""+d);h.push("(?:"+u(d)+")")}return new RegExp(h.join("|"),r?"gi":"g")}(a)}();var i=e.length,a=function(t){for(var o=t.sourceCode,s=t.basePos,l=t.sourceNode,c=[s,"pln"],u=0,h=o.match(n)||[],f={},p=0,g=h.length;p<g;++p){var m,v=h[p],y=f[v],b=void 0;if("string"==typeof y)m=!1;else{var x=r[v.charAt(0)];if(x)b=v.match(x[1]),y=x[0];else{for(var C=0;C<i;++C)if(x=e[C],b=v.match(x[1])){y=x[0];break}b||(y="pln")}!(m=y.length>=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(m=!1,y="src"),m||(f[v]=y)}var E=u;if(u+=v.length,m){var w=b[1],k=v.indexOf(w),T=k+w.length;b[2]&&(k=(T=v.length-b[2].length)-w.length);var O=y.substring(5);d(l,s+E,v.substring(0,k),a,c),d(l,s+E+k,w,S(O,w),c),d(l,s+E+T,v.substring(T),a,c)}else c.push(s+E,y)}t.decorations=c};return a}function m(t){var e=[],n=[];t.tripleQuotedStrings?e.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):t.multiLineStrings?e.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):e.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),t.verbatimStrings&&n.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=t.hashComments;r&&(t.cStyleComments?(r>1?e.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):e.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push(["com",/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=t.regexLiterals;if(i){var a=i>1?"":"\n\r",o=a?".":"[\\S\\s]",s="/(?=[^/*"+a+"])(?:[^/\\x5B\\x5C"+a+"]|\\x5C"+o+"|\\x5B(?:[^\\x5C\\x5D"+a+"]|\\x5C"+o+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+s+")")])}var l=t.types;l&&n.push(["typ",l]);var c=(""+t.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),e.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return t.regexLiterals&&(u+="(?!s*/)"),n.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),g(e,n)}var v=m({keywords:[r,a,i,o,s,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(t,e,n){for(var r=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,a=t.ownerDocument,o=a.createElement("li");t.firstChild;)o.appendChild(t.firstChild);var s=[o];function l(t){var e=t.nodeType;if(1!=e||r.test(t.className)){if((3==e||4==e)&&n){var o=t.nodeValue,s=o.match(i);if(s){var u=o.substring(0,s.index);t.nodeValue=u;var h=o.substring(s.index+s[0].length);if(h)t.parentNode.insertBefore(a.createTextNode(h),t.nextSibling);c(t),u||t.parentNode.removeChild(t)}}}else if("br"===t.nodeName)c(t),t.parentNode&&t.parentNode.removeChild(t);else for(var d=t.firstChild;d;d=d.nextSibling)l(d)}function c(t){for(;!t.nextSibling;)if(!(t=t.parentNode))return;for(var e,n=function t(e,n){var r=n?e.cloneNode(!1):e,i=e.parentNode;if(i){var a=t(i,1),o=e.nextSibling;a.appendChild(r);for(var s=o;s;s=o)o=s.nextSibling,a.appendChild(s)}return r}(t.nextSibling,0);(e=n.parentNode)&&1===e.nodeType;)n=e;s.push(n)}for(var u=0;u<s.length;++u)l(s[u]);e===(0|e)&&s[0].setAttribute("value",e);var h=a.createElement("ol");h.className="linenums";for(var d=Math.max(0,e-1|0)||0,f=(u=0,s.length);u<f;++u)(o=s[u]).className="L"+(u+d)%10,o.firstChild||o.appendChild(a.createTextNode(" ")),h.appendChild(o);t.appendChild(h)}var b={};function x(e,n){for(var r=n.length;--r>=0;){var i=n[r];b.hasOwnProperty(i)?t.console&&console.warn("cannot override language handler %s",i):b[i]=e}}function S(t,e){return t&&b.hasOwnProperty(t)||(t=/^\s*</.test(e)?"default-markup":"default-code"),b[t]}function C(e){var n,r,i,a,o,s,l,c=e.langExtension;try{var u=(n=e.sourceNode,r=e.pre,i=/(?:^|\s)nocode(?:\s|$)/,a=[],o=0,s=[],l=0,function t(e){var n=e.nodeType;if(1==n){if(i.test(e.className))return;for(var c=e.firstChild;c;c=c.nextSibling)t(c);var u=e.nodeName.toLowerCase();"br"!==u&&"li"!==u||(a[l]="\n",s[l<<1]=o++,s[l++<<1|1]=e)}else if(3==n||4==n){var h=e.nodeValue;h.length&&(h=r?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),a[l]=h,s[l<<1]=o,o+=h.length,s[l++<<1|1]=e)}}(n),{sourceCode:a.join("").replace(/\n$/,""),spans:s}),h=u.sourceCode;e.sourceCode=h,e.spans=u.spans,e.basePos=0,S(c,h)(e),function(t){var e=/\bMSIE\s(\d+)/.exec(navigator.userAgent);e=e&&+e[1]<=8;var n,r,i=/\n/g,a=t.sourceCode,o=a.length,s=0,l=t.spans,c=l.length,u=0,h=t.decorations,d=h.length,f=0;for(h[d]=o,r=n=0;r<d;)h[r]!==h[r+2]?(h[n++]=h[r++],h[n++]=h[r++]):r+=2;for(d=n,r=n=0;r<d;){for(var p=h[r],g=h[r+1],m=r+2;m+2<=d&&h[m+1]===g;)m+=2;h[n++]=p,h[n++]=g,r=m}d=h.length=n;var v=t.sourceNode,y="";v&&(y=v.style.display,v.style.display="none");try{for(;u<c;){l[u];var b,x=l[u+2]||o,S=h[f+2]||o,C=(m=Math.min(x,S),l[u+1]);if(1!==C.nodeType&&(b=a.substring(s,m))){e&&(b=b.replace(i,"\r")),C.nodeValue=b;var E=C.ownerDocument,w=E.createElement("span");w.className=h[f+1];var k=C.parentNode;k.replaceChild(w,C),w.appendChild(C),s<x&&(l[u+1]=C=E.createTextNode(a.substring(m,x)),k.insertBefore(C,w.nextSibling))}(s=m)>=x&&(u+=2),s>=S&&(f+=2)}}finally{v&&(v.style.display=y)}}(e)}catch(e){t.console&&console.log(e&&e.stack||e)}}function E(t,e,n){var r=n||!1,i=e||null,a=document.createElement("div");return a.innerHTML="<pre>"+t+"</pre>",a=a.firstChild,r&&y(a,r,!0),C({langExtension:i,numberLines:r,sourceNode:a,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),a.innerHTML}function w(e,n){var r=n||document.body,i=r.ownerDocument||document;function a(t){return r.getElementsByTagName(t)}for(var o=[a("pre"),a("code"),a("xmp")],s=[],l=0;l<o.length;++l)for(var c=0,u=o[l].length;c<u;++c)s.push(o[l][c]);o=null;var h=Date;h.now||(h={now:function(){return+new Date}});var d=0,f=/\blang(?:uage)?-([\w.]+)(?!\S)/,g=/\bprettyprint\b/,m=/\bprettyprinted\b/,v=/pre|xmp/i,b=/^code$/i,x=/^(?:pre|code|xmp)$/i,S={};!function n(){for(var r=t.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;d<s.length&&h.now()<r;d++){for(var a=s[d],o=S,l=a;l=l.previousSibling;){var c=l.nodeType,u=(7===c||8===c)&&l.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(l.nodeValue))break;if(u){o={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(t,e,n){o[e]=n}));break}}var E=a.className;if((o!==S||g.test(E))&&!m.test(E)){for(var w=!1,k=a.parentNode;k;k=k.parentNode){var T=k.tagName;if(x.test(T)&&k.className&&g.test(k.className)){w=!0;break}}if(!w){a.className+=" prettyprinted";var O,A,L=o.lang;if(!L)!(L=E.match(f))&&(O=p(a))&&b.test(O.tagName)&&(L=O.className.match(f)),L&&(L=L[1]);if(v.test(a.tagName))A=1;else{var D=a.currentStyle,R=i.defaultView,I=D?D.whiteSpace:R&&R.getComputedStyle?R.getComputedStyle(a,null).getPropertyValue("white-space"):0;A=I&&"pre"===I.substring(0,3)}var _=o.linenums;(_="true"===_||+_)||(_=!!(_=E.match(/\blinenums\b(?::(\d+))?/))&&(!_[1]||!_[1].length||+_[1])),_&&y(a,_,A),C({langExtension:L,sourceNode:a,numberLines:_,pre:A,sourceCode:null,basePos:null,spans:null,decorations:null})}}}d<s.length?t.setTimeout(n,250):"function"==typeof e&&e()}()}x(v,["default-code"]),x(g([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),x(g([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["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"]),x(g([],[["atv",/^[\s\S]+/]]),["uq.val"]),x(m({keywords:r,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),x(m({keywords:"null,true,false"}),["json"]),x(m({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),x(m({keywords:i,cStyleComments:!0}),["java"]),x(m({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),x(m({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),x(m({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),x(m({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),x(m({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),x(m({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),x(g([],[["str",/^[\s\S]+/]]),["regex"]);var k=t.PR={createSimpleLexer:g,registerLangHandler:x,sourceDecorator:m,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:E,prettyPrint:w},T=t.define;"function"==typeof T&&T.amd&&T("google-code-prettify",[],(function(){return k}))}()},U7T7:
/*!***********************************************************************!*\
!*** ./src/pages/MyProblem/LeftPanel/Discuss/discuss-item/index.less ***!
\***********************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},UZu5:
/*!*************************************************!*\
!*** ./src/components/image-preview/index.less ***!
\*************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},"VrN/":
/*!***************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.js ***!
\***************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),a=/Edge\/(\d+)/.exec(t),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),l=!a&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!a&&/Chrome\//.test(t),h=/Opera\//.test(t),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=!a&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),S=h&&t.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==S||S<12.11)),E=n||o&&s>=9;function w(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var k,T=function(t,e){var n=t.className,r=w(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function O(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function A(t,e){return O(t).appendChild(e)}function L(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var a=0;a<e.length;++a)i.appendChild(e[a]);return i}function D(t,e,n,r){var i=L(t,e,n,r);return i.setAttribute("role","presentation"),i}function R(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function I(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function _(t,e){var n=t.className;w(e).test(n)||(t.className+=(n?" ":"")+e)}function M(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!w(n[r]).test(e)&&(e+=" "+n[r]);return e}k=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var N=function(t){t.select()};function P(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function F(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function j(t,e,n,r,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var a=r||0,o=i||0;;){var s=t.indexOf("\t",a);if(s<0||s>=e)return o+(e-a);o+=s-a,o+=n-o%n,a=s+1}}g?N=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:o&&(N=function(t){try{t.select()}catch(t){}});var B=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function U(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}B.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},B.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var H={toString:function(){return"CodeMirror.Pass"}},G={scroll:!1},z={origin:"*mouse"},W={origin:"+move"};function V(t,e,n){for(var r=0,i=0;;){var a=t.indexOf("\t",r);-1==a&&(a=t.length);var o=a-r;if(a==t.length||i+o>=e)return r+Math.min(o,e-i);if(i+=a-r,r=a+1,(i+=n-i%n)>=e)return r}}var K=[""];function q(t){for(;K.length<=t;)K.push(Y(K)+" ");return K[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function $(){}function J(t,e){var n;return Object.create?n=Object.create(t):($.prototype=t,n=new $),e&&F(e,n),n}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||Z.test(t))}function tt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&Q(t))||e.test(t):Q(t)}function et(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var nt=/[\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 rt(t){return t.charCodeAt(0)>=768&&nt.test(t)}function it(t,e,n){for(;(n<0?e>0:e<t.length)&&rt(t.charAt(e));)e+=n;return e}function at(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var i=(e+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==e)return t(a)?e:n;t(a)?n=a:e=a+r}}var ot=null;function st(t,e,n){var r;ot=null;for(var i=0;i<t.length;++i){var a=t[i];if(a.from<e&&a.to>e)return i;a.to==e&&(a.from!=a.to&&"before"==n?r=i:ot=i),a.from==e&&(a.from!=a.to&&"before"!=n?r=i:ot=i)}return null!=r?r:ot}var lt=function(){var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function a(t,e,n){this.level=t,this.from=e,this.to=n}return function(o,s){var l="ltr"==s?"L":"R";if(0==o.length||"ltr"==s&&!t.test(o))return!1;for(var c,u=o.length,h=[],d=0;d<u;++d)h.push((c=o.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var f=0,p=l;f<u;++f){var g=h[f];"m"==g?h[f]=p:p=g}for(var m=0,v=l;m<u;++m){var y=h[m];"1"==y&&"r"==v?h[m]="n":n.test(y)&&(v=y,"r"==y&&(h[m]="R"))}for(var b=1,x=h[0];b<u-1;++b){var S=h[b];"+"==S&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=S||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=S}for(var C=0;C<u;++C){var E=h[C];if(","==E)h[C]="N";else if("%"==E){var w=void 0;for(w=C+1;w<u&&"%"==h[w];++w);for(var k=C&&"!"==h[C-1]||w<u&&"1"==h[w]?"1":"N",T=C;T<w;++T)h[T]=k;C=w-1}}for(var O=0,A=l;O<u;++O){var L=h[O];"L"==A&&"1"==L?h[O]="L":n.test(L)&&(A=L)}for(var D=0;D<u;++D)if(e.test(h[D])){var R=void 0;for(R=D+1;R<u&&e.test(h[R]);++R);for(var I="L"==(D?h[D-1]:l),_=I==("L"==(R<u?h[R]:l))?I?"L":"R":l,M=D;M<R;++M)h[M]=_;D=R-1}for(var N,P=[],F=0;F<u;)if(r.test(h[F])){var j=F;for(++F;F<u&&r.test(h[F]);++F);P.push(new a(0,j,F))}else{var B=F,U=P.length,H="rtl"==s?1:0;for(++F;F<u&&"L"!=h[F];++F);for(var G=B;G<F;)if(i.test(h[G])){B<G&&(P.splice(U,0,new a(1,B,G)),U+=H);var z=G;for(++G;G<F&&i.test(h[G]);++G);P.splice(U,0,new a(2,z,G)),U+=H,B=G}else++G;B<F&&P.splice(U,0,new a(1,B,F))}return"ltr"==s&&(1==P[0].level&&(N=o.match(/^\s+/))&&(P[0].from=N[0].length,P.unshift(new a(0,0,N[0].length))),1==Y(P).level&&(N=o.match(/\s+$/))&&(Y(P).to-=N[0].length,P.push(new a(0,u-N[0].length,u)))),"rtl"==s?P.reverse():P}}();function ct(t,e){var n=t.order;return null==n&&(n=t.order=lt(t.text,e)),n}var ut=[],ht=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||ut).concat(n)}};function dt(t,e){return t._handlers&&t._handlers[e]||ut}function ft(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var a=U(i,n);a>-1&&(r[e]=i.slice(0,a).concat(i.slice(a+1)))}}}function pt(t,e){var n=dt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function gt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),pt(t,n||e.type,t,e),St(e)||e.codemirrorIgnore}function mt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==U(n,e[r])&&n.push(e[r])}function vt(t,e){return dt(t,e).length>0}function yt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){ft(this,t,e)}}function bt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function xt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Ct(t){bt(t),xt(t)}function Et(t){return t.target||t.srcElement}function wt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var kt,Tt,Ot=function(){if(o&&s<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function At(t){if(null==kt){var e=L("span","");A(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(kt=e.offsetWidth<=1&&e.offsetHeight>2&&!(o&&s<8))}var n=kt?L("span",""):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Lt(t){if(null!=Tt)return Tt;var e=A(t,document.createTextNode("AخA")),n=k(e,0,1).getBoundingClientRect(),r=k(e,1,2).getBoundingClientRect();return O(t),!(!n||n.left==n.right)&&(Tt=r.right-n.right<3)}var Dt,Rt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var a=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),o=a.indexOf("\r");-1!=o?(n.push(a.slice(0,o)),e+=o+1):(n.push(a),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},_t="oncopy"in(Dt=L("div"))||(Dt.setAttribute("oncopy","return;"),"function"==typeof Dt.oncopy),Mt=null,Nt={},Pt={};function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Nt[t]=e}function jt(t){if("string"==typeof t&&Pt.hasOwnProperty(t))t=Pt[t];else if(t&&"string"==typeof t.name&&Pt.hasOwnProperty(t.name)){var e=Pt[t.name];"string"==typeof e&&(e={name:e}),(t=J(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return jt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return jt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Bt(t,e){e=jt(e);var n=Nt[e.name];if(!n)return Bt(t,"text/plain");var r=n(t,e);if(Ut.hasOwnProperty(e.name)){var i=Ut[e.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var o in e.modeProps)r[o]=e.modeProps[o];return r}var Ut={};function Ht(t,e){F(e,Ut.hasOwnProperty(t)?Ut[t]:Ut[t]={})}function Gt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function zt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Wt(t,e,n){return!t.startState||t.startState(e,n)}var Vt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Kt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(e<a){n=i;break}e-=a}return n.lines[e]}function qt(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,(function(t){var a=t.text;i==n.line&&(a=a.slice(0,n.ch)),i==e.line&&(a=a.slice(e.ch)),r.push(a),++i})),r}function Yt(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function Xt(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function $t(t){if(null==t.parent)return null;for(var e=t.parent,n=U(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Jt(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],a=i.height;if(e<a){t=i;continue t}e-=a,n+=i.chunkSize()}return n}while(!t.lines);for(var o=0;o<t.lines.length;++o){var s=t.lines[o].height;if(e<s)break;e-=s}return n+o}function Zt(t,e){return e>=t.first&&e<t.first+t.size}function Qt(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function te(t,e,n){if(void 0===n&&(n=null),!(this instanceof te))return new te(t,e,n);this.line=t,this.ch=e,this.sticky=n}function ee(t,e){return t.line-e.line||t.ch-e.ch}function ne(t,e){return t.sticky==e.sticky&&0==ee(t,e)}function re(t){return te(t.line,t.ch)}function ie(t,e){return ee(t,e)<0?e:t}function ae(t,e){return ee(t,e)<0?t:e}function oe(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function se(t,e){if(e.line<t.first)return te(t.first,0);var n=t.first+t.size-1;return e.line>n?te(n,Kt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?te(t.line,e):n<0?te(t.line,0):t}(e,Kt(t,e.line).text.length)}function le(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=se(t,e[r]);return n}Vt.prototype.eol=function(){return this.pos>=this.string.length},Vt.prototype.sol=function(){return this.pos==this.lineStart},Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vt.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},Vt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},Vt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Vt.prototype.skipToEnd=function(){this.pos=this.string.length},Vt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Vt.prototype.backUp=function(t){this.pos-=t},Vt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Vt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Vt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ce=function(t,e){this.state=t,this.lookAhead=e},ue=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function he(t,e,n,r){var i=[t.state.modeGen],a={};xe(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,c=0;n.state=!0,xe(t,e.text,s.mode,n,(function(t,e){for(var n=l;c<t;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var a=i[n+1];i[n+1]=(a?a+" ":"")+"overlay "+e}}),a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function de(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=fe(t,$t(e)),i=e.text.length>t.options.maxHighlightLength&&Gt(t.doc.mode,r.state),a=he(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=a.styles,a.classes?e.styleClasses=a.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function fe(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new ue(r,!0,e);var a=function(t,e,n){for(var r,i,a=t.doc,o=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>o;--s){if(s<=a.first)return a.first;var l=Kt(a,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ce?c.lookAhead:0)<=a.modeFrontier))return s;var u=j(l.text,null,t.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(t,e,n),o=a>r.first&&Kt(r,a-1).stateAfter,s=o?ue.fromSaved(r,o,a):new ue(r,Wt(r.mode),a);return r.iter(a,e,(function(n){pe(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function pe(t,e,n,r){var i=t.doc.mode,a=new Vt(e,t.options.tabSize,n);for(a.start=a.pos=r||0,""==e&&ge(i,n.state);!a.eol();)me(i,a,n.state),a.start=a.pos}function ge(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=zt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function me(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=zt(t,n).mode);var a=t.token(e,n);if(e.pos>e.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}ue.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ue.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ue.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ue.fromSaved=function(t,e,n){return e instanceof ce?new ue(t,Gt(t.mode,e.state),n,e.lookAhead):new ue(t,Gt(t.mode,e),n)},ue.prototype.save=function(t){var e=!1!==t?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ce(e,this.maxLookAhead):e};var ve=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ye(t,e,n,r){var i,a,o=t.doc,s=o.mode,l=Kt(o,(e=se(o,e)).line),c=fe(t,e.line,n),u=new Vt(l.text,t.options.tabSize,c);for(r&&(a=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,i=me(s,u,c.state),r&&a.push(new ve(u,i,Gt(o.mode,c.state)));return r?a:new ve(u,i,c.state)}function be(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[r])||(e[r]+=" "+n[2])}return t}function xe(t,e,n,r,i,a,o){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,h=new Vt(e,t.options.tabSize,r),d=t.options.addModeClass&&[null];for(""==e&&be(ge(n,r.state),a);!h.eol();){if(h.pos>t.options.maxHighlightLength?(s=!1,o&&pe(t,e,r,h.pos),h.pos=e.length,l=null):l=be(me(n,h,r.state,d),a),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;c<h.start;)i(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;){var p=Math.min(h.pos,c+5e3);i(p,u),c=p}}var Se=!1,Ce=!1;function Ee(t,e,n){this.marker=t,this.from=e,this.to=n}function we(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function ke(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Te(t,e){if(e.full)return null;var n=Zt(t,e.from.line)&&Kt(t,e.from.line).markedSpans,r=Zt(t,e.to.line)&&Kt(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,a=e.to.ch,o=0==ee(e.from,e.to),s=function(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var a=t[i],o=a.marker;if(null==a.from||(o.inclusiveLeft?a.from<=e:a.from<e)||a.from==e&&"bookmark"==o.type&&(!n||!a.marker.insertLeft)){var s=null==a.to||(o.inclusiveRight?a.to>=e:a.to>e);(r||(r=[])).push(new Ee(o,a.from,s?null:a.to))}}return r}(n,i,o),l=function(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var a=t[i],o=a.marker;if(null==a.to||(o.inclusiveRight?a.to>=e:a.to>e)||a.from==e&&"bookmark"==o.type&&(!n||a.marker.insertLeft)){var s=null==a.from||(o.inclusiveLeft?a.from<=e:a.from<e);(r||(r=[])).push(new Ee(o,s?null:a.from-e,null==a.to?null:a.to-e))}}return r}(r,a,o),c=1==e.text.length,u=Y(e.text).length+(c?i:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var f=we(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=i}}if(l)for(var p=0;p<l.length;++p){var g=l[p];null!=g.to&&(g.to+=u),null==g.from?we(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=Oe(s)),l&&l!=s&&(l=Oe(l));var m=[s];if(!c){var v,y=e.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Ee(s[b].marker,null,null));for(var x=0;x<y;++x)m.push(v);m.push(l)}return m}function Oe(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function Ae(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Le(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function De(t){return t.inclusiveLeft?-1:0}function Re(t){return t.inclusiveRight?1:0}function Ie(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),a=ee(r.from,i.from)||De(t)-De(e);if(a)return-a;var o=ee(r.to,i.to)||Re(t)-Re(e);return o||e.id-t.id}function _e(t,e){var n,r=Ce&&t.markedSpans;if(r)for(var i=void 0,a=0;a<r.length;++a)(i=r[a]).marker.collapsed&&null==(e?i.from:i.to)&&(!n||Ie(n,i.marker)<0)&&(n=i.marker);return n}function Me(t){return _e(t,!0)}function Ne(t){return _e(t,!1)}function Pe(t,e){var n,r=Ce&&t.markedSpans;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(null==a.from||a.from<e)&&(null==a.to||a.to>e)&&(!n||Ie(n,a.marker)<0)&&(n=a.marker)}return n}function Fe(t,e,n,r,i){var a=Kt(t,e),o=Ce&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ee(c.from,n)||De(l.marker)-De(i),h=ee(c.to,r)||Re(l.marker)-Re(i);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(c.to,n)>=0:ee(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(c.from,r)<=0:ee(c.from,r)<0)))return!0}}}function je(t){for(var e;e=Me(t);)t=e.find(-1,!0).line;return t}function Be(t,e){var n=Kt(t,e),r=je(n);return n==r?e:$t(r)}function Ue(t,e){if(e>t.lastLine())return e;var n,r=Kt(t,e);if(!He(t,r))return e;for(;n=Ne(r);)r=n.find(1,!0).line;return $t(r)+1}function He(t,e){var n=Ce&&e.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ge(t,e,r))return!0}}function Ge(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return Ge(t,r.line,we(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i=void 0,a=0;a<e.markedSpans.length;++a)if((i=e.markedSpans[a]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ge(t,e,i))return!0}function ze(t){for(var e=0,n=(t=je(t)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var a=n.parent;a;a=(n=a).parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;e+=s.height}return e}function We(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Me(r);){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=t;e=Ne(r);){var a=e.find(0,!0);n-=r.text.length-a.from.ch,n+=(r=a.to.line).text.length-a.to.ch}return n}function Ve(t){var e=t.display,n=t.doc;e.maxLine=Kt(n,n.first),e.maxLineLength=We(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=We(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var Ke=function(t,e,n){this.text=t,Le(this,e),this.height=n?n(this):1};function qe(t){t.parent=null,Ae(t)}Ke.prototype.lineNo=function(){return $t(this)},yt(Ke);var Ye={},Xe={};function $e(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:Ye;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Je(t,e){var n=D("span",null,null,l?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var a=i?e.rest[i-1]:e.line,o=void 0;r.pos=0,r.addToken=Qe,Lt(t.display.measure)&&(o=ct(a,t.doc.direction))&&(r.addToken=tn(r.addToken,o)),r.map=[],nn(a,r,de(t,a,e!=t.display.externalMeasured&&$t(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=M(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=M(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(At(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return pt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=M(r.pre.className,r.textClass||"")),r}function Ze(t){var e=L("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function Qe(t,e,n,r,i,a,l){if(e){var c,u=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;i<t.length;i++){var a=t.charAt(i);" "!=a||!n||i!=t.length-1&&32!=t.charCodeAt(i+1)||(a=" "),r+=a,n=" "==a}return r}(e,t.trailingSpace):e,h=t.cm.state.specialChars,d=!1;if(h.test(e)){c=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(e),g=p?p.index-f:e.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));o&&s<9?c.appendChild(L("span",[m])):c.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(v=c.appendChild(L("span",q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((v=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),o&&s<9?c.appendChild(L("span",[v])):c.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),o&&s<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||i||d||a||l){var x=n||"";r&&(x+=r),i&&(x+=i);var S=L("span",[c],x,a);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&S.setAttribute(C,l[C]);return t.content.appendChild(S)}t.content.appendChild(c)}}function tn(t,e){return function(n,r,i,a,o,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var h=void 0,d=0;d<e.length&&!((h=e[d]).to>c&&h.from<=c);d++);if(h.to>=u)return t(n,r,i,a,o,s,l);t(n,r.slice(0,h.to-c),i,a,null,s,l),a=null,r=r.slice(h.to-c),c=h.to}}}function en(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function nn(t,e,n){var r=t.markedSpans,i=t.text,a=0;if(r)for(var o,s,l,c,u,h,d,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=s="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var S=r[x],C=S.marker;if("bookmark"==C.type&&S.from==p&&C.widgetNode)y.push(C);else if(S.from<=p&&(null==S.to||S.to>p||C.collapsed&&S.to==p&&S.from==p)){if(null!=S.to&&S.to!=p&&v>S.to&&(v=S.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&S.from==p&&(u+=" "+C.startStyle),C.endStyle&&S.to==v&&(b||(b=[])).push(C.endStyle,S.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var E in C.attributes)(d||(d={}))[E]=C.attributes[E];C.collapsed&&(!h||Ie(h.marker,C)<0)&&(h=S)}else S.from>p&&v>S.from&&(v=S.from)}if(b)for(var w=0;w<b.length;w+=2)b[w+1]==v&&(c+=" "+b[w]);if(!h||h.from==p)for(var k=0;k<y.length;++k)en(e,0,y[k]);if(h&&(h.from||0)==p){if(en(e,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var T=Math.min(f,v);;){if(m){var O=p+m.length;if(!h){var A=O>T?m.slice(0,T-p):m;e.addToken(e,A,o?o+l:l,u,p+A.length==v?c:"",s,d)}if(O>=T){m=m.slice(T-p),p=T;break}p=O,u=""}m=i.slice(a,a=n[g++]),o=$e(n[g++],e.cm.options)}}else for(var L=1;L<n.length;L+=2)e.addToken(e,i.slice(a,a=n[L]),$e(n[L+1],e.cm.options))}function rn(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=Ne(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}(e),this.size=this.rest?$t(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=He(t,e)}function an(t,e,n){for(var r,i=[],a=e;a<n;a=r){var o=new rn(t.doc,Kt(t.doc,a),a);r=a+o.size,i.push(o)}return i}var on=null,sn=null;function ln(t,e){var n=dt(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);on?r=on.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(cn,0));for(var a=function(t){r.push((function(){return n[t].apply(null,i)}))},o=0;o<n.length;++o)a(o)}}function cn(){var t=sn;sn=null;for(var e=0;e<t.length;++e)t[e]()}function un(t,e,n,r){for(var i=0;i<e.changes.length;i++){var a=e.changes[i];"text"==a?fn(t,e):"gutter"==a?gn(t,e,n,r):"class"==a?pn(t,e):"widget"==a&&mn(t,e,r)}e.changes=null}function hn(t){return t.node==t.text&&(t.node=L("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),o&&s<8&&(t.node.style.zIndex=2)),t.node}function dn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):Je(t,e)}function fn(t,e){var n=e.text.className,r=dn(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,pn(t,e)):n&&(e.text.className=n)}function pn(t,e){!function(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var r=hn(e);e.background=r.insertBefore(L("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}(t,e),e.line.wrapClass?hn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function gn(t,e,n,r){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var i=hn(e);e.gutterBackground=L("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),i.insertBefore(e.gutterBackground,e.text)}var a=e.line.gutterMarkers;if(t.options.lineNumbers||a){var o=hn(e),s=e.gutter=L("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(t.display.input.setUneditable(s),o.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(L("div",Qt(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),a)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=a.hasOwnProperty(c)&&a[c];u&&s.appendChild(L("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function mn(t,e,n){e.alignable&&(e.alignable=null);for(var r=w("CodeMirror-linewidget"),i=e.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&e.node.removeChild(i);yn(t,e,n)}function vn(t,e,n,r){var i=dn(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),pn(t,e),gn(t,e,n,r),yn(t,e,r),e.node}function yn(t,e,n){if(bn(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)bn(t,e.rest[r],e,n,!1)}function bn(t,e,n,r,i){if(e.widgets)for(var a=hn(n),o=0,s=e.widgets;o<s.length;++o){var l=s[o],c=L("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),xn(l,c,n,r),t.display.input.setUneditable(c),i&&l.above?a.insertBefore(c,n.gutter||n.text):a.appendChild(c),ln(l,"redraw")}}function xn(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(i-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function Sn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!R(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),A(e.display.measure,L("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Cn(t,e){for(var n=Et(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function En(t){return t.lineSpace.offsetTop}function wn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function kn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=A(t.measure,L("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r),r}function Tn(t){return 50-t.display.nativeBarWidth}function On(t){return t.display.scroller.clientWidth-Tn(t)-t.display.barWidth}function An(t){return t.display.scroller.clientHeight-Tn(t)-t.display.barHeight}function Ln(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var i=0;i<t.rest.length;i++)if($t(t.rest[i])>n)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Dn(t,e,n,r){return _n(t,In(t,e),n,r)}function Rn(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[ur(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function In(t,e){var n=$t(e),r=Rn(t,n);r&&!r.text?r=null:r&&r.changes&&(un(t,r,n,ar(t)),t.curOp.forceUpdate=!0),r||(r=function(t,e){var n=$t(e=je(e)),r=t.display.externalMeasured=new rn(t.doc,e,n);r.lineN=n;var i=r.built=Je(t,r);return r.text=i.pre,A(t.display.lineMeasure,i.pre),r}(t,e));var i=Ln(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _n(t,e,n,r,i){e.before&&(n=-1);var a,l=n+(r||"");return e.cache.hasOwnProperty(l)?a=e.cache[l]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var r=t.options.lineWrapping,i=r&&On(t);if(!e.measure.heights||r&&e.measure.width!=i){var a=e.measure.heights=[];if(r){e.measure.width=i;for(var o=e.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var l=o[s],c=o[s+1];Math.abs(l.bottom-c.bottom)>2&&a.push((l.bottom+c.top)/2-n.top)}}a.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(a=function(t,e,n,r){var i,a=Pn(e.map,n,r),l=a.node,c=a.start,u=a.end,h=a.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&rt(e.line.text.charAt(a.coverStart+c));)--c;for(;a.coverStart+u<a.coverEnd&&rt(e.line.text.charAt(a.coverStart+u));)++u;if((i=o&&s<9&&0==c&&u==a.coverEnd-a.coverStart?l.parentNode.getBoundingClientRect():Fn(k(l,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,h="right"}o&&s<11&&(i=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=Mt)return Mt;var e=A(t,L("span","x")),n=e.getBoundingClientRect(),r=k(e,0,1).getBoundingClientRect();return Mt=Math.abs(n.left-r.left)>1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,i))}else{var f;c>0&&(h=r="right"),i=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(o&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ir(t.display),top:p.top,bottom:p.bottom}:Nn}for(var g=i.top-e.rect.top,m=i.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,S=y[b],C={left:("right"==h?i.right:i.left)-e.rect.left,right:("left"==h?i.left:i.right)-e.rect.left,top:x,bottom:S};return i.left||i.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=m),C}(t,e,n,r)).bogus||(e.cache[l]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Mn,Nn={left:0,right:0,top:0,bottom:0};function Pn(t,e,n){for(var r,i,a,o,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(i=0,a=1,o="left"):e<l?a=1+(i=e-s):(c==t.length-3||e==l&&t[c+3]>e)&&(i=(a=l-s)-1,e>=l&&(o="right")),null!=i){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(o=n),"left"==n&&0==i)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[2+(c-=3)],o="left";if("right"==n&&i==l-s)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)r=t[(c+=3)+2],o="right";break}return{node:r,start:i,end:a,collapse:o,coverStart:s,coverEnd:l}}function Fn(t,e){var n=Nn;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var i=t.length-1;i>=0&&(n=t[i]).left==n.right;i--);return n}function jn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function Bn(t){t.display.externalMeasure=null,O(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)jn(t.display.view[e])}function Un(t){Bn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function Hn(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Gn(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function zn(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=Sn(t.widgets[n]));return e}function Wn(t,e,n,r,i){if(!i){var a=zn(e);n.top+=a,n.bottom+=a}if("line"==r)return n;r||(r="local");var o=ze(e);if("local"==r?o+=En(t.display):o-=t.display.viewOffset,"page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();o+=s.top+("window"==r?0:Gn());var l=s.left+("window"==r?0:Hn());n.left+=l,n.right+=l}return n.top+=o,n.bottom+=o,n}function Vn(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n)r-=Hn(),i-=Gn();else if("local"==n||!n){var a=t.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=t.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Kn(t,e,n,r,i){return r||(r=Kt(t.doc,e.line)),Wn(t,r,Dn(t,r,e.ch,i),n)}function qn(t,e,n,r,i,a){function o(e,o){var s=_n(t,i,e,o?"right":"left",a);return o?s.left=s.right:s.right=s.left,Wn(t,r,s,n)}r=r||Kt(t.doc,e.line),i||(i=In(t,r));var s=ct(r,t.doc.direction),l=e.ch,c=e.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return o("before"==c?l-1:l,"before"==c);function u(t,e,n){return o(n?t-1:t,1==s[e].level!=n)}var h=st(s,l,c),d=ot,f=u(l,h,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Yn(t,e){var n=0;e=se(t.doc,e),t.options.lineWrapping||(n=ir(t.display)*e.ch);var r=Kt(t.doc,e.line),i=ze(r)+En(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(t,e,n,r,i){var a=te(t,e,n);return a.xRel=i,r&&(a.outside=r),a}function $n(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var i=Jt(r,n),a=r.first+r.size-1;if(i>a)return Xn(r.first+r.size-1,Kt(r,a).text.length,null,1,1);e<0&&(e=0);for(var o=Kt(r,i);;){var s=tr(t,o,i,e,n),l=Pe(o,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;o=Kt(r,i=c.line)}}function Jn(t,e,n,r){r-=zn(e);var i=e.text.length,a=at((function(e){return _n(t,n,e-1).bottom<=r}),i,0);return{begin:a,end:i=at((function(e){return _n(t,n,e).top>r}),a,i)}}function Zn(t,e,n,r){return n||(n=In(t,e)),Jn(t,e,n,Wn(t,e,_n(t,n,r),"line").top)}function Qn(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function tr(t,e,n,r,i){i-=ze(e);var a=In(t,e),o=zn(e),s=0,l=e.text.length,c=!0,u=ct(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?nr:er)(t,e,n,a,u,r,i);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,f,p=null,g=null,m=at((function(e){var n=_n(t,a,e);return n.top+=o,n.bottom+=o,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left<g.right-r,b=y==c;m=p+(b?0:1),f=b?"after":"before",d=y?g.left:g.right}else{c||m!=l&&m!=s||m++,f=0==m?"after":m==e.text.length?"before":_n(t,a,m-(c?1:0)).bottom+o<=i==c?"after":"before";var x=qn(t,te(n,m,f),"line",e,a);d=x.left,v=i<x.top?-1:i>=x.bottom?1:0}return Xn(n,m=it(e.text,m,1),f,v,r-d)}function er(t,e,n,r,i,a,o){var s=at((function(s){var l=i[s],c=1!=l.level;return Qn(qn(t,te(n,c?l.to:l.from,c?"before":"after"),"line",e,r),a,o,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=qn(t,te(n,c?l.from:l.to,c?"after":"before"),"line",e,r);Qn(u,a,o,!0)&&u.top>o&&(l=i[s-1])}return l}function nr(t,e,n,r,i,a,o){var s=Jn(t,e,r,o),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<i.length;d++){var f=i[d];if(!(f.from>=c||f.to<=l)){var p=_n(t,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=p<a?a-p+1e9:p-a;(!u||h>g)&&(u=f,h=g)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Mn){Mn=L("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(L("br"));Mn.appendChild(document.createTextNode("x"))}A(t.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),O(t.measure),n||1}function ir(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e],"CodeMirror-line-like");A(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function ar(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,a=e.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=t.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:or(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function or(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function sr(t){var e=rr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/ir(t.display)-3);return function(i){if(He(t.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*e:a+e}}function lr(t){var e=t.doc,n=sr(t);e.iter((function(t){var e=n(t);e!=t.height&&Xt(t,e)}))}function cr(t,e,n,r){var i=t.display;if(!n&&"true"==Et(e).getAttribute("cm-not-content"))return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=e.clientX-s.left,o=e.clientY-s.top}catch(t){return null}var l,c=$n(t,a,o);if(r&&c.xRel>0&&(l=Kt(t.doc,c.line).text).length==c.ch){var u=j(l,l.length,t.options.tabSize)-l.length;c=te(c.line,Math.max(0,Math.round((a-kn(t.display).left)/ir(t.display))-u))}return c}function ur(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;r<n.length;r++)if((e-=n[r].size)<0)return r}function hr(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var i=t.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Ce&&Be(t.doc,e)<i.viewTo&&fr(t);else if(n<=i.viewFrom)Ce&&Ue(t.doc,n+r)>i.viewFrom?fr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)fr(t);else if(e<=i.viewFrom){var a=pr(t,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):fr(t)}else if(n>=i.viewTo){var o=pr(t,e,e,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):fr(t)}else{var s=pr(t,e,e,-1),l=pr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(an(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):fr(t)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(i.externalMeasured=null))}function dr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var a=r.view[ur(t,e)];if(null!=a.node){var o=a.changes||(a.changes=[]);-1==U(o,n)&&o.push(n)}}}function fr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function pr(t,e,n,r){var i,a=ur(t,e),o=t.display.view;if(!Ce||n==t.doc.first+t.doc.size)return{index:a,lineN:n};for(var s=t.display.viewFrom,l=0;l<a;l++)s+=o[l].size;if(s!=e){if(r>0){if(a==o.length-1)return null;i=s+o[a].size-e,a++}else i=s-e;e+=i,n+=i}for(;Be(t.doc,n)!=n;){if(a==(r<0?0:o.length-1))return null;n+=r*o[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function gr(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function mr(t){t.display.input.showSelection(t.display.input.prepareSelection())}function vr(t,e){void 0===e&&(e=!0);for(var n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(e||o!=n.sel.primIndex){var s=n.sel.ranges[o];if(!(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom)){var l=s.empty();(l||t.options.showCursorWhenSelecting)&&yr(t,s.head,i),l||xr(t,s,a)}}return r}function yr(t,e,n){var r=qn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(L("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",r.other){var a=n.appendChild(L("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(t,e){return t.top-e.top||t.left-e.left}function xr(t,e,n){var r=t.display,i=t.doc,a=document.createDocumentFragment(),o=kn(t.display),s=o.left,l=Math.max(r.sizerWidth,On(t)-r.sizer.offsetLeft)-o.right,c="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),a.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function h(e,n,r){var a,o,h=Kt(i,e),d=h.text.length;function f(n,r){return Kn(t,te(e,n),"div",h,r)}function p(e,n,r){var i=Zn(t,h,null,e),a="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),a)[a]}var g=ct(h,i.direction);return function(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,a=0;a<t.length;++a){var o=t[a];(o.from<n&&o.to>e||e==n&&o.to==e)&&(r(Math.max(o.from,e),Math.min(o.to,n),1==o.level?"rtl":"ltr",a),i=!0)}i||r(e,n,"ltr")}(g,n||0,null==r?d:r,(function(t,e,i,h){var m="ltr"==i,v=f(t,m?"left":"right"),y=f(e-1,m?"right":"left"),b=null==n&&0==t,x=null==r&&e==d,S=0==h,C=!g||h==g.length-1;if(y.top-v.top<=3){var E=(c?x:b)&&C,w=(c?b:x)&&S?s:(m?v:y).left,k=E?l:(m?y:v).right;u(w,v.top,k-w,v.bottom)}else{var T,O,A,L;m?(T=c&&b&&S?s:v.left,O=c?l:p(t,i,"before"),A=c?s:p(e,i,"after"),L=c&&x&&C?l:y.right):(T=c?p(t,i,"before"):s,O=!c&&b&&S?l:v.right,A=!c&&x&&C?s:y.left,L=c?p(e,i,"after"):l),u(T,v.top,O-T,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(A,y.top,L-A,y.bottom)}(!a||br(v,a)<0)&&(a=v),br(y,a)<0&&(a=y),(!o||br(v,o)<0)&&(o=v),br(y,o)<0&&(o=y)})),{start:a,end:o}}var d=e.from(),f=e.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Kt(i,d.line),g=Kt(i,f.line),m=je(p)==je(g),v=h(d.line,d.ch,m?p.text.length+1:null).end,y=h(f.line,m?0:null,f.ch).start;m&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(a)}function Sr(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||kr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Cr(t){t.state.focused||(t.display.input.focus(),wr(t))}function Er(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,kr(t))}),100)}function wr(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(pt(t,"focus",t,e),t.state.focused=!0,_(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Sr(t))}function kr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(pt(t,"blur",t,e),t.state.focused=!1,T(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Tr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r<e.view.length;r++){var i=e.view[r],a=t.options.lineWrapping,l=void 0,c=0;if(!i.hidden){if(o&&s<8){var u=i.node.offsetTop+i.node.offsetHeight;l=u-n,n=u}else{var h=i.node.getBoundingClientRect();l=h.bottom-h.top,!a&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=i.line.height-l;if((d>.005||d<-.005)&&(Xt(i.line,l),Or(i.line),i.rest))for(var f=0;f<i.rest.length;f++)Or(i.rest[f]);if(c>t.display.sizerWidth){var p=Math.ceil(c/ir(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function Or(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Ar(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-En(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,a=Jt(e,r),o=Jt(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<a?(a=s,o=Jt(e,ze(Kt(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=o&&(a=Jt(e,ze(Kt(e,l))-t.wrapper.clientHeight),o=l)}return{from:a,to:Math.max(o,a+1)}}function Lr(t,e){var n=t.display,r=rr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,a=An(t),o={};e.bottom-e.top>a&&(e.bottom=e.top+a);var s=t.doc.height+wn(n),l=e.top<r,c=e.bottom>s-r;if(e.top<i)o.scrollTop=l?0:e.top;else if(e.bottom>i+a){var u=Math.min(e.top,(c?s:e.bottom)-a);u!=i&&(o.scrollTop=u)}var h=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-h,f=On(t)-n.gutters.offsetWidth,p=e.right-e.left>f;return p&&(e.right=e.left+f),e.left<10?o.scrollLeft=0:e.left<d?o.scrollLeft=Math.max(0,e.left+h-(p?0:10)):e.right>f+d-3&&(o.scrollLeft=e.right+(p?0:10)-f),o}function Dr(t,e){null!=e&&(_r(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Rr(t){_r(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Ir(t,e,n){null==e&&null==n||_r(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function _r(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Mr(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Mr(t,e,n,r){var i=Lr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Ir(t,i.scrollLeft,i.scrollTop)}function Nr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Pr(t,e,!0),n&&li(t),ri(t,100))}function Pr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Fr(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,hi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function jr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+wn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Tn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Br=function(t,e,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),ht(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),ht(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var a=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},Br.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new B,this.disableVert=new B},Br.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}))},Br.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Ur=function(){};function Hr(t,e){e||(e=jr(t));var n=t.display.barWidth,r=t.display.barHeight;Gr(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Tr(t),Gr(t,jr(t)),n=t.display.barWidth,r=t.display.barHeight}function Gr(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Ur.prototype.update=function(){return{bottom:0,right:0}},Ur.prototype.setScrollLeft=function(){},Ur.prototype.setScrollTop=function(){},Ur.prototype.clear=function(){};var zr={native:Br,null:Ur};function Wr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new zr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ht(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?Fr(t,e):Nr(t,e)}),t),t.display.scrollbars.addClass&&_(t.display.wrapper,t.display.scrollbars.addClass)}var Vr=0;function Kr(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++Vr},e=t.curOp,on?on.ops.push(e):e.ownsGroup=on={ops:[e],delayedCallbacks:[]}}function qr(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<e.length)}(n)}finally{on=null,e(n)}}(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;!function(t){for(var e=t.ops,n=0;n<e.length;n++)Yr(e[n]);for(var r=0;r<e.length;r++)Xr(e[r]);for(var i=0;i<e.length;i++)$r(e[i]);for(var a=0;a<e.length;a++)Jr(e[a]);for(var o=0;o<e.length;o++)Zr(e[o])}(t)}))}function Yr(t){var e=t.cm,n=e.display;!function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Tn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Tn(t)+"px",e.scrollbarsClipped=!0)}(e),t.updateMaxLine&&Ve(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new ai(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(t){t.updatedDisplay=t.mustUpdate&&oi(t.cm,t.update)}function $r(t){var e=t.cm,n=e.display;t.updatedDisplay&&Tr(e),t.barMeasure=jr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Dn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Tn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-On(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Jr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&Fr(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==I();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&Hr(e,t.barMeasure),t.updatedDisplay&&ui(e,t.barMeasure),t.selectionChanged&&Sr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Cr(t.cm)}function Zr(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&si(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Pr(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&Fr(e,t.scrollLeft,!0,!0),t.scrollToPos&&function(t,e){if(!gt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var a=L("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-En(t.display))+"px;\n height: "+(e.bottom-e.top+Tn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(a),a.scrollIntoView(i),t.display.lineSpace.removeChild(a)}}}(e,function(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?te(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?te(e.line,e.ch+1,"before"):e);for(var a=0;a<5;a++){var o=!1,s=qn(t,e),l=n&&n!=e?qn(t,n):s,c=Lr(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(Nr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(o=!0)),null!=c.scrollLeft&&(Fr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return i}(e,se(r,t.scrollToPos.from),se(r,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,a=t.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||pt(i[o],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&pt(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&pt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Qr(t,e){if(t.curOp)return e();Kr(t);try{return e()}finally{qr(t)}}function ti(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Kr(t);try{return e.apply(t,arguments)}finally{qr(t)}}}function ei(t){return function(){if(this.curOp)return t.apply(this,arguments);Kr(this);try{return t.apply(this,arguments)}finally{qr(this)}}}function ni(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Kr(e);try{return t.apply(this,arguments)}finally{qr(e)}}}function ri(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,P(ii,t))}function ii(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=fe(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(a){if(r.line>=t.display.viewFrom){var o=a.styles,s=a.text.length>t.options.maxHighlightLength?Gt(e.mode,r.state):null,l=he(t,a,r,!0);s&&(r.state=s),a.styles=l.styles;var c=a.styleClasses,u=l.classes;u?a.styleClasses=u:c&&(a.styleClasses=null);for(var h=!o||o.length!=a.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<o.length;++d)h=o[d]!=a.styles[d];h&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=t.options.maxHighlightLength&&pe(t,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Qr(t,(function(){for(var e=0;e<i.length;e++)dr(t,i[e],"text")}))}}var ai=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Ar(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=On(t),this.force=n,this.dims=ar(t),this.events=[]};function oi(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return fr(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(t))return!1;di(t)&&(fr(t),e.dims=ar(t));var i=r.first+r.size,a=Math.max(e.visible.from-t.options.viewportMargin,r.first),o=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Ce&&(a=Be(t.doc,a),o=Ue(t.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=an(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=an(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(ur(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(an(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(t,n)))),r.viewTo=n}(t,a,o),n.viewOffset=ze(Kt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=gr(t);if(!s&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=I();if(!e||!R(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&R(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,i=t.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==a){for(;o!=d.node;)o=s(o);var f=i&&null!=e&&e<=u&&d.lineNumber;d.changes&&(U(d.changes,"gutter")>-1&&(f=!1),un(t,d,u,n)),f&&(O(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Qt(t.options,u)))),o=d.node.nextSibling}else{var p=vn(t,d,u,n);a.insertBefore(p,o)}u+=d.size}for(;o;)o=s(o)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=I()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&R(document.body,t.anchorNode)&&R(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,ri(t,400)),n.updateLineNumbers=null,!0}function si(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=On(t))r&&(e.visible=Ar(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+wn(t.display)-An(t),n.top)}),e.visible=Ar(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!oi(t,e))break;Tr(t);var i=jr(t);mr(t),Hr(t,i),ui(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function li(t,e){var n=new ai(t,e);if(oi(t,n)){Tr(t),si(t,n);var r=jr(t);mr(t),Hr(t,r),ui(t,r),n.finish()}}function ci(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function ui(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Tn(t)+"px"}function hi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=or(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,a=r+"px",o=0;o<n.length;o++)if(!n[o].hidden){t.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=a}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function di(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=Qt(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(L("div",[L("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ci(t.display),!0}return!1}function fi(t,e){for(var n=[],r=!1,i=0;i<t.length;i++){var a=t[i],o=null;if("string"!=typeof a&&(o=a.style,a=a.className),"CodeMirror-linenumbers"==a){if(!e)continue;r=!0}n.push({className:a,style:o})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function pi(t){var e=t.gutters,n=t.gutterSpecs;O(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=e.appendChild(L("div",null,"CodeMirror-gutter "+a));o&&(s.style.cssText=o),"CodeMirror-linenumbers"==a&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",ci(t)}function gi(t){pi(t.display),hr(t),hi(t)}function mi(t,e,r,i){var a=this;this.input=r,a.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=D("div",null,"CodeMirror-code"),a.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=L("div",null,"CodeMirror-cursors"),a.measure=L("div",null,"CodeMirror-measure"),a.lineMeasure=L("div",null,"CodeMirror-measure"),a.lineSpace=D("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var c=D("div",[a.lineSpace],"CodeMirror-lines");a.mover=L("div",[c],null,"position: relative"),a.sizer=L("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=L("div",null,null,"position: absolute; height: 50px; width: 1px;"),a.gutters=L("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=L("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=L("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),l||n&&v||(a.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(a.wrapper):t(a.wrapper)),a.viewFrom=a.viewTo=e.first,a.reportedViewFrom=a.reportedViewTo=e.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=fi(i.gutters,i.lineNumbers),pi(a),r.init(a)}ai.prototype.signal=function(t,e){vt(t,e)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var t=0;t<this.events.length;t++)pt.apply(null,this.events[t])};var vi=0,yi=null;function bi(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function xi(t){var e=bi(t);return e.x*=yi,e.y*=yi,e}function Si(t,e){var r=bi(e),i=r.x,a=r.y,o=t.display,s=o.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||a&&u){if(a&&y&&l)t:for(var d=e.target,f=o.view;d!=s;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){t.display.currentWheelTarget=d;break t}if(i&&!n&&!h&&null!=yi)return a&&u&&Nr(t,Math.max(0,s.scrollTop+a*yi)),Fr(t,Math.max(0,s.scrollLeft+i*yi)),(!a||a&&u)&&bt(e),void(o.wheelStartX=null);if(a&&null!=yi){var g=a*yi,m=t.doc.scrollTop,v=m+o.wrapper.clientHeight;g<0?m=Math.max(0,m+g-50):v=Math.min(t.doc.height,v+g+50),li(t,{top:m,bottom:v})}vi<20&&(null==o.wheelStartX?(o.wheelStartX=s.scrollLeft,o.wheelStartY=s.scrollTop,o.wheelDX=i,o.wheelDY=a,setTimeout((function(){if(null!=o.wheelStartX){var t=s.scrollLeft-o.wheelStartX,e=s.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(yi=(yi*vi+n)/(vi+1),++vi)}}),200)):(o.wheelDX+=i,o.wheelDY+=a))}}o?yi=-.53:n?yi=15:u?yi=-.7:d&&(yi=-1/3);var Ci=function(t,e){this.ranges=t,this.primIndex=e};Ci.prototype.primary=function(){return this.ranges[this.primIndex]},Ci.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(!ne(n.anchor,r.anchor)||!ne(n.head,r.head))return!1}return!0},Ci.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new Ei(re(this.ranges[e].anchor),re(this.ranges[e].head));return new Ci(t,this.primIndex)},Ci.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},Ci.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ee(e,r.from())>=0&&ee(t,r.to())<=0)return n}return-1};var Ei=function(t,e){this.anchor=t,this.head=e};function wi(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ee(t.from(),e.from())})),n=U(e,i);for(var a=1;a<e.length;a++){var o=e[a],s=e[a-1],l=ee(s.to(),o.from());if(r&&!o.empty()?l>0:l>=0){var c=ae(s.from(),o.from()),u=ie(s.to(),o.to()),h=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,e.splice(--a,2,new Ei(h?u:c,h?c:u))}}return new Ci(e,n)}function ki(t,e){return new Ci([new Ei(t,e||t)],0)}function Ti(t){return t.text?te(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Oi(t,e){if(ee(t,e.from)<0)return t;if(ee(t,e.to)<=0)return Ti(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Ti(e).ch-e.to.ch),te(n,r)}function Ai(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new Ei(Oi(i.anchor,e),Oi(i.head,e)))}return wi(t.cm,n,t.sel.primIndex)}function Li(t,e,n){return t.line==e.line?te(n.line,t.ch-e.ch+n.ch):te(n.line+(t.line-e.line),t.ch)}function Di(t){t.doc.mode=Bt(t.options,t.doc.modeOption),Ri(t)}function Ri(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,ri(t,100),t.state.modeGen++,t.curOp&&hr(t)}function Ii(t,e){return 0==e.from.ch&&0==e.to.ch&&""==Y(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function _i(t,e,n,r){function i(t){return n?n[t]:null}function a(t,n,i){!function(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ae(t),Le(t,n);var i=r?r(t):1;i!=t.height&&Xt(t,i)}(t,n,i,r),ln(t,"change",t,e)}function o(t,e){for(var n=[],a=t;a<e;++a)n.push(new Ke(c[a],i(a),r));return n}var s=e.from,l=e.to,c=e.text,u=Kt(t,s.line),h=Kt(t,l.line),d=Y(c),f=i(c.length-1),p=l.line-s.line;if(e.full)t.insert(0,o(0,c.length)),t.remove(c.length,t.size-c.length);else if(Ii(t,e)){var g=o(0,c.length-1);a(h,h.text,f),p&&t.remove(s.line,p),g.length&&t.insert(s.line,g)}else if(u==h)if(1==c.length)a(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),f);else{var m=o(1,c.length-1);m.push(new Ke(d+u.text.slice(l.ch),f,r)),a(u,u.text.slice(0,s.ch)+c[0],i(0)),t.insert(s.line+1,m)}else if(1==c.length)a(u,u.text.slice(0,s.ch)+c[0]+h.text.slice(l.ch),i(0)),t.remove(s.line+1,p);else{a(u,u.text.slice(0,s.ch)+c[0],i(0)),a(h,d+h.text.slice(l.ch),f);var v=o(1,c.length-1);p>1&&t.remove(s.line+1,p-1),t.insert(s.line+1,v)}ln(t,"change",t,e)}function Mi(t,e,n){!function t(r,i,a){if(r.linked)for(var o=0;o<r.linked.length;++o){var s=r.linked[o];if(s.doc!=i){var l=a&&s.sharedHist;n&&!l||(e(s.doc,l),t(s.doc,r,l))}}}(t,null,!0)}function Ni(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,lr(t),Di(t),Pi(t),t.options.lineWrapping||Ve(t),t.options.mode=e.modeOption,hr(t)}function Pi(t){("rtl"==t.doc.direction?_:T)(t.display.lineDiv,"CodeMirror-rtl")}function Fi(t){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function ji(t,e){var n={from:re(e.from),to:Ti(e),text:qt(t,e.from,e.to)};return zi(t,n,e.from.line,e.to.line+1),Mi(t,(function(t){return zi(t,n,e.from.line,e.to.line+1)}),!0),n}function Bi(t){for(;t.length&&Y(t).ranges;)t.pop()}function Ui(t,e,n,r){var i=t.history;i.undone.length=0;var a,o,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(a=function(t,e){return e?(Bi(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}(i,i.lastOp==r)))o=Y(a.changes),0==ee(e.from,e.to)&&0==ee(e.from,o.to)?o.to=Ti(e):a.changes.push(ji(t,e));else{var l=Y(i.done);for(l&&l.ranges||Gi(t.sel,i.done),a={changes:[ji(t,e)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,o||pt(t,"historyAdded")}function Hi(t,e,n,r){var i=t.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||function(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,a,Y(i.done),e))?i.done[i.done.length-1]=e:Gi(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function Gi(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function zi(t,e,n,r){var i=e["spans_"+t.id],a=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[a]=n.markedSpans),++a}))}function Wi(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function Vi(t,e){var n=function(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],i=0;i<e.text.length;++i)r.push(Wi(n[i]));return r}(t,e),r=Te(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)t:for(var s=0;s<o.length;++s){for(var l=o[s],c=0;c<a.length;++c)if(a[c].marker==l.marker)continue t;a.push(l)}else o&&(n[i]=o)}return n}function Ki(t,e,n){for(var r=[],i=0;i<t.length;++i){var a=t[i];if(a.ranges)r.push(n?Ci.prototype.deepCopy.call(a):a);else{var o=a.changes,s=[];r.push({changes:s});for(var l=0;l<o.length;++l){var c=o[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),e)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&U(e,Number(u[1]))>-1&&(Y(s)[h]=c[h],delete c[h])}}}return r}function qi(t,e,n,r){if(r){var i=t.anchor;if(n){var a=ee(e,i)<0;a!=ee(n,i)<0?(i=e,e=n):a!=ee(e,n)<0&&(e=n)}return new Ei(i,e)}return new Ei(n||e,e)}function Yi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Qi(t,new Ci([qi(t.sel.primary(),e,n,i)],0),r)}function Xi(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),a=0;a<t.sel.ranges.length;a++)r[a]=qi(t.sel.ranges[a],e[a],null,i);Qi(t,wi(t.cm,r,t.sel.primIndex),n)}function $i(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,Qi(t,wi(t.cm,i,t.sel.primIndex),r)}function Ji(t,e,n,r){Qi(t,ki(e,n),r)}function Zi(t,e,n){var r=t.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=e,ta(t,e,n)):Qi(t,e,n)}function Qi(t,e,n){ta(t,e,n),Hi(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function ta(t,e,n){(vt(t,"beforeSelectionChange")||t.cm&&vt(t.cm,"beforeSelectionChange"))&&(e=function(t,e,n){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new Ei(se(t,e[n].anchor),se(t,e[n].head))},origin:n&&n.origin};return pt(t,"beforeSelectionChange",t,r),t.cm&&pt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?wi(t.cm,r.ranges,r.ranges.length-1):e}(t,e,n));var r=n&&n.bias||(ee(e.primary().head,t.sel.primary().head)<0?-1:1);ea(t,ra(t,e,r,!0)),n&&!1===n.scroll||!t.cm||Rr(t.cm)}function ea(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,mt(t.cm)),ln(t,"cursorActivity",t))}function na(t){ea(t,ra(t,t.sel,null,!1))}function ra(t,e,n,r){for(var i,a=0;a<e.ranges.length;a++){var o=e.ranges[a],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[a],l=aa(t,o.anchor,s&&s.anchor,n,r),c=aa(t,o.head,s&&s.head,n,r);(i||l!=o.anchor||c!=o.head)&&(i||(i=e.ranges.slice(0,a)),i[a]=new Ei(l,c))}return i?wi(t.cm,i,e.primIndex):e}function ia(t,e,n,r,i){var a=Kt(t,e.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(i&&(pt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!l.atomic)continue;if(n){var h=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(h=oa(t,h,-r,h&&h.line==e.line?a:null)),h&&h.line==e.line&&(d=ee(h,n))&&(r<0?d<0:d>0))return ia(t,h,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=oa(t,f,r,f.line==e.line?a:null)),f?ia(t,f,e,r,i):null}}return e}function aa(t,e,n,r,i){var a=r||1,o=ia(t,e,n,a,i)||!i&&ia(t,e,n,a,!0)||ia(t,e,n,-a,i)||!i&&ia(t,e,n,-a,!0);return o||(t.cantEdit=!0,te(t.first,0))}function oa(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?se(t,te(e.line-1)):null:n>0&&e.ch==(r||Kt(t,e.line)).text.length?e.line<t.first+t.size-1?te(e.line+1,0):null:new te(e.line,e.ch+n)}function sa(t){t.setSelection(te(t.firstLine(),0),te(t.lastLine()),G)}function la(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,i,a){e&&(r.from=se(t,e)),n&&(r.to=se(t,n)),i&&(r.text=i),void 0!==a&&(r.origin=a)}),pt(t,"beforeChange",t,r),t.cm&&pt(t.cm,"beforeChange",t.cm,r),r.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ca(t,e,n){if(t.cm){if(!t.cm.curOp)return ti(t.cm,ca)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(vt(t,"beforeChange")||t.cm&&vt(t.cm,"beforeChange"))||(e=la(t,e,!0))){var r=Se&&!n&&function(t,e,n){var r=null;if(t.iter(e.line,n.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=U(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:e,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),l=0;l<i.length;++l){var c=i[l];if(!(ee(c.to,s.from)<0||ee(c.from,s.to)>0)){var u=[l,1],h=ee(c.from,s.from),d=ee(c.to,s.to);(h<0||!o.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!o.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)ua(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else ua(t,e)}}function ua(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ee(e.from,e.to)){var n=Ai(t,e);Ui(t,e,n,t.cm?t.cm.curOp.id:NaN),fa(t,e,n,Te(t,e));var r=[];Mi(t,(function(t,n){n||-1!=U(r,t.history)||(va(t.history,e),r.push(t.history)),fa(t,e,null,Te(t,e))}))}}function ha(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,a=t.history,o=t.sel,s="undo"==e?a.done:a.undone,l="undo"==e?a.undone:a.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(t.sel):i.ranges);c++);if(c!=s.length){for(a.lastOrigin=a.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Gi(i,l),n&&!i.equals(t.sel))return void Qi(t,i,{clearRedo:!1});o=i}var u=[];Gi(o,l),l.push({changes:u,generation:a.generation}),a.generation=i.generation||++a.maxGeneration;for(var h=vt(t,"beforeChange")||t.cm&&vt(t.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=e,h&&!la(t,r,!1))return s.length=0,{};u.push(ji(t,r));var a=n?Ai(t,r):Y(s);fa(t,r,a,Vi(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:Ti(r)});var o=[];Mi(t,(function(t,e){e||-1!=U(o,t.history)||(va(t.history,r),o.push(t.history)),fa(t,r,null,Vi(t,r))}))},f=i.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function da(t,e){if(0!=e&&(t.first+=e,t.sel=new Ci(X(t.sel.ranges,(function(t){return new Ei(te(t.anchor.line+e,t.anchor.ch),te(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){hr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(t.cm,r,"gutter")}}function fa(t,e,n,r){if(t.cm&&!t.cm.curOp)return ti(t.cm,fa)(t,e,n,r);if(e.to.line<t.first)da(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);da(t,i),e={from:te(t.first,0),to:te(e.to.line+i,e.to.ch),text:[Y(e.text)],origin:e.origin}}var a=t.lastLine();e.to.line>a&&(e={from:e.from,to:te(a,Kt(t,a).text.length),text:[e.text[0]],origin:e.origin}),e.removed=qt(t,e.from,e.to),n||(n=Ai(t,e)),t.cm?function(t,e,n){var r=t.doc,i=t.display,a=e.from,o=e.to,s=!1,l=a.line;t.options.lineWrapping||(l=$t(je(Kt(r,a.line))),r.iter(l,o.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&mt(t),_i(r,e,n,sr(t)),t.options.lineWrapping||(r.iter(l,a.line+e.text.length,(function(t){var e=We(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var i=Kt(t,r).stateAfter;if(i&&(!(i instanceof ce)||r+i.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}(r,a.line),ri(t,400);var c=e.text.length-(o.line-a.line)-1;e.full?hr(t):a.line!=o.line||1!=e.text.length||Ii(t.doc,e)?hr(t,a.line,o.line+1,c):dr(t,a.line,"text");var u=vt(t,"changes"),h=vt(t,"change");if(h||u){var d={from:a,to:o,text:e.text,removed:e.removed,origin:e.origin};h&&ln(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}(t.cm,e,r):_i(t,e,r),ta(t,n,G),t.cantEdit&&aa(t,te(t.firstLine(),0))&&(t.cantEdit=!1)}}function pa(t,e,n,r,i){var a;r||(r=n),ee(r,n)<0&&(n=(a=[r,n])[0],r=a[1]),"string"==typeof e&&(e=t.splitLines(e)),ca(t,{from:n,to:r,text:e,origin:i})}function ga(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function ma(t,e,n,r){for(var i=0;i<t.length;++i){var a=t[i],o=!0;if(a.ranges){a.copied||((a=t[i]=a.deepCopy()).copied=!0);for(var s=0;s<a.ranges.length;s++)ga(a.ranges[s].anchor,e,n,r),ga(a.ranges[s].head,e,n,r)}else{for(var l=0;l<a.changes.length;++l){var c=a.changes[l];if(n<c.from.line)c.from=te(c.from.line+r,c.from.ch),c.to=te(c.to.line+r,c.to.ch);else if(e<=c.to.line){o=!1;break}}o||(t.splice(0,i+1),i=0)}}}function va(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;ma(t.done,n,r,i),ma(t.undone,n,r,i)}function ya(t,e,n,r){var i=e,a=e;return"number"==typeof e?a=Kt(t,oe(t,e)):i=$t(e),null==i?null:(r(a,i)&&t.cm&&dr(t.cm,i,n),a)}function ba(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function xa(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize(),n+=i.height,i.parent=this}this.size=e,this.height=n,this.parent=null}Ei.prototype.from=function(){return ae(this.anchor,this.head)},Ei.prototype.to=function(){return ie(this.anchor,this.head)},Ei.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ba.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var i=this.lines[n];this.height-=i.height,qe(i),ln(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;t<r;++t)if(n(this.lines[t]))return!0}},xa.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(t<i){var a=Math.min(e,i-t),o=r.height;if(r.removeInner(t,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),0==(e-=a))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof ba))){var s=[];this.collapse(s),this.children=[new ba(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(t<=a){if(i.insertInner(t,e,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var l=new ba(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}t-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new xa(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=U(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var r=new xa(t.children);r.parent=t,t.children=[r,e],t=r}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(t<a){var o=Math.min(e,a-t);if(i.iterN(t,o,n))return!0;if(0==(e-=o))break;t=0}else t-=a}}};var Sa=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=t,this.node=e};function Ca(t,e,n){ze(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Dr(t,n)}Sa.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=$t(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var a=Sn(this);Xt(n,Math.max(0,n.height-a)),t&&(Qr(t,(function(){Ca(t,n,-a),dr(t,r,"widget")})),ln(t,"lineWidgetCleared",t,this,r))}},Sa.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Sn(this)-e;i&&(He(this.doc,r)||Xt(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,Ca(n,r,i),ln(n,"lineWidgetChanged",n,t,$t(r))})))},yt(Sa);var Ea=0,wa=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++Ea};function ka(t,e,n,r,i){if(r&&r.shared)return function(t,e,n,r,i){(r=F(r)).shared=!1;var a=[ka(t,e,n,r,i)],o=a[0],s=r.widgetNode;return Mi(t,(function(t){s&&(r.widgetNode=s.cloneNode(!0)),a.push(ka(t,se(t,e),se(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;o=Y(a)})),new Ta(a,o)}(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return ti(t.cm,ka)(t,e,n,r,i);var a=new wa(t,i),o=ee(e,n);if(r&&F(r,a,!1),o>0||0==o&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=D("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Fe(t,e.line,e,n,a)||e.line!=n.line&&Fe(t,n.line,e,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ce=!0}a.addToHistory&&Ui(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(t){c&&a.collapsed&&!c.options.lineWrapping&&je(t)==c.display.maxLine&&(s=!0),a.collapsed&&l!=e.line&&Xt(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Ee(a,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),a.collapsed&&t.iter(e.line,n.line+1,(function(e){He(t,e)&&Xt(e,0)})),a.clearOnEnter&&ht(a,"beforeCursorEnter",(function(){return a.clear()})),a.readOnly&&(Se=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),a.collapsed&&(a.id=++Ea,a.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),a.collapsed)hr(c,e.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=e.line;u<=n.line;u++)dr(c,u,"text");a.atomic&&na(c.doc),ln(c,"markerAdded",c,a)}return a}wa.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Kr(t),vt(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=we(o.markedSpans,this);t&&!this.collapsed?dr(t,$t(o),"text"):t&&(null!=s.to&&(i=$t(o)),null!=s.from&&(r=$t(o))),o.markedSpans=ke(o.markedSpans,s),null==s.from&&this.collapsed&&!He(this.doc,o)&&t&&Xt(o,rr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=je(this.lines[l]),u=We(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&hr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&na(t.doc)),t&&ln(t,"markerCleared",t,this,r,i),e&&qr(t),this.parent&&this.parent.clear()}},wa.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i<this.lines.length;++i){var a=this.lines[i],o=we(a.markedSpans,this);if(null!=o.from&&(n=te(e?a:$t(a),o.from),-1==t))return n;if(null!=o.to&&(r=te(e?a:$t(a),o.to),1==t))return r}return n&&{from:n,to:r}},wa.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Qr(r,(function(){var i=e.line,a=$t(e.line),o=Rn(r,a);if(o&&(jn(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!He(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Sn(n)-s;l&&Xt(i,i.height+l)}ln(r,"markerChanged",r,t)}))},wa.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=U(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},wa.prototype.detachLine=function(t){if(this.lines.splice(U(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},yt(wa);var Ta=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function Oa(t){return t.findMarks(te(t.first,0),t.clipPos(te(t.lastLine())),(function(t){return t.parent}))}function Aa(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];Mi(n.primary.doc,(function(t){return r.push(t)}));for(var i=0;i<n.markers.length;i++){var a=n.markers[i];-1==U(r,a.doc)&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}Ta.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();ln(this,"clear")}},Ta.prototype.find=function(t,e){return this.primary.find(t,e)},yt(Ta);var La=0,Da=function(t,e,n,r,i){if(!(this instanceof Da))return new Da(t,e,n,r,i);null==n&&(n=0),xa.call(this,[new ba([new Ke("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=te(n,0);this.sel=ki(a),this.history=new Fi(null),this.id=++La,this.modeOption=e,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),_i(this,{from:a,to:a,text:t}),Qi(this,ki(a),G)};Da.prototype=J(xa.prototype,{constructor:Da,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Yt(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:ni((function(t){var e=te(this.first,0),n=this.first+this.size-1;ca(this,{from:e,to:te(n,Kt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Ir(this.cm,0,0),Qi(this,ki(e),G)})),replaceRange:function(t,e,n,r){pa(this,t,e=se(this,e),n=n?se(this,n):e,r)},getRange:function(t,e,n){var r=qt(this,se(this,t),se(this,e));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(Zt(this,t))return Kt(this,t)},getLineNumber:function(t){return $t(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Kt(this,t)),je(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return se(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(t,e,n){Ji(this,se(this,"number"==typeof t?te(t,e||0):t),null,n)})),setSelection:ni((function(t,e,n){Ji(this,se(this,t),se(this,e||t),n)})),extendSelection:ni((function(t,e,n){Yi(this,se(this,t),e&&se(this,e),n)})),extendSelections:ni((function(t,e){Xi(this,le(this,t),e)})),extendSelectionsBy:ni((function(t,e){Xi(this,le(this,X(this.sel.ranges,t)),e)})),setSelections:ni((function(t,e,n){if(t.length){for(var r=[],i=0;i<t.length;i++)r[i]=new Ei(se(this,t[i].anchor),se(this,t[i].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Qi(this,wi(this.cm,r,e),n)}})),addSelection:ni((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new Ei(se(this,t),se(this,e||t))),Qi(this,wi(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=qt(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=qt(this,n[r].from(),n[r].to());!1!==t&&(i=i.join(t||this.lineSeparator())),e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:ni((function(t,e,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(t[a]),origin:n}}for(var s=e&&"end"!=e&&function(t,e,n){for(var r=[],i=te(t.first,0),a=i,o=0;o<e.length;o++){var s=e[o],l=Li(s.from,i,a),c=Li(Ti(s),i,a);if(i=s.to,a=c,"around"==n){var u=t.sel.ranges[o],h=ee(u.head,u.anchor)<0;r[o]=new Ei(h?c:l,h?l:c)}else r[o]=new Ei(l,l)}return new Ci(r,t.sel.primIndex)}(this,r,e),l=r.length-1;l>=0;l--)ca(this,r[l]);s?Zi(this,s):this.cm&&Rr(this.cm)})),undo:ni((function(){ha(this,"undo")})),redo:ni((function(){ha(this,"redo")})),undoSelection:ni((function(){ha(this,"undo",!0)})),redoSelection:ni((function(){ha(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Fi(this.history.maxGeneration),Mi(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(t){var e=this.history=new Fi(this.history.maxGeneration);e.done=Ki(t.done.slice(0),null,!0),e.undone=Ki(t.undone.slice(0),null,!0)},setGutterMarker:ni((function(t,e,n){return ya(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&et(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:ni((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&ya(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,et(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!Zt(this,t))return null;if(e=t,!(t=Kt(this,t)))return null}else if(null==(e=$t(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:ni((function(t,e,n){return ya(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(w(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:ni((function(t,e,n){return ya(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var a=i.match(w(n));if(!a)return!1;var o=a.index+a[0].length;t[r]=i.slice(0,a.index)+(a.index&&o!=i.length?" ":"")+i.slice(o)||null}return!0}))})),addLineWidget:ni((function(t,e,n){return function(t,e,n,r){var i=new Sa(t,n,r),a=t.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ya(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,a&&!He(t,e)){var r=ze(e)<t.scrollTop;Xt(e,e.height+Sn(i)),r&&Dr(a,i.height),a.curOp.forceUpdate=!0}return!0})),a&&ln(a,"lineWidgetAdded",a,i,"number"==typeof e?e:$t(e)),i}(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return ka(this,se(this,t),se(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return ka(this,t=se(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Kt(this,(t=se(this,t)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=se(this,t),e=se(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var l=o[s];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)})),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var a=i.text.length+r;if(a>t)return e=t,!0;t-=a,++n})),se(this,te(n,e))},indexFromPos:function(t){var e=(t=se(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+n})),e},copy:function(t){var e=new Da(Yt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var r=new Da(Yt(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),a=t.clipPos(i.from),o=t.clipPos(i.to);if(ee(a,o)){var s=ka(t,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Oa(this)),r},unlinkDoc:function(t){if(t instanceof Oo&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),Aa(Oa(this));break}if(t.history==this.history){var n=[t.id];Mi(t,(function(t){return n.push(t.id)}),!0),t.history=new Fi(null),t.history.done=Ki(this.history.done,n),t.history.undone=Ki(this.history.undone,n)}},iterLinkedDocs:function(t){Mi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Rt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Qr(e=this.cm,(function(){Pi(e),hr(e)})))}))}),Da.prototype.eachLine=Da.prototype.iter;var Ra=0;function Ia(t){var e=this;if(_a(e),!gt(e,t)&&!Cn(e.display,t)){bt(t),o&&(Ra=+new Date);var n=cr(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,l=function(){++s==i&&ti(e,(function(){var t={from:n=se(e.doc,n),to:n,text:e.doc.splitLines(a.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};ca(e.doc,t),Zi(e.doc,ki(se(e.doc,n),se(e.doc,Ti(t))))}))()},c=function(t,n){if(e.options.allowDropFileTypes&&-1==U(e.options.allowDropFileTypes,t.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(a[n]=t),l()},r.readAsText(t)}},u=0;u<r.length;u++)c(r[u],u);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),ta(e.doc,ki(n,n)),d)for(var f=0;f<d.length;++f)pa(e.doc,"",d[f].anchor,d[f].head,"drag");e.replaceSelection(h,"around","paste"),e.display.input.focus()}}catch(t){}}}}function _a(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Ma(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Na=!1;function Pa(){var t;Na||(ht(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Ma(Fa)}),100))})),ht(window,"blur",(function(){return Ma(kr)})),Na=!0)}function Fa(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var ja={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ba=0;Ba<10;Ba++)ja[Ba+48]=ja[Ba+96]=String(Ba);for(var Ua=65;Ua<=90;Ua++)ja[Ua]=String.fromCharCode(Ua);for(var Ha=1;Ha<=12;Ha++)ja[Ha+111]=ja[Ha+63235]="F"+Ha;var Ga={};function za(t){var e,n,r,i,a=t.split(/-(?!$)/);t=a[a.length-1];for(var o=0;o<a.length-1;o++){var s=a[o];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),i&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function Wa(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=X(n.split(" "),za),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(" "),o=r):(s=i.slice(0,a+1).join(" "),o="...");var l=e[s];if(l){if(l!=o)throw new Error("Inconsistent bindings for "+s)}else e[s]=o}delete t[n]}for(var c in e)t[c]=e[c];return t}function Va(t,e,n,r){var i=(e=Xa(e)).call?e.call(t,r):e[t];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Va(t,e.fallthrough,n,r);for(var a=0;a<e.fallthrough.length;a++){var o=Va(t,e.fallthrough[a],n,r);if(o)return o}}}function Ka(t){var e="string"==typeof t?t:ja[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function qa(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(C?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(C?e.ctrlKey:e.metaKey)&&"Mod"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Ya(t,e){if(h&&34==t.keyCode&&t.char)return!1;var n=ja[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),qa(n,t,e))}function Xa(t){return"string"==typeof t?Ga[t]:t}function $a(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=e(n[i]);r.length&&ee(a.from,Y(r).to)<=0;){var o=r.pop();if(ee(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Qr(t,(function(){for(var e=r.length-1;e>=0;e--)pa(t.doc,"",r[e].from,r[e].to,"+delete");Rr(t)}))}function Ja(t,e,n){var r=it(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Za(t,e,n){var r=Ja(t,e.ch,n);return null==r?null:new te(e.line,r,n<0?"after":"before")}function Qa(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var a=ct(n,e.doc.direction);if(a){var o,s=i<0?Y(a):a[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=In(e,n);o=i<0?n.text.length-1:0;var u=_n(e,c,o).top;o=at((function(t){return _n(e,c,t).top==u}),i<0==(1==s.level)?s.from:s.to-1,o),"before"==l&&(o=Ja(n,o,1))}else o=i<0?s.to:s.from;return new te(r,o,l)}}return new te(r,i<0?n.text.length:0,i<0?"before":"after")}Ga.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ga.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ga.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ga.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ga.default=y?Ga.macDefault:Ga.pcDefault;var to={selectAll:sa,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),G)},killLine:function(t){return $a(t,(function(e){if(e.empty()){var n=Kt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:te(e.head.line+1,0)}:{from:e.head,to:te(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return $a(t,(function(e){return{from:te(e.from().line,0),to:se(t.doc,te(e.to().line+1,0))}}))},delLineLeft:function(t){return $a(t,(function(t){return{from:te(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return $a(t,(function(e){var n=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:n},"div"),to:e.from()}}))},delWrappedLineRight:function(t){return $a(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(te(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(te(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return eo(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return no(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return function(t,e){var n=Kt(t.doc,e),r=function(t){for(var e;e=Ne(t);)t=e.find(1,!0).line;return t}(n);return r!=n&&(e=$t(r)),Qa(!0,t,n,e,-1)}(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),W)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),W)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?no(t,e.head):r}),W)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=j(t.getLine(a.line),a.ch,r);e.push(q(r-o%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Qr(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var i=e[r].head,a=Kt(t.doc,i.line).text;if(a)if(i.ch==a.length&&(i=new te(i.line,i.ch-1)),i.ch>0)i=new te(i.line,i.ch+1),t.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),te(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var o=Kt(t.doc,i.line-1).text;o&&(i=new te(i.line,1),t.replaceRange(a.charAt(0)+t.doc.lineSeparator()+o.charAt(o.length-1),te(i.line-1,o.length-1),i,"+transpose"))}n.push(new Ei(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Qr(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r<e.length;r++)t.indentLine(e[r].from().line,null,!0);Rr(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function eo(t,e){var n=Kt(t.doc,e),r=je(n);return r!=n&&(e=$t(r)),Qa(!0,t,r,e,1)}function no(t,e){var n=eo(t,e.line),r=Kt(t.doc,n.line),i=ct(r,t.doc.direction);if(!i||0==i[0].level){var a=Math.max(n.ch,r.text.search(/\S/)),o=e.line==n.line&&e.ch<=a&&e.ch;return te(n.line,o?0:a,n.sticky)}return n}function ro(t,e,n){if("string"==typeof e&&!(e=to[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=H}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}var io=new B;function ao(t,e,n,r){var i=t.state.keySeq;if(i){if(Ka(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:io.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),oo(t,i+" "+e,n,r))return!0}return oo(t,e,n,r)}function oo(t,e,n,r){var i=function(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Va(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Va(e,t.options.extraKeys,n,t)||Va(e,t.options.keyMap,n,t)}(t,e,r);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&ln(t,"keyHandled",t,e,n),"handled"!=i&&"multi"!=i||(bt(n),Sr(t)),!!i}function so(t,e){var n=Ya(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?ao(t,"Shift-"+n,e,(function(e){return ro(t,e,!0)}))||ao(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return ro(t,e)})):ao(t,n,e,(function(e){return ro(t,e)})))}var lo=null;function co(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=I(),gt(e,t)))){o&&s<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var i=so(e,t);h&&(lo=i?r:null,i||88!=r||_t||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(T(e,"CodeMirror-crosshair"),ft(document,"keyup",n),ft(document,"mouseover",n))}_(e,"CodeMirror-crosshair"),ht(document,"keyup",n),ht(document,"mouseover",n)}(e)}}function uo(t){16==t.keyCode&&(this.doc.sel.shift=!1),gt(this,t)}function ho(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||Cn(e.display,t)||gt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(h&&n==lo)return lo=null,void bt(t);if(!h||t.which&&!(t.which<10)||!so(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(t,e,n){return ao(t,"'"+n+"'",e,(function(e){return ro(t,e,!0)}))}(e,t,i)||e.display.input.onKeyPress(t))}}}var fo,po,go=function(t,e,n){this.time=t,this.pos=e,this.button=n};function mo(t){var e=this,n=e.display;if(!(gt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Cn(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!bo(e,t)){var r=cr(e,t),i=wt(t),a=r?function(t,e){var n=+new Date;return po&&po.compare(n,t,e)?(fo=po=null,"triple"):fo&&fo.compare(n,t,e)?(po=new go(n,t,e),fo=null,"double"):(fo=new go(n,t,e),po=null,"single")}(r,i):"single";window.focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),r&&function(t,e,n,r,i){var a="Click";return"double"==r?a="Double"+a:"triple"==r&&(a="Triple"+a),ao(t,qa(a=(1==e?"Left":2==e?"Middle":"Right")+a,i),i,(function(e){if("string"==typeof e&&(e=to[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=H}finally{t.state.suppressEdits=!1}return r}))}(e,i,r,a,t)||(1==i?r?function(t,e,n,r){o?setTimeout(P(Cr,t),0):t.curOp.focus=I();var i,a=function(t,e,n){var r=t.getOption("configureMouse"),i=r?r(t,e,n):{};if(null==i.unit){var a=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}(t,n,r),c=t.doc.sel;t.options.dragDrop&&Ot&&!t.isReadOnly()&&"single"==n&&(i=c.contains(e))>-1&&(ee((i=c.ranges[i]).from(),e)<0||e.xRel>0)&&(ee(i.to(),e)>0||e.xRel<0)?function(t,e,n,r){var i=t.display,a=!1,c=ti(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,ft(i.wrapper.ownerDocument,"mouseup",c),ft(i.wrapper.ownerDocument,"mousemove",u),ft(i.scroller,"dragstart",h),ft(i.scroller,"drop",c),a||(bt(e),r.addNew||Yi(t.doc,n,null,null,r.extend),l&&!d||o&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(t){a=a||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return a=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ht(i.wrapper.ownerDocument,"mouseup",c),ht(i.wrapper.ownerDocument,"mousemove",u),ht(i.scroller,"dragstart",h),ht(i.scroller,"drop",c),Er(t),setTimeout((function(){return i.input.focus()}),20)}(t,r,e,a):function(t,e,n,r){var i=t.display,a=t.doc;bt(e);var o,s,l=a.sel,c=l.ranges;if(r.addNew&&!r.extend?(s=a.sel.contains(n),o=s>-1?c[s]:new Ei(n,n)):(o=a.sel.primary(),s=a.sel.primIndex),"rectangle"==r.unit)r.addNew||(o=new Ei(n,n)),n=cr(t,e,!0,!0),s=-1;else{var u=vo(t,n,r.unit);o=r.extend?qi(o,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Qi(a,wi(t,c.concat([o]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Qi(a,wi(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):$i(a,s,o,z):(s=0,Qi(a,new Ci([o],0),z),l=a.sel);var h=n;function d(e){if(0!=ee(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],c=t.options.tabSize,u=j(Kt(a,n.line).text,n.ch,c),d=j(Kt(a,e.line).text,e.ch,c),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Kt(a,g).text,y=V(v,f,c);f==p?i.push(new Ei(te(g,y),te(g,y))):v.length>y&&i.push(new Ei(te(g,y),te(g,V(v,p,c))))}i.length||i.push(new Ei(n,n)),Qi(a,wi(t,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=o,S=vo(t,e,r.unit),C=x.anchor;ee(S.anchor,C)>0?(b=S.head,C=ae(x.from(),S.anchor)):(b=S.anchor,C=ie(x.to(),S.head));var E=l.ranges.slice(0);E[s]=function(t,e){var n=e.anchor,r=e.head,i=Kt(t.doc,n.line);if(0==ee(n,r)&&n.sticky==r.sticky)return e;var a=ct(i);if(!a)return e;var o=st(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=o+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==a.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=st(a,r.ch,r.sticky),h=u-o||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=a[c+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new Ei(new te(n.line,p,g),r)}(t,new Ei(se(a,C),b)),Qi(a,wi(t,E,s),z)}}var f=i.wrapper.getBoundingClientRect(),p=0;function g(e){t.state.selectingText=!1,p=1/0,e&&(bt(e),i.input.focus()),ft(i.wrapper.ownerDocument,"mousemove",m),ft(i.wrapper.ownerDocument,"mouseup",v),a.history.lastSelOrigin=null}var m=ti(t,(function(e){0!==e.buttons&&wt(e)?function e(n){var o=++p,s=cr(t,n,!0,"rectangle"==r.unit);if(s)if(0!=ee(s,h)){t.curOp.focus=I(),d(s);var l=Ar(i,a);(s.line>=l.to||s.line<l.from)&&setTimeout(ti(t,(function(){p==o&&e(n)})),150)}else{var c=n.clientY<f.top?-20:n.clientY>f.bottom?20:0;c&&setTimeout(ti(t,(function(){p==o&&(i.scroller.scrollTop+=c,e(n))})),50)}}(e):g(e)})),v=ti(t,g);t.state.selectingText=v,ht(i.wrapper.ownerDocument,"mousemove",m),ht(i.wrapper.ownerDocument,"mouseup",v)}(t,r,e,a)}(e,r,a,t):Et(t)==n.scroller&&bt(t):2==i?(r&&Yi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(E?e.display.input.onContextMenu(t):Er(e)))}}function vo(t,e,n){if("char"==n)return new Ei(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Ei(te(e.line,0),se(t.doc,te(e.line+1,0)));var r=n(t,e);return new Ei(r.from,r.to)}function yo(t,e,n,r){var i,a;if(e.touches)i=e.touches[0].clientX,a=e.touches[0].clientY;else try{i=e.clientX,a=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&bt(e);var o=t.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!vt(t,n))return St(e);a-=s.top-o.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=o.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return pt(t,n,t,Jt(t.doc,a),t.display.gutterSpecs[l].className,e),St(e)}}function bo(t,e){return yo(t,e,"gutterClick",!0)}function xo(t,e){Cn(t.display,e)||function(t,e){return!!vt(t,"gutterContextMenu")&&yo(t,e,"gutterContextMenu",!1)}(t,e)||gt(t,e,"contextmenu")||E||t.display.input.onContextMenu(e)}function So(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Un(t)}go.prototype.compare=function(t,e,n){return this.time+400>t&&0==ee(e,this.pos)&&n==this.button};var Co={toString:function(){return"CodeMirror.Init"}},Eo={},wo={};function ko(t,e,n){if(!e!=!(n&&n!=Co)){var r=t.display.dragFunctions,i=e?ht:ft;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function To(t){t.options.lineWrapping?(_(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),Ve(t)),lr(t),hr(t),Un(t),setTimeout((function(){return Hr(t)}),100)}function Oo(t,e){var n=this;if(!(this instanceof Oo))return new Oo(t,e);this.options=e=e?F(e):{},F(Eo,e,!1);var r=e.value;"string"==typeof r?r=new Da(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Oo.inputStyles[e.inputStyle](this),a=this.display=new mi(t,r,i,e);for(var c in a.wrapper.CodeMirror=this,So(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(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 B,keySeq:null,specialChars:null},e.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;ht(e.scroller,"mousedown",ti(t,mo)),ht(e.scroller,"dblclick",o&&s<11?ti(t,(function(e){if(!gt(t,e)){var n=cr(t,e);if(n&&!bo(t,e)&&!Cn(t.display,e)){bt(e);var r=t.findWordAt(n);Yi(t.doc,r.anchor,r.head)}}})):function(e){return gt(t,e)||bt(e)}),ht(e.scroller,"contextmenu",(function(e){return xo(t,e)})),ht(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||xo(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function a(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}ht(e.scroller,"touchstart",(function(i){if(!gt(t,i)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(i)&&!bo(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Cn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,s=t.coordsChar(e.activeTouch,"page");o=!r.prev||a(r,r.prev)?new Ei(s,s):!r.prev.prev||a(r,r.prev.prev)?t.findWordAt(s):new Ei(te(s.line,0),se(t.doc,te(s.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),bt(n)}i()})),ht(e.scroller,"touchcancel",i),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Nr(t,e.scroller.scrollTop),Fr(t,e.scroller.scrollLeft,!0),pt(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return Si(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return Si(t,e)})),ht(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){gt(t,e)||Ct(e)},over:function(e){gt(t,e)||(function(t,e){var n=cr(t,e);if(n){var r=document.createDocumentFragment();yr(t,n,r),t.display.dragCursor||(t.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),A(t.display.dragCursor,r)}}(t,e),Ct(e))},start:function(e){return function(t,e){if(o&&(!t.state.draggingText||+new Date-Ra<100))Ct(e);else if(!gt(t,e)&&!Cn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!d)){var n=L("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(t,e)},drop:ti(t,Ia),leave:function(e){gt(t,e)||_a(t)}};var l=e.input.getField();ht(l,"keyup",(function(e){return uo.call(t,e)})),ht(l,"keydown",ti(t,co)),ht(l,"keypress",ti(t,ho)),ht(l,"focus",(function(e){return wr(t,e)})),ht(l,"blur",(function(e){return kr(t,e)}))}(this),Pa(),Kr(this),this.curOp.forceUpdate=!0,Ni(this,r),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&wr(n)}),20):kr(this),wo)wo.hasOwnProperty(c)&&wo[c](this,e[c],Co);di(this),e.finishInit&&e.finishInit(this);for(var u=0;u<Ao.length;++u)Ao[u](this);qr(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}Oo.defaults=Eo,Oo.optionHandlers=wo;var Ao=[];function Lo(t,e,n,r){var i,a=t.doc;null==n&&(n="add"),"smart"==n&&(a.mode.indent?i=fe(t,e).state:n="prev");var o=t.options.tabSize,s=Kt(a,e),l=j(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=a.mode.indent(i,s.text.slice(u.length),s.text))==H||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>a.first?j(Kt(a,e-1).text,null,o):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/o);f;--f)d+=o,h+="\t";if(d<c&&(h+=q(c-d)),h!=u)return pa(a,h,te(e,0),te(e,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<a.sel.ranges.length;p++){var g=a.sel.ranges[p];if(g.head.line==e&&g.head.ch<u.length){var m=te(e,u.length);$i(a,p,new Ei(m,m));break}}}Oo.defineInitHook=function(t){return Ao.push(t)};var Do=null;function Ro(t){Do=t}function Io(t,e,n,r,i){var a=t.doc;t.display.shift=!1,r||(r=a.sel);var o=+new Date-200,s="paste"==i||t.state.pasteIncoming>o,l=Rt(e),c=null;if(s&&r.ranges.length>1)if(Do&&Do.text.join("\n")==e){if(r.ranges.length%Do.text.length==0){c=[];for(var u=0;u<Do.text.length;u++)c.push(a.splitLines(Do.text[u]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(c=X(l,(function(t){return[t]})));for(var h=t.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=te(p.line,p.ch-n):t.state.overwrite&&!s?g=te(g.line,Math.min(Kt(a,g.line).text.length,g.ch+Y(l).length)):s&&Do&&Do.lineWise&&Do.text.join("\n")==l.join("\n")&&(p=g=te(p.line,0)));var m={from:p,to:g,text:c?c[d%c.length]:l,origin:i||(s?"paste":t.state.cutIncoming>o?"cut":"+input")};ca(t.doc,m),ln(t,"inputRead",t,m)}e&&!s&&Mo(t,e),Rr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function _o(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Qr(e,(function(){return Io(e,n,0,null,"paste")})),!0}function Mo(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=t.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(e.indexOf(a.electricChars.charAt(s))>-1){o=Lo(t,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Kt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Lo(t,i.head.line,"smart"));o&&ln(t,"electricInput",t,i.head.line)}}}function No(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var i=t.doc.sel.ranges[r].head.line,a={anchor:te(i,0),head:te(i+1,0)};n.push(a),e.push(t.getRange(a.anchor,a.head))}return{text:e,ranges:n}}function Po(t,e,n,r){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",r?"":"off"),t.setAttribute("spellcheck",!!e)}function Fo(){var t=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=L("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),g&&(t.style.border="1px solid black"),Po(t),e}function jo(t,e,n,r,i){var a=e,o=n,s=Kt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function c(a){var o,c;if("codepoint"==r){var u=s.text.charCodeAt(e.ch+(r>0?0:-1));o=isNaN(u)?null:new te(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(u>=55296&&u<56320?2:1))),-n)}else o=i?function(t,e,n,r){var i=ct(e,t.doc.direction);if(!i)return Za(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=st(i,n.ch,n.sticky),o=i[a];if("ltr"==t.doc.direction&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return Za(e,n,r);var s,l=function(t,n){return Ja(e,t instanceof te?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(s=s||In(t,e),Zn(t,e,s,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==o.level){var h=1==o.level==r<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=o.to&&d<=u.end:d>=o.from&&d>=u.begin)){var f=h?"before":"after";return new te(n.line,d,f)}}var p=function(t,e,r){for(var a=function(t,e){return e?new te(n.line,l(t,1),"before"):new te(n.line,t,"after")};t>=0&&t<i.length;t+=e){var o=i[t],s=e>0==(1!=o.level),c=s?r.begin:l(r.end,-1);if(o.from<=c&&c<o.to)return a(c,s);if(c=s?o.from:l(o.to,-1),r.begin<=c&&c<r.end)return a(c,s)}},g=p(a+r,r,u);if(g)return g;var m=r>0?u.end:l(u.begin,-1);return null==m||r>0&&m==e.text.length||!(g=p(r>0?0:i.length-1,r,c(m)))?null:g}(t.cm,s,e,n):Za(s,e,n);if(null==o){if(a||(c=e.line+l)<t.first||c>=t.first+t.size||(e=new te(c,e.ch,e.sticky),!(s=Kt(t,c))))return!1;e=Qa(i,t.cm,s,e.line,l)}else e=o;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,h="group"==r,d=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||c(!f);f=!1){var p=s.text.charAt(e.ch)||"\n",g=tt(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),u&&u!=g){n<0&&(n=1,c(),e.sticky="after");break}if(g&&(u=g),n>0&&!c(!f))break}var m=aa(t,e,a,o,!0);return ne(a,m)&&(m.hitSide=!0),m}function Bo(t,e,n,r){var i,a,o=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*rr(t.display),3);i=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(a=$n(t,s,i)).outside;){if(n<0?i<=0:i>=o.height){a.hitSide=!0;break}i+=5*n}return a}var Uo=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ho(t,e){var n=Rn(t,e.line);if(!n||n.hidden)return null;var r=Kt(t.doc,e.line),i=Ln(n,r,e.line),a=ct(r,t.doc.direction),o="left";a&&(o=st(a,e.ch)%2?"right":"left");var s=Pn(i.map,e.ch,o);return s.offset="right"==s.collapse?s.end:s.start,s}function Go(t,e){return e&&(t.bad=!0),t}function zo(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return Go(t.clipPos(te(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i<t.display.view.length;i++){var a=t.display.view[i];if(a.node==r)return Wo(a,e,n)}}function Wo(t,e,n){var r=t.text.firstChild,i=!1;if(!e||!R(r,e))return Go(te($t(t.line),0),!0);if(e==r&&(i=!0,e=r.childNodes[n],n=0,!e)){var a=t.rest?Y(t.rest):t.line;return Go(te($t(a),a.text.length),i)}var o=3==e.nodeType?e:null,s=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,n&&(n=o.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=t.measure,c=l.maps;function u(e,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var a=i<0?l.map:c[i],o=0;o<a.length;o+=3){var s=a[o+2];if(s==e||s==n){var u=$t(i<0?t.line:t.rest[i]),h=a[o]+r;return(r<0||s!=e)&&(h=a[o+(r?1:0)]),te(u,h)}}}var h=u(o,s,n);if(h)return Go(h,i);for(var d=s.nextSibling,f=o?o.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return Go(te(h.line,h.ch-f),i);f+=d.textContent.length}for(var p=s.previousSibling,g=n;p;p=p.previousSibling){if(h=u(p,p.firstChild,-1))return Go(te(h.line,h.ch+g),i);g+=p.textContent.length}}Uo.prototype.init=function(t){var e=this,n=this,r=n.cm,i=n.div=t.lineDiv;function a(t){for(var e=t.target;e;e=e.parentNode){if(e==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function o(t){if(a(t)&&!gt(r,t)){if(r.somethingSelected())Ro({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=No(r);Ro({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,G),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var o=Do.text.join("\n");if(t.clipboardData.setData("Text",o),t.clipboardData.getData("Text")==o)return void t.preventDefault()}var s=Fo(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Do.text.join("\n");var c=document.activeElement;N(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==i&&n.showPrimarySelection()}),50)}}Po(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),ht(i,"paste",(function(t){!a(t)||gt(r,t)||_o(t,r)||s<=11&&setTimeout(ti(r,(function(){return e.updateFromDOM()})),20)})),ht(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),ht(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),ht(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),ht(i,"touchstart",(function(){return n.forceCompositionEnd()})),ht(i,"input",(function(){e.composing||e.readFromDOMSoon()})),ht(i,"copy",o),ht(i,"cut",o)},Uo.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},Uo.prototype.prepareSelection=function(){var t=vr(this.cm,!1);return t.focus=document.activeElement==this.div,t},Uo.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Uo.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Uo.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),i=r.from(),a=r.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||a.line<e.display.viewFrom)t.removeAllRanges();else{var o=zo(e,t.anchorNode,t.anchorOffset),s=zo(e,t.focusNode,t.focusOffset);if(!o||o.bad||!s||s.bad||0!=ee(ae(o,s),i)||0!=ee(ie(o,s),a)){var l=e.display.view,c=i.line>=e.display.viewFrom&&Ho(e,i)||{node:l[0].measure.map[2],offset:0},u=a.line<e.display.viewTo&&Ho(e,a);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var f,p=t.rangeCount&&t.getRangeAt(0);try{f=k(c.node,c.offset,u.offset,u.node)}catch(t){}f&&(!n&&e.state.focused?(t.collapse(c.node,c.offset),f.collapsed||(t.removeAllRanges(),t.addRange(f))):(t.removeAllRanges(),t.addRange(f)),p&&null==t.anchorNode?t.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},Uo.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},Uo.prototype.showMultipleSelections=function(t){A(this.cm.display.cursorDiv,t.cursors),A(this.cm.display.selectionDiv,t.selection)},Uo.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Uo.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return R(this.div,e)},Uo.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Uo.prototype.blur=function(){this.div.blur()},Uo.prototype.getField=function(){return this.div},Uo.prototype.supportsTouch=function(){return!0},Uo.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},Uo.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Uo.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=zo(e,t.anchorNode,t.anchorOffset),r=zo(e,t.focusNode,t.focusOffset);n&&r&&Qr(e,(function(){Qi(e.doc,ki(n,r),G),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},Uo.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,i=r.display,a=r.doc.sel.primary(),o=a.from(),s=a.to();if(0==o.ch&&o.line>r.firstLine()&&(o=te(o.line-1,Kt(r.doc,o.line-1).length)),s.ch==Kt(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=te(s.line+1,0)),o.line<i.viewFrom||s.line>i.viewTo-1)return!1;o.line==i.viewFrom||0==(t=ur(r,o.line))?(e=$t(i.view[0].line),n=i.view[0].node):(e=$t(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,c,u=ur(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=$t(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(t,e,n,r,i){var a="",o=!1,s=t.doc.lineSeparator(),l=!1;function c(){o&&(a+=s,l&&(a+=s),o=l=!1)}function u(t){t&&(c(),a+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var a,d=e.getAttribute("cm-marker");if(d){var f=t.findMarks(te(r,0),te(i+1,0),(m=+d,function(t){return t.id==m}));return void(f.length&&(a=f[0].find(0))&&u(qt(t.doc,a.from,a.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;p&&c();for(var g=0;g<e.childNodes.length;g++)h(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),p&&(o=!0)}else 3==e.nodeType&&u(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;h(e),e!=n;)e=e.nextSibling,l=!1;return a}(r,n,c,e,l)),d=qt(r.doc,te(e,0),te(l,Kt(r.doc,l).text.length));h.length>1&&d.length>1;)if(Y(h)==Y(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),e++}for(var f=0,p=0,g=h[0],m=d[0],v=Math.min(g.length,m.length);f<v&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var y=Y(h),b=Y(d),x=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&e==o.line)for(;f&&f>o.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var S=te(e,f),C=te(l,d.length?Y(d).length-p:0);return h.length>1||h[0]||ee(S,C)?(pa(r.doc,h,S,C,"+input"),!0):void 0},Uo.prototype.ensurePolled=function(){this.forceCompositionEnd()},Uo.prototype.reset=function(){this.forceCompositionEnd()},Uo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Uo.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Uo.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return hr(t.cm)}))},Uo.prototype.setUneditable=function(t){t.contentEditable="false"},Uo.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Io)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Uo.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Uo.prototype.onContextMenu=function(){},Uo.prototype.resetPosition=function(){},Uo.prototype.needsContentAttribute=!0;var Vo=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null};Vo.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function a(t){if(!gt(r,t)){if(r.somethingSelected())Ro({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=No(r);Ro({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,G):(n.prevInput="",i.value=e.text.join("\n"),N(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),ht(i,"input",(function(){o&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(i,"paste",(function(t){gt(r,t)||_o(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ht(i,"cut",a),ht(i,"copy",a),ht(t.scroller,"paste",(function(e){if(!Cn(t,e)&&!gt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var a=new Event("paste");a.clipboardData=e.clipboardData,i.dispatchEvent(a)}})),ht(t.lineSpace,"selectstart",(function(e){Cn(t,e)||bt(e)})),ht(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ht(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Vo.prototype.createField=function(t){this.wrapper=Fo(),this.textarea=this.wrapper.firstChild},Vo.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},Vo.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=vr(t);if(t.options.moveInputWithCursor){var i=qn(t,n.sel.primary().head,"div"),a=e.wrapper.getBoundingClientRect(),o=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},Vo.prototype.showSelection=function(t){var e=this.cm.display;A(e.cursorDiv,t.cursors),A(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Vo.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&N(this.textarea),o&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",o&&s>=9&&(this.hasSelection=null))}},Vo.prototype.getField=function(){return this.textarea},Vo.prototype.supportsTouch=function(){return!1},Vo.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||I()!=this.textarea))try{this.textarea.focus()}catch(t){}},Vo.prototype.blur=function(){this.textarea.blur()},Vo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vo.prototype.receivedFocus=function(){this.slowPoll()},Vo.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},Vo.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}))},Vo.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var a=i.charCodeAt(0);if(8203!=a||r||(r=""),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l<c&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Qr(e,(function(){Io(e,i.slice(l),r.length-l,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Vo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vo.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},Vo.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var a=cr(n,t),c=r.scroller.scrollTop;if(a&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(a)&&ti(n,Qi)(n.doc,ki(a),G);var u,d=i.style.cssText,f=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),o&&s>=9&&m(),E){Ct(t);var g=function(){ft(window,"mouseup",g),setTimeout(v,20)};ht(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var t=n.somethingSelected(),a=""+(t?i.value:"");i.value="⇚",i.value=a,e.prevInput=t?"":"",i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=d,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!o||o&&s<9)&&m();var t=0,a=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==e.prevInput?ti(n,sa)(n):t++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}},Vo.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},Vo.prototype.setUneditable=function(){},Vo.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,i,a){t.defaults[n]=r,i&&(e[n]=a?function(t,e,n){n!=Co&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Co,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Di(t)}),!0),n("indentUnit",2,Di,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){Ri(t),Un(t),hr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var a=t.text.indexOf(e,i);if(-1==a)break;i=a+e.length,n.push(te(r,a))}r++}));for(var i=n.length-1;i>=0;i--)pa(t.doc,e,n[i],te(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Co&&t.refresh()})),n("specialCharPlaceholder",Ze,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){So(t),gi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Xa(e),i=n!=Co&&Xa(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,To,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=fi(e,t.options.lineNumbers),gi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?or(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return Hr(t)}),!0),n("scrollbarStyle","native",(function(t){Wr(t),Hr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=fi(t.options.gutters,e),gi(t)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(t){return t}),gi,!0),n("showCursorWhenSelecting",!1,mr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(kr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,ko),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,mr,!0),n("singleCursorHeightPerLine",!0,mr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ri,!0),n("addModeClass",!1,Ri,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,Ri,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}(Oo),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&ti(this,e[t])(this,n,i),pt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Xa(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:ei((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(t,e,n){for(var r=0,i=n(e);r<t.length&&n(t[r])<=i;)r++;t.splice(r,0,e)}(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,hr(this)})),removeOverlay:ei((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return e.splice(n,1),this.state.modeGen++,void hr(this)}})),indentLine:ei((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),Zt(this.doc,t)&&Lo(this,t,e,n)})),indentSelection:ei((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty())i.head.line>n&&(Lo(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&Rr(this));else{var a=i.from(),o=i.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=s;l<n;++l)Lo(this,l,t);var c=this.doc.sel.ranges;0==a.ch&&e.length==c.length&&c[r].from().ch>0&&$i(this.doc,r,new Ei(a,c[r].to()),G)}}})),getTokenAt:function(t,e){return ye(this,t,e)},getLineTokens:function(t,e){return ye(this,te(t),e,!0)},getTokenTypeAt:function(t){t=se(this.doc,t);var e,n=de(this,Kt(this.doc,t.line)),r=0,i=(n.length-1)/2,a=t.ch;if(0==a)e=n[2];else for(;;){var o=r+i>>1;if((o?n[2*o-1]:0)>=a)i=o;else{if(!(n[2*o+1]<a)){e=n[2*o+2];break}r=o+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var r=[];if(!n.hasOwnProperty(e))return r;var i=n[e],a=this.getModeAt(t);if("string"==typeof a[e])i[a[e]]&&r.push(i[a[e]]);else if(a[e])for(var o=0;o<a[e].length;o++){var s=i[a[e][o]];s&&r.push(s)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(a,this)&&-1==U(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(t,e){var n=this.doc;return fe(this,(t=oe(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return qn(this,null==t?n.head:"object"==typeof t?se(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return Kn(this,se(this.doc,t),e||"page")},coordsChar:function(t,e){return $n(this,(t=Vn(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=Vn(this,{top:t,left:0},e||"page").top,Jt(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,i=!1;if("number"==typeof t){var a=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>a&&(t=a,i=!0),r=Kt(this.doc,t)}else r=t;return Wn(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-ze(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var a,o,s,l=this.display,c=(t=qn(this,se(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==r)c=t.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>h)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=h&&(c=t.bottom),u+e.offsetWidth>d&&(u=d-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==i?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(a=this,o={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(s=Lr(a,o)).scrollTop&&Nr(a,s.scrollTop),null!=s.scrollLeft&&Fr(a,s.scrollLeft))},triggerOnKeyDown:ei(co),triggerOnKeyPress:ei(ho),triggerOnKeyUp:uo,triggerOnMouseDown:ei(mo),execCommand:function(t){if(to.hasOwnProperty(t))return to[t].call(null,this)},triggerElectric:ei((function(t){Mo(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var a=se(this.doc,t),o=0;o<e&&!(a=jo(this.doc,a,i,n,r)).hitSide;++o);return a},moveH:ei((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?jo(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),W)})),deleteH:ei((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):$a(this,(function(n){var i=jo(r,n.head,t,e,!1);return t<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(t,e,n,r){var i=1,a=r;e<0&&(i=-1,e=-e);for(var o=se(this.doc,t),s=0;s<e;++s){var l=qn(this,o,"div");if(null==a?a=l.left:l.left=a,(o=Bo(this,l,i,n)).hitSide)break}return o},moveV:ei((function(t,e){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(o){if(a)return t<0?o.from():o.to();var s=qn(n,o.head,"div");null!=o.goalColumn&&(s.left=o.goalColumn),i.push(s.left);var l=Bo(n,s,t,e);return"page"==e&&o==r.sel.primary()&&Dr(n,Kn(n,l,"div").top-s.top),l}),W),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]})),findWordAt:function(t){var e=Kt(this.doc,t.line).text,n=t.ch,r=t.ch;if(e){var i=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=e.length||!n?++r:--n;for(var a=e.charAt(n),o=tt(a,i)?function(t){return tt(t,i)}:/\s/.test(a)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!tt(t)};n>0&&o(e.charAt(n-1));)--n;for(;r<e.length&&o(e.charAt(r));)++r}return new Ei(te(t.line,n),te(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?_(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),pt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ei((function(t,e){Ir(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Tn(this)-this.display.barHeight,width:t.scrollWidth-Tn(this)-this.display.barWidth,clientHeight:An(this),clientWidth:On(this)}},scrollIntoView:ei((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:te(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?function(t,e){_r(t),t.curOp.scrollToPos=e}(this,t):Mr(this,t.from,t.to,t.margin)})),setSize:ei((function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&Bn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){dr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,pt(this,"refresh",this)})),operation:function(t){return Qr(this,t)},startOperation:function(){return Kr(this)},endOperation:function(){return qr(this)},refresh:ei((function(){var t=this.display.cachedTextHeight;hr(this),this.curOp.forceUpdate=!0,Un(this),Ir(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==t||Math.abs(t-rr(this.display))>.5||this.options.lineWrapping)&&lr(this),pt(this,"refresh",this)})),swapDoc:ei((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Ni(this,t),Un(this),this.display.input.reset(),Ir(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},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}},yt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,a){t.registerHelper(e,r,a),n[e]._global.push({pred:i,val:a})}}(Oo);var Ko="iter insert remove copy getEditor constructor".split(" ");for(var qo in Da.prototype)Da.prototype.hasOwnProperty(qo)&&U(Ko,qo)<0&&(Oo.prototype[qo]=function(t){return function(){return t.apply(this.doc,arguments)}}(Da.prototype[qo]));return yt(Da),Oo.inputStyles={textarea:Vo,contenteditable:Uo},Oo.defineMode=function(t){Oo.defaults.mode||"null"==t||(Oo.defaults.mode=t),Ft.apply(this,arguments)},Oo.defineMIME=function(t,e){Pt[t]=e},Oo.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Oo.defineMIME("text/plain","null"),Oo.defineExtension=function(t,e){Oo.prototype[t]=e},Oo.defineDocExtension=function(t,e){Da.prototype[t]=e},Oo.fromTextArea=function(t,e){if((e=e?F(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=I();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(ht(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var a=t.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(ft(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Oo((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s},function(t){t.off=ft,t.on=ht,t.wheelEventPixels=xi,t.Doc=Da,t.splitLines=Rt,t.countColumn=j,t.findColumn=V,t.isWordChar=Q,t.Pass=H,t.signal=pt,t.Line=Ke,t.changeEnd=Ti,t.scrollbarModel=zr,t.Pos=te,t.cmpPos=ee,t.modes=Nt,t.mimeModes=Pt,t.resolveMode=jt,t.getMode=Bt,t.modeExtensions=Ut,t.extendMode=Ht,t.copyState=Gt,t.startState=Wt,t.innerMode=zt,t.commands=to,t.keyMap=Ga,t.keyName=Ya,t.isModifierKey=Ka,t.lookupKey=Va,t.normalizeKeyMap=Wa,t.StringStream=Vt,t.SharedTextMarker=Ta,t.TextMarker=wa,t.LineWidget=Sa,t.e_preventDefault=bt,t.e_stopPropagation=xt,t.e_stop=Ct,t.addClass=_,t.contains=R,t.rmClass=T,t.keyNames=ja}(Oo),Oo.version="5.58.2",Oo}()},WaYH:
/*!*********************************************************!*\
!*** ./node_modules/rc-tree/es/TreeNode.js + 1 modules ***!
\*********************************************************/
/*! exports provided: InternalTreeNode, default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/contextTypes.js because of ./node_modules/rc-tree/es/Tree.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/util.js because of ./node_modules/antd/es/table/hooks/useSelection.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/treeUtil.js because of ./node_modules/antd/es/table/hooks/useSelection.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";var r=n("rePB"),i=n("Ff2n"),a=n("VTBJ"),o=n("1OyB"),s=n("vuIU"),l=n("JX7q"),c=n("Ji7U"),u=n("LK+K"),h=n("q1tI"),d=n("TSYQ"),f=n.n(d),p=n("sboe"),g=n("OZM5"),m=function(t){var e=t.prefixCls,n=t.level,i=t.isStart,a=t.isEnd;if(!n)return null;for(var o="".concat(e,"-indent-unit"),s=[],l=0;l<n;l+=1){var c;s.push(h.createElement("span",{key:l,className:f()(o,(c={},Object(r.a)(c,"".concat(o,"-start"),i[l+1]),Object(r.a)(c,"".concat(o,"-end"),a[l+1]),Object(r.a)(c,"".concat(o,"-end-first-level"),!l&&a[0]),c))}))}return h.createElement("span",{"aria-hidden":"true",className:"".concat(e,"-indent")},s)},v=n("815F"),y=function(t){Object(c.a)(n,t);var e=Object(u.a)(n);function n(){var t;return Object(o.a)(this,n),(t=e.apply(this,arguments)).state={dragNodeHighlight:!1},t.onSelectorClick=function(e){(0,t.props.context.onNodeClick)(e,Object(v.b)(t.props)),t.isSelectable()?t.onSelect(e):t.onCheck(e)},t.onSelectorDoubleClick=function(e){(0,t.props.context.onNodeDoubleClick)(e,Object(v.b)(t.props))},t.onSelect=function(e){if(!t.isDisabled()){var n=t.props.context.onNodeSelect;e.preventDefault(),n(e,Object(v.b)(t.props))}},t.onCheck=function(e){if(!t.isDisabled()){var n=t.props,r=n.disableCheckbox,i=n.checked,a=t.props.context.onNodeCheck;if(t.isCheckable()&&!r){e.preventDefault();var o=!i;a(e,Object(v.b)(t.props),o)}}},t.onMouseEnter=function(e){(0,t.props.context.onNodeMouseEnter)(e,Object(v.b)(t.props))},t.onMouseLeave=function(e){(0,t.props.context.onNodeMouseLeave)(e,Object(v.b)(t.props))},t.onContextMenu=function(e){(0,t.props.context.onNodeContextMenu)(e,Object(v.b)(t.props))},t.onDragStart=function(e){var n=t.props.context.onNodeDragStart;e.stopPropagation(),t.setState({dragNodeHighlight:!0}),n(e,Object(l.a)(t));try{e.dataTransfer.setData("text/plain","")}catch(t){}},t.onDragEnter=function(e){var n=t.props.context.onNodeDragEnter;e.preventDefault(),e.stopPropagation(),n(e,Object(l.a)(t))},t.onDragOver=function(e){var n=t.props.context.onNodeDragOver;e.preventDefault(),e.stopPropagation(),n(e,Object(l.a)(t))},t.onDragLeave=function(e){var n=t.props.context.onNodeDragLeave;e.stopPropagation(),n(e,Object(l.a)(t))},t.onDragEnd=function(e){var n=t.props.context.onNodeDragEnd;e.stopPropagation(),t.setState({dragNodeHighlight:!1}),n(e,Object(l.a)(t))},t.onDrop=function(e){var n=t.props.context.onNodeDrop;e.preventDefault(),e.stopPropagation(),t.setState({dragNodeHighlight:!1}),n(e,Object(l.a)(t))},t.onExpand=function(e){(0,t.props.context.onNodeExpand)(e,Object(v.b)(t.props))},t.setSelectHandle=function(e){t.selectHandle=e},t.getNodeState=function(){var e=t.props.expanded;return t.isLeaf()?null:e?"open":"close"},t.hasChildren=function(){var e=t.props.eventKey;return!!((t.props.context.keyEntities[e]||{}).children||[]).length},t.isLeaf=function(){var e=t.props,n=e.isLeaf,r=e.loaded,i=t.props.context.loadData,a=t.hasChildren();return!1!==n&&(n||!i&&!a||i&&r&&!a)},t.isDisabled=function(){var e=t.props.disabled;return!(!t.props.context.disabled&&!e)},t.isCheckable=function(){var e=t.props.checkable,n=t.props.context.checkable;return!(!n||!1===e)&&n},t.syncLoadData=function(e){var n=e.expanded,r=e.loading,i=e.loaded,a=t.props.context,o=a.loadData,s=a.onNodeLoad;r||o&&n&&!t.isLeaf()&&(t.hasChildren()||i||s(Object(v.b)(t.props)))},t.renderSwitcher=function(){var e=t.props,n=e.expanded,r=e.switcherIcon,i=t.props.context,o=i.prefixCls,s=i.switcherIcon,l=r||s;if(t.isLeaf())return h.createElement("span",{className:f()("".concat(o,"-switcher"),"".concat(o,"-switcher-noop"))},"function"==typeof l?l(Object(a.a)(Object(a.a)({},t.props),{},{isLeaf:!0})):l);var c=f()("".concat(o,"-switcher"),"".concat(o,"-switcher_").concat(n?"open":"close"));return h.createElement("span",{onClick:t.onExpand,className:c},"function"==typeof l?l(Object(a.a)(Object(a.a)({},t.props),{},{isLeaf:!1})):l)},t.renderCheckbox=function(){var e=t.props,n=e.checked,r=e.halfChecked,i=e.disableCheckbox,a=t.props.context.prefixCls,o=t.isDisabled(),s=t.isCheckable();if(!s)return null;var l="boolean"!=typeof s?s:null;return h.createElement("span",{className:f()("".concat(a,"-checkbox"),n&&"".concat(a,"-checkbox-checked"),!n&&r&&"".concat(a,"-checkbox-indeterminate"),(o||i)&&"".concat(a,"-checkbox-disabled")),onClick:t.onCheck},l)},t.renderIcon=function(){var e=t.props.loading,n=t.props.context.prefixCls;return h.createElement("span",{className:f()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(t.getNodeState()||"docu"),e&&"".concat(n,"-icon_loading"))})},t.renderSelector=function(){var e,n,r=t.state.dragNodeHighlight,i=t.props,a=i.title,o=i.selected,s=i.icon,l=i.loading,c=i.data,u=t.props.context,d=u.prefixCls,p=u.showIcon,g=u.icon,m=u.draggable,v=u.loadData,y=u.titleRender,b=t.isDisabled(),x="".concat(d,"-node-content-wrapper");if(p){var S=s||g;e=S?h.createElement("span",{className:f()("".concat(d,"-iconEle"),"".concat(d,"-icon__customize"))},"function"==typeof S?S(t.props):S):t.renderIcon()}else v&&l&&(e=t.renderIcon());n="function"==typeof a?a(c):y?y(c):a;var C=h.createElement("span",{className:"".concat(d,"-title")},n);return h.createElement("span",{ref:t.setSelectHandle,title:"string"==typeof a?a:"",className:f()("".concat(x),"".concat(x,"-").concat(t.getNodeState()||"normal"),!b&&(o||r)&&"".concat(d,"-node-selected"),!b&&m&&"draggable"),draggable:!b&&m||void 0,"aria-grabbed":!b&&m||void 0,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onContextMenu:t.onContextMenu,onClick:t.onSelectorClick,onDoubleClick:t.onSelectorDoubleClick,onDragStart:m?t.onDragStart:void 0},e,C)},t}return Object(s.a)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var t=this.props.selectable,e=this.props.context.selectable;return"boolean"==typeof t?t:e}},{key:"render",value:function(){var t,e=this.props,n=e.eventKey,a=e.className,o=e.style,s=e.dragOver,l=e.dragOverGapTop,c=e.dragOverGapBottom,u=e.isLeaf,d=e.isStart,p=e.isEnd,y=e.expanded,b=e.selected,x=e.checked,S=e.halfChecked,C=e.loading,E=e.domRef,w=e.active,k=e.onMouseMove,T=Object(i.a)(e,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),O=this.props.context,A=O.prefixCls,L=O.filterTreeNode,D=O.draggable,R=O.keyEntities,I=this.isDisabled(),_=Object(g.f)(T),M=(R[n]||{}).level,N=p[p.length-1];return h.createElement("div",Object.assign({ref:E,className:f()(a,"".concat(A,"-treenode"),(t={},Object(r.a)(t,"".concat(A,"-treenode-disabled"),I),Object(r.a)(t,"".concat(A,"-treenode-switcher-").concat(y?"open":"close"),!u),Object(r.a)(t,"".concat(A,"-treenode-checkbox-checked"),x),Object(r.a)(t,"".concat(A,"-treenode-checkbox-indeterminate"),S),Object(r.a)(t,"".concat(A,"-treenode-selected"),b),Object(r.a)(t,"".concat(A,"-treenode-loading"),C),Object(r.a)(t,"".concat(A,"-treenode-active"),w),Object(r.a)(t,"".concat(A,"-treenode-leaf-last"),N),Object(r.a)(t,"drag-over",!I&&s),Object(r.a)(t,"drag-over-gap-top",!I&&l),Object(r.a)(t,"drag-over-gap-bottom",!I&&c),Object(r.a)(t,"filter-node",L&&L(Object(v.b)(this.props))),t)),style:o,onDragEnter:D?this.onDragEnter:void 0,onDragOver:D?this.onDragOver:void 0,onDragLeave:D?this.onDragLeave:void 0,onDrop:D?this.onDrop:void 0,onDragEnd:D?this.onDragEnd:void 0,onMouseMove:k},_),h.createElement(m,{prefixCls:A,level:M,isStart:d,isEnd:p}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(h.Component),b=function(t){return h.createElement(p.a.Consumer,null,(function(e){return h.createElement(y,Object.assign({},t,{context:e}))}))};b.displayName="TreeNode",b.defaultProps={title:"---"},b.isTreeNode=1;e.a=b},XIdC:
/*!********************************************!*\
!*** ./node_modules/rc-switch/es/index.js ***!
\********************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),i=n(/*! @babel/runtime/helpers/esm/slicedToArray */"ODXe"),a=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),o=n(/*! react */"q1tI"),s=n(/*! classnames */"TSYQ"),l=n.n(s),c=n(/*! rc-util/es/hooks/useMergedState */"6cGi"),u=n(/*! rc-util/es/KeyCode */"4IlW"),h=o.forwardRef((function(t,e){var n,s=t.prefixCls,h=void 0===s?"rc-switch":s,d=t.className,f=t.checked,p=t.defaultChecked,g=t.disabled,m=t.loadingIcon,v=t.checkedChildren,y=t.unCheckedChildren,b=t.onClick,x=t.onChange,S=t.onKeyDown,C=Object(a.a)(t,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),E=Object(c.a)(!1,{value:f,defaultValue:p}),w=Object(i.a)(E,2),k=w[0],T=w[1];function O(t,e){var n=k;return g||(T(n=t),null==x||x(n,e)),n}var A=l()(h,d,(n={},Object(r.a)(n,"".concat(h,"-checked"),k),Object(r.a)(n,"".concat(h,"-disabled"),g),n));return o.createElement("button",Object.assign({},C,{type:"button",role:"switch","aria-checked":k,disabled:g,className:A,ref:e,onKeyDown:function(t){t.which===u.a.LEFT?O(!1,t):t.which===u.a.RIGHT&&O(!0,t),null==S||S(t)},onClick:function(t){var e=O(!k,t);null==b||b(e,t)}}),m,o.createElement("span",{className:"".concat(h,"-inner")},k?v:y))}));h.displayName="Switch",e.a=h},Y1PL:
/*!**********************************************************!*\
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
\**********************************************************/
/*! exports provided: ResizableTextArea, default */
/*! all exports used */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.r(e),n.d(e,"ResizableTextArea",(function(){return _}));var r=n("wx14"),i=n("1OyB"),a=n("vuIU"),o=n("Ji7U"),s=n("LK+K"),l=n("q1tI"),c=n("VTBJ"),u=n("rePB"),h=n("Zm9Q"),d=(n("Kwbf"),n("c+Xe")),f=n("m+aA"),p=n("bdgK"),g=new Map;var m=new p.default((function(t){t.forEach((function(t){var e,n=t.target;null===(e=g.get(n))||void 0===e||e.forEach((function(t){return t(n)}))}))}));var v=function(t){Object(o.a)(n,t);var e=Object(s.a)(n);function n(){return Object(i.a)(this,n),e.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(l.Component),y=l.createContext(null);function b(t){var e=t.children,n=t.disabled,r=l.useRef(null),i=l.useRef(null),a=l.useContext(y),o=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),s=l.isValidElement(e)&&Object(d.c)(e),u=s?e.ref:null,h=l.useMemo((function(){return Object(d.a)(u,r)}),[u,r]),p=l.useRef(t);p.current=t;var b=l.useCallback((function(t){var e=p.current,n=e.onResize,r=e.data,i=t.getBoundingClientRect(),s=i.width,l=i.height,u=t.offsetWidth,h=t.offsetHeight,d=Math.floor(s),f=Math.floor(l);if(o.current.width!==d||o.current.height!==f||o.current.offsetWidth!==u||o.current.offsetHeight!==h){var g={width:d,height:f,offsetWidth:u,offsetHeight:h};o.current=g;var m=u===Math.round(s)?s:u,v=h===Math.round(l)?l:h,y=Object(c.a)(Object(c.a)({},g),{},{offsetWidth:m,offsetHeight:v});null==a||a(y,t,r),n&&Promise.resolve().then((function(){n(y,t)}))}}),[]);return l.useEffect((function(){var t,e,a=Object(f.a)(r.current)||Object(f.a)(i.current);return a&&!n&&(t=a,e=b,g.has(t)||(g.set(t,new Set),m.observe(t)),g.get(t).add(e)),function(){return function(t,e){g.has(t)&&(g.get(t).delete(e),g.get(t).size||(m.unobserve(t),g.delete(t)))}(a,b)}}),[r.current,n]),l.createElement(v,{ref:i},s?l.cloneElement(e,{ref:h}):e)}function x(t){var e=t.children;return Object(h.a)(e).map((function(e,n){var i=(null==e?void 0:e.key)||"".concat("rc-observer-key","-").concat(n);return l.createElement(b,Object(r.a)({},t,{key:i}),e)}))}x.Collection=function(t){var e=t.children,n=t.onBatchResize,r=l.useRef(0),i=l.useRef([]),a=l.useContext(y),o=l.useCallback((function(t,e,o){r.current+=1;var s=r.current;i.current.push({size:t,element:e,data:o}),Promise.resolve().then((function(){s===r.current&&(null==n||n(i.current),i.current=[])})),null==a||a(t,e,o)}),[n,a]);return l.createElement(y.Provider,{value:o},e)};var S,C=x,E=n("bT9E"),w=n("TSYQ"),k=n.n(w),T="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",O=["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"],A={};function L(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&A[n])return A[n];var r=window.getComputedStyle(t),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=O.map((function(t){return"".concat(t,":").concat(r.getPropertyValue(t))})).join(";"),l={sizingStyle:s,paddingSize:a,borderSize:o,boxSizing:i};return e&&n&&(A[n]=l),l}var D,R=n("Gytx"),I=n.n(R);!function(t){t[t.NONE=0]="NONE",t[t.RESIZING=1]="RESIZING",t[t.RESIZED=2]="RESIZED"}(D||(D={}));var _=function(t){Object(o.a)(n,t);var e=Object(s.a)(n);function n(t){var a;return Object(i.a)(this,n),(a=e.call(this,t)).nextFrameActionId=void 0,a.resizeFrameId=void 0,a.textArea=void 0,a.saveTextArea=function(t){a.textArea=t},a.handleResize=function(t){var e=a.state.resizeStatus,n=a.props,r=n.autoSize,i=n.onResize;e===D.NONE&&("function"==typeof i&&i(t),r&&a.resizeOnNextFrame())},a.resizeOnNextFrame=function(){cancelAnimationFrame(a.nextFrameActionId),a.nextFrameActionId=requestAnimationFrame(a.resizeTextarea)},a.resizeTextarea=function(){var t=a.props.autoSize;if(t&&a.textArea){var e=t.minRows,n=t.maxRows,r=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;S||((S=document.createElement("textarea")).setAttribute("tab-index","-1"),S.setAttribute("aria-hidden","true"),document.body.appendChild(S)),t.getAttribute("wrap")?S.setAttribute("wrap",t.getAttribute("wrap")):S.removeAttribute("wrap");var i=L(t,e),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,l=i.sizingStyle;S.setAttribute("style","".concat(l,";").concat(T)),S.value=t.value||t.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=S.scrollHeight;if("border-box"===s?d+=o:"content-box"===s&&(d-=a),null!==n||null!==r){S.value=" ";var f=S.scrollHeight-a;null!==n&&(u=f*n,"border-box"===s&&(u=u+a+o),d=Math.max(u,d)),null!==r&&(h=f*r,"border-box"===s&&(h=h+a+o),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(a.textArea,!1,e,n);a.setState({textareaStyles:r,resizeStatus:D.RESIZING},(function(){cancelAnimationFrame(a.resizeFrameId),a.resizeFrameId=requestAnimationFrame((function(){a.setState({resizeStatus:D.RESIZED},(function(){a.resizeFrameId=requestAnimationFrame((function(){a.setState({resizeStatus:D.NONE}),a.fixFirefoxAutoScroll()}))}))}))}))}},a.renderTextArea=function(){var t=a.props,e=t.prefixCls,n=void 0===e?"rc-textarea":e,i=t.autoSize,o=t.onResize,s=t.className,h=t.disabled,d=a.state,f=d.textareaStyles,p=d.resizeStatus,g=Object(E.a)(a.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),m=k()(n,s,Object(u.a)({},"".concat(n,"-disabled"),h));"value"in g&&(g.value=g.value||"");var v=Object(c.a)(Object(c.a)(Object(c.a)({},a.props.style),f),p===D.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(C,{onResize:a.handleResize,disabled:!(i||o)},l.createElement("textarea",Object(r.a)({},g,{className:m,style:v,ref:a.saveTextArea})))},a.state={textareaStyles:{},resizeStatus:D.NONE},a}return Object(a.a)(n,[{key:"componentDidUpdate",value:function(t){t.value===this.props.value&&I()(t.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 t=this.textArea.selectionStart,e=this.textArea.selectionEnd;this.textArea.setSelectionRange(t,e)}}catch(t){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),M=function(t){Object(o.a)(n,t);var e=Object(s.a)(n);function n(t){var r;Object(i.a)(this,n),(r=e.call(this,t)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(t){r.resizableTextArea=t},r.handleChange=function(t){var e=r.props.onChange;r.setValue(t.target.value,(function(){r.resizableTextArea.resizeTextarea()})),e&&e(t)},r.handleKeyDown=function(t){var e=r.props,n=e.onPressEnter,i=e.onKeyDown;13===t.keyCode&&n&&n(t),i&&i(t)};var a=void 0===t.value||null===t.value?t.defaultValue:t.value;return r.state={value:a},r}return Object(a.a)(n,[{key:"setValue",value:function(t,e){"value"in this.props||this.setState({value:t},e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(_,Object(r.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(t){return"value"in t?{value:t.value}:null}}]),n}(l.Component);e.default=M},ZD9Y:
/*!*********************************************************!*\
!*** ./src/components/tpi-code-setting/CodeSetting.tsx ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/switch/style */"BoS7");var r=n(/*! antd/es/switch */"Sdc0"),i=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),a=n(/*! react */"q1tI"),o=n.n(a),s=(n(/*! ./index.less */"lOMy"),i.a.Option);e.a=function(t){var e=t.onFontSizeChange,n=t.cmFontSize,a=t.cmCodeMode,l=t.onCodeModeChange,c=t.onTabToSpace,u=t.className,h=void 0===u?"":u,d=t.tabToSpace,f=t.children;return o.a.createElement("div",{className:"tpi-code-setting ".concat(h)},o.a.createElement("h3",null,"代码编辑器"),o.a.createElement("section",null,o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"风格切换"),o.a.createElement(i.a,{bordered:!1,size:"small",value:a,onChange:l},o.a.createElement(s,{value:"vs"},"浅色风格"),o.a.createElement(s,{value:"vs-dark"},"深色风格"))),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"字体大小"),o.a.createElement(i.a,{bordered:!1,size:"small",value:n,onChange:e},o.a.createElement(s,{value:12},"12px"),o.a.createElement(s,{value:14},"14px"),o.a.createElement(s,{value:16},"16px"),o.a.createElement(s,{value:18},"18px"),o.a.createElement(s,{value:20},"20px"),o.a.createElement(s,{value:22},"22px"))),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"Tab转换"),o.a.createElement(r.a,{checked:d,onChange:c}))),o.a.createElement("h3",null,"快捷键"),o.a.createElement("section",null,o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"保存代码"),o.a.createElement("span",null,"Ctrl + S")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"唤出快捷键列表"),o.a.createElement("span",null,"F1 / Alt + F1")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"左右缩进"),o.a.createElement("span",null,"Ctrl + ]/[")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"跳到匹配的括号"),o.a.createElement("span",null,"Ctrl + Shift + \\")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"转到行首"),o.a.createElement("span",null,"Home")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"转到行尾"),o.a.createElement("span",null,"End"))),f)}},ZW9T:
/*!************************************************************!*\
!*** ./src/components/monaco-editor/index.jsx + 1 modules ***!
\************************************************************/
/*! exports provided: getLanguageByMirrorName, default, DiffEditor */
/*! exports used: DiffEditor, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n("k1fw"),i=(n("miYZ"),n("tsqr")),a=n("rAM+"),o=n("tJVT"),s=n("PpiC"),l=n("q1tI"),c=n.n(l),u=n("bdgK");function h(t,e,n,i,a){var o=e.getWordUntilPosition(n),s={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},l=i.map((function(e){return{label:e,kind:t.languages.CompletionItemKind.Keyword,insertText:e,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}));return a.map((function(t){l.push(Object(r.a)(Object(r.a)({},t),{},{range:s}))})),l}n("LvDl");function d(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}function f(){}var p={"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 g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t;if(Array.isArray(t)){for(var n=0;n<t.length;n++){var r=p[t[n]];if(r)return r}return e[0]}return p[e]||e}var m=null;e.b=function(t){var e=t.width,p=void 0===e?"100%":e,v=t.height,y=void 0===v?"100%":v,b=t.value,x=t.language,S=void 0===x?"javascript":x,C=t.style,E=void 0===C?{}:C,w=t.options,k=void 0===w?{}:w,T=t.overrideServices,O=void 0===T?{}:T,A=t.theme,L=void 0===A?"vs-dark":A,D=t.onEditBlur,R=t.onSave,I=t.autoHeight,_=void 0!==I&&I,M=t.forbidCopy,N=void 0!==M&&M,P=t.onChange,F=void 0===P?f:P,j=t.editorDidMount,B=void 0===j?f:j,U=t.onFocus,H=void 0===U?f:U,G=t.filename,z=void 0===G?"educoder.txt":G,W=(Object(s.a)(t,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Object(l.useRef)()),V=Object(l.useRef)({}),K=Object(l.useRef)(),q=Object(l.useRef)(!1),Y=Object(l.useRef)(),X=Object(l.useState)(!1),$=Object(o.a)(X,2),J=$[0],Z=$[1];function Q(){i.b.warn(decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"))}function tt(){var t=V.current.instance;if(t){var e=t.getSelection(),n=V.current.pastePos||{},r=new m.Range(n.startLineNumber||e.endLineNumber,n.startColumn||e.endColumn,n.endLineNumber||e.endLineNumber,n.endColumn||e.endColumn);setTimeout((function(){t.executeEdits("",[{range:r,text:""}])}),300)}}function et(t){(window.navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)&&83==t.keyCode&&(t.preventDefault(),R())}Object(l.useEffect)((function(){K.current&&clearTimeout(K.current),K.current=setTimeout((function(){!function(){var t=V.current.instance;if(null!=b&&t&&J){var e=t.getModel();e&&b!==e.getValue()&&(!0,e.setValue(b),t.layout(),!1)}}()}),500)}),[b,J,V.current]);var nt=function(){if(_&&V.current.instance){var t=V.current.instance.getContentHeight();ut(t<y?y:t)}else ut(y)};function rt(t,e){var n,r,i=window.URL||window.webkitURL||window,a=new Blob([e]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=i.createObjectURL(a),o.download=t,n=o,(r=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)}Object(l.useEffect)((function(){nt()}),[nt]),Object(l.useEffect)((function(){W.current&&!J&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(t){try{m=t,V.current.instance=m.editor.create(W.current,{value:b,language:g(S),theme:L,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},O);var e=V.current.instance;if(B(e,m),setTimeout((function(){nt(),V.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){rt(z||"educoder.txt",e.getValue())}})}),500),V.current.subscription=e.onDidChangeModelContent((function(t){q.current?clearTimeout(Y.current):(nt(),F(e.getValue(),t)),Y.current=setTimeout((function(){q.current=!1}),500)})),window.Monaco||function(t){var e={label:"ifelse",kind:t.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet},n=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];t.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(r,i){return{suggestions:h(t,r,i,n,[e])}}});var r=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];t.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(e,n){var i=[{label:"print",kind:t.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(t,e,n,r,i)}}});var i=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];t.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(n,r){var a=[e,{label:"main",kind:t.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {","\t$0","}"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:t.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(t,n,r,i,a)}}})}(m),N&&(e.addCommand(m.KeyMod.CtrlCmd|m.KeyMod.Shift|m.KeyCode.KEY_V,(function(){return Q(),null})),e.addCommand(m.KeyMod.CtrlCmd|m.KeyCode.KEY_C,(function(){return Q(),null}))),window.Monaco=m,D&&e.onDidBlurEditorWidget((function(){D(e.getValue())})),H&&e.onDidFocusEditorText((function(){H(e.getValue())})),N){e.addCommand(m.KeyMod.CtrlCmd|m.KeyCode.KEY_V,(function(){return Q(),null})),e.onDidPaste((function(t){V.current.pastePos=t}));try{window.addEventListener("paste",tt)}catch(t){}}var n=function(){var t;return W.current&&(t=new u.default((function(t){var e,n=Object(a.a)(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&V.current.instance.layout()}}catch(t){n.e(t)}finally{n.f()}}))).observe(W.current),t}();return Z(!0),function(){var t=V.current.instance;t.dispose();var e=t.getModel();e&&e.dispose(),V.current.subscription&&V.current.subscription.dispose(),N&&window.removeEventListener("paste",tt),n.unobserve(W.current)}}catch(t){}}))}),[]),Object(l.useEffect)((function(){if(V.current.instance&&J)return document.addEventListener("keydown",et,!1),function(){document.removeEventListener("keydown",et)}}),[R,J]),Object(l.useEffect)((function(){var t=V.current.instance;if(t&&J){var e=g(S);m.editor.setModelLanguage(t.getModel(),e),console.log("language:",S,t.getModel(),e)}}),[S,J]),Object(l.useEffect)((function(){V.current.instance&&J&&m.editor.setTheme(L)}),[L,J]),Object(l.useEffect)((function(){var t=V.current.instance;t&&J&&(t.updateOptions(Object(r.a)({},k)),setTimeout((function(){t.getModel().updateOptions(Object(r.a)({},k))}),200))}),[JSON.stringify(k),J]),Object(l.useEffect)((function(){var t=V.current.instance;t&&J&&t.layout()}),[p,y,J]);var it=Object(l.useState)(d(p)),at=Object(o.a)(it,2),ot=at[0],st=(at[1],Object(l.useState)(d(y))),lt=Object(o.a)(st,2),ct=lt[0],ut=lt[1],ht=Object(r.a)(Object(r.a)({},E),{},{width:ot,height:ct});return c.a.createElement("div",{className:"my-monaco-editor",ref:W,style:ht})};function v(t){var e=t.width,i=void 0===e?"100%":e,s=t.height,h=void 0===s?"100%":s,f=t.original,p=t.modified,g=t.language,v=t.options,y=void 0===v?{}:v,b=Object(l.useRef)(),x=Object(l.useState)(null),S=Object(o.a)(x,2),C=S[0],E=S[1];Object(l.useEffect)((function(){b.current&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(t){var e=(m=t).editor.createDiffEditor(b.current,Object(r.a)(Object(r.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},y),{},{wordWrap:!0}));E(e);var n=function(t){var e;return b.current&&(e=new u.default((function(e){var n,r=Object(a.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&t.layout()}}catch(t){r.e(t)}finally{r.f()}}))).observe(b.current),e}(e);return function(){e.dispose();var t=e.getModel();t&&t.dispose(),n.unobserve(b.current)}}))}),[]),Object(l.useEffect)((function(){C&&C.setModel({original:m.editor.createModel(f,g),modified:m.editor.createModel(p,g)})}),[f,p,g,C]);var w={width:d(i),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:b,style:w})}},ZpRC:
/*!*************************************************************************!*\
!*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***!
\*************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";function r(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function i(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function a(t,e){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var n=getComputedStyle(t,null);return i(n.overflowY,e)||i(n.overflowX,e)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function o(t,e,n,r,i,a,o,s){return a<t&&o>e||a>t&&o<e?0:a<=t&&s<=n||o>=e&&s>=n?a-t-r:o>e&&s<n||a<t&&s>n?o-e+i:0}var s=function(t,e){var n=window,i=e.scrollMode,s=e.block,l=e.inline,c=e.boundary,u=e.skipOverflowHiddenElements,h="function"==typeof c?c:function(t){return t!==c};if(!r(t))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,f=[],p=t;r(p)&&h(p);){if((p=p.parentElement)===d){f.push(p);break}null!=p&&p===document.body&&a(p)&&!a(document.documentElement)||null!=p&&a(p,u)&&f.push(p)}for(var g=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=t.getBoundingClientRect(),x=b.height,S=b.width,C=b.top,E=b.right,w=b.bottom,k=b.left,T="start"===s||"nearest"===s?C:"end"===s?w:C+x/2,O="center"===l?k+S/2:"end"===l?E:k,A=[],L=0;L<f.length;L++){var D=f[L],R=D.getBoundingClientRect(),I=R.height,_=R.width,M=R.top,N=R.right,P=R.bottom,F=R.left;if("if-needed"===i&&C>=0&&k>=0&&w<=m&&E<=g&&C>=M&&w<=P&&k>=F&&E<=N)return A;var j=getComputedStyle(D),B=parseInt(j.borderLeftWidth,10),U=parseInt(j.borderTopWidth,10),H=parseInt(j.borderRightWidth,10),G=parseInt(j.borderBottomWidth,10),z=0,W=0,V="offsetWidth"in D?D.offsetWidth-D.clientWidth-B-H:0,K="offsetHeight"in D?D.offsetHeight-D.clientHeight-U-G:0;if(d===D)z="start"===s?T:"end"===s?T-m:"nearest"===s?o(y,y+m,m,U,G,y+T,y+T+x,x):T-m/2,W="start"===l?O:"center"===l?O-g/2:"end"===l?O-g:o(v,v+g,g,B,H,v+O,v+O+S,S),z=Math.max(0,z+y),W=Math.max(0,W+v);else{z="start"===s?T-M-U:"end"===s?T-P+G+K:"nearest"===s?o(M,P,I,U,G+K,T,T+x,x):T-(M+I/2)+K/2,W="start"===l?O-F-B:"center"===l?O-(F+_/2)+V/2:"end"===l?O-N+H+V:o(F,N,_,B,H+V,O,O+S,S);var q=D.scrollLeft,Y=D.scrollTop;T+=Y-(z=Math.max(0,Math.min(Y+z,D.scrollHeight-I+K))),O+=q-(W=Math.max(0,Math.min(q+W,D.scrollWidth-_+V)))}A.push({el:D,top:z,left:W})}return A};function l(t){return t===Object(t)&&0!==Object.keys(t).length}e.a=function(t,e){var n=!t.ownerDocument.documentElement.contains(t);if(l(e)&&"function"==typeof e.behavior)return e.behavior(n?[]:s(t,e));if(!n){var r=function(t){return!1===t?{block:"end",inline:"nearest"}:l(t)?t:{block:"start",inline:"nearest"}}(e);return function(t,e){void 0===e&&(e="auto");var n="scrollBehavior"in document.body.style;t.forEach((function(t){var r=t.el,i=t.top,a=t.left;r.scroll&&n?r.scroll({top:i,left:a,behavior:e}):(r.scrollTop=i,r.scrollLeft=a)}))}(s(t,r),r.behavior)}}},a4uL:
/*!******************************************************!*\
!*** ./src/pages/MyProblem/TestCasePanel/index.less ***!
\******************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},aRTE:
/*!*****************************************************!*\
!*** ./node_modules/qr.js/lib/ErrorCorrectLevel.js ***!
\*****************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports={L:1,M:0,Q:3,H:2}},bCnd:
/*!******************************!*\
!*** ./src/utils/urlTool.ts ***!
\******************************/
/*! exports provided: toStore, fromStore */
/*! exports used: fromStore, toStore */function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return o}));var r=n(/*! store */"je13"),i=n.n(r);function a(t,e){var n=i.a.get("__ec");n||(n={}),n[t]=e,i.a.set("__ec",n)}function o(t,e){var n=i.a.get("__ec");return n?void 0===n[t]?e:n[t]:e}},bT9E:
/*!*****************************************!*\
!*** ./node_modules/rc-util/es/omit.js ***!
\*****************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function i(t,e){var n=Object(r.a)({},t);return Array.isArray(e)&&e.forEach((function(t){delete n[t]})),n}},biw7:
/*!**********************************************************!*\
!*** ./node_modules/rc-table/es/context/TableContext.js ***!
\**********************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r=n(/*! react */"q1tI"),i=r.createContext(null);e.a=i},c5Ni:
/*!******************************************************!*\
!*** ./node_modules/codemirror/theme/blackboard.css ***!
\******************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},cDPC:
/*!*************************************************!*\
!*** ./src/components/SplitContainer/index.tsx ***!
\*************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),i=n(/*! react */"q1tI"),a=n.n(i);n(/*! ./index.less */"i3hx");e.a=function(t){var e=t.defaultX,n=void 0===e?"40%":e,o=t.leftChild,s=t.rightChild,l=t.className,c=t.hideResize,u=void 0!==c&&c,h=Object(i.useState)(n),d=Object(r.a)(h,2),f=d[0],p=d[1],g=Object(i.useRef)();Object(i.useEffect)((function(){function t(t){g.current&&p(t.pageX)}function e(){g.current=!1}return window.addEventListener("mousemove",t),window.addEventListener("mouseup",e),function(){window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",e)}}),[]);var m="number"==typeof f&&.01!==f?"".concat(f,"px"):n,v="calc(100% - ".concat(u?"0px":"4px"," - ").concat(m,")");return a.a.createElement("div",{className:"split-panel-container ".concat(l)},a.a.createElement("section",{style:{width:m,display:.01===f?"none":""}},o),a.a.createElement("section",{className:"resize-x-bar",onMouseDown:function(){g.current=!0}},a.a.createElement("a",{className:"btn-resize"},a.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},a.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"})))),a.a.createElement("section",{style:{width:v}},s))}},dQei:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/math.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){for(var n={glog:function(t){if(t<1)throw new Error("glog("+t+")");return n.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return n.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},r=0;r<8;r++)n.EXP_TABLE[r]=1<<r;for(r=8;r<256;r++)n.EXP_TABLE[r]=n.EXP_TABLE[r-4]^n.EXP_TABLE[r-5]^n.EXP_TABLE[r-6]^n.EXP_TABLE[r-8];for(r=0;r<255;r++)n.LOG_TABLE[n.EXP_TABLE[r]]=r;t.exports=n},dWSS:
/*!**********************************************!*\
!*** ./node_modules/qr.js/lib/Polynomial.js ***!
\**********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./math */"dQei");function i(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&0==t[n];)n++;this.num=new Array(t.length-n+e);for(var r=0;r<t.length-n;r++)this.num[r]=t[r+n]}i.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var a=0;a<t.getLength();a++)e[n+a]^=r.gexp(r.glog(this.get(n))+r.glog(t.get(a)));return new i(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=r.glog(this.get(0))-r.glog(t.get(0)),n=new Array(this.getLength()),a=0;a<this.getLength();a++)n[a]=this.get(a);for(a=0;a<t.getLength();a++)n[a]^=r.gexp(r.glog(t.get(a))+e);return new i(n,0).mod(t)}},t.exports=i},dejd:
/*!***********************************************************!*\
!*** ./src/components/markdown-editor/toolbar/index.less ***!
\***********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},dmUQ:
/*!**************************************************************!*\
!*** ./node_modules/rc-input-number/es/index.js + 1 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";var r=n("Ff2n"),i=n("rePB"),a=n("1OyB"),o=n("vuIU"),s=n("Ji7U"),l=n("md7G"),c=n("foSv"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),f=n.n(d),p=n("4IlW");function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){Object(i.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(c.a)(t);if(e){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}function y(){}function b(t){t.preventDefault()}var x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(t){return null!=t},C=function(t,e){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},E=function(t){Object(s.a)(n,t);var e=v(n);function n(t){var r;Object(a.a)(this,n),(r=e.call(this,t)).onKeyDown=function(t){var e=r.props,n=e.onKeyDown,i=e.onPressEnter;if(t.keyCode===p.a.UP){var a=r.getRatio(t);r.up(t,a,null),r.stop()}else if(t.keyCode===p.a.DOWN){var o=r.getRatio(t);r.down(t,o,null),r.stop()}else t.keyCode===p.a.ENTER&&i&&i(t);if(r.recordCursorPosition(),r.lastKeyCode=t.keyCode,n){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];n.apply(void 0,[t].concat(l))}},r.onKeyUp=function(t){var e=r.props.onKeyUp;if(r.stop(),r.recordCursorPosition(),e){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];e.apply(void 0,[t].concat(i))}},r.onChange=function(t){var e=r.props.onChange;r.state.focused&&(r.inputting=!0),r.rawInput=r.props.parser(r.getValueFromEvent(t)),r.setState({inputValue:r.rawInput}),e(r.toNumber(r.rawInput))},r.onMouseUp=function(){var t=r.props.onMouseUp;r.recordCursorPosition(),t&&t.apply(void 0,arguments)},r.onFocus=function(){var t;r.setState({focused:!0}),(t=r.props).onFocus.apply(t,arguments)},r.onBlur=function(){var t=r.props.onBlur;r.inputting=!1,r.setState({focused:!1});var e=r.getCurrentValidValue(r.state.inputValue),n=r.setValue(e,y);if(t){var i=r.input.value,a=r.getInputDisplayValue({focus:!1,value:n});r.input.value=a?Number(a):a,t.apply(void 0,arguments),r.input.value=i}},r.getRatio=function(t){var e=1;return t.metaKey||t.ctrlKey?e=.1:t.shiftKey&&(e=10),e},r.getFullNum=function(t){return isNaN(t)?t:/e/i.test(String(t))?Number(t).toFixed(18).replace(/\.?0+$/,""):t},r.getPrecision=function(t){if(S(r.props.precision))return r.props.precision;var e=String(t);if(e.indexOf("e-")>=0)return parseInt(e.slice(e.indexOf("e-")+2),10);var n=0;return e.indexOf(".")>=0&&(n=e.length-e.indexOf(".")-1),n},r.getInputDisplayValue=function(t){var e,n=t||r.state,i=n.focused,a=n.inputValue,o=n.value;null==(e=i?a:r.toPrecisionAsStep(o))&&(e="");var s=r.formatWrapper(e);return S(r.props.decimalSeparator)&&(s=s.toString().replace(".",r.props.decimalSeparator)),s},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(t){}},r.restoreByAfter=function(t){if(void 0===t)return!1;var e=r.input.value,n=e.lastIndexOf(t);if(-1===n)return!1;var i=r.cursorBefore.length;return r.lastKeyCode===p.a.DELETE&&r.cursorBefore.charAt(i-1)===t[0]?(r.fixCaret(i,i),!0):n+t.length===e.length&&(r.fixCaret(n,n),!0)},r.partRestoreByAfter=function(t){return void 0!==t&&Array.prototype.some.call(t,(function(e,n){var i=t.substring(n);return r.restoreByAfter(i)}))},r.isNotCompleteNumber=function(t){return isNaN(t)||""===t||null===t||t&&t.toString().indexOf(".")===t.toString().length-1},r.stop=function(){r.autoStepTimer&&clearTimeout(r.autoStepTimer)},r.down=function(t,e,n){r.pressingUpOrDown=!0,r.step("down",t,e,n)},r.up=function(t,e,n){r.pressingUpOrDown=!0,r.step("up",t,e,n)},r.saveInput=function(t){r.input=t};var i=t.value;void 0===i&&(i=t.defaultValue),r.state={focused:t.autoFocus};var o=r.getValidValue(r.toNumber(i));return r.state=m(m({},r.state),{},{inputValue:r.toPrecisionAsStep(o),value:o}),r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.value,r=e.onChange,i=e.max,a=e.min,o=this.state.focused;if(t){if(!C(t.value,n)||!C(t.max,i)||!C(t.min,a)){var s,l=o?n:this.getValidValue(n);s=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:s})}var c="value"in this.props?n:this.state.value;"max"in this.props&&t.max!==i&&"number"==typeof c&&c>i&&r&&r(i),"min"in this.props&&t.min!==a&&"number"==typeof c&&c<a&&r&&r(a)}try{if(void 0!==this.cursorStart&&this.state.focused)if(this.partRestoreByAfter(this.cursorAfter)||this.state.value===this.props.value){if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1)}}else{var u=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?u=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(u=this.cursorStart):u=this.input.value.length,this.fixCaret(u,u)}}catch(t){}this.lastKeyCode=null,this.pressingUpOrDown&&this.props.focusOnUpDown&&this.state.focused&&document.activeElement!==this.input&&this.focus()}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(t){var e=t;return e=""===e?"":this.isNotCompleteNumber(parseFloat(e))?this.state.value:this.getValidValue(e),this.toNumber(e)}},{key:"getValueFromEvent",value:function(t){var e=t.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(e=e.replace(this.props.decimalSeparator,".")),e}},{key:"getValidValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.min,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,r=parseFloat(t);return isNaN(r)?t:(r<e&&(r=e),r>n&&(r=n),r)}},{key:"setValue",value:function(t,e){var n=this.props.precision,r=this.isNotCompleteNumber(parseFloat(t))?null:parseFloat(t),i=this.state.value,a=void 0===i?null:i,o=this.state.inputValue,s=void 0===o?null:o,l="number"==typeof r?r.toFixed(n):"".concat(r),c=r!==a||l!=="".concat(s);return"value"in this.props?(s=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:s},e)):this.setState({value:r,inputValue:this.toPrecisionAsStep(t)},e),c&&this.props.onChange(r),r}},{key:"getMaxPrecision",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,r=n.precision,i=n.step;if(S(r))return r;var a=this.getPrecision(e),o=this.getPrecision(i),s=this.getPrecision(t);return t?Math.max(s,a+o):a+o}},{key:"getPrecisionFactor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(t,e);return Math.pow(10,n)}},{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(t){return this.props.formatter?this.props.formatter(t):t}},{key:"toPrecisionAsStep",value:function(t){if(this.isNotCompleteNumber(t)||""===t)return t;var e=Math.abs(this.getMaxPrecision(t));return isNaN(e)?t.toString():Number(t).toFixed(e)}},{key:"toNumber",value:function(t){var e=this.props.precision,n=this.state.focused,r=t&&t.length>16&&n;return this.isNotCompleteNumber(t)||r?t:S(e)?Math.round(t*Math.pow(10,e))/Math.pow(10,e):Number(t)}},{key:"upStep",value:function(t,e){var n=this.props.step,r=this.getPrecisionFactor(t,e),i=Math.abs(this.getMaxPrecision(t,e)),a=((r*t+r*n*e)/r).toFixed(i);return this.toNumber(a)}},{key:"downStep",value:function(t,e){var n=this.props.step,r=this.getPrecisionFactor(t,e),i=Math.abs(this.getMaxPrecision(t,e)),a=((r*t-r*n*e)/r).toFixed(i);return this.toNumber(a)}},{key:"step",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;this.stop(),e&&(e.persist(),e.preventDefault());var a=this.props;if(!a.disabled){var o=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(o)){var s=this["".concat(t,"Step")](o,r),l=s>a.max||s<a.min;s>a.max?s=a.max:s<a.min&&(s=a.min),this.setValue(s,null),this.setState({focused:!0},(function(){n.pressingUpOrDown=!1})),l||(this.autoStepTimer=setTimeout((function(){n[t](e,r,!0)}),i?200:600))}}}},{key:"fixCaret",value:function(t,e){if(void 0!==t&&void 0!==e&&this.input&&this.input.value)try{var n=this.input.selectionStart,r=this.input.selectionEnd;t===n&&e===r||this.input.setSelectionRange(t,e)}catch(t){}}},{key:"render",value:function(){var t,e=this.props,n=e.prefixCls,a=e.disabled,o=e.readOnly,s=e.useTouch,l=e.autoComplete,c=e.upHandler,u=e.downHandler,d=e.className,p=e.max,g=e.min,m=e.style,v=e.title,x=e.onMouseEnter,S=e.onMouseLeave,C=e.onMouseOver,E=e.onMouseOut,w=e.required,k=e.onClick,T=e.tabIndex,O=e.type,A=e.placeholder,L=e.id,D=e.inputMode,R=e.pattern,I=e.step,_=e.maxLength,M=e.autoFocus,N=e.name,P=e.onPaste,F=e.onInput,j=Object(r.a)(e,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),B=this.state,U=B.value,H=B.focused,G=f()(n,(t={},Object(i.a)(t,d,!!d),Object(i.a)(t,"".concat(n,"-disabled"),a),Object(i.a)(t,"".concat(n,"-focused"),H),t)),z={};Object.keys(j).forEach((function(t){"data-"!==t.substr(0,5)&&"aria-"!==t.substr(0,5)&&"role"!==t||(z[t]=j[t])}));var W=!o&&!a,V=this.getInputDisplayValue(null),K=(U||0===U)&&(isNaN(U)||Number(U)>=p)||a||o,q=(U||0===U)&&(isNaN(U)||Number(U)<=g)||a||o,Y=f()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(i.a)({},"".concat(n,"-handler-up-disabled"),K)),X=f()("".concat(n,"-handler"),"".concat(n,"-handler-down"),Object(i.a)({},"".concat(n,"-handler-down-disabled"),q)),$=s?{onTouchStart:K?y:this.up,onTouchEnd:this.stop}:{onMouseDown:K?y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},J=s?{onTouchStart:q?y:this.down,onTouchEnd:this.stop}:{onMouseDown:q?y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:G,style:m,title:v,onMouseEnter:x,onMouseLeave:S,onMouseOver:C,onMouseOut:E,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(n,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},$,{role:"button","aria-label":"Increase Value","aria-disabled":K,className:Y}),c||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-up-inner"),onClick:b})),h.a.createElement("span",Object.assign({unselectable:"on"},J,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:X}),u||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-down-inner"),onClick:b}))),h.a.createElement("div",{className:"".concat(n,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":g,"aria-valuemax":p,"aria-valuenow":U,required:w,type:O,placeholder:A,onPaste:P,onClick:k,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:T,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:W?this.onKeyDown:y,onKeyUp:W?this.onKeyUp:y,autoFocus:M,maxLength:_,readOnly:o,disabled:a,max:p,min:g,step:I,name:N,title:v,id:L,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(V),pattern:R,inputMode:D,onInput:F},z))))}}]),n}(h.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:y,onKeyDown:y,onPressEnter:y,onFocus:y,onBlur:y,parser:function(t){return t.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var w=E;e.a=w},f4xo:
/*!********************************************!*\
!*** ./node_modules/qr.js/lib/8BitByte.js ***!
\********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./mode */"nVVt");function i(t){this.mode=r.MODE_8BIT_BYTE,this.data=t}i.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}},t.exports=i},fcSX:
/*!********************************************************!*\
!*** ./node_modules/rc-drawer/es/index.js + 3 modules ***!
\********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/PortalWrapper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/getScrollBarSize.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";var r=n("Ff2n"),i=n("1OyB"),a=n("vuIU"),o=n("Ji7U"),s=n("md7G"),l=n("foSv"),c=n("1W/9"),u=n("q1tI"),h=n("rePB"),d=n("JX7q"),f=n("TSYQ"),p=n.n(f),g=n("qx4F"),m=n("4IlW");var v={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},y=Object.keys(v).filter((function(t){if("undefined"==typeof document)return!1;var e=document.getElementsByTagName("html")[0];return t in(e?e.style:{})}))[0],b=v[y];function x(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on".concat(e),n)}function S(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r):t.attachEvent&&t.detachEvent("on".concat(e),n)}var C=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},E=!("undefined"!=typeof window&&window.document&&window.document.createElement);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(l.a)(t);if(e){var i=Object(l.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var k={},T=function(t){Object(o.a)(n,t);var e=w(n);function n(t){var r;return Object(i.a)(this,n),(r=e.call(this,t)).domFocus=function(){r.dom&&r.dom.focus()},r.removeStartHandler=function(t){t.touches.length>1||(r.startPos={x:t.touches[0].clientX,y:t.touches[0].clientY})},r.removeMoveHandler=function(t){if(!(t.changedTouches.length>1)){var e=t.currentTarget,n=t.changedTouches[0].clientX-r.startPos.x,i=t.changedTouches[0].clientY-r.startPos.y;(e===r.maskDom||e===r.handlerDom||e===r.contentDom&&function t(e,n,r,i){if(!n||n===document||n instanceof Document)return!1;if(n===e.parentNode)return!0;var a=Math.max(Math.abs(r),Math.abs(i))===Math.abs(i),o=Math.max(Math.abs(r),Math.abs(i))===Math.abs(r),s=n.scrollHeight-n.clientHeight,l=n.scrollWidth-n.clientWidth,c=document.defaultView.getComputedStyle(n),u="auto"===c.overflowY||"scroll"===c.overflowY,h="auto"===c.overflowX||"scroll"===c.overflowX,d=s&&u,f=l&&h;return!!(a&&(!d||d&&(n.scrollTop>=s&&i<0||n.scrollTop<=0&&i>0))||o&&(!f||f&&(n.scrollLeft>=l&&r<0||n.scrollLeft<=0&&r>0)))&&t(e,n.parentNode,r,i)}(e,t.target,n,i))&&t.cancelable&&t.preventDefault()}},r.transitionEnd=function(t){var e=t.target;S(e,b,r.transitionEnd),e.style.transition=""},r.onKeyDown=function(t){if(t.keyCode===m.a.ESC){var e=r.props.onClose;t.stopPropagation(),e&&e(t)}},r.onWrapperTransitionEnd=function(t){var e=r.props,n=e.open,i=e.afterVisibleChange;t.target===r.contentWrapper&&t.propertyName.match(/transform$/)&&(r.dom.style.transition="",!n&&r.getCurrentDrawerSome()&&(document.body.style.overflowX="",r.maskDom&&(r.maskDom.style.left="",r.maskDom.style.width="")),i&&i(!!n))},r.openLevelTransition=function(){var t=r.props,e=t.open,n=t.width,i=t.height,a=r.getHorizontalBoolAndPlacementName(),o=a.isHorizontal,s=a.placementName,l=r.contentDom?r.contentDom.getBoundingClientRect()[o?"width":"height"]:0,c=(o?n:i)||l;r.setLevelAndScrolling(e,s,c)},r.setLevelTransform=function(t,e,n,i){var a=r.props,o=a.placement,s=a.levelMove,l=a.duration,c=a.ease,u=a.showMask;r.levelDom.forEach((function(a){a.style.transition="transform ".concat(l," ").concat(c),x(a,b,r.transitionEnd);var h,d,f,p=t?n:0;if(s){var g=(d={target:a,open:t},f="function"==typeof(h=s)?h(d):h,Array.isArray(f)?2===f.length?f:[f[0],f[1]]:[f]);p=t?g[0]:g[1]||0}var m="number"==typeof p?"".concat(p,"px"):p,v="left"===o||"top"===o?m:"-".concat(m);v=u&&"right"===o&&i?"calc(".concat(v," + ").concat(i,"px)"):v,a.style.transform=p?"".concat(e,"(").concat(v,")"):""}))},r.setLevelAndScrolling=function(t,e,n){var i=r.props.onChange;if(!E){var a=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(g.a)(!0):0;r.setLevelTransform(t,e,n,a),r.toggleScrollingToDrawerAndBody(a)}i&&i(t)},r.toggleScrollingToDrawerAndBody=function(t){var e=r.props,n=e.getOpenCount,i=e.getContainer,a=e.showMask,o=e.open,s=i&&i(),l=n&&n();if(s&&s.parentNode===document.body&&a){var c=["touchstart"],u=[document.body,r.maskDom,r.handlerDom,r.contentDom];o&&"hidden"!==document.body.style.overflow?(t&&r.addScrollingEffect(t),1===l&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",u.forEach((function(t,e){t&&x(t,c[e]||"touchmove",e?r.removeMoveHandler:r.removeStartHandler,r.passive)}))):r.getCurrentDrawerSome()&&(l||(document.body.style.overflow=""),document.body.style.touchAction="",t&&r.remScrollingEffect(t),u.forEach((function(t,e){t&&S(t,c[e]||"touchmove",e?r.removeMoveHandler:r.removeStartHandler,r.passive)})))}},r.addScrollingEffect=function(t){var e=r.props,n=e.placement,i=e.duration,a=e.ease,o=e.getOpenCount,s=e.switchScrollingEffect;1===(o&&o())&&s();var l="width ".concat(i," ").concat(a),c="transform ".concat(i," ").concat(a);switch(r.dom.style.transition="none",n){case"right":r.dom.style.transform="translateX(-".concat(t,"px)");break;case"top":case"bottom":r.dom.style.width="calc(100% - ".concat(t,"px)"),r.dom.style.transform="translateZ(0)"}clearTimeout(r.timeout),r.timeout=setTimeout((function(){r.dom&&(r.dom.style.transition="".concat(c,",").concat(l),r.dom.style.width="",r.dom.style.transform="")}))},r.remScrollingEffect=function(t){var e,n=r.props,i=n.placement,a=n.duration,o=n.ease,s=n.getOpenCount,l=n.switchScrollingEffect;s&&s()||l(!0),y&&(document.body.style.overflowX="hidden"),r.dom.style.transition="none";var c="width ".concat(a," ").concat(o),u="transform ".concat(a," ").concat(o);switch(i){case"left":r.dom.style.width="100%",c="width 0s ".concat(o," ").concat(a);break;case"right":r.dom.style.transform="translateX(".concat(t,"px)"),r.dom.style.width="100%",c="width 0s ".concat(o," ").concat(a),r.maskDom&&(r.maskDom.style.left="-".concat(t,"px"),r.maskDom.style.width="calc(100% + ".concat(t,"px)"));break;case"top":case"bottom":r.dom.style.width="calc(100% + ".concat(t,"px)"),r.dom.style.height="100%",r.dom.style.transform="translateZ(0)",e="height 0s ".concat(o," ").concat(a)}clearTimeout(r.timeout),r.timeout=setTimeout((function(){r.dom&&(r.dom.style.transition="".concat(u,",").concat(e?"".concat(e,","):"").concat(c),r.dom.style.transform="",r.dom.style.width="",r.dom.style.height="")}))},r.getCurrentDrawerSome=function(){return!Object.keys(k).some((function(t){return k[t]}))},r.getLevelDom=function(t){var e=t.level,n=t.getContainer;if(!E){var i,a=n&&n(),o=a?a.parentNode:null;if(r.levelDom=[],"all"===e)(o?Array.prototype.slice.call(o.children):[]).forEach((function(t){"SCRIPT"!==t.nodeName&&"STYLE"!==t.nodeName&&"LINK"!==t.nodeName&&t!==a&&r.levelDom.push(t)}));else e&&(i=e,Array.isArray(i)?i:[i]).forEach((function(t){document.querySelectorAll(t).forEach((function(t){r.levelDom.push(t)}))}))}},r.getHorizontalBoolAndPlacementName=function(){var t=r.props.placement,e="left"===t||"right"===t;return{isHorizontal:e,placementName:"translate".concat(e?"X":"Y")}},r.state={_self:Object(d.a)(r)},r}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var t=this;if(!E){var e=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return e=!0,null}}))}catch(t){}this.passive=!!e&&{passive:!1}}var n=this.props,r=n.open,i=n.getContainer,a=i&&i();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(9*Math.random()).toString())).toString(16)),this.getLevelDom(this.props),r&&(a&&a.parentNode===document.body&&(k[this.drawerId]=r),this.openLevelTransition(),this.forceUpdate((function(){t.domFocus()})))}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.open,r=e.getContainer,i=r&&r();n!==t.open&&(n&&this.domFocus(),i&&i.parentNode===document.body&&(k[this.drawerId]=!!n),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var t=this.props,e=t.getOpenCount,n=t.open,r=t.switchScrollingEffect,i="function"==typeof e&&e();delete k[this.drawerId],n&&(this.setLevelTransform(!1),document.body.style.touchAction=""),i||(document.body.style.overflow="",r(!0))}},{key:"render",value:function(){var t,e=this,n=this.props,i=n.className,a=n.children,o=n.style,s=n.width,l=n.height,c=(n.defaultOpen,n.open),d=n.prefixCls,f=n.placement,g=(n.level,n.levelMove,n.ease,n.duration,n.getContainer,n.handler),m=(n.onChange,n.afterVisibleChange,n.showMask),v=n.maskClosable,y=n.maskStyle,b=n.onClose,x=n.onHandleClick,S=n.keyboard,E=(n.getOpenCount,n.switchScrollingEffect,Object(r.a)(n,["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"])),w=!!this.dom&&c,k=p()(d,(t={},Object(h.a)(t,"".concat(d,"-").concat(f),!0),Object(h.a)(t,"".concat(d,"-open"),w),Object(h.a)(t,i||"",!!i),Object(h.a)(t,"no-mask",!m),t)),T=this.getHorizontalBoolAndPlacementName().placementName,O="left"===f||"top"===f?"-100%":"100%",A=w?"":"".concat(T,"(").concat(O,")"),L=g&&u.cloneElement(g,{onClick:function(t){g.props.onClick&&g.props.onClick(),x&&x(t)},ref:function(t){e.handlerDom=t}});return u.createElement("div",Object.assign({},E,{tabIndex:-1,className:k,style:o,ref:function(t){e.dom=t},onKeyDown:w&&S?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),m&&u.createElement("div",{className:"".concat(d,"-mask"),onClick:v?b:void 0,style:y,ref:function(t){e.maskDom=t}}),u.createElement("div",{className:"".concat(d,"-content-wrapper"),style:{transform:A,msTransform:A,width:C(s)?"".concat(s,"px"):s,height:C(l)?"".concat(l,"px"):l},ref:function(t){e.contentWrapper=t}},u.createElement("div",{className:"".concat(d,"-content"),ref:function(t){e.contentDom=t},onTouchStart:w&&m?this.removeStartHandler:void 0,onTouchMove:w&&m?this.removeMoveHandler:void 0},a),L))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,r=e._self,i={prevProps:t};if(void 0!==n){var a=t.placement,o=t.level;a!==n.placement&&(r.contentDom=null),o!==n.level&&r.getLevelDom(t)}return i}}]),n}(u.Component);T.defaultProps={switchScrollingEffect:function(){}};var O=T;function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(l.a)(t);if(e){var i=Object(l.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var L=function(t){Object(o.a)(n,t);var e=A(n);function n(t){var r;Object(i.a)(this,n),(r=e.call(this,t)).onHandleClick=function(t){var e=r.props,n=e.onHandleClick,i=e.open;if(n&&n(t),void 0===i){var a=r.state.open;r.setState({open:!a})}},r.onClose=function(t){var e=r.props,n=e.onClose,i=e.open;n&&n(t),void 0===i&&r.setState({open:!1})};var a=void 0!==t.open?t.open:!!t.defaultOpen;return r.state={open:a},"onMaskClick"in t&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),r}return Object(a.a)(n,[{key:"render",value:function(){var t=this,e=this.props,n=(e.defaultOpen,e.getContainer),i=e.wrapperClassName,a=e.forceRender,o=e.handler,s=Object(r.a)(e,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),l=this.state.open;if(!n)return u.createElement("div",{className:i,ref:function(e){t.dom=e}},u.createElement(O,Object.assign({},s,{open:l,handler:o,getContainer:function(){return t.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var h=!!o||a;return u.createElement(c.a,{visible:l,forceRender:h,getContainer:n,wrapperClassName:i},(function(e){var n=e.visible,i=e.afterClose,a=Object(r.a)(e,["visible","afterClose"]);return u.createElement(O,Object.assign({},s,a,{open:void 0!==n?n:l,afterVisibleChange:void 0!==i?i:s.afterVisibleChange,handler:o,onClose:t.onClose,onHandleClick:t.onHandleClick}))}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,r={prevProps:t};return void 0!==n&&t.open!==n.open&&(r.open=t.open),r}}]),n}(u.Component);L.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:u.createElement("div",{className:"drawer-handle"},u.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var D=L;e.a=D},fcyK:
/*!********************************************************!*\
!*** ./src/pages/Problems/OjForm/CodePanel/index.less ***!
\********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},fyJ8:
/*!************************************************!*\
!*** ./node_modules/rc-table/es/Cell/index.js ***!
\************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),a=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),o=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),s=n(/*! react */"q1tI"),l=n(/*! classnames */"TSYQ"),c=n.n(l),u=n(/*! rc-util/es/ref */"c+Xe"),h=n(/*! ../utils/valueUtil */"sR1s");var d=s.forwardRef((function(t,e){var n,l,d,f=t.prefixCls,p=t.className,g=t.record,m=t.index,v=t.dataIndex,y=t.render,b=t.children,x=t.component,S=void 0===x?"td":x,C=t.colSpan,E=t.rowSpan,w=t.fixLeft,k=t.fixRight,T=t.firstFixLeft,O=t.lastFixLeft,A=t.firstFixRight,L=t.lastFixRight,D=t.appendNode,R=t.additionalProps,I=void 0===R?{}:R,_=t.ellipsis,M=t.align,N=t.rowType,P=t.isSticky,F="".concat(f,"-cell");if(b)d=b;else{var j=Object(h.b)(g,v);if(d=j,y){var B=y(j,g,m);!function(t){return t&&"object"===Object(o.a)(t)&&!Array.isArray(t)&&!s.isValidElement(t)}(B)?d=B:(d=B.children,l=B.props)}}"object"!==Object(o.a)(d)||Array.isArray(d)||s.isValidElement(d)||(d=null),_&&(O||A)&&(d=s.createElement("span",{className:"".concat(F,"-content")},d));var U=l||{},H=U.colSpan,G=U.rowSpan,z=U.style,W=U.className,V=Object(a.a)(U,["colSpan","rowSpan","style","className"]),K=void 0!==H?H:C,q=void 0!==G?G:E;if(0===K||0===q)return null;var Y={},X="number"==typeof w,$="number"==typeof k;X&&(Y.position="sticky",Y.left=w),$&&(Y.position="sticky",Y.right=k);var J,Z={};M&&(Z.textAlign=M);var Q=!0===_?{showTitle:!0}:_;Q&&(Q.showTitle||"header"===N)&&("string"==typeof d||"number"==typeof d?J=d.toString():s.isValidElement(d)&&"string"==typeof d.props.children&&(J=d.props.children));var tt,et=Object(i.a)(Object(i.a)(Object(i.a)({title:J},V),I),{},{colSpan:K&&1!==K?K:null,rowSpan:q&&1!==q?q:null,className:c()(F,p,(n={},Object(r.a)(n,"".concat(F,"-fix-left"),X),Object(r.a)(n,"".concat(F,"-fix-left-first"),T),Object(r.a)(n,"".concat(F,"-fix-left-last"),O),Object(r.a)(n,"".concat(F,"-fix-right"),$),Object(r.a)(n,"".concat(F,"-fix-right-first"),A),Object(r.a)(n,"".concat(F,"-fix-right-last"),L),Object(r.a)(n,"".concat(F,"-ellipsis"),_),Object(r.a)(n,"".concat(F,"-with-append"),D),Object(r.a)(n,"".concat(F,"-fix-sticky"),(X||$)&&P),n),I.className,W),style:Object(i.a)(Object(i.a)(Object(i.a)(Object(i.a)({},I.style),Z),Y),z),ref:(tt=S,"string"==typeof tt||Object(u.c)(tt)?e:null)});return s.createElement(S,Object.assign({},et),D,d)}));d.displayName="Cell";var f=s.memo(d,(function(t,e){return!!e.shouldCellUpdate&&!e.shouldCellUpdate(e.record,t.record)}));e.a=f},gRFJ:
/*!********************************************!*\
!*** ./node_modules/store/storages/all.js ***!
\********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=[n(/*! ./localStorage */"rdUC"),n(/*! ./oldFF-globalStorage */"ynwM"),n(/*! ./oldIE-userDataStorage */"RELg"),n(/*! ./cookieStorage */"DlR+"),n(/*! ./sessionStorage */"CrYA"),n(/*! ./memoryStorage */"PD8m")]},gaXo:
/*!*************************************************!*\
!*** ./node_modules/store/plugins/lib/json2.js ***!
\*************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(module,exports){"object"!=typeof JSON&&(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,gap,indent,meta,rep;function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,(function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}function str(t,e){var n,r,i,a,o,s=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(l)){for(a=l.length,n=0;n<a;n+=1)o[n]=str(n,l)||"null";return i=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+s+"]":"["+o.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(a=rep.length,n=0;n<a;n+=1)"string"==typeof rep[n]&&(i=str(r=rep[n],l))&&o.push(quote(r)+(gap?": ":":")+i);else for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(i=str(r,l))&&o.push(quote(r)+(gap?": ":":")+i);return i=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+s+"}":"{"+o.join(",")+"}",gap=s,i}}"function"!=typeof Date.prototype.toJSON&&(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),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(t,e){var n,r,i=t[e];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(void 0!==(r=walk(i,n))?i[n]=r:delete i[n]);return reviver.call(t,e,i)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,(function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},hW8S:
/*!******************************************************!*\
!*** ./node_modules/rc-table/es/utils/legacyUtil.js ***!
\******************************************************/
/*! exports provided: INTERNAL_COL_DEFINE, getExpandableProps, getDataAndAriaProps */
/*! exports used: INTERNAL_COL_DEFINE, getDataAndAriaProps, getExpandableProps */function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),i=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=(n(/*! rc-util/es/warning */"Kwbf"),"RC_TABLE_INTERNAL_COL_DEFINE");function o(t){var e=t.expandable,n=Object(i.a)(t,["expandable"]);return"expandable"in t?Object(r.a)(Object(r.a)({},n),e):n}function s(t){return Object.keys(t).reduce((function(e,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)||(e[n]=t[n]),e}),{})}},i3hx:
/*!**************************************************!*\
!*** ./src/components/SplitContainer/index.less ***!
\**************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},je13:
/*!*************************************************!*\
!*** ./node_modules/store/dist/store.legacy.js ***!
\*************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ../src/store-engine */"5nXd"),i=n(/*! ../storages/all */"gRFJ"),a=[n(/*! ../plugins/json2 */"uQRt")];t.exports=r.createStore(i,a)},kSUc:
/*!***************************************************!*\
!*** ./src/components/markdown-editor/index.less ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},"kaH+":
/*!************************************************!*\
!*** ./src/components/image-preview/index.tsx ***!
\************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/button/style */"+L6B");var r=n(/*! antd/es/button */"2/Rp"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),a=n(/*! react */"q1tI"),o=n.n(a),s=(n(/*! ./index.less */"UZu5"),n(/*! @/components/mediator */"dhSg")),l=n(/*! @ant-design/icons */"rLCj"),c=n(/*! @ant-design/icons */"dF/Y"),u=n(/*! @ant-design/icons */"4i/N");e.a=function(){var t=Object(a.useState)(""),e=Object(i.a)(t,2),n=e[0],h=e[1],d=Object(a.useState)(0),f=Object(i.a)(d,2),p=f[0],g=f[1],m=Object(a.useRef)("");function v(t){27==t.keyCode&&m.current&&y()}function y(){document.body.style.overflow="auto",h("")}return Object(a.useEffect)((function(){return s.a.subscribe("preview-image",(function(t){h(t),document.body.style.overflow="hidden"}))}),[]),Object(a.useEffect)((function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}}),[]),Object(a.useEffect)((function(){m.current=n}),[n]),o.a.createElement(a.Fragment,null,n?o.a.createElement("div",{className:"image-preview-container"},o.a.createElement("div",{className:"button-group"},o.a.createElement(r.a,{onClick:function(){g(p+90)}},"旋转",o.a.createElement(l.a,null)),o.a.createElement(r.a,{href:n},"下载",o.a.createElement(c.a,null)),o.a.createElement(r.a,{onClick:y},"关闭",o.a.createElement(u.a,null))),o.a.createElement("div",{className:"preview-wrp-group"},o.a.createElement("img",{className:"image-preview",src:n,alt:"预览大图",style:{transform:"rotate(".concat(p,"deg)")}}))):null)}},lOMy:
/*!****************************************************!*\
!*** ./src/components/tpi-code-setting/index.less ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},lZu9:
/*!***********************************************************!*\
!*** ./node_modules/codemirror/mode/markdown/markdown.js ***!
\***********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";t.defineMode("markdown",(function(e,n){var r=t.getMode(e,"text/html"),i="null"==r.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.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)&&n.tokenTypeOverrides[o]&&(a[o]=n.tokenTypeOverrides[o]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/;function m(t,e,n){return e.f=e.inline=n,n(t,e)}function v(t,e,n){return e.f=e.block=n,n(t,e)}function y(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==x){var n=i;if(!n){var a=t.innerMode(r,e.htmlState);n="xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText}n&&(e.f=w,e.block=b,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function b(r,i){var o,d=r.column()===i.indentation,g=!(o=i.prevLine.stream)||!/\S/.test(o.string),v=i.indentedCode,y=i.prevLine.hr,b=!1!==i.list,x=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var E=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,b)){for(i.list=null;E<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=E-i.listStack[i.listStack.length-1])}var w=!(g||y||i.prevLine.header||b&&v||i.prevLine.fencedCodeEnd),k=(!1===i.list||y||g)&&i.indentation<=x&&r.match(s),T=null;if(i.indentationDiff>=4&&(v||i.prevLine.fencedCodeEnd||i.prevLine.header||g))return r.skipToEnd(),i.indentedCode=!0,a.code;if(r.eatSpace())return null;if(d&&i.indentation<=x&&(T=r.match(u))&&T[1].length<=6)return i.quote=0,i.header=T[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,C(i);if(i.indentation<=x&&r.eat(">"))return i.quote=d?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),r.eatSpace(),C(i);if(!k&&!i.setext&&d&&i.indentation<=x&&(T=r.match(l))){var O=T[1]?"ol":"ul";return i.indentation=E+r.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,n.taskLists&&r.match(c,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+O]),C(i)}return d&&i.indentation<=x&&(T=r.match(f,!0))?(i.quote=0,i.fencedEndRE=new RegExp(T[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&function(n){if(t.findModeByName){var r=t.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=t.getMode(e,n);return"null"==i.name?null:i}(T[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=t.startState(i.localMode)),i.f=i.block=S,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,C(i)):i.setext||!(w&&b||i.quote||!1!==i.list||i.code||k||p.test(r.string))&&(T=r.lookAhead(1))&&(T=T.match(h))?(i.setext?(i.header=i.setext,i.setext=0,r.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==T[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,C(i)):k?(r.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===r.peek()?m(r,i,A):m(r,i,i.inline)}function x(e,n){var a=r.token(e,n.htmlState);if(!i){var o=t.innerMode(r,n.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||n.md_inside&&e.current().indexOf(">")>-1)&&(n.f=w,n.block=b,n.htmlState=null)}return a}function S(t,e){var r,i=e.listStack[e.listStack.length-1]||0,o=e.indentation<i,s=i+3;return e.fencedEndRE&&e.indentation<=s&&(o||t.match(e.fencedEndRE))?(n.highlightFormatting&&(e.formatting="code-block"),o||(r=C(e)),e.localMode=e.localState=null,e.block=b,e.f=w,e.fencedEndRE=null,e.code=0,e.thisLine.fencedCodeEnd=!0,o?v(t,e,e.block):r):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),a.code)}function C(t){var e=[];if(t.formatting){e.push(a.formatting),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var r=0;r<t.formatting.length;r++)e.push(a.formatting+"-"+t.formatting[r]),"header"===t.formatting[r]&&e.push(a.formatting+"-"+t.formatting[r]+"-"+t.header),"quote"===t.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(a.formatting+"-"+t.formatting[r]+"-"+t.quote):e.push("error"))}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref?e.push(a.linkHref,"url"):(t.strong&&e.push(a.strong),t.em&&e.push(a.em),t.strikethrough&&e.push(a.strikethrough),t.emoji&&e.push(a.emoji),t.linkText&&e.push(a.linkText),t.code&&e.push(a.code),t.image&&e.push(a.image),t.imageAltText&&e.push(a.imageAltText,"link"),t.imageMarker&&e.push(a.imageMarker)),t.header&&e.push(a.header,a.header+"-"+t.header),t.quote&&(e.push(a.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(a.quote+"-"+t.quote):e.push(a.quote+"-"+n.maxBlockquoteDepth)),!1!==t.list){var i=(t.listStack.length-1)%3;i?1===i?e.push(a.list2):e.push(a.list3):e.push(a.list1)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function E(t,e){if(t.match(d,!0))return C(e)}function w(e,i){var o=i.text(e,i);if(void 0!==o)return o;if(i.list)return i.list=null,C(i);if(i.taskList)return" "===e.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,C(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&e.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),C(i);var s=e.next();if(i.linkTitle){i.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(e.match(new RegExp(u),!0))return a.linkHref}if("`"===s){var h=i.formatting;n.highlightFormatting&&(i.formatting="code"),e.eatWhile("`");var d=e.current().length;if(0!=i.code||i.quote&&1!=d){if(d==i.code){var f=C(i);return i.code=0,f}return i.formatting=h,C(i)}return i.code=d,C(i)}if(i.code)return C(i);if("\\"===s&&(e.next(),n.highlightFormatting)){var p=C(i),m=a.formatting+"-escape";return p?p+" "+m:m}if("!"===s&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),C(i);if("["===s&&i.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),C(i);if("]"===s&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");var p=C(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=T,p}if("["===s&&!i.image)return i.linkText&&e.match(/^.*?\]/)||(i.linkText=!0,n.highlightFormatting&&(i.formatting="link")),C(i);if("]"===s&&i.linkText){n.highlightFormatting&&(i.formatting="link");var p=C(i);return i.linkText=!1,i.inline=i.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?T:w,p}if("<"===s&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=k,n.highlightFormatting&&(i.formatting="link"),(p=C(i))?p+=" ":p="",p+a.linkInline;if("<"===s&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=k,n.highlightFormatting&&(i.formatting="link"),(p=C(i))?p+=" ":p="",p+a.linkEmail;if(n.xml&&"<"===s&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=e.string.indexOf(">",e.pos);if(-1!=y){var b=e.string.substring(e.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(i.md_inside=!0)}return e.backUp(1),i.htmlState=t.startState(r),v(e,i,x)}if(n.xml&&"<"===s&&e.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===s||"_"===s){for(var S=1,E=1==e.pos?" ":e.string.charAt(e.pos-2);S<3&&e.eat(s);)S++;var O=e.peek()||" ",A=!/\s/.test(O)&&(!g.test(O)||/\s/.test(E)||g.test(E)),L=!/\s/.test(E)&&(!g.test(E)||/\s/.test(O)||g.test(O)),D=null,R=null;if(S%2&&(i.em||!A||"*"!==s&&L&&!g.test(E)?i.em!=s||!L||"*"!==s&&A&&!g.test(O)||(D=!1):D=!0),S>1&&(i.strong||!A||"*"!==s&&L&&!g.test(E)?i.strong!=s||!L||"*"!==s&&A&&!g.test(O)||(R=!1):R=!0),null!=R||null!=D)return n.highlightFormatting&&(i.formatting=null==D?"strong":null==R?"em":"strong em"),!0===D&&(i.em=s),!0===R&&(i.strong=s),f=C(i),!1===D&&(i.em=!1),!1===R&&(i.strong=!1),f}else if(" "===s&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return C(i);e.backUp(1)}if(n.strikethrough)if("~"===s&&e.eatWhile(s)){if(i.strikethrough)return n.highlightFormatting&&(i.formatting="strikethrough"),f=C(i),i.strikethrough=!1,f;if(e.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),C(i)}else if(" "===s&&e.match(/^~~/,!0)){if(" "===e.peek())return C(i);e.backUp(2)}if(n.emoji&&":"===s&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,n.highlightFormatting&&(i.formatting="emoji");var I=C(i);return i.emoji=!1,I}return" "===s&&(e.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),C(i)}function k(t,e){if(">"===t.next()){e.f=e.inline=w,n.highlightFormatting&&(e.formatting="link");var r=C(e);return r?r+=" ":r="",r+a.linkInline}return t.match(/^[^>]+/,!0),a.linkInline}function T(t,e){if(t.eatSpace())return null;var r,i=t.next();return"("===i||"["===i?(e.f=e.inline=(r="("===i?")":"]",function(t,e){if(t.next()===r){e.f=e.inline=w,n.highlightFormatting&&(e.formatting="link-string");var i=C(e);return e.linkHref=!1,i}return t.match(O[r]),e.linkHref=!0,C(e)}),n.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,C(e)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(t,e){return t.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=L,t.next(),n.highlightFormatting&&(e.formatting="link"),e.linkText=!0,C(e)):m(t,e,w)}function L(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=D,n.highlightFormatting&&(e.formatting="link");var r=C(e);return e.linkText=!1,r}return t.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function D(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=w,a.linkHref+" url")}var R={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:w,text:E,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(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(r,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(t,e){if(e.formatting=!1,t!=e.thisLine.stream){if(e.header=0,e.hr=!1,t.match(/^\s*$/,!0))return y(e),null;if(e.prevLine=e.thisLine,e.thisLine={stream:t},e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,!e.localState&&(e.f=e.block,e.f!=x)){var n=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(e.indentation=n,e.indentationDiff=null,n>0)return null}}return e.f(t,e)},innerMode:function(t){return t.block==x?{state:t.htmlState,mode:r}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:R}},indent:function(e,n,i){return e.block==x&&r.indent?r.indent(e.htmlState,n,i):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,n,i):t.Pass},blankLine:y,getType:C,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return R}),"xml"),t.defineMIME("text/markdown","markdown"),t.defineMIME("text/x-markdown","markdown")}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../xml/xml */"1eCo"),n(/*! ../meta */"8EBN"))},n6Qo:
/*!**************************************************************!*\
!*** ./node_modules/rc-table/es/Footer/index.js + 2 modules ***!
\**************************************************************/
/*! exports provided: default, FooterComponents */
/*! exports used: FooterComponents, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/Cell/index.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/context/TableContext.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("q1tI"),i=n("biw7"),a=n("fyJ8");e.b=function(t){var e=t.children,n=r.useContext(i.a).prefixCls;return r.createElement("tfoot",{className:"".concat(n,"-summary")},e)};var o={Cell:function(t){var e=t.className,n=t.index,o=t.children,s=t.colSpan,l=t.rowSpan,c=r.useContext(i.a),u=c.prefixCls,h=c.fixedInfoList[n];return r.createElement(a.a,Object.assign({className:e,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,render:function(){return{children:o,props:{colSpan:s,rowSpan:l}}}},h))},Row:function(t){return r.createElement("tr",Object.assign({},t))}}},nVVt:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/mode.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}},nWbc:
/*!**********************************************************************!*\
!*** ./src/pages/tasks/left-panel/discuss/discuss-editor/index.less ***!
\**********************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},osHv:
/*!********************************************************!*\
!*** ./node_modules/codemirror/addon/fold/xml-fold.js ***!
\********************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";var e=t.Pos;function n(t,e){return t.line-e.line||t.ch-e.ch}var r="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",i=new RegExp("<(/?)(["+r+"]["+r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function a(t,e,n,r){this.line=e,this.ch=n,this.cm=t,this.text=t.getLine(e),this.min=r?Math.max(r.from,t.firstLine()):t.firstLine(),this.max=r?Math.min(r.to-1,t.lastLine()):t.lastLine()}function o(t,n){var r=t.cm.getTokenTypeAt(e(t.line,n));return r&&/\btag\b/.test(r)}function s(t){if(!(t.line>=t.max))return t.ch=0,t.text=t.cm.getLine(++t.line),!0}function l(t){if(!(t.line<=t.min))return t.text=t.cm.getLine(--t.line),t.ch=t.text.length,!0}function c(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(s(t))continue;return}if(o(t,e+1)){var n=t.text.lastIndexOf("/",e),r=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,r?"selfClose":"regular"}t.ch=e+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(l(t))continue;return}if(o(t,e+1)){i.lastIndex=e,t.ch=e;var n=i.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function h(t){for(;;){i.lastIndex=t.ch;var e=i.exec(t.text);if(!e){if(s(t))continue;return}if(o(t,e.index+1))return t.ch=e.index+e[0].length,e;t.ch=e.index+1}}function d(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(l(t))continue;return}if(o(t,e+1)){var n=t.text.lastIndexOf("/",e),r=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,r?"selfClose":"regular"}t.ch=e}}function f(t,n){for(var r=[];;){var i,a=h(t),o=t.line,s=t.ch-(a?a[0].length:0);if(!a||!(i=c(t)))return;if("selfClose"!=i)if(a[1]){for(var l=r.length-1;l>=0;--l)if(r[l]==a[2]){r.length=l;break}if(l<0&&(!n||n==a[2]))return{tag:a[2],from:e(o,s),to:e(t.line,t.ch)}}else r.push(a[2])}}function p(t,n){for(var r=[];;){var i=d(t);if(!i)return;if("selfClose"!=i){var a=t.line,o=t.ch,s=u(t);if(!s)return;if(s[1])r.push(s[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==s[2]){r.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:e(t.line,t.ch),to:e(a,o)}}}else u(t)}}t.registerHelper("fold","xml",(function(t,r){for(var i=new a(t,r.line,0);;){var o=h(i);if(!o||i.line!=r.line)return;var s=c(i);if(!s)return;if(!o[1]&&"selfClose"!=s){var l=e(i.line,i.ch),u=f(i,o[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),t.findMatchingTag=function(t,r,i){var o=new a(t,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=c(o),l=s&&e(o.line,o.ch),h=s&&u(o);if(s&&h&&!(n(o,r)>0)){var d={from:e(o.line,o.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:p(o,h[2]),close:d,at:"close"}:{open:d,close:f(o=new a(t,l.line,l.ch,i),h[2]),at:"open"}}}},t.findEnclosingTag=function(t,e,n,r){for(var i=new a(t,e.line,e.ch,n);;){var o=p(i,r);if(!o)break;var s=f(new a(t,e.line,e.ch,n),o.tag);if(s)return{open:o,close:s}}},t.scanForClosingTag=function(t,e,n,r){return f(new a(t,e.line,e.ch,r?{from:0,to:r}:null),n)}}(n(/*! ../../lib/codemirror */"VrN/"))},"p/48":
/*!****************************************!*\
!*** ./src/pages/MyProblem/index.less ***!
\****************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},p5ED:
/*!*********************************************!*\
!*** ./src/components/PreviewAll/index.tsx ***!
\*********************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/button/style */"+L6B");var r=n(/*! antd/es/button */"2/Rp"),i=(n(/*! antd/es/tooltip/style */"5Dmo"),n(/*! antd/es/tooltip */"3S7+")),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! ./index.less?modules */"vHTk"),u=n.n(c),h=n(/*! @ant-design/icons */"yEEn"),d=n(/*! @/components/monaco-editor */"ZW9T"),f=n(/*! @/utils/util */"1vsH");e.a=function(t){var e=t.name,n=t.data,c=(t.theme,t.type),p=t.filename,g=t.monacoEditor,m=t.className,v=t.style,y=t.close,b=t.onClose,x=t.hasMask,S=Object(s.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),C=Object(o.a)(S,2),E=(C[0],C[1],Object(s.useState)("")),w=Object(o.a)(E,2),k=(w[0],w[1]),T=Object(s.useRef)();p&&(g.filename=p),Object(s.useEffect)((function(){var t,e,n=null===(t=document.cookie)||void 0===t||null===(e=t.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(t){var e=t.split("=");"_educoder_session"===e[0]&&k(e[1])}))}),[]);var O=function(){n.startsWith("http")||n.startsWith("/")?A():Object(f.x)(p||"educoder",n,p)},A=function(){Object(f.v)(p||e,n)};return console.log("data:",n,"fileanme:",p," name:",e),l.a.createElement("div",{style:Object(a.a)({},v||{}),className:"".concat(x&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},y&&l.a.createElement("div",{className:u.a.close,ref:T},l.a.createElement(i.a,{title:"点击下载此文件",getPopupContainer:function(){return T.current}},l.a.createElement("span",{onClick:A},l.a.createElement("i",{className:"icon-quxiaozhiding"}))),l.a.createElement(i.a,{title:"关闭",getPopupContainer:function(){return T.current}},l.a.createElement("span",{className:"",onClick:b},l.a.createElement("i",{className:"icon-guanbi1"})))),l.a.createElement("div",{className:"".concat(u.a[m]," ").concat(m," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&l.a.createElement(d.b,g)),"audio"===c&&l.a.createElement("audio",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),"video"===c&&l.a.createElement(l.a.Fragment,null,null!=n&&n.startsWith("/")?l.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):l.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),"html"===c&&l.a.createElement("iframe",{src:n+"&disposition=inline"}),"pdf"===c&&l.a.createElement("embed",{className:u.a.embed,src:n}),"pdfeditor"===c&&l.a.createElement("div",null,l.a.createElement("iframe",{src:"https://a1office.co/solutions/editor/pdf-editor/查重文档1-8839d79b81e8bda0d298ca058913ab88.pdf"}),l.a.createElement("div",{style:{position:"absolute",left:"1px",top:"1px",width:180,height:60,background:"#f9f9f9"}})),"image"===c&&l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),"other"===c&&l.a.createElement("div",null,l.a.createElement(r.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载")),("download"===c||"office"===c)&&l.a.createElement(r.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载"))}},"p77/":
/*!****************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.css ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},pPuO:
/*!**********************************************************************!*\
!*** ./src/pages/MyProblem/LeftPanel/Description/index.less?modules ***!
\**********************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},"qJ4+":
/*!**********************************************************!*\
!*** ./src/pages/MyProblem/LeftPanel/Discuss/index.less ***!
\**********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},"rAM+":
/*!*******************************************************************************************************************!*\
!*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***!
\*******************************************************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Object(r.a)(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,a=function(){};return{s:a,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}},rUJ1:
/*!********************************************!*\
!*** ./node_modules/marked/src/helpers.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: escape */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){const n=/[&<>"']/,r=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=t=>o[t];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(t){return t.replace(l,(t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const f={},p=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(t,e){f[" "+t]||(p.test(t)?f[" "+t]=t+"/":f[" "+t]=y(t,"/",!0));const n=-1===(t=f[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(g,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(m,"$1")+e:t+e}function y(t,e,n){const r=t.length;if(0===r)return"";let i=0;for(;i<r;){const a=t.charAt(r-i-1);if(a!==e||n){if(a===e||!n)break;i++}else i++}return t.substr(0,r-i)}t.exports={escape:function(t,e){if(e){if(n.test(t))return t.replace(r,s)}else if(i.test(t))return t.replace(a,s);return t},unescape:c,edit:function(t,e){t=t.source||t,e=e||"";const n={replace:(e,r)=>(r=(r=r.source||r).replace(u,"$1"),t=t.replace(e,r),n),getRegex:()=>new RegExp(t,e)};return n},cleanUrl:function(t,e,n){if(t){let t;try{t=decodeURIComponent(c(n)).replace(h,"").toLowerCase()}catch(t){return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}e&&!d.test(n)&&(n=v(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},resolveUrl:v,noopTest:{exec:function(){}},merge:function(t){let e,n,r=1;for(;r<arguments.length;r++)for(n in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},splitCells:function(t,e){const n=t.replace(/\|/g,(t,e,n)=>{let r=!1,i=e;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:y,findClosingBracket:function(t,e){if(-1===t.indexOf(e[1]))return-1;const n=t.length;let r=0,i=0;for(;i<n;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return-1},checkSanitizeDeprecation:function(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}}},rcnY:
/*!*******************************************!*\
!*** ./node_modules/qr.js/lib/RSBlock.js ***!
\*******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ./ErrorCorrectLevel */"aRTE");function i(t,e){this.totalCount=t,this.dataCount=e}i.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],i.getRSBlocks=function(t,e){var n=i.getRsBlockTable(t,e);if(null==n)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var r=n.length/3,a=new Array,o=0;o<r;o++)for(var s=n[3*o+0],l=n[3*o+1],c=n[3*o+2],u=0;u<s;u++)a.push(new i(l,c));return a},i.getRsBlockTable=function(t,e){switch(e){case r.L:return i.RS_BLOCK_TABLE[4*(t-1)+0];case r.M:return i.RS_BLOCK_TABLE[4*(t-1)+1];case r.Q:return i.RS_BLOCK_TABLE[4*(t-1)+2];case r.H:return i.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},t.exports=i},rdUC:
/*!*****************************************************!*\
!*** ./node_modules/store/storages/localStorage.js ***!
\*****************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ../src/util */"MFOe").Global;function i(){return r.localStorage}function a(t){return i().getItem(t)}t.exports={name:"localStorage",read:a,write:function(t,e){return i().setItem(t,e)},each:function(t){for(var e=i().length-1;e>=0;e--){var n=i().key(e);t(a(n),n)}},remove:function(t){return i().removeItem(t)},clearAll:function(){return i().clear()}}},sR1s:
/*!*****************************************************!*\
!*** ./node_modules/rc-table/es/utils/valueUtil.js ***!
\*****************************************************/
/*! exports provided: getPathValue, getColumnsKey, mergeObject, validateValue */
/*! exports used: getColumnsKey, getPathValue, mergeObject, validateValue */function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return l}));var r=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU");function i(t){return null==t?[]:Array.isArray(t)?t:[t]}function a(t,e){if(!e&&"number"!=typeof e)return t;for(var n=i(e),r=t,a=0;a<n.length;a+=1){if(!r)return null;r=r[n[a]]}return r}function o(t){var e=[],n={};return t.forEach((function(t){for(var r=t||{},a=r.key,o=r.dataIndex,s=a||i(o).join("-")||"RC_TABLE_KEY";n[s];)s="".concat(s,"_next");n[s]=!0,e.push(s)})),e}function s(){var t={};function e(t,n){n&&Object.keys(n).forEach((function(i){var a=n[i];a&&"object"===Object(r.a)(a)?(t[i]=t[i]||{},e(t[i],a)):t[i]=a}))}for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return i.forEach((function(n){e(t,n)})),t}function l(t){return null!=t}},sboe:
/*!*************************************************!*\
!*** ./node_modules/rc-tree/es/contextTypes.js ***!
\*************************************************/
/*! exports provided: TreeContext */
/*! exports used: TreeContext */function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(/*! react */"q1tI"),i=r.createContext(null)},t23M:
/*!*****************************************************!*\
!*** ./node_modules/rc-resize-observer/es/index.js ***!
\*****************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,n){"use strict";var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),i=n(/*! @babel/runtime/helpers/esm/classCallCheck */"1OyB"),a=n(/*! @babel/runtime/helpers/esm/createClass */"vuIU"),o=n(/*! @babel/runtime/helpers/esm/inherits */"Ji7U"),s=n(/*! @babel/runtime/helpers/esm/createSuper */"LK+K"),l=n(/*! react */"q1tI"),c=n(/*! rc-util/es/Dom/findDOMNode */"m+aA"),u=n(/*! rc-util/es/Children/toArray */"Zm9Q"),h=n(/*! rc-util/es/warning */"Kwbf"),d=n(/*! rc-util/es/ref */"c+Xe"),f=n(/*! resize-observer-polyfill */"bdgK"),p=function(t){Object(o.a)(n,t);var e=Object(s.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.apply(this,arguments)).resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(e){var n=t.props.onResize,i=e[0].target,a=i.getBoundingClientRect(),o=a.width,s=a.height,l=i.offsetWidth,c=i.offsetHeight,u=Math.floor(o),h=Math.floor(s);if(t.state.width!==u||t.state.height!==h||t.state.offsetWidth!==l||t.state.offsetHeight!==c){var d={width:u,height:h,offsetWidth:l,offsetHeight:c};t.setState(d),n&&Promise.resolve().then((function(){n(Object(r.a)(Object(r.a)({},d),{},{offsetWidth:l,offsetHeight:c}))}))}},t.setChildNode=function(e){t.childNode=e},t}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){if(this.props.disabled)this.destroyObserver();else{var t=Object(c.a)(this.childNode||this);t!==this.currentElement&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(t))}}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var t=this.props.children,e=Object(u.a)(t);if(e.length>1)Object(h.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(0===e.length)return Object(h.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var n=e[0];if(l.isValidElement(n)&&Object(d.c)(n)){var r=n.ref;e[0]=l.cloneElement(n,{ref:Object(d.a)(r,this.setChildNode)})}return 1===e.length?e[0]:e.map((function(t,e){return!l.isValidElement(t)||"key"in t&&null!==t.key?t:l.cloneElement(t,{key:"".concat("rc-observer-key","-").concat(e)})}))}}]),n}(l.Component);p.displayName="ResizeObserver",e.a=p},uD2n:
/*!***************************************************************************************!*\
!*** ./src/pages/MyProblem/LeftPanel/Discuss/discuss-input-editor/index.less?modules ***!
\***************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={"dis-input-editor-container":"dis-input-editor-container___3uf7A",active:"active___20tmT","input-mask":"input-mask___1kijM","text-area":"text-area___2gTEA","tip-container":"tip-container___2tKkE",hide:"hide___3jIwM","md-container":"md-container___14zRI","btn-send":"btn-send___3TabT"}},uMZB:
/*!******************************************************!*\
!*** ./src/pages/Problems/OjForm/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.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:
/*!*********************************************!*\
!*** ./node_modules/store/plugins/json2.js ***!
\*********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=function(){return n(/*! ./lib/json2 */"gaXo"),{}}},ulZh:
/*!*****************************************!*\
!*** ./node_modules/hls.js/dist/hls.js ***!
\*****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r;"undefined"!=typeof window&&(r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
/*!*********************************************!*\
!*** ./node_modules/eventemitter3/index.js ***!
\*********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function a(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new a:delete t._events[e]}function c(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,a=n.length,o=new Array(a);r<a;r++)o[r]=n[r].fn;return o},c.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,a,o){var s=i?i+t:t;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,n),!0;case 4:return u.fn.call(u.context,e,n,r),!0;case 5:return u.fn.call(u.context,e,n,r,a),!0;case 6:return u.fn.call(u.context,e,n,r,a,o),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,n);break;case 4:u[c].fn.call(u[c].context,e,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},c.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var a=i?i+t:t;if(!this._events[a])return this;if(!e)return l(this,a),this;var o=this._events[a];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||l(this,a);else{for(var s=0,c=[],u=o.length;s<u;s++)(o[s].fn!==e||r&&!o[s].once||n&&o[s].context!==n)&&c.push(o[s]);c.length?this._events[a]=1===c.length?c[0]:c:l(this,a)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&l(this,e)):(this._events=new a,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":
/*!*****************************************************!*\
!*** ./node_modules/url-toolkit/src/url-toolkit.js ***!
\*****************************************************/
/*! no static exports found */function(t,e,n){var r,i,a,o,s;r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,i=/^([^\/?#]*)([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(t,e,n){if(n=n||{},t=t.trim(),!(e=e.trim())){if(!n.alwaysNormalize)return t;var r=s.parseURL(t);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):e;var o=s.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=i.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var u=o.path,h=u.substring(0,u.lastIndexOf("/")+1)+a.path;c.path=s.normalizePath(h)}else c.path=o.path,a.params||(c.params=o.params,a.query||(c.query=o.query));return null===c.path&&(c.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(c)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(a,"");t.length!==(t=t.replace(o,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=s},"./node_modules/webworkify-webpack/index.js":
/*!**************************************************!*\
!*** ./node_modules/webworkify-webpack/index.js ***!
\**************************************************/
/*! no static exports found */function(t,e,n){function r(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n.oe=function(t){throw console.error(t),t};var r=n(n.s=ENTRY_MODULE);return r.default||r}function i(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t,e,r){var a={};a[r]=[];var o=e.toString(),s=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return a;for(var l,c=s[1],u=new RegExp("(\\\\n|\\W)"+i(c)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=u.exec(o);)"dll-reference"!==l[3]&&a[r].push(l[3]);for(u=new RegExp("\\("+i(c)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=u.exec(o);)t[l[2]]||(a[r].push(l[1]),t[l[2]]=n(l[1]).m),a[l[2]]=a[l[2]]||[],a[l[2]].push(l[4]);for(var h,d=Object.keys(a),f=0;f<d.length;f++)for(var p=0;p<a[d[f]].length;p++)h=a[d[f]][p],isNaN(1*h)||(a[d[f]][p]=1*a[d[f]][p]);return a}function o(t){return Object.keys(t).reduce((function(e,n){return e||t[n].length>0}),!1)}t.exports=function(t,e){e=e||{};var i={main:n.m},s=e.all?{main:Object.keys(i.main)}:function(t,e){for(var n={main:[e]},r={main:[]},i={main:{}};o(n);)for(var s=Object.keys(n),l=0;l<s.length;l++){var c=s[l],u=n[c].pop();if(i[c]=i[c]||{},!i[c][u]&&t[c][u]){i[c][u]=!0,r[c]=r[c]||[],r[c].push(u);for(var h=a(t,t[c][u],c),d=Object.keys(h),f=0;f<d.length;f++)n[d[f]]=n[d[f]]||[],n[d[f]]=n[d[f]].concat(h[d[f]])}}return r}(i,t),l="";Object.keys(s).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;s[t][e];)e++;s[t].push(e),i[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+t+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+s[t].map((function(e){return JSON.stringify(e)+": "+i[t][e].toString()})).join(",")+"});\n"})),l=l+"new (("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+s.main.map((function(t){return JSON.stringify(t)+": "+i.main[t].toString()})).join(",")+"}))(self);";var c=new window.Blob([l],{type:"text/javascript"});if(e.bare)return c;var u=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(c),h=new window.Worker(u);return h.objectURL=u,h}},"./src/config.ts":
/*!***********************!*\
!*** ./src/config.ts ***!
\***********************/
/*! exports provided: hlsDefaultConfig, mergeConfig, enableStreamingMode */function(t,e,n){"use strict";n.r(e),n.d(e,"hlsDefaultConfig",(function(){return E})),n.d(e,"mergeConfig",(function(){return w})),n.d(e,"enableStreamingMode",(function(){return k}));var r=n(/*! ./controller/abr-controller */"./src/controller/abr-controller.ts"),i=n(/*! ./controller/audio-stream-controller */"./src/controller/audio-stream-controller.ts"),a=n(/*! ./controller/audio-track-controller */"./src/controller/audio-track-controller.ts"),o=n(/*! ./controller/subtitle-stream-controller */"./src/controller/subtitle-stream-controller.ts"),s=n(/*! ./controller/subtitle-track-controller */"./src/controller/subtitle-track-controller.ts"),l=n(/*! ./controller/buffer-controller */"./src/controller/buffer-controller.ts"),c=n(/*! ./controller/timeline-controller */"./src/controller/timeline-controller.ts"),u=n(/*! ./controller/cap-level-controller */"./src/controller/cap-level-controller.ts"),h=n(/*! ./controller/fps-controller */"./src/controller/fps-controller.ts"),d=n(/*! ./controller/eme-controller */"./src/controller/eme-controller.ts"),f=n(/*! ./controller/cmcd-controller */"./src/controller/cmcd-controller.ts"),p=n(/*! ./utils/xhr-loader */"./src/utils/xhr-loader.ts"),g=n(/*! ./utils/fetch-loader */"./src/utils/fetch-loader.ts"),m=n(/*! ./utils/cues */"./src/utils/cues.ts"),v=n(/*! ./utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts"),y=n(/*! ./utils/logger */"./src/utils/logger.ts");function b(){return(b=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){C(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:r.default,bufferController:l.default,capLevelController:u.default,fpsController:h.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:v.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},{cueHandler:m.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:o.SubtitleStreamController,subtitleTrackController:s.default,timelineController:c.TimelineController,audioStreamController:i.default,audioTrackController:a.default,emeController:d.default,cmcdController:f.default});function w(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return b({},t,e)}function k(t){var e=t.loader;e!==g.default&&e!==p.default?(y.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):Object(g.fetchSupported)()&&(t.loader=g.default,t.progressive=!0,t.enableSoftwareAES=!0,y.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":
/*!******************************************!*\
!*** ./src/controller/abr-controller.ts ***!
\******************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/ewma-bandwidth-estimator */"./src/utils/ewma-bandwidth-estimator.ts"),a=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=n(/*! ../errors */"./src/errors.ts"),l=n(/*! ../types/loader */"./src/types/loader.ts"),c=n(/*! ../utils/logger */"./src/utils/logger.ts");function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var h=function(){function t(t){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;var e=t.config;this.bwEstimator=new i.default(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}var e,n,h,d=t.prototype;return d.registerListeners=function(){var t=this.hls;t.on(a.Events.FRAG_LOADING,this.onFragLoading,this),t.on(a.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(a.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var t=this.hls;t.off(a.Events.FRAG_LOADING,this.onFragLoading,this),t.off(a.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(a.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.onFragLoading=function(t,e){var n,r=e.frag;r.type===l.PlaylistLevelType.MAIN&&(this.timer||(this.fragCurrent=r,this.partCurrent=null!=(n=e.part)?n:null,this.timer=self.setInterval(this.onCheck,100)))},d.onLevelLoaded=function(t,e){var n=this.hls.config;e.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var t=this.fragCurrent,e=this.partCurrent,n=this.hls,i=n.autoLevelEnabled,s=n.config,l=n.media;if(t&&l){var u=e?e.stats:t.stats,h=e?e.duration:t.duration;if(u.aborted)return c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);if(i&&!l.paused&&l.playbackRate&&l.readyState){var d=performance.now()-u.loading.start,f=Math.abs(l.playbackRate);if(!(d<=500*h/f)){var p=n.levels,g=n.minAutoLevel,m=p[t.level],v=u.total||Math.max(u.loaded,Math.round(h*m.maxBitrate/8)),y=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),b=(v-u.loaded)/y,x=l.currentTime,S=(o.BufferHelper.bufferInfo(l,x,s.maxBufferHole).end-x)/f;if(!(S>=2*h/f||b<=S)){var C,E=Number.POSITIVE_INFINITY;for(C=t.level-1;C>g&&!((E=h*p[C].maxBitrate/(6.4*y))<S);C--);if(!(E>=b)){var w=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+C+"\n Current BW estimate: "+(Object(r.isFiniteNumber)(w)?(w/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+b.toFixed(3)+" s\n Estimated load time for the next fragment: "+E.toFixed(3)+" s\n Time to underbuffer: "+S.toFixed(3)+" s"),n.nextLoadLevel=C,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),n.trigger(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:u})}}}}}},d.onFragLoaded=function(t,e){var n=e.frag,i=e.part;if(n.type===l.PlaylistLevelType.MAIN&&Object(r.isFiniteNumber)(n.sn)){var o=i?i.stats:n.stats,s=i?i.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var c=this.hls.levels[n.level],u=(c.loaded?c.loaded.bytes:0)+o.loaded,h=(c.loaded?c.loaded.duration:0)+s;c.loaded={bytes:u,duration:h},c.realBitrate=Math.round(8*u/h)}if(n.bitrateTest){var d={stats:o,frag:n,part:i,id:n.type};this.onFragBuffered(a.Events.FRAG_BUFFERED,d),n.bitrateTest=!1}}},d.onFragBuffered=function(t,e){var n=e.frag,r=e.part,i=r?r.stats:n.stats;if(!i.aborted&&n.type===l.PlaylistLevelType.MAIN&&"initSegment"!==n.sn){var a=i.parsing.end-i.loading.start;this.bwEstimator.sample(a,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},d.onError=function(t,e){switch(e.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,n=this.hls,r=n.maxAutoLevel,i=n.config,a=n.minAutoLevel,s=n.media,l=e?e.duration:t?t.duration:0,u=s?s.currentTime:0,h=s&&0!==s.playbackRate?Math.abs(s.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,f=(o.BufferHelper.bufferInfo(s,u,i.maxBufferHole).end-u)/h,p=this.findBestLevel(d,a,r,f,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(p>=0)return p;c.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=l?Math.min(l,i.maxStarvationDelay):i.maxStarvationDelay,m=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(!f){var y=this.bitrateTestDelay;y&&(g=(l?Math.min(l,i.maxLoadingDelay):i.maxLoadingDelay)-y,c.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),m=v=1)}return p=this.findBestLevel(d,a,r,f+g,m,v),Math.max(p,0)},d.findBestLevel=function(t,e,n,r,i,a){for(var o,s=this.fragCurrent,l=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,d=h[u],f=!(null==d||null===(o=d.details)||void 0===o||!o.live),p=null==d?void 0:d.codecSet,g=l?l.duration:s?s.duration:0,m=n;m>=e;m--){var v=h[m];if(v&&(!p||v.codecSet===p)){var y=v.details,b=(l?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||g,x=void 0;x=m<=u?i*t:a*t;var S=h[m].maxBitrate,C=S*b/x;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+m+"/"+Math.round(x)+"/"+S+"/"+b+"/"+r+"/"+C),x>S&&(!C||f&&!this.bitrateTestDelay||C<r))return m}}return-1},e=t,(n=[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this.bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var n=this.getNextABRAutoLevel();return-1!==t&&(n=Math.min(t,n)),n},set:function(t){this._nextAutoLevel=t}}])&&u(e.prototype,n),h&&u(e,h),t}();e.default=h},"./src/controller/audio-stream-controller.ts":
/*!***************************************************!*\
!*** ./src/controller/audio-stream-controller.ts ***!
\***************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),a=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),l=n(/*! ../types/level */"./src/types/level.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=n(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts"),d=n(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),f=n(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),p=n(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),g=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),m=n(/*! ../errors */"./src/errors.ts"),v=n(/*! ../utils/logger */"./src/utils/logger.ts");function y(){return(y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var x=function(t){var e,n;function x(e,n){var r;return(r=t.call(this,e,n,"[audio-stream-controller]")||this).videoBuffer=null,r.videoTrackCC=-1,r.waitingVideoCC=-1,r.audioSwitch=!1,r.trackId=-1,r.waitingData=null,r.mainDetails=null,r.bufferFlushed=!1,r._registerListeners(),r}n=t,(e=x).prototype=Object.create(n.prototype),e.prototype.constructor=e,b(e,n);var S=x.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var t=this.hls;t.on(a.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(a.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(a.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(a.Events.ERROR,this.onError,this),t.on(a.Events.BUFFER_RESET,this.onBufferReset,this),t.on(a.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(a.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(a.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(a.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var t=this.hls;t.off(a.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(a.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(a.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(a.Events.ERROR,this.onError,this),t.off(a.Events.BUFFER_RESET,this.onBufferReset,this),t.off(a.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(a.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(a.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(a.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onInitPtsFound=function(t,e){var n=e.frag,r=e.id,a=e.initPTS;if("main"===r){var o=n.cc;this.initPTS[n.cc]=a,this.log("InitPTS for cc: "+o+" found from main: "+a),this.videoTrackCC=o,this.state===i.State.WAITING_INIT_PTS&&this.tick()}},S.startLoad=function(t){if(!this.levels)return this.startPosition=t,void(this.state=i.State.STOPPED);var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=i.State.IDLE):(this.loadedmetadata=!1,this.state=i.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},S.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_TRACK:var e,n=this.levels,r=this.trackId,a=null==n||null===(e=n[r])||void 0===e?void 0:e.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=i.State.WAITING_INIT_PTS}break;case i.State.FRAG_LOADING_WAITING_RETRY:var s,l=performance.now(),c=this.retryDate;(!c||l>=c||null!==(s=this.media)&&void 0!==s&&s.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=i.State.IDLE);break;case i.State.WAITING_INIT_PTS:var u=this.waitingData;if(u){var h=u.frag,d=u.part,f=u.cache,g=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.FRAG_LOADING;var m={frag:h,part:d,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(m),g&&t.prototype._handleFragmentLoadComplete.call(this,m)}else if(this.videoTrackCC!==this.waitingVideoCC)v.logger.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var y=this.getLoadPosition(),b=o.BufferHelper.bufferInfo(this.mediaBuffer,y,this.config.maxBufferHole);Object(p.fragmentWithinToleranceTest)(b.end,this.config.maxFragLookUpTolerance,h)<0&&(v.logger.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+b.end+" is needed"),this.clearWaitingFragment())}}else this.state=i.State.IDLE}this.onTickEnd()},S.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.IDLE)},S.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},S.doTickIdle=function(){var t,e,n=this.hls,r=this.levels,o=this.media,s=this.trackId,l=n.config;if(r&&r[s]&&(o||!this.startFragRequested&&l.startFragPrefetch)){var h=r[s].details;if(!h||h.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(h))this.state=i.State.WAITING_TRACK;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var d=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,c.PlaylistLevelType.AUDIO);if(null!==d){var f=d.len,p=this.getMaxBufferLength(),g=this.audioSwitch;if(!(f>=p)||g){if(!g&&this._streamEnded(d,h))return n.trigger(a.Events.BUFFER_EOS,{type:"audio"}),void(this.state=i.State.ENDED);var m=h.fragments[0].start,v=d.end;if(g){var y=this.getLoadPosition();v=y,h.PTSKnown&&y<m&&(d.end>m||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=m+.05)}var b=this.getNextFragment(v,h);b?"identity"!==(null===(t=b.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=b.decryptdata)&&void 0!==e&&e.key?this.loadFragment(b,h,v):this.loadKey(b,h):this.bufferFlushed=!0}}}}},S.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),n=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return null===n?e:Math.max(e,n.len)},S.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(t,e){var n=e.audioTracks;this.resetTransmuxer(),this.levels=n.map((function(t){return new l.Level(t)}))},S.onAudioTrackSwitching=function(t,e){var n=!!e.url;this.trackId=e.id;var r=this.fragCurrent;null!=r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),n?this.setInterval(100):this.resetTransmuxer(),n?(this.audioSwitch=!0,this.state=i.State.IDLE):this.state=i.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(t,e){this.mainDetails=e.details},S.onAudioTrackLoaded=function(t,e){var n,r=this.levels,a=e.details,o=e.id;if(r){this.log("Track "+o+" loaded ["+a.startSN+","+a.endSN+"],duration:"+a.totalduration);var s=r[o],l=0;if(a.live||null!==(n=s.details)&&void 0!==n&&n.live){var c=this.mainDetails;if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed||!c)return;!s.details&&a.hasProgramDateTime&&c.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(a,c),l=a.fragments[0].start):l=this.alignPlaylists(a,s.details)}s.details=a,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(s.details,l),this.state!==i.State.WAITING_TRACK||this.waitForCdnTuneIn(a)||(this.state=i.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+o)},S._handleFragmentLoadProgress=function(t){var e,n=t.frag,r=t.part,a=t.payload,o=this.config,s=this.trackId,l=this.levels;if(l){var u=l[s];console.assert(u,"Audio track is defined on fragment load progress");var p=u.details;console.assert(p,"Audio track details are defined on fragment load progress");var g=o.defaultAudioCodec||u.audioCodec||"mp4a.40.2",m=this.transmuxer;m||(m=this.transmuxer=new d.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[n.cc],b=null===(e=n.initSegment)||void 0===e?void 0:e.data;if(void 0!==y){var x=r?r.index:-1,S=-1!==x,C=new f.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,a.byteLength,x,S);m.push(a,b,g,"",n,r,p.totalduration,!1,C,y)}else v.logger.log("Unknown video PTS for cc "+n.cc+", waiting for video PTS before demuxing audio frag "+n.sn+" of ["+p.startSN+" ,"+p.endSN+"],track "+s),(this.waitingData=this.waitingData||{frag:n,part:r,cache:new h.default,complete:!1}).cache.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=i.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+n.sn+" of level "+n.level+" will not be buffered")},S._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(t,e){var n=e.tracks.audio;n&&(this.mediaBuffer=n.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},S.onFragBuffered=function(t,e){var n=e.frag,r=e.part;n.type===c.PlaylistLevelType.AUDIO&&(this.fragContextChanged(n)?this.warn("Fragment "+n.sn+(r?" p: "+r.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==n.sn&&(this.fragPrevious=n,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(a.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(n,r)))},S.onError=function(e,n){switch(n.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,n);break;case m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==i.State.ERROR&&this.state!==i.State.STOPPED&&(this.state=n.fatal?i.State.ERROR:i.State.IDLE,this.warn(n.details+" while loading frag, switching to "+this.state+" state"));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===n.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var r=!0,a=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);a&&a.len>.5&&(r=!this.reduceMaxBufferLength(a.len)),r&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},S.onBufferFlushed=function(t,e){e.type===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},S._handleTransmuxComplete=function(t){var e,n="audio",r=this.hls,o=t.remuxResult,s=t.chunkMeta,l=this.getCurrentContext(s);if(!l)return this.warn("The loading context changed while buffering fragment "+s.sn+" of level "+s.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(s.level);var c=l.frag,h=l.part,d=o.audio,f=o.text,p=o.id3,g=o.initSegment;if(!this.fragContextChanged(c)){if(this.state=i.State.PARSING,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,c,s),r.trigger(a.Events.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:n,tracks:g.tracks})),d){var m=d.startPTS,v=d.endPTS,b=d.startDTS,x=d.endDTS;h&&(h.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:m,endPTS:v,startDTS:b,endDTS:x}),c.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,m,v,b,x),this.bufferFragmentData(d,c,h,s)}if(null!=p&&null!==(e=p.samples)&&void 0!==e&&e.length){var S=y({frag:c,id:n},p);r.trigger(a.Events.FRAG_PARSING_METADATA,S)}if(f){var C=y({frag:c,id:n},f);r.trigger(a.Events.FRAG_PARSING_USERDATA,C)}}},S._bufferInitSegment=function(t,e,n){if(this.state===i.State.PARSING){t.video&&delete t.video;var r=t.audio;if(r){r.levelCodec=r.codec,r.id="audio",this.log("Init audio buffer, container:"+r.container+", codecs[parsed]=["+r.codec+"]"),this.hls.trigger(a.Events.BUFFER_CODECS,t);var o=r.initSegment;if(null!=o&&o.byteLength){var s={type:"audio",frag:e,part:null,chunkMeta:n,parent:e.type,data:o};this.hls.trigger(a.Events.BUFFER_APPENDING,s)}this.tick()}}},S.loadFragment=function(e,n,a){var o=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||o===s.FragmentState.NOT_LOADED||o===s.FragmentState.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):n.live&&!Object(r.isFiniteNumber)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=i.State.WAITING_INIT_PTS):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,n,a)))},S.completeAudioSwitch=function(){var e=this.hls,n=this.media,r=this.trackId;n&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(a.Events.AUDIO_TRACK_SWITCHED,{id:r})},x}(i.default);e.default=x},"./src/controller/audio-track-controller.ts":
/*!**************************************************!*\
!*** ./src/controller/audio-track-controller.ts ***!
\**************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../errors */"./src/errors.ts"),a=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),o=n(/*! ../types/loader */"./src/types/loader.ts");function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){var e,n;function a(e){var n;return(n=t.call(this,e,"[audio-track-controller]")||this).tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.trackName="",n.selectDefaultTrack=!0,n.registerListeners(),n}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n);var c,u,h,d=a.prototype;return d.registerListeners=function(){var t=this.hls;t.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(r.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(r.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var t=this.hls;t.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(r.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(r.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(t,e){this.tracks=e.audioTracks||[]},d.onAudioTrackLoaded=function(t,e){var n=e.id,r=e.details,i=this.tracksInGroup[n];if(i){var a=i.details;i.details=e.details,this.log("audioTrack "+n+" loaded ["+r.startSN+"-"+r.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,e,a))}else this.warn("Invalid audio track id "+n)},d.onLevelLoading=function(t,e){this.switchLevel(e.level)},d.onLevelSwitching=function(t,e){this.switchLevel(e.level)},d.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.audioGroupIds){var n=e.audioGroupIds[e.urlId];if(this.groupId!==n){this.groupId=n;var i=this.tracks.filter((function(t){return!n||t.groupId===n}));this.selectDefaultTrack&&!i.some((function(t){return t.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var a={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(r.Events.AUDIO_TRACKS_UPDATED,a),this.selectInitialTrack()}}},d.onError=function(e,n){t.prototype.onError.call(this,e,n),!n.fatal&&n.context&&n.context.type===o.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},d.setAudioTrack=function(t){var e=this.tracksInGroup;if(t<0||t>=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var n=e[this.trackId];this.log("Now switching to audio-track index "+t);var i=e[t],a=i.id,o=i.groupId,s=void 0===o?"":o,l=i.name,c=i.type,u=i.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(r.Events.AUDIO_TRACK_SWITCHING,{id:a,groupId:s,name:l,type:c,url:u}),!i.details||i.details.live){var h=this.switchParams(i.url,null==n?void 0:n.details);this.loadPlaylist(h)}}},d.selectInitialTrack=function(){var t=this.tracksInGroup;console.assert(t.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,n=this.findTrackId(e)||this.findTrackId();-1!==n?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(t){for(var e=this.tracksInGroup,n=0;n<e.length;n++){var r=e[n];if((!this.selectDefaultTrack||r.default)&&(!t||t===r.name))return r.id}return-1},d.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var n=e.id,i=e.groupId,a=e.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(r.Events.AUDIO_TRACK_LOADING,{url:a,id:n,groupId:i,deliveryDirectives:t||null})}},c=a,(u=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}])&&s(c.prototype,u),h&&s(c,h),a}(a.default);e.default=c},"./src/controller/base-playlist-controller.ts":
/*!****************************************************!*\
!*** ./src/controller/base-playlist-controller.ts ***!
\****************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return l}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../types/level */"./src/types/level.ts"),a=n(/*! ./level-helper */"./src/controller/level-helper.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../errors */"./src/errors.ts"),l=function(){function t(t,e){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=o.logger.log.bind(o.logger,e+":"),this.warn=o.logger.warn.bind(o.logger,e+":"),this.hls=t}var e=t.prototype;return e.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},e.onError=function(t,e){e.fatal&&e.type===s.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},e.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},e.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},e.stopLoad=function(){this.canLoad=!1,this.clearTimer()},e.switchParams=function(t,e){var n=null==e?void 0:e.renditionReports;if(n)for(var a=0;a<n.length;a++){var o=n[a],s=""+o.URI;if(s===t.substr(-s.length)){var l=parseInt(o["LAST-MSN"]),c=parseInt(o["LAST-PART"]);if(e&&this.hls.config.lowLatencyMode){var u=Math.min(e.age-e.partTarget,e.targetduration);void 0!==c&&u>e.partTarget&&(c+=1)}if(Object(r.isFiniteNumber)(l))return new i.HlsUrlParameters(l,Object(r.isFiniteNumber)(c)?c:void 0,i.HlsSkip.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,n){var r=this,i=e.details,o=e.stats,s=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(i.advancedDateTime=Date.now()-s,i.live||null!=n&&n.live){if(i.reloaded(n),n&&this.log("live playlist "+t+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),n&&i.fragments.length>0&&Object(a.mergeDetails)(n,i),!this.canLoad||!i.live)return;var l,c=void 0,u=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var h=this.hls.config.lowLatencyMode,d=i.lastPartSn,f=i.endSN,p=i.lastPartIndex,g=d===f;-1!==p?(c=g?f+1:d,u=g?h?0:p:p+1):c=f+1;var m=i.age,v=m+i.ageHeader,y=Math.min(v-i.partTarget,1.5*i.targetduration);if(y>0){if(n&&y>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var b=Math.floor(y/i.targetduration);c+=b,void 0!==u&&(u+=Math.round(y%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+m.toFixed(2)+"s goal: "+y+" skip sn "+b+" to part "+u)}i.tuneInGoal=y}if(l=this.getDeliveryDirectives(i,e.deliveryDirectives,c,u),h||!g)return void this.loadPlaylist(l)}else l=this.getDeliveryDirectives(i,e.deliveryDirectives,c,u);var x=Object(a.computeReloadInterval)(i,o);void 0!==c&&i.canBlockReload&&(x-=i.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout((function(){return r.loadPlaylist(l)}),x)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,n,r){var a=Object(i.getSkipValue)(t,n);return null!=e&&e.skip&&t.deltaUpdateFailed&&(n=e.msn,r=e.part,a=i.HlsSkip.No),new i.HlsUrlParameters(n,r,a)},e.retryLoadingOrFail=function(t){var e,n=this,r=this.hls.config,i=this.retryCount<r.levelLoadingMaxRetry;if(i)if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return n.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return i},t}()},"./src/controller/base-stream-controller.ts":
/*!**************************************************!*\
!*** ./src/controller/base-stream-controller.ts ***!
\**************************************************/
/*! exports provided: State, default */function(t,e,n){"use strict";n.r(e),n.d(e,"State",(function(){return S})),n.d(e,"default",(function(){return C}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../task-loop */"./src/task-loop.ts"),a=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),l=n(/*! ../events */"./src/events.ts"),c=n(/*! ../errors */"./src/errors.ts"),u=n(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),h=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),d=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),f=n(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),p=n(/*! ./level-helper */"./src/controller/level-helper.ts"),g=n(/*! ../loader/fragment-loader */"./src/loader/fragment-loader.ts"),m=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),v=n(/*! ../utils/time-ranges */"./src/utils/time-ranges.ts"),y=n(/*! ../types/loader */"./src/types/loader.ts");function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e){return(x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var S={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},C=function(t){var e,n;function i(e,n,r){var i;return(i=t.call(this)||this).hls=void 0,i.fragPrevious=null,i.fragCurrent=null,i.fragmentTracker=void 0,i.transmuxer=null,i._state=S.STOPPED,i.media=void 0,i.mediaBuffer=void 0,i.config=void 0,i.bitrateTest=!1,i.lastCurrentTime=0,i.nextLoadPosition=0,i.startPosition=0,i.loadedmetadata=!1,i.fragLoadError=0,i.retryDate=0,i.levels=null,i.fragmentLoader=void 0,i.levelLastLoaded=null,i.startFragRequested=!1,i.decrypter=void 0,i.initPTS=[],i.onvseeking=null,i.onvended=null,i.logPrefix="",i.log=void 0,i.warn=void 0,i.logPrefix=r,i.log=s.logger.log.bind(s.logger,r+":"),i.warn=s.logger.warn.bind(s.logger,r+":"),i.hls=e,i.fragmentLoader=new g.default(e.config),i.fragmentTracker=n,i.config=e.config,i.decrypter=new m.default(e,e.config),e.on(l.Events.KEY_LOADED,i.onKeyLoaded,function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(i)),i}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,x(e,n);var C,E,w,k=i.prototype;return k.doTick=function(){this.onTickEnd()},k.onTickEnd=function(){},k.startLoad=function(t){},k.stopLoad=function(){this.fragmentLoader.abort();var t=this.fragCurrent;t&&this.fragmentTracker.removeFragment(t),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},k._streamEnded=function(t,e){var n=this.fragCurrent,r=this.fragmentTracker;if(!e.live&&n&&n.sn===e.endSN&&!t.nextStart){var i=r.getState(n);return i===a.FragmentState.PARTIAL||i===a.FragmentState.OK}return!1},k.onMediaAttached=function(t,e){var n=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(r.startPosition)},k.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},k.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,n=this.media,i=this.mediaBuffer,a=this.state,s=n?n.currentTime:0,l=o.BufferHelper.bufferInfo(i||n,s,t.maxBufferHole);if(this.log("media seeking to "+(Object(r.isFiniteNumber)(s)?s.toFixed(3):s)+", state: "+a),a===S.ENDED)this.resetLoadingState();else if(e&&!l.len){var c=t.maxFragLookUpTolerance,u=e.start-c,h=s>e.start+e.duration+c;(s<u||h)&&(h&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.loader.abort()),this.resetLoadingState())}n&&(this.lastCurrentTime=s),this.loadedmetadata||l.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()},k.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},k.onKeyLoaded=function(t,e){if(this.state===S.KEY_LOADING&&e.frag===this.fragCurrent&&this.levels){this.state=S.IDLE;var n=this.levels[e.frag.level].details;n&&this.loadFragment(e.frag,n,e.frag.start)}},k.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},k.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(l.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},k.loadKey=function(t,e){this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=S.KEY_LOADING,this.fragCurrent=t,this.hls.trigger(l.Events.KEY_LOADING,{frag:t})},k.loadFragment=function(t,e,n){this._loadFragForPlayback(t,e,n)},k._loadFragForPlayback=function(t,e,n){var r=this;this._doFragLoad(t,e,n,(function(e){if(r.fragContextChanged(t))return r.warn("Fragment "+t.sn+(e.part?" p: "+e.part.index:"")+" of level "+t.level+" was dropped during download."),void r.fragmentTracker.removeFragment(t);t.stats.chunkCount++,r._handleFragmentLoadProgress(e)})).then((function(e){if(e){r.fragLoadError=0;var n=r.state;if(!r.fragContextChanged(t))return"payload"in e&&(r.log("Loaded fragment "+t.sn+" of level "+t.level),r.hls.trigger(l.Events.FRAG_LOADED,e),r.state===S.BACKTRACKING)?(r.fragmentTracker.backtrack(t,e),void r.resetFragmentLoading(t)):void r._handleFragmentLoadComplete(e);(n===S.FRAG_LOADING||n===S.BACKTRACKING||!r.fragCurrent&&n===S.PARSING)&&(r.fragmentTracker.removeFragment(t),r.state=S.IDLE)}})).catch((function(e){r.warn(e),r.resetFragmentLoading(t)}))},k.flushMainBuffer=function(t,e,n){if(void 0===n&&(n=null),t-e){var r={startOffset:t,endOffset:e,type:n};this.fragLoadError=0,this.hls.trigger(l.Events.BUFFER_FLUSHING,r)}},k._loadInitSegment=function(t){var e=this;this._doFragLoad(t).then((function(n){if(!n||e.fragContextChanged(t)||!e.levels)throw new Error("init load aborted");return n})).then((function(n){var r=e.hls,i=n.payload,a=t.decryptdata;if(i&&i.byteLength>0&&a&&a.key&&a.iv&&"AES-128"===a.method){var o=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(i),a.key.buffer,a.iv.buffer).then((function(e){var i=self.performance.now();return r.trigger(l.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:i}}),n.payload=e,n}))}return n})).then((function(n){var r=e.fragCurrent,i=e.hls,a=e.levels;if(!a)throw new Error("init load aborted, missing levels");var o=a[t.level].details;console.assert(o,"Level details are defined when init segment is loaded");var s=t.stats;e.state=S.IDLE,e.fragLoadError=0,t.data=new Uint8Array(n.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),n.frag===r&&i.trigger(l.Events.FRAG_BUFFERED,{stats:s,frag:r,part:null,id:t.type}),e.tick()})).catch((function(n){e.warn(n),e.resetFragmentLoading(t)}))},k.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},k.fragBufferedComplete=function(t,e){var n=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+v.default.toString(o.BufferHelper.getBuffered(n))),this.state=S.IDLE,this.tick()},k._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var n=t.frag,r=t.part,i=t.partsLoaded,a=!i||0===i.length||i.some((function(t){return!t})),o=new u.ChunkMetadata(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!a);e.flush(o)}},k._handleFragmentLoadProgress=function(t){},k._doFragLoad=function(t,e,n,i){var a=this;if(void 0===n&&(n=null),!this.levels)throw new Error("frag load aborted, missing levels");if(n=Math.max(t.start,n||0),this.config.lowLatencyMode&&e){var o=e.partList;if(o&&i){n>t.end&&e.fragmentHint&&(t=e.fragmentHint);var s=this.getNextPart(o,t,n);if(s>-1){var c=o[s];return this.log("Loading part sn: "+t.sn+" p: "+c.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+s+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(n.toFixed(3))),this.nextLoadPosition=c.start+c.duration,this.state=S.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:t,part:o[s],targetBufferTime:n}),this.doFragPartsLoad(t,o,s,i).catch((function(t){return a.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(o,n))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(n.toFixed(3))),Object(r.isFiniteNumber)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=S.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:t,targetBufferTime:n}),this.fragmentLoader.load(t,i).catch((function(t){return a.handleFragLoadError(t)}))},k.doFragPartsLoad=function(t,e,n,r){var i=this;return new Promise((function(a,o){var s=[];!function n(c){var u=e[c];i.fragmentLoader.loadPart(t,u,r).then((function(r){s[u.index]=r;var o=r.part;i.hls.trigger(l.Events.FRAG_LOADED,r);var h=e[c+1];if(!h||h.fragment!==t)return a({frag:t,part:o,partsLoaded:s});n(c+1)})).catch(o)}(n)}))},k.handleFragLoadError=function(t){var e=t.data;return e&&e.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(l.Events.ERROR,e),null},k._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===S.PARSING){var n=e.frag,r=e.part,i=e.level,a=self.performance.now();n.stats.parsing.end=a,r&&(r.stats.parsing.end=a),this.updateLevelTiming(n,r,i,t.partial)}else this.fragCurrent||(this.state=S.IDLE)},k.getCurrentContext=function(t){var e=this.levels,n=t.level,r=t.sn,i=t.part;if(!e||!e[n])return this.warn("Levels object was unset while buffering fragment "+r+" of level "+n+". The current chunk will not be buffered."),null;var a=e[n],o=i>-1?Object(p.getPartWith)(a,r,i):null,s=o?o.fragment:Object(p.getFragmentWithSN)(a,r,this.fragCurrent);return s?{frag:s,part:o,level:a}:null},k.bufferFragmentData=function(t,e,n,r){if(t&&this.state===S.PARSING){var i=t.data1,a=t.data2,o=i;if(i&&a&&(o=Object(h.appendUint8Array)(i,a)),o&&o.length){var s={type:t.type,frag:e,part:n,chunkMeta:r,parent:e.type,data:o};this.hls.trigger(l.Events.BUFFER_APPENDING,s),t.dropped&&t.independent&&!n&&this.flushBufferGap(e)}}},k.flushBufferGap=function(t){var e=this.media;if(e)if(o.BufferHelper.isBuffered(e,e.currentTime)){var n=e.currentTime,r=o.BufferHelper.bufferInfo(e,n,0),i=t.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),s=Math.max(Math.min(t.start-a,r.end-a),n+a);t.start-s>a&&this.flushMainBuffer(s,t.start)}else this.flushMainBuffer(0,t.start)},k.getFwdBufferInfo=function(t,e){var n=this.config,i=this.getLoadPosition();if(!Object(r.isFiniteNumber)(i))return null;var a=o.BufferHelper.bufferInfo(t,i,n.maxBufferHole);if(0===a.len&&void 0!==a.nextStart){var s=this.fragmentTracker.getBufferedFrag(i,e);if(s&&a.nextStart<s.end)return o.BufferHelper.bufferInfo(t,i,Math.max(a.nextStart,n.maxBufferHole))}return a},k.getMaxBufferLength=function(t){var e,n=this.config;return e=t?Math.max(8*n.maxBufferSize/t,n.maxBufferLength):n.maxBufferLength,Math.min(e,n.maxMaxBufferLength)},k.reduceMaxBufferLength=function(t){var e=this.config,n=t||e.maxBufferLength;return e.maxMaxBufferLength>=n&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},k.getNextFragment=function(t,e){var n,r,i=e.fragments,a=i.length;if(!a)return null;var o,s=this.config,l=i[0].start;if(e.live){var c=s.initialLiveManifestSize;if(a<c)return this.warn("Not enough fragments to start playback (have: "+a+", need: "+c+")"),null;e.PTSKnown||this.startFragRequested||-1!==this.startPosition||(o=this.getInitialLiveFragment(e,i),this.startPosition=o?this.hls.liveSyncPosition||o.start:t)}else t<=l&&(o=i[0]);if(!o){var u=s.lowLatencyMode?e.partEnd:e.fragmentEnd;o=this.getFragmentAtPosition(t,u,e)}return null===(n=o)||void 0===n||!n.initSegment||null!==(r=o)&&void 0!==r&&r.initSegment.data||this.bitrateTest||(o=o.initSegment),o},k.getNextPart=function(t,e,n){for(var r=-1,i=!1,a=!0,o=0,s=t.length;o<s;o++){var l=t[o];if(a=a&&!l.independent,r>-1&&n<l.start)break;var c=l.loaded;!c&&(i||l.independent||a)&&l.fragment===e&&(r=o),i=c}return r},k.loadedEndOfParts=function(t,e){var n=t[t.length-1];return n&&e>n.start&&n.loaded},k.getInitialLiveFragment=function(t,e){var n=this.fragPrevious,r=null;if(n){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+n.programDateTime),r=Object(f.findFragmentByPDT)(e,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var i=n.sn+1;if(i>=t.startSN&&i<=t.endSN){var a=e[i-t.startSN];n.cc===a.cc&&(r=a,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=Object(f.findFragWithCC)(e,n.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+r.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(r=this.getFragmentAtPosition(o,this.bitrateTest?t.fragmentEnd:t.edge,t))}return r},k.getFragmentAtPosition=function(t,e,n){var r,i=this.config,o=this.fragPrevious,s=n.fragments,l=n.endSN,c=n.fragmentHint,u=i.maxFragLookUpTolerance,h=!!(i.lowLatencyMode&&n.partList&&c);if(h&&c&&!this.bitrateTest&&(s=s.concat(c),l=c.sn),t<e){var d=t>e-u?0:u;r=Object(f.findFragmentByPTS)(o,s,t,d)}else r=s[s.length-1];if(r){var p=r.sn-n.startSN,g=o&&r.level===o.level,m=s[p+1];if(this.fragmentTracker.getState(r)===a.FragmentState.BACKTRACKED){r=null;for(var v=p;s[v]&&this.fragmentTracker.getState(s[v])===a.FragmentState.BACKTRACKED;)r=o?s[v--]:s[--v];r||(r=m)}else o&&r.sn===o.sn&&!h&&g&&(r.sn<l&&this.fragmentTracker.getState(m)!==a.FragmentState.OK?(this.log("SN "+r.sn+" just loaded, load next one: "+m.sn),r=m):r=null)}return r},k.synchronizeToLiveEdge=function(t){var e=this.config,n=this.media;if(n){var r=this.hls.liveSyncPosition,i=n.currentTime,a=t.fragments[0].start,o=t.edge,s=i>=a-e.maxFragLookUpTolerance&&i<=o;if(null!==r&&n.duration>r&&(i<r||!s)){var l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!s&&n.readyState<4||i<o-l)&&(this.loadedmetadata||(this.nextLoadPosition=r),n.readyState&&(this.warn("Playback: "+i.toFixed(3)+" is located too far from the end of live sliding playlist: "+o+", reset currentTime to : "+r.toFixed(3)),n.currentTime=r))}}},k.alignPlaylists=function(t,e){var n=this.levels,i=this.levelLastLoaded,a=this.fragPrevious,o=null!==i?n[i]:null,s=t.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;var l=t.fragments[0].start,c=!e,u=t.alignedSliding&&Object(r.isFiniteNumber)(l);if(c||!u&&!l){Object(d.alignStream)(a,o,t);var h=t.fragments[0].start;return this.log("Live playlist sliding: "+h.toFixed(2)+" start-sn: "+(e?e.startSN:"na")+"->"+t.startSN+" prev-sn: "+(a?a.sn:"na")+" fragments: "+s),h}return l},k.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},k.setStartPosition=function(t,e){var n=this.startPosition;if(n<e&&(n=-1),-1===n||-1===this.lastCurrentTime){var i=t.startTimeOffset;Object(r.isFiniteNumber)(i)?(n=e+i,i<0&&(n+=t.totalduration),n=Math.min(Math.max(e,n),e+t.totalduration),this.log("Start time offset "+i+" found in playlist, adjust startPosition to "+n),this.startPosition=n):t.live?n=this.hls.liveSyncPosition||e:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n},k.getLoadPosition=function(){var t=this.media,e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e},k.handleFragLoadAborted=function(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn("Fragment "+t.sn+(e?" part"+e.index:"")+" of level "+t.level+" was aborted"),this.resetFragmentLoading(t))},k.resetFragmentLoading=function(t){this.fragCurrent&&this.fragContextChanged(t)||(this.state=S.IDLE)},k.onFragmentOrKeyLoadError=function(t,e){if(!e.fatal){var n=e.frag;if(n&&n.type===t){var r=this.fragCurrent;console.assert(r&&n.sn===r.sn&&n.level===r.level&&n.urlId===r.urlId,"Frag load error must match current frag to retry");var i=this.config;if(this.fragLoadError+1<=i.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(n.level))return;var a=Math.min(Math.pow(2,this.fragLoadError)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);this.warn("Fragment "+n.sn+" of "+t+" "+n.level+" failed to load, retrying in "+a+"ms"),this.retryDate=self.performance.now()+a,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else e.levelRetry?(t===y.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(s.logger.error(e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)}}},k.afterBufferFlushed=function(t,e,n){if(t){var r=o.BufferHelper.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,n),this.state===S.ENDED&&this.resetLoadingState()}},k.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},k.resetLiveStartWhenNotLoaded=function(t){if(!this.loadedmetadata){this.startFragRequested=!1;var e=this.levels?this.levels[t].details:null;if(null!=e&&e.live)return this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},k.updateLevelTiming=function(t,e,n,r){var i=this,a=n.details;console.assert(!!a,"level.details must be defined"),Object.keys(t.elementaryStreams).reduce((function(e,o){var s=t.elementaryStreams[o];if(s){var c=s.endPTS-s.startPTS;if(c<=0)return i.warn("Could not parse fragment "+t.sn+" "+o+" duration reliably ("+c+") resetting transmuxer to fallback to playlist timing"),i.resetTransmuxer(),e||!1;var u=r?0:Object(p.updateFragPTSDTS)(a,t,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return i.hls.trigger(l.Events.LEVEL_PTS_UPDATED,{details:a,level:n,drift:u,type:o,frag:t,start:s.startPTS,end:s.endPTS}),!0}return e}),!1)?(this.state=S.PARSED,this.hls.trigger(l.Events.FRAG_PARSED,{frag:t,part:e})):this.resetLoadingState()},k.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C=i,(E=[{key:"state",get:function(){return this._state},set:function(t){var e=this._state;e!==t&&(this._state=t,this.log(e+"->"+t))}}])&&b(C.prototype,E),w&&b(C,w),i}(i.default)},"./src/controller/buffer-controller.ts":
/*!*********************************************!*\
!*** ./src/controller/buffer-controller.ts ***!
\*********************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return f}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! ../errors */"./src/errors.ts"),s=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=n(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),u=n(/*! ./buffer-operation-queue */"./src/controller/buffer-operation-queue.ts"),h=Object(l.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function t(t){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=e.hls,n=e.media,r=e.mediaSource;a.logger.log("[buffer-controller]: Media source opened"),n&&(e.updateMediaElementDuration(),t.trigger(i.Events.MEDIA_ATTACHED,{media:n})),r&&r.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){a.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){a.logger.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(i.Events.BUFFER_RESET,this.onBufferReset,this),t.on(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(i.Events.BUFFER_EOS,this.onBufferEos,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(i.Events.FRAG_PARSED,this.onFragParsed,this),t.on(i.Events.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(i.Events.BUFFER_RESET,this.onBufferReset,this),t.off(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(i.Events.BUFFER_EOS,this.onBufferEos,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(i.Events.FRAG_PARSED,this.onFragParsed,this),t.off(i.Events.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var n=2;(e.audio&&!e.video||!e.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,a.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var n=this.media=e.media;if(n&&h){var r=this.mediaSource=new h;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(r),this._objectUrl=n.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,n=this._objectUrl;if(e){if(a.logger.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){a.logger.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(n&&self.URL.revokeObjectURL(n),t.src===n?(t.removeAttribute("src"),t.load()):a.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(i.Events.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var n=t.sourceBuffer[e];try{n&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(n),t.sourceBuffer[e]=void 0)}catch(t){a.logger.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var n=this,r=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(r){var i=n.tracks[t];if(i&&"function"==typeof i.buffer.changeType){var a=e[t],o=a.codec,s=a.levelCodec,l=a.container;if((i.levelCodec||i.codec).replace(d,"$1")!==(s||o).replace(d,"$1")){var c=l+";codecs="+(s||o);n.appendChangeType(t,c)}}}else n.pendingTracks[t]=e[t]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var n=this,r=this.operationQueue,i={execute:function(){var i=n.sourceBuffer[t];i&&(a.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),i.changeType(e)),r.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){a.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};r.append(i,t)},e.onBufferAppending=function(t,e){var n=this,r=this.hls,l=this.operationQueue,c=this.tracks,u=e.data,h=e.type,d=e.frag,f=e.part,p=e.chunkMeta,g=p.buffering[h],m=self.performance.now();g.start=m;var v=d.stats.buffering,y=f?f.stats.buffering:null;0===v.start&&(v.start=m),y&&0===y.start&&(y.start=m);var b=c.audio,x="audio"===h&&1===p.id&&"audio/mpeg"===(null==b?void 0:b.container),S={execute:function(){if(g.executeStart=self.performance.now(),x){var t=n.sourceBuffer[h];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(a.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}n.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===v.first&&(v.first=t),y&&0===y.first&&(y.first=t);var e=n.sourceBuffer,r={};for(var a in e)r[a]=s.BufferHelper.getBuffered(e[a]);n.appendError=0,n.hls.trigger(i.Events.BUFFER_APPENDED,{type:h,frag:d,part:f,chunkMeta:p,parent:d.type,timeRanges:r})},onError:function(t){a.logger.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",t);var e={type:o.ErrorTypes.MEDIA_ERROR,parent:d.type,details:o.ErrorDetails.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=o.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,e.details=o.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>r.config.appendErrorMaxRetry&&(a.logger.error("[buffer-controller]: Failed "+r.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),r.trigger(i.Events.ERROR,e)}};l.append(S,h)},e.onBufferFlushing=function(t,e){var n=this,r=this.operationQueue,o=function(t){return{execute:n.removeExecutor.bind(n,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(i.Events.BUFFER_FLUSHED,{type:t})},onError:function(e){a.logger.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?r.append(o(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){r.append(o(t),t)}))},e.onFragParsed=function(t,e){var n=this,r=e.frag,o=e.part,s=[],l=o?o.elementaryStreams:r.elementaryStreams;l[c.ElementaryStreamTypes.AUDIOVIDEO]?s.push("audiovideo"):(l[c.ElementaryStreamTypes.AUDIO]&&s.push("audio"),l[c.ElementaryStreamTypes.VIDEO]&&s.push("video")),0===s.length&&a.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers((function(){var t=self.performance.now();r.stats.buffering.end=t,o&&(o.stats.buffering.end=t);var e=o?o.stats:r.stats;n.hls.trigger(i.Events.FRAG_BUFFERED,{frag:r,part:o,stats:e,id:r.type})}),s)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var n=this;this.getSourceBufferTypes().reduce((function(t,r){var i=n.sourceBuffer[r];return e.type&&e.type!==r||i&&!i.ended&&(i.ended=!0,a.logger.log("[buffer-controller]: "+r+" sourceBuffer now EOS")),t&&!(i&&!i.ended)}),!0)&&this.blockBuffers((function(){var t=n.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var n=e.details;n.fragments.length&&(this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,n=this.media,a=this.sourceBuffer;if(n&&null!==e){var o=this.getSourceBufferTypes();if(o.length){var l=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(r.isFiniteNumber)(l)&&!(l<0)){var c=n.currentTime,u=e.levelTargetDuration,h=Math.max(l,u),d=Math.floor(c/u)*u-h;o.forEach((function(n){var r=a[n];if(r){var o=s.BufferHelper.getBuffered(r);o.length>0&&d>o.start(0)&&(t.trigger(i.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(i.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(i.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:n}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,n=this.media,i=this.mediaSource,o=t.fragments[0].start+t.totalduration,s=n.duration,l=Object(r.isFiniteNumber)(i.duration)?i.duration:0;t.live&&e.config.liveDurationInfinity?(a.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(t)):(o>l&&o>s||!Object(r.isFiniteNumber)(s))&&(a.logger.log("[buffer-controller]: Updating Media Source duration to "+o.toFixed(3)),i.duration=o)}},e.updateSeekableRange=function(t){var e=this.mediaSource,n=t.fragments;if(n.length&&t.live&&null!=e&&e.setLiveSeekableRange){var r=Math.max(0,n[0].start),i=Math.max(r,r+t.totalduration);e.setLiveSeekableRange(r,i)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,n=this.pendingTracks,r=Object.keys(n).length;if(r&&!t||2===r){this.createSourceBuffers(n),this.pendingTracks={};var a=this.getSourceBufferTypes();if(0===a.length)return void this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});a.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var r=0;for(var s in t)if(!e[s]){var l=t[s];if(!l)throw Error("source buffer exists for track "+s+", however track does not");var c=l.levelCodec||l.codec,u=l.container+";codecs="+c;a.logger.log("[buffer-controller]: creating sourceBuffer("+u+")");try{var h=e[s]=n.addSourceBuffer(u),d=s;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[s]={buffer:h,codec:c,container:l.container,levelCodec:l.levelCodec,id:l.id},r++}catch(t){a.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:u})}}r&&this.hls.trigger(i.Events.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){a.logger.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(t);n&&n.onError(e)},e.removeExecutor=function(t,e,n){var i=this.media,o=this.mediaSource,s=this.operationQueue,l=this.sourceBuffer[t];if(!i||!o||!l)return a.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(t);var c=Object(r.isFiniteNumber)(i.duration)?i.duration:1/0,u=Object(r.isFiniteNumber)(o.duration)?o.duration:1/0,h=Math.max(0,e),d=Math.min(n,c,u);d>h?(a.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+t+" SourceBuffer"),console.assert(!l.updating,t+" sourceBuffer must not be updating"),l.remove(h,d)):s.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var n=this.operationQueue,r=this.sourceBuffer[e];if(!r)return a.logger.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void n.shiftAndExecuteNext(e);r.ended=!1,console.assert(!r.updating,e+" sourceBuffer must not be updating"),r.appendBuffer(t)},e.blockBuffers=function(t,e){var n=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return a.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var r=this.operationQueue,i=e.map((function(t){return r.appendBlocker(t)}));Promise.all(i).then((function(){t(),e.forEach((function(t){var e=n.sourceBuffer[t];e&&e.updating||r.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,n){var r=this.sourceBuffer[t];if(r){var i=n.bind(this,t);this.listeners[t].push({event:e,listener:i}),r.addEventListener(e,i)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}()},"./src/controller/buffer-operation-queue.ts":
/*!**************************************************!*\
!*** ./src/controller/buffer-operation-queue.ts ***!
\**************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var n=this.queues[e];n.push(t),1===n.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,n=new Promise((function(t){e=t})),r={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,t),n},e.executeNext=function(t){var e=this.buffers,n=this.queues,i=e[t],a=n[t];if(a.length){var o=a[0];try{o.execute()}catch(e){r.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(e),i&&i.updating||(a.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}()},"./src/controller/cap-level-controller.ts":
/*!************************************************!*\
!*** ./src/controller/cap-level-controller.ts ***!
\************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../events */"./src/events.ts");function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(t){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e,n,a,o=t.prototype;return o.setStreamController=function(t){this.streamController=t},o.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},o.registerListeners=function(){var t=this.hls;t.on(r.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.unregisterListener=function(){var t=this.hls;t.off(r.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.onFpsDropLevelCapping=function(e,n){t.isLevelAllowed(n.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(n.droppedLevel)},o.onMediaAttaching=function(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null},o.onManifestParsed=function(t,e){var n=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,n.config.capLevelToPlayerSize&&e.video&&this.startCapping()},o.onBufferCodecs=function(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()},o.onMediaDetaching=function(){this.stopCapping()},o.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},o.getMaxLevel=function(e){var n=this,r=this.hls.levels;if(!r.length)return-1;var i=r.filter((function(r,i){return t.isLevelAllowed(i,n.restrictedLevels)&&i<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},o.startCapping=function(){this.timer||(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())},o.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},o.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var n=t.getBoundingClientRect();e.width=n.width,e.height=n.height,e.width||e.height||(e.width=n.right-n.left||t.width||0,e.height=n.bottom-n.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,n){if(!t||!t.length)return-1;for(var r,i,a=t.length-1,o=0;o<t.length;o+=1){var s=t[o];if((s.width>=e||s.height>=n)&&(r=s,!(i=t[o+1])||r.width!==i.width||r.height!==i.height)){a=o;break}}return a},e=t,a=[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(t){}return t}}],(n=[{key:"mediaWidth",get:function(){return this.getDimensions().width*t.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*t.contentScaleFactor}}])&&i(e.prototype,n),a&&i(e,a),t}();e.default=a},"./src/controller/cmcd-controller.ts":
/*!*******************************************!*\
!*** ./src/controller/cmcd-controller.ts ***!
\*******************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return d}));var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../types/cmcd */"./src/types/cmcd.ts"),a=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts");function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function c(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var d=function(){function t(e){var n=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(t){try{n.apply(t,{ot:i.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(t){o.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(t){try{var e=t.frag,r=n.hls.levels[e.level],a=n.getObjectType(e),s={d:1e3*e.duration,ot:a};a!==i.CMCDObjectType.VIDEO&&a!==i.CMCDObjectType.AUDIO&&a!=i.CMCDObjectType.MUXED||(s.br=r.bitrate/1e3,s.tb=n.getTopBandwidth(a),s.bl=n.getBufferLength(a)),n.apply(t,s)}catch(t){o.logger.warn("Could not generate segment CMCD data.",t)}},this.hls=e;var r=this.config=e.config,a=r.cmcd;null!=a&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||t.uuid(),this.cid=a.contentId,this.useHeaders=!0===a.useHeaders,this.registerListeners())}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(r.Events.BUFFER_CREATED,this.onBufferCreated,this)},e.unregisterListeners=function(){var t=this.hls;t.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(r.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},e.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},e.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},e.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},e.onBufferCreated=function(t,e){var n,r;this.audioBuffer=null===(n=e.tracks.audio)||void 0===n?void 0:n.buffer,this.videoBuffer=null===(r=e.tracks.video)||void 0===r?void 0:r.buffer},e.createData=function(){var t;return{v:i.CMCDVersion,sf:i.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(t=this.media)||void 0===t?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},e.apply=function(e,n){void 0===n&&(n={}),h(n,this.createData());var r=n.ot===i.CMCDObjectType.INIT||n.ot===i.CMCDObjectType.VIDEO||n.ot===i.CMCDObjectType.MUXED;if(this.starved&&r&&(n.bs=!0,n.su=!0,this.starved=!1),null==n.su&&(n.su=this.buffering),this.useHeaders){var a=t.toHeaders(n);if(!Object.keys(a).length)return;e.headers||(e.headers={}),h(e.headers,a)}else{var o=t.toQuery(n);if(!o)return;e.url=t.appendQueryToUri(e.url,o)}},e.getObjectType=function(t){var e=t.type;return"subtitle"===e?i.CMCDObjectType.TIMED_TEXT:"initSegment"===t.sn?i.CMCDObjectType.INIT:"audio"===e?i.CMCDObjectType.AUDIO:"main"===e?this.hls.audioTracks.length?i.CMCDObjectType.VIDEO:i.CMCDObjectType.MUXED:void 0},e.getTopBandwidth=function(t){for(var e,n=0,r=c(t===i.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels);!(e=r()).done;){var a=e.value;a.bitrate>n&&(n=a.bitrate)}return n>0?n:NaN},e.getBufferLength=function(t){var e=this.hls.media,n=t===i.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return n&&e?1e3*a.BufferHelper.bufferInfo(n,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,n=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new n(t)}var r=t.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(t,n,r){e(t),this.loader.load(t,n,r)},l(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,n=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new n(t)}var r=t.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(t,n,r){e(t),this.loader.load(t,n,r)},l(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,n=[],r=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},i=function(t){return Math.round(t)},a=function(t){return 100*i(t/100)},o={br:i,d:i,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:i},s=c(Object.keys(t||{}).sort());!(e=s()).done;){var l=e.value,u=t[l];if(r(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=o[l];h&&(u=h(u));var d=typeof u,f=void 0;f="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),n.push(f)}}return n.join(",")},t.toHeaders=function(e){for(var n={},r=["Object","Request","Session","Status"],i=[{},{},{},{}],a={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},o=0,s=Object.keys(e);o<s.length;o++){var l=s[o];i[null!=a[l]?a[l]:1][l]=e[l]}for(var c=0;c<i.length;c++){var u=t.serialize(i[c]);u&&(n["CMCD-"+r[c]]=u)}return n},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(t,e){if(!e)return t;var n=t.includes("?")?"&":"?";return""+t+n+e},t}()},"./src/controller/eme-controller.ts":
/*!******************************************!*\
!*** ./src/controller/eme-controller.ts ***!
\******************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../errors */"./src/errors.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! ../utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts");function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var l=function(){function t(t){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=t,this._config=t.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var e,n,l,c=t.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._registerListeners=function(){this.hls.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(t){switch(t){case o.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+t+'"')},c._attemptKeySystemAccess=function(t,e,n){var r=this,i=function(t,e,n,r){switch(t){case o.KeySystems.WIDEVINE:return function(t,e,n){var r={audioCapabilities:[],videoCapabilities:[]};return t.forEach((function(t){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:n.audioRobustness||""})})),e.forEach((function(t){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:n.videoRobustness||""})})),[r]}(e,n,r);default:throw new Error("Unknown key-system: "+t)}}(t,e,n,this._drmSystemOptions);a.logger.log("Requesting encrypted media key-system access");var s=this.requestMediaKeySystemAccess(t,i);this.mediaKeysPromise=s.then((function(e){return r._onMediaKeySystemAccessObtained(t,e)})),s.catch((function(e){a.logger.error('Failed to obtain key-system "'+t+'" access:',e)}))},c._onMediaKeySystemAccessObtained=function(t,e){var n=this;a.logger.log('Access for key-system "'+t+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:t};this._mediaKeysList.push(r);var i=Promise.resolve().then((function(){return e.createMediaKeys()})).then((function(e){return r.mediaKeys=e,a.logger.log('Media-keys created for key-system "'+t+'"'),n._onMediaKeysCreated(),e}));return i.catch((function(t){a.logger.error("Failed to create media-keys:",t)})),i},c._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach((function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),t._onNewMediaKeySession(e.mediaKeysSession))}))},c._onNewMediaKeySession=function(t){var e=this;a.logger.log("New key-system session "+t.sessionId),t.addEventListener("message",(function(n){e._onKeySessionMessage(t,n.message)}),!1)},c._onKeySessionMessage=function(t,e){a.logger.log("Got EME message event, creating license request"),this._requestLicense(e,(function(e){a.logger.log("Received license data (length: "+(e?e.byteLength:e)+"), updating key-session"),t.update(e)}))},c.onMediaEncrypted=function(t){var e=this;if(a.logger.log('Media is encrypted using "'+t.initDataType+'" init data type'),!this.mediaKeysPromise)return a.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});var n=function(n){e._media&&(e._attemptSetMediaKeys(n),e._generateRequestWithPreferredKeySession(t.initDataType,t.initData))};this.mediaKeysPromise.then(n).catch(n)},c._attemptSetMediaKeys=function(t){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return a.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});a.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(t,e){var n=this,o=this._mediaKeysList[0];if(!o)return a.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(o.mediaKeysSessionInitialized)a.logger.warn("Key-Session already initialized but requested again");else{var s=o.mediaKeysSession;if(!s)return a.logger.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!e)return a.logger.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});a.logger.log('Generating key-session request for "'+t+'" init data type'),o.mediaKeysSessionInitialized=!0,s.generateRequest(t,e).then((function(){a.logger.debug("Key-session generation succeeded")})).catch((function(t){a.logger.error("Error generating key-session request:",t),n.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},c._createLicenseXhr=function(t,e,n){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,t,e,n);var i=this._licenseXhrSetup;if(i)try{i.call(this.hls,r,t),i=void 0}catch(t){a.logger.error(t)}try{r.readyState||r.open("POST",t,!0),i&&i.call(this.hls,r,t)}catch(t){throw new Error("issue setting up KeySystem license XHR "+t)}return r},c._onLicenseRequestReadyStageChange=function(t,e,n,o){switch(t.readyState){case 4:if(200===t.status){this._requestLicenseFailureCount=0,a.logger.log("License request succeeded");var s=t.response,l=this._licenseResponseCallback;if(l)try{s=l.call(this.hls,t,e)}catch(t){a.logger.error(t)}o(s)}else{if(a.logger.error("License Request XHR failed ("+e+"). Status: "+t.status+" ("+t.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var c=3-this._requestLicenseFailureCount+1;a.logger.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(n,o)}}},c._generateLicenseRequestChallenge=function(t,e){switch(t.mediaKeySystemDomain){case o.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},c._requestLicense=function(t,e){a.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n)return a.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var o=this.getLicenseServerUrl(n.mediaKeySystemDomain),s=this._createLicenseXhr(o,t,e);a.logger.log("Sending license request to URL: "+o);var l=this._generateLicenseRequestChallenge(n,t);s.send(l)}catch(t){a.logger.error("Failure requesting DRM license: "+t),this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(t,e){if(this._emeEnabled){var n=e.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)}},c.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},c.onManifestParsed=function(t,e){if(this._emeEnabled){var n=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),r=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(o.KeySystems.WIDEVINE,n,r)}},e=t,(n=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&s(e.prototype,n),l&&s(e,l),t}();e.default=l},"./src/controller/fps-controller.ts":
/*!******************************************!*\
!*** ./src/controller/fps-controller.ts ***!
\******************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=function(){function t(t){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=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var n=this.hls.config;if(n.capLevelOnFPSDrop){var r=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,n){var a=performance.now();if(e){if(this.lastTime){var o=a-this.lastTime,s=n-this.lastDroppedFrames,l=e-this.lastDecodedFrames,c=1e3*s/o,u=this.hls;if(u.trigger(r.Events.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*l){var h=u.currentLevel;i.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=h)&&(h-=1,u.trigger(r.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=n,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();e.default=a},"./src/controller/fragment-finders.ts":
/*!********************************************!*\
!*** ./src/controller/fragment-finders.ts ***!
\********************************************/
/*! exports provided: findFragmentByPDT, findFragmentByPTS, fragmentWithinToleranceTest, pdtWithinToleranceTest, findFragWithCC */function(t,e,n){"use strict";n.r(e),n.d(e,"findFragmentByPDT",(function(){return a})),n.d(e,"findFragmentByPTS",(function(){return o})),n.d(e,"fragmentWithinToleranceTest",(function(){return s})),n.d(e,"pdtWithinToleranceTest",(function(){return l})),n.d(e,"findFragWithCC",(function(){return c}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/binary-search */"./src/utils/binary-search.ts");function a(t,e,n){if(null===e||!Array.isArray(t)||!t.length||!Object(r.isFiniteNumber)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;n=n||0;for(var i=0;i<t.length;++i){var a=t[i];if(l(e,n,a))return a}return null}function o(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var a=null;if(t?a=e[t.sn-e[0].sn+1]||null:0===n&&0===e[0].start&&(a=e[0]),a&&0===s(n,r,a))return a;var o=i.default.search(e,s.bind(null,n,r));return o||a}function s(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0);var r=Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=t?1:n.start-r>t&&n.start?-1:0}function l(t,e,n){var r=1e3*Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>t}function c(t,e){return i.default.search(t,(function(t){return t.cc<e?1:t.cc>e?-1:0}))}},"./src/controller/fragment-tracker.ts":
/*!********************************************!*\
!*** ./src/controller/fragment-tracker.ts ***!
\********************************************/
/*! exports provided: FragmentState, FragmentTracker */function(t,e,n){"use strict";n.r(e),n.d(e,"FragmentState",(function(){return r})),n.d(e,"FragmentTracker",(function(){return o}));var r,i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../types/loader */"./src/types/loader.ts");!function(t){t.NOT_LOADED="NOT_LOADED",t.BACKTRACKED="BACKTRACKED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(r||(r={}));var o=function(){function t(t){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=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===a.PlaylistLevelType.MAIN){var n=this.activeFragment,r=this.activeParts;if(!n)return null;if(r)for(var i=r.length;i--;){var o=r[i],s=o?o.end:n.appendedPTS;if(o.start<=t&&void 0!==s&&t<=s)return i>9&&(this.activeParts=r.slice(i-9)),o}else if(n.start<=t&&void 0!==n.appendedPTS&&t<=n.appendedPTS)return n}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var n=this.fragments,r=Object.keys(n),i=r.length;i--;){var a=n[r[i]];if((null==a?void 0:a.body.type)===e&&a.buffered){var o=a.body;if(o.start<=t&&t<=o.end)return o}}return null},e.detectEvictedFragments=function(t,e,n){var r=this;Object.keys(this.fragments).forEach((function(i){var a=r.fragments[i];if(a)if(a.buffered){var o=a.range[t];o&&o.time.some((function(t){var n=!r.isTimeBuffered(t.startPTS,t.endPTS,e);return n&&r.removeFragment(a.body),n}))}else a.body.type===n&&r.removeFragment(a.body)}))},e.detectPartialFragments=function(t){var e=this,n=this.timeRanges,r=t.frag,i=t.part;if(n&&"initSegment"!==r.sn){var a=l(r),o=this.fragments[a];o&&(Object.keys(n).forEach((function(t){var a=r.elementaryStreams[t];if(a){var s=n[t],l=null!==i||!0===a.partial;o.range[t]=e.getBufferedTimes(r,i,l,s)}})),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body))}},e.fragBuffered=function(t){var e=l(t),n=this.fragments[e];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},e.getBufferedTimes=function(t,e,n,r){for(var i={time:[],partial:n},a=e?e.start:t.start,o=e?e.end:t.end,s=t.minEndPTS||o,l=t.maxStartPTS||a,c=0;c<r.length;c++){var u=r.start(c)-this.bufferPadding,h=r.end(c)+this.bufferPadding;if(l>=u&&s<=h){i.time.push({startPTS:Math.max(a,r.start(c)),endPTS:Math.min(o,r.end(c))});break}if(a<h&&o>u)i.partial=!0,i.time.push({startPTS:Math.max(a,r.start(c)),endPTS:Math.min(o,r.end(c))});else if(o<=u)break}return i},e.getPartialFragment=function(t){var e,n,r,i=null,a=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(c){var u=l[c];u&&s(u)&&(n=u.body.start-o,r=u.body.end+o,t>=n&&t<=r&&(e=Math.min(t-n,r-t),a<=e&&(i=u.body,a=e)))})),i},e.getState=function(t){var e=l(t),n=this.fragments[e];return n?n.buffered?s(n)?r.PARTIAL:r.OK:n.backtrack?r.BACKTRACKED:r.APPENDING:r.NOT_LOADED},e.backtrack=function(t,e){var n=l(t),r=this.fragments[n];if(!r||r.backtrack)return null;var i=r.backtrack=e||r.loaded;return r.loaded=null,i},e.getBacktrackData=function(t){var e=l(t),n=this.fragments[e];if(n){var r,i=n.backtrack;if(null!=i&&null!==(r=i.payload)&&void 0!==r&&r.byteLength)return i;this.removeFragment(t)}return null},e.isTimeBuffered=function(t,e,n){for(var r,i,a=0;a<n.length;a++){if(r=n.start(a)-this.bufferPadding,i=n.end(a)+this.bufferPadding,t>=r&&e<=i)return!0;if(e<=r)return!1}return!1},e.onFragLoaded=function(t,e){var n=e.frag,r=e.part;if("initSegment"!==n.sn&&!n.bitrateTest&&!r){var i=l(n);this.fragments[i]={body:n,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var n=this,r=e.frag,i=e.part,o=e.timeRanges;if(r.type===a.PlaylistLevelType.MAIN)if(this.activeFragment=r,i){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(i)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach((function(t){var e=o[t];if(n.detectEvictedFragments(t,e),!i)for(var a=0;a<e.length;a++)r.appendedPTS=Math.max(e.end(a),r.appendedPTS||0)}))},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=l(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,n){var r=this;Object.keys(this.fragments).forEach((function(i){var a=r.fragments[i];if(a&&a.buffered){var o=a.body;o.type===n&&o.start<e&&o.end>t&&r.removeFragment(o)}}))},e.removeFragment=function(t){var e=l(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function s(t){var e,n;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(n=t.range.audio)||void 0===n?void 0:n.partial))}function l(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}},"./src/controller/gap-controller.ts":
/*!******************************************!*\
!*** ./src/controller/gap-controller.ts ***!
\******************************************/
/*! exports provided: STALL_MINIMUM_DURATION_MS, MAX_START_GAP_JUMP, SKIP_BUFFER_HOLE_STEP_SECONDS, SKIP_BUFFER_RANGE_START, default */function(t,e,n){"use strict";n.r(e),n.d(e,"STALL_MINIMUM_DURATION_MS",(function(){return s})),n.d(e,"MAX_START_GAP_JUMP",(function(){return l})),n.d(e,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return c})),n.d(e,"SKIP_BUFFER_RANGE_START",(function(){return u})),n.d(e,"default",(function(){return h}));var r=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),i=n(/*! ../errors */"./src/errors.ts"),a=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=250,l=2,c=.1,u=.05,h=function(){function t(t,e,n,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=n,this.hls=r}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,n=this.media,i=this.stalled,a=n.currentTime,c=n.seeking,u=this.seeking&&!c,h=!this.seeking&&c;if(this.seeking=c,a===t){if((h||u)&&(this.stalled=null),!n.paused&&!n.ended&&0!==n.playbackRate&&r.BufferHelper.getBuffered(n).length){var d=r.BufferHelper.bufferInfo(n,a,0),f=d.len>0,p=d.nextStart||0;if(f||p){if(c){var g=d.len>l,m=!p||p-a>l&&!this.fragmentTracker.getPartialFragment(a);if(g||m)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var v,y=Math.max(p,d.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,x=(null==b||null===(v=b.details)||void 0===v?void 0:v.live)?2*b.details.targetduration:l;if(y>0&&y<=x)return void this._trySkipBufferHole(null)}var S=self.performance.now();if(null!==i){var C=S-i;!c&&C>=s&&this._reportStall(d.len);var E=r.BufferHelper.bufferInfo(n,a,e.maxBufferHole);this._tryFixBufferStall(E,C)}else this.stalled=S}}}else if(this.moved=!0,null!==i){if(this.stallReported){var w=self.performance.now()-i;o.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var n=this.config,r=this.fragmentTracker,i=this.media.currentTime,a=r.getPartialFragment(i);a&&this._trySkipBufferHole(a)||t.len>n.maxBufferHole&&e>1e3*n.highBufferWatchdogPeriod&&(o.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},e._reportStall=function(t){var e=this.hls,n=this.media;this.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,n=this.hls,s=this.media,l=s.currentTime,h=0,d=r.BufferHelper.getBuffered(s),f=0;f<d.length;f++){var p=d.start(f);if(l+e.maxBufferHole>=h&&l<p){var g=Math.max(p+u,s.currentTime+c);return o.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+g),this.moved=!0,this.stalled=null,s.currentTime=g,t&&n.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+g,frag:t}),g}h=d.end(f)}return 0},e._tryNudgeBuffer=function(){var t=this.config,e=this.hls,n=this.media,r=n.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<t.nudgeMaxRetry){var l=r+s*t.nudgeOffset;o.logger.warn("Nudging 'currentTime' from "+r+" to "+l),n.currentTime=l,e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+t.nudgeMaxRetry+" nudges"),e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},t}()},"./src/controller/id3-track-controller.ts":
/*!************************************************!*\
!*** ./src/controller/id3-track-controller.ts ***!
\************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),a=n(/*! ../demux/id3 */"./src/demux/id3.ts"),o=function(){function t(t){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e.destroy=function(){this._unregisterListeners()},e._registerListeners=function(){var t=this.hls;t.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(r.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},e._unregisterListeners=function(){var t=this.hls;t.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(r.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},e.onMediaAttached=function(t,e){this.media=e.media},e.onMediaDetaching=function(){this.id3Track&&(Object(i.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null)},e.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var n=t[e];if("metadata"===n.kind&&"id3"===n.label)return Object(i.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")}},e.onFragParsingMetadata=function(t,e){if(this.media){var n=e.frag,r=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var i=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<r.length;o++){var s=a.getID3Frames(r[o].data);if(s){var l=r[o].pts,c=o<r.length-1?r[o+1].pts:n.end;c-l<=0&&(c=l+.25);for(var u=0;u<s.length;u++){var h=s[u];if(!a.isTimeStampFrame(h)){var d=new i(l,c,"");d.value=h,this.id3Track.addCue(d)}}}}}},e.onBufferFlushing=function(t,e){var n=e.startOffset,r=e.endOffset,a=e.type;if(!a||"audio"===a){var o=this.id3Track;o&&Object(i.removeCuesInRange)(o,n,r)}},t}();e.default=o},"./src/controller/latency-controller.ts":
/*!**********************************************!*\
!*** ./src/controller/latency-controller.ts ***!
\**********************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return s}));var r=n(/*! ../errors */"./src/errors.ts"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts");function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var s=function(){function t(t){var e=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var e,n,s,l=t.prototype;return l.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},l.registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(i.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(i.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(i.Events.ERROR,this.onError)},l.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},l.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},l.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},l.onLevelUpdated=function(t,e){var n=e.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},l.onError=function(t,e){e.details===r.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,a.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},l.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var n=this.computeLatency();if(null!==n){this._latency=n;var r=this.config,i=r.lowLatencyMode,a=r.maxLiveSyncPlaybackRate;if(i&&1!==a){var o=this.targetLatency;if(null!==o){var s=n-o,l=s<Math.min(this.maxLatency,o+e.targetduration);if(e.live&&l&&s>.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,a)),u=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;t.playbackRate=Math.min(c,Math.max(1,u))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},l.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},l.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(n=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,n=t.partHoldBack,r=t.targetduration,i=this.config,a=i.liveSyncDuration,o=i.liveSyncDurationCount,s=i.lowLatencyMode,l=this.hls.userConfig,c=s&&n||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==a?a:o*r);var u=r;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,n=this.levelDetails;if(null===t||null===e||null===n)return null;var r=n.edge,i=t-e-this.edgeStalled,a=r-n.totalduration,o=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,i),o)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var n=t.buffered.length;return n?t.buffered.end(n-1):e.edge-this.currentTime}}])&&o(e.prototype,n),s&&o(e,s),t}()},"./src/controller/level-controller.ts":
/*!********************************************!*\
!*** ./src/controller/level-controller.ts ***!
\********************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return p}));var r=n(/*! ../types/level */"./src/types/level.ts"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../utils/codecs */"./src/utils/codecs.ts"),s=n(/*! ./level-helper */"./src/controller/level-helper.ts"),l=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts");function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(t){var e,n;function l(e){var n;return(n=t.call(this,e,"[level-controller]")||this)._levels=[],n._firstLevel=-1,n._startLevel=void 0,n.currentLevelIndex=-1,n.manualLevelIndex=-1,n.onParsedComplete=void 0,n._registerListeners(),n}n=t,(e=l).prototype=Object.create(n.prototype),e.prototype.constructor=e,d(e,n);var p,g,m,v=l.prototype;return v._registerListeners=function(){var t=this.hls;t.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(i.Events.ERROR,this.onError,this)},v._unregisterListeners=function(){var t=this.hls;t.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(i.Events.ERROR,this.onError,this)},v.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},v.startLoad=function(){this._levels.forEach((function(t){t.loadError=0})),t.prototype.startLoad.call(this)},v.onManifestLoaded=function(t,e){var n,l,c=[],u=[],h=[],d={},p=!1,g=!1,m=!1;if(e.levels.forEach((function(t){var e=t.attrs;p=p||!(!t.width||!t.height),g=g||!!t.videoCodec,m=m||!!t.audioCodec,f&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0);var n=t.bitrate+"-"+t.attrs.RESOLUTION+"-"+t.attrs.CODECS;(l=d[n])?l.url.push(t.url):(l=new r.Level(t),d[n]=l,c.push(l)),e&&(e.AUDIO&&Object(s.addGroupId)(l,"audio",e.AUDIO),e.SUBTITLES&&Object(s.addGroupId)(l,"text",e.SUBTITLES))})),(p||g)&&m&&(c=c.filter((function(t){var e=t.videoCodec,n=t.width,r=t.height;return!!e||!(!n||!r)}))),c=c.filter((function(t){var e=t.audioCodec,n=t.videoCodec;return(!e||Object(o.isCodecSupportedInMp4)(e,"audio"))&&(!n||Object(o.isCodecSupportedInMp4)(n,"video"))})),e.audioTracks&&(u=e.audioTracks.filter((function(t){return!t.audioCodec||Object(o.isCodecSupportedInMp4)(t.audioCodec,"audio")})),Object(s.assignTrackIdsByGroup)(u)),e.subtitles&&(h=e.subtitles,Object(s.assignTrackIdsByGroup)(h)),c.length>0){n=c[0].bitrate,c.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=c;for(var v=0;v<c.length;v++)if(c[v].bitrate===n){this._firstLevel=v,this.log("manifest loaded, "+c.length+" level(s) found, first bitrate: "+n);break}var y=m&&!g,b={levels:c,audioTracks:u,subtitleTracks:h,firstLevel:this._firstLevel,stats:e.stats,audio:m,video:g,altAudio:!y&&u.some((function(t){return!!t.url}))};this.hls.trigger(i.Events.MANIFEST_PARSED,b),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,reason:"no level with compatible codecs found in manifest"})},v.onError=function(e,n){if(t.prototype.onError.call(this,e,n),!n.fatal){var r=n.context,i=this._levels[this.currentLevelIndex];if(r&&(r.type===c.PlaylistContextType.AUDIO_TRACK&&i.audioGroupIds&&r.groupId===i.audioGroupIds[i.urlId]||r.type===c.PlaylistContextType.SUBTITLE_TRACK&&i.textGroupIds&&r.groupId===i.textGroupIds[i.urlId]))this.redundantFailover(this.currentLevelIndex);else{var o,s=!1,l=!0;switch(n.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:if(n.frag){var u=this._levels[n.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=n.frag.level)):o=n.frag.level}break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:r&&(r.deliveryDirectives&&(l=!1),o=r.level),s=!0;break;case a.ErrorDetails.REMUX_ALLOC_ERROR:o=n.level,s=!0}void 0!==o&&this.recoverLevel(n,o,s,l)}}},v.recoverLevel=function(t,e,n,r){var i=t.details,a=this._levels[e];if(a.loadError++,n){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(r){var o=a.url.length;if(o>1&&a.loadError<o)t.levelRetry=!0,this.redundantFailover(e);else if(-1===this.manualLevelIndex){var s=0===e?this._levels.length-1:e-1;this.currentLevelIndex!==s&&0===this._levels[s].loadError&&(this.warn(i+": switch to "+s),t.levelRetry=!0,this.hls.nextAutoLevel=s)}}},v.redundantFailover=function(t){var e=this._levels[t],n=e.url.length;if(n>1){var r=(e.urlId+1)%n;this.warn("Switching to redundant URL-id "+r),this._levels.forEach((function(t){t.urlId=r})),this.level=t}},v.onFragLoaded=function(t,e){var n=e.frag;if(void 0!==n&&n.type===c.PlaylistLevelType.MAIN){var r=this._levels[n.level];void 0!==r&&(r.fragmentError=0,r.loadError=0)}},v.onLevelLoaded=function(t,e){var n,r,i=e.level,a=e.details,o=this._levels[i];if(!o)return this.warn("Invalid level index "+i),void(null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(i,e,o.details)):null!==(n=e.deliveryDirectives)&&void 0!==n&&n.skip&&(a.deltaUpdateFailed=!0)},v.onAudioTrackSwitched=function(t,e){var n=this.hls.levels[this.currentLevelIndex];if(n&&n.audioGroupIds){for(var r=-1,i=this.hls.audioTracks[e.id].groupId,a=0;a<n.audioGroupIds.length;a++)if(n.audioGroupIds[a]===i){r=a;break}r!==n.urlId&&(n.urlId=r,this.startLoad())}},v.loadPlaylist=function(t){var e=this.currentLevelIndex,n=this._levels[e];if(this.canLoad&&n&&n.url.length>0){var r=n.urlId,a=n.url[r];if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+r+" "+a),this.clearTimer(),this.hls.trigger(i.Events.LEVEL_LOADING,{url:a,level:e,id:r,deliveryDirectives:t||null})}},v.removeLevel=function(t,e){var n=function(t,n){return n!==e},r=this._levels.filter((function(r,i){return i!==t||r.url.length>1&&void 0!==e&&(r.url=r.url.filter(n),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(n)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(n)),r.urlId=0,!0)})).map((function(t,e){var n=t.details;return null!=n&&n.fragments&&n.fragments.forEach((function(t){t.level=e})),t}));this._levels=r,this.hls.trigger(i.Events.LEVELS_UPDATED,{levels:r})},p=l,(g=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,n=this._levels;if(0!==n.length&&(this.currentLevelIndex!==t||null===(e=n[t])||void 0===e||!e.details)){if(t<0||t>=n.length){var r=t<0;if(this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:r,reason:"invalid level idx"}),r)return;t=Math.min(t,n.length-1)}this.clearTimer();var o=this.currentLevelIndex,s=n[o],l=n[t];this.log("switching to level "+t+" from "+o),this.currentLevelIndex=t;var c=u({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete c._urlId,this.hls.trigger(i.Events.LEVEL_SWITCHING,c);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==s?void 0:s.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&h(p.prototype,g),m&&h(p,m),l}(l.default)},"./src/controller/level-helper.ts":
/*!****************************************!*\
!*** ./src/controller/level-helper.ts ***!
\****************************************/
/*! exports provided: addGroupId, assignTrackIdsByGroup, updatePTS, updateFragPTSDTS, mergeDetails, mapPartIntersection, mapFragmentIntersection, adjustSliding, addSliding, computeReloadInterval, getFragmentWithSN, getPartWith */function(t,e,n){"use strict";n.r(e),n.d(e,"addGroupId",(function(){return a})),n.d(e,"assignTrackIdsByGroup",(function(){return o})),n.d(e,"updatePTS",(function(){return s})),n.d(e,"updateFragPTSDTS",(function(){return c})),n.d(e,"mergeDetails",(function(){return u})),n.d(e,"mapPartIntersection",(function(){return h})),n.d(e,"mapFragmentIntersection",(function(){return d})),n.d(e,"adjustSliding",(function(){return f})),n.d(e,"addSliding",(function(){return p})),n.d(e,"computeReloadInterval",(function(){return g})),n.d(e,"getFragmentWithSN",(function(){return m})),n.d(e,"getPartWith",(function(){return v}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/logger */"./src/utils/logger.ts");function a(t,e,n){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(n);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(n)}}function o(t){var e={};t.forEach((function(t){var n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++}))}function s(t,e,n){l(t[e],t[n])}function l(t,e){var n=e.startPTS;if(Object(r.isFiniteNumber)(n)){var i,a=0;e.sn>t.sn?(a=n-t.start,i=t):(a=t.start-n,i=e),i.duration!==a&&(i.duration=a)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function c(t,e,n,a,o,s){a-n<=0&&(i.logger.warn("Fragment should have a positive duration",e),a=n+e.duration,s=o+e.duration);var c=n,u=a,h=e.startPTS,d=e.endPTS;if(Object(r.isFiniteNumber)(h)){var f=Math.abs(h-n);Object(r.isFiniteNumber)(e.deltaPTS)?e.deltaPTS=Math.max(f,e.deltaPTS):e.deltaPTS=f,c=Math.max(n,h),n=Math.min(n,h),o=Math.min(o,e.startDTS),u=Math.min(a,d),a=Math.max(a,d),s=Math.max(s,e.endDTS)}e.duration=a-n;var p=n-e.start;e.appendedPTS=a,e.start=e.startPTS=n,e.maxStartPTS=c,e.startDTS=o,e.endPTS=a,e.minEndPTS=u,e.endDTS=s;var g,m=e.sn;if(!t||m<t.startSN||m>t.endSN)return 0;var v=m-t.startSN,y=t.fragments;for(y[v]=e,g=v;g>0;g--)l(y[g],y[g-1]);for(g=v;g<y.length-1;g++)l(y[g],y[g+1]);return t.fragmentHint&&l(y[y.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,p}function u(t,e){for(var n=null,a=t.fragments,o=a.length-1;o>=0;o--){var s=a[o].initSegment;if(s){n=s;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var l,u=0;if(d(t,e,(function(t,i){t.relurl&&(u=t.cc-i.cc),Object(r.isFiniteNumber)(t.startPTS)&&Object(r.isFiniteNumber)(t.endPTS)&&(i.start=i.startPTS=t.startPTS,i.startDTS=t.startDTS,i.appendedPTS=t.appendedPTS,i.maxStartPTS=t.maxStartPTS,i.endPTS=t.endPTS,i.endDTS=t.endDTS,i.minEndPTS=t.minEndPTS,i.duration=t.endPTS-t.startPTS,i.duration&&(l=i),e.PTSKnown=e.alignedSliding=!0),i.elementaryStreams=t.elementaryStreams,i.loader=t.loader,i.stats=t.stats,i.urlId=t.urlId,t.initSegment&&(i.initSegment=t.initSegment,n=t.initSegment)})),n&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach((function(t){var e;t.initSegment&&t.initSegment.relurl!==(null===(e=n)||void 0===e?void 0:e.relurl)||(t.initSegment=n)})),e.skippedSegments&&(e.deltaUpdateFailed=e.fragments.some((function(t){return!t})),e.deltaUpdateFailed)){i.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=e.skippedSegments;p--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}var g=e.fragments;if(u){i.logger.warn("discontinuity sliding from playlist, take drift into account");for(var m=0;m<g.length;m++)g[m].cc+=u}e.skippedSegments&&(e.startCC=e.fragments[0].cc),h(t.partList,e.partList,(function(t,e){e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),l?c(e,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):f(t,e),g.length&&(e.totalduration=e.edge-g[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;var v=e.advancedDateTime;if(e.advanced&&v){var y=e.edge;e.driftStart||(e.driftStartTime=v,e.driftStart=y),e.driftEndTime=v,e.driftEnd=y}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function h(t,e,n){if(t&&e)for(var r=0,i=0,a=t.length;i<=a;i++){var o=t[i],s=e[i+r];o&&s&&o.index===s.index&&o.fragment.sn===s.fragment.sn?n(o,s):r--}}function d(t,e,n){for(var r=e.skippedSegments,i=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(r?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,o=e.startSN-t.startSN,s=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=i;c<=a;c++){var u=l[o+c],h=s[c];r&&!h&&c<r&&(h=e.fragments[c]=u),u&&h&&n(u,h)}}function f(t,e){var n=e.startSN+e.skippedSegments-t.startSN,r=t.fragments;n<0||n>=r.length||p(e,r[n].start)}function p(t,e){if(e){for(var n=t.fragments,r=t.skippedSegments;r<n.length;r++)n[r].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}function g(t,e){var n,r=1e3*t.levelTargetDuration,i=r/2,a=t.age,o=a>0&&a<3*r,s=e.loading.end-e.loading.start,l=t.availabilityDelay;if(!1===t.updated)if(o){var c=333*t.misses;n=Math.max(Math.min(i,2*s),c),t.availabilityDelay=(t.availabilityDelay||0)+n}else n=i;else o?(l=Math.min(l||r/2,a),t.availabilityDelay=l,n=l+r-a):n=r-s;return Math.round(n)}function m(t,e,n){if(!t||!t.details)return null;var r=t.details,i=r.fragments[e-r.startSN];return i||((i=r.fragmentHint)&&i.sn===e?i:e<r.startSN&&n&&n.sn===e?n:null)}function v(t,e,n){if(!t||!t.details)return null;var r=t.details.partList;if(r)for(var i=r.length;i--;){var a=r[i];if(a.index===n&&a.fragment.sn===e)return a}return null}},"./src/controller/stream-controller.ts":
/*!*********************************************!*\
!*** ./src/controller/stream-controller.ts ***!
\*********************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),a=n(/*! ../is-supported */"./src/is-supported.ts"),o=n(/*! ../events */"./src/events.ts"),s=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=n(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),d=n(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),f=n(/*! ./gap-controller */"./src/controller/gap-controller.ts"),p=n(/*! ../errors */"./src/errors.ts"),g=n(/*! ../utils/logger */"./src/utils/logger.ts");function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var y=function(t){var e,n;function y(e,n){var r;return(r=t.call(this,e,n,"[stream-controller]")||this).audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.stalled=!1,r.couldBacktrack=!1,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}n=t,(e=y).prototype=Object.create(n.prototype),e.prototype.constructor=e,v(e,n);var b,x,S,C=y.prototype;return C._registerListeners=function(){var t=this.hls;t.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(o.Events.ERROR,this.onError,this),t.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var t=this.hls;t.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(o.Events.ERROR,this.onError,this),t.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,n=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=n.startLevel;-1===r&&(n.config.testBandwidth?(r=0,this.bitrateTest=!0):r=n.nextAutoLevel),this.level=n.nextLoadLevel=r,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=i.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=i.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_LEVEL:var t,e=this.levels,n=this.level,r=null==e||null===(t=e[n])||void 0===t?void 0:t.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=i.State.IDLE;break}break;case i.State.FRAG_LOADING_WAITING_RETRY:var a,o=self.performance.now(),s=this.retryDate;(!s||o>=s||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=i.State.IDLE)}this.onTickEnd()},C.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var t,e,n=this.hls,r=this.levelLastLoaded,a=this.levels,s=this.media,h=n.config,d=n.nextLoadLevel;if(null!==r&&(s||!this.startFragRequested&&h.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&a&&a[d]){var f=a[d];this.level=n.nextLoadLevel=d;var p=f.details;if(!p||this.state===i.State.WAITING_LEVEL||p.live&&this.levelLastLoaded!==d)this.state=i.State.WAITING_LEVEL;else{var g=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:s,c.PlaylistLevelType.MAIN);if(null!==g&&!(g.len>=this.getMaxBufferLength(f.maxBitrate))){if(this._streamEnded(g,p)){var m={};return this.altAudio&&(m.type="video"),this.hls.trigger(o.Events.BUFFER_EOS,m),void(this.state=i.State.ENDED)}var v=g.end,y=this.getNextFragment(v,p);if(this.couldBacktrack&&!this.fragPrevious&&y&&"initSegment"!==y.sn){var b=y.sn-p.startSN;b>1&&(y=p.fragments[b-1],this.fragmentTracker.removeFragment(y))}if(y&&this.fragmentTracker.getState(y)===l.FragmentState.OK&&this.nextLoadPosition>v){var x=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(s,x,c.PlaylistLevelType.MAIN),y=this.getNextFragment(this.nextLoadPosition,p)}y&&(!y.initSegment||y.initSegment.data||this.bitrateTest||(y=y.initSegment),"identity"!==(null===(t=y.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=y.decryptdata)&&void 0!==e&&e.key?this.loadFragment(y,p,v):this.loadKey(y,p))}}}},C.loadFragment=function(e,n,r){var i,a=this.fragmentTracker.getState(e);if(this.fragCurrent=e,a===l.FragmentState.BACKTRACKED){var o=this.fragmentTracker.getBacktrackData(e);if(o)return this._handleFragmentLoadProgress(o),void this._handleFragmentLoadComplete(o);a=l.FragmentState.NOT_LOADED}a===l.FragmentState.NOT_LOADED||a===l.FragmentState.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,n,r)):a===l.FragmentState.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(i=this.media)||void 0===i?void 0:i.buffered.length)&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,c.PlaylistLevelType.MAIN);return e&&"fragment"in e?e.fragment:e},C.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,c.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var n,r=this.getAppendedFrag(e.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!e.paused&&t){var i=t[this.hls.nextLoadLevel],a=this.fragLastKbps;n=a&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*a)+1:0}else n=0;var o=this.getBufferedFrag(e.currentTime+n);if(o){var s=this.followingBufferedFrag(o);if(s){this.abortCurrentFrag();var l=s.maxStartPTS?s.maxStartPTS:s.start,c=s.duration,u=Math.max(o.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,.5*c),.75*c));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===i.State.KEY_LOADING&&(this.state=i.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(e,n){t.prototype.flushMainBuffer.call(this,e,n,this.altAudio?"video":null)},C.onMediaAttached=function(e,n){t.prototype.onMediaAttached.call(this,e,n);var r=n.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,r,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(r.isFiniteNumber)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(o.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},C.onManifestParsed=function(t,e){var n,r=!1,i=!1;e.levels.forEach((function(t){(n=t.audioCodec)&&(-1!==n.indexOf("mp4a.40.2")&&(r=!0),-1!==n.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=r&&i&&!Object(a.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},C.onLevelLoading=function(t,e){var n=this.levels;if(n&&this.state===i.State.IDLE){var r=n[e.level];(!r.details||r.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(r.details))&&(this.state=i.State.WAITING_LEVEL)}},C.onLevelLoaded=function(t,e){var n,r=this.levels,a=e.level,s=e.details,l=s.totalduration;if(r){this.log("Level "+a+" loaded ["+s.startSN+","+s.endSN+"], cc ["+s.startCC+", "+s.endCC+"] duration:"+l);var c=this.fragCurrent;!c||this.state!==i.State.FRAG_LOADING&&this.state!==i.State.FRAG_LOADING_WAITING_RETRY||c.level!==e.level&&c.loader&&(this.state=i.State.IDLE,c.loader.abort());var u=r[a],h=0;if(s.live||null!==(n=u.details)&&void 0!==n&&n.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;h=this.alignPlaylists(s,u.details)}if(u.details=s,this.levelLastLoaded=a,this.hls.trigger(o.Events.LEVEL_UPDATED,{details:s,level:a}),this.state===i.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=i.State.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,h),this.tick()}else this.warn("Levels were reset while loading level "+a)},C._handleFragmentLoadProgress=function(t){var e,n=t.frag,r=t.part,i=t.payload,a=this.levels;if(a){var o=a[n.level],s=o.details;if(s){var l=o.videoCodec,u=s.PTSKnown||!s.live,f=null===(e=n.initSegment)||void 0===e?void 0:e.data,p=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=r?r.index:-1,v=-1!==m,y=new d.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,i.byteLength,m,v),b=this.initPTS[n.cc];g.push(i,f,p,l,n,r,s.totalduration,u,y,b)}else this.warn("Dropping fragment "+n.sn+" of level "+n.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+n.sn+" of level "+n.level+" will not be buffered")},C.onAudioTrackSwitching=function(t,e){var n=this.altAudio,r=!!e.url,i=e.id;if(!r){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var a=this.fragCurrent;null!=a&&a.loader&&(this.log("Switching to main audio track, cancel main fragment load"),a.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var s=this.hls;n&&s.trigger(o.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),s.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:i})}},C.onAudioTrackSwitched=function(t,e){var n=e.id,r=!!this.hls.audioTracks[n].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},C.onBufferCreated=function(t,e){var n,r,i=e.tracks,a=!1;for(var o in i){var s=i[o];if("main"===s.id){if(r=o,n=s,"video"===o){var l=i[o];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&n?(this.log("Alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(t,e){var n=e.frag,r=e.part;if(!n||n.type===c.PlaylistLevelType.MAIN){if(this.fragContextChanged(n))return this.warn("Fragment "+n.sn+(r?" p: "+r.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===i.State.PARSED&&(this.state=i.State.IDLE));var a=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==n.sn&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}},C.onError=function(t,e){switch(e.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.MAIN,e);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==i.State.ERROR&&(e.fatal?(this.warn(""+e.details),this.state=i.State.ERROR):e.levelRetry||this.state!==i.State.WAITING_LEVEL||(this.state=i.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var n=!0,r=this.getFwdBufferInfo(this.media,c.PlaylistLevelType.MAIN);r&&r.len>.5&&(n=!this.reduceMaxBufferLength(r.len)),n&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},C.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var n=s.BufferHelper.getBuffered(t);!this.loadedmetadata&&n.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},C.onFragLoadEmergencyAborted=function(){this.state=i.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(t,e){var n=e.type;if(n!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var r=(n===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,n,c.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(t,e){this.levels=e.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var t=this.media,e=t.currentTime,n=this.startPosition;if(n>=0&&e<n){if(t.seeking)return void g.logger.log("could not seek to "+n+", already seeking at "+e);var r=s.BufferHelper.getBuffered(t),i=(r.length?r.start(0):0)-n;i>0&&(i<this.config.maxBufferHole||i<this.config.maxFragLookUpTolerance)&&(g.logger.log("adjusting start position by "+i+" to match buffer start"),n+=i,this.startPosition=n),this.log("seek to target start position "+n+" from current time "+e),t.currentTime=n}},C._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},C._loadBitrateTestFrag=function(t){var e=this;this._doFragLoad(t).then((function(n){var r=e.hls;if(n&&!r.nextLoadLevel&&!e.fragContextChanged(t)){e.fragLoadError=0,e.state=i.State.IDLE,e.startFragRequested=!1,e.bitrateTest=!1;var a=t.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),r.trigger(o.Events.FRAG_LOADED,n)}}))},C._handleTransmuxComplete=function(t){var e,n="main",a=this.hls,s=t.remuxResult,l=t.chunkMeta,c=this.getCurrentContext(l);if(!c)return this.warn("The loading context changed while buffering fragment "+l.sn+" of level "+l.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(l.level);var h=c.frag,d=c.part,f=c.level,p=s.video,g=s.text,m=s.id3,v=s.initSegment,y=this.altAudio?void 0:s.audio;if(!this.fragContextChanged(h)){if(this.state=i.State.PARSING,v){v.tracks&&(this._bufferInitSegment(f,v.tracks,h,l),a.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:n,tracks:v.tracks}));var b=v.initPTS,x=v.timescale;Object(r.isFiniteNumber)(b)&&(this.initPTS[h.cc]=b,a.trigger(o.Events.INIT_PTS_FOUND,{frag:h,id:n,initPTS:b,timescale:x}))}if(p&&!1!==s.independent){if(f.details){var S=p.startPTS,C=p.endPTS,E=p.startDTS,w=p.endDTS;if(d)d.elementaryStreams[p.type]={startPTS:S,endPTS:C,startDTS:E,endDTS:w};else if(p.firstKeyFrame&&p.independent&&(this.couldBacktrack=!0),p.dropped&&p.independent){if(this.getLoadPosition()+this.config.maxBufferHole<S)return void this.backtrack(h);h.setElementaryStreamInfo(p.type,h.start,C,h.start,w,!0)}h.setElementaryStreamInfo(p.type,S,C,E,w),this.bufferFragmentData(p,h,d,l)}}else if(!1===s.independent)return void this.backtrack(h);if(y){var k=y.startPTS,T=y.endPTS,O=y.startDTS,A=y.endDTS;d&&(d.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:k,endPTS:T,startDTS:O,endDTS:A}),h.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,k,T,O,A),this.bufferFragmentData(y,h,d,l)}if(null!=m&&null!==(e=m.samples)&&void 0!==e&&e.length){var L={frag:h,id:n,samples:m.samples};a.trigger(o.Events.FRAG_PARSING_METADATA,L)}if(g){var D={frag:h,id:n,samples:g.samples};a.trigger(o.Events.FRAG_PARSING_USERDATA,D)}}},C._bufferInitSegment=function(t,e,n,r){var a=this;if(this.state===i.State.PARSING){this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;var s=e.audio,l=e.video,c=e.audiovideo;if(s){var u=t.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==s.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==s.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),t.audioCodec&&t.audioCodec!==u&&this.log('Swapping manifest audio codec "'+t.audioCodec+'" for "'+u+'"'),s.levelCodec=u,s.id="main",this.log("Init audio buffer, container:"+s.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(t.audioCodec||"")+"/"+s.codec+"]")}l&&(l.levelCodec=t.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(t.videoCodec||"")+"/"+l.codec+"]")),c&&this.log("Init audiovideo buffer, container:"+c.container+", codecs[level/parsed]=["+(t.attrs.CODECS||"")+"/"+c.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,e),Object.keys(e).forEach((function(t){var i=e[t].initSegment;null!=i&&i.byteLength&&a.hls.trigger(o.Events.BUFFER_APPENDING,{type:t,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})),this.tick()}},C.backtrack=function(t){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(t);var e=this.fragmentTracker.backtrack(t);this.fragPrevious=null,this.nextLoadPosition=t.start,e?this.resetFragmentLoading(t):this.state=i.State.BACKTRACKING},C.checkFragmentChanged=function(){var t=this.media,e=null;if(t&&t.readyState>1&&!1===t.seeking){var n=t.currentTime;if(s.BufferHelper.isBuffered(t,n)?e=this.getAppendedFrag(n):s.BufferHelper.isBuffered(t,n+.1)&&(e=this.getAppendedFrag(n+.1)),e){var r=this.fragPlaying,i=e.level;r&&e.sn===r.sn&&r.level===i&&e.urlId===r.urlId||(this.hls.trigger(o.Events.FRAG_CHANGED,{frag:e}),r&&r.level===i||this.hls.trigger(o.Events.LEVEL_SWITCHED,{level:i}),this.fragPlaying=e)}}},b=y,(x=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&m(b.prototype,x),S&&m(b,S),y}(i.default)},"./src/controller/subtitle-stream-controller.ts":
/*!******************************************************!*\
!*** ./src/controller/subtitle-stream-controller.ts ***!
\******************************************************/
/*! exports provided: SubtitleStreamController */function(t,e,n){"use strict";n.r(e),n.d(e,"SubtitleStreamController",(function(){return g}));var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=n(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),s=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),l=n(/*! ./level-helper */"./src/controller/level-helper.ts"),c=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),u=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),h=n(/*! ../types/loader */"./src/types/loader.ts"),d=n(/*! ../types/level */"./src/types/level.ts");function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var g=function(t){var e,n;function g(e,n){var r;return(r=t.call(this,e,n,"[subtitle-stream-controller]")||this).levels=[],r.currentTrackId=-1,r.tracksBuffered=[],r.mainDetails=null,r._registerListeners(),r}n=t,(e=g).prototype=Object.create(n.prototype),e.prototype.constructor=e,p(e,n);var m,v,y,b=g.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var t=this.hls;t.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(r.Events.ERROR,this.onError,this),t.on(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(r.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(r.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var t=this.hls;t.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(r.Events.ERROR,this.onError,this),t.off(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(r.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(r.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b.startLoad=function(){this.stopLoad(),this.state=u.State.IDLE,this.setInterval(500),this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},b.onLevelLoaded=function(t,e){this.mainDetails=e.details},b.onSubtitleFragProcessed=function(t,e){var n=e.frag,r=e.success;if(this.fragPrevious=n,this.state=u.State.IDLE,r){var i=this.tracksBuffered[this.currentTrackId];if(i){for(var a,o=n.start,s=0;s<i.length;s++)if(o>=i[s].start&&o<=i[s].end){a=i[s];break}var l=n.start+n.duration;a?a.end=l:(a={start:o,end:l},i.push(a)),this.fragmentTracker.fragBuffered(n)}}},b.onBufferFlushing=function(t,e){var n=e.startOffset,r=e.endOffset;if(0===n&&r!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,a=this.levels;if(!a.length||!a[i]||!a[i].details)return;var o=r-a[i].details.targetduration;if(o<=0)return;e.endOffsetSubtitles=Math.max(0,o),this.tracksBuffered.forEach((function(t){for(var e=0;e<t.length;)if(t[e].end<=o)t.shift();else{if(!(t[e].start<o))break;t[e].start=o,e++}})),this.fragmentTracker.removeFragmentsInRange(n,o,h.PlaylistLevelType.SUBTITLE)}},b.onError=function(t,e){var n,r=e.frag;r&&r.type===h.PlaylistLevelType.SUBTITLE&&(null!==(n=this.fragCurrent)&&void 0!==n&&n.loader&&this.fragCurrent.loader.abort(),this.state=u.State.IDLE)},b.onSubtitleTracksUpdated=function(t,e){var n=this,r=e.subtitleTracks;this.tracksBuffered=[],this.levels=r.map((function(t){return new d.Level(t)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(t){n.tracksBuffered[t.id]=[]})),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(t,e){if(this.currentTrackId=e.id,this.levels.length&&-1!==this.currentTrackId){var n=this.levels[this.currentTrackId];null!=n&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.setInterval(500)}else this.clearInterval()},b.onSubtitleTrackLoaded=function(t,e){var n,r=e.details,i=e.id,a=this.currentTrackId,c=this.levels;if(c.length){var h=c[a];if(!(i>=c.length||i!==a)&&h){if(this.mediaBuffer=this.mediaBufferTimeRanges,r.live||null!==(n=h.details)&&void 0!==n&&n.live){var d=this.mainDetails;if(r.deltaUpdateFailed||!d)return;var f=d.fragments[0];h.details?0===this.alignPlaylists(r,h.details)&&f&&Object(l.addSliding)(r,f.start):r.hasProgramDateTime&&d.hasProgramDateTime?Object(s.alignMediaPlaylistByPDT)(r,d):f&&Object(l.addSliding)(r,f.start)}h.details=r,this.levelLastLoaded=i,this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE&&(Object(o.findFragmentByPTS)(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0))}}},b._handleFragmentLoadComplete=function(t){var e=t.frag,n=t.payload,i=e.decryptdata,a=this.hls;if(!this.fragContextChanged(e)&&n&&n.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).then((function(t){var n=performance.now();a.trigger(r.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:o,tdecrypt:n}})}))}},b.doTick=function(){if(this.media){if(this.state===u.State.IDLE){var t,e=this.currentTrackId,n=this.levels;if(!n.length||!n[e]||!n[e].details)return;var s=n[e].details,l=s.targetduration,h=this.config,d=this.media,f=a.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,d.currentTime-l,h.maxBufferHole),p=f.end;if(f.len>this.getMaxBufferLength()+l)return;console.assert(s,"Subtitle track details are defined on idle subtitle stream controller tick");var g,m=s.fragments,v=m.length,y=s.edge,b=this.fragPrevious;if(p<y){var x=h.maxFragLookUpTolerance;b&&s.hasProgramDateTime&&(g=Object(o.findFragmentByPDT)(m,b.endProgramDateTime,x)),g||!(g=Object(o.findFragmentByPTS)(b,m,p,x))&&b&&b.start<m[0].start&&(g=m[0])}else g=m[v-1];null!==(t=g)&&void 0!==t&&t.encrypted?(i.logger.log("Loading key for "+g.sn),this.state=u.State.KEY_LOADING,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===c.FragmentState.NOT_LOADED&&this.loadFragment(g,s,p)}}else this.state=u.State.IDLE},b.loadFragment=function(e,n,r){this.fragCurrent=e,t.prototype.loadFragment.call(this,e,n,r)},m=g,(v=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}])&&f(m.prototype,v),y&&f(m,y),g}(u.default)},"./src/controller/subtitle-track-controller.ts":
/*!*****************************************************!*\
!*** ./src/controller/subtitle-track-controller.ts ***!
\*****************************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),a=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),o=n(/*! ../types/loader */"./src/types/loader.ts");function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){var e,n;function a(e){var n;return(n=t.call(this,e,"[subtitle-track-controller]")||this).media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n);var c,h,d,f=a.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,t.prototype.destroy.call(this)},f.registerListeners=function(){var t=this.hls;t.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(r.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var t=this.hls;t.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(r.Events.ERROR,this.onError,this)},f.onMediaAttached=function(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},f.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},f.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),u(this.media.textTracks).forEach((function(t){Object(i.clearCurrentCues)(t)})),this.subtitleTrack=-1,this.media=null)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},f.onSubtitleTrackLoaded=function(t,e){var n=e.id,r=e.details,i=this.trackId,a=this.tracksInGroup[i];if(a){var o=a.details;a.details=e.details,this.log("subtitle track "+n+" loaded ["+r.startSN+"-"+r.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,e,o))}else this.warn("Invalid subtitle track id "+n)},f.onLevelLoading=function(t,e){this.switchLevel(e.level)},f.onLevelSwitching=function(t,e){this.switchLevel(e.level)},f.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var n=e.textGroupIds[e.urlId];if(this.groupId!==n){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,a=this.tracks.filter((function(t){return!n||t.groupId===n}));this.tracksInGroup=a;var o=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=n;var s={subtitleTracks:a};this.log("Updating subtitle tracks, "+a.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(r.Events.SUBTITLE_TRACKS_UPDATED,s),-1!==o&&this.setSubtitleTrack(o,i)}}},f.findTrackId=function(t){for(var e=this.tracksInGroup,n=0;n<e.length;n++){var r=e[n];if((!this.selectDefaultTrack||r.default)&&(!t||t===r.name))return r.id}return-1},f.onError=function(e,n){t.prototype.onError.call(this,e,n),!n.fatal&&n.context&&n.context.type===o.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},f.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var n=e.id,i=e.groupId,a=e.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(r.Events.SUBTITLE_TRACK_LOADING,{url:a,id:n,groupId:i,deliveryDirectives:t||null})}},f.toggleTrackModes=function(t){var e=this,n=this.media,r=this.subtitleDisplay,i=this.trackId;if(n){var a=u(n.textTracks),o=a.filter((function(t){return t.groupId===e.groupId}));if(-1===t)[].slice.call(a).forEach((function(t){t.mode="disabled"}));else{var s=o[i];s&&(s.mode="disabled")}var l=o[t];l&&(l.mode=r?"showing":"hidden")}},f.setSubtitleTrack=function(t,e){var n,i=this.tracksInGroup;if(this.media){if(this.trackId!==t&&this.toggleTrackModes(t),!(this.trackId===t&&(-1===t||null!==(n=i[t])&&void 0!==n&&n.details)||t<-1||t>=i.length)){this.clearTimer();var a=i[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,a){var o=a.id,s=a.groupId,l=void 0===s?"":s,c=a.name,u=a.type,h=a.url;this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:c,type:u,url:h});var d=this.switchParams(a.url,null==e?void 0:e.details);this.loadPlaylist(d)}else this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=u(this.media.textTracks),n=0;n<e.length;n++)if("hidden"===e[n].mode)t=n;else if("showing"===e[n].mode){t=n;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)}},c=a,(h=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}])&&s(c.prototype,h),d&&s(c,d),a}(a.default);function u(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];"subtitles"===r.kind&&r.label&&e.push(t[n])}return e}e.default=c},"./src/controller/timeline-controller.ts":
/*!***********************************************!*\
!*** ./src/controller/timeline-controller.ts ***!
\***********************************************/
/*! exports provided: TimelineController */function(t,e,n){"use strict";n.r(e),n.d(e,"TimelineController",(function(){return d}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../utils/cea-608-parser */"./src/utils/cea-608-parser.ts"),o=n(/*! ../utils/output-filter */"./src/utils/output-filter.ts"),s=n(/*! ../utils/webvtt-parser */"./src/utils/webvtt-parser.ts"),l=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),c=n(/*! ../utils/imsc1-ttml-parser */"./src/utils/imsc1-ttml-parser.ts"),u=n(/*! ../types/loader */"./src/types/loader.ts"),h=n(/*! ../utils/logger */"./src/utils/logger.ts"),d=function(){function t(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var e=new o.default(this,"textTrack1"),n=new o.default(this,"textTrack2"),r=new o.default(this,"textTrack3"),s=new o.default(this,"textTrack4");this.cea608Parser1=new a.default(1,e,n),this.cea608Parser2=new a.default(3,r,s)}t.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(i.Events.FRAG_LOADING,this.onFragLoading,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=t.prototype;return e.destroy=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(i.Events.FRAG_LOADING,this.onFragLoading,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(t,e,n,r,a){for(var o,s,l,c,u=!1,h=a.length;h--;){var d=a[h],f=(o=d[0],s=d[1],l=e,c=n,Math.min(s,c)-Math.max(o,l));if(f>=0&&(d[0]=Math.min(d[0],e),d[1]=Math.max(d[1],n),u=!0,f/(n-e)>.5))return}if(u||a.push([e,n]),this.config.renderTextTracksNatively){var p=this.captionsTracks[t];this.Cues.newCue(p,e,n,r)}else{var g=this.Cues.newCue(null,e,n,r);this.hls.trigger(i.Events.CUES_PARSED,{type:"captions",cues:g,track:t})}},e.onInitPtsFound=function(t,e){var n=this,r=e.frag,a=e.id,o=e.initPTS,s=e.timescale,l=this.unparsedVttFrags;"main"===a&&(this.initPTS[r.cc]=o,this.timescale[r.cc]=s),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){n.onFragLoaded(i.Events.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var n=0;n<e.textTracks.length;n++){var r=e.textTracks[n];if(r[t])return r}return null},e.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},e.createNativeTrack=function(t){if(!this.captionsTracks[t]){var e=this.captionsProperties,n=this.captionsTracks,r=this.media,i=e[t],a=i.label,o=i.languageCode,s=this.getExistingTrack(t);if(s)n[t]=s,Object(l.clearCurrentCues)(n[t]),Object(l.sendAddTrackEvent)(n[t],r);else{var c=this.createTextTrack("captions",a,o);c&&(c[t]=!0,n[t]=c)}}},e.createNonNativeTrack=function(t){if(!this.nonNativeCaptionsTracks[t]){var e=this.captionsProperties[t];if(e){var n={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=n,this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}}},e.createTextTrack=function(t,e,n){var r=this.media;if(r)return r.addTextTrack(t,e,n)},e.onMediaAttaching=function(t,e){this.media=e.media,this._cleanTracks()},e.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach((function(e){Object(l.clearCurrentCues)(t[e]),delete t[e]})),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var n=0;n<e.length;n++)Object(l.clearCurrentCues)(e[n])}},e.onSubtitleTracksUpdated=function(t,e){var n=this;this.textTracks=[];var r=e.subtitleTracks||[],a=r.some((function(t){return t.textCodec===c.IMSC1_CODEC}));if(this.config.enableWebVTT||a&&this.config.enableIMSC1){var o=this.tracks&&r&&this.tracks.length===r.length;if(this.tracks=r||[],this.config.renderTextTracksNatively){var s=this.media?this.media.textTracks:[];this.tracks.forEach((function(t,e){var r;if(e<s.length){for(var i=null,a=0;a<s.length;a++)if(f(s[a],t)){i=s[a];break}i&&(r=i)}r?Object(l.clearCurrentCues)(r):(r=n.createTextTrack("subtitles",t.name,t.lang))&&(r.mode="disabled"),r&&(r.groupId=t.groupId,n.textTracks.push(r))}))}else if(!o&&this.tracks&&this.tracks.length){var u=this.tracks.map((function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}}));this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},e.onManifestLoaded=function(t,e){var n=this;this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((function(t){var e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(e){var r="textTrack"+e[1],i=n.captionsProperties[r];i&&(i.label=t.name,t.lang&&(i.languageCode=t.lang),i.media=t)}}))},e.onFragLoading=function(t,e){var n=this.cea608Parser1,r=this.cea608Parser2,i=this.lastSn,a=this.lastPartIndex;if(this.enabled&&n&&r&&e.frag.type===u.PlaylistLevelType.MAIN){var o,s,l=e.frag.sn,c=null!=(o=null==e||null===(s=e.part)||void 0===s?void 0:s.index)?o:-1;l===i+1||l===i&&c===a+1||(n.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=c}},e.onFragLoaded=function(t,e){var n=e.frag,a=e.payload,o=this.initPTS,s=this.unparsedVttFrags;if(n.type===u.PlaylistLevelType.SUBTITLE)if(a.byteLength){if(!Object(r.isFiniteNumber)(o[n.cc]))return s.push(e),void(o.length&&this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Missing initial subtitle PTS")}));var l=n.decryptdata;if(null==l||null==l.key||"AES-128"!==l.method){var h=this.tracks[n.level],d=this.vttCCs;d[n.cc]||(d[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),h&&h.textCodec===c.IMSC1_CODEC?this._parseIMSC1(n,a):this._parseVTTs(n,a,d)}}else this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(t,e){var n=this,r=this.hls;Object(c.parseIMSC1)(e,this.initPTS[t.cc],this.timescale[t.cc],(function(e){n._appendCues(e,t.level),r.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(e){h.logger.log("Failed to parse IMSC1: "+e),r.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))},e._parseVTTs=function(t,e,n){var r=this,a=this.hls;Object(s.parseWebVTT)(e,this.initPTS[t.cc],this.timescale[t.cc],n,t.cc,t.start,(function(e){r._appendCues(e,t.level),a.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(n){r._fallbackToIMSC1(t,e),h.logger.log("Failed to parse VTT cue: "+n),a.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:n})}))},e._fallbackToIMSC1=function(t,e){var n=this,r=this.tracks[t.level];r.textCodec||Object(c.parseIMSC1)(e,this.initPTS[t.cc],this.timescale[t.cc],(function(){r.textCodec=c.IMSC1_CODEC,n._parseIMSC1(t,e)}),(function(){r.textCodec="wvtt"}))},e._appendCues=function(t,e){var n=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[e];if("disabled"===r.mode)return;t.forEach((function(t){return Object(l.addCueToTrack)(r,t)}))}else{var a=this.tracks[e].default?"default":"subtitles"+e;n.trigger(i.Events.CUES_PARSED,{type:"subtitles",cues:t,track:a})}},e.onFragDecrypted=function(t,e){var n=e.frag;if(n.type===u.PlaylistLevelType.SUBTITLE){if(!Object(r.isFiniteNumber)(this.initPTS[n.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(i.Events.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var n=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&n&&r)for(var i=0;i<e.samples.length;i++){var a=e.samples[i].bytes;if(a){var o=this.extractCea608Data(a);n.addData(e.samples[i].pts,o[0]),r.addData(e.samples[i].pts,o[1])}}},e.onBufferFlushing=function(t,e){var n=e.startOffset,r=e.endOffset,i=e.endOffsetSubtitles,a=e.type,o=this.media;if(o&&!(o.currentTime<r)){if(!a||"video"===a){var s=this.captionsTracks;Object.keys(s).forEach((function(t){return Object(l.removeCuesInRange)(s[t],n,r)}))}if(this.config.renderTextTracksNatively&&0===n&&void 0!==i){var c=this.textTracks;Object.keys(c).forEach((function(t){return Object(l.removeCuesInRange)(c[t],n,i)}))}}},e.extractCea608Data=function(t){for(var e=31&t[0],n=2,r=[[],[]],i=0;i<e;i++){var a=t[n++],o=127&t[n++],s=127&t[n++],l=3&a;0===o&&0===s||0!=(4&a)&&(0!==l&&1!==l||(r[l].push(o),r[l].push(s)))}return r},t}();function f(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}},"./src/crypt/aes-crypto.ts":
/*!*********************************!*\
!*** ./src/crypt/aes-crypto.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var r=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}()},"./src/crypt/aes-decryptor.ts":
/*!************************************!*\
!*** ./src/crypt/aes-decryptor.ts ***!
\************************************/
/*! exports provided: removePadding, default */function(t,e,n){"use strict";n.r(e),n.d(e,"removePadding",(function(){return i})),n.d(e,"default",(function(){return a}));var r=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts");function i(t){var e=t.byteLength,n=e&&new DataView(t.buffer).getUint8(e-1);return n?Object(r.sliceUint8)(t,0,e-n):t}var a=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),n=new Uint32Array(4),r=0;r<4;r++)n[r]=e.getUint32(4*r);return n},e.initTable=function(){var t=this.sBox,e=this.invSBox,n=this.subMix,r=n[0],i=n[1],a=n[2],o=n[3],s=this.invSubMix,l=s[0],c=s[1],u=s[2],h=s[3],d=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)d[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var m=p^p<<1^p<<2^p<<3^p<<4;m=m>>>8^255&m^99,t[f]=m,e[m]=f;var v=d[f],y=d[v],b=d[y],x=257*d[m]^16843008*m;r[f]=x<<24|x>>>8,i[f]=x<<16|x>>>16,a[f]=x<<8|x>>>24,o[f]=x,x=16843009*b^65537*y^257*v^16843008*f,l[m]=x<<24|x>>>8,c[m]=x<<16|x>>>16,u[m]=x<<8|x>>>24,h[m]=x,f?(f=v^d[d[d[b^v]]],p^=d[d[p]]):f=p=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),n=!0,r=0;r<e.length&&n;)n=e[r]===this.key[r],r++;if(!n){this.key=e;var i=this.keySize=e.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a,o,s,l,c=this.ksRows=4*(i+6+1),u=this.keySchedule=new Uint32Array(c),h=this.invKeySchedule=new Uint32Array(c),d=this.sBox,f=this.rcon,p=this.invSubMix,g=p[0],m=p[1],v=p[2],y=p[3];for(a=0;a<c;a++)a<i?s=u[a]=e[a]:(l=s,a%i==0?(l=d[(l=l<<8|l>>>24)>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l],l^=f[a/i|0]<<24):i>6&&a%i==4&&(l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l]),u[a]=s=(u[a-i]^l)>>>0);for(o=0;o<c;o++)a=c-o,l=3&o?u[a]:u[a-4],h[o]=o<4||a<=4?l:g[d[l>>>24]]^m[d[l>>>16&255]]^v[d[l>>>8&255]]^y[d[255&l]],h[o]=h[o]>>>0}},e.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},e.decrypt=function(t,e,n){for(var r,i,a,o,s,l,c,u,h,d,f,p,g,m,v=this.keySize+6,y=this.invKeySchedule,b=this.invSBox,x=this.invSubMix,S=x[0],C=x[1],E=x[2],w=x[3],k=this.uint8ArrayToUint32Array_(n),T=k[0],O=k[1],A=k[2],L=k[3],D=new Int32Array(t),R=new Int32Array(D.length),I=this.networkToHostOrderSwap;e<D.length;){for(h=I(D[e]),d=I(D[e+1]),f=I(D[e+2]),p=I(D[e+3]),s=h^y[0],l=p^y[1],c=f^y[2],u=d^y[3],g=4,m=1;m<v;m++)r=S[s>>>24]^C[l>>16&255]^E[c>>8&255]^w[255&u]^y[g],i=S[l>>>24]^C[c>>16&255]^E[u>>8&255]^w[255&s]^y[g+1],a=S[c>>>24]^C[u>>16&255]^E[s>>8&255]^w[255&l]^y[g+2],o=S[u>>>24]^C[s>>16&255]^E[l>>8&255]^w[255&c]^y[g+3],s=r,l=i,c=a,u=o,g+=4;r=b[s>>>24]<<24^b[l>>16&255]<<16^b[c>>8&255]<<8^b[255&u]^y[g],i=b[l>>>24]<<24^b[c>>16&255]<<16^b[u>>8&255]<<8^b[255&s]^y[g+1],a=b[c>>>24]<<24^b[u>>16&255]<<16^b[s>>8&255]<<8^b[255&l]^y[g+2],o=b[u>>>24]<<24^b[s>>16&255]<<16^b[l>>8&255]<<8^b[255&c]^y[g+3],R[e]=I(r^T),R[e+1]=I(o^O),R[e+2]=I(a^A),R[e+3]=I(i^L),T=h,O=d,A=f,L=p,e+=4}return R.buffer},t}()},"./src/crypt/decrypter.ts":
/*!********************************!*\
!*** ./src/crypt/decrypter.ts ***!
\********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return c}));var r=n(/*! ./aes-crypto */"./src/crypt/aes-crypto.ts"),i=n(/*! ./fast-aes-key */"./src/crypt/fast-aes-key.ts"),a=n(/*! ./aes-decryptor */"./src/crypt/aes-decryptor.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),c=function(){function t(t,e,n){var r=(void 0===n?{}:n).removePKCS7Padding,i=void 0===r||r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=t,this.config=e,this.removePKCS7Padding=i,i)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(t){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var e=t.prototype;return e.destroy=function(){this.observer=null},e.isSync=function(){return this.config.enableSoftwareAES},e.flush=function(){var t=this.currentResult;if(t){var e=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?Object(a.removePadding)(e):e}this.reset()},e.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},e.decrypt=function(t,e,n,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),e,n);var i=this.flush();i&&r(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),e,n).then(r)},e.softwareDecrypt=function(t,e,n){var r=this.currentIV,i=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(t=Object(s.appendUint8Array)(o,t),this.remainderData=null);var c=this.getValidChunk(t);if(!c.length)return null;r&&(n=r);var u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new a.default),u.expandKey(e);var h=i;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=Object(l.sliceUint8)(c,-16).buffer,h||null},e.webCryptoDecrypt=function(t,e,n){var a=this,o=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new i.default(o,e)),this.fastAesKey.expandKey().then((function(e){return o?new r.default(o,n).decrypt(t.buffer,e):Promise.reject(new Error("web crypto not initialized"))})).catch((function(r){return a.onWebCryptoError(r,t,e,n)}))},e.onWebCryptoError=function(t,e,n,r){return o.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(e,n,r)},e.getValidChunk=function(t){var e=t,n=t.length-t.length%16;return n!==t.length&&(e=Object(l.sliceUint8)(t,0,n),this.remainderData=Object(l.sliceUint8)(t,n)),e},e.logOnce=function(t){this.logEnabled&&(o.logger.log("[decrypter.ts]: "+t),this.logEnabled=!1)},t}()},"./src/crypt/fast-aes-key.ts":
/*!***********************************!*\
!*** ./src/crypt/fast-aes-key.ts ***!
\***********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var r=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}()},"./src/demux/aacdemuxer.ts":
/*!*********************************!*\
!*** ./src/demux/aacdemuxer.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),i=n(/*! ./adts */"./src/demux/adts.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! ../demux/id3 */"./src/demux/id3.ts");function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=function(t){var e,n;function r(e,n){var r;return(r=t.call(this)||this).observer=void 0,r.config=void 0,r.observer=e,r.config=n,r}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,s(e,n);var l=r.prototype;return l.resetInitSegment=function(e,n,r){t.prototype.resetInitSegment.call(this,e,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(t){if(!t)return!1;for(var e=(o.getID3Data(t,0)||[]).length,n=t.length;e<n;e++)if(i.probe(t,e))return a.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(t,e){return i.canParse(t,e)},l.appendFrame=function(t,e,n){i.initTrackConfig(t,this.observer,e,n,t.manifestCodec);var r=i.appendFrame(t,e,n,this.initPTS,this.frameIndex);if(r&&0===r.missing)return r},r}(r.default);l.minProbeByteLength=9,e.default=l},"./src/demux/adts.ts":
/*!***************************!*\
!*** ./src/demux/adts.ts ***!
\***************************/
/*! exports provided: getAudioConfig, isHeaderPattern, getHeaderLength, getFullFrameLength, canGetFrameLength, isHeader, canParse, probe, initTrackConfig, getFrameDuration, parseFrameHeader, appendFrame */function(t,e,n){"use strict";n.r(e),n.d(e,"getAudioConfig",(function(){return o})),n.d(e,"isHeaderPattern",(function(){return s})),n.d(e,"getHeaderLength",(function(){return l})),n.d(e,"getFullFrameLength",(function(){return c})),n.d(e,"canGetFrameLength",(function(){return u})),n.d(e,"isHeader",(function(){return h})),n.d(e,"canParse",(function(){return d})),n.d(e,"probe",(function(){return f})),n.d(e,"initTrackConfig",(function(){return p})),n.d(e,"getFrameDuration",(function(){return g})),n.d(e,"parseFrameHeader",(function(){return m})),n.d(e,"appendFrame",(function(){return v}));var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=n(/*! ../errors */"./src/errors.ts"),a=n(/*! ../events */"./src/events.ts");function o(t,e,n,o){var s,l,c,u,h=navigator.userAgent.toLowerCase(),d=o,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[n+2])>>>6);var p=(60&e[n+2])>>>2;if(!(p>f.length-1))return c=(1&e[n+2])<<2,c|=(192&e[n+3])>>>6,r.logger.log("manifest codec:"+o+", ADTS type:"+s+", samplingIndex:"+p),/firefox/i.test(h)?p>=6?(s=5,u=new Array(4),l=p-3):(s=2,u=new Array(2),l=p):-1!==h.indexOf("android")?(s=2,u=new Array(2),l=p):(s=5,u=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&p>=6?l=p-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(p>=6&&1===c||/vivaldi/i.test(h))||!o&&1===c)&&(s=2,u=new Array(2)),l=p)),u[0]=s<<3,u[0]|=(14&p)>>1,u[1]|=(1&p)<<7,u[1]|=c<<3,5===s&&(u[1]|=(14&l)>>1,u[2]=(1&l)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:f[p],channelCount:c,codec:"mp4a.40."+s,manifestCodec:d};t.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function s(t,e){return 255===t[e]&&240==(246&t[e+1])}function l(t,e){return 1&t[e+1]?7:9}function c(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function u(t,e){return e+5<t.length}function h(t,e){return e+1<t.length&&s(t,e)}function d(t,e){return u(t,e)&&s(t,e)&&c(t,e)<=t.length-e}function f(t,e){if(h(t,e)){var n=l(t,e);if(e+n>=t.length)return!1;var r=c(t,e);if(r<=n)return!1;var i=e+r;return i===t.length||h(t,i)}return!1}function p(t,e,n,i,a){if(!t.samplerate){var s=o(e,n,i,a);if(!s)return;t.config=s.config,t.samplerate=s.samplerate,t.channelCount=s.channelCount,t.codec=s.codec,t.manifestCodec=s.manifestCodec,r.logger.log("parsed codec:"+t.codec+", rate:"+s.samplerate+", channels:"+s.channelCount)}}function g(t){return 9216e4/t}function m(t,e,n,r,i){var a=l(t,e),o=c(t,e);if((o-=a)>0)return{headerLength:a,frameLength:o,stamp:n+r*i}}function v(t,e,n,r,i){var a=m(e,n,r,i,g(t.samplerate));if(a){var o,s=a.frameLength,l=a.headerLength,c=a.stamp,u=l+s,h=Math.max(0,n+u-e.length);h?(o=new Uint8Array(u-l)).set(e.subarray(n+l,e.length),0):o=e.subarray(n+l,n+u);var d={unit:o,pts:c};return h||t.samples.push(d),{sample:d,length:u,missing:h}}}},"./src/demux/base-audio-demuxer.ts":
/*!*****************************************!*\
!*** ./src/demux/base-audio-demuxer.ts ***!
\*****************************************/
/*! exports provided: initPTSFn, default */function(t,e,n){"use strict";n.r(e),n.d(e,"initPTSFn",(function(){return c}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../demux/id3 */"./src/demux/id3.ts"),a=n(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),o=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),s=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),l=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,n){},e.demux=function(t,e){this.cachedData&&(t=Object(o.appendUint8Array)(this.cachedData,t),this.cachedData=null);var n,r,l=i.getID3Data(t,0),u=l?l.length:0,h=this._audioTrack,d=this._id3Track,f=l?i.getTimeStamp(l):void 0,p=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=c(f,e)),l&&l.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),r=this.initPTS;u<p;){if(this.canParse(t,u)){var g=this.appendFrame(h,t,u);g?(this.frameIndex++,r=g.sample.pts,n=u+=g.length):u=p}else i.canParse(t,u)?(l=i.getID3Data(t,u),d.samples.push({pts:r,dts:r,data:l}),n=u+=l.length):u++;if(u===p&&n!==p){var m=Object(s.sliceUint8)(t,n);this.cachedData?this.cachedData=Object(o.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:h,avcTrack:Object(a.dummyTrack)(),id3Track:d,textTrack:Object(a.dummyTrack)()}},e.demuxSampleAes=function(t,e,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},e.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(a.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(a.dummyTrack)()}},e.destroy=function(){},t}(),c=function(t,e){return Object(r.isFiniteNumber)(t)?90*t:9e4*e};e.default=l},"./src/demux/chunk-cache.ts":
/*!**********************************!*\
!*** ./src/demux/chunk-cache.ts ***!
\**********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var r=function(){function t(){this.chunks=[],this.dataLength=0}var e=t.prototype;return e.push=function(t){this.chunks.push(t),this.dataLength+=t.length},e.flush=function(){var t,e=this.chunks,n=this.dataLength;return e.length?(t=1===e.length?e[0]:function(t,e){for(var n=new Uint8Array(e),r=0,i=0;i<t.length;i++){var a=t[i];n.set(a,r),r+=a.length}return n}(e,n),this.reset(),t):new Uint8Array(0)},e.reset=function(){this.chunks.length=0,this.dataLength=0},t}()},"./src/demux/dummy-demuxed-track.ts":
/*!******************************************!*\
!*** ./src/demux/dummy-demuxed-track.ts ***!
\******************************************/
/*! exports provided: dummyTrack */function(t,e,n){"use strict";function r(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}n.r(e),n.d(e,"dummyTrack",(function(){return r}))},"./src/demux/exp-golomb.ts":
/*!*********************************!*\
!*** ./src/demux/exp-golomb.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=function(){function t(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var e=t.prototype;return e.loadWord=function(){var t=this.data,e=this.bytesAvailable,n=t.byteLength-e,r=new Uint8Array(4),i=Math.min(4,e);if(0===i)throw new Error("no bytes available");r.set(t.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},e.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),n=this.word>>>32-e;return t>32&&r.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?n<<e|this.readBits(e):n},e.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,n=8,r=0;r<t;r++)0!==n&&(n=(e+this.readEG()+256)%256),e=0===n?e:n},e.readSPS=function(){var t,e,n,r=0,i=0,a=0,o=0,s=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);s();var g=s();if(l(5),h(3),s(),f(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){var m=c();if(3===m&&h(1),f(),f(),h(1),u())for(e=3!==m?8:12,n=0;n<e;n++)u()&&p(n<6?16:64)}f();var v=c();if(0===v)c();else if(1===v)for(h(1),d(),d(),t=c(),n=0;n<t;n++)d();f(),h(1);var y=c(),b=c(),x=l(1);0===x&&h(1),h(1),u()&&(r=c(),i=c(),a=c(),o=c());var S=[1,1];if(u()&&u())switch(s()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[s()<<8|s(),s()<<8|s()]}return{width:Math.ceil(16*(y+1)-2*r-2*i),height:(2-x)*(b+1)*16-(x?2:4)*(a+o),pixelRatio:S}},e.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}();e.default=i},"./src/demux/id3.ts":
/*!**************************!*\
!*** ./src/demux/id3.ts ***!
\**************************/
/*! exports provided: isHeader, isFooter, getID3Data, canParse, getTimeStamp, isTimeStampFrame, getID3Frames, decodeFrame, utf8ArrayToStr, testables */function(t,e,n){"use strict";n.r(e),n.d(e,"isHeader",(function(){return i})),n.d(e,"isFooter",(function(){return a})),n.d(e,"getID3Data",(function(){return o})),n.d(e,"canParse",(function(){return l})),n.d(e,"getTimeStamp",(function(){return c})),n.d(e,"isTimeStampFrame",(function(){return u})),n.d(e,"getID3Frames",(function(){return d})),n.d(e,"decodeFrame",(function(){return f})),n.d(e,"utf8ArrayToStr",(function(){return y})),n.d(e,"testables",(function(){return b}));var r,i=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},a=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},o=function(t,e){for(var n=e,r=0;i(t,e);)r+=10,r+=s(t,e+6),a(t,e+10)&&(r+=10),e+=r;if(r>0)return t.subarray(n,n+r)},s=function(t,e){var n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3]},l=function(t,e){return i(t,e)&&s(t,e+6)+10<=t.length-e},c=function(t){for(var e=d(t),n=0;n<e.length;n++){var r=e[n];if(u(r))return v(r)}},u=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},h=function(t){var e=String.fromCharCode(t[0],t[1],t[2],t[3]),n=s(t,4);return{type:e,size:n,data:t.subarray(10,10+n)}},d=function(t){for(var e=0,n=[];i(t,e);){for(var r=s(t,e+6),o=(e+=10)+r;e+8<o;){var l=h(t.subarray(e)),c=f(l);c&&n.push(c),e+=l.size+10}a(t,e)&&(e+=10)}return n},f=function(t){return"PRIV"===t.type?p(t):"W"===t.type[0]?m(t):g(t)},p=function(t){if(!(t.size<2)){var e=y(t.data,!0),n=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:n.buffer}}},g=function(t){if(!(t.size<2)){if("TXXX"===t.type){var e=1,n=y(t.data.subarray(e),!0);e+=n.length+1;var r=y(t.data.subarray(e));return{key:t.type,info:n,data:r}}var i=y(t.data.subarray(1));return{key:t.type,data:i}}},m=function(t){if("WXXX"===t.type){if(t.size<2)return;var e=1,n=y(t.data.subarray(e),!0);e+=n.length+1;var r=y(t.data.subarray(e));return{key:t.type,info:n,data:r}}var i=y(t.data);return{key:t.type,data:i}},v=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),n=1&e[3],r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}},y=function(t,e){void 0===e&&(e=!1);var n=x();if(n){var r=n.decode(t);if(e){var i=r.indexOf("\0");return-1!==i?r.substring(0,i):r}return r.replace(/\0/g,"")}for(var a,o,s,l=t.length,c="",u=0;u<l;){if(0===(a=t[u++])&&e)return c;if(0!==a&&3!==a)switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(a);break;case 12:case 13:o=t[u++],c+=String.fromCharCode((31&a)<<6|63&o);break;case 14:o=t[u++],s=t[u++],c+=String.fromCharCode((15&a)<<12|(63&o)<<6|(63&s)<<0)}}return c},b={decodeTextFrame:g};function x(){return r||void 0===self.TextDecoder||(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":
/*!*********************************!*\
!*** ./src/demux/mp3demuxer.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),i=n(/*! ../demux/id3 */"./src/demux/id3.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! ./mpegaudio */"./src/demux/mpegaudio.ts");function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=function(t){var e,n;function r(){return t.apply(this,arguments)||this}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,s(e,n);var l=r.prototype;return l.resetInitSegment=function(e,n,r){t.prototype.resetInitSegment.call(this,e,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(t){if(!t)return!1;for(var e=(i.getID3Data(t,0)||[]).length,n=t.length;e<n;e++)if(o.probe(t,e))return a.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(t,e){return o.canParse(t,e)},l.appendFrame=function(t,e,n){if(null!==this.initPTS)return o.appendFrame(t,e,n,this.initPTS,this.frameIndex)},r}(r.default);l.minProbeByteLength=4,e.default=l},"./src/demux/mp4demuxer.ts":
/*!*********************************!*\
!*** ./src/demux/mp4demuxer.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),i=n(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),a=function(){function t(t,e){this.remainderData=null,this.config=void 0,this.config=e}var e=t.prototype;return e.resetTimeStamp=function(){},e.resetInitSegment=function(){},e.resetContiguity=function(){},t.probe=function(t){return Object(r.findBox)({data:t,start:0,end:Math.min(t.length,16384)},["moof"]).length>0},e.demux=function(t){var e=t,n=Object(i.dummyTrack)();if(this.config.progressive){this.remainderData&&(e=Object(r.appendUint8Array)(this.remainderData,t));var a=Object(r.segmentValidRange)(e);this.remainderData=a.remainder,n.samples=a.valid||new Uint8Array}else n.samples=e;return{audioTrack:Object(i.dummyTrack)(),avcTrack:n,id3Track:Object(i.dummyTrack)(),textTrack:Object(i.dummyTrack)()}},e.flush=function(){var t=Object(i.dummyTrack)();return t.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(i.dummyTrack)(),avcTrack:t,id3Track:Object(i.dummyTrack)(),textTrack:Object(i.dummyTrack)()}},e.demuxSampleAes=function(t,e,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();a.minProbeByteLength=1024,e.default=a},"./src/demux/mpegaudio.ts":
/*!********************************!*\
!*** ./src/demux/mpegaudio.ts ***!
\********************************/
/*! exports provided: appendFrame, parseHeader, isHeaderPattern, isHeader, canParse, probe */function(t,e,n){"use strict";n.r(e),n.d(e,"appendFrame",(function(){return l})),n.d(e,"parseHeader",(function(){return c})),n.d(e,"isHeaderPattern",(function(){return u})),n.d(e,"isHeader",(function(){return h})),n.d(e,"canParse",(function(){return d})),n.d(e,"probe",(function(){return f}));var r=null,i=[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],a=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],o=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],s=[0,1,1,4];function l(t,e,n,r,i){if(!(n+24>e.length)){var a=c(e,n);if(a&&n+a.frameLength<=e.length){var o=r+i*(9e4*a.samplesPerFrame/a.sampleRate),s={unit:e.subarray(n,n+a.frameLength),pts:o,dts:o};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(s),{sample:s,length:a.frameLength,missing:0}}}}function c(t,e){var n=t[e+1]>>3&3,l=t[e+1]>>1&3,c=t[e+2]>>4&15,u=t[e+2]>>2&3;if(1!==n&&0!==c&&15!==c&&3!==u){var h=t[e+2]>>1&1,d=t[e+3]>>6,f=1e3*i[14*(3===n?3-l:3===l?3:4)+c-1],p=a[3*(3===n?0:2===n?1:2)+u],g=3===d?1:2,m=o[n][l],v=s[l],y=8*m*v,b=Math.floor(m*f/p+h)*v;if(null===r){var x=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);r=x?parseInt(x[1]):0}return!!r&&r<=87&&2===l&&f>=224e3&&0===d&&(t[e+3]=128|t[e+3]),{sampleRate:p,channelCount:g,frameLength:b,samplesPerFrame:y}}}function u(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function h(t,e){return e+1<t.length&&u(t,e)}function d(t,e){return u(t,e)&&4<=t.length-e}function f(t,e){if(e+1<t.length&&u(t,e)){var n=c(t,e),r=4;null!=n&&n.frameLength&&(r=n.frameLength);var i=e+r;return i===t.length||h(t,i)}return!1}},"./src/demux/sample-aes.ts":
/*!*********************************!*\
!*** ./src/demux/sample-aes.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),i=n(/*! ./tsdemuxer */"./src/demux/tsdemuxer.ts"),a=function(){function t(t,e,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new r.default(t,e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,e)},e.decryptAacSample=function(t,e,n,r){var i=t[e].unit,a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,(function(a){var o=new Uint8Array(a);i.set(o,16),r||s.decryptAacSamples(t,e+1,n)}))},e.decryptAacSamples=function(t,e,n){for(;;e++){if(e>=t.length)return void n();if(!(t[e].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(t,e,n,r),!r)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,n=new Int8Array(e),r=0,i=32;i<=t.length-16;i+=160,r+=16)n.set(t.subarray(i,i+16),r);return n},e.getAvcDecryptedUnit=function(t,e){for(var n=new Uint8Array(e),r=0,i=32;i<=t.length-16;i+=160,r+=16)t.set(n.subarray(r,r+16),i);return t},e.decryptAvcSample=function(t,e,n,r,a,o){var s=Object(i.discardEPB)(a.data),l=this.getAvcEncryptedData(s),c=this;this.decryptBuffer(l.buffer,(function(i){a.data=c.getAvcDecryptedUnit(s,i),o||c.decryptAvcSamples(t,e,n+1,r)}))},e.decryptAvcSamples=function(t,e,n,r){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,n=0){if(e>=t.length)return void r();for(var i=t[e].units;!(n>=i.length);n++){var a=i[n];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,n,r,a,o),!o)return}}}},t}();e.default=a},"./src/demux/transmuxer-interface.ts":
/*!*******************************************!*\
!*** ./src/demux/transmuxer-interface.ts ***!
\*******************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var r=n(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../errors */"./src/errors.ts"),l=n(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),u=Object(l.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function t(t,e,n,l){var h=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=t,this.id=e,this.onTransmuxComplete=n,this.onFlush=l;var d=t.config,f=function(e,n){(n=n||{}).frag=h.frag,n.id=h.id,t.trigger(e,n)};this.observer=new c.EventEmitter,this.observer.on(i.Events.FRAG_DECRYPTED,f),this.observer.on(i.Events.ERROR,f);var p={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(d.enableWorker&&"undefined"!=typeof Worker){var m;o.logger.log("demuxing in webworker");try{m=this.worker=r(/*! ../demux/transmuxer-worker.ts */"./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(e){t.trigger(i.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},m.postMessage({cmd:"init",typeSupported:p,vendor:g,id:e,config:JSON.stringify(d)})}catch(t){o.logger.warn("Error in worker:",t),o.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new a.default(this.observer,p,d,g,e),this.worker=null}}else this.transmuxer=new a.default(this.observer,p,d,g,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},e.push=function(t,e,n,r,i,s,l,c,u,h){var d=this;u.transmuxing.start=self.performance.now();var f=this.transmuxer,p=this.worker,g=s?s.start:i.start,m=i.decryptdata,v=this.frag,y=!(v&&i.cc===v.cc),b=!(v&&u.level===v.level),x=v?u.sn-v.sn:-1,S=this.part?u.part-this.part.index:1,C=!b&&(1===x||0===x&&1===S),E=self.performance.now();(b||x||0===i.stats.parsing.start)&&(i.stats.parsing.start=E),!s||!S&&C||(s.stats.parsing.start=E);var w=new a.TransmuxState(y,C,c,b,g);if(!C||y){o.logger.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+y+"\n trackSwitch: "+b+"\n contiguous: "+C+"\n accurateTimeOffset: "+c+"\n timeOffset: "+g);var k=new a.TransmuxConfig(n,r,e,l,h);this.configureTransmuxer(k)}if(this.frag=i,this.part=s,p)p.postMessage({cmd:"demux",data:t,decryptdata:m,chunkMeta:u,state:w},t instanceof ArrayBuffer?[t]:[]);else if(f){var T=f.push(t,m,u,w);Object(a.isPromise)(T)?T.then((function(t){d.handleTransmuxComplete(t)})):this.handleTransmuxComplete(T)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var n=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:t});else if(n){var i=n.flush(t);Object(a.isPromise)(i)?i.then((function(n){e.handleFlushResult(n,t)})):this.handleFlushResult(i,t)}},e.handleFlushResult=function(t,e){var n=this;t.forEach((function(t){n.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,n=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,n.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,n=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):n&&n.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}()},"./src/demux/transmuxer-worker.ts":
/*!****************************************!*\
!*** ./src/demux/transmuxer-worker.ts ***!
\****************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return s}));var r=n(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js");function s(t){var e=new o.EventEmitter,n=function(e,n){t.postMessage({event:e,data:n})};e.on(i.Events.FRAG_DECRYPTED,n),e.on(i.Events.ERROR,n),t.addEventListener("message",(function(i){var o=i.data;switch(o.cmd){case"init":var s=JSON.parse(o.config);t.transmuxer=new r.default(e,o.typeSupported,s,o.vendor,o.id),Object(a.enableLogs)(s.debug),n("init",null);break;case"configure":t.transmuxer.configure(o.config);break;case"demux":var c=t.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(r.isPromise)(c)?c.then((function(e){l(t,e)})):l(t,c);break;case"flush":var h=o.chunkMeta,d=t.transmuxer.flush(h);Object(r.isPromise)(d)?d.then((function(e){u(t,e,h)})):u(t,d,h)}}))}function l(t,e){if((n=e.remuxResult).audio||n.video||n.text||n.id3||n.initSegment){var n,r=[],i=e.remuxResult,a=i.audio,o=i.video;a&&c(r,a),o&&c(r,o),t.postMessage({event:"transmuxComplete",data:e},r)}}function c(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function u(t,e,n){e.forEach((function(e){l(t,e)})),t.postMessage({event:"flush",data:n})}},"./src/demux/transmuxer.ts":
/*!*********************************!*\
!*** ./src/demux/transmuxer.ts ***!
\*********************************/
/*! exports provided: default, isPromise, TransmuxConfig, TransmuxState */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y})),n.d(e,"isPromise",(function(){return x})),n.d(e,"TransmuxConfig",(function(){return S})),n.d(e,"TransmuxState",(function(){return C}));var r,i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),s=n(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.ts"),l=n(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.ts"),c=n(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.ts"),u=n(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.ts"),h=n(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),d=n(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.ts"),f=n(/*! ./chunk-cache */"./src/demux/chunk-cache.ts"),p=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),g=n(/*! ../utils/logger */"./src/utils/logger.ts");try{r=self.performance.now.bind(self.performance)}catch(t){g.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var m=[{demux:c.default,remux:h.default},{demux:l.default,remux:d.default},{demux:s.default,remux:h.default},{demux:u.default,remux:h.default}],v=1024;m.forEach((function(t){var e=t.demux;v=Math.max(v,e.minProbeByteLength)}));var y=function(){function t(t,e,n,r,i){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 f.default,this.observer=t,this.typeSupported=e,this.config=n,this.vendor=r,this.id=i}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,n,i){var a=this,o=n.transmuxing;o.executeStart=r();var s=new Uint8Array(t),l=this.cache,c=this.config,u=this.currentTransmuxState,h=this.transmuxConfig;i&&(this.currentTransmuxState=i);var d=function(t,e){var n=null;return t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(n=e),n}(s,e);if(d&&"AES-128"===d.method){var f=this.getDecrypter();if(!c.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(s,d.key.buffer,d.iv.buffer).then((function(t){var e=a.push(t,null,n);return a.decryptionPromise=null,e})),this.decryptionPromise;var g=f.softwareDecrypt(s,d.key.buffer,d.iv.buffer);if(!g)return o.executeEnd=r(),b(n);s=new Uint8Array(g)}var m=i||u,v=m.contiguous,y=m.discontinuity,x=m.trackSwitch,S=m.accurateTimeOffset,C=m.timeOffset,E=h.audioCodec,w=h.videoCodec,k=h.defaultInitPts,T=h.duration,O=h.initSegmentData;if((y||x)&&this.resetInitSegment(O,E,w,T),y&&this.resetInitialTimestamp(k),v||this.resetContiguity(),this.needsProbing(s,y,x)){if(l.dataLength){var A=l.flush();s=Object(p.appendUint8Array)(A,s)}this.configureTransmuxer(s,h)}var L=this.transmux(s,d,C,S,n),D=this.currentTransmuxState;return D.contiguous=!0,D.discontinuity=!1,D.trackSwitch=!1,o.executeEnd=r(),L},e.flush=function(t){var e=this,n=t.transmuxing;n.executeStart=r();var o=this.decrypter,s=this.cache,l=this.currentTransmuxState,c=this.decryptionPromise;if(c)return c.then((function(){return e.flush(t)}));var u=[],h=l.timeOffset;if(o){var d=o.flush();d&&u.push(this.push(d,null,t))}var f=s.dataLength;s.reset();var p=this.demuxer,g=this.remuxer;if(!p||!g)return f>=v&&this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),n.executeEnd=r(),[b(t)];var m=p.flush(h);return x(m)?m.then((function(n){return e.flushRemux(u,n,t),u})):(this.flushRemux(u,m,t),u)},e.flushRemux=function(t,e,n){var i=e.audioTrack,a=e.avcTrack,o=e.id3Track,s=e.textTrack,l=this.currentTransmuxState,c=l.accurateTimeOffset,u=l.timeOffset;g.logger.log("[transmuxer.ts]: Flushed fragment "+n.sn+(n.part>-1?" p: "+n.part:"")+" of level "+n.level);var h=this.remuxer.remux(i,a,o,s,u,c,!0,this.id);t.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=r()},e.resetInitialTimestamp=function(t){var e=this.demuxer,n=this.remuxer;e&&n&&(e.resetTimeStamp(t),n.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,n,r){var i=this.demuxer,a=this.remuxer;i&&a&&(i.resetInitSegment(e,n,r),a.resetInitSegment(t,e,n))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,n,r,i){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,n,r,i):this.transmuxUnencrypted(t,n,r,i)},e.transmuxUnencrypted=function(t,e,n,r){var i=this.demuxer.demux(t,e,!1,!this.config.progressive),a=i.audioTrack,o=i.avcTrack,s=i.id3Track,l=i.textTrack;return{remuxResult:this.remuxer.remux(a,o,s,l,e,n,!1,this.id),chunkMeta:r}},e.transmuxSampleAes=function(t,e,n,r,i){var a=this;return this.demuxer.demuxSampleAes(t,e,n).then((function(t){return{remuxResult:a.remuxer.remux(t.audioTrack,t.avcTrack,t.id3Track,t.textTrack,n,r,!1,a.id),chunkMeta:i}}))},e.configureTransmuxer=function(t,e){for(var n,r=this.config,i=this.observer,a=this.typeSupported,o=this.vendor,s=e.audioCodec,c=e.defaultInitPts,u=e.duration,h=e.initSegmentData,f=e.videoCodec,p=0,v=m.length;p<v;p++)if(m[p].demux.probe(t)){n=m[p];break}n||(g.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),n={demux:l.default,remux:d.default});var y=this.demuxer,b=this.remuxer,x=n.remux,S=n.demux;b&&b instanceof x||(this.remuxer=new x(i,r,a,o)),y&&y instanceof S||(this.demuxer=new S(i,r,a),this.probe=S.probe),this.resetInitSegment(h,s,f,u),this.resetInitialTimestamp(c)},e.needsProbing=function(t,e,n){return!this.demuxer||!this.remuxer||e||n},e.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new o.default(this.observer,this.config)),t},t}(),b=function(t){return{remuxResult:{},chunkMeta:t}};function x(t){return"then"in t&&t.then instanceof Function}var S=function(t,e,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i},C=function(t,e,n,r,i){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i}},"./src/demux/tsdemuxer.ts":
/*!********************************!*\
!*** ./src/demux/tsdemuxer.ts ***!
\********************************/
/*! exports provided: discardEPB, default */function(t,e,n){"use strict";n.r(e),n.d(e,"discardEPB",(function(){return x}));var r=n(/*! ./adts */"./src/demux/adts.ts"),i=n(/*! ./mpegaudio */"./src/demux/mpegaudio.ts"),a=n(/*! ./exp-golomb */"./src/demux/exp-golomb.ts"),o=n(/*! ./id3 */"./src/demux/id3.ts"),s=n(/*! ./sample-aes */"./src/demux/sample-aes.ts"),l=n(/*! ../events */"./src/events.ts"),c=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),u=n(/*! ../utils/logger */"./src/utils/logger.ts"),h=n(/*! ../errors */"./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},f=function(){function t(t,e,n){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=n}t.probe=function(e){var n=t.syncOffset(e);return!(n<0||(n&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+n+", junk ahead ?"),0))},t.syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),n=0;n<e;){if(71===t[n]&&71===t[n+188]&&71===t[n+376])return n;n++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:d[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,n,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video",r),this._audioTrack=t.createTrack("audio",r),this._id3Track=t.createTrack("id3",r),this._txtTrack=t.createTrack("text",r),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=e,this.videoCodec=n,this._duration=r},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,n=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},e.demux=function(e,n,r,i){var a;void 0===r&&(r=!1),void 0===i&&(i=!1),r||(this.sampleAes=null);var o=this._avcTrack,s=this._audioTrack,d=this._id3Track,f=o.pid,p=o.pesData,y=s.pid,b=d.pid,x=s.pesData,S=d.pesData,C=!1,E=this.pmtParsed,w=this._pmtId,k=e.length;if(this.remainderData&&(k=(e=Object(c.appendUint8Array)(this.remainderData,e)).length,this.remainderData=null),k<188&&!i)return this.remainderData=e,{audioTrack:s,avcTrack:o,id3Track:d,textTrack:this._txtTrack};var T=Math.max(0,t.syncOffset(e));(k-=(k+T)%188)<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,k,e.buffer.byteLength-k));for(var O=T;O<k;O+=188)if(71===e[O]){var A=!!(64&e[O+1]),L=((31&e[O+1])<<8)+e[O+2],D=void 0;if((48&e[O+3])>>4>1){if((D=O+5+e[O+4])===O+188)continue}else D=O+4;switch(L){case f:A&&(p&&(a=v(p))&&this.parseAVCPES(a,!1),p={data:[],size:0}),p&&(p.data.push(e.subarray(D,O+188)),p.size+=O+188-D);break;case y:A&&(x&&(a=v(x))&&(s.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),x={data:[],size:0}),x&&(x.data.push(e.subarray(D,O+188)),x.size+=O+188-D);break;case b:A&&(S&&(a=v(S))&&this.parseID3PES(a),S={data:[],size:0}),S&&(S.data.push(e.subarray(D,O+188)),S.size+=O+188-D);break;case 0:A&&(D+=e[D]+1),w=this._pmtId=g(e,D);break;case w:A&&(D+=e[D]+1);var R=m(e,D,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,r);(f=R.avc)>0&&(o.pid=f),(y=R.audio)>0&&(s.pid=y,s.isAAC=R.isAAC),(b=R.id3)>0&&(d.pid=b),C&&!E&&(u.logger.log("reparse from beginning"),C=!1,O=T-188),E=this.pmtParsed=!0;break;case 17:case 8191:break;default:C=!0}}else this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});o.pesData=p,s.pesData=x,d.pesData=S;var I={audioTrack:s,avcTrack:o,id3Track:d,textTrack:this._txtTrack};return i&&this.extractRemainingSamples(I),I},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,n=t.audioTrack,r=t.avcTrack,i=t.id3Track,a=r.pesData,o=n.pesData,s=i.pesData;a&&(e=v(a))?(this.parseAVCPES(e,!0),r.pesData=null):r.pesData=a,o&&(e=v(o))?(n.isAAC?this.parseAACPES(e):this.parseMPEGPES(e),n.pesData=null):(null!=o&&o.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData=o),s&&(e=v(s))?(this.parseID3PES(e),i.pesData=null):i.pesData=s},e.demuxSampleAes=function(t,e,n){var r=this.demux(t,n,!0,!this.config.progressive),i=this.sampleAes=new s.default(this.observer,this.config,e);return this.decrypt(r,i)},e.decrypt=function(t,e){return new Promise((function(n){var r=t.audioTrack,i=t.avcTrack;r.samples&&r.isAAC?e.decryptAacSamples(r.samples,0,(function(){i.samples?e.decryptAvcSamples(i.samples,0,0,(function(){n(t)})):n(t)})):i.samples&&e.decryptAvcSamples(i.samples,0,0,(function(){n(t)}))}))},e.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},e.parseAVCPES=function(t,e){var n,r=this,i=this._avcTrack,s=this.parseAVCNALu(t.data),l=this.avcSample,c=!1;t.data=null,l&&s.length&&!i.audFound&&(y(l,i),l=this.avcSample=p(!1,t.pts,t.dts,"")),s.forEach((function(e){switch(e.type){case 1:n=!0,l||(l=r.avcSample=p(!0,t.pts,t.dts,"")),l.frame=!0;var s=e.data;if(c&&s.length>4){var u=new a.default(s).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:n=!0,l||(l=r.avcSample=p(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0;var h=new a.default(x(e.data));h.readUByte();for(var d=0,f=0,g=!1,m=0;!g&&h.bytesAvailable>1;){d=0;do{d+=m=h.readUByte()}while(255===m);f=0;do{f+=m=h.readUByte()}while(255===m);if(4===d&&0!==h.bytesAvailable){if(g=!0,181===h.readUByte()&&49===h.readUShort()&&1195456820===h.readUInt()&&3===h.readUByte()){for(var v=h.readUByte(),S=31&v,C=[v,h.readUByte()],E=0;E<S;E++)C.push(h.readUByte()),C.push(h.readUByte()),C.push(h.readUByte());b(r._txtTrack.samples,{type:3,pts:t.pts,bytes:C})}}else if(5===d&&0!==h.bytesAvailable){if(g=!0,f>16){for(var w=[],k=0;k<16;k++)w.push(h.readUByte().toString(16)),3!==k&&5!==k&&7!==k&&9!==k||w.push("-");for(var T=f-16,O=new Uint8Array(T),A=0;A<T;A++)O[A]=h.readUByte();b(r._txtTrack.samples,{pts:t.pts,payloadType:d,uuid:w.join(""),userData:Object(o.utf8ArrayToStr)(O),userDataBytes:O})}}else if(f<h.bytesAvailable)for(var L=0;L<f;L++)h.readUByte()}break;case 7:if(n=!0,c=!0,!i.sps){var D=new a.default(e.data).readSPS();i.width=D.width,i.height=D.height,i.pixelRatio=D.pixelRatio,i.sps=[e.data],i.duration=r._duration;for(var R=e.data.subarray(1,4),I="avc1.",_=0;_<3;_++){var M=R[_].toString(16);M.length<2&&(M="0"+M),I+=M}i.codec=I}break;case 8:n=!0,i.pps||(i.pps=[e.data]);break;case 9:n=!1,i.audFound=!0,l&&y(l,i),l=r.avcSample=p(!1,t.pts,t.dts,"");break;case 12:n=!1;break;default:n=!1,l&&(l.debug+="unknown NAL "+e.type+" ")}l&&n&&l.units.push(e)})),e&&l&&(y(l,i),this.avcSample=null)},e.getLastNalUnit=function(){var t,e,n=this.avcSample;if(!n||0===n.units.length){var r=this._avcTrack.samples;n=r[r.length-1]}if(null!==(t=n)&&void 0!==t&&t.units){var i=n.units;e=i[i.length-1]}return e},e.parseAVCNALu=function(t){var e,n,r=t.byteLength,i=this._avcTrack,a=i.naluState||0,o=a,s=[],l=0,c=-1,u=0;for(-1===a&&(c=0,u=31&t[0],a=0,l=1);l<r;)if(e=t[l++],a)if(1!==a)if(e)if(1===e){if(c>=0){var h={data:t.subarray(c,l-a-1),type:u};s.push(h)}else{var d=this.getLastNalUnit();if(d&&(o&&l<=4-o&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-o)),(n=l-a-1)>0)){var f=new Uint8Array(d.data.byteLength+n);f.set(d.data,0),f.set(t.subarray(0,n),d.data.byteLength),d.data=f,d.state=0}}l<r?(c=l,u=31&t[l],a=0):a=-1}else a=0;else a=3;else a=e?0:2;else a=e?0:1;if(c>=0&&a>=0){var p={data:t.subarray(c,r),type:u,state:a};s.push(p)}if(0===s.length){var g=this.getLastNalUnit();if(g){var m=new Uint8Array(g.data.byteLength+t.byteLength);m.set(g.data,0),m.set(t,g.data.byteLength),g.data=m}}return i.naluState=a,s},e.parseAACPES=function(t){var e,n,i,a,o,s=0,c=this._audioTrack,d=this.aacOverFlow,f=t.data;if(d){this.aacOverFlow=null;var p=d.sample.unit.byteLength,g=Math.min(d.missing,p),m=p-g;d.sample.unit.set(f.subarray(0,g),m),c.samples.push(d.sample),s=d.missing}for(e=s,n=f.length;e<n-1&&!r.isHeader(f,e);e++);if(e===s||(e<n-1?(i="AAC PES did not start with ADTS header,offset:"+e,a=!1):(i="no ADTS header found in AAC PES",a=!0),u.logger.warn("parsing error:"+i),this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:a,reason:i}),!a)){if(r.initTrackConfig(c,this.observer,f,e,this.audioCodec),void 0!==t.pts)o=t.pts;else{if(!d)return void u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");var v=r.getFrameDuration(c.samplerate);o=d.sample.pts+v}for(var y=0;e<n;){if(r.isHeader(f,e)){if(e+5<n){var b=r.appendFrame(c,f,e,o,y);if(b){if(!b.missing){e+=b.length,y++;continue}this.aacOverFlow=b}}break}e++}}},e.parseMPEGPES=function(t){var e=t.data,n=e.length,r=0,a=0,o=t.pts;if(void 0!==o)for(;a<n;)if(i.isHeader(e,a)){var s=i.appendFrame(this._audioTrack,e,a,o,r);if(!s)break;a+=s.length,r++}else a++;else u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")},e.parseID3PES=function(t){void 0!==t.pts?this._id3Track.samples.push(t):u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},t}();function p(t,e,n,r){return{key:t,frame:!1,pts:e,dts:n,units:[],debug:r,length:0}}function g(t,e){return(31&t[e+10])<<8|t[e+11]}function m(t,e,n,r){var i={audio:-1,avc:-1,id3:-1,isAAC:!0},a=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<a;){var o=(31&t[e+1])<<8|t[e+2];switch(t[e]){case 207:if(!r){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===i.audio&&(i.audio=o);break;case 21:-1===i.id3&&(i.id3=o);break;case 219:if(!r){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===i.avc&&(i.avc=o);break;case 3:case 4:n?-1===i.audio&&(i.audio=o,i.isAAC=!1):u.logger.log("MPEG audio found, not supported in this browser");break;case 36:u.logger.warn("Unsupported HEVC stream type found")}e+=5+((15&t[e+3])<<8|t[e+4])}return i}function v(t){var e,n,r,i,a,o=0,s=t.data;if(!t||0===t.size)return null;for(;s[0].length<19&&s.length>1;){var l=new Uint8Array(s[0].length+s[1].length);l.set(s[0]),l.set(s[1],s[0].length),s[0]=l,s.splice(1,1)}if(1===((e=s[0])[0]<<16)+(e[1]<<8)+e[2]){if((n=(e[4]<<8)+e[5])&&n>t.size-6)return null;var c=e[7];192&c&&(i=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&c?i-(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(u.logger.warn(Math.round((i-a)/9e4)+"s delta between PTS and DTS, align them"),i=a):a=i);var h=(r=e[8])+9;if(t.size<=h)return null;t.size-=h;for(var d=new Uint8Array(t.size),f=0,p=s.length;f<p;f++){var g=(e=s[f]).byteLength;if(h){if(h>g){h-=g;continue}e=e.subarray(h),g-=h,h=0}d.set(e,o),o+=g}return n&&(n-=r+3),{data:d,pts:i,dts:a,len:n}}return null}function y(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var n=e.samples,r=n.length;if(!r)return void e.dropped++;var i=n[r-1];t.pts=i.pts,t.dts=i.dts}e.samples.push(t)}t.debug.length&&u.logger.log(t.pts+"/"+t.dts+":"+t.debug)}function b(t,e){var n=t.length;if(n>0){if(e.pts>=t[n-1].pts)t.push(e);else for(var r=n-1;r>=0;r--)if(e.pts<t[r].pts){t.splice(r,0,e);break}}else t.push(e)}function x(t){for(var e=t.byteLength,n=[],r=1;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return t;var i=e-n.length,a=new Uint8Array(i),o=0;for(r=0;r<i;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=t[o];return a}f.minProbeByteLength=188,e.default=f},"./src/errors.ts":
/*!***********************!*\
!*** ./src/errors.ts ***!
\***********************/
/*! exports provided: ErrorTypes, ErrorDetails */function(t,e,n){"use strict";var r,i;n.r(e),n.d(e,"ErrorTypes",(function(){return r})),n.d(e,"ErrorDetails",(function(){return i})),function(t){t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError"}(r||(r={})),function(t){t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown"}(i||(i={}))},"./src/events.ts":
/*!***********************!*\
!*** ./src/events.ts ***!
\***********************/
/*! exports provided: Events */function(t,e,n){"use strict";var r;n.r(e),n.d(e,"Events",(function(){return r})),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(r||(r={}))},"./src/hls.ts":
/*!********************!*\
!*** ./src/hls.ts ***!
\********************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var r=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),i=n(/*! ./loader/playlist-loader */"./src/loader/playlist-loader.ts"),a=n(/*! ./loader/key-loader */"./src/loader/key-loader.ts"),o=n(/*! ./controller/id3-track-controller */"./src/controller/id3-track-controller.ts"),s=n(/*! ./controller/latency-controller */"./src/controller/latency-controller.ts"),l=n(/*! ./controller/level-controller */"./src/controller/level-controller.ts"),c=n(/*! ./controller/fragment-tracker */"./src/controller/fragment-tracker.ts"),u=n(/*! ./controller/stream-controller */"./src/controller/stream-controller.ts"),h=n(/*! ./is-supported */"./src/is-supported.ts"),d=n(/*! ./utils/logger */"./src/utils/logger.ts"),f=n(/*! ./config */"./src/config.ts"),p=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),g=n(/*! ./events */"./src/events.ts"),m=n(/*! ./errors */"./src/errors.ts");function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var y=function(){function t(e){void 0===e&&(e={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var n=this.config=Object(f.mergeConfig)(t.DefaultConfig,e);this.userConfig=e,Object(d.enableLogs)(n.debug),this._autoLevelCapping=-1,n.progressive&&Object(f.enableStreamingMode)(n);var r=n.abrController,h=n.bufferController,g=n.capLevelController,m=n.fpsController,v=this.abrController=new r(this),y=this.bufferController=new h(this),b=this.capLevelController=new g(this),x=new m(this),S=new i.default(this),C=new a.default(this),E=new o.default(this),w=this.levelController=new l.default(this),k=new c.FragmentTracker(this),T=this.streamController=new u.default(this,k);b.setStreamController(T),x.setStreamController(T);var O=[w,T];this.networkControllers=O;var A=[S,C,v,y,b,x,E,k];this.audioTrackController=this.createController(n.audioTrackController,null,O),this.createController(n.audioStreamController,k,O),this.subtitleTrackController=this.createController(n.subtitleTrackController,null,O),this.createController(n.subtitleStreamController,k,O),this.createController(n.timelineController,null,A),this.emeController=this.createController(n.emeController,null,A),this.cmcdController=this.createController(n.cmcdController,null,A),this.latencyController=this.createController(s.default,null,A),this.coreComponents=A}t.isSupported=function(){return Object(h.isSupported)()};var e,n,y,b=t.prototype;return b.createController=function(t,e,n){if(t){var r=e?new t(this,e):new t(this);return n&&n.push(r),r}return null},b.on=function(t,e,n){void 0===n&&(n=this),this._emitter.on(t,e,n)},b.once=function(t,e,n){void 0===n&&(n=this),this._emitter.once(t,e,n)},b.removeAllListeners=function(t){this._emitter.removeAllListeners(t)},b.off=function(t,e,n,r){void 0===n&&(n=this),this._emitter.off(t,e,n,r)},b.listeners=function(t){return this._emitter.listeners(t)},b.emit=function(t,e,n){return this._emitter.emit(t,e,n)},b.trigger=function(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){d.logger.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.trigger(g.Events.ERROR,{type:m.ErrorTypes.OTHER_ERROR,details:m.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:t,error:e})}return!1},b.listenerCount=function(t){return this._emitter.listenerCount(t)},b.destroy=function(){d.logger.log("destroy"),this.trigger(g.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(t){return t.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(t){return t.destroy()})),this.coreComponents.length=0},b.attachMedia=function(t){d.logger.log("attachMedia"),this._media=t,this.trigger(g.Events.MEDIA_ATTACHING,{media:t})},b.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(g.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(t){this.stopLoad();var e=this.media,n=this.url,i=this.url=r.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});d.logger.log("loadSource:"+i),e&&n&&n!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(e)),this.trigger(g.Events.MANIFEST_LOADING,{url:t})},b.startLoad=function(t){void 0===t&&(t=-1),d.logger.log("startLoad("+t+")"),this.networkControllers.forEach((function(e){e.startLoad(t)}))},b.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach((function(t){t.stopLoad()}))},b.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){d.logger.log("recoverMediaError");var t=this._media;this.detachMedia(),t&&this.attachMedia(t)},b.removeLevel=function(t,e){void 0===e&&(e=0),this.levelController.removeLevel(t,e)},e=t,y=[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return g.Events}},{key:"ErrorTypes",get:function(){return m.ErrorTypes}},{key:"ErrorDetails",get:function(){return m.ErrorDetails}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:f.hlsDefaultConfig},set:function(e){t.defaultConfig=e}}],(n=[{key:"levels",get:function(){var t=this.levelController.levels;return t||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){d.logger.log("set currentLevel:"+t),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){d.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){d.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){d.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){d.logger.log("set startLevel:"+t),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(t){var e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){this._autoLevelCapping!==t&&(d.logger.log("set autoLevelCapping:"+t),this._autoLevelCapping=t)}},{key:"bandwidthEstimate",get:function(){var t=this.abrController.bwEstimator;return t?t.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var n=t.length,r=0;r<n;r++)if(t[r].maxBitrate>e)return r;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{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}}])&&v(e.prototype,n),y&&v(e,y),t}();y.defaultConfig=void 0},"./src/is-supported.ts":
/*!*****************************!*\
!*** ./src/is-supported.ts ***!
\*****************************/
/*! exports provided: isSupported, changeTypeSupported */function(t,e,n){"use strict";n.r(e),n.d(e,"isSupported",(function(){return a})),n.d(e,"changeTypeSupported",(function(){return o}));var r=n(/*! ./utils/mediasource-helper */"./src/utils/mediasource-helper.ts");function i(){return self.SourceBuffer||self.WebKitSourceBuffer}function a(){var t=Object(r.getMediaSource)();if(!t)return!1;var e=i(),n=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),a=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!n&&!!a}function o(){var t,e=i();return"function"==typeof(null==e||null===(t=e.prototype)||void 0===t?void 0:t.changeType)}},"./src/loader/fragment-loader.ts":
/*!***************************************!*\
!*** ./src/loader/fragment-loader.ts ***!
\***************************************/
/*! exports provided: default, LoadError */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h})),n.d(e,"LoadError",(function(){return f}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../errors */"./src/errors.ts");function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return o(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)})(t)}function o(t,e,n){return(o=s()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&l(i,n.prototype),i}).apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var u=Math.pow(2,17),h=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var n=this,r=t.url;if(!r)return Promise.reject(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(r?"part list":"url")));this.abort();var a=this.config,o=a.fLoader,s=a.loader;return new Promise((function(r,l){n.loader&&n.loader.destroy();var c=n.loader=t.loader=o?new o(a):new s(a),h=d(t),p={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=c.stats,c.load(h,p,{onSuccess:function(e,i,a,o){n.resetLoader(t,c),r({frag:t,part:null,payload:e.data,networkDetails:o})},onError:function(e,r,a){n.resetLoader(t,c),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:a}))},onAbort:function(e,r,a){n.resetLoader(t,c),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:a}))},onTimeout:function(e,r,a){n.resetLoader(t,c),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:a}))},onProgress:function(n,r,i,a){e&&e({frag:t,part:null,payload:i,networkDetails:a})}})}))},e.loadPart=function(t,e,n){var r=this;this.abort();var a=this.config,o=a.fLoader,s=a.loader;return new Promise((function(l,c){r.loader&&r.loader.destroy();var h=r.loader=t.loader=o?new o(a):new s(a),p=d(t,e),g={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:u};e.stats=h.stats,h.load(p,g,{onSuccess:function(i,a,o,s){r.resetLoader(t,h),r.updateStatsFromPart(t,e);var c={frag:t,part:e,payload:i.data,networkDetails:s};n(c),l(c)},onError:function(n,a,o){r.resetLoader(t,h),c(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:n,networkDetails:o}))},onAbort:function(n,a,o){t.stats.aborted=e.stats.aborted,r.resetLoader(t,h),c(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:o}))},onTimeout:function(n,a,o){r.resetLoader(t,h),c(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:o}))}})}))},e.updateStatsFromPart=function(t,e){var n=t.stats,r=e.stats,i=r.total;if(n.loaded+=r.loaded,i){var a=Math.round(t.duration/e.duration),o=Math.min(Math.round(n.loaded/i),a),s=(a-o)*Math.round(n.loaded/o);n.total=n.loaded+s}else n.total=Math.max(n.loaded,n.total);var l=n.loading,c=r.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function d(t,e){void 0===e&&(e=null);var n=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},a=n.byteRangeStartOffset,o=n.byteRangeEndOffset;return Object(r.isFiniteNumber)(a)&&Object(r.isFiniteNumber)(o)&&(i.rangeStart=a,i.rangeEnd=o),i}var f=function(t){var e,n;function r(e){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return(n=t.call.apply(t,[this].concat(i))||this).data=void 0,n.data=e,n}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n),r}(a(Error))},"./src/loader/fragment.ts":
/*!********************************!*\
!*** ./src/loader/fragment.ts ***!
\********************************/
/*! exports provided: ElementaryStreamTypes, BaseSegment, Fragment, Part */function(t,e,n){"use strict";n.r(e),n.d(e,"ElementaryStreamTypes",(function(){return r})),n.d(e,"BaseSegment",(function(){return f})),n.d(e,"Fragment",(function(){return p})),n.d(e,"Part",(function(){return g}));var r,i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),a=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ./level-key */"./src/loader/level-key.ts"),l=n(/*! ./load-stats */"./src/loader/load-stats.ts");function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,u(t,e)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}!function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"}(r||(r={}));var f=function(){function t(t){var e;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((e={})[r.AUDIO]=null,e[r.VIDEO]=null,e[r.AUDIOVIDEO]=null,e),this.baseurl=t}return t.prototype.setByteRange=function(t,e){var n=t.split("@",2),r=[];1===n.length?r[0]=e?e.byteRangeEndOffset:0:r[0]=parseInt(n[1]),r[1]=parseInt(n[0])+r[0],this._byteRange=r},d(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(a.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(t){this._url=t}}]),t}(),p=function(t){function e(e,n){var r;return(r=t.call(this,n)||this)._decryptdata=null,r.rawProgramDateTime=null,r.programDateTime=null,r.tagList=[],r.duration=0,r.sn=0,r.levelkey=void 0,r.type=void 0,r.loader=null,r.level=-1,r.cc=0,r.startPTS=void 0,r.endPTS=void 0,r.appendedPTS=void 0,r.startDTS=void 0,r.endDTS=void 0,r.start=0,r.deltaPTS=void 0,r.maxStartPTS=void 0,r.minEndPTS=void 0,r.stats=new l.LoadStats,r.urlId=0,r.data=void 0,r.bitrateTest=!1,r.title=null,r.initSegment=null,r.type=e,r}c(e,t);var n=e.prototype;return n.createInitializationVector=function(t){for(var e=new Uint8Array(16),n=12;n<16;n++)e[n]=t>>8*(15-n)&255;return e},n.setDecryptDataFromLevelKey=function(t,e){var n=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((n=s.LevelKey.fromURI(t.uri)).method=t.method,n.iv=this.createInitializationVector(e),n.keyFormat="identity"),n},n.setElementaryStreamInfo=function(t,e,n,r,i,a){void 0===a&&(a=!1);var o=this.elementaryStreams,s=o[t];s?(s.startPTS=Math.min(s.startPTS,e),s.endPTS=Math.max(s.endPTS,n),s.startDTS=Math.min(s.startDTS,r),s.endDTS=Math.max(s.endDTS,i)):o[t]={startPTS:e,endPTS:n,startDTS:r,endDTS:i,partial:a}},n.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[r.AUDIO]=null,t[r.VIDEO]=null,t[r.AUDIOVIDEO]=null},d(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(i.isFiniteNumber)(this.programDateTime))return null;var t=Object(i.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(f),g=function(t){function e(e,n,r,i,a){var o;(o=t.call(this,r)||this).fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new l.LoadStats,o.duration=e.decimalFloatingPoint("DURATION"),o.gap=e.bool("GAP"),o.independent=e.bool("INDEPENDENT"),o.relurl=e.enumeratedString("URI"),o.fragment=n,o.index=i;var s=e.enumeratedString("BYTERANGE");return s&&o.setByteRange(s,a),a&&(o.fragOffset=a.fragOffset+a.duration),o}return c(e,t),d(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(f)},"./src/loader/key-loader.ts":
/*!**********************************!*\
!*** ./src/loader/key-loader.ts ***!
\**********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../errors */"./src/errors.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(r.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(r.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var n=e.frag,i=n.type,o=this.loaders[i];if(n.decryptdata){var s=n.decryptdata.uri;if(s!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(o&&(a.logger.warn("abort previous key loader for type:"+i),o.abort()),!s)return void a.logger.warn("key uri is falsy");var c=l.loader,u=n.loader=this.loaders[i]=new c(l);this.decrypturl=s,this.decryptkey=null;var h={url:s,frag:n,responseType:"arraybuffer"},d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(h,d,f)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(r.Events.KEY_LOADED,{frag:n}))}else a.logger.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,n){var i=n.frag;i.decryptdata?(this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(r.Events.KEY_LOADED,{frag:i})):a.logger.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var n=e.frag,a=n.loader;a&&a.abort(),delete this.loaders[n.type],this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:t})},e.loadtimeout=function(t,e){var n=e.frag,a=n.loader;a&&a.abort(),delete this.loaders[n.type],this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},t}()},"./src/loader/level-details.ts":
/*!*************************************!*\
!*** ./src/loader/level-details.ts ***!
\*************************************/
/*! exports provided: LevelDetails */function(t,e,n){"use strict";n.r(e),n.d(e,"LevelDetails",(function(){return a}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts");function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=t}var e,n,a;return t.prototype.reloaded=function(t){if(!t)return this.advanced=!0,void(this.updated=!0);var e=this.lastPartSn-t.lastPartSn,n=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!n||!!e,this.advanced=this.endSN>t.endSN||e>0||0===e&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(n=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(r.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.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 t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&i(e.prototype,n),a&&i(e,a),t}()},"./src/loader/level-key.ts":
/*!*********************************!*\
!*** ./src/loader/level-key.ts ***!
\*********************************/
/*! exports provided: LevelKey */function(t,e,n){"use strict";n.r(e),n.d(e,"LevelKey",(function(){return a}));var r=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js");function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(t,e){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=e?Object(r.buildAbsoluteURL)(t,e,{alwaysNormalize:!0}):t}var e,n,a;return t.fromURL=function(e,n){return new t(e,n)},t.fromURI=function(e){return new t(e)},e=t,(n=[{key:"uri",get:function(){return this._uri}}])&&i(e.prototype,n),a&&i(e,a),t}()},"./src/loader/load-stats.ts":
/*!**********************************!*\
!*** ./src/loader/load-stats.ts ***!
\**********************************/
/*! exports provided: LoadStats */function(t,e,n){"use strict";n.r(e),n.d(e,"LoadStats",(function(){return r}));var r=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":
/*!***********************************!*\
!*** ./src/loader/m3u8-parser.ts ***!
\***********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return m}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),a=n(/*! ./fragment */"./src/loader/fragment.ts"),o=n(/*! ./level-details */"./src/loader/level-details.ts"),s=n(/*! ./level-key */"./src/loader/level-key.ts"),l=n(/*! ../utils/attr-list */"./src/utils/attr-list.ts"),c=n(/*! ../utils/logger */"./src/utils/logger.ts"),u=n(/*! ../utils/codecs */"./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),g=/\.(mp4|m4s|m4v|m4a)$/i,m=function(){function t(){}return t.findGroup=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.id===e)return r}},t.convertAVC1ToAVCOTI=function(t){var e=t.split(".");if(e.length>2){var n=e.shift()+".";return n+=parseInt(e.shift()).toString(16),n+=("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.resolve=function(t,e){return i.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,n){var r,i=[],a={},o=!1;for(h.lastIndex=0;null!=(r=h.exec(e));)if(r[1]){var s=new l.AttrList(r[1]),c={attrs:s,bitrate:s.decimalInteger("AVERAGE-BANDWIDTH")||s.decimalInteger("BANDWIDTH"),name:s.NAME,url:t.resolve(r[2],n)},u=s.decimalResolution("RESOLUTION");u&&(c.width=u.width,c.height=u.height),v((s.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),c),c.videoCodec&&-1!==c.videoCodec.indexOf("avc1")&&(c.videoCodec=t.convertAVC1ToAVCOTI(c.videoCodec)),i.push(c)}else if(r[3]){var d=new l.AttrList(r[3]);d["DATA-ID"]&&(o=!0,a[d["DATA-ID"]]=d)}return{levels:i,sessionData:o?a:null}},t.parseMasterPlaylistMedia=function(e,n,r,i){var a;void 0===i&&(i=[]);var o=[],s=0;for(d.lastIndex=0;null!==(a=d.exec(e));){var c=new l.AttrList(a[1]);if(c.TYPE===r){var u={attrs:c,bitrate:0,id:s++,groupId:c["GROUP-ID"],instreamId:c["INSTREAM-ID"],name:c.NAME||c.LANGUAGE||"",type:r,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:c.LANGUAGE,url:c.URI?t.resolve(c.URI,n):""};if(i.length){var h=t.findGroup(i,u.groupId)||i[0];y(u,h,"audioCodec"),y(u,h,"textCodec")}o.push(u)}}return o},t.parseLevelPlaylist=function(t,e,n,u,h){var d,m,v,y=new o.LevelDetails(e),x=y.fragments,S=null,C=0,E=0,w=0,k=0,T=null,O=new a.Fragment(u,e),A=-1,L=!1;for(f.lastIndex=0,y.m3u8=t;null!==(d=f.exec(t));){L&&(L=!1,(O=new a.Fragment(u,e)).start=w,O.sn=C,O.cc=k,O.level=n,S&&(O.initSegment=S,O.rawProgramDateTime=S.rawProgramDateTime));var D=d[1];if(D){O.duration=parseFloat(D);var R=(" "+d[2]).slice(1);O.title=R||null,O.tagList.push(R?["INF",D,R]:["INF",D])}else if(d[3])Object(r.isFiniteNumber)(O.duration)&&(O.start=w,v&&(O.levelkey=v),O.sn=C,O.level=n,O.cc=k,O.urlId=h,x.push(O),O.relurl=(" "+d[3]).slice(1),b(O,T),T=O,w+=O.duration,C++,E=0,L=!0);else if(d[4]){var I=(" "+d[4]).slice(1);T?O.setByteRange(I,T):O.setByteRange(I)}else if(d[5])O.rawProgramDateTime=(" "+d[5]).slice(1),O.tagList.push(["PROGRAM-DATE-TIME",O.rawProgramDateTime]),-1===A&&(A=x.length);else{if(!(d=d[0].match(p))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(m=1;m<d.length&&void 0===d[m];m++);var _=(" "+d[m]).slice(1),M=(" "+d[m+1]).slice(1),N=d[m+2]?(" "+d[m+2]).slice(1):"";switch(_){case"PLAYLIST-TYPE":y.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":C=y.startSN=parseInt(M);break;case"SKIP":var P=new l.AttrList(M),F=P.decimalInteger("SKIPPED-SEGMENTS");if(Object(r.isFiniteNumber)(F)){y.skippedSegments=F;for(var j=F;j--;)x.unshift(null);C+=F}var B=P.enumeratedString("RECENTLY-REMOVED-DATERANGES");B&&(y.recentlyRemovedDateranges=B.split("\t"));break;case"TARGETDURATION":y.targetduration=parseFloat(M);break;case"VERSION":y.version=parseInt(M);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(M||N)&&O.tagList.push(N?[M,N]:[M]);break;case"DIS":k++;case"GAP":O.tagList.push([_]);break;case"BITRATE":O.tagList.push([_,M]);break;case"DISCONTINUITY-SEQ":k=parseInt(M);break;case"KEY":var U,H=new l.AttrList(M),G=H.enumeratedString("METHOD"),z=H.URI,W=H.hexadecimalInteger("IV"),V=H.enumeratedString("KEYFORMATVERSIONS"),K=H.enumeratedString("KEYID"),q=null!=(U=H.enumeratedString("KEYFORMAT"))?U:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(q)>-1){c.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}if("identity"!==q)continue;G&&(v=s.LevelKey.fromURL(e,z),z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(G)>=0&&(v.method=G,v.keyFormat=q,K&&(v.keyID=K),V&&(v.keyFormatVersions=V),v.iv=W));break;case"START":var Y=new l.AttrList(M).decimalFloatingPoint("TIME-OFFSET");Object(r.isFiniteNumber)(Y)&&(y.startTimeOffset=Y);break;case"MAP":var X=new l.AttrList(M);O.relurl=X.URI,X.BYTERANGE&&O.setByteRange(X.BYTERANGE),O.level=n,O.sn="initSegment",v&&(O.levelkey=v),O.initSegment=null,S=O,L=!0;break;case"SERVER-CONTROL":var $=new l.AttrList(M);y.canBlockReload=$.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=$.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&$.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=$.optionalFloat("PART-HOLD-BACK",0),y.holdBack=$.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var J=new l.AttrList(M);y.partTarget=J.decimalFloatingPoint("PART-TARGET");break;case"PART":var Z=y.partList;Z||(Z=y.partList=[]);var Q=E>0?Z[Z.length-1]:void 0,tt=E++,et=new a.Part(new l.AttrList(M),O,e,tt,Q);Z.push(et),O.duration+=et.duration;break;case"PRELOAD-HINT":var nt=new l.AttrList(M);y.preloadHint=nt;break;case"RENDITION-REPORT":var rt=new l.AttrList(M);y.renditionReports=y.renditionReports||[],y.renditionReports.push(rt);break;default:c.logger.warn("line parsed but not handled: "+d)}}}T&&!T.relurl?(x.pop(),w-=T.duration,y.partList&&(y.fragmentHint=T)):y.partList&&(b(O,T),O.cc=k,y.fragmentHint=O);var it=x.length,at=x[0],ot=x[it-1];if((w+=y.skippedSegments*y.targetduration)>0&&it&&ot){y.averagetargetduration=w/it;var st=ot.sn;y.endSN="initSegment"!==st?st:0,at&&(y.startCC=at.cc,at.initSegment||y.fragments.every((function(t){return t.relurl&&(e=t.relurl,g.test(null!=(n=null===(r=i.parseURL(e))||void 0===r?void 0:r.path)?n:""));var e,n,r}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(O=new a.Fragment(u,e)).relurl=ot.relurl,O.level=n,O.sn="initSegment",at.initSegment=O,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(w+=y.fragmentHint.duration),y.totalduration=w,y.endCC=k,A>0&&function(t,e){for(var n=t[e],r=e;r--;){var i=t[r];if(!i)return;i.programDateTime=n.programDateTime-1e3*i.duration,n=i}}(x,A),y},t}();function v(t,e){["video","audio","text"].forEach((function(n){var r=t.filter((function(t){return Object(u.isCodecType)(t,n)}));if(r.length){var i=r.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[n+"Codec"]=i.length>0?i[0]:r[0],t=t.filter((function(t){return-1===r.indexOf(t)}))}})),e.unknownCodecs=t}function y(t,e,n){var r=e[n];r&&(t[n]=r)}function b(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(r.isFiniteNumber)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":
/*!***************************************!*\
!*** ./src/loader/playlist-loader.ts ***!
\***************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../events */"./src/events.ts"),a=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=n(/*! ./m3u8-parser */"./src/loader/m3u8-parser.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../utils/attr-list */"./src/utils/attr-list.ts");function h(t,e){var n=t.url;return void 0!==n&&0!==n.indexOf("data:")||(n=e.url),n}var d=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,n=e.pLoader,r=e.loader,i=new(n||r)(e);return t.loader=i,this.loaders[t.type]=i,i},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var n=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var n=e.id,r=e.level,i=e.url,a=e.deliveryDirectives;this.load({id:n,groupId:null,level:r,responseType:"text",type:c.PlaylistContextType.LEVEL,url:i,deliveryDirectives:a})},e.onAudioTrackLoading=function(t,e){var n=e.id,r=e.groupId,i=e.url,a=e.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:i,deliveryDirectives:a})},e.onSubtitleTrackLoading=function(t,e){var n=e.id,r=e.groupId,i=e.url,a=e.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:i,deliveryDirectives:a})},e.load=function(t){var e,n,r,i,a,s,l=this.hls.config,u=this.getInternalLoader(t);if(u){var h=u.context;if(h&&h.url===t.url)return void o.logger.trace("[playlist-loader]: playlist request ongoing");o.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case c.PlaylistContextType.MANIFEST:n=l.manifestLoadingMaxRetry,r=l.manifestLoadingTimeOut,i=l.manifestLoadingRetryDelay,a=l.manifestLoadingMaxRetryTimeout;break;case c.PlaylistContextType.LEVEL:case c.PlaylistContextType.AUDIO_TRACK:case c.PlaylistContextType.SUBTITLE_TRACK:n=0,r=l.levelLoadingTimeOut;break;default:n=l.levelLoadingMaxRetry,r=l.levelLoadingTimeOut,i=l.levelLoadingRetryDelay,a=l.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part&&(t.type===c.PlaylistContextType.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===c.PlaylistContextType.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===c.PlaylistContextType.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var d=s.partTarget,f=s.targetduration;d&&f&&(r=Math.min(1e3*Math.max(3*d,.8*f),r))}var p={timeout:r,maxRetry:n,retryDelay:i,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,p,g)},e.loadsuccess=function(t,e,n,r){if(void 0===r&&(r=null),n.isSidxRequest)return this.handleSidxRequest(t,n),void this.handlePlaylistLoaded(t,e,n,r);this.resetInternalLoader(n.type);var i=t.data;0===i.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,n,r):this.handleMasterPlaylist(t,e,n,r)):this.handleManifestParsingError(t,n,"no EXTM3U delimiter",r)},e.loaderror=function(t,e,n){void 0===n&&(n=null),this.handleNetworkError(e,n,!1,t)},e.loadtimeout=function(t,e,n){void 0===n&&(n=null),this.handleNetworkError(e,n,!0)},e.handleMasterPlaylist=function(t,e,n,r){var a=this.hls,s=t.data,c=h(t,n),d=l.default.parseMasterPlaylist(s,c),f=d.levels,p=d.sessionData;if(f.length){var g=f.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),m=f.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),v=l.default.parseMasterPlaylistMedia(s,c,"AUDIO",g),y=l.default.parseMasterPlaylistMedia(s,c,"SUBTITLES",m),b=l.default.parseMasterPlaylistMedia(s,c,"CLOSED-CAPTIONS");v.length&&(v.some((function(t){return!t.url}))||!f[0].audioCodec||f[0].attrs.AUDIO||(o.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))),a.trigger(i.Events.MANIFEST_LOADED,{levels:f,audioTracks:v,subtitles:y,captions:b,url:c,stats:e,networkDetails:r,sessionData:p})}else this.handleManifestParsingError(t,n,"no level found in manifest",r)},e.handleTrackOrLevelPlaylist=function(t,e,n,o){var s=this.hls,d=n.id,f=n.level,p=n.type,g=h(t,n),m=Object(r.isFiniteNumber)(d)?d:0,v=Object(r.isFiniteNumber)(f)?f:m,y=function(t){switch(t.type){case c.PlaylistContextType.AUDIO_TRACK:return c.PlaylistLevelType.AUDIO;case c.PlaylistContextType.SUBTITLE_TRACK:return c.PlaylistLevelType.SUBTITLE;default:return c.PlaylistLevelType.MAIN}}(n),b=l.default.parseLevelPlaylist(t.data,g,v,y,m);if(b.fragments.length){if(p===c.PlaylistContextType.MANIFEST){var x={attrs:new u.AttrList({}),bitrate:0,details:b,name:"",url:g};s.trigger(i.Events.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:g,stats:e,networkDetails:o,sessionData:null})}if(e.parsing.end=performance.now(),b.needSidxRanges){var S,C=null===(S=b.fragments[0].initSegment)||void 0===S?void 0:S.url;this.load({url:C,isSidxRequest:!0,type:p,level:f,levelDetails:b,id:d,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else n.levelDetails=b,this.handlePlaylistLoaded(t,e,n,o)}else s.trigger(i.Events.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:"number"==typeof n.level?n.level:void 0})},e.handleSidxRequest=function(t,e){var n=Object(s.parseSegmentIndex)(new Uint8Array(t.data));if(n){var r=n.references,i=e.levelDetails;r.forEach((function(t,e){var r=t.info,a=i.fragments[e];0===a.byteRange.length&&a.setByteRange(String(1+r.end-r.start)+"@"+String(r.start)),a.initSegment&&a.initSegment.setByteRange(String(n.moovEndOffset)+"@0")}))}},e.handleManifestParsingError=function(t,e,n,r){this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:e.type===c.PlaylistContextType.MANIFEST,url:t.url,reason:n,response:t,context:e,networkDetails:r})},e.handleNetworkError=function(t,e,n,r){void 0===n&&(n=!1),o.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var s=a.ErrorDetails.UNKNOWN,l=!1,u=this.getInternalLoader(t);switch(t.type){case c.PlaylistContextType.MANIFEST:s=n?a.ErrorDetails.MANIFEST_LOAD_TIMEOUT:a.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case c.PlaylistContextType.LEVEL:s=n?a.ErrorDetails.LEVEL_LOAD_TIMEOUT:a.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.AUDIO_TRACK:s=n?a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:s=n?a.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:a.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(t.type);var h={type:a.ErrorTypes.NETWORK_ERROR,details:s,fatal:l,url:t.url,loader:u,context:t,networkDetails:e};r&&(h.response=r),this.hls.trigger(i.Events.ERROR,h)},e.handlePlaylistLoaded=function(t,e,n,r){var a=n.type,o=n.level,s=n.id,l=n.groupId,u=n.loader,h=n.levelDetails,d=n.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),a){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(i.Events.LEVEL_LOADED,{details:h,level:o||0,id:s||0,stats:e,networkDetails:r,deliveryDirectives:d});break;case c.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(i.Events.AUDIO_TRACK_LOADED,{details:h,id:s||0,groupId:l||"",stats:e,networkDetails:r,deliveryDirectives:d});break;case c.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADED,{details:h,id:s||0,groupId:l||"",stats:e,networkDetails:r,deliveryDirectives:d})}}else this.handleManifestParsingError(t,n,"invalid target duration",r)},t}();e.default=d},"./src/polyfills/number.ts":
/*!*********************************!*\
!*** ./src/polyfills/number.ts ***!
\*********************************/
/*! exports provided: isFiniteNumber, MAX_SAFE_INTEGER */function(t,e,n){"use strict";n.r(e),n.d(e,"isFiniteNumber",(function(){return r})),n.d(e,"MAX_SAFE_INTEGER",(function(){return i}));var r=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},i=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":
/*!*********************************!*\
!*** ./src/remux/aac-helper.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=function(){function t(){}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)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(6===e)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(1===e)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(2===e)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(3===e)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])}},t}();e.default=r},"./src/remux/mp4-generator.ts":
/*!************************************!*\
!*** ./src/remux/mp4-generator.ts ***!
\************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=Math.pow(2,32)-1,i=function(){function t(){}return t.init=function(){var e;for(e in 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:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var n=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]),r=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:n,audio:r};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,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 o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,i))},t.box=function(t){for(var e=8,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var a=r.length,o=a;a--;)e+=r[a].byteLength;var s=new Uint8Array(e);for(s[0]=e>>24&255,s[1]=e>>16&255,s[2]=e>>8&255,s[3]=255&e,s.set(t,4),a=0,e=8;a<o;a++)s.set(r[a],e),e+=r[a].byteLength;return s},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,n){n*=e;var i=Math.floor(n/(r+1)),a=Math.floor(n%(r+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,n,r){return t.box(t.types.moof,t.mfhd(e),t.traf(r,n))},t.moov=function(e){for(var n=e.length,r=[];n--;)r[n]=t.trak(e[n]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(t.mvex(e)))},t.mvex=function(e){for(var n=e.length,r=[];n--;)r[n]=t.trex(e[n]);return t.box.apply(null,[t.types.mvex].concat(r))},t.mvhd=function(e,n){n*=e;var i=Math.floor(n/(r+1)),a=Math.floor(n%(r+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,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,o)},t.sdtp=function(e){var n,r,i=e.samples||[],a=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)r=i[n].flags,a[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t.box(t.types.sdtp,a)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var n,r,i,a=[],o=[];for(n=0;n<e.sps.length;n++)i=(r=e.sps[n]).byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(r));for(n=0;n<e.pps.length;n++)i=(r=e.pps[n]).byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(r));var s=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(o))),l=e.width,c=e.height,u=e.pixelRatio[0],h=e.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,l>>8&255,255&l,c>>8&255,255&c,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]),s,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([u>>24,u>>16&255,u>>8&255,255&u,h>>24,h>>16&255,h>>8&255,255&h])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var n=e.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,e.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var n=e.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,e.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var n=e.id,i=e.duration*e.timescale,a=e.width,o=e.height,s=Math.floor(i/(r+1)),l=Math.floor(i%(r+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,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,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,a>>8&255,255&a,0,0,o>>8&255,255&o,0,0]))},t.traf=function(e,n){var i=t.sdtp(e),a=e.id,o=Math.floor(n/(r+1)),s=Math.floor(n%(r+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var n=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,n){var r,i,a,o,s,l,c=e.samples||[],u=c.length,h=12+16*u,d=new Uint8Array(h);for(n+=8+h,d.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0),r=0;r<u;r++)a=(i=c[r]).duration,o=i.size,s=i.flags,l=i.cts,d.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r);return t.box(t.types.trun,d)},t.initSegment=function(e){t.types||t.init();var n=t.moov(e),r=new Uint8Array(t.FTYP.byteLength+n.byteLength);return r.set(t.FTYP),r.set(n,t.FTYP.byteLength),r},t}();i.types=void 0,i.HDLR_TYPES=void 0,i.STTS=void 0,i.STSC=void 0,i.STCO=void 0,i.STSZ=void 0,i.VMHD=void 0,i.SMHD=void 0,i.STSD=void 0,i.FTYP=void 0,i.DINF=void 0,e.default=i},"./src/remux/mp4-remuxer.ts":
/*!**********************************!*\
!*** ./src/remux/mp4-remuxer.ts ***!
\**********************************/
/*! exports provided: default, normalizePts */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return g})),n.d(e,"normalizePts",(function(){return m}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./aac-helper */"./src/remux/aac-helper.ts"),a=n(/*! ./mp4-generator */"./src/remux/mp4-generator.ts"),o=n(/*! ../events */"./src/events.ts"),s=n(/*! ../errors */"./src/errors.ts"),l=n(/*! ../utils/logger */"./src/utils/logger.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../utils/timescale-conversion */"./src/utils/timescale-conversion.ts");function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var d=null,f=null,p=!1,g=function(){function t(t,e,n,r){if(void 0===r&&(r=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=n,this.ISGenerated=!1,null===d){var i=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);d=i?parseInt(i[1]):0}if(null===f){var a=navigator.userAgent.match(/Safari\/(\d+)/i);f=a?parseInt(a[1]):0}p=!!d&&d<75||!!f&&f<600}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){l.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},e.resetNextTimestamp=function(){l.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},e.resetInitSegment=function(){l.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},e.getVideoStartPts=function(t){var e=!1,n=t.reduce((function(t,n){var r=n.pts-t;return r<-4294967296?(e=!0,m(t,n.pts)):r>0?t:n.pts}),t[0].pts);return e&&l.logger.debug("PTS rollover detected"),n},e.remux=function(t,e,n,r,i,a,o,s){var u,h,d,f,p,g,v=i,y=i,b=t.pid>-1,x=e.pid>-1,S=e.samples.length,C=t.samples.length>0,E=S>1;if((!b||C)&&(!x||E)||this.ISGenerated||o){this.ISGenerated||(d=this.generateIS(t,e,i));var w=this.isVideoContiguous,k=-1;if(E&&(k=function(t){for(var e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,k>0){l.logger.warn("[mp4-remuxer]: Dropped "+k+" out of "+S+" video samples due to a missing keyframe");var T=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(k),e.dropped+=k,y+=(e.samples[0].pts-T)/(e.timescale||9e4)}else-1===k&&(l.logger.warn("[mp4-remuxer]: No keyframe found out of "+S+" video samples"),g=!1);if(this.ISGenerated){if(C&&E){var O=this.getVideoStartPts(e.samples),A=(m(t.samples[0].pts,O)-O)/e.inputTimeScale;v+=Math.max(0,A),y+=Math.max(0,-A)}if(C){if(t.samplerate||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(t,e,i)),h=this.remuxAudio(t,v,this.isAudioContiguous,a,x||E||s===c.PlaylistLevelType.AUDIO?y:void 0),E){var L=h?h.endPTS-h.startPTS:0;e.inputTimeScale||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(t,e,i)),u=this.remuxVideo(e,y,w,L)}}else E&&(u=this.remuxVideo(e,y,w,0));u&&(u.firstKeyFrame=k,u.independent=-1!==k)}}return this.ISGenerated&&(n.samples.length&&(p=this.remuxID3(n,i)),r.samples.length&&(f=this.remuxText(r,i))),{audio:h,video:u,initSegment:d,independent:g,text:f,id3:p}},e.generateIS=function(t,e,n){var i,o,s,l=t.samples,c=e.samples,u=this.typeSupported,h={},d=!Object(r.isFiniteNumber)(this._initPTS),f="audio/mp4";if(d&&(i=o=1/0),t.config&&l.length&&(t.timescale=t.samplerate,t.isAAC||(u.mpeg?(f="audio/mpeg",t.codec=""):u.mp3&&(t.codec="mp3")),h.audio={id:"audio",container:f,codec:t.codec,initSegment:!t.isAAC&&u.mpeg?new Uint8Array(0):a.default.initSegment([t]),metadata:{channelCount:t.channelCount}},d&&(s=t.inputTimeScale,i=o=l[0].pts-Math.round(s*n))),e.sps&&e.pps&&c.length&&(e.timescale=e.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:a.default.initSegment([e]),metadata:{width:e.width,height:e.height}},d)){s=e.inputTimeScale;var p=this.getVideoStartPts(c),g=Math.round(s*n);o=Math.min(o,m(c[0].dts,p)-g),i=Math.min(i,p-g)}if(Object.keys(h).length)return this.ISGenerated=!0,d&&(this._initPTS=i,this._initDTS=o),{tracks:h,initPTS:i,timescale:s}},e.remuxVideo=function(t,e,n,r){var i,c,f,g=t.inputTimeScale,y=t.samples,b=[],x=y.length,S=this._initPTS,C=this.nextAvcDts,E=8,w=Number.POSITIVE_INFINITY,k=Number.NEGATIVE_INFINITY,T=0,O=!1;n&&null!==C||(C=e*g-(y[0].pts-m(y[0].dts,y[0].pts)));for(var A=0;A<x;A++){var L=y[A];L.pts=m(L.pts-S,C),L.dts=m(L.dts-S,C),L.dts>L.pts&&(T=Math.max(Math.min(T,L.pts-L.dts),-18e3)),L.dts<y[A>0?A-1:A].dts&&(O=!0)}O&&y.sort((function(t,e){var n=t.dts-e.dts,r=t.pts-e.pts;return n||r})),c=y[0].dts,f=y[y.length-1].dts;var D=Math.round((f-c)/(x-1));if(T<0){if(T<-2*D){l.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(u.toMsFromMpegTsClock)(-D,!0)+" ms");for(var R=T,I=0;I<x;I++)y[I].dts=R=Math.max(R,y[I].pts-D),y[I].pts=Math.max(R,y[I].pts)}else{l.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(u.toMsFromMpegTsClock)(T,!0)+" ms to overcome this issue");for(var _=0;_<x;_++)y[_].dts=y[_].dts+T}c=y[0].dts}if(n){var M=c-C,N=M>D;if(N||M<-1){N?l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(M,!0)+" ms ("+M+"dts) hole between fragments detected, filling it"):l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-M,!0)+" ms ("+M+"dts) overlapping between fragments detected"),c=C;var P=y[0].pts-M;y[0].dts=c,y[0].pts=P,l.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(P,!0)+"/"+Object(u.toMsFromMpegTsClock)(c,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(M,!0)+" ms")}}p&&(c=Math.max(0,c));for(var F=0,j=0,B=0;B<x;B++){for(var U=y[B],H=U.units,G=H.length,z=0,W=0;W<G;W++)z+=H[W].data.length;j+=z,F+=G,U.length=z,U.dts=Math.max(U.dts,c),U.pts=Math.max(U.pts,U.dts,0),w=Math.min(U.pts,w),k=Math.max(U.pts,k)}f=y[x-1].dts;var V,K=j+4*F+8;try{V=new Uint8Array(K)}catch(t){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:s.ErrorTypes.MUX_ERROR,details:s.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating video mdat "+K})}var q=new DataView(V.buffer);q.setUint32(0,K),V.set(a.default.types.mdat,4);for(var Y=0;Y<x;Y++){for(var X=y[Y],$=X.units,J=0,Z=0,Q=$.length;Z<Q;Z++){var tt=$[Z],et=tt.data,nt=tt.data.byteLength;q.setUint32(E,nt),E+=4,V.set(et,E),E+=nt,J+=4+nt}if(Y<x-1)i=y[Y+1].dts-X.dts;else{var rt=this.config,it=X.dts-y[Y>0?Y-1:Y].dts;if(rt.stretchShortVideoTrack&&null!==this.nextAudioPts){var at=Math.floor(rt.maxBufferHole*g),ot=(r?w+r*g:this.nextAudioPts)-X.pts;ot>at?((i=ot-it)<0&&(i=it),l.logger.log("[mp4-remuxer]: It is approximately "+ot/90+" ms to the next segment; using duration "+i/90+" ms for the last video frame.")):i=it}else i=it}var st=Math.round(X.pts-X.dts);b.push(new v(X.key,i,J,st))}if(b.length&&d&&d<70){var lt=b[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(void 0!==i,"mp4SampleDuration must be computed"),this.nextAvcDts=C=f+i,this.isVideoContiguous=!0;var ct={data1:a.default.moof(t.sequenceNumber++,c,h({},t,{samples:b})),data2:V,startPTS:w/g,endPTS:(k+i)/g,startDTS:c/g,endDTS:C/g,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:t.dropped};return t.samples=[],t.dropped=0,console.assert(V.length,"MDAT length must not be zero"),ct},e.remuxAudio=function(t,e,n,r,c){var u=t.inputTimeScale,d=u/(t.samplerate?t.samplerate:u),f=t.isAAC?1024:1152,p=f*d,g=this._initPTS,y=!t.isAAC&&this.typeSupported.mpeg,b=[],x=t.samples,S=y?0:8,C=this.nextAudioPts||-1,E=e*u;if(this.isAudioContiguous=n=n||x.length&&C>0&&(r&&Math.abs(E-C)<9e3||Math.abs(m(x[0].pts-g,E)-C)<20*p),x.forEach((function(t){t.pts=m(t.pts-g,E)})),!n||C<0){if(!(x=x.filter((function(t){return t.pts>=0}))).length)return;C=0===c?0:r?Math.max(0,E):x[0].pts}if(t.isAAC)for(var w=void 0!==c,k=this.config.maxAudioFramesDrift,T=0,O=C;T<x.length;T++){var A=x[T],L=A.pts,D=L-O,R=Math.abs(1e3*D/u);if(D<=-k*p&&w)0===T&&(l.logger.warn("Audio frame @ "+(L/u).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*D/u)+" ms."),this.nextAudioPts=C=O=L);else if(D>=k*p&&R<1e4&&w){var I=Math.round(D/p);(O=L-I*p)<0&&(I--,O+=p),0===T&&(this.nextAudioPts=C=O),l.logger.warn("[mp4-remuxer]: Injecting "+I+" audio frame @ "+(O/u).toFixed(3)+"s due to "+Math.round(1e3*D/u)+" ms gap.");for(var _=0;_<I;_++){var M=Math.max(O,0),N=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);N||(l.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),N=A.unit.subarray()),x.splice(T,0,{unit:N,pts:M}),O+=p,T++}}A.pts=O,O+=p}for(var P,F=null,j=null,B=0,U=x.length;U--;)B+=x[U].unit.byteLength;for(var H=0,G=x.length;H<G;H++){var z=x[H],W=z.unit,V=z.pts;if(null!==j)b[H-1].duration=Math.round((V-j)/d);else{if(n&&t.isAAC&&(V=C),F=V,!(B>0))return;B+=S;try{P=new Uint8Array(B)}catch(t){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:s.ErrorTypes.MUX_ERROR,details:s.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}y||(new DataView(P.buffer).setUint32(0,B),P.set(a.default.types.mdat,4))}P.set(W,S);var K=W.byteLength;S+=K,b.push(new v(!0,f,K,0)),j=V}var q=b.length;if(q){var Y=b[b.length-1];this.nextAudioPts=C=j+d*Y.duration;var X=y?new Uint8Array(0):a.default.moof(t.sequenceNumber++,F/d,h({},t,{samples:b}));t.samples=[];var $=F/u,J=C/u,Z={data1:X,data2:P,startPTS:$,endPTS:J,startDTS:$,endDTS:J,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,console.assert(P.length,"MDAT length must not be zero"),Z}},e.remuxEmptyAudio=function(t,e,n,r){var a=t.inputTimeScale,o=a/(t.samplerate?t.samplerate:a),s=this.nextAudioPts,c=(null!==s?s:r.startDTS*a)+this._initDTS,u=r.endDTS*a+this._initDTS,h=1024*o,d=Math.ceil((u-c)/h),f=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(l.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],g=0;g<d;g++){var m=c+g*h;p.push({unit:f,pts:m,dts:m})}return t.samples=p,this.remuxAudio(t,e,n,!1)}l.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},e.remuxID3=function(t,e){var n=t.samples.length;if(n){for(var r=t.inputTimeScale,i=this._initPTS,a=this._initDTS,o=0;o<n;o++){var s=t.samples[o];s.pts=m(s.pts-i,e*r)/r,s.dts=m(s.dts-a,e*r)/r}var l=t.samples;return t.samples=[],{samples:l}}},e.remuxText=function(t,e){var n=t.samples.length;if(n){for(var r=t.inputTimeScale,i=this._initPTS,a=0;a<n;a++){var o=t.samples[a];o.pts=m(o.pts-i,e*r)/r}t.samples.sort((function(t,e){return t.pts-e.pts}));var s=t.samples;return t.samples=[],{samples:s}}},t}();function m(t,e){var n;if(null===e)return t;for(n=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=n;return t}var v=function(t,e,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=n,this.cts=r,this.flags=new y(t)},y=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},"./src/remux/passthrough-remuxer.ts":
/*!******************************************!*\
!*** ./src/remux/passthrough-remuxer.ts ***!
\******************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),a=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndDTS=null},e.resetNextTimestamp=function(){this.lastEndDTS=null},e.resetInitSegment=function(t,e,n){this.audioCodec=e,this.videoCodec=n,this.generateInitSegment(t),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,n=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Object(i.parseInitSegment)(t);e||(e=c(r.audio,a.ElementaryStreamTypes.AUDIO)),n||(n=c(r.video,a.ElementaryStreamTypes.VIDEO));var s={};r.audio&&r.video?s.audiovideo={container:"video/mp4",codec:e+","+n,initSegment:t,id:"main"}:r.audio?s.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:r.video?s.video={container:"video/mp4",codec:n,initSegment:t,id:"main"}:o.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},e.remux=function(t,e,n,a,s){var c=this.initPTS,u=this.lastEndDTS,h={audio:void 0,video:void 0,text:a,id3:n,initSegment:void 0};Object(r.isFiniteNumber)(u)||(u=this.lastEndDTS=s||0);var d=e.samples;if(!d||!d.length)return h;var f={initPTS:void 0,timescale:1},p=this.initData;if(p&&p.length||(this.generateInitSegment(d),p=this.initData),!p||!p.length)return o.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(r.isFiniteNumber)(c)||(this.initPTS=f.initPTS=c=l(p,d,u));var g=Object(i.getDuration)(d,p),m=u,v=g+m;Object(i.offsetStartDTS)(p,d,c),g>0?this.lastEndDTS=v:(o.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!p.audio,b=!!p.video,x="";y&&(x+="audio"),b&&(x+="video");var S={data1:d,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:x,hasAudio:y,hasVideo:b,nb:1,dropped:0};return h.audio="audio"===S.type?S:void 0,h.video="audio"!==S.type?S:void 0,h.text=a,h.id3=n,h.initSegment=f,h},t}(),l=function(t,e,n){return Object(i.getStartDTS)(t,e)-n};function c(t,e){var n=null==t?void 0:t.codec;return n&&n.length>4?n:"hvc1"===n?"hvc1.1.c.L120.90":"av01"===n?"av01.0.04M.08":"avc1"===n||e===a.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}e.default=s},"./src/task-loop.ts":
/*!**************************!*\
!*** ./src/task-loop.ts ***!
\**************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var r=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}()},"./src/types/cmcd.ts":
/*!***************************!*\
!*** ./src/types/cmcd.ts ***!
\***************************/
/*! exports provided: CMCDVersion, CMCDObjectType, CMCDStreamingFormat, CMCDStreamType */function(t,e,n){"use strict";n.r(e),n.d(e,"CMCDVersion",(function(){return o})),n.d(e,"CMCDObjectType",(function(){return r})),n.d(e,"CMCDStreamingFormat",(function(){return i})),n.d(e,"CMCDStreamType",(function(){return a}));var r,i,a,o=1;!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(r||(r={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(i||(i={})),function(t){t.VOD="v",t.LIVE="l"}(a||(a={}))},"./src/types/level.ts":
/*!****************************!*\
!*** ./src/types/level.ts ***!
\****************************/
/*! exports provided: HlsSkip, getSkipValue, HlsUrlParameters, Level */function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i;function a(t,e){var n=t.canSkipUntil,r=t.canSkipDateRanges,a=t.endSN;return n&&(void 0!==e?e-a:0)<n?r?i.v2:i.Yes:i.No}n.r(e),n.d(e,"HlsSkip",(function(){return i})),n.d(e,"getSkipValue",(function(){return a})),n.d(e,"HlsUrlParameters",(function(){return o})),n.d(e,"Level",(function(){return s})),function(t){t.No="",t.Yes="YES",t.v2="v2"}(i||(i={}));var o=function(){function t(t,e,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=n}return t.prototype.addDirectives=function(t){var e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.toString()},t}(),s=function(){function t(t){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(t){return t})).join(",").replace(/\.[^.,]+/g,"")}var e,n,i;return e=t,(n=[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(t){var e=t%this.url.length;this._urlId!==e&&(this.details=void 0,this._urlId=e)}}])&&r(e.prototype,n),i&&r(e,i),t}()},"./src/types/loader.ts":
/*!*****************************!*\
!*** ./src/types/loader.ts ***!
\*****************************/
/*! exports provided: PlaylistContextType, PlaylistLevelType */function(t,e,n){"use strict";var r,i;n.r(e),n.d(e,"PlaylistContextType",(function(){return r})),n.d(e,"PlaylistLevelType",(function(){return i})),function(t){t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack"}(r||(r={})),function(t){t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle"}(i||(i={}))},"./src/types/transmuxer.ts":
/*!*********************************!*\
!*** ./src/types/transmuxer.ts ***!
\*********************************/
/*! exports provided: ChunkMetadata */function(t,e,n){"use strict";n.r(e),n.d(e,"ChunkMetadata",(function(){return r}));var r=function(t,e,n,r,i,a){void 0===r&&(r=0),void 0===i&&(i=-1),void 0===a&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=n,this.size=r,this.part=i,this.partial=a}},"./src/utils/attr-list.ts":
/*!********************************!*\
!*** ./src/utils/attr-list.ts ***!
\********************************/
/*! exports provided: AttrList */function(t,e,n){"use strict";n.r(e),n.d(e,"AttrList",(function(){return a}));var r=/^(\d+)x(\d+)$/,i=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,a=function(){function t(e){for(var n in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(n)&&(this[n]=e[n])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var n=new Uint8Array(e.length/2),r=0;r<e.length/2;r++)n[r]=parseInt(e.slice(2*r,2*r+2),16);return n}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var n=this[t];return n?parseFloat(n):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=r.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,n={};for(i.lastIndex=0;null!==(e=i.exec(t));){var r=e[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),n[e[1]]=r}return n},t}()},"./src/utils/binary-search.ts":
/*!************************************!*\
!*** ./src/utils/binary-search.ts ***!
\************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),e.default={search:function(t,e){for(var n=0,r=t.length-1,i=null,a=null;n<=r;){var o=e(a=t[i=(n+r)/2|0]);if(o>0)n=i+1;else{if(!(o<0))return a;r=i-1}}return null}}},"./src/utils/buffer-helper.ts":
/*!************************************!*\
!*** ./src/utils/buffer-helper.ts ***!
\************************************/
/*! exports provided: BufferHelper */function(t,e,n){"use strict";n.r(e),n.d(e,"BufferHelper",(function(){return a}));var r=n(/*! ./logger */"./src/utils/logger.ts"),i={length:0,start:function(){return 0},end:function(){return 0}},a=function(){function t(){}return t.isBuffered=function(e,n){try{if(e)for(var r=t.getBuffered(e),i=0;i<r.length;i++)if(n>=r.start(i)&&n<=r.end(i))return!0}catch(t){}return!1},t.bufferInfo=function(e,n,r){try{if(e){var i,a=t.getBuffered(e),o=[];for(i=0;i<a.length;i++)o.push({start:a.start(i),end:a.end(i)});return this.bufferedInfo(o,n,r)}}catch(t){}return{len:0,start:n,end:n,nextStart:void 0}},t.bufferedInfo=function(t,e,n){e=Math.max(0,e),t.sort((function(t,e){var n=t.start-e.start;return n||e.end-t.end}));var r=[];if(n)for(var i=0;i<t.length;i++){var a=r.length;if(a){var o=r[a-1].end;t[i].start-o<n?t[i].end>o&&(r[a-1].end=t[i].end):r.push(t[i])}else r.push(t[i])}else r=t;for(var s,l=0,c=e,u=e,h=0;h<r.length;h++){var d=r[h].start,f=r[h].end;if(e+n>=d&&e<f)c=d,l=(u=f)-e;else if(e+n<d){s=d;break}}return{len:l,start:c||0,end:u||0,nextStart:s}},t.getBuffered=function(t){try{return t.buffered}catch(t){return r.logger.log("failed to get media.buffered",t),i}},t}()},"./src/utils/cea-608-parser.ts":
/*!*************************************!*\
!*** ./src/utils/cea-608-parser.ts ***!
\*************************************/
/*! exports provided: Row, CaptionScreen, default */function(t,e,n){"use strict";n.r(e),n.d(e,"Row",(function(){return m})),n.d(e,"CaptionScreen",(function(){return v}));var r,i=n(/*! ../utils/logger */"./src/utils/logger.ts"),a={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},o=function(t){var e=t;return a.hasOwnProperty(t)&&(e=a[t]),String.fromCharCode(e)},s={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},l={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(r||(r={}));var d=function(){function t(){this.time=null,this.verboseLevel=r.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&i.logger.log(this.time+" ["+t+"] "+e)},t}(),f=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].toString(16));return e},p=function(){function t(t,e,n,r,i){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=e||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1}var e=t.prototype;return e.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},e.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],n=0;n<e.length;n++){var r=e[n];t.hasOwnProperty(r)&&(this[r]=t[r])}},e.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},e.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},e.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},e.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),g=function(){function t(t,e,n,r,i,a){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new p(e,n,r,i,a)}var e=t.prototype;return e.reset=function(){this.uchar=" ",this.penState.reset()},e.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},e.setPenState=function(t){this.penState.copy(t)},e.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},e.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},e.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),m=function(){function t(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var e=0;e<100;e++)this.chars.push(new g);this.logger=t,this.pos=0,this.currPenState=new p}var e=t.prototype;return e.equals=function(t){for(var e=!0,n=0;n<100;n++)if(!this.chars[n].equals(t.chars[n])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<100;e++)this.chars[e].copy(t.chars[e])},e.isEmpty=function(){for(var t=!0,e=0;e<100;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},e.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(r.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var n=this.pos+1;n<e+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(e)},e.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},e.insertChar=function(t){t>=144&&this.backSpace();var e=o(t);this.pos>=100?this.logger.log(r.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,n=0;n<100;n++){var r=this.chars[n].uchar;" "!==r&&(e=!1),t.push(r)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),v=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new m(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,n=0;n<15;n++)if(!this.rows[n].equals(t.rows[n])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(r.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(r.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var n=0;n<15;n++)this.rows[n].clear();var i=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){var o=a.rows[i].cueStartTime,s=this.logger.time;if(o&&null!==s&&o<s)for(var l=0;l<this.nrRollUpRows;l++)this.rows[e-this.nrRollUpRows+l+1].copy(a.rows[i+l])}}this.currRow=e;var c=this.rows[this.currRow];if(null!==t.indent){var u=t.indent,h=Math.max(u-1,0);c.setCursor(t.indent),t.color=c.chars[h].penState.foreground}var d={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(d)},e.setBkgData=function(t){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},e.setRollUpRows=function(t){this.nrRollUpRows=t},e.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(r.TEXT,this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(r.INFO,"Rolling up")}else this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet")},e.getDisplayText=function(t){t=t||!1;for(var e=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,t?e.push("Row "+r+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(n=t?"["+e.join(" | ")+"]":e.join("\n")),n},e.getTextAndFormat=function(){return this.rows},t}(),y=function(){function t(t,e,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new v(n),this.nonDisplayedMemory=new v(n),this.lastOutputScreen=new v(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(r.INFO,"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(r.INFO,n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(r.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},e.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},e.ccBS=function(){this.logger.log(r.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},e.ccAOF=function(){},e.ccAON=function(){},e.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},e.ccRU=function(t){this.logger.log(r.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},e.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},e.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},e.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},e.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},e.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},e.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},e.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},e.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},e.ccTO=function(t){this.logger.log(r.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},e.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var n=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),b=function(){function t(t,e,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var r=new d;this.channels=[null,new y(t,e,r),new y(t+1,n,r)],this.cmdHistory={a:null,b:null},this.logger=r}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var n,i,a,o=!1;this.logger.time=t;for(var s=0;s<e.length;s+=2)if(i=127&e[s],a=127&e[s+1],0!==i||0!==a){if(this.logger.log(r.DATA,"["+f([e[s],e[s+1]])+"] -> ("+f([i,a])+")"),(n=this.parseCmd(i,a))||(n=this.parseMidrow(i,a)),n||(n=this.parsePAC(i,a)),n||(n=this.parseBackgroundAttributes(i,a)),!n&&(o=this.parseChars(i,a))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(o):this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}n||o||this.logger.log(r.WARNING,"Couldn't parse cleaned data "+f([i,a])+" orig: "+f([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var n=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=33&&e<=35))return!1;if(S(t,e,n))return x(null,null,n),this.logger.log(r.DEBUG,"Repeated command ("+f([t,e])+") is dropped"),!0;var i=20===t||21===t||23===t?1:2,a=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),x(t,e,n),this.currentChannel=i,!0},e.parseMidrow=function(t,e){var n=0;if((17===t||25===t)&&e>=32&&e<=47){if((n=17===t?1:2)!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[n];return!!i&&(i.ccMIDROW(e),this.logger.log(r.DEBUG,"MIDROW ("+f([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var n,r=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127||(16===t||24===t)&&e>=64&&e<=95))return!1;if(S(t,e,r))return x(null,null,r),!0;var i=t<=23?1:2;n=e>=64&&e<=95?1===i?s[t]:c[t]:1===i?l[t]:u[t];var a=this.channels[i];return!!a&&(a.setPAC(this.interpretPAC(n,e)),x(t,e,r),this.currentChannel=i,!0)},e.interpretPAC=function(t,e){var n,r={color:null,italics:!1,indent:null,underline:!1,row:t};return n=e>95?e-96:e-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},e.parseChars=function(t,e){var n,i,a=null,s=null;if(t>=25?(n=2,s=t-8):(n=1,s=t),s>=17&&s<=19?(i=17===s?e+80:18===s?e+112:e+144,this.logger.log(r.INFO,"Special char '"+o(i)+"' in channel "+n),a=[i]):t>=32&&t<=127&&(a=0===e?[t]:[t,e]),a){var l=f(a);this.logger.log(r.DEBUG,"Char codes = "+l.join(",")),x(t,e,this.cmdHistory)}return a},e.parseBackgroundAttributes=function(t,e){var n;if(!((16===t||24===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=45&&e<=47))return!1;var r={};16===t||24===t?(n=Math.floor((e-32)/2),r.background=h[n],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0));var i=t<=23?1:2;return this.channels[i].setBkgData(r),x(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var e=this.channels[t];e&&e.reset()}this.cmdHistory={a:null,b:null}},e.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++){var n=this.channels[e];n&&n.cueSplitAtTime(t)}},t}();function x(t,e,n){n.a=t,n.b=e}function S(t,e,n){return n.a===t&&n.b===e}e.default=b},"./src/utils/codecs.ts":
/*!*****************************!*\
!*** ./src/utils/codecs.ts ***!
\*****************************/
/*! exports provided: isCodecType, isCodecSupportedInMp4 */function(t,e,n){"use strict";n.r(e),n.d(e,"isCodecType",(function(){return i})),n.d(e,"isCodecSupportedInMp4",(function(){return a}));var r={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function i(t,e){var n=r[e];return!!n&&!0===n[t.slice(0,4)]}function a(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}},"./src/utils/cues.ts":
/*!***************************!*\
!*** ./src/utils/cues.ts ***!
\***************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ./vttparser */"./src/utils/vttparser.ts"),i=n(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts"),a=n(/*! ./texttrack-utils */"./src/utils/texttrack-utils.ts"),o=/\s/,s={newCue:function(t,e,n,s){for(var l,c,u,h,d,f=[],p=self.VTTCue||self.TextTrackCue,g=0;g<s.rows.length;g++)if(u=!0,h=0,d="",!(l=s.rows[g]).isEmpty()){for(var m=0;m<l.chars.length;m++)o.test(l.chars[m].uchar)&&u?h++:(d+=l.chars[m].uchar,u=!1);l.cueStartTime=e,e===n&&(n+=1e-4),h>=16?h--:h++;var v=Object(r.fixLineBreaks)(d.trim()),y=Object(i.generateCueId)(e,n,v);t&&t.cues&&t.cues.getCueById(y)||((c=new p(e,n,v)).id=y,c.line=g+1,c.align="left",c.position=10+Math.min(80,10*Math.floor(8*h/32)),f.push(c))}return t&&f.length&&(f.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),f.forEach((function(e){return Object(a.addCueToTrack)(t,e)}))),f}};e.default=s},"./src/utils/discontinuities.ts":
/*!**************************************!*\
!*** ./src/utils/discontinuities.ts ***!
\**************************************/
/*! exports provided: findFirstFragWithCC, shouldAlignOnDiscontinuities, findDiscontinuousReferenceFrag, adjustSlidingStart, alignStream, alignPDT, alignFragmentByPDTDelta, alignMediaPlaylistByPDT */function(t,e,n){"use strict";n.r(e),n.d(e,"findFirstFragWithCC",(function(){return o})),n.d(e,"shouldAlignOnDiscontinuities",(function(){return s})),n.d(e,"findDiscontinuousReferenceFrag",(function(){return l})),n.d(e,"adjustSlidingStart",(function(){return u})),n.d(e,"alignStream",(function(){return h})),n.d(e,"alignPDT",(function(){return d})),n.d(e,"alignFragmentByPDTDelta",(function(){return f})),n.d(e,"alignMediaPlaylistByPDT",(function(){return p}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./logger */"./src/utils/logger.ts"),a=n(/*! ../controller/level-helper */"./src/controller/level-helper.ts");function o(t,e){for(var n=null,r=0,i=t.length;r<i;r++){var a=t[r];if(a&&a.cc===e){n=a;break}}return n}function s(t,e,n){return!(!e.details||!(n.endCC>n.startCC||t&&t.cc<n.startCC))}function l(t,e){var n=t.fragments,r=e.fragments;if(r.length&&n.length){var a=o(n,r[0].cc);if(a&&(!a||a.startPTS))return a;i.logger.log("No frag in previous level to align on")}else i.logger.log("No fragments to align")}function c(t,e){if(t){var n=t.start+e;t.start=t.startPTS=n,t.endPTS=n+t.duration}}function u(t,e){for(var n=e.fragments,r=0,i=n.length;r<i;r++)c(n[r],t);e.fragmentHint&&c(e.fragmentHint,t),e.alignedSliding=!0}function h(t,e,n){e&&(function(t,e,n){if(s(t,n,e)){var a=l(n.details,e);a&&Object(r.isFiniteNumber)(a.start)&&(i.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),u(a.start,e))}}(t,n,e),!n.alignedSliding&&e.details&&d(n,e.details),n.alignedSliding||!e.details||n.skippedSegments||Object(a.adjustSliding)(e.details,n))}function d(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var n=e.fragments[0].programDateTime,a=t.fragments[0].programDateTime,o=(a-n)/1e3+e.fragments[0].start;o&&Object(r.isFiniteNumber)(o)&&(i.logger.log("Adjusting PTS using programDateTime delta "+(a-n)+"ms, sliding:"+o.toFixed(3)+" "+t.url+" "),u(o,t))}}function f(t,e){var n=t.programDateTime;if(n){var r=(n-e)/1e3;t.start=t.startPTS=r,t.endPTS=r+t.duration}}function p(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var n=e.fragments[0].programDateTime-1e3*e.fragments[0].start;t.fragments.forEach((function(t){f(t,n)})),t.fragmentHint&&f(t.fragmentHint,n),t.alignedSliding=!0}}},"./src/utils/ewma-bandwidth-estimator.ts":
/*!***********************************************!*\
!*** ./src/utils/ewma-bandwidth-estimator.ts ***!
\***********************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../utils/ewma */"./src/utils/ewma.ts"),i=function(){function t(t,e,n){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new r.default(t),this.fast_=new r.default(e)}var e=t.prototype;return e.update=function(t,e){var n=this.slow_,i=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new r.default(t,n.getEstimate(),n.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new r.default(e,i.getEstimate(),i.getTotalWeight()))},e.sample=function(t,e){var n=(t=Math.max(t,this.minDelayMs_))/1e3,r=8*e/n;this.fast_.sample(n,r),this.slow_.sample(n,r)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();e.default=i},"./src/utils/ewma.ts":
/*!***************************!*\
!*** ./src/utils/ewma.ts ***!
\***************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=function(){function t(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=n}var e=t.prototype;return e.sample=function(t,e){var n=Math.pow(this.alpha_,t);this.estimate_=e*(1-n)+n*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}();e.default=r},"./src/utils/fetch-loader.ts":
/*!***********************************!*\
!*** ./src/utils/fetch-loader.ts ***!
\***********************************/
/*! exports provided: fetchSupported, default */function(t,e,n){"use strict";n.r(e),n.d(e,"fetchSupported",(function(){return d}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),a=n(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts");function o(t){var e="function"==typeof Map?new Map:void 0;return(o=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return s(t,arguments,u(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,t)})(t)}function s(t,e,n){return(s=l()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&c(i,n.prototype),i}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var f=function(){function t(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||p,this.controller=new self.AbortController,this.stats=new i.LoadStats}var e=t.prototype;return e.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},e.abortInternal=function(){var t=this.response;t&&t.ok||(this.stats.aborted=!0,this.controller.abort())},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},e.load=function(t,e,n){var i=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var o=function(t,e){var n={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(h({},t.headers))};return t.rangeEnd&&n.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),n}(t,this.controller.signal),s=n.onProgress,l="arraybuffer"===t.responseType,c=l?"byteLength":"length";this.context=t,this.config=e,this.callbacks=n,this.request=this.fetchSetup(t,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){i.abortInternal(),n.onTimeout(a,t,i.response)}),e.timeout),self.fetch(this.request).then((function(n){if(i.response=i.loader=n,!n.ok){var o=n.status,c=n.statusText;throw new g(c||"fetch, bad network response",o,n)}return a.loading.first=Math.max(self.performance.now(),a.loading.start),a.total=parseInt(n.headers.get("Content-Length")||"0"),s&&Object(r.isFiniteNumber)(e.highWaterMark)?i.loadProgressively(n,a,t,e.highWaterMark,s):l?n.arrayBuffer():n.text()})).then((function(o){var l=i.response;self.clearTimeout(i.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first),a.loaded=a.total=o[c];var u={url:l.url,data:o};s&&!Object(r.isFiniteNumber)(e.highWaterMark)&&s(a,t,o,l),n.onSuccess(u,a,t,l)})).catch((function(e){if(self.clearTimeout(i.requestTimeout),!a.aborted){var r=e.code||0;n.onError({code:r,text:e.message},t,e.details)}}))},e.getCacheAge=function(){var t=null;if(this.response){var e=this.response.headers.get("age");t=e?parseFloat(e):null}return t},e.loadProgressively=function(t,e,n,r,i){void 0===r&&(r=0);var o=new a.default,s=t.body.getReader();return function a(){return s.read().then((function(s){if(s.done)return o.dataLength&&i(e,n,o.flush(),t),Promise.resolve(new ArrayBuffer(0));var l=s.value,c=l.length;return e.loaded+=c,c<r||o.dataLength?(o.push(l),o.dataLength>=r&&i(e,n,o.flush(),t)):i(e,n,l,t),a()})).catch((function(){return Promise.reject()}))}()},t}();function p(t,e){return new self.Request(t.url,e)}var g=function(t){var e,n;function r(e,n,r){var i;return(i=t.call(this,e)||this).code=void 0,i.details=void 0,i.code=n,i.details=r,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,c(e,n),r}(o(Error));e.default=f},"./src/utils/imsc1-ttml-parser.ts":
/*!****************************************!*\
!*** ./src/utils/imsc1-ttml-parser.ts ***!
\****************************************/
/*! exports provided: IMSC1_CODEC, parseIMSC1 */function(t,e,n){"use strict";n.r(e),n.d(e,"IMSC1_CODEC",(function(){return u})),n.d(e,"parseIMSC1",(function(){return p}));var r=n(/*! ./mp4-tools */"./src/utils/mp4-tools.ts"),i=n(/*! ./vttparser */"./src/utils/vttparser.ts"),a=n(/*! ./vttcue */"./src/utils/vttcue.ts"),o=n(/*! ../demux/id3 */"./src/demux/id3.ts"),s=n(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),l=n(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts");function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var u="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(t,e,n,i,u){var h=Object(r.findBox)(new Uint8Array(t),["mdat"]);if(0!==h.length){var d=h[0],p=Object(o.utf8ArrayToStr)(new Uint8Array(t,d.start,d.end-d.start)),x=Object(s.toTimescaleFromScale)(e,1,n);try{i(function(t,e){var n=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!n)throw new Error("Invalid ttml");var r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(r).reduce((function(t,e){return t[e]=n.getAttribute("ttp:"+e)||r[e],t}),{}),o="preserve"!==n.getAttribute("xml:space"),s=m(g(n,"styling","style")),u=m(g(n,"layout","region")),h=g(n,"body","[begin]");return[].map.call(h,(function(t){var n=function t(e,n){return[].slice.call(e.childNodes).reduce((function(e,r,i){var a;return"br"===r.nodeName&&i?e+"\n":null!==(a=r.childNodes)&&void 0!==a&&a.length?t(r,n):n?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent}),"")}(t,o);if(!n||!t.hasAttribute("begin"))return null;var r=b(t.getAttribute("begin"),i),h=b(t.getAttribute("dur"),i),d=b(t.getAttribute("end"),i);if(null===r)throw y(t);if(null===d){if(null===h)throw y(t);d=r+h}var p=new a.default(r-e,d-e,n);p.id=Object(l.generateCueId)(p.startTime,p.endTime,p.text);var g=u[t.getAttribute("region")],m=s[t.getAttribute("style")];p.position=10,p.size=80;var x=function(t,e){var n="http://www.w3.org/ns/ttml#styling";return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(r,i){var a=v(e,n,i)||v(t,n,i);return a&&(r[i]=a),r}),{})}(g,m),S=x.textAlign;if(S){var C=f[S];C&&(p.lineAlign=C),p.align=S}return c(p,x),p})).filter((function(t){return null!==t}))}(p,x))}catch(t){u(t)}}else u(new Error("Could not parse IMSC1 mdat"))}function g(t,e,n){var r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function m(t){return t.reduce((function(t,e){var n=e.getAttribute("xml:id");return n&&(t[n]=e),t}),{})}function v(t,e,n){return t.hasAttributeNS(e,n)?t.getAttributeNS(e,n):null}function y(t){return new Error("Could not parse ttml timestamp "+t)}function b(t,e){if(!t)return null;var n=Object(i.parseTimeStamp)(t);return null===n&&(h.test(t)?n=function(t,e){var n=h.exec(t),r=(0|n[4])+(0|n[5])/e.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/e.frameRate}(t,e):d.test(t)&&(n=function(t,e){var n=d.exec(t),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}(t,e))),n}},"./src/utils/logger.ts":
/*!*****************************!*\
!*** ./src/utils/logger.ts ***!
\*****************************/
/*! exports provided: enableLogs, logger */function(t,e,n){"use strict";n.r(e),n.d(e,"enableLogs",(function(){return s})),n.d(e,"logger",(function(){return l}));var r=function(){},i={trace:r,debug:r,log:r,warn:r,info:r,error:r},a=i;function o(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):r}function s(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];n.forEach((function(e){a[e]=t[e]?t[e].bind(t):o(e)}))}(t,"debug","log","info","warn","error");try{a.log()}catch(t){a=i}}else a=i}var l=i},"./src/utils/mediakeys-helper.ts":
/*!***************************************!*\
!*** ./src/utils/mediakeys-helper.ts ***!
\***************************************/
/*! exports provided: KeySystems, requestMediaKeySystemAccess */function(t,e,n){"use strict";var r;n.r(e),n.d(e,"KeySystems",(function(){return r})),n.d(e,"requestMediaKeySystemAccess",(function(){return i})),function(t){t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready"}(r||(r={}));var i="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null},"./src/utils/mediasource-helper.ts":
/*!*****************************************!*\
!*** ./src/utils/mediasource-helper.ts ***!
\*****************************************/
/*! exports provided: getMediaSource */function(t,e,n){"use strict";function r(){return self.MediaSource||self.WebKitMediaSource}n.r(e),n.d(e,"getMediaSource",(function(){return r}))},"./src/utils/mp4-tools.ts":
/*!********************************!*\
!*** ./src/utils/mp4-tools.ts ***!
\********************************/
/*! exports provided: bin2str, readUint16, readUint32, writeUint32, findBox, parseSegmentIndex, parseInitSegment, getStartDTS, getDuration, computeRawDurationFromSamples, offsetStartDTS, segmentValidRange, appendUint8Array */function(t,e,n){"use strict";n.r(e),n.d(e,"bin2str",(function(){return s})),n.d(e,"readUint16",(function(){return l})),n.d(e,"readUint32",(function(){return c})),n.d(e,"writeUint32",(function(){return u})),n.d(e,"findBox",(function(){return h})),n.d(e,"parseSegmentIndex",(function(){return d})),n.d(e,"parseInitSegment",(function(){return f})),n.d(e,"getStartDTS",(function(){return p})),n.d(e,"getDuration",(function(){return g})),n.d(e,"computeRawDurationFromSamples",(function(){return m})),n.d(e,"offsetStartDTS",(function(){return v})),n.d(e,"segmentValidRange",(function(){return y})),n.d(e,"appendUint8Array",(function(){return b}));var r=n(/*! ./typed-array */"./src/utils/typed-array.ts"),i=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),a=Math.pow(2,32)-1,o=[].push;function s(t){return String.fromCharCode.apply(null,t)}function l(t,e){"data"in t&&(e+=t.start,t=t.data);var n=t[e]<<8|t[e+1];return n<0?65536+n:n}function c(t,e){"data"in t&&(e+=t.start,t=t.data);var n=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return n<0?4294967296+n:n}function u(t,e,n){"data"in t&&(e+=t.start,t=t.data),t[e]=n>>24,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n}function h(t,e){var n,r,i,a=[];if(!e.length)return a;"data"in t?(n=t.data,r=t.start,i=t.end):(r=0,i=(n=t).byteLength);for(var l=r;l<i;){var u=c(n,l),d=u>1?l+u:i;if(s(n.subarray(l+4,l+8))===e[0])if(1===e.length)a.push({data:n,start:l+8,end:d});else{var f=h({data:n,start:l+8,end:d},e.slice(1));f.length&&o.apply(a,f)}l=d}return a}function d(t){var e=h(t,["moov"])[0],n=e?e.end:null,r=h(t,["sidx"]);if(!r||!r[0])return null;var i=[],a=r[0],o=a.data[0],s=0===o?8:16,u=c(a,s);s+=4,s+=0===o?8:16,s+=2;var d=a.end+0,f=l(a,s);s+=2;for(var p=0;p<f;p++){var g=s,m=c(a,g);g+=4;var v=2147483647&m;if(1==(2147483648&m)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var y=c(a,g);g+=4,i.push({referenceSize:v,subsegmentDuration:y,info:{duration:y/u,start:d,end:d+v-1}}),d+=v,s=g+=4}return{earliestPresentationTime:0,timescale:u,version:o,referencesCount:f,references:i,moovEndOffset:n}}function f(t){for(var e=[],n=h(t,["moov","trak"]),r=0;r<n.length;r++){var a=n[r],o=h(a,["tkhd"])[0];if(o){var l=o.data[o.start],u=0===l?12:20,d=c(o,u),f=h(a,["mdia","mdhd"])[0];if(f){var p=c(f,u=0===(l=f.data[f.start])?12:20),g=h(a,["mdia","hdlr"])[0];if(g){var m=s(g.data.subarray(g.start+8,g.start+12)),v={soun:i.ElementaryStreamTypes.AUDIO,vide:i.ElementaryStreamTypes.VIDEO}[m];if(v){var y=h(a,["mdia","minf","stbl","stsd"])[0],b=void 0;y&&(b=s(y.data.subarray(y.start+12,y.start+16))),e[d]={timescale:p,type:v},e[v]={timescale:p,id:d,codec:b}}}}}}return h(t,["moov","mvex","trex"]).forEach((function(t){var n=c(t,4),r=e[n];r&&(r.default={duration:c(t,12),flags:c(t,20)})})),e}function p(t,e){return h(e,["moof","traf"]).reduce((function(e,n){var r=h(n,["tfdt"])[0],i=r.data[r.start],a=h(n,["tfhd"]).reduce((function(e,n){var a=c(n,4),o=t[a];if(o){var s=c(r,4);1===i&&(s*=Math.pow(2,32),s+=c(r,8));var l=s/(o.timescale||9e4);if(isFinite(l)&&(null===e||l<e))return l}return e}),null);return null!==a&&isFinite(a)&&(null===e||a<e)?a:e}),null)||0}function g(t,e){for(var n=0,r=0,a=0,o=h(t,["moof","traf"]),s=0;s<o.length;s++){var l=o[s],u=h(l,["tfhd"])[0],f=e[c(u,4)];if(f){var p=f.default,g=c(u,0)|(null==p?void 0:p.flags),v=null==p?void 0:p.duration;8&g&&(v=c(u,2&g?12:8));for(var y=f.timescale||9e4,b=h(l,["trun"]),x=0;x<b.length;x++)n=v?v*c(b[x],4):m(b[x]),f.type===i.ElementaryStreamTypes.VIDEO?r+=n/y:f.type===i.ElementaryStreamTypes.AUDIO&&(a+=n/y)}}if(0===r&&0===a){var S=d(t);if(null!=S&&S.references)return S.references.reduce((function(t,e){return t+e.info.duration||0}),0)}return r||a}function m(t){var e=c(t,0),n=8;1&e&&(n+=4),4&e&&(n+=4);for(var r=0,i=c(t,4),a=0;a<i;a++)256&e&&(r+=c(t,n),n+=4),512&e&&(n+=4),1024&e&&(n+=4),2048&e&&(n+=4);return r}function v(t,e,n){h(e,["moof","traf"]).forEach((function(e){h(e,["tfhd"]).forEach((function(r){var i=c(r,4),o=t[i];if(o){var s=o.timescale||9e4;h(e,["tfdt"]).forEach((function(t){var e=t.data[t.start],r=c(t,4);if(0===e)u(t,4,r-n*s);else{r*=Math.pow(2,32),r+=c(t,8),r-=n*s,r=Math.max(r,0);var i=Math.floor(r/(a+1)),o=Math.floor(r%(a+1));u(t,4,i),u(t,8,o)}}))}}))}))}function y(t){var e={valid:null,remainder:null},n=h(t,["moof"]);if(!n)return e;if(n.length<2)return e.remainder=t,e;var i=n[n.length-1];return e.valid=Object(r.sliceUint8)(t,0,i.start-8),e.remainder=Object(r.sliceUint8)(t,i.start-8),e}function b(t,e){var n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}},"./src/utils/output-filter.ts":
/*!************************************!*\
!*** ./src/utils/output-filter.ts ***!
\************************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var r=function(){function t(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}var e=t.prototype;return e.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},e.newCue=function(t,e,n){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[]},t}()},"./src/utils/texttrack-utils.ts":
/*!**************************************!*\
!*** ./src/utils/texttrack-utils.ts ***!
\**************************************/
/*! exports provided: sendAddTrackEvent, addCueToTrack, clearCurrentCues, removeCuesInRange, getCuesInRange */function(t,e,n){"use strict";n.r(e),n.d(e,"sendAddTrackEvent",(function(){return i})),n.d(e,"addCueToTrack",(function(){return a})),n.d(e,"clearCurrentCues",(function(){return o})),n.d(e,"removeCuesInRange",(function(){return s})),n.d(e,"getCuesInRange",(function(){return l}));var r=n(/*! ./logger */"./src/utils/logger.ts");function i(t,e){var n;try{n=new Event("addtrack")}catch(t){(n=document.createEvent("Event")).initEvent("addtrack",!1,!1)}n.track=t,e.dispatchEvent(n)}function a(t,e){var n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(n){r.logger.debug("[texttrack-utils]: "+n);var i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}"disabled"===n&&(t.mode=n)}function o(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var n=t.cues.length;n--;)t.removeCue(t.cues[n]);"disabled"===e&&(t.mode=e)}function s(t,e,n){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var i=l(t.cues,e,n),a=0;a<i.length;a++)t.removeCue(i[a]);"disabled"===r&&(t.mode=r)}function l(t,e,n){var r=[],i=function(t,e){if(e<t[0].startTime)return 0;var n=t.length-1;if(e>t[n].endTime)return-1;for(var r=0,i=n;r<=i;){var a=Math.floor((i+r)/2);if(e<t[a].startTime)i=a-1;else{if(!(e>t[a].startTime&&r<n))return a;r=a+1}}return t[r].startTime-e<e-t[i].startTime?r:i}(t,e);if(i>-1)for(var a=i,o=t.length;a<o;a++){var s=t[a];if(s.startTime>=e&&s.endTime<=n)r.push(s);else if(s.startTime>n)return r}return r}},"./src/utils/time-ranges.ts":
/*!**********************************!*\
!*** ./src/utils/time-ranges.ts ***!
\**********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),e.default={toString:function(t){for(var e="",n=t.length,r=0;r<n;r++)e+="["+t.start(r).toFixed(3)+","+t.end(r).toFixed(3)+"]";return e}}},"./src/utils/timescale-conversion.ts":
/*!*******************************************!*\
!*** ./src/utils/timescale-conversion.ts ***!
\*******************************************/
/*! exports provided: toTimescaleFromBase, toTimescaleFromScale, toMsFromMpegTsClock, toMpegTsClockFromTimescale */function(t,e,n){"use strict";function r(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=!1);var i=t*e*n;return r?Math.round(i):i}function i(t,e,n,i){return void 0===n&&(n=1),void 0===i&&(i=!1),r(t,e,1/n,i)}function a(t,e){return void 0===e&&(e=!1),r(t,1e3,1/9e4,e)}function o(t,e){return void 0===e&&(e=1),r(t,9e4,1/e)}n.r(e),n.d(e,"toTimescaleFromBase",(function(){return r})),n.d(e,"toTimescaleFromScale",(function(){return i})),n.d(e,"toMsFromMpegTsClock",(function(){return a})),n.d(e,"toMpegTsClockFromTimescale",(function(){return o}))},"./src/utils/typed-array.ts":
/*!**********************************!*\
!*** ./src/utils/typed-array.ts ***!
\**********************************/
/*! exports provided: sliceUint8 */function(t,e,n){"use strict";function r(t,e,n){return Uint8Array.prototype.slice?t.slice(e,n):new Uint8Array(Array.prototype.slice.call(t,e,n))}n.r(e),n.d(e,"sliceUint8",(function(){return r}))},"./src/utils/vttcue.ts":
/*!*****************************!*\
!*** ./src/utils/vttcue.ts ***!
\*****************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),e.default=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function n(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var n=e.toLowerCase();return!!~t.indexOf(n)&&n}function r(t){return n(e,t)}function i(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var o in a)t[o]=a[o]}return t}function a(e,a,o){var s=this,l={enumerable:!0};s.hasBeenReset=!1;var c="",u=!1,h=e,d=a,f=o,p=null,g="",m=!0,v="auto",y="start",b=50,x="middle",S=50,C="middle";Object.defineProperty(s,"id",i({},l,{get:function(){return c},set:function(t){c=""+t}})),Object.defineProperty(s,"pauseOnExit",i({},l,{get:function(){return u},set:function(t){u=!!t}})),Object.defineProperty(s,"startTime",i({},l,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",i({},l,{get:function(){return d},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",i({},l,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",i({},l,{get:function(){return p},set:function(t){p=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",i({},l,{get:function(){return g},set:function(e){var r=function(e){return n(t,e)}(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");g=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",i({},l,{get:function(){return m},set:function(t){m=!!t,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",i({},l,{get:function(){return v},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",i({},l,{get:function(){return y},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",i({},l,{get:function(){return b},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},l,{get:function(){return x},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");x=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},l,{get:function(){return S},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");S=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},l,{get:function(){return C},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");C=e,this.hasBeenReset=!0}})),s.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts":
/*!********************************!*\
!*** ./src/utils/vttparser.ts ***!
\********************************/
/*! exports provided: parseTimeStamp, fixLineBreaks, VTTParser */function(t,e,n){"use strict";n.r(e),n.d(e,"parseTimeStamp",(function(){return a})),n.d(e,"fixLineBreaks",(function(){return h})),n.d(e,"VTTParser",(function(){return d}));var r=n(/*! ./vttcue */"./src/utils/vttcue.ts"),i=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function a(t){function e(t,e,n,r){return 3600*(0|t)+60*(0|e)+(0|n)+parseFloat(r||0)}var n=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?e(n[2],n[3],0,n[4]):e(n[1],n[2],n[3],n[4]):null}var o=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,n){for(var r=0;r<n.length;++r)if(e===n[r]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var n=parseFloat(e);if(n>=0&&n<=100)return this.set(t,n),!0}return!1},t}();function s(t,e,n,r){var i=r?t.split(r):[t];for(var a in i)if("string"==typeof i[a]){var o=i[a].split(n);2===o.length&&e(o[0],o[1])}}var l=new r.default(0,0,""),c="middle"===l.align?"middle":"center";function u(t,e,n){var r=t;function i(){var e=a(t);if(null===e)throw new Error("Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function u(){t=t.replace(/^\s+/,"")}if(u(),e.startTime=i(),u(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.substr(3),u(),e.endTime=i(),u(),function(t,e){var r=new o;s(t,(function(t,e){var i;switch(t){case"region":for(var a=n.length-1;a>=0;a--)if(n[a].id===e){r.set(t,n[a].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":i=e.split(","),r.integer(t,i[0]),r.percent(t,i[0])&&r.set("snapToLines",!1),r.alt(t,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",c,"end"]);break;case"position":i=e.split(","),r.percent(t,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",c,"end","left","right"])}}),/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");var i=r.get("line","auto");"auto"===i&&-1===l.line&&(i=-1),e.line=i,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",c);var a=r.get("position","auto");"auto"===a&&50===l.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function h(t){return t.replace(/<br(?: \/)?>/gi,"\n")}var d=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new i,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function n(){var t=e.buffer,n=0;for(t=h(t);n<t.length&&"\r"!==t[n]&&"\n"!==t[n];)++n;var r=t.substr(0,n);return"\r"===t[n]&&++n,"\n"===t[n]&&++n,e.buffer=t.substr(n),r}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var i="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var a=(i=n()).match(/^()?WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var o=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(o?o=!1:i=n(),e.state){case"HEADER":/:/.test(i)?s(i,(function(t,e){}),/:/):i||(e.state="ID");continue;case"NOTE":i||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){e.state="NOTE";break}if(!i)continue;if(e.cue=new r.default(0,0,""),e.state="CUE",-1===i.indexOf("--\x3e")){e.cue.id=i;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{u(i,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var l=-1!==i.indexOf("--\x3e");if(!i||l&&(o=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=i;continue;case"BADCUE":i||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(t){this.onparsingerror&&this.onparsingerror(t)}return this.onflush&&this.onflush(),this},t}()},"./src/utils/webvtt-parser.ts":
/*!************************************!*\
!*** ./src/utils/webvtt-parser.ts ***!
\************************************/
/*! exports provided: generateCueId, parseWebVTT */function(t,e,n){"use strict";n.r(e),n.d(e,"generateCueId",(function(){return h})),n.d(e,"parseWebVTT",(function(){return d}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./vttparser */"./src/utils/vttparser.ts"),a=n(/*! ../demux/id3 */"./src/demux/id3.ts"),o=n(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),s=n(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),l=/\r\n|\n\r|\n|\r/g,c=function(t,e,n){return void 0===n&&(n=0),t.substr(n,e.length)===e},u=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return(e>>>0).toString()};function h(t,e,n){return u(t.toString())+u(e.toString())+u(n)}function d(t,e,n,u,d,f,p,g){var m,v=new i.VTTParser,y=Object(a.utf8ArrayToStr)(new Uint8Array(t)).trim().replace(l,"\n").split("\n"),b=[],x=Object(o.toMpegTsClockFromTimescale)(e,n),S="00:00.000",C=0,E=0,w=!0,k=!1;v.oncue=function(t){var e=u[d],n=u.ccOffset,r=(C-x)/9e4;if(null!=e&&e.new&&(void 0!==E?n=u.ccOffset=e.start:function(t,e,n){var r=t[e],i=t[r.prevCC];if(!i||!i.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!==(a=i)&&void 0!==a&&a.new;){var a;t.ccOffset+=r.start-i.start,r.new=!1,i=t[(r=i).prevCC]}t.presentationOffset=n}(u,d,r)),r&&(n=r-u.presentationOffset),k){var i=t.endTime-t.startTime,a=Object(s.normalizePts)(9e4*(t.startTime+n-E),9e4*f)/9e4;t.startTime=a,t.endTime=a+i}var o=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(o)),t.id||(t.id=h(t.startTime,t.endTime,o)),t.endTime>0&&b.push(t)},v.onparsingerror=function(t){m=t},v.onflush=function(){m?g(m):p(b)},y.forEach((function(t){if(w){if(c(t,"X-TIMESTAMP-MAP=")){w=!1,k=!0,t.substr(16).split(",").forEach((function(t){c(t,"LOCAL:")?S=t.substr(6):c(t,"MPEGTS:")&&(C=parseInt(t.substr(7)))}));try{E=function(t){var e=parseInt(t.substr(-3)),n=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),a=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(r.isFiniteNumber)(e)&&Object(r.isFiniteNumber)(n)&&Object(r.isFiniteNumber)(i)&&Object(r.isFiniteNumber)(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*n,e+=6e4*i,e+=36e5*a}(S)/1e3}catch(t){k=!1,m=t}return}""===t&&(w=!1)}v.parse(t+"\n")})),v.flush()}},"./src/utils/xhr-loader.ts":
/*!*********************************!*\
!*** ./src/utils/xhr-loader.ts ***!
\*********************************/
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=n(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),a=/^age:\s*[\d.]+\s*$/m,o=function(){function t(t){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=t?t.xhrSetup:null,this.stats=new i.LoadStats,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(t,e,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=n,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t=this.config,e=this.context;if(t){var n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(n,e.url)}catch(t){n.open("GET",e.url,!0),i(n,e.url)}n.readyState||n.open("GET",e.url,!0);var a=this.context.headers;if(a)for(var o in a)n.setRequestHeader(o,a[o])}catch(t){return void this.callbacks.onError({code:n.status,text:t.message},e,n)}e.rangeEnd&&n.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=e.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),n.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,n=this.stats;if(t&&e){var i=e.readyState,a=this.config;if(!n.aborted&&i>=2)if(self.clearTimeout(this.requestTimeout),0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),4===i){e.onreadystatechange=null,e.onprogress=null;var o=e.status;if(o>=200&&o<300){var s,l;if(n.loading.end=Math.max(self.performance.now(),n.loading.first),l="arraybuffer"===t.responseType?(s=e.response).byteLength:(s=e.responseText).length,n.loaded=n.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(n,t,s,e),!this.callbacks)return;var u={url:e.responseURL,data:s};this.callbacks.onSuccess(u,n,t,e)}else n.retry>=a.maxRetry||o>=400&&o<499?(r.logger.error(o+" while loading "+t.url),this.callbacks.onError({code:o,text:e.statusText},t,e)):(r.logger.warn(o+" while loading "+t.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,a.maxRetryDelay),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)}},e.loadtimeout=function(){r.logger.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&a.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();e.default=o}}).default},t.exports=r())},vHTk:
/*!******************************************************!*\
!*** ./src/components/PreviewAll/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:
/*!********************************************************!*\
!*** ./node_modules/rc-table/es/Table.js + 17 modules ***!
\********************************************************/
/*! exports provided: INTERNAL_HOOKS, default */
/*! exports used: INTERNAL_HOOKS, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/raf/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-resize-observer/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/Cell/index.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/Footer/index.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/context/TableContext.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/hooks/useColumns.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/sugar/Column.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/sugar/ColumnGroup.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/utils/legacyUtil.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/utils/valueUtil.js because of ./node_modules/antd/es/table/Table.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/addEventListener.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/css.js because of ./node_modules/rc-image/es/Image.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/getScrollBarSize.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return Z}));var r=n("rePB"),i=n("VTBJ"),a=n("KQm4"),o=n("U8pU"),s=n("ODXe"),l=n("q1tI"),c=n("TSYQ"),u=n.n(c),h=n("Gytx"),d=n.n(h),f=n("Kwbf"),p=n("t23M"),g=n("qx4F"),m=n("6eGT"),v=n("IBYe"),y=n("Ff2n"),b=n("c+Xe"),x=n("fyJ8"),S=n("biw7");function C(t,e,n,r,i){var a,o,s=n[t]||{},l=n[e]||{};"left"===s.fixed?a=r.left[t]:"right"===l.fixed&&(o=r.right[e]);var c=!1,u=!1,h=!1,d=!1,f=n[e+1],p=n[t-1];if("rtl"===i){if(void 0!==a)d=!(p&&"left"===p.fixed);else if(void 0!==o){h=!(f&&"right"===f.fixed)}}else if(void 0!==a){c=!(f&&"left"===f.fixed)}else if(void 0!==o){u=!(p&&"right"===p.fixed)}return{fixLeft:a,fixRight:o,lastFixLeft:c,firstFixRight:u,lastFixRight:h,firstFixLeft:d,isSticky:r.isSticky}}var E=n("sR1s");function w(t){var e,n=t.cells,r=t.stickyOffsets,i=t.flattenColumns,a=t.rowComponent,o=t.cellComponent,s=t.onHeaderRow,c=t.index,u=l.useContext(S.a),h=u.prefixCls,d=u.direction;s&&(e=s(n.map((function(t){return t.column})),c));var f=Object(E.a)(n.map((function(t){return t.column})));return l.createElement(a,Object.assign({},e),n.map((function(t,e){var n,a=t.column,s=C(t.colStart,t.colEnd,i,r,d);return a&&a.onHeaderCell&&(n=t.column.onHeaderCell(a)),l.createElement(x.a,Object.assign({},t,{ellipsis:a.ellipsis,align:a.align,component:o,prefixCls:h,key:f[e]},s,{additionalProps:n,rowType:"header"}))})))}w.displayName="HeaderRow";var k=w;var T=function(t){var e=t.stickyOffsets,n=t.columns,r=t.flattenColumns,i=t.onHeaderRow,a=l.useContext(S.a),o=a.prefixCls,s=a.getComponent,c=l.useMemo((function(){return function(t){var e=[];!function t(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e[i]=e[i]||[];var a=r,o=n.filter(Boolean).map((function(n){var r={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},o=1,s=n.children;return s&&s.length>0&&(o=t(s,a,i+1).reduce((function(t,e){return t+e}),0),r.hasSubColumns=!0),"colSpan"in n&&(o=n.colSpan),"rowSpan"in n&&(r.rowSpan=n.rowSpan),r.colSpan=o,r.colEnd=r.colStart+o-1,e[i].push(r),a+=o,o}));return o}(t,0);for(var n=e.length,r=function(t){e[t].forEach((function(e){"rowSpan"in e||e.hasSubColumns||(e.rowSpan=n-t)}))},i=0;i<n;i+=1)r(i);return e}(n)}),[n]),u=s(["header","wrapper"],"thead"),h=s(["header","row"],"tr"),d=s(["header","cell"],"th");return l.createElement(u,{className:"".concat(o,"-thead")},c.map((function(t,n){return l.createElement(k,{key:n,flattenColumns:r,cells:t,stickyOffsets:e,rowComponent:h,cellComponent:d,onHeaderRow:i,index:n})})))},O=n("hW8S");var A=function(t){for(var e=t.colWidths,n=t.columns,r=[],i=!1,a=(t.columCount||n.length)-1;a>=0;a-=1){var o=e[a],s=n&&n[a],c=s&&s[O.a];(o||c||i)&&(r.unshift(l.createElement("col",Object.assign({key:a,style:{width:o,minWidth:o}},c))),i=!0)}return l.createElement("colgroup",null,r)};var L=l.forwardRef((function(t,e){var n=t.noData,o=t.columns,s=t.flattenColumns,c=t.colWidths,h=t.columCount,d=t.stickyOffsets,f=t.direction,p=t.fixHeader,g=t.offsetHeader,m=t.stickyClassName,v=t.onScroll,x=Object(y.a)(t,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),C=l.useContext(S.a),E=C.prefixCls,w=C.scrollbarSize,k=C.isSticky,O=k&&!p?0:w,L=l.useRef(null),D=l.useCallback((function(t){Object(b.b)(e,t),Object(b.b)(L,t)}),[]);l.useEffect((function(){var t;function e(t){var e=t.currentTarget,n=t.deltaX;n&&(v({currentTarget:e,scrollLeft:e.scrollLeft+n}),t.preventDefault())}return null===(t=L.current)||void 0===t||t.addEventListener("wheel",e),function(){var t;null===(t=L.current)||void 0===t||t.removeEventListener("wheel",e)}}),[]);var R=s[s.length-1],I={fixed:R?R.fixed:null,onHeaderCell:function(){return{className:"".concat(E,"-cell-scrollbar")}}},_=Object(l.useMemo)((function(){return O?[].concat(Object(a.a)(o),[I]):o}),[O,o]),M=Object(l.useMemo)((function(){return O?[].concat(Object(a.a)(s),[I]):s}),[O,s]),N=Object(l.useMemo)((function(){var t=d.right,e=d.left;return Object(i.a)(Object(i.a)({},d),{},{left:"rtl"===f?[].concat(Object(a.a)(e.map((function(t){return t+O}))),[0]):e,right:"rtl"===f?t:[].concat(Object(a.a)(t.map((function(t){return t+O}))),[0]),isSticky:k})}),[O,d,k]),P=function(t,e){return Object(l.useMemo)((function(){for(var n=[],r=0;r<e;r+=1){var i=t[r];if(void 0===i)return null;n[r]=i}return n}),[t.join("_"),e])}(c,h);return l.createElement("div",{style:Object(i.a)({overflow:"hidden"},k?{top:g}:{}),ref:D,className:u()("".concat(E,"-header"),Object(r.a)({},m,!!m))},l.createElement("table",{style:{tableLayout:"fixed",visibility:n||P?null:"hidden"}},l.createElement(A,{colWidths:P?[].concat(Object(a.a)(P),[O]):[],columCount:h+1,columns:M}),l.createElement(T,Object.assign({},x,{stickyOffsets:N,columns:_,flattenColumns:M}))))}));L.displayName="FixedHeader";var D=L,R=l.createContext(null);var I=function(t){var e=t.prefixCls,n=t.children,r=t.component,i=t.cellComponent,a=t.fixHeader,o=t.fixColumn,s=t.horizonScroll,c=t.className,u=t.expanded,h=t.componentWidth,d=t.colSpan,f=l.useContext(S.a).scrollbarSize;return l.useMemo((function(){var t=n;return o&&(t=l.createElement("div",{style:{width:h-(a?f:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(e,"-expanded-row-fixed")},t)),l.createElement(r,{className:c,style:{display:u?null:"none"}},l.createElement(x.a,{component:i,prefixCls:e,colSpan:d},t))}),[n,r,a,s,c,u,h,d,f])};function _(t){var e=t.className,n=t.style,r=t.record,a=t.index,o=t.rowKey,c=t.getRowKey,h=t.rowExpandable,d=t.expandedKeys,f=t.onRow,p=t.indent,g=void 0===p?0:p,m=t.rowComponent,v=t.cellComponent,y=t.childrenColumnName,b=l.useContext(S.a),C=b.prefixCls,w=b.fixedInfoList,k=l.useContext(R),T=k.fixHeader,O=k.fixColumn,A=k.horizonScroll,L=k.componentWidth,D=k.flattenColumns,M=k.expandableType,N=k.expandRowByClick,P=k.onTriggerExpand,F=k.rowClassName,j=k.expandedRowClassName,B=k.indentSize,U=k.expandIcon,H=k.expandedRowRender,G=k.expandIconColumnIndex,z=l.useState(!1),W=Object(s.a)(z,2),V=W[0],K=W[1],q=d&&d.has(t.recordKey);l.useEffect((function(){q&&K(!0)}),[q]);var Y,X="row"===M&&(!h||h(r)),$="nest"===M,J=y&&r&&r[y],Z=X||$;f&&(Y=f(r,a));var Q;"string"==typeof F?Q=F:"function"==typeof F&&(Q=F(r,a,g));var tt,et,nt=Object(E.a)(D),rt=l.createElement(m,Object.assign({},Y,{"data-row-key":o,className:u()(e,"".concat(C,"-row"),"".concat(C,"-row-level-").concat(g),Q,Y&&Y.className),style:Object(i.a)(Object(i.a)({},n),Y?Y.style:null),onClick:function(t){if(N&&Z&&P(r,t),Y&&Y.onClick){for(var e,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(e=Y).onClick.apply(e,[t].concat(i))}}}),D.map((function(t,e){var n,i,o=t.render,s=t.dataIndex,c=t.className,u=nt[e],h=w[e];return e===(G||0)&&$&&(n=l.createElement(l.Fragment,null,l.createElement("span",{style:{paddingLeft:"".concat(B*g,"px")},className:"".concat(C,"-row-indent indent-level-").concat(g)}),U({prefixCls:C,expanded:q,expandable:J,record:r,onExpand:P}))),t.onCell&&(i=t.onCell(r,a)),l.createElement(x.a,Object.assign({className:c,ellipsis:t.ellipsis,align:t.align,component:v,prefixCls:C,key:u,record:r,index:a,dataIndex:s,render:o,shouldCellUpdate:t.shouldCellUpdate},h,{appendNode:n,additionalProps:i}))})));if(X&&(V||q)){var it=H(r,a,g+1,q),at=j&&j(r,a,g);tt=l.createElement(I,{expanded:q,className:u()("".concat(C,"-expanded-row"),"".concat(C,"-expanded-row-level-").concat(g+1),at),prefixCls:C,fixHeader:T,fixColumn:O,horizonScroll:A,component:m,componentWidth:L,cellComponent:v,colSpan:D.length},it)}return J&&q&&(et=(r[y]||[]).map((function(e,n){var r=c(e,n);return l.createElement(_,Object.assign({},t,{key:r,rowKey:r,record:e,recordKey:r,index:n,indent:g+1}))}))),l.createElement(l.Fragment,null,rt,tt,et)}_.displayName="BodyRow";var M=_,N=l.createContext(null);function P(t){var e=t.columnKey,n=t.onColumnResize,r=l.useRef();return l.useEffect((function(){r.current&&n(e,r.current.offsetWidth)}),[]),l.createElement(p.a,{onResize:function(t){var r=t.offsetWidth;n(e,r)}},l.createElement("td",{ref:r,style:{padding:0,border:0,height:0}},l.createElement("div",{style:{height:0,overflow:"hidden"}}," ")))}var F=l.memo((function(t){var e=t.data,n=t.getRowKey,r=t.measureColumnWidth,i=t.expandedKeys,a=t.onRow,o=t.rowExpandable,s=t.emptyNode,c=t.childrenColumnName,u=l.useContext(N).onColumnResize,h=l.useContext(S.a),d=h.prefixCls,f=h.getComponent,p=l.useContext(R),g=p.fixHeader,m=p.horizonScroll,v=p.flattenColumns,y=p.componentWidth;return l.useMemo((function(){var t,h=f(["body","wrapper"],"tbody"),p=f(["body","row"],"tr"),b=f(["body","cell"],"td");t=e.length?e.map((function(t,e){var r=n(t,e);return l.createElement(M,{key:r,rowKey:r,record:t,recordKey:r,index:e,rowComponent:p,cellComponent:b,expandedKeys:i,onRow:a,getRowKey:n,rowExpandable:o,childrenColumnName:c})})):l.createElement(I,{expanded:!0,className:"".concat(d,"-placeholder"),prefixCls:d,fixHeader:g,fixColumn:m,horizonScroll:m,component:p,componentWidth:y,cellComponent:b,colSpan:v.length},s);var x=Object(E.a)(v);return l.createElement(h,{className:"".concat(d,"-tbody")},r&&l.createElement("tr",{"aria-hidden":"true",className:"".concat(d,"-measure-row"),style:{height:0}},x.map((function(t){return l.createElement(P,{key:t,columnKey:t,onColumnResize:u})}))),t)}),[e,d,a,r,i,n,f,y,s,v])}));F.displayName="Body";var j=F,B=n("wRmb"),U=n("xEkU"),H=n.n(U);function G(t){var e=Object(l.useRef)(t),n=Object(l.useState)({}),r=Object(s.a)(n,2)[1],i=Object(l.useRef)(null),a=Object(l.useRef)([]);return Object(l.useEffect)((function(){return function(){H.a.cancel(i.current)}}),[]),[e.current,function(t){null===i.current&&(a.current=[],i.current=H()((function(){a.current.forEach((function(t){e.current=t(e.current)})),i.current=null,r({})}))),a.current.push(t)}]}var z=function(t,e,n){return Object(l.useMemo)((function(){for(var r=[],i=[],a=0,o=0,s=0;s<e;s+=1)if("rtl"===n){i[s]=o,o+=t[s]||0;var l=e-s-1;r[l]=a,a+=t[l]||0}else{r[s]=a,a+=t[s]||0;var c=e-s-1;i[c]=o,o+=t[c]||0}return{left:r,right:i}}),[t,e,n])};var W=function(t){var e=t.className,n=t.children;return l.createElement("div",{className:e},n)},V=n("n6Qo");function K(t){var e,n=t.prefixCls,i=t.record,a=t.onExpand,o=t.expanded,s=t.expandable,c="".concat(n,"-row-expand-icon");if(!s)return l.createElement("span",{className:u()(c,"".concat(n,"-row-spaced"))});return l.createElement("span",{className:u()(c,(e={},Object(r.a)(e,"".concat(n,"-row-expanded"),o),Object(r.a)(e,"".concat(n,"-row-collapsed"),!o),e)),onClick:function(t){a(i,t),t.stopPropagation()}})}var q=n("zT1h"),Y=n("y0+3"),X=l.forwardRef((function(t,e){var n,a,o=t.scrollBodyRef,c=t.onScroll,h=t.offsetScroll,d=l.useContext(S.a).prefixCls,f=(null===(n=o.current)||void 0===n?void 0:n.scrollWidth)||0,p=(null===(a=o.current)||void 0===a?void 0:a.clientWidth)||0,m=f&&p*(p/f),v=l.useRef(),y=G({scrollLeft:0,isHiddenScrollBar:!1}),b=Object(s.a)(y,2),x=b[0],C=b[1],E=l.useRef({delta:0,x:0}),w=l.useState(!1),k=Object(s.a)(w,2),T=k[0],O=k[1],A=function(){O(!1)},L=function(t){var e,n=(t||(null===(e=window)||void 0===e?void 0:e.event)).buttons;if(T&&0!==n){var r=E.current.x+t.pageX-E.current.x-E.current.delta;r<=0&&(r=0),r+m>=p&&(r=p-m),c({scrollLeft:r/p*(f+2)}),E.current.x=t.pageX}else T&&O(!1)},D=function(){var t=Object(Y.b)(o.current).top,e=t+o.current.offsetHeight,n=document.documentElement.scrollTop+window.innerHeight;e-Object(g.a)()<=n||t>=n-h?C((function(t){return Object(i.a)(Object(i.a)({},t),{},{isHiddenScrollBar:!0})})):C((function(t){return Object(i.a)(Object(i.a)({},t),{},{isHiddenScrollBar:!1})}))},R=function(t){C((function(e){return Object(i.a)(Object(i.a)({},e),{},{scrollLeft:t/f*p||0})}))};return l.useImperativeHandle(e,(function(){return{setScrollLeft:R}})),l.useEffect((function(){var t=Object(q.a)(document.body,"mouseup",A,!1),e=Object(q.a)(document.body,"mousemove",L,!1);return D(),function(){t.remove(),e.remove()}}),[m,T]),l.useEffect((function(){var t=Object(q.a)(window,"scroll",D,!1),e=Object(q.a)(window,"resize",D,!1);return function(){t.remove(),e.remove()}}),[]),l.useEffect((function(){x.isHiddenScrollBar||C((function(t){var e,n;return Object(i.a)(Object(i.a)({},t),{},{scrollLeft:o.current.scrollLeft/(null===(e=o.current)||void 0===e?void 0:e.scrollWidth)*(null===(n=o.current)||void 0===n?void 0:n.clientWidth)})}))}),[x.isHiddenScrollBar]),f<=p||!m||x.isHiddenScrollBar?null:l.createElement("div",{style:{height:Object(g.a)(),width:p,bottom:h},className:"".concat(d,"-sticky-scroll")},l.createElement("div",{onMouseDown:function(t){t.persist(),E.current.delta=t.pageX-x.scrollLeft,E.current.x=0,O(!0),t.preventDefault()},ref:v,className:u()("".concat(d,"-sticky-scroll-bar"),Object(r.a)({},"".concat(d,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(m,"px"),transform:"translate3d(".concat(x.scrollLeft,"px, 0, 0)")}}))}));var $=[],J={},Z="rc-table-internal-hook",Q=l.memo((function(t){return t.children}),(function(t,e){return!!d()(t.props,e.props)&&(t.pingLeft!==e.pingLeft||t.pingRight!==e.pingRight)}));function tt(t){var e,n=t.prefixCls,c=t.className,h=t.rowClassName,d=t.style,m=t.data,v=t.rowKey,y=t.scroll,b=t.tableLayout,x=t.direction,w=t.title,k=t.footer,L=t.summary,I=t.id,_=t.showHeader,M=t.components,P=t.emptyText,F=t.onRow,U=t.onHeaderRow,H=t.internalHooks,q=t.transformColumns,Y=t.internalRefs,tt=t.sticky,et=m||$,nt=!!et.length,rt=l.useState(0),it=Object(s.a)(rt,2),at=it[0],ot=it[1];l.useEffect((function(){ot(Object(g.a)())}));var st,lt,ct,ut=l.useMemo((function(){return Object(E.c)(M,{})}),[M]),ht=l.useCallback((function(t,e){return Object(E.b)(ut,t)||e}),[ut]),dt=l.useMemo((function(){return"function"==typeof v?v:function(t){return t&&t[v]}}),[v]),ft=Object(O.c)(t),pt=ft.expandIcon,gt=ft.expandedRowKeys,mt=ft.defaultExpandedRowKeys,vt=ft.defaultExpandAllRows,yt=ft.expandedRowRender,bt=ft.onExpand,xt=ft.onExpandedRowsChange,St=ft.expandRowByClick,Ct=ft.rowExpandable,Et=ft.expandIconColumnIndex,wt=ft.expandedRowClassName,kt=ft.childrenColumnName,Tt=ft.indentSize,Ot=pt||K,At=kt||"children",Lt=l.useMemo((function(){return yt?"row":!!(t.expandable&&H===Z&&t.expandable.__PARENT_RENDER_ICON__||et.some((function(t){return t&&"object"===Object(o.a)(t)&&t[At]})))&&"nest"}),[!!yt,et]),Dt=l.useState((function(){return mt||(vt?function(t,e,n){var r=[];return function t(i){(i||[]).forEach((function(i,a){r.push(e(i,a)),t(i[n])}))}(t),r}(et,dt,At):[])})),Rt=Object(s.a)(Dt,2),It=Rt[0],_t=Rt[1],Mt=l.useMemo((function(){return new Set(gt||It||[])}),[gt,It]),Nt=l.useCallback((function(t){var e,n=dt(t,et.indexOf(t)),r=Mt.has(n);r?(Mt.delete(n),e=Object(a.a)(Mt)):e=[].concat(Object(a.a)(Mt),[n]),_t(e),bt&&bt(!r,t),xt&&xt(e)}),[dt,Mt,et,bt,xt]),Pt=l.useState(0),Ft=Object(s.a)(Pt,2),jt=Ft[0],Bt=Ft[1],Ut=Object(B.b)(Object(i.a)(Object(i.a)(Object(i.a)({},t),ft),{},{expandable:!!yt,expandedKeys:Mt,getRowKey:dt,onTriggerExpand:Nt,expandIcon:Ot,expandIconColumnIndex:Et,direction:x}),H===Z?q:null),Ht=Object(s.a)(Ut,2),Gt=Ht[0],zt=Ht[1],Wt=l.useMemo((function(){return{columns:Gt,flattenColumns:zt}}),[Gt,zt]),Vt=l.useRef(),Kt=l.useRef(),qt=l.useRef(),Yt=l.useState(!1),Xt=Object(s.a)(Yt,2),$t=Xt[0],Jt=Xt[1],Zt=l.useState(!1),Qt=Object(s.a)(Zt,2),te=Qt[0],ee=Qt[1],ne=G(new Map),re=Object(s.a)(ne,2),ie=re[0],ae=re[1],oe=Object(E.a)(zt).map((function(t){return ie.get(t)})),se=l.useMemo((function(){return oe}),[oe.join("_")]),le=z(se,zt.length,x),ce=y&&Object(E.d)(y.y),ue=y&&Object(E.d)(y.x),he=ue&&zt.some((function(t){return t.fixed})),de=l.useRef(),fe=function(t,e){return l.useMemo((function(){var n=!!t;return{isSticky:n,stickyClassName:n?"".concat(e,"-sticky-header"):"",offsetHeader:"object"===Object(o.a)(t)&&t.offsetHeader||0,offsetScroll:"object"===Object(o.a)(t)&&t.offsetScroll||0}}),[t,e])}(tt,n),pe=fe.isSticky,ge=fe.offsetHeader,me=fe.offsetScroll,ve=fe.stickyClassName;ce&&(lt={overflowY:"scroll",maxHeight:y.y}),ue&&(st={overflowX:"auto"},ce||(lt={overflowY:"hidden"}),ct={width:!0===y.x?"auto":y.x,minWidth:"100%"});var ye=l.useCallback((function(t,e){ae((function(n){var r=new Map(n);return r.set(t,e),r}))}),[]),be=function(t){var e=Object(l.useRef)(t),n=Object(l.useRef)(null);function r(){window.clearTimeout(n.current)}return Object(l.useEffect)((function(){return r}),[]),[function(t){e.current=t,r(),n.current=window.setTimeout((function(){e.current=null,n.current=null}),100)},function(){return e.current}]}(null),xe=Object(s.a)(be,2),Se=xe[0],Ce=xe[1];function Ee(t,e){e&&("function"==typeof e?e(t):e.scrollLeft!==t&&(e.scrollLeft=t))}var we=function(t){var e,n=t.currentTarget,r=t.scrollLeft,i="number"==typeof r?r:n.scrollLeft,a=n||J;Ce()&&Ce()!==a||(Se(a),Ee(i,Kt.current),Ee(i,qt.current),Ee(i,null===(e=de.current)||void 0===e?void 0:e.setScrollLeft));if(n){var o=n.scrollWidth,s=n.clientWidth;Jt(i>0),ee(i<o-s)}},ke=function(){qt.current&&we({currentTarget:qt.current})};l.useEffect((function(){return ke}),[]),l.useEffect((function(){ue&&ke()}),[ue]),l.useEffect((function(){H===Z&&Y&&(Y.body.current=qt.current)}));var Te,Oe,Ae=ht(["table"],"table"),Le=l.useMemo((function(){return b||(he?"max-content"===y.x?"auto":"fixed":ce||zt.some((function(t){return t.ellipsis}))?"fixed":"auto")}),[ce,he,zt,b]),De={colWidths:se,columCount:zt.length,stickyOffsets:le,onHeaderRow:U,fixHeader:ce},Re=l.useMemo((function(){return nt?null:"function"==typeof P?P():P}),[nt,P]),Ie=l.createElement(j,{data:et,measureColumnWidth:ce||ue||pe,expandedKeys:Mt,rowExpandable:Ct,getRowKey:dt,onRow:F,emptyNode:Re,childrenColumnName:At}),_e=l.createElement(A,{colWidths:zt.map((function(t){return t.width})),columns:zt}),Me=L&&l.createElement(V.b,null,L(et)),Ne=ht(["body"]);ce||pe?("function"==typeof Ne?(Oe=Ne(et,{scrollbarSize:at,ref:qt,onScroll:we}),De.colWidths=zt.map((function(t,e){var n=t.width,r=e===Gt.length-1?n-at:n;return"number"!=typeof r||Number.isNaN(r)?(Object(f.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0):r}))):Oe=l.createElement("div",{style:Object(i.a)(Object(i.a)({},st),lt),onScroll:we,ref:qt,className:u()("".concat(n,"-body"))},l.createElement(Ae,{style:Object(i.a)(Object(i.a)({},ct),{},{tableLayout:Le})},_e,Ie,Me),pe&&l.createElement(X,{ref:de,offsetScroll:me,scrollBodyRef:qt,onScroll:we})),Te=l.createElement(l.Fragment,null,!1!==_&&l.createElement(D,Object.assign({noData:!et.length},De,Wt,{direction:x,offsetHeader:ge,stickyClassName:ve,ref:Kt,onScroll:we})),Oe)):Te=l.createElement("div",{style:Object(i.a)(Object(i.a)({},st),lt),className:u()("".concat(n,"-content")),onScroll:we,ref:qt},l.createElement(Ae,{style:Object(i.a)(Object(i.a)({},ct),{},{tableLayout:Le})},_e,!1!==_&&l.createElement(T,Object.assign({},De,Wt)),Ie,Me));var Pe=Object(O.b)(t),Fe=l.createElement("div",Object.assign({className:u()(n,c,(e={},Object(r.a)(e,"".concat(n,"-rtl"),"rtl"===x),Object(r.a)(e,"".concat(n,"-ping-left"),$t),Object(r.a)(e,"".concat(n,"-ping-right"),te),Object(r.a)(e,"".concat(n,"-layout-fixed"),"fixed"===b),Object(r.a)(e,"".concat(n,"-fixed-header"),ce),Object(r.a)(e,"".concat(n,"-fixed-column"),he),Object(r.a)(e,"".concat(n,"-scroll-horizontal"),ue),Object(r.a)(e,"".concat(n,"-has-fix-left"),zt[0]&&zt[0].fixed),Object(r.a)(e,"".concat(n,"-has-fix-right"),zt[zt.length-1]&&"right"===zt[zt.length-1].fixed),e)),style:d,id:I,ref:Vt},Pe),l.createElement(Q,{pingLeft:$t,pingRight:te,props:Object(i.a)(Object(i.a)({},t),{},{stickyOffsets:le,mergedExpandedKeys:Mt})},w&&l.createElement(W,{className:"".concat(n,"-title")},w(et)),l.createElement("div",{className:"".concat(n,"-container")},Te),k&&l.createElement(W,{className:"".concat(n,"-footer")},k(et))));ue&&(Fe=l.createElement(p.a,{onResize:function(t){var e=t.width;ke(),Bt(Vt.current?Vt.current.offsetWidth:e)}},Fe));var je=l.useMemo((function(){return{prefixCls:n,getComponent:ht,scrollbarSize:at,direction:x,fixedInfoList:zt.map((function(t,e){return C(e,e,zt,le,x)})),isSticky:pe}}),[n,ht,at,x,zt,le,x,pe]),Be=l.useMemo((function(){return Object(i.a)(Object(i.a)({},Wt),{},{tableLayout:Le,rowClassName:h,expandedRowClassName:wt,componentWidth:jt,fixHeader:ce,fixColumn:he,horizonScroll:ue,expandIcon:Ot,expandableType:Lt,expandRowByClick:St,expandedRowRender:yt,onTriggerExpand:Nt,expandIconColumnIndex:Et,indentSize:Tt})}),[Wt,Le,h,wt,jt,ce,he,ue,Ot,Lt,St,yt,Nt,Et,Tt]),Ue=l.useMemo((function(){return{onColumnResize:ye}}),[ye]);return l.createElement(S.a.Provider,{value:je},l.createElement(R.Provider,{value:Be},l.createElement(N.Provider,{value:Ue},Fe)))}tt.Column=v.a,tt.ColumnGroup=m.a,tt.Summary=V.a,tt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};e.b=tt},wRmb:
/*!******************************************************!*\
!*** ./node_modules/rc-table/es/hooks/useColumns.js ***!
\******************************************************/
/*! exports provided: convertChildrenToColumns, default */
/*! exports used: convertChildrenToColumns, default */function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),a=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),s=n(/*! react */"q1tI"),l=(n(/*! rc-util/es/warning */"Kwbf"),n(/*! rc-util/es/Children/toArray */"Zm9Q")),c=n(/*! ../utils/legacyUtil */"hW8S");function u(t){return Object(l.a)(t).filter((function(t){return s.isValidElement(t)})).map((function(t){var e=t.key,n=t.props,r=n.children,i=Object(o.a)(n,["children"]),s=Object(a.a)({key:e},i);return r&&(s.children=u(r)),s}))}function h(t){return t.reduce((function(t,e){var n=e.fixed,r=!0===n?"left":n,o=e.children;return o&&o.length>0?[].concat(Object(i.a)(t),Object(i.a)(h(o).map((function(t){return Object(a.a)({fixed:r},t)})))):[].concat(Object(i.a)(t),[Object(a.a)(Object(a.a)({},e),{},{fixed:r})])}),[])}e.b=function(t,e){var n=t.prefixCls,i=t.columns,l=t.children,d=t.expandable,f=t.expandedKeys,p=t.getRowKey,g=t.onTriggerExpand,m=t.expandIcon,v=t.rowExpandable,y=t.expandIconColumnIndex,b=t.direction,x=t.expandRowByClick,S=s.useMemo((function(){return i||u(l)}),[i,l]),C=s.useMemo((function(){if(d){var t,e=y||0,i=S[e],a=(t={},Object(r.a)(t,c.a,{className:"".concat(n,"-expand-icon-col")}),Object(r.a)(t,"title",""),Object(r.a)(t,"fixed",i?i.fixed:null),Object(r.a)(t,"className","".concat(n,"-row-expand-icon-cell")),Object(r.a)(t,"render",(function(t,e,r){var i=p(e,r),a=f.has(i),o=!v||v(e),l=m({prefixCls:n,expanded:a,expandable:o,record:e,onExpand:g});return x?s.createElement("span",{onClick:function(t){return t.stopPropagation()}},l):l})),t),o=S.slice();return e>=0&&o.splice(e,0,a),o}return S}),[d,S,p,f,m,b]),E=s.useMemo((function(){var t=C;return e&&(t=e(t)),t.length||(t=[{render:function(){return null}}]),t}),[e,C,b]),w=s.useMemo((function(){return"rtl"===b?function(t){return t.map((function(t){var e=t.fixed,n=Object(o.a)(t,["fixed"]),r=e;return"left"===e?r="right":"right"===e&&(r="left"),Object(a.a)({fixed:r},n)}))}(h(E)):h(E)}),[E,b]);return[E,w]}},wU8J:
/*!*********************************************!*\
!*** ./node_modules/qr.js/lib/BitBuffer.js ***!
\*********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){function n(){this.buffer=new Array,this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=n},"y0+3":
/*!********************************************!*\
!*** ./node_modules/rc-util/es/Dom/css.js ***!
\********************************************/
/*! exports provided: get, set, getOuterWidth, getOuterHeight, getDocSize, getClientSize, getScroll, getOffset */
/*! exports used: getClientSize, getOffset */function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));function r(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function i(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}},ynwM:
/*!************************************************************!*\
!*** ./node_modules/store/storages/oldFF-globalStorage.js ***!
\************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var r=n(/*! ../src/util */"MFOe").Global;t.exports={name:"oldFF-globalStorage",read:function(t){return i[t]},write:function(t,e){i[t]=e},each:a,remove:function(t){return i.removeItem(t)},clearAll:function(){a((function(t,e){delete i[t]}))}};var i=r.globalStorage;function a(t){for(var e=i.length-1;e>=0;e--){var n=i.key(e);t(i[n],n)}}}}]);